summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--.hgeol1
-rw-r--r--.hgignore16
-rw-r--r--.hgtouch3
-rw-r--r--Doc/Makefile36
-rw-r--r--Doc/README.txt23
-rw-r--r--Doc/c-api/arg.rst2
-rw-r--r--Doc/c-api/concrete.rst22
-rw-r--r--Doc/c-api/dict.rst11
-rw-r--r--Doc/c-api/exceptions.rst69
-rw-r--r--Doc/c-api/file.rst2
-rw-r--r--Doc/c-api/import.rst8
-rw-r--r--Doc/c-api/init.rst50
-rw-r--r--Doc/c-api/long.rst2
-rw-r--r--Doc/c-api/mapping.rst6
-rw-r--r--Doc/c-api/memory.rst171
-rw-r--r--Doc/c-api/module.rst11
-rw-r--r--Doc/c-api/object.rst26
-rw-r--r--Doc/c-api/tuple.rst8
-rw-r--r--Doc/c-api/type.rst10
-rw-r--r--Doc/c-api/typeobj.rst49
-rw-r--r--Doc/c-api/unicode.rst11
-rw-r--r--Doc/c-api/veryhigh.rst52
-rw-r--r--Doc/conf.py6
-rw-r--r--Doc/contents.rst12
-rw-r--r--Doc/data/refcounts.dat33
-rw-r--r--Doc/distributing/index.rst143
-rw-r--r--Doc/distutils/apiref.rst11
-rw-r--r--Doc/distutils/builtdist.rst3
-rw-r--r--Doc/distutils/index.rst6
-rw-r--r--Doc/distutils/sourcedist.rst18
-rw-r--r--Doc/extending/embedding.rst8
-rw-r--r--Doc/extending/index.rst42
-rw-r--r--Doc/extending/newtypes.rst24
-rw-r--r--Doc/faq/library.rst8
-rw-r--r--Doc/faq/programming.rst10
-rw-r--r--Doc/glossary.rst36
-rw-r--r--Doc/howto/clinic.rst1686
-rw-r--r--Doc/howto/functional.rst144
-rw-r--r--Doc/howto/index.rst1
-rw-r--r--Doc/howto/logging-cookbook.rst4
-rw-r--r--Doc/howto/logging.rst4
-rw-r--r--Doc/howto/regex.rst24
-rw-r--r--Doc/howto/urllib2.rst2
-rw-r--r--Doc/includes/email-alternative-new-api.py56
-rw-r--r--Doc/includes/email-dir.py86
-rw-r--r--Doc/includes/email-read-alternative-new-api.py74
-rw-r--r--Doc/includes/email-unpack.py45
-rw-r--r--Doc/includes/mp_benchmarks.py239
-rw-r--r--Doc/includes/mp_newtype.py14
-rw-r--r--Doc/includes/mp_pool.py337
-rw-r--r--Doc/includes/mp_synchronize.py278
-rw-r--r--Doc/includes/mp_webserver.py70
-rw-r--r--Doc/includes/mp_workers.py13
-rw-r--r--Doc/includes/typestruct.h7
-rw-r--r--Doc/install/index.rst6
-rw-r--r--Doc/installing/index.rst210
-rw-r--r--Doc/library/2to3.rst37
-rw-r--r--Doc/library/abc.rst38
-rw-r--r--Doc/library/aifc.rst19
-rw-r--r--Doc/library/argparse.rst23
-rw-r--r--Doc/library/asynchat.rst5
-rw-r--r--Doc/library/asyncio-dev.rst251
-rw-r--r--Doc/library/asyncio-eventloop.rst742
-rw-r--r--Doc/library/asyncio-protocol.rst502
-rw-r--r--Doc/library/asyncio-stream.rst278
-rw-r--r--Doc/library/asyncio-subprocess.rst176
-rw-r--r--Doc/library/asyncio-sync.rst410
-rw-r--r--Doc/library/asyncio-task.rst545
-rw-r--r--Doc/library/asyncio.rst59
-rw-r--r--Doc/library/asyncore.rst5
-rw-r--r--Doc/library/audioop.rst29
-rw-r--r--Doc/library/base64.rst104
-rw-r--r--Doc/library/bz2.rst15
-rw-r--r--Doc/library/cgi.rst13
-rw-r--r--Doc/library/code.rst5
-rw-r--r--Doc/library/codecs.rst156
-rw-r--r--Doc/library/collections.abc.rst2
-rw-r--r--Doc/library/collections.rst26
-rw-r--r--Doc/library/concurrency.rst1
-rw-r--r--Doc/library/concurrent.futures.rst3
-rw-r--r--Doc/library/contextlib.rst227
-rw-r--r--Doc/library/curses.rst2
-rw-r--r--Doc/library/datatypes.rst1
-rw-r--r--Doc/library/datetime.rst10
-rw-r--r--Doc/library/dbm.rst38
-rw-r--r--Doc/library/debug.rst1
-rw-r--r--Doc/library/development.rst1
-rw-r--r--Doc/library/dis.rst253
-rw-r--r--Doc/library/distribution.rst14
-rw-r--r--Doc/library/distutils.rst19
-rw-r--r--Doc/library/doctest.rst27
-rw-r--r--Doc/library/email-examples.rst30
-rw-r--r--Doc/library/email.contentmanager.rst430
-rw-r--r--Doc/library/email.message.rst87
-rw-r--r--Doc/library/email.policy.rst45
-rw-r--r--Doc/library/email.rst1
-rw-r--r--Doc/library/ensurepip.rst131
-rw-r--r--Doc/library/enum.rst749
-rw-r--r--Doc/library/exceptions.rst10
-rw-r--r--Doc/library/faulthandler.rst3
-rw-r--r--Doc/library/filecmp.rst32
-rw-r--r--Doc/library/fileinput.rst3
-rw-r--r--Doc/library/filesys.rst1
-rw-r--r--Doc/library/fnmatch.rst2
-rw-r--r--Doc/library/formatter.rst5
-rw-r--r--Doc/library/ftplib.rst10
-rw-r--r--Doc/library/functions.rst76
-rw-r--r--Doc/library/functools.rst177
-rw-r--r--Doc/library/gc.rst48
-rw-r--r--Doc/library/glob.rst15
-rw-r--r--Doc/library/gzip.rst15
-rw-r--r--Doc/library/hashlib.rst65
-rw-r--r--Doc/library/hmac.rst43
-rw-r--r--Doc/library/html.entities.rst1
-rw-r--r--Doc/library/html.parser.rst39
-rw-r--r--Doc/library/html.rst11
-rw-r--r--Doc/library/http.client.rst24
-rw-r--r--Doc/library/http.server.rst37
-rw-r--r--Doc/library/idle.rst345
-rw-r--r--Doc/library/imaplib.rst8
-rw-r--r--Doc/library/imp.rst41
-rw-r--r--Doc/library/importlib.rst693
-rw-r--r--Doc/library/index.rst1
-rw-r--r--Doc/library/inspect.rst73
-rw-r--r--Doc/library/io.rst57
-rw-r--r--Doc/library/ipaddress.rst30
-rw-r--r--Doc/library/ipc.rst5
-rw-r--r--Doc/library/json.rst72
-rw-r--r--Doc/library/logging.config.rst54
-rw-r--r--Doc/library/logging.handlers.rst14
-rw-r--r--Doc/library/lzma.rst15
-rw-r--r--Doc/library/marshal.rst9
-rw-r--r--Doc/library/multiprocessing.rst320
-rw-r--r--Doc/library/netrc.rst2
-rw-r--r--Doc/library/nntplib.rst11
-rw-r--r--Doc/library/numeric.rst1
-rw-r--r--Doc/library/operator.rst11
-rw-r--r--Doc/library/os.path.rst36
-rw-r--r--Doc/library/os.rst268
-rw-r--r--Doc/library/pathlib-inheritance.pngbin0 -> 11280 bytes
-rw-r--r--Doc/library/pathlib-inheritance.svg4
-rw-r--r--Doc/library/pathlib.rst919
-rw-r--r--Doc/library/pdb.rst14
-rw-r--r--Doc/library/pickle.rst171
-rw-r--r--Doc/library/pkgutil.rst17
-rw-r--r--Doc/library/plistlib.rst184
-rw-r--r--Doc/library/poplib.rst34
-rw-r--r--Doc/library/pprint.rst254
-rw-r--r--Doc/library/pty.rst3
-rw-r--r--Doc/library/py_compile.rst16
-rw-r--r--Doc/library/pydoc.rst5
-rw-r--r--Doc/library/python.rst1
-rw-r--r--Doc/library/re.rst48
-rw-r--r--Doc/library/readline.rst20
-rw-r--r--Doc/library/resource.rst95
-rw-r--r--Doc/library/rlcompleter.rst16
-rw-r--r--Doc/library/runpy.rst69
-rw-r--r--Doc/library/select.rst66
-rw-r--r--Doc/library/selectors.rst257
-rw-r--r--Doc/library/shelve.rst17
-rw-r--r--Doc/library/shutil.rst22
-rw-r--r--Doc/library/site.rst27
-rw-r--r--Doc/library/smtpd.rst19
-rw-r--r--Doc/library/smtplib.rst16
-rw-r--r--Doc/library/socket.rst102
-rw-r--r--Doc/library/spwd.rst10
-rw-r--r--Doc/library/sqlite3.rst14
-rw-r--r--Doc/library/ssl.rst397
-rw-r--r--Doc/library/stat.rst51
-rw-r--r--Doc/library/statistics.rst418
-rw-r--r--Doc/library/stdtypes.rst6
-rw-r--r--Doc/library/struct.rst20
-rw-r--r--Doc/library/subprocess.rst45
-rw-r--r--Doc/library/sunau.rst14
-rw-r--r--Doc/library/sys.rst49
-rw-r--r--Doc/library/sysconfig.rst2
-rw-r--r--Doc/library/tarfile.rst61
-rw-r--r--Doc/library/test.rst22
-rw-r--r--Doc/library/textwrap.rst73
-rw-r--r--Doc/library/threading.rst9
-rw-r--r--Doc/library/timeit.rst2
-rw-r--r--Doc/library/tkinter.rst26
-rw-r--r--Doc/library/traceback.rst9
-rw-r--r--Doc/library/tracemalloc.rst634
-rw-r--r--Doc/library/tulip_coro.diabin0 -> 4461 bytes
-rw-r--r--Doc/library/tulip_coro.pngbin0 -> 45565 bytes
-rw-r--r--Doc/library/types.rst53
-rw-r--r--Doc/library/undoc.rst2
-rw-r--r--Doc/library/unicodedata.rst8
-rw-r--r--Doc/library/unittest.mock-examples.rst14
-rw-r--r--Doc/library/unittest.mock.rst31
-rw-r--r--Doc/library/unittest.rst206
-rw-r--r--Doc/library/urllib.error.rst7
-rw-r--r--Doc/library/urllib.request.rst140
-rw-r--r--Doc/library/venv.rst24
-rw-r--r--Doc/library/wave.rst62
-rw-r--r--Doc/library/weakref.rst257
-rw-r--r--Doc/library/xml.etree.elementtree.rst175
-rw-r--r--Doc/library/zipfile.rst58
-rw-r--r--Doc/license.rst70
-rw-r--r--Doc/make.bat19
-rw-r--r--Doc/reference/compound_stmts.rst17
-rw-r--r--Doc/reference/datamodel.rst53
-rw-r--r--Doc/reference/import.rst533
-rw-r--r--Doc/tools/sphinx-build.py28
-rw-r--r--Doc/tools/sphinxext/indexcontent.html8
-rw-r--r--Doc/tools/sphinxext/indexsidebar.html2
-rw-r--r--Doc/tools/sphinxext/pyspecific.py2
-rw-r--r--Doc/tools/sphinxext/susp-ignored.csv37
-rw-r--r--Doc/tutorial/interactive.rst153
-rw-r--r--Doc/tutorial/interpreter.rst14
-rw-r--r--Doc/tutorial/modules.rst45
-rw-r--r--Doc/tutorial/stdlib.rst2
-rw-r--r--Doc/tutorial/stdlib2.rst2
-rw-r--r--Doc/tutorial/whatnow.rst4
-rw-r--r--Doc/using/cmdline.rst95
-rw-r--r--Doc/using/mac.rst6
-rw-r--r--Doc/using/unix.rst2
-rw-r--r--Doc/using/venv-create.inc49
-rw-r--r--Doc/using/windows.rst10
-rw-r--r--Doc/whatsnew/3.4.rst2496
-rw-r--r--Doc/whatsnew/index.rst1
-rw-r--r--Include/Python-ast.h31
-rw-r--r--Include/Python.h1
-rw-r--r--Include/abstract.h48
-rw-r--r--Include/asdl.h15
-rw-r--r--Include/ast.h5
-rw-r--r--Include/bytearrayobject.h11
-rw-r--r--Include/bytesobject.h10
-rw-r--r--Include/compile.h18
-rw-r--r--Include/dictobject.h8
-rw-r--r--Include/fileobject.h5
-rw-r--r--Include/fileutils.h19
-rw-r--r--Include/frameobject.h6
-rw-r--r--Include/genobject.h2
-rw-r--r--Include/grammar.h8
-rw-r--r--Include/import.h24
-rw-r--r--Include/longobject.h19
-rw-r--r--Include/marshal.h5
-rw-r--r--Include/modsupport.h3
-rw-r--r--Include/moduleobject.h1
-rw-r--r--Include/object.h116
-rw-r--r--Include/objimpl.h104
-rw-r--r--Include/opcode.h2
-rw-r--r--Include/osdefs.h8
-rw-r--r--Include/parsetok.h49
-rw-r--r--Include/patchlevel.h10
-rw-r--r--Include/pydebug.h1
-rw-r--r--Include/pyerrors.h44
-rw-r--r--Include/pyhash.h149
-rw-r--r--Include/pymacro.h6
-rw-r--r--Include/pymem.h99
-rw-r--r--Include/pyport.h71
-rw-r--r--Include/pystate.h50
-rw-r--r--Include/pythonrun.h47
-rw-r--r--Include/pytime.h17
-rw-r--r--Include/setobject.h9
-rw-r--r--Include/sliceobject.h3
-rw-r--r--Include/structseq.h2
-rw-r--r--Include/symtable.h10
-rw-r--r--Include/sysmodule.h5
-rw-r--r--Include/token.h2
-rw-r--r--Include/unicodeobject.h88
-rw-r--r--Include/warnings.h17
-rw-r--r--Lib/_bootlocale.py34
-rw-r--r--Lib/_collections_abc.py734
-rw-r--r--Lib/_dummy_thread.py4
-rw-r--r--Lib/_osx_support.py4
-rw-r--r--Lib/_pyio.py209
-rw-r--r--Lib/_sitebuiltins.py99
-rw-r--r--Lib/_strptime.py2
-rw-r--r--Lib/abc.py20
-rw-r--r--Lib/aifc.py41
-rw-r--r--Lib/argparse.py31
-rw-r--r--Lib/ast.py6
-rw-r--r--Lib/asynchat.py8
-rw-r--r--Lib/asyncio/__init__.py45
-rw-r--r--Lib/asyncio/base_events.py807
-rw-r--r--Lib/asyncio/base_subprocess.py159
-rw-r--r--Lib/asyncio/constants.py7
-rw-r--r--Lib/asyncio/events.py485
-rw-r--r--Lib/asyncio/futures.py371
-rw-r--r--Lib/asyncio/locks.py466
-rw-r--r--Lib/asyncio/log.py7
-rw-r--r--Lib/asyncio/proactor_events.py455
-rw-r--r--Lib/asyncio/protocols.py129
-rw-r--r--Lib/asyncio/queues.py288
-rw-r--r--Lib/asyncio/selector_events.py846
-rw-r--r--Lib/asyncio/streams.py468
-rw-r--r--Lib/asyncio/subprocess.py195
-rw-r--r--Lib/asyncio/tasks.py682
-rw-r--r--Lib/asyncio/test_utils.py374
-rw-r--r--Lib/asyncio/transports.py295
-rw-r--r--Lib/asyncio/unix_events.py838
-rw-r--r--Lib/asyncio/windows_events.py489
-rw-r--r--Lib/asyncio/windows_utils.py205
-rw-r--r--Lib/asyncore.py29
-rwxr-xr-xLib/base64.py345
-rw-r--r--Lib/bdb.py36
-rw-r--r--Lib/bz2.py50
-rwxr-xr-xLib/cProfile.py53
-rwxr-xr-xLib/cgi.py13
-rw-r--r--Lib/chunk.py6
-rw-r--r--Lib/code.py2
-rw-r--r--Lib/collections/__init__.py24
-rw-r--r--Lib/collections/abc.py730
-rw-r--r--Lib/colorsys.py18
-rw-r--r--Lib/compileall.py19
-rw-r--r--Lib/concurrent/futures/_base.py9
-rw-r--r--Lib/concurrent/futures/process.py11
-rw-r--r--Lib/concurrent/futures/thread.py2
-rw-r--r--Lib/configparser.py2
-rw-r--r--Lib/contextlib.py71
-rw-r--r--Lib/copyreg.py6
-rw-r--r--Lib/ctypes/__init__.py26
-rw-r--r--Lib/ctypes/test/__init__.py2
-rw-r--r--Lib/ctypes/test/test_checkretval.py2
-rw-r--r--Lib/ctypes/test/test_internals.py19
-rw-r--r--Lib/ctypes/test/test_macholib.py56
-rw-r--r--Lib/ctypes/test/test_win32.py2
-rw-r--r--Lib/ctypes/util.py20
-rw-r--r--Lib/datetime.py395
-rw-r--r--Lib/dbm/__init__.py16
-rw-r--r--Lib/dbm/dumb.py16
-rw-r--r--Lib/decimal.py4
-rw-r--r--Lib/difflib.py35
-rw-r--r--Lib/dis.py396
-rw-r--r--Lib/distutils/__init__.py2
-rw-r--r--Lib/distutils/archive_util.py71
-rw-r--r--Lib/distutils/ccompiler.py5
-rw-r--r--Lib/distutils/cmd.py6
-rw-r--r--Lib/distutils/command/bdist.py16
-rw-r--r--Lib/distutils/command/bdist_dumb.py19
-rw-r--r--Lib/distutils/command/build_ext.py26
-rw-r--r--Lib/distutils/command/build_py.py10
-rw-r--r--Lib/distutils/command/build_scripts.py2
-rw-r--r--Lib/distutils/command/install.py15
-rw-r--r--Lib/distutils/command/install_lib.py6
-rw-r--r--Lib/distutils/command/sdist.py9
-rw-r--r--Lib/distutils/command/upload.py2
-rw-r--r--Lib/distutils/config.py9
-rw-r--r--Lib/distutils/core.py7
-rw-r--r--Lib/distutils/cygwinccompiler.py28
-rw-r--r--Lib/distutils/dir_util.py4
-rw-r--r--Lib/distutils/dist.py35
-rw-r--r--Lib/distutils/emxccompiler.py315
-rw-r--r--Lib/distutils/errors.py4
-rw-r--r--Lib/distutils/file_util.py16
-rw-r--r--Lib/distutils/msvc9compiler.py2
-rw-r--r--Lib/distutils/spawn.py26
-rw-r--r--Lib/distutils/sysconfig.py38
-rw-r--r--Lib/distutils/tests/test_archive_util.py61
-rw-r--r--Lib/distutils/tests/test_bdist_dumb.py5
-rw-r--r--Lib/distutils/tests/test_build_py.py10
-rw-r--r--Lib/distutils/tests/test_dist.py29
-rw-r--r--Lib/distutils/tests/test_install.py6
-rw-r--r--Lib/distutils/tests/test_install_lib.py8
-rw-r--r--Lib/distutils/tests/test_sdist.py54
-rw-r--r--Lib/distutils/tests/test_sysconfig.py48
-rw-r--r--Lib/distutils/tests/test_upload.py9
-rw-r--r--Lib/distutils/tests/test_util.py2
-rw-r--r--Lib/distutils/util.py13
-rw-r--r--Lib/doctest.py76
-rw-r--r--Lib/email/_header_value_parser.py37
-rw-r--r--Lib/email/contentmanager.py249
-rw-r--r--Lib/email/encoders.py17
-rw-r--r--Lib/email/feedparser.py52
-rw-r--r--Lib/email/iterators.py6
-rw-r--r--Lib/email/message.py266
-rw-r--r--Lib/email/parser.py5
-rw-r--r--Lib/email/policy.py13
-rw-r--r--Lib/email/utils.py24
-rw-r--r--Lib/encodings/aliases.py47
-rw-r--r--Lib/encodings/cp037.py1
-rw-r--r--Lib/encodings/cp1125.py698
-rw-r--r--Lib/encodings/cp273.py307
-rw-r--r--Lib/encodings/cp500.py1
-rw-r--r--Lib/encodings/iso8859_1.py1
-rw-r--r--Lib/ensurepip/__init__.py210
-rw-r--r--Lib/ensurepip/__main__.py4
-rw-r--r--Lib/ensurepip/_bundled/pip-1.5.4-py2.py3-none-any.whlbin0 -> 1169272 bytes
-rw-r--r--Lib/ensurepip/_bundled/setuptools-2.1-py2.py3-none-any.whlbin0 -> 540293 bytes
-rw-r--r--Lib/ensurepip/_uninstall.py30
-rw-r--r--Lib/enum.py525
-rw-r--r--Lib/filecmp.py25
-rw-r--r--Lib/fileinput.py16
-rw-r--r--Lib/formatter.py3
-rw-r--r--Lib/fractions.py14
-rw-r--r--Lib/ftplib.py189
-rw-r--r--Lib/functools.py422
-rw-r--r--Lib/genericpath.py34
-rw-r--r--Lib/gettext.py14
-rw-r--r--Lib/glob.py21
-rw-r--r--Lib/gzip.py115
-rw-r--r--Lib/hashlib.py97
-rw-r--r--Lib/hmac.py31
-rw-r--r--Lib/html/__init__.py123
-rw-r--r--Lib/html/parser.py111
-rw-r--r--Lib/http/client.py60
-rw-r--r--Lib/http/cookiejar.py31
-rw-r--r--Lib/http/server.py42
-rw-r--r--Lib/idlelib/EditorWindow.py13
-rw-r--r--Lib/idlelib/FileList.py2
-rw-r--r--Lib/idlelib/GrepDialog.py1
-rw-r--r--Lib/idlelib/IOBinding.py2
-rw-r--r--Lib/idlelib/MultiCall.py33
-rw-r--r--Lib/idlelib/NEWS.txt68
-rw-r--r--Lib/idlelib/PathBrowser.py2
-rwxr-xr-xLib/idlelib/PyShell.py12
-rw-r--r--Lib/idlelib/TreeWidget.py4
-rw-r--r--Lib/idlelib/configHandler.py4
-rw-r--r--Lib/idlelib/help.txt556
-rw-r--r--Lib/idlelib/idle_test/test_calltips.py7
-rw-r--r--Lib/idlelib/idlever.py2
-rw-r--r--Lib/idlelib/rpc.py8
-rw-r--r--Lib/idlelib/run.py4
-rw-r--r--Lib/imaplib.py30
-rw-r--r--Lib/imghdr.py2
-rw-r--r--Lib/imp.py224
-rw-r--r--Lib/importlib/__init__.py87
-rw-r--r--Lib/importlib/_bootstrap.py1748
-rw-r--r--Lib/importlib/abc.py367
-rw-r--r--Lib/importlib/machinery.py1
-rw-r--r--Lib/importlib/util.py187
-rw-r--r--Lib/inspect.py1030
-rw-r--r--Lib/io.py2
-rw-r--r--Lib/ipaddress.py93
-rw-r--r--Lib/json/__init__.py30
-rw-r--r--Lib/json/decoder.py28
-rw-r--r--Lib/json/encoder.py56
-rw-r--r--Lib/json/scanner.py4
-rw-r--r--Lib/json/tool.py3
-rwxr-xr-xLib/keyword.py23
-rw-r--r--Lib/lib2to3/btm_utils.py6
-rw-r--r--Lib/lib2to3/fixer_util.py23
-rw-r--r--Lib/lib2to3/fixes/fix_asserts.py34
-rw-r--r--Lib/lib2to3/fixes/fix_intern.py21
-rw-r--r--Lib/lib2to3/fixes/fix_reload.py28
-rw-r--r--Lib/lib2to3/main.py4
-rw-r--r--Lib/lib2to3/pgen2/conv.py4
-rw-r--r--Lib/lib2to3/pgen2/driver.py2
-rw-r--r--Lib/lib2to3/pgen2/grammar.py10
-rw-r--r--Lib/lib2to3/pytree.py9
-rw-r--r--Lib/lib2to3/refactor.py6
-rwxr-xr-xLib/lib2to3/tests/pytree_idempotency.py2
-rw-r--r--Lib/lib2to3/tests/test_fixers.py109
-rw-r--r--Lib/linecache.py8
-rw-r--r--Lib/locale.py487
-rw-r--r--Lib/logging/__init__.py90
-rw-r--r--Lib/logging/config.py76
-rw-r--r--Lib/logging/handlers.py124
-rw-r--r--Lib/lzma.py137
-rw-r--r--Lib/macpath.py2
-rw-r--r--Lib/mailbox.py83
-rw-r--r--Lib/mailcap.py2
-rw-r--r--Lib/mimetypes.py2
-rw-r--r--Lib/modulefinder.py19
-rw-r--r--Lib/multiprocessing/__init__.py251
-rw-r--r--Lib/multiprocessing/connection.py147
-rw-r--r--Lib/multiprocessing/context.py348
-rw-r--r--Lib/multiprocessing/dummy/__init__.py31
-rw-r--r--Lib/multiprocessing/dummy/connection.py27
-rw-r--r--Lib/multiprocessing/forking.py474
-rw-r--r--Lib/multiprocessing/forkserver.py267
-rw-r--r--Lib/multiprocessing/heap.py56
-rw-r--r--Lib/multiprocessing/managers.py51
-rw-r--r--Lib/multiprocessing/pool.py133
-rw-r--r--Lib/multiprocessing/popen_fork.py83
-rw-r--r--Lib/multiprocessing/popen_forkserver.py69
-rw-r--r--Lib/multiprocessing/popen_spawn_posix.py72
-rw-r--r--Lib/multiprocessing/popen_spawn_win32.py99
-rw-r--r--Lib/multiprocessing/process.py83
-rw-r--r--Lib/multiprocessing/queues.py106
-rw-r--r--Lib/multiprocessing/reduction.py363
-rw-r--r--Lib/multiprocessing/resource_sharer.py158
-rw-r--r--Lib/multiprocessing/semaphore_tracker.py145
-rw-r--r--Lib/multiprocessing/sharedctypes.py40
-rw-r--r--Lib/multiprocessing/spawn.py279
-rw-r--r--Lib/multiprocessing/synchronize.py112
-rw-r--r--Lib/multiprocessing/util.py52
-rw-r--r--Lib/netrc.py5
-rw-r--r--Lib/nntplib.py17
-rw-r--r--Lib/ntpath.py60
-rw-r--r--Lib/nturl2path.py4
-rw-r--r--Lib/opcode.py17
-rw-r--r--Lib/operator.py411
-rw-r--r--Lib/os.py95
-rw-r--r--Lib/os2emxpath.py158
-rw-r--r--Lib/pathlib.py1288
-rwxr-xr-xLib/pdb.py47
-rw-r--r--Lib/pickle.py862
-rw-r--r--Lib/pickletools.py871
-rw-r--r--Lib/pkgutil.py157
-rw-r--r--Lib/plat-os2emx/IN.py82
-rw-r--r--Lib/plat-os2emx/SOCKET.py106
-rw-r--r--Lib/plat-os2emx/_emx_link.py79
-rw-r--r--Lib/plat-os2emx/grp.py182
-rw-r--r--Lib/plat-os2emx/pwd.py208
-rw-r--r--Lib/plat-os2emx/regen7
-rwxr-xr-xLib/platform.py310
-rw-r--r--Lib/plistlib.py1111
-rw-r--r--Lib/poplib.py102
-rw-r--r--Lib/posixpath.py57
-rw-r--r--Lib/pprint.py124
-rwxr-xr-xLib/profile.py63
-rw-r--r--Lib/pstats.py12
-rw-r--r--Lib/pty.py22
-rw-r--r--Lib/py_compile.py77
-rw-r--r--Lib/pyclbr.py11
-rwxr-xr-xLib/pydoc.py242
-rw-r--r--Lib/pydoc_data/topics.py20
-rwxr-xr-xLib/quopri.py2
-rw-r--r--Lib/random.py16
-rw-r--r--Lib/re.py29
-rw-r--r--Lib/rlcompleter.py5
-rw-r--r--Lib/runpy.py112
-rw-r--r--Lib/sched.py11
-rw-r--r--Lib/selectors.py525
-rw-r--r--Lib/shelve.py9
-rw-r--r--Lib/shutil.py39
-rw-r--r--Lib/site.py202
-rwxr-xr-xLib/smtpd.py21
-rwxr-xr-xLib/smtplib.py33
-rw-r--r--Lib/sndhdr.py17
-rw-r--r--Lib/socket.py116
-rw-r--r--Lib/socketserver.py8
-rw-r--r--Lib/sqlite3/test/dbapi.py18
-rw-r--r--Lib/sre_compile.py270
-rw-r--r--Lib/sre_constants.py8
-rw-r--r--Lib/sre_parse.py75
-rw-r--r--Lib/ssl.py357
-rw-r--r--Lib/stat.py6
-rw-r--r--Lib/statistics.py595
-rw-r--r--Lib/struct.py1
-rw-r--r--Lib/subprocess.py370
-rw-r--r--Lib/sunau.py40
-rwxr-xr-xLib/symbol.py4
-rw-r--r--Lib/symtable.py3
-rw-r--r--Lib/sysconfig.py46
-rwxr-xr-xLib/tabnanny.py2
-rwxr-xr-xLib/tarfile.py147
-rw-r--r--Lib/telnetlib.py275
-rw-r--r--Lib/tempfile.py97
-rw-r--r--Lib/test/__main__.py14
-rw-r--r--Lib/test/_test_multiprocessing.py (renamed from Lib/test/test_multiprocessing.py)591
-rw-r--r--Lib/test/audiodata/pluck-pcm24.aubin0 -> 19866 bytes
-rw-r--r--Lib/test/audiotests.py119
-rw-r--r--Lib/test/badsyntax_future10.py3
-rw-r--r--Lib/test/buffer_tests.py16
-rw-r--r--Lib/test/bytecode_helper.py41
-rw-r--r--Lib/test/coding20731.py8
-rw-r--r--Lib/test/datetimetester.py4
-rw-r--r--Lib/test/final_a.py19
-rw-r--r--Lib/test/final_b.py19
-rw-r--r--Lib/test/fork_wait.py2
-rw-r--r--Lib/test/keycert3.pem73
-rw-r--r--Lib/test/keycert4.pem73
-rw-r--r--Lib/test/leakers/test_gestalt.py14
-rw-r--r--Lib/test/lock_tests.py20
-rw-r--r--Lib/test/make_ssl_certs.py118
-rw-r--r--Lib/test/mock_socket.py8
-rw-r--r--Lib/test/mp_fork_bomb.py5
-rw-r--r--Lib/test/multibytecodec_support.py2
-rw-r--r--Lib/test/pickletester.py659
-rw-r--r--Lib/test/pycacert.pem78
-rw-r--r--Lib/test/pycakey.pem28
-rwxr-xr-xLib/test/regrtest.py1153
-rw-r--r--Lib/test/revocation.crl11
-rw-r--r--Lib/test/script_helper.py42
-rw-r--r--Lib/test/sortperf.py6
-rw-r--r--Lib/test/ssl_servers.py10
-rw-r--r--Lib/test/ssltests.py22
-rw-r--r--Lib/test/string_tests.py30
-rw-r--r--Lib/test/subprocessdata/fd_status.py26
-rw-r--r--Lib/test/support/__init__.py253
-rw-r--r--Lib/test/test___all__.py30
-rw-r--r--Lib/test/test__opcode.py23
-rw-r--r--Lib/test/test_abc.py16
-rw-r--r--Lib/test/test_aifc.py26
-rw-r--r--Lib/test/test_argparse.py36
-rw-r--r--Lib/test/test_array.py16
-rw-r--r--Lib/test/test_ast.py100
-rw-r--r--Lib/test/test_asynchat.py35
-rw-r--r--Lib/test/test_asyncio/__init__.py31
-rw-r--r--Lib/test/test_asyncio/__main__.py5
-rw-r--r--Lib/test/test_asyncio/echo.py8
-rw-r--r--Lib/test/test_asyncio/echo2.py6
-rw-r--r--Lib/test/test_asyncio/echo3.py11
-rw-r--r--Lib/test/test_asyncio/keycert3.pem73
-rw-r--r--Lib/test/test_asyncio/pycacert.pem78
-rw-r--r--Lib/test/test_asyncio/ssl_cert.pem15
-rw-r--r--Lib/test/test_asyncio/ssl_key.pem16
-rw-r--r--Lib/test/test_asyncio/test_base_events.py926
-rw-r--r--Lib/test/test_asyncio/test_events.py2044
-rw-r--r--Lib/test/test_asyncio/test_futures.py351
-rw-r--r--Lib/test/test_asyncio/test_locks.py870
-rw-r--r--Lib/test/test_asyncio/test_proactor_events.py490
-rw-r--r--Lib/test/test_asyncio/test_queues.py466
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py1690
-rw-r--r--Lib/test/test_asyncio/test_streams.py588
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py184
-rw-r--r--Lib/test/test_asyncio/test_tasks.py1677
-rw-r--r--Lib/test/test_asyncio/test_transports.py88
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py1580
-rw-r--r--Lib/test/test_asyncio/test_windows_events.py134
-rw-r--r--Lib/test/test_asyncio/test_windows_utils.py160
-rw-r--r--Lib/test/test_asyncio/tests.txt14
-rw-r--r--Lib/test/test_asyncore.py25
-rw-r--r--Lib/test/test_atexit.py41
-rw-r--r--Lib/test/test_audioop.py243
-rw-r--r--Lib/test/test_base64.py362
-rw-r--r--Lib/test/test_bisect.py10
-rw-r--r--Lib/test/test_buffer.py6
-rw-r--r--Lib/test/test_builtin.py128
-rw-r--r--Lib/test/test_bytes.py34
-rw-r--r--Lib/test/test_bz2.py218
-rw-r--r--Lib/test/test_capi.py161
-rw-r--r--Lib/test/test_cmd_line.py100
-rw-r--r--Lib/test/test_cmd_line_script.py47
-rw-r--r--Lib/test/test_code_module.py14
-rw-r--r--Lib/test/test_codeccallbacks.py4
-rw-r--r--Lib/test/test_codecs.py389
-rw-r--r--Lib/test/test_coding.py71
-rw-r--r--Lib/test/test_collections.py128
-rw-r--r--Lib/test/test_colorsys.py32
-rw-r--r--Lib/test/test_compileall.py54
-rw-r--r--Lib/test/test_complex.py3
-rw-r--r--Lib/test/test_concurrent_futures.py22
-rw-r--r--Lib/test/test_contextlib.py141
-rw-r--r--Lib/test/test_cprofile.py3
-rw-r--r--Lib/test/test_crypt.py6
-rw-r--r--Lib/test/test_csv.py30
-rw-r--r--Lib/test/test_curses.py4
-rw-r--r--Lib/test/test_dbm.py2
-rw-r--r--Lib/test/test_dbm_dumb.py13
-rw-r--r--Lib/test/test_dbm_gnu.py11
-rw-r--r--Lib/test/test_dbm_ndbm.py13
-rw-r--r--Lib/test/test_deque.py4
-rw-r--r--Lib/test/test_descr.py641
-rw-r--r--Lib/test/test_devpoll.py37
-rw-r--r--Lib/test/test_dis.py489
-rw-r--r--Lib/test/test_doctest.py317
-rw-r--r--Lib/test/test_dynamicclassattribute.py304
-rw-r--r--Lib/test/test_email/__init__.py26
-rw-r--r--Lib/test/test_email/test_contentmanager.py796
-rw-r--r--Lib/test/test_email/test_email.py50
-rw-r--r--Lib/test/test_email/test_headerregistry.py14
-rw-r--r--Lib/test/test_email/test_message.py758
-rw-r--r--Lib/test/test_email/test_policy.py10
-rw-r--r--Lib/test/test_email/torture_test.py2
-rw-r--r--Lib/test/test_ensurepip.py345
-rw-r--r--Lib/test/test_enum.py1594
-rw-r--r--Lib/test/test_enumerate.py10
-rw-r--r--Lib/test/test_epoll.py53
-rw-r--r--Lib/test/test_exceptions.py23
-rw-r--r--Lib/test/test_faulthandler.py77
-rw-r--r--Lib/test/test_fcntl.py39
-rw-r--r--Lib/test/test_file.py6
-rw-r--r--Lib/test/test_filecmp.py23
-rw-r--r--Lib/test/test_fileinput.py36
-rw-r--r--Lib/test/test_fileio.py20
-rw-r--r--Lib/test/test_finalization.py522
-rw-r--r--Lib/test/test_float.py1
-rw-r--r--Lib/test/test_fork1.py2
-rw-r--r--Lib/test/test_format.py36
-rw-r--r--Lib/test/test_fractions.py32
-rw-r--r--Lib/test/test_frame.py116
-rw-r--r--Lib/test/test_frozen.py79
-rw-r--r--Lib/test/test_ftplib.py91
-rw-r--r--Lib/test/test_funcattrs.py7
-rw-r--r--Lib/test/test_functools.py945
-rw-r--r--Lib/test/test_future.py8
-rw-r--r--Lib/test/test_gc.py94
-rw-r--r--Lib/test/test_gdb.py31
-rw-r--r--Lib/test/test_generators.py78
-rw-r--r--Lib/test/test_genericpath.py82
-rw-r--r--Lib/test/test_genexps.py4
-rw-r--r--Lib/test/test_getargs2.py112
-rw-r--r--Lib/test/test_glob.py22
-rw-r--r--Lib/test/test_grammar.py7
-rw-r--r--Lib/test/test_gzip.py51
-rw-r--r--Lib/test/test_hash.py146
-rw-r--r--Lib/test/test_hashlib.py154
-rw-r--r--Lib/test/test_hmac.py99
-rw-r--r--Lib/test/test_html.py86
-rw-r--r--Lib/test/test_htmlparser.py98
-rw-r--r--Lib/test/test_httplib.py30
-rw-r--r--Lib/test/test_httpservers.py21
-rw-r--r--Lib/test/test_imaplib.py34
-rw-r--r--Lib/test/test_imp.py89
-rw-r--r--Lib/test/test_import.py102
-rw-r--r--Lib/test/test_importhooks.py250
-rw-r--r--Lib/test/test_importlib/__main__.py13
-rw-r--r--Lib/test/test_importlib/abc.py9
-rw-r--r--Lib/test/test_importlib/builtin/test_finder.py60
-rw-r--r--Lib/test/test_importlib/builtin/test_loader.py47
-rw-r--r--Lib/test/test_importlib/extension/test_case_sensitivity.py29
-rw-r--r--Lib/test/test_importlib/extension/test_finder.py25
-rw-r--r--Lib/test/test_importlib/extension/test_loader.py30
-rw-r--r--Lib/test/test_importlib/extension/test_path_hook.py20
-rw-r--r--Lib/test/test_importlib/extension/util.py1
-rw-r--r--Lib/test/test_importlib/frozen/test_finder.py49
-rw-r--r--Lib/test/test_importlib/frozen/test_loader.py156
-rw-r--r--Lib/test/test_importlib/import_/test___loader__.py70
-rw-r--r--Lib/test/test_importlib/import_/test___package__.py56
-rw-r--r--Lib/test/test_importlib/import_/test_api.py73
-rw-r--r--Lib/test/test_importlib/import_/test_caching.py32
-rw-r--r--Lib/test/test_importlib/import_/test_fromlist.py36
-rw-r--r--Lib/test/test_importlib/import_/test_meta_path.py66
-rw-r--r--Lib/test/test_importlib/import_/test_packages.py44
-rw-r--r--Lib/test/test_importlib/import_/test_path.py76
-rw-r--r--Lib/test/test_importlib/import_/test_relative_imports.py53
-rw-r--r--Lib/test/test_importlib/import_/util.py20
-rw-r--r--Lib/test/test_importlib/source/test_abc_loader.py906
-rw-r--r--Lib/test/test_importlib/source/test_case_sensitivity.py53
-rw-r--r--Lib/test/test_importlib/source/test_file_loader.py230
-rw-r--r--Lib/test/test_importlib/source/test_finder.py83
-rw-r--r--Lib/test/test_importlib/source/test_path_hook.py18
-rw-r--r--Lib/test/test_importlib/source/test_source_encoding.py66
-rw-r--r--Lib/test/test_importlib/source/util.py1
-rw-r--r--Lib/test/test_importlib/test_abc.py930
-rw-r--r--Lib/test/test_importlib/test_api.py330
-rw-r--r--Lib/test/test_importlib/test_locks.py71
-rw-r--r--Lib/test/test_importlib/test_spec.py957
-rw-r--r--Lib/test/test_importlib/test_util.py450
-rw-r--r--Lib/test/test_importlib/test_windows.py29
-rw-r--r--Lib/test/test_importlib/util.py105
-rw-r--r--Lib/test/test_index.py3
-rw-r--r--Lib/test/test_inspect.py828
-rw-r--r--Lib/test/test_int.py50
-rw-r--r--Lib/test/test_io.py170
-rw-r--r--Lib/test/test_ioctl.py6
-rw-r--r--Lib/test/test_ipaddress.py12
-rw-r--r--Lib/test/test_iterlen.py62
-rw-r--r--Lib/test/test_itertools.py48
-rw-r--r--Lib/test/test_json/test_decode.py23
-rw-r--r--Lib/test/test_json/test_enum.py120
-rw-r--r--Lib/test/test_json/test_fail.py89
-rw-r--r--Lib/test/test_json/test_indent.py4
-rw-r--r--Lib/test/test_keyword.py138
-rw-r--r--Lib/test/test_keywordonlyarg.py12
-rw-r--r--Lib/test/test_kqueue.py29
-rw-r--r--Lib/test/test_largefile.py2
-rw-r--r--Lib/test/test_locale.py42
-rw-r--r--Lib/test/test_logging.py472
-rw-r--r--Lib/test/test_long.py2
-rw-r--r--Lib/test/test_lzma.py46
-rw-r--r--Lib/test/test_mailbox.py2
-rw-r--r--Lib/test/test_marshal.py163
-rw-r--r--Lib/test/test_memoryio.py12
-rw-r--r--Lib/test/test_memoryview.py9
-rw-r--r--Lib/test/test_minidom.py65
-rw-r--r--Lib/test/test_mmap.py26
-rw-r--r--Lib/test/test_module.py64
-rw-r--r--Lib/test/test_multibytecodec.py73
-rw-r--r--Lib/test/test_multiprocessing_fork.py7
-rw-r--r--Lib/test/test_multiprocessing_forkserver.py7
-rw-r--r--Lib/test/test_multiprocessing_main_handling.py285
-rw-r--r--Lib/test/test_multiprocessing_spawn.py7
-rw-r--r--Lib/test/test_namespace_pkgs.py13
-rw-r--r--Lib/test/test_nntplib.py2
-rw-r--r--Lib/test/test_normalization.py2
-rw-r--r--Lib/test/test_ntpath.py34
-rw-r--r--Lib/test/test_openpty.py2
-rw-r--r--Lib/test/test_operator.py122
-rw-r--r--Lib/test/test_optparse.py8
-rw-r--r--Lib/test/test_os.py329
-rw-r--r--Lib/test/test_ossaudiodev.py4
-rw-r--r--Lib/test/test_pathlib.py1840
-rw-r--r--Lib/test/test_pdb.py348
-rw-r--r--Lib/test/test_peepholer.py295
-rw-r--r--Lib/test/test_pep247.py12
-rw-r--r--Lib/test/test_pep277.py4
-rw-r--r--Lib/test/test_pep3151.py2
-rw-r--r--Lib/test/test_pep352.py5
-rw-r--r--Lib/test/test_pickle.py4
-rw-r--r--Lib/test/test_pkg.py20
-rw-r--r--Lib/test/test_pkgimport.py2
-rw-r--r--Lib/test/test_pkgutil.py62
-rw-r--r--Lib/test/test_plistlib.py533
-rw-r--r--Lib/test/test_poll.py20
-rw-r--r--Lib/test/test_poplib.py190
-rw-r--r--Lib/test/test_posix.py85
-rw-r--r--Lib/test/test_posixpath.py62
-rw-r--r--Lib/test/test_pprint.py50
-rw-r--r--Lib/test/test_print.py74
-rw-r--r--Lib/test/test_profile.py29
-rw-r--r--Lib/test/test_pty.py2
-rw-r--r--Lib/test/test_py_compile.py46
-rw-r--r--Lib/test/test_pyclbr.py4
-rw-r--r--Lib/test/test_pydoc.py327
-rw-r--r--Lib/test/test_random.py207
-rw-r--r--Lib/test/test_range.py9
-rw-r--r--Lib/test/test_re.py240
-rw-r--r--Lib/test/test_regrtest.py275
-rw-r--r--Lib/test/test_reprlib.py6
-rw-r--r--Lib/test/test_resource.py32
-rw-r--r--Lib/test/test_runpy.py183
-rw-r--r--Lib/test/test_sched.py5
-rw-r--r--Lib/test/test_scope.py17
-rw-r--r--Lib/test/test_select.py4
-rw-r--r--Lib/test/test_selectors.py453
-rw-r--r--Lib/test/test_set.py2
-rw-r--r--Lib/test/test_shelve.py13
-rw-r--r--Lib/test/test_shutil.py43
-rw-r--r--Lib/test/test_signal.py60
-rw-r--r--Lib/test/test_site.py39
-rw-r--r--Lib/test/test_slice.py114
-rw-r--r--Lib/test/test_smtplib.py23
-rw-r--r--Lib/test/test_smtpnet.py30
-rw-r--r--Lib/test/test_sndhdr.py2
-rw-r--r--Lib/test/test_socket.py392
-rw-r--r--Lib/test/test_socketserver.py20
-rw-r--r--Lib/test/test_source_encoding.py (renamed from Lib/test/test_pep263.py)77
-rw-r--r--Lib/test/test_ssl.py803
-rw-r--r--Lib/test/test_stat.py61
-rw-r--r--Lib/test/test_statistics.py1574
-rw-r--r--Lib/test/test_strftime.py23
-rw-r--r--Lib/test/test_strtod.py2
-rw-r--r--Lib/test/test_struct.py89
-rw-r--r--Lib/test/test_structseq.py2
-rw-r--r--Lib/test/test_subprocess.py206
-rw-r--r--Lib/test/test_sunau.py28
-rw-r--r--Lib/test/test_sundry.py37
-rw-r--r--Lib/test/test_super.py33
-rw-r--r--Lib/test/test_support.py1
-rw-r--r--Lib/test/test_syntax.py4
-rw-r--r--Lib/test/test_sys.py106
-rw-r--r--Lib/test/test_sysconfig.py66
-rw-r--r--Lib/test/test_syslog.py4
-rw-r--r--Lib/test/test_tarfile.py191
-rw-r--r--Lib/test/test_tcl.py34
-rw-r--r--Lib/test/test_telnetlib.py106
-rw-r--r--Lib/test/test_tempfile.py33
-rw-r--r--Lib/test/test_textwrap.py159
-rw-r--r--Lib/test/test_thread.py2
-rw-r--r--Lib/test/test_threaded_import.py14
-rw-r--r--Lib/test/test_threading.py454
-rw-r--r--Lib/test/test_threadsignals.py8
-rw-r--r--Lib/test/test_time.py148
-rw-r--r--Lib/test/test_timeout.py2
-rw-r--r--Lib/test/test_tools.py9
-rw-r--r--Lib/test/test_traceback.py82
-rw-r--r--Lib/test/test_tracemalloc.py820
-rw-r--r--Lib/test/test_types.py63
-rw-r--r--Lib/test/test_ucn.py2
-rw-r--r--Lib/test/test_unicode.py403
-rw-r--r--Lib/test/test_unicodedata.py4
-rw-r--r--Lib/test/test_urllib.py103
-rw-r--r--Lib/test/test_urllib2.py136
-rw-r--r--Lib/test/test_urllib2_localnet.py27
-rw-r--r--Lib/test/test_urllib2net.py44
-rw-r--r--Lib/test/test_urllibnet.py19
-rw-r--r--Lib/test/test_urlparse.py8
-rw-r--r--Lib/test/test_userdict.py9
-rw-r--r--Lib/test/test_venv.py209
-rw-r--r--Lib/test/test_wait3.py12
-rw-r--r--Lib/test/test_warnings.py32
-rw-r--r--Lib/test/test_wave.py21
-rw-r--r--Lib/test/test_weakref.py316
-rw-r--r--Lib/test/test_winreg.py28
-rw-r--r--Lib/test/test_winsound.py2
-rw-r--r--Lib/test/test_xml_etree.py200
-rw-r--r--Lib/test/test_xml_etree_c.py9
-rw-r--r--Lib/test/test_xmlrpc.py74
-rw-r--r--Lib/test/test_xmlrpc_net.py30
-rw-r--r--Lib/test/test_zipfile.py254
-rw-r--r--Lib/test/test_zipfile64.py4
-rw-r--r--Lib/test/test_zipimport.py37
-rw-r--r--Lib/test/test_zipimport_support.py6
-rw-r--r--Lib/test/tf_inherit_check.py2
-rw-r--r--Lib/textwrap.py73
-rw-r--r--Lib/threading.py188
-rwxr-xr-xLib/timeit.py46
-rw-r--r--Lib/tkinter/__init__.py45
-rw-r--r--Lib/tkinter/filedialog.py4
-rw-r--r--Lib/tkinter/test/test_tkinter/test_widgets.py4
-rw-r--r--Lib/token.py6
-rw-r--r--Lib/tokenize.py2
-rwxr-xr-xLib/trace.py10
-rw-r--r--Lib/traceback.py259
-rw-r--r--Lib/tracemalloc.py487
-rw-r--r--Lib/turtle.py22
-rwxr-xr-xLib/turtledemo/__main__.py2
-rw-r--r--Lib/types.py57
-rw-r--r--Lib/unittest/__main__.py3
-rw-r--r--Lib/unittest/case.py391
-rw-r--r--Lib/unittest/loader.py76
-rw-r--r--Lib/unittest/main.py247
-rw-r--r--Lib/unittest/mock.py248
-rw-r--r--Lib/unittest/result.py27
-rw-r--r--Lib/unittest/suite.py31
-rw-r--r--Lib/unittest/test/__main__.py18
-rw-r--r--Lib/unittest/test/support.py38
-rw-r--r--Lib/unittest/test/test_assertions.py4
-rw-r--r--Lib/unittest/test/test_break.py4
-rw-r--r--Lib/unittest/test/test_case.py255
-rw-r--r--Lib/unittest/test/test_discovery.py169
-rw-r--r--Lib/unittest/test/test_functiontestcase.py4
-rw-r--r--Lib/unittest/test/test_loader.py4
-rw-r--r--Lib/unittest/test/test_program.py72
-rw-r--r--Lib/unittest/test/test_result.py92
-rw-r--r--Lib/unittest/test/test_runner.py16
-rw-r--r--Lib/unittest/test/test_setups.py7
-rw-r--r--Lib/unittest/test/test_skipping.py80
-rw-r--r--Lib/unittest/test/test_suite.py81
-rw-r--r--Lib/unittest/test/testmock/__main__.py18
-rw-r--r--Lib/unittest/test/testmock/testcallable.py4
-rw-r--r--Lib/unittest/test/testmock/testhelpers.py59
-rw-r--r--Lib/unittest/test/testmock/testmock.py143
-rw-r--r--Lib/unittest/test/testmock/testpatch.py1
-rw-r--r--Lib/unittest/test/testmock/testwith.py83
-rw-r--r--Lib/unittest/util.py37
-rw-r--r--Lib/urllib/error.py14
-rw-r--r--Lib/urllib/parse.py9
-rw-r--r--Lib/urllib/request.py195
-rw-r--r--Lib/uuid.py11
-rw-r--r--Lib/venv/__init__.py79
-rw-r--r--Lib/venv/scripts/nt/Activate.ps145
-rw-r--r--Lib/venv/scripts/nt/Deactivate.ps119
-rw-r--r--Lib/venv/scripts/nt/activate.bat2
-rw-r--r--Lib/venv/scripts/posix/activate4
-rw-r--r--Lib/venv/scripts/posix/activate.csh37
-rw-r--r--Lib/venv/scripts/posix/activate.fish74
-rw-r--r--Lib/warnings.py8
-rw-r--r--Lib/wave.py88
-rw-r--r--Lib/weakref.py198
-rwxr-xr-xLib/webbrowser.py95
-rw-r--r--Lib/wsgiref/__init__.py2
-rw-r--r--Lib/xml/dom/expatbuilder.py10
-rw-r--r--Lib/xml/etree/ElementInclude.py6
-rw-r--r--Lib/xml/etree/ElementPath.py15
-rw-r--r--Lib/xml/etree/ElementTree.py1431
-rw-r--r--Lib/xmlrpc/client.py9
-rw-r--r--Lib/xmlrpc/server.py7
-rw-r--r--Lib/zipfile.py202
-rw-r--r--Mac/BuildScript/README.txt12
-rwxr-xr-xMac/BuildScript/build-installer.py101
-rw-r--r--Mac/BuildScript/resources/ReadMe.txt30
-rw-r--r--Mac/BuildScript/resources/Welcome.rtf18
-rwxr-xr-xMac/BuildScript/scripts/postflight.ensurepip65
-rw-r--r--Mac/Makefile.in129
-rw-r--r--Mac/README10
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Help_Indexing_Tool_Suite.py110
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Miscellaneous_Standards.py49
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Required_Suite.py32
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/Standard_Suite.py343
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/__init__.py78
-rw-r--r--Mac/Tools/Doc/HelpIndexingTool/odds_and_ends.py49
-rw-r--r--Mac/Tools/Doc/README35
-rw-r--r--Mac/Tools/Doc/setup.py213
-rwxr-xr-x[-rw-r--r--]Mac/Tools/bundlebuilder.py2
-rwxr-xr-xMac/Tools/plistlib_generate_testdata.py103
-rw-r--r--Makefile.pre.in171
-rw-r--r--Misc/ACKS65
-rw-r--r--Misc/HISTORY4101
-rw-r--r--Misc/NEWS3477
-rw-r--r--Misc/README4
-rw-r--r--Misc/RPM/python-3.4.spec (renamed from Misc/RPM/python-3.3.spec)7
-rw-r--r--Misc/SpecialBuilds.txt4
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/2 to 3 - Module Deletion.tmCommand64
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Build Docs.tmCommand23
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Build.tmCommand25
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Go to Issue.tmCommand20
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Open Docs.tmCommand32
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Commands/Open PEP.tmCommand23
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion (docs).tmSnippet16
-rw-r--r--Misc/TextMate/Python-Dev.tmbundle/info.plist37
-rw-r--r--Misc/Vim/python.vim148
-rw-r--r--Misc/Vim/syntax_test.py62
-rw-r--r--Misc/Vim/vim_syntax.py229
-rw-r--r--Misc/Vim/vimrc87
-rw-r--r--Misc/coverity_model.c132
-rw-r--r--Misc/python-config.in2
-rw-r--r--Misc/python-config.sh.in111
-rw-r--r--Misc/python-wing5.wpr18
-rw-r--r--Misc/python.man14
-rw-r--r--Modules/Setup.dist22
-rw-r--r--Modules/_bisectmodule.c5
-rw-r--r--Modules/_bz2module.c196
-rw-r--r--Modules/_codecsmodule.c6
-rw-r--r--Modules/_collectionsmodule.c412
-rw-r--r--Modules/_cryptmodule.c82
-rw-r--r--Modules/_csv.c18
-rw-r--r--Modules/_ctypes/_ctypes.c80
-rw-r--r--Modules/_ctypes/callbacks.c23
-rw-r--r--Modules/_ctypes/callproc.c105
-rw-r--r--Modules/_ctypes/libffi.diff36
-rw-r--r--Modules/_ctypes/libffi/src/dlmalloc.c8
-rw-r--r--Modules/_ctypes/libffi/testsuite/libffi.call/a.out0
-rw-r--r--Modules/_ctypes/libffi_osx/ffi.c11
-rw-r--r--Modules/_ctypes/libffi_osx/x86/x86-ffi64.c11
-rw-r--r--Modules/_ctypes/stgdict.c4
-rw-r--r--Modules/_curses_panel.c8
-rw-r--r--Modules/_cursesmodule.c258
-rw-r--r--Modules/_datetimemodule.c191
-rw-r--r--Modules/_dbmmodule.c196
-rw-r--r--Modules/_elementtree.c426
-rw-r--r--Modules/_freeze_importlib.c6
-rw-r--r--Modules/_gdbmmodule.c38
-rw-r--r--Modules/_gestalt.c84
-rw-r--r--Modules/_hashopenssl.c254
-rw-r--r--Modules/_heapqmodule.c5
-rw-r--r--Modules/_io/_iomodule.c49
-rw-r--r--Modules/_io/_iomodule.h7
-rw-r--r--Modules/_io/bufferedio.c89
-rw-r--r--Modules/_io/fileio.c209
-rw-r--r--Modules/_io/iobase.c129
-rw-r--r--Modules/_io/textio.c114
-rw-r--r--Modules/_json.c169
-rw-r--r--Modules/_localemodule.c39
-rw-r--r--Modules/_lsprof.c32
-rw-r--r--Modules/_lzmamodule.c377
-rw-r--r--Modules/_multiprocessing/multiprocessing.c32
-rw-r--r--Modules/_multiprocessing/multiprocessing.h16
-rw-r--r--Modules/_multiprocessing/semaphore.c98
-rw-r--r--Modules/_opcode.c109
-rw-r--r--Modules/_operator.c (renamed from Modules/operator.c)125
-rw-r--r--Modules/_pickle.c3194
-rw-r--r--Modules/_posixsubprocess.c178
-rw-r--r--Modules/_randommodule.c109
-rw-r--r--Modules/_sqlite/cache.c1
-rw-r--r--Modules/_sqlite/connection.c109
-rw-r--r--Modules/_sqlite/cursor.c17
-rw-r--r--Modules/_sqlite/module.c16
-rw-r--r--Modules/_sqlite/prepare_protocol.c1
-rw-r--r--Modules/_sqlite/row.c14
-rw-r--r--Modules/_sqlite/sqlitecompat.h63
-rw-r--r--Modules/_sqlite/statement.c33
-rw-r--r--Modules/_sqlite/util.c2
-rw-r--r--Modules/_sre.c1911
-rw-r--r--Modules/_ssl.c1443
-rw-r--r--Modules/_stat.c563
-rw-r--r--Modules/_struct.c359
-rw-r--r--Modules/_testbuffer.c62
-rw-r--r--Modules/_testcapimodule.c486
-rw-r--r--Modules/_testembed.c94
-rw-r--r--Modules/_testimportmultiple.c57
-rw-r--r--Modules/_threadmodule.c98
-rw-r--r--Modules/_tkinter.c666
-rw-r--r--Modules/_tracemalloc.c1429
-rw-r--r--Modules/_weakref.c63
-rw-r--r--Modules/_winapi.c43
-rw-r--r--Modules/arraymodule.c122
-rw-r--r--Modules/atexitmodule.c121
-rw-r--r--Modules/audioop.c1299
-rw-r--r--Modules/binascii.c658
-rw-r--r--Modules/cjkcodecs/_codecs_cn.c293
-rw-r--r--Modules/cjkcodecs/_codecs_hk.c93
-rw-r--r--Modules/cjkcodecs/_codecs_iso2022.c475
-rw-r--r--Modules/cjkcodecs/_codecs_jp.c459
-rw-r--r--Modules/cjkcodecs/_codecs_kr.c204
-rw-r--r--Modules/cjkcodecs/_codecs_tw.c93
-rw-r--r--Modules/cjkcodecs/alg_jisx0201.h75
-rw-r--r--Modules/cjkcodecs/cjkcodecs.h203
-rw-r--r--Modules/cjkcodecs/emu_jisx0213_2000.h33
-rw-r--r--Modules/cjkcodecs/mappings_cn.h2
-rw-r--r--Modules/cjkcodecs/mappings_jisx0213_pair.h2
-rw-r--r--Modules/cjkcodecs/multibytecodec.c344
-rw-r--r--Modules/cjkcodecs/multibytecodec.h27
-rw-r--r--Modules/clinic/_bz2module.c.h162
-rw-r--r--Modules/clinic/_lzmamodule.c.h245
-rw-r--r--Modules/clinic/_pickle.c.h491
-rw-r--r--Modules/clinic/audioop.c.h889
-rw-r--r--Modules/clinic/binascii.c.h478
-rw-r--r--Modules/clinic/zlibmodule.c.h453
-rw-r--r--Modules/cmathmodule.c2
-rw-r--r--Modules/expat/xmlparse.c12
-rw-r--r--Modules/expat/xmlrole.c4
-rw-r--r--Modules/expat/xmltok.c4
-rw-r--r--Modules/faulthandler.c35
-rw-r--r--Modules/fcntlmodule.c178
-rw-r--r--Modules/fpectlmodule.c29
-rw-r--r--Modules/gcmodule.c289
-rw-r--r--Modules/getpath.c136
-rw-r--r--Modules/grpmodule.c16
-rw-r--r--Modules/hashlib.h33
-rw-r--r--Modules/hashtable.c518
-rw-r--r--Modules/hashtable.h128
-rw-r--r--Modules/itertoolsmodule.c55
-rw-r--r--Modules/main.c102
-rw-r--r--Modules/md5module.c21
-rw-r--r--Modules/mmapmodule.c22
-rw-r--r--Modules/ossaudiodev.c13
-rw-r--r--Modules/overlapped.c1380
-rw-r--r--Modules/parsermodule.c154
-rw-r--r--Modules/posixmodule.c2708
-rw-r--r--Modules/pwdmodule.c17
-rw-r--r--Modules/pyexpat.c67
-rw-r--r--Modules/python.c27
-rw-r--r--Modules/readline.c170
-rw-r--r--Modules/resource.c191
-rw-r--r--Modules/selectmodule.c271
-rw-r--r--Modules/sha1module.c21
-rw-r--r--Modules/sha256module.c44
-rw-r--r--Modules/sha512module.c43
-rw-r--r--Modules/signalmodule.c47
-rw-r--r--Modules/socketmodule.c1345
-rw-r--r--Modules/socketmodule.h6
-rw-r--r--Modules/spwdmodule.c22
-rw-r--r--Modules/sre.h10
-rw-r--r--Modules/sre_constants.h2
-rw-r--r--Modules/sre_lib.h1343
-rw-r--r--Modules/symtablemodule.c42
-rw-r--r--Modules/syslogmodule.c66
-rw-r--r--Modules/timemodule.c103
-rw-r--r--Modules/unicodedata.c77
-rw-r--r--Modules/unicodedata_db.h1988
-rw-r--r--Modules/unicodename_db.h33019
-rw-r--r--Modules/xxlimited.c2
-rw-r--r--Modules/zipimport.c68
-rw-r--r--Modules/zlib/ChangeLog266
-rw-r--r--Modules/zlib/FAQ12
-rw-r--r--Modules/zlib/INDEX13
-rw-r--r--Modules/zlib/Makefile.in111
-rw-r--r--Modules/zlib/README24
-rw-r--r--Modules/zlib/adler32.c68
-rw-r--r--Modules/zlib/algorithm.txt4
-rw-r--r--Modules/zlib/compress.c2
-rwxr-xr-xModules/zlib/configure521
-rw-r--r--Modules/zlib/crc32.c83
-rw-r--r--Modules/zlib/crc32.h2
-rw-r--r--Modules/zlib/deflate.c267
-rw-r--r--Modules/zlib/deflate.h12
-rw-r--r--Modules/zlib/example.c90
-rw-r--r--Modules/zlib/gzguts.h103
-rw-r--r--Modules/zlib/gzio.c1026
-rw-r--r--Modules/zlib/gzlib.c197
-rw-r--r--Modules/zlib/gzread.c431
-rw-r--r--Modules/zlib/gzwrite.c196
-rw-r--r--Modules/zlib/infback.c16
-rw-r--r--Modules/zlib/inffast.c6
-rw-r--r--Modules/zlib/inffixed.h6
-rw-r--r--Modules/zlib/inflate.c136
-rw-r--r--Modules/zlib/inftrees.c54
-rw-r--r--Modules/zlib/inftrees.h2
-rw-r--r--Modules/zlib/make_vms.com403
-rw-r--r--Modules/zlib/minigzip.c213
-rw-r--r--Modules/zlib/trees.c54
-rw-r--r--Modules/zlib/uncompr.c2
-rw-r--r--Modules/zlib/zconf.h201
-rw-r--r--Modules/zlib/zconf.h.cmakein201
-rw-r--r--Modules/zlib/zconf.h.in201
-rw-r--r--Modules/zlib/zconf.in.h332
-rw-r--r--Modules/zlib/zlib.318
-rw-r--r--Modules/zlib/zlib.h345
-rw-r--r--Modules/zlib/zlib.map15
-rw-r--r--Modules/zlib/zutil.c26
-rw-r--r--Modules/zlib/zutil.h103
-rw-r--r--Modules/zlibmodule.c710
-rw-r--r--Objects/abstract.c144
-rw-r--r--Objects/bytearrayobject.c440
-rw-r--r--Objects/bytes_methods.c30
-rw-r--r--Objects/bytesobject.c269
-rw-r--r--Objects/classobject.c34
-rw-r--r--Objects/codeobject.c5
-rw-r--r--Objects/complexobject.c28
-rw-r--r--Objects/descrobject.c98
-rw-r--r--Objects/dictobject.c418
-rw-r--r--Objects/exceptions.c274
-rw-r--r--Objects/fileobject.c6
-rw-r--r--Objects/floatobject.c37
-rw-r--r--Objects/frameobject.c136
-rw-r--r--Objects/funcobject.c101
-rw-r--r--Objects/genobject.c108
-rw-r--r--Objects/iterobject.c13
-rw-r--r--Objects/listobject.c106
-rw-r--r--Objects/longobject.c198
-rw-r--r--Objects/memoryobject.c4
-rw-r--r--Objects/methodobject.c91
-rw-r--r--Objects/moduleobject.c122
-rw-r--r--Objects/namespaceobject.c62
-rw-r--r--Objects/object.c348
-rw-r--r--Objects/obmalloc.c584
-rw-r--r--Objects/rangeobject.c205
-rw-r--r--Objects/setobject.c531
-rw-r--r--Objects/sliceobject.c204
-rw-r--r--Objects/stringlib/asciilib.h1
-rw-r--r--Objects/stringlib/codecs.h116
-rw-r--r--Objects/stringlib/eq.h4
-rw-r--r--Objects/stringlib/fastsearch.h8
-rw-r--r--Objects/stringlib/find_max_char.h4
-rw-r--r--Objects/stringlib/join.h133
-rw-r--r--Objects/stringlib/partition.h10
-rw-r--r--Objects/stringlib/replace.h53
-rw-r--r--Objects/stringlib/split.h4
-rw-r--r--Objects/stringlib/stringdefs.h1
-rw-r--r--Objects/stringlib/transmogrify.h8
-rw-r--r--Objects/stringlib/ucs1lib.h1
-rw-r--r--Objects/stringlib/ucs2lib.h1
-rw-r--r--Objects/stringlib/ucs4lib.h1
-rw-r--r--Objects/stringlib/undef.h1
-rw-r--r--Objects/stringlib/unicode_format.h141
-rw-r--r--Objects/stringlib/unicodedefs.h6
-rw-r--r--Objects/structseq.c86
-rw-r--r--Objects/tupleobject.c121
-rw-r--r--Objects/typeobject.c1114
-rw-r--r--Objects/unicodectype.c2
-rw-r--r--Objects/unicodeobject.c4824
-rw-r--r--Objects/unicodetype_db.h25
-rw-r--r--Objects/weakrefobject.c7
-rw-r--r--PC/VC6/_ctypes.dsp131
-rw-r--r--PC/VC6/_ctypes_test.dsp99
-rw-r--r--PC/VC6/_elementtree.dsp111
-rw-r--r--PC/VC6/_msi.dsp99
-rw-r--r--PC/VC6/_multiprocessing.dsp107
-rw-r--r--PC/VC6/_socket.dsp99
-rw-r--r--PC/VC6/_sqlite3.dsp131
-rw-r--r--PC/VC6/_ssl.dsp89
-rw-r--r--PC/VC6/_ssl.mak22
-rw-r--r--PC/VC6/_testcapi.dsp99
-rw-r--r--PC/VC6/_tkinter.dsp103
-rw-r--r--PC/VC6/build_ssl.py228
-rw-r--r--PC/VC6/build_tkinter.py81
-rw-r--r--PC/VC6/bz2.dsp99
-rw-r--r--PC/VC6/make_versioninfo.dsp108
-rw-r--r--PC/VC6/pcbuild.dsw306
-rw-r--r--PC/VC6/pyexpat.dsp111
-rw-r--r--PC/VC6/python.dsp100
-rw-r--r--PC/VC6/pythoncore.dsp780
-rw-r--r--PC/VC6/pythonw.dsp101
-rw-r--r--PC/VC6/readme.txt192
-rw-r--r--PC/VC6/rmpyc.py25
-rwxr-xr-xPC/VC6/rt.bat41
-rw-r--r--PC/VC6/select.dsp99
-rw-r--r--PC/VC6/tcl852.patch11
-rw-r--r--PC/VC6/unicodedata.dsp99
-rw-r--r--PC/VC6/w9xpopen.dsp97
-rw-r--r--PC/VC6/winsound.dsp99
-rw-r--r--PC/VS7.1/Uninstal.wse514
-rw-r--r--PC/VS7.1/_ctypes.vcproj311
-rw-r--r--PC/VS7.1/_ctypes_test.vcproj242
-rw-r--r--PC/VS7.1/_elementtree.vcproj264
-rw-r--r--PC/VS7.1/_msi.vcproj252
-rw-r--r--PC/VS7.1/_socket.vcproj254
-rw-r--r--PC/VS7.1/_sqlite3.vcproj283
-rw-r--r--PC/VS7.1/_ssl.mak38
-rw-r--r--PC/VS7.1/_ssl.vcproj84
-rw-r--r--PC/VS7.1/_testcapi.vcproj247
-rw-r--r--PC/VS7.1/_tkinter.vcproj261
-rw-r--r--PC/VS7.1/amd64_ml64.bat17
-rw-r--r--PC/VS7.1/build_ssl.bat12
-rw-r--r--PC/VS7.1/build_ssl.py181
-rw-r--r--PC/VS7.1/bz2.vcproj271
-rw-r--r--PC/VS7.1/db.build10
-rw-r--r--PC/VS7.1/field3.py35
-rw-r--r--PC/VS7.1/installer.bmpbin58806 -> 0 bytes
-rw-r--r--PC/VS7.1/make_buildinfo.c92
-rw-r--r--PC/VS7.1/make_buildinfo.vcproj122
-rw-r--r--PC/VS7.1/make_versioninfo.vcproj142
-rw-r--r--PC/VS7.1/pcbuild.sln275
-rw-r--r--PC/VS7.1/pyexpat.vcproj263
-rw-r--r--PC/VS7.1/python.build20
-rw-r--r--PC/VS7.1/python.iss341
-rw-r--r--PC/VS7.1/python.vcproj274
-rw-r--r--PC/VS7.1/python20.wse3117
-rw-r--r--PC/VS7.1/pythoncore.vcproj826
-rw-r--r--PC/VS7.1/pythonw.vcproj261
-rw-r--r--PC/VS7.1/readme.txt337
-rw-r--r--PC/VS7.1/rmpyc.py25
-rwxr-xr-xPC/VS7.1/rt.bat52
-rw-r--r--PC/VS7.1/select.vcproj258
-rw-r--r--PC/VS7.1/unicodedata.vcproj247
-rw-r--r--PC/VS7.1/w9xpopen.vcproj121
-rw-r--r--PC/VS7.1/winsound.vcproj251
-rw-r--r--PC/VS8.0/_ctypes.vcproj705
-rw-r--r--PC/VS8.0/_ctypes_test.vcproj521
-rw-r--r--PC/VS8.0/_elementtree.vcproj613
-rw-r--r--PC/VS8.0/_hashlib.vcproj537
-rw-r--r--PC/VS8.0/_msi.vcproj529
-rw-r--r--PC/VS8.0/_multiprocessing.vcproj545
-rw-r--r--PC/VS8.0/_socket.vcproj537
-rw-r--r--PC/VS8.0/_sqlite3.vcproj613
-rw-r--r--PC/VS8.0/_ssl.vcproj537
-rw-r--r--PC/VS8.0/_tkinter.vcproj541
-rw-r--r--PC/VS8.0/bdist_wininst.vcproj270
-rw-r--r--PC/VS8.0/build.bat17
-rw-r--r--PC/VS8.0/build_env.bat1
-rw-r--r--PC/VS8.0/build_pgo.bat41
-rw-r--r--PC/VS8.0/build_ssl.bat12
-rw-r--r--PC/VS8.0/build_ssl.py277
-rw-r--r--PC/VS8.0/build_tkinter.py85
-rw-r--r--PC/VS8.0/bz2.vcproj581
-rw-r--r--PC/VS8.0/debug.vsprops15
-rw-r--r--PC/VS8.0/env.bat5
-rw-r--r--PC/VS8.0/field3.py35
-rw-r--r--PC/VS8.0/idle.bat15
-rw-r--r--PC/VS8.0/kill_python.c178
-rw-r--r--PC/VS8.0/kill_python.vcproj279
-rw-r--r--PC/VS8.0/make_buildinfo.c116
-rw-r--r--PC/VS8.0/make_buildinfo.vcproj101
-rw-r--r--PC/VS8.0/make_versioninfo.vcproj324
-rw-r--r--PC/VS8.0/pcbuild.sln560
-rw-r--r--PC/VS8.0/pginstrument.vsprops34
-rw-r--r--PC/VS8.0/pgupdate.vsprops14
-rw-r--r--PC/VS8.0/pyd.vsprops28
-rw-r--r--PC/VS8.0/pyd_d.vsprops36
-rw-r--r--PC/VS8.0/pyexpat.vcproj553
-rw-r--r--PC/VS8.0/pyproject.vsprops87
-rw-r--r--PC/VS8.0/python.vcproj637
-rw-r--r--PC/VS8.0/pythoncore.vcproj1921
-rw-r--r--PC/VS8.0/pythonw.vcproj618
-rw-r--r--PC/VS8.0/release.vsprops15
-rw-r--r--PC/VS8.0/rmpyc.py25
-rw-r--r--PC/VS8.0/rt.bat52
-rw-r--r--PC/VS8.0/select.vcproj537
-rw-r--r--PC/VS8.0/sqlite3.vcproj537
-rw-r--r--PC/VS8.0/sqlite3.vsprops14
-rw-r--r--PC/VS8.0/ssl.vcproj189
-rw-r--r--PC/VS8.0/unicodedata.vcproj533
-rw-r--r--PC/VS8.0/w9xpopen.vcproj576
-rw-r--r--PC/VS8.0/winsound.vcproj523
-rw-r--r--PC/VS8.0/x64.vsprops22
-rw-r--r--PC/VS9.0/_sqlite3.vcproj4
-rw-r--r--PC/VS9.0/_ssl.vcproj18
-rw-r--r--PC/VS9.0/_testimportmultiple.vcproj (renamed from PC/VS8.0/_testcapi.vcproj)10
-rw-r--r--PC/VS9.0/kill_python.c2
-rw-r--r--PC/VS9.0/pcbuild.sln42
-rw-r--r--PC/VS9.0/pyproject.vsprops6
-rw-r--r--PC/VS9.0/pythoncore.vcproj90
-rw-r--r--PC/VS9.0/w9xpopen.vcproj576
-rw-r--r--PC/_msi.c80
-rw-r--r--PC/bdist_wininst/install.c2
-rw-r--r--PC/config.c10
-rw-r--r--PC/example_nt/example.vcproj4
-rw-r--r--PC/getpathp.c43
-rw-r--r--PC/launcher.c254
-rw-r--r--PC/msvcrtmodule.c5
-rw-r--r--PC/os2emx/Makefile672
-rw-r--r--PC/os2emx/README.os2emx663
-rw-r--r--PC/os2emx/config.c164
-rw-r--r--PC/os2emx/dlfcn.c223
-rw-r--r--PC/os2emx/dlfcn.h51
-rw-r--r--PC/os2emx/dllentry.c42
-rw-r--r--PC/os2emx/getpathp.c418
-rw-r--r--PC/os2emx/pyconfig.h332
-rw-r--r--PC/os2emx/python33.def1314
-rw-r--r--PC/os2emx/pythonpm.c124
-rw-r--r--PC/os2vacpp/_tkinter.def8
-rw-r--r--PC/os2vacpp/config.c99
-rw-r--r--PC/os2vacpp/getpathp.c482
-rw-r--r--PC/os2vacpp/makefile1549
-rw-r--r--PC/os2vacpp/makefile.omk1047
-rw-r--r--PC/os2vacpp/pyconfig.h212
-rw-r--r--PC/os2vacpp/python.def479
-rw-r--r--PC/os2vacpp/readme.txt119
-rw-r--r--PC/pyconfig.h21
-rw-r--r--PC/python.mk5
-rw-r--r--PC/python3.def1396
-rw-r--r--PC/python3.mak12
-rw-r--r--PC/python34gen.py (renamed from PC/python33gen.py)8
-rw-r--r--PC/python34stub.def (renamed from PC/python33stub.def)4
-rw-r--r--PC/readme.txt13
-rw-r--r--PC/w9xpopen.c112
-rw-r--r--PC/winreg.c12
-rw-r--r--PCbuild/_overlapped.vcxproj234
-rw-r--r--PCbuild/_overlapped.vcxproj.filters (renamed from PCbuild/w9xpopen.vcxproj.filters)4
-rw-r--r--PCbuild/_sqlite3.vcxproj1
-rw-r--r--PCbuild/_sqlite3.vcxproj.filters3
-rw-r--r--PCbuild/_ssl.vcxproj16
-rw-r--r--PCbuild/_testembed.vcxproj161
-rw-r--r--PCbuild/_testembed.vcxproj.filters22
-rw-r--r--PCbuild/_testimportmultiple.vcxproj (renamed from PCbuild/w9xpopen.vcxproj)167
-rw-r--r--PCbuild/_testimportmultiple.vcxproj.filters13
-rw-r--r--PCbuild/build_ssl.bat4
-rw-r--r--PCbuild/build_tkinter.py12
-rw-r--r--PCbuild/kill_python.c2
-rw-r--r--PCbuild/pcbuild.sln88
-rw-r--r--PCbuild/pyproject.props19
-rw-r--r--PCbuild/python.vcxproj8
-rw-r--r--PCbuild/pythoncore.vcxproj15
-rw-r--r--PCbuild/pythoncore.vcxproj.filters35
-rw-r--r--PCbuild/readme.txt485
-rw-r--r--PCbuild/xxlimited.vcxproj5
-rw-r--r--Parser/Python.asdl12
-rw-r--r--Parser/asdl.py33
-rwxr-xr-xParser/asdl_c.py69
-rw-r--r--Parser/grammar.c10
-rw-r--r--Parser/grammar1.c8
-rw-r--r--Parser/myreadline.c48
-rw-r--r--Parser/node.c4
-rw-r--r--Parser/parser.c36
-rw-r--r--Parser/parsetok.c93
-rw-r--r--Parser/pgenmain.c3
-rw-r--r--Parser/tokenizer.c29
-rw-r--r--Parser/tokenizer.h6
-rw-r--r--Python/Python-ast.c370
-rw-r--r--Python/_warnings.c245
-rw-r--r--Python/asdl.c4
-rw-r--r--Python/ast.c239
-rw-r--r--Python/bltinmodule.c181
-rw-r--r--Python/ceval.c2352
-rw-r--r--Python/codecs.c201
-rw-r--r--Python/compile.c490
-rw-r--r--Python/condvar.h2
-rw-r--r--Python/dynload_aix.c12
-rw-r--r--Python/dynload_os2.c42
-rw-r--r--Python/dynload_shlib.c62
-rw-r--r--Python/errors.c285
-rw-r--r--Python/fileutils.c380
-rw-r--r--Python/formatter_unicode.c37
-rw-r--r--Python/frozen.c4
-rw-r--r--Python/frozenmain.c58
-rw-r--r--Python/future.c53
-rw-r--r--Python/getargs.c121
-rw-r--r--Python/getcwd.c83
-rw-r--r--Python/import.c905
-rw-r--r--Python/importdl.c2
-rw-r--r--Python/importdl.h5
-rw-r--r--Python/importlib.h8642
-rw-r--r--Python/marshal.c799
-rw-r--r--Python/modsupport.c12
-rw-r--r--Python/mystrtoul.c32
-rw-r--r--Python/opcode_targets.h4
-rw-r--r--Python/peephole.c55
-rw-r--r--Python/pyarena.c12
-rw-r--r--Python/pyhash.c427
-rw-r--r--Python/pystate.c152
-rw-r--r--Python/pystrtod.c6
-rw-r--r--Python/pythonrun.c542
-rw-r--r--Python/pytime.c35
-rw-r--r--Python/random.c136
-rw-r--r--Python/strdup.c2
-rw-r--r--Python/symtable.c187
-rw-r--r--Python/sysmodule.c258
-rw-r--r--Python/thread.c38
-rw-r--r--Python/thread_nt.h19
-rw-r--r--Python/thread_os2.h267
-rw-r--r--Python/thread_pth.h177
-rw-r--r--Python/thread_pthread.h15
-rw-r--r--Python/traceback.c35
-rw-r--r--README18
-rw-r--r--Tools/buildbot/external-amd64.bat18
-rw-r--r--Tools/buildbot/external-common.bat19
-rw-r--r--Tools/buildbot/external.bat16
-rw-r--r--Tools/buildbot/test-amd64.bat2
-rw-r--r--Tools/buildbot/test.bat2
-rwxr-xr-xTools/clinic/clinic.py4199
-rw-r--r--Tools/clinic/clinic_test.py801
-rw-r--r--Tools/clinic/cpp.py191
-rw-r--r--Tools/freeze/bkfile.py4
-rwxr-xr-xTools/freeze/freeze.py4
-rwxr-xr-xTools/gdb/libpython.py44
-rwxr-xr-xTools/i18n/makelocalealias.py27
-rwxr-xr-xTools/i18n/msgfmt.py2
-rw-r--r--Tools/importbench/importbench.py31
-rw-r--r--Tools/iobench/iobench.py4
-rw-r--r--Tools/msi/msi.py67
-rw-r--r--Tools/parser/unparse.py15
-rw-r--r--Tools/scripts/README126
-rwxr-xr-xTools/scripts/byext.py2
-rwxr-xr-xTools/scripts/byteyears.py2
-rwxr-xr-xTools/scripts/checkpip.py32
-rwxr-xr-xTools/scripts/checkpyc.py12
-rwxr-xr-xTools/scripts/copytime.py4
-rwxr-xr-xTools/scripts/diff.py4
-rwxr-xr-xTools/scripts/finddiv.py2
-rwxr-xr-xTools/scripts/findlinksto.py2
-rwxr-xr-xTools/scripts/fixcid.py8
-rwxr-xr-xTools/scripts/ftpmirror.py20
-rwxr-xr-xTools/scripts/linktree.py6
-rwxr-xr-xTools/scripts/ndiff.py2
-rwxr-xr-xTools/scripts/parse_html5_entities.py105
-rwxr-xr-xTools/scripts/pathfix.py10
-rwxr-xr-xTools/scripts/pindent.py4
-rwxr-xr-xTools/scripts/reindent.py2
-rwxr-xr-xTools/scripts/treesync.py2
-rwxr-xr-xTools/scripts/untabify.py4
-rwxr-xr-xTools/scripts/which.py2
-rw-r--r--Tools/scripts/win_add2path.py2
-rw-r--r--Tools/ssl/test_multiple_versions.py241
-rw-r--r--Tools/stringbench/stringbench.py2
-rw-r--r--Tools/unicode/gencodec.py18
-rw-r--r--Tools/unicode/makeunicodedata.py8
-rw-r--r--Tools/unicode/python-mappings/CP273.TXT258
-rwxr-xr-xconfigure582
-rw-r--r--configure.ac420
-rw-r--r--pyconfig.h.in37
-rw-r--r--setup.py30
1480 files changed, 167484 insertions, 107803 deletions
diff --git a/.gitignore b/.gitignore
index 49299eec1f..59d383265d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,11 +15,13 @@ Doc/tools/jinja2/
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 @@ platform
pybuilddir.txt
pyconfig.h
python
+python-config
+python-config.py
python.exe
python-gdb.py
python.exe-gdb.py
diff --git a/.hgeol b/.hgeol
index 73a4770f32..2919f76a11 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 c42dd03236..91f02fd2a3 100644
--- a/.hgignore
+++ b/.hgignore
@@ -19,21 +19,20 @@ platform$
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
@@ -82,6 +81,9 @@ PCbuild/*.*sdf
PCbuild/Win32-temp-*
PCbuild/x64-temp-*
PCbuild/amd64
+PCbuild/ipch
+Tools/unicode/build/
+Tools/unicode/MAPPINGS/
BuildLog.htm
__pycache__
Modules/_freeze_importlib
@@ -89,3 +91,7 @@ Modules/_testembed
.coverage
coverage/
htmlcov/
+*.gcda
+*.gcno
+*.gcov
+coverage.info
diff --git a/.hgtouch b/.hgtouch
index a629de9310..7e3a5e7370 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 82f5bef0fa..d85fb94a2c 100644
--- a/Doc/Makefile
+++ b/Doc/Makefile
@@ -5,7 +5,7 @@
# You can set these variables from the command line.
PYTHON = python
-SVNROOT = http://svn.python.org/projects
+SPHINXBUILD = sphinx-build
SPHINXOPTS =
PAPER =
SOURCES =
@@ -14,14 +14,13 @@ DISTVERSION = $(shell $(PYTHON) tools/sphinxext/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 " htmlhelp to make HTML files and a HTML help project"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@@ -37,30 +36,8 @@ help:
@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
@@ -120,10 +97,6 @@ htmlview: html
clean:
-rm -rf build/*
- -rm -rf tools/sphinx
- -rm -rf tools/pygments
- -rm -rf tools/jinja2
- -rm -rf tools/docutils
dist:
rm -rf dist
@@ -184,7 +157,6 @@ serve:
# for development releases: always build
autobuild-dev:
- make update
make dist SPHINXOPTS='-A daily=1 -A versionswitcher=1'
-make suspicious
diff --git a/Doc/README.txt b/Doc/README.txt
index a494c89db6..f4f6d81bc9 100644
--- a/Doc/README.txt
+++ b/Doc/README.txt
@@ -3,34 +3,31 @@ Python Documentation README
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 <http://docs.python.org/download/>.
Documentation on the authoring Python documentation, including information about
both style and markup, is available in the "Documenting Python" chapter of the
-documentation.
+developers guide <http://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 <http://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. To view the generated HTML, point your favorite
+browser at the top-level index `build/html/index.html` after running "make".
On Windows, we try to emulate the Makefile as closely as possible with a
``make.bat`` file.
@@ -78,8 +75,6 @@ Available make targets are:
* "suspicious", which checks the parsed markup for text that looks like
malformed and thus unconverted reST.
-A "make update" updates the Subversion checkouts in `tools/`.
-
Without make
------------
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 28a434e5a3..2f0224104e 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -295,6 +295,8 @@ Other objects
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
diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst
index 65904ee49d..2d5638670e 100644
--- a/Doc/c-api/concrete.rst
+++ b/Doc/c-api/concrete.rst
@@ -74,26 +74,35 @@ intrinsic to the Python language.
.. _mapobjects:
-Mapping Objects
-===============
+Container Objects
+=================
.. index:: object: mapping
.. toctree::
dict.rst
+ set.rst
.. _otherobjects:
-Other Objects
-=============
+Function Objects
+================
.. toctree::
- set.rst
function.rst
method.rst
+ cell.rst
+ code.rst
+
+
+Other Objects
+=============
+
+.. toctree::
+
file.rst
module.rst
iterator.rst
@@ -102,7 +111,6 @@ Other Objects
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 6bacc32682..5a9dca2845 100644
--- a/Doc/c-api/dict.rst
+++ b/Doc/c-api/dict.rst
@@ -84,7 +84,7 @@ Dictionary Objects
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 @@ Dictionary Objects
: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.
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 0aa892d75d..7067448b46 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -90,6 +90,16 @@ in various ways. There is a separate error indicator for each thread.
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()
@@ -231,11 +241,20 @@ in various ways. There is a separate error indicator for each thread.
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 @@ in various ways. There is a separate error indicator for each thread.
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 @@ in various ways. There is a separate error indicator for each thread.
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,15 +314,22 @@ in various ways. There is a separate error indicator for each thread.
.. 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.2
+.. 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
.. c:function:: void PyErr_SyntaxLocation(char *filename, int lineno)
@@ -355,15 +383,22 @@ in various ways. There is a separate error indicator for each thread.
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 cc190c9f42..6f2ecee51f 100644
--- a/Doc/c-api/file.rst
+++ b/Doc/c-api/file.rst
@@ -17,7 +17,7 @@ error reporting in the interpreter; third-party code is advised to access
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 270152ebbe..6cd2b8bea0 100644
--- a/Doc/c-api/import.rst
+++ b/Doc/c-api/import.rst
@@ -118,7 +118,7 @@ Importing Modules
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
@@ -145,7 +145,7 @@ Importing Modules
: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 +162,7 @@ Importing Modules
.. 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
@@ -246,7 +246,7 @@ Importing Modules
.. versionadded:: 3.3
-.. 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 4dad2c814d..0587e15d9f 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -86,6 +86,36 @@ Process-wide parameters
=======================
+.. 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::
@@ -329,7 +359,11 @@ Process-wide parameters
.. 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 +692,20 @@ with sub-interpreters:
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.
diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst
index d5430fd56a..b3480159c0 100644
--- a/Doc/c-api/long.rst
+++ b/Doc/c-api/long.rst
@@ -80,7 +80,7 @@ All integers are implemented as "long" integer objects of arbitrary size.
*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 0ef29616e5..2803fd044e 100644
--- a/Doc/c-api/mapping.rst
+++ b/Doc/c-api/mapping.rst
@@ -22,7 +22,7 @@ Mapping Protocol
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 @@ Mapping Protocol
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 8afa56ac6c..a82e1c2f2c 100644
--- a/Doc/c-api/memory.rst
+++ b/Doc/c-api/memory.rst
@@ -84,6 +84,48 @@ the C library allocator as shown in the previous example, the allocated memory
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 @@ Memory Interface
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 @@ versions and is therefore deprecated in extension modules.
: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 bd461709fb..985a347d63 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -35,13 +35,20 @@ There are only a few functions special to module objects.
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 0aba360592..509ca3f0fa 100644
--- a/Doc/c-api/object.rst
+++ b/Doc/c-api/object.rst
@@ -149,6 +149,9 @@ Object Protocol
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 @@ Object Protocol
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
@@ -240,7 +247,7 @@ attribute is considered sufficient for this determination.
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 +257,11 @@ attribute is considered sufficient for this determination.
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 +271,9 @@ attribute is considered sufficient for this determination.
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 +355,15 @@ attribute is considered sufficient for this determination.
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/tuple.rst b/Doc/c-api/tuple.rst
index 184affb222..3922d50f80 100644
--- a/Doc/c-api/tuple.rst
+++ b/Doc/c-api/tuple.rst
@@ -129,6 +129,14 @@ type.
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 5d832541f2..8dc040b852 100644
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -97,3 +97,13 @@ Type Objects
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 f3089d065e..efd85743a4 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -464,6 +464,14 @@ type objects) *must* have the :attr:`ob_size` field.
:const:`Py_TPFLAGS_HAVE_VERSION_TAG`.
+ .. 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
@@ -967,6 +975,47 @@ type objects) *must* have the :attr:`ob_size` field.
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.
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 3649cfb08d..c7ed5e5987 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -526,12 +526,23 @@ APIs:
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)
diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst
index 14ef8df4ae..f7ed4c7713 100644
--- a/Doc/c-api/veryhigh.rst
+++ b/Doc/c-api/veryhigh.rst
@@ -144,6 +144,37 @@ the same library that the Python runtime is using.
(: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 @@ the same library that the Python runtime is using.
*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,8 +282,15 @@ the same library that the Python runtime is using.
``__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)
@@ -285,6 +322,10 @@ the same library that the Python runtime is using.
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 @@ the same library that the Python runtime is using.
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 5b63cad028..c0ed8c62cd 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -61,6 +61,8 @@ add_module_names = True
# By default, highlight as Python 3.
highlight_language = 'python3'
+needs_sphinx = '1.1'
+
# Options for HTML output
# -----------------------
@@ -118,11 +120,11 @@ _stdauthor = r'Guido van Rossum\\Fred L. Drake, Jr., editor'
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'),
diff --git a/Doc/contents.rst b/Doc/contents.rst
index c0c6af34d9..29b07db401 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
+
+.. 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 a42584ce4e..6025617a1b 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*::0:
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_AddModule:const char*:name::
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*::+1:
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:PyObject*::+1:
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_DelItemString:const char*:key::
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_HasKey:PyObject*:key::
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_Length:PyObject*:o:0:
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:PyObject*::+1:
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*::+1:
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_Call:PyObject*:kw:0:
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_CallFunctionObjArgs::...::
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 0000000000..d6710415e2
--- /dev/null
+++ b/Doc/distributing/index.rst
@@ -0,0 +1,143 @@
+.. _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 Package 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
+ <http://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).
+
+
+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
+using ``pip``::
+
+ pip install setuptools wheel twine
+
+
+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 Package Index`_
+
+.. _Project structure: \
+ http://packaging.python.org/en/latest/tutorial.html#creating-your-own-project
+.. _Building and packaging the project: \
+ http://packaging.python.org/en/latest/tutorial.html#building-packaging-your-project
+.. _Uploading the project to the Python Package Index: \
+ http://packaging.python.org/en/latest/tutorial.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 Package 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
+ <http://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
+ http://packaging.python.org/en/latest/deployment.html#pypi-mirrors-and-caches)
diff --git a/Doc/distutils/apiref.rst b/Doc/distutils/apiref.rst
index 9853f021ea..36a911ebbd 100644
--- a/Doc/distutils/apiref.rst
+++ b/Doc/distutils/apiref.rst
@@ -853,17 +853,6 @@ Windows. It also contains the Mingw32CCompiler class which handles the mingw32
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
======================================================
diff --git a/Doc/distutils/builtdist.rst b/Doc/distutils/builtdist.rst
index d1ab7dbce9..83c68ae20c 100644
--- a/Doc/distutils/builtdist.rst
+++ b/Doc/distutils/builtdist.rst
@@ -239,7 +239,8 @@ tedious and error-prone, so it's usually best to put them in the setup
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/index.rst b/Doc/distutils/index.rst
index 1a6f04c87a..90d1c1ab34 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/sourcedist.rst b/Doc/distutils/sourcedist.rst
index 1666436be0..9f7a38eda6 100644
--- a/Doc/distutils/sourcedist.rst
+++ b/Doc/distutils/sourcedist.rst
@@ -26,16 +26,16 @@ to create a gzipped tarball and a zip file. The available formats are:
+===========+=========================+=========+
| ``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 @@ Notes:
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:
diff --git a/Doc/extending/embedding.rst b/Doc/extending/embedding.rst
index bd66086bbb..6cb686ab09 100644
--- a/Doc/extending/embedding.rst
+++ b/Doc/extending/embedding.rst
@@ -285,14 +285,14 @@ be directly useful to you:
* ``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/index.rst b/Doc/extending/index.rst
index 44a7f92c00..dd43926450 100644
--- a/Doc/extending/index.rst
+++ b/Doc/extending/index.rst
@@ -21,14 +21,31 @@ Python) that give the language its wide application range.
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 @@ For a detailed description of the whole Python/C API, see the separate
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 f484ba43e7..45b57211b6 100644
--- a/Doc/extending/newtypes.rst
+++ b/Doc/extending/newtypes.rst
@@ -157,7 +157,8 @@ to :const:`Py_TPFLAGS_DEFAULT`. ::
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 @@ Finalization and De-allocation
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 @@ done. This can be done using the :c:func:`PyErr_Fetch` and
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/library.rst b/Doc/faq/library.rst
index 2566932dc9..5f4ff1797b 100644
--- a/Doc/faq/library.rst
+++ b/Doc/faq/library.rst
@@ -211,7 +211,7 @@ using curses, but curses is a fairly large module to learn.
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 @@ using curses, but curses is a fairly large module to learn.
: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
diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index 280d5e13d2..d514a80e4a 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -1751,12 +1751,12 @@ When I edit an imported module and reimport it, the changes don't show up. Why
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 +1768,10 @@ module contains class definitions, existing class instances will *not* be
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/glossary.rst b/Doc/glossary.rst
index b48eb1ed5f..f71a1f72e5 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -310,6 +310,15 @@ Glossary
>>> 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`.
@@ -530,6 +539,10 @@ Glossary
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 @@ Glossary
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 @@ Glossary
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
diff --git a/Doc/howto/clinic.rst b/Doc/howto/clinic.rst
new file mode 100644
index 0000000000..750ddbe074
--- /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/functional.rst b/Doc/howto/functional.rst
index 7189c65127..97c90c7c0b 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 @@ concepts of functional programming, we'll look at language features such as
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 @@ new programs by arranging existing functions in a new configuration and writing
a few functions specialized for the current task.
+.. _functional-howto-iterators:
+
Iterators
=========
@@ -670,7 +672,7 @@ indexes at which certain conditions are met::
: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 @@ Another group of functions chooses a subset of an iterator's elements based on a
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 @@ iterable's results. ::
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 @@ write the obvious :keyword:`for` loop::
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 @@ features in Python 2.5.
.. 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 @@ features in Python 2.5.
sys.stdout.write(str(elem))
sys.stdout.write(', ')
print(elem[-1])
-
-
diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst
index 81a4f8b98d..2c9d69910a 100644
--- a/Doc/howto/index.rst
+++ b/Doc/howto/index.rst
@@ -28,4 +28,5 @@ Currently, the HOWTOs are:
webservers.rst
argparse.rst
ipaddress.rst
+ clinic.rst
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index 563da9ddee..a21423b2ef 100644
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -704,9 +704,7 @@ the basis for code meeting your own specific requirements::
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)
diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst
index 55b1c867dd..dab58f4109 100644
--- a/Doc/howto/logging.rst
+++ b/Doc/howto/logging.rst
@@ -901,10 +901,10 @@ provided:
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.
diff --git a/Doc/howto/regex.rst b/Doc/howto/regex.rst
index 5203e53700..fbe763b3f2 100644
--- a/Doc/howto/regex.rst
+++ b/Doc/howto/regex.rst
@@ -271,8 +271,8 @@ performing string substitutions. ::
>>> 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 @@ Python interpreter, import the :mod:`re` module, and compile a RE::
>>> 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 @@ should store the result in a variable for later use. ::
>>> 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 @@ case. ::
>>> 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 @@ the RE string added as the first argument, and still return either ``None`` or a
>>> 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 @@ given location, they can obviously be matched an infinite number of times.
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 @@ given location, they can obviously be matched an infinite number of times.
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 @@ given location, they can obviously be matched an infinite number of times.
>>> 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 @@ given location, they can obviously be matched an infinite number of times.
>>> 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/urllib2.rst b/Doc/howto/urllib2.rst
index 5a2266070a..3d5de32152 100644
--- a/Doc/howto/urllib2.rst
+++ b/Doc/howto/urllib2.rst
@@ -507,7 +507,7 @@ than the URL you pass to .add_password() will also match. ::
-- ``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)
diff --git a/Doc/includes/email-alternative-new-api.py b/Doc/includes/email-alternative-new-api.py
new file mode 100644
index 0000000000..c1255a68df
--- /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-dir.py b/Doc/includes/email-dir.py
index cc5529e8fe..3c7c770dda 100644
--- a/Doc/includes/email-dir.py
+++ b/Doc/includes/email-dir.py
@@ -8,7 +8,7 @@ import smtplib
# 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 @@ COMMASPACE = ', '
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 @@ must be running an SMTP server.
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 @@ must be running an SMTP server.
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 0000000000..8ab4e9fd16
--- /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 3653543566..574a0b6d72 100644
--- a/Doc/includes/email-unpack.py
+++ b/Doc/includes/email-unpack.py
@@ -8,41 +8,27 @@ import email
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()
- try:
- msgfile = args[0]
- except IndexError:
- parser.print_help()
- sys.exit(1)
+ with open(args.msgfile) as fp:
+ msg = email.message_from_file(fp)
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 @@ Usage: %prog [options] msgfile
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 3763ea9448..0000000000
--- 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 729174363e..1c796a5640 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 @@ def baz():
# 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 @@ def test():
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 1578498754..11101e1a90 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 noop(x):
#
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
- #
-
- 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)
-
- 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('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()
-
- #
- # Simple benchmarks
- #
-
- N = 100000
- print('def pow3(x): return x**3')
- t = time.time()
- A = list(map(pow3, range(N)))
- print('\tmap(pow3, range(%d)):\n\t\t%s seconds' % \
- (N, time.time() - t))
+ with multiprocessing.Pool(PROCESSES) as pool:
+ #
+ # Tests
+ #
- t = time.time()
- B = pool.map(pow3, range(N))
- print('\tpool.map(pow3, range(%d)):\n\t\t%s seconds' % \
- (N, time.time() - t))
+ TASKS = [(mul, (i, 7)) for i in range(10)] + \
+ [(plus, (i, 8)) for i in range(10)]
- 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))
+ results = [pool.apply_async(calculate, t) for t in TASKS]
+ imap_it = pool.imap(calculatestar, TASKS)
+ imap_unordered_it = pool.imap_unordered(calculatestar, TASKS)
- assert A == B == C, (len(A), len(B), len(C))
- print()
+ print('Ordered results using pool.apply_async():')
+ for r in results:
+ print('\t', r.get())
+ print()
- L = [None] * 1000000
- print('def noop(x): pass')
- print('L = [None] * 1000000')
+ print('Ordered results using pool.imap():')
+ for x in imap_it:
+ print('\t', x)
+ print()
- t = time.time()
- A = list(map(noop, L))
- print('\tmap(noop, L):\n\t\t%s seconds' % \
- (time.time() - t))
+ print('Unordered results using pool.imap_unordered():')
+ for x in imap_unordered_it:
+ print('\t', x)
+ print()
- t = time.time()
- B = pool.map(noop, L)
- print('\tpool.map(noop, L):\n\t\t%s seconds' % \
- (time.time() - t))
+ print('Ordered results using pool.map() --- will block till complete:')
+ for x in pool.map(calculatestar, TASKS):
+ print('\t', x)
+ print()
- 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))
+ #
+ # Test error handling
+ #
- assert A == B == C, (len(A), len(B), len(C))
- print()
+ print('Testing error handling:')
- 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')
-
- assert i == 9
- print('\tGot ZeroDivisionError as expected from IMapIterator.next()')
- print()
+ raise AssertionError('expected ZeroDivisionError')
- #
- # 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()
-
- #
- # Testing callback
- #
-
- print('Testing callback:')
-
- A = []
- B = [56, 0, 1, 8, 27, 64, 125, 216, 343, 512, 729]
-
- r = pool.apply_async(mul, (7, 8), callback=A.append)
- r.wait()
-
- 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(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)
+ except ZeroDivisionError:
+ if i == 5:
+ pass
+ except StopIteration:
+ break
+ else:
+ if i == 5:
+ 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('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 81dbc387fc..0000000000
--- 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 651024d939..0000000000
--- 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 e66d97bd50..3b92269f89 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 32647c0ee5..fcb846acca 100644
--- a/Doc/includes/typestruct.h
+++ b/Doc/includes/typestruct.h
@@ -70,4 +70,11 @@ typedef struct _typeobject {
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 0c9a9f21d8..d0fea3d4f1 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
diff --git a/Doc/installing/index.rst b/Doc/installing/index.rst
new file mode 100644
index 0000000000..12846136b6
--- /dev/null
+++ b/Doc/installing/index.rst
@@ -0,0 +1,210 @@
+.. 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
+* the `Python Package 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
+ <http://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. For Windows users, the examples below assume that the option to
+adjust the system PATH environment variable was selected when installing
+Python. For Linux users, the command to install into the system version of
+Python 3 is likely to be ``pip3`` rather than ``pip``.
+
+The following command will install the latest version of a module and its
+dependencies from the Python Package Index::
+
+ pip install SomePackage
+
+It's also possible to specify an exact or minimum version directly on the
+command line::
+
+ pip install SomePackage==1.0.4 # specific version
+ 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::
+
+ pip install --upgrade SomePackage
+
+More information and resources regarding ``pip`` and its capabilities can be
+found in the `Python Packaging User Guide <http://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 packages
+ <http://packaging.python.org/en/latest/tutorial.html#installing-python-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: Installing the Tools
+ <http://packaging.python.org/en/latest/tutorial.html#installing-the-tools>`__
+
+
+.. installing-per-user-installation:
+
+... install packages just for the current user?
+-----------------------------------------------
+
+Passing the ``--user`` option to ``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
+<http://packaging.python.org/en/latest/platforms.html#installing-scientific-packages>`__
+rather than attempting to install them with ``pip``.
+
+.. seealso::
+
+ `Python Packaging User Guide: Installing Scientific Packages
+ <http://packaging.python.org/en/latest/platforms.html#installing-scientific-packages>`__
+
+
+... 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
+ http://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 Package 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
+<http://packaging.python.org/en/latest/platforms.html#installing-scientific-packages>`__
+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
+ <http://packaging.python.org/en/latest/extensions.html>`__
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index 1e5f42d05a..1092e6b620 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -142,6 +142,39 @@ and off individually. They are described here in more detail.
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 @@ and off individually. They are described here in more detail.
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`.
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst
index 9299124380..7a73704bf6 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 @@ a class or instance provides a particular interface, for example, is it
hashable or a mapping.
-This module provides the following class:
+This module provides the following classes:
.. class:: ABCMeta
@@ -58,6 +58,10 @@ This module provides the following class:
.. 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 @@ This module provides the following class:
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 @@ The :mod:`abc` module also provides the following decorators:
: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 8a3541b806..6fbcf286cf 100644
--- a/Doc/library/aifc.rst
+++ b/Doc/library/aifc.rst
@@ -30,8 +30,8 @@ sampling rate or frame rate is the number of times per second the sound is
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 @@ Module :mod:`aifc` defines the following function:
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 @@ following methods:
.. 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 @@ number of frames must be filled in.
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/argparse.rst b/Doc/library/argparse.rst
index b686c44e4f..b1b5135eac 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -977,9 +977,9 @@ See the section on the default_ keyword argument for information on when the
``type`` argument is applied to default arguments.
To ease the use of various types of files, the argparse module provides the
-factory FileType which takes the ``mode=`` and ``bufsize=`` arguments of the
-:func:`open` function. For example, ``FileType('w')`` can be used to create a
-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'))
@@ -1648,17 +1648,19 @@ Sub-commands
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
@@ -1669,6 +1671,9 @@ FileType objects
>>> parser.parse_args(['-'])
Namespace(infile=<_io.TextIOWrapper name='<stdin>' encoding='UTF-8'>)
+ .. versionadded:: 3.4
+ The *encodings* and *errors* keyword arguments.
+
Argument groups
^^^^^^^^^^^^^^^
diff --git a/Doc/library/asynchat.rst b/Doc/library/asynchat.rst
index adbd3be758..c6fa06162e 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 0000000000..9d6f054a7c
--- /dev/null
+++ b/Doc/library/asyncio-dev.rst
@@ -0,0 +1,251 @@
+.. 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-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::
+
+ See the :ref:`Synchronization primitives <asyncio-sync>` section to
+ synchronize tasks.
+
+
+.. _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 but not passed to :func:`async` or to the
+:class:`Task` constructor, it is not scheduled and it is probably a bug.
+
+To detect such bug, set the environment variable :envvar:`PYTHONASYNCIODEBUG`
+to ``1``. When the coroutine object is destroyed by the garbage collector, a
+log will be emitted with the traceback where the coroutine function was called.
+See the :ref:`asyncio logger <asyncio-logger>`.
+
+The debug flag changes the behaviour of the :func:`coroutine` decorator. The
+debug flag value is only used when then coroutine function is defined, not when
+it is called. Coroutine functions defined before the debug flag is set to
+``True`` will not be tracked. For example, it is not possible to debug
+coroutines defined in the :mod:`asyncio` module, because the module must be
+imported before the flag value can be changed.
+
+Example with the bug::
+
+ import asyncio
+
+ @asyncio.coroutine
+ def test():
+ print("never scheduled")
+
+ test()
+
+Output in debug mode::
+
+ Coroutine 'test' defined at test.py:4 was never yielded from
+
+The fix is to call the :func:`async` function or create a :class:`Task` object
+with this coroutine object.
+
+
+Detect exceptions not consumed
+------------------------------
+
+Python usually calls :func:`sys.displayhook` on unhandled exceptions. If
+:meth:`Future.set_exception` is called, but the exception is not consumed,
+:func:`sys.displayhook` is not called. Instead, a log is emitted when the
+future is deleted by the garbage collector, with the traceback where the
+exception was raised. See the :ref:`asyncio logger <asyncio-logger>`.
+
+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::
+
+ Future/Task exception was never retrieved:
+ Traceback (most recent call last):
+ File "/usr/lib/python3.4/asyncio/tasks.py", line 279, in _step
+ result = next(coro)
+ File "/usr/lib/python3.4/asyncio/tasks.py", line 80, 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 to
+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")
+
+See also 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(<create>)<PENDING>}
+
+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()
+
diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
new file mode 100644
index 0000000000..df8416959f
--- /dev/null
+++ b/Doc/library/asyncio-eventloop.rst
@@ -0,0 +1,742 @@
+.. currentmodule:: asyncio
+
+.. _asyncio-event-loop:
+
+Event loops
+===========
+
+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.
+
+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 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()``.
+
+Event loop policy interface
+---------------------------
+
+An event loop policy must implement the following interface:
+
+.. class:: AbstractEventLoopPolicy
+
+ .. method:: get_event_loop()
+
+ Get the event loop for current context. Returns an event loop object
+ implementing :class:`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``.
+
+ .. method:: set_event_loop(loop)
+
+ Set the event loop of 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 of 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.
+
+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 <coroutine>`, it is wrapped
+ in a :class:`Task`.
+
+ 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.
+ Callback scheduled after :meth:`stop` is called won't. However, those
+ callbacks will run if :meth:`run_forever` is called again later.
+
+.. method:: BaseEventLoop.close()
+
+ Close the event loop. The loop should 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.
+
+
+Calls
+-----
+
+.. method:: BaseEventLoop.call_soon(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.
+
+ An instance of :class:`asyncio.Handle` is returned.
+
+.. 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`.
+
+.. 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:`time`.
+
+ This method's behavior is the same as :meth:`call_later`.
+
+.. 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.
+
+
+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.
+
+ * *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*.
+
+ .. 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.
+
+
+.. 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)
+
+ A :ref:`coroutine <coroutine>` method which creates a TCP server bound to
+ host and port.
+
+ The return value is a :class:`AbstractServer` 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 :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.
+
+ *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.
+
+ .. 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
+----------------------
+
+.. method:: BaseEventLoop.add_reader(fd, callback, \*args)
+
+ Start watching the file descriptor for read availability and then call the
+ *callback* with specified arguments.
+
+.. 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.
+
+.. method:: BaseEventLoop.remove_writer(fd)
+
+ Stop watching the file descriptor for write availability.
+
+
+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*.
+
+ 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.
+
+ 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.
+
+ 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.
+
+ 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.
+
+
+Running subprocesses
+--------------------
+
+Run subprocesses asynchronously using the :mod:`subprocess` module.
+
+.. note::
+
+ On Windows, the default event loop uses
+ :class:`selectors.SelectSelector` which only supports sockets. The
+ :class:`ProactorEventLoop` should be used to support subprocesses.
+
+.. note::
+
+ On Mac OS X older than 10.9 (Mavericks), :class:`selectors.KqueueSelector`
+ does not support character devices like PTY, whereas it is used by the
+ default event loop. The :class:`SelectorEventLoop` can be used with
+ :class:`SelectSelector` or :class:`PollSelector` to handle character devices
+ on Mac OS X 10.6 (Snow Leopard) and later.
+
+.. 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, 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.
+
+ 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 string using the platform's
+ "shell" syntax. This is similar to the standard library
+ :class:`subprocess.Popen` class called with ``shell=True``.
+
+ 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`.
+
+ This method is a :ref:`coroutine <coroutine>`.
+
+ See the constructor of the :class:`subprocess.Popen` class for parameters.
+
+.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe)
+
+ Register read pipe in eventloop.
+
+ *protocol_factory* should instantiate object with :class:`Protocol`
+ interface. pipe is file-like object already switched to nonblocking.
+ Return pair (transport, protocol), where transport support
+ :class:`ReadTransport` interface.
+
+ 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 file-like object already switched to nonblocking.
+ Return pair (transport, protocol), where transport support
+ :class:`WriteTransport` interface.
+
+ This method is a :ref:`coroutine <coroutine>`.
+
+.. seealso::
+
+ The :func:`create_subprocess_exec` and :func:`create_subprocess_shell`
+ functions.
+
+
+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.
+
+.. 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``.
+
+ 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, ``False`` by default.
+
+.. method:: BaseEventLoop.set_debug(enabled: bool)
+
+ Set the debug mode of the event loop.
+
+.. seealso::
+
+ The :ref:`Develop with asyncio <asyncio-dev>` section.
+
+
+Server
+------
+
+.. class:: AbstractServer
+
+ Abstract server returned by :func:`BaseEventLoop.create_server`.
+
+ .. method:: close()
+
+ Stop serving. This leaves existing connections open.
+
+ .. method:: wait_closed()
+
+ A :ref:`coroutine <coroutine>` to wait until service 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.
+
+
+.. _asyncio-hello-world-callback:
+
+Example: Hello World (callback)
+-------------------------------
+
+Print ``Hello World`` every two seconds, using a callback::
+
+ import asyncio
+
+ def print_and_repeat(loop):
+ print('Hello World')
+ loop.call_later(2, print_and_repeat, loop)
+
+ loop = asyncio.get_event_loop()
+ loop.call_soon(print_and_repeat, loop)
+ loop.run_forever()
+
+.. seealso::
+
+ :ref:`Hello World example using a coroutine <asyncio-hello-world-coroutine>`.
+
+
+Example: Set signal handlers for SIGINT and SIGTERM
+---------------------------------------------------
+
+Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM`::
+
+ 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())
+ loop.run_forever()
+
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
new file mode 100644
index 0000000000..80c974af06
--- /dev/null
+++ b/Doc/library/asyncio-protocol.rst
@@ -0,0 +1,502 @@
+.. currentmodule:: asyncio
+
++++++++++++++++++++++++++++++++++++++++++
+Transports and protocols (low-level API)
++++++++++++++++++++++++++++++++++++++++++
+
+.. _asyncio-transport:
+
+Transports
+==========
+
+Transports are classed 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:: 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.
+
+ .. 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*. The return value can be a readable or
+ writable streaming transport, depending on the *fd*. If *fd* doesn't
+ correspond to a pipe belonging to this transport, :const:`None` is
+ returned.
+
+ .. 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.
+
+
+.. _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` 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:`connection_made` and :meth:`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.
+
+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 not guarantee on 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 example: TCP echo server and client
+============================================
+
+Echo client
+-----------
+
+TCP echo client example, send data and wait until the connection is closed::
+
+ import asyncio
+
+ class EchoClient(asyncio.Protocol):
+ message = 'This is the message. It will be echoed.'
+
+ def connection_made(self, transport):
+ transport.write(self.message.encode())
+ print('data sent: {}'.format(self.message))
+
+ def data_received(self, data):
+ print('data received: {}'.format(data.decode()))
+
+ def connection_lost(self, exc):
+ print('server closed the connection')
+ asyncio.get_event_loop().stop()
+
+ loop = asyncio.get_event_loop()
+ coro = loop.create_connection(EchoClient, '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 more running, so there is no need to stop the loop in case of an error.
+
+Echo server
+-----------
+
+TCP echo server example, send back received data and close the connection::
+
+ import asyncio
+
+ class EchoServer(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):
+ print('data received: {}'.format(data.decode()))
+ self.transport.write(data)
+
+ # close the socket
+ self.transport.close()
+
+ loop = asyncio.get_event_loop()
+ coro = loop.create_server(EchoServer, '127.0.0.1', 8888)
+ server = loop.run_until_complete(coro)
+ print('serving on {}'.format(server.sockets[0].getsockname()))
+
+ try:
+ loop.run_forever()
+ except KeyboardInterrupt:
+ print("exit")
+ finally:
+ server.close()
+ 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.
+
+
diff --git a/Doc/library/asyncio-stream.rst b/Doc/library/asyncio-stream.rst
new file mode 100644
index 0000000000..4543af4c2e
--- /dev/null
+++ b/Doc/library/asyncio-stream.rst
@@ -0,0 +1,278 @@
+.. 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 first parameter, *client_connected_cb*, takes two parameters:
+ *client_reader*, *client_writer*. *client_reader* is a
+ :class:`StreamReader` object, while *client_writer* is a
+ :class:`StreamWriter` object. This 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. The return value is the same as
+ :meth:`~BaseEventLoop.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
+ :class:`StreamReader`).
+
+ The return value is the same as :meth:`~BaseEventLoop.create_server()`, i.e.
+ a :class:`AbstractServer` object which can be used to stop the service.
+
+ 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()
+
+ Wait until the write buffer of the underlying transport is flushed.
+
+ This method has an unusual return value. The intended use is to write::
+
+ w.write(data)
+ yield from w.drain()
+
+ When there's nothing to wait for, :meth:`drain()` returns ``()``, and the
+ yield-from continues immediately. When the transport buffer is full (the
+ protocol is paused), :meth:`drain` creates and returns a
+ :class:`Future` and the yield-from will block until
+ that Future is completed, which will happen when the buffer is
+ (partially) drained and the protocol is resumed.
+
+ .. 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`).
+
+
+Example
+=======
+
+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)
+ reader, writer = yield from asyncio.open_connection(url.hostname, 80)
+ query = ('HEAD {url.path} HTTP/1.0\r\n'
+ 'Host: {url.hostname}\r\n'
+ '\r\n').format(url=url)
+ 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)
+
+ 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
+
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst
new file mode 100644
index 0000000000..861bcc0e18
--- /dev/null
+++ b/Doc/library/asyncio-subprocess.rst
@@ -0,0 +1,176 @@
+.. currentmodule:: asyncio
+
+Subprocess
+==========
+
+Create a subprocess
+-------------------
+
+.. function:: create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
+
+ Run the shell command *cmd* given as a string. Return a :class:`~asyncio.subprocess.Process`
+ instance.
+
+ This function is a :ref:`coroutine <coroutine>`.
+
+.. function:: create_subprocess_exec(\*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds)
+
+ Create a subprocess. Return a :class:`~asyncio.subprocess.Process` instance.
+
+ This function is a :ref:`coroutine <coroutine>`.
+
+Use the :meth:`BaseEventLoop.connect_read_pipe` and
+:meth:`BaseEventLoop.connect_write_pipe` methods to connect pipes.
+
+.. seealso::
+
+ The :meth:`BaseEventLoop.subprocess_exec` and
+ :meth:`BaseEventLoop.subprocess_shell` 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 *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.
+
+
+Process
+-------
+
+.. class:: asyncio.subprocess.Process
+
+ .. attribute:: pid
+
+ The identifier of the process.
+
+ Note that if you set the *shell* argument to ``True``, this 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).
+
+ .. attribute:: stdin
+
+ Standard input stream (write), ``None`` if the process was created with
+ ``stdin=None``.
+
+ .. attribute:: stdout
+
+ Standard output stream (read), ``None`` if the process was created with
+ ``stdout=None``.
+
+ .. attribute:: stderr
+
+ Standard error stream (read), ``None`` if the process was created with
+ ``stderr=None``.
+
+ .. 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 ``(stdoutdata, stderrdata)``.
+
+ 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.
+
+ .. note::
+
+ The data read is buffered in memory, so do not use this method if the
+ data size is large or unlimited.
+
+ .. 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`.
+
+ .. 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:: wait(self):
+
+ Wait for child process to terminate. Set and return :attr:`returncode`
+ attribute.
+
+
+Example
+-------
+
+Implement a function similar to :func:`subprocess.getstatusoutput`, except that
+it does not use a shell. Get the output of the "python -m platform" command and
+display the output::
+
+ import asyncio
+ import sys
+ from asyncio import subprocess
+
+ @asyncio.coroutine
+ def getstatusoutput(*args):
+ proc = yield from asyncio.create_subprocess_exec(
+ *args,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT)
+ try:
+ stdout, _ = yield from proc.communicate()
+ except:
+ proc.kill()
+ yield from proc.wait()
+ raise
+ exitcode = yield from proc.wait()
+ return (exitcode, stdout)
+
+ loop = asyncio.get_event_loop()
+ coro = getstatusoutput(sys.executable, '-m', 'platform')
+ exitcode, stdout = loop.run_until_complete(coro)
+ if not exitcode:
+ stdout = stdout.decode('ascii').rstrip()
+ print("Platform: %s" % stdout)
+ else:
+ print("Python failed with exit code %s:" % exitcode)
+ sys.stdout.flush()
+ sys.stdout.buffer.flush()
+ sys.stdout.buffer.write(stdout)
+ sys.stdout.buffer.flush()
+ loop.close()
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
new file mode 100644
index 0000000000..a299f09085
--- /dev/null
+++ b/Doc/library/asyncio-sync.rst
@@ -0,0 +1,410 @@
+.. currentmodule:: asyncio
+.. _asyncio-sync:
+
+Synchronization primitives
+==========================
+
+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 manager 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(\*, 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.
+
+ 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 manager 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 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 you yield from :meth:`get()`, wait until a item is available.
+
+ This method is a :ref:`coroutine <coroutine>`.
+
+ .. 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 you yield from ``put()``, wait until a free slot is available before
+ adding item.
+
+ This method is a :ref:`coroutine <coroutine>`.
+
+ .. 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 0000000000..4e5526e90e
--- /dev/null
+++ b/Doc/library/asyncio-task.rst
@@ -0,0 +1,545 @@
+.. 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 convert it to a
+:class:`Task`.
+
+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
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Print ``"Hello World"`` every two seconds using a coroutine::
+
+ import asyncio
+
+ @asyncio.coroutine
+ def greet_every_two_seconds():
+ while True:
+ print('Hello World')
+ yield from asyncio.sleep(2)
+
+ loop = asyncio.get_event_loop()
+ loop.run_until_complete(greet_every_two_seconds())
+
+.. seealso::
+
+ :ref:`Hello World example using a callback <asyncio-hello-world-callback>`.
+
+
+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.
+
+
+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`.
+
+ .. 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.Task(slow_operation(future))
+ loop.run_until_complete(future)
+ print(future.result())
+ loop.close()
+
+The coroutine function is responsible of 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.Task(slow_operation(future))
+ future.add_done_callback(got_result)
+ try:
+ loop.run_forever()
+ finally:
+ loop.close()
+
+In this example, the future is responsible to display the result and to stop
+the loop.
+
+.. note::
+ The "slow_operation" coroutine object is only executed when the event loop
+ starts running, so it is possible to add a "done callback" to the future
+ after creating the task scheduling the coroutine object.
+
+
+
+Task
+----
+
+.. class:: Task(coro, \*, loop=None)
+
+ A coroutine object wrapped in a :class:`Future`. Subclass of :class:`Future`.
+
+ .. 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:: get_stack(self, \*, limit=None)
+
+ Return the list of stack frames for this task's coroutine.
+
+ If the coroutine is active, 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
+ goes; by default it goes 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))
+
+ tasks = [
+ asyncio.Task(factorial("A", 2)),
+ asyncio.Task(factorial("B", 3)),
+ asyncio.Task(factorial("C", 4))]
+
+ loop = asyncio.get_event_loop()
+ 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:`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)
+
+ Wrap a :ref:`coroutine object <coroutine>` in a future.
+
+ If the argument is a :class:`Future`, it is returned directly.
+
+.. 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).
+
+ *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:`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:`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 0000000000..23731b1321
--- /dev/null
+++ b/Doc/library/asyncio.rst
@@ -0,0 +1,59 @@
+:mod:`asyncio` -- Asynchronous I/O, event loop, coroutines and tasks
+====================================================================
+
+.. module:: asyncio
+ :synopsis: Asynchronous I/O, event loop, coroutines and tasks.
+
+.. 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 <http://twistedmatrix.com/>`_);
+
+* 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 content:
+
+.. toctree::
+ :maxdepth: 3
+
+ asyncio-eventloop.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 the :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 1521e72533..0adf8d9c25 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.
diff --git a/Doc/library/audioop.rst b/Doc/library/audioop.rst
index edb3870e5b..ce127aa06a 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 @@ The module defines the following variables and functions:
.. 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 @@ The module defines the following variables and functions:
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 @@ The module defines the following variables and functions:
.. 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 f0d11b0fa1..02b4d7b489 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
+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 @@ The modern interface provides:
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 b79bccdb31..488cda5968 100644
--- a/Doc/library/bz2.rst
+++ b/Doc/library/bz2.rst
@@ -37,8 +37,8 @@ All of the classes in this module may safely be accessed from multiple threads.
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 @@ All of the classes in this module may safely be accessed from multiple threads.
.. 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 @@ All of the classes in this module may safely be accessed from multiple threads.
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 @@ All of the classes in this module may safely be accessed from multiple threads.
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 c4e7c60539..fa131453c7 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -142,9 +142,11 @@ If a field represents an uploaded file, accessing the value via the
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 @@ actually be instances of the class :class:`MiniFieldStorage`. In this case, the
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/code.rst b/Doc/library/code.rst
index e869004729..5b5d7cc8c1 100644
--- a/Doc/library/code.rst
+++ b/Doc/library/code.rst
@@ -132,12 +132,15 @@ interpreter objects as well as the following additions.
.. 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 009ae26c99..3729dac8ae 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -365,18 +365,23 @@ and implemented by all standard Python codecs:
| | in :pep:`383`. |
+-------------------------+-----------------------------------------------+
-In addition, the following error handlers are specific to a single codec:
+In addition, the following error handlers are specific to Unicode encoding
+schemes:
-+-------------------+---------+-------------------------------------------+
-| Value | Codec | Meaning |
-+===================+=========+===========================================+
-|``'surrogatepass'``| utf-8 | Allow encoding and decoding of surrogate |
-| | | codes in UTF-8. |
-+-------------------+---------+-------------------------------------------+
++-------------------+------------------------+-------------------------------------------+
+| Value | Codec | Meaning |
++===================+========================+===========================================+
+|``'surrogatepass'``| utf-8, utf-16, utf-32, | Allow encoding and decoding of surrogate |
+| | utf-16-be, utf-16-le, | codes in all the Unicode encoding schemes.|
+| | utf-32-be, utf-32-le | |
++-------------------+------------------------+-------------------------------------------+
.. versionadded:: 3.1
The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers.
+.. versionchanged:: 3.4
+ The ``'surrogatepass'`` error handlers now works with utf-16\* and utf-32\* codecs.
+
The set of allowed values can be extended via :meth:`register_error`.
@@ -966,6 +971,10 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| cp037 | IBM037, IBM039 | English |
+-----------------+--------------------------------+--------------------------------+
+| cp273 | 273, IBM273, csIBM273 | German |
+| | | |
+| | | .. versionadded:: 3.4 |
++-----------------+--------------------------------+--------------------------------+
| cp424 | EBCDIC-CP-HE, IBM424 | Hebrew |
+-----------------+--------------------------------+--------------------------------+
| cp437 | 437, IBM437 | English |
@@ -1022,6 +1031,10 @@ particular, the following variants typically exist:
+-----------------+--------------------------------+--------------------------------+
| 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 +1180,12 @@ particular, the following variants typically exist:
| 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 +1196,9 @@ common use case for codecs, the underlying codec infrastructure supports
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.
@@ -1223,57 +1245,83 @@ encodings.
| | | .. deprecated:: 3.3 |
+--------------------+---------+---------------------------+
-The following codecs provide :term:`bytes-like object` to :class:`bytes`
-mappings.
-
-
-.. tabularcolumns:: |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` |
-+----------------------+---------------------------+------------------------------+
-
-.. [#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.
+.. _binary-transforms:
+
+Binary Transforms
+^^^^^^^^^^^^^^^^^
+
+The following codecs provide binary transforms: :term:`bytes-like object`
+to :class:`bytes` mappings.
+
+
+.. tabularcolumns:: |l|L|L|L|
+
++----------------------+------------------+------------------------------+------------------------------+
+| 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] In addition to :term:`bytes-like objects <bytes-like object>`,
+ ``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for
+ decoding
-.. tabularcolumns:: |l|L|
+.. versionadded:: 3.2
+ Restoration of the binary transforms.
+
+.. versionchanged:: 3.4
+ Restoration of the aliases for the binary transforms.
-+--------------------+---------------------------+
-| Codec | Purpose |
-+====================+===========================+
-| rot_13 | Returns the Caesar-cypher |
-| | encryption of the operand |
-+--------------------+---------------------------+
+
+.. _text-transforms:
+
+Text Transforms
+^^^^^^^^^^^^^^^
+
+The following codec provides a text transform: a :class:`str` to :class:`str`
+mapping.
+
+.. tabularcolumns:: |l|l|L|
+
++--------------------+---------+---------------------------+
+| Codec | Aliases | Purpose |
++====================+=========+===========================+
+| rot_13 | rot13 | Returns the Caesar-cypher |
+| | | encryption of the operand |
++--------------------+---------+---------------------------+
.. versionadded:: 3.2
- bytes-to-bytes and str-to-str codecs.
+ 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 4b21932e43..356f47332f 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`
--------------
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 4def1dccb1..f5fe12a739 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -76,14 +76,19 @@ The class can be used to simulate nested scopes and is useful in templating.
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
@@ -369,10 +374,6 @@ or subtracting from an empty counter.
.. 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.
@@ -915,11 +916,6 @@ and more efficient to use a simple class declaration:
>>> class Status:
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 +978,6 @@ The :class:`OrderedDict` constructor and :meth:`update` method both accept
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/concurrency.rst b/Doc/library/concurrency.rst
index f2a512f845..0de281bd14 100644
--- a/Doc/library/concurrency.rst
+++ b/Doc/library/concurrency.rst
@@ -20,7 +20,6 @@ multitasking). Here's an overview:
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 575b1ea56c..0495737e8b 100644
--- a/Doc/library/concurrent.futures.rst
+++ b/Doc/library/concurrent.futures.rst
@@ -164,6 +164,9 @@ uses a pool of processes to execute calls asynchronously.
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.
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index fba48f47d5..82efd0cca1 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -95,6 +95,83 @@ Functions and classes provided:
``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:`reusable but not reentrant <reusable-cms>`.
+
+ .. versionadded:: 3.4
+
+
.. class:: ContextDecorator()
A base class that enables a context manager to also be used as a decorator.
@@ -520,3 +597,153 @@ an explicit ``with`` statement.
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/curses.rst b/Doc/library/curses.rst
index 314636e4b4..f3e60b4be9 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -12,7 +12,7 @@ The :mod:`curses` module provides an interface to the curses library, the
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 d0382e0f7a..48af0823aa 100644
--- a/Doc/library/datatypes.rst
+++ b/Doc/library/datatypes.rst
@@ -30,3 +30,4 @@ The following modules are documented in this chapter:
copy.rst
pprint.rst
reprlib.rst
+ enum.rst
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
index 065e850756..e4f1eb2301 100644
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -170,10 +170,12 @@ dates or times.
* ``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.
diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst
index 81a05c7073..f5496d5b99 100644
--- a/Doc/library/dbm.rst
+++ b/Doc/library/dbm.rst
@@ -73,33 +73,39 @@ Key and values are always stored as bytes. This means that when
strings are used they are implicitly converted to the default encoding before
being stored.
+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 c69fb1c846..88a2fa62a5 100644
--- a/Doc/library/debug.rst
+++ b/Doc/library/debug.rst
@@ -15,3 +15,4 @@ allowing you to identify bottlenecks in your programs.
profile.rst
timeit.rst
trace.rst
+ tracemalloc.rst
diff --git a/Doc/library/development.rst b/Doc/library/development.rst
index 2368769c41..06e7048a04 100644
--- a/Doc/library/development.rst
+++ b/Doc/library/development.rst
@@ -23,4 +23,3 @@ The list of modules described in this chapter is:
unittest.mock-examples.rst
2to3.rst
test.rst
- venv.rst
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index ec7112de26..d86550f182 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -26,7 +26,8 @@ Example: Given the function :func:`myfunc`::
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 following command can be used to get the disassembly of :func:`myfunc`::
(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 @@ The :mod:`dis` module defines the following functions and constants:
.. 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 @@ The :mod:`dis` module defines the following functions and constants:
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.
+
+ .. versionchanged:: 3.4
+ Added ``file`` parameter
+
-.. function:: disassemble(code, lasti=-1)
- disco(code, lasti=-1)
+.. 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 :mod:`dis` module defines the following functions and constants:
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,60 +220,66 @@ The :mod:`dis` module defines the following functions and constants:
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*.
+ .. versionadded:: 3.4
-.. data:: opmap
+.. _bytecodes:
- Dictionary mapping operation names to bytecodes.
+Python Bytecode Instructions
+----------------------------
+The :func:`get_instructions` function and :class:`Bytecode` class provide
+details of bytecode instructions as :class:`Instruction` instances:
-.. data:: cmp_op
+.. class:: Instruction
- Sequence of all compare operation names.
+ Details for a bytecode operation
+ .. data:: opcode
-.. data:: hasconst
+ numeric code for operation, corresponding to the opcode values listed
+ below and the bytecode values in the :ref:`opcode_collections`.
- Sequence of bytecodes that have a constant parameter.
+ .. data:: opname
-.. data:: hasfree
+ human readable name for operation
- Sequence of bytecodes that access a free variable.
+ .. data:: arg
-.. data:: hasname
+ numeric argument to operation (if any), otherwise None
- Sequence of bytecodes that access an attribute by name.
+ .. data:: argval
-.. data:: hasjrel
+ resolved arg value (if known), otherwise same as arg
- Sequence of bytecodes that have a relative jump target.
+ .. data:: argrepr
-.. data:: hasjabs
+ human readable description of operation argument
- Sequence of bytecodes that have an absolute jump target.
+ .. data:: offset
-.. data:: haslocal
+ start index of operation within bytecode sequence
- Sequence of bytecodes that access a local variable.
+ .. data:: starts_line
-.. data:: hascompare
+ line started by this opcode (if any), otherwise None
- Sequence of bytecodes of Boolean operations.
+ .. data:: is_jump_target
-.. _bytecodes:
+ ``True`` if other code jumps to here, otherwise ``False``
+
+ .. versionadded:: 3.4
-Python Bytecode Instructions
-----------------------------
The Python compiler currently generates the following bytecode instructions.
@@ -506,12 +621,6 @@ the stack so that it is available for further iterations of the loop.
.. 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.
@@ -722,6 +831,13 @@ the more significant byte last.
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
@@ -820,3 +936,62 @@ the more significant byte last.
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 0000000000..fb3f5df599
--- /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>`__, 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 6666a9b7d7..8e3732bca5 100644
--- a/Doc/library/distutils.rst
+++ b/Doc/library/distutils.rst
@@ -12,14 +12,15 @@ additional modules into a Python installation. The new modules may be either
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.
+Refer to the `Python Packaging User Guide <http://packaging.python.org>`_
+for more information.
-User documentation and API reference are provided in another document:
+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:
-.. seealso::
-
- :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`.
+* :ref:`install-index`
+* :ref:`distutils-index`
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 222c719528..28df49c700 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -278,6 +278,10 @@ strings are treated as if they were docstrings. In output, a key ``K`` in
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,10 @@ Option Flags
A number of option flags control various aspects of doctest's behavior.
Symbolic names for the flags are supplied as module constants, which can be
or'ed together and passed to various functions. The names can also be used in
-: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 +640,19 @@ The second group of options controls how test failures are reported:
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.
@@ -1269,9 +1289,8 @@ DocTestFinder objects
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 32cecf3486..cbbcb78e24 100644
--- a/Doc/library/email-examples.rst
+++ b/Doc/library/email-examples.rst
@@ -40,6 +40,36 @@ text version: [2]_
.. 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 0000000000..8f0bfdbe53
--- /dev/null
+++ b/Doc/library/email.contentmanager.rst
@@ -0,0 +1,430 @@
+: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:
+
+
+ .. attribute:: is_attachment
+
+ Set to ``True`` if there is a :mailheader:`Content-Disposition` header
+ and its (case insensitive) value is ``attachment``, ``False`` otherwise.
+
+
+ .. 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.message.rst b/Doc/library/email.message.rst
index 3075e86d05..58f708ccaf 100644
--- a/Doc/library/email.message.rst
+++ b/Doc/library/email.message.rst
@@ -33,23 +33,31 @@ Here are the methods of the :class:`Message` class:
.. 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 udpate 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,10 +73,58 @@ Here are the methods of the :class:`Message` class:
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()
@@ -410,7 +466,8 @@ Here are the methods of the :class:`Message` class:
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 +484,12 @@ Here are the methods of the :class:`Message` class:
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)
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst
index cb2023c0ed..97358f014c 100644
--- a/Doc/library/email.policy.rst
+++ b/Doc/library/email.policy.rst
@@ -97,6 +97,17 @@ correct line separator characters when creating the binary string to feed into
``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_string` 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 @@ added matters. To illustrate::
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 @@ added matters. To illustrate::
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 @@ added matters. To illustrate::
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 @@ added matters. To illustrate::
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 @@ added matters. To illustrate::
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 @@ With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API of
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 a6cbbce588..331d2ef0e4 100644
--- a/Doc/library/email.rst
+++ b/Doc/library/email.rst
@@ -53,6 +53,7 @@ Contents of the :mod:`email` package documentation:
email.generator.rst
email.policy.rst
email.headerregistry.rst
+ email.contentmanager.rst
email.mime.rst
email.header.rst
email.charset.rst
diff --git a/Doc/library/ensurepip.rst b/Doc/library/ensurepip.rst
new file mode 100644
index 0000000000..8012f5184b
--- /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 0000000000..fc7267bf73
--- /dev/null
+++ b/Doc/library/enum.rst
@@ -0,0 +1,749 @@
+: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 Animals(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::
+
+ >>> Animals = Enum('Animals', '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::
+
+ >>> Animals = Enum('Animals', 'ant bee cat dog', qualname='SomeData.Animals')
+
+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 seperated string
+ (values will start at 1)::
+
+ 'red green blue' | 'red,green,blue' | 'red, green, blue'
+
+ or an iterator of (name, value) pairs::
+
+ [('cyan', 4), ('magenta', 5), ('yellow', 6)]
+
+ or a mapping::
+
+ {'chartruese': 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 equivalant 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. Due to the way Enums are
+ supposed to behave, there is no way to customize Enum's :meth:`__new__`.
+
+
+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']
+
+A :meth:`__new__` method will only be used for the creation of the
+:class:`Enum` members -- after that it is replaced. This means if you wish to
+change how :class:`Enum` members are looked up you either have to write a
+helper function or a :func:`classmethod`.
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 6e4559cc0a..0aac1bf026 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -253,12 +253,22 @@ The following exceptions are the exceptions that are usually raised.
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
diff --git a/Doc/library/faulthandler.rst b/Doc/library/faulthandler.rst
index 3c336215fc..61bc503d8f 100644
--- a/Doc/library/faulthandler.rst
+++ b/Doc/library/faulthandler.rst
@@ -27,6 +27,7 @@ tracebacks:
* 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
@@ -129,7 +130,7 @@ Example of a segmentation fault on Linux: ::
>>> 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 8a88f8ce9a..06d3f21300 100644
--- a/Doc/library/filecmp.rst
+++ b/Doc/library/filecmp.rst
@@ -27,6 +27,10 @@ The :mod:`filecmp` module defines the following functions:
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 @@ The :mod:`filecmp` module defines the following functions:
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 @@ The :class:`dircmp` class
.. 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 @@ The :class:`dircmp` class
.. attribute:: common_files
- Files in both *a* and *b*
+ Files in both *a* and *b*.
.. attribute:: common_funny
@@ -164,6 +174,12 @@ The :class:`dircmp` class
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 d5a48756fe..ee06830ad8 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -160,6 +160,9 @@ available for subclassing as well:
.. 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 58998a8abf..03e085b454 100644
--- a/Doc/library/filesys.rst
+++ b/Doc/library/filesys.rst
@@ -12,6 +12,7 @@ in this chapter is:
.. toctree::
+ pathlib.rst
os.path.rst
fileinput.rst
stat.rst
diff --git a/Doc/library/fnmatch.rst b/Doc/library/fnmatch.rst
index e0434b0c19..ef93f05a7a 100644
--- a/Doc/library/fnmatch.rst
+++ b/Doc/library/fnmatch.rst
@@ -86,7 +86,7 @@ patterns.
'.*\\.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 88be11c3c5..1847a8094b 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 dcb2ac4107..7f98d0bd81 100644
--- a/Doc/library/ftplib.rst
+++ b/Doc/library/ftplib.rst
@@ -94,6 +94,11 @@ The module defines the following items:
.. versionchanged:: 3.3
*source_address* parameter was added.
+ .. versionchanged:: 3.4
+ The class now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
+
Here's a sample session using the :class:`FTP_TLS` class:
>>> from ftplib import FTP_TLS
@@ -427,6 +432,11 @@ FTP_TLS Objects
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:`SSLContext.check_hostname` and *Server Name Indicator* (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 ae29cd8422..0ee52fa4dc 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -540,8 +540,13 @@ are always available. They are listed here in alphabetical order.
A call to ``format(value, format_spec)`` is translated to
``type(value).__format__(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:
@@ -605,6 +610,10 @@ are always available. They are listed here in alphabetical order.
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)
@@ -666,6 +675,12 @@ are always available. They are listed here in alphabetical order.
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)
@@ -748,25 +763,31 @@ are always available. They are listed here in alphabetical order.
already arranged into argument tuples, see :func:`itertools.starmap`\.
-.. function:: max(iterable, *[, key])
+.. function:: max(iterable, *[, default, key])
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 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 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)
@@ -776,25 +797,31 @@ are always available. They are listed here in alphabetical order.
:ref:`typememoryview` for more information.
-.. function:: min(iterable, *[, key])
+.. function:: min(iterable, *[, default, key])
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
@@ -856,8 +883,7 @@ are always available. They are listed here in alphabetical order.
``'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'``).
@@ -963,6 +989,8 @@ are always available. They are listed here in alphabetical order.
: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::
@@ -976,10 +1004,6 @@ are always available. They are listed here in alphabetical order.
...
>>> 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
@@ -1006,10 +1030,18 @@ are always available. They are listed here in alphabetical order.
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)
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 3c946e3eb2..77cd8384b1 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`
@@ -133,15 +134,34 @@ The :mod:`functools` module defines the following functions:
@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 +194,48 @@ The :mod:`functools` module defines the following functions:
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):
+ ... @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
@@ -198,6 +260,111 @@ The :mod:`functools` module defines the following functions:
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 +379,8 @@ The :mod:`functools` module defines the following functions:
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,6 +403,11 @@ The :mod:`functools` module defines the following functions:
.. 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)
@@ -301,4 +473,3 @@ differences. For instance, the :attr:`__name__` and :attr:`__doc__` attributes
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 71449a3c9b..813554206a 100644
--- a/Doc/library/gc.rst
+++ b/Doc/library/gc.rst
@@ -67,6 +67,25 @@ The :mod:`gc` module provides the following functions:
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 @@ values but should not rebind them):
.. 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.
-
- If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added
- to this list rather than freed.
+ 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.
.. versionchanged:: 3.2
If this list is non-empty at interpreter shutdown, a
@@ -183,6 +191,10 @@ values but should not rebind them):
: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/glob.rst b/Doc/library/glob.rst
index eff138b330..abcbf380d9 100644
--- a/Doc/library/glob.rst
+++ b/Doc/library/glob.rst
@@ -25,6 +25,10 @@ For a literal match, wrap the meta-characters in brackets.
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 @@ For example, ``'[?]'`` matches the character ``'?'``.
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 354deed921..78536fab51 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -35,8 +35,8 @@ The module defines the following items:
: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 @@ The module defines the following items:
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 @@ The module defines the following items:
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 @@ The module defines the following items:
.. 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 a693f7ef06..d27902e3c2 100644
--- a/Doc/library/hashlib.rst
+++ b/Doc/library/hashlib.rst
@@ -32,6 +32,12 @@ digests. The modern term is secure hash.
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 @@ concatenation of the data fed to it so far using the :meth:`digest` or
.. 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 @@ returned by the constructors:
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,45 @@ A hash object has the following methods:
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.
+
+
+.. 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 a value of at least 100,000 rounds of SHA-256
+ have been 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 +230,5 @@ A hash object has the following methods:
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/hmac.rst b/Doc/library/hmac.rst
index 95756933d1..4858235107 100644
--- a/Doc/library/hmac.rst
+++ b/Doc/library/hmac.rst
@@ -16,20 +16,32 @@ This module implements the HMAC algorithm as described by :rfc:`2104`.
.. 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`.
+ Paramter *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 @@ An HMAC object has the following methods:
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 0aabbadc58..09b0abc837 100644
--- a/Doc/library/html.entities.rst
+++ b/Doc/library/html.entities.rst
@@ -20,6 +20,7 @@ This module defines four dictionaries, :data:`html5`,
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
diff --git a/Doc/library/html.parser.rst b/Doc/library/html.parser.rst
index e4154ef968..44b7d6ea6d 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 @@ parsing text files formatted in HTML (HyperText Mark-up Language) and XHTML.
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 @@ as they are encountered::
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 @@ implementations do nothing (except for :meth:`~HTMLParser.handle_startendtag`):
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 @@ implementations do nothing (except for :meth:`~HTMLParser.handle_startendtag`):
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 @@ examples::
def handle_decl(self, data):
print("Decl :", data)
- parser = MyHTMLParser(strict=False)
+ parser = MyHTMLParser()
Parsing a doctype::
@@ -324,7 +336,8 @@ correct char (note: these 3 references are all equivalent to ``'>'``)::
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 1107ca9b8a..d0706bcbc0 100644
--- a/Doc/library/html.rst
+++ b/Doc/library/html.rst
@@ -20,6 +20,17 @@ This module defines utilities to manipulate HTML.
.. 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 783a5963db..d4cdfd37ae 100644
--- a/Doc/library/http.client.rst
+++ b/Doc/library/http.client.rst
@@ -27,7 +27,7 @@ HTTPS protocols. It is normally not used directly --- the module
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
@@ -51,13 +51,13 @@ The module provides the following classes:
.. 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)
@@ -89,19 +89,19 @@ The module provides the following classes:
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.
-.. 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:
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index 5aeb719930..dd19fb4bfb 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -116,7 +116,7 @@ of which this module provides three different variants:
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 +170,22 @@ of which this module provides three different variants:
.. 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 +351,7 @@ of which this module provides three different variants:
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 +365,23 @@ the current directory. ::
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 +424,7 @@ the previous example, this serves files relative to the current directory. ::
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 36d78b0991..2718cef3d5 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -16,70 +16,82 @@ 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 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
-^^^^^^^^^
+File menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
New file
- create a new file editing window
+ Create a new file editing window
Open...
- open an existing file
+ Open an existing file
Open module...
- open an existing module (searches sys.path)
+ Open an existing module (searches sys.path)
+
+Recent Files
+ Open a list of recent files
Class browser
- show classes and methods in current file
+ Show classes and methods in current file
Path browser
- show sys.path directories, modules, classes and methods
+ Show sys.path directories, modules, classes and methods
.. index::
single: Class browser
single: Path browser
Save
- save current window to the associated file (unsaved windows have a \* before and
- after the window title)
+ 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 current window to new file, which becomes the associated file
Save Copy As...
- save current window to different file without changing the associated file
+ 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)
+ Close current window (asks to save if unsaved)
Exit
- close all windows and quit IDLE (asks to save if unsaved)
+ Close all windows and quit IDLE (asks to save if unsaved)
-Edit menu
-^^^^^^^^^
+Edit menu (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Undo
- Undo last change to current window (max 1000 changes)
+ Undo last change to current window (a maximum of 1000 changes may be undone)
Redo
Redo last undone change to current window
Cut
- Copy selection into system-wide clipboard; then delete selection
+ Copy selection into system-wide clipboard; then delete the selection
Copy
Copy selection into system-wide clipboard
@@ -108,11 +120,30 @@ Replace...
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 call tip
+ After an unclosed parenthesis for a function, open a small window with
+ function parameter hints
+
+Show surrounding parens
+ Highlight the surrounding parenthesis
+
+Show Completions
+ Open a scroll window allowing selection keywords and attributes. See
+ Completions below.
+
+
+Format menu (Editor window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
Indent region
- Shift selected lines right 4 spaces
+ Shift selected lines right by the indent width (default 4 spaces)
Dedent region
- Shift selected lines left 4 spaces
+ Shift selected lines left by the indent width (default 4 spaces)
Comment out region
Insert ## in front of selected lines
@@ -121,67 +152,121 @@ Uncomment region
Remove leading # or ## from selected lines
Tabify region
- Turns *leading* stretches of spaces into tabs
+ 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
+ Turn *all* tabs into the correct number of spaces
-Expand word
- Expand the word you have typed to match another word in the same buffer; repeat
- to get a different expansion
+Toggle tabs
+ Open a dialog to switch between indenting with spaces and tabs.
-Format Paragraph
- Reformat the current blank-line-separated paragraph
+New Indent Width
+ Open a dialog to change indent width. The accepted default by the Python
+ community is 4 spaces.
-Import module
- Import or reload the current module
+Format Paragraph
+ Reformat the current blank-line-separated paragraph. All lines in the
+ paragraph will be formatted to less than 80 columns.
-Run script
- Execute the current file in the __main__ namespace
+Strip trailing whitespace
+ Removes any space characters after the end of the last non-space character
.. index::
single: Import module
single: Run script
-Windows menu
-^^^^^^^^^^^^
+Run menu (Editor window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Zoom Height
- toggles the window between normal size (24x80) and maximum height.
+Python Shell
+ Open or wake up the Python Shell window
-The rest of this menu lists the names of all open windows; select one to bring
-it to the foreground (deiconifying it if necessary).
+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 (Shell window only)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-Debug menu
-^^^^^^^^^^
+View Last Restart
+ Scroll the shell window to the last Shell restart
-* in the Python Shell window only
+Restart Shell
+ Restart the shell to clean the environment
+
+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. Useful to view the source lines referenced in an
- exception traceback.
+ exception traceback. Available in the context menu of the Shell window.
-Debugger
- Run commands in the shell under the debugger.
+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.
+ Show the stack traceback of the last exception
Auto-open Stack Viewer
- Open stack viewer on traceback.
+ Toggle automatically opening the stack viewer on unhandled exception
.. index::
single: stack viewer
single: debugger
+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.
+
+Code Context (toggle)(Editor Window only)
+ 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 of the window.
+
+Windows 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 (Shell and Editor)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+About IDLE
+ Version, copyright, license, credits
+
+IDLE Help
+ Display 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.
-Edit context menu
-^^^^^^^^^^^^^^^^^
+Additional help sources may be added here with the Configure IDLE dialog under
+the General tab.
-* Right-click in Edit window (Control-click on OS X)
+Editor Window context menu
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+* Right-click in Editor window (Control-click on OS X)
Cut
Copy selection into system-wide clipboard; then delete selection
@@ -207,8 +292,8 @@ Clear Breakpoint
single: breakpoints
-Shell context menu
-^^^^^^^^^^^^^^^^^^
+Shell Window context menu
+^^^^^^^^^^^^^^^^^^^^^^^^^
* Right-click in Python Shell window (Control-click on OS X)
@@ -225,19 +310,44 @@ Go to file/line
Same as in Debug menu.
-Basic editing and navigation
-----------------------------
+Editing and navigation
+----------------------
* :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 +356,76 @@ 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, :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
+ (this is :kbd:`C-z` on Windows).
-* :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 +467,17 @@ Startup
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.
+to be used from IDLE's Python shell.
Command line usage
@@ -349,3 +508,45 @@ If there are arguments:
the arguments are still available in ``sys.argv``.
+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.
+
+
+Other preferences
+-----------------
+
+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.
+
+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:
+
+* FormatParagraph
+
+* AutoExpand
+
+* ZoomHeight
+
+* ScriptBinding
+
+* CallTips
+
+* ParenMatch
+
+* AutoComplete
+
+* CodeContext
+
diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst
index 01236fbb8e..be2f599b0c 100644
--- a/Doc/library/imaplib.rst
+++ b/Doc/library/imaplib.rst
@@ -80,6 +80,10 @@ There's also a subclass for secure connections:
.. versionchanged:: 3.3
*ssl_context* parameter added.
+ .. versionchanged:: 3.4
+ The class now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
The second subclass allows for connections created by a child process:
@@ -437,6 +441,10 @@ An :class:`IMAP4` instance has the following methods:
.. versionadded:: 3.2
+ .. versionchanged:: 3.4
+ The method now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
.. method:: IMAP4.status(mailbox, names)
diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
index 364d81ec13..8f0b79f332 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 @@ This module provides an interface to the mechanisms used to implement the
: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 @@ This module provides an interface to the mechanisms used to implement the
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()
@@ -101,8 +103,10 @@ This module provides an interface to the mechanisms used to implement the
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
+ call ``load_module()`` on the returned loader. If you wish to load a
+ module from a specific file, then use one of the file-based loaders found
+ in :mod:`importlib.machinery`.
.. function:: new_module(name)
@@ -110,6 +114,9 @@ This module provides an interface to the mechanisms used to implement the
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 +183,9 @@ This module provides an interface to the mechanisms used to implement the
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 +211,9 @@ file paths.
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 +229,17 @@ file paths.
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.
@@ -251,6 +267,8 @@ that circular imports work without any deadlocks.
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()
@@ -269,6 +287,8 @@ that circular imports work without any deadlocks.
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()
@@ -280,6 +300,8 @@ that circular imports work without any deadlocks.
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
to indicate the search result of :func:`find_module`.
@@ -345,6 +367,9 @@ to indicate the search result of :func:`find_module`.
``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 5f740a2732..3b55b06ec0 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -95,7 +95,7 @@ Functions
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 @@ Functions
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 @@ Functions
.. 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 @@ ABC hierarchy::
+-- ExecutionLoader --+
+-- FileLoader
+-- SourceLoader
- +-- PyLoader (deprecated)
- +-- PyPycLoader (deprecated)
.. class:: Finder
@@ -154,6 +229,10 @@ ABC hierarchy::
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 @@ ABC hierarchy::
.. 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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
- :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
+
+ .. versionchanged:: 3.4
+ Made optional instead of an abstractmethod.
- .. versionadded: 3.3
+ .. deprecated:: 3.4
+ The import machinery now takes care of this automatically.
.. class:: ResourceLoader
@@ -286,6 +453,9 @@ ABC hierarchy::
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:`IOError` instead of :exc:`NotImplementedError`.
+
.. class:: InspectLoader
@@ -294,14 +464,21 @@ ABC hierarchy::
.. 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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
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 @@ ABC hierarchy::
- ``'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:`IOError` is raised.
.. versionadded:: 3.3
+ .. versionchanged:: 3.4
+ Raise :exc:`IOError` instead of :exc:`NotImplementedError`.
+
.. method:: path_mtime(path)
Optional abstract method which returns the modification time for the
@@ -407,7 +624,10 @@ ABC hierarchy::
.. 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:`IOError` if the path cannot be handled.
+
+ .. versionchanged:: 3.4
+ Raise :exc:`IOError` instead of :exc:`NotImplementedError`.
.. method:: set_data(path, data)
@@ -419,13 +639,25 @@ ABC hierarchy::
(: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 @@ ABC hierarchy::
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 @@ find and load modules.
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 @@ find and load modules.
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 @@ find and load modules.
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`.
@@ -805,7 +924,7 @@ find and load modules.
.. 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
@@ -826,6 +945,10 @@ find and load modules.
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 +962,70 @@ find and load modules.
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 +1036,51 @@ find and load modules.
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 +1097,25 @@ an :term:`importer`.
.. 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 +1126,68 @@ an :term:`importer`.
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).
-.. decorator:: set_loader
+ .. versionchanged:: 3.4
+ Set :attr:`__name__`, :attr:`__loader__` :attr:`__package__`
+ unconditionally to support reloading.
- 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.
+ .. deprecated:: 3.4
+ The import machinery now directly performs all the functionality
+ provided by this function.
- .. note::
+.. decorator:: set_loader
- It is recommended that :func:`module_for_loader` be used over this
- decorator as it subsumes this functionality.
+ 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.
+ .. versionchanged:: 3.4
+ Set ``__loader__`` if set to ``None``, as if the attribute does not
+ exist.
+
+ .. 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.
+
+ .. deprecated:: 3.4
+ The import machinery takes care of this automatically.
+
+.. function:: spec_from_loader(name, loader, *, origin=None, is_package=None)
+
+ 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
- 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.
+.. function:: spec_from_file_location(name, location, *, loader=None, submodule_search_locations=None)
- .. note::
+ 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.
- It is recommended that :func:`module_for_loader` be used over this
- decorator as it subsumes this functionality.
+ .. versionadded:: 3.4
diff --git a/Doc/library/index.rst b/Doc/library/index.rst
index 1b25c6e476..81289a56c5 100644
--- a/Doc/library/index.rst
+++ b/Doc/library/index.rst
@@ -65,6 +65,7 @@ the `Python Package Index <http://pypi.python.org/pypi>`_.
tk.rst
development.rst
debug.rst
+ distribution.rst
python.rst
custominterp.rst
modules.rst
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index d4cf9054cb..0c087123e8 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -69,7 +69,12 @@ attributes:
| | | :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 @@ attributes:
.. 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 @@ function.
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 @@ function.
.. 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 @@ function.
>>> 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
@@ -717,6 +729,11 @@ Classes and functions
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)
@@ -806,6 +823,23 @@ Classes and functions
.. 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 +872,10 @@ index of the current line within that list.
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 +1032,22 @@ updated as expected:
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/io.rst b/Doc/library/io.rst
index 716767f465..79f65e0007 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -283,10 +283,10 @@ I/O Base Classes
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
@@ -366,14 +366,14 @@ I/O Base Classes
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 +442,10 @@ I/O Base Classes
.. 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 +457,9 @@ I/O Base Classes
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 +522,8 @@ Raw File I/O
: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 +531,9 @@ Raw File I/O
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 +606,21 @@ than raw I/O does.
: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 +740,17 @@ Text I/O
.. 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 8eac92f339..9625e71b04 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.
@@ -161,7 +154,16 @@ write code that handles both IP versions correctly.
.. 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 @@ write code that handles both IP versions correctly.
``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 @@ write code that handles both IP versions correctly.
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 91ec69368c..6b1756331e 100644
--- a/Doc/library/ipc.rst
+++ b/Doc/library/ipc.rst
@@ -9,7 +9,7 @@ to communicate.
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 @@ The list of modules described in this chapter is:
socket.rst
ssl.rst
+ select.rst
+ selectors.rst
+ asyncio.rst
asyncore.rst
asynchat.rst
signal.rst
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index f6520393eb..5d97ee88fc 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -42,8 +42,7 @@ Compact encoding::
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
@@ -158,15 +157,13 @@ Basic Usage
.. 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 ``(', ', ': ')`` if *indent* is ``None`` and
+ ``(',', ': ')`` otherwise. To get the most compact JSON representation,
+ you should specify ``(',', ':')`` to eliminate whitespace.
- 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 +245,8 @@ Basic Usage
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 +256,8 @@ Basic Usage
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 +355,26 @@ Encoders and Decoders
.. _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 +414,13 @@ Encoders and Decoders
.. 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
diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst
index 303b4d89b9..171b0a3ede 100644
--- a/Doc/library/logging.config.rst
+++ b/Doc/library/logging.config.rst
@@ -80,12 +80,25 @@ in :mod:`logging` itself) and defining handlers which are declared either in
.. 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.
@@ -99,8 +112,17 @@ in :mod:`logging` itself) and defining handlers which are declared either in
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:
+
+ * 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)
+.. 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 @@ in :mod:`logging` itself) and defining handlers which are declared either in
: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 @@ in :mod:`logging` itself) and defining handlers which are declared either in
: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 415e397127..315c168f1d 100644
--- a/Doc/library/logging.handlers.rst
+++ b/Doc/library/logging.handlers.rst
@@ -300,7 +300,7 @@ The :class:`TimedRotatingFileHandler` class, located in the
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 +350,12 @@ timed intervals.
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 +381,9 @@ sends logging output to a network socket. The base class uses a TCP socket.
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 +469,9 @@ over UDP sockets.
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()
diff --git a/Doc/library/lzma.rst b/Doc/library/lzma.rst
index 07b69eb772..b71051da85 100644
--- a/Doc/library/lzma.rst
+++ b/Doc/library/lzma.rst
@@ -39,8 +39,8 @@ Reading and writing compressed files
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 @@ Reading and writing compressed files
: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 @@ Reading and writing compressed files
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 @@ Reading and writing compressed files
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/marshal.rst b/Doc/library/marshal.rst
index 3b9e3d226f..124eb6168e 100644
--- a/Doc/library/marshal.rst
+++ b/Doc/library/marshal.rst
@@ -40,10 +40,11 @@ this module. The following types are supported: booleans, integers, floating
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 @@ In addition, the following constants are defined:
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 3.
.. rubric:: Footnotes
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 5f50cf1014..b303e16324 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -93,11 +93,112 @@ To show the individual process IDs involved, here is an expanded example::
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -274,15 +375,31 @@ processes in a few different ways.
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.
@@ -731,6 +848,9 @@ Miscellaneous
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 +881,43 @@ Miscellaneous
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 +926,21 @@ Miscellaneous
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::
@@ -1678,25 +1848,37 @@ Process Pools
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::
@@ -2189,43 +2371,8 @@ Below is an example session with logging turned on::
[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 +2393,10 @@ There are certain guidelines and idioms which should be adhered to when using
:mod:`multiprocessing`.
-All platforms
-~~~~~~~~~~~~~
+All start methods
+~~~~~~~~~~~~~~~~~
+
+The following applies to all start methods.
Avoid shared state
@@ -2281,11 +2430,13 @@ Joining zombie processes
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
@@ -2332,15 +2483,17 @@ Joining processes that use queues
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 +2552,19 @@ Beware of replacing :data:`sys.stdin` with a "file like object"
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 +2586,8 @@ Safe importing of main module
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 +2601,14 @@ Safe importing of main module
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 +2639,7 @@ Using :class:`~multiprocessing.pool.Pool`:
: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 564f101554..23ffed69eb 100644
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -29,7 +29,7 @@ the Unix :program:`ftp` program and other FTP clients.
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 a15d7f7868..a8145fe83e 100644
--- a/Doc/library/nntplib.rst
+++ b/Doc/library/nntplib.rst
@@ -1,4 +1,3 @@
-
:mod:`nntplib` --- NNTP protocol client
=======================================
@@ -71,7 +70,7 @@ The module itself defines the following classes:
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
@@ -103,6 +102,10 @@ The module itself defines the following classes:
.. versionadded:: 3.2
+ .. versionchanged:: 3.4
+ The class now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
.. exception:: NNTPError
@@ -242,6 +245,10 @@ tuples or objects that the method normally returns will be empty.
.. versionadded:: 3.2
+ .. versionchanged:: 3.4
+ The method now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
.. method:: NNTP.newgroups(date, *, file=None)
diff --git a/Doc/library/numeric.rst b/Doc/library/numeric.rst
index 2732a84439..7c76a479d7 100644
--- a/Doc/library/numeric.rst
+++ b/Doc/library/numeric.rst
@@ -23,3 +23,4 @@ The following modules are documented in this chapter:
decimal.rst
fractions.rst
random.rst
+ statistics.rst
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst
index 24becf9889..3bcbaa4b86 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
@@ -235,6 +238,14 @@ their character equivalents.
.. XXX: find a better, readable, example
+.. function:: length_hint(obj, default=0)
+
+ 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
:func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or other functions that
diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst
index 57a6bcad22..3771ab06f5 100644
--- a/Doc/library/os.path.rst
+++ b/Doc/library/os.path.rst
@@ -22,6 +22,11 @@ Functions such as :func:`expanduser` and :func:`expandvars` can be invoked
explicitly when an application desires shell-like path expansion. (See also
the :mod:`glob` module.)
+
+.. 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 @@ the :mod:`glob` module.)
* :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)
@@ -189,11 +193,17 @@ the :mod:`glob` module.)
.. 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[, ...]])
@@ -247,18 +257,17 @@ the :mod:`glob` module.)
.. 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 +286,10 @@ the :mod:`glob` module.)
: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 72693f14b0..f50e5d97f4 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -54,7 +54,7 @@ Notes on the availability of these functions:
The name of the operating system dependent module imported. The following
names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
- ``'os2'``, ``'ce'``, ``'java'``.
+ ``'ce'``, ``'java'``.
.. seealso::
:attr:`sys.platform` has a finer granularity. :func:`os.uname` gives
@@ -687,17 +687,30 @@ as internal buffering of data.
.. 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)
@@ -848,17 +861,21 @@ as internal buffering of data.
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 +886,93 @@ as internal buffering of data.
.. 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)
@@ -1027,7 +1112,7 @@ as internal buffering of data.
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,80 +1165,8 @@ as internal buffering of data.
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)`.
+ Availability: Unix.
.. versionadded:: 3.3
@@ -1195,6 +1208,49 @@ Querying the size of a terminal
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
@@ -1931,11 +1987,26 @@ features:
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
@@ -2585,7 +2656,7 @@ written in Python, such as a mail server's external command delivery program.
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::
@@ -2831,7 +2902,6 @@ written in Python, such as a mail server's external command delivery program.
: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.
@@ -3053,7 +3123,7 @@ information, consult your Unix manpages.
.. 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
@@ -3162,10 +3232,6 @@ operating system.
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:
@@ -3203,6 +3269,13 @@ Miscellaneous System Information
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
@@ -3301,6 +3374,19 @@ Higher-level operations on pathnames are defined in the :mod:`os.path` module.
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/pathlib-inheritance.png b/Doc/library/pathlib-inheritance.png
new file mode 100644
index 0000000000..b81c3deb60
--- /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 0000000000..9f42005e0a
--- /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 0000000000..ec1dc4f616
--- /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 f4e37ac2a6..48a8a6b722 100644
--- a/Doc/library/pdb.rst
+++ b/Doc/library/pdb.rst
@@ -41,7 +41,7 @@ of the debugger is::
.. 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 +309,7 @@ by the local file.
``end`` to terminate the commands. An example::
(Pdb) commands 1
- (com) print some_variable
+ (com) p some_variable
(com) end
(Pdb)
@@ -403,13 +403,19 @@ by the local file.
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 273fb34c0c..ce5467fcf5 100644
--- a/Doc/library/pickle.rst
+++ b/Doc/library/pickle.rst
@@ -94,6 +94,9 @@ There are fundamental differences between the pickle protocols and
The :mod:`json` module: a standard library module allowing JSON
serialization and deserialization.
+
+.. _pickle-protocols:
+
Data stream format
------------------
@@ -113,7 +116,9 @@ The module :mod:`pickletools` contains tools for analyzing data streams
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 @@ There are currently 4 different protocols which can be used for pickling.
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 @@ The :mod:`pickle` module provides the following constants:
.. 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 @@ process more convenient:
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 @@ process more convenient:
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.
-
- 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.
+ Return the pickled representation of the object as a :class:`bytes` object,
+ instead of writing it to a file.
- 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 @@ The :mod:`pickle` module exports two classes, :class:`Pickler` and
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 :mod:`pickle` module exports two classes, :class:`Pickler` and
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 @@ The following types can be pickled:
* 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 @@ raised in this case. You can carefully raise this limit with
: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 @@ implementation of this behaviour::
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 @@ the methods :meth:`__getstate__` and :meth:`__setstate__`.
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 @@ objects. [#]_
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 @@ The following example reads the resulting pickled data. ::
.. [#] 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 7c4f9121fa..13ea7b9b33 100644
--- a/Doc/library/pkgutil.rst
+++ b/Doc/library/pkgutil.rst
@@ -74,15 +74,17 @@ support.
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 @@ support.
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 a267368848..6a2d6b4971 100644
--- a/Doc/library/plistlib.rst
+++ b/Doc/library/plistlib.rst
@@ -16,26 +16,24 @@
--------------
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::
@@ -45,37 +43,147 @@ contain control characters.
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 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
-The following class is available:
.. class:: Data(data)
@@ -86,6 +194,24 @@ The following class is available:
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 @@ Generating a plist::
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 b4080d61e8..fa1db01fff 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.
@@ -50,6 +53,10 @@ The :mod:`poplib` module provides two classes:
.. versionchanged:: 3.2
*context* parameter added.
+ .. versionchanged:: 3.4
+ The class now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
One exception is defined as an attribute of the :mod:`poplib` module:
@@ -97,6 +104,14 @@ An :class:`POP3` instance has the following methods:
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 +191,21 @@ An :class:`POP3` instance has the following methods:
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. This method supports
+ hostname checking via :attr:`SSLContext.check_hostname`
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (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 3a863318fe..447f8f7060 100644
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -14,8 +14,8 @@ The :mod:`pprint` module provides a capability to "pretty-print" arbitrary
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 @@ The :mod:`pprint` module defines one class:
.. 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 :mod:`pprint` module defines one class:
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 @@ The :mod:`pprint` module defines one class:
'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 @@ The :mod:`pprint` module defines one class:
('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 @@ Example
-------
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>`_::
>>> 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"')]}
-
-Additionally, maximum *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)
+ {'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 character *width* can be suggested. If a long object
+cannot be split, the specified width will be exceeded::
+
+ >>> 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 2b9385b5f9..90baec542f 100644
--- a/Doc/library/pty.rst
+++ b/Doc/library/pty.rst
@@ -45,6 +45,9 @@ The :mod:`pty` module defines the following functions:
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 07ddc25422..bae8450b7c 100644
--- a/Doc/library/py_compile.rst
+++ b/Doc/library/py_compile.rst
@@ -28,7 +28,7 @@ byte-code cache files in the directory containing the source code.
.. 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 @@ byte-code cache files in the directory containing the source code.
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 @@ byte-code cache files in the directory containing the source code.
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 e100865515..3f520e892d 100644
--- a/Doc/library/pydoc.rst
+++ b/Doc/library/pydoc.rst
@@ -84,3 +84,8 @@ Reference Manual pages.
.. versionchanged:: 3.2
Added the ``-b`` option, deprecated the ``-g`` option.
+
+.. 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/python.rst b/Doc/library/python.rst
index b67fbfc281..f307d7db6d 100644
--- a/Doc/library/python.rst
+++ b/Doc/library/python.rst
@@ -25,4 +25,3 @@ overview:
inspect.rst
site.rst
fpectl.rst
- distutils.rst
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index dd790e7efe..1fa1cc0c60 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -481,7 +481,7 @@ form.
.. 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.
@@ -584,6 +584,16 @@ form.
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 +765,7 @@ attributes:
>>> 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 +782,30 @@ attributes:
>>> 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 +1167,7 @@ For example::
>>> 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 +1175,7 @@ restrict the match at the beginning of the string::
>>> 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 +1183,7 @@ beginning with ``'^'`` will match at the beginning of each line.
>>> 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 +1302,9 @@ another one to escape it. For example, the two following lines of code are
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 +1312,9 @@ notation, one must use ``"\\\\"``, making the following lines of code
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
diff --git a/Doc/library/readline.rst b/Doc/library/readline.rst
index 11346190c2..692310b941 100644
--- a/Doc/library/readline.rst
+++ b/Doc/library/readline.rst
@@ -190,28 +190,32 @@ Example
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/resource.rst b/Doc/library/resource.rst
index ed858505a7..f8112cc0e4 100644
--- a/Doc/library/resource.rst
+++ b/Doc/library/resource.rst
@@ -74,6 +74,27 @@ this module for those platforms.
``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 @@ platform.
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 633088d897..9ed01c7146 100644
--- a/Doc/library/rlcompleter.rst
+++ b/Doc/library/rlcompleter.rst
@@ -27,18 +27,10 @@ Example::
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 6919bc0c37..ee9fbcf529 100644
--- a/Doc/library/runpy.rst
+++ b/Doc/library/runpy.rst
@@ -44,28 +44,22 @@ The :mod:`runpy` module provides two functions:
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
@@ -83,8 +77,13 @@ The :mod:`runpy` module provides two functions:
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)
@@ -108,23 +107,28 @@ The :mod:`runpy` module provides two functions:
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`.
+ ``__spec__`` will be set to :const:`None` if the supplied path is a
+ direct path to a script (as source or as precompiled bytecode).
- ``__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
@@ -141,6 +145,12 @@ The :mod:`runpy` module provides two functions:
.. 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
@@ -149,6 +159,9 @@ The :mod:`runpy` module provides two functions:
: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 b1fd3a83df..4fae87e5ed 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -14,6 +14,14 @@ it also works for other file types (in particular, on Unix, it works on pipes).
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 @@ The module defines the following:
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 @@ The module defines the following:
(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)
@@ -144,6 +173,27 @@ descriptors), ``/dev/poll`` is O(active file descriptors).
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 +291,11 @@ Edge and Level Trigger Polling (epoll) Objects
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 +313,7 @@ Edge and Level Trigger Polling (epoll) Objects
.. method:: epoll.modify(fd, eventmask)
- Modify a register file descriptor.
+ Modify a registered file descriptor.
.. method:: epoll.unregister(fd)
@@ -360,6 +415,11 @@ Kqueue Objects
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 0000000000..98377c890f
--- /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 048f80afa0..22e202dace 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -44,8 +44,11 @@ lots of shared sub-objects. The keys are ordinary strings.
.. 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 @@ Restrictions
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 a1457d070b..e4f348cd82 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -53,7 +53,7 @@ Directory and files operations
*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 @@ Directory and files operations
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 @@ provided by this module. ::
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)
diff --git a/Doc/library/site.rst b/Doc/library/site.rst
index 36b80c379c..2fdf303c88 100644
--- a/Doc/library/site.rst
+++ b/Doc/library/site.rst
@@ -38,6 +38,9 @@ Unix and Macintosh). For each of the distinct head-tail combinations, it sees
if it refers to an existing directory, and if so, adds it to ``sys.path`` and
also inspects the newly added path for configuration files.
+.. 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
@@ -111,6 +114,27 @@ empty, and the path manipulations are skipped; however the import of
: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 +177,7 @@ empty, and the path manipulations are skipped; however the import of
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 f3058187d4..3ebed06260 100644
--- a/Doc/library/smtpd.rst
+++ b/Doc/library/smtpd.rst
@@ -27,7 +27,8 @@ SMTPServer Objects
------------------
-.. 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 @@ SMTPServer Objects
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 @@ SMTPServer Objects
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 @@ MailmanProxy Objects
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 addc6be923..ec8dc9da45 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -90,6 +90,10 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
.. versionchanged:: 3.3
source_address argument was added.
+ .. versionchanged:: 3.4
+ The class now supports hostname check with
+ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
+ :data:`~ssl.HAS_SNI`).
.. class:: LMTP(host='', port=LMTP_PORT, local_hostname=None, source_address=None)
@@ -110,8 +114,11 @@ A nice selection of exceptions is defined as well:
.. 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 +323,11 @@ An :class:`SMTP` instance has the following methods:
.. 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 3a49eed09d..54c6badb13 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::
@@ -107,8 +106,8 @@ created. Socket addresses are represented as follows:
.. 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!
@@ -264,6 +263,16 @@ Constants
.. 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 +299,11 @@ Constants
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 +320,29 @@ Creating sockets
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 +352,15 @@ The following functions all create :ref:`socket objects <socket-objects>`.
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 +388,7 @@ The following functions all create :ref:`socket objects <socket-objects>`.
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 +399,11 @@ The following functions all create :ref:`socket objects <socket-objects>`.
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)
@@ -598,7 +631,10 @@ The :mod:`socket` module also offers various network-related services:
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 +650,10 @@ The :mod:`socket` module also offers various network-related services:
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 +774,11 @@ to sockets.
*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 +831,16 @@ to sockets.
.. 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 +851,15 @@ to sockets.
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
@@ -1083,6 +1146,14 @@ to sockets.
.. 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 +1435,16 @@ the interface::
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 add611f09e..58be78f017 100644
--- a/Doc/library/spwd.rst
+++ b/Doc/library/spwd.rst
@@ -19,9 +19,9 @@ below, see ``<shadow.h>``):
+-------+---------------+---------------------------------+
| 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 @@ below, see ``<shadow.h>``):
+-------+---------------+---------------------------------+
| 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 8a50f87d14..1ec8398594 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -159,7 +159,7 @@ Module functions and constants
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 +195,18 @@ Module functions and constants
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)
diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst
index aa5a52f62f..0ed5fb2d20 100644
--- a/Doc/library/ssl.rst
+++ b/Doc/library/ssl.rst
@@ -26,7 +26,8 @@ probably additional platforms, as long as OpenSSL is installed on that platform.
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,14 +187,16 @@ instead.
.. 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* yes no yes no no no
+ *TLSv1* no no yes yes no no
+ *TLSv1.1* no no yes no yes no
+ *TLSv1.2* no no yes no no yes
+ ======================== ========= ========= ========== ========= =========== ===========
.. note::
@@ -227,6 +230,45 @@ instead.
.. 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_TLSv1` 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.
+
+ .. versionadded:: 3.4
+
+
Random generation
^^^^^^^^^^^^^^^^^
@@ -356,6 +398,61 @@ Certificate handling
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,6 +489,38 @@ Constants
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_SSLv2
Selects SSL version 2 as the channel encryption protocol.
@@ -417,9 +546,22 @@ Constants
.. data:: PROTOCOL_TLSv1
- Selects TLS version 1 as the channel encryption protocol. This is the most
+ 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.
+ sides can speak it. Available only with openssl version 1.0.1+.
+
+ .. versionadded:: 3.4
.. data:: OP_ALL
@@ -453,6 +595,22 @@ Constants
.. 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.
@@ -549,6 +707,37 @@ Constants
.. 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
-----------
@@ -584,10 +773,16 @@ SSL sockets also have the following additional methods and attributes:
Perform the SSL setup handshake.
+ .. versionchanged:: 3.4
+ The handshake method also performce :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 +840,11 @@ SSL sockets also have the following additional methods and attributes:
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
@@ -715,11 +915,30 @@ to speed up repeated connections from the same clients.
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 +969,32 @@ to speed up repeated connections from the same clients.
.. 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
+ 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 +1005,25 @@ to speed up repeated connections from the same clients.
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 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 +1061,56 @@ to speed up repeated connections from the same clients.
.. 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 a 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.
@@ -869,6 +1177,45 @@ to speed up repeated connections from the same clients.
>>> 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 +1232,15 @@ to speed up repeated connections from the same clients.
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
@@ -1274,7 +1630,9 @@ Therefore, when in client mode, it is highly recommended to use
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
@@ -1350,3 +1708,12 @@ successful call of :func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
`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://www.ietf.org/rfc/rfc5246>`_
+ T. Dierks et. al.
+
+ `RFC 6066: Transport Layer Security (TLS) Extensions <http://www.ietf.org/rfc/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 6c20aa2072..24769f6893 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 @@ results of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat` (if they
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 @@ types:
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 @@ readable string:
.. 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 @@ Use of the functions above is more portable than use of the first set of flags:
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 0000000000..4e7783872a
--- /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://projects.gnome.org/gnumeric/doc/gnumeric-function-SSMEDIAN.shtml>`_
+ 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 ab78cdc85f..bb421af062 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1526,7 +1526,7 @@ expression support in the :mod:`re` module).
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
@@ -2462,6 +2462,10 @@ copying.
.. 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)
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index dde32b97e0..ec2e1beb03 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -66,6 +66,19 @@ The module defines the following exception and functions:
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 +401,13 @@ The :mod:`struct` module also defines the following type:
(``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 347dcc3e50..cdcbe8280c 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -116,7 +116,7 @@ use cases, the underlying :class:`Popen` interface can be used directly.
*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 +129,21 @@ use cases, the underlying :class:`Popen` interface can be used directly.
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 +152,10 @@ use cases, the underlying :class:`Popen` interface can be used directly.
>>> 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,10 +177,6 @@ use cases, the underlying :class:`Popen` interface can be used directly.
... 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
@@ -183,9 +189,13 @@ use cases, the underlying :class:`Popen` interface can be used directly.
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.
+ .. versionadded:: 3.1
+
.. versionchanged:: 3.3
*timeout* was added.
+ .. versionchanged:: 3.4
+ *input* was added.
.. data:: DEVNULL
@@ -619,6 +629,12 @@ Instances of the :class:`Popen` class have the following methods:
:exc:`TimeoutExpired` exception. It is safe to catch this exception and
retry the wait.
+ .. 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`.
+
.. warning::
This will deadlock when using ``stdout=PIPE`` and/or
@@ -629,6 +645,11 @@ Instances of the :class:`Popen` class have the following methods:
.. versionchanged:: 3.3
*timeout* was added.
+ .. deprecated:: 3.4
+
+ Do not use the undocumented *endtime* parameter. It is was
+ unintentionally exposed in 3.3 but was intended to be private
+ for internal use. Use *timeout* instead.
.. method:: Popen.communicate(input=None, timeout=None)
@@ -841,8 +862,6 @@ The :mod:`subprocess` module exposes the following constants.
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
@@ -1057,9 +1076,9 @@ handling consistency are valid for these functions.
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
diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst
index 4bdb99bea6..a94ae08d83 100644
--- a/Doc/library/sunau.rst
+++ b/Doc/library/sunau.rst
@@ -150,8 +150,9 @@ AU_read objects, as returned by :func:`.open` above, have the following methods:
.. 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 @@ AU_write objects, as returned by :func:`.open` above, have the following methods
Set the sample width (in bytes.)
+ .. versionchanged:: 3.4
+ Added support for 24-bit samples.
+
.. method:: AU_write.setframerate(n)
@@ -246,11 +250,17 @@ AU_write objects, as returned by :func:`.open` above, have the following methods
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/sys.rst b/Doc/library/sys.rst
index 36c608cd35..e3cc866630 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -382,6 +382,21 @@ always available.
.. 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 +413,10 @@ always available.
.. 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 +595,20 @@ always available.
| :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
@@ -665,6 +692,17 @@ always available.
.. 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 +850,6 @@ always available.
Windows ``'win32'``
Windows/Cygwin ``'cygwin'``
Mac OS X ``'darwin'``
- OS/2 ``'os2'``
- OS/2 EMX ``'os2emx'``
================ ===========================
.. versionchanged:: 3.3
@@ -884,7 +920,7 @@ always available.
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`).
@@ -1094,7 +1130,6 @@ always available.
| :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 c47dcce83c..535ac54b3c 100644
--- a/Doc/library/sysconfig.rst
+++ b/Doc/library/sysconfig.rst
@@ -83,8 +83,6 @@ Python currently supports seven schemes:
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 1ead71cce0..59336c9788 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -591,6 +591,67 @@ A :class:`TarInfo` object also provides some convenient query methods:
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
diff --git a/Doc/library/test.rst b/Doc/library/test.rst
index c28536da0b..83026d85f7 100644
--- a/Doc/library/test.rst
+++ b/Doc/library/test.rst
@@ -443,13 +443,6 @@ The :mod:`test.support` module defines the following functions:
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
@@ -594,6 +587,21 @@ The :mod:`test.support` module defines the following classes:
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 c625254070..edf1fd6ece 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 @@ otherwise, you should use an instance of :class:`TextWrapper` for efficiency.
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)
+
+ 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
-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.
.. function:: dedent(text)
@@ -102,6 +114,16 @@ in a block of text.
+ world
+: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)
The :class:`TextWrapper` constructor accepts a number of optional keyword
@@ -235,7 +257,23 @@ in a block of text.
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 +289,3 @@ in a block of text.
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 7c326d1d72..4a3b3ea00b 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -57,6 +57,15 @@ This module defines the following functions:
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
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index a487917924..0cc15868db 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -151,7 +151,7 @@ The module defines three convenience functions and a public class:
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 eeb1f8096e..b8f6607148 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -747,32 +747,6 @@ Entry widget indexes (index, view index, etc.)
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/traceback.rst b/Doc/library/traceback.rst
index 32e57337fa..b68a8f1e19 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -129,6 +129,13 @@ The module defines the following functions:
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 @@ module. ::
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 0000000000..3405518ab2
--- /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:`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 0000000000..eccf4fa7f5
--- /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 0000000000..65b6951550
--- /dev/null
+++ b/Doc/library/tulip_coro.png
Binary files differ
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index 695480f6cb..abdb939d1a 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -15,6 +15,9 @@ It also defines names for some object types that are used by the standard
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 @@ Standard names are defined for the following types:
C".)
-.. data:: ModuleType
+.. class:: ModuleType(name, doc=None)
+
+ 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.
- The type of modules.
+ .. 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 @@ Standard names are defined for the following types:
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 @@ Standard names are defined for the following types:
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 80386d240c..20830e2963 100644
--- a/Doc/library/undoc.rst
+++ b/Doc/library/undoc.rst
@@ -20,7 +20,7 @@ These modules are used to implement the :mod:`os.path` module, and are not
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 ad70dd9dd1..3b3d3a0a8f 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 @@ Examples:
.. 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 554ef11727..c5fa365afd 100644
--- a/Doc/library/unittest.mock-examples.rst
+++ b/Doc/library/unittest.mock-examples.rst
@@ -277,6 +277,20 @@ instantiate the class in those tests.
...
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`.
diff --git a/Doc/library/unittest.mock.rst b/Doc/library/unittest.mock.rst
index f805df3d3a..cb72a683dd 100644
--- a/Doc/library/unittest.mock.rst
+++ b/Doc/library/unittest.mock.rst
@@ -264,7 +264,6 @@ the `new_callable` argument to `patch`.
<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
@@ -685,6 +684,27 @@ have to create a dictionary and unpack it using `**`:
...
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)
@@ -1969,8 +1989,13 @@ mock_open
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 `~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
are closed properly and is becoming common::
diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst
index fdc940954c..690c98b75d 100644
--- a/Doc/library/unittest.rst
+++ b/Doc/library/unittest.rst
@@ -239,9 +239,10 @@ Test Discovery
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 @@ as the start directory.
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 @@ The following decorators implement test skipping and expected failures:
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:
@@ -676,6 +743,21 @@ Test cases
.. 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 @@ Test cases
- 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 @@ Test cases
| :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 @@ Test cases
.. 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 @@ Grouping tests
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,7 +1635,9 @@ Loading and running tests
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``
@@ -1519,6 +1656,14 @@ Loading and running tests
.. 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 @@ Loading and running tests
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()
@@ -1728,6 +1877,22 @@ Loading and running tests
: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 @@ Loading and running tests
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 @@ Loading and running tests
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 @@ Loading and running tests
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 25c13bdc32..f7f0c9739d 100644
--- a/Doc/library/urllib.error.rst
+++ b/Doc/library/urllib.error.rst
@@ -46,6 +46,13 @@ The following exceptions are raised by :mod:`urllib.error` as appropriate:
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.request.rst b/Doc/library/urllib.request.rst
index 6493a292aa..6ac90818dc 100644
--- a/Doc/library/urllib.request.rst
+++ b/Doc/library/urllib.request.rst
@@ -218,12 +218,17 @@ The following classes are provided:
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 +361,11 @@ The following classes are provided:
Open local files.
+.. class:: DataHandler()
+
+ Open data URLs.
+
+ .. versionadded:: 3.4
.. class:: FTPHandler()
@@ -391,6 +401,12 @@ request.
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 +429,10 @@ request.
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 +440,20 @@ request.
.. 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,65 +488,29 @@ request.
unredirected).
-.. method:: Request.get_full_url()
-
- Return the URL given in the constructor.
-
-
-.. method:: Request.set_proxy(host, type)
-
- Prepare the request by connecting to a proxy server. The *host* and *type* will
- replace those of the instance, and the instance's selector will be the original
- 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()
+.. method:: Request.remove_header(header)
- Return the instance's data. Deprecated in 3.3, use :attr:`Request.data`.
+ Remove named header from the request instance (both from regular and
+ unredirected headers).
- .. deprecated-removed:: 3.3 3.4
+ .. versionadded:: 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_full_url()
-.. method:: Request.get_host()
+ Return the URL given in the constructor.
- Return the host to which a connection will be made. Deprecated in 3.3, use
- :attr:`Request.host`.
+ .. versionchanged:: 3.4
- .. deprecated-removed:: 3.3 3.4
+ Returns :attr:`Request.full_url`
-.. method:: Request.get_selector()
+.. method:: Request.set_proxy(host, type)
- Return the selector --- the part of the URL that is sent to the server.
- Deprecated in 3.3, use :attr:`Request.selector`.
+ Prepare the request by connecting to a proxy server. The *host* and *type* will
+ replace those of the instance, and the instance's selector will be the original
+ URL given in the constructor.
- .. deprecated-removed:: 3.3 3.4
.. method:: Request.get_header(header_name, default=None)
@@ -531,26 +522,10 @@ request.
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
+ Request methods add_data, has_data, get_data, get_type, get_host,
+ get_selector, get_origin_req_host and is_unverifiable deprecated since 3.3
+ have been removed.
.. _opener-director-objects:
@@ -983,6 +958,21 @@ FileHandler Objects
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 @@ some point in the future.
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 96ca2f5155..e93f48e9f5 100644
--- a/Doc/library/venv.rst
+++ b/Doc/library/venv.rst
@@ -76,6 +76,8 @@ Creating virtual environments
without there needing to be any reference to its venv in ``PATH``.
+.. _venv-api:
+
API
---
@@ -85,7 +87,8 @@ The high-level method described above makes use of a simple API which provides
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 @@ creation according to their needs, the :class:`EnvBuilder` class.
* ``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 @@ creation according to their needs, the :class:`EnvBuilder` class.
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 @@ creation according to their needs, the :class:`EnvBuilder` class.
* ``__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 @@ creation according to their needs, the :class:`EnvBuilder` class.
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 afafb45c55..ab64978cfd 100644
--- a/Doc/library/wave.rst
+++ b/Doc/library/wave.rst
@@ -19,26 +19,32 @@ The :mod:`wave` module defines the following function and exception:
.. 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 @@ Wave_read objects, as returned by :func:`.open`, have the following methods:
.. 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 @@ them, and is otherwise implementation dependent.
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 @@ Wave_write objects, as returned by :func:`.open`, have the following methods:
.. 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 @@ Wave_write objects, as returned by :func:`.open`, have the following methods:
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 224f442edd..9ca60a903f 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -51,10 +51,16 @@ garbage collection. :class:`WeakSet` implements the :class:`set` interface,
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 @@ Extension types can easily be made to support weak references; see
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 @@ These method have the same issues as the and :meth:`keyrefs` method of
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 @@ These method have the same issues as the and :meth:`keyrefs` method of
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 @@ objects can still be retrieved by ID if they do.
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/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index 3f2dcbb71b..c6dbce062a 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -105,6 +105,46 @@ Children are nested, and we can access specific child nodes by index::
>>> root[0][1].text
'2008'
+
+.. _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
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -379,25 +419,32 @@ Functions
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)
@@ -438,29 +485,39 @@ Functions
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 +810,8 @@ ElementTree Objects
.. 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 +822,10 @@ ElementTree Objects
*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 +834,9 @@ ElementTree Objects
: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 +882,7 @@ QName Objects
:class:`QName` instances are opaque.
+
.. _elementtree-treebuilder-objects:
TreeBuilder Objects
@@ -876,13 +942,18 @@ XMLParser Objects
.. 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 +973,12 @@ XMLParser Objects
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 +1012,60 @@ XMLParser Objects
>>> 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
^^^^^^^^^^
diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst
index 7a6482be1f..1d23a7c4d2 100644
--- a/Doc/library/zipfile.rst
+++ b/Doc/library/zipfile.rst
@@ -130,7 +130,7 @@ ZipFile Objects
---------------
-.. 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 @@ ZipFile Objects
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 @@ ZipFile Objects
.. 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 @@ ZipFile Objects
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 @@ ZipFile Objects
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 @@ PyZipFile Objects
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 @@ The :class:`PyZipFile` constructor takes the same parameters as the
``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 @@ The :class:`PyZipFile` constructor takes the same parameters as the
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 4440c7b130..08e5464769 100644
--- a/Doc/license.rst
+++ b/Doc/license.rst
@@ -590,6 +590,35 @@ The :mod:`select` and contains the following notice for the kqueue interface::
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
---------------
@@ -846,6 +875,47 @@ used for the build::
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 d6f70744e2..0b5b56e428 100644
--- a/Doc/make.bat
+++ b/Doc/make.bat
@@ -1,7 +1,6 @@
@@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
@@ -14,15 +13,11 @@ 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
:help
set this=%~n0
echo HELP
echo.
-echo %this% checkout
-echo %this% update
echo %this% html
echo %this% htmlhelp
echo %this% latex
@@ -33,20 +28,6 @@ echo %this% changes
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
-goto end
-
:build
if not exist build mkdir build
if not exist build\%1 mkdir build\%1
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index 8afc69eaba..e35aa9f740 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -493,14 +493,15 @@ case the parameter's default value is substituted. If a parameter has a default
value, all following parameters up until the "``*``" must also have a default
value --- this is a syntactic restriction that is not expressed by the grammar.
-**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 160af305d8..8204dc3dcd 100644
--- a/Doc/reference/datamodel.rst
+++ b/Doc/reference/datamodel.rst
@@ -934,6 +934,20 @@ Internal types
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
@@ -1121,12 +1135,10 @@ Basic customization
``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.
+ 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::
@@ -1214,6 +1226,10 @@ Basic customization
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)
@@ -1631,6 +1647,8 @@ of these candidate metaclasses. If none of the candidate metaclasses meets
that criterion, then the class definition will fail with ``TypeError``.
+.. _prepare:
+
Preparing the class namespace
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1830,6 +1848,15 @@ through the container; for mappings, :meth:`__iter__` should be the same as
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 ::
@@ -2061,9 +2088,17 @@ left undefined.
.. 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::
+
+ When :meth:`__index__` is defined, :meth:`__int__` should also be defined,
+ and both shuld return the same value, in order to have a coherent integer
+ type class.
.. _context-managers:
diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst
index eb497a10b2..1b28d2c67a 100644
--- a/Doc/reference/import.rst
+++ b/Doc/reference/import.rst
@@ -210,6 +210,7 @@ Finders and loaders
.. 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 @@ The import machinery is extensible, so new finders can be added to extend the
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 @@ The meta path
.. 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,236 @@ knows how to import built-in modules, one that knows how to import frozen
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.
-
-In many cases, the finder and loader can be the same object; in such cases the
-:meth:`finder.find_module()` would just return ``self``.
-
-Loaders must satisfy the following requirements:
+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::
+
+ 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)
+
+ 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.
-
- * 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`).
-
- * 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.
-
- * 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 ``__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.
-
- * 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.
+ * 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`.
- This attribute is used instead of ``__name__`` to calculate explicit
- relative imports for main modules, as defined in :pep:`366`.
+ * 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>`.
+
+ * 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.
+
+ * The module created during loading and passed to exec_module() may
+ not be the one returned at the end of import [#fnlo]_.
+
+.. 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.
+
+Loaders
+-------
+
+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.
-
-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.
-
-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.
+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.
-Here are the exact rules used:
+.. versionadded:: 3.4
+ The create_module() method of loaders.
- * 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.
+.. 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.
- * 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.
+ 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 ``__file__`` attribute, this is used as part of 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 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 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`.
- * Otherwise, just use the module's ``__name__`` in the repr.
+ * The module *must* exist in :data:`sys.modules` before the loader
+ executes the module code, to prevent unbounded recursion or multiple
+ loading.
+
+ * 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.
+
+Module spec
+-----------
+
+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.
+
+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__
-This example, from :pep:`420` shows how a loader can craft its own module
-repr::
+ 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.
- class NamespaceLoader:
- @classmethod
- def module_repr(cls, module):
- return "<module '{}' (namespace)>".format(module.__name__)
+.. 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.
+
+ .. 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 +576,47 @@ A package's ``__init__.py`` file may set or alter the package's ``__path__``
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 +625,9 @@ The Path Based Finder
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 +676,15 @@ Path entry finders
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 +704,16 @@ finder>`.
The :term:`path based finder` is a :term:`meta path finder`, so the import
machinery begins the :term:`import path` search by calling the path
-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 +730,82 @@ hooks <path entry hook>` in this list is called with a single argument, the
path entry to be searched. This callable may either return a :term:`path
entry finder` that can handle the path entry, or it may raise
:exc:`ImportError`. An :exc:`ImportError` is used by the path based finder to
-signal that the hook cannot find a :term:`path entry finder` for that
-:term:`path entry`. The exception is ignored and :term:`import path`
-iteration continues. The hook should expect either a string or bytes object;
-the encoding of bytes objects is up to the hook (e.g. it may be a file system
-encoding, UTF-8, or something else), and if the hook cannot decode the
-argument, it should raise :exc:`ImportError`.
+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.
-
-: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.
-
-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.
-
-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).
-
-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()`.
+the :meth:`~importlib.abc.PathEntryFinder.find_spec` method.
+
+: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).
+
+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.
+
+.. 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.
+
+ 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 +824,9 @@ import statements within that module.
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.
Open issues
@@ -688,6 +866,11 @@ proposed ``__name__`` for semantics :pep:`366` would eventually specify for
: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/tools/sphinx-build.py b/Doc/tools/sphinx-build.py
deleted file mode 100644
index d3fe7026b1..0000000000
--- 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/indexcontent.html b/Doc/tools/sphinxext/indexcontent.html
index 7f8547020f..969099a006 100644
--- a/Doc/tools/sphinxext/indexcontent.html
+++ b/Doc/tools/sphinxext/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/sphinxext/indexsidebar.html b/Doc/tools/sphinxext/indexsidebar.html
index a0ec32f163..ed5da0cd31 100644
--- a/Doc/tools/sphinxext/indexsidebar.html
+++ b/Doc/tools/sphinxext/indexsidebar.html
@@ -3,7 +3,7 @@
<h3>Docs for other versions</h3>
<ul>
<li><a href="http://docs.python.org/2.7/">Python 2.7 (stable)</a></li>
- <li><a href="http://docs.python.org/3.4/">Python 3.4 (in development)</a></li>
+ <li><a href="http://docs.python.org/3.3/">Python 3.3 (stable)</a></li>
<li><a href="http://www.python.org/doc/versions/">Old versions</a></li>
</ul>
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index f2d3ca17d7..e37ef89fcd 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -10,7 +10,7 @@
"""
ISSUE_URI = 'http://bugs.python.org/issue%s'
-SOURCE_URI = 'http://hg.python.org/cpython/file/3.3/%s'
+SOURCE_URI = 'http://hg.python.org/cpython/file/default/%s'
from docutils import nodes, utils
diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/sphinxext/susp-ignored.csv
index abc3ca85c0..f9d6bbfa57 100644
--- a/Doc/tools/sphinxext/susp-ignored.csv
+++ b/Doc/tools/sphinxext/susp-ignored.csv
@@ -79,9 +79,8 @@ howto/logging,,:Started,INFO:root:Started
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/linecache,,:sys,"sys:x:3:3:sys:/dev:/bin/sh"
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,,:bytes,:bytes
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/socket,,:len,fds.fromstring(cmsg_data[:len(cmsg_data) - (len(cmsg_data)
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,'r:xz'
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"""
@@ -283,6 +277,7 @@ whatsnew/3.2,,:gz,">>> with tarfile.open(name='myarchive.tar.gz', mode='w:gz') a
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"
diff --git a/Doc/tutorial/interactive.rst b/Doc/tutorial/interactive.rst
index 36acb06d29..abf30f020d 100644
--- a/Doc/tutorial/interactive.rst
+++ b/Doc/tutorial/interactive.rst
@@ -7,140 +7,27 @@ Interactive Input Editing and History Substitution
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
-============
-
-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
+Tab Completion and History Editing
+==================================
- # 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 @@ into other applications. Another similar enhanced interactive environment is
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 cdc2bf2f1a..c182511ada 100644
--- a/Doc/tutorial/interpreter.rst
+++ b/Doc/tutorial/interpreter.rst
@@ -10,13 +10,13 @@ Using the Python Interpreter
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,11 +24,11 @@ Python guru or system administrator. (E.g., :file:`/usr/local/python` is a
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
@@ -95,8 +95,8 @@ with the *secondary prompt*, by default three dots (``...``). The interpreter
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)
+ $ python3.4
+ Python 3.4 (default, Sep 24 2012, 09:25:04)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
@@ -149,7 +149,7 @@ 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
+ #! /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
diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst
index 19029641ea..fd361aed69 100644
--- a/Doc/tutorial/modules.rst
+++ b/Doc/tutorial/modules.rst
@@ -165,10 +165,16 @@ a built-in module with that name. If not found, it then searches for a file
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 @@ defines. It returns a sorted list of strings::
>>> 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 7e7a1545ee..2e3ed181d0 100644
--- a/Doc/tutorial/stdlib.rst
+++ b/Doc/tutorial/stdlib.rst
@@ -15,7 +15,7 @@ operating system::
>>> 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
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst
index c1dd69adce..c0197ea5ef 100644
--- a/Doc/tutorial/stdlib2.rst
+++ b/Doc/tutorial/stdlib2.rst
@@ -277,7 +277,7 @@ applications include caching objects that are expensive to create::
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 7fcbdc3f44..979f58719e 100644
--- a/Doc/tutorial/whatnow.rst
+++ b/Doc/tutorial/whatnow.rst
@@ -21,8 +21,8 @@ the set are:
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
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 4e7168fb28..0c3c2037e8 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -24,7 +24,7 @@ Command line
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 @@ source.
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 @@ source.
.. versionchanged:: 3.1
Supply the package name to run a ``__main__`` submodule.
+ .. versionchanged:: 3.4
+ namespace packages are also supported
+
.. describe:: -
@@ -147,7 +151,12 @@ source.
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`).
+
+.. versionchanged:: 3.4
+ Automatic enabling of tab-completion and history editing.
.. seealso:: :ref:`tut-invoking`
@@ -170,6 +179,8 @@ Generic options
Python 3.0
+.. _using-on-misc-options:
+
Miscellaneous options
~~~~~~~~~~~~~~~~~~~~~
@@ -208,6 +219,17 @@ Miscellaneous options
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 +380,19 @@ Miscellaneous options
.. 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 +400,9 @@ Miscellaneous options
.. versionadded:: 3.3
The ``-X faulthandler`` option.
+ .. versionadded:: 3.4
+ The ``-X showrefcount`` and ``-X tracemalloc`` options.
+
Options you shouldn't use
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -385,7 +420,7 @@ Environment variables
---------------------
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,7 +465,7 @@ conflict.
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.
+ :data:`sys.ps2` and the hook :data:`sys.__interactivehook__` in this file.
.. envvar:: PYTHONY2K
@@ -485,9 +520,9 @@ conflict.
.. 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 +547,16 @@ conflict.
.. 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 +594,34 @@ conflict.
.. 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 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 3e1b74df0b..5be439f3d6 100644
--- a/Doc/using/mac.rst
+++ b/Doc/using/mac.rst
@@ -25,7 +25,7 @@ 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
@@ -93,7 +93,7 @@ aware of: programs that talk to the Aqua window manager (in other words,
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
@@ -158,7 +158,7 @@ http://www.riverbankcomputing.co.uk/software/pyqt/intro.
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.
diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst
index 40635c6111..3c7fc41344 100644
--- a/Doc/using/unix.rst
+++ b/Doc/using/unix.rst
@@ -60,6 +60,8 @@ To install the newest Python versions on OpenSolaris, install `blastwave
prompt.
+.. _building-python-on-unix:
+
Building Python
===============
diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc
index 5fdbc9be45..52cdda044d 100644
--- a/Doc/using/venv-create.inc
+++ b/Doc/using/venv-create.inc
@@ -11,6 +11,11 @@ containing a copy of the ``python`` binary (or binaries, in the case of
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
+ <http://packaging.python.org/en/latest/tutorial.html#creating-and-using-virtual-environments>`__
+
.. highlight:: none
On Windows, you may have to invoke the ``pyvenv`` script as follows, if you
@@ -25,7 +30,7 @@ or equivalently::
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,11 +43,19 @@ The command, if run with ``-h``, will show the available options::
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)
+
+.. versionchanged:: 3.4
+ Installs pip by default, added the ``--without-pip`` and ``--copies``
+ options
If the target directory already exists an error will be raised, unless
the ``--clear`` or ``--upgrade`` option was provided.
@@ -51,25 +64,29 @@ 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::
-
- $ 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.
+venv's binary directory. The invocation of the script is platform-specific:
+
++-------------+-----------------+-----------------------------------------+
+| 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 +100,5 @@ a "deactivate" function, whereas on Windows there are separate scripts called
``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 6c4d16e270..42a92afad7 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
=================
@@ -560,12 +564,6 @@ View the :file:`readme.txt` in their respective directories:
+--------------------+--------------+-----------------------+
| 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 |
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
new file mode 100644
index 0000000000..7f7383059e
--- /dev/null
+++ b/Doc/whatsnew/3.4.rst
@@ -0,0 +1,2496 @@
+****************************
+ 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 TBD.
+
+For full details, see the
+`changelog <http://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.
+
+New expected features for Python implementations:
+
+* :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 Expected Features for Python Implementations
+================================================
+
+.. _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.
+
+By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where
+X.Y stands for the version of the Python installation), along with the
+``pip`` Python package and its dependencies.
+
+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 offer the option to
+install ``pip`` along with CPython itself.
+
+As `discussed in the PEP`__, platform packagers may choose not to install
+``pip`` by default, as long as the command ``pip``, when invoked, provides
+clear and simple directions on how to install ``pip`` on the platform.
+
+__ http://www.python.org/dev/peps/pep-0453/#recommendations-for-downstream-distributors
+
+
+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
+<http://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`.
+
+.. 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 (including by the CPython
+ installers). ``pyvenv`` ensures that the unqualified ``pip`` command is
+ made available in virtual environments, and ``pip`` can always be
+ invoked via the ``-m`` switch rather than directly to avoid ambiguity on
+ systems with multiple Python installations.
+
+.. 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 manager 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 dfault "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 manager 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 manager 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 :func:`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
+ <http://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 <http://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:`AttributError`. 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.
diff --git a/Doc/whatsnew/index.rst b/Doc/whatsnew/index.rst
index bc1206bb64..29902e407c 100644
--- a/Doc/whatsnew/index.rst
+++ b/Doc/whatsnew/index.rst
@@ -11,6 +11,7 @@ anyone wishing to stay up-to-date after a new release.
.. 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 00e92d0b97..67d677b233 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -182,8 +182,9 @@ enum _expr_kind {BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4,
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 @@ struct _expr {
} Bytes;
struct {
+ singleton value;
+ } NameConstant;
+
+ struct {
expr_ty value;
identifier attr;
expr_context_ty ctx;
@@ -359,18 +364,18 @@ struct _excepthandler {
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_Num(object n, int lineno, int col_offset, PyArena *arena);
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 @@ comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_seq *
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 a78a721926..2dd82903bc 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 c9624f32b2..4bc9952ac6 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -144,7 +144,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
- 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
#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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
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.
@@ -1151,7 +1156,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/* 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
#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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
*/
- 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 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
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 6bf618f3e9..495153c576 100644
--- a/Include/asdl.h
+++ b/Include/asdl.h
@@ -5,6 +5,7 @@ typedef PyObject * identifier;
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 @@ typedef struct {
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 055e8dc916..6a8c8165c0 100644
--- a/Include/ast.h
+++ b/Include/ast.h
@@ -10,6 +10,11 @@ PyAPI_FUNC(mod_ty) PyAST_FromNode(
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 eccd44c751..a757b88059 100644
--- a/Include/bytearrayobject.h
+++ b/Include/bytearrayobject.h
@@ -22,10 +22,11 @@ extern "C" {
#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 @@ PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
#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 d7c7ffd37b..0ee8d366d4 100644
--- a/Include/bytesobject.h
+++ b/Include/bytesobject.h
@@ -86,11 +86,11 @@ PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x);
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/compile.h b/Include/compile.h
index ac2636dfc9..c6650d7f77 100644
--- a/Include/compile.h
+++ b/Include/compile.h
@@ -36,11 +36,27 @@ PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
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 d89aac8932..ef122bde97 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -53,6 +53,10 @@ PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
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_SetItemId(PyObject *dp, struct _Py_Identifier *key, PyOb
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/fileobject.h b/Include/fileobject.h
index a99c94d2d5..0939744e6d 100644
--- a/Include/fileobject.h
+++ b/Include/fileobject.h
@@ -8,8 +8,9 @@ extern "C" {
#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 7c18cf2378..e9bad80b87 100644
--- a/Include/fileutils.h
+++ b/Include/fileutils.h
@@ -27,11 +27,21 @@ PyAPI_FUNC(int) _Py_stat(
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 @@ PyAPI_FUNC(wchar_t*) _Py_wgetcwd(
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 33f73af52a..966ff1f6e6 100644
--- a/Include/frameobject.h
+++ b/Include/frameobject.h
@@ -36,8 +36,9 @@ typedef struct _frame {
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 @@ typedef struct _frame {
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 @@ PyAPI_FUNC(PyObject **) PyFrame_ExtendStack(PyFrameObject *, int, int);
/* 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 ed451baf3c..65f1ecfd54 100644
--- a/Include/genobject.h
+++ b/Include/genobject.h
@@ -36,6 +36,8 @@ PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
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 8426da30d9..ba7d19d821 100644
--- a/Include/grammar.h
+++ b/Include/grammar.h
@@ -69,14 +69,14 @@ typedef struct {
/* 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 73c86ee400..afdfac2a93 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -13,19 +13,19 @@ PyMODINIT_FUNC PyInit_imp(void);
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 @@ PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
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_FindBuiltin(
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 @@ PyAPI_FUNC(int) PyImport_AppendInittab(
#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/longobject.h b/Include/longobject.h
index 1c1c5de8e1..ff43309c76 100644
--- a/Include/longobject.h
+++ b/Include/longobject.h
@@ -52,6 +52,19 @@ PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
#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(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
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 @@ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
/* 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 e96d062b18..09d9337e57 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(int) PyMarshal_ReadShortFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *);
PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *);
#endif
-PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
+PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *,
+ Py_ssize_t);
#ifdef __cplusplus
}
diff --git a/Include/modsupport.h b/Include/modsupport.h
index ecf1dccc81..5de0458245 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -26,7 +26,7 @@ PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
/* 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 @@ PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...);
#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 8013dd9b48..f119364b88 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -25,6 +25,7 @@ PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
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/object.h b/Include/object.h
index cdeb06ccd4..7584d4cdde 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -143,7 +143,8 @@ typedef struct _Py_Identifier {
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 @@ typedef struct _typeobject {
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 @@ typedef struct _typeobject {
/* 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 @@ typedef struct{
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 @@ PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
#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) PyType_Type; /* built-in 'type' */
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(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *
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) PyObject_Not(PyObject *);
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,23 +572,6 @@ PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *);
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);
-#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))
@@ -604,50 +602,55 @@ given type object has a specified feature.
*/
/* 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 +685,6 @@ is not considered to be a reference to the type object, to save
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 +701,6 @@ PyAPI_DATA(Py_ssize_t) _Py_RefTotal;
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 +762,16 @@ PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
#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 +810,27 @@ PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
*/
#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 c6b7df4aa5..3f21b70e07 100644
--- a/Include/objimpl.h
+++ b/Include/objimpl.h
@@ -94,51 +94,27 @@ PyObject_{New, NewVar, Del}.
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
-
-#else /* WITH_PYMALLOC && ! PYMALLOC_DEBUG */
+#endif
+
+/* 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 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
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 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
/* 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 @@ typedef union _gc_head {
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 @@ extern PyGC_Head *_PyGC_generation0;
* 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 @@ extern PyGC_Head *_PyGC_generation0;
*/
#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 @@ extern PyGC_Head *_PyGC_generation0;
/* 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 a90184d0d7..0936f2d9f4 100644
--- a/Include/opcode.h
+++ b/Include/opcode.h
@@ -49,7 +49,6 @@ extern "C" {
#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 @@ extern "C" {
#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 05c0c8ea4a..0c2e34b879 100644
--- a/Include/osdefs.h
+++ b/Include/osdefs.h
@@ -9,16 +9,10 @@ extern "C" {
/* 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 911dfc10e4..2acb854672 100644
--- a/Include/parsetok.h
+++ b/Include/parsetok.h
@@ -38,29 +38,49 @@ typedef struct {
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 @@ PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(
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 61a3ba09c2..4e4265c579 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 5
-#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
-#define PY_RELEASE_SERIAL 0
+#define PY_MINOR_VERSION 4
+#define PY_MICRO_VERSION 0
+#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA
+#define PY_RELEASE_SERIAL 1
/* Version as a string */
-#define PY_VERSION "3.3.5+"
+#define PY_VERSION "3.4.0rc1+"
/*--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 97c2f8c425..8fe98183f9 100644
--- a/Include/pydebug.h
+++ b/Include/pydebug.h
@@ -20,6 +20,7 @@ PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
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 e38512307e..e44fb5f0eb 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -53,6 +53,7 @@ typedef struct {
PyObject *myerrno;
PyObject *strerror;
PyObject *filename;
+ PyObject *filename2;
#ifdef MS_WINDOWS
PyObject *winerror;
#endif
@@ -75,6 +76,9 @@ typedef PyOSErrorObject PyWindowsErrorObject;
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 */
@@ -198,9 +202,6 @@ PyAPI_DATA(PyObject *) PyExc_IOError;
#ifdef MS_WINDOWS
PyAPI_DATA(PyObject *) PyExc_WindowsError;
#endif
-#ifdef __VMS
-PyAPI_DATA(PyObject *) PyExc_VMSError;
-#endif
PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst;
@@ -225,6 +226,8 @@ PyAPI_FUNC(PyObject *) PyErr_NoMemory(void);
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 +256,8 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename(
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 +289,28 @@ PyAPI_FUNC(PyObject *) PyErr_NewExceptionWithDoc(
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 +328,20 @@ PyAPI_FUNC(void) PyErr_SyntaxLocationEx(
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 0000000000..a7ca93758c
--- /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 793f67dce9..7997c55cd6 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 10b5bea5eb..2372b864a1 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 @@ extern "C" {
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 @@ PyAPI_FUNC(void) PyMem_Free(void *);
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 @@ PyAPI_FUNC(void) PyMem_Free(void *);
#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 a5edea978a..c706213c87 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -144,23 +144,6 @@ Used in: PY_LONG_LONG
#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 @@ typedef Py_intptr_t Py_ssize_t;
#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 @@ typedef size_t Py_uhash_t;
/* 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 @@ typedef size_t Py_uhash_t;
*/
#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 @@ typedef size_t Py_uhash_t;
#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 @@ typedef size_t Py_uhash_t;
#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 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#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 @@ extern pid_t forkpty(int *, char *, struct termios *, struct winsize *);
#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 2017b0276f..4992c22684 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -33,7 +33,6 @@ typedef struct _is {
int codecs_initialized;
int fscodec_initialized;
-
#ifdef HAVE_DLOPEN
int dlopenflags;
#endif
@@ -41,6 +40,7 @@ typedef struct _is {
int tscdump;
#endif
+ PyObject *builtins_copy;
} PyInterpreterState;
#endif
@@ -69,6 +69,7 @@ typedef struct _ts PyThreadState;
typedef struct _ts {
/* See Python/ceval.c for comments explaining most fields */
+ struct _ts *prev;
struct _ts *next;
PyInterpreterState *interp;
@@ -99,16 +100,6 @@ typedef struct _ts {
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 @@ typedef struct _ts {
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_AddModule(PyObject*, struct PyModuleDef*);
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(void) PyGILState_Release(PyGILState_STATE);
*/
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 e8a582d50a..2fc5578f04 100644
--- a/Include/pythonrun.h
+++ b/Include/pythonrun.h
@@ -28,6 +28,14 @@ PyAPI_FUNC(wchar_t *) Py_GetProgramName(void);
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 @@ PyAPI_FUNC(int) PyRun_InteractiveOneFlags(
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 @@ PyAPI_FUNC(struct _mod *) PyParser_ASTFromString(
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 @@ PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile(
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 @@ PyAPI_FUNC(PyObject *) Py_CompileStringExFlags(
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) _PyImport_Init(void);
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) PyBytes_Fini(void);
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 52902f5e3a..b0fc6d0354 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -53,10 +53,19 @@ do { \
(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(time_t) _PyLong_AsTime_t(
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_ObjectToTimeval(
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 a14874bb0f..ae3f556365 100644
--- a/Include/setobject.h
+++ b/Include/setobject.h
@@ -23,8 +23,8 @@ no meaning otherwise.
typedef struct {
/* Cached hash code of the key. */
- Py_hash_t hash;
PyObject *key;
+ Py_hash_t hash;
} setentry;
@@ -51,9 +51,9 @@ struct _setobject {
*/
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 @@ struct _setobject {
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(PyObject *) PySet_Pop(PyObject *set);
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 8bec17909d..f7ee90c3cc 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -34,6 +34,9 @@ PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
+PyAPI_FUNC(int) _PySlice_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 30c52aca9b..af227164c8 100644
--- a/Include/structseq.h
+++ b/Include/structseq.h
@@ -24,6 +24,8 @@ extern char* PyStructSequence_UnnamedField;
#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 6ed3a2b06c..1cfd8844e5 100644
--- a/Include/symtable.h
+++ b/Include/symtable.h
@@ -16,7 +16,7 @@ typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock }
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 @@ typedef struct _symtable_entry {
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 @@ typedef struct _symtable_entry {
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 @@ PyAPI_FUNC(struct symtable *) PySymtable_Build(
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 0cabf6fee7..79e52a365f 100644
--- a/Include/sysmodule.h
+++ b/Include/sysmodule.h
@@ -8,7 +8,12 @@ extern "C" {
#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 *);
diff --git a/Include/token.h b/Include/token.h
index f7f650456e..905022b8d2 100644
--- a/Include/token.h
+++ b/Include/token.h
@@ -75,7 +75,7 @@ extern "C" {
#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/unicodeobject.h b/Include/unicodeobject.h
index a8f5b5df36..c088a0f0c1 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -180,9 +180,9 @@ typedef unsigned char Py_UCS1;
} 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) | \
@@ -859,7 +859,7 @@ PyAPI_FUNC(int) PyUnicode_Resize(
*/
PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
- register PyObject *obj, /* Object */
+ PyObject *obj, /* Object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
@@ -878,7 +878,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
*/
PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
- register PyObject *obj /* Object */
+ PyObject *obj /* Object */
);
PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(
@@ -898,22 +898,28 @@ typedef struct {
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 +939,52 @@ PyAPI_FUNC(int)
_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_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);
+_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 +1023,7 @@ PyAPI_FUNC(void) _Py_ReleaseInternedUnicodeStrings(void);
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 +1041,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
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 +1772,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
/* 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 +1996,21 @@ PyAPI_FUNC(PyObject *) PyUnicode_Replace(
);
/* 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 b7db681cc4..effb9fad71 100644
--- a/Include/warnings.h
+++ b/Include/warnings.h
@@ -17,6 +17,15 @@ PyAPI_FUNC(int) PyErr_WarnFormat(
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 @@ PyAPI_FUNC(int) PyErr_WarnExplicit(
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 0000000000..4bccac1139
--- /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 0000000000..faa1ff22ff
--- /dev/null
+++ b/Lib/_collections_abc.py
@@ -0,0 +1,734 @@
+# 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), 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):
+ 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 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)
+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 13b1f26965..b67cfb95be 100644
--- a/Lib/_dummy_thread.py
+++ b/Lib/_dummy_thread.py
@@ -81,6 +81,10 @@ def stack_size(size=None):
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 50b2d17e90..40fc78b698 100644
--- a/Lib/_osx_support.py
+++ b/Lib/_osx_support.py
@@ -38,7 +38,7 @@ def _find_executable(executable, path=None):
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 @@ def _get_system_version():
_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
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index a0c4b25977..b04d23a0c2 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -34,7 +34,7 @@ BlockingIOError = BlockingIOError
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 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
'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 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
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 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
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 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
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")
@@ -200,7 +208,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
buffering = DEFAULT_BUFFER_SIZE
try:
bs = os.fstat(raw.fileno()).st_blksize
- except (os.error, AttributeError):
+ except (OSError, AttributeError):
pass
else:
if bs > 1:
@@ -254,7 +262,7 @@ class OpenWrapper:
try:
UnsupportedOperation = io.UnsupportedOperation
except AttributeError:
- class UnsupportedOperation(ValueError, IOError):
+ class UnsupportedOperation(ValueError, OSError):
pass
@@ -278,7 +286,7 @@ class IOBase(metaclass=abc.ABCMeta):
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 +302,7 @@ class IOBase(metaclass=abc.ABCMeta):
### 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 +449,7 @@ class IOBase(metaclass=abc.ABCMeta):
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 +463,11 @@ class IOBase(metaclass=abc.ABCMeta):
### 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 +480,18 @@ class IOBase(metaclass=abc.ABCMeta):
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 +550,17 @@ class RawIOBase(IOBase):
# 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 +618,8 @@ class BufferedIOBase(IOBase):
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 +638,9 @@ class BufferedIOBase(IOBase):
"""
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 +707,13 @@ class _BufferedIOMixin(BufferedIOBase):
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):
@@ -820,24 +828,24 @@ class BytesIO(BufferedIOBase):
"""
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 +935,7 @@ class BufferedReader(_BufferedIOMixin):
"""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 +948,18 @@ class BufferedReader(_BufferedIOMixin):
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 +1019,7 @@ class BufferedReader(_BufferedIOMixin):
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 +1027,7 @@ class BufferedReader(_BufferedIOMixin):
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 +1045,18 @@ class BufferedReader(_BufferedIOMixin):
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 +1082,7 @@ class BufferedWriter(_BufferedIOMixin):
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 +1146,7 @@ class BufferedWriter(_BufferedIOMixin):
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 +1182,18 @@ class BufferedRWPair(BufferedIOBase):
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 +1201,11 @@ class BufferedRWPair(BufferedIOBase):
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 +1256,7 @@ class BufferedRandom(BufferedWriter, BufferedReader):
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 +1271,23 @@ class BufferedRandom(BufferedWriter, BufferedReader):
# 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 +1307,11 @@ class TextIOBase(IOBase):
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.
"""
@@ -1732,7 +1740,7 @@ class TextIOWrapper(TextIOBase):
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 +1827,7 @@ class TextIOWrapper(TextIOBase):
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 +1904,7 @@ class TextIOWrapper(TextIOBase):
# 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 +1920,16 @@ class TextIOWrapper(TextIOBase):
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 +1937,12 @@ class TextIOWrapper(TextIOBase):
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 +1954,13 @@ class TextIOWrapper(TextIOBase):
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 +2019,8 @@ class TextIOWrapper(TextIOBase):
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 +2035,8 @@ class TextIOWrapper(TextIOBase):
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 +2067,6 @@ class StringIO(TextIOWrapper):
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 0000000000..1f21358e26
--- /dev/null
+++ b/Lib/_sitebuiltins.py
@@ -0,0 +1,99 @@
+"""
+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 (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)
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 9058a69861..d101c6de05 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -21,7 +21,7 @@ from datetime import (date as datetime_date,
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 09778e8609..0358a4696d 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 @@ class ABCMeta(type):
# 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 @@ class ABCMeta(type):
# 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 db0924a2b7..9e64de9c44 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -69,7 +69,7 @@ This returns an instance of a class with the following public methods:
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 @@ def _write_float(f, x):
_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 @@ class Aifc_read:
# 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 @@ class Aifc_read:
## 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 @@ class Aifc_write:
def __del__(self):
self.close()
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ self.close()
+
#
# User visible methods.
#
@@ -644,8 +661,8 @@ class Aifc_write:
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 @@ class Aifc_write:
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 __name__ == '__main__':
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 __name__ == '__main__':
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 bc2ba132ed..5ad7e13a48 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -608,8 +608,7 @@ class HelpFormatter(object):
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 @@ class _VersionAction(Action):
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):
@@ -1143,11 +1143,17 @@ class FileType(object):
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 +1168,18 @@ class FileType(object):
# 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)
# ===========================
@@ -2003,17 +2013,14 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
# 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 13f59f9dfa..02c3b2867f 100644
--- a/Lib/ast.py
+++ b/Lib/ast.py
@@ -42,7 +42,6 @@ def literal_eval(node_or_string):
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 @@ def literal_eval(node_or_string):
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 eea3418762..0378fa7069 100644
--- a/Lib/asynchat.py
+++ b/Lib/asynchat.py
@@ -56,8 +56,8 @@ class async_chat (asyncore.dispatcher):
# 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
@@ -111,7 +111,7 @@ class async_chat (asyncore.dispatcher):
try:
data = self.recv (self.ac_in_buffer_size)
- except socket.error as why:
+ except OSError as why:
self.handle_error()
return
@@ -240,7 +240,7 @@ class async_chat (asyncore.dispatcher):
# send the data
try:
num_sent = self.send(data)
- except socket.error:
+ except OSError:
self.handle_error()
return
diff --git a/Lib/asyncio/__init__.py b/Lib/asyncio/__init__.py
new file mode 100644
index 0000000000..3df2f8034d
--- /dev/null
+++ b/Lib/asyncio/__init__.py
@@ -0,0 +1,45 @@
+"""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 .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 *
+
+if sys.platform == 'win32': # pragma: no cover
+ from .windows_events import *
+else:
+ from .unix_events import * # pragma: no cover
+
+
+__all__ = (events.__all__ +
+ futures.__all__ +
+ locks.__all__ +
+ protocols.__all__ +
+ queues.__all__ +
+ streams.__all__ +
+ subprocess.__all__ +
+ tasks.__all__ +
+ transports.__all__)
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
new file mode 100644
index 0000000000..80df9271b3
--- /dev/null
+++ b/Lib/asyncio/base_events.py
@@ -0,0 +1,807 @@
+"""Base implementation of event loop.
+
+The event loop can be broken up into a multiplexer (the part
+responsible for notifying us of IO 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 logging
+import socket
+import subprocess
+import time
+import os
+import sys
+
+from . import events
+from . import futures
+from . import tasks
+from .log import logger
+
+
+__all__ = ['BaseEventLoop', 'Server']
+
+
+# Argument for default thread pool executor creation.
+_MAX_WORKERS = 5
+
+
+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(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
+
+
+class Server(events.AbstractServer):
+
+ def __init__(self, loop, sockets):
+ self.loop = loop
+ self.sockets = sockets
+ self.active_count = 0
+ self.waiters = []
+
+ def attach(self, transport):
+ assert self.sockets is not None
+ self.active_count += 1
+
+ def detach(self, transport):
+ 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 not None:
+ 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)
+
+ @tasks.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._ready = collections.deque()
+ self._scheduled = []
+ self._default_executor = None
+ self._internal_fds = 0
+ self._running = False
+ self._clock_resolution = time.get_clock_info('monotonic').resolution
+ self._exception_handler = None
+ self._debug = False
+
+ 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, *,
+ server_side=False, server_hostname=None,
+ extra=None, server=None):
+ """Create SSL transport."""
+ raise NotImplementedError
+
+ def _make_datagram_transport(self, sock, protocol,
+ address=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
+
+ @tasks.coroutine
+ def _make_subprocess_transport(self, protocol, args, shell,
+ stdin, stdout, stderr, bufsize,
+ extra=None, **kwargs):
+ """Create subprocess transport."""
+ raise NotImplementedError
+
+ def _read_from_self(self):
+ """XXX"""
+ raise NotImplementedError
+
+ def _write_to_self(self):
+ """XXX"""
+ raise NotImplementedError
+
+ def _process_events(self, event_list):
+ """Process selector events."""
+ raise NotImplementedError
+
+ def run_forever(self):
+ """Run until stop() is called."""
+ if self._running:
+ raise RuntimeError('Event loop is running.')
+ self._running = True
+ try:
+ while True:
+ try:
+ self._run_once()
+ except _StopError:
+ break
+ finally:
+ self._running = False
+
+ def run_until_complete(self, future):
+ """Run until the Future is done.
+
+ If the argument is a coroutine, it is wrapped in a Task.
+
+ XXX TBD: 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.
+ """
+ future = tasks.async(future, loop=self)
+ future.add_done_callback(_raise_stop_error)
+ self.run_forever()
+ future.remove_done_callback(_raise_stop_error)
+ 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.
+ Callback scheduled after stop() is called won't. However,
+ those callbacks will run if run() 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.
+ """
+ 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_running(self):
+ """Returns running status of event loop."""
+ return self._running
+
+ def time(self):
+ """Return the time according to the event loop's clock."""
+ 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 a relative 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.
+ """
+ return self.call_at(self.time() + delay, callback, *args)
+
+ def call_at(self, when, callback, *args):
+ """Like call_later(), but uses an absolute time."""
+ if tasks.iscoroutinefunction(callback):
+ raise TypeError("coroutines cannot be used with call_at()")
+ timer = events.TimerHandle(when, callback, args, self)
+ heapq.heappush(self._scheduled, timer)
+ 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 tasks.iscoroutinefunction(callback):
+ raise TypeError("coroutines cannot be used with call_soon()")
+ handle = events.Handle(callback, args, self)
+ self._ready.append(handle)
+ return handle
+
+ def call_soon_threadsafe(self, callback, *args):
+ """XXX"""
+ handle = self.call_soon(callback, *args)
+ self._write_to_self()
+ return handle
+
+ def run_in_executor(self, executor, callback, *args):
+ if tasks.iscoroutinefunction(callback):
+ raise TypeError("coroutines cannot be used with run_in_executor()")
+ 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(self, host, port, *,
+ family=0, type=0, proto=0, flags=0):
+ 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)
+
+ @tasks.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):
+ """XXX"""
+ 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
+ yield from self.sock_connect(sock, address)
+ except OSError as exc:
+ if sock is not None:
+ sock.close()
+ exceptions.append(exc)
+ 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)
+ return transport, protocol
+
+ @tasks.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)
+
+ yield from waiter
+ return transport, protocol
+
+ @tasks.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 addresss 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)
+ else:
+ break
+ else:
+ raise exceptions[0]
+
+ protocol = protocol_factory()
+ transport = self._make_datagram_transport(sock, protocol, r_addr)
+ return transport, protocol
+
+ @tasks.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):
+ """XXX"""
+ 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.
+ 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(
+ 'host and port was not specified and no sock 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)
+ return server
+
+ @tasks.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)
+ yield from waiter
+ return transport, protocol
+
+ @tasks.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)
+ yield from waiter
+ return transport, protocol
+
+ @tasks.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()
+ transport = yield from self._make_subprocess_transport(
+ protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs)
+ return transport, protocol
+
+ @tasks.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()
+ transport = yield from self._make_subprocess_transport(
+ protocol, popen_args, False, stdin, stdout, stderr,
+ bufsize, **kwargs)
+ 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
+ matching signature to '(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.
+
+ 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
+
+ log_lines = [message]
+ for key in sorted(context):
+ if key in {'message', 'exception'}:
+ continue
+ log_lines.append('{}: {!r}'.format(key, context[key]))
+
+ logger.error('\n'.join(log_lines), exc_info=exc_info)
+
+ def call_exception_handler(self, context):
+ """Call the current event loop exception handler.
+
+ context is a dict object containing the following keys
+ (new keys maybe introduced later):
+ - '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.
+
+ Note: this method should not be overloaded in subclassed
+ event loops. For any custom exception handling, use
+ `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's
+ # 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 ready or scheduled."""
+ assert isinstance(handle, events.Handle), 'A Handle is required here'
+ if handle._cancelled:
+ return
+ if isinstance(handle, events.TimerHandle):
+ heapq.heappush(self._scheduled, handle)
+ else:
+ 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 _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.
+ """
+ # Remove delayed calls that were cancelled from head of queue.
+ while self._scheduled and self._scheduled[0]._cancelled:
+ heapq.heappop(self._scheduled)
+
+ timeout = None
+ if self._ready:
+ timeout = 0
+ elif self._scheduled:
+ # Compute the desired timeout.
+ when = self._scheduled[0]._when
+ deadline = max(0, when - self.time())
+ if timeout is None:
+ timeout = deadline
+ else:
+ timeout = min(timeout, deadline)
+
+ # TODO: Instrumentation only in debug mode?
+ if logger.isEnabledFor(logging.INFO):
+ t0 = self.time()
+ event_list = self._selector.select(timeout)
+ t1 = self.time()
+ if t1-t0 >= 1:
+ level = logging.INFO
+ else:
+ level = logging.DEBUG
+ if timeout is not None:
+ logger.log(level, 'poll %.3f took %.3f seconds',
+ timeout, t1-t0)
+ else:
+ logger.log(level, 'poll took %.3f seconds', t1-t0)
+ 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)
+ 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 threadsafe without using locks.
+ ntodo = len(self._ready)
+ for i in range(ntodo):
+ handle = self._ready.popleft()
+ if not handle._cancelled:
+ 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 0000000000..b78f816d4c
--- /dev/null
+++ b/Lib/asyncio/base_subprocess.py
@@ -0,0 +1,159 @@
+import collections
+import subprocess
+
+from . import protocols
+from . import tasks
+from . import transports
+
+
+class BaseSubprocessTransport(transports.SubprocessTransport):
+
+ def __init__(self, loop, protocol, args, shell,
+ stdin, stdout, stderr, bufsize,
+ extra=None, **kwargs):
+ super().__init__(extra)
+ self._protocol = protocol
+ self._loop = loop
+
+ self._pipes = {}
+ if stdin == subprocess.PIPE:
+ self._pipes[0] = None
+ if stdout == subprocess.PIPE:
+ self._pipes[1] = None
+ if stderr == subprocess.PIPE:
+ self._pipes[2] = None
+ self._pending_calls = collections.deque()
+ self._finished = False
+ self._returncode = None
+ self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
+ stderr=stderr, bufsize=bufsize, **kwargs)
+ self._extra['subprocess'] = self._proc
+
+ 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):
+ for proto in self._pipes.values():
+ proto.pipe.close()
+ if self._returncode is None:
+ self.terminate()
+
+ def get_pid(self):
+ return self._proc.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 send_signal(self, signal):
+ self._proc.send_signal(signal)
+
+ def terminate(self):
+ self._proc.terminate()
+
+ def kill(self):
+ self._proc.kill()
+
+ @tasks.coroutine
+ def _post_init(self):
+ 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
+
+ self._loop.call_soon(self._protocol.connection_made, self)
+ for callback, data in self._pending_calls:
+ self._loop.call_soon(callback, *data)
+ self._pending_calls = 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
+ self._returncode = returncode
+ self._call(self._protocol.process_exited)
+ self._try_finish()
+
+ 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._loop.call_soon(self._call_connection_lost, None)
+
+ def _call_connection_lost(self, exc):
+ try:
+ self._protocol.connection_lost(exc)
+ finally:
+ self._proc = None
+ self._protocol = None
+ self._loop = 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 connection_lost(self, exc):
+ self.disconnected = True
+ self.proc._pipe_connection_lost(self.fd, exc)
+
+ 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 0000000000..f9e123281e
--- /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/events.py b/Lib/asyncio/events.py
new file mode 100644
index 0000000000..57af68afb6
--- /dev/null
+++ b/Lib/asyncio/events.py
@@ -0,0 +1,485 @@
+"""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 subprocess
+import threading
+import socket
+
+
+class Handle:
+ """Object returned by callback registration methods."""
+
+ __slots__ = ['_callback', '_args', '_cancelled', '_loop']
+
+ 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
+
+ def __repr__(self):
+ res = 'Handle({}, {})'.format(self._callback, self._args)
+ if self._cancelled:
+ res += '<cancelled>'
+ return res
+
+ def cancel(self):
+ self._cancelled = True
+
+ def _run(self):
+ try:
+ self._callback(*self._args)
+ except Exception as exc:
+ msg = 'Exception in callback {}{!r}'.format(self._callback,
+ self._args)
+ self._loop.call_exception_handler({
+ 'message': msg,
+ 'exception': exc,
+ 'handle': self,
+ })
+ self = None # Needed to break cycles when an exception occurs.
+
+
+class TimerHandle(Handle):
+ """Object returned by timed callback registration methods."""
+
+ __slots__ = ['_when']
+
+ def __init__(self, when, callback, args, loop):
+ assert when is not None
+ super().__init__(callback, args, loop)
+
+ self._when = when
+
+ def __repr__(self):
+ res = 'TimerHandle({}, {}, {})'.format(self._when,
+ self._callback,
+ self._args)
+ if self._cancelled:
+ res += '<cancelled>'
+
+ return res
+
+ 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
+
+
+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 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 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
+
+ # 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.
+
+ protocol_factory should instantiate object with Protocol interface.
+ pipe is file-like object already switched to nonblocking.
+ Return pair (transport, protocol), where transport support
+ 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):
+ """XXX"""
+ raise NotImplementedError
+
+ def set_event_loop(self, loop):
+ """XXX"""
+ raise NotImplementedError
+
+ def new_event_loop(self):
+ """XXX"""
+ raise NotImplementedError
+
+ # Child processes handling (Unix only).
+
+ def get_child_watcher(self):
+ """XXX"""
+ raise NotImplementedError
+
+ def set_child_watcher(self, watcher):
+ """XXX"""
+ 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())
+ assert self._local._loop is not None, \
+ ('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():
+ """XXX"""
+ if _event_loop_policy is None:
+ _init_event_loop_policy()
+ return _event_loop_policy
+
+
+def set_event_loop_policy(policy):
+ """XXX"""
+ global _event_loop_policy
+ assert policy is None or isinstance(policy, AbstractEventLoopPolicy)
+ _event_loop_policy = policy
+
+
+def get_event_loop():
+ """XXX"""
+ return get_event_loop_policy().get_event_loop()
+
+
+def set_event_loop(loop):
+ """XXX"""
+ get_event_loop_policy().set_event_loop(loop)
+
+
+def new_event_loop():
+ """XXX"""
+ return get_event_loop_policy().new_event_loop()
+
+
+def get_child_watcher():
+ """XXX"""
+ return get_event_loop_policy().get_child_watcher()
+
+
+def set_child_watcher(watcher):
+ """XXX"""
+ 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 0000000000..91ea170661
--- /dev/null
+++ b/Lib/asyncio/futures.py
@@ -0,0 +1,371 @@
+"""A Future class similar to the one in PEP 3148."""
+
+__all__ = ['CancelledError', 'TimeoutError',
+ 'InvalidStateError',
+ 'Future', 'wrap_future',
+ ]
+
+import concurrent.futures._base
+import logging
+import sys
+import traceback
+
+from . import events
+
+# States for Future.
+_PENDING = 'PENDING'
+_CANCELLED = 'CANCELLED'
+_FINISHED = 'FINISHED'
+
+_PY34 = sys.version_info >= (3, 4)
+
+# TODO: Do we really want to depend on concurrent.futures internals?
+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."""
+ # TODO: Show the future, its state, the method, and the required 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 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__ = ['exc', 'tb', 'loop']
+
+ def __init__(self, exc, loop):
+ self.loop = loop
+ 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{tb}'
+ context = {
+ 'message': msg.format(tb=''.join(self.tb)),
+ }
+ self.loop.call_exception_handler(context)
+
+
+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
+
+ _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 = []
+
+ def __repr__(self):
+ res = self.__class__.__name__
+ if self._state == _FINISHED:
+ if self._exception is not None:
+ res += '<exception={!r}>'.format(self._exception)
+ else:
+ res += '<result={!r}>'.format(self._result)
+ elif self._callbacks:
+ size = len(self._callbacks)
+ if size > 2:
+ res += '<{}, [{}, <{} more>, {}]>'.format(
+ self._state, self._callbacks[0],
+ size-2, self._callbacks[-1])
+ else:
+ res += '<{}, {}>'.format(self._state, self._callbacks)
+ else:
+ res += '<{}>'.format(self._state)
+ return res
+
+ 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': 'Future/Task exception was never retrieved',
+ 'exception': exc,
+ 'future': self,
+ }
+ 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(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(exception, self._loop)
+ # 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, fut))
+ return new_future
diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py
new file mode 100644
index 0000000000..29c4434a62
--- /dev/null
+++ b/Lib/asyncio/locks.py
@@ -0,0 +1,466 @@
+"""Synchronization primitives."""
+
+__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore']
+
+import collections
+
+from . import events
+from . import futures
+from . import tasks
+
+
+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 manager 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
+
+ @tasks.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
+
+ @tasks.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, *, loop=None):
+ if loop is not None:
+ self._loop = loop
+ else:
+ self._loop = events.get_event_loop()
+
+ # Lock as an attribute as in threading.Condition.
+ lock = Lock(loop=self._loop)
+ 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)
+
+ @tasks.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()
+
+ @tasks.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 manager 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
+
+ @tasks.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 0000000000..23a7074afb
--- /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 0000000000..d99e8ce727
--- /dev/null
+++ b/Lib/asyncio/proactor_events.py
@@ -0,0 +1,455 @@
+"""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
+
+from . import base_events
+from . import constants
+from . import futures
+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)
+ self._set_extra(sock)
+ self._loop = loop
+ 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)
+ self._loop.call_soon(self._protocol.connection_made, self)
+ if waiter is not None:
+ self._loop.call_soon(waiter.set_result, None)
+
+ 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()
+
+ def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+ if not isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+ 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()
+ if self._read_fut:
+ self._read_fut.cancel()
+ self._write_fut = 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()
+ server = self._server
+ if server is not None:
+ server.detach(self)
+ 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._read_fut = None
+ 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
+
+ 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)
+
+ 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')
+ 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:
+ 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))
+ # XXX Should we pause the protocol at this point
+ # if len(data) > self._high_water? (That would
+ # require keeping track of the number of bytes passed
+ # to a send() that hasn't finished yet.)
+ 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):
+ pass
+ if 'peername' not in self._extra:
+ try:
+ self._extra['peername'] = sock.getpeername()
+ except (socket.error, AttributeError):
+ pass
+
+ 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_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._proactor is not None:
+ self._close_self_pipe()
+ self._proactor.close()
+ self._proactor = None
+ self._selector = None
+ super().close()
+ self._accept_futures.clear()
+
+ 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:
+ self.close()
+ raise
+ else:
+ self._self_reading_future = f
+ f.add_done_callback(self._loop_self_reading)
+
+ def _write_to_self(self):
+ self._csock.send(b'x')
+
+ def _start_serving(self, protocol_factory, sock, ssl=None, server=None):
+ if ssl:
+ raise ValueError('IocpEventLoop is incompatible with SSL.')
+
+ def loop(f=None):
+ try:
+ if f is not None:
+ conn, addr = f.result()
+ protocol = protocol_factory()
+ self._make_socket_transport(
+ conn, protocol,
+ extra={'peername': addr}, server=server)
+ f = self._proactor.accept(sock)
+ except OSError as exc:
+ if sock.fileno() != -1:
+ self.call_exception_handler({
+ 'message': 'Accept failed',
+ 'exception': exc,
+ 'socket': sock,
+ })
+ sock.close()
+ 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):
+ pass # XXX hard work currently done in poll
+
+ def _stop_serving(self, sock):
+ for future in self._accept_futures.values():
+ future.cancel()
+ self._proactor._stop_serving(sock)
+ sock.close()
diff --git a/Lib/asyncio/protocols.py b/Lib/asyncio/protocols.py
new file mode 100644
index 0000000000..52fc25c2ee
--- /dev/null
+++ b/Lib/asyncio/protocols.py
@@ -0,0 +1,129 @@
+"""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
+ """
+
+ 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 0000000000..6283db3268
--- /dev/null
+++ b/Lib/asyncio/queues.py
@@ -0,0 +1,288 @@
+"""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.
+
+ If you yield from put(), wait until a free slot is available
+ before adding item.
+ """
+ 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.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.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 you yield from get(), wait until a item is available.
+ """
+ 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, 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.
+ 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 0000000000..367c5fbe3f
--- /dev/null
+++ b/Lib/asyncio/selector_events.py
@@ -0,0 +1,846 @@
+"""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 socket
+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 .log import logger
+
+
+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, *,
+ server_side=False, server_hostname=None,
+ extra=None, server=None):
+ return _SelectorSslTransport(
+ self, rawsock, protocol, sslcontext, waiter,
+ server_side, server_hostname, extra, server)
+
+ def _make_datagram_transport(self, sock, protocol,
+ address=None, extra=None):
+ return _SelectorDatagramTransport(self, sock, protocol, address, extra)
+
+ def close(self):
+ if self._selector is not None:
+ self._close_self_pipe()
+ self._selector.close()
+ self._selector = None
+ super().close()
+
+ 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 _read_from_self(self):
+ try:
+ self._ssock.recv(1)
+ except (BlockingIOError, InterruptedError):
+ pass
+
+ def _write_to_self(self):
+ try:
+ self._csock.send(b'x')
+ except (BlockingIOError, InterruptedError):
+ pass
+
+ 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()
+ 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.
+ # TODO: Someone will want an error handler for this.
+ 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:
+ if sslcontext:
+ self._make_ssl_transport(
+ conn, protocol_factory(), sslcontext, None,
+ server_side=True, extra={'peername': addr}, server=server)
+ else:
+ self._make_socket_transport(
+ conn, protocol_factory(), extra={'peername': addr},
+ server=server)
+ # It's now up to the protocol to handle the connection.
+
+ def add_reader(self, fd, callback, *args):
+ """Add a reader callback."""
+ if self._selector is None:
+ raise RuntimeError('Event loop is 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._selector is None:
+ 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.."""
+ if self._selector is None:
+ raise RuntimeError('Event loop is 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._selector is None:
+ 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):
+ """XXX"""
+ 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):
+ """XXX"""
+ 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):
+ """XXX"""
+ 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, False, sock, address)
+ return fut
+
+ def _sock_connect(self, fut, registered, sock, address):
+ fd = sock.fileno()
+ if registered:
+ self.remove_writer(fd)
+ if fut.cancelled():
+ return
+ try:
+ if not registered:
+ # First time around.
+ sock.connect(address)
+ else:
+ err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
+ if err != 0:
+ # Jump to the except clause below.
+ raise OSError(err, 'Connect call failed %s' % (address,))
+ except (BlockingIOError, InterruptedError):
+ self.add_writer(fd, self._sock_connect, fut, True, sock, address)
+ except Exception as exc:
+ fut.set_exception(exc)
+ else:
+ fut.set_result(None)
+
+ def sock_accept(self, sock):
+ """XXX"""
+ 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.
+
+ def __init__(self, loop, sock, protocol, extra, server=None):
+ super().__init__(extra)
+ 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._loop = loop
+ self._sock = sock
+ self._sock_fd = sock.fileno()
+ self._protocol = protocol
+ 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(self)
+
+ 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)
+
+ def _fatal_error(self, exc, message='Fatal error on transport'):
+ # Should be called from exception handler only.
+ if not isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+ 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:
+ 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)
+ 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.add_reader(self._sock_fd, self._read_ready)
+ self._loop.call_soon(self._protocol.connection_made, self)
+ if waiter is not None:
+ self._loop.call_soon(waiter.set_result, 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)
+
+ 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)
+
+ 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:
+ 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 server_side:
+ if not sslcontext:
+ raise ValueError('Server side ssl needs a valid SSLContext')
+ else:
+ if not sslcontext:
+ # Client side may pass ssl=True to use a default
+ # context; in that case the sslcontext passed is None.
+ # The default is the same as used by urllib with
+ # cadefault=True.
+ if hasattr(ssl, '_create_stdlib_context'):
+ sslcontext = ssl._create_stdlib_context(
+ cert_reqs=ssl.CERT_REQUIRED,
+ check_hostname=bool(server_hostname))
+ else:
+ # Fallback for Python 3.3.
+ sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ sslcontext.options |= ssl.OP_NO_SSLv2
+ sslcontext.set_default_verify_paths()
+ sslcontext.verify_mode = ssl.CERT_REQUIRED
+
+ wrap_kwargs = {
+ 'server_side': server_side,
+ 'do_handshake_on_connect': False,
+ }
+ if server_hostname and not server_side and ssl.HAS_SNI:
+ wrap_kwargs['server_hostname'] = server_hostname
+ sslsock = sslcontext.wrap_socket(rawsock, **wrap_kwargs)
+
+ super().__init__(loop, sslsock, protocol, extra, server)
+
+ self._server_hostname = server_hostname
+ self._waiter = waiter
+ self._rawsock = rawsock
+ self._sslcontext = sslcontext
+ self._paused = False
+
+ # SSL-specific extra info. (peercert is set later)
+ self._extra.update(sslcontext=sslcontext)
+
+ self._on_handshake()
+
+ def _on_handshake(self):
+ try:
+ self._sock.do_handshake()
+ except ssl.SSLWantReadError:
+ self._loop.add_reader(self._sock_fd, self._on_handshake)
+ return
+ except ssl.SSLWantWriteError:
+ self._loop.add_writer(self._sock_fd, self._on_handshake)
+ return
+ except Exception as exc:
+ self._loop.remove_reader(self._sock_fd)
+ self._loop.remove_writer(self._sock_fd)
+ self._sock.close()
+ if self._waiter is not None:
+ self._waiter.set_exception(exc)
+ return
+ except BaseException as exc:
+ self._loop.remove_reader(self._sock_fd)
+ self._loop.remove_writer(self._sock_fd)
+ self._sock.close()
+ if self._waiter is not None:
+ self._waiter.set_exception(exc)
+ 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:
+ self._sock.close()
+ if self._waiter is not None:
+ self._waiter.set_exception(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._loop.call_soon(self._protocol.connection_made, self)
+ if self._waiter is not None:
+ self._loop.call_soon(self._waiter.set_result, None)
+
+ 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)
+
+ def resume_reading(self):
+ if not self._paused:
+ raise ('Not paused')
+ self._paused = False
+ if self._closing:
+ return
+ self._loop.add_reader(self._sock_fd, self._read_ready)
+
+ 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:
+ 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, extra=None):
+ super().__init__(loop, sock, protocol, extra)
+ self._address = address
+ self._loop.add_reader(self._sock_fd, self._read_ready)
+ self._loop.call_soon(self._protocol.connection_made, self)
+
+ 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/streams.py b/Lib/asyncio/streams.py
new file mode 100644
index 0000000000..27d595f174
--- /dev/null
+++ b/Lib/asyncio/streams.py
@@ -0,0 +1,468 @@
+"""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 events
+from . import futures
+from . import protocols
+from . import tasks
+
+
+_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
+
+
+@tasks.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
+
+
+@tasks.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
+
+ @tasks.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
+
+
+ @tasks.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 check for error conditions and then call
+ _make_drain_waiter(), which will return either () or a Future
+ depending on the paused state.
+ """
+
+ def __init__(self, loop=None):
+ self._loop = loop # May be None; we may never need it.
+ self._paused = False
+ self._drain_waiter = None
+
+ def pause_writing(self):
+ assert not self._paused
+ self._paused = True
+
+ def resume_writing(self):
+ assert self._paused
+ self._paused = False
+ 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):
+ # 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)
+
+ def _make_drain_waiter(self):
+ 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
+ return 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 tasks.iscoroutine(res):
+ tasks.Task(res, loop=self._loop)
+
+ 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
+ self._reader = reader
+ self._loop = loop
+
+ @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)
+
+ def drain(self):
+ """This method has an unusual return value.
+
+ The intended use is to write
+
+ w.write(data)
+ yield from w.drain()
+
+ When there's nothing to wait for, drain() returns (), and the
+ yield-from continues immediately. When the transport buffer
+ is full (the protocol is paused), drain() creates and returns
+ a Future and the yield-from will block until that Future is
+ completed, which will happen when the buffer is (partially)
+ drained and the protocol is resumed.
+ """
+ if self._reader is not None and self._reader._exception is not None:
+ raise self._reader._exception
+ if self._transport._conn_lost: # Uses private variable.
+ raise ConnectionResetError('Connection lost')
+ return self._protocol._make_drain_waiter()
+
+
+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:
+ loop = events.get_event_loop()
+ self._loop = loop
+ self._buffer = bytearray()
+ self._eof = False # Whether we're done.
+ self._waiter = None # A future.
+ 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 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
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ if not waiter.cancelled():
+ waiter.set_result(True)
+
+ 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)
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ if not waiter.cancelled():
+ waiter.set_result(False)
+
+ 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 _create_waiter(self, func_name):
+ # 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)
+ return futures.Future(loop=self._loop)
+
+ @tasks.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:
+ self._waiter = self._create_waiter('readline')
+ try:
+ yield from self._waiter
+ finally:
+ self._waiter = None
+
+ self._maybe_resume_transport()
+ return bytes(line)
+
+ @tasks.coroutine
+ def read(self, n=-1):
+ if self._exception is not None:
+ raise self._exception
+
+ if not n:
+ return b''
+
+ if n < 0:
+ while not self._eof:
+ self._waiter = self._create_waiter('read')
+ try:
+ yield from self._waiter
+ finally:
+ self._waiter = None
+ else:
+ if not self._buffer and not self._eof:
+ self._waiter = self._create_waiter('read')
+ try:
+ yield from self._waiter
+ finally:
+ self._waiter = None
+
+ 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
+
+ @tasks.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 0000000000..414e02383e
--- /dev/null
+++ b/Lib/asyncio/subprocess.py
@@ -0,0 +1,195 @@
+__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
+
+
+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.waiter = futures.Future(loop=loop)
+ self._waiters = collections.deque()
+ self._transport = None
+
+ def connection_made(self, transport):
+ self._transport = transport
+ if transport.get_pipe_transport(1):
+ self.stdout = streams.StreamReader(limit=self._limit,
+ loop=self._loop)
+ if transport.get_pipe_transport(2):
+ self.stderr = streams.StreamReader(limit=self._limit,
+ loop=self._loop)
+ stdin = transport.get_pipe_transport(0)
+ if stdin is not None:
+ self.stdin = streams.StreamWriter(stdin,
+ protocol=self,
+ reader=None,
+ loop=self._loop)
+ self.waiter.set_result(None)
+
+ 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):
+ # wake up futures waiting for wait()
+ returncode = self._transport.get_returncode()
+ while self._waiters:
+ waiter = self._waiters.popleft()
+ waiter.set_result(returncode)
+
+
+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()
+
+ @property
+ def returncode(self):
+ return self._transport.get_returncode()
+
+ @tasks.coroutine
+ def wait(self):
+ """Wait until the process exit and return the process return code."""
+ returncode = self._transport.get_returncode()
+ if returncode is not None:
+ return returncode
+
+ waiter = futures.Future(loop=self._loop)
+ self._protocol._waiters.append(waiter)
+ yield from waiter
+ return waiter.result()
+
+ def _check_alive(self):
+ if self._transport.get_returncode() is not None:
+ raise ProcessLookupError()
+
+ def send_signal(self, signal):
+ self._check_alive()
+ self._transport.send_signal(signal)
+
+ def terminate(self):
+ self._check_alive()
+ self._transport.terminate()
+
+ def kill(self):
+ self._check_alive()
+ self._transport.kill()
+
+ @tasks.coroutine
+ def _feed_stdin(self, input):
+ self.stdin.write(input)
+ yield from self.stdin.drain()
+ self.stdin.close()
+
+ @tasks.coroutine
+ def _noop(self):
+ return None
+
+ @tasks.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
+ output = yield from stream.read()
+ transport.close()
+ return output
+
+ @tasks.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)
+
+
+@tasks.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)
+ yield from protocol.waiter
+ return Process(transport, protocol, loop)
+
+@tasks.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)
+ yield from protocol.waiter
+ return Process(transport, protocol, loop)
diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py
new file mode 100644
index 0000000000..0967e7e628
--- /dev/null
+++ b/Lib/asyncio/tasks.py
@@ -0,0 +1,682 @@
+"""Support for tasks, coroutines and the scheduler."""
+
+__all__ = ['coroutine', 'Task',
+ 'iscoroutinefunction', 'iscoroutine',
+ '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 os
+import sys
+import traceback
+import weakref
+
+from . import events
+from . import futures
+from .log import logger
+
+# 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')))
+
+
+class CoroWrapper:
+ # Wrapper for coroutine in _DEBUG mode.
+
+ __slots__ = ['gen', 'func', '__name__', '__doc__']
+
+ def __init__(self, gen, func):
+ assert inspect.isgenerator(gen), gen
+ self.gen = gen
+ self.func = func
+
+ def __iter__(self):
+ return self
+
+ def __next__(self):
+ return next(self.gen)
+
+ 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()
+
+ def __del__(self):
+ frame = self.gen.gi_frame
+ if frame is not None and frame.f_lasti == -1:
+ func = self.func
+ code = func.__code__
+ filename = code.co_filename
+ lineno = code.co_firstlineno
+ logger.error(
+ 'Coroutine %r defined at %s:%s was never yielded from',
+ func.__name__, filename, lineno)
+
+
+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)
+ w.__name__ = coro.__name__
+ w.__doc__ = coro.__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)
+
+
+def iscoroutine(obj):
+ """Return True if obj is a coroutine object."""
+ return isinstance(obj, CoroWrapper) or inspect.isgenerator(obj)
+
+
+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 = {}
+
+ @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 iscoroutine(coro), repr(coro) # Not a coroutine function!
+ super().__init__(loop=loop)
+ 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)
+
+ def __repr__(self):
+ res = super().__repr__()
+ if (self._must_cancel and
+ self._state == futures._PENDING and
+ '<PENDING' in res):
+ res = res.replace('<PENDING', '<CANCELLING', 1)
+ i = res.find('<')
+ if i < 0:
+ i = len(res)
+ res = res[:i] + '(<{}>)'.format(self._coro.__name__) + res[i:]
+ return res
+
+ def get_stack(self, *, limit=None):
+ """Return the list of stack frames for this task's coroutine.
+
+ If the coroutine is active, 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 goes; by default it goes 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):
+ 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.
+
+ 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 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 loop is None:
+ loop = events.get_event_loop()
+
+ fs = {async(f, loop=loop) for f in set(fs)}
+
+ if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED):
+ raise ValueError('Invalid return_when value: {}'.format(return_when))
+ return (yield from _wait(fs, timeout, return_when, loop))
+
+
+def _release_waiter(waiter, value=True, *args):
+ if not waiter.done():
+ waiter.set_result(value)
+
+
+@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().
+
+ Usage:
+
+ result = yield from asyncio.wait_for(fut, 10.0)
+
+ """
+ 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, False)
+ cb = functools.partial(_release_waiter, waiter, True)
+
+ fut = async(fut, loop=loop)
+ fut.add_done_callback(cb)
+
+ try:
+ if (yield from waiter):
+ 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(False)
+
+ 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 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, 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 iscoroutine(coro_or_future):
+ return Task(coro_or_future, loop=loop)
+ 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.)
+ """
+ arg_to_fut = {arg: async(arg, loop=loop) for arg in set(coros_or_futures)}
+ children = [arg_to_fut[arg] for arg in coros_or_futures]
+ n = len(children)
+ if n == 0:
+ outer = futures.Future(loop=loop)
+ outer.set_result([])
+ return outer
+ if loop is None:
+ loop = children[0]._loop
+ for fut in children:
+ if fut._loop is not loop:
+ raise ValueError("futures are tied to different event loops")
+ outer = _GatheringFuture(children, loop=loop)
+ nfinished = 0
+ results = [None] * n
+
+ def _done_callback(i, fut):
+ nonlocal nfinished
+ if outer._state != futures._PENDING:
+ if fut._exception is not None:
+ # Mark exception retrieved.
+ fut.exception()
+ return
+ if fut._state == futures._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 == n:
+ 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():
+ # Mark inner's result as retrieved.
+ inner.cancelled() or 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 0000000000..9c3656ac2b
--- /dev/null
+++ b/Lib/asyncio/test_utils.py
@@ -0,0 +1,374 @@
+"""Utilities shared by tests."""
+
+import collections
+import contextlib
+import io
+import os
+import re
+import socket
+import socketserver
+import sys
+import tempfile
+import threading
+import time
+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
+
+
+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):
+ @tasks.coroutine
+ def once():
+ pass
+ gen = once()
+ t = tasks.Task(gen, loop=loop)
+ 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):
+
+ 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=httpd.serve_forever)
+ 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):
+
+ def server_bind(self):
+ UnixHTTPServer.server_bind(self)
+ self.setup_environ()
+
+ def get_request(self):
+ request, client_addr = super().get_request()
+ # 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):
+ 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))
diff --git a/Lib/asyncio/transports.py b/Lib/asyncio/transports.py
new file mode 100644
index 0000000000..5f674f99d7
--- /dev/null
+++ b/Lib/asyncio/transports.py
@@ -0,0 +1,295 @@
+"""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):
+ super().__init__(extra)
+ 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 _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 0000000000..212554801d
--- /dev/null
+++ b/Lib/asyncio/unix_events.py
@@ -0,0 +1,838 @@
+"""Selector event loop for Unix with signal handling."""
+
+import errno
+import fcntl
+import os
+import signal
+import socket
+import stat
+import subprocess
+import sys
+import threading
+
+
+from . import base_events
+from . import base_subprocess
+from . import constants
+from . import events
+from . import selector_events
+from . import tasks
+from . import transports
+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')
+
+
+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):
+ for sig in list(self._signal_handlers):
+ self.remove_signal_handler(sig)
+ super().close()
+
+ 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.
+ """
+ self._check_signal(sig)
+ 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 as exc:
+ raise RuntimeError(str(exc))
+
+ handle = events.Handle(callback, args, self)
+ self._signal_handlers[sig] = handle
+
+ try:
+ signal.signal(sig, self._handle_signal)
+ # 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 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, arg):
+ """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 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)
+
+ @tasks.coroutine
+ def _make_subprocess_transport(self, protocol, args, shell,
+ stdin, stdout, stderr, bufsize,
+ extra=None, **kwargs):
+ with events.get_child_watcher() as watcher:
+ transp = _UnixSubprocessTransport(self, protocol, args, shell,
+ stdin, stdout, stderr, bufsize,
+ extra=extra, **kwargs)
+ yield from transp._post_init()
+ watcher.add_child_handler(transp.get_pid(),
+ self._child_watcher_callback, transp)
+
+ return transp
+
+ def _child_watcher_callback(self, pid, returncode, transp):
+ self.call_soon_threadsafe(transp._process_exited, returncode)
+
+ @tasks.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
+
+ @tasks.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:
+ 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
+ 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
+
+
+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.add_reader(self._fileno, self._read_ready)
+ self._loop.call_soon(self._protocol.connection_made, self)
+ if waiter is not None:
+ self._loop.call_soon(waiter.set_result, None)
+
+ 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:
+ 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)
+
+ def _fatal_error(self, exc, message='Fatal error on pipe transport'):
+ # should be called by exception handler only
+ if not (isinstance(exc, OSError) and exc.errno == errno.EIO):
+ 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)
+ self._extra['pipe'] = pipe
+ self._loop = loop
+ 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.
+
+ # On AIX, the reader trick 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"):
+ self._loop.add_reader(self._fileno, self._read_ready)
+
+ self._loop.call_soon(self._protocol.connection_made, self)
+ if waiter is not None:
+ self._loop.call_soon(waiter.set_result, None)
+
+ 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._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
+
+ # TODO: Make the relationships between write_eof(), close(),
+ # abort(), _fatal_error() and _close() more straightforward.
+
+ 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 not self._closing:
+ # write_eof is all what we needed to close the write pipe
+ self.write_eof()
+
+ 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 not isinstance(exc, (BrokenPipeError, ConnectionResetError)):
+ 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
+
+
+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()
+ 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(), 'rb', 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)
+
+ try:
+ callback, args = self._callbacks.pop(pid)
+ except KeyError: # pragma: no cover
+ # May happen if .remove_child_handler() is called
+ # after os.waitpid() returns.
+ pass
+ 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
+ continue
+ callback = None
+
+ 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):
+ """XXX"""
+ _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 child watcher
+
+ 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 child watcher"""
+
+ 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 0000000000..19f25882cd
--- /dev/null
+++ b/Lib/asyncio/windows_events.py
@@ -0,0 +1,489 @@
+"""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 .log import logger
+from . import _overlapped
+
+
+__all__ = ['SelectorEventLoop', 'ProactorEventLoop', 'IocpProactor',
+ 'DefaultEventLoopPolicy',
+ ]
+
+
+NULL = 0
+INFINITE = 0xffffffff
+ERROR_CONNECTION_REFUSED = 1225
+ERROR_CONNECTION_ABORTED = 1236
+
+
+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)
+ self.ov = ov
+
+ def cancel(self):
+ try:
+ self.ov.cancel()
+ except OSError:
+ pass
+ return super().cancel()
+
+
+class _WaitHandleFuture(futures.Future):
+ """Subclass of Future which represents a wait handle."""
+
+ def __init__(self, wait_handle, *, loop=None):
+ super().__init__(loop=loop)
+ self._wait_handle = wait_handle
+
+ def cancel(self):
+ super().cancel()
+ try:
+ _overlapped.UnregisterWait(self._wait_handle)
+ except OSError as e:
+ if e.winerror != _overlapped.ERROR_IO_PENDING:
+ raise
+
+
+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()
+ 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._address is None:
+ 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 close(self):
+ # 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()
+
+ @tasks.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
+
+ @tasks.coroutine
+ def start_serving_pipe(self, protocol_factory, address):
+ server = PipeServer(address)
+
+ def loop(f=None):
+ pipe = None
+ try:
+ if f:
+ pipe = f.result()
+ server._free_instances.discard(pipe)
+ 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()
+ except futures.CancelledError:
+ if pipe:
+ pipe.close()
+ else:
+ f.add_done_callback(loop)
+
+ self.call_soon(loop)
+ return [server]
+
+ @tasks.coroutine
+ def _make_subprocess_transport(self, protocol, args, shell,
+ stdin, stdout, stderr, bufsize,
+ extra=None, **kwargs):
+ transp = _WindowsSubprocessTransport(self, protocol, args, shell,
+ stdin, stdout, stderr, bufsize,
+ extra=extra, **kwargs)
+ yield from transp._post_init()
+ 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._stopped_serving = weakref.WeakSet()
+
+ 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 recv(self, conn, nbytes, flags=0):
+ self._register_with_iocp(conn)
+ ov = _overlapped.Overlapped(NULL)
+ if isinstance(conn, socket.socket):
+ ov.WSARecv(conn.fileno(), nbytes, flags)
+ else:
+ ov.ReadFile(conn.fileno(), nbytes)
+
+ 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()
+
+ @tasks.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)
+ ov.ConnectNamedPipe(pipe.fileno())
+
+ def finish_accept_pipe(trans, key, ov):
+ ov.getresult()
+ return pipe
+
+ return self._register(ov, pipe, finish_accept_pipe)
+
+ def connect_pipe(self, address):
+ ov = _overlapped.Overlapped(NULL)
+ ov.WaitNamedPipeAndConnect(address, self._iocp, ov.address)
+
+ def finish_connect_pipe(err, handle, ov):
+ # err, handle were arguments passed to PostQueuedCompletionStatus()
+ # in a function run in a thread pool.
+ if err == _overlapped.ERROR_SEM_TIMEOUT:
+ # Connection did not succeed within time limit.
+ msg = _overlapped.FormatMessage(err)
+ raise ConnectionRefusedError(0, msg, None, err)
+ elif err != 0:
+ msg = _overlapped.FormatMessage(err)
+ raise OSError(0, msg, None, err)
+ else:
+ return windows_utils.PipeHandle(handle)
+
+ return self._register(ov, None, finish_connect_pipe, wait_for_post=True)
+
+ def wait_for_handle(self, handle, timeout=None):
+ 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)
+ wh = _overlapped.RegisterWaitWithQueue(
+ handle, self._iocp, ov.address, ms)
+ f = _WaitHandleFuture(wh, loop=self._loop)
+
+ def finish_wait_for_handle(trans, key, ov):
+ if not f.cancelled():
+ try:
+ _overlapped.UnregisterWait(wh)
+ except OSError as e:
+ if e.winerror != _overlapped.ERROR_IO_PENDING:
+ raise
+ # 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 (_winapi.WaitForSingleObject(handle, 0) ==
+ _winapi.WAIT_OBJECT_0)
+
+ self._cache[ov.address] = (f, ov, None, 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, wait_for_post=False):
+ # 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 ov.pending or wait_for_post:
+ # 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)
+ else:
+ # 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)
+ return f
+
+ 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:
+ return
+ err, transferred, key, address = status
+ try:
+ f, ov, obj, callback = self._cache.pop(address)
+ except KeyError:
+ # 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)
+ ms = 0
+ continue
+ if obj in self._stopped_serving:
+ f.cancel()
+ elif not f.cancelled():
+ 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)
+ ms = 0
+
+ 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, (f, ov, obj, callback) in list(self._cache.items()):
+ if obj is None:
+ # The operation was started with connect_pipe() which
+ # queues a task to Windows' thread pool. This cannot
+ # be cancelled, so just forget it.
+ del self._cache[address]
+ else:
+ try:
+ ov.cancel()
+ except OSError:
+ pass
+
+ 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
+
+
+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 0000000000..2a196cc76b
--- /dev/null
+++ b/Lib/asyncio/windows_utils.py
@@ -0,0 +1,205 @@
+"""
+Various Windows specific bits and pieces
+"""
+
+import sys
+
+if sys.platform != 'win32': # pragma: no cover
+ raise ImportError('win32 only')
+
+import socket
+import itertools
+import msvcrt
+import os
+import subprocess
+import tempfile
+import _winapi
+
+
+__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle']
+
+
+# Constants/globals
+
+
+BUFSIZE = 8192
+PIPE = subprocess.PIPE
+STDOUT = subprocess.STDOUT
+_mmap_counter = itertools.count()
+
+
+# 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("Ony 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)
+ 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)
+ csock.setblocking(False)
+ try:
+ csock.connect((addr, port))
+ except (BlockingIOError, InterruptedError):
+ pass
+ except Exception:
+ lsock.close()
+ csock.close()
+ raise
+ ssock, _ = lsock.accept()
+ csock.setblocking(True)
+ 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
+
+ @property
+ def handle(self):
+ return self._handle
+
+ def fileno(self):
+ return self._handle
+
+ def close(self, *, CloseHandle=_winapi.CloseHandle):
+ if self._handle != -1:
+ CloseHandle(self._handle)
+ self._handle = -1
+
+ __del__ = 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 909d9f605d..75481ddde0 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -112,7 +112,7 @@ def readwrite(obj, flags):
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 @@ class dispatcher:
# 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 @@ class dispatcher:
self.socket.getsockopt(socket.SOL_SOCKET,
socket.SO_REUSEADDR) | 1
)
- except socket.error:
+ except OSError:
pass
# ==================================================
@@ -345,7 +345,7 @@ class dispatcher:
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 @@ class dispatcher:
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 @@ class dispatcher:
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 @@ class dispatcher:
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 @@ class dispatcher:
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 @@ class dispatcher:
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 @@ class dispatcher_with_send(dispatcher):
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):
diff --git a/Lib/base64.py b/Lib/base64.py
index b6e82b69bd..ad154ae0ae 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 @@ __all__ = [
# 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 @@ def _bytes_from_decode_data(s):
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 @@ def b64encode(s, altchars=None):
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,21 +137,10 @@ def urlsafe_b64decode(s):
# 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'
+_b32tab = [bytes([i]) for i in _b32alphabet]
+_b32tab2 = [a + b for a in _b32tab for b in _b32tab]
+_b32rev = {v: k for k, v in enumerate(_b32alphabet)}
def b32encode(s):
"""Encode a byte string using Base32.
@@ -160,31 +148,21 @@ def b32encode(s):
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__)
- 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 +174,6 @@ def b32encode(s):
encoded[-1:] = b'='
return bytes(encoded)
-
def b32decode(s, casefold=False, map01=None):
"""Decode a Base32 encoded byte string.
@@ -217,8 +194,7 @@ def b32decode(s, casefold=False, map01=None):
characters present in the input.
"""
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 +208,36 @@ def b32decode(s, casefold=False, map01=None):
# 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 +249,6 @@ def b16encode(s):
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 +270,193 @@ def b16decode(s, casefold=False):
raise binascii.Error('Non-base16 digit found')
return binascii.unhexlify(s)
+#
+# Ascii85 encoding/decoding
+#
+
+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)
+
+ a85chars2 = _a85chars2
+ a85chars = _a85chars
+ 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)
+
+_A85START = b"<~"
+_A85END = b"~>"
+_a85chars = [bytes([i]) for i in range(33, 118)]
+_a85chars2 = [(a + b) for a in _a85chars for b in _a85chars]
+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.
+ """
+ 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
+
+_b85chars = b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
+ b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~"
+_b85chars = [bytes([i]) for i in _b85chars]
+_b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]
+_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.
+ """
+ return _85encode(b, _b85chars, _b85chars2, pad)
+
+def b85decode(b):
+ """Decode base85-encoded byte array"""
+ b = _bytes_from_decode_data(b)
+ global _b85dec
+ if _b85dec is None:
+ _b85dec = [None] * 256
+ for i, c in enumerate(_b85chars):
+ _b85dec[c[0]] = i
+
+ 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 +489,26 @@ def decode(input, output):
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 +525,7 @@ def encodestring(s):
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 dd1f4287c1..67a08463fa 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 @@ class Bdb:
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 @@ class Bdb:
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 @@ class Bdb:
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 1de8f3ca7d..6f47bfaf6c 100644
--- a/Lib/bz2.py
+++ b/Lib/bz2.py
@@ -9,7 +9,6 @@ __all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor",
__author__ = "Nadeem Vawda <nadeem.vawda@gmail.com>"
-import builtins
import io
import warnings
@@ -28,6 +27,8 @@ _MODE_WRITE = 3
_BUFFER_SIZE = 8192
+_builtin_open = open
+
class BZ2File(io.BufferedIOBase):
@@ -43,16 +44,17 @@ class BZ2File(io.BufferedIOBase):
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 @@ class BZ2File(io.BufferedIOBase):
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 @@ class BZ2File(io.BufferedIOBase):
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 @@ class BZ2File(io.BufferedIOBase):
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 @@ def open(filename, mode="rb", compresslevel=9,
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 c24d45bab4..1184385ae1 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 @@ class Profile(_lsprof.Profiler):
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 0f50d0e705..a91974263d 100755
--- a/Lib/cgi.py
+++ b/Lib/cgi.py
@@ -82,7 +82,7 @@ def initlog(*allargs):
if logfile and not logfp:
try:
logfp = open(logfile, "a")
- except IOError:
+ except OSError:
pass
if not logfp:
log = nolog
@@ -560,6 +560,12 @@ class FieldStorage:
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 @@ class FieldStorage:
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 @@ def print_directory():
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()
diff --git a/Lib/chunk.py b/Lib/chunk.py
index 5863ed0846..dc90a7522e 100644
--- a/Lib/chunk.py
+++ b/Lib/chunk.py
@@ -70,7 +70,7 @@ class Chunk:
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 @@ class Chunk:
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 @@ class Chunk:
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 9020aab701..f8184b6c22 100644
--- a/Lib/code.py
+++ b/Lib/code.py
@@ -216,7 +216,7 @@ class InteractiveConsole(InteractiveInterpreter):
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/collections/__init__.py b/Lib/collections/__init__.py
index d737295dd1..02bdc57c9f 100644
--- a/Lib/collections/__init__.py
+++ b/Lib/collections/__init__.py
@@ -3,16 +3,16 @@ __all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
# 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
@@ -199,13 +199,10 @@ class OrderedDict(dict):
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'
@@ -822,9 +819,14 @@ class ChainMap(MutableMapping):
__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 7939268c99..891600d16b 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 a6c0cf6a46..b93e384406 100644
--- a/Lib/colorsys.py
+++ b/Lib/colorsys.py
@@ -33,17 +33,25 @@ TWO_THIRD = 2.0/3.0
# 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 693eda97b1..07f50aa3a3 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -13,7 +13,7 @@ See module py_compile for details of the actual byte-compilation.
import os
import sys
import errno
-import imp
+import importlib.util
import py_compile
import struct
@@ -38,7 +38,7 @@ def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
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 +91,23 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False,
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 +125,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=False,
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 +210,7 @@ def main():
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 d45a404d37..acd05d0b2a 100644
--- a/Lib/concurrent/futures/_base.py
+++ b/Lib/concurrent/futures/_base.py
@@ -200,8 +200,7 @@ def as_completed(fs, timeout=None):
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 @@ def as_completed(fs, timeout=None):
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 @@ def wait(fs, timeout=None, return_when=ALL_COMPLETED):
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 adf2ab4759..07b5225d1d 100644
--- a/Lib/concurrent/futures/process.py
+++ b/Lib/concurrent/futures/process.py
@@ -40,7 +40,7 @@ Local worker thread:
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 atexit
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 @@ def _queue_management_worker(executor_reference,
"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 @@ def _queue_management_worker(executor_reference,
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 @@ class ProcessPoolExecutor(_base.Executor):
_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 95bb682565..f9beb0f7f7 100644
--- a/Lib/concurrent/futures/thread.py
+++ b/Lib/concurrent/futures/thread.py
@@ -63,6 +63,8 @@ def _worker(executor_reference, work_queue):
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 aebf8a0fb9..4ee8307613 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -670,7 +670,7 @@ class RawConfigParser(MutableMapping):
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 b03f828319..82ee955a8b 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -4,7 +4,8 @@ import sys
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 @@ class _GeneratorContextManager(ContextDecorator):
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 @@ class _GeneratorContextManager(ContextDecorator):
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 @@ class closing(object):
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 66c0f8a64d..67f5bb029e 100644
--- a/Lib/copyreg.py
+++ b/Lib/copyreg.py
@@ -87,6 +87,12 @@ def _reduce_ex(self, proto):
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 c92e130976..e34c646e2d 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -34,17 +34,15 @@ from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
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
@@ -395,7 +393,7 @@ if _os.name in ("nt", "ce"):
_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 @@ if _os.name in ("nt", "ce"):
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 @@ if _os.name in ("nt", "ce"):
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 cc5fe02d1b..7c72210496 100644
--- a/Lib/ctypes/test/__init__.py
+++ b/Lib/ctypes/test/__init__.py
@@ -37,7 +37,7 @@ def requires(resource, msg=None):
def find_package_modules(package, mask):
import fnmatch
- if (hasattr(package, "__loader__") and
+ if (package.__loader__ is not None and
hasattr(package.__loader__, '_files')):
path = package.__name__.replace(".", os.path.sep)
mask = os.path.join(path, mask)
diff --git a/Lib/ctypes/test/test_checkretval.py b/Lib/ctypes/test/test_checkretval.py
index 01ccc57686..19bb8135b3 100644
--- a/Lib/ctypes/test/test_checkretval.py
+++ b/Lib/ctypes/test/test_checkretval.py
@@ -31,7 +31,7 @@ class Test(unittest.TestCase):
pass
else:
def test_oledll(self):
- self.assertRaises(WindowsError,
+ self.assertRaises(OSError,
oledll.oleaut32.CreateTypeLib2,
0, None, None)
diff --git a/Lib/ctypes/test/test_internals.py b/Lib/ctypes/test/test_internals.py
index cbf2e0589a..271e3f57f8 100644
--- a/Lib/ctypes/test/test_internals.py
+++ b/Lib/ctypes/test/test_internals.py
@@ -5,17 +5,14 @@ from sys import getrefcount as grc
# 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_macholib.py b/Lib/ctypes/test/test_macholib.py
index eda846d30a..fd2683764c 100644
--- a/Lib/ctypes/test/test_macholib.py
+++ b/Lib/ctypes/test/test_macholib.py
@@ -3,35 +3,33 @@ import sys
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
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py
index da21336682..91ad3149a7 100644
--- a/Lib/ctypes/test/test_win32.py
+++ b/Lib/ctypes/test/test_win32.py
@@ -41,7 +41,7 @@ if sys.platform == "win32":
# Call functions with invalid arguments, and make sure
# that access violations are trapped and raise an
# exception.
- self.assertRaises(WindowsError, windll.kernel32.GetModuleHandleA, 32)
+ self.assertRaises(OSError, windll.kernel32.GetModuleHandleA, 32)
def test_noargs(self):
# This is a special case on win32 x64
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 054c51158e..0cf20766cc 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -102,9 +102,8 @@ elif os.name == "posix":
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 @@ elif os.name == "posix":
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 @@ elif os.name == "posix":
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 d1f353be10..1789714034 100644
--- a/Lib/datetime.py
+++ b/Lib/datetime.py
@@ -23,9 +23,10 @@ _MAXORDINAL = 3652059 # date.max.toordinal()
# 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.utc = timezone._create(timedelta(0))
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).
-
-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]
+# 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.
-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 a783fde464..5f4664a7c6 100644
--- a/Lib/dbm/__init__.py
+++ b/Lib/dbm/__init__.py
@@ -42,7 +42,7 @@ _names = ['dbm.gnu', 'dbm.ndbm', 'dbm.dumb']
_defaultmod = None
_modules = {}
-error = (error, IOError)
+error = (error, OSError)
try:
from dbm import ndbm
@@ -111,12 +111,10 @@ def whichdb(filename):
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 @@ def whichdb(filename):
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 @@ def whichdb(filename):
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 cfb912371c..ba6a20d0c9 100644
--- a/Lib/dbm/dumb.py
+++ b/Lib/dbm/dumb.py
@@ -29,7 +29,7 @@ __all__ = ["error", "open"]
_BLOCKSIZE = 512
-error = IOError
+error = OSError
class _Database(collections.MutableMapping):
@@ -67,7 +67,7 @@ class _Database(collections.MutableMapping):
# Mod by Jack: create data file if needed
try:
f = _io.open(self._datfile, 'r', encoding="Latin-1")
- except IOError:
+ except OSError:
f = _io.open(self._datfile, 'w', encoding="Latin-1")
self._chmod(self._datfile)
f.close()
@@ -78,7 +78,7 @@ class _Database(collections.MutableMapping):
self._index = {}
try:
f = _io.open(self._dirfile, 'r', encoding="Latin-1")
- except IOError:
+ except OSError:
pass
else:
for line in f:
@@ -100,12 +100,12 @@ class _Database(collections.MutableMapping):
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")
@@ -236,6 +236,12 @@ class _Database(collections.MutableMapping):
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 9f37e4fa48..7bc1c943b5 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -704,8 +704,7 @@ class Decimal(object):
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 +743,6 @@ class Decimal(object):
return result
else:
return cls(result)
- from_float = classmethod(from_float)
def _isnan(self):
"""Returns whether the number is not actually one.
diff --git a/Lib/difflib.py b/Lib/difflib.py
index f0bfcc5070..e8a36219d6 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -334,20 +334,6 @@ class SequenceMatcher:
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].
@@ -920,8 +906,7 @@ class Differ:
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 +925,7 @@ class Differ:
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 +979,7 @@ class Differ:
# 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 +991,7 @@ class Differ:
# 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 +1013,13 @@ class Differ:
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 +1031,7 @@ class Differ:
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 543fdc7ed0..81cbe7f4f9 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 @@ def _try_compile(source, name):
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 @@ def dis(x=None):
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 @@ def distb(tb=None):
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 @@ def pretty_flags(flags):
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 @@ def _format_code_info(co):
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))
- n = len(code)
- i = 0
+ 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
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 @@ def findlabels(code):
"""
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 @@ def findlinestarts(code):
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 2e8719f8b7..4c716e2075 100644
--- a/Lib/distutils/__init__.py
+++ b/Lib/distutils/__init__.py
@@ -13,5 +13,5 @@ used from a setup script as
# Updated automatically by the Python release process.
#
#--start constants--
-__version__ = "3.3.5"
+__version__ = "3.4.0rc1"
#--end constants--
diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py
index fcda08e20a..4470bb0222 100644
--- a/Lib/distutils/archive_util.py
+++ b/Lib/distutils/archive_util.py
@@ -18,15 +18,55 @@ from distutils.spawn import spawn
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 @@ def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0):
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 @@ def check_archive_formats(formats):
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 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
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 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
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 c795c958fe..911e84dd3b 100644
--- a/Lib/distutils/ccompiler.py
+++ b/Lib/distutils/ccompiler.py
@@ -351,7 +351,7 @@ class CCompiler:
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 @@ _default_compilers = (
# 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 @@ compiler_class = { 'unix': ('unixccompiler', 'UnixCCompiler',
"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 3ea08101ac..c89d5efc45 100644
--- a/Lib/distutils/cmd.py
+++ b/Lib/distutils/cmd.py
@@ -365,9 +365,11 @@ class Command:
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 c5188eb371..6814a1c382 100644
--- a/Lib/distutils/command/bdist.py
+++ b/Lib/distutils/command/bdist.py
@@ -37,6 +37,12 @@ class bdist(Command):
"[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 @@ class bdist(Command):
# 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 @@ class bdist(Command):
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 @@ class bdist(Command):
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 1ab09d1616..4405d12c05 100644
--- a/Lib/distutils/command/bdist_dumb.py
+++ b/Lib/distutils/command/bdist_dumb.py
@@ -33,13 +33,18 @@ class bdist_dumb(Command):
('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 @@ class bdist_dumb(Command):
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 @@ class bdist_dumb(Command):
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 @@ class bdist_dumb(Command):
# 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 bc6a23f1b6..80689b6357 100644
--- a/Lib/distutils/command/build_ext.py
+++ b/Lib/distutils/command/build_ext.py
@@ -230,11 +230,6 @@ class build_ext(Command):
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':
@@ -619,9 +614,6 @@ class build_ext(Command):
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 +664,6 @@ class build_ext(Command):
"""
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 +684,7 @@ class build_ext(Command):
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 +704,6 @@ class build_ext(Command):
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 d48eb69900..9100b96a2a 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 @@ class build_py (Command):
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 4b5b22ec20..90a8380a04 100644
--- a/Lib/distutils/command/build_scripts.py
+++ b/Lib/distutils/command/build_scripts.py
@@ -74,7 +74,7 @@ class build_scripts(Command):
# script.
try:
f = open(script, "rb")
- except IOError:
+ except OSError:
if not self.dry_run:
raise
f = None
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 3c675d1182..456511cdfb 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -58,13 +58,6 @@ INSTALL_SCHEMES = {
'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 +79,6 @@ if HAS_USER_SITE:
'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 15c08f1249..215813ba97 100644
--- a/Lib/distutils/command/install_lib.py
+++ b/Lib/distutils/command/install_lib.py
@@ -4,7 +4,7 @@ Implements the Distutils 'install_lib' command
(install all Python modules)."""
import os
-import imp
+import importlib.util
import sys
from distutils.core import Command
@@ -165,10 +165,10 @@ class install_lib(Command):
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 116f67ef9b..7ea3d5fa27 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -74,6 +74,10 @@ class sdist(Command):
('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 @@ class sdist(Command):
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 @@ class sdist(Command):
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 e30c189791..d6762e46fd 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -182,7 +182,7 @@ class upload(PyPIRCCommand):
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
except HTTPError as e:
diff --git a/Lib/distutils/config.py b/Lib/distutils/config.py
index 106e146598..382aca8fc1 100644
--- a/Lib/distutils/config.py
+++ b/Lib/distutils/config.py
@@ -83,6 +83,15 @@ class PyPIRCCommand(Command):
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 25d91baa0f..2bfe66aa2f 100644
--- a/Lib/distutils/core.py
+++ b/Lib/distutils/core.py
@@ -127,8 +127,9 @@ def setup (**attrs):
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 @@ def setup (**attrs):
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 e0074a18f3..d28b1b368a 100644
--- a/Lib/distutils/cygwinccompiler.py
+++ b/Lib/distutils/cygwinccompiler.py
@@ -54,7 +54,8 @@ import re
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 @@ class Mingw32CCompiler(CygwinCCompiler):
else:
entry_point = ''
- if self.gcc_version < '4' or is_cygwingcc():
- no_cygwin = ' -mno-cygwin'
- else:
- no_cygwin = ''
-
- 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))
+ if is_cygwingcc():
+ raise CCompilerError(
+ 'Cygwin gcc cannot be used with --compiler=mingw32')
+
+ 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 @@ def check_config_h():
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 6a72bdd4cd..9879b0dc07 100644
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -124,7 +124,7 @@ def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
"cannot copy tree '%s': not a directory" % src)
try:
names = os.listdir(src)
- except os.error as e:
+ except OSError as e:
(errno, errstr) = e
if dry_run:
names = []
@@ -197,7 +197,7 @@ def remove_tree(directory, verbose=1, dry_run=0):
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 11a210279e..7eb04bc3f5 100644
--- a/Lib/distutils/dist.py
+++ b/Lib/distutils/dist.py
@@ -52,7 +52,9 @@ class Distribution:
('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 @@ Common commands: (see '--help-commands' for more)
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 @@ Common commands: (see '--help-commands' for more)
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 @@ Common commands: (see '--help-commands' for more)
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 3675f8df9c..0000000000
--- 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 eb13c983e9..8b93059e19 100644
--- a/Lib/distutils/errors.py
+++ b/Lib/distutils/errors.py
@@ -35,8 +35,8 @@ class DistutilsArgError (DistutilsError):
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 9bdd14e42e..f6ed290f13 100644
--- a/Lib/distutils/file_util.py
+++ b/Lib/distutils/file_util.py
@@ -27,26 +27,26 @@ def _copy_file_contents(src, dst, buffer_size=16*1024):
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 @@ def _copy_file_contents(src, dst, buffer_size=16*1024):
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:
@@ -193,7 +193,7 @@ def move_file (src, dst,
copy_it = False
try:
os.rename(src, dst)
- except os.error as e:
+ except OSError as e:
(num, msg) = e
if num == errno.EXDEV:
copy_it = True
@@ -205,11 +205,11 @@ def move_file (src, dst,
copy_file(src, dst, verbose=verbose)
try:
os.unlink(src)
- except os.error as e:
+ except OSError as e:
(num, msg) = e
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 b3f6ce10a8..9688f20019 100644
--- a/Lib/distutils/msvc9compiler.py
+++ b/Lib/distutils/msvc9compiler.py
@@ -729,7 +729,7 @@ class MSVCCompiler(CCompiler) :
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 f66ff93dfb..d9cf950a9b 100644
--- a/Lib/distutils/spawn.py
+++ b/Lib/distutils/spawn.py
@@ -82,30 +82,6 @@ def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
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 +183,7 @@ def find_executable(executable, path=None):
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 b9479889f4..75537db8d0 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -114,8 +114,6 @@ def get_python_inc(plat_specific=0, prefix=None):
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 "
@@ -157,11 +155,6 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
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(
"I don't know where Python installs its library "
@@ -442,7 +435,7 @@ def _init_posix():
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 +447,7 @@ def _init_posix():
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
@@ -492,7 +485,6 @@ def _init_nt():
# 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 +494,6 @@ def _init_nt():
_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 +518,11 @@ def get_config_vars(*args):
_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 +573,7 @@ def get_config_var(name):
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 d3fb24ad56..2d72af4aa6 100644
--- a/Lib/distutils/tests/test_archive_util.py
+++ b/Lib/distutils/tests/test_archive_util.py
@@ -16,6 +16,13 @@ from distutils.tests import support
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 @@ class ArchiveUtilTestCase(support.TempdirManager,
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 @@ class ArchiveUtilTestCase(support.TempdirManager,
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 0ad32d421e..c8ccdc2383 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 @@ class BuildDumbTestCase(support.TempdirManager,
# 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 @@ class BuildDumbTestCase(support.TempdirManager,
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_build_py.py b/Lib/distutils/tests/test_build_py.py
index 2ce9d4492d..c8f6b89919 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 @@ class BuildPyTestCase(support.TempdirManager,
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 @@ class BuildPyTestCase(support.TempdirManager,
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 @@ class BuildPyTestCase(support.TempdirManager,
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_dist.py b/Lib/distutils/tests/test_dist.py
index 61ac57d230..b7fd3fbf90 100644
--- a/Lib/distutils/tests/test_dist.py
+++ b/Lib/distutils/tests/test_dist.py
@@ -39,6 +39,7 @@ class TestDistribution(Distribution):
class DistributionTestCase(support.LoggingSilencer,
+ support.TempdirManager,
support.EnvironGuard,
unittest.TestCase):
@@ -213,6 +214,34 @@ class DistributionTestCase(support.LoggingSilencer,
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_install.py b/Lib/distutils/tests/test_install.py
index ede88e5d90..18e1e57505 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 @@ class InstallTestCase(support.TempdirManager,
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 @@ class InstallTestCase(support.TempdirManager,
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 d0dfca00d7..40dd1a95a6 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 @@ class InstallLibTestCase(support.TempdirManager,
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 c952406131..5a04e0ddd0 100644
--- a/Lib/distutils/tests/test_sdist.py
+++ b/Lib/distutils/tests/test_sdist.py
@@ -14,6 +14,12 @@ try:
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 @@ class SDistTestCase(PyPIRCCommandTestCase):
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 a1cb47d87c..95fa9dc111 100644
--- a/Lib/distutils/tests/test_sysconfig.py
+++ b/Lib/distutils/tests/test_sysconfig.py
@@ -1,16 +1,14 @@
"""Tests for distutils.sysconfig."""
import os
import shutil
-import test
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 +30,6 @@ class SysconfigTestCase(support.EnvironGuard,
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 +64,9 @@ class SysconfigTestCase(support.EnvironGuard,
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 +124,13 @@ class SysconfigTestCase(support.EnvironGuard,
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 +149,30 @@ class SysconfigTestCase(support.EnvironGuard,
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_suite():
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py
index 8532369aa5..f53eb266ed 100644
--- a/Lib/distutils/tests/test_upload.py
+++ b/Lib/distutils/tests/test_upload.py
@@ -124,11 +124,12 @@ class uploadTestCase(PyPIRCCommandTestCase):
# 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'))
+ 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)
diff --git a/Lib/distutils/tests/test_util.py b/Lib/distutils/tests/test_util.py
index a1abf8f029..4e9d79b7c6 100644
--- a/Lib/distutils/tests/test_util.py
+++ b/Lib/distutils/tests/test_util.py
@@ -237,7 +237,7 @@ class UtilTestCase(support.EnvironGuard, unittest.TestCase):
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 b558957814..5adcac5a95 100644
--- a/Lib/distutils/util.py
+++ b/Lib/distutils/util.py
@@ -6,7 +6,7 @@ one of the other *util.py modules.
import os
import re
-import imp
+import importlib.util
import sys
import string
from distutils.errors import DistutilsPlatformError
@@ -154,12 +154,6 @@ def change_root (new_root, pathname):
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 @@ byte_compile(files, optimize=%r, force=%r,
# 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 3f0d9d9ca5..d212ad6be1 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -62,6 +62,7 @@ __all__ = [
'REPORT_NDIFF',
'REPORT_ONLY_FIRST_FAILURE',
'REPORTING_FLAGS',
+ 'FAIL_FAST',
# 1. Utility Functions
# 2. Example & DocTest
'Example',
@@ -92,6 +93,7 @@ __all__ = [
]
import __future__
+import argparse
import difflib
import inspect
import linecache
@@ -150,11 +152,13 @@ REPORT_UDIFF = register_optionflag('REPORT_UDIFF')
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 @@ def _load_testfile(filename, package, module_relative, encoding):
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)
@@ -940,6 +944,14 @@ class DocTestFinder:
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 +984,7 @@ class DocTestFinder:
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 +996,8 @@ class DocTestFinder:
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 +1016,7 @@ class DocTestFinder:
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 +1378,9 @@ class DocTestRunner:
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
@@ -2308,6 +2322,12 @@ class SkipDocTestCase(DocTestCase):
__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 +2373,7 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
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 +2387,7 @@ def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
raise ValueError(module, "has no docstrings")
tests.sort()
- suite = unittest.TestSuite()
+ suite = _DocTestSuite()
for test in tests:
if len(test.examples) == 0:
@@ -2477,7 +2497,7 @@ def DocFileSuite(*paths, **kw):
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 +2747,30 @@ __test__ = {"_TestClass": _TestClass,
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 +2780,10 @@ def _test():
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 0369e01547..04ab84c82b 100644
--- a/Lib/email/_header_value_parser.py
+++ b/Lib/email/_header_value_parser.py
@@ -368,8 +368,7 @@ class TokenList(list):
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 @@ RouteComponentMarker = ValueTerminal('@', 'route-component-marker')
# 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(
diff --git a/Lib/email/contentmanager.py b/Lib/email/contentmanager.py
new file mode 100644
index 0000000000..d3636529b6
--- /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 f9657f0a25..0a66acb624 100644
--- a/Lib/email/encoders.py
+++ b/Lib/email/encoders.py
@@ -54,21 +54,12 @@ def encode_7or8bit(msg):
# 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 ea41e9571d..6cf9b91c1f 100644
--- a/Lib/email/feedparser.py
+++ b/Lib/email/feedparser.py
@@ -98,24 +98,15 @@ class BufferedSubFile(object):
"""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 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 parts and 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 +126,7 @@ class BufferedSubFile(object):
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 +134,23 @@ class FeedParser:
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__
diff --git a/Lib/email/iterators.py b/Lib/email/iterators.py
index 3adc4a04ba..b5502ee975 100644
--- a/Lib/email/iterators.py
+++ b/Lib/email/iterators.py
@@ -26,8 +26,7 @@ def walk(self):
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 @@ def body_line_iterator(msg, decode=False):
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 afe350c902..b4bc8cbc9e 100644
--- a/Lib/email/message.py
+++ b/Lib/email/message.py
@@ -8,8 +8,6 @@ __all__ = ['Message']
import re
import uu
-import base64
-import binascii
from io import BytesIO, StringIO
# Intrapackage imports
@@ -132,22 +130,50 @@ class Message:
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 +203,11 @@ class Message:
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.
@@ -668,7 +698,7 @@ class Message:
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 +742,11 @@ class Message:
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 +927,208 @@ class Message:
# I.e. def walk(self): ...
from email.iterators import walk
+
+
+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')
+ if c_d is None:
+ return False
+ return c_d.lower() == 'attachment'
+
+ 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/parser.py b/Lib/email/parser.py
index 752bf35a6e..ed512b114f 100644
--- a/Lib/email/parser.py
+++ b/Lib/email/parser.py
@@ -4,7 +4,8 @@
"""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
@@ -16,7 +17,7 @@ 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
diff --git a/Lib/email/policy.py b/Lib/email/policy.py
index 38e88afe1d..f0b20f4b19 100644
--- a/Lib/email/policy.py
+++ b/Lib/email/policy.py
@@ -5,6 +5,7 @@ code that adds all the email6 features.
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 @@ class EmailPolicy(Policy):
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/utils.py b/Lib/email/utils.py
index f76c21eb1b..95855d81bd 100644
--- a/Lib/email/utils.py
+++ b/Lib/email/utils.py
@@ -54,17 +54,27 @@ TICK = "'"
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 235deb5c30..4cbaadea3e 100644
--- a/Lib/encodings/aliases.py
+++ b/Lib/encodings/aliases.py
@@ -33,9 +33,9 @@ aliases = {
'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 @@ aliases = {
'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 @@ aliases = {
'csibm1026' : 'cp1026',
'ibm1026' : 'cp1026',
+ # cp1125 codec
+ '1125' : 'cp1125',
+ 'ibm1125' : 'cp1125',
+ 'cp866u' : 'cp1125',
+ 'ruscii' : 'cp1125',
+
# cp1140 codec
'1140' : 'cp1140',
'ibm1140' : 'cp1140',
@@ -103,6 +109,11 @@ aliases = {
'1258' : 'cp1258',
'windows_1258' : 'cp1258',
+ # cp273 codec
+ '273' : 'cp273',
+ 'ibm273' : 'cp273',
+ 'csibm273' : 'cp273',
+
# cp424 codec
'424' : 'cp424',
'csibm424' : 'cp424',
@@ -248,8 +259,8 @@ aliases = {
'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 @@ aliases = {
'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 @@ aliases = {
'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 bfe2c1ed17..4edd708f3d 100644
--- a/Lib/encodings/cp037.py
+++ b/Lib/encodings/cp037.py
@@ -301,7 +301,6 @@ decoding_table = (
'\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 0000000000..b1fd69deb0
--- /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 0000000000..69c6d778c5
--- /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 a975be7b8d..5f61535f82 100644
--- a/Lib/encodings/cp500.py
+++ b/Lib/encodings/cp500.py
@@ -301,7 +301,6 @@ decoding_table = (
'\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 d9cc516718..8cfc01fe14 100644
--- a/Lib/encodings/iso8859_1.py
+++ b/Lib/encodings/iso8859_1.py
@@ -301,7 +301,6 @@ decoding_table = (
'\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/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
new file mode 100644
index 0000000000..7cf6a4b826
--- /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 = "2.1"
+
+_PIP_VERSION = "1.5.4"
+
+# 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 0000000000..77527d7a35
--- /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-1.5.4-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/pip-1.5.4-py2.py3-none-any.whl
new file mode 100644
index 0000000000..e07d4767a0
--- /dev/null
+++ b/Lib/ensurepip/_bundled/pip-1.5.4-py2.py3-none-any.whl
Binary files differ
diff --git a/Lib/ensurepip/_bundled/setuptools-2.1-py2.py3-none-any.whl b/Lib/ensurepip/_bundled/setuptools-2.1-py2.py3-none-any.whl
new file mode 100644
index 0000000000..ed77b59e63
--- /dev/null
+++ b/Lib/ensurepip/_bundled/setuptools-2.1-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 0000000000..750365ec4d
--- /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 0000000000..844a95690f
--- /dev/null
+++ b/Lib/enum.py
@@ -0,0 +1,525 @@
+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("%s 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 m in self.__class__.__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 f5cea1de6f..dd5a2af46d 100644
--- a/Lib/filecmp.py
+++ b/Lib/filecmp.py
@@ -6,6 +6,7 @@ Classes:
Functions:
cmp(f1, f2, shallow=True) -> int
cmpfiles(a, b, common) -> ([], [], [])
+ clear_cache()
"""
@@ -13,11 +14,18 @@ import os
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.
@@ -35,7 +43,8 @@ def cmp(f1, f2, shallow=True):
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 @@ def cmp(f1, f2, shallow=True):
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 @@ class dircmp:
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 @@ class dircmp:
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 @@ class dircmp:
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 cmpfiles(a, b, common, shallow=True):
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 879a0fdaab..de2951844a 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -30,7 +30,7 @@ pertaining to the last line read; nextfile() has no effect.
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 @@ class FileInput:
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:
@@ -322,9 +326,11 @@ class FileInput:
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 +352,7 @@ class FileInput:
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 60e60f1160..d8cca52e30 100644
--- a/Lib/formatter.py
+++ b/Lib/formatter.py
@@ -19,6 +19,9 @@ manage and inserting data into the output.
"""
import sys
+import warnings
+warnings.warn('the formatter module is deprecated and will be removed in '
+ 'Python 3.6', PendingDeprecationWarning)
AS_IS = None
diff --git a/Lib/fractions.py b/Lib/fractions.py
index 8be52d2db8..79e83ff2c0 100644
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -182,8 +182,10 @@ class Fraction(numbers.Rational):
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 @@ class Fraction(numbers.Rational):
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 5e75e6d422..2cc470258e 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -39,9 +39,10 @@ python ftplib.py -d localhost -l -p -l
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 @@ class error_proto(Error): pass # response does not begin with [1-5]
# 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 @@ class FTP:
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 @@ class FTP:
'''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 @@ class FTP:
# 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 @@ class FTP:
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 @@ class FTP:
# 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 @@ class FTP:
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 @@ class FTP:
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,8 @@ class FTP:
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")
+ raise OSError(msg)
sock.listen(1)
port = sock.getsockname()[1] # Get proper port
host = self.sock.getsockname()[0] # Get proper host
@@ -392,9 +400,12 @@ class FTP:
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 +416,10 @@ class FTP:
# 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 +445,9 @@ class FTP:
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 +462,8 @@ class FTP:
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 +471,8 @@ class FTP:
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 +480,9 @@ class FTP:
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 +504,14 @@ class FTP:
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 +532,17 @@ class FTP:
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 +677,10 @@ class FTP:
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.
@@ -694,6 +727,10 @@ else:
"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)
@@ -711,12 +748,9 @@ else:
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)
+ server_hostname = self.host if ssl.HAS_SNI else None
+ self.sock = self.context.wrap_socket(self.sock,
+ server_hostname=server_hostname)
self.file = self.sock.makefile(mode='r', encoding=self.encoding)
return resp
@@ -755,80 +789,11 @@ else:
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)
+ server_hostname = self.host if ssl.HAS_SNI else None
+ conn = self.context.wrap_socket(conn,
+ server_hostname=server_hostname)
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 +804,7 @@ else:
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 +901,8 @@ def print_line(line):
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 +912,11 @@ def ftpcp(source, sourcename, target, targetname = '', type = 'I'):
# 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 +934,22 @@ class Netrc:
__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 +1058,7 @@ def test():
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 053e44e3e8..2b77f7866a 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, MethodType
+from weakref import WeakKeyDictionary
try:
from _thread import RLock
except:
@@ -47,7 +55,6 @@ def update_wrapper(wrapper,
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 @@ def update_wrapper(wrapper,
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,91 @@ def wraps(wrapped,
### total_ordering class decorator
################################################################################
+# The correct way to indicate that a comparison operation doesn't
+# recognise the other type is to return NotImplemented and let the
+# interpreter handle raising TypeError if both operands return
+# NotImplemented from their respective comparison methods
+#
+# This makes the implementation of total_ordering more complicated, since
+# we need to be careful not to trigger infinite recursion when two
+# different types that both use this decorator encounter each other.
+#
+# For example, if a type implements __lt__, it's natural to define
+# __gt__ as something like:
+#
+# lambda self, other: not self < other and not self == other
+#
+# However, using the operator syntax like that ends up invoking the full
+# type checking machinery again and means we can end up bouncing back and
+# forth between the two operands until we run out of stack space.
+#
+# The solution is to define helper functions that invoke the appropriate
+# magic methods directly, ensuring we only try each operand once, and
+# return NotImplemented immediately if it is returned from the
+# underlying user provided method. Using this scheme, the __gt__ derived
+# from a user provided __lt__ becomes:
+#
+# lambda self, other: _not_op_and_not_eq(self.__lt__, self, other))
+
+def _not_op(op, other):
+ # "not a < b" handles "a >= b"
+ # "not a <= b" handles "a > b"
+ # "not a >= b" handles "a < b"
+ # "not a > b" handles "a <= b"
+ op_result = op(other)
+ if op_result is NotImplemented:
+ return NotImplemented
+ return not op_result
+
+def _op_or_eq(op, self, other):
+ # "a < b or a == b" handles "a <= b"
+ # "a > b or a == b" handles "a >= b"
+ op_result = op(other)
+ if op_result is NotImplemented:
+ return NotImplemented
+ return op_result or self == other
+
+def _not_op_and_not_eq(op, self, other):
+ # "not (a < b or a == b)" handles "a > b"
+ # "not a < b and a != b" is equivalent
+ # "not (a > b or a == b)" handles "a < b"
+ # "not a > b and a != b" is equivalent
+ op_result = op(other)
+ if op_result is NotImplemented:
+ return NotImplemented
+ return not op_result and self != other
+
+def _not_op_or_eq(op, self, other):
+ # "not a <= b or a == b" handles "a >= b"
+ # "not a >= b or a == b" handles "a <= b"
+ op_result = op(other)
+ if op_result is NotImplemented:
+ return NotImplemented
+ return not op_result or self == other
+
+def _op_and_not_eq(op, self, other):
+ # "a <= b and not a == b" handles "a < b"
+ # "a >= b and not a == b" handles "a > b"
+ op_result = op(other)
+ if op_result is NotImplemented:
+ return NotImplemented
+ return op_result and self != other
+
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__', lambda self, other: _not_op_and_not_eq(self.__lt__, self, other)),
+ ('__le__', lambda self, other: _op_or_eq(self.__lt__, self, other)),
+ ('__ge__', lambda self, other: _not_op(self.__lt__, other))],
+ '__le__': [('__ge__', lambda self, other: _not_op_or_eq(self.__le__, self, other)),
+ ('__lt__', lambda self, other: _op_and_not_eq(self.__le__, self, other)),
+ ('__gt__', lambda self, other: _not_op(self.__le__, other))],
+ '__gt__': [('__lt__', lambda self, other: _not_op_and_not_eq(self.__gt__, self, other)),
+ ('__ge__', lambda self, other: _op_or_eq(self.__gt__, self, other)),
+ ('__le__', lambda self, other: _not_op(self.__gt__, other))],
+ '__ge__': [('__le__', lambda self, other: _not_op_or_eq(self.__ge__, self, other)),
+ ('__gt__', lambda self, other: _op_and_not_eq(self.__ge__, self, other)),
+ ('__lt__', lambda self, other: _not_op(self.__ge__, other))]
}
# 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)]
@@ -140,6 +220,104 @@ except ImportError:
################################################################################
+### 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
################################################################################
@@ -220,7 +398,6 @@ def lru_cache(maxsize=128, typed=False):
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 +506,210 @@ def lru_cache(maxsize=128, typed=False):
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 340c00494d..ca4a5108fd 100644
--- a/Lib/genericpath.py
+++ b/Lib/genericpath.py
@@ -7,7 +7,8 @@ import os
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 @@ def exists(path):
"""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 @@ def isfile(path):
"""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 @@ def isdir(s):
"""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 @@ def commonprefix(m):
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/gettext.py b/Lib/gettext.py
index e43f044cc7..05d9c1e5a3 100644
--- a/Lib/gettext.py
+++ b/Lib/gettext.py
@@ -244,7 +244,7 @@ class GNUTranslations(NullTranslations):
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 @@ class GNUTranslations(NullTranslations):
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 @@ def translation(domain, localedir=None, languages=None,
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 @@ def dgettext(domain, message):
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 @@ def ldgettext(domain, message):
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 @@ def dngettext(domain, msgid1, msgid2, n):
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 @@ def ldngettext(domain, msgid1, msgid2, n):
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 1f602656d0..e388b5f9c0 100644
--- a/Lib/glob.py
+++ b/Lib/glob.py
@@ -32,8 +32,7 @@ def iglob(pathname):
return
dirname, basename = os.path.split(pathname)
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 +61,7 @@ def glob1(dirname, pattern):
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 +79,8 @@ def glob0(dirname, basename):
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 +91,15 @@ def has_magic(s):
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 4ff98205fe..f934d4f1c2 100644
--- a/Lib/gzip.py
+++ b/Lib/gzip.py
@@ -23,9 +23,9 @@ def open(filename, mode="rb", compresslevel=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 @@ def write32u(output, value):
# 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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
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 @@ class GzipFile(io.BufferedIOBase):
# 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 @@ class GzipFile(io.BufferedIOBase):
# 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 @@ class GzipFile(io.BufferedIOBase):
'''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 @@ class GzipFile(io.BufferedIOBase):
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 21454c7d30..e652fc69e4 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_guaranteed = set(__always_supported)
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 @@ except ImportError:
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 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 4297a7171a..77785a2d9b 100644
--- a/Lib/hmac.py
+++ b/Lib/hmac.py
@@ -4,7 +4,8 @@ Implements the HMAC algorithm as described by RFC 2104.
"""
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 @@ class HMAC:
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 @@ class HMAC:
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 @@ class HMAC:
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 02652ef73c..da0a0a3ce7 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 @@ def escape(s, quote=True):
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/parser.py b/Lib/html/parser.py
index 63fe77425b..a650d5eede 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 @@ class HTMLParseError(Exception):
return result
+_default_sentinel = object()
+
class HTMLParser(_markupbase.ParserBase):
"""Find tags and other markup and call handler functions.
@@ -105,26 +112,39 @@ class HTMLParser(_markupbase.ParserBase):
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 @@ class HTMLParser(_markupbase.ParserBase):
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 @@ class HTMLParser(_markupbase.ParserBase):
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 @@ class HTMLParser(_markupbase.ParserBase):
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 @@ class HTMLParser(_markupbase.ParserBase):
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 @@ class HTMLParser(_markupbase.ParserBase):
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 @@ class HTMLParser(_markupbase.ParserBase):
# 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 e05c84dab7..763a903d42 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -271,8 +271,6 @@ def parse_headers(fp, _class=HTTPMessage):
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 +280,7 @@ class HTTPResponse(io.RawIOBase):
# 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 +290,6 @@ class HTTPResponse(io.RawIOBase):
# 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 +726,17 @@ class HTTPConnection:
default_port = HTTP_PORT
auto_open = 1
debuglevel = 0
-
- 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)
+ # 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, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
+ source_address=None):
self.timeout = timeout
self.source_address = source_address
self.sock = None
@@ -804,8 +802,8 @@ class HTTPConnection:
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:
@@ -899,8 +897,11 @@ class HTTPConnection:
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)
@@ -1170,16 +1171,15 @@ else:
# 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_stdlib_context()
will_verify = context.verify_mode != ssl.CERT_NONE
if check_hostname is None:
check_hostname = will_verify
@@ -1204,13 +1204,13 @@ else:
server_hostname = self.host if ssl.HAS_SNI else None
self.sock = self._context.wrap_socket(sock,
server_hostname=server_hostname)
- try:
- if self._check_hostname:
+ if not self._context.check_hostname and self._check_hostname:
+ try:
ssl.match_hostname(self.sock.getpeercert(), self.host)
- except Exception:
- self.sock.shutdown(socket.SHUT_RDWR)
- self.sock.close()
- raise
+ 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 9fcd4c6f46..4dc468bacc 100644
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -1193,8 +1193,7 @@ def deepvalues(mapping):
pass
else:
mapping = True
- for subobj in deepvalues(obj):
- yield subobj
+ yield from deepvalues(obj)
if not mapping:
yield obj
@@ -1731,8 +1730,8 @@ class CookieJar:
return "<%s[%s]>" % (self.__class__, ", ".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 @@ class FileCookieJar(CookieJar):
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 @@ class FileCookieJar(CookieJar):
self._cookies = {}
try:
self.load(filename, ignore_discard, ignore_expires)
- except (LoadError, IOError):
+ except OSError:
self._cookies = old_state
raise
@@ -1857,15 +1853,12 @@ class LWPCookieJar(FileCookieJar):
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 @@ class LWPCookieJar(FileCookieJar):
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 @@ class MozillaCookieJar(FileCookieJar):
continue
self.set_cookie(c)
- except IOError:
+ except OSError:
raise
except Exception:
_warn_unhandled_exception()
@@ -2057,8 +2049,7 @@ class MozillaCookieJar(FileCookieJar):
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 @@ class MozillaCookieJar(FileCookieJar):
"\t".join([cookie.domain, initial_dot, cookie.path,
secure, expires, name, value])+
"\n")
- finally:
- f.close()
diff --git a/Lib/http/server.py b/Lib/http/server.py
index dab1eb65c4..f019bd9fc3 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -401,12 +401,17 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
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 +425,20 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
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
@@ -711,7 +719,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
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,7 +744,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
"""
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())
@@ -1130,7 +1138,7 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
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 +1191,15 @@ class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
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 +1217,16 @@ if __name__ == '__main__':
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/EditorWindow.py b/Lib/idlelib/EditorWindow.py
index 4bf1111482..d18305783a 100644
--- a/Lib/idlelib/EditorWindow.py
+++ b/Lib/idlelib/EditorWindow.py
@@ -1,5 +1,6 @@
import importlib
import importlib.abc
+import importlib.util
import os
from platform import python_version
import re
@@ -549,7 +550,7 @@ class EditorWindow(object):
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 +661,20 @@ class EditorWindow(object):
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",
@@ -872,7 +873,7 @@ class EditorWindow(object):
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:
diff --git a/Lib/idlelib/FileList.py b/Lib/idlelib/FileList.py
index 37a337ed9a..a9989a8624 100644
--- a/Lib/idlelib/FileList.py
+++ b/Lib/idlelib/FileList.py
@@ -103,7 +103,7 @@ class FileList:
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/GrepDialog.py b/Lib/idlelib/GrepDialog.py
index c3590742eb..f73d70a5c5 100644
--- a/Lib/idlelib/GrepDialog.py
+++ b/Lib/idlelib/GrepDialog.py
@@ -125,4 +125,3 @@ if __name__ == "__main__":
# 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)
-
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index f008b46799..3cd7a4c083 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -506,7 +506,7 @@ class IOBinding:
else:
try:
pwd = os.getcwd()
- except os.error:
+ except OSError:
pwd = ""
return pwd, ""
diff --git a/Lib/idlelib/MultiCall.py b/Lib/idlelib/MultiCall.py
index 64729eab8c..25105dc93e 100644
--- a/Lib/idlelib/MultiCall.py
+++ b/Lib/idlelib/MultiCall.py
@@ -57,6 +57,13 @@ _modifier_names = dict([(name, number)
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 = '''\
+can't invoke "bind" command: 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 +105,14 @@ class _SimpleBinder:
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 e.args[0] == APPLICATION_GONE:
+ pass
+ else:
+ 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 +241,13 @@ class _ComplexBinder:
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 e.args[0] == APPLICATION_GONE:
+ break
+ else:
+ raise
# define the list of event types to be handled by MultiEvent. the order is
# compatible with the definition of event type constants.
@@ -390,8 +410,13 @@ def MultiCallCreator(widget):
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 e.args[0] == APPLICATION_GONE:
+ break
+ else:
+ raise
_multicall_dict[widget] = MultiCall
return MultiCall
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 6388d0dc31..953a38dcda 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -1,74 +1,10 @@
-What's New in IDLE 3.3.4?
-=========================
-
-- 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.
-
-- Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial
- shell window is present.
-
-
-What's New in IDLE 3.3.3?
-=========================
-
-- 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.
-
-- Issue #18226: Add docstrings and unittests for FormatParagraph.py.
- Original patches by Todd Rovito and Phil Webster.
-
-- 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 #7136: In the Idle File menu, "New Window" is renamed "New File".
- Patch by Tal Einat, Roget Serwy, and Todd Rovito.
-
-- Remove dead imports of imp.
-
-- Issue #18196: Avoid displaying spurious SystemExit tracebacks.
-
-- Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
-
-- Issue #17511: Keep IDLE find dialog open after clicking "Find Next".
- Original patch by Sarah K.
-
-- Issue #18055: Move IDLE off of imp and on to importlib.
-
-- 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 #14146: Highlight source line while debugging on Windows.
-
-- Issue #17532: Always include Options menu for IDLE on OS X.
- Patch by Guilherme Simões.
-
-
-What's New in IDLE 3.3.2?
+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/PathBrowser.py b/Lib/idlelib/PathBrowser.py
index ba40719084..5e5c6be98d 100644
--- a/Lib/idlelib/PathBrowser.py
+++ b/Lib/idlelib/PathBrowser.py
@@ -44,7 +44,7 @@ class DirBrowserTreeItem(TreeItem):
def GetSubList(self):
try:
names = os.listdir(self.dir or os.curdir)
- except os.error:
+ except OSError:
return []
packages = []
for name in names:
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 2e5ebb233b..e8890d1746 100755
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -419,7 +419,7 @@ class ModifiedInterpreter(InteractiveInterpreter):
try:
self.rpcclt = MyRPCClient(addr)
break
- except socket.error as err:
+ except OSError as err:
pass
else:
self.display_port_binding_error()
@@ -1034,7 +1034,10 @@ class PyShell(OutputWindow):
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 +1401,8 @@ USAGE: idle [-deins] [-t title] [file]*
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:
@@ -1476,6 +1480,8 @@ def main():
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
diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py
index 25bae48047..1f4854ddc4 100644
--- a/Lib/idlelib/TreeWidget.py
+++ b/Lib/idlelib/TreeWidget.py
@@ -381,7 +381,7 @@ class FileTreeItem(TreeItem):
try:
os.rename(self.path, newpath)
self.path = newpath
- except os.error:
+ except OSError:
pass
def GetIconName(self):
@@ -394,7 +394,7 @@ class FileTreeItem(TreeItem):
def GetSubList(self):
try:
names = os.listdir(self.path)
- except os.error:
+ except OSError:
return []
names.sort(key = os.path.normcase)
sublist = []
diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py
index a974d54bce..ea2010edec 100644
--- a/Lib/idlelib/configHandler.py
+++ b/Lib/idlelib/configHandler.py
@@ -271,8 +271,10 @@ class IdleConf:
except OSError:
pass
return default
+
def SetOption(self, configType, section, option, value):
"""In user's config file, set section's option to value.
+
"""
self.userCfg[configType].SetOption(section, option, value)
@@ -638,8 +640,10 @@ class IdleConf:
except OSError:
pass
return keyBindings
+
def GetExtraHelpSourceList(self,configSet):
"""Fetch 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'
diff --git a/Lib/idlelib/help.txt b/Lib/idlelib/help.txt
index ff786c53f3..6378a2e722 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.
-
-File Menu:
-
- 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
+IDLE is the Python IDE built with the tkinter GUI toolkit.
+
+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)
+
+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 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:
-
- 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,
+ ---
+ 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)
+
+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,
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
-
-Format Menu (only in Edit window):
-
- 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
-
-Run Menu (only in Edit window):
-
- 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
-
-Shell Menu (only in Shell window):
-
- View Last Restart -- Scroll the shell window to the last restart
- Restart Shell -- Restart the interpreter with a fresh environment
-
-Debug Menu (only in Shell window):
-
- 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
-
-Options Menu:
-
- Configure IDLE -- Open a configuration dialog. Fonts, indentation,
+ 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 (Editor window only):
+
+ 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 (Editor window only):
+
+ 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 (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 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 (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.
-
- 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.)
-
-Windows Menu:
-
- 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).
+ Startup Preferences may be set, and additional Help
+ sources can be specified.
+
+ ---
+ 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.
+
+Windows 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)
-
-Edit context menu (Right-click / Control-click on OS X in Edit window):
-
- Cut -- Copy a selection into system-wide clipboard,
+ 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.
+
+Editor context menu (Right-click / Control-click on OS X in Edit window):
+
+ Cut -- Copy a selection into system-wide clipboard,
then delete the selection
- Copy -- Copy selection into system-wide clipboard
- Paste -- Insert system-wide clipboard into window
- Set Breakpoint -- Sets a breakpoint (when debugger open)
- Clear Breakpoint -- Clears the breakpoint on that line
+ 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 @@ Shell context menu (Right-click / Control-click on OS X in Shell window):
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.
-
- 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.
-
- 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.
-
- 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.
-
- '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 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.
-
- 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.)
+ 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
+ tab will supply that completion without opening the ACW.
+
+ '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 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__ 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. 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.
-
-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.
+ Enter idle -h at the command prompt to get a usage message.
+
+ idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ...
+
+ -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:
-
- FormatParagraph
- AutoExpand
- ZoomHeight
- ScriptBinding
- CallTips
- ParenMatch
- AutoComplete
- CodeContext
+ 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
diff --git a/Lib/idlelib/idle_test/test_calltips.py b/Lib/idlelib/idle_test/test_calltips.py
index f3637646c4..4ee15aef76 100644
--- a/Lib/idlelib/idle_test/test_calltips.py
+++ b/Lib/idlelib/idle_test/test_calltips.py
@@ -54,9 +54,9 @@ class Get_signatureTest(unittest.TestCase):
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 @@ class Get_signatureTest(unittest.TestCase):
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/idlever.py b/Lib/idlelib/idlever.py
index 044bef929f..8646baabbd 100644
--- a/Lib/idlelib/idlever.py
+++ b/Lib/idlelib/idlever.py
@@ -1 +1 @@
-IDLE_VERSION = "3.3.5"
+IDLE_VERSION = "3.4.0rc1"
diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py
index ddce6e9389..9c51b8f6b5 100644
--- a/Lib/idlelib/rpc.py
+++ b/Lib/idlelib/rpc.py
@@ -199,7 +199,7 @@ class SocketIO(object):
raise
except KeyboardInterrupt:
raise
- except socket.error:
+ except OSError:
raise
except Exception as ex:
return ("CALLEXC", ex)
@@ -340,7 +340,7 @@ class SocketIO(object):
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 @@ class SocketIO(object):
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 @@ class RPCClient(SocketIO):
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 c1859b66b2..13cec62976 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -150,8 +150,8 @@ def manage_socket(address):
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/imaplib.py b/Lib/imaplib.py
index ad5f4e9de8..ad104fe76a 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -185,7 +185,7 @@ class IMAP4:
except Exception:
try:
self.shutdown()
- except socket.error:
+ except OSError:
pass
raise
@@ -281,7 +281,7 @@ class IMAP4:
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 @@ class IMAP4:
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,12 @@ class IMAP4:
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)
+ server_hostname = self.host if ssl.HAS_SNI else None
+ self.sock = ssl_context.wrap_socket(self.sock,
+ server_hostname=server_hostname)
self.file = self.sock.makefile('rb')
self._tls_established = True
self._get_capabilities()
@@ -915,7 +915,7 @@ class IMAP4:
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 +940,7 @@ class IMAP4:
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 +1090,7 @@ class IMAP4:
# 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 +1215,17 @@ if HAVE_SSL:
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)
+ server_hostname = self.host if ssl.HAS_SNI else None
+ return self.ssl_context.wrap_socket(sock,
+ server_hostname=server_hostname)
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 bdd47eea0d..add2ea8898 100644
--- a/Lib/imghdr.py
+++ b/Lib/imghdr.py
@@ -147,7 +147,7 @@ def testall(list, recursive, toplevel):
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 408838387b..c8449c6155 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -16,18 +16,20 @@ except ImportError:
# 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 @@ PY_CODERESOURCE = 8
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 @@ def get_tag():
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 @@ def get_suffixes():
class NullImporter:
- """Null import object."""
+ """**DEPRECATED**
+
+ Null import object.
+
+ """
def __init__(self, path):
if path == '':
@@ -106,48 +156,49 @@ class _HackedGetData:
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 @@ def load_package(name, path):
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 @@ def load_module(name, file, filename, details):
"""
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 @@ def find_module(name, path=None):
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 22c90f24a7..f6adc5cdcf 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 #####################################################
@@ -32,6 +32,10 @@ _r_long = _bootstrap._r_long
# 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 +50,15 @@ def invalidate_caches():
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 +67,20 @@ def find_loader(name, path=None):
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 +94,58 @@ def import_module(name, package=None):
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 e40ec925ce..beaa9b3758 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -9,7 +9,7 @@ work. One should use importlib as the public-facing version of this module.
#
# 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 @@ work. One should use importlib as the public-facing version of this module.
# 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 @@ def _make_relax_case():
return _relax_case
-# TODO: Expose from marshal
def _w_long(x):
- """Convert a 32-bit integer to little-endian.
+ """Convert a 32-bit integer to little-endian."""
+ return (int(x) & 0xFFFFFFFF).to_bytes(4, 'little')
- 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)
-
-# 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 @@ def _wrap(new, old):
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 @@ class _ModuleLock:
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 @@ class _ModuleLock:
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 @@ class _ModuleLock:
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 @@ class _DummyModuleLock:
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 @@ def _call_with_frames_removed(f, *args, **kwds):
# 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.
-
-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).
+# 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).
-"""
-_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__'
@@ -481,6 +503,18 @@ def _get_sourcefile(bytecode_path):
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 @@ def _verbose_message(message, *args, verbosity=1):
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 @@ def _check_name(method):
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 @@ def _requires_builtin(fxn):
"""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 @@ def _requires_frozen(fxn):
"""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,659 @@ def _requires_frozen(fxn):
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()
# Loaders #####################################################################
@@ -634,9 +1231,23 @@ class BuiltinImporter:
"""
+ @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 +1255,23 @@ class BuiltinImporter:
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 +1301,48 @@ class FrozenImporter:
"""
+ @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 +1365,21 @@ class FrozenImporter:
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 +1392,38 @@ class WindowsRegistryFinder:
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 +1439,15 @@ class _LoaderBasics:
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 +1455,10 @@ class SourceLoader(_LoaderBasics):
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 +1469,7 @@ class SourceLoader(_LoaderBasics):
- '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 +1487,26 @@ class SourceLoader(_LoaderBasics):
"""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()",
- 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",
+ except OSError as exc:
+ raise ImportError('source not available through get_data()',
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 +1524,34 @@ class SourceLoader(_LoaderBasics):
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 +1559,6 @@ class SourceLoader(_LoaderBasics):
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 +1571,22 @@ class FileLoader:
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 +1607,12 @@ class SourceFileLoader(FileLoader, SourceLoader):
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 +1648,11 @@ class SourcelessFileLoader(FileLoader, _LoaderBasics):
"""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 +1675,30 @@ class ExtensionFileLoader:
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 +1714,11 @@ class ExtensionFileLoader:
"""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 +1751,12 @@ class _NamespacePath:
# 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 +1767,7 @@ class _NamespacePath:
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 +1776,41 @@ class _NamespacePath:
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.
+
+ 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)
- @module_for_loader
- def load_module(self, module):
- """Load a namespace module."""
+ 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 +1853,7 @@ class PathFinder:
"""
if path == '':
- path = '.'
+ path = _os.getcwd()
try:
finder = sys.path_importer_cache[path]
except KeyError:
@@ -1274,7 +1862,22 @@ class PathFinder:
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 +1887,61 @@ class PathFinder:
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 +1975,28 @@ class FileFinder:
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 +2012,34 @@ class FileFinder:
# 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 +2064,7 @@ class FileFinder:
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 +2079,13 @@ class FileFinder:
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 +2112,51 @@ def _resolve_name(name, package, level):
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:
+ try:
+ find_spec = finder.find_spec
+ except AttributeError:
+ spec = _find_spec_legacy(finder, name, path)
+ if spec is None:
+ continue
+ else:
+ spec = find_spec(name, path, target)
+ if spec is not None:
# The parent import may have already imported this module.
- if name not in sys.modules:
- return loader
+ 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 sys.modules[name].__loader__
+ return spec
else:
return None
@@ -1488,21 +2164,22 @@ def _find_module(name, path):
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 +2190,28 @@ def _find_and_load_unlocked(name, import_):
# 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 +2232,8 @@ def _gcd_import(name, package=None, level=0):
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 +2263,7 @@ def _handle_fromlist(module, fromlist, import_):
# 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 +2331,13 @@ def __import__(name, globals=None, locals=None, fromlist=(), level=0):
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 +2356,31 @@ def _setup(sys_module, _imp_module):
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 +2390,33 @@ def _setup(sys_module, _imp_module):
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 387567a450..558abd3d9a 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -8,11 +8,6 @@ except ImportError as exc:
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 @@ class Finder(metaclass=abc.ABCMeta):
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 @@ class PathEntryFinder(Finder):
"""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 @@ class PathEntryFinder(Finder):
"""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 @@ class Loader(metaclass=abc.ABCMeta):
"""Abstract base class for import loaders."""
- @abc.abstractmethod
+ def create_module(self, spec):
+ """Return a module to initialize and into which to load.
+
+ 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):
- """Abstract method which when implemented should load a module.
- The fullname is a str."""
- raise NotImplementedError
+ """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)
- @abc.abstractmethod
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 @@ class ResourceLoader(Loader):
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 @@ class InspectLoader(Loader):
"""
- @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.
+
+ Raises ImportError if the module cannot be found.
+ """
+ raise ImportError
- @abc.abstractmethod
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.
+
+ 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)
-_register(InspectLoader, machinery.BuiltinImporter, machinery.FrozenImporter,
- machinery.ExtensionFileLoader)
+ 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 @@ class ExecutionLoader(InspectLoader):
@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 @@ class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
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 @@ class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
- '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 @@ class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
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 ff826e4fae..2e1b2d73e7 100644
--- a/Lib/importlib/machinery.py
+++ b/Lib/importlib/machinery.py
@@ -5,6 +5,7 @@ import _imp
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 1316437102..6d73b1d7b6 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 @@ def resolve_name(name, package):
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 680623d9b4..c7a2cf8833 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -31,7 +31,7 @@ Here are some of the useful functions provided by this module:
__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 os
import re
import sys
import tokenize
+import token
import types
import warnings
import functools
@@ -268,21 +269,40 @@ def getmembers(object, predicate=None):
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 @@ def classify_class_attrs(cls):
'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:
+ 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:
+ 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__:
- obj = base.__dict__[name]
- homecls = base
+ dict_obj = base.__dict__[name]
+ if homecls not in metamro:
+ homecls = base
break
- else:
- obj = getattr(cls, name)
- homecls = getattr(obj, "__objclass__", homecls)
-
- # Classify the object.
- if isinstance(obj, staticmethod):
+ 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"
- elif isinstance(obj, classmethod):
+ obj = dict_obj
+ elif isinstance(dict_obj, classmethod):
kind = "class method"
- elif isinstance(obj, property):
+ obj = dict_obj
+ elif isinstance(dict_obj, property):
kind = "property"
- elif ismethoddescriptor(obj):
+ obj = dict_obj
+ elif isroutine(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"
- else:
- kind = "data"
- obj = obj_via_getattr
-
+ kind = "data"
result.append(Attribute(name, kind, homecls, obj))
-
+ processed.add(name)
return result
# ----------------------------------------------------------- class helpers
@@ -361,6 +427,40 @@ def getmro(cls):
"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 @@ def getfile(object):
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 @@ def getmoduleinfo(path):
"""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 @@ def getsourcefile(object):
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,13 +649,13 @@ def findsource(object):
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')
+ raise OSError('source code not available')
file = sourcefile if sourcefile else file
module = getmodule(object, file)
@@ -560,7 +664,7 @@ def findsource(object):
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 +690,7 @@ def findsource(object):
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 +702,14 @@ def findsource(object):
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 +718,7 @@ def getcomments(object):
"""
try:
lines, lnum = findsource(object)
- except (IOError, TypeError):
+ except (OSError, TypeError):
return None
if ismodule(object):
@@ -710,7 +814,7 @@ def getsourcelines(object):
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 +826,7 @@ def getsource(object):
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 +935,7 @@ FullArgSpec = namedtuple('FullArgSpec',
'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 +949,78 @@ def getfullargspec(func):
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')
@@ -1125,7 +1294,7 @@ def getframeinfo(frame, context=1):
start = lineno - 1 - context//2
try:
lines, lnum = findsource(frame)
- except IOError:
+ except OSError:
lines = index = None
else:
start = max(start, 1)
@@ -1317,13 +1486,15 @@ def getgeneratorlocals(generator):
_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 +1506,361 @@ def _get_user_defined_method(cls, method_name):
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.
+
+ new_params = OrderedDict(wrapped_sig.parameters.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
+
+ 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 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 +1868,17 @@ def signature(obj):
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__
@@ -1356,57 +1889,42 @@ def signature(obj):
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(obj, types.FunctionType):
+ 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)
+
+ 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 isinstance(obj, functools.partial):
- sig = signature(obj.func)
-
- new_params = OrderedDict(sig.parameters.items())
+ if _signature_is_builtin(obj):
+ return _signature_from_builtin(Signature, obj,
+ skip_bound_arg=skip_bound_arg)
- 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())
+ if isinstance(obj, functools.partial):
+ 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 +1932,80 @@ def signature(obj):
# 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 +2014,10 @@ def signature(obj):
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 +2056,12 @@ class Parameter:
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`,
@@ -1522,17 +2094,16 @@ class Parameter:
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')
+
+ 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
self._partial_kwarg = _partial_kwarg
@@ -1576,12 +2147,7 @@ class Parameter:
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:
@@ -1603,6 +2169,17 @@ class Parameter:
id(self), self.name)
def __eq__(self, other):
+ # NB: We deliberately do not compare '_partial_kwarg' attributes
+ # here. Imagine we have a following situation:
+ #
+ # def foo(a, b=1): pass
+ # def bar(a, b): pass
+ # bar2 = functools.partial(bar, b=1)
+ #
+ # For the above scenario, signatures for `foo` and `bar2` should
+ # be equal. '_partial_kwarg' attribute is an internal flag, to
+ # distinguish between keyword parameters with defaults and
+ # keyword parameters which got their defaults from functools.partial
return (issubclass(other.__class__, Parameter) and
self._name == other._name and
self._kind == other._kind and
@@ -1720,7 +2297,7 @@ class Signature:
* 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 +2325,41 @@ class Signature:
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 = 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) and
+ not param._partial_kwarg):
+ # If we have a positional-only or positional-or-keyword
+ # parameter, that does not have its default value set
+ # by 'functools.partial' or other "partial" signature:
+ 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 +2372,14 @@ class Signature:
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 +2416,7 @@ class Signature:
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 +2433,9 @@ class Signature:
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 +2443,15 @@ class Signature:
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):
@@ -1955,6 +2561,8 @@ class Signature:
parameters_ex = (param,)
break
else:
+ # No default, not VAR_KEYWORD, not VAR_POSITIONAL,
+ # not in `kwargs`
if partial:
parameters_ex = (param,)
break
@@ -1993,19 +2601,17 @@ class Signature:
# 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 +2626,14 @@ class Signature:
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 +2645,37 @@ class Signature:
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 +2691,11 @@ class Signature:
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 +2703,64 @@ class Signature:
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 bda4def3da..39878b8337 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -4,7 +4,7 @@ builtin open function is defined in this module.
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
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index ecf3f4491c..54df39ae56 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -1030,13 +1030,25 @@ class _BaseNetwork(_IPAddressBase):
"""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 +1288,30 @@ class IPv4Address(_BaseV4, _BaseAddress):
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 +1527,21 @@ class IPv4Network(_BaseV4, _BaseNetwork):
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 +1898,36 @@ class IPv6Address(_BaseV6, _BaseAddress):
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 +2155,18 @@ class IPv6Network(_BaseV6, _BaseNetwork):
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 6d9b30d92e..94f7d8c0fa 100644
--- a/Lib/json/__init__.py
+++ b/Lib/json/__init__.py
@@ -36,8 +36,7 @@ Compact encoding::
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 @@ def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True,
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 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,
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 @@ def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None,
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 80d3420a95..59e5f41f4d 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 @@ __all__ = ['JSONDecoder']
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 @@ def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook,
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 @@ def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
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 @@ def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
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 @@ class JSONDecoder(object):
"""
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 1d8b20c095..05138383bc 100644
--- a/Lib/json/encoder.py
+++ b/Lib/json/encoder.py
@@ -125,14 +125,12 @@ class JSONEncoder(object):
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 @@ class JSONEncoder(object):
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 @@ class JSONEncoder(object):
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
# 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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
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 23eef61b94..86426cde1a 100644
--- a/Lib/json/scanner.py
+++ b/Lib/json/scanner.py
@@ -29,7 +29,7 @@ def py_make_scanner(context):
try:
nextchar = string[idx]
except IndexError:
- raise StopIteration
+ raise StopIteration(idx)
if nextchar == '"':
return parse_string(string, idx + 1, strict)
@@ -60,7 +60,7 @@ def py_make_scanner(context):
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 ecf9c47885..7db4528571 100644
--- a/Lib/json/tool.py
+++ b/Lib/json/tool.py
@@ -31,8 +31,7 @@ def main():
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 dad39cc377..6e1e882a91 100755
--- a/Lib/keyword.py
+++ b/Lib/keyword.py
@@ -60,6 +60,12 @@ def main():
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 @@ def main():
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/btm_utils.py b/Lib/lib2to3/btm_utils.py
index 2276dc9e96..339750edba 100644
--- a/Lib/lib2to3/btm_utils.py
+++ b/Lib/lib2to3/btm_utils.py
@@ -96,8 +96,7 @@ class MinNode(object):
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 @@ def rec_test(sequence, test_func):
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 60d219f577..6e259c54ac 100644
--- a/Lib/lib2to3/fixer_util.py
+++ b/Lib/lib2to3/fixer_util.py
@@ -129,6 +129,29 @@ def FromImport(package_name, name_leafs):
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
diff --git a/Lib/lib2to3/fixes/fix_asserts.py b/Lib/lib2to3/fixes/fix_asserts.py
new file mode 100644
index 0000000000..5bcec885f5
--- /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_intern.py b/Lib/lib2to3/fixes/fix_intern.py
index 6be11cd39d..fb2973c242 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 @@ class FixIntern(fixer_base.BaseFix):
"""
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 0000000000..1855357588
--- /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 f9cc18b5d3..93bae9021a 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -90,11 +90,11 @@ class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool):
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/pgen2/conv.py b/Lib/lib2to3/pgen2/conv.py
index bf49762ae4..ed0cac532e 100644
--- a/Lib/lib2to3/pgen2/conv.py
+++ b/Lib/lib2to3/pgen2/conv.py
@@ -60,7 +60,7 @@ class Converter(grammar.Grammar):
"""
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 @@ class Converter(grammar.Grammar):
"""
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 4c611c6640..3ccc69dcf6 100644
--- a/Lib/lib2to3/pgen2/driver.py
+++ b/Lib/lib2to3/pgen2/driver.py
@@ -123,7 +123,7 @@ def load_grammar(gt="Grammar.txt", gp=None,
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 14c5f70f1d..7f1c5648e2 100644
--- a/Lib/lib2to3/pgen2/grammar.py
+++ b/Lib/lib2to3/pgen2/grammar.py
@@ -86,15 +86,13 @@ class Grammar(object):
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):
diff --git a/Lib/lib2to3/pytree.py b/Lib/lib2to3/pytree.py
index 17cbf0a2f9..c4a1be3500 100644
--- a/Lib/lib2to3/pytree.py
+++ b/Lib/lib2to3/pytree.py
@@ -194,8 +194,7 @@ class Base(object):
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 +273,14 @@ class Node(Base):
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 201e193fe2..8100317871 100644
--- a/Lib/lib2to3/refactor.py
+++ b/Lib/lib2to3/refactor.py
@@ -326,7 +326,7 @@ class RefactoringTool(object):
"""
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 @@ class RefactoringTool(object):
"""
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/pytree_idempotency.py b/Lib/lib2to3/tests/pytree_idempotency.py
index a02bbfe201..731c403120 100755
--- a/Lib/lib2to3/tests/pytree_idempotency.py
+++ b/Lib/lib2to3/tests/pytree_idempotency.py
@@ -53,7 +53,7 @@ def main():
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_fixers.py b/Lib/lib2to3/tests/test_fixers.py
index 2f08f935d9..06b0033b8f 100644
--- a/Lib/lib2to3/tests/test_fixers.py
+++ b/Lib/lib2to3/tests/test_fixers.py
@@ -282,6 +282,65 @@ class Test_apply(FixerTestCase):
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 @@ class Test_exitfunc(FixerTestCase):
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/linecache.py b/Lib/linecache.py
index c3f2c3fdca..02a9eb5253 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -59,7 +59,7 @@ def checkcache(filename=None):
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 @@ def updatecache(filename, module_globals=None):
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 @@ def updatecache(filename, module_globals=None):
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 7cfea618d7..fa24829aff 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -344,14 +344,32 @@ def _replace_encoding(code, encoding):
# 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 @@ def normalize(localename):
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 @@ def normalize(localename):
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 @@ if sys.platform.startswith("win"):
# 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 @@ else:
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 @@ locale_encoding_alias = {
'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 @@ locale_encoding_alias = {
'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
@@ -797,55 +821,33 @@ locale_encoding_alias = {
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',
'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',
'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',
'az': 'az_AZ.ISO8859-9E',
@@ -854,35 +856,20 @@ locale_alias = {
'be': 'be_BY.CP1251',
'be@latin': 'be_BY.UTF-8@latin',
'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',
'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',
'bn_in': 'bn_IN.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',
'bs': 'bs_BA.ISO8859-2',
'bs_ba': 'bs_BA.ISO8859-2',
- 'bs_ba.iso88592': 'bs_BA.ISO8859-2',
'bulgarian': 'bg_BG.CP1251',
'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',
@@ -890,343 +877,131 @@ locale_alias = {
'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_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',
'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',
'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_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',
'dutch': 'nl_NL.ISO8859-1',
'dutch.iso88591': 'nl_BE.ISO8859-1',
'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_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_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_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_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_zw': 'en_ZW.ISO8859-1',
- 'en_zw.iso88591': 'en_ZW.ISO8859-1',
'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_eo': 'eo_EO.ISO8859-3',
- 'eo_eo.iso88593': 'eo_EO.ISO8859-3',
'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_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',
'fa': 'fa_IR.UTF-8',
'fa_ir': 'fa_IR.UTF-8',
'fa_ir.isiri3342': 'fa_IR.ISIRI-3342',
'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',
'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',
'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',
'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',
'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 +1009,17 @@ locale_alias = {
'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',
'hu': 'hu_HU.ISO8859-2',
'hu_hu': 'hu_HU.ISO8859-2',
- 'hu_hu.iso88592': 'hu_HU.ISO8859-2',
'hungarian': 'hu_HU.ISO8859-2',
'icelandic': 'is_IS.ISO8859-1',
- 'icelandic.iso88591': 'is_IS.ISO8859-1',
'id': 'id_ID.ISO8859-1',
'id_id': 'id_ID.ISO8859-1',
'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,46 +1027,23 @@ locale_alias = {
'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',
'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',
@@ -1306,27 +1052,18 @@ locale_alias = {
'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY',
'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',
'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',
'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',
'lithuanian': 'lt_LT.ISO8859-13',
@@ -1337,157 +1074,78 @@ locale_alias = {
'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',
'mai': 'mai_IN.UTF-8',
'mai_in': 'mai_IN.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',
'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',
'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',
'ne_np': 'ne_NP.UTF-8',
'nl': 'nl_NL.ISO8859-1',
- 'nl.iso885915': 'nl_NL.ISO8859-15',
'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',
'or': 'or_IN.UTF-8',
'or_in': 'or_IN.UTF-8',
'pa': 'pa_IN.UTF-8',
'pa_in': 'pa_IN.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',
'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',
'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',
'se_no': 'se_NO.UTF-8',
'serbocroatian': 'sr_RS.UTF-8@latin',
'sh': 'sr_RS.UTF-8@latin',
@@ -1501,37 +1159,26 @@ locale_alias = {
'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',
'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',
'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,29 +1187,15 @@ locale_alias = {
'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@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',
'swedish': 'sv_SE.ISO8859-1',
- 'swedish.iso88591': 'sv_SE.ISO8859-1',
'ta': 'ta_IN.TSCII-0',
'ta_in': 'ta_IN.TSCII-0',
'ta_in.tscii': 'ta_IN.TSCII-0',
@@ -1570,49 +1203,33 @@ locale_alias = {
'te': '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',
'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_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',
'turkish': 'tr_TR.ISO8859-9',
- 'turkish.iso88599': 'tr_TR.ISO8859-9',
'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',
'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 +1241,21 @@ locale_alias = {
'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',
'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',
'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_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 9f436f3680..478c5afdae 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,7 +18,7 @@
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!
"""
@@ -42,6 +42,7 @@ except ImportError: #pragma: no cover
__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"
@@ -67,7 +68,7 @@ else: #pragma: no cover
"""Return the frame object for the caller's stack frame."""
try:
raise Exception
- except:
+ except Exception:
return sys.exc_info()[2].tb_frame.f_back
# _srcfile is only used in conjunction with sys._getframe().
@@ -123,20 +124,22 @@ INFO = 20
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 +156,7 @@ def getLevelName(level):
Otherwise, the string "Level %s" % level is returned.
"""
- return _levelNames.get(level, ("Level %s" % level))
+ return _levelToName.get(level, ("Level %s" % level))
def addLevelName(level, levelName):
"""
@@ -163,8 +166,8 @@ def addLevelName(level, levelName):
"""
_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()
@@ -172,9 +175,9 @@ 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
@@ -882,16 +885,37 @@ class Handler(Filterer):
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 +965,7 @@ class StreamHandler(Handler):
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):
@@ -1836,7 +1858,7 @@ def shutdown(handlerList=_handlerList):
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 +1866,7 @@ def shutdown(handlerList=_handlerList):
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 188061449d..b882a62ab3 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -61,11 +61,14 @@ def fileConfig(fname, defaults=None, disable_existing_loggers=True):
"""
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 +144,7 @@ def _install_handlers(cp, formatters):
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 +191,7 @@ def _install_loggers(cp, handlers, disable_existing):
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 +237,7 @@ def _install_loggers(cp, handlers, disable_existing):
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
@@ -729,6 +732,7 @@ class DictConfigurator(BaseConfigurator):
'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 +751,9 @@ class DictConfigurator(BaseConfigurator):
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 +802,7 @@ def dictConfig(config):
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 +811,15 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
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,25 +847,26 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
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:
+ except OSError as e:
if not isinstance(e.args, tuple):
raise
else:
@@ -865,13 +882,14 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
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 +907,18 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
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 +928,7 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
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 ddec7dd9d0..b2e7d445cf 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -72,9 +72,7 @@ class BaseRotatingHandler(logging.FileHandler):
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 +199,12 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
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 +274,22 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
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 +307,7 @@ class TimedRotatingFileHandler(BaseRotatingHandler):
# 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,11 +456,8 @@ class WatchedFileHandler(logging.FileHandler):
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:
@@ -485,6 +494,10 @@ class SocketHandler(logging.Handler):
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 @@ class SocketHandler(logging.Handler):
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 @@ class SocketHandler(logging.Handler):
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 @@ class SocketHandler(logging.Handler):
#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 @@ class SocketHandler(logging.Handler):
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 @@ class DatagramHandler(SocketHandler):
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 @@ class DatagramHandler(SocketHandler):
"""
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 @@ class SysLogHandler(logging.Handler):
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 @@ class SysLogHandler(logging.Handler):
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 @@ class SysLogHandler(logging.Handler):
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
@@ -871,10 +884,9 @@ class SysLogHandler(logging.Handler):
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.
- """
+
+ # 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')
@@ -885,7 +897,7 @@ class SysLogHandler(logging.Handler):
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 @@ class SysLogHandler(logging.Handler):
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):
@@ -973,9 +983,7 @@ class SMTPHandler(logging.Handler):
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 @@ class NTEventLogHandler(logging.Handler):
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):
@@ -1147,9 +1153,7 @@ class HTTPHandler(logging.Handler):
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 +1333,7 @@ class QueueHandler(logging.Handler):
"""
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 1a89887b39..f1d3958179 100644
--- a/Lib/lzma.py
+++ b/Lib/lzma.py
@@ -54,9 +54,9 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
# 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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
# 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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
# 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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ class LZMAFile(io.BufferedIOBase):
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 @@ def open(filename, mode="rb", *,
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 @@ def compress(data, format=FORMAT_XZ, check=-1, preset=None, filters=None):
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 @@ def decompress(data, format=FORMAT_AUTO, memlimit=None, filters=None):
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 1615d9122a..d34f9e944c 100644
--- a/Lib/macpath.py
+++ b/Lib/macpath.py
@@ -127,7 +127,7 @@ def lexists(path):
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 3b64c2ed0d..dde597c0f4 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -20,9 +20,6 @@ import email.generator
import io
import contextlib
try:
- if sys.platform == 'os2emx':
- # OS/2 EMX fcntl() not adequate
- raise ImportError
import fcntl
except ImportError:
fcntl = None
@@ -339,11 +336,8 @@ class Maildir(Mailbox):
# 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 +369,11 @@ class Maildir(Mailbox):
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 +383,8 @@ class Maildir(Mailbox):
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 +496,12 @@ class Maildir(Mailbox):
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' %
@@ -594,7 +578,7 @@ class _singlefileMailbox(Mailbox):
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 +621,7 @@ class _singlefileMailbox(Mailbox):
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 +699,9 @@ class _singlefileMailbox(Mailbox):
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 +978,7 @@ class MH(Mailbox):
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 +992,7 @@ class MH(Mailbox):
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 +1018,12 @@ class MH(Mailbox):
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 +1031,6 @@ class MH(Mailbox):
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 +1043,12 @@ class MH(Mailbox):
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 +1056,12 @@ class MH(Mailbox):
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:
@@ -2079,7 +2054,7 @@ def _lock_file(f, dotlock=True):
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 +2064,7 @@ def _lock_file(f, dotlock=True):
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 +2077,10 @@ def _lock_file(f, dotlock=True):
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 0c0b19c47c..97e303522c 100644
--- a/Lib/mailcap.py
+++ b/Lib/mailcap.py
@@ -20,7 +20,7 @@ def getcaps():
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 cdebf7a66d..b98c8749f6 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -361,7 +361,7 @@ def init(files=None):
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 264b0f0bfd..cc5b8cc691 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 @@ class ModuleFinder:
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 @@ class ModuleFinder:
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)
diff --git a/Lib/multiprocessing/__init__.py b/Lib/multiprocessing/__init__.py
index 1f3e67c9b8..86df638370 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
-
-#
-# Definitions not depending on native semaphores
-#
-
-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
+globals().update((name, getattr(context._default_context, name))
+ for name in context._default_context.__all__)
+__all__ = context._default_context.__all__
#
-# Definitions depending on native semaphores
+# XXX These should not really be documented or public.
#
-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)
+SUBDEBUG = 5
+SUBWARNING = 25
-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)
-
-#
#
+# Alias for main module -- will be reset by bootstrapping child processes
#
-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 22589d0422..09ec4fc22a 100644
--- a/Lib/multiprocessing/connection.py
+++ b/Lib/multiprocessing/connection.py
@@ -12,8 +12,6 @@ __all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ]
import io
import os
import sys
-import pickle
-import select
import socket
import struct
import errno
@@ -22,9 +20,13 @@ 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
@@ -72,7 +74,7 @@ def arbitrary_address(family):
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)))
@@ -132,22 +134,22 @@ class _ConnectionBase:
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 +204,7 @@ class _ConnectionBase:
"""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):
"""
@@ -249,7 +249,7 @@ class _ConnectionBase:
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 +317,7 @@ if _winapi:
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 +389,7 @@ class Connection(_ConnectionBase):
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 +459,7 @@ class Listener(object):
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 +545,9 @@ else:
_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 +592,7 @@ class SocketListener(object):
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 +640,8 @@ if sys.platform == 'win32':
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 +683,7 @@ if sys.platform == 'win32':
@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 +700,7 @@ if sys.platform == 'win32':
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 +729,7 @@ def deliver_challenge(connection, authkey):
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 +743,7 @@ def answer_challenge(connection, authkey):
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 +886,15 @@ if sys.platform == 'win32':
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 +902,54 @@ else:
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 0000000000..63849f9d16
--- /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 e31fc61572..97f7af737e 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 sys
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
@@ -138,7 +113,7 @@ def shutdown():
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 874ec8e432..694ef96215 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 9793237bef..0000000000
--- 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 .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 0000000000..387517ebdc
--- /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 e63fdb8755..98bfdc8ee1 100644
--- a/Lib/multiprocessing/heap.py
+++ b/Lib/multiprocessing/heap.py
@@ -8,15 +8,17 @@
#
import bisect
+import itertools
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 +32,25 @@ if sys.platform == 'win32':
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 +62,28 @@ else:
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 +118,7 @@ class Heap(object):
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 +244,7 @@ class BufferWrapper(object):
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 96056b04ea..cc87d36612 100644
--- a/Lib/multiprocessing/managers.py
+++ b/Lib/multiprocessing/managers.py
@@ -19,11 +19,16 @@ import threading
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 @@ from time import time as _time
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 @@ class Server(object):
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 @@ class Server(object):
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 @@ class Server(object):
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 @@ class BaseManager(object):
_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 @@ class BaseManager(object):
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 @@ class BaseProxy(object):
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 @@ class BaseProxy(object):
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 @@ class BaseProxy(object):
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 @@ def RebuildProxy(func, token, serializer, kwds):
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 @@ def AutoProxy(token, serializer, manager=None, authkey=None,
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,
@@ -1109,7 +1114,7 @@ SyncManager.register('BoundedSemaphore', threading.BoundedSemaphore,
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 0f2dab48eb..1cb2d95678 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 threading
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, cpu_count, TimeoutError
#
# Constants representing the state of a pool
@@ -43,6 +47,29 @@ def starmapstar(args):
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
#
@@ -78,28 +105,29 @@ def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None):
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:
+ 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 +137,12 @@ class Pool(object):
'''
Class which supports an async version of applying functions to arguments.
'''
- Process = Process
+ 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 +152,7 @@ class Pool(object):
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 +189,7 @@ class Pool(object):
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 +206,7 @@ class Pool(object):
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]
@@ -199,7 +226,7 @@ class Pool(object):
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 +235,8 @@ class Pool(object):
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 +362,7 @@ class Pool(object):
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 +372,7 @@ class Pool(object):
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 +384,27 @@ class Pool(object):
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 +413,17 @@ class Pool(object):
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 +435,12 @@ class Pool(object):
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 +449,7 @@ class Pool(object):
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 +458,10 @@ class Pool(object):
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 +479,19 @@ class Pool(object):
)
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 +502,7 @@ class Pool(object):
@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 +512,12 @@ class Pool(object):
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 +527,31 @@ class Pool(object):
# 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):
@@ -711,7 +737,10 @@ class IMapUnorderedIterator(IMapIterator):
class ThreadPool(Pool):
- 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 0000000000..463cc18aa3
--- /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 .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 0000000000..b115f8123c
--- /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 .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 0000000000..8b5dc42aa1
--- /dev/null
+++ b/Lib/multiprocessing/popen_spawn_posix.py
@@ -0,0 +1,72 @@
+import fcntl
+import io
+import os
+
+from . import context
+from . import popen_fork
+from . import reduction
+from . import spawn
+from . import util
+
+from . import current_process
+
+__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 0000000000..3b53068be4
--- /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 3d32add71a..68959bf9f4 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 @@ def active_children():
Return list of process objects corresponding to live child processes
'''
_cleanup()
- return list(_current_process._children)
+ return list(_children)
#
#
@@ -51,33 +51,29 @@ def active_children():
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 @@ class Process(object):
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 @@ class Process(object):
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 @@ class Process(object):
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 @@ class Process(object):
'''
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 @@ class Process(object):
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 @@ class Process(object):
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 Process(object):
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 @@ class AuthenticationString(bytes):
# 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 37271fb4eb..f650771092 100644
--- a/Lib/multiprocessing/queues.py
+++ b/Lib/multiprocessing/queues.py
@@ -18,11 +18,14 @@ import weakref
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 @@ from multiprocessing.forking import assert_spawning
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 @@ class Queue(object):
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 @@ class Queue(object):
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 @@ class Queue(object):
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 @@ class Queue(object):
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 @@ class Queue(object):
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 @@ class Queue(object):
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 @@ class Queue(object):
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 @@ _sentinel = object()
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 JoinableQueue(Queue):
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 656fa8ff6b..01e6de2f96 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,57 @@
# 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
+from . import util
+__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 +65,44 @@ if not(sys.platform == 'win32' or (hasattr(socket, 'CMSG_LEN') and
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 +115,12 @@ if sys.platform == 'win32':
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 +130,112 @@ if sys.platform == 'win32':
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 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 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:
- s.sendmsg([b'x'], [(socket.SOL_SOCKET, socket.SCM_RIGHTS,
- struct.pack("@i", handle))])
- if ACKNOWLEDGE and conn.recv_bytes() != b'ACK':
- raise RuntimeError('did not receive acknowledgement of fd')
+ sendfds(s, [handle])
def recv_handle(conn):
- size = struct.calcsize("@i")
+ '''Receive 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')
-
- 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)
+ return recvfds(s, 1)[0]
+
+ 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 detach(self):
- conn = resource_sharer.get_connection(self._id)
- try:
- return recv_handle(conn)
- finally:
- conn.close()
+#
+# Try making some callable types picklable
+#
- def reduce_socket(s):
- df = DupFd(s.fileno())
- return rebuild_socket, (df, s.family, s.type, s.proto)
+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 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 _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 rebuild_connection(df, readable, writable):
- from .connection import Connection
- fd = df.detach()
- return Connection(fd, readable, writable)
+
+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)
#
-# Server which shares registered resources with clients
+# Make sockets picklable
#
-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()
+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):
+ fd = df.detach()
+ 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 0000000000..5e46fc65b4
--- /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 0000000000..ddb2b520f5
--- /dev/null
+++ b/Lib/multiprocessing/semaphore_tracker.py
@@ -0,0 +1,145 @@
+#
+# 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 errno
+import os
+import signal
+import sys
+import threading
+import warnings
+import _multiprocessing
+
+from . import spawn
+from . import util
+from . import current_process
+
+__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 a358ed4f12..0c178252d5 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 @@ def RawArray(typecode_or_type, size_or_initializer):
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 @@ def Value(typecode_or_type, *args, lock=True):
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 @@ def Array(typecode_or_type, size_or_initializer, *, lock=True):
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 @@ def synchronized(obj, lock=None):
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_cache = weakref.WeakKeyDictionary()
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 0000000000..c8297f3134
--- /dev/null
+++ b/Lib/multiprocessing/spawn.py
@@ -0,0 +1,279 @@
+#
+# 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):
+ main()
+ 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']
+ 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 0faca78412..9d8e282477 100644
--- a/Lib/multiprocessing/synchronize.py
+++ b/Lib/multiprocessing/synchronize.py
@@ -11,20 +11,24 @@ __all__ = [
'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event'
]
+import os
import threading
import sys
-
+import itertools
+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 +48,46 @@ SEM_VALUE_MAX = _multiprocessing.SemLock.SEM_VALUE_MAX
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):
+ ctx = ctx or get_context()
+ ctx = ctx.get_context()
+ unlink_now = sys.platform == 'win32' or ctx._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 +100,32 @@ class SemLock(object):
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 +143,8 @@ class Semaphore(SemLock):
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 +160,13 @@ class BoundedSemaphore(Semaphore):
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 +185,13 @@ class Lock(SemLock):
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 +211,15 @@ class RLock(SemLock):
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 +333,9 @@ class Condition(object):
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 +384,11 @@ class Event(object):
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 f5862b49a4..e476e85382 100644
--- a/Lib/multiprocessing/util.py
+++ b/Lib/multiprocessing/util.py
@@ -17,13 +17,13 @@ import threading # we want threading to install it's
# 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 +71,6 @@ def get_logger():
_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 +109,14 @@ def log_to_stderr(level=None):
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 +272,8 @@ def is_exiting():
_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 +302,7 @@ def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
# #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 +334,36 @@ class ForkAwareLocal(threading.local):
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 2aa48f32cd..bbb3d23b54 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 @@ class netrc:
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 @@ class netrc:
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 02cc37c1e2..fcb01d319b 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -279,7 +279,7 @@ def _unparse_datetime(dt, legacy=False):
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,9 @@ if _have_ssl:
"""
# 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()
+ server_hostname = hostname if ssl.HAS_SNI else None
+ return context.wrap_socket(sock, server_hostname=server_hostname)
# The classes themselves
@@ -366,7 +365,7 @@ class _NNTPBase:
if is_connected():
try:
self.quit()
- except (socket.error, EOFError):
+ except (OSError, EOFError):
pass
finally:
if is_connected():
@@ -956,7 +955,7 @@ class _NNTPBase:
if auth:
user = auth[0]
password = auth[2]
- except IOError:
+ except OSError:
pass
# Perform NNTP authentication if needed.
if not user:
@@ -1007,7 +1006,7 @@ class _NNTPBase:
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 +1066,7 @@ if _have_ssl:
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)
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 303e5862b3..af3fb8746a 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -17,7 +17,7 @@ __all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"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 @@ altsep = '/'
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 dirname(p):
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 @@ def lexists(path):
"""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 @@ else: # use native Windows method on Windows
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 @@ except (AttributeError, ImportError):
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 511dcec5d6..5a6d44a659 100644
--- a/Lib/nturl2path.py
+++ b/Lib/nturl2path.py
@@ -23,7 +23,7 @@ def url2pathname(url):
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 @@ def pathname2url(p):
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/opcode.py b/Lib/opcode.py
index a639fe322b..0bd1ee679c 100644
--- a/Lib/opcode.py
+++ b/Lib/opcode.py
@@ -8,6 +8,19 @@ __all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"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_XOR', 65)
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('LIST_APPEND', 145)
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 0000000000..b60349fe4c
--- /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 87689cc269..e9880a1e4c 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.
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 @@ elif 'nt' in _names:
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'
@@ -256,10 +232,9 @@ def makedirs(name, mode=0o777, exist_ok=False):
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')
@@ -302,7 +277,7 @@ def removedirs(name):
while head and tail:
try:
rmdir(head)
- except error:
+ except OSError:
break
head, tail = path.split(head)
@@ -329,7 +304,7 @@ def renames(old, new):
if head and tail:
try:
removedirs(head)
- except error:
+ except OSError:
pass
__all__.extend(["makedirs", "removedirs", "renames"])
@@ -365,7 +340,7 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
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.
@@ -399,10 +374,10 @@ def walk(top, topdown=True, onerror=None, followlinks=False):
# 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
@@ -504,7 +479,7 @@ if {open, stat} <= supports_dir_fd and {listdir, stat} <= supports_fd:
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
@@ -599,7 +574,7 @@ def _execvpe(file, args, env=None):
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
@@ -656,7 +631,7 @@ def get_exec_path(env=None):
# 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):
@@ -716,17 +691,19 @@ try:
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):
@@ -766,7 +743,7 @@ def getenv(key, default=None):
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:
@@ -865,7 +842,7 @@ if _exists("fork") and not _exists("spawnv") and _exists("execv"):
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
@@ -908,6 +885,10 @@ If mode == P_WAIT return the process's exit code if it exits normally;
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
@@ -933,7 +914,7 @@ otherwise return -SIG, where SIG is the signal that killed it. """
return spawnve(mode, file, args[:-1], env)
- __all__.extend(["spawnv", "spawnve", "spawnl", "spawnle",])
+ __all__.extend(["spawnl", "spawnle"])
if _exists("spawnvp"):
@@ -961,34 +942,8 @@ otherwise return -SIG, where SIG is the signal that killed it. """
return spawnvpe(mode, file, args[:-1], env)
- __all__.extend(["spawnvp", "spawnvpe", "spawnlp", "spawnlpe",])
-
-import copyreg as _copyreg
-
-def _make_stat_result(tup, dict):
- return stat_result(tup, dict)
+ __all__.extend(["spawnlp", "spawnlpe"])
-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 0ccbf8ae7b..0000000000
--- 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 0000000000..8d08e8b413
--- /dev/null
+++ b/Lib/pathlib.py
@@ -0,0 +1,1288 @@
+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
+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
+try:
+ import nt
+except ImportError:
+ nt = None
+else:
+ if sys.getwindowsversion()[:2] >= (6, 0):
+ from nt import _getfinalpathname
+ else:
+ supports_symlinks = False
+ _getfinalpathname = 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 = (nt is not None)
+
+ 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):
+ # Assuming a str
+ parts.append(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 __ne__(self, other):
+ return not self == other
+
+ 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,))
+ 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?
+ drv, root, parts = self._flavour.parse_parts((suffix,))
+ if drv or root or len(parts) != 1:
+ raise ValueError("Invalid suffix %r" % (suffix))
+ suffix = parts[0]
+ if not suffix.startswith('.'):
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 != ENOENT:
+ 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 80cba9d36c..dd7ceb8927 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -92,21 +92,14 @@ def find_function(funcname, filename):
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 @@ class Pdb(bdb.Bdb, cmd.Cmd):
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 @@ class Pdb(bdb.Bdb, cmd.Cmd):
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 occured 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
@@ -1163,15 +1164,13 @@ class Pdb(bdb.Bdb, cmd.Cmd):
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 @@ class Pdb(bdb.Bdb, cmd.Cmd):
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 @@ class Pdb(bdb.Bdb, cmd.Cmd):
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 @@ class Pdb(bdb.Bdb, cmd.Cmd):
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 @@ if __doc__ is not None:
'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 386ffba7e2..9cd0132a18 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -23,12 +23,13 @@ Misc variables:
"""
-from types import FunctionType, BuiltinFunctionType
+from types import FunctionType, ModuleType
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 @@ __all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",
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,181 @@ _tuplesize2code = [EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3]
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':
+ 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
+ for module_name, module in 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 +348,25 @@ class _Pickler:
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 +375,11 @@ class _Pickler:
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 +390,9 @@ class _Pickler:
"""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 +400,16 @@ class _Pickler:
"""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 +429,35 @@ class _Pickler:
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 +466,20 @@ class _Pickler:
# 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 +493,11 @@ class _Pickler:
# 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 +533,33 @@ class _Pickler:
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 +602,13 @@ class _Pickler:
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 +633,14 @@ class _Pickler:
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 +648,95 @@ class _Pickler:
# 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 +750,23 @@ class _Pickler:
# 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 +786,9 @@ class _Pickler:
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 +799,14 @@ class _Pickler:
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 +827,9 @@ class _Pickler:
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 +843,109 @@ class _Pickler:
save(v)
write(SETITEM)
# else tmp is empty, and we're done
+ if n < self._BATCHSIZE:
+ return
+
+ 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
- def save_global(self, obj, name=None, pack=struct.pack):
+ 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 +964,8 @@ class _Pickler:
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 +975,14 @@ class _Unpickler:
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 +991,17 @@ class _Unpickler:
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 +1015,20 @@ class _Unpickler:
"""
# 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 +1058,19 @@ class _Unpickler:
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 +1100,40 @@ class _Unpickler:
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 +1142,43 @@ class _Unpickler:
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 _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:
+ return value.decode(self.encoding, self.errors)
+
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
+ 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 ValueError("insecure string pickle: %r" % orig)
- self.append(codecs.escape_decode(rep)[0]
- .decode(self.encoding, self.errors))
+ 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 +1186,38 @@ class _Unpickler:
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 +1247,15 @@ class _Unpickler:
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 +1263,9 @@ class _Unpickler:
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 +1304,19 @@ class _Unpickler:
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 +1324,26 @@ class _Unpickler:
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 +1357,7 @@ class _Unpickler:
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 +1371,8 @@ class _Unpickler:
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 +1410,7 @@ class _Unpickler:
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 +1429,18 @@ class _Unpickler:
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 +1480,26 @@ class _Unpickler:
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 +1527,46 @@ class _Unpickler:
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 612fa8f27e..71c2aa1c79 100644
--- a/Lib/pickletools.py
+++ b/Lib/pickletools.py
@@ -11,6 +11,7 @@ dis(pickle, out=None, memo=None, indentlevel=4)
'''
import codecs
+import io
import pickle
import re
import sys
@@ -34,119 +35,118 @@ bytes_types = pickle.bytes_types
# 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.
-
-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.
-"""
+# "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.
+
# Meta-rule: Descriptions are stored in instances of descriptor objects,
# with plain constructors. No meta-language is defined from which
@@ -169,6 +169,7 @@ UP_TO_NEWLINE = -1
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 @@ class ArgumentDescriptor(object):
'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 @@ class ArgumentDescriptor(object):
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 @@ uint4 = ArgumentDescriptor(
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 @@ stringnl_noescape_pair = ArgumentDescriptor(
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 @@ string4 = ArgumentDescriptor(
""")
-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 @@ def read_bytes4(f):
"""
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 @@ bytes4 = ArgumentDescriptor(
""")
+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 @@ unicodestringnl = ArgumentDescriptor(
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 @@ def read_unicodestring4(f):
"""
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 @@ unicodestring4 = ArgumentDescriptor(
""")
+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 @@ class StackObject(object):
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.
-
- 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.
- """)
+ 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.
+""")
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 @@ opcodes = [
code='L',
arg=decimalnl_long,
stack_before=[],
- stack_after=[pylong],
+ stack_after=[pyint],
proto=0,
doc="""Push a long integer.
@@ -1050,7 +1224,7 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ opcodes = [
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 @@ del assure_pickle_consistency
##############################################################################
# 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,48 @@ def genops(pickle):
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
+ not_a_put = object()
+ gets = { not_a_put } # set of args used by a GET opcode
+ opcodes = [] # (startpos, stoppos, putid)
+ proto = 0
+ for opcode, arg, pos, end_pos in _genops(p, yield_end_pos=True):
if 'PUT' in opcode.name:
- prevarg, prevpos = arg, pos
- elif 'GET' in opcode.name:
- gets.add(arg)
-
- # 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)
+ opcodes.append((pos, end_pos, arg))
+ elif 'FRAME' in opcode.name:
+ pass
+ else:
+ if 'GET' in opcode.name:
+ gets.add(arg)
+ elif opcode.name == 'PROTO':
+ assert pos == 0, pos
+ proto = arg
+ opcodes.append((pos, end_pos, not_a_put))
+ prevpos, prevarg = pos, None
+
+ # Copy the opcodes except for PUTS without a corresponding GET
+ out = io.BytesIO()
+ opcodes = iter(opcodes)
+ if proto >= 2:
+ # Write the PROTO header before any framing
+ start, stop, _ = next(opcodes)
+ out.write(p[start:stop])
+ buf = pickle._Framer(out.write)
+ if proto >= 4:
+ buf.start_framing()
+ for start, stop, putid in opcodes:
+ if putid in gets:
+ buf.commit_frame()
+ buf.write(p[start:stop])
+ if proto >= 4:
+ buf.end_framing()
+ return out.getvalue()
##############################################################################
# A symbolic pickle disassembler.
@@ -2082,17 +2416,20 @@ def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
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 20e6498942..58cccdc974 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 @@ __all__ = [
'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 @@ def walk_packages(path=None, prefix='', onerror=None):
# 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 @@ def iter_modules(path=None, prefix=''):
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 @@ def _iter_file_finder_modules(importer, prefix=''):
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 @@ class ImpImporter:
"""
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 @@ class ImpLoader:
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 @@ class ImpLoader:
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 @@ def iter_importers(fullname=""):
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
@@ -485,29 +470,22 @@ def get_loader(module_or_name):
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
def extend_path(path, name):
@@ -569,13 +547,14 @@ def extend_path(path, name):
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 +568,20 @@ def extend_path(path, name):
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 +604,15 @@ def get_data(package, resource):
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 753ae24883..0000000000
--- 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 dac594ad7f..0000000000
--- 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 01e6b54c8d..0000000000
--- 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 ee63ef8ae2..0000000000
--- 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 2cb077f5ab..0000000000
--- 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 100644
index 3ecd2a8605..0000000000
--- 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 030ef2a3a4..11b501e7d7 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -122,7 +122,7 @@ try:
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 @@ _libc_search = re.compile(b'(__libc_init)'
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 @@ def libc_ver(executable=sys.executable,lib='',version='',
# 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 @@ def libc_ver(executable=sys.executable,lib='',version='',
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 @@ def libc_ver(executable=sys.executable,lib='',version='',
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 @@ def _dist_try_harder(distname,version,id):
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 @@ def _dist_try_harder(distname,version,id):
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 @@ def _dist_try_harder(distname,version,id):
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 @@ def _dist_try_harder(distname,version,id):
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 @@ def linux_distribution(distname='', version='', id='',
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 @@ def linux_distribution(distname='', version='', id='',
# To maintain backwards compatibility:
-def dist(distname='',version='',id='',
+def dist(distname='', version='', id='',
supported_dists=_supported_dists):
@@ -360,7 +360,7 @@ def dist(distname='',version='',id='',
/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 @@ def _norm_version(version, build=''):
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 @@ _ver_output = re.compile(r'(?:([\w ]+) ([\w.]+) '
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 @@ def _syscmd_ver(system='', release='', version='',
# 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 @@ def _win32_getvalue(key,name,default=''):
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).
@@ -517,7 +514,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
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 +532,8 @@ def win32_ver(release='',version='',csd='',ptype=''):
# 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 +583,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
# 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 +608,8 @@ def win32_ver(release='',version='',csd='',ptype=''):
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 +617,7 @@ def win32_ver(release='',version='',csd='',ptype=''):
# 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 +627,17 @@ def win32_ver(release='',version='',csd='',ptype=''):
# 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 +649,19 @@ def _mac_ver_xml():
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 +677,10 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
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 +691,13 @@ def _java_getprop(name,default):
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 +707,7 @@ def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')):
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 +726,9 @@ def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')):
### 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 +738,13 @@ def system_alias(system,release,version):
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 +772,11 @@ def system_alias(system,release,version):
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 +789,21 @@ def _platform(*args):
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 +823,7 @@ def _node(default=''):
return default
try:
return socket.gethostname()
- except socket.error:
+ except OSError:
# Still not working...
return default
@@ -899,19 +835,19 @@ def _follow_symlinks(filepath):
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 +856,7 @@ def _syscmd_uname(option,default=''):
else:
return output
-def _syscmd_file(target,default=''):
+def _syscmd_file(target, default=''):
""" Interface to the system's file command.
@@ -929,7 +865,7 @@ def _syscmd_file(target,default=''):
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 +873,7 @@ def _syscmd_file(target,default=''):
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 +887,17 @@ def _syscmd_file(target,default=''):
# 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 +935,16 @@ def architecture(executable=sys.executable,bits='',linkage=''):
# "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 +972,7 @@ def architecture(executable=sys.executable,bits='',linkage=''):
# XXX the A.OUT format also falls under this class...
pass
- return bits,linkage
+ return bits, linkage
### Portable uname() interface
@@ -1048,7 +984,7 @@ _uname_cache = None
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 +1003,7 @@ def uname():
# 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 +1021,7 @@ def uname():
# 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 +1040,7 @@ def uname():
# 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 +1058,7 @@ def uname():
# 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 +1067,7 @@ def uname():
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 +1085,14 @@ def uname():
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 +1113,8 @@ def uname():
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 +1411,58 @@ def platform(aliased=0, terse=0):
# 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 +1473,5 @@ if __name__ == '__main__':
# 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 2b0b634100..dcb0f9ce96 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -4,25 +4,20 @@ The property list (.plist) file format is a simple XML pickle supporting
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 @@ Generate Plist example:
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
-
-
-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")
+PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)
+globals().update(PlistFormat.__members__)
- 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 @@ class _InternalDict(dict):
# 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 @@ class _InternalDict(dict):
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
+
+ else:
+ yield pathOrFile
+
- """This class has been deprecated. Use readPlist() and writePlist()
+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 @@ class Data:
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 @@ class Data:
def __repr__(self):
return "%s(%s)" % (self.__class__.__name__, repr(self.data))
-class PlistParser:
+#
+#
+# End of deprecated functionality
+#
+#
+
+
+#
+# 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 __init__(self):
+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 @@ class PlistParser:
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,661 @@ class PlistParser:
# 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)
+ offset_format = '>' + _BINARY_FORMAT[offset_size] * num_objects
+ self._ref_format = _BINARY_FORMAT[self._ref_size]
+ self._object_offsets = struct.unpack(
+ offset_format, self._fp.read(offset_size * num_objects))
+ 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_refs(self, n):
+ return struct.unpack(
+ '>' + self._ref_format * n, self._fp.read(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'](
+ use_builtin_types=use_builtin_types,
+ dict_type=dict_type,
+ )
+ break
+
+ else:
+ raise InvalidFileException()
+
+ else:
+ p = _FORMATS[fmt]['parser'](use_builtin_types=use_builtin_types)
+
+ 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 43f8305c48..23a3517e98 100644
--- a/Lib/poplib.py
+++ b/Lib/poplib.py
@@ -13,7 +13,15 @@ Based on the J. Myers POP3 draft, Jan. 96
# 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"]
@@ -61,6 +69,8 @@ class POP3:
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 @@ class POP3:
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 @@ class POP3:
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,72 @@ class POP3:
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')
+ server_hostname = self.host if ssl.HAS_SNI else None
+ self.sock = context.wrap_socket(self.sock,
+ server_hostname=server_hostname)
+ 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 +422,26 @@ else:
"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)
+ server_hostname = self.host if ssl.HAS_SNI else None
+ sock = self.context.wrap_socket(sock,
+ server_hostname=server_hostname)
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 fd63f97fe9..3e13239022 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -162,7 +162,7 @@ def islink(path):
"""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 +172,35 @@ def lexists(path):
"""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 22be0b4bdb..3be9c36254 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -34,6 +34,7 @@ saferepr()
"""
+import re
import sys as _sys
from collections import OrderedDict as _OrderedDict
from io import StringIO as _StringIO
@@ -41,22 +42,19 @@ from io import StringIO as _StringIO
__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 @@ def _safe_tuple(t):
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 @@ class PrettyPrinter:
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 @@ class PrettyPrinter:
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 @@ class PrettyPrinter:
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 @@ class PrettyPrinter:
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 @@ class PrettyPrinter:
(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,71 @@ class PrettyPrinter:
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__:
+ def _str_parts(s):
+ """
+ Return a list of string literals comprising the repr()
+ of the given string using literal concatenation.
+ """
+ lines = s.splitlines(True)
+ for i, line in enumerate(lines):
+ rep = repr(line)
+ if len(rep) <= max_width:
+ yield 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:
+ yield repr(current)
+ current = part
+ else:
+ current = candidate
+ if current:
+ yield repr(current)
+ for i, rep in enumerate(_str_parts(object)):
+ if i > 0:
+ write('\n' + ' '*indent)
+ write(rep)
+ 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 +310,7 @@ class PrettyPrinter:
# 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 +334,7 @@ def _safe_repr(object, context, maxlevels, level):
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 +355,7 @@ def _safe_repr(object, context, maxlevels, level):
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 +363,13 @@ def _safe_repr(object, context, maxlevels, level):
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 +388,7 @@ def _safe_repr(object, context, maxlevels, level):
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 +396,7 @@ def _safe_repr(object, context, maxlevels, level):
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 743e77d7bf..5d0e9685a4 100755
--- a/Lib/profile.py
+++ b/Lib/profile.py
@@ -40,6 +40,40 @@ __all__ = ["run", "runctx", "Profile"]
# 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 @@ def run(statement, filename=None, sort=-1):
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 @@ def runctx(statement, globals, locals, filename=None, sort=-1):
statement and filename have the same semantics as profile.run
"""
- prof = Profile()
- try:
- prof = prof.runctx(statement, globals, locals)
- except SystemExit:
- pass
-
- if filename is not None:
- prof.dump_stats(filename)
- else:
- return prof.print_stats(sort)
+ return _Utils(Profile).runctx(statement, globals, locals, filename, sort)
+
class Profile:
"""Profiler class.
@@ -373,10 +391,9 @@ class Profile:
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 6a77605e14..e1ec355740 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -93,9 +93,8 @@ class Stats:
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 @@ class Stats:
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 __name__ == '__main__':
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 3ccf619896..e841f12f3e 100644
--- a/Lib/pty.py
+++ b/Lib/pty.py
@@ -47,27 +47,16 @@ def master_open():
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 @@ def slave_open(tty_name):
try:
ioctl(result, I_PUSH, "ptem")
ioctl(result, I_PUSH, "ldterm")
- except IOError:
+ except OSError:
pass
return result
@@ -173,8 +162,9 @@ def spawn(argv, master_read=_read, stdin_read=_read):
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 62d69ad448..1277b93ea5 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 @@ class PyCompileError(Exception):
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 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1):
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 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1):
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 @@ def main(args=None):
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 9ec05ee80b..dd58ada0aa 100644
--- a/Lib/pyclbr.py
+++ b/Lib/pyclbr.py
@@ -42,7 +42,7 @@ Instances of this class have the following instance variables:
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 @@ def _readmodule(module, path, inpackage=None):
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 9dce07976d..505b7cbd58 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -44,16 +44,16 @@ Richard Chamberlain, for the first implementation of textdoc.
"""
# 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
@@ -137,6 +137,19 @@ def _is_some_method(obj):
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 +180,9 @@ def _split_list(s, predicate):
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 +238,38 @@ def synopsis(filename, cache={}):
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 +285,22 @@ class ErrorDuringImport(Exception):
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.
@@ -891,7 +911,7 @@ class HTMLDoc(Doc):
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 +922,6 @@ class HTMLDoc(Doc):
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,20 +935,21 @@ class HTMLDoc(Doc):
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(
@@ -1236,8 +1256,12 @@ location listed above.
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 +1283,6 @@ location listed above.
else:
tag = "inherited from %s" % classname(thisclass,
object.__module__)
-
# Sort attrs by name.
attrs.sort()
@@ -1274,6 +1297,7 @@ location listed above.
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 +1316,7 @@ location listed above.
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 +1327,6 @@ location listed above.
object.__self__.__class__, mod)
else:
note = ' unbound %s method' % classname(imclass,mod)
- object = object.__func__
if name == realname:
title = self.bold(realname)
@@ -1312,20 +1335,22 @@ location listed above.
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
@@ -1396,7 +1421,7 @@ def getpager():
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 +1447,15 @@ def pipepager(text, cmd):
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:
@@ -1850,10 +1874,10 @@ Enter the name of any module, keyword, or topic to get help on writing
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 +1941,10 @@ module "pydoc_data.topics" could not be found.
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 +1981,10 @@ module "pydoc_data.topics" could not be found.
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 +2003,11 @@ Please wait a moment while I gather a list of all available modules...
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 +2036,11 @@ class ModuleScanner:
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 +2054,9 @@ class ModuleScanner:
else:
path = None
else:
+ _spec = importlib._bootstrap._SpecMethods(spec)
try:
- module = loader.load_module(modname)
+ module = _spec.load()
except ImportError:
if onerror:
onerror(modname)
diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py
index e2fd380f19..905c7c8ae8 100644
--- a/Lib/pydoc_data/topics.py
+++ b/Lib/pydoc_data/topics.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# Autogenerated by Sphinx on Sun Feb 23 08:13:25 2014
+# Autogenerated by Sphinx on Mon Feb 10 04:20:03 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',
'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',
@@ -19,12 +19,12 @@ topics = {'assert': '\nThe "assert" statement\n**********************\n\nAssert
'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',
'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',
+ '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 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',
+ '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\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',
@@ -35,7 +35,7 @@ topics = {'assert': '\nThe "assert" statement\n**********************\n\nAssert
'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',
+ '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 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',
'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',
@@ -49,24 +49,24 @@ topics = {'assert': '\nThe "assert" statement\n**********************\n\nAssert
'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',
'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',
+ '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()", 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: When "__index__()" is defined, "__int__()" should also be\n defined, and both shuld return the same value, in order to have a\n coherent integer type class.\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',
'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',
+ '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\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\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, 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()", 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: When "__index__()" is defined, "__int__()" should also be\n defined, and both shuld return the same value, in order to have a\n coherent integer type class.\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=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 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',
'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',
+ '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 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',
'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',
diff --git a/Lib/quopri.py b/Lib/quopri.py
index 3d0f0ac078..e5bd010d5b 100755
--- a/Lib/quopri.py
+++ b/Lib/quopri.py
@@ -223,7 +223,7 @@ def main():
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 14ac5e5b09..808175ab4a 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -41,7 +41,7 @@ from types import MethodType as _MethodType, BuiltinMethodType as _BuiltinMethod
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",
@@ -151,6 +151,9 @@ class Random(_random.Random):
## -------------------- 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 +219,11 @@ class Random(_random.Random):
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 +231,6 @@ class Random(_random.Random):
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 +254,11 @@ class Random(_random.Random):
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.
"""
diff --git a/Lib/re.py b/Lib/re.py
index a46ecc84f2..2e4d87c3f5 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -85,16 +85,17 @@ resulting RE will match the second character.
\\ 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,9 @@ This module also defines an exception 'error'.
import sys
import sre_compile
import sre_parse
-import functools
# 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 +155,11 @@ def match(pattern, string, flags=0):
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."""
diff --git a/Lib/rlcompleter.py b/Lib/rlcompleter.py
index 3f970536dd..94f9341bee 100644
--- a/Lib/rlcompleter.py
+++ b/Lib/rlcompleter.py
@@ -29,6 +29,7 @@ Notes:
"""
+import atexit
import builtins
import __main__
@@ -158,3 +159,7 @@ except ImportError:
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 39c0e9f7dd..577deb29b8 100644
--- a/Lib/runpy.py
+++ b/Lib/runpy.py
@@ -13,8 +13,9 @@ importers when locating support scripts as well as when importing modules.
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 +25,7 @@ class _TempModule(object):
"""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 +59,59 @@ class _ModifiedArgv0(object):
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 +120,14 @@ def _get_module_details(mod_name):
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 +149,9 @@ def _run_module_as_main(mod_name, alter_argv=True):
"""
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 +164,11 @@ def _run_module_as_main(mod_name, alter_argv=True):
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 +176,14 @@ def run_module(mod_name, init_globals=None,
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 +212,7 @@ def _get_code_from_file(run_name, fname):
# 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 +228,17 @@ def run_path(path_name, init_globals=None, run_name=None):
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 +250,12 @@ def run_path(path_name, init_globals=None, run_name=None):
# 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 b9a7ad1afa..2e6b00a2a2 100644
--- a/Lib/sched.py
+++ b/Lib/sched.py
@@ -71,10 +71,10 @@ class scheduler:
"""
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 @@ class scheduler:
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 @@ class scheduler:
# 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 0000000000..9be9225537
--- /dev/null
+++ b/Lib/selectors.py
@@ -0,0 +1,525 @@
+"""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:
+ 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()
+
+ 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
+ max_ev = len(self._fd_to_key)
+ 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 cc1815e3eb..cef580e5cd 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -61,7 +61,7 @@ from io import BytesIO
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 @@ class Shelf(collections.MutableMapping):
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 @@ class Shelf(collections.MutableMapping):
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/shutil.py b/Lib/shutil.py
index 5a4d4f6e79..0cd6ec48e1 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -39,17 +39,20 @@ __all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2",
"ignore_patterns", "chown", "which"]
# 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 +60,6 @@ class RegistryError(Exception):
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 +88,7 @@ def copyfile(src, dst, *, follow_symlinks=True):
"""
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 +219,9 @@ def copy(src, dst, *, follow_symlinks=True):
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 +330,13 @@ def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
# 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 why.winerror is None:
errors.append((src, dst, str(why)))
if errors:
raise Error(errors)
@@ -356,24 +355,24 @@ def _rmtree_unsafe(path, onerror):
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 +463,7 @@ def rmtree(path, ignore_errors=False, onerror=None):
_rmtree_safe_fd(fd, path, onerror)
try:
os.rmdir(path)
- except os.error:
+ except OSError:
onerror(os.rmdir, path, sys.exc_info())
else:
try:
diff --git a/Lib/site.py b/Lib/site.py
index 7e09701415..4fb1058a1e 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -58,17 +58,20 @@ Note that bletch is omitted because it doesn't exist; bar precedes foo
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 @@ def addpackage(sitedir, name, known_paths):
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 @@ def addsitedir(sitedir, known_paths=None):
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 @@ def getsitepackages(prefixes=None):
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 @@ def addsitepackages(known_paths, prefixes=None):
"""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,89 @@ def setquit():
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')
-
-
-class _Printer(object):
- """interactive prompt objects for printing the license text, a list of
- contributors and the copyright notice."""
+ builtins.quit = _sitebuiltins.Quitter('quit', eof)
+ builtins.exit = _sitebuiltins.Quitter('exit', eof)
- 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(
+ builtins.license = _sitebuiltins._Printer(
"license",
- "See http://www.python.org/download/releases/%.5s/license/" % sys.version,
+ "See http://www.python.org/download/releases/%.5s/license" % sys.version,
["LICENSE.txt", "LICENSE"],
[os.path.join(here, os.pardir), here, os.curdir])
-class _Helper(object):
- """Define the builtin 'help'.
- This is a wrapper around pydoc.help (with a twist).
+def sethelper():
+ 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
- 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)
+ # 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')
-def sethelper():
- builtins.help = _Helper()
+ 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 +440,7 @@ def aliasmbcs():
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 +463,14 @@ def venv(known_paths):
]
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 +542,10 @@ def main():
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 778d6d6280..1fa157ade7 100755
--- a/Lib/smtpd.py
+++ b/Lib/smtpd.py
@@ -121,8 +121,9 @@ class SMTPChannel(asynchat.async_chat):
})
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 @@ class SMTPChannel(asynchat.async_chat):
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 @@ class SMTPServer(asyncore.dispatcher):
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 @@ class SMTPServer(asyncore.dispatcher):
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 @@ class PureProxy(SMTPServer):
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 @@ def parseargs():
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 @@ if __name__ == '__main__':
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 57f181b986..66b5879def 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -67,7 +67,7 @@ _MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3
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 @@ class SMTP:
will be used.
"""
+ self._host = host
self.timeout = timeout
self.esmtp_features = {}
self.source_address = source_address
@@ -312,7 +313,7 @@ class SMTP:
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 @@ class SMTP:
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 @@ class SMTP:
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))
@@ -582,7 +583,7 @@ class SMTP:
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 +668,12 @@ class SMTP:
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)
+ server_hostname = self._host if ssl.HAS_SNI else None
+ self.sock = context.wrap_socket(self.sock,
+ server_hostname=server_hostname)
self.file = None
# RFC 3207:
# The client MUST discard any knowledge obtained from
@@ -883,6 +886,9 @@ if _have_ssl:
"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 +898,9 @@ if _have_ssl:
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)
+ server_hostname = self._host if ssl.HAS_SNI else None
+ new_socket = self.context.wrap_socket(new_socket,
+ server_hostname=server_hostname)
return new_socket
__all__.append("SMTP_SSL")
@@ -937,7 +942,7 @@ class LMTP(SMTP):
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 9f5dcc90d4..240e5072f8 100644
--- a/Lib/sndhdr.py
+++ b/Lib/sndhdr.py
@@ -11,7 +11,7 @@ The return tuple contains the following items, in this order:
- 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 @@ tests.append(test_voc)
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 @@ def testall(list, recursive, toplevel):
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 d4f1b65e46..6d67b3d282 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -48,6 +48,7 @@ import _socket
from _socket import *
import os, sys, io
+from enum import IntEnum
try:
import errno
@@ -60,6 +61,30 @@ EWOULDBLOCK = getattr(errno, 'EWOULDBLOCK', 11)
__all__ = ["getfqdn", "create_connection"]
__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__)
+
+SocketType = IntEnum('SocketType',
+ {name: value for name, value in globals().items()
+ if name.isupper() and name.startswith('SOCK_')})
+globals().update(SocketType.__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 +116,10 @@ class socket(_socket.socket):
__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 +132,32 @@ class socket(_socket.socket):
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 +166,8 @@ class socket(_socket.socket):
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)
@@ -210,6 +259,31 @@ class socket(_socket.socket):
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, SocketType)
+
+ 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
@@ -291,7 +365,7 @@ class SocketIO(io.RawIOBase):
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 +509,27 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
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, SocketType),
+ proto, canonname, sa))
+ return addrlist
diff --git a/Lib/socketserver.py b/Lib/socketserver.py
index 8332fdf66d..e9e4e4e4ad 100644
--- a/Lib/socketserver.py
+++ b/Lib/socketserver.py
@@ -299,7 +299,7 @@ class BaseServer:
"""
try:
request, client_address = self.get_request()
- except socket.error:
+ except OSError:
return
if self.verify_request(request, client_address):
try:
@@ -479,7 +479,7 @@ class TCPServer(BaseServer):
#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)
@@ -532,7 +532,7 @@ class ForkingMixIn:
# children.
try:
pid, status = os.waitpid(0, 0)
- except os.error:
+ except OSError:
pid = None
if pid not in self.active_children: continue
self.active_children.remove(pid)
@@ -545,7 +545,7 @@ class ForkingMixIn:
for child in self.active_children:
try:
pid, status = os.waitpid(child, os.WNOHANG)
- except os.error:
+ except OSError:
pid = None
if not pid: continue
try:
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index b7ec1ad0d9..04649fc549 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -28,6 +28,9 @@ try:
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 @@ class ConnectionTests(unittest.TestCase):
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/sre_compile.py b/Lib/sre_compile.py
index b984a54b03..3a5083fde8 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -13,6 +13,7 @@
import _sre, sys
import sre_parse
from sre_constants import *
+from _sre import MAXREPEAT
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
@@ -64,13 +65,6 @@ def _compile(code, pattern, flags):
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])
@@ -207,158 +201,143 @@ def _compile_charset(charset, flags, code, fixup=None):
def _optimize_charset(charset, fixup):
# 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:
+ 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 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
+ 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)))
+ out.append((RANGE, (p, q - 1)))
+ out += tail
if len(out) < len(charset):
return out
- else:
- # use bitmap
+ 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).
-
-# 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).
-
-# 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]
+ # 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.
+
+ # 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).
+
+ 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
+
+_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
+ import array
+ a = array.array('I', b)
+ 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 +434,7 @@ def _compile_info(code, pattern, flags):
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 3fb5eac322..23e3516006 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 @@ if __name__ == "__main__":
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 8a77790b08..6583ef6c4a 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -15,6 +15,7 @@
import sys
from sre_constants import *
+from _sre import MAXREPEAT
SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"
@@ -768,35 +769,33 @@ def parse_template(source, pattern):
# 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:
@@ -810,50 +809,38 @@ def parse_template(source, pattern):
index = pattern.groupindex[name]
except KeyError:
raise IndexError("unknown group name")
- a((MARK, index))
+ 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 cd8d6b4c9e..4408e7b743 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -52,10 +52,47 @@ PROTOCOL_SSLv2
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,35 +103,26 @@ from _ssl import (
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
- )
-try:
- from _ssl import OP_NO_COMPRESSION
-except ImportError:
- pass
-try:
- from _ssl import OP_SINGLE_ECDH_USE
-except ImportError:
- pass
+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_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_')
+
from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN
-from _ssl import (PROTOCOL_SSLv3, PROTOCOL_SSLv23,
- PROTOCOL_TLSv1)
+
+from _ssl import PROTOCOL_SSLv3, PROTOCOL_SSLv23, PROTOCOL_TLSv1
from _ssl import _OPENSSL_API_VERSION
+
_PROTOCOL_NAMES = {
PROTOCOL_TLSv1: "TLSv1",
PROTOCOL_SSLv23: "SSLv23",
@@ -108,14 +136,28 @@ except ImportError:
else:
_PROTOCOL_NAMES[PROTOCOL_SSLv2] = "SSLv2"
+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 getnameinfo as _getnameinfo
-from socket import error as socket_error
+from socket import SHUT_RDWR as _SHUT_RDWR
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:
@@ -125,6 +167,13 @@ else:
# (OpenSSL's default setting is 'DEFAULT:!aNULL:!eNULL')
_DEFAULT_CIPHERS = 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2'
+# restricted and more secure ciphers
+# HIGH: high encryption cipher suites with key length >= 128 bits (no MD5)
+# !aNULL: only authenticated cipher suites (no anonymous DH)
+# !RC4: no RC4 streaming cipher, RC4 is broken
+# !DSS: RSA is preferred over DSA
+_RESTRICTED_CIPHERS = 'HIGH:!aNULL:!RC4:!DSS'
+
class CertificateError(ValueError):
pass
@@ -188,7 +237,9 @@ def match_hostname(cert, hostname):
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 +271,58 @@ def match_hostname(cert, hostname):
"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 +354,94 @@ class SSLContext(_SSLContext):
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)
+ else:
+ 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_TLSv1)
+ # SSLv2 considered harmful.
+ context.options |= OP_NO_SSLv2
+ # disable compression to prevent CRIME attacks (OpenSSL 1.0+)
+ context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0)
+ # disallow ciphers with known vulnerabilities
+ context.set_ciphers(_RESTRICTED_CIPHERS)
+ # verify certs and host name in client mode
+ if purpose == Purpose.SERVER_AUTH:
+ context.verify_mode = CERT_REQUIRED
+ context.check_hostname = True
+ 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_stdlib_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
+
+ 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
class SSLSocket(socket):
"""This class implements a subtype of socket.socket that wraps
@@ -272,7 +458,7 @@ class SSLSocket(socket):
_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 +467,16 @@ class SSLSocket(socket):
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 +490,17 @@ class SSLSocket(socket):
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:
+ if HAS_SNI:
+ raise ValueError("check_hostname requires server_hostname")
+ else:
+ raise ValueError("check_hostname requires server_hostname, "
+ "but it's not supported by your OpenSSL "
+ "library")
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 +508,29 @@ class SSLSocket(socket):
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 +539,18 @@ class SSLSocket(socket):
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 +560,21 @@ class SSLSocket(socket):
# 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 +595,8 @@ class SSLSocket(socket):
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 +606,7 @@ class SSLSocket(socket):
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 +637,17 @@ class SSLSocket(socket):
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 +755,11 @@ class SSLSocket(socket):
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 +768,12 @@ class SSLSocket(socket):
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 +789,11 @@ class SSLSocket(socket):
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
@@ -671,15 +891,16 @@ def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None):
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 704adfe2e1..3eecc3e0d3 100644
--- a/Lib/stat.py
+++ b/Lib/stat.py
@@ -147,3 +147,9 @@ def filemode(mode):
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 0000000000..25a26d4aa7
--- /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/struct.py b/Lib/struct.py
index 9bfc23f8d5..d6bba58863 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 0178b083d0..d629bdfc93 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -145,11 +145,13 @@ check_call(*popenargs, **kwargs):
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 @@ check_output(*popenargs, **kwargs):
>>> 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
----------
@@ -398,19 +403,24 @@ if mswindows:
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
# 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 +516,8 @@ def _args_from_interpreter_flags():
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 +580,31 @@ def check_output(*popenargs, timeout=None, **kwargs):
... 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 +693,15 @@ def list2cmdline(seq):
#
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 'check_output' and
+ return a 2-tuple (status, output). Universal newlines mode is used,
+ meaning that the result with be decoded to a string.
- 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:
+ 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')
@@ -822,7 +853,7 @@ class Popen(object):
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 +869,7 @@ class Popen(object):
for fd in to_close:
try:
os.close(fd)
- except EnvironmentError:
+ except OSError:
pass
raise
@@ -899,7 +930,7 @@ class Popen(object):
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 +1062,6 @@ class Popen(object):
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 +1090,6 @@ class Popen(object):
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 +1101,6 @@ class Popen(object):
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 +1185,9 @@ class Popen(object):
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 +1271,7 @@ class Popen(object):
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 +1283,7 @@ class Popen(object):
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 +1295,7 @@ class Popen(object):
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 +1347,14 @@ class Popen(object):
# 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 +1424,13 @@ class Popen(object):
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)
@@ -1460,11 +1460,11 @@ class Popen(object):
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.
@@ -1477,7 +1477,7 @@ class Popen(object):
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:
@@ -1551,12 +1551,68 @@ class Popen(object):
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 +1646,6 @@ class Popen(object):
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 15f7b0354b..3c244925d1 100644
--- a/Lib/sunau.py
+++ b/Lib/sunau.py
@@ -51,7 +51,7 @@ This returns an instance of a class with the following public methods:
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 @@ The close() method is called automatically when the class instance
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 @@ class Au_read:
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 @@ class Au_read:
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 @@ class Au_write:
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 @@ class Au_write:
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 @@ class Au_write:
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 @@ class Au_write:
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 @@ class Au_write:
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 34143b5d8e..5cf4a65f22 100755
--- a/Lib/symbol.py
+++ b/Lib/symbol.py
@@ -100,7 +100,7 @@ for _name, _value in list(globals().items()):
sym_name[_value] = _name
-def main():
+def _main():
import sys
import token
if len(sys.argv) == 1:
@@ -108,4 +108,4 @@ def main():
token._main()
if __name__ == "__main__":
- main()
+ _main()
diff --git a/Lib/symtable.py b/Lib/symtable.py
index bb271968a4..e23313b031 100644
--- a/Lib/symtable.py
+++ b/Lib/symtable.py
@@ -232,7 +232,8 @@ class Symbol(object):
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 2a2160cc0d..dbf7767205 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 @@ _INSTALL_SCHEMES = {
'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 _getuserbase():
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 @@ def _parse_makefile(filename, vars=None):
"""
# 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 @@ def _generate_posix_vars():
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 @@ def _generate_posix_vars():
# 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 @@ def _init_non_posix(vars):
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 @@ def parse_config_h(fp, vars=None):
"""
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 @@ def get_config_vars(*args):
# 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 @@ def get_config_var(name):
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 @@ def get_platform():
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 5b9b444c1a..46e0f56a39 100755
--- a/Lib/tabnanny.py
+++ b/Lib/tabnanny.py
@@ -95,7 +95,7 @@ def check(file):
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 f6d7f79390..3409efea03 100755
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -56,9 +56,9 @@ except ImportError:
# 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
@@ -140,30 +140,6 @@ PAX_NUMBER_FIELDS = {
}
#---------------------------------------------------------
-# 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 +196,7 @@ def itn(n, digits=8, format=DEFAULT_FORMAT):
# 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 +240,13 @@ def copyfileobj(src, dst, length=None):
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 +381,7 @@ class _Stream:
if mode == "r":
self.dbuf = b""
self.cmp = bz2.BZ2Decompressor()
- self.exception = IOError
+ self.exception = OSError
else:
self.cmp = bz2.BZ2Compressor()
@@ -1672,7 +1648,7 @@ class TarFile(object):
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 +2018,7 @@ class TarFile(object):
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 +2207,8 @@ class TarFile(object):
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 +2217,7 @@ class TarFile(object):
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 +2227,7 @@ class TarFile(object):
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 +2318,9 @@ class TarFile(object):
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 +2424,97 @@ def is_tarfile(name):
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 d49d4f41af..0cacac85fa 100644
--- a/Lib/telnetlib.py
+++ b/Lib/telnetlib.py
@@ -17,13 +17,12 @@ guido Guido van Rossum pts/2 <Dec 2 11:10> snag.cnri.reston..
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 @@ To do:
# 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 @@ PRAGMA_HEARTBEAT = bytes([140]) # TELOPT PRAGMA HEARTBEAT
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 @@ class Telnet:
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 @@ class Telnet:
"""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 @@ class Telnet:
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 @@ class Telnet:
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 @@ class Telnet:
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 @@ class Telnet:
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 @@ class Telnet:
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 6bc842f6d8..05d4cabe60 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -27,7 +27,6 @@ __all__ = [
# Imports.
-import atexit as _atexit
import functools as _functools
import warnings as _warnings
import io as _io
@@ -35,23 +34,7 @@ import os as _os
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 @@ except ImportError:
_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 @@ else:
# 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 @@ class _RandomNameSequence:
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 @@ def _get_default_tempdir():
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 @@ def _mkstemp_inner(dir, pre, suf, flags):
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 @@ class _TemporaryFileCloser:
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):
@@ -682,10 +661,21 @@ class TemporaryDirectory(object):
# Handle mkdtemp raising an exception
name = None
+ _finalizer = 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=None):
+ _shutil.rmtree(name)
+ if warn_message is not None:
+ _warnings.warn(warn_message, ResourceWarning)
+
def __repr__(self):
return "<{} {!r}>".format(self.__class__.__name__, self.name)
@@ -693,53 +683,12 @@ class TemporaryDirectory(object):
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 is not None:
+ self._finalizer.detach()
+ if self.name is not None and not self._closed:
+ _shutil.rmtree(self.name)
+ self._closed = True
diff --git a/Lib/test/__main__.py b/Lib/test/__main__.py
index ce5615b889..d5fbe159d7 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
index aa66db4b7e..8eb57fe87e 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -41,7 +41,7 @@ from multiprocessing import util
try:
from multiprocessing import reduction
- HAS_REDUCTION = True
+ HAS_REDUCTION = reduction.HAVE_SEND_HANDLE
except ImportError:
HAS_REDUCTION = False
@@ -97,6 +97,9 @@ try:
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 @@ class _TestProcess(BaseTestCase):
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 @@ class _TestProcess(BaseTestCase):
@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 @@ class _TestProcess(BaseTestCase):
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 @@ class _TestQueue(BaseTestCase):
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,35 @@ class _TestPool(BaseTestCase):
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())
+
def raising():
raise KeyError("key")
@@ -2484,7 +2517,7 @@ class _TestPicklingConnections(BaseTestCase):
@classmethod
def tearDownClass(cls):
- from multiprocessing.reduction import resource_sharer
+ from multiprocessing import resource_sharer
resource_sharer.stop(timeout=5)
@classmethod
@@ -2798,30 +2831,40 @@ class _TestFinalize(BaseTestCase):
# 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'
- ]
-
- if HAS_REDUCTION:
- modules.append('multiprocessing.reduction')
+ 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 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 +2947,7 @@ class _TestPollEintr(BaseTestCase):
@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 +2960,14 @@ class _TestPollEintr(BaseTestCase):
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 +2980,11 @@ class TestInvalidHandle(unittest.TestCase):
@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 +2992,6 @@ class TestInvalidHandle(unittest.TestCase):
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 +3341,7 @@ class TestFlags(unittest.TestCase):
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 +3388,14 @@ class TestTimeouts(unittest.TestCase):
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 +3413,8 @@ class TestForkAwareThreadLock(unittest.TestCase):
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 +3425,78 @@ class TestForkAwareThreadLock(unittest.TestCase):
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 +3540,10 @@ class TestIgnoreEINTR(unittest.TestCase):
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 +3564,267 @@ class TestIgnoreEINTR(unittest.TestCase):
finally:
conn.close()
+class TestStartMethod(unittest.TestCase):
+ @classmethod
+ def _check_context(cls, conn):
+ conn.send(multiprocessing.get_start_method())
+
+ 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:
+ 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
#
-def setUpModule():
- 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 for use by all processes
- multiprocessing.get_logger().setLevel(LOG_LEVEL)
+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)
+
+
+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)
-def tearDownModule():
- # pause a bit so we don't get warning about dangling threads/processes
- time.sleep(0.5)
+ @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 0000000000..0bb230418a
--- /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 6ff5bb81bb..b7497ce5b0 100644
--- a/Lib/test/audiotests.py
+++ b/Lib/test/audiotests.py
@@ -12,24 +12,6 @@ class UnseekableIO(io.FileIO):
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,6 +38,12 @@ class AudioTests:
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)
@@ -72,15 +60,12 @@ class AudioWriteTests(AudioTests):
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 +75,53 @@ class AudioWriteTests(AudioTests):
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 +130,30 @@ class AudioWriteTests(AudioTests):
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 +193,18 @@ class AudioWriteTests(AudioTests):
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 +321,9 @@ class AudioTestsWithSourceFile(AudioTests):
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 0000000000..fa5ab67a98
--- /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 cf54c28759..0a629400fd 100644
--- a/Lib/test/buffer_tests.py
+++ b/Lib/test/buffer_tests.py
@@ -160,14 +160,20 @@ class MixinBytesBufferCommonTests(object):
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 0000000000..58b4209f55
--- /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 ca4962ee8e..b0e227ad11 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 ab55476226..3f3c60acea 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -619,6 +619,10 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
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),
diff --git a/Lib/test/final_a.py b/Lib/test/final_a.py
new file mode 100644
index 0000000000..390ee8895a
--- /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 0000000000..7228d82b88
--- /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 88527df25e..19b54ec736 100644
--- a/Lib/test/fork_wait.py
+++ b/Lib/test/fork_wait.py
@@ -28,7 +28,7 @@ class ForkWait(unittest.TestCase):
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 0000000000..5bfa62c4ca
--- /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 0000000000..53355c8a50
--- /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 e0081c1fc5..0000000000
--- 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 bfbf44e0db..1cbcea2343 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -80,6 +80,11 @@ class BaseLockTests(BaseTestCase):
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 @@ class ConditionTests(BaseTestCase):
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 @@ class ConditionTests(BaseTestCase):
_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 @@ class ConditionTests(BaseTestCase):
_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 48d2e57f4b..4251d5524f 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_template = """
[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 @@ def make_cert_key(hostname):
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 @@ def make_cert_key(hostname):
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:
+ r.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 @@ if __name__ == '__main__':
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 861bfb2b56..e36724f54b 100644
--- a/Lib/test/mock_socket.py
+++ b/Lib/test/mock_socket.py
@@ -145,12 +145,8 @@ def gethostbyname(name):
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 908afe3045..017e010ba0 100644
--- a/Lib/test/mp_fork_bomb.py
+++ b/Lib/test/mp_fork_bomb.py
@@ -7,6 +7,11 @@ def foo():
# 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 14fea3ef7d..51ca3bd64f 100644
--- a/Lib/test/multibytecodec_support.py
+++ b/Lib/test/multibytecodec_support.py
@@ -281,7 +281,7 @@ class TestBase_Mapping(unittest.TestCase):
unittest.TestCase.__init__(self, *args, **kw)
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 4d59bde851..a2bea600ed 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 @@ class E(C):
def __getinitargs__(self):
return ()
+class H(object):
+ pass
+
import __main__
__main__.C = C
C.__module__ = "__main__"
@@ -100,6 +105,8 @@ __main__.D = D
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 @@ def create_data():
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
# 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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
@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 @@ class AbstractPickleTests(unittest.TestCase):
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
@@ -1248,6 +1311,35 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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 @@ class AbstractPickleTests(unittest.TestCase):
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,194 @@ class AbstractPickleTests(unittest.TestCase):
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_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 +1648,9 @@ class BigmemPickleTests(unittest.TestCase):
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 +1665,44 @@ class BigmemPickleTests(unittest.TestCase):
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 +1714,52 @@ class BigmemPickleTests(unittest.TestCase):
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 +1803,8 @@ class REX_five(object):
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 +1816,8 @@ class REX_six(object):
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 +1855,16 @@ class MyList(list):
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 +1874,8 @@ class SimpleNewObj(object):
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 +1912,7 @@ class AbstractPickleModuleTests(unittest.TestCase):
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 +2097,23 @@ class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
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()
-
- 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)
+ 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)
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 0000000000..09b1f3e08a
--- /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 0000000000..fc6effefb2
--- /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/regrtest.py b/Lib/test/regrtest.py
index ae62c6e7a0..c1c831ff86 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 @@ For more rigorous testing, it is useful to use the following
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 @@ option '-uall,-gui'.
# 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 @@ try:
except ImportError:
threading = None
try:
- import multiprocessing.process
+ import _multiprocessing, multiprocessing.process
except ImportError:
multiprocessing = None
@@ -246,20 +201,262 @@ from test import support
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network',
'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui')
-TEMPDIR = os.path.abspath(tempfile.gettempdir())
-
-def usage(msg):
- print(msg, file=sys.stderr)
- print("Use --help for usage", file=sys.stderr)
- sys.exit(2)
-
+# 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)
+
+class _ArgParser(argparse.ArgumentParser):
+
+ def error(self, message):
+ super().error(message + "\nPass -h or --help for complete help.")
+
+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 main(tests=None, testdir=None, verbose=0, quiet=False,
+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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
#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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
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 @@ def replace_stdout():
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 @@ def runtest(test, verbose, quiet,
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 @@ def runtest(test, verbose, quiet,
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 @@ def runtest(test, verbose, quiet,
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 @@ class saved_test_environment:
'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 @@ class saved_test_environment:
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 @@ class saved_test_environment:
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 @@ class saved_test_environment:
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,8 +1268,7 @@ def runtest_inner(test, verbose, quiet,
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)
@@ -1221,8 +1277,7 @@ def runtest_inner(test, verbose, quiet,
test_runner = lambda: 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 +1383,50 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
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 +1492,11 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
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 +1539,10 @@ def printlist(x, width=70, indent=4):
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 +1551,16 @@ def _make_temp_dir_for_build(TEMPDIR):
# 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)
+
+ # 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()
- TESTCWD = os.path.join(TEMPDIR, TESTCWD)
- return TEMPDIR, TESTCWD
if __name__ == '__main__':
# Remove regrtest.py's own directory from the module search path. Despite
@@ -1808,11 +1584,4 @@ if __name__ == '__main__':
# 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 0000000000..6d89b08ebe
--- /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 ab201649e5..af0545bac2 100644
--- a/Lib/test/script_helper.py
+++ b/Lib/test/script_helper.py
@@ -12,13 +12,22 @@ import contextlib
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,7 +48,7 @@ def _assert_python(expected_success, *args, **env_vars):
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, "
@@ -49,18 +58,32 @@ def _assert_python(expected_success, *args, **env_vars):
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):
+ """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)
return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
@@ -68,6 +91,7 @@ def spawn_python(*args, **kw):
**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 +101,10 @@ def kill_python(p):
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')
diff --git a/Lib/test/sortperf.py b/Lib/test/sortperf.py
index af7c0b4bd1..90722f7abc 100644
--- a/Lib/test/sortperf.py
+++ b/Lib/test/sortperf.py
@@ -22,7 +22,7 @@ def randfloats(n):
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 @@ def randfloats(n):
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 8686153a17..759b3f487e 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -35,7 +35,7 @@ class HTTPSServer(_HTTPServer):
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 @@ class HTTPSServerThread(threading.Thread):
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 0000000000..9b0ed22b95
--- /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 4800d6d7f2..5ed01f2979 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -327,13 +327,26 @@ class BaseTest:
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)
@@ -1165,7 +1178,8 @@ class MixinStrUnicodeUserStringTest:
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 1f61e13a34..d12bd95abe 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 @@ if __name__ == "__main__":
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 5c03f54d5c..9857f9dca4 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -15,10 +15,10 @@ import shutil
import warnings
import unittest
import importlib
+import importlib.util
import collections.abc
import re
import subprocess
-import imp
import time
import sysconfig
import fnmatch
@@ -56,26 +56,49 @@ try:
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",
+ # 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 +120,8 @@ def _ignore_deprecated_imports(ignore=True):
"""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 +131,21 @@ def _ignore_deprecated_imports(ignore=True):
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))
@@ -302,25 +331,20 @@ else:
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 +356,7 @@ def make_legacy_pyc(source):
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,8 +375,8 @@ def forget(modname):
# 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'.
@@ -513,7 +537,7 @@ def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM):
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 +615,9 @@ def _is_ipv6_enabled():
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:
@@ -1180,9 +1204,9 @@ class TransientResource(object):
# 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
@@ -1228,17 +1252,17 @@ def transient_internet(resource_name, *, timeout=30.0, errnos=()):
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
@@ -1697,9 +1721,18 @@ def run_unittest(*classes):
#=======================================================================
# 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 +1807,12 @@ def threading_setup():
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 +1914,7 @@ def strip_python_stderr(stderr):
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 +2045,81 @@ def skip_unless_xattr(test):
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 +2154,23 @@ def patch(test_instance, object_to_patch, attr_name, new_value):
# 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 608ec01f14..8cc285f70a 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -29,17 +29,20 @@ class AllTest(unittest.TestCase):
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)):
@@ -110,8 +113,5 @@ class AllTest(unittest.TestCase):
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 0000000000..0152e9d94d
--- /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_abc.py b/Lib/test/test_abc.py
index d4d7556518..93f9dae215 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -68,6 +68,19 @@ class TestLegacyAPI(unittest.TestCase):
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 @@ class TestABC(unittest.TestCase):
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 10260e3269..ab5143787b 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 @@ class AifcULAWTest(AifcTest, unittest.TestCase):
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 @@ class AifcALAWTest(AifcTest, unittest.TestCase):
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 @@ class AifcMiscTest(audiotests.AudioTests, unittest.TestCase):
#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 @@ class AIFCLowLevelTest(unittest.TestCase):
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 9cb15c78bd..25ba9e62d1 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -14,6 +14,7 @@ import argparse
from io import StringIO
from test import support
+from unittest import mock
class StdIOBuffer(StringIO):
pass
@@ -1421,6 +1422,19 @@ class TestFileTypeRepr(TestCase):
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 +1571,24 @@ class TestFileTypeWB(TempDirMixin, ParserTestCase):
]
+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"""
@@ -4381,7 +4413,7 @@ class TestOptionalsHelpVersionActions(TestCase):
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 +4426,7 @@ class TestOptionalsHelpVersionActions(TestCase):
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):
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index d68284f919..f8dbf0695c 100644
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -353,12 +353,12 @@ class BaseTest:
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 +1026,18 @@ class BaseTest:
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 63528885e9..f17c93fc68 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -37,7 +37,7 @@ exec_tests = [
# 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
@@ -180,20 +180,36 @@ eval_tests = [
class AST_Tests(unittest.TestCase):
- def _assertTrueorder(self, ast_node, parent_pos):
+ def _assertTrueorder(self, ast_node, parent_pos, reverse_check = False):
+ def should_reverse_check(parent, child):
+ # In some situations, the children of nodes occur before
+ # their parents, for example in a.b.c, a occurs before b
+ # but a is a child of b.
+ if isinstance(parent, ast.Call):
+ if parent.func == child:
+ return True
+ if isinstance(parent, (ast.Attribute, ast.Subscript)):
+ return True
+ return False
+
if not isinstance(ast_node, ast.AST) or ast_node._fields is None:
return
if isinstance(ast_node, (ast.expr, ast.stmt, ast.excepthandler)):
node_pos = (ast_node.lineno, ast_node.col_offset)
- self.assertTrue(node_pos >= parent_pos)
+ if reverse_check:
+ self.assertTrue(node_pos <= parent_pos)
+ else:
+ self.assertTrue(node_pos >= parent_pos)
parent_pos = (ast_node.lineno, ast_node.col_offset)
for name in ast_node._fields:
value = getattr(ast_node, name)
if isinstance(value, list):
for child in value:
- self._assertTrueorder(child, parent_pos)
+ self._assertTrueorder(child, parent_pos,
+ should_reverse_check(ast_node, child))
elif value is not None:
- self._assertTrueorder(value, parent_pos)
+ self._assertTrueorder(value, parent_pos,
+ should_reverse_check(ast_node, value))
def test_AST_objects(self):
x = ast.AST()
@@ -262,14 +278,14 @@ class AST_Tests(unittest.TestCase):
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):
@@ -439,7 +455,7 @@ class ASTHelpers_Test(unittest.TestCase):
"lineno=1, col_offset=0), args=[Name(id='eggs', ctx=Load(), "
"lineno=1, col_offset=5), Str(s='and cheese', lineno=1, "
"col_offset=11)], keywords=[], starargs=None, kwargs=None, "
- "lineno=1, col_offset=0), lineno=1, col_offset=0)])"
+ "lineno=1, col_offset=4), lineno=1, col_offset=0)])"
)
def test_copy_location(self):
@@ -460,7 +476,7 @@ class ASTHelpers_Test(unittest.TestCase):
"Module(body=[Expr(value=Call(func=Name(id='write', ctx=Load(), "
"lineno=1, col_offset=0), args=[Str(s='spam', lineno=1, "
"col_offset=6)], keywords=[], starargs=None, kwargs=None, "
- "lineno=1, col_offset=0), lineno=1, col_offset=0), "
+ "lineno=1, col_offset=5), lineno=1, col_offset=0), "
"Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, "
"col_offset=0), args=[Str(s='eggs', lineno=1, col_offset=0)], "
"keywords=[], starargs=None, kwargs=None, lineno=1, "
@@ -560,8 +576,8 @@ class ASTValidatorTests(unittest.TestCase):
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 +587,12 @@ class ASTValidatorTests(unittest.TestCase):
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 +607,7 @@ class ASTValidatorTests(unittest.TestCase):
"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 +778,7 @@ class ASTValidatorTests(unittest.TestCase):
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 +936,9 @@ class ASTValidatorTests(unittest.TestCase):
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 +947,10 @@ class ASTValidatorTests(unittest.TestCase):
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 +963,20 @@ def main():
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))]),
@@ -977,7 +985,7 @@ exec_results = [
('Module', [('If', (1, 0), ('Name', (1, 3), 'v', ('Load',)), [('Pass', (1, 5))], [])]),
('Module', [('With', (1, 0), [('withitem', ('Name', (1, 5), 'x', ('Load',)), ('Name', (1, 10), 'y', ('Store',)))], [('Pass', (1, 13))])]),
('Module', [('With', (1, 0), [('withitem', ('Name', (1, 5), 'x', ('Load',)), ('Name', (1, 10), 'y', ('Store',))), ('withitem', ('Name', (1, 13), 'z', ('Load',)), ('Name', (1, 18), 'q', ('Store',)))], [('Pass', (1, 21))])]),
-('Module', [('Raise', (1, 0), ('Call', (1, 6), ('Name', (1, 6), 'Exception', ('Load',)), [('Str', (1, 16), 'string')], [], None, None), None)]),
+('Module', [('Raise', (1, 0), ('Call', (1, 15), ('Name', (1, 6), 'Exception', ('Load',)), [('Str', (1, 16), 'string')], [], None, None), None)]),
('Module', [('Try', (1, 0), [('Pass', (2, 2))], [('ExceptHandler', (3, 0), ('Name', (3, 7), 'Exception', ('Load',)), None, [('Pass', (4, 2))])], [], [])]),
('Module', [('Try', (1, 0), [('Pass', (2, 2))], [], [], [('Pass', (4, 2))])]),
('Module', [('Assert', (1, 0), ('Name', (1, 7), 'v', ('Load',)), None)]),
@@ -1002,29 +1010,29 @@ single_results = [
('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',))])])),
('Expression', ('Compare', (1, 0), ('Num', (1, 0), 1), [('Lt',), ('Lt',)], [('Num', (1, 4), 2), ('Num', (1, 8), 3)])),
-('Expression', ('Call', (1, 0), ('Name', (1, 0), 'f', ('Load',)), [('Num', (1, 2), 1), ('Num', (1, 4), 2)], [('keyword', 'c', ('Num', (1, 8), 3))], ('Name', (1, 11), 'd', ('Load',)), ('Name', (1, 15), 'e', ('Load',)))),
+('Expression', ('Call', (1, 1), ('Name', (1, 0), 'f', ('Load',)), [('Num', (1, 2), 1), ('Num', (1, 4), 2)], [('keyword', 'c', ('Num', (1, 8), 3))], ('Name', (1, 11), 'd', ('Load',)), ('Name', (1, 15), 'e', ('Load',)))),
('Expression', ('Num', (1, 0), 10)),
('Expression', ('Str', (1, 0), 'string')),
-('Expression', ('Attribute', (1, 0), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',))),
-('Expression', ('Subscript', (1, 0), ('Name', (1, 0), 'a', ('Load',)), ('Slice', ('Name', (1, 2), 'b', ('Load',)), ('Name', (1, 4), 'c', ('Load',)), None), ('Load',))),
+('Expression', ('Attribute', (1, 2), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',))),
+('Expression', ('Subscript', (1, 2), ('Name', (1, 0), 'a', ('Load',)), ('Slice', ('Name', (1, 2), 'b', ('Load',)), ('Name', (1, 4), 'c', ('Load',)), None), ('Load',))),
('Expression', ('Name', (1, 0), 'v', ('Load',))),
('Expression', ('List', (1, 0), [('Num', (1, 1), 1), ('Num', (1, 3), 2), ('Num', (1, 5), 3)], ('Load',))),
('Expression', ('List', (1, 0), [], ('Load',))),
('Expression', ('Tuple', (1, 0), [('Num', (1, 0), 1), ('Num', (1, 2), 2), ('Num', (1, 4), 3)], ('Load',))),
('Expression', ('Tuple', (1, 1), [('Num', (1, 1), 1), ('Num', (1, 3), 2), ('Num', (1, 5), 3)], ('Load',))),
('Expression', ('Tuple', (1, 0), [], ('Load',))),
-('Expression', ('Call', (1, 0), ('Attribute', (1, 0), ('Attribute', (1, 0), ('Attribute', (1, 0), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',)), 'd', ('Load',)), [('Subscript', (1, 8), ('Attribute', (1, 8), ('Name', (1, 8), 'a', ('Load',)), 'b', ('Load',)), ('Slice', ('Num', (1, 12), 1), ('Num', (1, 14), 2), None), ('Load',))], [], None, None)),
+('Expression', ('Call', (1, 7), ('Attribute', (1, 6), ('Attribute', (1, 4), ('Attribute', (1, 2), ('Name', (1, 0), 'a', ('Load',)), 'b', ('Load',)), 'c', ('Load',)), 'd', ('Load',)), [('Subscript', (1, 12), ('Attribute', (1, 10), ('Name', (1, 8), 'a', ('Load',)), 'b', ('Load',)), ('Slice', ('Num', (1, 12), 1), ('Num', (1, 14), 2), None), ('Load',))], [], None, None)),
]
main()
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index c79fe6f613..f93a52d8c9 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -15,6 +15,7 @@ except ImportError:
HOST = support.HOST
SERVER_QUIT = b'QUIT\n'
+TIMEOUT = 3.0
if threading:
class echo_server(threading.Thread):
@@ -123,7 +124,9 @@ class TestAsynchat(unittest.TestCase):
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!"])
@@ -154,7 +157,9 @@ class TestAsynchat(unittest.TestCase):
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 +179,9 @@ class TestAsynchat(unittest.TestCase):
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 +193,9 @@ class TestAsynchat(unittest.TestCase):
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 +205,9 @@ class TestAsynchat(unittest.TestCase):
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 +218,9 @@ class TestAsynchat(unittest.TestCase):
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 +239,9 @@ class TestAsynchat(unittest.TestCase):
# 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
@@ -268,9 +283,5 @@ class TestFifo(unittest.TestCase):
self.assertEqual(f.pop(), (0, None))
-def test_main(verbose=None):
- support.run_unittest(TestAsynchat, TestAsynchat_WithPoll,
- TestHelperFunctions, TestFifo)
-
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 0000000000..23ce5e8059
--- /dev/null
+++ b/Lib/test/test_asyncio/__init__.py
@@ -0,0 +1,31 @@
+import os
+import sys
+import unittest
+from test.support import run_unittest, 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 suite():
+ tests_file = os.path.join(os.path.dirname(__file__), 'tests.txt')
+ with open(tests_file) as fp:
+ test_names = fp.read().splitlines()
+ tests = unittest.TestSuite()
+ loader = unittest.TestLoader()
+ for test_name in test_names:
+ mod_name = 'test.' + test_name
+ try:
+ __import__(mod_name)
+ except unittest.SkipTest:
+ pass
+ else:
+ mod = sys.modules[mod_name]
+ tests.addTests(loader.loadTestsFromModule(mod))
+ return tests
+
+
+def test_main():
+ run_unittest(suite())
diff --git a/Lib/test/test_asyncio/__main__.py b/Lib/test/test_asyncio/__main__.py
new file mode 100644
index 0000000000..b549492038
--- /dev/null
+++ b/Lib/test/test_asyncio/__main__.py
@@ -0,0 +1,5 @@
+from . import test_main
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_asyncio/echo.py b/Lib/test/test_asyncio/echo.py
new file mode 100644
index 0000000000..006364bb00
--- /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 0000000000..e83ca09fb7
--- /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 0000000000..064496736b
--- /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 0000000000..5bfa62c4ca
--- /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 0000000000..09b1f3e08a
--- /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 0000000000..47a7d7e37e
--- /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 0000000000..3fd3bbd54a
--- /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 0000000000..340ca67d64
--- /dev/null
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -0,0 +1,926 @@
+"""Tests for base_events.py"""
+
+import errno
+import logging
+import socket
+import sys
+import time
+import unittest
+from unittest import mock
+from test.support import IPV6_ENABLED
+
+import asyncio
+from asyncio import base_events
+from asyncio import constants
+from asyncio import test_utils
+
+
+MOCK_ANY = mock.ANY
+PY34 = sys.version_info >= (3, 4)
+
+
+class BaseEventLoopTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = base_events.BaseEventLoop()
+ self.loop._selector = mock.Mock()
+ asyncio.set_event_loop(None)
+
+ 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._read_from_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__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_timer(self):
+ h = asyncio.TimerHandle(time.monotonic()+10, lambda: False, (),
+ self.loop)
+
+ self.loop._add_callback(h)
+ self.assertIn(h, self.loop._scheduled)
+
+ 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 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.time')
+ @mock.patch('asyncio.base_events.logger')
+ def test__run_once_logging(self, m_logger, m_time):
+ # Log to INFO level if timeout > 1.0 sec.
+ idx = -1
+ data = [10.0, 10.0, 12.0, 13.0]
+
+ def monotonic():
+ nonlocal data, idx
+ idx += 1
+ return data[idx]
+
+ m_time.monotonic = monotonic
+
+ self.loop._scheduled.append(
+ asyncio.TimerHandle(11.0, lambda: True, (), self.loop))
+ self.loop._process_events = mock.Mock()
+ self.loop._run_once()
+ self.assertEqual(logging.INFO, m_logger.log.call_args[0][0])
+
+ idx = -1
+ data = [10.0, 10.0, 10.3, 13.0]
+ self.loop._scheduled = [asyncio.TimerHandle(11.0, lambda: True, (),
+ self.loop)]
+ 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_until_complete_type_error(self):
+ self.assertRaises(TypeError,
+ self.loop.run_until_complete, 'blah')
+
+ 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)
+
+ # exepected 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():
+ self.loop.call_soon(zero_error)
+ self.loop._run_once()
+
+ self.loop._process_events = mock.Mock()
+
+ mock_handler = mock.Mock()
+ self.loop.set_exception_handler(mock_handler)
+ run_loop()
+ mock_handler.assert_called_with(self.loop, {
+ 'exception': MOCK_ANY,
+ 'message': test_utils.MockPattern(
+ 'Exception in callback.*zero_error'),
+ 'handle': MOCK_ANY,
+ })
+ 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()
+ 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)
+
+
+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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ @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')
+
+ 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 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(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 coroutine_function():
+ pass
+
+ with self.assertRaises(TypeError):
+ self.loop.call_soon(coroutine_function)
+ with self.assertRaises(TypeError):
+ self.loop.call_soon_threadsafe(coroutine_function)
+ with self.assertRaises(TypeError):
+ self.loop.call_later(60, coroutine_function)
+ with self.assertRaises(TypeError):
+ self.loop.call_at(self.loop.time() + 60, coroutine_function)
+ with self.assertRaises(TypeError):
+ self.loop.run_in_executor(None, coroutine_function)
+
+
+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 0000000000..bafa8756cf
--- /dev/null
+++ b/Lib/test/test_asyncio/test_events.py
@@ -0,0 +1,2044 @@
+"""Tests for events.py."""
+
+import functools
+import gc
+import io
+import os
+import platform
+import signal
+import socket
+try:
+ import ssl
+except ImportError:
+ ssl = None
+ HAS_SNI = False
+else:
+ from ssl import HAS_SNI
+import subprocess
+import sys
+import threading
+import time
+import errno
+import unittest
+from unittest import mock
+from test import support # find_unused_port, IPV6_ENABLED, TEST_HOME_DIR
+
+
+import asyncio
+from asyncio import selector_events
+from asyncio import test_utils
+
+
+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()
+ asyncio.set_event_loop(None)
+
+ 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()
+
+ 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):
+ 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)
+ 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()
+
+ @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:
+ conn_fut = self.loop.create_connection(
+ lambda: MyProto(loop=self.loop),
+ *httpd.address,
+ ssl=test_utils.dummy_ssl_context())
+
+ self._basetest_create_ssl_connection(conn_fut)
+
+ @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:
+ conn_fut = self.loop.create_unix_connection(
+ lambda: MyProto(loop=self.loop),
+ httpd.address,
+ ssl=test_utils.dummy_ssl_context(),
+ server_hostname='127.0.0.1')
+
+ self._basetest_create_ssl_connection(conn_fut, check_sockname)
+
+ 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()
+
+ 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()
+
+ @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()
+
+ @unittest.skipIf(ssl is None, 'No ssl module')
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in 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 self.assertRaisesRegex(ssl.SSLError,
+ 'certificate verify failed '):
+ self.loop.run_until_complete(f_c)
+
+ # close connection
+ self.assertIsNone(proto.transport)
+ server.close()
+
+ @unittest.skipIf(ssl is None, 'No ssl module')
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in 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 self.assertRaisesRegex(ssl.SSLError,
+ 'certificate verify failed '):
+ self.loop.run_until_complete(f_c)
+
+ # close connection
+ self.assertIsNone(proto.transport)
+ server.close()
+
+ @unittest.skipIf(ssl is None, 'No ssl module')
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in 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 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()
+
+ @unittest.skipIf(ssl is None, 'No ssl module')
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in 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()
+
+ @unittest.skipIf(ssl is None, 'No ssl module')
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in 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()
+
+ 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')
+
+ coro = self.loop.create_datagram_endpoint(
+ lambda: MyDatagramProto(loop=self.loop),
+ remote_addr=(host, port))
+ transport, client = self.loop.run_until_complete(coro)
+
+ self.assertEqual('INITIALIZED', client.state)
+ 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):
+ 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()
+ 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:
+ 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)
+
+
+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())
+ transp.close()
+ self.loop.run_until_complete(proto.completed)
+ self.check_terminated(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)
+
+ try:
+ 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])
+ finally:
+ transp.close()
+
+ self.loop.run_until_complete(proto.completed)
+ self.check_terminated(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'')
+
+ 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)
+
+ 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)
+
+ 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)
+
+ @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)
+
+ 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])
+ transp.close()
+ self.loop.run_until_complete(proto.completed)
+ self.check_terminated(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, unittest.TestCase):
+
+ def create_event_loop(self):
+ return asyncio.SelectorEventLoop()
+
+ class ProactorEventLoopTests(EventLoopTestsMixin,
+ SubprocessTestsMixin,
+ unittest.TestCase):
+
+ def create_event_loop(self):
+ return asyncio.ProactorEventLoop()
+
+ def test_create_ssl_connection(self):
+ raise unittest.SkipTest("IocpEventLoop incompatible with SSL")
+
+ def test_create_server_ssl(self):
+ raise unittest.SkipTest("IocpEventLoop incompatible with SSL")
+
+ def test_create_server_ssl_verify_failed(self):
+ raise unittest.SkipTest("IocpEventLoop incompatible with SSL")
+
+ def test_create_server_ssl_match_failed(self):
+ raise unittest.SkipTest("IocpEventLoop incompatible with SSL")
+
+ def test_create_server_ssl_verified(self):
+ raise unittest.SkipTest("IocpEventLoop incompatible with 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,
+ unittest.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,
+ unittest.TestCase):
+
+ def create_event_loop(self):
+ return asyncio.SelectorEventLoop(selectors.EpollSelector())
+
+ if hasattr(selectors, 'PollSelector'):
+ class PollEventLoopTests(UnixEventLoopTestsMixin,
+ SubprocessTestsMixin,
+ unittest.TestCase):
+
+ def create_event_loop(self):
+ return asyncio.SelectorEventLoop(selectors.PollSelector())
+
+ # Should always exist.
+ class SelectEventLoopTests(UnixEventLoopTestsMixin,
+ SubprocessTestsMixin,
+ unittest.TestCase):
+
+ def create_event_loop(self):
+ return asyncio.SelectorEventLoop(selectors.SelectSelector())
+
+
+class HandleTests(unittest.TestCase):
+
+ def test_handle(self):
+ def callback(*args):
+ return args
+
+ args = ()
+ h = asyncio.Handle(callback, args, mock.Mock())
+ self.assertIs(h._callback, callback)
+ self.assertIs(h._args, args)
+ self.assertFalse(h._cancelled)
+
+ r = repr(h)
+ self.assertTrue(r.startswith(
+ 'Handle('
+ '<function HandleTests.test_handle.<locals>.callback'))
+ self.assertTrue(r.endswith('())'))
+
+ h.cancel()
+ self.assertTrue(h._cancelled)
+
+ r = repr(h)
+ self.assertTrue(r.startswith(
+ 'Handle('
+ '<function HandleTests.test_handle.<locals>.callback'))
+ self.assertTrue(r.endswith('())<cancelled>'), r)
+
+ def test_handle_from_handle(self):
+ def callback(*args):
+ return args
+ m_loop = object()
+ h1 = asyncio.Handle(callback, (), loop=m_loop)
+ self.assertRaises(
+ AssertionError, asyncio.Handle, h1, (), m_loop)
+
+ def test_callback_with_exception(self):
+ def callback():
+ raise ValueError()
+
+ m_loop = mock.Mock()
+ m_loop.call_exception_handler = mock.Mock()
+
+ h = asyncio.Handle(callback, (), m_loop)
+ h._run()
+
+ m_loop.call_exception_handler.assert_called_with({
+ 'message': test_utils.MockPattern('Exception in callback.*'),
+ 'exception': mock.ANY,
+ 'handle': h
+ })
+
+
+class TimerTests(unittest.TestCase):
+
+ 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 = ()
+ 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)
+
+ r = repr(h)
+ self.assertTrue(r.endswith('())'))
+
+ h.cancel()
+ self.assertTrue(h._cancelled)
+
+ r = repr(h)
+ self.assertTrue(r.endswith('())<cancelled>'), r)
+
+ self.assertRaises(AssertionError,
+ asyncio.TimerHandle, None, callback, args,
+ mock.Mock())
+
+ def test_timer_comparison(self):
+ loop = mock.Mock()
+
+ def callback(*args):
+ return args
+
+ when = time.monotonic()
+
+ h1 = asyncio.TimerHandle(when, callback, (), loop)
+ h2 = asyncio.TimerHandle(when, callback, (), 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, (), loop)
+ h2 = asyncio.TimerHandle(when + 10.0, callback, (), 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, (), 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.close)
+ 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)
+
+
+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(AssertionError, 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(AssertionError, 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 0000000000..399e8f438e
--- /dev/null
+++ b/Lib/test/test_asyncio/test_futures.py
@@ -0,0 +1,351 @@
+"""Tests for futures.py."""
+
+import concurrent.futures
+import threading
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import test_utils
+
+
+def _fakefunc(f):
+ return f
+
+
+class FutureTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ 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):
+ try:
+ asyncio.set_event_loop(self.loop)
+ f = asyncio.Future()
+ self.assertIs(f._loop, self.loop)
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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_repr(self):
+ 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<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<exception=RuntimeError()>')
+ self.assertIs(f_exception.exception(), exc)
+
+ f_few_callbacks = asyncio.Future(loop=self.loop)
+ f_few_callbacks.add_done_callback(_fakefunc)
+ self.assertIn('Future<PENDING, [<function _fakefunc',
+ repr(f_few_callbacks))
+ f_few_callbacks.cancel()
+
+ f_many_callbacks = asyncio.Future(loop=self.loop)
+ for i in range(20):
+ f_many_callbacks.add_done_callback(_fakefunc)
+ r = repr(f_many_callbacks)
+ self.assertIn('Future<PENDING, [<function _fakefunc', r)
+ self.assertIn('<18 more>', r)
+ f_many_callbacks.cancel()
+
+ 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())
+
+
+class FutureDoneCallbackTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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 0000000000..f542463ad2
--- /dev/null
+++ b/Lib/test/test_asyncio/test_locks.py
@@ -0,0 +1,870 @@
+"""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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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):
+ try:
+ asyncio.set_event_loop(self.loop)
+ lock = asyncio.Lock()
+ self.assertIs(lock._loop, self.loop)
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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):
+ try:
+ asyncio.set_event_loop(self.loop)
+ ev = asyncio.Event()
+ self.assertIs(ev._loop, self.loop)
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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):
+ try:
+ asyncio.set_event_loop(self.loop)
+ cond = asyncio.Condition()
+ self.assertIs(cond._loop, self.loop)
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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())
+
+
+class SemaphoreTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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):
+ try:
+ asyncio.set_event_loop(self.loop)
+ sem = asyncio.Semaphore()
+ self.assertIs(sem._loop, self.loop)
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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()
+
+ 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 0000000000..5bf24a4503
--- /dev/null
+++ b/Lib/test/test_asyncio/test_proactor_events.py
@@ -0,0 +1,490 @@
+"""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
+
+
+class ProactorSocketTransportTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ 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 test_ctor(self):
+ fut = asyncio.Future(loop=self.loop)
+ tr = _ProactorSocketTransport(
+ self.loop, self.sock, self.protocol, 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ tr.write(b'')
+ self.assertFalse(tr._buffer)
+
+ def test_write_more(self):
+ tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ tr._force_close = mock.Mock()
+ tr.abort()
+ tr._force_close.assert_called_with(None)
+
+ def test_close(self):
+ tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
+ tr._call_connection_lost(None)
+ self.assertTrue(self.protocol.connection_lost.called)
+ self.assertTrue(self.sock.close.called)
+
+ def test_write_eof(self):
+ tr = _ProactorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _ProactorSocketTransport(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._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()
+ tr.close()
+
+ def test_pause_resume_reading(self):
+ tr = _ProactorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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()
+
+
+class BaseProactorEventLoopTests(unittest.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)
+
+ @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)
+
+ 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)
+
+ 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):
+ self.assertRaises(
+ NotImplementedError, BaseProactorEventLoop, self.proactor)
+
+ def test_make_socket_transport(self):
+ tr = self.loop._make_socket_transport(self.sock, asyncio.Protocol())
+ self.assertIsInstance(tr, _ProactorSocketTransport)
+
+ 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.proactor.recv.side_effect = OSError()
+ self.assertRaises(OSError, self.loop._loop_self_reading)
+ self.assertTrue(self.loop.close.called)
+
+ def test_write_to_self(self):
+ self.loop._write_to_self()
+ self.csock.send.assert_called_with(b'x')
+
+ 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 0000000000..f79fee21d6
--- /dev/null
+++ b/Lib/test/test_asyncio/test_queues.py
@@ -0,0 +1,466 @@
+"""Tests for queues.py"""
+
+import unittest
+from unittest import mock
+
+import asyncio
+from asyncio import test_utils
+
+
+class _QueueTestBase(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+
+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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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):
+ try:
+ asyncio.set_event_loop(self.loop)
+ q = asyncio.Queue()
+ self.assertIs(q._loop, self.loop)
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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_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)
+
+ asyncio.Task(q.put('a'), loop=self.loop)
+ asyncio.Task(q.put('c'), loop=self.loop)
+ t = asyncio.Task(q.put('b'), loop=self.loop)
+
+ test_utils.run_briefly(self.loop)
+ t.cancel()
+ test_utils.run_briefly(self.loop)
+ self.assertTrue(t.done())
+ self.assertEqual(q.get_nowait(), 'a')
+ self.assertEqual(q.get_nowait(), 'c')
+
+ 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():
+ for _ in range(2):
+ asyncio.Task(worker(), loop=self.loop)
+
+ yield from q.join()
+
+ self.loop.run_until_complete(test())
+ self.assertEqual(sum(range(100)), accumulator)
+
+ # close running generators
+ running = False
+ for i in range(2):
+ q.put_nowait(0)
+
+ 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 0000000000..964b2e8ec8
--- /dev/null
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -0,0 +1,1690 @@
+"""Tests for selector_events.py"""
+
+import errno
+import gc
+import pprint
+import socket
+import sys
+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 _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)
+
+
+class BaseSelectorEventLoopTests(unittest.TestCase):
+
+ def setUp(self):
+ selector = mock.Mock()
+ self.loop = TestBaseSelectorEventLoop(selector)
+
+ def test_make_socket_transport(self):
+ m = mock.Mock()
+ self.loop.add_reader = mock.Mock()
+ transport = self.loop._make_socket_transport(m, asyncio.Protocol())
+ self.assertIsInstance(transport, _SelectorSocketTransport)
+
+ @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_writer = mock.Mock()
+ self.loop.remove_reader = mock.Mock()
+ self.loop.remove_writer = mock.Mock()
+ waiter = asyncio.Future(loop=self.loop)
+ transport = self.loop._make_ssl_transport(
+ m, asyncio.Protocol(), m, waiter)
+ self.assertIsInstance(transport, _SelectorSslTransport)
+
+ @mock.patch('asyncio.selector_events.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):
+ 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.loop.close()
+ 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)
+
+ self.loop.close()
+ self.loop.close()
+
+ def test_close_no_selector(self):
+ ssock = self.loop._ssock
+ csock = self.loop._csock
+ remove_reader = self.loop.remove_reader = mock.Mock()
+
+ self.loop._selector.close()
+ self.loop._selector = None
+ self.loop.close()
+ self.assertIsNone(self.loop._selector)
+ self.assertFalse(ssock.close.called)
+ self.assertFalse(csock.close.called)
+ self.assertFalse(remove_reader.called)
+
+ 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
+ self.assertIsNone(self.loop._write_to_self())
+
+ def test_write_to_self_exception(self):
+ self.loop._csock.send.side_effect = OSError()
+ self.assertRaises(OSError, self.loop._write_to_self)
+
+ def test_sock_recv(self):
+ sock = mock.Mock()
+ 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 = mock.Mock()
+ 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 = mock.Mock()
+ 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 = mock.Mock()
+ 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, False, sock, ('127.0.0.1', 8080)),
+ self.loop._sock_connect.call_args[0])
+
+ def test__sock_connect(self):
+ f = asyncio.Future(loop=self.loop)
+
+ sock = mock.Mock()
+ sock.fileno.return_value = 10
+
+ self.loop._sock_connect(f, False, sock, ('127.0.0.1', 8080))
+ self.assertTrue(f.done())
+ self.assertIsNone(f.result())
+ self.assertTrue(sock.connect.called)
+
+ def test__sock_connect_canceled_fut(self):
+ sock = mock.Mock()
+
+ f = asyncio.Future(loop=self.loop)
+ f.cancel()
+
+ self.loop._sock_connect(f, False, sock, ('127.0.0.1', 8080))
+ self.assertFalse(sock.connect.called)
+
+ def test__sock_connect_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_connect(f, True, sock, ('127.0.0.1', 8080))
+ self.assertEqual((10,), self.loop.remove_writer.call_args[0])
+
+ def test__sock_connect_tryagain(self):
+ f = asyncio.Future(loop=self.loop)
+ sock = mock.Mock()
+ sock.fileno.return_value = 10
+ sock.getsockopt.return_value = errno.EAGAIN
+
+ self.loop.add_writer = mock.Mock()
+ self.loop.remove_writer = mock.Mock()
+
+ self.loop._sock_connect(f, True, sock, ('127.0.0.1', 8080))
+ self.assertEqual(
+ (10, self.loop._sock_connect, f,
+ True, sock, ('127.0.0.1', 8080)),
+ self.loop.add_writer.call_args[0])
+
+ def test__sock_connect_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(f, True, sock, ('127.0.0.1', 8080))
+ self.assertIsInstance(f.exception(), OSError)
+
+ def test_sock_accept(self):
+ sock = mock.Mock()
+ 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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+ self.sock = mock.Mock(socket.socket)
+ self.sock.fileno.return_value = 7
+
+ def test_ctor(self):
+ tr = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ self.assertIs(tr._loop, self.loop)
+ self.assertIs(tr._sock, self.sock)
+ self.assertIs(tr._sock_fd, 7)
+
+ def test_abort(self):
+ tr = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ tr._force_close = mock.Mock()
+
+ tr.abort()
+ tr._force_close.assert_called_with(None)
+
+ def test_close(self):
+ tr = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ 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 = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ 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 = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ 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 = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ 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 = _SelectorTransport(self.loop, self.sock, self.protocol, None)
+ 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.assertEqual(2, sys.getrefcount(self.protocol),
+ pprint.pformat(gc.get_referrers(self.protocol)))
+ self.assertIsNone(tr._loop)
+ self.assertEqual(2, sys.getrefcount(self.loop),
+ pprint.pformat(gc.get_referrers(self.loop)))
+
+
+class SelectorSocketTransportTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ 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 test_ctor(self):
+ tr = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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):
+ fut = asyncio.Future(loop=self.loop)
+
+ _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol, fut)
+ test_utils.run_briefly(self.loop)
+ self.assertIsNone(fut.result())
+
+ def test_pause_resume_reading(self):
+ tr = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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)
+
+ def test_read_ready(self):
+ transport = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ transport._force_close = mock.Mock()
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ transport.write(data)
+ self.sock.send.assert_called_with(data)
+
+ def test_write_no_data(self):
+ transport = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ self.assertRaises(TypeError, transport.write, 'str')
+
+ def test_write_closing(self):
+ transport = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ # 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ transport.close()
+ transport._buffer.extend(b'data')
+ transport._write_ready()
+ remove_writer.assert_called_with(self.sock_fd)
+
+ def test_write_eof(self):
+ tr = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorSocketTransport(
+ self.loop, self.sock, self.protocol)
+ 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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ 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 _make_one(self, create_waiter=None):
+ transport = _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext)
+ 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 = _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext,
+ 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.sslsock.do_handshake.side_effect = ssl.SSLWantReadError
+ transport = _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext)
+ transport._on_handshake()
+ self.loop.assert_reader(1, transport._on_handshake)
+
+ def test_on_handshake_writer_retry(self):
+ self.sslsock.do_handshake.side_effect = ssl.SSLWantWriteError
+ transport = _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext)
+ transport._on_handshake()
+ self.loop.assert_writer(1, transport._on_handshake)
+
+ def test_on_handshake_exc(self):
+ exc = ValueError()
+ self.sslsock.do_handshake.side_effect = exc
+ transport = _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext)
+ transport._waiter = asyncio.Future(loop=self.loop)
+ transport._on_handshake()
+ self.assertTrue(self.sslsock.close.called)
+ self.assertTrue(transport._waiter.done())
+ self.assertIs(exc, transport._waiter.exception())
+
+ def test_on_handshake_base_exc(self):
+ transport = _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext)
+ transport._waiter = asyncio.Future(loop=self.loop)
+ exc = BaseException()
+ self.sslsock.do_handshake.side_effect = exc
+ self.assertRaises(BaseException, transport._on_handshake)
+ self.assertTrue(self.sslsock.close.called)
+ self.assertTrue(transport._waiter.done())
+ self.assertIs(exc, transport._waiter.exception())
+
+ 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)
+
+ 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()
+ 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 test_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])
+
+ @unittest.skipIf(ssl is None or not ssl.HAS_SNI, 'No SNI support')
+ def test_server_hostname(self):
+ _SelectorSslTransport(
+ self.loop, self.sock, self.protocol, self.sslcontext,
+ 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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ self.protocol = test_utils.make_test_protocol(asyncio.DatagramProtocol)
+ self.sock = mock.Mock(spec_set=socket.socket)
+ self.sock.fileno.return_value = 7
+
+ def test_read_ready(self):
+ transport = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol, ('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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ self.assertRaises(TypeError, transport.sendto, 'str', ())
+
+ def test_sendto_connected_addr(self):
+ transport = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol, ('0.0.0.0', 1))
+ self.assertRaises(
+ ValueError, transport.sendto, b'str', ('0.0.0.0', 2))
+
+ def test_sendto_closing(self):
+ transport = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol, 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol)
+ 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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol, ('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 = _SelectorDatagramTransport(
+ self.loop, self.sock, self.protocol, ('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_streams.py b/Lib/test/test_asyncio/test_streams.py
new file mode 100644
index 0000000000..031499e814
--- /dev/null
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -0,0 +1,588 @@
+"""Tests for streams.py."""
+
+import gc
+import socket
+import unittest
+from unittest import mock
+try:
+ import ssl
+except ImportError:
+ ssl = None
+
+import asyncio
+from asyncio import test_utils
+
+
+class StreamReaderTests(unittest.TestCase):
+
+ DATA = b'line1\nline2\nline3\n'
+
+ def setUp(self):
+ self.loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ # just in case if we have transport close callbacks
+ test_utils.run_briefly(self.loop)
+
+ self.loop.close()
+ gc.collect()
+
+ @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())
+
+ @asyncio.coroutine
+ def readline():
+ yield from stream.readline()
+
+ 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)
+
+ @asyncio.coroutine
+ def read_a_line():
+ yield from stream.readline()
+
+ t = asyncio.Task(read_a_line(), 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")
+
+
+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 0000000000..14fd17e61a
--- /dev/null
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -0,0 +1,184 @@
+from asyncio import subprocess
+import asyncio
+import signal
+import sys
+import unittest
+from test import support
+if sys.platform != 'win32':
+ from asyncio import unix_events
+
+# Program blocking
+PROGRAM_BLOCKED = [sys.executable, '-c', 'import time; time.sleep(3600)']
+
+# Program sleeping during 1 second
+PROGRAM_SLEEP_1SEC = [sys.executable, '-c', 'import time; time.sleep(1)']
+
+# Program copying input to output
+PROGRAM_CAT = [
+ sys.executable, '-c',
+ ';'.join(('import sys',
+ 'data = sys.stdin.buffer.read()',
+ 'sys.stdout.buffer.write(data)'))]
+
+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, 10.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, 10.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):
+ args = PROGRAM_BLOCKED
+ create = asyncio.create_subprocess_exec(*args, loop=self.loop)
+ proc = self.loop.run_until_complete(create)
+ proc.send_signal(signal.SIGHUP)
+ returncode = self.loop.run_until_complete(proc.wait())
+ self.assertEqual(-signal.SIGHUP, returncode)
+
+ def test_broken_pipe(self):
+ large_data = b'x' * support.PIPE_MAX_SIZE
+
+ create = asyncio.create_subprocess_exec(
+ *PROGRAM_SLEEP_1SEC,
+ stdin=subprocess.PIPE,
+ loop=self.loop)
+ proc = self.loop.run_until_complete(create)
+ with self.assertRaises(BrokenPipeError):
+ self.loop.run_until_complete(proc.communicate(large_data))
+ self.loop.run_until_complete(proc.wait())
+
+
+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()
+
+ # ensure that the event loop is passed explicitly in the code
+ policy.set_event_loop(None)
+
+ watcher = self.Watcher()
+ watcher.attach_loop(self.loop)
+ policy.set_child_watcher(watcher)
+
+ def tearDown(self):
+ policy = asyncio.get_event_loop_policy()
+ policy.set_child_watcher(None)
+ self.loop.close()
+ policy.set_event_loop(None)
+
+ class SubprocessSafeWatcherTests(SubprocessWatcherMixin,
+ unittest.TestCase):
+
+ Watcher = unix_events.SafeChildWatcher
+
+ class SubprocessFastWatcherTests(SubprocessWatcherMixin,
+ unittest.TestCase):
+
+ Watcher = unix_events.FastChildWatcher
+
+else:
+ # Windows
+ class SubprocessProactorTests(SubprocessMixin, unittest.TestCase):
+
+ def setUp(self):
+ policy = asyncio.get_event_loop_policy()
+ self.loop = asyncio.ProactorEventLoop()
+
+ # ensure that the event loop is passed explicitly in the code
+ policy.set_event_loop(None)
+
+ def tearDown(self):
+ policy = asyncio.get_event_loop_policy()
+ self.loop.close()
+ policy.set_event_loop(None)
+
+
+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 0000000000..ced34312f7
--- /dev/null
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -0,0 +1,1677 @@
+"""Tests for tasks.py."""
+
+import gc
+import os.path
+import unittest
+from test.script_helper import assert_python_ok
+
+import asyncio
+from asyncio import test_utils
+
+
+@asyncio.coroutine
+def coroutine_function():
+ pass
+
+
+class Dummy:
+
+ def __repr__(self):
+ return 'Dummy()'
+
+ def __call__(self, *args):
+ pass
+
+
+class TaskTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+ gc.collect()
+
+ 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()
+ t = asyncio.Task(notmuch(), loop=loop)
+ self.assertIs(t._loop, loop)
+ 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()
+ t = asyncio.async(notmuch(), loop=loop)
+ self.assertIs(t._loop, loop)
+ 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()
+
+ 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()
+
+ 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):
+ @asyncio.coroutine
+ def notmuch():
+ yield from []
+ return 'abc'
+
+ t = asyncio.Task(notmuch(), loop=self.loop)
+ t.add_done_callback(Dummy())
+ self.assertEqual(repr(t), 'Task(<notmuch>)<PENDING, [Dummy()]>')
+ t.cancel() # Does not take immediate effect!
+ self.assertEqual(repr(t), 'Task(<notmuch>)<CANCELLING, [Dummy()]>')
+ self.assertRaises(asyncio.CancelledError,
+ self.loop.run_until_complete, t)
+ self.assertEqual(repr(t), 'Task(<notmuch>)<CANCELLED>')
+ t = asyncio.Task(notmuch(), loop=self.loop)
+ self.loop.run_until_complete(t)
+ self.assertEqual(repr(t), "Task(<notmuch>)<result='abc'>")
+
+ def test_task_repr_custom(self):
+ @asyncio.coroutine
+ def coro():
+ pass
+
+ class T(asyncio.Future):
+ def __repr__(self):
+ return 'T[]'
+
+ class MyTask(asyncio.Task, T):
+ def __repr__(self):
+ return super().__repr__()
+
+ gen = coro()
+ t = MyTask(gen, loop=self.loop)
+ self.assertEqual(repr(t), 'T[](<coro>)')
+ gen.close()
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ @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.addCleanup(loop.close)
+
+ @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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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)
+ self.assertRaises(
+ RuntimeError, loop.run_until_complete, t)
+ self.assertFalse(t.done())
+ self.assertEqual(x, 2)
+ self.assertAlmostEqual(0.3, loop.time())
+
+ # close generators
+ for w in waiters:
+ w.close()
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop()
+ self.addCleanup(loop.close)
+
+ @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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ @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(self):
+
+ def gen():
+ when = yield
+ self.assertAlmostEqual(0.1, when)
+ when = yield 0
+ self.assertAlmostEqual(0.15, when)
+ yield 0.15
+
+ loop = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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)
+ try:
+ res = loop.run_until_complete(
+ asyncio.Task(foo(), loop=loop))
+ finally:
+ asyncio.set_event_loop(None)
+
+ 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))
+
+ self.assertRaises(
+ ValueError, self.loop.run_until_complete,
+ asyncio.wait([asyncio.sleep(10.0, loop=self.loop)],
+ return_when=-1, loop=self.loop))
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ # 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ # 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ @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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ t = asyncio.Task(asyncio.sleep(10.0, 'yeah', loop=loop),
+ loop=loop)
+
+ handle = None
+ orig_call_later = loop.call_later
+
+ def call_later(self, delay, callback, *args):
+ nonlocal handle
+ handle = orig_call_later(self, 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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ @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 = test_utils.TestLoop(gen)
+ self.addCleanup(loop.close)
+
+ @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))
+ self.assertRaises(TypeError, self.loop.run_until_complete,
+ asyncio.as_completed(coroutine_function(), loop=self.loop))
+
+ 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))
+ self.assertRaises(TypeError, self.loop.run_until_complete,
+ asyncio.wait(coroutine_function(), loop=self.loop))
+
+ # wait() expects at least a future
+ self.assertRaises(ValueError, self.loop.run_until_complete,
+ asyncio.wait([], loop=self.loop))
+
+class GatherTestsBase:
+
+ def setUp(self):
+ self.one_loop = test_utils.TestLoop()
+ self.other_loop = test_utils.TestLoop()
+
+ def tearDown(self):
+ self.one_loop.close()
+ self.other_loop.close()
+
+ 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):
+ path = os.path.dirname(asyncio.__file__)
+ path = os.path.normpath(os.path.join(path, '..'))
+ code = '\n'.join((
+ 'import sys',
+ 'sys.path.insert(0, %r)' % path,
+ 'import asyncio.tasks',
+ 'print(asyncio.tasks._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')
+
+
+class FutureGatherTests(GatherTestsBase, unittest.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, unittest.TestCase):
+
+ def setUp(self):
+ super().setUp()
+ asyncio.set_event_loop(self.one_loop)
+
+ def tearDown(self):
+ asyncio.set_event_loop(None)
+ super().tearDown()
+
+ 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)
+ gen1.close()
+ gen2.close()
+ gen3 = coro()
+ gen4 = coro()
+ fut = asyncio.gather(gen3, gen4, loop=self.other_loop)
+ self.assertIs(fut._loop, self.other_loop)
+ gen3.close()
+ gen4.close()
+
+ 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 0000000000..cfbdf3e9bc
--- /dev/null
+++ b/Lib/test/test_asyncio/test_transports.py
@@ -0,0 +1,88 @@
+"""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
+
+ transport = MyTransport()
+ 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)
+
+ transport.set_write_buffer_limits(high=256, low=128)
+ self.assertTrue(transport._protocol_paused)
+
+
+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 0000000000..cc74383952
--- /dev/null
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -0,0 +1,1580 @@
+"""Tests for unix_events.py."""
+
+import collections
+import gc
+import errno
+import io
+import os
+import pprint
+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
+
+
+@unittest.skipUnless(signal, 'Signals are not supported')
+class SelectorEventLoopSignalTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = asyncio.SelectorEventLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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(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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = asyncio.SelectorEventLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+
+ 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)
+
+ 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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ self.protocol = test_utils.make_test_protocol(asyncio.Protocol)
+ self.pipe = mock.Mock(spec_set=io.RawIOBase)
+ self.pipe.fileno.return_value = 5
+
+ fcntl_patcher = mock.patch('fcntl.fcntl')
+ fcntl_patcher.start()
+ self.addCleanup(fcntl_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 test_ctor(self):
+ tr = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+ self.loop.assert_reader(5, tr._read_ready)
+ test_utils.run_briefly(self.loop)
+ self.protocol.connection_made.assert_called_with(tr)
+
+ def test_ctor_with_waiter(self):
+ fut = asyncio.Future(loop=self.loop)
+ unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol, fut)
+ test_utils.run_briefly(self.loop)
+ self.assertIsNone(fut.result())
+
+ @mock.patch('os.read')
+ def test__read_ready(self, m_read):
+ tr = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ tr.resume_reading()
+ self.loop.assert_reader(5, tr._read_ready)
+
+ @mock.patch('os.read')
+ def test_close(self, m_read):
+ tr = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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.assertEqual(2, sys.getrefcount(self.protocol),
+ pprint.pformat(gc.get_referrers(self.protocol)))
+ self.assertIsNone(tr._loop)
+ self.assertEqual(4, sys.getrefcount(self.loop),
+ pprint.pformat(gc.get_referrers(self.loop)))
+
+ def test__call_connection_lost_with_err(self):
+ tr = unix_events._UnixReadPipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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.assertEqual(2, sys.getrefcount(self.protocol),
+ pprint.pformat(gc.get_referrers(self.protocol)))
+ self.assertIsNone(tr._loop)
+ self.assertEqual(4, sys.getrefcount(self.loop),
+ pprint.pformat(gc.get_referrers(self.loop)))
+
+
+class UnixWritePipeTransportTests(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = test_utils.TestLoop()
+ self.protocol = test_utils.make_test_protocol(asyncio.BaseProtocol)
+ self.pipe = mock.Mock(spec_set=io.RawIOBase)
+ self.pipe.fileno.return_value = 5
+
+ fcntl_patcher = mock.patch('fcntl.fcntl')
+ fcntl_patcher.start()
+ self.addCleanup(fcntl_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 test_ctor(self):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+ self.loop.assert_reader(5, tr._read_ready)
+ test_utils.run_briefly(self.loop)
+ self.protocol.connection_made.assert_called_with(tr)
+
+ def test_ctor_with_waiter(self):
+ fut = asyncio.Future(loop=self.loop)
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol, fut)
+ self.loop.assert_reader(5, tr._read_ready)
+ test_utils.run_briefly(self.loop)
+ self.assertEqual(None, fut.result())
+
+ def test_can_write_eof(self):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+ self.assertTrue(tr.can_write_eof())
+
+ @mock.patch('os.write')
+ def test_write(self, m_write):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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.')
+
+ @mock.patch('os.write')
+ def test_write_close(self, m_write):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = unix_events._UnixWritePipeTransport(self.loop, self.pipe,
+ self.protocol)
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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.assertEqual(2, sys.getrefcount(self.protocol),
+ pprint.pformat(gc.get_referrers(self.protocol)))
+ self.assertIsNone(tr._loop)
+ self.assertEqual(4, sys.getrefcount(self.loop),
+ pprint.pformat(gc.get_referrers(self.loop)))
+
+ def test__call_connection_lost_with_err(self):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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.assertEqual(2, sys.getrefcount(self.protocol),
+ pprint.pformat(gc.get_referrers(self.protocol)))
+ self.assertIsNone(tr._loop)
+ self.assertEqual(4, sys.getrefcount(self.loop),
+ pprint.pformat(gc.get_referrers(self.loop)))
+
+ def test_close(self):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ tr.write_eof = mock.Mock()
+ tr.close()
+ tr.write_eof.assert_called_with()
+
+ def test_close_closing(self):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ tr.write_eof = mock.Mock()
+ tr._closing = True
+ tr.close()
+ self.assertFalse(tr.write_eof.called)
+
+ def test_write_eof(self):
+ tr = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+
+ 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 = unix_events._UnixWritePipeTransport(
+ self.loop, self.pipe, self.protocol)
+ 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 = test_utils.TestLoop()
+ 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()
+
+ callback.assert_called(m.waitpid)
+ 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 = test_utils.TestLoop()
+ 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 = test_utils.TestLoop()
+
+ 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, unittest.TestCase):
+ def create_watcher(self):
+ return asyncio.SafeChildWatcher()
+
+
+class FastChildWatcherTests (ChildWatcherTestsMixin, unittest.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 0000000000..f652258639
--- /dev/null
+++ b/Lib/test/test_asyncio/test_windows_events.py
@@ -0,0 +1,134 @@
+import os
+import sys
+import unittest
+
+if sys.platform != 'win32':
+ raise unittest.SkipTest('Windows only')
+
+import _winapi
+
+import asyncio
+from asyncio import _overlapped
+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(unittest.TestCase):
+
+ def setUp(self):
+ self.loop = asyncio.ProactorEventLoop()
+ asyncio.set_event_loop(None)
+
+ def tearDown(self):
+ self.loop.close()
+ self.loop = None
+
+ 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)
+ 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_wait_for_handle(self):
+ event = _overlapped.CreateEvent(None, True, False, None)
+ self.addCleanup(_winapi.CloseHandle, event)
+
+ # Wait for unset event with 0.2s timeout;
+ # result should be False at timeout
+ f = self.loop._proactor.wait_for_handle(event, 0.2)
+ start = self.loop.time()
+ self.loop.run_until_complete(f)
+ elapsed = self.loop.time() - start
+ self.assertFalse(f.result())
+ self.assertTrue(0.18 < elapsed < 0.9, elapsed)
+
+ _overlapped.SetEvent(event)
+
+ # Wait for for set event;
+ # result should be True immediately
+ f = self.loop._proactor.wait_for_handle(event, 10)
+ start = self.loop.time()
+ self.loop.run_until_complete(f)
+ elapsed = self.loop.time() - start
+ self.assertTrue(f.result())
+ self.assertTrue(0 <= elapsed < 0.1, elapsed)
+
+ _overlapped.ResetEvent(event)
+
+ # Wait for unset event with a cancelled future;
+ # CancelledError should be raised immediately
+ f = self.loop._proactor.wait_for_handle(event, 10)
+ f.cancel()
+ start = self.loop.time()
+ with self.assertRaises(asyncio.CancelledError):
+ self.loop.run_until_complete(f)
+ elapsed = self.loop.time() - start
+ self.assertTrue(0 <= elapsed < 0.1, elapsed)
+
+
+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 0000000000..9daf4340a4
--- /dev/null
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -0,0 +1,160 @@
+"""Tests for window_utils"""
+
+import socket
+import sys
+import test.support
+import unittest
+from test.support import IPV6_ENABLED
+from unittest import mock
+
+if sys.platform != 'win32':
+ raise unittest.SkipTest('Windows only')
+
+import _winapi
+
+from asyncio import windows_utils
+from asyncio import _overlapped
+
+
+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(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)
+
+ @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)
+
+
+
+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
+ del p
+ test.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))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/Lib/test/test_asyncio/tests.txt b/Lib/test/test_asyncio/tests.txt
new file mode 100644
index 0000000000..c69582bc86
--- /dev/null
+++ b/Lib/test/test_asyncio/tests.txt
@@ -0,0 +1,14 @@
+test_asyncio.test_base_events
+test_asyncio.test_events
+test_asyncio.test_futures
+test_asyncio.test_locks
+test_asyncio.test_proactor_events
+test_asyncio.test_queues
+test_asyncio.test_selector_events
+test_asyncio.test_streams
+test_asyncio.test_subprocess
+test_asyncio.test_tasks
+test_asyncio.test_transports
+test_asyncio.test_unix_events
+test_asyncio.test_windows_events
+test_asyncio.test_windows_utils
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 5d0632ef26..084d247295 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -19,6 +19,7 @@ try:
except ImportError:
threading = None
+TIMEOUT = 3
HAS_UNIX_SOCKETS = hasattr(socket, 'AF_UNIX')
class dummysocket:
@@ -395,7 +396,10 @@ class DispatcherWithSendTests(unittest.TestCase):
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):
@@ -740,7 +744,12 @@ class BaseTestAPI:
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 +763,7 @@ class BaseTestAPI:
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 +771,7 @@ class BaseTestAPI:
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 +796,11 @@ class BaseTestAPI:
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,7 +808,7 @@ class BaseTestAPI:
struct.pack('ii', 1, 0))
try:
s.connect(server.address)
- except socket.error:
+ except OSError:
pass
finally:
s.close()
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 30c3b4a07b..70d2f1cf54 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -23,7 +23,9 @@ def raise1():
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 @@ class TestCase(unittest.TestCase):
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 a92cf874bd..879adea2b8 100644
--- a/Lib/test/test_audioop.py
+++ b/Lib/test/test_audioop.py
@@ -5,13 +5,18 @@ import unittest
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 @@ datas = {
INVALID_DATA = [
(b'abc', 0),
(b'abc', 2),
+ (b'ab', 3),
(b'abc', 4),
]
@@ -26,8 +32,10 @@ INVALID_DATA = [
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
(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 @@ class TestAudioop(unittest.TestCase):
-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 @@ class TestAudioop(unittest.TestCase):
-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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
-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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 @@ class TestAudioop(unittest.TestCase):
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 13695de67e..b9738ddaf5 100644
--- a/Lib/test/test_base64.py
+++ b/Lib/test/test_base64.py
@@ -5,10 +5,21 @@ import binascii
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 @@ class LegacyBase64TestCase(unittest.TestCase):
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 @@ class LegacyBase64TestCase(unittest.TestCase):
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 LegacyBase64TestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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 @@ class BaseXYTestCase(unittest.TestCase):
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_bisect.py b/Lib/test/test_bisect.py
index 7b9bd19fcb..580a963f62 100644
--- a/Lib/test/test_bisect.py
+++ b/Lib/test/test_bisect.py
@@ -7,7 +7,7 @@ py_bisect = support.import_fresh_module('bisect', blocked=['_bisect'])
c_bisect = support.import_fresh_module('bisect', fresh=['_bisect'])
class Range(object):
- """A trivial range()-like object without any integer width limitations."""
+ """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 @@ class TestBisect:
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_buffer.py b/Lib/test/test_buffer.py
index 04e3f61e89..1667847a9d 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -4290,9 +4290,5 @@ class TestBufferProtocol(unittest.TestCase):
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 c342a4329f..b561a6f73a 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -16,6 +16,7 @@ import unittest
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:
@@ -464,6 +465,11 @@ class BuiltinTest(unittest.TestCase):
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 @@ class BuiltinTest(unittest.TestCase):
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})
@@ -839,8 +848,19 @@ class BuiltinTest(unittest.TestCase):
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 +877,13 @@ class BuiltinTest(unittest.TestCase):
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 +910,9 @@ class BuiltinTest(unittest.TestCase):
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 +929,13 @@ class BuiltinTest(unittest.TestCase):
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 +977,25 @@ class BuiltinTest(unittest.TestCase):
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 +1010,17 @@ class BuiltinTest(unittest.TestCase):
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 +1131,6 @@ class BuiltinTest(unittest.TestCase):
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):
@@ -1476,17 +1510,11 @@ class BuiltinTest(unittest.TestCase):
# --------------------------------------------------------------------
# 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 +1593,45 @@ class TestSorted(unittest.TestCase):
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)
-
- # 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)
+class ShutdownTest(unittest.TestCase):
+
+ 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 3c09141184..f350211f71 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -288,8 +288,22 @@ class BaseBytesTest:
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)
+ # 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')
@@ -765,7 +779,7 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
finally:
try:
os.remove(tfn)
- except os.error:
+ except OSError:
pass
def test_reverse(self):
@@ -901,6 +915,15 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase):
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 +1303,11 @@ class BytearrayPEP3137Test(unittest.TestCase,
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 c8c93513d8..40d8425eee 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 pickle
import random
import subprocess
import sys
+from test.support import unlink
try:
import threading
@@ -18,10 +19,10 @@ except ImportError:
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 @@ class BaseTest(unittest.TestCase):
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 @@ class BaseTest(unittest.TestCase):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
# 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 @@ class BZ2FileTest(BaseTest):
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 @@ class BZ2FileTest(BaseTest):
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()
@@ -740,97 +747,122 @@ class CompressDecompressTest(BaseTest):
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 50c4bba24f..ba7c38db27 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -9,6 +9,7 @@ import sys
import time
import unittest
from test import support
+from test.support import MISSING_C_DOCSTRINGS
try:
import _posixsubprocess
except ImportError:
@@ -44,7 +45,7 @@ class CAPITest(unittest.TestCase):
@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 @@ class CAPITest(unittest.TestCase):
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 @@ class TestPendingCalls(unittest.TestCase):
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 @@ class TestPendingCalls(unittest.TestCase):
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 @@ class Test_testcapi(unittest.TestCase):
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_line.py b/Lib/test/test_cmd_line.py
index a89d7e4f10..327c1455fc 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 @@ class CmdLineTest(unittest.TestCase):
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 @@ class CmdLineTest(unittest.TestCase):
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 @@ class CmdLineTest(unittest.TestCase):
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 @@ class CmdLineTest(unittest.TestCase):
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 @@ class CmdLineTest(unittest.TestCase):
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 @@ class CmdLineTest(unittest.TestCase):
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 b4269b994e..1e6746d434 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -41,11 +41,28 @@ from importlib.machinery import BuiltinImporter
_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 +140,7 @@ class CmdLineTest(unittest.TestCase):
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)
@@ -294,7 +311,7 @@ class CmdLineTest(unittest.TestCase):
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 +328,8 @@ class CmdLineTest(unittest.TestCase):
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 +343,8 @@ class CmdLineTest(unittest.TestCase):
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 +405,24 @@ class CmdLineTest(unittest.TestCase):
'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 adef1701d4..5fd21dc32c 100644
--- a/Lib/test/test_code_module.py
+++ b/Lib/test/test_code_module.py
@@ -64,6 +64,20 @@ class TestInteractiveConsole(unittest.TestCase):
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 fd88505081..84804bb0da 100644
--- a/Lib/test/test_codeccallbacks.py
+++ b/Lib/test/test_codeccallbacks.py
@@ -875,8 +875,6 @@ class CodecCallbackTest(unittest.TestCase):
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_codecs.py b/Lib/test/test_codecs.py
index a8b3da0f37..9b62d5b12f 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 @@ class ReadTest(MixInCheckStateHandling):
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 UTF32Test(ReadTest, unittest.TestCase):
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 UTF32LETest(ReadTest, unittest.TestCase):
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 UTF32BETest(ReadTest, unittest.TestCase):
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 @@ class UTF16Test(ReadTest, unittest.TestCase):
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 UTF16LETest(ReadTest, unittest.TestCase):
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 UTF16BETest(ReadTest, unittest.TestCase):
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 @@ class UTF8Test(ReadTest, unittest.TestCase):
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 @@ class UTF7Test(ReadTest, unittest.TestCase):
(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 @@ class ReadBufferTest(unittest.TestCase):
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):
@@ -1628,6 +1676,7 @@ all_unicode_encodings = [
"cp037",
"cp1006",
"cp1026",
+ "cp1125",
"cp1140",
"cp1250",
"cp1251",
@@ -2370,60 +2419,93 @@ bytes_transform_encodings = [
"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 +2514,224 @@ class TransformCodecTest(unittest.TestCase):
# 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)
+
+
+# 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
+
+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)
+
+ 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 +2743,8 @@ class CodePageTest(unittest.TestCase):
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 bdbb51f49a..0000000000
--- 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 ff52755354..ee28a6c0b3 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -112,6 +112,38 @@ class TestChainMap(unittest.TestCase):
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 +301,7 @@ class TestNamedTuple(unittest.TestCase):
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)
@@ -750,6 +782,8 @@ class TestCollectionABCs(ABCTestCase):
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__')
@@ -904,23 +938,26 @@ class TestCounter(unittest.TestCase):
words = Counter('which witch had which witches wrist watch'.split())
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))
+ for label, dup in [
+ ('words.copy()', words.copy()),
+ ('copy.copy(words)', copy.copy(words)),
+ ('copy.deepcopy(words)', copy.deepcopy(words)),
+ ('pickle.loads(pickle.dumps(words, 0))',
+ pickle.loads(pickle.dumps(words, 0))),
+ ('pickle.loads(pickle.dumps(words, 1))',
+ pickle.loads(pickle.dumps(words, 1))),
+ ('pickle.loads(pickle.dumps(words, 2))',
+ pickle.loads(pickle.dumps(words, 2))),
+ ('pickle.loads(pickle.dumps(words, -1))',
+ pickle.loads(pickle.dumps(words, -1))),
+ ('eval(repr(words))', eval(repr(words))),
+ ('update_test', update_test),
+ ('Counter(words)', Counter(words)),
+ ]:
+ with self.subTest(label=label):
+ msg = "\ncopy: %s\nwords: %s" % (dup, words)
+ self.assertIsNot(dup, words, msg)
+ self.assertEqual(dup, words)
def test_copy_subclass(self):
class MyCounter(Counter):
@@ -1043,8 +1080,10 @@ class TestCounter(unittest.TestCase):
# 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 })
################################################################################
@@ -1205,24 +1244,28 @@ class TestOrderedDict(unittest.TestCase):
od = OrderedDict(pairs)
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))
+ for label, dup in [
+ ('od.copy()', od.copy()),
+ ('copy.copy(od)', copy.copy(od)),
+ ('copy.deepcopy(od)', copy.deepcopy(od)),
+ ('pickle.loads(pickle.dumps(od, 0))',
+ pickle.loads(pickle.dumps(od, 0))),
+ ('pickle.loads(pickle.dumps(od, 1))',
+ pickle.loads(pickle.dumps(od, 1))),
+ ('pickle.loads(pickle.dumps(od, 2))',
+ pickle.loads(pickle.dumps(od, 2))),
+ ('pickle.loads(pickle.dumps(od, 3))',
+ pickle.loads(pickle.dumps(od, 3))),
+ ('pickle.loads(pickle.dumps(od, -1))',
+ pickle.loads(pickle.dumps(od, -1))),
+ ('eval(repr(od))', eval(repr(od))),
+ ('update_test', update_test),
+ ('OrderedDict(od)', OrderedDict(od)),
+ ]:
+ with self.subTest(label=label):
+ msg = "\ncopy: %s\nod: %s" % (dup, od)
+ self.assertIsNot(dup, od, msg)
+ self.assertEqual(dup, od)
def test_yaml_linkage(self):
# Verify that __reduce__ is setup in a way that supports PyYAML's dump() feature.
@@ -1237,9 +1280,18 @@ class TestOrderedDict(unittest.TestCase):
# 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 e405b8a4d0..a24e3adcb4 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 @@ class ColorsysTest(unittest.TestCase):
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_compileall.py b/Lib/test/test_compileall.py
index 0505c521d1..2a42238755 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 @@ class CompileallTests(unittest.TestCase):
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 @@ class CompileallTests(unittest.TestCase):
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 @@ class CompileallTests(unittest.TestCase):
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 @@ class CompileallTests(unittest.TestCase):
# 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 @@ class CommandLineTests(unittest.TestCase):
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 @@ class CommandLineTests(unittest.TestCase):
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 @@ class CommandLineTests(unittest.TestCase):
['-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 @@ class CommandLineTests(unittest.TestCase):
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 @@ class CommandLineTests(unittest.TestCase):
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 @@ class CommandLineTests(unittest.TestCase):
'-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 @@ class CommandLineTests(unittest.TestCase):
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 1bf409798b..cd55375bdb 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -220,6 +220,8 @@ class ComplexTest(unittest.TestCase):
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 +303,7 @@ class ComplexTest(unittest.TestCase):
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 04c4c3717e..c74b2ca6ed 100644
--- a/Lib/test/test_concurrent_futures.py
+++ b/Lib/test/test_concurrent_futures.py
@@ -15,6 +15,7 @@ import sys
import threading
import time
import unittest
+import weakref
from concurrent import futures
from concurrent.futures._base import (
@@ -52,6 +53,11 @@ def sleep_and_print(t, msg):
sys.stdout.flush()
+class MyObject(object):
+ def my_method(self):
+ pass
+
+
class ExecutorMixin:
worker_count = 5
@@ -403,6 +409,22 @@ class ExecutorTest:
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_contextlib.py b/Lib/test/test_contextlib.py
index e38d043a5b..39cc776dbc 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 @@ class ContextManagerTestCase(unittest.TestCase):
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 LockContextTestCase(unittest.TestCase):
class mycontext(ContextDecorator):
+ """Example decoration-compatible context manager for testing"""
started = False
exc = None
catch = False
@@ -219,6 +231,13 @@ class mycontext(ContextDecorator):
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 TestContextDecorator(unittest.TestCase):
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 @@ class TestExitStack(unittest.TestCase):
stack.push(cm)
self.assertIs(stack._exit_callbacks[-1], cm)
+class TestRedirectStdout(unittest.TestCase):
+
+ @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
-# This is needed to make the test actually run under regrtest.py!
-def test_main():
- support.run_unittest(__name__)
+ 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 56766682b3..ce5d27edd6 100644
--- a/Lib/test/test_cprofile.py
+++ b/Lib/test/test_cprofile.py
@@ -6,9 +6,11 @@ from test.support import run_unittest, TESTFN, unlink
# 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 @@ class CProfileTest(ProfileTest):
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 cfb7341e20..624d702f99 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 83f8cb3cb7..7e2485f954 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -136,12 +136,12 @@ class Test_Csv(unittest.TestCase):
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 @@ class Test_Csv(unittest.TestCase):
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 @@ class Test_Csv(unittest.TestCase):
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 @@ class TestDialectValidity(unittest.TestCase):
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_curses.py b/Lib/test/test_curses.py
index 7310afc995..ce8f254bbb 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -115,8 +115,8 @@ def window_funcs(stdscr):
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)
+ 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)
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
index d11d924b30..623d9929d5 100644
--- a/Lib/test/test_dbm.py
+++ b/Lib/test/test_dbm.py
@@ -61,7 +61,7 @@ class AnyDBMTestCase:
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 4f03ae7e58..7601e64638 100644
--- a/Lib/test/test_dbm_dumb.py
+++ b/Lib/test/test_dbm_dumb.py
@@ -183,6 +183,19 @@ class DumbDBMTestCase(unittest.TestCase):
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"])
+
+ # This currently just raises AttributeError rather than a specific
+ # exception like the GNU or NDBM based implementations. See
+ # http://bugs.python.org/issue19385 for details.
+ with self.assertRaises(Exception):
+ db.keys()
+
def tearDown(self):
_delete_files()
diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py
index 4fb66c54b8..a7808f51c7 100644
--- a/Lib/test/test_dbm_gnu.py
+++ b/Lib/test/test_dbm_gnu.py
@@ -81,6 +81,17 @@ class TestGdbm(unittest.TestCase):
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 b57e1f0653..2291561def 100644
--- a/Lib/test/test_dbm_ndbm.py
+++ b/Lib/test/test_dbm_ndbm.py
@@ -37,5 +37,18 @@ class DbmTestCase(unittest.TestCase):
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_deque.py b/Lib/test/test_deque.py
index a8487d2d95..7bff1d2798 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -543,8 +543,8 @@ class TestBasic(unittest.TestCase):
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):
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 1a891a8063..2a9e329633 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
@@ -1797,6 +1800,7 @@ order (MRO) for bases """
("__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 @@ order (MRO) for bases """
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 @@ order (MRO) for bases """
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 @@ order (MRO) for bases """
# 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 @@ order (MRO) for bases """
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)
@@ -4691,11 +4524,453 @@ class MiscTests(unittest.TestCase):
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)
+
+
def test_main():
# Run all local test cases, with PTypesLongInitTest first.
support.run_unittest(PTypesLongInitTest, OperatorsTest,
ClassPropertiesAndMethods, DictProxyTests,
- MiscTests)
+ MiscTests, PicklingTests)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_devpoll.py b/Lib/test/test_devpoll.py
index 9129ac0cb1..e634d3a373 100644
--- a/Lib/test/test_devpoll.py
+++ b/Lib/test/test_devpoll.py
@@ -2,13 +2,17 @@
# 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")
+ raise unittest.SkipTest("select.devpoll not defined")
def find_ready_matching(ready, flag):
@@ -87,6 +91,35 @@ class DevPollTests(unittest.TestCase):
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_dis.py b/Lib/test/test_dis.py
index b86cc86856..d1229fba6d 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 @@ dis_c_instance_method = """\
""" % (_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 = """\
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 @@ def bug1333982(x=[]):
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 @@ dis_bug1333982 = """\
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__,
@@ -171,38 +189,69 @@ dis_compound_stmt_str = """\
25 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 +339,35 @@ class DisTests(unittest.TestCase):
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 +431,7 @@ Free variables:
code_info_expr_str = """\
Name: <module>
-Filename: <code_info>
+Filename: <disassembly>
Argument count: 0
Kw-only arguments: 0
Number of locals: 0
@@ -395,7 +444,7 @@ Names:
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 +458,7 @@ Names:
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 +492,9 @@ class CodeInfoTests(unittest.TestCase):
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 +503,330 @@ class CodeInfoTests(unittest.TestCase):
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 86259c3c56..56193e87b1 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -409,7 +409,8 @@ Compare `DocTestCase`:
"""
-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 @@ DocTestFinder finds the line number of each example:
[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 @@ However, output from `report_start` is not suppressed:
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 @@ count as failures:
...
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.
@@ -2580,6 +2657,240 @@ Check doctest with a non-ascii filename:
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_dynamicclassattribute.py b/Lib/test/test_dynamicclassattribute.py
new file mode 100644
index 0000000000..079d6c3224
--- /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 f206ace10c..d8896eed46 100644
--- a/Lib/test/test_email/__init__.py
+++ b/Lib/test/test_email/__init__.py
@@ -2,6 +2,7 @@ import os
import sys
import unittest
import test.support
+import collections
import email
from email.message import Message
from email._policybase import compat32
@@ -42,6 +43,8 @@ class TestEmailBase(unittest.TestCase):
# 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 +57,23 @@ class TestEmailBase(unittest.TestCase):
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 +138,7 @@ def parameterize(cls):
"""
paramdicts = {}
+ testers = collections.defaultdict(list)
for name, attr in cls.__dict__.items():
if name.endswith('_params'):
if not hasattr(attr, 'keys'):
@@ -134,7 +150,15 @@ def parameterize(cls):
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/test_contentmanager.py b/Lib/test/test_email/test_contentmanager.py
new file mode 100644
index 0000000000..cdb04e45ed
--- /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 51fe756df7..2f89a10e0a 100644
--- a/Lib/test/test_email/test_email.py
+++ b/Lib/test/test_email/test_email.py
@@ -124,6 +124,14 @@ class TestMessageAPI(TestEmailBase):
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 +289,42 @@ class TestMessageAPI(TestEmailBase):
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 +777,15 @@ class TestEncoders(unittest.TestCase):
# 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')
diff --git a/Lib/test/test_email/test_headerregistry.py b/Lib/test/test_email/test_headerregistry.py
index adaf3e8fe4..7d64a3829c 100644
--- a/Lib/test/test_email/test_headerregistry.py
+++ b/Lib/test/test_email/test_headerregistry.py
@@ -661,7 +661,7 @@ class TestContentTypeHeader(TestHeaderBase):
'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 +669,18 @@ class TestContentTypeHeader(TestHeaderBase):
[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 8cc3f80e46..c761c62d04 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,753 @@ class Test(TestEmailBase):
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)
+ m['Content-Disposition'] = 'inline'
+ self.assertFalse(m.is_attachment)
+ m.replace_header('Content-Disposition', 'attachment')
+ self.assertTrue(m.is_attachment)
+ m.replace_header('Content-Disposition', 'AtTachMent')
+ 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_policy.py b/Lib/test/test_email/test_policy.py
index 983bd49a11..e797f36b72 100644
--- a/Lib/test/test_email/test_policy.py
+++ b/Lib/test/test_email/test_policy.py
@@ -30,6 +30,7 @@ class PolicyAPITests(unittest.TestCase):
'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 @@ class TestPolicyPropagation(unittest.TestCase):
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 544b1bbb39..19cf64f0c7 100644
--- a/Lib/test/test_email/torture_test.py
+++ b/Lib/test/test_email/torture_test.py
@@ -27,7 +27,7 @@ def openfile(filename):
# 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 0000000000..70b41538a3
--- /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.run_pip.assert_not_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.run_pip.assert_not_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.run_pip.assert_not_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.run_pip.assert_not_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.run_pip.assert_not_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.run_pip.assert_not_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.run_pip.assert_not_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.run_pip.assert_not_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 0000000000..b8ef632a0d
--- /dev/null
+++ b/Lib/test/test_enum.py
@@ -0,0 +1,1594 @@
+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_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()
+ if result != expected_text:
+ print_diffs(expected_text, result)
+ self.fail("outputs are not equal, see diff above")
+
+ 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 4af217b733..8742afcea8 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
@@ -168,15 +169,12 @@ class TestReversed(unittest.TestCase, PickleTest):
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 +185,7 @@ class TestReversed(unittest.TestCase, PickleTest):
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 871efb2d31..0c88cc424c 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 @@ if not hasattr(select, "epoll"):
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 @@ class TestEPoll(unittest.TestCase):
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 @@ class TestEPoll(unittest.TestCase):
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 @@ class TestEPoll(unittest.TestCase):
# 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 @@ class TestEPoll(unittest.TestCase):
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")
@@ -217,6 +225,35 @@ class TestEPoll(unittest.TestCase):
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 8d11d90abb..62a2e324b1 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -8,8 +8,8 @@ import weakref
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 @@ class ExceptionTests(unittest.TestCase):
{'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 @@ class ExceptionTests(unittest.TestCase):
self.assertIsNone(e.__context__)
self.assertIsNone(e.__cause__)
- class MyException(EnvironmentError):
+ class MyException(OSError):
pass
e = MyException()
@@ -968,8 +968,5 @@ class ImportErrorTests(unittest.TestCase):
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 770e70c77d..ebd99edc8f 100644
--- a/Lib/test/test_faulthandler.py
+++ b/Lib/test/test_faulthandler.py
@@ -19,18 +19,6 @@ except ImportError:
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 +47,8 @@ class FaultHandlerTests(unittest.TestCase):
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)
+ with support.SuppressCrashReport():
+ process = script_helper.spawn_python('-c', code)
stdout, stderr = process.communicate()
exitcode = process.wait()
output = support.strip_python_stderr(stdout)
@@ -86,9 +72,9 @@ class FaultHandlerTests(unittest.TestCase):
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}
@@ -101,8 +87,7 @@ class FaultHandlerTests(unittest.TestCase):
header=re.escape(header))
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)
@@ -232,8 +217,7 @@ faulthandler.disable()
faulthandler._sigsegv()
""".strip()
not_expected = 'Fatal Python error'
- with support.suppress_crash_popup():
- stderr, exitcode = self.get_output(code)
+ stderr, exitcode = self.get_output(code)
stder = '\n'.join(stderr)
self.assertTrue(not_expected not in stderr,
"%r is present in %r" % (not_expected, stderr))
@@ -264,16 +248,34 @@ faulthandler._sigsegv()
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 = (sys.executable, '-E', '-c', code)
+ # don't use assert_python_ok() because it always enable faulthandler
+ output = subprocess.check_output(args)
+ 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 = (sys.executable, "-E", "-X", "faulthandler", "-c", code)
+ # don't use assert_python_ok() because it always enable faulthandler
+ output = subprocess.check_output(args)
+ 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 enable 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):
"""
@@ -304,7 +306,7 @@ funcA()
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>'
@@ -336,7 +338,7 @@ def {func_name}():
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>'
]
@@ -390,13 +392,13 @@ waiter.join()
else:
lineno = 10
regex = """
-^Thread 0x[0-9a-f]+:
+^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:
+Current thread XXX \(most recent call first\):
File "<string>", line {lineno} in dump
File "<string>", line 28 in <module>$
""".strip()
@@ -459,7 +461,7 @@ if file is not None:
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:
@@ -561,9 +563,9 @@ sys.exit(exitcode)
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:
@@ -590,8 +592,5 @@ sys.exit(exitcode)
self.check_register(chain=True)
-def test_main():
- support.run_unittest(FaultHandlerTests)
-
if __name__ == "__main__":
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 1810c4e95e..e3b7ed20a0 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 @@ def get_lockdata():
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 @@ class TestFcntl(unittest.TestCase):
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 @@ class TestFcntl(unittest.TestCase):
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 76b1694e98..d54e976143 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -87,7 +87,7 @@ class AutoFileTests:
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 @@ class AutoFileTests:
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 @@ class OtherFileTests:
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 09599794ad..c7cb3fcf36 100644
--- a/Lib/test/test_filecmp.py
+++ b/Lib/test/test_filecmp.py
@@ -1,4 +1,3 @@
-
import os, filecmp, shutil, tempfile
import unittest
from test import support
@@ -40,15 +39,27 @@ class FileCompareTestCase(unittest.TestCase):
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:
@@ -64,9 +75,11 @@ class DirCompareTestCase(unittest.TestCase):
output.close()
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']) ==
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index b9523cc333..eba55c99a4 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -22,7 +22,7 @@ except ImportError:
from io import 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
@@ -224,8 +224,10 @@ class FileInputTests(unittest.TestCase):
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)
@@ -296,8 +298,8 @@ class FileInputTests(unittest.TestCase):
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 +871,13 @@ class Test_hook_encoded(unittest.TestCase):
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 444be91920..c37482ed70 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -144,16 +144,16 @@ class AutoFileTests(unittest.TestCase):
# 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 @@ class AutoFileTests(unittest.TestCase):
finally:
try:
self.f.close()
- except IOError:
+ except OSError:
pass
return wrapper
@@ -183,14 +183,14 @@ class AutoFileTests(unittest.TestCase):
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 @@ class AutoFileTests(unittest.TestCase):
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 @@ class OtherFileTests(unittest.TestCase):
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 @@ class OtherFileTests(unittest.TestCase):
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 0000000000..03ac1aa274
--- /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 96d907a671..e1e1f0423e 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -41,6 +41,7 @@ class GeneralFloatCases(unittest.TestCase):
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 8192c38a44..e0626dffdc 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 ea5a731d98..fc71e4818e 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -142,7 +142,8 @@ class FormatTest(unittest.TestCase):
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 @@ class FormatTest(unittest.TestCase):
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 @@ class FormatTest(unittest.TestCase):
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 @@ class FormatTest(unittest.TestCase):
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 @@ class FormatTest(unittest.TestCase):
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)
+ 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)
-def test_main():
- support.run_unittest(FormatTest)
+ self.assertIs(text % (), text)
+ self.assertIs(text.format(), text)
def test_precision(self):
f = 1.2
@@ -318,14 +338,12 @@ def test_main():
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 1fad9215c0..33365322b9 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -146,9 +146,10 @@ class FractionTest(unittest.TestCase):
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 @@ class FractionTest(unittest.TestCase):
_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 @@ class FractionTest(unittest.TestCase):
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 @@ class FractionTest(unittest.TestCase):
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 0000000000..2dd5780c88
--- /dev/null
+++ b/Lib/test/test_frame.py
@@ -0,0 +1,116 @@
+import gc
+import sys
+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())
+
+
+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 fd6761c651..0000000000
--- 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 6c95c491ff..a9bf30b3d5 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -15,12 +15,16 @@ try:
import ssl
except ImportError:
ssl = None
+ HAS_SNI = False
+else:
+ from ssl import HAS_SNI
from unittest import TestCase, skipUnless
from test import support
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 +130,7 @@ class DummyFTPHandler(asynchat.async_chat):
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 +138,7 @@ class DummyFTPHandler(asynchat.async_chat):
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 +148,7 @@ class DummyFTPHandler(asynchat.async_chat):
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 +156,7 @@ class DummyFTPHandler(asynchat.async_chat):
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 +304,8 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
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 +332,7 @@ if ssl is not None:
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 +346,7 @@ if ssl is not None:
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 +465,7 @@ class TestFTPClass(TestCase):
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 +493,7 @@ class TestFTPClass(TestCase):
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 +683,7 @@ class TestFTPClass(TestCase):
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 +696,12 @@ class TestFTPClass(TestCase):
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 +709,7 @@ class TestFTPClass(TestCase):
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 +719,7 @@ class TestFTPClass(TestCase):
# 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 +741,7 @@ class TestFTPClass(TestCase):
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 +752,7 @@ class TestFTPClass(TestCase):
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 +790,7 @@ class TestIPv6Environment(TestCase):
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 +807,7 @@ class TestIPv6Environment(TestCase):
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 +834,7 @@ class TestTLS_FTPClassMixin(TestFTPClass):
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 +848,7 @@ class TestTLS_FTPClass(TestCase):
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):
@@ -903,7 +908,7 @@ class TestTLS_FTPClass(TestCase):
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 +927,37 @@ class TestTLS_FTPClass(TestCase):
self.client.ccc()
self.assertRaises(ValueError, self.client.sock.unwrap)
+ @skipUnless(HAS_SNI, 'No SNI support in ssl module')
+ 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 +1053,19 @@ class TestTimeouts(TestCase):
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 c8ed83020e..5094f7ba1f 100644
--- a/Lib/test/test_funcattrs.py
+++ b/Lib/test/test_funcattrs.py
@@ -7,6 +7,11 @@ def global_function():
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 @@ class FunctionPropertiesTest(FuncAttrsTest):
'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 d1ce2a9c8e..75ae7f3a15 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1,66 +1,52 @@
-import functools
+import abc
import collections
+from itertools import permutations
+import pickle
+from random import choice
import sys
-import unittest
from test import support
+import unittest
from weakref import proxy
-import pickle
-from random import choice
-@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 @@ class TestPartial(unittest.TestCase):
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 @@ class TestPartial(unittest.TestCase):
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 @@ class TestPartial(unittest.TestCase):
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 @@ class TestPartial(unittest.TestCase):
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 @@ class TestPartial(unittest.TestCase):
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,39 +126,61 @@ class TestPartial(unittest.TestCase):
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))
@@ -191,30 +199,140 @@ class TestPartial(unittest.TestCase):
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)
+
+
+if c_functools:
+ class PartialSubclass(c_functools.partial):
+ pass
- thetype = PartialSubclass
-class TestPythonPartial(TestPartial):
+@unittest.skipUnless(c_functools, 'requires the C _functools module')
+class TestPartialCSubclass(TestPartialC):
+ if c_functools:
+ partial = PartialSubclass
- thetype = PythonPartial
- # the python version hasn't a nice repr
- test_repr = None
+class TestPartialMethod(unittest.TestCase):
- # the python version isn't picklable
- test_pickle = test_setstate_refcount = None
+ 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))
- # the python version isn't a type
- test_attributes = None
class TestUpdateWrapper(unittest.TestCase):
@@ -223,19 +341,26 @@ class TestUpdateWrapper(unittest.TestCase):
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 +447,7 @@ class TestUpdateWrapper(unittest.TestCase):
self.assertTrue(wrapper.__doc__.startswith('max('))
self.assertEqual(wrapper.__annotations__, {})
+
class TestWraps(TestUpdateWrapper):
def _default_update(self):
@@ -329,14 +455,15 @@ class TestWraps(TestUpdateWrapper):
"""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 +509,7 @@ class TestWraps(TestUpdateWrapper):
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 +590,29 @@ class TestReduce(unittest.TestCase):
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 +620,10 @@ class TestCmpToKey(unittest.TestCase):
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 +632,7 @@ class TestCmpToKey(unittest.TestCase):
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 +647,13 @@ class TestCmpToKey(unittest.TestCase):
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 +661,29 @@ class TestCmpToKey(unittest.TestCase):
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 +701,7 @@ class TestTotalOrdering(unittest.TestCase):
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 +718,7 @@ class TestTotalOrdering(unittest.TestCase):
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 +735,7 @@ class TestTotalOrdering(unittest.TestCase):
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 +752,7 @@ class TestTotalOrdering(unittest.TestCase):
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 +772,118 @@ class TestTotalOrdering(unittest.TestCase):
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 +988,7 @@ class TestLRU(unittest.TestCase):
# 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 +1001,7 @@ class TestLRU(unittest.TestCase):
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 +1016,36 @@ class TestLRU(unittest.TestCase):
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
@@ -802,17 +1071,495 @@ class TestLRU(unittest.TestCase):
DoubleEq(2)) # Verify the correct return value
+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 a0c156f5f7..beac993e4d 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -82,6 +82,14 @@ class FutureTest(unittest.TestCase):
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 c59b72eacf..7eb104a6b5 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 @@ try:
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 @@ class GC_Detector(object):
# 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 @@ class Uncollectable(object):
self.partner = Uncollectable(partner=self)
else:
self.partner = partner
- def __del__(self):
+ def __tp_del__(self):
pass
### Tests
@@ -139,11 +151,13 @@ class GCTests(unittest.TestCase):
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 @@ class GCTests(unittest.TestCase):
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,19 @@ class GCTests(unittest.TestCase):
# would be damaged, with an empty __dict__.
self.assertEqual(x, None)
+ @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 +629,66 @@ class GCTests(unittest.TestCase):
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 +775,7 @@ class GCCallbackTests(unittest.TestCase):
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 846422b837..0e254a2487 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,6 +18,7 @@ try:
except ImportError:
_thread = None
+from test import support
from test.support import run_unittest, findfile, python_is_optimized
try:
@@ -40,6 +42,8 @@ if not sysconfig.is_python_build():
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.
@@ -144,7 +148,7 @@ class DebuggerTests(unittest.TestCase):
# 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 +169,10 @@ class DebuggerTests(unittest.TestCase):
'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 +256,8 @@ class PrettyPrintTests(DebuggerTests):
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 +312,30 @@ class PrettyPrintTests(DebuggerTests):
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 +852,10 @@ class PyLocalsTests(DebuggerTests):
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 958054aef5..91afe47799 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -1,3 +1,55 @@
+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)
+
+
tutorial_tests = """
Let's try a simple generator:
@@ -384,8 +436,8 @@ From the Iterators list, about the types of these things.
>>> [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 +1781,7 @@ Our ill-behaved code should be invoked during GC:
>>> 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 +1891,23 @@ to test.
... 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 +1932,7 @@ __test__ = {"tut": tutorial_tests,
# 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 b5068e4c98..e59ed4d21c 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -188,12 +188,93 @@ class GenericTest:
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 @@ class CommonTest(GenericTest):
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 203b336fde..fb531d6d47 100644
--- a/Lib/test/test_genexps.py
+++ b/Lib/test/test_genexps.py
@@ -222,8 +222,8 @@ Check that generator attributes are present
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 fe64ee1669..1853a2dbed 100644
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -3,38 +3,40 @@ from test import support
# Skip this test if the _testcapi module isn't available.
support.import_module('_testcapi')
from _testcapi import getargs_keywords, getargs_keyword_only
-
-"""
-> 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).
-"""
+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).
LARGE = 0x7FFFFFFF
VERY_LARGE = 0xFF0000121212121212121242
@@ -77,7 +79,8 @@ class Unsigned_TestCase(unittest.TestCase):
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 @@ class Unsigned_TestCase(unittest.TestCase):
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 @@ class Unsigned_TestCase(unittest.TestCase):
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 @@ class Unsigned_TestCase(unittest.TestCase):
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 @@ class Signed_TestCase(unittest.TestCase):
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 @@ class Signed_TestCase(unittest.TestCase):
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 @@ class Signed_TestCase(unittest.TestCase):
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 @@ class Signed_TestCase(unittest.TestCase):
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 @@ class LongLong_TestCase(unittest.TestCase):
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 @@ class Unicode_TestCase(unittest.TestCase):
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_glob.py b/Lib/test/test_glob.py
index eb9aeb5776..a5ab8d6c3e 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -169,6 +169,28 @@ class GlobTests(unittest.TestCase):
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 6b326bdaa1..bba8820ab1 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -314,6 +314,13 @@ class GrammarTests(unittest.TestCase):
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
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index 034acb02c2..b7a7e03c96 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -130,6 +130,14 @@ class TestGzip(BaseTest):
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 @@ class TestGzip(BaseTest):
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 @@ class TestGzip(BaseTest):
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 TestGzip(BaseTest):
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 @@ class TestOpen(BaseTest):
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 22ebbccb22..f647c6f7d2 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -12,6 +12,40 @@ from collections import Hashable
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 @@ class HashRandomizationTests:
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 @@ class StringlikeHashRandomizationTests(HashRandomizationTests):
# 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 @@ class DatetimeTimeTests(DatetimeTests, unittest.TestCase):
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 c0470d6018..36a98cb027 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -18,11 +18,13 @@ except ImportError:
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 @@ def hexstr(s):
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 @@ class HashLibTestCase(unittest.TestCase):
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 @@ class HashLibTestCase(unittest.TestCase):
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 @@ class HashLibTestCase(unittest.TestCase):
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 @@ class HashLibTestCase(unittest.TestCase):
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 @@ class HashLibTestCase(unittest.TestCase):
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)
@@ -352,6 +373,12 @@ class HashLibTestCase(unittest.TestCase):
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")
+ @unittest.skipIf(sys.maxsize < _4G + 5, 'test cannot run on 32-bit systems')
+ @bigmemtest(size=_4G + 5, memuse=1, dry_run=False)
+ def test_case_sha3_224_huge(self, size):
+ self.check('sha3_224', b'A'*size,
+ '58ef60057c9dddb6a87477e9ace5a26f0d9db01881cf9b10a9f8c224')
+
def test_gil(self):
# Check things work fine with an input larger than the size required
# for multithreaded operation (which is hardwired to 2048).
@@ -400,8 +427,8 @@ class HashLibTestCase(unittest.TestCase):
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 +439,95 @@ class HashLibTestCase(unittest.TestCase):
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 4ca7cec44c..cde56fd76f 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 @@ class TestVectorsTestCase(unittest.TestCase):
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 @@ class TestVectorsTestCase(unittest.TestCase):
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 @@ class TestVectorsTestCase(unittest.TestCase):
})
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 @@ class TestVectorsTestCase(unittest.TestCase):
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 @@ class SanityTestCase(unittest.TestCase):
# 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 @@ class CopyTestCase(unittest.TestCase):
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 @@ class CopyTestCase(unittest.TestCase):
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 30dac58e6d..5e9f382a2d 100644
--- a/Lib/test/test_html.py
+++ b/Lib/test/test_html.py
@@ -16,9 +16,89 @@ class HtmlTests(unittest.TestCase):
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 codepoints
+ for cp in [0xD800, 0xDB00, 0xDC00, 0xDFFF, 0x110000]:
+ check_num(cp, '\uFFFD')
+ # check more invalid codepoints
+ 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 11d9c9ce8b..2d771a2a97 100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -70,6 +70,18 @@ class EventCollectorExtra(EventCollector):
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 @@ class TestCaseBase(unittest.TestCase):
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 @@ text
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 @@ text
('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 @@ class HTMLParserTolerantTestCase(HTMLParserStrictTestCase):
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 @@ class AttributesStrictTestCase(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_attr_syntax(self):
output = [
@@ -691,7 +751,7 @@ class AttributesStrictTestCase(TestCaseBase):
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_httplib.py b/Lib/test/test_httplib.py
index c8ded92478..30b6c0cfcb 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -27,8 +27,10 @@ class FakeSocket:
self.text = text
self.fileclass = fileclass
self.data = b''
+ self.sendall_calls = 0
def sendall(self, data):
+ self.sendall_calls += 1
self.data += data
def makefile(self, mode, bufsize=None):
@@ -45,7 +47,7 @@ class EPipeSocket(FakeSocket):
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):
@@ -600,7 +602,7 @@ class BasicTest(TestCase):
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 +648,28 @@ class BasicTest(TestCase):
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)
+
class OfflineTest(TestCase):
def test_responses(self):
self.assertEqual(client.responses[client.NOT_FOUND], "Not Found")
@@ -736,7 +760,7 @@ class HTTPSTest(TestCase):
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
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 4e62963725..15694afd1d 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -92,6 +92,13 @@ class BaseHTTPServerTestCase(BaseTestCase):
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')
@@ -203,6 +210,12 @@ class BaseHTTPServerTestCase(BaseTestCase):
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 +224,14 @@ class BaseHTTPServerTestCase(BaseTestCase):
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):
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 7c9afd9f39..5e0eaeab2b 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -18,8 +18,12 @@ try:
import ssl
except ImportError:
ssl = None
+ HAS_SNI = False
+else:
+ from ssl import HAS_SNI
CERTFILE = None
+CAFILE = None
class TestImaplib(unittest.TestCase):
@@ -125,7 +129,7 @@ class SimpleIMAPHandler(socketserver.StreamRequestHandler):
# 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 +351,26 @@ class ThreadedNetworkedTestsSSL(BaseThreadedNetworkedTests):
server_class = SecureTCPServer
imap_class = IMAP4_SSL
+ @reap_threads
+ @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module')
+ 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 +483,15 @@ def load_tests(*args):
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,
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 71c220f03e..024f43894b 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 @@ class ImportTests(unittest.TestCase):
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)
@@ -208,9 +223,7 @@ class ImportTests(unittest.TestCase):
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 +235,22 @@ class ImportTests(unittest.TestCase):
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 +262,12 @@ class ImportTests(unittest.TestCase):
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 +275,15 @@ class ImportTests(unittest.TestCase):
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 +329,6 @@ class ReloadTests(unittest.TestCase):
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 +481,5 @@ class NullImporterTests(unittest.TestCase):
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 df08e6a86f..bda1541fdb 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 @@ import test.support
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 @@ class ImportTests(unittest.TestCase):
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 @@ class ImportTests(unittest.TestCase):
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 @@ class ImportTests(unittest.TestCase):
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:
@@ -225,7 +220,7 @@ class ImportTests(unittest.TestCase):
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")
@@ -280,7 +275,7 @@ class ImportTests(unittest.TestCase):
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 @@ class ImportTests(unittest.TestCase):
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 @@ class ImportTests(unittest.TestCase):
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 @@ class FilePermissionTests(unittest.TestCase):
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 @@ class FilePermissionTests(unittest.TestCase):
# 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 @@ class FilePermissionTests(unittest.TestCase):
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 @@ class FilePermissionTests(unittest.TestCase):
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 @@ func_filename = func.__code__.co_filename
"""
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 @@ func_filename = func.__code__.co_filename
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 OverridingImportBuiltinTests(unittest.TestCase):
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 @@ class PycacheTests(unittest.TestCase):
# 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 @@ class PycacheTests(unittest.TestCase):
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 @@ class PycacheTests(unittest.TestCase):
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 @@ class PycacheTests(unittest.TestCase):
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 @@ class ImportlibBootstrapTests(unittest.TestCase):
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 @@ class ImportTracebackTests(unittest.TestCase):
# 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,21 @@ class ImportTracebackTests(unittest.TestCase):
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')
+ 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 2a22d1a186..0000000000
--- 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/__main__.py b/Lib/test/test_importlib/__main__.py
index c39712871f..14bd5bc017 100644
--- a/Lib/test/test_importlib/__main__.py
+++ b/Lib/test/test_importlib/__main__.py
@@ -4,17 +4,6 @@ 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
+ from . import test_main
test_main()
diff --git a/Lib/test/test_importlib/abc.py b/Lib/test/test_importlib/abc.py
index 2c17ac329b..2070dadc23 100644
--- a/Lib/test/test_importlib/abc.py
+++ b/Lib/test/test_importlib/abc.py
@@ -2,7 +2,7 @@ import abc
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 @@ class FinderTests(unittest.TestCase, metaclass=abc.ABCMeta):
pass
-class LoaderTests(unittest.TestCase, metaclass=abc.ABCMeta):
+class LoaderTests(metaclass=abc.ABCMeta):
@abc.abstractmethod
def test_module(self):
@@ -81,11 +81,6 @@ class LoaderTests(unittest.TestCase, metaclass=abc.ABCMeta):
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/test_finder.py b/Lib/test/test_importlib/builtin/test_finder.py
index da0ef28589..934562feb6 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 @@ class FinderTests(abc.FinderTests):
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 @@ class FinderTests(abc.FinderTests):
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 12a79c6ba9..a636f778fa 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 @@ class LoaderTests(abc.LoaderTests):
"""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 @@ class LoaderTests(abc.LoaderTests):
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 @@ class LoaderTests(abc.LoaderTests):
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)
+
+
+Frozen_LoaderTests, Source_LoaderTests = util.test_both(LoaderTests,
+ machinery=[frozen_machinery, source_machinery])
-class InspectLoaderTests(unittest.TestCase):
+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)
+ result = self.machinery.BuiltinImporter.is_package(builtin_util.NAME)
self.assertTrue(not 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/test_case_sensitivity.py b/Lib/test/test_importlib/extension/test_case_sensitivity.py
index 76c53e4fd6..bb2528e626 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 @@ class ExtensionModuleCaseSensitivityTest(unittest.TestCase):
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 37f67727b0..990f29c4e5 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 @@ class FinderTests(abc.FinderTests):
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 e790675f58..fd9abf269b 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 @@ class LoaderTests(abc.LoaderTests):
"""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 @@ class LoaderTests(abc.LoaderTests):
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 @@ class LoaderTests(abc.LoaderTests):
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 @@ class LoaderTests(abc.LoaderTests):
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 1d969a1b28..49d6734711 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 a266dd98c8..8d089f0d7c 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/test_finder.py b/Lib/test/test_importlib/frozen/test_finder.py
index f0abe0e989..f9f97f3851 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 @@ class FinderTests(abc.FinderTests):
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 f3a8bf67c7..7c0146456d 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 @@ class LoaderTests(abc.LoaderTests):
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 @@ class LoaderTests(abc.LoaderTests):
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 @@ class LoaderTests(abc.LoaderTests):
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 @@ class InspectLoaderTests(unittest.TestCase):
# 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 @@ class InspectLoaderTests(unittest.TestCase):
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_/test___loader__.py b/Lib/test/test_importlib/import_/test___loader__.py
new file mode 100644
index 0000000000..6df80101fa
--- /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 783cde1729..2e19725680 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
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 @@ class Using__package__(unittest.TestCase):
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 @@ class Using__package__(unittest.TestCase):
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 @@ class Using__package__(unittest.TestCase):
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
-@import_util.importlib_only
-class Setting__package__(unittest.TestCase):
+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__)
+
+
+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 @@ class Setting__package__(unittest.TestCase):
"""
+ __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 3d4cd94889..439c105e9b 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 BadSpecFinderLoader:
+ @classmethod
+ 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 BadLoaderFinder:
- bad = 'fine.bogus'
@classmethod
def find_module(cls, fullname, path):
- if fullname == cls.bad:
+ if fullname == SUBMOD_NAME:
return cls
+
@classmethod
def load_module(cls, fullname):
- if fullname == cls.bad:
+ if fullname == SUBMOD_NAME:
raise ImportError('I cannot be loaded!')
-class APITest(unittest.TestCase):
+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 @@ class APITest(unittest.TestCase):
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
+
+Frozen_OldAPITests, Source_OldAPITests = util.test_both(
+ OldAPITests, __import__=import_util.__import__)
+class SpecAPITests(APITest):
+ bad_finder_loader = BadSpecFinderLoader
-def test_main():
- from test.support import run_unittest
- run_unittest(APITest)
+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 207378a6fb..c292ee4ac2 100644
--- a/Lib/test/test_importlib/import_/test_caching.py
+++ b/Lib/test/test_importlib/import_/test_caching.py
@@ -6,7 +6,7 @@ from types import MethodType
import unittest
-class UseCache(unittest.TestCase):
+class UseCache:
"""When it comes to sys.modules, import prefers it over anything else.
@@ -21,12 +21,13 @@ class UseCache(unittest.TestCase):
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 @@ class UseCache(unittest.TestCase):
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 @@ class UseCache(unittest.TestCase):
# __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 c16c33710f..58f244bddc 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 @@ class ReturnValue(unittest.TestCase):
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,14 +52,14 @@ class HandlingFromlist(unittest.TestCase):
# [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'))
@@ -64,7 +67,7 @@ class HandlingFromlist(unittest.TestCase):
# [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 @@ class HandlingFromlist(unittest.TestCase):
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 @@ class HandlingFromlist(unittest.TestCase):
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 @@ class HandlingFromlist(unittest.TestCase):
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 4d85f80e67..dc45420621 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 unittest
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 @@ class CallingOrder(unittest.TestCase):
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 @@ class CallingOrder(unittest.TestCase):
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,12 +86,12 @@ class CallSignature(unittest.TestCase):
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]
@@ -104,12 +100,20 @@ class CallSignature(unittest.TestCase):
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__)
+class CallSignaturePEP451(CallSignature):
+ mock_modules = util.mock_spec
+ finder_name = 'find_spec'
-def test_main():
- from test.support import run_unittest
- run_unittest(CallingOrder, CallSignature)
+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 bfa18dc217..55a5d14985 100644
--- a/Lib/test/test_importlib/import_/test_packages.py
+++ b/Lib/test/test_importlib/import_/test_packages.py
@@ -6,37 +6,37 @@ import importlib
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 @@ class ParentModuleTests(unittest.TestCase):
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 @@ class ParentModuleTests(unittest.TestCase):
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 @@ class ParentModuleTests(unittest.TestCase):
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 @@ class ParentModuleTests(unittest.TestCase):
# 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 @@ class ParentModuleTests(unittest.TestCase):
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 d82b7f6b0c..1274f8cb9e 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 warnings
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 @@ class FinderTests(unittest.TestCase):
# 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 @@ class FinderTests(unittest.TestCase):
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 @@ class FinderTests(unittest.TestCase):
# 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 @@ class FinderTests(unittest.TestCase):
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 @@ class FinderTests(unittest.TestCase):
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)
+
+
+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)
-def test_main():
- from test.support import run_unittest
- run_unittest(FinderTests)
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 4569c26424..b216e9cc13 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 @@ from . import util as import_util
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
{'__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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
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 @@ class RelativeImports(unittest.TestCase):
'__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 @@ class RelativeImports(unittest.TestCase):
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 86ac065e64..dcb490f967 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/test_importlib/source/test_abc_loader.py b/Lib/test/test_importlib/source/test_abc_loader.py
deleted file mode 100644
index 0d912b6469..0000000000
--- 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 241173fb44..efd3146d90 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 @@ import unittest
@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 @@ class CaseSensitivityTest(unittest.TestCase):
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 @@ class CaseSensitivityTest(unittest.TestCase):
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)
+
+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
-def test_main():
- test_support.run_unittest(CaseSensitivityTest)
+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 d711cb3e79..2d415f985d 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 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>'
+ def setUp(self):
+ self.name = 'spam'
+ self.filepath = os.path.join('ham', self.name + '.py')
+ self.loader = self.machinery.SourceFileLoader(self.name, self.filepath)
- class Tester(importlib.abc.FileLoader, TesterMixin):
- def get_code(self, _): pass
- def get_source(self, _): pass
- def is_package(self, _): pass
+ def test_load_module_API(self):
+ class Tester(self.abc.FileLoader):
+ def get_source(self, _): return 'attr = 42'
+ def is_package(self, _): return False
- 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 @@ class SimpleTest(unittest.TestCase):
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 @@ class SimpleTest(unittest.TestCase):
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 @@ class SimpleTest(unittest.TestCase):
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 @@ class SimpleTest(unittest.TestCase):
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 @@ class SimpleTest(unittest.TestCase):
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.exec_module(orig_module)
+ for attr in attributes:
+ self.assertEqual(getattr(orig_module, attr), value)
with self.assertRaises(SyntaxError):
- loader.load_module(name)
+ 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 @@ class SimpleTest(unittest.TestCase):
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 @@ class SimpleTest(unittest.TestCase):
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 @@ class SimpleTest(unittest.TestCase):
# 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 @@ class SimpleTest(unittest.TestCase):
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 @@ class BadBytecodeTest(unittest.TestCase):
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 @@ class BadBytecodeTest(unittest.TestCase):
lambda bc: b'\x00\x00\x00\x00' + bc[4:])
test('_temp', mapping, bc_path)
+class BadBytecodeTestPEP451(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)
+
+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(BadBytecodeTest):
- loader = machinery.SourceFileLoader
+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 @@ class SourceLoaderBadBytecodeTest(BadBytecodeTest):
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 @@ class SourceLoaderBadBytecodeTest(BadBytecodeTest):
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 @@ class SourceLoaderBadBytecodeTest(BadBytecodeTest):
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 @@ class SourceLoaderBadBytecodeTest(BadBytecodeTest):
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
+
+Frozen_SourceBadBytecodePEP451, Source_SourceBadBytecodePEP451 = util.test_both(
+ SourceLoaderBadBytecodeTestPEP451, importlib=importlib, machinery=machinery,
+ abc=importlib_abc, util=importlib_util)
+
+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(BadBytecodeTest):
- loader = machinery.SourcelessFileLoader
+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 @@ class SourcelessLoaderBadBytecodeTest(BadBytecodeTest):
def test_non_code_marshal(self):
self._test_non_code_marshal(del_source=True)
+class SourcelessLoaderBadBytecodeTestPEP451(SourcelessLoaderBadBytecodeTest,
+ BadBytecodeTestPEP451):
+ pass
+
+Frozen_SourcelessBadBytecodePEP451, Source_SourcelessBadBytecodePEP451 = util.test_both(
+ SourcelessLoaderBadBytecodeTestPEP451, importlib=importlib,
+ machinery=machinery, abc=importlib_abc, util=importlib_util)
+
+class SourcelessLoaderBadBytecodeTestPEP302(SourcelessLoaderBadBytecodeTest,
+ BadBytecodeTestPEP302):
+ pass
-def test_main():
- from test.support import run_unittest
- run_unittest(SimpleTest,
- SourceLoaderBadBytecodeTest,
- SourcelessLoaderBadBytecodeTest
- )
+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 8e4986835d..473297bdc8 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 @@ class FinderTests(abc.FinderTests):
"""
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 @@ class FinderTests(abc.FinderTests):
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 @@ class FinderTests(abc.FinderTests):
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 @@ class FinderTests(abc.FinderTests):
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)
+
+
+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)
-def test_main():
- from test.support import run_unittest
- run_unittest(FinderTests)
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 6a78792f07..92da77265b 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 @@ class PathHookTest(unittest.TestCase):
# 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 ba02b44274..c62dfa108d 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 @@ class EncodingTest(unittest.TestCase):
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 @@ class EncodingTest(unittest.TestCase):
with self.assertRaises(SyntaxError):
self.run_test(source)
+class EncodingTestPEP451(EncodingTest):
+
+ 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(unittest.TestCase):
+
+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 @@ class LineEndingTest(unittest.TestCase):
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 @@ class LineEndingTest(unittest.TestCase):
def test_lf(self):
self.run_test(b'\n')
+class LineEndingTestPEP451(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)
-def test_main():
- from test.support import run_unittest
- run_unittest(EncodingTest, LineEndingTest)
+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 ae65663a67..63cd25adc4 100644
--- a/Lib/test/test_importlib/source/util.py
+++ b/Lib/test/test_importlib/source/util.py
@@ -2,7 +2,6 @@ from .. import util
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 c620c3771b..09b72949ca 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 @@ class InheritanceTests:
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 @@ class InheritanceTests:
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):
+ 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
- superclasses = [abc.Finder]
- subclasses = [machinery.BuiltinImporter, machinery.FrozenImporter,
- machinery.PathFinder, machinery.WindowsRegistryFinder]
+class MetaPathFinder(InheritanceTests):
+ superclass_names = ['Finder']
+ subclass_names = ['BuiltinImporter', 'FrozenImporter', 'PathFinder',
+ 'WindowsRegistryFinder']
-class PathEntryFinder(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(MetaPathFinder)
+Frozen_MetaPathFinderInheritanceTests, Source_MetaPathFinderInheritanceTests = tests
- superclasses = [abc.Finder]
- subclasses = [machinery.FileFinder]
+class PathEntryFinder(InheritanceTests):
+ superclass_names = ['Finder']
+ subclass_names = ['FileFinder']
-class Loader(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(PathEntryFinder)
+Frozen_PathEntryFinderInheritanceTests, Source_PathEntryFinderInheritanceTests = tests
- subclasses = [abc.PyLoader]
+class ResourceLoader(InheritanceTests):
+ superclass_names = ['Loader']
-class ResourceLoader(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(ResourceLoader)
+Frozen_ResourceLoaderInheritanceTests, Source_ResourceLoaderInheritanceTests = tests
- superclasses = [abc.Loader]
+class InspectLoader(InheritanceTests):
+ superclass_names = ['Loader']
+ subclass_names = ['BuiltinImporter', 'FrozenImporter', 'ExtensionFileLoader']
-class InspectLoader(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(InspectLoader)
+Frozen_InspectLoaderInheritanceTests, Source_InspectLoaderInheritanceTests = tests
- superclasses = [abc.Loader]
- subclasses = [abc.PyLoader, machinery.BuiltinImporter,
- machinery.FrozenImporter, machinery.ExtensionFileLoader]
+class ExecutionLoader(InheritanceTests):
+ superclass_names = ['InspectLoader']
+ subclass_names = ['ExtensionFileLoader']
-class ExecutionLoader(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(ExecutionLoader)
+Frozen_ExecutionLoaderInheritanceTests, Source_ExecutionLoaderInheritanceTests = tests
- superclasses = [abc.InspectLoader]
- subclasses = [abc.PyLoader]
+class FileLoader(InheritanceTests):
+ superclass_names = ['ResourceLoader', 'ExecutionLoader']
+ subclass_names = ['SourceFileLoader', 'SourcelessFileLoader']
-class FileLoader(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(FileLoader)
+Frozen_FileLoaderInheritanceTests, Source_FileLoaderInheritanceTests = tests
- superclasses = [abc.ResourceLoader, abc.ExecutionLoader]
- subclasses = [machinery.SourceFileLoader, machinery.SourcelessFileLoader]
+class SourceLoader(InheritanceTests):
+ superclass_names = ['ResourceLoader', 'ExecutionLoader']
+ subclass_names = ['SourceFileLoader']
-class SourceLoader(InheritanceTests, unittest.TestCase):
+tests = create_inheritance_tests(SourceLoader)
+Frozen_SourceLoaderInheritanceTests, Source_SourceLoaderInheritanceTests = tests
- superclasses = [abc.ResourceLoader, abc.ExecutionLoader]
- subclasses = [machinery.SourceFileLoader]
+##### 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 PyLoader(InheritanceTests, unittest.TestCase):
- superclasses = [abc.Loader, abc.ResourceLoader, abc.ExecutionLoader]
+class MetaPathFinder:
+ def find_module(self, fullname, path):
+ return super().find_module(fullname, path)
-class PyPycLoader(InheritanceTests, unittest.TestCase):
+Frozen_MPF, Source_MPF = make_abc_subclasses(MetaPathFinder)
- superclasses = [abc.PyLoader]
+class MetaPathFinderDefaultsTests:
-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)
+ 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.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)
+
+
+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 b1a58944f3..744001b4c0 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 @@ class ImportModuleTests(unittest.TestCase):
# 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 @@ class ImportModuleTests(unittest.TestCase):
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 @@ class ImportModuleTests(unittest.TestCase):
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 @@ class ImportModuleTests(unittest.TestCase):
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 @@ class ImportModuleTests(unittest.TestCase):
# 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 @@ class ImportModuleTests(unittest.TestCase):
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 Source_ImportModuleTests(ImportModuleTests, unittest.TestCase):
+ init = source_init
-class FindLoaderTests(unittest.TestCase):
+
+class FindLoaderTests:
class FakeMetaFinder:
@staticmethod
@@ -98,29 +108,51 @@ class FindLoaderTests(unittest.TestCase):
# 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,200 @@ class FindLoaderTests(unittest.TestCase):
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,
+ '__builtins__': __builtins__,
+ }
+ support.create_empty_file(path)
+ module = self.init.import_module(name)
+ ns = vars(module)
+ loader = ns.pop('__loader__')
+ spec = ns.pop('__spec__')
+ 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,
+ '__builtins__': __builtins__,
+ }
+ os.mkdir(name)
+ os.rename(path, init_path)
+ reloaded = self.init.reload(module)
+ ns = vars(reloaded)
+ loader = ns.pop('__loader__')
+ spec = ns.pop('__spec__')
+ 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)
+ loader = ns.pop('__loader__')
+ path = ns.pop('__path__')
+ spec = ns.pop('__spec__')
+ 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,
+ '__builtins__': __builtins__,
+ 'eggs': None,
+ }
+ os.rename(bad_path, init_path)
+ reloaded = self.init.reload(module)
+ ns = vars(reloaded)
+ loader = ns.pop('__loader__')
+ spec = ns.pop('__spec__')
+ 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 +372,65 @@ class InvalidateCacheTests(unittest.TestCase):
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__)
-
-def test_main():
- from test.support import run_unittest
- run_unittest(ImportModuleTests,
- FindLoaderTests,
- InvalidateCacheTests,
- FrozenImportlibTests,
- StartupTests)
+ 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_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 c373b11256..dc97ba1567 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 @@ except ImportError:
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 @@ if threading is not None:
# _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 @@ class DeadlockAvoidanceTests(unittest.TestCase):
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 @@ class DeadlockAvoidanceTests(unittest.TestCase):
"""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 @@ class DeadlockAvoidanceTests(unittest.TestCase):
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
+
+@unittest.skipUnless(threading, "threads needed for this test")
+class Source_DeadlockAvoidanceTests(DeadlockAvoidanceTests, unittest.TestCase):
+ LockType = source_bootstrap._ModuleLock
+ DeadlockError = source_bootstrap._DeadlockError
-class LifetimeTests(unittest.TestCase):
+
+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_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py
new file mode 100644
index 0000000000..71541f692e
--- /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 efc8977fb4..b2823c6a78 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 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]))
-class ModuleForLoaderTests(unittest.TestCase):
+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 @@ class ModuleForLoaderTests(unittest.TestCase):
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 @@ class ModuleForLoaderTests(unittest.TestCase):
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 @@ class ModuleForLoaderTests(unittest.TestCase):
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 @@ class ModuleForLoaderTests(unittest.TestCase):
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 @@ class ModuleForLoaderTests(unittest.TestCase):
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 @@ class SetPackageTests(unittest.TestCase):
"""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 @@ class SetPackageTests(unittest.TestCase):
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])
+
+
+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_main():
- from test import support
- support.run_unittest(
- ModuleForLoaderTests,
- SetPackageTests,
- ResolveNameTests
- )
+ 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 0000000000..96b4adcd05
--- /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 ef32f7d690..885cec3b29 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 @@ def case_insensitive_tests(test):
"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 @@ def uncache(*names):
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 @@ def import_state(**kwargs):
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 @@ class mock_modules:
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 @@ class mock_modules:
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 @@ class mock_modules:
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 87857119e1..a2ac32132e 100644
--- a/Lib/test/test_index.py
+++ b/Lib/test/test_index.py
@@ -81,7 +81,8 @@ class BaseTestCase(unittest.TestCase):
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 5cbec9bb17..5c6ae394d5 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -1,22 +1,32 @@
-import re
-import sys
-import types
-import unittest
+import collections
+import datetime
+import functools
+import importlib
import inspect
+import io
import linecache
-import datetime
-import collections
import os
-import shutil
from os.path import normcase
+import _pickle
+import re
+import shutil
+import sys
+import types
+import unicodedata
+import unittest
+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
# Functions tested in this suite:
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
@@ -120,7 +130,6 @@ class TestPredicates(IsTestBase):
def test_get_slot_members(self):
class C(object):
__slots__ = ("a", "b")
-
x = C()
x.a = 42
members = dict(inspect.getmembers(x))
@@ -310,6 +319,16 @@ class TestRetrievingSourceCode(GetSourceBase):
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'
@@ -418,14 +437,14 @@ class TestBuggyCases(GetSourceBase):
unicodedata.__file__[-4:] in (".pyc", ".pyo"),
"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 +482,13 @@ class _BrokenDataDescriptor(object):
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 +496,10 @@ class _BrokenMethodDescriptor(object):
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 +578,96 @@ class TestClassesAndFunctions(unittest.TestCase):
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 +697,10 @@ class TestClassesAndFunctions(unittest.TestCase):
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 +763,88 @@ class TestClassesAndFunctions(unittest.TestCase):
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 +888,28 @@ class TestClassesAndFunctions(unittest.TestCase):
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):
@@ -1080,6 +1297,15 @@ class TestGetattrStatic(unittest.TestCase):
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 +1616,13 @@ class TestSignatureObject(unittest.TestCase):
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 +1645,15 @@ class TestSignatureObject(unittest.TestCase):
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 +1698,100 @@ class TestSignatureObject(unittest.TestCase):
('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 +1800,112 @@ class TestSignatureObject(unittest.TestCase):
with self.assertRaisesRegex(TypeError, 'is not a Python function'):
inspect.Signature.from_function(42)
+ 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
+
+ __name__ = func.__name__
+ __code__ = func.__code__
+ __annotations__ = func.__annotations__
+ __defaults__ = func.__defaults__
+ __kwdefaults__ = func.__kwdefaults__
+
+ 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 foo(self, arg1, arg2=1) -> int:
+ def __init__(*args):
+ pass
+ def m1(self, arg1, arg2=1) -> int:
+ pass
+ def m2(*args):
+ pass
+ def __call__(*, a):
pass
- meth = Test().foo
-
- self.assertEqual(self.signature(meth),
+ 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
@@ -1687,6 +2099,38 @@ class TestSignatureObject(unittest.TestCase):
ba = inspect.signature(_foo).bind(12, 14)
self.assertEqual(_foo(*ba.args, **ba.kwargs), (12, 14, 13))
+ 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 +2180,17 @@ class TestSignatureObject(unittest.TestCase):
((('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 +2272,49 @@ class TestSignatureObject(unittest.TestCase):
('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 +2336,16 @@ class TestSignatureObject(unittest.TestCase):
((('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 +2419,7 @@ class TestSignatureObject(unittest.TestCase):
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 +2430,20 @@ class TestSignatureObject(unittest.TestCase):
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 +2458,22 @@ class TestSignatureObject(unittest.TestCase):
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 +2498,13 @@ class TestParameterObject(unittest.TestCase):
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 +2553,8 @@ class TestParameterObject(unittest.TestCase):
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 +2576,11 @@ class TestParameterObject(unittest.TestCase):
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 +2778,15 @@ class TestSignatureBind(unittest.TestCase):
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 +2803,22 @@ class TestSignatureBind(unittest.TestCase):
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 +2846,168 @@ class TestBoundArguments(unittest.TestCase):
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'')
+
+ @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'')
+
+
+
+
def test_main():
run_unittest(
TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases,
@@ -2308,7 +3015,8 @@ def test_main():
TestGetcallargsFunctions, TestGetcallargsMethods,
TestGetcallargsUnboundMethods, TestGetattrStatic, TestGetGeneratorState,
TestNoEOL, TestSignatureObject, TestSignatureBind, TestParameterObject,
- TestBoundArguments, TestGetClosureVars
+ TestBoundArguments, TestSignaturePrivateHelpers, TestGetClosureVars,
+ TestUnwrap, TestMain
)
if __name__ == "__main__":
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index c489510537..e94602e88d 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -228,6 +228,47 @@ class IntTestCases(unittest.TestCase):
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 @@ class IntTestCases(unittest.TestCase):
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 2a96b7b8e7..267537fdeb 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -35,6 +35,7 @@ import weakref
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 @@ class CloseFailureIO(MockRawIO):
def close(self):
if not self.closed:
self.closed = 1
- raise IOError
+ raise OSError
class CCloseFailureIO(CloseFailureIO, io.RawIOBase):
pass
@@ -595,9 +596,9 @@ class IOTest(unittest.TestCase):
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):
@@ -757,7 +758,7 @@ class CommonBufferedTests:
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,22 +774,22 @@ class CommonBufferedTests:
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.assertEqual(err.exception.__context__.args, ('flush',))
@@ -828,6 +829,14 @@ class SizeofTest:
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 +1021,8 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
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 +1073,18 @@ class CBufferedReaderTest(BufferedReaderTest, SizeofTest):
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 +1337,9 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
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 +1348,11 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
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 +1383,14 @@ class CBufferedWriterTest(BufferedWriterTest, SizeofTest):
# 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 +1437,14 @@ class BufferedRWPairTest(unittest.TestCase):
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())
@@ -1962,7 +1973,7 @@ class TextIOWrapperTest(unittest.TestCase):
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()
@@ -2209,7 +2220,7 @@ class TextIOWrapperTest(unittest.TestCase):
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
@@ -2281,7 +2292,7 @@ class TextIOWrapperTest(unittest.TestCase):
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()
@@ -2385,7 +2396,7 @@ class TextIOWrapperTest(unittest.TestCase):
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"))
@@ -2560,9 +2571,9 @@ class TextIOWrapperTest(unittest.TestCase):
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_multi_close(self):
@@ -2618,11 +2629,11 @@ class TextIOWrapperTest(unittest.TestCase):
# 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
@@ -2634,8 +2645,46 @@ class TextIOWrapperTest(unittest.TestCase):
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())
+
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")
@@ -2650,14 +2699,15 @@ class CTextIOWrapperTest(TextIOWrapperTest):
# 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")
@@ -2678,7 +2728,9 @@ class CTextIOWrapperTest(TextIOWrapperTest):
class PyTextIOWrapperTest(TextIOWrapperTest):
- pass
+ io = pyio
+ #shutdown_error = "LookupError: unknown encoding: ascii"
+ shutdown_error = "TypeError: 'NoneType' object is not iterable"
class IncrementalNewlineDecoderTest(unittest.TestCase):
@@ -2817,7 +2869,8 @@ class MiscIOTest(unittest.TestCase):
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)
@@ -2947,7 +3000,7 @@ class MiscIOTest(unittest.TestCase):
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)
@@ -3069,7 +3122,6 @@ class MiscIOTest(unittest.TestCase):
class CMiscIOTest(MiscIOTest):
io = io
- shutdown_error = "RuntimeError: could not find io module state"
def test_readinto_buffer_overflow(self):
# Issue #18025
@@ -3082,7 +3134,6 @@ class CMiscIOTest(MiscIOTest):
class PyMiscIOTest(MiscIOTest):
io = pyio
- shutdown_error = "LookupError: unknown encoding: ascii"
@unittest.skipIf(os.name == 'nt', 'POSIX signals required for this test.')
@@ -3115,15 +3166,18 @@ class SignalsTest(unittest.TestCase):
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.
@@ -3137,7 +3191,7 @@ class SignalsTest(unittest.TestCase):
# buffer, and block again.
try:
wio.close()
- except IOError as e:
+ except OSError as e:
if e.errno != errno.EBADF:
raise
@@ -3265,7 +3319,7 @@ class SignalsTest(unittest.TestCase):
# 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 531c9afbb5..efe9f516cc 100644
--- a/Lib/test/test_ioctl.py
+++ b/Lib/test/test_ioctl.py
@@ -8,7 +8,7 @@ get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature
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 @@ class IoctlTests(unittest.TestCase):
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 5bfcf41429..f2947b9c8a 100644
--- a/Lib/test/test_ipaddress.py
+++ b/Lib/test/test_ipaddress.py
@@ -1358,6 +1358,14 @@ class IpaddrUnitTest(unittest.TestCase):
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 +1431,10 @@ class IpaddrUnitTest(unittest.TestCase):
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_iterlen.py b/Lib/test/test_iterlen.py
index 9101f6c884..152f5fc0cb 100644
--- a/Lib/test/test_iterlen.py
+++ b/Lib/test/test_iterlen.py
@@ -45,31 +45,21 @@ import unittest
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 @@ class TestTemporarilyImmutable(TestInvariantWithoutMutations):
# 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 @@ class TestRepeat(TestInvariantWithoutMutations, unittest.TestCase):
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 @@ class TestList(TestInvariantWithoutMutations, unittest.TestCase):
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 @@ class TestListReversed(TestInvariantWithoutMutations, unittest.TestCase):
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 514a6b7a20..21f1bdeb82 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -10,6 +10,8 @@ import random
import copy
import pickle
from functools import reduce
+import sys
+import struct
maxsize = support.MAX_Py_ssize_t
minsize = -maxsize-1
@@ -1729,9 +1731,8 @@ class TestVariousIteratorArgs(unittest.TestCase):
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), 12), 12)
class RegressionTests(unittest.TestCase):
@@ -1808,6 +1809,44 @@ class SubclassWithKwargsTest(unittest.TestCase):
# 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
@@ -2043,7 +2082,8 @@ __test__ = {'libreftest' : libreftest}
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/test_decode.py b/Lib/test/test_json/test_decode.py
index d23e285909..35c02de88c 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,5 +70,26 @@ class TestDecode:
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')
+
class TestPyDecode(TestDecode, PyTest): pass
class TestCDecode(TestDecode, CTest): pass
diff --git a/Lib/test/test_json/test_enum.py b/Lib/test/test_json/test_enum.py
new file mode 100644
index 0000000000..10f414898b
--- /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 3dd877afdb..7caafdbddd 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 @@ class TestFail:
#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 a4d4d20142..e07856f33c 100644
--- a/Lib/test/test_json/test_indent.py
+++ b/Lib/test/test_json/test_indent.py
@@ -32,6 +32,8 @@ class TestIndent:
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 @@ class TestIndent:
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 0000000000..af99f52c63
--- /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 6c2ff00362..7f315d4cb4 100644
--- a/Lib/test/test_keywordonlyarg.py
+++ b/Lib/test/test_keywordonlyarg.py
@@ -174,6 +174,18 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
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 e5e6058334..bafdeba6ff 100644
--- a/Lib/test/test_kqueue.py
+++ b/Lib/test/test_kqueue.py
@@ -94,7 +94,7 @@ class TestKQueue(unittest.TestCase):
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 +185,33 @@ class TestKQueue(unittest.TestCase):
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 63ee697250..5b276e76ff 100644
--- a/Lib/test/test_largefile.py
+++ b/Lib/test/test_largefile.py
@@ -159,7 +159,7 @@ def setUpModule():
# 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_locale.py b/Lib/test/test_locale.py
index 76347b7746..ab990ae63f 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -371,7 +371,8 @@ class NormalizeTest(unittest.TestCase):
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 @@ class NormalizeTest(unittest.TestCase):
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 @@ class NormalizeTest(unittest.TestCase):
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,10 +416,12 @@ class NormalizeTest(unittest.TestCase):
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')
@@ -435,6 +442,39 @@ class NormalizeTest(unittest.TestCase):
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 f34172a371..e72b036e10 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -24,6 +24,7 @@ import logging.handlers
import logging.config
import codecs
+import configparser
import datetime
import pickle
import io
@@ -38,6 +39,7 @@ import socket
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)
import textwrap
@@ -56,7 +58,9 @@ try:
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 @@ try:
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 @@ class BaseTest(unittest.TestCase):
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 @@ class BaseTest(unittest.TestCase):
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 @@ class BaseTest(unittest.TestCase):
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):
@@ -428,7 +434,7 @@ class CustomLevelsAndFiltersTest(BaseTest):
"""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 +564,7 @@ class HandlerTest(BaseTest):
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 +589,7 @@ class HandlerTest(BaseTest):
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 +597,9 @@ class HandlerTest(BaseTest):
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 +613,14 @@ class HandlerTest(BaseTest):
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 +662,6 @@ class StreamHandlerTest(BaseTest):
# -- 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 +682,14 @@ if threading:
: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 +720,8 @@ if threading:
: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 +828,7 @@ if threading:
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
@@ -906,6 +865,9 @@ if threading:
super(TestTCPServer, self).server_bind()
self.port = self.socket.getsockname()[1]
+ class TestUnixStreamServer(TestTCPServer):
+ address_family = socket.AF_UNIX
+
class TestUDPServer(ControlMixin, ThreadingUDPServer):
"""
A UDP server which is controllable using :class:`ControlMixin`.
@@ -935,7 +897,7 @@ if threading:
if data:
try:
super(DelegatingUDPRequestHandler, self).finish()
- except socket.error:
+ except OSError:
if not self.server._closed:
raise
@@ -953,6 +915,9 @@ if threading:
super(TestUDPServer, self).server_close()
self._closed = True
+ class TestUnixDatagramServer(TestUDPServer):
+ address_family = socket.AF_UNIX
+
# - end of server_helper section
@unittest.skipUnless(threading, 'Threading required for this test.')
@@ -991,7 +956,7 @@ class MemoryHandlerTest(BaseTest):
"""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 +1009,7 @@ class ConfigFileTest(BaseTest):
"""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 +1257,24 @@ class ConfigFileTest(BaseTest):
# 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 +1364,7 @@ class ConfigFileTest(BaseTest):
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 +1377,23 @@ class SocketHandlerTest(BaseTest):
"""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 +1433,69 @@ class SocketHandlerTest(BaseTest):
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(threading, 'Threading required for this test.')
+class UnixSocketHandlerTest(SocketHandlerTest):
+
+ """Test for SocketHandler with unix sockets."""
+
+ if threading:
+ 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)
@@ -1507,21 +1530,44 @@ class DatagramHandlerTest(BaseTest):
@unittest.skipUnless(threading, 'Threading required for this test.')
+class UnixDatagramHandlerTest(DatagramHandlerTest):
+
+ """Test for DatagramHandler using Unix sockets."""
+
+ if threading:
+ 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)
@@ -1559,6 +1605,23 @@ class SysLogHandlerTest(BaseTest):
@unittest.skipUnless(threading, 'Threading required for this test.')
+class UnixSysLogHandlerTest(SysLogHandlerTest):
+
+ """Test for SysLogHandler with Unix sockets."""
+
+ if threading:
+ 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."""
@@ -1779,7 +1842,7 @@ class WarningsTest(BaseTest):
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 +1880,7 @@ class ConfigDictTest(BaseTest):
"""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 +2452,32 @@ class ConfigDictTest(BaseTest):
},
}
+ # 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 +2745,20 @@ class ConfigDictTest(BaseTest):
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 +2818,69 @@ class ConfigDictTest(BaseTest):
# 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 +2940,14 @@ class ChildLoggerTest(BaseTest):
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 +2990,7 @@ class LogRecordFactoryTest(BaseTest):
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 +3284,13 @@ class ShutdownTest(BaseTest):
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 +3396,25 @@ class ModuleLevelMiscTest(BaseTest):
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 +3532,12 @@ class BasicConfigTest(unittest.TestCase):
"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 +3545,23 @@ class BasicConfigTest(unittest.TestCase):
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 +4017,63 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
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 +4132,7 @@ class NTEventLogHandlerTest(BaseTest):
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 +4165,8 @@ def test_main():
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 3f9c1e295b..13152ecf12 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -1079,7 +1079,7 @@ class LongTest(unittest.TestCase):
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')
diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py
index 160b0e8b0f..3e73d7f1cf 100644
--- a/Lib/test/test_lzma.py
+++ b/Lib/test/test_lzma.py
@@ -383,6 +383,8 @@ class FileTestCase(unittest.TestCase):
pass
with LZMAFile(BytesIO(), "w") as f:
pass
+ with LZMAFile(BytesIO(), "x") as f:
+ pass
with LZMAFile(BytesIO(), "a") as f:
pass
@@ -410,13 +412,29 @@ class FileTestCase(unittest.TestCase):
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 +716,20 @@ class FileTestCase(unittest.TestCase):
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 +1073,6 @@ class OpenTestCase(unittest.TestCase):
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 +1121,16 @@ class OpenTestCase(unittest.TestCase):
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_mailbox.py b/Lib/test/test_mailbox.py
index 5e9e30acf1..d40509368a 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -596,7 +596,7 @@ class TestMaildir(TestMailbox, unittest.TestCase):
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):
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 0b1413715d..068c4713e1 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -22,37 +22,13 @@ class HelperMixin:
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 @@ class BugsTestCase(unittest.TestCase):
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 @@ class BugsTestCase(unittest.TestCase):
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 @@ class LargeValuesTestCase(unittest.TestCase):
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 4fa9a195f9..9ef293e708 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -520,12 +520,12 @@ class TextIOTestMixin:
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 bf0eaad2ac..e7df8a762c 100644
--- a/Lib/test/test_memoryview.py
+++ b/Lib/test/test_memoryview.py
@@ -352,6 +352,15 @@ class AbstractMemoryTests:
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]))
+
+
# 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 113c7fd71d..a1516c242d 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -360,6 +360,15 @@ class MinidomTest(unittest.TestCase):
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 @@ class MinidomTest(unittest.TestCase):
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 @@ class MinidomTest(unittest.TestCase):
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 @@ class MinidomTest(unittest.TestCase):
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 @@ class MinidomTest(unittest.TestCase):
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 @@ class MinidomTest(unittest.TestCase):
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
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 899df8d818..6ca5e1b730 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)
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 @@ class MmapTests(unittest.TestCase):
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,
@@ -655,7 +656,7 @@ class MmapTests(unittest.TestCase):
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 +672,7 @@ class MmapTests(unittest.TestCase):
# 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 +683,23 @@ class MmapTests(unittest.TestCase):
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 +717,7 @@ class LargeMmapTests(unittest.TestCase):
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 e5a2525d18..1230293670 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 @@ class ModuleTests(unittest.TestCase):
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 @@ class ModuleTests(unittest.TestCase):
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 @@ class ModuleTests(unittest.TestCase):
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 @@ class ModuleTests(unittest.TestCase):
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 @@ a = A(destroyed)"""
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 @@ a = A(destroyed)"""
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 @@ a = A(destroyed)"""
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 @@ a = A(destroyed)"""
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_multibytecodec.py b/Lib/test/test_multibytecodec.py
index 6889184cce..ea592c7501 100644
--- a/Lib/test/test_multibytecodec.py
+++ b/Lib/test/test_multibytecodec.py
@@ -175,57 +175,28 @@ class Test_StreamReader(unittest.TestCase):
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_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_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')
+ 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 0000000000..2bf4e75644
--- /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 0000000000..193a04a5fc
--- /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 0000000000..7ea8e7806c
--- /dev/null
+++ b/Lib/test/test_multiprocessing_main_handling.py
@@ -0,0 +1,285 @@
+# tests __main__ module handling in multiprocessing
+
+import importlib
+import importlib.machinery
+import zipimport
+import unittest
+import sys
+import os
+import os.path
+import py_compile
+
+from test import support
+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)
+
+# Skip tests if _multiprocessing wasn't built.
+_multiprocessing = support.import_module('_multiprocessing')
+# Look up which start methods are available to test
+import multiprocessing
+AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods())
+
+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 0000000000..334ae9e8f7
--- /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_namespace_pkgs.py b/Lib/test/test_namespace_pkgs.py
index 7067b12e8f..6639612631 100644
--- a/Lib/test/test_namespace_pkgs.py
+++ b/Lib/test/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 @@ class ModuleAndNamespacePackageInSameDir(NamespacePackageTest):
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_nntplib.py b/Lib/test/test_nntplib.py
index 1d52713f07..71a4ec022b 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -266,7 +266,7 @@ class NetworkedNNTPTestsMixin:
return False
try:
server.help()
- except (socket.error, EOFError):
+ except (OSError, EOFError):
return False
return True
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index 28ede34cd7..ab2eeb77da 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -43,7 +43,7 @@ class NormalizationTest(unittest.TestCase):
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 e9e1d715ef..000fc75c20 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -306,6 +306,40 @@ class TestNtpath(unittest.TestCase):
# 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 63843705b1..47851072c1 100644
--- a/Lib/test/test_openpty.py
+++ b/Lib/test/test_openpty.py
@@ -4,7 +4,7 @@ import os, unittest
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 fa608b9a52..ab58a98365 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 @@ class Seq2(object):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
self.assertTrue(operator.is_not(a,c))
def test_attrgetter(self):
+ operator = self.module
class A:
pass
a = A()
@@ -316,6 +350,7 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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 @@ class OperatorTestCase(unittest.TestCase):
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,
- )
-
- support.run_unittest(*test_classes)
-
- # verify reference counting
- if verbose and hasattr(sys, "gettotalrefcount"):
- import gc
- counts = [None] * 5
- for i in range(len(counts)):
- support.run_unittest(*test_classes)
- gc.collect()
- counts[i] = sys.gettotalrefcount()
- print(counts)
+
+ def test_length_hint(self):
+ operator = self.module
+ class X(object):
+ def __init__(self, value):
+ self.value = value
+
+ def __length_hint__(self):
+ if type(self.value) is type:
+ raise self.value
+ else:
+ return self.value
+
+ 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 eaee504ac8..3c8c6124a2 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -730,7 +730,7 @@ class TestStandard(BaseTest):
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 +740,15 @@ class TestStandard(BaseTest):
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 d70a0aeaf8..50240939d8 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -24,6 +24,9 @@ import itertools
import stat
import locale
import codecs
+import decimal
+import fractions
+import pickle
try:
import threading
except ImportError:
@@ -32,6 +35,10 @@ try:
import resource
except ImportError:
resource = None
+try:
+ import fcntl
+except ImportError:
+ fcntl = None
from test.script_helper import assert_python_ok
@@ -256,6 +263,13 @@ class StatAttributeTests(unittest.TestCase):
warnings.simplefilter("ignore", DeprecationWarning)
self.check_stat_attributes(fname)
+ def test_stat_result_pickle(self):
+ result = os.stat(self.fname)
+ p = pickle.dumps(result)
+ self.assertIn(b'\x03cos\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 +277,7 @@ class StatAttributeTests(unittest.TestCase):
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 +314,21 @@ class StatAttributeTests(unittest.TestCase):
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')
+
+ p = pickle.dumps(result)
+ self.assertIn(b'\x03cos\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 +507,9 @@ class StatAttributeTests(unittest.TestCase):
# 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 +905,17 @@ class MakedirTests(unittest.TestCase):
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
@@ -1133,27 +1173,27 @@ class ExecTests(unittest.TestCase):
@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",
@@ -1287,41 +1327,57 @@ class PosixUidGidTests(unittest.TestCase):
@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):
@@ -1511,6 +1567,52 @@ class Win32KillTests(unittest.TestCase):
@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'
@@ -2175,6 +2277,197 @@ class TermsizeTests(unittest.TestCase):
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(
@@ -2192,6 +2485,7 @@ def test_main():
PosixUidGidTests,
Pep383Tests,
Win32KillTests,
+ Win32ListdirTests,
Win32SymlinkTests,
NonLocalSymlinkTests,
FSEncodingTests,
@@ -2204,7 +2498,10 @@ def test_main():
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 3908a0506e..c9e2a24767 100644
--- a/Lib/test/test_ossaudiodev.py
+++ b/Lib/test/test_ossaudiodev.py
@@ -44,7 +44,7 @@ class OSSAudioDevTests(unittest.TestCase):
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 @@ class OSSAudioDevTests(unittest.TestCase):
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 0000000000..2268f94a72
--- /dev/null
+++ b/Lib/test/test_pathlib.py
@@ -0,0 +1,1840 @@
+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 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')
+
+ 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'))
+ # 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, '/.gz')
+ self.assertRaises(ValueError, P('a/b').with_suffix, 'c/d')
+ self.assertRaises(ValueError, P('a/b').with_suffix, '.c/.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_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')
+
+ 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(shutil.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())
+ if not symlink_skip_reason:
+ self.assertIs(True, (p / 'linkA').exists())
+ self.assertIs(True, (p / 'linkB').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(shutil.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())
+ 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())
+ 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())
+ 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())
+
+ @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())
+
+ @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())
+
+ 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())
+
+ 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 03084e4d12..74253b338f 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 @@ def test_pdb_breakpoint_commands():
... '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 @@ def test_pdb_breakpoint_commands():
(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 @@ def test_pdb_skip_modules():
# 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,311 @@ def test_pdb_run_with_code_object():
(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
+
+ >>> 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):
@@ -617,6 +925,36 @@ class PdbTestCase(unittest.TestCase):
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 1cacdea569..50257923fe 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -5,44 +5,28 @@ from io import StringIO
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 @@ class TestTranforms(unittest.TestCase):
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 @@ class TestTranforms(unittest.TestCase):
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 @@ class TestTranforms(unittest.TestCase):
('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 @@ class TestTranforms(unittest.TestCase):
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 @@ class TestTranforms(unittest.TestCase):
('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 @@ class TestTranforms(unittest.TestCase):
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 @@ class TestTranforms(unittest.TestCase):
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 @@ def test_main(verbose=None):
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 7f10472856..b85a26ad65 100644
--- a/Lib/test/test_pep247.py
+++ b/Lib/test/test_pep247.py
@@ -15,12 +15,14 @@ class Pep247Test(unittest.TestCase):
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_pep277.py b/Lib/test/test_pep277.py
index 4b16cbb383..9bae6dcad7 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -99,10 +99,6 @@ class UnicodeFileTests(unittest.TestCase):
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" %
diff --git a/Lib/test/test_pep3151.py b/Lib/test/test_pep3151.py
index 2792c10f98..7d4a5d8446 100644
--- a/Lib/test/test_pep3151.py
+++ b/Lib/test/test_pep3151.py
@@ -157,8 +157,6 @@ class AttributesTest(unittest.TestCase):
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 558cdb56d2..7c98c460b9 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 @@ class UsageTests(unittest.TestCase):
# 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_pickle.py b/Lib/test/test_pickle.py
index fbe96ac2a8..0b2fe1ef2a 100644
--- a/Lib/test/test_pickle.py
+++ b/Lib/test/test_pickle.py
@@ -83,13 +83,17 @@ class PyPicklerUnpicklerObjectTests(AbstractPicklerUnpicklerObjectTests):
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)
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index 355efe7566..9883000945 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -199,14 +199,14 @@ class TestPkg(unittest.TestCase):
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 @@ class TestPkg(unittest.TestCase):
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 @@ class TestPkg(unittest.TestCase):
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 a8426b5c9a..370b2aae28 100644
--- a/Lib/test/test_pkgimport.py
+++ b/Lib/test/test_pkgimport.py
@@ -6,7 +6,7 @@ import random
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 fd0661450a..c4410a9041 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
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 PkgutilTests(unittest.TestCase):
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 @@ class ExtendPathTests(unittest.TestCase):
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 @@ class ExtendPathTests(unittest.TestCase):
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 @@ class ExtendPathTests(unittest.TestCase):
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,25 @@ class ImportlibMigrationTests(unittest.TestCase):
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_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 9e86b3de64..bb7cc159b4 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 @@ class TestPlistlib(unittest.TestCase):
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 @@ class TestPlistlib(unittest.TestCase):
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,215 @@ class TestPlistlib(unittest.TestCase):
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])
+ 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()))
+ 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 +350,27 @@ class TestPlistlib(unittest.TestCase):
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 +379,130 @@ class TestPlistlib(unittest.TestCase):
"<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))
+
+
+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 a07a7199c1..a0a332bdbc 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 @@ from test.support import TESTFN, run_unittest, reap_threads, cpython_only
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 @@ class PollTests(unittest.TestCase):
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 @@ class PollTests(unittest.TestCase):
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 @@ class PollTests(unittest.TestCase):
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 @@ class PollTests(unittest.TestCase):
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 5809be66bb..d076fc1b9c 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -18,6 +18,19 @@ threading = test_support.import_module('threading')
HOST = test_support.HOST
PORT = 0
+SUPPORTS_SSL = False
+if hasattr(poplib, 'POP3_SSL'):
+ import ssl
+ from ssl import HAS_SNI
+
+ 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")
+else:
+ HAS_SNI = False
+
+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 +46,15 @@ line3\r\n\
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 +129,65 @@ class DummyPOP3Handler(asynchat.async_chat):
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 +312,43 @@ class TestPOP3Class(TestCase):
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())
+
+ @requires_ssl
+ def test_stls(self):
+ expected = b'+OK Begin TLS negotiation'
+ resp = self.client.stls()
+ self.assertEqual(resp, expected)
+
+ @requires_ssl
+ @skipUnless(HAS_SNI, 'No SNI support in ssl module')
+ 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)
-SUPPORTS_SSL = False
-if hasattr(poplib, 'POP3_SSL'):
- import ssl
- SUPPORTS_SSL = True
- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem")
+if SUPPORTS_SSL:
class DummyPOP3_SSLHandler(DummyPOP3Handler):
@@ -260,35 +360,13 @@ if hasattr(poplib, 'POP3_SSL'):
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 +384,60 @@ class TestPOP3_SSLClass(TestPOP3Class):
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 +495,7 @@ class TestTimeouts(TestCase):
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 5c09ebfe8e..9a5ee91f66 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -603,8 +603,10 @@ class PosixTester(unittest.TestCase):
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 @@ class PosixTester(unittest.TestCase):
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 @@ class PosixTester(unittest.TestCase):
@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
-
- 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")
+ 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
- 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)
+ 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")
- _create_and_do_getcwd(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)
- finally:
- os.chdir(curdir)
- support.rmtree(base_path)
+ _create_and_do_getcwd(dirname)
+
+ 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()")
@@ -1121,6 +1121,23 @@ class PosixTester(unittest.TestCase):
# 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", "symlink"):
+ function = getattr(os, name, None)
+
+ if function:
+ 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 0e7d866485..412849cff3 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -186,63 +186,6 @@ class PosixPathTest(unittest.TestCase):
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 +538,6 @@ class PosixPathTest(unittest.TestCase):
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 a85298e26f..3d364c4595 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,54 @@ frozenset2({0,
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=20), """\
+'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)
+
+ 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 9d6dbea46b..7eea349115 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):
+ """Test correct operation of the print function."""
+
def check(self, expected, args,
- sep=NotDefined, end=NotDefined, file=NotDefined):
+ 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.
+ # 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
+ # 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 @@ class TestPrint(unittest.TestCase):
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 @@ class TestPrint(unittest.TestCase):
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 @@ class TestPrint(unittest.TestCase):
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 @@ class TestPrint(unittest.TestCase):
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 cd7ec58e23..1fc3c42669 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 @@ from test.profilee import testfunc, timer
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 @@ class ProfileTest(unittest.TestCase):
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 @@ def regenerate_expected_output(filename, cls):
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 29297f8841..8916861f5b 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -187,7 +187,7 @@ class PtyTest(unittest.TestCase):
##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 f3c1a6a44b..154c08a6a2 100644
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -1,7 +1,9 @@
-import imp
+import importlib.util
import os
import py_compile
import shutil
+import stat
+import sys
import tempfile
import unittest
@@ -13,7 +15,7 @@ class PyCompileTests(unittest.TestCase):
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 +37,26 @@ class PyCompileTests(unittest.TestCase):
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 +76,22 @@ class PyCompileTests(unittest.TestCase):
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)
+
if __name__ == "__main__":
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index e83989e2d8..88aff898d4 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -142,7 +142,7 @@ class PyclbrTest(TestCase):
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,7 +158,7 @@ class PyclbrTest(TestCase):
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('aifc', ignore=('openfp', '_aifc_params')) # set with = in module
cm('sre_parse', ignore=('dump',)) # from sre_constants import *
cm('pdb')
cm('pydoc')
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 43f4163dae..f26fb15f53 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -6,11 +6,13 @@ import difflib
import inspect
import pydoc
import keyword
+import _pickle
import pkgutil
import re
import string
import test.support
import time
+import types
import unittest
import xml.etree
import textwrap
@@ -20,7 +22,7 @@ from test.script_helper import assert_python_ok
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 +31,6 @@ try:
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)',
@@ -212,6 +210,75 @@ missing_pattern = "no Python documentation found for '%s'"
# 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
@@ -320,6 +387,16 @@ class PydocDocTest(unittest.TestCase):
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)
@@ -421,6 +498,38 @@ class PydocDocTest(unittest.TestCase):
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 +618,55 @@ class PydocImportTest(PydocBaseTest):
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):
@@ -544,6 +702,42 @@ class TestDescriptions(unittest.TestCase):
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):
@@ -615,6 +809,128 @@ class TestHelper(unittest.TestCase):
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:
@@ -624,6 +940,7 @@ def test_main():
PydocServerTest,
PydocUrlHandlerTest,
TestHelper,
+ PydocWithMetaClasses,
)
finally:
reap_children()
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index a475207fbd..37a222d622 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 @@ class TestBasicOps:
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 @@ class TestBasicOps:
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
@@ -203,6 +249,25 @@ class SystemRandom_TestBasicOps(TestBasicOps, unittest.TestCase):
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 +337,16 @@ class MersenneTwister_TestBasicOps(TestBasicOps, unittest.TestCase):
# 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 +486,38 @@ class MersenneTwister_TestBasicOps(TestBasicOps, unittest.TestCase):
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
@@ -528,6 +635,106 @@ class TestDistributions(unittest.TestCase):
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 aab98abf4d..fecda1ba8a 100644
--- a/Lib/test/test_range.py
+++ b/Lib/test/test_range.py
@@ -313,7 +313,7 @@ class RangeTest(unittest.TestCase):
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 @@ class RangeTest(unittest.TestCase):
(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),
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 5466b20653..33ccd15398 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -3,10 +3,12 @@ from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
import io
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 +17,26 @@ from weakref import proxy
# 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')
@@ -53,6 +71,15 @@ class ReTests(unittest.TestCase):
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 +237,29 @@ class ReTests(unittest.TestCase):
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 +281,53 @@ class ReTests(unittest.TestCase):
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,6 +349,36 @@ class ReTests(unittest.TestCase):
(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'))
@@ -1053,6 +1160,28 @@ class ReTests(unittest.TestCase):
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
@@ -1082,6 +1211,8 @@ class ReTests(unittest.TestCase):
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'])
@@ -1093,6 +1224,83 @@ class ReTests(unittest.TestCase):
(7, 9))
+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])
+
+
def run_re_tests():
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
if verbose:
@@ -1222,7 +1430,7 @@ def run_re_tests():
def test_main():
- run_unittest(ReTests)
+ run_unittest(__name__)
run_re_tests()
if __name__ == "__main__":
diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
new file mode 100644
index 0000000000..a398a4f836
--- /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 c233b1d67b..ae67f06bc4 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 @@ class LongReprTest(unittest.TestCase):
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 @@ class LongReprTest(unittest.TestCase):
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 0cf61cb17a..2ecae0fc45 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 @@ class ResourceTest(unittest.TestCase):
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 @@ class ResourceTest(unittest.TestCase):
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_runpy.py b/Lib/test/test_runpy.py
index 2ddba3413a..786b813b32 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -5,7 +5,7 @@ import os.path
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 @@ implicit_namespace = {
"__cached__": None,
"__package__": None,
"__doc__": None,
+ "__spec__": None
}
example_namespace = {
"sys": sys,
@@ -67,11 +68,19 @@ class CodeExecutionMixin:
# 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 @@ class CodeExecutionMixin:
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 @@ class ExecutionLayerTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class ExecutionLayerTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunModuleTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunModuleTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunModuleTestCase(unittest.TestCase, CodeExecutionMixin):
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 __future__ import absolute_import
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 @@ from ..uncle.cousin import nephew
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 @@ from ..uncle.cousin import nephew
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 @@ from ..uncle.cousin import nephew
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 @@ from ..uncle.cousin import nephew
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 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ class RunPathTestCase(unittest.TestCase, CodeExecutionMixin):
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 @@ s = "non-ASCII: h\xe9"
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_sched.py b/Lib/test/test_sched.py
index 79fa7d3e3d..fe8e785092 100644
--- a/Lib/test/test_sched.py
+++ b/Lib/test/test_sched.py
@@ -195,8 +195,5 @@ class TestCase(unittest.TestCase):
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 26ce0424f8..b325545f32 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -715,6 +715,19 @@ class ScopeTests(unittest.TestCase):
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 @@ class ScopeTests(unittest.TestCase):
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_select.py b/Lib/test/test_select.py
index ddb9a0f67e..8f9a1c9d88 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -5,7 +5,7 @@ import sys
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 @@ class SelectTestCase(unittest.TestCase):
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 0000000000..34edd7630d
--- /dev/null
+++ b/Lib/test/test_selectors.py
@@ -0,0 +1,453 @@
+import errno
+import os
+import random
+import selectors
+import signal
+import socket
+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)
+
+ 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)
+
+ 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)
+
+ 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
+ self.assertTrue(0.8 <= dt <= 1.6, 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 = hard
+ 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 c0bca2fb88..bfef621093 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -848,8 +848,6 @@ class TestBasicOps:
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):
diff --git a/Lib/test/test_shelve.py b/Lib/test/test_shelve.py
index 13c126566d..bd51d868fe 100644
--- a/Lib/test/test_shelve.py
+++ b/Lib/test/test_shelve.py
@@ -148,6 +148,19 @@ class TestCase(unittest.TestCase):
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 c3fb8a7d2c..a483fe127c 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -18,7 +18,8 @@ from shutil import (_make_tarball, _make_zipfile, make_archive,
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
@@ -746,13 +747,13 @@ class TestShutil(unittest.TestCase):
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.skipIf(os.name == 'nt', 'temporarily disabled on Windows')
@unittest.skipUnless(hasattr(os, 'link'), 'requires os.link')
@@ -765,7 +766,7 @@ class TestShutil(unittest.TestCase):
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 +786,7 @@ class TestShutil(unittest.TestCase):
# 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)
@@ -1293,6 +1294,16 @@ class TestShutil(unittest.TestCase):
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 +1612,7 @@ class TestCopyFile(unittest.TestCase):
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 +1626,12 @@ class TestCopyFile(unittest.TestCase):
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 +1641,14 @@ class TestCopyFile(unittest.TestCase):
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 +1670,7 @@ class TestCopyFile(unittest.TestCase):
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 +1688,7 @@ class TestCopyFile(unittest.TestCase):
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 +1759,5 @@ class TermsizeTests(unittest.TestCase):
self.assertEqual(expected, actual)
-def test_main():
- support.run_unittest(TestShutil, TestMove, TestCopyFile,
- TermsizeTests, TestWhich)
-
if __name__ == '__main__':
- test_main()
+ unittest.main()
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index 191d4cf691..a6f2c64857 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -15,9 +15,6 @@ try:
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 exit_subprocess():
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 @@ class WakeupSignalTests(unittest.TestCase):
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 @@ class WakeupSignalTests(unittest.TestCase):
# 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:
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index f3bd168168..2d214f4baf 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -230,11 +230,7 @@ class HelperFunctionsTests(unittest.TestCase):
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']
@@ -432,5 +428,38 @@ class ImportSideEffectTests(unittest.TestCase):
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'}
+ 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 2df9271da7..9203d5eb19 100644
--- a/Lib/test/test_slice.py
+++ b/Lib/test/test_slice.py
@@ -4,8 +4,70 @@ import unittest
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 @@ class SliceTest(unittest.TestCase):
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 @@ class SliceTest(unittest.TestCase):
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 3bbc6b7e53..3f7b9b4175 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -222,7 +222,7 @@ class DebuggingServerTests(unittest.TestCase):
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 DebuggingServerTests(unittest.TestCase):
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 @@ class NonConnectingTests(unittest.TestCase):
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")
@@ -852,6 +846,15 @@ class SMTPSimTests(unittest.TestCase):
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_with_statement(self):
with smtplib.SMTP(HOST, self.port) as smtp:
code, message = smtp.noop()
diff --git a/Lib/test/test_smtpnet.py b/Lib/test/test_smtpnet.py
index e97cf363bb..7f9db2ddf0 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,7 @@ class SmtpTest(unittest.TestCase):
class SmtpSSLTest(unittest.TestCase):
testServer = 'smtp.gmail.com'
remotePort = 465
- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
+ can_verify = check_ssl_verifiy(testServer, remotePort)
def test_connect(self):
support.get_attribute(smtplib, 'SMTP_SSL')
@@ -47,9 +59,19 @@ class SmtpSSLTest(unittest.TestCase):
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=context)
+ server.ehlo()
+ server.quit()
+
+ @unittest.skipUnless(can_verify, "SSL certificate can't be verified")
+ def test_connect_using_sslcontext_verified(self):
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=self.context)
+ 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 10046887d7..5e0abe0b36 100644
--- a/Lib/test/test_sndhdr.py
+++ b/Lib/test/test_sndhdr.py
@@ -12,7 +12,7 @@ class TestFormats(unittest.TestCase):
('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 450aee1d43..e94f5396c5 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1,6 +1,5 @@
import unittest
from test import support
-from unittest.case import _ExpectedFailure
import errno
import io
@@ -21,13 +20,13 @@ import math
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
@@ -43,7 +42,7 @@ 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 +117,42 @@ class SocketCANTest(unittest.TestCase):
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 +268,6 @@ class ThreadableTest:
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 +318,7 @@ class ThreadedCANSocketTest(SocketCANTest, ThreadableTest):
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 +566,7 @@ class SCTPStreamBase(InetTestBase):
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 +627,7 @@ def requireSocket(*args):
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:
@@ -623,8 +645,17 @@ class GeneralModuleTests(unittest.TestCase):
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))
def test_weakref(self):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -642,11 +673,11 @@ class GeneralModuleTests(unittest.TestCase):
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 +740,13 @@ class GeneralModuleTests(unittest.TestCase):
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 +754,27 @@ class GeneralModuleTests(unittest.TestCase):
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 +808,8 @@ class GeneralModuleTests(unittest.TestCase):
'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 +831,7 @@ class GeneralModuleTests(unittest.TestCase):
try:
# On some versions, this crashes the interpreter.
socket.getnameinfo(('x', 0, 0, 0), 0)
- except socket.error:
+ except OSError:
pass
def testNtoH(self):
@@ -833,17 +878,17 @@ class GeneralModuleTests(unittest.TestCase):
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 +944,7 @@ class GeneralModuleTests(unittest.TestCase):
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 +977,17 @@ class GeneralModuleTests(unittest.TestCase):
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 +1036,7 @@ class GeneralModuleTests(unittest.TestCase):
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 +1063,17 @@ class GeneralModuleTests(unittest.TestCase):
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 +1101,7 @@ class GeneralModuleTests(unittest.TestCase):
# 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,13 +1128,19 @@ class GeneralModuleTests(unittest.TestCase):
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()
@@ -1126,9 +1193,12 @@ class GeneralModuleTests(unittest.TestCase):
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), 'SocketType.SOCK_STREAM')
infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM)
for _, socktype, _, _, _ in infos:
self.assertEqual(socktype, socket.SOCK_STREAM)
@@ -1176,7 +1246,7 @@ class GeneralModuleTests(unittest.TestCase):
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')
@@ -1291,10 +1361,31 @@ class GeneralModuleTests(unittest.TestCase):
@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), 'SocketType.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):
@@ -1304,10 +1395,35 @@ class BasicCANTest(unittest.TestCase):
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(('', ))
@@ -1315,7 +1431,7 @@ class BasicCANTest(unittest.TestCase):
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"),
@@ -1340,19 +1456,8 @@ class BasicCANTest(unittest.TestCase):
@unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.')
-@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)
@@ -1401,6 +1506,46 @@ class CANTest(ThreadedCANSocketTest):
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):
@@ -1623,7 +1768,7 @@ class BasicTCPTest(SocketConnectedTest):
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
@@ -1992,7 +2137,7 @@ class SendmsgTests(SendrecvmsgServerTimeoutBase):
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")
@@ -2003,7 +2148,7 @@ class SendmsgTests(SendrecvmsgServerTimeoutBase):
def _testSendmsgAfterClose(self):
self.cli_sock.close()
- self.assertRaises(socket.error, self.sendmsgToServer, [MSG])
+ self.assertRaises(OSError, self.sendmsgToServer, [MSG])
class SendmsgStreamTests(SendmsgTests):
@@ -2047,7 +2192,7 @@ class SendmsgStreamTests(SendmsgTests):
@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,
@@ -2067,9 +2212,9 @@ class SendmsgConnectionlessTests(SendmsgTests):
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)
@@ -2155,7 +2300,7 @@ class RecvmsgGenericTests(SendrecvmsgBase):
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
@@ -2606,7 +2751,7 @@ class SCMRightsTest(SendrecvmsgServerTimeoutBase):
# 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])
@@ -2984,7 +3129,7 @@ class RFC3542AncillaryTest(SendrecvmsgServerTimeoutBase):
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],
@@ -3442,10 +3587,10 @@ class InterruptedRecvTimeoutTest(InterruptedTimeoutBase, UDPTestBase):
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)
@@ -3502,9 +3647,9 @@ class InterruptedSendTimeoutTest(InterruptedTimeoutBase,
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)
@@ -3603,7 +3748,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
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.")
@@ -3638,7 +3783,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
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.")
@@ -3668,7 +3813,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
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.")
@@ -3698,7 +3843,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
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.")
@@ -3781,7 +3926,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
# 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))
@@ -3873,7 +4018,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
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
@@ -3910,7 +4055,7 @@ class FileObjectInterruptedTestCase(unittest.TestCase):
@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")
@@ -4022,7 +4167,7 @@ class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
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)
@@ -4171,7 +4316,7 @@ class NetworkConnectionNoServer(unittest.TestCase):
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)
@@ -4179,7 +4324,7 @@ class NetworkConnectionNoServer(unittest.TestCase):
# 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
@@ -4327,7 +4472,7 @@ class TCPTimeoutTest(SocketTCPTest):
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)")
@@ -4384,7 +4529,7 @@ class UDPTimeoutTest(SocketUDPTest):
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)")
@@ -4394,10 +4539,10 @@ class UDPTimeoutTest(SocketUDPTest):
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):
@@ -4424,7 +4569,7 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
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.
@@ -4681,7 +4826,7 @@ class ContextManagersTest(ThreadedTCPSocketTest):
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):
@@ -4709,19 +4854,76 @@ class ContextManagersTest(ThreadedTCPSocketTest):
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"),
@@ -4890,7 +5092,7 @@ def test_main():
NetworkConnectionAttributesTest,
NetworkConnectionBehaviourTest,
ContextManagersTest,
- CloexecConstantTest,
+ InheritanceTest,
NonblockConstantTest
])
tests.append(BasicSocketPairTest)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 59d8e5dcb7..0617b30a69 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 @@ HOST = test.support.HOST
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 @@ class SocketServerTest(unittest.TestCase):
for fn in self.test_files:
try:
os.remove(fn)
- except os.error:
+ except OSError:
pass
self.test_files[:] = []
@@ -96,21 +96,7 @@ class SocketServerTest(unittest.TestCase):
# 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
diff --git a/Lib/test/test_pep263.py b/Lib/test/test_source_encoding.py
index 324ae38619..0c41e50662 100644
--- a/Lib/test/test_pep263.py
+++ b/Lib/test/test_source_encoding.py
@@ -1,9 +1,13 @@
# -*- coding: koi8-r -*-
import unittest
-from test import support
+from test.support import TESTFN, unlink, unload
+import importlib
+import os
+import sys
+import subprocess
-class PEP263Test(unittest.TestCase):
+class SourceEncodingTest(unittest.TestCase):
def test_pep263(self):
self.assertEqual(
@@ -55,6 +59,15 @@ class PEP263Test(unittest.TestCase):
# 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')
@@ -72,9 +85,61 @@ class PEP263Test(unittest.TestCase):
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)
+
+ 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_main():
- support.run_unittest(PEP263Test)
-if __name__=="__main__":
- test_main()
+if __name__ == "__main__":
+ unittest.main()
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index e52a71c241..1a2a9f0caa 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -6,6 +6,7 @@ from test import support
import socket
import select
import time
+import datetime
import gc
import os
import errno
@@ -17,19 +18,15 @@ import asyncore
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 @@ ONLYKEY_PROTECTED = data_file("ssl_key.passwd.pem")
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 @@ NULLBYTECERT = data_file("nullbytecert.pem")
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 @@ def no_sslv2_implies_sslv3_hello():
# 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 @@ def skip_if_broken_ubuntu_ssl(func):
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
@@ -179,8 +203,9 @@ class BasicSocketTests(unittest.TestCase):
(('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 +223,12 @@ class BasicSocketTests(unittest.TestCase):
(('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)
@@ -280,15 +311,15 @@ class BasicSocketTests(unittest.TestCase):
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 +344,15 @@ class BasicSocketTests(unittest.TestCase):
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 +524,114 @@ class BasicSocketTests(unittest.TestCase):
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 +648,8 @@ class ContextTests(unittest.TestCase):
@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 +686,7 @@ class ContextTests(unittest.TestCase):
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 +701,32 @@ class ContextTests(unittest.TestCase):
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=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 +810,8 @@ class ContextTests(unittest.TestCase):
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 +822,64 @@ class ContextTests(unittest.TestCase):
# 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 +927,158 @@ class ContextTests(unittest.TestCase):
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')
+
+ def test_create_default_context(self):
+ ctx = ssl.create_default_context()
+ 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)
+
+ 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_TLSv1)
+ self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED)
+ self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
+
+ ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
+ 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)
+
+ 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):
@@ -919,6 +1284,28 @@ class NetworkedTests(unittest.TestCase):
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 +1423,36 @@ class NetworkedTests(unittest.TestCase):
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 +1580,7 @@ else:
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 +1690,7 @@ else:
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 +1794,19 @@ else:
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 +1816,8 @@ else:
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 +1841,7 @@ else:
stats.update({
'compression': s.compression(),
'cipher': s.cipher(),
+ 'peercert': s.getpeercert(),
'client_npn_protocol': s.selected_npn_protocol()
})
s.close()
@@ -1448,12 +1867,15 @@ else:
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 +1886,7 @@ else:
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 +1905,11 @@ else:
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 +1920,14 @@ else:
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 +1949,87 @@ else:
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.")
+
+ @needs_sni
+ 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 +2048,7 @@ else:
"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 +2076,7 @@ else:
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')
@@ -1609,7 +2119,7 @@ else:
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(
@@ -1669,6 +2179,49 @@ else:
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)
+ 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)
+ 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 +2282,7 @@ else:
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')
@@ -1985,6 +2538,20 @@ else:
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,7 +2563,7 @@ else:
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]))
@@ -2129,6 +2696,124 @@ else:
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 +2833,16 @@ def test_main(verbose=False):
(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 eb3f07a63d..af6ced4204 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
+
+c_stat = import_fresh_module('stat', fresh=['_stat'])
+py_stat = import_fresh_module('stat', blocked=['_stat'])
+
+class TestFilemode:
+ statmod = None
-class TestFilemode(unittest.TestCase):
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 @@ class TestFilemode(unittest.TestCase):
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 @@ class TestFilemode(unittest.TestCase):
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 @@ class TestFilemode(unittest.TestCase):
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 0000000000..6f5c9a649d
--- /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_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_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 4f39cc79ac..772cd0688c 100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -182,15 +182,15 @@ class Y1900Tests(unittest.TestCase):
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 @@ class Y1900Tests(unittest.TestCase):
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_strtod.py b/Lib/test/test_strtod.py
index c5979fc989..41b6e5f833 100644
--- a/Lib/test/test_strtod.py
+++ b/Lib/test/test_strtod.py
@@ -248,7 +248,7 @@ class StrtodTests(unittest.TestCase):
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 50cae052f3..0107eebca6 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 @@ import sys
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 @@ class StructTest(unittest.TestCase):
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 @@ class StructTest(unittest.TestCase):
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 @@ class StructTest(unittest.TestCase):
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 @@ class StructTest(unittest.TestCase):
# 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 @@ class StructTest(unittest.TestCase):
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 a89e9556c1..353d0eadcc 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -38,7 +38,7 @@ class StructSeqTest(unittest.TestCase):
# 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 f5a70a3873..46e012d142 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -11,6 +11,7 @@ import errno
import tempfile
import time
import re
+import selectors
import sysconfig
import warnings
import select
@@ -19,10 +20,6 @@ import gc
import textwrap
try:
- import resource
-except ImportError:
- resource = None
-try:
import threading
except ImportError:
threading = None
@@ -162,8 +159,28 @@ class ProcessTestCase(BaseTestCase):
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 @@ class ProcessTestCase(BaseTestCase):
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:
@@ -853,8 +884,9 @@ class ProcessTestCase(BaseTestCase):
#
# 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 +897,7 @@ class ProcessTestCase(BaseTestCase):
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 +906,7 @@ class ProcessTestCase(BaseTestCase):
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):
@@ -982,8 +1014,7 @@ class ProcessTestCase(BaseTestCase):
# 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)
@@ -1114,47 +1145,6 @@ class ProcessTestCase(BaseTestCase):
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 +1233,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1256,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1296,10 @@ class POSIXProcessTestCase(BaseTestCase):
"""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 +1498,28 @@ class POSIXProcessTestCase(BaseTestCase):
# 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 +1534,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1595,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1611,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1635,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1661,7 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1693,47 @@ class POSIXProcessTestCase(BaseTestCase):
# 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 +1839,9 @@ class POSIXProcessTestCase(BaseTestCase):
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()
@@ -1881,6 +1886,8 @@ class POSIXProcessTestCase(BaseTestCase):
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 +1910,32 @@ class POSIXProcessTestCase(BaseTestCase):
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 +2023,7 @@ class POSIXProcessTestCase(BaseTestCase):
# 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:
@@ -2175,15 +2208,16 @@ class CommandTests(unittest.TestCase):
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 1655317c07..0f4134e982 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 SunauPCM16Test(SunauTest, unittest.TestCase):
""")
+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 @@ class SunauULAWTest(SunauTest, unittest.TestCase):
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 8808c47edd..e99ca9ed37 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 @@ class TestUntestedModules(unittest.TestCase):
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 1e272ee2cf..37fc2d9134 100644
--- a/Lib/test/test_super.py
+++ b/Lib/test/test_super.py
@@ -44,6 +44,11 @@ class G(A):
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 @@ class TestSuper(unittest.TestCase):
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 @@ class TestSuper(unittest.TestCase):
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 cb6f84e73d..9bd0a01948 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -304,6 +304,7 @@ class TestSupport(unittest.TestCase):
# 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 5926b69c93..a9d3628819 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -33,7 +33,7 @@ SyntaxError: invalid syntax
>>> 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 @@ Traceback (most recent call last):
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 f768e9b7c3..5a9699ff20 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -7,6 +7,9 @@ import textwrap
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 @@ class SysModuleTest(unittest.TestCase):
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 @@ class SysModuleTest(unittest.TestCase):
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 @@ class SysModuleTest(unittest.TestCase):
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 @@ class SysModuleTest(unittest.TestCase):
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,7 +512,7 @@ class SysModuleTest(unittest.TestCase):
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)
@@ -522,6 +541,42 @@ class SysModuleTest(unittest.TestCase):
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):
@@ -589,6 +644,39 @@ class SysModuleTest(unittest.TestCase):
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):
@@ -634,7 +722,7 @@ class SizeofTest(unittest.TestCase):
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 +801,7 @@ class SizeofTest(unittest.TestCase):
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 +847,7 @@ class SizeofTest(unittest.TestCase):
# memoryview
check(memoryview(b''), size('Pnin 2P2n2i5P 3cPn'))
# module
- check(unittest, size('PnP'))
+ check(unittest, size('PnPPP'))
# None
check(None, size(''))
# NotImplementedType
@@ -813,11 +901,11 @@ class SizeofTest(unittest.TestCase):
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_sysconfig.py b/Lib/test/test_sysconfig.py
index 03f67fd476..804c446716 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -5,7 +5,7 @@ import subprocess
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 @@ class TestSysConfig(unittest.TestCase):
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 @@ class TestSysConfig(unittest.TestCase):
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 @@ class TestSysConfig(unittest.TestCase):
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()
-
- self.assertEqual(status, 0)
- self.assertEqual(my_platform, test_platform)
+ 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)
def test_srcdir(self):
# See Issues #15322, #15364.
@@ -371,6 +369,26 @@ class TestSysConfig(unittest.TestCase):
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 4e7621e5ec..b7fd2bdabb 100644
--- a/Lib/test/test_syslog.py
+++ b/Lib/test/test_syslog.py
@@ -32,6 +32,10 @@ class Test(unittest.TestCase):
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 68fe60801d..92f8bfe920 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -7,7 +7,7 @@ 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 +27,13 @@ def md5sum(data):
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 +273,7 @@ class ListTest(ReadTest, unittest.TestCase):
# ?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 +321,7 @@ class CommonReadTest(ReadTest):
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):
@@ -1847,6 +1844,171 @@ class MiscTest(unittest.TestCase):
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 +2017,20 @@ class ContextManagerTest(unittest.TestCase):
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 +2136,8 @@ def setUpModule():
support.unlink(TEMPDIR)
os.makedirs(TEMPDIR)
+ global testtarnames
+ testtarnames = [tarname]
with open(tarname, "rb") as fobj:
data = fobj.read()
@@ -1981,6 +2145,7 @@ def setUpModule():
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)
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 5226ee676e..d12fb22484 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -504,40 +504,6 @@ class TclTest(unittest.TestCase):
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')
-
class BigmemTclTest(unittest.TestCase):
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index c9f2ccb462..ee1c35705b 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 @@ class TelnetAlike(telnetlib.Telnet):
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 = {}
+
+ @property
+ def resolution(self):
+ return 1e-3
+
+ def register(self, fileobj, events, data=None):
+ key = selectors.SelectorKey(fileobj, 0, events, data)
+ self.keys[fileobj] = key
+ return key
- 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)
+ def unregister(self, fileobj):
+ return self.keys.pop(fileobj)
- def poll(self, timeout=None):
+ 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 get_map(self):
+ return self.keys
- def unregister(self, fd):
- self._file_objs.remove(fd)
@contextlib.contextmanager
def test_socket(reads):
@@ -159,7 +155,7 @@ def test_socket(reads):
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 @@ def test_telnet(reads=(), cls=TelnetAlike, use_poll=None):
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 @@ class ReadTests(ExpectAndReadTestCase):
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 @@ class ExpectTests(ExpectAndReadTestCase):
(_,_,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 5a970355e6..cf2ae080be 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -37,7 +37,7 @@ else:
# 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 +64,7 @@ class BaseTestCase(unittest.TestCase):
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 +153,7 @@ class TestRandomNameSequence(BaseTestCase):
# 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 +192,7 @@ class TestCandidateTempdirList(BaseTestCase):
try:
dirname = os.getcwd()
- except (AttributeError, os.error):
+ except (AttributeError, OSError):
dirname = os.curdir
self.assertIn(dirname, cand)
@@ -332,7 +332,7 @@ class TestMkstempInner(BaseTestCase):
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 +349,7 @@ class TestMkstempInner(BaseTestCase):
v="q"
file = self.do_create()
+ self.assertEqual(os.get_inheritable(file.fd), False)
fd = "%d" % file.fd
try:
@@ -365,7 +366,7 @@ class TestMkstempInner(BaseTestCase):
# 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 +476,20 @@ class TestGetTempDir(BaseTestCase):
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 +578,7 @@ class TestMkdtemp(BaseTestCase):
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
@@ -1139,8 +1154,9 @@ class TestTemporaryDirectory(BaseTestCase):
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 +1181,7 @@ class TestTemporaryDirectory(BaseTestCase):
"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 c86f5cfae8..1bba77eb9e 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 @@ What a mess!
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 @@ How *do* you spell that odd word, anyways?
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 @@ class IndentTestCase(unittest.TestCase):
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 54372813b9..614490199a 100644
--- a/Lib/test/test_thread.py
+++ b/Lib/test/test_thread.py
@@ -68,7 +68,7 @@ class ThreadRunningTests(BasicThreadTest):
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 6c2965ba6e..c7bfea07a1 100644
--- a/Lib/test/test_threaded_import.py
+++ b/Lib/test/test_threaded_import.py
@@ -5,8 +5,8 @@
# 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
@@ -57,7 +57,7 @@ circular_imports_modules = {
}
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 +65,8 @@ class Finder:
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 +80,7 @@ class FlushingFinder:
"""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 +145,13 @@ class ThreadedImportTests(unittest.TestCase):
# 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)
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 11c8979517..7170f60f1c 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -17,13 +17,18 @@ 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 +108,7 @@ class ThreadTests(BaseTestCase):
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 +476,127 @@ class ThreadTests(BaseTestCase):
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 +616,48 @@ class ThreadTests(BaseTestCase):
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.
+
+ 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)
- # 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')
+ # 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 +730,8 @@ class ThreadJoinOnShutdown(BaseTestCase):
"""
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 +797,111 @@ class ThreadJoinOnShutdown(BaseTestCase):
for t in threads:
t.join()
- @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.
+ @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()
- def noop_trace(frame, event, arg):
- # no operation
- return noop_trace
+ # 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()
- def generator():
- while 1:
- yield "genereator"
+ 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)
- def callback():
- if callback.gen is None:
- callback.gen = generator()
- return next(callback.gen)
- callback.gen = None
+ for t in threads:
+ t.join()
- 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)
+class SubinterpThreadingTests(BaseTestCase):
- # 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)
+ 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
+ def test_daemon_threads_fatal_error(self):
+ subinterp_code = r"""if 1:
+ import os
+ import threading
+ import time
+
+ 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
+
+ _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):
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py
index f975a75e85..9d92742375 100644
--- a/Lib/test/test_threadsignals.py
+++ b/Lib/test/test_threadsignals.py
@@ -8,7 +8,7 @@ from test.support import run_unittest, import_module
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 @@ class ThreadSignals(unittest.TestCase):
@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 @@ class ThreadSignals(unittest.TestCase):
@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 1a4d873a57..be7ddcc34d 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -14,6 +14,8 @@ except ImportError:
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 @@ class TimeTestCase(unittest.TestCase):
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 @@ class TimeTestCase(unittest.TestCase):
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 @@ class TimeTestCase(unittest.TestCase):
@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 @@ class TimeTestCase(unittest.TestCase):
# 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 @@ class TestPytime(unittest.TestCase):
@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_timeout.py b/Lib/test/test_timeout.py
index dcf201b507..703c43ab2b 100644
--- a/Lib/test/test_timeout.py
+++ b/Lib/test/test_timeout.py
@@ -207,7 +207,7 @@ class TCPTimeoutTestCase(TimeoutTestCase):
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_tools.py b/Lib/test/test_tools.py
index f971515899..1bf7d54c1e 100644
--- a/Lib/test/test_tools.py
+++ b/Lib/test/test_tools.py
@@ -6,6 +6,7 @@ Tools directory of a Python checkout or tarball, such as reindent.py.
import os
import sys
+import importlib._bootstrap
import importlib.machinery
import unittest
from unittest import mock
@@ -405,8 +406,8 @@ 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()
+ spec = importlib.util.spec_from_file_location('pdeps', path)
+ self.pdeps = importlib._bootstrap._SpecMethods(spec).load()
@classmethod
def tearDownClass(self):
@@ -430,8 +431,8 @@ 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()
+ spec = importlib.util.spec_from_file_location('gprof2html', path)
+ self.gprof = importlib._bootstrap._SpecMethods(spec).load()
oldargv = sys.argv
def fixup():
sys.argv = oldargv
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index c38c65bb31..c29556354e 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -172,32 +172,76 @@ class SyntaxTracebackCases(unittest.TestCase):
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 @@ class CExcReportingTests(BaseExceptionReportingTests, unittest.TestCase):
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 0000000000..c953885fc5
--- /dev/null
+++ b/Lib/test/test_tracemalloc.py
@@ -0,0 +1,820 @@
+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(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')
+
+ # PYTHON* environment variables must be ignored when -E option 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')
+
+ # 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')
+
+ # 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_main():
+ support.run_unittest(
+ TestTracemallocEnabled,
+ TestSnapshot,
+ TestFilters,
+ TestCommandLine,
+ )
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 3ee4c6bc5f..18e6b0a89c 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -1,7 +1,8 @@
# Python test set -- part 6, built-in types
-from test.support import run_unittest, run_with_locale
+from test.support import run_unittest, run_with_locale, cpython_only
import collections
+import pickle
import locale
import sys
import types
@@ -1077,9 +1078,19 @@ class SimpleNamespaceTests(unittest.TestCase):
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 @@ class SimpleNamespaceTests(unittest.TestCase):
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,10 +1156,45 @@ class SimpleNamespaceTests(unittest.TestCase):
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)
+
+
+class SharedKeyTests(unittest.TestCase):
+
+ @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_unittest(TypesTests, MappingProxyTests, ClassCreationTests,
- SimpleNamespaceTests)
+ SimpleNamespaceTests, SharedKeyTests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index de71680c63..be7e9cdcd7 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -177,7 +177,7 @@ class UnicodeNamesTest(unittest.TestCase):
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 c2ede07a83..7e7091872f 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -7,6 +7,7 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
"""#"
import _string
import codecs
+import itertools
import struct
import sys
import unittest
@@ -31,6 +32,16 @@ def search_function(encoding):
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,
@@ -863,11 +874,9 @@ class UnicodeTest(string_tests.CommonTest,
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,
@@ -903,7 +912,7 @@ class UnicodeTest(string_tests.CommonTest,
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)
@@ -955,6 +964,15 @@ class UnicodeTest(string_tests.CommonTest,
'')
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):
@@ -1108,6 +1126,67 @@ class UnicodeTest(string_tests.CommonTest,
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):
@@ -1788,10 +1867,10 @@ class UnicodeTest(string_tests.CommonTest,
# 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',
@@ -1816,10 +1895,10 @@ class UnicodeTest(string_tests.CommonTest,
# 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',
@@ -2010,9 +2089,10 @@ class UnicodeTest(string_tests.CommonTest,
# Test PyUnicode_FromFormat()
def test_from_format(self):
support.import_module('ctypes')
- from ctypes import (pythonapi, py_object,
+ from ctypes import (
+ pythonapi, py_object, sizeof,
c_int, c_long, c_longlong, c_ssize_t,
- c_uint, c_ulong, c_ulonglong, c_size_t)
+ c_uint, c_ulong, c_ulonglong, c_size_t, c_void_p)
name = "PyUnicode_FromFormat"
_PyUnicode_FromFormat = getattr(pythonapi, name)
_PyUnicode_FromFormat.restype = py_object
@@ -2023,9 +2103,13 @@ class UnicodeTest(string_tests.CommonTest,
for arg in args)
return _PyUnicode_FromFormat(format, *cargs)
+ def check_format(expected, format, *args):
+ text = PyUnicode_FromFormat(format, *args)
+ self.assertEqual(expected, text)
+
# ascii format, non-ascii argument
- text = PyUnicode_FromFormat(b'ascii\x7f=%U', 'unicode\xe9')
- self.assertEqual(text, 'ascii\x7f=unicode\xe9')
+ check_format('ascii\x7f=unicode\xe9',
+ b'ascii\x7f=%U', 'unicode\xe9')
# non-ascii format, ascii argument: ensure that PyUnicode_FromFormatV()
# raises an error
@@ -2035,64 +2119,205 @@ class UnicodeTest(string_tests.CommonTest,
PyUnicode_FromFormat, b'unicode\xe9=%s', 'ascii')
# test "%c"
- self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0xabcd)), '\uabcd')
- self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0x10ffff)), '\U0010ffff')
+ check_format('\uabcd',
+ b'%c', c_int(0xabcd))
+ check_format('\U0010ffff',
+ b'%c', c_int(0x10ffff))
with self.assertRaises(OverflowError):
PyUnicode_FromFormat(b'%c', c_int(0x110000))
# Issue #18183
- self.assertEqual(
- PyUnicode_FromFormat(b'%c%c', c_int(0x10000), c_int(0x100000)),
- '\U00010000\U00100000')
+ check_format('\U00010000\U00100000',
+ b'%c%c', c_int(0x10000), c_int(0x100000))
# test "%"
- self.assertEqual(PyUnicode_FromFormat(b'%'), '%')
- self.assertEqual(PyUnicode_FromFormat(b'%%'), '%')
- self.assertEqual(PyUnicode_FromFormat(b'%%s'), '%s')
- self.assertEqual(PyUnicode_FromFormat(b'[%%]'), '[%]')
- self.assertEqual(PyUnicode_FromFormat(b'%%%s', b'abc'), '%abc')
+ check_format('%',
+ b'%')
+ check_format('%',
+ b'%%')
+ check_format('%s',
+ b'%%s')
+ check_format('[%]',
+ b'[%%]')
+ check_format('%abc',
+ b'%%%s', b'abc')
+
+ # 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'))
+
+ # 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)
- self.assertEqual(PyUnicode_FromFormat(b'%03i', c_int(10)), '010')
- self.assertEqual(PyUnicode_FromFormat(b'%0.4i', c_int(10)), '0010')
- self.assertEqual(PyUnicode_FromFormat(b'%i', c_int(-123)), '-123')
- self.assertEqual(PyUnicode_FromFormat(b'%li', c_long(-123)), '-123')
- self.assertEqual(PyUnicode_FromFormat(b'%lli', c_longlong(-123)), '-123')
- self.assertEqual(PyUnicode_FromFormat(b'%zi', c_ssize_t(-123)), '-123')
-
- self.assertEqual(PyUnicode_FromFormat(b'%d', c_int(-123)), '-123')
- self.assertEqual(PyUnicode_FromFormat(b'%ld', c_long(-123)), '-123')
- self.assertEqual(PyUnicode_FromFormat(b'%lld', c_longlong(-123)), '-123')
- self.assertEqual(PyUnicode_FromFormat(b'%zd', c_ssize_t(-123)), '-123')
-
- self.assertEqual(PyUnicode_FromFormat(b'%u', c_uint(123)), '123')
- self.assertEqual(PyUnicode_FromFormat(b'%lu', c_ulong(123)), '123')
- self.assertEqual(PyUnicode_FromFormat(b'%llu', c_ulonglong(123)), '123')
- self.assertEqual(PyUnicode_FromFormat(b'%zu', c_size_t(123)), '123')
+ check_format('010',
+ b'%03i', c_int(10))
+ check_format('0010',
+ b'%0.4i', c_int(10))
+ check_format('-123',
+ b'%i', c_int(-123))
+ check_format('-123',
+ b'%li', c_long(-123))
+ check_format('-123',
+ b'%lli', c_longlong(-123))
+ check_format('-123',
+ b'%zi', c_ssize_t(-123))
+
+ check_format('-123',
+ b'%d', c_int(-123))
+ check_format('-123',
+ b'%ld', c_long(-123))
+ check_format('-123',
+ b'%lld', c_longlong(-123))
+ check_format('-123',
+ b'%zd', c_ssize_t(-123))
+
+ check_format('123',
+ b'%u', c_uint(123))
+ check_format('123',
+ b'%lu', c_ulong(123))
+ check_format('123',
+ b'%llu', c_ulonglong(123))
+ check_format('123',
+ b'%zu', c_size_t(123))
+
+ # test long output
+ min_longlong = -(2 ** (8 * sizeof(c_longlong) - 1))
+ max_longlong = -min_longlong - 1
+ check_format(str(min_longlong),
+ b'%lld', c_longlong(min_longlong))
+ check_format(str(max_longlong),
+ b'%lld', c_longlong(max_longlong))
+ max_ulonglong = 2 ** (8 * sizeof(c_ulonglong)) - 1
+ check_format(str(max_ulonglong),
+ b'%llu', c_ulonglong(max_ulonglong))
+ PyUnicode_FromFormat(b'%p', c_void_p(-1))
+
+ # test padding (width and/or precision)
+ check_format('123'.rjust(10, '0'),
+ b'%010i', c_int(123))
+ check_format('123'.rjust(100),
+ b'%100i', 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))
+
+ check_format('123'.rjust(10, '0'),
+ b'%010u', c_uint(123))
+ check_format('123'.rjust(100),
+ b'%100u', 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))
+
+ check_format('123'.rjust(10, '0'),
+ b'%010x', c_int(0x123))
+ check_format('123'.rjust(100),
+ b'%100x', 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))
# test %A
- text = PyUnicode_FromFormat(b'%%A:%A', 'abc\xe9\uabcd\U0010ffff')
- self.assertEqual(text, r"%A:'abc\xe9\uabcd\U0010ffff'")
+ check_format(r"%A:'abc\xe9\uabcd\U0010ffff'",
+ b'%%A:%A', 'abc\xe9\uabcd\U0010ffff')
# test %V
- text = PyUnicode_FromFormat(b'repr=%V', 'abc', b'xyz')
- self.assertEqual(text, 'repr=abc')
+ check_format('repr=abc',
+ b'repr=%V', 'abc', b'xyz')
# Test string decode from parameter of %s using utf-8.
# b'\xe4\xba\xba\xe6\xb0\x91' is utf-8 encoded byte sequence of
# '\u4eba\u6c11'
- text = PyUnicode_FromFormat(b'repr=%V', None, b'\xe4\xba\xba\xe6\xb0\x91')
- self.assertEqual(text, 'repr=\u4eba\u6c11')
+ check_format('repr=\u4eba\u6c11',
+ b'repr=%V', None, b'\xe4\xba\xba\xe6\xb0\x91')
#Test replace error handler.
- text = PyUnicode_FromFormat(b'repr=%V', None, b'abc\xff')
- self.assertEqual(text, 'repr=abc\ufffd')
+ check_format('repr=abc\ufffd',
+ b'repr=%V', None, b'abc\xff')
# not supported: copy the raw format string. these tests are just here
# to check for crashs and should not be considered as specifications
- self.assertEqual(PyUnicode_FromFormat(b'%1%s', b'abc'), '%s')
- self.assertEqual(PyUnicode_FromFormat(b'%1abc'), '%1abc')
- self.assertEqual(PyUnicode_FromFormat(b'%+i', c_int(10)), '%+i')
- self.assertEqual(PyUnicode_FromFormat(b'%.%s', b'abc'), '%.%s')
+ check_format('%s',
+ b'%1%s', b'abc')
+ check_format('%1abc',
+ b'%1abc')
+ check_format('%+i',
+ b'%+i', c_int(10))
+ check_format('%.%s',
+ b'%.%s', b'abc')
# Test PyUnicode_AsWideChar()
@support.cpython_only
@@ -2220,6 +2445,80 @@ class UnicodeTest(string_tests.CommonTest,
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 99aa0033cd..707b30e50c 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -21,7 +21,7 @@ errors = 'surrogatepass'
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 UnicodeDatabaseTest(unittest.TestCase):
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 2dec4e9f88..1a40566620 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -16,6 +16,7 @@ from nturl2path import url2pathname, pathname2url
from base64 import b64encode
import collections
+
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()
@@ -238,7 +239,7 @@ class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin):
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 +247,12 @@ Connection: close
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 +267,20 @@ Content-Type: text/html; charset=iso-8859-1
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 +293,21 @@ Content-Type: text/html; charset=iso-8859-1
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)
def test_userpass_inurl(self):
@@ -341,6 +344,79 @@ Content-Type: text/html; charset=iso-8859-1
with support.check_warnings(('',DeprecationWarning)):
urllib.request.URLopener()
+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 +1367,7 @@ class URLopener_Tests(unittest.TestCase):
# 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 d0691398b5..4b92d6317a 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -11,6 +11,7 @@ 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.parse import urlparse
import urllib.error
# XXX
@@ -118,6 +119,15 @@ class RequestHdrsTests(unittest.TestCase):
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 +321,7 @@ class MockHTTPClass:
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 +606,6 @@ class OpenerDirectorTests(unittest.TestCase):
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")
@@ -812,7 +800,7 @@ class HandlerTests(unittest.TestCase):
("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 +905,36 @@ class HandlerTests(unittest.TestCase):
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'/'
@@ -1418,6 +1436,21 @@ class MiscTests(unittest.TestCase):
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.python.org/~jeremy/")
+ 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 +1462,31 @@ class MiscTests(unittest.TestCase):
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)
-
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 +1495,25 @@ class RequestTests(unittest.TestCase):
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 +1555,13 @@ class RequestTests(unittest.TestCase):
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 31c638fc4e..83626f4fd3 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -7,7 +7,10 @@ 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 +18,7 @@ CERT_localhost = os.path.join(here, 'keycert.pem')
# Self-signed cert file for 'fakehostname'
CERT_fakehostname = os.path.join(here, 'keycert2.pem')
+
# Loopback http server infrastructure
class LoopbackHttpServer(http.server.HTTPServer):
@@ -387,14 +391,14 @@ class TestUrlopen(unittest.TestCase):
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
@@ -484,6 +488,21 @@ class TestUrlopen(unittest.TestCase):
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)
+ self.urlopen("https://localhost:%s" % handler.port)
+ 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 +549,7 @@ class TestUrlopen(unittest.TestCase):
# 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
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index 4981c2410b..78891fd797 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -12,6 +12,8 @@ try:
except ImportError:
ssl = None
+support.requires("network")
+
TIMEOUT = 60 # seconds
@@ -162,6 +164,14 @@ class OtherNetworkTests(unittest.TestCase):
self.assertEqual(res.geturl(),
"http://docs.python.org/2/glossary.html#glossary")
+ def test_redirect_url_withfrag(self):
+ redirect_url_with_frag = "http://bitly.com/urllibredirecttest"
+ 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://docs.python.org/3.4/glossary.html#term-global-interpreter-lock")
+
def test_custom_headers(self):
url = "http://www.example.com"
with support.transient_internet(url):
@@ -214,7 +224,7 @@ class OtherNetworkTests(unittest.TestCase):
debug(url)
try:
f = urlopen(url, req, TIMEOUT)
- except EnvironmentError as err:
+ except OSError as err:
debug(err)
if expected_err:
msg = ("Didn't get expected error(s) %s for %s %s, got %s: %s" %
@@ -328,35 +338,5 @@ class TimeoutTest(unittest.TestCase):
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_urllibnet.py b/Lib/test/test_urllibnet.py
index 38afb69250..4da89fcaaa 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -121,16 +121,15 @@ class urlopenNetworkTests(unittest.TestCase):
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):
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index d67cf258b0..393481148d 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -863,6 +863,14 @@ class UrlParseTestCase(unittest.TestCase):
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 137c445eae..2ca99298d4 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -45,7 +45,8 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
# 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 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
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_venv.py b/Lib/test/test_venv.py
index 0fae88bcf9..1084a99a5e 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -5,6 +5,7 @@ Copyright (C) 2011-2012 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
"""
+import ensurepip
import os
import os.path
import shutil
@@ -12,10 +13,28 @@ import subprocess
import sys
import tempfile
from test.support import (captured_stdout, captured_stderr, run_unittest,
- can_symlink)
+ can_symlink, EnvironmentVarGuard)
+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."""
@@ -83,8 +102,7 @@ class BasicTest(BaseTest):
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.
@@ -109,13 +127,68 @@ class BasicTest(BaseTest):
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):
+ shutil.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):
"""
@@ -162,8 +235,7 @@ class BasicTest(BaseTest):
# 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.
@@ -192,8 +264,129 @@ class BasicTest(BaseTest):
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):
+ shutil.rmtree(self.env_dir)
+ self.run_with_capture(venv.create, self.env_dir)
+ self.assert_pip_not_installed()
+
+ def test_explicit_no_pip(self):
+ shutil.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):
+ shutil.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 bd06c8d8bd..f6a065d850 100644
--- a/Lib/test/test_wait3.py
+++ b/Lib/test/test_wait3.py
@@ -7,15 +7,11 @@ import unittest
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 10076af3aa..eec2c24218 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -329,6 +329,19 @@ class WarnTests(BaseTest):
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.
@@ -766,6 +779,25 @@ class BootstrapTest(unittest.TestCase):
# 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 f64201f9fc..3eff773bca 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 @@ import wave
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 @@ class WavePCM16Test(WaveTest, unittest.TestCase):
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 @@ class WavePCM24Test(WaveTest, unittest.TestCase):
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 @@ class WavePCM32Test(WaveTest, unittest.TestCase):
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 85ab717c69..cccb515252 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -7,11 +7,15 @@ import operator
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 @@ class Object:
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 @@ class ReferencesTestCase(TestBase):
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 @@ class SubclassableWeakrefTestCase(TestBase):
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
@@ -1385,6 +1552,151 @@ class WeakKeyDictionaryTestCase(mapping_tests.BasicTestMappingProtocol):
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 +1785,12 @@ __test__ = {'libreftest' : libreftest}
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 cb4cde9bc6..ef4ce552f1 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -8,7 +8,7 @@ threading = support.import_module("threading")
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 @@ class BaseWinregTests(unittest.TestCase):
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 @@ class BaseWinregTests(unittest.TestCase):
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 @@ class BaseWinregTests(unittest.TestCase):
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 @@ class BaseWinregTests(unittest.TestCase):
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 @@ class BaseWinregTests(unittest.TestCase):
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 @@ class BaseWinregTests(unittest.TestCase):
# 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 @@ class BaseWinregTests(unittest.TestCase):
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 @@ class LocalWinregTests(BaseWinregTests):
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 @@ class LocalWinregTests(BaseWinregTests):
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):
@@ -407,7 +407,7 @@ class Win64WinregTests(BaseWinregTests):
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 +447,7 @@ class Win64WinregTests(BaseWinregTests):
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 069adc3981..83618b6a44 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -22,7 +22,7 @@ def has_sound(sound):
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_xml_etree.py b/Lib/test/test_xml_etree.py
index 7bd8a2c7ee..89971f16ca 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -10,6 +10,7 @@ import io
import operator
import pickle
import sys
+import types
import unittest
import weakref
@@ -240,7 +241,6 @@ class ElementTreeTest(unittest.TestCase):
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 @@ class ElementTreeTest(unittest.TestCase):
' <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 @@ class ElementTreeTest(unittest.TestCase):
'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 @@ class ElementTreeTest(unittest.TestCase):
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 @@ class BugsTest(unittest.TestCase):
# 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" []>
@@ -1643,6 +1788,11 @@ class ElementFindTest(unittest.TestCase):
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 +2052,7 @@ class TreeBuilderTest(unittest.TestCase):
# 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 +2411,18 @@ class IOTest(unittest.TestCase):
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 +2488,11 @@ class NoAcceleratorTest(unittest.TestCase):
# 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 +2562,7 @@ def test_main(module=None):
ElementIterTest,
TreeBuilderTest,
XMLParserTest,
+ XMLPullParserTest,
BugsTest,
]
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py
index d04b7dc97f..816aa8645d 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 @@ class TestAliasWorking(unittest.TestCase):
@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 cc52259c82..99b3eda13e 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -15,6 +15,10 @@ import contextlib
from test import support
try:
+ import gzip
+except ImportError:
+ gzip = None
+try:
import threading
except ImportError:
threading = None
@@ -216,7 +220,7 @@ class XMLRPCTestCase(unittest.TestCase):
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 @@ def http_server(evt, numrequests, requestHandler=None):
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 @@ def http_server(evt, numrequests, requestHandler=None):
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,7 +510,7 @@ def is_unavailable_exception(e):
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():
@@ -515,7 +525,7 @@ def make_request_and_skipIf(condition, reason):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
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 @@ class SimpleServerTestCase(BaseServerTestCase):
# 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 @@ class KeepaliveServerTestCase2(BaseKeepaliveServerTestCase):
#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
@@ -923,7 +941,7 @@ class FailingServerTestCase(unittest.TestCase):
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
@@ -936,7 +954,7 @@ class FailingServerTestCase(unittest.TestCase):
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
@@ -956,7 +974,7 @@ class FailingServerTestCase(unittest.TestCase):
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
@@ -1084,23 +1102,13 @@ class UseBuiltinTypesTestCase(unittest.TestCase):
@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)
- 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(*xmlrpc_tests)
+ support.run_unittest(XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
+ BinaryTestCase, FaultTestCase, UseBuiltinTypesTestCase,
+ SimpleServerTestCase, KeepaliveServerTestCase1,
+ KeepaliveServerTestCase2, GzipServerTestCase,
+ MultiPathServerTestCase, ServerProxyTestCase, FailingServerTestCase,
+ CGIHandlerTestCase)
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_xmlrpc_net.py b/Lib/test/test_xmlrpc_net.py
index 77f66ea57b..b60b82f3e2 100644
--- a/Lib/test/test_xmlrpc_net.py
+++ b/Lib/test/test_xmlrpc_net.py
@@ -7,31 +7,7 @@ from test import support
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 @@ class CurrentTimeTest(unittest.TestCase):
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 @@ class CurrentTimeTest(unittest.TestCase):
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 12a0f71f5d..1bef5750a1 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -1,7 +1,7 @@
import io
import os
import sys
-import imp
+import importlib.util
import time
import shutil
import struct
@@ -14,7 +14,7 @@ from random import randint, random, getrandbits
from test.support import (TESTFN, findfile, unlink,
requires_zlib, requires_bz2, requires_lzma,
- captured_stdout)
+ captured_stdout, check_warnings)
TESTFN2 = TESTFN + "2"
TESTFNDIR = TESTFN + "d"
@@ -35,6 +35,10 @@ def get_files(test):
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):
@@ -537,12 +541,12 @@ class StoredTestZip64InSmallFiles(AbstractTestZip64InSmallFiles,
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 +592,7 @@ class PyZipFileTests(unittest.TestCase):
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 +626,34 @@ class PyZipFileTests(unittest.TestCase):
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 +663,7 @@ class PyZipFileTests(unittest.TestCase):
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()
@@ -661,6 +693,26 @@ class PyZipFileTests(unittest.TestCase):
finally:
shutil.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:
+ shutil.rmtree(TESTFN2)
+
def test_write_non_pyfile(self):
with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
with open(TESTFN, 'w') as f:
@@ -764,25 +816,25 @@ class ExtractTests(unittest.TestCase):
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)
@@ -860,6 +912,17 @@ class OtherTests(unittest.TestCase):
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 +932,7 @@ class OtherTests(unittest.TestCase):
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 +973,10 @@ class OtherTests(unittest.TestCase):
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 +1009,7 @@ class OtherTests(unittest.TestCase):
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 +1081,7 @@ class OtherTests(unittest.TestCase):
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 +1093,7 @@ class OtherTests(unittest.TestCase):
# 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 +1162,11 @@ class OtherTests(unittest.TestCase):
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 +1281,7 @@ class OtherTests(unittest.TestCase):
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')
@@ -1266,57 +1329,57 @@ class AbstractBadCrcTests:
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 +1388,22 @@ class DecryptionTests(unittest.TestCase):
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
@@ -1599,7 +1662,7 @@ class AbstractUniversalNewlineTests:
# 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 +1676,7 @@ class AbstractUniversalNewlineTests:
# 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 +1701,7 @@ class AbstractUniversalNewlineTests:
# 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 +1716,7 @@ class AbstractUniversalNewlineTests:
# 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 +1731,7 @@ class AbstractUniversalNewlineTests:
# 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')
@@ -1702,6 +1765,5 @@ class LzmaUniversalNewlineTests(AbstractUniversalNewlineTests,
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 a8fb7aba54..498d464db3 100644
--- a/Lib/test/test_zipfile64.py
+++ b/Lib/test/test_zipfile64.py
@@ -38,7 +38,7 @@ class TestsWithSourceFile(unittest.TestCase):
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 @@ class OtherTests(unittest.TestCase):
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=False)
zipf.debug = 100
numfiles = (1 << 16) * 3//2
for i in range(numfiles):
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 37603b9bcd..1e351c8c8a 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 doctest
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 @@ def make_pyc(co, mtime, size):
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 @@ TESTPACK = "ziptestpackage"
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 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
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 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
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 @@ class BadFileZipImportTestCase(unittest.TestCase):
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 f7f3398015..84ba5e047a 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -227,13 +227,15 @@ class ZipSupportTests(unittest.TestCase):
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 92ebd95e52..afe50d2325 100644
--- a/Lib/test/tf_inherit_check.py
+++ b/Lib/test/tf_inherit_check.py
@@ -11,7 +11,7 @@ try:
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/textwrap.py b/Lib/textwrap.py
index 7024d4d245..24891804dd 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 @@ class TextWrapper:
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 @@ class TextWrapper:
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 @@ class TextWrapper:
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 @@ class TextWrapper:
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 @@ class TextWrapper:
# 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 @@ class TextWrapper:
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 @@ def fill(text, width=70, **kwargs):
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 625c9b9d7b..d907c89f3f 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -10,6 +10,11 @@ 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
+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 +33,7 @@ __all__ = ['active_count', 'Condition', 'current_thread', 'enumerate', 'Event',
# 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 +138,7 @@ class _RLock:
"""
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 +230,7 @@ class Condition:
self._is_owned = lock._is_owned
except AttributeError:
pass
- self._waiters = []
+ self._waiters = _deque()
def __enter__(self):
return self._lock.__enter__()
@@ -332,14 +338,14 @@ class Condition:
"""
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 @@ class Semaphore:
break
self._cond.wait(timeout)
else:
- self._value = self._value - 1
+ self._value -= 1
rc = True
return rc
@@ -428,7 +434,7 @@ class Semaphore:
"""
with self._cond:
- self._value = self._value + 1
+ self._value += 1
self._cond.notify()
def __exit__(self, t, v, tb):
@@ -723,15 +729,13 @@ class BrokenBarrierError(RuntimeError):
_counter = 0
def _newname(template="Thread-%d"):
global _counter
- _counter = _counter + 1
+ _counter += 1
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
@@ -790,28 +794,35 @@ class Thread:
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 +895,18 @@ class Thread:
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
@@ -941,7 +961,6 @@ class Thread:
pass
finally:
with _active_limbo_lock:
- self._stop()
try:
# We don't call self._delete() because it also
# grabs _active_limbo_lock.
@@ -950,10 +969,27 @@ class Thread:
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 +1057,26 @@ class Thread:
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 +1115,10 @@ class Thread:
"""
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
@@ -1149,25 +1194,12 @@ class _MainThread(Thread):
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 +1214,6 @@ class _DummyThread(Thread):
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 +1275,40 @@ from _thread import stack_size
# 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 +1326,31 @@ def _after_fork():
# 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 4f7d28fbef..ead2030515 100755
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -31,38 +31,29 @@ treated similarly.
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.
-
-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.
+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.
+
+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
@@ -180,10 +171,7 @@ class Timer:
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 b9e5d2ef2e..5d6f31b48d 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -2199,45 +2199,6 @@ class Button(Widget):
"""
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):
@@ -2968,11 +2929,11 @@ class Text(Widget, XView, YView):
"""
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):
diff --git a/Lib/tkinter/filedialog.py b/Lib/tkinter/filedialog.py
index 3ffb2528f0..a71afb25b9 100644
--- a/Lib/tkinter/filedialog.py
+++ b/Lib/tkinter/filedialog.py
@@ -166,7 +166,7 @@ class FileDialog:
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 @@ class FileDialog:
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/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index 6ef7750f33..47e281ff19 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -631,8 +631,8 @@ class TextTest(AbstractWidgetTest, unittest.TestCase):
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)
diff --git a/Lib/token.py b/Lib/token.py
index 31fae0a078..7470c8c376 100644
--- a/Lib/token.py
+++ b/Lib/token.py
@@ -93,7 +93,7 @@ def _main():
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 @@ def _main():
# 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 @@ def _main():
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 5304de5941..98e91223fe 100644
--- a/Lib/tokenize.py
+++ b/Lib/tokenize.py
@@ -679,7 +679,7 @@ def main():
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 c09b365a01..09fe9ee0e4 100755
--- a/Lib/trace.py
+++ b/Lib/trace.py
@@ -238,7 +238,7 @@ class CoverageResults:
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 @@ class CoverageResults:
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 @@ class CoverageResults:
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 @@ def _find_executable_linenos(filename):
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 @@ def main(argv=None):
'__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 f33fced7a9..faf593a735 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 @@ def format_list(extracted_list):
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)
+ 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:
- item = item + ' %s\n' % line.strip()
- list.append(item)
- return list
+ 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 @@ def print_tb(tb, limit=None, file=None):
'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 @@ def extract_tb(tb, limit=None):
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 @@ def _iter_chain(exc, custom_tb=None, seen=None):
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 @@ def print_exception(etype, value, tb, limit=None, file=None, chain=True):
"""
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 @@ def format_exception(etype, value, tb, limit=None, chain=True):
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 @@ def format_exception_only(etype, value):
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 @@ def format_exception_only(etype, value):
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 @@ def _some_str(value):
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 @@ def print_stack(f=None, limit=None, file=None):
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 @@ def extract_stack(f=None, limit=None):
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 0000000000..adedfc5fb4
--- /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 c6ebfa5c6d..ab7b6ba42a 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -3843,18 +3843,18 @@ def write_docstringdict(filename="turtle_docstringdict"):
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/__main__.py b/Lib/turtledemo/__main__.py
index cbf3aeb692..a14684c356 100755
--- a/Lib/turtledemo/__main__.py
+++ b/Lib/turtledemo/__main__.py
@@ -6,7 +6,7 @@ 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 importlib import reload
import turtle
import time
diff --git a/Lib/types.py b/Lib/types.py
index cfd09eaaff..7e4fec2d25 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -99,3 +99,60 @@ def _calculate_meta(meta, bases):
"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 798ebc0f53..2663178d3f 100644
--- a/Lib/unittest/__main__.py
+++ b/Lib/unittest/__main__.py
@@ -13,7 +13,6 @@ if sys.argv[0].endswith("__main__.py"):
__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 f56af5574b..87fb02bd2e 100644
--- a/Lib/unittest/case.py
+++ b/Lib/unittest/case.py
@@ -3,14 +3,16 @@
import sys
import functools
import difflib
+import logging
import pprint
import re
import warnings
import collections
+import contextlib
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 +28,11 @@ class SkipTest(Exception):
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 +40,43 @@ class _UnexpectedSuccess(Exception):
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 +114,26 @@ def skipUnless(condition, reason):
return skip(reason)
return _id
+def expectedFailure(test_item):
+ test_item.__unittest_expecting_failure__ = True
+ return test_item
-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
+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(object):
+
+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:
@@ -118,10 +148,6 @@ class _AssertRaisesBaseContext(object):
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 +161,6 @@ class _AssertRaisesBaseContext(object):
callable_obj(*args, **kwargs)
-
class _AssertRaisesContext(_AssertRaisesBaseContext):
"""A context manager used to implement TestCase.assertRaises* methods."""
@@ -217,6 +242,74 @@ class _AssertWarnsContext(_AssertRaisesBaseContext):
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 +363,7 @@ class TestCase(object):
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 +376,7 @@ class TestCase(object):
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 +464,80 @@ class TestCase(object):
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(test_case)
+
+ @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:
+ 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 _executeTestPart(self, function, outcome, isTest=False):
+ def _addUnexpectedSuccess(self, result):
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())
+ 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 +556,38 @@ class TestCase(object):
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)
- 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)
+ if expecting_failure:
+ if outcome.expectedFailure:
+ self._addExpectedFailure(result, 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 +596,23 @@ class TestCase(object):
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 +731,28 @@ class TestCase(object):
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 +782,7 @@ class TestCase(object):
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 +917,9 @@ class TestCase(object):
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 +1077,7 @@ class TestCase(object):
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 +1161,7 @@ class TestCase(object):
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))
@@ -1212,3 +1359,39 @@ class FunctionTestCase(TestCase):
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 9ab26c1efb..808c50eb66 100644
--- a/Lib/unittest/loader.py
+++ b/Lib/unittest/loader.py
@@ -34,6 +34,14 @@ def _make_failed_test(classname, methodname, exception, suiteClass):
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 @@ class TestLoader(object):
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 @@ class TestLoader(object):
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 @@ class TestLoader(object):
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 @@ class TestLoader(object):
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 @@ class TestLoader(object):
# 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 @@ class TestLoader(object):
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 @@ class TestLoader(object):
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 @@ class TestLoader(object):
# 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 ead64936a0..180df8676e 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 @@ from .signals import installHandler
__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 @@ class TestProgram(object):
"""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 @@ class TestProgram(object):
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 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
-
- parser = self._getOptParser()
- options, args = parser.parse_args(argv[1:])
- self._setAttributesFromOptions(options)
+ 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})
- 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
+ def parseArgs(self, argv):
+ 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)
- 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 @@ class TestProgram(object):
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')
- return parser
+ 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')
- 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
+ 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:
- self.catchbreak = options.catchbreak
+ 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:
- self.buffer = options.buffer
-
- if options.verbose:
- self.verbosity = 2
- elif options.quiet:
- self.verbosity = 0
+ parser.add_argument('-b', '--buffer', dest='buffer',
+ action='store_true',
+ help='Buffer stdout and stderr during tests')
+ self.buffer = False
- 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)')
-
- def _do_discovery(self, argv, Loader=None):
- if Loader is None:
- Loader = lambda: self.testLoader
+ return parser
- # handle command line args for test discovery
- self.progName = '%s discover' % self.progName
- parser = self._getOptParser()
- self._addDiscoveryOptions(parser)
+ def _getMainArgParser(self, parent):
+ parser = argparse.ArgumentParser(parents=[parent])
+ parser.prog = self.progName
+ parser.print_help = self._print_help
- options, args = parser.parse_args(argv)
- if len(args) > 3:
- self.usageExit()
+ parser.add_argument('tests', nargs='*',
+ help='a list of any number of test modules, '
+ 'classes and test methods.')
- for name, value in zip(('start', 'pattern', 'top'), args):
- setattr(options, name, value)
+ return parser
- self._setAttributesFromOptions(options)
+ 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)
- start_dir = options.start
- pattern = options.pattern
- top_level_dir = options.top
+ return parser
- loader = Loader()
- self.test = loader.discover(start_dir, pattern, top_level_dir)
+ def _do_discovery(self, argv, Loader=None):
+ 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)
+
+ 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 073869a1f1..8b76503429 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -27,7 +27,7 @@ __version__ = '1.0'
import inspect
import pprint
import sys
-from functools import wraps
+from functools import wraps, partial
BaseExceptions = (BaseException,)
@@ -66,55 +66,45 @@ DescriptorTypes = (
)
-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):
- return
-
- result = _getsignature(func, skipfirst, instance)
- if result is None:
+ sig = _get_signature_object(func, instance, skipfirst)
+ if sig 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 _check_signature(func, mock, skipfirst, instance=False):
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 @@ def _set_signature(mock, original, instance=False):
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__
@@ -368,7 +368,7 @@ class NonCallableMock(Base):
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 +382,10 @@ class NonCallableMock(Base):
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 +430,26 @@ class NonCallableMock(Base):
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
@@ -695,7 +703,6 @@ class NonCallableMock(Base):
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 +718,28 @@ class NonCallableMock(Base):
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 +750,14 @@ class NonCallableMock(Base):
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 +781,21 @@ class NonCallableMock(Base):
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 +803,7 @@ class NonCallableMock(Base):
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 +812,14 @@ class NonCallableMock(Base):
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 +889,12 @@ class CallableMixin(Base):
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 +949,6 @@ class CallableMixin(Base):
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):
@@ -2030,6 +2068,8 @@ def create_autospec(spec, spec_set=False, instance=False, _parent=None,
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)
@@ -2096,10 +2136,12 @@ def create_autospec(spec, spec_set=False, instance=False, _parent=None,
if isinstance(spec, FunctionTypes):
parent = mock.mock
+ skipfirst = _must_skip(spec, entry, is_type)
+ kwargs['_eat_self'] = skipfirst
new = MagicMock(parent=parent, name=entry, _new_name=entry,
- _new_parent=parent, **kwargs)
+ _new_parent=parent,
+ **kwargs)
mock._mock_children[entry] = new
- skipfirst = _must_skip(spec, entry, is_type)
_check_signature(original, new, skipfirst=skipfirst)
# so functions created with _set_signature become instance attributes,
@@ -2113,6 +2155,10 @@ def create_autospec(spec, spec_set=False, instance=False, _parent=None,
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 +2171,12 @@ def _must_skip(spec, entry, is_type):
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 +2210,31 @@ FunctionTypes = (
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 +2245,27 @@ def mock_open(mock=None, read_data=''):
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 +2275,18 @@ def mock_open(mock=None, read_data=''):
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 97e5426927..b967a60a01 100644
--- a/Lib/unittest/result.py
+++ b/Lib/unittest/result.py
@@ -121,6 +121,22 @@ class TestResult(object):
self.failures.append((test, self._exc_info_to_string(err, test)))
self._mirrorOutput = True
+ @failfast
+ 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 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 +156,16 @@ class TestResult(object):
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 cde5d385ed..4997d81b8f 100644
--- a/Lib/unittest/suite.py
+++ b/Lib/unittest/suite.py
@@ -16,8 +16,11 @@ def _call_if_exists(parent, attr):
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):
@@ -35,9 +38,10 @@ class BaseTestSuite(object):
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 +61,28 @@ class BaseTestSuite(object):
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 +107,7 @@ class TestSuite(BaseTestSuite):
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 +126,9 @@ class TestSuite(BaseTestSuite):
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 0000000000..44d0591e84
--- /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 dbe4ddcd0e..02e8f3a00b 100644
--- a/Lib/unittest/test/support.py
+++ b/Lib/unittest/test/support.py
@@ -41,7 +41,7 @@ class TestHashing(object):
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 @@ class LoggingResult(unittest.TestResult):
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 @@ class LoggingResult(unittest.TestResult):
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 @@ class LoggingResult(unittest.TestResult):
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 @@ class LoggingResult(unittest.TestResult):
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 7931cadaf3..af08d5ad65 100644
--- a/Lib/unittest/test/test_assertions.py
+++ b/Lib/unittest/test/test_assertions.py
@@ -361,3 +361,7 @@ class TestLongMessage(unittest.TestCase):
['^"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 75532f42d3..0bf1a229b8 100644
--- a/Lib/unittest/test/test_break.py
+++ b/Lib/unittest/test/test_break.py
@@ -282,3 +282,7 @@ class TestBreakSignalIgnored(TestBreak):
"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 b8cb0c76b7..363390af09 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
@@ -13,9 +15,15 @@ from test import support
import unittest
from .support import (
- TestEquality, TestHashing, LoggingResult,
+ 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,98 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
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)
+
# "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 +829,18 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
# 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 +857,35 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
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])
@@ -1159,6 +1288,94 @@ test case
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 fitering
+ 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 +1530,33 @@ test case
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 ccc7db249e..6b7b1280f8 100644
--- a/Lib/unittest/test/test_discovery.py
+++ b/Lib/unittest/test/test_discovery.py
@@ -1,12 +1,15 @@
import os
import re
import sys
+import types
+import builtins
+from test import support
import unittest
class TestableTestProgram(unittest.TestProgram):
- module = '__main__'
+ module = None
exit = True
defaultTest = failfast = catchbreak = buffer = None
verbosity = 1
@@ -46,9 +49,9 @@ class TestDiscovery(unittest.TestCase):
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 +73,8 @@ class TestDiscovery(unittest.TestCase):
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 +137,7 @@ class TestDiscovery(unittest.TestCase):
# 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 +175,7 @@ class TestDiscovery(unittest.TestCase):
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 +190,9 @@ class TestDiscovery(unittest.TestCase):
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 +202,11 @@ class TestDiscovery(unittest.TestCase):
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 +215,74 @@ class TestDiscovery(unittest.TestCase):
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 +438,7 @@ class TestDiscovery(unittest.TestCase):
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 +448,79 @@ class TestDiscovery(unittest.TestCase):
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 9ce5ee3556..d7fe07a53b 100644
--- a/Lib/unittest/test/test_functiontestcase.py
+++ b/Lib/unittest/test/test_functiontestcase.py
@@ -142,3 +142,7 @@ class Test_FunctionTestCase(unittest.TestCase):
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 fcd2e07624..b62a1b5c54 100644
--- a/Lib/unittest/test/test_loader.py
+++ b/Lib/unittest/test/test_loader.py
@@ -1306,3 +1306,7 @@ class Test_TestLoader(unittest.TestCase):
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 8a4b3fad58..3294298030 100644
--- a/Lib/unittest/test/test_program.py
+++ b/Lib/unittest/test/test_program.py
@@ -2,6 +2,7 @@ import io
import os
import sys
+from test import support
import unittest
@@ -64,6 +65,41 @@ class Test_TestProgram(unittest.TestCase):
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 +187,38 @@ class TestCommandLineArgs(unittest.TestCase):
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))
-
- for opt in short_opt, long_opt:
- not_none = object()
- setattr(program, attr, not_none)
-
program.parseArgs([None, opt])
- self.assertEqual(getattr(program, attr), not_none)
+ self.assertIs(getattr(program, attr), True)
+
+ 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,))
+
+ 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 7d40725cf2..489fe17754 100644
--- a/Lib/unittest/test/test_result.py
+++ b/Lib/unittest/test/test_result.py
@@ -227,6 +227,40 @@ class Test_TestResult(unittest.TestCase):
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 @@ class Test_TestResult(unittest.TestCase):
'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 @@ class Test_TestResult(unittest.TestCase):
@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 @@ class Test_TestResult(unittest.TestCase):
'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 e22e6bc279..ef1c1af9f1 100644
--- a/Lib/unittest/test/test_runner.py
+++ b/Lib/unittest/test/test_runner.py
@@ -5,6 +5,7 @@ import pickle
import subprocess
import unittest
+from unittest.case import _Outcome
from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun
@@ -42,12 +43,8 @@ class TestCleanUp(unittest.TestCase):
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 +58,10 @@ class TestCleanUp(unittest.TestCase):
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 +339,7 @@ class Test_TextTestRunner(unittest.TestCase):
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 b8d5aa41e9..392f95efc0 100644
--- a/Lib/unittest/test/test_setups.py
+++ b/Lib/unittest/test/test_setups.py
@@ -494,14 +494,13 @@ class TestSetups(unittest.TestCase):
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 952240eeed..314a7a4d0f 100644
--- a/Lib/unittest/test/test_skipping.py
+++ b/Lib/unittest/test/test_skipping.py
@@ -29,6 +29,31 @@ class Test_TestSkipping(unittest.TestCase):
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 @@ class Test_TestSkipping(unittest.TestCase):
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 @@ class Test_TestSkipping(unittest.TestCase):
['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 @@ class Test_TestSkipping(unittest.TestCase):
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 2db978ddb8..38311ca488 100644
--- a/Lib/unittest/test/test_suite.py
+++ b/Lib/unittest/test/test_suite.py
@@ -1,6 +1,8 @@
import unittest
+import gc
import sys
+import weakref
from .support import LoggingResult, TestEquality
@@ -49,6 +51,9 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
# 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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 @@ class Test_TestSuite(unittest.TestCase, TestEquality):
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 0000000000..45c633a4ee
--- /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 7b2dd003ea..5390a4e10f 100644
--- a/Lib/unittest/test/testmock/testcallable.py
+++ b/Lib/unittest/test/testmock/testcallable.py
@@ -145,3 +145,7 @@ class TestCallable(unittest.TestCase):
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 a362a2f784..1dbc0b64ba 100644
--- a/Lib/unittest/test/testmock/testhelpers.py
+++ b/Lib/unittest/test/testmock/testhelpers.py
@@ -337,9 +337,10 @@ class SpecSignatureTest(unittest.TestCase):
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 @@ class SpecSignatureTest(unittest.TestCase):
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 @@ class SpecSignatureTest(unittest.TestCase):
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 @@ class SpecSignatureTest(unittest.TestCase):
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 @@ class SpecSignatureTest(unittest.TestCase):
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 @@ class SpecSignatureTest(unittest.TestCase):
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 @@ class SpecSignatureTest(unittest.TestCase):
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/testmock.py b/Lib/unittest/test/testmock/testmock.py
index cef5405fe9..20cc6541e6 100644
--- a/Lib/unittest/test/testmock/testmock.py
+++ b/Lib/unittest/test/testmock/testmock.py
@@ -25,6 +25,18 @@ class Iter(object):
__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):
@@ -273,6 +285,43 @@ class MockTest(unittest.TestCase):
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 +346,29 @@ class MockTest(unittest.TestCase):
)
+ 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 +1067,39 @@ class MockTest(unittest.TestCase):
)
+ 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 +1126,26 @@ class MockTest(unittest.TestCase):
)
+ 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
@@ -1177,20 +1302,6 @@ class MockTest(unittest.TestCase):
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 +1365,8 @@ class MockTest(unittest.TestCase):
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 +1386,5 @@ class MockTest(unittest.TestCase):
mock.foo
-
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py
index c1091b4e9b..c1bc34fa8c 100644
--- a/Lib/unittest/test/testmock/testpatch.py
+++ b/Lib/unittest/test/testmock/testpatch.py
@@ -1780,6 +1780,5 @@ class PatchTest(unittest.TestCase):
self.assertIs(os.path, path)
-
if __name__ == '__main__':
unittest.main()
diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/unittest/test/testmock/testwith.py
index 0a0cfad120..f54e051e94 100644
--- a/Lib/unittest/test/testmock/testwith.py
+++ b/Lib/unittest/test/testmock/testwith.py
@@ -172,5 +172,88 @@ class TestMockOpen(unittest.TestCase):
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 ccdf0b81fa..aee498fd0b 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 b712ebb5cb..45b7169793 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 @@ __all__ = ['URLError', 'HTTPError', 'ContentTooShortError']
# 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 @@ class HTTPError(URLError, urllib.response.addinfourl):
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 975c6ffb9c..2ba39917cf 100644
--- a/Lib/urllib/parse.py
+++ b/Lib/urllib/parse.py
@@ -846,7 +846,6 @@ def splittype(url):
"""splittype('type:opaquestring') --> 'type', 'opaquestring'."""
global _typeprog
if _typeprog is None:
- import re
_typeprog = re.compile('^([^/:]+):')
match = _typeprog.match(url)
@@ -860,7 +859,6 @@ def splithost(url):
"""splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
global _hostprog
if _hostprog is None:
- import re
_hostprog = re.compile('^//([^/?]*)(.*)$')
match = _hostprog.match(url)
@@ -877,7 +875,6 @@ def splituser(host):
"""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 +886,6 @@ def splitpasswd(user):
"""splitpasswd('user:passwd') -> 'user', 'passwd'."""
global _passwdprog
if _passwdprog is None:
- import re
_passwdprog = re.compile('^([^:]*):(.*)$',re.S)
match = _passwdprog.match(user)
@@ -902,7 +898,6 @@ def splitport(host):
"""splitport('host:port') --> 'host', 'port'."""
global _portprog
if _portprog is None:
- import re
_portprog = re.compile('^(.*):([0-9]*)$')
match = _portprog.match(host)
@@ -920,7 +915,6 @@ def splitnport(host, defport=-1):
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 +933,6 @@ def splitquery(url):
"""splitquery('/path?query') --> '/path', 'query'."""
global _queryprog
if _queryprog is None:
- import re
_queryprog = re.compile('^(.*)\?([^?]*)$')
match = _queryprog.match(url)
@@ -951,7 +944,6 @@ def splittag(url):
"""splittag('/path#tag') --> '/path', 'tag'."""
global _tagprog
if _tagprog is None:
- import re
_tagprog = re.compile('^(.*)#([^#]*)$')
match = _tagprog.match(url)
@@ -969,7 +961,6 @@ def splitvalue(attr):
"""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 ef62acc710..5995cbe24f 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -18,7 +18,7 @@ urlopen(url, data=None) -- Basic usage is the same as original
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.error import URLError, HTTPError, ContentTooShortError
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 @@ __all__ = [
'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',
@@ -140,13 +141,9 @@ def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
if cafile or capath or 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()
+ context = ssl._create_stdlib_context(cert_reqs=ssl.CERT_REQUIRED,
+ cafile=cafile,
+ capath=capath)
https_handler = HTTPSHandler(context=context, check_hostname=True)
opener = build_opener(https_handler)
elif _opener is None:
@@ -227,7 +224,7 @@ def urlcleanup():
for temp_file in _url_tempfiles:
try:
os.unlink(temp_file)
- except EnvironmentError:
+ except OSError:
pass
del _url_tempfiles[:]
@@ -258,24 +255,60 @@ class Request:
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 +317,11 @@ class Request:
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 +351,10 @@ class Request:
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)
@@ -531,7 +517,8 @@ def build_opener(*handlers):
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()
@@ -1246,7 +1233,7 @@ class AbstractHTTPHandler(BaseHandler):
try:
h.request(req.get_method(), req.selector, req.data, headers)
- except socket.error as err: # timeout error
+ except OSError as err: # timeout error
h.close()
raise URLError(err)
else:
@@ -1451,7 +1438,7 @@ class FTPHandler(BaseHandler):
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 +1524,36 @@ class CacheFTPHandler(FTPHandler):
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 +1677,20 @@ class URLopener:
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 +1706,7 @@ class URLopener:
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 +1799,7 @@ class URLopener:
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 +1872,7 @@ class URLopener:
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)
@@ -1982,7 +1999,7 @@ class URLopener:
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 +2448,7 @@ def _proxy_bypass_macosx_sysconf(host, proxy_settings):
try:
hostIP = socket.gethostbyname(hostonly)
hostIP = ip2num(hostIP)
- except socket.error:
+ except OSError:
continue
base = ip2num(m.group(1))
@@ -2517,7 +2534,7 @@ elif os.name == 'nt':
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 +2564,7 @@ elif os.name == 'nt':
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 +2575,13 @@ elif os.name == 'nt':
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/uuid.py b/Lib/uuid.py
index 9946042c29..a4e553247d 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -147,7 +147,7 @@ class UUID(object):
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')
@@ -321,8 +321,9 @@ def _find_mac(command, args, hw_identifiers, get_index):
return None
try:
- # LC_ALL to ensure English output, 2>/dev/null to
- # prevent output on stderr
+ # 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)
with os.popen(cmd) as pipe:
for line in pipe:
@@ -339,7 +340,7 @@ def _find_mac(command, args, hw_identifiers, get_index):
# dashes. These should be ignored in favor of a
# real MAC address
pass
- except IOError:
+ except OSError:
pass
def _ifconfig_getnode():
@@ -380,7 +381,7 @@ def _ipconfig_getnode():
for dir in dirs:
try:
pipe = os.popen(os.path.join(dir, 'ipconfig') + ' /all')
- except IOError:
+ except OSError:
continue
else:
for line in pipe:
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 3606370e86..3b5f5fab81 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -24,10 +24,13 @@ optional arguments:
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
@@ -56,14 +59,17 @@ class EnvBuilder:
: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 +82,20 @@ class EnvBuilder:
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 +107,11 @@ class EnvBuilder:
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]
@@ -216,6 +232,15 @@ class EnvBuilder:
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 +278,8 @@ class EnvBuilder:
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 +334,8 @@ class EnvBuilder:
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 +351,11 @@ def create(env_dir, system_site_packages=False, clear=False, symlinks=False):
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 +389,40 @@ def main(args=None):
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 1c5ef98726..b15decb9c5 100644
--- a/Lib/venv/scripts/nt/Activate.ps1
+++ b/Lib/venv/scripts/nt/Activate.ps1
@@ -1,25 +1,40 @@
-$env:VIRTUAL_ENV="__VENV_DIR__"
+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
+ }
-# 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_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:_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__"
+
# 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 3d1e96bc8c..0000000000
--- 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 3cebe26381..9eab147f31 100644
--- a/Lib/venv/scripts/nt/activate.bat
+++ b/Lib/venv/scripts/nt/activate.bat
@@ -14,7 +14,7 @@ if defined _OLD_VIRTUAL_PYTHONHOME (
)
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 c241450c0b..7bbffd9ba6 100644
--- a/Lib/venv/scripts/posix/activate
+++ b/Lib/venv/scripts/posix/activate
@@ -54,8 +54,8 @@ fi
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 0000000000..99d79e0138
--- /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 0000000000..45391aa01c
--- /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 edbbb5eda4..a427e3510e 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -1,9 +1,5 @@
"""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",
@@ -16,11 +12,12 @@ def showwarning(message, category, filename, lineno, file=None, line=None):
file = sys.stderr
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:
@@ -233,6 +230,7 @@ def warn_explicit(message, category, filename, lineno,
# 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":
diff --git a/Lib/wave.py b/Lib/wave.py
index 4a223451bf..b56395ead7 100644
--- a/Lib/wave.py
+++ b/Lib/wave.py
@@ -18,7 +18,7 @@ This returns an instance of a class with the following public methods:
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 @@ WAVE_FORMAT_PCM = 0x0001
_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 @@ class Wave_read:
def __del__(self):
self.close()
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ self.close()
+
#
# User visible methods.
#
@@ -207,9 +213,9 @@ class Wave_read:
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 @@ class Wave_read:
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 @@ class Wave_write:
def __del__(self):
self.close()
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *args):
+ self.close()
+
#
# User visible methods.
#
@@ -402,8 +394,8 @@ class Wave_write:
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 @@ class Wave_write:
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 @@ class Wave_write:
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 fcb6b74d1b..f6a40ca4bf 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -21,13 +21,69 @@ from _weakref import (
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 @@ class WeakValueDictionary(collections.MutableMapping):
"""
with _IterationGuard(self):
- for wr in self.data.values():
- yield wr
+ yield from self.data.values()
def values(self):
with _IterationGuard(self):
@@ -383,3 +438,140 @@ class WeakKeyDictionary(collections.MutableMapping):
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 945eda4a95..9e47084a91 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 @@ def _synthesize(browser, update_tryorder=1):
"""
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 @@ def _synthesize(browser, update_tryorder=1):
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):
@@ -418,11 +384,11 @@ class Grail(BaseBrowser):
# 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 +419,22 @@ class Grail(BaseBrowser):
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 +442,39 @@ def register_X_browsers():
"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 +483,18 @@ if os.environ.get("DISPLAY"):
# 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 +506,7 @@ if sys.platform[:3] == "win":
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 +524,7 @@ if sys.platform[:3] == "win":
"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 +610,6 @@ if sys.platform == 'darwin':
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 46c579f8ec..1efbba01a3 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/xml/dom/expatbuilder.py b/Lib/xml/dom/expatbuilder.py
index f074ab932f..81e2df70d7 100644
--- a/Lib/xml/dom/expatbuilder.py
+++ b/Lib/xml/dom/expatbuilder.py
@@ -905,11 +905,8 @@ def parse(file, namespaces=True):
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 +936,8 @@ def parseFragment(file, context, namespaces=True):
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/etree/ElementInclude.py b/Lib/xml/etree/ElementInclude.py
index 71eeb05a6e..963470e3b1 100644
--- a/Lib/xml/etree/ElementInclude.py
+++ b/Lib/xml/etree/ElementInclude.py
@@ -71,8 +71,8 @@ class FatalIncludeError(SyntaxError):
# @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 @@ def default_loader(href, parse, encoding=None):
# 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 e7015c7c61..d914ddb672 100644
--- a/Lib/xml/etree/ElementPath.py
+++ b/Lib/xml/etree/ElementPath.py
@@ -105,14 +105,12 @@ def prepare_child(next, token):
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 @@ def prepare_predicate(next, token):
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 @@ def prepare_predicate(next, token):
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 @@ def prepare_predicate(next, token):
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 @@ def prepare_predicate(next, token):
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 a8e57295c6..d9e98078c8 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 @@ __all__ = [
"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 @@ import contextlib
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.
- tag = None
+ An element's length is its number of subelements. That means if you
+ you want to check if an element is truly empty, you should check BOTH
+ its length AND its text attribute.
- ##
- # (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 tag, attribute names, and attribute values can be either
+ bytes or strings.
- attrib = None
+ *tag* is the element name. *attrib* is an optional dictionary containing
+ element attributes. *extra* are additional element attributes given as
+ keyword arguments.
- ##
- # (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.
+ Example form:
+ <tag attrib>text<child/>...</tag>tail
+
+ """
+
+ tag = None
+ """The element's name."""
+
+ attrib = None
+ """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 @@ class Element:
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):
- return self.__class__(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.
- ##
- # (Experimental) Copies the current element. This creates a
- # shallow copy; subelements will be shared with the original tree.
- #
- # @return A new element instance.
+ """
+ return self.__class__(tag, attrib)
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 @@ class Element:
)
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 @@ class Element:
# 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, element):
- # assert iselement(element)
- self._children.remove(element)
+ def remove(self, subelement):
+ """Remove matching subelement.
+
+ 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.
- ##
- # (Deprecated) Returns all subelements. The elements are returned
- # in document order.
- #
- # @return A list of subelements.
- # @defreturn list of Element instances
+ """
+ # assert iselement(element)
+ 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 @@ class Element:
)
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):
- return ElementPath.find(self, path, namespaces)
+ """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.
- ##
- # 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
+ Return the first matching element, or None if no element was found.
+
+ """
+ return ElementPath.find(self, path, namespaces)
def findtext(self, path, default=None, namespaces=None):
- return ElementPath.findtext(self, path, default, namespaces)
+ """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.
- ##
- # 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
+ 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)
def findall(self, path, namespaces=None):
- return ElementPath.findall(self, path, namespaces)
+ """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.
- ##
- # 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
+ Returns list containing all matching elements in document order.
+
+ """
+ return ElementPath.findall(self, path, namespaces)
def iterfind(self, path, namespaces=None):
- return ElementPath.iterfind(self, path, namespaces)
+ """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.
- ##
- # Resets an element. This function removes all subelements, clears
- # all attributes, and sets the <b>text</b> and <b>tail</b> attributes
- # to None.
+ Return an iterable yielding all matching elements in document order.
+
+ """
+ return ElementPath.iterfind(self, path, namespaces)
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):
- return self.attrib.get(key, default)
+ """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.
- ##
- # 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.
+ Returns a string containing the attribute value, or the default if
+ attribute was not found.
+
+ """
+ return self.attrib.get(key, default)
def set(self, key, value):
- self.attrib[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.
- ##
- # 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
+ """
+ self.attrib[key] = value
def keys(self):
- return self.attrib.keys()
+ """Get list of attribute names.
- ##
- # 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
+ Names are returned in an arbitrary order, just like an ordinary
+ Python dict. Equivalent to attrib.keys()
+
+ """
+ return self.attrib.keys()
def items(self):
- return self.attrib.items()
+ """Get element attributes as a sequence.
+
+ The attributes are returned in arbitrary order. Equivalent to
+ 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
+ Return a list of (name, value) tuples.
+
+ """
+ return self.attrib.items()
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 @@ class Element:
)
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 @@ def ProcessingInstruction(target, text=None):
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 @@ class QName:
# --------------------------------------------------------------------
-##
-# 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 @@ class ElementTree:
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 @@ class ElementTree:
)
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 @@ class ElementTree:
)
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 @@ class ElementTree:
)
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 @@ class ElementTree:
)
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 @@ class ElementTree:
)
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 @@ class ElementTree:
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 @@ def _namespaces(elem, default_namespace=None):
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 @@ def _serialize_xml(write, elem, qnames, namespaces):
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 @@ def _serialize_xml(write, elem, qnames, namespaces):
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 @@ try:
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 @@ _serialize = {
# "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 @@ def _escape_attrib_html(text):
# --------------------------------------------------------------------
-##
-# 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):
+def tostring(element, encoding=None, method=None, *,
+ short_empty_elements=True):
+ """Generate string representation of XML element.
+
+ 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 @@ class _ListDataStream(io.BufferedIOBase):
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 @@ def dump(elem):
# --------------------------------------------------------------------
# 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 @@ def XMLID(text, parser=None):
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 @@ def fromstringlist(sequence, parser=None):
# --------------------------------------------------------------------
-##
-# 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 @@ class TreeBuilder:
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 @@ class TreeBuilder:
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 @@ class TreeBuilder:
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 @@ class TreeBuilder:
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 @@ class XMLParser:
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 @@ class XMLParser:
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 @@ class XMLParser:
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 @@ class XMLParser:
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 @@ class XMLParser:
# 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 @@ class XMLParser:
# 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/xmlrpc/client.py b/Lib/xmlrpc/client.py
index 461c3005ff..1238b9bf37 100644
--- a/Lib/xmlrpc/client.py
+++ b/Lib/xmlrpc/client.py
@@ -1045,7 +1045,7 @@ def gzip_decode(data):
gzf = gzip.GzipFile(mode="rb", fileobj=f)
try:
decoded = gzf.read()
- except IOError:
+ except OSError:
raise ValueError("invalid data")
f.close()
gzf.close()
@@ -1130,8 +1130,9 @@ class Transport:
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:
@@ -1385,7 +1386,7 @@ class ServerProxy:
# 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"
diff --git a/Lib/xmlrpc/server.py b/Lib/xmlrpc/server.py
index d27bf5a177..304e218c00 100644
--- a/Lib/xmlrpc/server.py
+++ b/Lib/xmlrpc/server.py
@@ -584,13 +584,6 @@ class SimpleXMLRPCServer(socketserver.TCPServer,
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 ff64c90829..7b6bd5f809 100644
--- a/Lib/zipfile.py
+++ b/Lib/zipfile.py
@@ -6,7 +6,7 @@ XXX references to utf-8 need further investigation.
import io
import os
import re
-import imp
+import importlib.util
import sys
import time
import stat
@@ -164,7 +164,7 @@ def _check_zipfile(fp):
try:
if _EndRecData(fp):
return True # file has correct magic number
- except IOError:
+ except OSError:
pass
return False
@@ -180,7 +180,7 @@ def is_zipfile(filename):
else:
with open(filename, "rb") as fp:
result = _check_zipfile(fp)
- except IOError:
+ except OSError:
pass
return result
@@ -190,7 +190,7 @@ def _EndRecData64(fpin, offset, endrec):
"""
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 @@ def _EndRecData64(fpin, offset, endrec):
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 @@ def _EndRecData(fpin):
# 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 ZipInfo (object):
"""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 @@ class ZipInfo (object):
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 @@ class ZipInfo (object):
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):
@@ -475,13 +475,15 @@ class _ZipDecrypter:
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 @@ class LZMACompressor:
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 @@ class LZMADecompressor:
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 @@ def _check_compression(compression):
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 _check_compression(compression):
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 @@ class ZipExtFile(io.BufferedIOBase):
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 ZipExtFile(io.BufferedIOBase):
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 @@ class ZipFile:
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 @@ class ZipFile:
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 @@ class ZipFile:
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 @@ class ZipFile:
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 @@ class ZipFile:
# 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 @@ class ZipFile:
"""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,7 +1302,7 @@ class ZipFile:
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:
@@ -1304,14 +1310,14 @@ class ZipFile:
if zinfo.header_offset > ZIP64_LIMIT:
if not self._allowZip64:
raise LargeZipFile(
- "Zipfile size would require ZIP64 extensions")
+ "Zipfile size 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)
@@ -1358,7 +1364,7 @@ class ZipFile:
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:
@@ -1412,7 +1418,7 @@ class ZipFile:
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 +1438,7 @@ class ZipFile:
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 +1447,7 @@ class ZipFile:
# 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
@@ -1467,7 +1473,7 @@ class ZipFile:
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 +1493,8 @@ class ZipFile:
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 +1508,21 @@ class ZipFile:
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)
@@ -1533,22 +1539,22 @@ class ZipFile:
centDirSize > ZIP64_LIMIT):
# Need to write the ZIP64 end-of-archive records
zip64endrec = struct.pack(
- structEndArchive64, stringEndArchive64,
- 44, 45, 45, 0, 0, centDirCount, centDirCount,
- centDirSize, centDirOffset)
+ 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 +1569,12 @@ class PyZipFile(ZipFile):
"""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 +1585,14 @@ class PyZipFile(ZipFile):
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 +1617,15 @@ class PyZipFile(ZipFile):
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 +1637,19 @@ class PyZipFile(ZipFile):
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 +1676,8 @@ class PyZipFile(ZipFile):
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
@@ -1766,10 +1788,10 @@ def main(args = None):
elif os.path.isdir(path):
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:
+ with ZipFile(args[1], 'w') as zf:
for src in args[2:]:
addToZip(zf, src, os.path.basename(src))
diff --git a/Mac/BuildScript/README.txt b/Mac/BuildScript/README.txt
index 56c769af7b..0a6b544557 100644
--- a/Mac/BuildScript/README.txt
+++ b/Mac/BuildScript/README.txt
@@ -8,7 +8,7 @@ $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 Python 3.4.0, PSF practice is to build two installer variants
for each release.
1. 32-bit-only, i386 and PPC universal, capable on running on all machines
@@ -22,8 +22,8 @@ for each release.
- 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.1
+ * XZ 5.0.5
- uses system-supplied versions of third-party libraries
@@ -56,14 +56,14 @@ for each release.
- 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.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.5.9 (or later) to be installed for building
+ - requires ActiveState Tcl/Tk 8.5.15 (or later) to be installed for building
- recommended build environment:
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index fd5d5c36a7..7c1d90f83e 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -193,7 +193,8 @@ def library_recipes():
LT_10_5 = bool(DEPTARGET < '10.5')
- if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
+# Disable for now
+ if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 5)):
result.extend([
dict(
name="Tcl 8.5.15",
@@ -237,9 +238,9 @@ def library_recipes():
if getVersionTuple() >= (3, 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 +283,9 @@ def library_recipes():
),
),
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 '
@@ -364,6 +365,7 @@ def library_recipes():
# Instructions for building packages inside the .mpkg.
def pkg_recipes():
unselected_for_python3 = ('selected', 'unselected')[PYTHON_3]
+ unselected_for_lt_python34 = ('selected', 'unselected')[getVersionTuple() < (3, 4)]
result = [
dict(
name="PythonFramework",
@@ -432,10 +434,27 @@ def pkg_recipes():
topdir="/Library/Frameworks/Python.framework",
source="/empty-dir",
required=False,
- selected=unselected_for_python3,
+ selected=unselected_for_lt_python34,
),
]
+ if getVersionTuple() >= (3, 4):
+ result.append(
+ 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:
result.append(
dict(
@@ -453,6 +472,7 @@ def pkg_recipes():
selected=unselected_for_python3,
)
)
+
return result
def fatal(msg):
@@ -567,20 +587,6 @@ def checkEnvironment():
% 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']
@@ -955,34 +961,19 @@ def buildPython():
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 ')[getVersionTuple() >= (3, 4)],
shellQuote(WORKDIR)[1:-1],
shellQuote(WORKDIR)[1:-1]))
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 +998,11 @@ def buildPython():
'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 +1028,9 @@ def buildPython():
% (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
diff --git a/Mac/BuildScript/resources/ReadMe.txt b/Mac/BuildScript/resources/ReadMe.txt
index 212d963c64..e061a06350 100644
--- a/Mac/BuildScript/resources/ReadMe.txt
+++ b/Mac/BuildScript/resources/ReadMe.txt
@@ -28,6 +28,36 @@ 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.
+ **NEW* As of Python 3.4.0b1:
+
+New Installation Options and Defaults
+=====================================
+
+The Python installer now includes an option to automatically install
+or upgrade pip, 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 "Customize"
+option at the "Installation Type" step and uncheck the "Install or
+ugprade pip" option.
+
+To make it easier to use scripts installed by third-party Python
+packages, with pip or by other means, the "Shell profile updater"
+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
+"Customize" and unchecking the "Shell profile updater" option. You
+can also update your shell profile later by launching the "Update
+Shell Profile" command found in the /Applications/Python $VERSION
+folder. You may need to start a new terminal window for the
+changes to take effect.
+
+Python.org Python $VERSION and 2.7.x versions can both be installed and
+will not conflict. Command names for Python 3 contain a 3 in them,
+python3 (or python$VERSION), idle3 (or idle$VERSION), pip3 (or pip$VERSION), etc.
+Python 2.7 command names contain a 2 or no digit: python2 (or
+python2.7 or python), idle2 (or idle2.7 or idle), etc. If you want to
+use pip with Python 2.7.x, you will need to download and install a
+separate copy of it from the Python Package Index
+(https://pypi.python.org/pypi).
Using this version of Python on OS X
====================================
diff --git a/Mac/BuildScript/resources/Welcome.rtf b/Mac/BuildScript/resources/Welcome.rtf
index 239d76ecc2..886ebfecab 100644
--- a/Mac/BuildScript/resources/Welcome.rtf
+++ b/Mac/BuildScript/resources/Welcome.rtf
@@ -1,5 +1,5 @@
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf400
-\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\paperw11905\paperh16837\margl1440\margr1440\vieww9640\viewh10620\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
@@ -16,13 +16,17 @@
\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.\
-\
-\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:
+\b0 This package now updates your shell profile by default to make $FULL_VERSION the default Python 3 version. This version can co-exist with other installed versions of Python 3 and Python 2. This package also installs a version of
+\f1 pip
+\f0 , the recommended tool for installing and managing Python packages. Type\
+\
+
+\f1 pip3.4 --help
+\f0 \
+\
+for an overview. See the ReadMe file and the Python documentation for more information.\
\
\b IMPORTANT:
diff --git a/Mac/BuildScript/scripts/postflight.ensurepip b/Mac/BuildScript/scripts/postflight.ensurepip
new file mode 100755
index 0000000000..3b97c4759e
--- /dev/null
+++ b/Mac/BuildScript/scripts/postflight.ensurepip
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# Install/upgrade pip.
+#
+
+PYVER="@PYVER@"
+PYMAJOR="3"
+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
+ (
+ 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
+ if [ "$(readlink -n ./python${PYVER})" = "${RELFWKBIN}/python${PYVER}" ] ; then
+ for fn in "pip${PYVER}" "easy_install-${PYVER}" ;
+ 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
+ # Create pipx link if /usr/local/bin/pythonx is linked to this version
+ if [ "$(readlink -n ./python${PYMAJOR})" = "${RELFWKBIN}/python${PYMAJOR}" ] ; then
+ for fn in "pip${PYMAJOR}" ;
+ 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
+ )
+fi
+exit 0
diff --git a/Mac/Makefile.in b/Mac/Makefile.in
index 5cb664da1c..03ec738e34 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 @@ export MACOSX_DEPLOYMENT_TARGET
# 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 @@ APPTEMPLATE=$(srcdir)/Resources/app
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 @@ installunixtools:
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) ;\
- do \
- ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
- done
-ifneq ($(LIPO_32BIT_FLAGS),)
- for fn in python3-32 pythonw3-32 \
- python$(VERSION)-32 pythonw$(VERSION)-32 ;\
+ 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
-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 @@ altinstallunixtools:
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) ;\
- do \
- ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
- done
-ifneq ($(LIPO_32BIT_FLAGS),)
- for fn in python$(VERSION)-32 pythonw$(VERSION)-32 ;\
+ 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
-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/README b/Mac/README
index 8d4eb3b809..2774d10e36 100644
--- a/Mac/README
+++ b/Mac/README
@@ -7,7 +7,7 @@ Python on Mac OS X README
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.
@@ -106,6 +106,8 @@ values are available:
* ``intel``: ``i386``, ``x86_64``
+ * ``intel-32``: ``i386``
+
* ``32-bit``: ``ppc``, ``i386``
* ``3-way``: ``i386``, ``x86_64``, ``ppc``
@@ -132,7 +134,7 @@ following combinations of SDKs and universal-archs flavors are available:
* 10.7 and 10.8 SDKs with Xcode 4 support ``intel`` only
-The makefile for a framework build will also install ``python3.3-32``
+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,7 +158,7 @@ Using ``arch`` is not a perfect solution as the selected architecture will
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.
@@ -176,7 +178,7 @@ 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
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 9b3ace4631..0000000000
--- 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 616ae70b4a..0000000000
--- 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 eb9fee0017..0000000000
--- 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 7f0b63a3bb..0000000000
--- 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 5359df53c4..0000000000
--- 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 86ecb95c96..0000000000
--- 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 4f4d53d01e..0000000000
--- 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 a35152cef1..0000000000
--- 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 6cc130fa44..f5679d3bd1 100644..100755
--- a/Mac/Tools/bundlebuilder.py
+++ b/Mac/Tools/bundlebuilder.py
@@ -270,7 +270,7 @@ __load()
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 0000000000..057b61765b
--- /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 fdca38e327..bd79fb364a 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -127,7 +127,6 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
# 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 +148,21 @@ PYTHONFRAMEWORKINSTALLDIR= @PYTHONFRAMEWORKINSTALLDIR@
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 +224,12 @@ TCLTK_LIBS= @TCLTK_LIBS@
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 ===
@@ -361,6 +375,7 @@ PYTHON_OBJS= \
Python/pyarena.o \
Python/pyctype.o \
Python/pyfpe.o \
+ Python/pyhash.o \
Python/pymath.o \
Python/pystate.o \
Python/pythonrun.o \
@@ -444,7 +459,7 @@ LIBRARY_OBJS= \
# 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 +483,53 @@ run_profile_task:
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)
@@ -646,6 +703,8 @@ Modules/python.o: $(srcdir)/Modules/python.c
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 +772,31 @@ Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
$(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 +814,6 @@ $(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
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 +883,7 @@ PYTHON_HEADERS= \
$(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 +962,38 @@ buildbottest: all platform
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: 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
-altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
- sharedinstall oldsharedinstall altmaninstall @FRAMEWORKALTINSTALLLAST@
+commoninstall: @FRAMEWORKALTINSTALLFIRST@ \
+ altbininstall libinstall inclinstall libainstall \
+ sharedinstall oldsharedinstall altmaninstall \
+ @FRAMEWORKALTINSTALLLAST@
# Install shared libraries enabled by Setup
DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
@@ -935,7 +1018,7 @@ $(DESTSHARED):
# 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 +1027,18 @@ altbininstall: $(BUILDPYTHON)
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 +1052,12 @@ altbininstall: $(BUILDPYTHON)
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 +1083,10 @@ bininstall: altbininstall
(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:
@@ -1042,8 +1139,11 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
test/namespace_pkgs/project3/parent/child \
test/namespace_pkgs/module_and_namespace_package \
test/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 +1261,19 @@ $(srcdir)/Lib/$(PLATDIR):
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 +1331,8 @@ libainstall: all python-config
$(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 +1414,14 @@ frameworkinstallmaclib:
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)"
@@ -1403,6 +1519,8 @@ clean: pycremoval
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 +1528,7 @@ clobber: clean profile-removal
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 +1600,7 @@ Python/thread.o: @THREADHEADERS@
.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 aa1add20b3..b8aaf75331 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -57,6 +57,7 @@ John Aycock
Donovan Baarda
Arne Babenhauserheide
Attila Babo
+Matt Bachmann
Marcin Bachry
Alfonso Baciero
Dwayne Bailey
@@ -123,6 +124,7 @@ Philippe Biondi
Michael Birtwell
Stuart Bishop
Roy Bixler
+Daniel Black
Jonathan Black
Renaud Blanch
Mike Bland
@@ -140,6 +142,7 @@ Gawain Bolton
Forest Bond
Gregory Bond
Matias Bordese
+Jonas Borgström
Jurjen Bos
Peter Bosch
Dan Boswell
@@ -154,8 +157,10 @@ Georg Brandl
Christopher Brannon
Terrence Brannon
Germán M. Bravo
+Sven Brauch
Erik Bray
Brian Brazil
+Demian Brecht
Dave Brennan
Tom Bridgman
Anthony Briggs
@@ -172,9 +177,11 @@ Dave Brueck
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
@@ -194,6 +201,7 @@ Brett Cannon
Mike Carlton
Pierre Carrier
Terry Carroll
+Edward Catmur
Lorenzo M. Catucci
Donn Cave
Charles Cazabon
@@ -228,6 +236,7 @@ David Cinege
Craig Citro
Gilles Civario
Chris Clark
+Laurie Clark-Michalek
Mike Clarkson
Andrew Clegg
Brad Clements
@@ -285,6 +294,7 @@ Kushal Das
Jonathan Dasteel
Pierre-Yves David
A. Jesse Jiryu Davis
+Merlijn van Deen
John DeGood
Ned Deily
Vincent Delft
@@ -320,11 +330,13 @@ Derk Drukker
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
Eugene Dvurechenski
@@ -333,6 +345,7 @@ Maxim Dzumanenko
Walter Dörwald
Hans Eckardt
Rodolpho Eckhardt
+Ulrich Eckhardt
David Edelsohn
John Edmonds
Grant Edwards
@@ -347,6 +360,7 @@ Phil Elson
David Ely
Jeff Epler
Tom Epperly
+Gökcen Eraslan
Stoffel Erasmus
Jürgen A. Erhard
Michael Ernst
@@ -443,6 +457,7 @@ Yannick Gingras
Matt Giuca
Wim Glenn
Michael Goderbauer
+Jeroen Van Goey
Christoph Gohlke
Tim Golden
Guilherme Gonçalves
@@ -461,7 +476,7 @@ Eric Groo
Dag Gruneau
Filip Gruszczyński
Thomas Guettler
-Ajitesh Gupta
+Anuj Gupta
Michael Guravage
Lars Gustäbel
Thomas Güttler
@@ -472,6 +487,7 @@ Paul ten Hagen
Rasmus Hahn
Peter Haight
Václav Haisman
+Zbigniew Halas
Walker Hale IV
Bob Halley
Jesse Hallio
@@ -497,6 +513,7 @@ Janko Hauser
Rycharde Hawkes
Ben Hayden
Jochen Hayek
+Tim Heaney
Henrik Heimbuerger
Christian Heimes
Thomas Heller
@@ -569,6 +586,7 @@ Aaron Iles
Lars Immisch
Bobby Impollonia
Meador Inge
+Peter Ingebretson
Tony Ingraldi
John Interrante
Bob Ippolito
@@ -602,6 +620,7 @@ Orjan Johansen
Fredrik Johansson
Gregory K. Johnson
Kent Johnson
+Michael Johnson
Simon Johnston
Matt Joiner
Thomas Jollans
@@ -621,6 +640,7 @@ Tattoo Mabonzo K.
Sarah K.
Sunny K
Bohuslav Kabrda
+Alexey Kachayev
Bob Kahn
Kurt B. Kaiser
Tamito Kajiyama
@@ -642,6 +662,7 @@ Jim Kerr
Magnus Kessler
Lawrence Kesteloot
Vivek Khera
+Dhiru Kholia
Mads Kiilerich
Jason Killen
Jan Kim
@@ -698,7 +719,9 @@ Vladimir Kushnir
Erno Kuusela
Ross Lagerwall
Cameron Laird
+David Lam
Thomas Lamb
+Valerie Lambert
Jean-Baptiste "Jiba" Lamy
Ronan Lamy
Torsten Landschoff
@@ -736,9 +759,11 @@ Marc-André Lemburg
Mateusz Lenik
John Lenton
Kostyantyn Leschenko
+Benno Leslie
Christopher Tur Lesniewski-Laas
Alain Leufroy
Mark Levinson
+Mark Levitt
William Lewis
Akira Li
Xuanji Li
@@ -762,14 +787,17 @@ Hugo Lopes Tavares
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
@@ -780,9 +808,13 @@ Andrew I MacIntyre
Tim MacKenzie
Nick Maclaren
Don MacMillen
+Tomasz Maćkowiak
Steve Majewski
+Marek Majkowski
Grzegorz Makarewicz
David Malcolm
+Greg Malcolm
+William Mallard
Ken Manheimer
Vladimir Marangozov
Colin Marc
@@ -805,7 +837,9 @@ Martin Matusiak
Dieter Maurer
Daniel May
Madison May
+Lucas Maystre
Arnaud Mazin
+Matt McClure
Rebecca McCreary
Kirk McDonald
Chris McDonough
@@ -845,6 +879,7 @@ Chad Miller
Damien Miller
Jason V. Miller
Jay T. Miller
+Katie Miller
Roman Milner
Julien Miotte
Andrii V. Mishkovskyi
@@ -854,6 +889,7 @@ Zubin Mithra
Florian Mladitsch
Doug Moen
The Dragon De Monsyne
+Bastien Montagne
Skip Montanaro
Peter Moody
Paul Moore
@@ -861,6 +897,7 @@ Ross Moore
Ben Morgan
Derek Morr
James A Morrison
+Martin Morrison
Derek McTavish Mounce
Alessandro Moura
Pablo Mouzo
@@ -875,6 +912,7 @@ Neil Muller
Louis Munro
R. David Murray
Matti Mäki
+Jörg Müller
Dale Nagata
John Nagle
Takahiro Nakayama
@@ -913,6 +951,7 @@ Aaron Oakley
James Oakley
Elena Oat
Jon Oberheide
+Milan Oberkirch
Pascal Oberndoerfer
Jeffrey Ollie
Adam Olsen
@@ -937,6 +976,7 @@ Mike Pall
Todd R. Palmer
Juan David Ibáñez Palomar
Jan Palus
+Mathias Panzenböck
M. Papillon
Peter Parente
Alexandre Parenteau
@@ -945,6 +985,7 @@ William Park
Heikki Partanen
Harri Pasanen
Gaël Pasgrimaud
+Ashish Nitin Patil
Randy Pausch
Samuele Pedroni
Justin Peel
@@ -963,8 +1004,10 @@ Tim Peters
Benjamin Peterson
Joe Peterson
Chris Petrilli
+Roumen Petrov
Bjorn Pettersen
Justin D. Pettit
+Esa Peuha
Ronny Pfannschmidt
Geoff Philbrick
Gavrie Philipson
@@ -978,12 +1021,15 @@ Anand B. Pillai
François Pinard
Tom Pinckney
Zach Pincus
+Zero Piraeus
Michael Piotrowski
Antoine Pitrou
Jean-François Piéronne
Oleg Plakhotnyuk
Remi Pointel
+Ariel Poliak
Guilherme Polo
+Illia Polosukhin
Michael Pomraning
Martin Pool
Iustin Pop
@@ -994,18 +1040,22 @@ Amrit Prem
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
@@ -1038,7 +1088,7 @@ Nicholas Riley
Jean-Claude Rimbault
Vlad Riscutia
Wes Rishel
-Dan Riti
+Daniel Riti
Juan M. Bello Rivas
Davide Rizzo
Anthony Roach
@@ -1140,6 +1190,7 @@ Daniel Shahaf
Ha Shao
Mark Shannon
Richard Shapiro
+Varun Sharma
Vlad Shcherbina
Justin Sheehy
Charlie Shepherd
@@ -1169,6 +1220,7 @@ J. Sipprell
Kragen Sitaker
Michael Sloan
Nick Sloan
+Václav Šmilauer
Christopher Smith
Eric V. Smith
Gregory P. Smith
@@ -1208,6 +1260,7 @@ Michael Stone
Serhiy Storchaka
Ken Stox
Dan Stromberg
+Donald Stufft
Daniel Stutzbach
Andreas Stührk
Colin Su
@@ -1224,6 +1277,7 @@ Thenault Sylvain
Péter Szabó
Amir Szekely
Arfrever Frehtes Taifersar Arahesis
+Hideaki Takahashi
Indra Talip
Neil Tallim
Geoff Talvola
@@ -1235,6 +1289,7 @@ Amy Taylor
Monty Taylor
Anatoly Techtonik
Mikhail Terekhov
+Victor Terrón
Richard M. Tew
Tobias Thelen
Févry Thibault
@@ -1242,6 +1297,7 @@ Lowe Thiderman
Nicolas M. Thiéry
James Thomas
Robin Thomas
+Brian Thorne
Stephen Thorne
Jeremy Thurgood
Eric Tiedemann
@@ -1321,6 +1377,7 @@ Kevin Walzer
Rodrigo Steinmuller Wanderley
Ke Wang
Greg Ward
+Tom Wardill
Zachary Ware
Jonas Wagner
Barry Warsaw
@@ -1346,6 +1403,7 @@ Truida Wiedijk
Felix Wiemann
Gerry Wiener
Frank Wierzbicki
+Santoso Wijaya
Bryce "Zooko" Wilcox-O'Hearn
Timothy Wild
Jakub Wilk
@@ -1378,6 +1436,7 @@ Steven Work
Gordon Worley
Darren Worrall
Thomas Wouters
+Daniel Wozniak
Heiko Wundram
Doug Wyatt
Robert Xiao
@@ -1390,6 +1449,7 @@ Bob Yodlowski
Danny Yoo
Rory Yorke
George Yoshida
+Kazuhiro Yoshida
Masazumi Yoshikawa
Arnaud Ysmal
Bernard Yue
@@ -1405,4 +1465,5 @@ Uwe Zessin
Cheng Zhang
Kai Zhu
Tarek Ziadé
+Gennadiy Zlobin
Peter Ã…strand
diff --git a/Misc/HISTORY b/Misc/HISTORY
index 01c635b223..4280764d18 100644
--- a/Misc/HISTORY
+++ b/Misc/HISTORY
@@ -3,13 +3,4110 @@ Python History
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 manager 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 manager 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
+ 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?
=========================
diff --git a/Misc/NEWS b/Misc/NEWS
index 253c850b5a..dd5d7da83b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,19 +2,28 @@
Python News
+++++++++++
-What's New in Python 3.3.6 release candidate 1?
-===============================================
-
-*Release date: XX-XXX-XXXX*
+What's New in Python 3.4.1?
+===========================
Core and Builtins
-----------------
+- 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 #20786: Fix signatures for dict.__delitem__ and
+ property.__delete__ builtins.
+
Library
-------
-- Issue #20875: Prevent possible gzip "'read' is not defined" NameError.
- Patch by Claudiu Popa.
+- 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
@@ -23,58 +32,63 @@ Library
- 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 #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).
-What's New in Python 3.3.5?
-===========================
-
-*Release date: 09-Mar-2014*
-
-No changes from release candidate 2.
+- 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.
-What's New in Python 3.3.5 release candidate 2?
-===============================================
+- Issue #19748: On AIX, time.mktime() now raises an OverflowError for year
+ outsize range [1902; 2037].
-*Release date: 02-Mar-2014*
+Documentation
+-------------
-Core and Builtins
------------------
+- Issue #20765: Add missing documentation for PurePath.with_name() and
+ PurePath.with_suffix().
-- Issue #20731: Properly position in source code files even if they
- are opened in text mode. Patch by Serhiy Storchaka.
+- 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 #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)
+Tests
+-----
-Library
--------
+- Issue #20743: Fix a reference leak in test_tcl.
-- Issue #20778: Fix modulefinder to work with bytecode-only modules.
+Build
+-----
-- Issue #20791: copy.copy() now doesn't make a copy when the input is
- a bytes object. Initial patch by Peter Otten.
+- Issue #14512: Launch pydoc -b instead of pydocgui.pyw on Windows.
-- 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 #20748: Uninstalling pip does not leave behind the pyc of
+ the uninstaller anymore.
-- Issue #20404: io.TextIOWrapper (and hence the open() builtin) now uses the
- internal codec marking system added for issue #19619 to throw LookupError
- for known non-text encodings at stream construction time. The existing
- output type checks remain in place to deal with unmarked third party
- codecs.
+- Issue #20568: The Windows installer now installs the unversioned ``pip``
+ command in addition to the versioned ``pip3`` and ``pip3.4`` commands.
-Tests
------
+- 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 #20743: Fix a reference leak in test_tcl.
+- Issue #20465: Update OS X and Windows installer builds to use
+ SQLite 3.8.3.1.
Tools/Demos
-----------
@@ -83,24 +97,37 @@ Tools/Demos
Patch by Arfrever Frehtes Taifersar Arahesis.
-What's New in Python 3.3.5 release candidate 1?
+What's New in Python 3.4.0 release candidate 2?
===============================================
-*Release date: 23-Feb-2014*
+Release date: 2014-02-23
Core and Builtins
-----------------
-- Issue #20588: Make Python-ast.c C89 compliant.
+- Issue #20261: In pickle, lookup __getnewargs__ and __getnewargs_ex__ on the
+ type of the object.
-- Issue #20437: Fixed 21 potential bugs when deleting objects references.
+- Issue #20619: Give the AST nodes of keyword-only arguments a column and line
+ number.
-- Issue #20538: UTF-7 incremental decoder produced inconsistant string when
- input was truncated in BASE64 section.
+- 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.
+
+- Issue #20595: Make getargs.c C89 compliant.
+
+- Issue #20625: Parameter names in __annotations__ were not mangled properly.
+ Discovered by Jonas Wielicki, patch by Yury Selivanov.
Library
-------
+- Issue #20710: The pydoc summary line no longer displays the "self" parameter
+ for bound methods.
+
+- Issue #20654: Fixed pydoc for enums with zero value. Patch by Vajrasky Kok.
+
- Issue #20635: Fixed grid_columnconfigure() and grid_rowconfigure() methods of
Tkinter widgets to work in wantobjects=True mode.
@@ -108,6 +135,15 @@ Library
OSError(22, 'Invalid argument') when writing input data into stdin, whereas
the process already exited.
+- Issue #20320: select.select() and select.kqueue.control() now round the
+ timeout aways from zero, instead of rounding towards zero.
+
+- 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 #6815: os.path.expandvars() now supports non-ASCII environment
variables names and values.
@@ -122,6 +158,102 @@ Library
- Issue #19856: shutil.move() failed to move a directory to other directory
on Windows if source name ends with os.altsep.
+- 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 #20681: Add new error handling API in asyncio. New APIs:
+ loop.set_exception_handler(), loop.default_exception_handler(), and
+ loop.call_exception_handler().
+
+- 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 #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.
+
+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 #20605: Make test_socket getaddrinfo OS X segfault test more robust.
+
+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
+ for known non-text encodings at stream construction time. The existing
+ output type checks remain in place to deal with unmarked third party
+ codecs.
+
+- Issue #17162: Add PyType_GetSlot.
+
+- Issue #20162: Fix an alignment issue in the siphash24() hash function which
+ caused a crash on PowerPC 64-bit (ppc64).
+
+Library
+-------
+
+- Issue #20530: The signatures for slot builtins have been updated
+ to reflect the fact that they only accept positional-only arguments.
+
+- Issue #20517: Functions in the os module that accept two filenames
+ now register both filenames in the exception on failure.
+
+- 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
fixes an RFC compliance bug and solves an issue with signed MIME parts.
@@ -137,9 +269,21 @@ Library
- 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.
@@ -148,6 +292,14 @@ Library
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.
@@ -155,6 +307,9 @@ Library
- 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.
@@ -164,17 +319,62 @@ Library
- 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.
@@ -183,6 +383,18 @@ Library
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 integers in the range
+ of an unsigned long long but outside of the range of signed long long for
+ binary plist files.
+
IDLE
----
@@ -198,11 +410,7 @@ IDLE
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.
@@ -211,43 +419,73 @@ Tests
- 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 #20609: Restored the ability to build 64-bit Windows binaries on
- 32-bit Windows, which was broken by the change in issue #19788.
+- Issue #20465: Update SQLite shipped with OS X installer to 3.8.3.
+C-API
+-----
-What's New in Python 3.3.4?
-===========================
+- Issue #20517: Added new functions allowing OSError exceptions to reference
+ two filenames instead of one: PyErr_SetFromErrnoWithFilenameObjects() and
+ PyErr_SetExcFromWindowsErrWithFilenameObjects().
-*Release date: 09-Feb-2014*
+Documentation
+-------------
-Library
--------
+- Issue #20488: Change wording to say importlib is *the* implementation of
+ import instead of just *an* implementation.
-- Issue #20374: Fix build warnings of the readline module with libedit on Mac.
+- 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 release candidate 1?
-===============================================
+What's New in Python 3.4.0 Beta 3?
+==================================
-*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.
@@ -262,29 +500,26 @@ Core and Builtins
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.
+Library
+-------
-- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes.
+- 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 #19729: In str.format(), fix recursive expansion in format spec.
+- 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 #19638: Fix possible crash / undefined behaviour from huge (more than 2
- billion characters) input strings in _Py_dg_strtod.
+- Issue #20311: selectors: Add a resolution attribute to BaseSelector.
-Library
--------
-
-- Issue #16042: CVE-2013-1752: smtplib: Limit amount of data read by
- limiting the call to readline(). Original patch by Christian Heimes.
+- 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
@@ -297,6 +532,9 @@ Library
- 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.
@@ -328,7 +566,7 @@ Library
- 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
@@ -346,20 +584,205 @@ Library
- 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.
@@ -368,15 +791,37 @@ Library
- 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.
@@ -396,6 +841,19 @@ Library
- 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
@@ -406,6 +864,9 @@ Library
- 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.
@@ -413,11 +874,16 @@ Library
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
@@ -425,6 +891,9 @@ Library
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.
@@ -432,21 +901,73 @@ Library
- 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.
@@ -456,64 +977,30 @@ Library
- Issue #6477: Added support for pickling the types of built-in singletons
(i.e., Ellipsis, NotImplemented, None).
-- Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with
- virtual interface. Original patch by Kent Frazier.
-
-- Issue #11489: JSON decoder now accepts lone surrogates.
-
-- 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 #19713: Add remaining PEP 451-related deprecations and move away
+ from using find_module/find_loaer/load_module.
-- Issue #13674: Prevented time.strftime from crashing on Windows when given
- a year before 1900 and a format of %y.
+- Issue #19708: Update pkgutil to use the new importer APIs.
-- 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 #19703: Update pydoc to use the new importer APIs.
-- Issue #19544 and Issue #7457: Restore the read_pkg_file method to
- distutils.dist.DistributionMetadata accidentally removed in the undo of
- distutils2.
+- Issue #19851: Fixed a regression in reloading sub-modules.
-- Issue #1575020: Fixed support of 24-bit wave files on big-endian platforms.
+- ssl.create_default_context() sets OP_NO_COMPRESSION to prevent CRIME.
-- Issue #19480: HTMLParser now accepts all valid start-tag names as defined
- by the HTML5 standard.
+- Issue #19802: Add socket.SO_PRIORITY.
-- 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 #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with
+ virtual interface. Original patch by Kent Frazier.
-- Issue #10197: Rework subprocess.get[status]output to use subprocess
- functionality and thus to work on Windows. Patch by Nick Coghlan.
+- Issue #11489: JSON decoder now accepts lone surrogates.
-- Issue #19286: Directories in ``package_data`` are no longer added to
- the filelist, preventing failure outlined in the ticket.
+- Issue #19545: Avoid chained exceptions while passing stray % to
+ time.strptime(). Initial patch by Claudiu Popa.
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.
@@ -524,21 +1011,17 @@ IDLE
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.
@@ -548,26 +1031,35 @@ Tests
- 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
-------------
@@ -581,9 +1073,6 @@ Documentation
- 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.
@@ -591,149 +1080,294 @@ Documentation
- 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.
+Tools/Demos
+-----------
-Build
------
+- Issue #19659: Added documentation for Argument Clinic.
-- 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.
+- Issue #19976: Argument Clinic METH_NOARGS functions now always
+ take two parameters.
-- Add workaround for VS 2010 nmake clean issue. VS 2010 doesn't set up PATH
- for nmake.exe correctly.
+What's New in Python 3.4.0 Beta 1?
+==================================
-Tools/Demos
------------
+Release date: 2013-11-24
-- 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.
+Core and Builtins
+-----------------
-- 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.
+- 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.
-What's New in Python 3.3.3?
-===========================
+- 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.
-*Release date: 17-Nov-2013*
+- Issue #17806: Added keyword-argument support for "tabsize" to
+ str/bytes.expandtabs().
-No changes from release candidate 2.
+- 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.
-What's New in Python 3.3.3 release candidate 2?
-===============================================
+- 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.
-*Release date: 11-Nov-2013*
+- 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 #19306: Add extra hints to the faulthandler module's stack
+ dumps that these are "upside down".
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 #3158: doctest can now find doctests in functions and methods
+ written in C.
-- Issue #19435: Fix directory traversal attack on CGIHttpRequestHandler.
+- Issue #13477: Added command line interface to the tarfile module.
+ Original patch by Berker Peksag.
-Tests
------
+- Issue #19674: inspect.signature() now produces a correct signature
+ for some builtins.
-- Issue #18964: Fix test_tcl when run with Tcl/Tk versions < 8.5.
+- Issue #19722: Added opcode.stack_effect(), which
+ computes the stack effect of bytecode instructions.
-Build
------
+- 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 #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.
+- 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.
-What's New in Python 3.3.3 release candidate 1?
-===============================================
+- Issue #19641: Added the audioop.byteswap() function to convert big-endian
+ samples to little-endian and vice versa.
-*Release date: 27-Oct-2013*
+- Issue #15204: Deprecated the 'U' mode in file-like objects.
-Core and Builtins
------------------
+- Issue #17810: Implement PEP 3154, pickle protocol 4.
-- Issue #18603: Ensure that PyOS_mystricmp and PyOS_mystrnicmp are in the
- Python executable and not removed by the linker's optimizer.
+- Issue #19668: Added support for the cp1125 encoding.
-- Issue #19279: UTF-7 decoder no more produces illegal strings.
+- Issue #19689: Add ssl.create_default_context() factory function. It creates
+ a new SSLContext object with secure default settings.
-- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
- least one place so as to avoid regressions.
+- Issue #19727: os.utime(..., None) is now potentially more precise
+ under Windows.
-- Issue #19014: memoryview.cast() is now allowed on zero-length views.
+- Issue #17201: ZIP64 extensions now are enabled by default. Patch by
+ William Mallard.
-- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
- absurdly high.
+- 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 #18942: sys._debugmallocstats() output was damaged on Windows.
+- Issue #19673: Add pathlib to the stdlib as a provisional module (PEP 428).
-- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
+- 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 #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
- fails.
+- 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 #16741: Fix an error reporting in int().
+- Issue #19552: venv now supports bootstrapping pip into virtual environments
-- Issue #17899: Fix rare file descriptor leak in os.listdir().
+- 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 #18552: Check return value of PyArena_AddPyObject() in
- obj2ast_object().
+- Issue #19555: Restore sysconfig.get_config_var('SO'), (and the distutils
+ equivalent) with a DeprecationWarning pointing people at $EXT_SUFFIX.
-- Issue #18560: Fix potential NULL pointer dereference in sum().
+- 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 #15905: Fix theoretical buffer overflow in handling of sys.argv[0],
- prefix and exec_prefix if the operation system does not obey MAXPATHLEN.
+- Issue #18294: Fix the zlib module to make it 64-bit safe.
-- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
+- Issue #19682: Fix compatibility issue with old version of OpenSSL that
+ was introduced by Issue #18379.
-- Issue #17872: Fix a segfault in marshal.load() when input stream returns
- more bytes than requested.
+- Issue #14455: plistlib now supports binary plists and has an updated API.
-- Issue #18426: Fix NULL pointer dereference in C extension import when
- PyModule_GetDef() returns an error.
+- Issue #19633: Fixed writing not compressed 16- and 32-bit wave files on
+ big-endian platforms.
-- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
- tstate is first removed from TLS and then deallocated.
+- Issue #18379: SSLSocket.getpeercert() returns CA issuer AIA fields, OCSP
+ and CRL distribution points.
-- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
- OverflowError when an argument of %c format is out of range.
+- 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 #18137: Detect integer overflow on precision in float.__format__()
- and complex.__format__().
+- 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 #18183: Fix various unicode operations on strings with large unicode
- codepoints.
+- Issue #17276: MD5 as default digestmod for HMAC is deprecated. The HMAC
+ module supports digestmod names, e.g. hmac.HMAC('sha1').
-- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
+- 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 #18038: SyntaxError raised during compilation sources with illegal
- encoding now always contains an encoding name.
+- Issue #13633: Added a new convert_charrefs keyword arg to HTMLParser that,
+ when True, automatically converts all character references.
-- Issue #17644: Fix a crash in str.format when curly braces are used in square
- brackets.
+- Issue #2927: Added the unescape() function to the html module.
-- Issue #17983: Raise a SyntaxError for a ``global __class__`` statement in a
- class body.
+- Issue #8402: Added the escape() function to the glob module.
-- Issue #17927: Frame objects kept arguments alive if they had been copied into
- a cell, even if the cell was cleared.
+- Issue #17618: Add Base85 and Ascii85 encoding/decoding to the base64 module.
-Library
--------
+- 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 #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 #19282: dbm.open now supports the context manager 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().
@@ -756,12 +1390,30 @@ Library
- 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.
@@ -770,812 +1422,938 @@ Library
- 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 #18235: Fix the sysconfig variables LDSHARED and BLDSHARED under AIX.
- Patch by David Edelsohn.
+- Issue #17087: Improved the repr for regular expression match objects.
-- Issue #19276: Fixed the wave module on 64-bit big-endian platforms.
+Tests
+-----
-- Issue #18776: atexit callbacks now display their full traceback when they
- raise an exception.
+- Issue #19664: test_userdict's repr test no longer depends on the order
+ of dict elements.
-- Issue #17827: Add the missing documentation for ``codecs.encode`` and
- ``codecs.decode``.
+- 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 #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 #19378: the main dis module tests are now run with both stdout
+ redirection *and* passing an explicit file parameter
-- 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 #19378: removed the not-actually-helpful assertInstructionMatches
+ and assertBytecodeExactlyMatches helpers from bytecode_helper
-- Issue #19131: The aifc module now correctly reads and writes sampwidth of
- compressed streams.
+- Issue #18702: All skipped tests now reported as skipped.
-- Issue #19158: a rare race in BoundedSemaphore could allow .release() too
- often.
+- Issue #19439: interpreter embedding tests are now executed on Windows
+ (Patch by Zachary Ware)
-- Issue #18037: 2to3 now escapes '\u' and '\U' in native strings.
+- Issue #19085: Added basic tests for all tkinter widget options.
-- Issue #19137: The pprint module now correctly formats instances of set and
- frozenset subclasses.
+- Issue #19384: Fix test_py_compile for root user, patch by Claudiu Popa.
-- Issue #19092: contextlib.ExitStack now correctly reraises exceptions
- from the __exit__ callbacks of inner context managers (Patch by Hrvoje
- Nikšić)
+Documentation
+-------------
-- Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
- when necessary. Patch by Oscar Benjamin.
+- 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.
-- 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.
+Build
+-----
-- Properly initialize all fields of a SSL object after allocation.
+- Issue #19358: "make clinic" now runs the Argument Clinic preprocessor
+ over all CPython source files.
-- Issue #4366: Fix building extensions on all platforms when --enable-shared
- is used.
+- Update SQLite to 3.8.1, xz to 5.0.5, and Tcl/Tk to 8.6.1 on Windows.
-- 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
- correctly updates current file position. Au_read.getnframes() now returns an
- 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 #16632: Enable DEP and ASLR on Windows.
-- Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
- bytes until end of data.
+- Issue #17791: Drop PREFIX and EXEC_PREFIX definitions from PC/pyconfig.h
-- Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
+- Add workaround for VS 2010 nmake clean issue. VS 2010 doesn't set up PATH
+ for nmake.exe correctly.
-- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call
- returned empty string.
+- Issue #19550: Implement Windows installer changes of PEP 453 (ensurepip).
-- Issue #18050: Fixed an incompatibility of the re module with Python 3.3.0
- binaries.
+- Issue #19520: Fix compiler warning in the _sha3 module on 32bit Windows.
-- 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.
+- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
+ word in some C compilers.
-- Issue #14984: On POSIX systems, when netrc is called without a filename
- argument (and therefore is reading the user's $HOME/.netrc file), it now
- enforces the same security rules as typical ftp clients: the .netrc file must
- be owned by the user that owns the process and must not be readable by any
- other user.
+- Issue #15792: Correct build options on Win64. Patch by Jeremy Kloth.
-- Issue #18873: The tokenize module now detects Python source code encoding
- only in comment lines.
+- Issue #19373: Apply upstream change to Tk 8.5.15 fixing OS X 10.9
+ screen refresh problem for OS X installer build.
-- Issue #17324: Fix http.server's request handling case on trailing '/'. Patch
- contributed by Vajrasky Kok.
+- 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 #19018: The heapq.merge() function no longer suppresses IndexError
- in the underlying iterables.
+- 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 #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 #19551: PEP 453 - the OS X installer now installs pip by default.
-- Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
- the _sre module.
+- Update third-party libraries for OS X installers: xz 5.0.3 -> 5.0.5,
+ SQLite 3.7.13 -> 3.8.1
-- Issue #18830: inspect.getclasstree() no more produces duplicated entries even
- when input list contains duplicates.
+- 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.
-- Issue #18909: Fix _tkinter.tkapp.interpaddr() on Windows 64-bit, don't cast
- 64-bit pointer to long (32 bits).
+Tools/Demos
+-----------
-- Issue #18876: The FileIO.mode attribute now better reflects the actual mode
- under which the file was opened. Patch by Erik Bray.
+- 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 #18418: After fork(), reinit all threads states, not only active ones.
- Patch by A. Jesse Jiryu Davis.
+- Issue #19552: pyvenv now bootstraps pip into virtual environments by
+ default (pass --without-pip to request the old behaviour)
-- Issue #16611: http.cookie now correctly parses the 'secure' and 'httponly'
- cookie flags.
+- Issue #19390: Argument Clinic no longer accepts malformed Python
+ and C ids.
-- Issue #11973: Fix a problem in kevent. The flags and fflags fields are now
- properly handled as unsigned.
+What's New in Python 3.4.0 Alpha 4?
+===================================
-- Issue #17702: On error, os.environb now removes suppress the except context
- when raising a new KeyError with the original key.
+Release date: 2013-10-20
-- Issue #18755: Fixed the loader used in imp to allow get_data() to be called
- multiple times.
+Core and Builtins
+-----------------
-- Issue #16809: Fixed some tkinter incompabilities with Tcl/Tk 8.6.
+- Issue #19301: Give classes and functions that are explicitly marked global a
+ global qualname.
-- Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj
- argument.
+- Issue #19279: UTF-7 decoder no longer produces illegal strings.
-- Issue #18324: set_payload now correctly handles binary input. This also
- supersedes the previous fixes for #14360, #1717, and #16564.
+- Issue #16612: Add "Argument Clinic", a compile-time preprocessor for
+ C files to generate argument parsing code. (See PEP 436.)
-- Issue #17119: Fixed integer overflows when processing large strings and tuples
- in the tkinter module.
+- 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 #18747: Re-seed OpenSSL's pseudo-random number generator after fork.
- A pthread_atfork() parent handler is used to seed the PRNG with pid, time
- and some stack data.
+- 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 #8865: Concurrent invocation of select.poll.poll() now raises a
- RuntimeError exception. Patch by Christian Schubert.
+- Issue #4555: All exported C symbols are now prefixed with either
+ "Py" or "_Py".
-- Issue #13461: Fix a crash in the TextIOWrapper.tell method on 64-bit
- platforms. Patch by Yogesh Chaudhari.
+- Issue #19219: Speed up marshal.loads(), and make pyc files slightly
+ (5% to 10%) smaller.
-- 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.
+- Issue #19221: Upgrade Unicode database to version 6.3.0.
-- Issue #18768: Correct doc string of RAND_edg(). Patch by Vajrasky Kok.
+- 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 #18178: Fix ctypes on BSD. dlmalloc.c was compiled twice which broke
- malloc weak symbols.
+- Issue #19199: Remove ``PyThreadState.tick_counter`` field
-- Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes
- inside subjectAltName correctly. Formerly the module has used OpenSSL's
- GENERAL_NAME_print() function to get the string represention of ASN.1
- strings for ``rfc822Name`` (email), ``dNSName`` (DNS) and
- ``uniformResourceIdentifier`` (URI).
+- Fix macro expansion of _PyErr_OCCURRED(), and make sure to use it in at
+ least one place so as to avoid regressions.
-- 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 #19087: Improve bytearray allocation in order to allow cheap popping
+ of data at the front (slice deletion).
-- Issue #18405: Improve the entropy of crypt.mksalt().
+- Issue #19014: memoryview.cast() is now allowed on zero-length views.
-- Issue #19151: Fix docstring and use of _get_supported_file_loaders() to
- reflect 2-tuples.
+- Issue #18690: memoryview is now automatically registered with
+ collections.abc.Sequence
-- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
- docstrings and ValueError messages. Patch by Zhongyue Luo
+- Issue #19078: memoryview now correctly supports the reversed builtin
+ (Patch by Claudiu Popa)
-- Issue #18681: Fix a NameError in imp.reload() (noticed by Weizhao Li).
+Library
+-------
-- Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error
- if methods have annotations; it now correctly displays the annotations.
+- Issue #17457: unittest test discovery now works with namespace packages.
+ Patch by Claudiu Popa.
-- Issue #17998: Fix an internal error in regular expression engine.
+- Issue #18235: Fix the sysconfig variables LDSHARED and BLDSHARED under AIX.
+ Patch by David Edelsohn.
-- 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 #18606: Add the new "statistics" module (PEP 450). Contributed
+ by Steven D'Aprano.
-- Issue #18599: Fix name attribute of _sha1.sha1() object. It now returns
- 'SHA1' instead of 'SHA'.
+- Issue #12866: The audioop module now supports 24-bit samples.
-- Issue #18561: Skip name in ctypes' _build_callargs() if name is NULL.
+- Issue #19254: Provide an optimized Python implementation of pbkdf2_hmac.
-- Issue #18559: Fix NULL pointer dereference error in _pickle module
+- 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.
-- Issue #18556: Check the return value of a PyUnicode_AsWideChar() call in
- ctypes' U_set().
+- Fix a reference count leak in _sre.
-- Issue #18549: Eliminate dead code in socket_ntohl()
+- 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 #18514: Fix unreachable Py_DECREF() call in PyCData_FromBaseObj()
+- Issue #19276: Fixed the wave module on 64-bit big-endian platforms.
-- Issue #18513: Fix behaviour of cmath.rect w.r.t. signed zeros on OS X 10.8 +
- gcc.
+- 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 #18480: Add missing call to PyType_Ready to the _elementtree extension.
+- Issue #18891: Completed the new email package (provisional) API additions
+ by adding new classes EmailMessage, MIMEPart, and ContentManager.
-- Issue #17778: Fix test discovery for test_multiprocessing. (Patch by
- Zachary Ware.)
+- Issue #18281: Unused stat constants removed from `tarfile`.
-- Issue #18431: The new email header parser now decodes RFC2047 encoded words
- in structured headers.
+- Issue #18999: Multiprocessing now supports 'contexts' with the same API
+ as the module, but bound to specified start methods.
-- Issue #18432: The sched module's queue method was incorrectly returning
- an iterator instead of a list.
+- 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 #18044: The new email header parser was mis-parsing encoded words where
- an encoded character immediately followed the '?' that follows the CTE
- character, resulting in a decoding failure. They are now decoded correctly.
+- Issue #18725: The textwrap module now supports truncating multiline text.
-- Issue #18101: Tcl.split() now process strings nested in a tuple as it
- do with byte strings.
+- Issue #18776: atexit callbacks now display their full traceback when they
+ raise an exception.
-- Issue #17198: Fix a NameError in the dbm module. Patch by Valentina
- Mukhamedzhanova.
+- Issue #17827: Add the missing documentation for ``codecs.encode`` and
+ ``codecs.decode``.
-- Issue #18013: Fix cgi.FieldStorage to parse the W3C sample form.
+- Issue #19218: Rename collections.abc to _collections_abc in order to
+ speed up interpreter start.
-- Issue #18347: ElementTree's html serializer now preserves the case of
- closing tags.
+- Issue #18582: Add 'pbkdf2_hmac' to the hashlib module. It implements PKCS#5
+ password-based key derivation functions with HMAC as pseudorandom function.
-- Issue #17261: Ensure multiprocessing's proxies use proper address.
+- Issue #19131: The aifc module now correctly reads and writes sampwidth of
+ compressed streams.
-- Issue #18343: faulthandler.register() now keeps the previous signal handler
- when the function is called twice, so faulthandler.unregister() restores
- correctly the original signal handler.
+- 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 #17097: Make multiprocessing ignore EINTR.
+- Issue #19205: Don't import the 're' module in site and sysconfig module to
+ to speed up interpreter start.
-- Issue #18339: Negative ints keys in unpickler.memo dict no longer cause a
- segfault inside the _pickle C extension.
+- Issue #9548: Add a minimal "_bootlocale" module that is imported by the
+ _io module instead of the full locale module.
-- Issue #18224: Removed pydoc script from created venv, as it causes problems
- on Windows and adds no value over and above python -m pydoc ...
+- Issue #18764: remove the 'print' alias for the PDB 'p' command so that it no
+ longer shadows the print function.
-- Issue #18155: The csv module now correctly handles csv files that use
- a delimter character that has a special meaning in regexes, instead of
- throwing an exception.
+- Issue #19158: a rare race in BoundedSemaphore could allow .release() too
+ often.
-- Issue #14360: encode_quopri can now be successfully used as an encoder
- when constructing a MIMEApplication object.
+- Issue #15805: Add contextlib.redirect_stdout().
-- 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 #18716: Deprecate the formatter module.
-- Issue #18248: Fix libffi build on AIX.
+- Issue #10712: 2to3 has a new "asserts" fixer that replaces deprecated names
+ of unittest methods (e.g. failUnlessEqual -> assertEqual).
-- Issue #18259: Declare sethostname in socketmodule.c for AIX
+- Issue #18037: 2to3 now escapes '\u' and '\U' in native strings.
-- 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 #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)
-- 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 #19132: The pprint module now supports compact mode.
-- Issue #16102: Make uuid._netbios_getnode() work again on Python 3.
+- Issue #19137: The pprint module now correctly formats instances of set and
+ frozenset subclasses.
-- 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 #10042: functools.total_ordering now correctly handles
+ NotImplemented being returned by the underlying comparison function (Patch
+ by Katie Miller)
-- Issue #17403: urllib.parse.robotparser normalizes the urls before adding to
- ruleline. This helps in handling certain types invalid urls in a conservative
- manner.
+- Issue #19092: contextlib.ExitStack now correctly reraises exceptions
+ from the __exit__ callbacks of inner context managers (Patch by Hrvoje
+ Nikšić)
-- Issue #18025: Fixed a segfault in io.BufferedIOBase.readinto() when raw
- stream's read() returns more bytes than requested.
+- Issue #12641: Avoid passing "-mno-cygwin" to the mingw32 compiler, except
+ when necessary. Patch by Oscar Benjamin.
-- Issue #18011: As was originally intended, base64.b32decode() now raises a
- binascii.Error if there are non-b32-alphabet characters present in the input
- string, instead of a TypeError.
+- 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.
-- 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.
+- Properly initialize all fields of a SSL object after allocation.
-- Issue #16986: ElementTree now correctly parses a string input not only when
- an internal XML encoding is UTF-8 or US-ASCII.
+- Issue #19095: SSLSocket.getpeercert() now raises ValueError when the
+ SSL handshake hasn't been done.
-- Issue #17812: Fixed quadratic complexity of base64.b32encode().
+- Issue #4366: Fix building extensions on all platforms when --enable-shared
+ is used.
-- Issue #17980: Fix possible abuse of ssl.match_hostname() for denial of
- service using certificates with many wildcards (CVE-2013-2099).
+- 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.
-- Issue #17981: Closed socket on error in SysLogHandler.
+C API
+-----
-- Fix typos in the multiprocessing module.
+- Issue #1772673: The type of `char*` arguments now changed to `const char*`.
-- Issue #17754: Make ctypes.util.find_library() independent of the locale.
+- 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)
-- Issue #17968: Fix memory leak in os.listxattr().
+Tests
+-----
-- Issue #17269: Workaround for socket.getaddrinfo crash on MacOS X
- with port None or "0" and flags AI_NUMERICSERV.
+- Issue #19275: Fix test_site on AMD64 Snow Leopard
-- Issue #18698: Ensure imp.reload() returns the module out of sys.modules.
+- Issue #14407: Fix unittest test discovery in test_concurrent_futures.
-- 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
- the default for linking if LDSHARED is not also overriden. This restores
- Distutils behavior introduced in 3.2.3 and inadvertently dropped in 3.3.0.
+- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
+ wave.
-- Issue #18113: Fixed a refcount leak in the curses.panel module's
- set_userptr() method. Reported by Atsuo Ishimoto.
+- Issue #18714: Added tests for ``pdb.find_function()``.
-- 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.
+Documentation
+-------------
-- 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.
+- Issue #18758: Fixed and improved cross-references.
-C API
+- Issue #18972: Modernize email examples and use the argparse module in them.
+
+Build
-----
-- 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 #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
-IDLE
-----
+- Issue #15663: Update OS X 10.6+ installer to use Tcl/Tk 8.5.15.
-- Issue #18873: IDLE now detects Python source code encoding only in comment
- lines.
+- 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 #18988: The "Tab" key now works when a word is already autocompleted.
+- 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.
-- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster.
+What's New in Python 3.4.0 Alpha 3?
+===================================
-- 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.
+Release date: 2013-09-29
-- Issue #18226: Add docstrings and unittests for FormatParagraph.py.
- Original patches by Todd Rovito and Phil Webster.
+Core and Builtins
+-----------------
-- 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 #18818: The "encodingname" part of PYTHONIOENCODING is now optional.
-- Issue #7136: In the Idle File menu, "New Window" is renamed "New File".
- Patch by Tal Einat, Roget Serwy, and Todd Rovito.
+- Issue #19098: Prevent overflow in the compiler when the recursion limit is set
+ absurdly high.
-- Remove dead imports of imp.
+Library
+-------
-- Issue #18196: Avoid displaying spurious SystemExit tracebacks.
+- Issue #18929: `inspect.classify_class_attrs()` now correctly finds class
+ attributes returned by `dir()` that are located in the metaclass.
-- Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
+- 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
+ correctly updates current file position. Au_read.getnframes() now returns an
+ 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 #17511: Keep IDLE find dialog open after clicking "Find Next".
- Original patch by Sarah K.
+- Issue #18594: The fast path for collections.Counter() was never taken
+ due to an over-restrictive type check.
-- Issue #18055: Move IDLE off of imp and on to importlib.
+- Issue #19053: ZipExtFile.read1() with non-zero argument no more returns empty
+ bytes until end of data.
-- 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.
+- logging: added support for Unix domain sockets to SocketHandler and
+ DatagramHandler.
-- Issue #14146: Highlight source line while debugging on Windows.
+- Issue #18996: TestCase.assertEqual() now more cleverly shorten differing
+ strings in error report.
-- Issue #17532: Always include Options menu for IDLE on OS X.
- Patch by Guilherme Simões.
+- Issue #19034: repr() for tkinter.Tcl_Obj now exposes string reperesentation.
-Tests
------
+- 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 #14407: Fix unittest test discovery in test_concurrent_futures.
+- Issue #18626: the inspect module now offers a basic command line
+ introspection interface (Initial patch by Claudiu Popa)
-- Issue #18919: Unified and extended tests for audio modules: aifc, sunau and
- wave.
+- Issue #3015: Fixed tkinter with wantobject=False. Any Tcl command call
+ returned empty string.
+
+- 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.
+
+- Issue #14984: On POSIX systems, when netrc is called without a filename
+ argument (and therefore is reading the user's $HOME/.netrc file), it now
+ enforces the same security rules as typical ftp clients: the .netrc file must
+ be owned by the user that owns the process and must not be readable by any
+ other user.
+
+- 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 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.
-- Issue #12037: Fix test_email for desktop Windows.
+IDLE
+----
-- 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 #18873: IDLE now detects Python source code encoding only in comment
+ lines.
-- 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 #18988: The "Tab" key now works when a word is already autocompleted.
-- Issue #1666318: Add a test that shutil.copytree() retains directory
- permissions. Patch by Catherine Devlin.
+Documentation
+-------------
-- Issue #18357: add tests for dictview set difference.
- Patch by Fraser Tweedale.
+- Issue #17003: Unified the size argument names in the io module with common
+ practice.
-- 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.
+Build
+-----
-- Fix a fcntl test case on KFreeBSD, Debian #708653 (Petr Salinger).
+- 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.
-- Issue #18396: Fix spurious test failure in test_signal on Windows when
- faulthandler is enabled (Patch by Jeremy Kloth)
+Tools/Demos
+-----------
-- Issue #17046: Fix broken test_executable_without_cwd in test_subprocess.
+- Issue #18873: 2to3 and the findnocoding.py script now detect Python source
+ code encoding only in comment lines.
-- Issue #15415: Add new temp_dir() and change_cwd() context managers to
- test.support, and refactor temp_cwd() to use them. Patch by Chris Jerdonek.
-- Issue #15494: test.support is now a package rather than a module (Initial
- patch by Indra Talip)
+What's New in Python 3.4.0 Alpha 2?
+===================================
-- Issue #17944: test_zipfile now discoverable and uses subclassing to
- generate tests for different compression types. Fixed a bug with skipping
- some tests due to use of exhausted iterators.
+Release date: 2013-09-09
-- Issue #18266: test_largefile now works with unittest test discovery and
- supports running only selected tests. Patch by Zachary Ware.
+Core and Builtins
+-----------------
-- Issue #17767: test_locale now works with unittest test discovery.
- Original patch by Zachary Ware.
+- Issue #18942: sys._debugmallocstats() output was damaged on Windows.
-- Issue #18375: Assume --randomize when --randseed is used for running the
- testsuite.
+- 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 #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé.
+- Issue #11619: The parser and the import machinery do not encode Unicode
+ filenames anymore on Windows.
-- Issue #17691: test_univnewlines now works with unittest test discovery.
- Patch by Zachary Ware.
+- Issue #18808: Non-daemon threads are now automatically joined when
+ a sub-interpreter is shutdown (it would previously dump a fatal error).
-- Issue #18094: test_uuid no more reports skipped tests as passed.
+- Remove support for compiling on systems without getcwd().
-- Issue #11995: test_pydoc doesn't import all sys.path modules anymore.
+- Issue #18774: Remove last bits of GNU PTH thread code and thread_pth.h.
-Documentation
--------------
+- 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 #19392: Document that `imp.reload()` now also requires `__loader__` to
- be set on the module being reloaded.
+- 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 #18758: Fixed and improved cross-references.
+- Issue #18722: Remove uses of the "register" keyword in C code.
-- Issue #18743: Fix references to non-existant "StringIO" module.
+- Issue #18667: Add missing "HAVE_FCHOWNAT" symbol to posix._have_functions.
-- Issue #18783: Removed existing mentions of Python long type in docstrings,
- error messages and comments.
+- Issue #16499: Add command line option for isolated mode.
-- Issue #17701: Improving strftime documentation.
+- Issue #15301: Parsing fd, uid, and gid parameters for builtins
+ in Modules/posixmodule.c is now far more robust.
-- Issue #18440: Clarify that `hash()` can truncate the value returned from an
- object's custom `__hash__()` method.
+- Issue #18368: PyOS_StdioReadline() no longer leaks memory when realloc()
+ fail.
-- Issue #17953: Mention that you shouldn't replace sys.modules and deleting key
- items will cause Python to not be happy.
+- Issue #17934: Add a clear() method to frame objects, to help clean up
+ expensive details (local variables) and break reference cycles.
-- Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
+- Issue #18780: %-formatting codes %d, %i, and %u now treat int-subclasses
+ as int (displays value of int-subclass instead of str(int-subclass) ).
-- Issue #14097: improve the "introduction" page of the tutorial.
+Library
+-------
-- Issue #17977: The documentation for the cadefault argument's default value
- in urllib.request.urlopen() is fixed to match the code.
+- 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.
-Tools/Demos
------------
+- 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 #18873: 2to3 and the findnocoding.py script now detect Python source
- code encoding only in comment lines.
+- Issue #18852: Handle case of ``readline.__doc__`` being ``None`` in the new
+ readline activation code in ``site.py``.
-- Issue #18817: Fix a resource warning in Lib/aifc.py demo.
+- Issue #18672: Fixed format specifiers for Py_ssize_t in debugging output in
+ the _sre module.
-- Issue #18439: Make patchcheck work on Windows for ACKS, NEWS.
+- Issue #18830: inspect.getclasstree() no longer produces duplicate entries even
+ when input list contains duplicates.
-- Issue #18448: Fix a typo in Tools/demo/eiffel.py.
+- Issue #18878: sunau.open now supports the context manager protocol. Based on
+ patches by Claudiu Popa and R. David Murray.
-- Issue #18457: Fixed saving of formulas and complex numbers in
- Tools/demo/ss1.py.
+- Issue #18909: Fix _tkinter.tkapp.interpaddr() on Windows 64-bit, don't cast
+ 64-bit pointer to long (32 bits).
-- Issue #18449: Make Tools/demo/ss1.py work again on Python 3. Patch by
- Févry Thibault.
+- Issue #18876: The FileIO.mode attribute now better reflects the actual mode
+ under which the file was opened. Patch by Erik Bray.
-- Issue #15239: Make mkstringprep.py work again on Python 3.
+- Issue #16853: Add new selectors module.
-- Issue #12990: The "Python Launcher" on OSX could not launch python scripts
- that have paths that include wide characters.
+- Issue #18882: Add threading.main_thread() function.
-Build
------
+- Issue #18901: The sunau getparams method now returns a namedtuple rather than
+ a plain tuple. Patch by Claudiu Popa.
-- Issue #19356: Avoid using a C variabled named "_self", it's a reserved
- word in some C compilers.
+- Issue #17487: The result of the wave getparams method now is pickleable again.
+ Patch by Claudiu Popa.
-- Issue #19130: Correct PCbuild/readme.txt, Python 3.3 and 3.4 require VS 2010.
+- 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 #16067: Add description into MSI file to replace installer's temporary name.
+- Issue #18418: After fork(), reinit all threads states, not only active ones.
+ Patch by A. Jesse Jiryu Davis.
-- Issue #18256: Compilation fix for recent AIX releases. Patch by
- David Edelsohn.
+- Issue #17974: Switch unittest from using getopt to using argparse.
-- Issue #15172: Document NASM 2.10+ as requirement for building OpenSSL 1.0.1
- on Windows.
+- Issue #11798: TestSuite now drops references to own tests after execution.
-- Issue #1584: Provide options to override default search paths for
- Tcl and Tk when building _tkinter.
+- Issue #16611: http.cookie now correctly parses the 'secure' and 'httponly'
+ cookie flags.
-- 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 #11973: Fix a problem in kevent. The flags and fflags fields are now
+ properly handled as unsigned.
-- 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.
+- Issue #18807: ``pyvenv`` now takes a --copies argument allowing copies
+ instead of symlinks even where symlinks are available and the default.
+- Issue #18538: ``python -m dis`` now uses argparse for argument processing.
+ Patch by Michele Orrù.
-What's New in Python 3.3.2?
-===========================
+- Issue #18394: Close cgi.FieldStorage's optional file.
-*Release date: 13-May-2013*
+- Issue #17702: On error, os.environb now suppresses the exception context
+ when raising a new KeyError with the original key.
-Core and Builtins
------------------
+- Issue #16809: Fixed some tkinter incompabilities with Tcl/Tk 8.6.
-- Issue #17237: Fix crash in the ASCII decoder on m68k.
+- Issue #16809: Tkinter's splitlist() and split() methods now accept Tcl_Obj
+ argument.
-- Issue #17408: Avoid using an obsolete instance of the copyreg module when
- the interpreter is shutdown and then started again.
+- Issue #18324: set_payload now correctly handles binary input. This also
+ supersedes the previous fixes for #14360, #1717, and #16564.
-- Issue #17863: In the interactive console, don't loop forever if the encoding
- can't be fetched from stdin.
+- Issue #18794: Add a fileno() method and a closed attribute to select.devpoll
+ objects.
-- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
+- Issue #17119: Fixed integer overflows when processing large strings and tuples
+ in the tkinter module.
-- 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 #18747: Re-seed OpenSSL's pseudo-random number generator after fork.
+ A pthread_atfork() parent handler is used to seed the PRNG with pid, time
+ and some stack data.
-- 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 #8865: Concurrent invocation of select.poll.poll() now raises a
+ RuntimeError exception. Patch by Christian Schubert.
-- Issue #17782: Fix undefined behaviour on platforms where
- ``struct timespec``'s "tv_nsec" member is not a C long.
+- 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.
-- Issue #17715: Fix segmentation fault from raising an exception in a __trunc__
- method.
+- Issue #18768: Correct doc string of RAND_edg(). Patch by Vajrasky Kok.
-- Issue #16447: Fixed potential segmentation fault when setting __name__ on a
- class.
+- Issue #18178: Fix ctypes on BSD. dlmalloc.c was compiled twice which broke
+ malloc weak symbols.
-- Issue #17669: Fix crash involving finalization of generators using yield from.
+- Issue #18709: Fix CVE-2013-4238. The SSL module now handles NULL bytes
+ inside subjectAltName correctly. Formerly the module has used OpenSSL's
+ GENERAL_NAME_print() function to get the string represention of ASN.1
+ strings for ``rfc822Name`` (email), ``dNSName`` (DNS) and
+ ``uniformResourceIdentifier`` (URI).
-- Issue #17619: Make input() check for Ctrl-C correctly on Windows.
+- Issue #18701: Remove support of old CPython versions (<3.0) from C code.
-- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
+- 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 #17357: Add missing verbosity output when using -v/-vv.
+- 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.
-Library
--------
+- Issue #18532: Change the builtin hash algorithms' names to lower case names
+ as promised by hashlib's documentation.
-- Issue #17606: Fixed support of encoded byte strings in the XMLGenerator
- characters() and ignorableWhitespace() methods. Original patch by Sebastian
- Ortiz Vasquez.
+- 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 #17732: Ignore distutils.cfg options pertaining to install paths if a
- virtual environment is active.
+- Issue #18405: Improve the entropy of crypt.mksalt().
-- Issue #1159051: Back out a fix for handling corrupted gzip files that
- broke backwards compatibility.
+- 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 #17915: Fix interoperability of xml.sax with file objects returned by
- codecs.open().
+- Issue #18585: Add :func:`textwrap.shorten` to collapse and truncate a
+ piece of text to a given length.
-- Issue #16601: Restarting iteration over tarfile no more continues from where
- it left off. Patch by Michael Birtwell.
+- Issue #18598: Tweak exception message for importlib.import_module() to
+ include the module name when a key argument is missing.
-- 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 #19151: Fix docstring and use of _get_supported_file_loaders() to
+ reflect 2-tuples.
-- Issue #12181: select module: Fix struct kevent definition on OpenBSD 64-bit
- platforms. Patch by Federico Schwindt.
+- Issue #19152: Add ExtensionFileLoader.get_filename().
-- Issue #14173: Avoid crashing when reading a signal handler during
- interpreter shutdown.
+- Issue #18676: Change 'positive' to 'non-negative' in queue.py put and get
+ docstrings and ValueError messages. Patch by Zhongyue Luo
-- Issue #16316: mimetypes now recognizes the .xz and .txz (.tar.xz) extensions.
+- Fix refcounting issue with extension types in tkinter.
-- Issue #15902: Fix imp.load_module() accepting None as a file when loading an
- extension module.
+- Issue #8112: xlmrpc.server's DocXMLRPCServer server no longer raises an error
+ if methods have annotations; it now correctly displays the annotations.
-- Issue #17802: Fix an UnboundLocalError in html.parser. Initial tests by
- Thomas Barlow.
+- Issue #18600: Added policy argument to email.message.Message.as_string,
+ and as_bytes and __bytes__ methods to Message.
-- Issue #15535: Fix namedtuple pickles which were picking up the OrderedDict
- instead of just the underlying tuple.
+- Issue #18671: Output more information when logging exceptions occur.
-- 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 #18621: Prevent the site module's patched builtins from keeping
+ too many references alive for too long.
-- 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 #4885: Add weakref support to mmap objects. Patch by Valerie Lambert.
-- Issue #17353: Plistlib emitted empty data tags with deeply nested datastructures
+- Issue #8860: Fixed rounding in timedelta constructor.
-- Issue #11714: Use 'with' statements to assure a Semaphore releases a
- condition variable. Original patch by Thomas Rachel.
+- 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 #17795: Reverted backwards-incompatible change in SysLogHandler with
- Unix domain sockets.
+- Issue #18920: argparse's default destination for the version action (-v,
+ --version) has also been changed to stdout, to match the Python executable.
-- Issue #17555: Fix ForkAwareThreadLock so that size of after fork
- registry does not grow exponentially with generation of process.
+Tests
+-----
-- Issue #17707: multiprocessing.Queue's get() method does not block for short
- timeouts.
+- Issue #18623: Factor out the _SuppressCoreFiles context manager into
+ test.support. Patch by Valerie Lambert.
-- Isuse #17720: Fix the Python implementation of pickle.Unpickler to correctly
- process the APPENDS opcode when it is used on non-list objects.
+- Issue #12037: Fix test_email for desktop Windows.
-- Issue #17012: shutil.which() no longer fallbacks to the PATH environment
- variable if empty path argument is specified. Patch by Serhiy Storchaka.
+- 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 #17710: Fix pickle raising a SystemError on bogus input.
+- Issue #16799: Switched from getopt to argparse style in regrtest's argument
+ parsing. Added more tests for regrtest's argument parsing.
-- Issue #17341: Include the invalid name in the error messages from re about
- invalid group names.
+- 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 #17702: os.environ now raises KeyError with the original environment
- variable name (str on UNIX), instead of using the encoded name (bytes on
- UNIX).
+IDLE
+----
-- Issue #16163: Make the importlib based version of pkgutil.iter_importers
- work for submodules. Initial patch by Berker Peksag.
+- Issue #18489: Add tests for SearchEngine. Original patch by Phil Webster.
-- Issue #16804: Fix a bug in the 'site' module that caused running
- 'python -S -m site' to incorrectly throw an exception.
+Documentation
+-------------
-- Issue #17016: Get rid of possible pointer wraparounds and integer overflows
- in the re module. Patch by Nickolai Zeldovich.
+- Issue #18743: Fix references to non-existant "StringIO" module.
-- Issue #16658: add missing return to HTTPConnection.send()
- Patch by Jeff Knupp.
+- Issue #18783: Removed existing mentions of Python long type in docstrings,
+ error messages and comments.
-- Issue #14971: unittest test discovery no longer gets confused when a function
- has a different __name__ than its name in the TestCase class dictionary.
+Build
+-----
-- Issue #17678: Fix DeprecationWarning in the http/cookiejar.py by changing the
- usage of get_origin_req_host() to origin_req_host.
+- Issue #1584: Provide configure options to override default search paths for
+ Tcl and Tk when building _tkinter.
-- Issue #17666: Fix reading gzip files with an extra field.
+- 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.
-- Issue #17502: Process DEFAULT values in mock side_effect that returns iterator.
- Patch by Michael Foord.
+Tools/Demos
+-----------
-- Issue #17572: Avoid chained exceptions while passing bad directives to
- time.strptime(). Initial patch by Claudiu Popa.
+- Issue #18922: Now The Lib/smtpd.py and Tools/i18n/msgfmt.py scripts write
+ their version strings to stdout, and not to sderr.
-- Issue #17435: threading.Timer's __init__ method no longer uses mutable
- default values for the args and kwargs parameters.
+What's New in Python 3.4.0 Alpha 1?
+===================================
-- Issue #17526: fix an IndexError raised while passing code without filename to
- inspect.findsource(). Initial patch by Tyler Doyle.
+Release date: 2013-08-03
-- Issue #16550: Update the opcode descriptions of pickletools to use unsigned
- integers where appropriate. Initial patch by Serhiy Storchaka.
+Core and Builtins
+-----------------
-IDLE
-----
+- Issue #16741: Fix an error reporting in int().
-- Issue #17838: Allow sys.stdin to be reassigned.
+- Issue #17899: Fix rare file descriptor leak in os.listdir().
-- Issue #13495: Avoid loading the color delegator twice in IDLE.
+- Issue #10241: Clear extension module dict copies at interpreter shutdown.
+ Patch by Neil Schemenauer, minimally modified.
-- Issue #17798: Allow IDLE to edit new files when specified on command line.
+- Issue #9035: ismount now recognises volumes mounted below a drive root
+ on Windows. Original patch by Atsuo Ishimoto.
-- Issue #14735: Update IDLE docs to omit "Control-z on Windows".
+- Issue #18214: Improve finalization of Python modules to avoid setting
+ their globals to None, in most cases.
-- Issue #17585: Fixed IDLE regression. Now closes when using exit() or quit().
+- Issue #18112: PEP 442 implementation (safe object finalization).
-- Issue #17657: Show full Tk version in IDLE's about dialog.
- Patch by Todd Rovito.
+- Issue #18552: Check return value of PyArena_AddPyObject() in
+ obj2ast_object().
-- Issue #17613: Prevent traceback when removing syntax colorizer in IDLE.
+- Issue #18560: Fix potential NULL pointer dereference in sum().
-- Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE.
+- 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 #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
+- 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 #17625: In IDLE, close the replace dialog after it is used.
+- Issue #18408: Fix many various bugs in code handling errors, especially
+ on memory allocation failure (MemoryError).
-- Issue #14254: IDLE now handles readline correctly across shell restarts.
+- Issue #18344: Fix potential ref-leaks in _bufferedreader_read_all().
-- Issue #17614: IDLE no longer raises exception when quickly closing a file.
+- Issue #18342: Use the repr of a module name when an import fails when using
+ ``from ... import ...``.
-- Issue #6698: IDLE now opens just an editor window when configured to do so.
+- Issue #17872: Fix a segfault in marshal.load() when input stream returns
+ more bytes than requested.
-- Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer
- raises an exception.
+- Issue #18338: `python --version` now prints version string to stdout, and
+ not to stderr. Patch by Berker Peksag and Michael Dickens.
-- Issue #6649: Fixed missing exit status in IDLE. Patch by Guilherme Polo.
+- Issue #18426: Fix NULL pointer dereference in C extension import when
+ PyModule_GetDef() returns an error.
-Tests
------
+- 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 #17833: Fix test_gdb failures seen on machines where debug symbols
- for glibc are available (seen on PPC64 Linux).
+- Issue #3329: Implement the PEP 445: Add new APIs to customize Python memory
+ allocators.
-- Issue #7855: Add tests for ctypes/winreg for issues found in IronPython.
- Initial patch by Dino Viehland.
+- Issue #18328: Reorder ops in PyThreadState_Delete*() functions. Now the
+ tstate is first removed from TLS and then deallocated.
-- Issue #17712: Fix test_gdb failures on Ubuntu 13.04.
+- Issue #13483: Use VirtualAlloc in obmalloc on Windows.
-- Issue #17835: Fix test_io when the default OS pipe buffer size is larger
- than one million bytes.
+- Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
+ OverflowError when an argument of %c format is out of range.
-- Issue #17065: Use process-unique key for winreg tests to avoid failures if
- test is run multiple times in parallel (eg: on a buildbot host).
+- 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 #12820: add tests for the xml.dom.minicompat module.
- Patch by John Chandler and Phil Connell.
+- Issue #18137: Detect integer overflow on precision in float.__format__()
+ and complex.__format__().
-- Issue #17790: test_set now works with unittest test discovery.
- Patch by Zachary Ware.
+- Issue #18183: Fix various unicode operations on strings with large unicode
+ codepoints.
-- Issue #17789: test_random now works with unittest test discovery.
- Patch by Zachary Ware.
+- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
-- Issue #17779: test_osx_env now works with unittest test discovery.
- Patch by Zachary Ware.
+- Issue #18038: SyntaxError raised during compilation sources with illegal
+ encoding now always contains an encoding name.
-- Issue #17766: test_iterlen now works with unittest test discovery.
- Patch by Zachary Ware.
+- Issue #17931: Resolve confusion on Windows between pids and process
+ handles.
-- Issue #17690: test_time now works with unittest test discovery.
- Patch by Zachary Ware.
+- Tweak the exception message when the magic number or size value in a bytecode
+ file is truncated.
-- Issue #17692: test_sqlite now works with unittest test discovery.
- Patch by Zachary Ware.
+- 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 #17843: Removed bz2 test data file that was triggering false-positive
- virus warnings with certain antivirus software.
+- Issue #18065: Don't set __path__ to the package name for frozen packages.
-Documentation
--------------
+- Issue #18088: When reloading a module, unconditionally reset all relevant
+ attributes on the module (e.g. __name__, __loader__, __package__, __file__,
+ __cached__).
-- Issue #15940: Specify effect of locale on time functions.
+- Issue #17937: Try harder to collect cyclic garbage at shutdown.
-- Issue #6696: add documentation for the Profile objects, and improve
- profile/cProfile docs. Patch by Tom Pinckney.
+- Issue #12370: Prevent class bodies from interfering with the __class__
+ closure.
-- Issue #17915: Fix interoperability of xml.sax with file objects returned by
- codecs.open().
+- Issue #17644: Fix a crash in str.format when curly braces are used in square
+ brackets.
-Build
------
+- Issue #17237: Fix crash in the ASCII decoder on m68k.
-- Issue #17547: In configure, explicitly pass -Wformat for the benefit for GCC
- 4.8.
+- Issue #17927: Frame objects kept arguments alive if they had been
+ copied into a cell, even if the cell was cleared.
-- Issue #17962: Build with OpenSSL 1.0.1e on Windows.
+- 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.
-What's New in Python 3.3.1?
-===========================
+- Issue #1545463: Global variables caught in reference cycles are now
+ garbage-collected at shutdown.
-*Release date: 07-Apr-2013*
+- 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).
-Build
------
+- Issue #17408: Avoid using an obsolete instance of the copyreg module when
+ the interpreter is shutdown and then started again.
-- Issue #17550: Fix the --enable-profiling configure switch.
+- Issue #5845: Enable tab-completion in the interactive interpreter by
+ default, thanks to a new sys.__interactivehook__.
-IDLE
--------
+- Issue #17115,17116: Module initialization now includes setting __package__ and
+ __loader__ attributes to None.
-- Issue #17625: In IDLE, close the replace dialog after it is used.
+- 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.
-What's New in Python 3.3.1 release candidate 1?
-===============================================
+- Issue #17867: Raise an ImportError if __import__ is not found in __builtins__.
-*Release date: 24-Mar-2013*
+- Issue #18698: Ensure importlib.reload() returns the module out of sys.modules.
-Core and 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 #17328: Fix possible refleak in dict.setdefault.
+- 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 #17223: Fix PyUnicode_FromUnicode() for string of 1 character outside
- the range U+0000-U+10ffff.
+- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
-- Issue #1692335: Move initial args assignment to
- BaseException.__new__ to help pickling of naive subclasses.
+- 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.
@@ -1583,12 +2361,17 @@ Core and Builtins
- 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.
@@ -1603,6 +2386,10 @@ Core and Builtins
- 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.
@@ -1614,6 +2401,9 @@ Core and Builtins
- 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
@@ -1630,12 +2420,6 @@ Core and Builtins
- 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
@@ -1645,24 +2429,51 @@ Core and Builtins
- 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 #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 #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
@@ -1674,11 +2485,23 @@ Core and Builtins
- 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.
@@ -1698,23 +2521,46 @@ Core and Builtins
- 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.
@@ -1727,24 +2573,482 @@ Core and Builtins
- 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 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.
+- 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 #17540: Added style to formatter configuration by dict.
+- 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 manager 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 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.
+
+- Issue #18432: The sched module's queue method was incorrectly returning
+ an iterator instead of a list.
+
+- Issue #18044: The new email header parser was mis-parsing encoded words where
+ an encoded character immediately followed the '?' that follows the CTE
+ character, resulting in a decoding failure. They are now decoded correctly.
+
+- 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.
+
+- Issue #17261: Ensure multiprocessing's proxies use proper address.
+
+- Issue #18343: faulthandler.register() now keeps the previous signal handler
+ when the function is called twice, so faulthandler.unregister() restores
+ correctly the original signal handler.
+
+- Issue #17097: Make multiprocessing ignore EINTR.
+
+- 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 ...
+
+- Issue #18155: The csv module now correctly handles csv files that use
+ a delimter character that has a special meaning in regexes, instead of
+ throwing an exception.
+
+- 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. 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.
+
+- Issue #18011: As was originally intended, base64.b32decode() now raises a
+ binascii.Error if there are non-b32-alphabet characters present in the input
+ string, instead of a TypeError.
+
+- Issue #18072: Implement importlib.abc.InspectLoader.get_code() and
+ importlib.abc.ExecutionLoader.get_code().
+
+- 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 #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.
+
+- Issue #17754: Make ctypes.util.find_library() independent of the locale.
+
+- Issue #17968: Fix memory leak in os.listxattr().
+
+- 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 #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
+ the default for linking if LDSHARED is not also overriden. This restores
+ Distutils behavior introduced in 3.2.3 and inadvertently dropped in 3.3.0.
+
+- Issue #18113: Fixed a refcount leak in the curses.panel module's
+ set_userptr() method. Reported by Atsuo Ishimoto.
+
+- Implement PEP 443 "Single-dispatch generic functions".
+
+- Implement PEP 435 "Adding an Enum type to the Python standard library".
+
+- Issue #15596: Faster pickling of unicode strings.
+
+- 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
@@ -1753,16 +3057,31 @@ Library
- 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 #17508: Corrected logging MemoryHandler configuration in dictConfig()
+ where the target handler wasn't configured first.
-- Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt
+- 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.
@@ -1776,20 +3095,51 @@ Library
- 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
@@ -1801,18 +3151,30 @@ Library
- 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.
@@ -1829,11 +3191,19 @@ Library
- 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.
@@ -1841,7 +3211,7 @@ Library
- Issue #4591: Uid and gid values larger than 2**31 are supported now.
-- Issue #17141: random.vonmisesvariate() no more hangs for large kappas.
+- Issue #17141: random.vonmisesvariate() no longer hangs for large kappas.
- Issue #17149: Fix random.vonmisesvariate to always return results in
[0, 2*math.pi].
@@ -1851,6 +3221,9 @@ Library
- 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.
@@ -1870,6 +3243,9 @@ Library
- 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.
@@ -1878,12 +3254,12 @@ Library
- Issue #17132: Update symbol for "yield from" grammar changes.
-- Issue #17076: Make copying of xattrs more permissive of missing FS support.
+- 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 not only when
- an internal XML encoding is UTF-8 or US-ASCII. It now accepts bytes and
- strings larger than 2 GiB.
+- 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.
@@ -1894,6 +3270,10 @@ Library
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.
@@ -1913,6 +3293,14 @@ Library
- 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.
@@ -1929,6 +3317,9 @@ Library
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.
@@ -1941,8 +3332,6 @@ Library
- 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.
@@ -1951,6 +3340,13 @@ Library
- 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
@@ -1960,12 +3356,29 @@ Library
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.
@@ -1981,14 +3394,21 @@ Library
- 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.
@@ -1998,6 +3418,8 @@ Library
- 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.
@@ -2019,10 +3441,26 @@ Library
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.
@@ -2030,6 +3468,9 @@ Library
- 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.
@@ -2050,25 +3491,60 @@ Library
- 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.
@@ -2089,6 +3565,9 @@ Library
- 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
@@ -2101,30 +3580,57 @@ Library
- 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 #16250: Fix URLError invocation with proper args.
+- 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.
@@ -2136,27 +3642,44 @@ Library
- 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 #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 #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 #16913: Fix Element.itertext()'s handling of text with XML entities.,
+- 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.
-- Issue #16112: platform.architecture does not correctly escape argument to
- /usr/bin/file. Patch by David Benjamin.
+- `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
@@ -2176,6 +3699,9 @@ Library
- 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'.
@@ -2198,22 +3724,103 @@ Library
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
+ 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,
+- 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 #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 #18226: Add docstrings and unittests for FormatParagraph.py.
+ Original patches by Todd Rovito and Phil Webster.
+
+- 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 #7136: In the Idle File menu, "New Window" is renamed "New File".
+ Patch by Tal Einat, Roget Serwy, and Todd Rovito.
+
+- Remove dead imports of imp.
+
+- Issue #18196: Avoid displaying spurious SystemExit tracebacks.
+
+- Issue #5492: Avoid traceback when exiting IDLE caused by a race condition.
+
+- Issue #17511: Keep IDLE find dialog open after clicking "Find Next".
+ Original patch by Sarah K.
+
+- Issue #18055: Move IDLE off of imp and on to importlib.
+
+- 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 #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.
@@ -2230,9 +3837,97 @@ IDLE
- 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 #1666318: Add a test that shutil.copytree() retains directory
+ permissions. Patch by Catherine Devlin.
+
+- 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.
+
+- Fix a fcntl test case on KFreeBSD, Debian #708653 (Petr Salinger).
+
+- Issue #18396: Fix spurious test failure in test_signal on Windows when
+ faulthandler is enabled (Patch by Jeremy Kloth)
+
+- Issue #17046: Fix broken test_executable_without_cwd in test_subprocess.
+
+- Issue #15415: Add new temp_dir() and change_cwd() context managers to
+ test.support, and refactor temp_cwd() to use them. Patch by Chris Jerdonek.
+
+- Issue #15494: test.support is now a package rather than a module (Initial
+ patch by Indra Talip)
+
+- Issue #17944: test_zipfile now discoverable and uses subclassing to
+ generate tests for different compression types. Fixed a bug with skipping
+ some tests due to use of exhausted iterators.
+
+- Issue #18266: test_largefile now works with unittest test discovery and
+ supports running only selected tests. Patch by Zachary Ware.
+
+- Issue #17767: test_locale now works with unittest test discovery.
+ Original patch by Zachary Ware.
+
+- Issue #18375: Assume --randomize when --randseed is used for running the
+ testsuite.
+
+- Issue #11185: Fix test_wait4 under AIX. Patch by Sébastien Sablé.
+
+- Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds
+ in ASN1_TIME fields.
+
+- Issue #18094: test_uuid no longer reports skipped tests as passed.
+
+- 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).
+
+- 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
+ than one million bytes.
+
+- Issue #17065: Use process-unique key for winreg tests to avoid failures if
+ test is run multiple times in parallel (eg: on a buildbot host).
+
+- 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.
+
+- Issue #17789: test_random now works with unittest test discovery.
+ Patch by Zachary Ware.
+
+- Issue #17779: test_osx_env now works with unittest test discovery.
+ Patch by Zachary Ware.
+
+- Issue #17766: test_iterlen now works with unittest test discovery.
+ Patch by Zachary Ware.
+
+- Issue #17690: test_time now works with unittest test discovery.
+ Patch by Zachary Ware.
+
+- Issue #17692: test_sqlite now works with unittest test discovery.
+ Patch by Zachary Ware.
+
+- 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.
@@ -2250,8 +3945,15 @@ Tests
- 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.
@@ -2318,6 +4020,11 @@ Tests
- 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.
@@ -2327,6 +4034,9 @@ Tests
- 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.
@@ -2345,7 +4055,7 @@ Tests
- 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
@@ -2354,6 +4064,30 @@ Tests
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.
@@ -2369,6 +4103,10 @@ Build
- 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.
@@ -2376,12 +4114,14 @@ Build
- 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.
@@ -2389,6 +4129,8 @@ Build
- 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.
@@ -2403,6 +4145,8 @@ Build
- 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.)
@@ -2415,11 +4159,54 @@ Build
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.
@@ -2464,8 +4251,8 @@ Documentation
- 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.
@@ -2488,6 +4275,9 @@ Documentation
- 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.
@@ -2508,17 +4298,47 @@ Documentation
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.
@@ -2526,6 +4346,12 @@ Tools/Demos
- 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?
===========================
@@ -2613,6 +4439,9 @@ Core and Builtins
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.
@@ -3103,6 +4932,10 @@ Documentation
- 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
-----
@@ -3215,9 +5048,6 @@ Core and Builtins
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.
@@ -4545,7 +6375,7 @@ Core and Builtins
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.
@@ -4912,7 +6742,7 @@ Library
- 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.
@@ -5013,7 +6843,7 @@ Library
'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
@@ -5371,8 +7201,8 @@ Library
- 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.
@@ -5930,6 +7760,9 @@ Library
- 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.
diff --git a/Misc/README b/Misc/README
index 118f6c7a80..e7780a2f31 100644
--- a/Misc/README
+++ b/Misc/README
@@ -22,9 +22,7 @@ README.AIX Information about using Python on AIX
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
index 94332faddf..a911a7e623 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.5
-%define libvers 3.3
+%define version 3.4.0rc1
+%define libvers 3.4
#--end constants--
%define release 1pydotorg
%define __prefix /usr
@@ -83,8 +83,7 @@ with very clear syntax. It has interfaces to many system calls and
libraries, as well as to various window systems, and is extensible in C or
C++. It is also usable as an extension language for applications that need
a programmable interface. Finally, Python is portable: it runs on many
-brands of UNIX, on 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 f869e7c05e..646ac2344c 100644
--- a/Misc/SpecialBuilds.txt
+++ b/Misc/SpecialBuilds.txt
@@ -105,7 +105,9 @@ negative indices differs from a Python slice):
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 3cfada8cd5..0000000000
--- 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 7e4d53b210..0000000000
--- 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 6ffda5cdd0..0000000000
--- 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 65d30bc728..0000000000
--- 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 501be43ab2..0000000000
--- 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 af5533a68e..0000000000
--- 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 (docs).tmSnippet b/Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion (docs).tmSnippet
deleted file mode 100644
index 5de8bae741..0000000000
--- a/Misc/TextMate/Python-Dev.tmbundle/Snippets/2 to 3 - Module Deletion (docs).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 0510d5d4ee..0000000000
--- 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 11ee7eb2eb..0000000000
--- 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 1d208668d0..0000000000
--- 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 172b350c39..0000000000
--- 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 c398cca696..0000000000
--- 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 0000000000..57f3aeb11a
--- /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 ac3a2c763b..0b9b5dc441 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
diff --git a/Misc/python-config.sh.in b/Misc/python-config.sh.in
new file mode 100644
index 0000000000..f5a3dbebea
--- /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="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"
+BASECFLAGS="@BASECFLAGS@"
+LDLIBRARY="@LDLIBRARY@"
+LINKFORSHARED="@LINKFORSHARED@"
+OPT="@OPT@"
+PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
+LDVERSION="@LDVERSION@"
+LIBDEST=${prefix}/lib/python${VERSION}
+LIBPL=$(echo "@LIBPL@" | sed "s#$prefix_build#$prefix_real#")
+SO="@SO@"
+PYTHONFRAMEWORK="@PYTHONFRAMEWORK@"
+INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
+PLATINCDIR="-I$includedir/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 0000000000..0e1ae63543
--- /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 bcb3ec8723..52aedee5bf 100644
--- a/Misc/python.man
+++ b/Misc/python.man
@@ -26,11 +26,14 @@ python \- an interpreted, interactive, object-oriented programming language
.B \-i
]
[
-.B \-m
-.I module-name
+.B \-I
]
.br
[
+.B \-m
+.I module-name
+]
+[
.B \-q
]
[
@@ -139,6 +142,13 @@ command. It does not read the $PYTHONSTARTUP file. This can be
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
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index f45de5caf4..01fb85ffc3 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -102,7 +102,7 @@ PYTHONPATH=$(COREPYTHONPATH)
# 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 @@ _sre _sre.c # Fredrik Lundh's new regular expressions
_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 @@ zipimport zipimport.c
# 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 @@ _symtable symtablemodule.c
#_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 @@ _symtable symtablemodule.c
# 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 @@ _symtable symtablemodule.c
#_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 faca8cfbca..02b55d1b41 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -6,6 +6,8 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
#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 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
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 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
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 3f7a6cf026..e652f4dfcd 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 @@ typedef struct {
#endif
} BZ2Decompressor;
+static PyTypeObject BZ2Compressor_Type;
+static PyTypeObject BZ2Decompressor_Type;
/* Helper functions. */
@@ -149,7 +149,7 @@ compress(BZ2Compressor *c, char *data, size_t len, int action)
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 @@ compress(BZ2Compressor *c, char *data, size_t len, int action)
/* 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 @@ compress(BZ2Compressor *c, char *data, size_t len, int action)
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 @@ error:
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 @@ BZ2Compressor_getstate(BZ2Compressor *self, PyObject *noargs)
return NULL;
}
+static void*
+BZ2_Malloc(void* ctx, int items, int size)
+{
+ 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
-BZ2Compressor_init(BZ2Compressor *self, PyObject *args, PyObject *kwargs)
+_bz2_BZ2Compressor___init___impl(BZ2Compressor *self, int compresslevel)
+/*[clinic end generated code: output=c4e6adfd02963827 input=4e1ff7b8394b6e9a]*/
{
- int compresslevel = 9;
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 @@ BZ2Compressor_init(BZ2Compressor *self, PyObject *args, PyObject *kwargs)
}
#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 @@ BZ2Compressor_dealloc(BZ2Compressor *self)
}
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 @@ static PyTypeObject BZ2Compressor_Type = {
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 @@ static PyTypeObject BZ2Compressor_Type = {
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 @@ decompress(BZ2Decompressor *d, char *data, size_t len)
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 @@ decompress(BZ2Decompressor *d, char *data, size_t len)
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 @@ decompress(BZ2Decompressor *d, char *data, size_t len)
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 @@ error:
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 @@ BZ2Decompressor_getstate(BZ2Decompressor *self, PyObject *noargs)
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 @@ BZ2Decompressor_dealloc(BZ2Decompressor *self)
}
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 @@ static PyMemberDef BZ2Decompressor_members[] = {
{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 @@ static PyTypeObject BZ2Decompressor_Type = {
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 @@ static PyTypeObject BZ2Decompressor_Type = {
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 40037b1dc6..0b093ab19f 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -189,9 +189,9 @@ escape_encode(PyObject *self,
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 */
diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c
index 3cf4764c4f..c1aa9a30bc 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 = PyMem_Malloc(sizeof(block));
+ if (b != NULL) {
+ return b;
}
- b->leftlink = leftlink;
- b->rightlink = rightlink;
- return b;
+ PyErr_NoMemory();
+ return NULL;
}
static void
@@ -97,14 +117,13 @@ freeblock(block *b)
}
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 @@ typedef struct {
*/
#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 @@ deque_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ deque_pop(dequeobject *deque, PyObject *unused)
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 @@ deque_pop(dequeobject *deque, PyObject *unused)
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 @@ deque_popleft(dequeobject *deque, PyObject *unused)
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 @@ deque_popleft(dequeobject *deque, PyObject *unused)
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_append(dequeobject *deque, PyObject *item)
{
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_appendleft(dequeobject *deque, PyObject *item)
{
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 @@ deque_extend(dequeobject *deque, PyObject *iterable)
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 @@ deque_extend(dequeobject *deque, PyObject *iterable)
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 @@ deque_extendleft(dequeobject *deque, PyObject *iterable)
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 @@ deque_extendleft(dequeobject *deque, PyObject *iterable)
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 @@ deque_inplace_concat(dequeobject *deque, PyObject *other)
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_rotate(dequeobject *deque, Py_ssize_t n)
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);
-
- 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;
+ assert(leftindex > 0);
+ {
+ PyObject **src, **dest;
+ Py_ssize_t m = n;
+
+ 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);
-
- 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;
+ assert (rightindex < BLOCKLEN - 1);
+ {
+ PyObject **src, **dest;
+ Py_ssize_t m = -n;
+
+ 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 @@ deque_reverse(dequeobject *deque, PyObject *unused)
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 @@ deque_reverse(dequeobject *deque, PyObject *unused)
/* Advance left block/index pair */
leftindex++;
if (leftindex == BLOCKLEN) {
- if (leftblock->rightlink == NULL)
- break;
leftblock = leftblock->rightlink;
leftindex = 0;
}
@@ -548,8 +625,6 @@ deque_reverse(dequeobject *deque, PyObject *unused)
/* 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 @@ PyDoc_STRVAR(reverse_doc,
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 @@ deque_count(dequeobject *deque, PyObject *v)
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 @@ deque_count(dequeobject *deque, PyObject *v)
}
/* 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 @@ PyDoc_STRVAR(count_doc,
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 @@ deque_clear(dequeobject *deque)
{
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 @@ deque_item(dequeobject *deque, Py_ssize_t i)
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 @@ deque_item(dequeobject *deque, Py_ssize_t i)
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 @@ deque_del_item(dequeobject *deque, Py_ssize_t i)
{
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 @@ deque_ass_item(dequeobject *deque, Py_ssize_t i, PyObject *v)
{
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 @@ deque_traverse(dequeobject *deque, visitproc visit, void *arg)
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 @@ deque_richcompare(PyObject *v, PyObject *w, int op)
}
/* 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 @@ deque_sizeof(dequeobject *deque, void *unused)
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 @@ deque_iter(dequeobject *deque)
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 @@ dequeiter_next(dequeiterobject *it)
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 @@ PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(
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 @@ deque_reviter(dequeobject *deque)
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 @@ dequereviter_next(dequeiterobject *it)
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 @@ _count_elements(PyObject *self, PyObject *args)
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 51007889bf..da44ef34ee 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]*/
+
+
+/*[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(PyObject *self, PyObject *args)
+static PyObject *
+crypt_crypt_impl(PyModuleDef *module, const char *word, const char *salt);
+
+static PyObject *
+crypt_crypt(PyModuleDef *module, PyObject *args)
+{
+ PyObject *return_value = NULL;
+ const char *word;
+ const char *salt;
+
+ 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]*/
{
- char *word, *salt;
-#ifndef __VMS
- extern char * crypt(const char *, const char *);
-#endif
-
- if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) {
- return NULL;
- }
/* 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 f5f6e71686..c8767d1ea5 100644
--- a/Modules/_csv.c
+++ b/Modules/_csv.c
@@ -51,7 +51,7 @@ static struct PyModuleDef _csvmodule;
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 @@ parse_save_field(ReaderObj *self)
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 @@ parse_process_char(ReaderObj *self, Py_UCS4 c)
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 @@ parse_process_char(ReaderObj *self, Py_UCS4 c)
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 48351bee03..97ae798a51 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -276,8 +276,10 @@ _ctypes_alloc_format_string(const char *prefix, const char *suffix)
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
@@ -426,13 +428,7 @@ CDataType_from_buffer(PyObject *type, PyObject *args)
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))
+ if (!PyArg_ParseTuple(args, "O|n:from_buffer", &obj, &offset))
return NULL;
if (-1 == PyObject_AsWriteBuffer(obj, &buffer, &buffer_len))
@@ -445,11 +441,7 @@ CDataType_from_buffer(PyObject *type, PyObject *args)
}
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);
return NULL;
}
@@ -460,7 +452,6 @@ CDataType_from_buffer(PyObject *type, PyObject *args)
Py_INCREF(obj);
if (-1 == KeepRef((CDataObject *)result, -1, obj)) {
- Py_DECREF(result);
return NULL;
}
return result;
@@ -482,13 +473,7 @@ CDataType_from_buffer_copy(PyObject *type, PyObject *args)
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))
+ if (!PyArg_ParseTuple(args, "O|n:from_buffer", &obj, &offset))
return NULL;
if (-1 == PyObject_AsReadBuffer(obj, (const void**)&buffer, &buffer_len))
@@ -502,11 +487,7 @@ CDataType_from_buffer_copy(PyObject *type, PyObject *args)
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);
return NULL;
}
@@ -1324,9 +1305,11 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 +1340,8 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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!
@@ -2259,6 +2243,10 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 +2329,8 @@ PyCData_GetContainer(CDataObject *self)
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 +2342,11 @@ PyCData_GetContainer(CDataObject *self)
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 +2403,10 @@ KeepRef(CDataObject *target, Py_ssize_t index, PyObject *keep)
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 +2793,9 @@ _PyCData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
/* XXX */;
value = GetKeepedObjects(src);
+ if (value == NULL)
+ return NULL;
+
Py_INCREF(value);
return value;
}
@@ -2818,6 +2819,9 @@ _PyCData_set(CDataObject *dst, PyObject *type, SETFUNC setfunc, PyObject *value,
*(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
@@ -4044,8 +4048,8 @@ Struct_init(PyObject *self, PyObject *args, PyObject *kwds)
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 +4220,7 @@ Array_subscript(PyObject *myself, PyObject *item)
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 +4296,10 @@ Array_subscript(PyObject *myself, PyObject *item)
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;
@@ -4806,6 +4814,9 @@ Pointer_set_contents(CDataObject *self, PyObject *value, void *closure)
return -1;
keep = GetKeepedObjects(dst);
+ if (keep == NULL)
+ return -1;
+
Py_INCREF(keep);
return KeepRef(self, 0, keep);
}
@@ -5212,9 +5223,14 @@ cast(void *ptr, PyObject *src, PyObject *ctype)
*/
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/callbacks.c b/Modules/_ctypes/callbacks.c
index a3d232118b..ec8fd12a89 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -98,20 +98,37 @@ void _ctypes_add_traceback(char *funcname, char *filename, int lineno)
PyObject *py_globals = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
+ 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);
py_globals = PyDict_New();
- if (!py_globals) goto bad;
+ if (!py_globals)
+ goto bad;
py_code = PyCode_NewEmpty(filename, funcname, lineno);
- if (!py_code) goto bad;
+ 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;
+ if (!py_frame)
+ goto bad;
py_frame->f_lineno = lineno;
+
+ PyErr_Restore(exception, value, tb);
PyTraceBack_Here(py_frame);
+
+ Py_DECREF(py_globals);
+ Py_DECREF(py_code);
+ Py_DECREF(py_frame);
+ return;
+
bad:
Py_XDECREF(py_globals);
Py_XDECREF(py_code);
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 09eb653b30..74119a3b4d 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -261,18 +261,18 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
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 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
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 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
/* 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 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
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 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
/* 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 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
/* 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 @@ static void SetException(DWORD code, EXCEPTION_RECORD *pr)
/* 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 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
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;
@@ -1105,9 +1107,7 @@ PyObject *_ctypes_callproc(PPROC pProc,
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;
@@ -1272,62 +1272,6 @@ static PyObject *free_library(PyObject *self, PyObject *args)
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 +1433,9 @@ call_cdeclfunction(PyObject *self, PyObject *args)
NULL,
#endif
FUNCFLAG_CDECL, /* flags */
- NULL, /* self->argtypes */
- NULL, /* self->restype */
- NULL); /* checker */
+ NULL, /* self->argtypes */
+ NULL, /* self->restype */
+ NULL); /* checker */
return result;
}
@@ -1822,7 +1766,6 @@ PyMethodDef _ctypes_module_methods[] = {
{"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/libffi.diff b/Modules/_ctypes/libffi.diff
index ade28e5f9e..1f931fb3b4 100644
--- a/Modules/_ctypes/libffi.diff
+++ b/Modules/_ctypes/libffi.diff
@@ -167,3 +167,39 @@ diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c
#endif /* WIN32 */
#ifdef __OS2__
+@@ -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;
diff --git a/Modules/_ctypes/libffi/src/dlmalloc.c b/Modules/_ctypes/libffi/src/dlmalloc.c
index 2773953590..fe1e40d651 100644
--- a/Modules/_ctypes/libffi/src/dlmalloc.c
+++ b/Modules/_ctypes/libffi/src/dlmalloc.c
@@ -3393,7 +3393,7 @@ static void add_segment(mstate m, char* tbase, size_t tsize, flag_t mmapped) {
*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 @@ static void* sys_alloc(mstate m, size_t nb) {
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 @@ mspace create_mspace(size_t capacity, int locked) {
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 @@ mspace create_mspace_with_base(void* base, size_t capacity, int locked) {
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 --git a/Modules/_ctypes/libffi/testsuite/libffi.call/a.out b/Modules/_ctypes/libffi/testsuite/libffi.call/a.out
deleted file mode 100644
index e69de29bb2..0000000000
--- a/Modules/_ctypes/libffi/testsuite/libffi.call/a.out
+++ /dev/null
diff --git a/Modules/_ctypes/libffi_osx/ffi.c b/Modules/_ctypes/libffi_osx/ffi.c
index bf420936db..96826b5c8e 100644
--- a/Modules/_ctypes/libffi_osx/ffi.c
+++ b/Modules/_ctypes/libffi_osx/ffi.c
@@ -38,12 +38,13 @@ initialize_aggregate(
/*@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 @@ ffi_prep_cif(
/*@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 2affb14c1a..f2610c16c7 100644
--- a/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
+++ b/Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
@@ -225,14 +225,16 @@ classify_argument(
/* 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 @@ ffi_prep_closure(
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 25d999626a..b95b0a4231 100644
--- a/Modules/_ctypes/stgdict.c
+++ b/Modules/_ctypes/stgdict.c
@@ -417,6 +417,8 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
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 @@ PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct
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)
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index f560702878..87b9c0516f 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -117,7 +117,7 @@ insert_lop(PyCursesPanelObject *po)
{
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 @@ remove_lop(PyCursesPanelObject *po)
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 @@ remove_lop(PyCursesPanelObject *po)
temp = temp->next;
}
n = temp->next->next;
- free(temp->next);
+ PyMem_Free(temp->next);
temp->next = n;
return;
}
@@ -513,6 +513,8 @@ PyInit__curses_panel(void)
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 13cfcf5307..494f02e194 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -134,6 +134,12 @@ typedef chtype attr_t; /* No attr_t type is available */
#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 @@ static char *screen_encoding = NULL;
"must call start_color() first"); \
return 0; }
-#ifndef MIN
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#endif
-
/* Utility Functions */
/*
@@ -533,7 +535,7 @@ PyCursesWindow_New(WINDOW *win, const char *encoding)
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 @@ PyCursesWindow_Dealloc(PyCursesWindowObject *wo)
{
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
+
+ [
+ x: int
+ X-coordinate.
+ y: int
+ Y-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([x, y,] ch, [attr])\n"
+"Paint character ch at (y, x) with attributes attr.\n"
+"\n"
+" x\n"
+" X-coordinate.\n"
+" y\n"
+" Y-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 *
+curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int x, int y, PyObject *ch, int group_right_1, long attr);
+
static PyObject *
-PyCursesWindow_AddCh(PyCursesWindowObject *self, PyObject *args)
+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 x = 0;
+ int y = 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", &x, &y, &ch))
+ goto exit;
+ group_left_1 = 1;
+ break;
+ case 4:
+ if (!PyArg_ParseTuple(args, "iiOl:addch", &x, &y, &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, x, y, ch, group_right_1, attr);
+
+exit:
+ return return_value;
+}
+
+static PyObject *
+curses_window_addch_impl(PyCursesWindowObject *self, int group_left_1, int x, int y, PyObject *ch, int group_right_1, long attr)
+/*[clinic end generated code: output=43acb91a5c98f615 input=fe7e3711d5bbf1f6]*/
+{
+ 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 @@ PyCursesWindow_GetStr(PyCursesWindowObject *self, PyObject *args)
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 @@ PyCursesWindow_GetStr(PyCursesWindowObject *self, PyObject *args)
#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 @@ PyCursesWindow_InStr(PyCursesWindowObject *self, PyObject *args)
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 @@ PyCursesWindow_InStr(PyCursesWindowObject *self, PyObject *args)
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 @@ PyCursesWindow_PutWin(PyCursesWindowObject *self, PyObject *stream)
/* 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 @@ PyCursesWindow_PutWin(PyCursesWindowObject *self, PyObject *stream)
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 @@ PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value)
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 @@ static PyMethodDef PyCursesWindow_Methods[] = {
{"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 @@ static PyObject *
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 @@ PyCurses_GetWin(PyCursesWindowObject *self, PyObject *stream)
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 @@ PyInit__curses(void)
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 @@ PyInit__curses(void)
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 fa231d9259..496ff348f1 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_TimeType;
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 @@ divmod(int x, int y, int *r)
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 @@ time_alloc(PyTypeObject *type, Py_ssize_t aware)
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 @@ datetime_alloc(PyTypeObject *type, Py_ssize_t aware)
sizeof(_PyDateTime_BaseDateTime));
if (self == NULL)
return (PyObject *)PyErr_NoMemory();
- PyObject_INIT(self, type);
+ (void)PyObject_INIT(self, type);
return self;
}
@@ -1290,8 +1288,6 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple,
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 @@ cmperror(PyObject *a, PyObject *b)
*/
/* 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 @@ multiply_float_timedelta(PyObject *floatobj, PyDateTime_Delta *delta)
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 @@ truedivide_timedelta_float(PyDateTime_Delta *delta, PyObject *f)
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 @@ delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
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 @@ delta_new(PyTypeObject *type, PyObject *args, PyObject *kw)
}
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 @@ delta_total_seconds(PyObject *self)
{
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 @@ date_local_from_object(PyObject *cls, PyObject *obj)
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 @@ date_isoformat(PyDateTime_Date *self)
static PyObject *
date_str(PyDateTime_Date *self)
{
- _Py_IDENTIFIER(isoformat);
-
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "()");
}
@@ -2671,7 +2681,6 @@ static PyObject *
date_format(PyDateTime_Date *self, PyObject *args)
{
PyObject *format;
- _Py_IDENTIFIER(strftime);
if (!PyArg_ParseTuple(args, "U:__format__", &format))
return NULL;
@@ -3588,8 +3597,6 @@ time_repr(PyDateTime_Time *self)
static PyObject *
time_str(PyDateTime_Time *self)
{
- _Py_IDENTIFIER(isoformat);
-
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "()");
}
@@ -4120,7 +4127,7 @@ datetime_from_timestamp(PyObject *cls, TM_FUNC f, PyObject *timestamp,
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 @@ datetime_best_possible(PyObject *cls, TM_FUNC f, PyObject *tzinfo)
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 @@ datetime_fromtimestamp(PyObject *cls, PyObject *args, PyObject *kw)
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 @@ datetime_subtract(PyObject *left, PyObject *right)
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 @@ datetime_repr(PyDateTime_DateTime *self)
static PyObject *
datetime_str(PyDateTime_DateTime *self)
{
- _Py_IDENTIFIER(isoformat);
-
return _PyObject_CallMethodId((PyObject *)self, &PyId_isoformat, "(s)", " ");
}
@@ -4749,7 +4798,7 @@ local_timezone(PyDateTime_DateTime *utc_time)
goto error;
}
result = new_timezone(delta, nameo);
- Py_DECREF(nameo);
+ Py_XDECREF(nameo);
error:
Py_DECREF(delta);
return result;
@@ -4762,7 +4811,6 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw)
PyObject *offset;
PyObject *temp;
PyObject *tzinfo = Py_None;
- _Py_IDENTIFIER(fromutc);
static char *keywords[] = {"tz", NULL};
if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:astimezone", keywords,
@@ -4873,9 +4921,16 @@ datetime_timestamp(PyDateTime_DateTime *self)
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 @@ static PyMethodDef datetime_methods[] = {
/* 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 @@ PyInit__datetime(void)
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 @@ PyInit__datetime(void)
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 83c051c505..93ea4161a7 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 @@ static char *which_dbm = "Berkeley DB";
#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 PyTypeObject Dbmtype;
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 @@ newdbmobject(char *file, int flags, int mode)
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 @@ newdbmobject(char *file, int flags, int mode)
/* 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 @@ dbm_length(dbmobject *dp)
}
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 PyMappingMethods dbm_as_mapping = {
};
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 @@ dbm__close(register dbmobject *dp, PyObject *unused)
}
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 @@ static PySequenceMethods dbm_as_sequence = {
0, /* sq_inplace_repeat */
};
+/*[clinic input]
+
+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_get(register dbmobject *dp, PyObject *args)
+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)
{
- datum key, val;
- PyObject *defvalue = Py_None;
- char *tmp_ptr;
- Py_ssize_t tmp_size;
+ 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;
+}
- if (!PyArg_ParseTuple(args, "s#|O:get",
- &tmp_ptr, &tmp_size, &defvalue))
- return NULL;
- key.dptr = tmp_ptr;
- key.dsize = tmp_size;
+static PyObject *
+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, key);
+ val = dbm_fetch(dp->di_dbm, dbm_key);
if (val.dptr != NULL)
return PyBytes_FromStringAndSize(val.dptr, val.dsize);
- else {
- Py_INCREF(defvalue);
- return defvalue;
- }
+
+ Py_INCREF(default_value);
+ return default_value;
}
static PyObject *
-dbm_setdefault(register dbmobject *dp, PyObject *args)
+dbm_setdefault(dbmobject *dp, PyObject *args)
{
datum key, val;
PyObject *defvalue = NULL;
@@ -317,18 +366,33 @@ dbm_setdefault(register dbmobject *dp, PyObject *args)
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 PyTypeObject Dbmtype = {
/* ----------------------------------------------------------------- */
+/*[clinic input]
+
+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(PyObject *self, PyObject *args)
+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]*/
{
- char *name;
- char *flags = "r";
int iflags;
- int mode = 0666;
- if ( !PyArg_ParseTuple(args, "s|si:open", &name, &flags, &mode) )
- return NULL;
if ( strcmp(flags, "r") == 0 )
iflags = O_RDONLY;
else if ( strcmp(flags, "w") == 0 )
@@ -390,13 +508,11 @@ dbmopen(PyObject *self, PyObject *args)
"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/_elementtree.c b/Modules/_elementtree.c
index f45893f15d..b3b6976708 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 $
- *
- * 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)
+/*--------------------------------------------------------------------
+ * Licensed to PSF under a Contributor Agreement.
+ * See http://www.python.org/psf/license for licensing details.
*
+ * _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 TreeBuilder_Type;
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 @@ LOCAL(PyObject*)
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 @@ deepcopy(PyObject* object, PyObject* memo)
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 @@ LOCAL(int)
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 @@ create_new_element(PyObject* tag, PyObject* attrib)
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 @@ create_new_element(PyObject* tag, PyObject* attrib)
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 @@ get_attrib_from_keywords(PyObject *kwds)
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 @@ element_resize(ElementObject* self, int extra)
/* 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 @@ subelement(PyObject *self, PyObject *args, PyObject *kwds)
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 @@ subelement(PyObject *self, PyObject *args, PyObject *kwds)
}
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 @@ element_dealloc(ElementObject* self)
}
/* -------------------------------------------------------------------- */
-/* methods (in alphabetical order) */
static PyObject*
element_append(ElementObject* self, PyObject* args)
@@ -689,8 +696,7 @@ element_copy(ElementObject* self, PyObject* args)
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 @@ element_copy(ElementObject* self, PyObject* args)
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_copy(ElementObject* self, PyObject* args)
}
element->extra->length = self->extra->length;
-
}
return (PyObject*) element;
@@ -772,7 +776,6 @@ element_deepcopy(ElementObject* self, PyObject* args)
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_deepcopy(ElementObject* self, PyObject* args)
}
element->extra->length = self->extra->length;
-
}
/* add object to memo dictionary (so deepcopy won't visit it again) */
@@ -1079,6 +1081,7 @@ element_find(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_find(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_findtext(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_findtext(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_findtext(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_findall(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_findall(ElementObject *self, PyObject *args, PyObject *kwds)
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 @@ element_iterfind(ElementObject *self, PyObject *args, PyObject *kwds)
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_insert(ElementObject* self, PyObject* args)
&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 @@ element_set(ElementObject* self, PyObject* args)
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 @@ element_ass_subscr(PyObject* self_, PyObject* item, PyObject* value)
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 @@ element_getattro(ElementObject* self, PyObject* nameobj)
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 @@ element_getattro(ElementObject* self, PyObject* nameobj)
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 @@ element_setattro(ElementObject* self, PyObject* nameobj, PyObject* value)
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 @@ element_setattro(ElementObject* self, PyObject* nameobj, PyObject* value)
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 @@ create_elementiter(ElementObject *self, PyObject *tag, int gettext)
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 @@ create_elementiter(ElementObject *self, PyObject *tag, int gettext)
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;
- it->root_element = self;
-
Py_INCREF(self);
- Py_INCREF(tag);
+ it->root_element = self;
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 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
{
PyObject* node;
PyObject* this;
+ elementtreestate *st = ET_STATE_GLOBAL;
if (self->data) {
if (self->this == self->last) {
@@ -2401,7 +2420,7 @@ treebuilder_handle_start(TreeBuilderObject* self, PyObject* tag,
} else {
if (self->root) {
PyErr_SetString(
- elementtree_parseerror_obj,
+ st->parseerror_obj,
"multiple elements on top level"
);
goto error;
@@ -2688,10 +2707,12 @@ static PyTypeObject TreeBuilder_Type = {
/* ==================================================================== */
/* 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 @@ makeuniversal(XMLParserObject* self, const char* string)
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 @@ static void
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 @@ expat_set_error(enum XML_Error error_code, int line, int column, char *message)
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 @@ expat_set_error(enum XML_Error error_code, int line, int column, char *message)
}
Py_DECREF(position);
- PyErr_SetObject(elementtree_parseerror_obj, error);
+ PyErr_SetObject(st->parseerror_obj, error);
Py_DECREF(error);
}
@@ -2852,6 +2878,9 @@ expat_default_handler(XMLParserObject* self, const XML_Char* data_in,
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 @@ expat_start_handler(XMLParserObject* self, const XML_Char* tag_in,
PyObject* attrib;
int ok;
+ if (PyErr_Occurred())
+ return;
+
/* tag name */
tag = makeuniversal(self, tag_in);
if (!tag)
@@ -2950,6 +2982,9 @@ expat_data_handler(XMLParserObject* self, const XML_Char* data_in,
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 @@ expat_end_handler(XMLParserObject* self, const XML_Char* tag_in)
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 @@ expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix,
PyObject* sprefix = NULL;
PyObject* suri = NULL;
+ if (PyErr_Occurred())
+ return;
+
if (uri)
suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict");
else
@@ -3024,6 +3065,9 @@ expat_start_ns_handler(XMLParserObject* self, const XML_Char* prefix,
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 @@ expat_comment_handler(XMLParserObject* self, const XML_Char* comment_in)
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 @@ expat_start_doctype_handler(XMLParserObject *self,
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 @@ expat_pi_handler(XMLParserObject* self, const XML_Char* target_in,
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 @@ expat_parse(XMLParserObject* self, const char* data, int data_len, int final)
{
int ok;
+ assert(!PyErr_Occurred());
ok = EXPAT(Parse)(self->parser, data, data_len, final);
if (PyErr_Occurred())
@@ -3331,11 +3385,14 @@ xmlparser_close(XMLParserObject* self, PyObject* args)
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 @@ xmlparser_feed(XMLParserObject* self, PyObject* arg)
}
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 @@ xmlparser_parse(XMLParserObject* self, PyObject* args)
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 @@ static PyObject*
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 @@ xmlparser_setevents(XMLParserObject *self, PyObject* args)
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 @@ xmlparser_setevents(XMLParserObject *self, PyObject* args)
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 @@ static PyTypeObject XMLParser_Type = {
0, /* tp_free */
};
-#endif
-
/* ==================================================================== */
/* python module interface */
@@ -3639,22 +3689,29 @@ static PyMethodDef _functions[] = {
};
-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 @@ PyInit__elementtree(void)
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 @@ PyInit__elementtree(void)
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 @@ PyInit__elementtree(void)
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 8f07a89a8a..57b1ac0662 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 @@ static struct _frozen _PyImport_FrozenModules[] = {
/* 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 @@ main(int argc, char *argv[])
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 0bd59c8aa2..229e16e627 100644
--- a/Modules/_gdbmmodule.c
+++ b/Modules/_gdbmmodule.c
@@ -79,7 +79,7 @@ newdbmobject(char *file, int flags, int mode)
/* 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 @@ dbm_length(dbmobject *dp)
}
static PyObject *
-dbm_subscript(dbmobject *dp, register PyObject *key)
+dbm_subscript(dbmobject *dp, PyObject *key)
{
PyObject *v;
datum drec, krec;
@@ -232,7 +232,7 @@ PyDoc_STRVAR(dbm_close__doc__,
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 @@ PyDoc_STRVAR(dbm_keys__doc__,
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 @@ hash values, and won't be sorted by the key values. This method\n\
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 @@ to create a list in memory that contains them all:\n\
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 @@ by using this reorganization; otherwise, deleted file space will be\n\
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 @@ When the database has been opened in fast mode, this method forces\n\
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 @@ dbm_sync(register dbmobject *dp, PyObject *unused)
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 @@ static PyMethodDef dbm_methods[] = {
{"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 cd3068334a..0000000000
--- 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 3ab1c0c99b..6a2a9afd22 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 @@ EVP_new(PyObject *self, PyObject *args, PyObject *kwdict)
}
+
+#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 @@ _openssl_hash_name_mapper(const OBJ_NAME *openssl_obj_name, void *arg)
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 @@ GEN_CONSTRUCTOR(sha512)
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 @@ PyInit__hashlib(void)
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 @@ PyInit__hashlib(void)
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 f377e9cf6c..96afcdc1b3 100644
--- a/Modules/_heapqmodule.c
+++ b/Modules/_heapqmodule.c
@@ -168,7 +168,10 @@ heappop(PyObject *self, PyObject *heap)
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)
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c
index 4a7e758cda..be0464c4fa 100644
--- a/Modules/_io/_iomodule.c
+++ b/Modules/_io/_iomodule.c
@@ -126,8 +126,7 @@ PyDoc_STRVAR(open_doc,
"'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 @@ PyDoc_STRVAR(open_doc,
"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"
@@ -310,6 +313,9 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds)
"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;
}
@@ -533,6 +539,45 @@ _PyIO_ConvertSsize_t(PyObject *obj, void *result) {
}
+_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 0fe90a3b3b..8927864e8c 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -77,7 +77,7 @@ extern int _PyIO_trap_eintr(void);
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 @@ typedef struct {
} _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 c28e289277..7494646342 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -52,7 +52,6 @@ bufferediobase_readinto(PyObject *self, PyObject *args)
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 @@ bufferediobase_readinto(PyObject *self, PyObject *args)
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 @@ PyTypeObject PyBufferedIOBase_Type = {
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 @@ PyTypeObject PyBufferedIOBase_Type = {
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 @@ typedef struct {
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 @@ _enter_buffered_busy(buffered *self)
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 @@ buffered_traverse(buffered *self, visitproc visit, void *arg)
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 @@ buffered_close(buffered *self, PyObject *args)
goto end;
}
- if (self->deallocating) {
+ if (self->finalizing) {
PyObject *r = buffered_dealloc_warn(self, (PyObject *) self);
if (r)
Py_DECREF(r);
@@ -527,6 +537,11 @@ buffered_close(buffered *self, PyObject *args)
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);
@@ -658,6 +673,11 @@ static void
_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)
@@ -1739,6 +1759,7 @@ static PyMethodDef bufferedreader_methods[] = {
static PyMemberDef bufferedreader_members[] = {
{"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+ {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
{NULL}
};
@@ -1771,7 +1792,7 @@ PyTypeObject PyBufferedReader_Type = {
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 +1811,16 @@ PyTypeObject PyBufferedReader_Type = {
(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 +2151,7 @@ static PyMethodDef bufferedwriter_methods[] = {
static PyMemberDef bufferedwriter_members[] = {
{"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+ {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
{NULL}
};
@@ -2152,7 +2184,7 @@ PyTypeObject PyBufferedWriter_Type = {
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 +2203,16 @@ PyTypeObject PyBufferedWriter_Type = {
(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 */
};
@@ -2411,7 +2453,7 @@ PyTypeObject PyBufferedRWPair_Type = {
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 */
@@ -2430,6 +2472,16 @@ PyTypeObject PyBufferedRWPair_Type = {
(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 */
};
@@ -2517,6 +2569,7 @@ static PyMethodDef bufferedrandom_methods[] = {
static PyMemberDef bufferedrandom_members[] = {
{"raw", T_OBJECT, offsetof(buffered, raw), READONLY},
+ {"_finalizing", T_BOOL, offsetof(buffered, finalizing), 0},
{NULL}
};
@@ -2549,7 +2602,7 @@ PyTypeObject PyBufferedRandom_Type = {
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 */
@@ -2568,4 +2621,14 @@ PyTypeObject PyBufferedRandom_Type = {
(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/fileio.c b/Modules/_io/fileio.c
index f3ce776993..cbb2daf5c2 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -52,13 +52,15 @@ typedef struct {
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 @@ fileio_close(fileio *self)
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 @@ check_fd(int fd)
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 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
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 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
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 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
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 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
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 @@ fileio_init(PyObject *oself, PyObject *args, PyObject *kwds)
_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 @@ fileio_clear(fileio *self)
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 @@ err_closed(void)
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 @@ fileio_readinto(fileio *self, PyObject *args)
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 @@ fileio_readinto(fileio *self, PyObject *args)
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 @@ new_buffersize(fileio *self, size_t currentsize
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 @@ fileio_readall(fileio *self)
end = st.st_size;
else
end = (Py_off_t)-1;
-#endif
+
+ 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) {
-#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 (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)newsize) {
- if (_PyBytes_Resize(&result, newsize) < 0) {
- if (total == 0) {
- Py_DECREF(result);
+ 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,7 +691,7 @@ fileio_readall(fileio *self)
}
continue;
}
- if (total > 0)
+ if (bytes_read > 0)
break;
if (errno == EAGAIN) {
Py_DECREF(result);
@@ -686,22 +701,19 @@ fileio_readall(fileio *self)
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 @@ fileio_read(fileio *self, PyObject *args)
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 @@ fileio_read(fileio *self, PyObject *args)
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 @@ fileio_read(fileio *self, PyObject *args)
if (n != size) {
if (_PyBytes_Resize(&bytes, n) < 0) {
- Py_DECREF(bytes);
+ Py_CLEAR(bytes);
return NULL;
}
}
@@ -782,7 +794,7 @@ fileio_write(fileio *self, PyObject *args)
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 @@ portable_lseek(int fd, PyObject *posobj, int whence)
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 @@ mode_string(fileio *self)
static PyObject *
fileio_repr(fileio *self)
{
- _Py_IDENTIFIER(name);
PyObject *nameobj, *res;
if (self->fd < 0)
@@ -1204,6 +1215,11 @@ static PyGetSetDef fileio_getsetlist[] = {
{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 +1241,7 @@ PyTypeObject PyFileIO_Type = {
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 +1250,7 @@ PyTypeObject PyFileIO_Type = {
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 +1261,13 @@ PyTypeObject PyFileIO_Type = {
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 e38473a745..e3729902d8 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;
@@ -63,11 +63,15 @@ _Py_IDENTIFIER(__IOBase_closed);
#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 @@ static PyObject *
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);
+
+ /* Save the current exception, if any. */
+ PyErr_Fetch(&error_type, &error_value, &error_traceback);
- /* 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);
/* 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 @@ _PyIOBase_finalize(PyObject *self)
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 @@ _PyIOBase_finalize(PyObject *self)
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 @@ iobase_traverse(iobase *self, visitproc visit, void *arg)
static int
iobase_clear(iobase *self)
{
- if (_PyIOBase_finalize((PyObject *) self) < 0)
- return -1;
Py_CLEAR(self->dict);
return 0;
}
@@ -455,7 +457,6 @@ iobase_readline(PyObject *self, PyObject *args)
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 @@ iobase_readline(PyObject *self, PyObject *args)
}
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 @@ PyTypeObject PyIOBase_Type = {
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 @@ PyTypeObject PyIOBase_Type = {
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 @@ rawiobase_readall(PyObject *self, PyObject *args)
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 @@ PyTypeObject PyRawIOBase_Type = {
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 @@ PyTypeObject PyRawIOBase_Type = {
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 e8f9984c90..5739bc4d01 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -45,7 +45,9 @@ PyDoc_STRVAR(textiobase_doc,
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 @@ PyTypeObject PyTextIOBase_Type = {
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 @@ PyTypeObject PyTextIOBase_Type = {
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 @@ typedef struct
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 @@ utf16_encode(textio *self, PyObject *text)
{
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 @@ utf32_encode(textio *self, PyObject *text)
{
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 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
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 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
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 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
}
}
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);
@@ -1122,8 +1132,6 @@ textiowrapper_init(textio *self, PyObject *args, PyObject *kwds)
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 @@ _textiowrapper_clear(textio *self)
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);
@@ -1947,10 +1956,7 @@ typedef struct {
#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 +1968,6 @@ typedef struct {
# 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 +1988,7 @@ textiowrapper_parse_cookie(cookie_type *cookie, PyObject *cookieObj)
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 +2014,9 @@ textiowrapper_build_cookie(cookie_type *cookie)
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)
@@ -2363,7 +2366,7 @@ textiowrapper_tell(textio *self, PyObject *args)
/* 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;
@@ -2589,7 +2592,7 @@ textiowrapper_close(textio *self, PyObject *args)
}
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);
@@ -2750,6 +2753,7 @@ static PyMemberDef textiowrapper_members[] = {
{"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 +2790,7 @@ PyTypeObject PyTextIOWrapper_Type = {
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 +2809,14 @@ PyTypeObject PyTextIOWrapper_Type = {
(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 9166680289..125101fa7c 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 @@ static void
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 @@ ascii_escape_unichar(Py_UCS4 c, unsigned char *output, Py_ssize_t chars)
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';
@@ -268,13 +234,23 @@ raise_errmsg(char *msg, PyObject *s, Py_ssize_t end)
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 */
@@ -344,7 +320,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next
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;
}
@@ -515,7 +491,7 @@ py_scanstring(PyObject* self UNUSED, PyObject *args)
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)) {
@@ -630,12 +606,12 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
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;
}
@@ -692,11 +668,9 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
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;
}
@@ -707,12 +681,6 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss
}
}
- /* 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) {
@@ -764,8 +732,8 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
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);
@@ -782,11 +750,9 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
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;
}
@@ -799,7 +765,7 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi
/* 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;
@@ -867,7 +833,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
if (PyUnicode_READ(kind, str, idx) == '-') {
idx++;
if (idx > end_idx) {
- PyErr_SetNone(PyExc_StopIteration);
+ raise_stop_iteration(start);
return NULL;
}
}
@@ -883,7 +849,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
}
/* no integer digits, error */
else {
- PyErr_SetNone(PyExc_StopIteration);
+ raise_stop_iteration(start);
return NULL;
}
@@ -976,7 +942,7 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
length = PyUnicode_GET_LENGTH(pystr);
if (idx >= length) {
- PyErr_SetNone(PyExc_StopIteration);
+ raise_stop_iteration(idx);
return NULL;
}
@@ -1078,7 +1044,7 @@ scanner_call(PyObject *self, PyObject *args, PyObject *kwds)
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)) {
@@ -1279,8 +1245,8 @@ encoder_call(PyObject *self, PyObject *args, PyObject *kwds)
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;
@@ -1326,13 +1292,45 @@ _encoded_const(PyObject *obj)
}
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) {
@@ -1345,8 +1343,24 @@ encoder_encode_float(PyEncoderObject *s, PyObject *obj)
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 *
@@ -1390,7 +1404,7 @@ encoder_listencode_obj(PyEncoderObject *s, _PyAccu *acc,
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);
@@ -1575,9 +1589,10 @@ encoder_listencode_dict(PyEncoderObject *s, _PyAccu *acc,
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 cc688ba140..400c3448ba 100644
--- a/Modules/_localemodule.c
+++ b/Modules/_localemodule.c
@@ -147,26 +147,34 @@ PyLocale_localeconv(PyObject* self)
/* 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 @@ PyLocale_localeconv(PyObject* self)
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 @@ PyLocale_localeconv(PyObject* self)
failed:
Py_XDECREF(result);
- Py_XDECREF(x);
return NULL;
}
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 4162be8340..0137d95443 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -36,12 +36,8 @@ hpTimerUnit(void)
#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 @@ static ProfilerEntry*
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 @@ newProfilerEntry(ProfilerObject *pObj, void *key, PyObject *userObj)
userObj = normalizeUserObj(userObj);
if (userObj == NULL) {
PyErr_Clear();
- free(self);
+ PyMem_Free(self);
pObj->flags |= POF_NOMEMORY;
return NULL;
}
@@ -268,7 +264,7 @@ static ProfilerSubEntry *
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 @@ newSubEntry(ProfilerObject *pObj, ProfilerEntry *caller, ProfilerEntry* entry)
static int freeSubEntry(rotating_node_t *header, void *arg)
{
ProfilerSubEntry *subentry = (ProfilerSubEntry*) header;
- free(subentry);
+ PyMem_Free(subentry);
return 0;
}
@@ -295,7 +291,7 @@ static int freeEntry(rotating_node_t *header, void *arg)
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 @@ static void clearEntries(ProfilerObject *pObj)
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 @@ ptrace_enter_call(PyObject *self, void *key, PyObject *userObj)
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 @@ flush_unmatched(ProfilerObject *pObj)
else
pObj->currentProfilerContext = pContext->previous;
if (pContext)
- free(pContext);
+ PyMem_Free(pContext);
}
}
@@ -876,10 +872,12 @@ PyInit__lsprof(void)
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 643616052c..c43676ab75 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -51,6 +51,7 @@ enum {
typedef struct {
PyObject_HEAD
+ lzma_allocator alloc;
lzma_stream lzs;
int flushed;
#ifdef WITH_THREAD
@@ -60,6 +61,7 @@ typedef struct {
typedef struct {
PyObject_HEAD
+ lzma_allocator alloc;
lzma_stream lzs;
int check;
char eof;
@@ -117,6 +119,22 @@ catch_lzma_error(lzma_ret lzret)
}
}
+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 @@ parse_filter_spec_bcj(PyObject *spec)
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 @@ parse_filter_spec(lzma_filter *f, PyObject *spec)
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 @@ parse_filter_chain_spec(lzma_filter filters[], PyObject *filterspecs)
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 @@ error:
}
+/*[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 @@ error:
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 @@ Compressor_init_raw(lzma_stream *lzs, PyObject *filterspecs)
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 @@ Compressor_init(Compressor *self, PyObject *args, PyObject *kwargs)
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 @@ Compressor_dealloc(Compressor *self)
}
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 @@ error:
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 @@ Decompressor_init_raw(lzma_stream *lzs, PyObject *filterspecs)
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 @@ Decompressor_init(Decompressor *self, PyObject *args, PyObject *kwargs)
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 @@ Decompressor_dealloc(Decompressor *self)
}
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 @@ static PyMemberDef Decompressor_members[] = {
{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 @@ static PyTypeObject Decompressor_type = {
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 @@ static PyTypeObject Decompressor_type = {
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 @@ static PyTypeObject Decompressor_type = {
/* 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
+ /
-static PyObject *
-is_check_supported(PyObject *self, PyObject *args)
-{
- int check_id;
+Test whether the given integrity check is supported.
- if (!PyArg_ParseTuple(args, "i:is_check_supported", &check_id))
- return NULL;
+Always returns True for CHECK_NONE and CHECK_CRC32.
+[clinic start generated code]*/
+static PyObject *
+_lzma_is_check_supported_impl(PyModuleDef *module, int check_id)
+/*[clinic end generated code: output=bb828e90e00ad96e input=5518297b97b2318f]*/
+{
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 @@ _encode_filter_properties(PyObject *self, PyObject *args)
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 @@ _decode_filter_properties(PyObject *self, PyObject *args)
/* 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/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index 9460c896ca..1aaf360571 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 @@ multiprocessing_send(PyObject *self, PyObject *args)
{
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,7 @@ static PyMethodDef module_methods[] = {
{"recv", multiprocessing_recv, METH_VARARGS, ""},
{"send", multiprocessing_send, METH_VARARGS, ""},
#endif
+ {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""},
{NULL}
};
@@ -159,19 +160,12 @@ PyInit__multiprocessing(void)
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 +176,10 @@ PyInit__multiprocessing(void)
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 e3de9baf1b..9aeea8d618 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 2c2b020e3b..de85a90d47 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -18,6 +18,7 @@ typedef struct {
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 @@ _GetSemaphoreValue(HANDLE handle, long *value)
{
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 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
}
/* 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 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds)
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 @@ semlock_release(SemLockObject *self, PyObject *args)
#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 @@ semlock_release(SemLockObject *self, PyObject *args)
*/
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 @@ newsemlockobject(PyTypeObject *type, SEM_HANDLE handle, int kind, int maxvalue)
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 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ semlock_rebuild(PyTypeObject *type, PyObject *args)
{
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 @@ semlock_dealloc(SemLockObject* self)
{
if (self->handle != SEM_FAILED)
SEM_CLOSE(self->handle);
+ PyMem_Free(self->name);
PyObject_Del(self);
}
@@ -498,7 +526,7 @@ semlock_getvalue(SemLockObject *self)
#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 @@ semlock_iszero(SemLockObject *self)
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 @@ static PyMemberDef semlock_members[] = {
""},
{"maxvalue", T_INT, offsetof(SemLockObject, maxvalue), READONLY,
""},
+ {"name", T_STRING, offsetof(SemLockObject, name), READONLY,
+ ""},
{NULL}
};
@@ -581,7 +611,7 @@ static PyMemberDef semlock_members[] = {
* Semaphore type
*/
-PyTypeObject SemLockType = {
+PyTypeObject _PyMp_SemLockType = {
PyVarObject_HEAD_INIT(NULL, 0)
/* tp_name */ "_multiprocessing.SemLock",
/* tp_basicsize */ sizeof(SemLockObject),
@@ -621,3 +651,23 @@ PyTypeObject SemLockType = {
/* 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 0000000000..fee388f596
--- /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
index 5156b6b32d..e8bef04f84 100644
--- a/Modules/operator.c
+++ b/Modules/_operator.c
@@ -208,6 +208,31 @@ _tscmp(const unsigned char *a, const unsigned char *b,
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"
@@ -297,17 +322,15 @@ compare_digest(PyObject *self, PyObject *args)
/* 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(countOf,
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 @@ static PyTypeObject methodcaller_type = {
};
-/* 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 @@ static struct PyModuleDef operatormodule = {
};
PyMODINIT_FUNC
-PyInit_operator(void)
+PyInit__operator(void)
{
PyObject *m;
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index ae801f74ef..7faf96dd93 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,19 +81,21 @@ enum opcode {
/* Protocol 3 (Python 3.x) */
BINBYTES = 'B',
- SHORT_BINBYTES = 'C'
+ SHORT_BINBYTES = 'C',
+
+ /* 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'
};
-/* 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"
-
enum {
/* Keep in synch with pickle.Pickler._BATCHSIZE. This is how many elements
batch_list/dict() pumps out before doing APPENDS/SETITEMS. Nothing will
@@ -98,48 +110,246 @@ enum {
/* 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;
-
-/* _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;
-
-/* 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;
+/*************************************************************************/
+
+/* State of the pickle module, per PEP 3121. */
+typedef struct {
+ /* Exception classes for pickle. */
+ PyObject *PickleError;
+ PyObject *PicklingError;
+ PyObject *UnpicklingError;
+
+ /* copyreg.dispatch_table, {type_object: pickling_function} */
+ PyObject *dispatch_table;
+
+ /* 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;
}
@@ -240,8 +450,9 @@ Pdata_grow(Pdata *self)
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 @@ typedef struct PicklerObject {
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 @@ typedef struct PicklerObject {
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 @@ typedef struct UnpicklerObject {
/* 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 @@ typedef struct UnpicklerObject {
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 @@ typedef struct UnpicklerObject {
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 @@ PyMemoTable_Copy(PyMemoTable *self)
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 @@ _PyMemoTable_ResizeTable(PyMemoTable *self, Py_ssize_t min_size)
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 @@ PyMemoTable_Set(PyMemoTable *self, PyObject *key, Py_ssize_t value)
/*************************************************************************/
-/* 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 @@ _Pickler_ClearBuffer(PicklerObject *self)
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 @@ _Pickler_FlushToFile(PicklerObject *self)
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;
- }
- 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;
+ /* Make place in buffer for the pickle chunk */
+ 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;
}
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 @@ _Pickler_New(void)
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 @@ _Pickler_New(void)
}
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 @@ _Pickler_SetOutputStream(PicklerObject *self, PyObject *file)
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 @@ _Unpickler_SetStringInput(UnpicklerObject *self, PyObject *input)
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 @@ static Py_ssize_t
_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 @@ _Unpickler_CopyLine(UnpicklerObject *self, char *line, Py_ssize_t len,
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 @@ _Unpickler_MemoPut(UnpicklerObject *self, Py_ssize_t idx, PyObject *value)
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 @@ static PyObject **
_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 @@ _Unpickler_New(void)
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 @@ _Unpickler_New(void)
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 @@ _Unpickler_SetInputEncoding(UnpicklerObject *self,
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 @@ memo_get(PicklerObject *self, PyObject *key)
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 @@ memo_get(PicklerObject *self, PyObject *key)
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 0;
+}
- return status;
+static PyObject *
+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)
+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)
- return NULL;
- main_str = PyUnicode_InternFromString("__main__");
- if (main_str == NULL)
- return NULL;
- }
-
- module_name = PyObject_GetAttr(global, module_str);
+ module_name = _PyObject_GetAttrId(global, &PyId___module__);
- /* 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))
+ if (module_name == NULL) {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError))
+ return NULL;
PyErr_Clear();
- else
- return NULL;
-
- search:
- modules_dict = PySys_GetObject("modules");
- if (modules_dict == 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);
+
+ 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 @@ fast_save_enter(PicklerObject *self, PyObject *obj)
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 @@ fast_save_enter(PicklerObject *self, PyObject *obj)
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 @@ save_none(PicklerObject *self, PyObject *obj)
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)
-{
- char pdata[32];
- Py_ssize_t len = 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;
+save_long(PicklerObject *self, PyObject *obj)
+{
+ PyObject *repr = NULL;
+ Py_ssize_t size;
+ long val;
+ int status = 0;
+
+ 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,30 +1801,9 @@ save_int(PicklerObject *self, long x)
if (_Pickler_Write(self, pdata, len) < 0)
return -1;
- }
-
- 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();
+ return 0;
}
- else
-#if SIZEOF_LONG > 4
- if (val <= 0x7fffffffL && val >= -0x80000000L)
-#endif
- return save_int(self, val);
if (self->proto >= 2) {
/* Linear-time pickling. */
@@ -1719,40 +1969,25 @@ save_bytes(PicklerObject *self, PyObject *obj)
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 @@ save_bytes(PicklerObject *self, PyObject *obj)
}
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 @@ save_bytes(PicklerObject *self, PyObject *obj)
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 @@ done:
}
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];
+ 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;
+ }
- encoded = PyUnicode_AsEncodedString(obj, "utf-8", "surrogatepass");
- if (encoded == NULL)
- goto error;
+ if (_Pickler_Write(self, header, len) < 0)
+ return -1;
+ if (_Pickler_Write(self, data, size) < 0)
+ return -1;
- 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 */
- }
+ return 0;
+}
- 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);
+static int
+write_unicode_binary(PicklerObject *self, PyObject *obj)
+{
+ PyObject *encoded = NULL;
+ Py_ssize_t size;
+ char *data;
+ int r;
- if (_Pickler_Write(self, pdata, 5) < 0)
- goto error;
+ if (PyUnicode_READY(obj))
+ return -1;
- if (_Pickler_Write(self, PyBytes_AS_STRING(encoded), size) < 0)
- goto error;
+ 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 @@ save_dict(PicklerObject *self, PyObject *obj)
}
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 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
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 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
/* 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 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
/* 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 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
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 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
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;
- }
-
- /* 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;
+ /* 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 *);
- 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);
- 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);
+
+ /* 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_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;
+ }
+ if (_Pickler_Write(self, PyBytes_AS_STRING(encoded),
+ PyBytes_GET_SIZE(encoded)) < 0) {
+ Py_DECREF(encoded);
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) {
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 @@ save_global(PicklerObject *self, PyObject *obj, PyObject *name)
}
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 @@ save_pers(PicklerObject *self, PyObject *obj, PyObject *func)
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 @@ static PyObject *
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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
/* 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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
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 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
}
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
* __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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
}
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
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
+ }
+ else {
goto error;
+ }
/* Check for a __reduce__ method. */
- reduce_func = PyObject_GetAttr(obj, reduce_str);
+ reduce_func = _PyObject_GetAttrId(obj, &PyId___reduce__);
if (reduce_func != NULL) {
- reduce_value = PyObject_Call(reduce_func, empty_tuple, NULL);
+ PyObject *empty_tuple = PyTuple_New(0);
+ reduce_value = PyObject_Call(reduce_func, empty_tuple,
+ NULL);
+ Py_DECREF(empty_tuple);
}
else {
- PyErr_Format(PicklingError, "can't pickle '%.200s' object: %R",
+ PyErr_Format(st->PicklingError,
+ "can't pickle '%.200s' object: %R",
type->tp_name, obj);
goto error;
}
@@ -3323,7 +3826,8 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
}
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 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
status = -1;
}
done:
+
Py_LeaveRecursiveCall();
Py_XDECREF(reduce_func);
Py_XDECREF(reduce_value);
@@ -3355,6 +3860,8 @@ dump(PicklerObject *self, PyObject *obj)
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 @@ dump(PicklerObject *self, PyObject *obj)
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 @@ Pickler_clear_memo(PicklerObject *self)
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;
@@ -3415,10 +3931,8 @@ Pickler_dump(PicklerObject *self, PyObject *args)
}
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
{NULL, NULL} /* sentinel */
};
@@ -3431,7 +3945,6 @@ Pickler_dealloc(PicklerObject *self)
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 +3958,6 @@ Pickler_traverse(PicklerObject *self, visitproc visit, void *arg)
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 +3969,6 @@ Pickler_clear(PicklerObject *self)
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 +3980,46 @@ Pickler_clear(PicklerObject *self)
}
-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 +4040,6 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
return -1;
}
- self->arg = NULL;
self->fast = 0;
self->fast_nesting = 0;
self->fast_memo = NULL;
@@ -3550,9 +4057,11 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
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 +4072,30 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
* 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 +4132,18 @@ pmp_copy(PicklerMemoProxyObject *self)
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 +4166,9 @@ pmp_reduce(PicklerMemoProxyObject *self, PyObject *args)
}
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 +4380,7 @@ static PyTypeObject Pickler_Type = {
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 +4395,7 @@ static PyTypeObject Pickler_Type = {
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 +4421,9 @@ find_class(UnpicklerObject *self, PyObject *module_name, PyObject *global_name)
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 +4440,8 @@ load_none(UnpicklerObject *self)
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 +4502,15 @@ load_bool(UnpicklerObject *self, PyObject *boolean)
* 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 +4524,21 @@ calc_binsize(char *bytes, int size)
* 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 +4636,9 @@ load_counted_long(UnpicklerObject *self, int size)
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,155 +4712,114 @@ static int
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);
- return 0;
-}
-
-static int
-load_binbytes(UnpicklerObject *self)
-{
- PyObject *bytes;
- Py_ssize_t x;
- char *s;
-
- if (_Unpickler_Read(self, &s, 4) < 0)
- return -1;
- x = calc_binsize(s, 4);
- if (x < 0) {
- PyErr_Format(PyExc_OverflowError,
- "BINBYTES exceeds system's maximum size of %zd bytes",
- PY_SSIZE_T_MAX
- );
- return -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;
+ }
}
- 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_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);
+ PDATA_PUSH(self->stack, obj, -1);
return 0;
}
static int
-load_binstring(UnpicklerObject *self)
+load_counted_binstring(UnpicklerObject *self, int nbytes)
{
- PyObject *str;
- 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_binint(s, 4);
- if (x < 0) {
- PyErr_SetString(UnpicklingError,
- "BINSTRING pickle has negative byte count");
+ 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, x) < 0)
+ if (_Unpickler_Read(self, &s, size) < 0)
return -1;
- /* Convert Python 2.x strings to unicode. */
- str = PyUnicode_Decode(s, x, self->encoding, self->errors);
- if (str == NULL)
+ /* 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, str, -1);
+ PDATA_PUSH(self->stack, obj, -1);
return 0;
}
static int
-load_short_binstring(UnpicklerObject *self)
+load_counted_binbytes(UnpicklerObject *self, int nbytes)
{
- PyObject *str;
- Py_ssize_t x;
+ PyObject *bytes;
+ Py_ssize_t size;
char *s;
- if (_Unpickler_Read(self, &s, 1) < 0)
+ if (_Unpickler_Read(self, &s, nbytes) < 0)
return -1;
- x = (unsigned char)s[0];
+ 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);
+ return -1;
+ }
- if (_Unpickler_Read(self, &s, x) < 0)
+ if (_Unpickler_Read(self, &s, size) < 0)
return -1;
- /* Convert Python 2.x strings to unicode. */
- str = PyUnicode_Decode(s, x, self->encoding, self->errors);
- if (str == NULL)
+ bytes = PyBytes_FromStringAndSize(s, size);
+ if (bytes == NULL)
return -1;
- PDATA_PUSH(self->stack, str, -1);
+ PDATA_PUSH(self->stack, bytes, -1);
return 0;
}
@@ -4368,25 +4844,23 @@ load_unicode(UnpicklerObject *self)
}
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 +4932,17 @@ load_empty_dict(UnpicklerObject *self)
}
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 +4984,29 @@ load_dict(UnpicklerObject *self)
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 +5114,7 @@ load_newobj(UnpicklerObject *self)
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 +5123,8 @@ load_newobj(UnpicklerObject *self)
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 +5133,12 @@ load_newobj(UnpicklerObject *self)
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 +5160,58 @@ load_newobj(UnpicklerObject *self)
}
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 +5248,32 @@ load_global(UnpicklerObject *self)
}
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 +5290,9 @@ load_persid(UnpicklerObject *self)
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 +5300,8 @@ load_persid(UnpicklerObject *self)
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 +5318,9 @@ load_binpersid(UnpicklerObject *self)
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 +5328,8 @@ load_binpersid(UnpicklerObject *self)
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 +5485,7 @@ load_extension(UnpicklerObject *self, int nbytes)
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 +5493,7 @@ load_extension(UnpicklerObject *self, int nbytes)
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 +5501,26 @@ load_extension(UnpicklerObject *self, int nbytes)
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 +5541,7 @@ load_extension(UnpicklerObject *self, int nbytes)
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 +5626,18 @@ load_long_binput(UnpicklerObject *self)
}
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 +5676,7 @@ do_append(UnpicklerObject *self, Py_ssize_t x)
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 +5718,10 @@ do_setitems(UnpicklerObject *self, Py_ssize_t x)
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 +5755,59 @@ load_setitems(UnpicklerObject *self)
}
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 +5840,7 @@ load_build(UnpicklerObject *self)
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 +5871,8 @@ load_build(UnpicklerObject *self)
_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 +5901,8 @@ load_build(UnpicklerObject *self)
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 +6008,39 @@ load_proto(UnpicklerObject *self)
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 +6066,16 @@ load(UnpicklerObject *self)
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 +6085,15 @@ load(UnpicklerObject *self)
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 +6105,7 @@ load(UnpicklerObject *self)
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 +6114,7 @@ load(UnpicklerObject *self)
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 +6125,93 @@ load(UnpicklerObject *self)
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)
+ if (PyErr_Occurred()) {
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 (_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 +6219,14 @@ Unpickler_find_class(UnpicklerObject *self, PyObject *args)
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 +6252,7 @@ Unpickler_find_class(UnpicklerObject *self, PyObject *args)
}
/* 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 +6267,11 @@ Unpickler_find_class(UnpicklerObject *self, PyObject *args)
}
}
- 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 +6280,18 @@ Unpickler_find_class(UnpicklerObject *self, PyObject *args)
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;
}
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
{NULL, NULL} /* sentinel */
};
@@ -5592,7 +6304,6 @@ Unpickler_dealloc(UnpicklerObject *self)
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 +6312,8 @@ Unpickler_dealloc(UnpicklerObject *self)
_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 +6326,6 @@ Unpickler_traverse(UnpicklerObject *self, visitproc visit, void *arg)
Py_VISIT(self->peek);
Py_VISIT(self->stack);
Py_VISIT(self->pers_func);
- Py_VISIT(self->arg);
return 0;
}
@@ -5627,7 +6337,6 @@ Unpickler_clear(UnpicklerObject *self)
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 +6347,52 @@ Unpickler_clear(UnpicklerObject *self)
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 +6403,7 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
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 +6411,7 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
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 +6419,19 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
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 +6445,15 @@ Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds)
* 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 +6462,15 @@ ump_clear(UnpicklerMemoProxyObject *self)
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 +6500,19 @@ error:
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 +6535,9 @@ ump_reduce(UnpicklerMemoProxyObject *self, PyObject *args)
}
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 +6761,7 @@ static PyTypeObject Unpickler_Type = {
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 +6776,56 @@ static PyTypeObject Unpickler_Type = {
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]
-static PyObject *
-pickle_dump(PyObject *self, PyObject *args, PyObject *kwds)
-{
- static char *kwlist[] = {"obj", "file", "protocol", "fix_imports", 0};
- PyObject *obj;
- PyObject *file;
- PyObject *proto = NULL;
- PyObject *fix_imports = Py_True;
- PicklerObject *pickler;
+_pickle.dump
- /* 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;
- }
+ obj: object
+ file: object
+ protocol: object = NULL
+ *
+ fix_imports: bool = True
- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|OO:dump", kwlist,
- &obj, &file, &proto, &fix_imports))
- return NULL;
+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_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports)
+/*[clinic end generated code: output=a606e626d553850d input=e9e5fdd48de92eae]*/
+{
+ PicklerObject *pickler = _Pickler_New();
- 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 +6845,41 @@ pickle_dump(PyObject *self, PyObject *args, PyObject *kwds)
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;
-
- /* 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;
+ PicklerObject *pickler = _Pickler_New();
- 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 +6894,48 @@ pickle_dumps(PyObject *self, PyObject *args, PyObject *kwds)
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 +6945,7 @@ pickle_load(PyObject *self, PyObject *args, PyObject *kwds)
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 +6956,49 @@ pickle_load(PyObject *self, PyObject *args, PyObject *kwds)
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;
-
- /* 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;
+ UnpicklerObject *unpickler = _Unpickler_New();
- 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 +7009,69 @@ pickle_loads(PyObject *self, PyObject *args, PyObject *kwds)
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);
+ _Pickle_ClearState(_Pickle_GetState(m));
+ return 0;
+}
- 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);
+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;
-
- 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 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 +7096,32 @@ PyInit__pickle(void)
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 0196ca2cb6..a2d7022992 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -35,7 +35,7 @@
# define FD_DIR "/proc/self/fd"
#endif
-#define POSIX_CALL(call) if ((call) == -1) goto error
+#define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0)
/* Maximum file descriptor, initialized on module load. */
@@ -87,7 +87,7 @@ _is_fdescfs_mounted_on_dev_fd(void)
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,6 +136,29 @@ _is_fd_in_sorted_fd_sequence(int fd, PyObject *fd_sequence)
return 0;
}
+static int
+make_inheritable(PyObject *py_fds_to_keep, int errpipe_write)
+{
+ Py_ssize_t i, len;
+
+ 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;
+}
+
/* Close all file descriptors in the range start_fd inclusive to
* end_fd exclusive except for those in py_fds_to_keep. If the
@@ -205,18 +228,8 @@ _close_open_fd_range_safe(int start_fd, int end_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);
@@ -356,16 +369,16 @@ child_exec(char *const exec_array[],
/* 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 +392,34 @@ child_exec(char *const exec_array[],
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) {
- POSIX_CALL(dup2(p2cread, 0)); /* stdin */
+ 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) {
- POSIX_CALL(dup2(c2pwrite, 1)); /* stdout */
+ 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));
@@ -492,7 +501,7 @@ error:
/* 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. */
@@ -544,7 +553,7 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
PyObject *result;
_Py_IDENTIFIER(isenabled);
_Py_IDENTIFIER(disable);
-
+
gc_module = PyImport_ImportModule("gc");
if (gc_module == NULL)
return NULL;
@@ -721,88 +730,6 @@ Returns: the child process's PID.\n\
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 +738,6 @@ PyDoc_STRVAR(module_doc,
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 */
};
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 21a2b09f94..4377ee0cf4 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -168,9 +168,9 @@ init_genrand(RandomObject *self, unsigned long s)
/* 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 @@ init_by_array(RandomObject *self, unsigned long init_key[], unsigned long key_le
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 @@ init_by_array(RandomObject *self, unsigned long init_key[], unsigned long key_le
}
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 @@ static PyObject *
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 @@ random_seed(RandomObject *self, PyObject *args)
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)
+ /* Figure out how many 32-bit chunks this gives us. */
+ keyused = bits == 0 ? 1 : (bits - 1) / 32 + 1;
+
+ /* 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;
- thirtytwo = PyLong_FromLong(32L);
- if (thirtytwo == NULL)
+ }
+ 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;
- while ((err=PyObject_IsTrue(n))) {
- PyObject *newn;
- PyObject *pychunk;
- unsigned long chunk;
-
- 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;
}
- 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 @@ random_getrandbits(RandomObject *self, PyObject *args)
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 3693363bb2..3689a4e387 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 8cf2d6aa80..882424b0d9 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 @@ static void _sqlite3_result_error(sqlite3_context* ctx, const char* errmsg, int
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 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
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 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject
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) {
@@ -506,10 +525,16 @@ _pysqlite_set_result(sqlite3_context* context, PyObject* 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");
+ PyErr_SetString(PyExc_ValueError,
+ "could not convert BLOB to buffer");
return -1;
}
- sqlite3_result_blob(context, buffer, buflen, SQLITE_TRANSIENT);
+ if (buflen > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "BLOB longer than INT_MAX bytes");
+ return -1;
+ }
+ sqlite3_result_blob(context, buffer, (int)buflen, SQLITE_TRANSIENT);
} else {
return -1;
}
@@ -682,6 +707,8 @@ void _pysqlite_final_callback(sqlite3_context* context)
PyObject** aggregate_instance;
_Py_IDENTIFIER(finalize);
int ok;
+ PyObject *exception, *value, *tb;
+ int restore;
#ifdef WITH_THREAD
PyGILState_STATE threadstate;
@@ -697,7 +724,12 @@ void _pysqlite_final_callback(sqlite3_context* context)
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 +744,17 @@ void _pysqlite_final_callback(sqlite3_context* context)
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 +905,29 @@ static int _authorizer_callback(void* user_arg, int action, const char* arg1, co
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 +1240,8 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
return NULL;
}
- if (!PyArg_ParseTuple(args, "O", &sql)) {
+ if (!PyArg_ParseTuple(args, "O", &sql))
return NULL;
- }
_pysqlite_drop_unused_statement_references(self);
@@ -1208,7 +1257,6 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
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.");
@@ -1218,25 +1266,23 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
(void)pysqlite_statement_reset(statement);
_pysqlite_seterror(self->db, NULL);
}
+ goto error;
+ }
- 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;
- }
-
+ 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);
-error:
return (PyObject*)statement;
+
+error:
+ Py_DECREF(statement);
+ return NULL;
}
PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args, PyObject* kwargs)
@@ -1244,7 +1290,6 @@ PyObject* pysqlite_connection_execute(pysqlite_Connection* self, PyObject* args,
PyObject* cursor = 0;
PyObject* result = 0;
PyObject* method = 0;
- _Py_IDENTIFIER(cursor);
cursor = _PyObject_CallMethodId((PyObject*)self, &PyId_cursor, "");
if (!cursor) {
@@ -1274,7 +1319,6 @@ PyObject* pysqlite_connection_executemany(pysqlite_Connection* self, PyObject* a
PyObject* cursor = 0;
PyObject* result = 0;
PyObject* method = 0;
- _Py_IDENTIFIER(cursor);
cursor = _PyObject_CallMethodId((PyObject*)self, &PyId_cursor, "");
if (!cursor) {
@@ -1304,7 +1348,6 @@ PyObject* pysqlite_connection_executescript(pysqlite_Connection* self, PyObject*
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 09c13d4dbd..ce92af6920 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);
@@ -338,6 +337,11 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
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>";
@@ -864,10 +868,15 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
}
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;
@@ -884,6 +893,12 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
if (rc == SQLITE_ROW) {
self->next_row = _pysqlite_fetch_one_row(self);
+ if (self->next_row == NULL) {
+ (void)pysqlite_statement_reset(self->statement);
+ Py_DECREF(next_row);
+ _pysqlite_seterror(self->connection->db, NULL);
+ return NULL;
+ }
}
}
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index bea6d6aba1..7a7e86040a 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -50,19 +50,26 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
* 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 @@ static PyObject* module_connect(PyObject* self, PyObject* args, PyObject*
}
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 fc6887445e..f2c85f9af6 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 b50658c220..4a87a048fd 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)
{
@@ -68,7 +67,7 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
{
long _idx;
char* key;
- int nitems, i;
+ Py_ssize_t nitems, i;
char* compare_key;
char* p1;
@@ -89,7 +88,10 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
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 +123,12 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
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;
}
diff --git a/Modules/_sqlite/sqlitecompat.h b/Modules/_sqlite/sqlitecompat.h
deleted file mode 100644
index cf20f16f65..0000000000
--- 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 471a0676a8..66b4a52565 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);
@@ -133,18 +132,26 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
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;
+ 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:
- if (PyObject_AsCharBuffer(parameter, &buffer, &buflen) == 0) {
- rc = sqlite3_bind_blob(self->st, pos, buffer, buflen, SQLITE_TRANSIENT);
- } else {
+ if (PyObject_AsCharBuffer(parameter, &buffer, &buflen) != 0) {
PyErr_SetString(PyExc_ValueError, "could not convert BLOB to buffer");
- rc = -1;
+ return -1;
+ }
+ if (buflen > INT_MAX) {
+ PyErr_SetString(PyExc_OverflowError,
+ "BLOB longer than INT_MAX bytes");
+ return -1;
}
+ rc = sqlite3_bind_blob(self->st, pos, buffer, buflen, SQLITE_TRANSIENT);
break;
case TYPE_UNKNOWN:
rc = -1;
@@ -177,7 +184,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
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 +200,9 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
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 +258,7 @@ void pysqlite_statement_bind_parameters(pysqlite_Statement* self, PyObject* para
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 d88bc3fc53..312fe3be11 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -132,7 +132,7 @@ _pysqlite_long_from_int64(sqlite_int64 value)
}
# 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 b1258eefc4..eb1106ad80 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 @@ static char copyright[] =
#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 @@ static char copyright[] =
/* 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 @@ static char copyright[] =
/* 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 @@ static unsigned int sre_lower(unsigned int ch)
/* 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 @@ data_stack_grow(SRE_STATE* state, Py_ssize_t size)
/* 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_RECURSIVE
-#include "_sre.c"
-#undef SRE_RECURSIVE
-
-#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
-
-/* generate 8/16/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 */
+#define SRE_CHAR Py_UCS1
+#define SIZEOF_SRE_CHAR 1
+#define SRE(F) sre_ucs1_##F
+#include "sre_lib.h"
- int ok = 1;
+/* generate 16-bit unicode version */
- for (;;) {
- switch (*set++) {
+#define SRE_CHAR Py_UCS2
+#define SIZEOF_SRE_CHAR 2
+#define SRE(F) sre_ucs2_##F
+#include "sre_lib.h"
- case SRE_OP_FAILURE:
- return !ok;
+/* generate 32-bit unicode version */
- 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 @@ state_reset(SRE_STATE* state)
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;
- }
-
- /* determine buffer size */
- bytes = view->len;
- ptr = view->buf;
-
- if (bytes < 0) {
- PyErr_SetString(PyExc_TypeError, "buffer has negative size");
- goto err;
- }
-
- /* 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;
+ if (PyObject_GetBuffer(string, view, PyBUF_SIMPLE) != 0) {
+ PyErr_SetString(PyExc_TypeError, "expected string or buffer");
+ return NULL;
}
- *p_length = size;
- *p_charsize = charsize;
- *p_logical_charsize = charsize;
+ *p_length = view->len;
+ *p_charsize = 1;
+ *p_isbytes = 1;
- if (ptr == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer is NULL");
- goto err;
+ if (view->buf == NULL) {
+ PyErr_SetString(PyExc_ValueError, "Buffer is NULL");
+ PyBuffer_Release(view);
+ view->buf = NULL;
+ return NULL;
}
- return ptr;
- err:
- PyBuffer_Release(view);
- view->buf = NULL;
- return NULL;
+ return view->buf;
}
LOCAL(PyObject*)
@@ -1740,7 +352,7 @@ state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string,
/* 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_init(SRE_STATE* state, PatternObject* pattern, PyObject* string,
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 @@ state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string,
else if (end > length)
end = length;
- state->logical_charsize = logical_charsize;
+ state->isbytes = isbytes;
state->charsize = charsize;
state->beginning = ptr;
@@ -1816,6 +428,24 @@ state_fini(SRE_STATE* state)
(((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 @@ state_getslice(SRE_STATE* state, Py_ssize_t index, PyObject* string, int empty)
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 @@ pattern_dealloc(PatternObject* self)
{
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)
+{
+ if (state->charsize == 1)
+ return sre_ucs1_match(state, pattern);
+ if (state->charsize == 2)
+ return sre_ucs2_match(state, pattern);
+ assert(state->charsize == 4);
+ return sre_ucs4_match(state, pattern);
+}
+
+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 @@ fix_string_param(PyObject *string, PyObject *string2, const char *oldname)
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));
+
+ 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;
@@ -1922,15 +609,12 @@ pattern_match(PatternObject* self, PyObject* args, PyObject* kw)
if (!string)
return NULL;
+ state.match_all = 1;
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));
TRACE(("|%p|%p|END\n", PatternObject_GetCode(self), state.ptr));
if (PyErr_Occurred())
@@ -1945,7 +629,7 @@ static PyObject*
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 +649,7 @@ pattern_search(PatternObject* self, PyObject* args, PyObject* kw)
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 +709,11 @@ deepcopy(PyObject** object, PyObject* memo)
#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 +746,7 @@ pattern_findall(PatternObject* self, PyObject* args, PyObject* kw)
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 +762,8 @@ pattern_findall(PatternObject* self, PyObject* args, PyObject* kw)
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 +809,6 @@ error:
}
-#if PY_VERSION_HEX >= 0x02020000
static PyObject*
pattern_finditer(PatternObject* pattern, PyObject* args, PyObject* kw)
{
@@ -2203,7 +830,6 @@ pattern_finditer(PatternObject* pattern, PyObject* args, PyObject* kw)
return iterator;
}
-#endif
static PyObject*
pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
@@ -2211,7 +837,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
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 +872,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
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 +892,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
}
/* 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 +921,7 @@ pattern_split(PatternObject* self, PyObject* args, PyObject* kw)
}
/* 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 +947,16 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
{
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 +969,13 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
/* 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 +1019,7 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
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 +1035,8 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string,
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 +1091,8 @@ next:
/* 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 +1106,25 @@ next:
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 +1218,94 @@ pattern_deepcopy(PatternObject* self, PyObject* memo)
#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 +1341,8 @@ PyDoc_STRVAR(pattern_doc, "Compiled regular expression objects");
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 +1353,8 @@ static PyMethodDef pattern_methods[] = {
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 +1379,7 @@ static PyTypeObject Pattern_Type = {
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 +1432,6 @@ _compile(PyObject* self_, PyObject* args)
self->pattern = NULL;
self->groupindex = NULL;
self->indexgroup = NULL;
- self->view.buf = NULL;
self->codesize = n;
@@ -2732,16 +1452,20 @@ _compile(PyObject* self_, PyObject* args)
}
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 +1551,7 @@ _compile(PyObject* self_, PyObject* args)
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 +1583,8 @@ _validate_charset(SRE_CODE *code, SRE_CODE *end)
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 +1592,7 @@ _validate_charset(SRE_CODE *code, SRE_CODE *end)
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 +1600,8 @@ _validate_charset(SRE_CODE *code, SRE_CODE *end)
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 +1664,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
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 +1752,11 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
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 +1847,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
case SRE_OP_GROUPREF:
case SRE_OP_GROUPREF_IGNORE:
GET_ARG;
- if (arg >= groups)
+ if (arg >= (size_t)groups)
FAIL;
break;
@@ -3132,7 +1856,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
'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 +1885,7 @@ _validate_inner(SRE_CODE *code, SRE_CODE *end, Py_ssize_t groups)
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 +1969,12 @@ match_dealloc(MatchObject* self)
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 +1992,14 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def)
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 +2419,22 @@ match_regs_get(MatchObject *self)
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 +2463,7 @@ static PyTypeObject Match_Type = {
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 +2487,7 @@ static PyTypeObject Match_Type = {
};
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 +2566,13 @@ scanner_match(ScannerObject* self, PyObject *unused)
{
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));
if (PyErr_Occurred())
return NULL;
@@ -3846,17 +2593,13 @@ scanner_search(ScannerObject* self, PyObject *unused)
{
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 +2756,5 @@ PyMODINIT_FUNC PyInit__sre(void)
return m;
}
-#endif /* !defined(SRE_RECURSIVE) */
-
/* vim:ts=4:sw=4:et
*/
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 499e8ba269..813c926c2d 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -42,50 +42,6 @@
#endif
-enum py_ssl_error {
- /* these mirror ssl.h */
- PY_SSL_ERROR_NONE,
- PY_SSL_ERROR_SSL,
- PY_SSL_ERROR_WANT_READ,
- PY_SSL_ERROR_WANT_WRITE,
- PY_SSL_ERROR_WANT_X509_LOOKUP,
- PY_SSL_ERROR_SYSCALL, /* look at error stack/return value/errno */
- PY_SSL_ERROR_ZERO_RETURN,
- PY_SSL_ERROR_WANT_CONNECT,
- /* start of non ssl.h errorcodes */
- PY_SSL_ERROR_EOF, /* special case of SSL_ERROR_SYSCALL */
- PY_SSL_ERROR_NO_SOCKET, /* socket has been GC'd */
- PY_SSL_ERROR_INVALID_ERROR_CODE
-};
-
-enum py_ssl_server_or_client {
- PY_SSL_CLIENT,
- PY_SSL_SERVER
-};
-
-enum py_ssl_cert_requirements {
- PY_SSL_CERT_NONE,
- PY_SSL_CERT_OPTIONAL,
- PY_SSL_CERT_REQUIRED
-};
-
-enum py_ssl_version {
- PY_SSL_VERSION_SSL2,
- PY_SSL_VERSION_SSL3=1,
- PY_SSL_VERSION_SSL23,
- 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"
@@ -107,9 +63,6 @@ static PySocketModule_APIObject PySocketModule;
#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;
@@ -123,6 +76,76 @@ 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,
+ PY_SSL_ERROR_SSL,
+ PY_SSL_ERROR_WANT_READ,
+ PY_SSL_ERROR_WANT_WRITE,
+ PY_SSL_ERROR_WANT_X509_LOOKUP,
+ PY_SSL_ERROR_SYSCALL, /* look at error stack/return value/errno */
+ PY_SSL_ERROR_ZERO_RETURN,
+ PY_SSL_ERROR_WANT_CONNECT,
+ /* start of non ssl.h errorcodes */
+ PY_SSL_ERROR_EOF, /* special case of SSL_ERROR_SYSCALL */
+ PY_SSL_ERROR_NO_SOCKET, /* socket has been GC'd */
+ PY_SSL_ERROR_INVALID_ERROR_CODE
+};
+
+enum py_ssl_server_or_client {
+ PY_SSL_CLIENT,
+ PY_SSL_SERVER
+};
+
+enum py_ssl_cert_requirements {
+ PY_SSL_CERT_NONE,
+ PY_SSL_CERT_OPTIONAL,
+ PY_SSL_CERT_REQUIRED
+};
+
+enum py_ssl_version {
+ 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
+#endif
+};
+
#ifdef WITH_THREAD
/* serves as a flag to see whether we've initialized the SSL thread support. */
@@ -173,6 +196,11 @@ static unsigned int _ssl_locks_count = 0;
# 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 +209,20 @@ typedef struct {
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 +350,18 @@ fill_and_set_sslerror(PyObject *type, int ssl_errno, const char *errstr,
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 +475,13 @@ _setSSLError (char *errstr, int errcode, char *filename, int lineno) {
*/
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 +490,10 @@ newPySSLSocket(SSL_CTX *ctx, PySocketSockObject *sock,
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 +502,15 @@ newPySSLSocket(SSL_CTX *ctx, PySocketSockObject *sock,
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 +532,10 @@ newPySSLSocket(SSL_CTX *ctx, PySocketSockObject *sock,
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 +602,7 @@ static PyObject *PySSL_SSLdo_handshake(PySSLSocket *self)
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 +969,126 @@ _get_peer_alt_names (X509 *certificate) {
}
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 +1098,10 @@ _decode_certificate(X509 *certificate) {
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 +1207,41 @@ _decode_certificate(X509 *certificate) {
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 +1253,24 @@ _decode_certificate(X509 *certificate) {
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 +1316,23 @@ PySSL_test_decode_certificate (PyObject *mod, PyObject *args) {
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 +1435,43 @@ static PyObject *PySSL_compression(PySSLSocket *self) {
#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 +1479,7 @@ static void PySSL_dealloc(PySSLSocket *self)
if (self->ssl)
SSL_free(self->ssl);
Py_XDECREF(self->Socket);
+ Py_XDECREF(self->ctx);
PyObject_Del(self);
}
@@ -1286,9 +1538,11 @@ check_socket_and_wait_for_timeout(PySocketSockObject *s, int writing)
/* 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 +1922,12 @@ If the TLS handshake is not yet complete, None is returned");
#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 +1982,8 @@ static PyTypeObject PySSLSocket_Type = {
0, /*tp_iter*/
0, /*tp_iternext*/
PySSLMethods, /*tp_methods*/
+ 0, /*tp_members*/
+ ssl_getsetlist, /*tp_getset*/
};
@@ -1746,6 +2008,12 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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
else if (proto_version == PY_SSL_VERSION_SSL3)
ctx = SSL_CTX_new(SSLv3_method());
#ifndef OPENSSL_NO_SSL2
@@ -1779,6 +2047,11 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
#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;
@@ -1794,9 +2067,28 @@ context_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 +2235,56 @@ set_verify_mode(PySSLContext *self, PyObject *arg, void *c)
"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 +2314,30 @@ set_options(PySSLContext *self, PyObject *arg, void *c)
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 +2382,8 @@ _pwinfo_set(_PySSLPasswordInfo *pw_info, PyObject* password,
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 +2527,212 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
}
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
- Py_XDECREF(cafile_bytes);
- Py_XDECREF(capath_bytes);
- if (r != 1) {
- if (errno != 0) {
- ERR_clear_error();
- PyErr_SetFromErrno(PyExc_IOError);
+
+ /* 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;
+ }
}
- else {
- _setSSLError(NULL, 0, __FILE__, __LINE__);
+ }
+
+ /* 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 (ok) {
+ Py_RETURN_NONE;
+ } else {
return NULL;
}
- Py_RETURN_NONE;
}
static PyObject *
@@ -2239,7 +2741,7 @@ load_dh_params(PySSLContext *self, PyObject *filepath)
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,7 +2789,7 @@ context_wrap_socket(PySSLContext *self, PyObject *args, PyObject *kwds)
&sock, &server_side,
"idna", &hostname))
return NULL;
-#ifndef SSL_CTRL_SET_TLSEXT_HOSTNAME
+#if !HAVE_SNI
PyMem_Free(hostname);
PyErr_SetString(PyExc_ValueError, "server_hostname is not supported "
"by your OpenSSL library");
@@ -2295,7 +2797,7 @@ context_wrap_socket(PySSLContext *self, PyObject *args, PyObject *kwds)
#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 +2882,259 @@ set_ecdh_curve(PySSLContext *self, PyObject *name)
}
#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 +3161,12 @@ static struct PyMethodDef context_methods[] = {
{"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 +3190,10 @@ static PyTypeObject PySSLContext_Type = {
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*/
@@ -2590,7 +3348,384 @@ fails or if it does not provide enough data to seed PRNG.");
#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];
+ int 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. */
@@ -2609,6 +3744,18 @@ static PyMethodDef PySSL_methods[] = {
{"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 +3817,7 @@ static int _setup_ssl_threads(void) {
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 +3829,7 @@ static int _setup_ssl_threads(void) {
for (j = 0; j < i; j++) {
PyThread_free_lock(_ssl_locks[j]);
}
- free(_ssl_locks);
+ PyMem_Free(_ssl_locks);
return 0;
}
}
@@ -2836,6 +3983,66 @@ PyInit__ssl(void)
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
@@ -2848,6 +4055,12 @@ PyInit__ssl(void)
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 +4068,10 @@ PyInit__ssl(void)
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 +4083,7 @@ PyInit__ssl(void)
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/_stat.c b/Modules/_stat.c
new file mode 100644
index 0000000000..a301fa8840
--- /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 a248753766..1de94e406e 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -26,6 +26,7 @@ typedef struct _formatcode {
const struct _formatdef *fmtdef;
Py_ssize_t offset;
Py_ssize_t size;
+ Py_ssize_t repeat;
} formatcode;
/* Struct object interface */
@@ -1199,12 +1200,11 @@ whichtable(char **pfmt)
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 @@ align(Py_ssize_t size, char c, const formatdef *e)
return size;
}
+/*
+ * Struct object implementation.
+ */
/* calculate the size of a format string */
@@ -1261,7 +1264,7 @@ prepare_s(PyStructObject *self)
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 @@ prepare_s(PyStructObject *self)
s = fmt;
size = 0;
len = 0;
+ ncodes = 0;
while ((c = *s++) != '\0') {
if (Py_ISSPACE(Py_CHARMASK(c)))
continue;
@@ -1299,9 +1303,9 @@ prepare_s(PyStructObject *self)
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 @@ prepare_s(PyStructObject *self)
}
/* 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 @@ prepare_s(PyStructObject *self)
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 @@ s_unpack_internal(PyStructObject *soself, char *startfrom) {
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 @@ s_unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
}
+/* 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 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
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;
}
}
@@ -1769,14 +1919,18 @@ static PyObject *
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 +2180,34 @@ unpack_from(PyObject *self, PyObject *args, PyObject *kwds)
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 +2277,13 @@ PyInit__struct(void)
/* 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 316666e68e..0c6ef16f17 100644
--- a/Modules/_testbuffer.c
+++ b/Modules/_testbuffer.c
@@ -1815,7 +1815,7 @@ ndarray_subscript(NDArrayObject *self, PyObject *key)
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 @@ PyInit__testbuffer(void)
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_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_AddIntConstant(m, "PyBUF_READ", PyBUF_READ);
- PyModule_AddIntConstant(m, "PyBUF_WRITE", PyBUF_WRITE);
+ 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_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_AddIntMacro(m, PyBUF_READ);
+ PyModule_AddIntMacro(m, PyBUF_WRITE);
return m;
}
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 91f291a011..db2376d036 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -65,6 +65,69 @@ test_config(PyObject *self)
}
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 @@ test_widechar(PyObject *self)
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;
@@ -2439,14 +2516,27 @@ run_in_subinterp(PyObject *self, PyObject *args)
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 (check_time_rounding(round) < 0)
return NULL;
- if (_PyTime_ObjectToTime_t(obj, &sec) == -1)
+ if (_PyTime_ObjectToTime_t(obj, &sec, round) == -1)
return NULL;
return _PyLong_FromTime_t(sec);
}
@@ -2457,9 +2547,12 @@ test_pytime_object_to_timeval(PyObject *self, PyObject *args)
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 +2563,354 @@ test_pytime_object_to_timespec(PyObject *self, PyObject *args)
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 (check_time_rounding(round) < 0)
return NULL;
- if (_PyTime_ObjectToTimespec(obj, &sec, &nsec) == -1)
+ 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(ob);
+ 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 +3005,17 @@ static PyMethodDef TestMethods[] = {
{"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},
@@ -2663,6 +3103,38 @@ static PyMethodDef TestMethods[] = {
{"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",
+ (PyCFunction)test_pymem_alloc0, METH_NOARGS},
+ {"test_pymem_alloc0",
+ (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 +3353,8 @@ PyInit__testcapi(void)
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 51b439f480..a21d2518be 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 @@ void print_subinterp(void)
);
}
-int main(int argc, char *argv[])
+static void test_repeated_init_and_subinterpreters(void)
{
PyThreadState *mainstate, *substate;
#ifdef WITH_THREAD
@@ -24,10 +43,7 @@ int main(int argc, char *argv[])
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 @@ int main(int argc, char *argv[])
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 0000000000..1caeb66eb8
--- /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 d1dc61d0b1..9925b0e7ec 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -17,6 +17,8 @@ static PyObject *ThreadError;
static long nb_threads = 0;
static PyObject *str_dict;
+_Py_IDENTIFIER(stderr);
+
/* Lock objects */
typedef struct {
@@ -68,7 +70,7 @@ acquire_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds)
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 @@ typedef struct {
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 @@ current thread, release() needs to be called as many times for the lock\n\
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 @@ rlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
self = (rlockobject *) type->tp_alloc(type, 0);
if (self != NULL) {
+ self->in_weakreflist = NULL;
+ self->rlock_owner = 0;
+ self->rlock_count = 0;
+
self->rlock_lock = PyThread_allocate_lock();
if (self->rlock_lock == NULL) {
- type->tp_free(self);
+ Py_DECREF(self);
PyErr_SetString(ThreadError, "can't allocate lock");
return NULL;
}
- self->in_weakreflist = NULL;
- self->rlock_owner = 0;
- self->rlock_count = 0;
}
return (PyObject *) self;
@@ -482,7 +488,7 @@ static PyMethodDef rlock_methods[] = {
{"_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 @@ local_new(PyTypeObject *type, PyObject *args, PyObject *kw)
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 @@ t_bootstrap(void *boot_raw)
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 @@ yet finished.\n\
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 @@ static PyMethodDef thread_methods[] = {
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 262d679055..af430fba98 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -114,52 +114,60 @@ Copyright (C) 1994 Steen Lumholt.
/* 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.
-
- 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.
+
+ 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.
+
+ 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.
-
- 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.
-
- 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.
+ 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.
+
+ 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.
*/
@@ -168,7 +176,8 @@ static PyThread_type_lock tcl_lock = 0;
#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 @@ static PyThreadState *tcl_tstate = NULL;
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 @@ static PyThreadState *tcl_tstate = NULL;
#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 @@ static PyThreadState *tcl_tstate = NULL;
#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 @@ static PyThreadState *tcl_tstate = NULL;
/**** Tkapp Object Declaration ****/
-static PyTypeObject Tkapp_Type;
+static PyObject *Tkapp_Type;
typedef struct {
PyObject_HEAD
@@ -239,7 +251,6 @@ typedef struct {
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 @@ WaitForMainloop(TkappObject* self)
#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 *
@@ -471,8 +381,7 @@ Split(char *list)
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 +413,9 @@ Split(char *list)
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 +547,10 @@ Tkapp_New(char *screenName, char *className,
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 +561,8 @@ Tkapp_New(char *screenName, char *className,
#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;
}
@@ -788,16 +699,17 @@ typedef struct {
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 +719,11 @@ newPyTclObject(Tcl_Obj *arg)
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 +762,13 @@ PyTclObject_str(PyTclObject *self, void *ignored)
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 +842,25 @@ static PyGetSetDef PyTclObject_getsetlist[] = {
{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,
};
+
static Tcl_Obj*
AsObj(PyObject *value)
{
@@ -1376,42 +1270,6 @@ Tkapp_Call(PyObject *selfptr, PyObject *args)
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;
@@ -1435,34 +1293,6 @@ Tkapp_Eval(PyObject *self, PyObject *args)
}
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;
@@ -1521,8 +1351,7 @@ Tkapp_AddErrorInfo(PyObject *self, PyObject *args)
Tcl_AddErrorInfo(Tkapp_Interp(self), msg);
LEAVE_TCL
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -1748,7 +1577,8 @@ GetVar(PyObject *self, PyObject *args, int flags)
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);
@@ -1807,7 +1637,8 @@ Tkapp_UnsetVar(PyObject *self, PyObject *args)
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);
}
@@ -2073,27 +1904,6 @@ Tkapp_Split(PyObject *self, PyObject *args)
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 **/
@@ -2267,8 +2077,7 @@ Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -2309,8 +2118,7 @@ Tkapp_DeleteCommand(PyObject *selfptr, PyObject *args)
PyErr_SetString(Tkinter_TclError, "can't delete Tcl command");
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -2414,8 +2222,7 @@ Tkapp_CreateFileHandler(PyObject *self, PyObject *args)
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 +2246,14 @@ Tkapp_DeleteFileHandler(PyObject *self, PyObject *args)
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 +2278,7 @@ Tktt_DeleteTimerHandler(PyObject *self, PyObject *args)
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 +2292,10 @@ Tktt_New(PyObject *func)
{
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 +2311,12 @@ Tktt_Dealloc(PyObject *self)
{
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 +2328,20 @@ Tktt_Repr(PyObject *self)
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 +2463,7 @@ Tkapp_MainLoop(PyObject *selfptr, PyObject *args)
excInCmd = valInCmd = trbInCmd = NULL;
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2700,8 +2489,7 @@ Tkapp_Quit(PyObject *self, PyObject *args)
return NULL;
quitMainLoop = 1;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2751,15 +2539,15 @@ Tkapp_TkInit(PyObject *self, PyObject *args)
}
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 +2561,7 @@ Tkapp_WantObjects(PyObject *self, PyObject *args)
return PyBool_FromLong(((TkappObject*)self)->wantobjects);
((TkappObject*)self)->wantobjects = wantobjects;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *
@@ -2783,8 +2570,7 @@ Tkapp_WillDispatch(PyObject *self, PyObject *args)
((TkappObject*)self)->dispatching = 1;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
@@ -2795,9 +2581,7 @@ static PyMethodDef Tkapp_methods[] =
{"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 +2600,6 @@ static PyMethodDef Tkapp_methods[] =
{"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 +2622,29 @@ static PyMethodDef Tkapp_methods[] =
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,
};
@@ -3016,7 +2784,7 @@ Tkinter_Create(PyObject *self, PyObject *args)
return NULL;
return (PyObject *) Tkapp_New(screenName, className,
- interactive, wantobjects, wantTk,
+ interactive, wantobjects, wantTk,
sync, use);
}
@@ -3032,8 +2800,7 @@ Tkinter_setbusywaitinterval(PyObject *self, PyObject *args)
return NULL;
}
Tkinter_busywaitinterval = new_val;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
static char setbusywaitinterval_doc[] =
@@ -3166,27 +2933,6 @@ DisableEventHook(void)
}
-/* 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 +2948,111 @@ static struct PyModuleDef _tkintermodule = {
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);
+ o = PyErr_NewException("_tkinter.TclError", NULL, NULL);
+ if (o == NULL) {
+ Py_DECREF(m);
+ return NULL;
+ }
+ Py_INCREF(o);
+ if (PyModule_AddObject(m, "TclError", o)) {
+ Py_DECREF(o);
+ Py_DECREF(m);
+ return NULL;
+ }
+ Tkinter_TclError = o;
- 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);
+ 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;
+ }
- PyDict_SetItemString(d, "TkappType", (PyObject *)&Tkapp_Type);
+ 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;
- if (PyType_Ready(&Tktt_Type) < 0) {
+ 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;
}
- PyDict_SetItemString(d, "TkttType", (PyObject *)&Tktt_Type);
+ Tktt_Type = o;
- Py_TYPE(&PyTclObject_Type) = &PyType_Type;
- PyDict_SetItemString(d, "Tcl_Obj", (PyObject *)&PyTclObject_Type);
+ 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 0000000000..42dbeaee08
--- /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 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 88995b88a8..da589314ea 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 @@ weakref_proxy(PyObject *self, PyObject *args)
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 @@ PyInit__weakref(void)
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 c53d55a535..724a4789f4 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 @@ overlapped_dealloc(OverlappedObject *self)
{
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 @@ winapi_WriteFile(PyObject *self, PyObject *args, PyObject *kwds)
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 @@ winapi_WriteFile(PyObject *self, PyObject *args, PyObject *kwds)
}
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
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 3aba9adbeb..4a1c158514 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -513,7 +513,7 @@ newarrayobject(PyTypeObject *type, Py_ssize_t size, struct arraydescr *descr)
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 @@ array_count(arrayobject *self, PyObject *v)
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 @@ array_index(arrayobject *self, PyObject *v)
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 @@ array_contains(arrayobject *self, PyObject *v)
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 @@ array_remove(arrayobject *self, PyObject *v)
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 @@ array_pop(arrayobject *self, PyObject *args)
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 @@ Insert a new item x into the array before position i.");
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 @@ Byteswap all items of the array. If the items in the array are not 1, 2,\n\
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 @@ array_tolist(arrayobject *self, PyObject *unused)
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,
@@ -1664,11 +1698,8 @@ static const struct mformatdescr {
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 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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)
@@ -2613,9 +2658,19 @@ PyDoc_STRVAR(module_doc,
"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 @@ NOTE: The 'q' and 'Q' type codes are only available if the platform \n\
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 f68d8047ed..98870141dd 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 @@ typedef struct {
#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_callfuncs(void)
}
}
- 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 @@ Clear the list of previously registered exit functions.");
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 @@ atexit_free(PyObject *m)
{
atexitmodule_state *modstate;
modstate = GET_ATEXIT_STATE(m);
+ atexit_cleanup(modstate);
PyMem_Free(modstate->atexit_callbacks);
}
@@ -246,7 +281,7 @@ atexit_unregister(PyObject *self, PyObject *func)
if (eq < 0)
return NULL;
if (eq)
- atexit_delete_cb(self, i);
+ atexit_delete_cb(modstate, i);
}
Py_RETURN_NONE;
}
@@ -260,6 +295,8 @@ static PyMethodDef atexit_methods[] = {
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 @@ Two public functions, register and unregister, are defined.\n\
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 3f047623eb..2d287f249b 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 @@ fbound(double val, double minval, double maxval)
val = maxval;
else if (val < minval + 1)
val = minval;
- return val;
+ return (int)val;
}
@@ -161,9 +149,6 @@ st_14linear2ulaw(PyInt16 pcm_val) /* 2's complement (14-bit range) */
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 @@ st_linear2alaw(PyInt16 pcm_val) /* 2's complement (13-bit range) */
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,10 +287,82 @@ static int stepsizeTable[89] = {
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;
@@ -316,8 +370,8 @@ 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 @@ audioop_check_parameters(Py_ssize_t len, int size)
return 1;
}
+/*[clinic input]
+output preset file
+module audioop
+[clinic start generated code]*/
+/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5619f935f269199a]*/
+
+/*[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(PyObject *self, PyObject *args)
+audioop_getsample_impl(PyModuleDef *module, Py_buffer *fragment, int width, Py_ssize_t index)
+/*[clinic end generated code: output=f4482497e6f6e78f input=88edbe2871393549]*/
{
- signed char *cp;
- Py_ssize_t len, i;
- int size, val = 0;
+ int val;
- if ( !PyArg_ParseTuple(args, "s#in:getsample", &cp, &len, &size, &i) )
- return 0;
- if (!audioop_check_parameters(len, size))
+ 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 @@ audioop_max(PyObject *self, PyObject *args)
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))
- return NULL;
- 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 > max) max = val;
if (val < min) min = val;
}
return Py_BuildValue("(ii)", min, max);
}
+/*[clinic input]
+audioop.avg
+
+ fragment: Py_buffer
+ width: int
+ /
+
+Return the average over all samples in the fragment.
+[clinic start generated code]*/
+
static PyObject *
-audioop_avg(PyObject *self, PyObject *args)
+audioop_avg_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=7fccd645c95f4860 input=1114493c7611334d]*/
{
- signed char *cp;
- Py_ssize_t len, i;
- int size, val = 0;
- double avg = 0.0;
+ Py_ssize_t i;
+ int avg;
+ double sum = 0.0;
- if ( !PyArg_ParseTuple(args, "s#i:avg", &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);
- 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 @@ static double _sum2(short *a, short *b, Py_ssize_t len)
** 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 @@ audioop_findfit(PyObject *self, PyObject *args)
** 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 @@ audioop_findfactor(PyObject *self, PyObject *args)
** 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 @@ audioop_findmax(PyObject *self, PyObject *args)
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 @@ audioop_avgpp(PyObject *self, PyObject *args)
** 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 @@ audioop_avgpp(PyObject *self, PyObject *args)
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 @@ audioop_maxpp(PyObject *self, PyObject *args)
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 @@ audioop_add(PyObject *self, PyObject *args)
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);
+ 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;
+}
- j = len - i - size;
+/*[clinic input]
+audioop.byteswap
- 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;
+ fragment: Py_buffer
+ width: int
+ /
+
+Convert big-endian samples to little-endian and vice versa.
+[clinic start generated code]*/
+
+static PyObject *
+audioop_byteswap_impl(PyModuleDef *module, Py_buffer *fragment, int width)
+/*[clinic end generated code: output=bfe4aa584b7a3f5b input=fae7611ceffa5c82]*/
+{
+ unsigned char *ncp;
+ Py_ssize_t i;
+ PyObject *rv;
+
+ if (!audioop_check_parameters(fragment->len, width))
+ return NULL;
+
+ 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(PyObject *self, PyObject *args)
+audioop_lin2lin_impl(PyModuleDef *module, Py_buffer *fragment, int width, int newwidth)
+/*[clinic end generated code: output=3f9468a74472a93e input=5ce08c8aa2f24d96]*/
{
- signed char *cp;
unsigned char *ncp;
- Py_ssize_t len, i, j;
- int size, size2, val = 0;
+ Py_ssize_t i, j;
PyObject *rv;
- if ( !PyArg_ParseTuple(args, "s#ii:lin2lin",
- &cp, &len, &size, &size2) )
- return 0;
-
- if (!audioop_check_parameters(len, size))
+ if (!audioop_check_parameters(fragment->len, width))
return NULL;
- if (!audioop_check_size(size2))
+ if (!audioop_check_size(newwidth))
return NULL;
- if (len/size > PY_SSIZE_T_MAX/size2) {
+ 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 @@ gcd(int a, int b)
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 @@ audioop_ratecv(PyObject *self, PyObject *args)
"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 @@ audioop_ratecv(PyObject *self, PyObject *args)
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 @@ audioop_ratecv(PyObject *self, PyObject *args)
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 @@ audioop_ratecv(PyObject *self, PyObject *args)
goto exit;
}
ncp = PyBytes_AsString(str);
+ cp = fragment->buf;
for (;;) {
while (d < 0) {
@@ -1227,13 +1415,8 @@ audioop_ratecv(PyObject *self, PyObject *args)
}
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 @@ audioop_ratecv(PyObject *self, PyObject *args)
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 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
/* 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 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
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 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
/* 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 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
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 @@ audioop_adpcm2lin(PyObject *self, PyObject *args)
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 a84badc7c9..42d08de373 100644
--- a/Modules/binascii.c
+++ b/Modules/binascii.c
@@ -183,6 +183,27 @@ static unsigned short crctab_hqx[256] = {
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 @@ ascii_buffer_converter(PyObject *arg, Py_buffer *buf)
return Py_CLEANUP_SUPPORTED;
}
+#include "clinic/binascii.c.h"
+
+/*[clinic input]
+binascii.a2b_uu
-PyDoc_STRVAR(doc_a2b_uu, "(ascii) -> bin. Decode a line of uuencoded data");
+ 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 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
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 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
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 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
*/
if ( this_ch < ' ' || this_ch > (' ' + 64)) {
PyErr_SetString(Error, "Illegal char");
- PyBuffer_Release(&pascii);
Py_DECREF(rv);
return NULL;
}
@@ -298,21 +322,26 @@ binascii_a2b_uu(PyObject *self, PyObject *args)
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 @@ binascii_b2a_uu(PyObject *self, PyObject *args)
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 @@ binascii_b2a_uu(PyObject *self, PyObject *args)
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 @@ binascii_find_valid(unsigned char *s, Py_ssize_t slen, int num)
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 @@ binascii_a2b_base64(PyObject *self, PyObject *args)
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 @@ binascii_a2b_base64(PyObject *self, PyObject *args)
}
if (leftbits != 0) {
- PyBuffer_Release(&pascii);
PyErr_SetString(Error, "Incorrect padding");
Py_DECREF(rv);
return NULL;
@@ -491,24 +513,30 @@ binascii_a2b_base64(PyObject *self, PyObject *args)
*/
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 @@ binascii_b2a_base64(PyObject *self, PyObject *args)
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 @@ binascii_b2a_base64(PyObject *self, PyObject *args)
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 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
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 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
continue;
if ( this_ch == FAIL ) {
PyErr_SetString(Error, "Illegal char");
- PyBuffer_Release(&pascii);
Py_DECREF(rv);
return NULL;
}
@@ -635,55 +656,53 @@ binascii_a2b_hqx(PyObject *self, PyObject *args)
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 @@ binascii_rlecode_hqx(PyObject *self, PyObject *args)
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 @@ binascii_b2a_hqx(PyObject *self, PyObject *args)
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 @@ binascii_b2a_hqx(PyObject *self, PyObject *args)
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 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
if ( --in_len < 0 ) { \
PyErr_SetString(Incomplete, ""); \
Py_DECREF(rv); \
- PyBuffer_Release(&pin); \
return NULL; \
} \
b = *in_data++; \
@@ -834,7 +850,7 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
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 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
** 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 @@ binascii_rledecode_hqx(PyObject *self, PyObject *args)
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 @@ static unsigned int crc_32_tab[256] = {
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 @@ binascii_crc32(PyObject *self, PyObject *args)
}
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,9 @@ binascii_hexlify(PyObject *self, PyObject *args)
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()\".");
-
static int
to_int(int c)
@@ -1148,20 +1163,30 @@ to_int(int c)
}
+/*[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 +1195,13 @@ binascii_unhexlify(PyObject *self, PyObject *args)
* 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,21 +1214,13 @@ binascii_unhexlify(PyObject *self, PyObject *args)
}
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()\"");
-
static int table_hex[128] = {
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
-1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
@@ -1222,25 +1236,28 @@ static int table_hex[128] = {
#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 +1265,6 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
*/
odata = (unsigned char *) PyMem_Malloc(datalen);
if (odata == NULL) {
- PyBuffer_Release(&pdata);
PyErr_NoMemory();
return NULL;
}
@@ -1256,31 +1272,31 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
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 +1304,20 @@ binascii_a2b_qp(PyObject *self, PyObject *args, PyObject *kwargs)
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 +1333,62 @@ to_hex (unsigned char ch, unsigned char *s)
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 +1403,26 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
}
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 +1443,6 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
*/
odata = (unsigned char *) PyMem_Malloc(odatalen);
if (odata == NULL) {
- PyBuffer_Release(&pdata);
PyErr_NoMemory();
return NULL;
}
@@ -1437,17 +1450,17 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
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 +1469,16 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
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 +1491,14 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
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 +1506,20 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
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 +1527,24 @@ binascii_b2a_qp (PyObject *self, PyObject *args, PyObject *kwargs)
/* 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
+ {"unhexlify", (PyCFunction)binascii_a2b_hex, METH_VARARGS,
+ binascii_a2b_hex__doc__},
+ {"hexlify", (PyCFunction)binascii_b2a_hex, METH_VARARGS,
+ binascii_b2a_hex__doc__},
+ 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 9e9e96c4d1..013c3fb6b7 100644
--- a/Modules/cjkcodecs/_codecs_cn.c
+++ b/Modules/cjkcodecs/_codecs_cn.c
@@ -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_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_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(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 @@ DECODER(gb2312)
{
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 @@ DECODER(gb2312)
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;
+ else
+ return 1;
- OUT1((code >> 8) | 0x80)
+ OUTBYTE1((code >> 8) | 0x80);
if (code & 0x8000)
- OUT2((code & 0xFF)) /* MSB set: GBK */
+ OUTBYTE2((code & 0xFF)); /* MSB set: GBK */
else
- OUT2((code & 0xFF) | 0x80) /* MSB unset: GB2312 */
- NEXT(1, 2)
+ OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: GB2312 */
+ NEXT(1, 2);
}
return 0;
@@ -128,22 +151,22 @@ ENCODER(gbk)
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 @@ DECODER(gbk)
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 @@ ENCODER(gb18030)
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 @@ ENCODER(gb18030)
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_INIT(hz)
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_RESET(hz)
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 @@ DECODER(hz)
; /* line-continuation */
else
return 1;
- NEXT(2, 0);
+ NEXT_IN(2);
continue;
}
@@ -409,14 +428,14 @@ DECODER(hz)
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 d3ad04b6dd..b7a7ebd6e1 100644
--- a/Modules/cjkcodecs/_codecs_hk.c
+++ b/Modules/cjkcodecs/_codecs_hk.c
@@ -38,35 +38,39 @@ static const DBCHAR big5hkscs_pairenc_table[4] = {0x8862, 0x8864, 0x88a3, 0x88a5
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 @@ ENCODER(big5hkscs)
}
}
}
- 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 @@ ENCODER(big5hkscs)
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 @@ DECODER(big5hkscs)
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 codepoints are pairs, above. */
}
return 0;
diff --git a/Modules/cjkcodecs/_codecs_iso2022.c b/Modules/cjkcodecs/_codecs_iso2022.c
index cbc1542922..5c401aaf8e 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 @@ CODEC_INIT(iso2022)
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 @@ ENCODER(iso2022)
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 @@ ENCODER(iso2022)
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 @@ ENCODER(iso2022)
}
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 @@ ENCODER(iso2022)
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 @@ iso2022processesc(const void *config, MultibyteCodec_State *state,
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 @@ iso2022processesc(const void *config, MultibyteCodec_State *state,
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 @@ iso2022processesc(const void *config, MultibyteCodec_State *state,
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 @@ DECODER(iso2022)
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 @@ DECODER(iso2022)
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 @@ DECODER(iso2022)
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
+bypass:
+ OUTCHAR(c);
+ NEXT_IN(1);
+ break;
+ }
+
+ if (dsgcache != NULL &&
+ dsgcache->mark == charset)
+ dsg = dsgcache;
+ else {
+ for (dsg = CONFIG_DESIGNATIONS;
+ dsg->mark != charset
#ifdef Py_DEBUG
- && dsg->mark != '\0'
+ && 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)
+ ; dsg++)
+ {
+ /* noop */
+ }
+ assert(dsg->mark != '\0');
+ dsgcache = dsg;
}
- NEXT_IN(dsg->width)
+
+ 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 @@ ksx1001_init(void)
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 @@ jisx0208_init(void)
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 @@ jisx0212_init(void)
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 @@ jisx0213_init(void)
}
#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 @@ jisx0213_2000_2_decoder(const unsigned char *data)
}
#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 @@ jisx0213_2004_2_decoder(const unsigned char *data)
}
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 @@ jisx0213_encoder(const ucs4_t *data, Py_ssize_t *length, void *config)
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 @@ jisx0213_encoder(const ucs4_t *data, Py_ssize_t *length, void *config)
}
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 @@ jisx0213_2000_1_encoder(const ucs4_t *data, Py_ssize_t *length)
}
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 @@ jisx0213_2000_1_encoder_paironly(const ucs4_t *data, Py_ssize_t *length)
}
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 @@ jisx0213_2000_2_encoder(const ucs4_t *data, Py_ssize_t *length)
}
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 @@ jisx0213_2004_1_encoder(const ucs4_t *data, Py_ssize_t *length)
}
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 @@ jisx0213_2004_1_encoder_paironly(const ucs4_t *data, Py_ssize_t *length)
}
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 @@ jisx0213_2004_2_encoder(const ucs4_t *data, Py_ssize_t *length)
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 @@ gb2312_init(void)
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 @@ gb2312_encoder(const ucs4_t *data, Py_ssize_t *length)
}
-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 a500696e93..2c7788a645 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 @@ ENCODER(cp932)
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 @@ ENCODER(cp932)
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 @@ DECODER(cp932)
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 @@ DECODER(cp932)
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 @@ ENCODER(euc_jis_2004)
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 @@ ENCODER(euc_jis_2004)
}
}
}
- 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 @@ ENCODER(euc_jis_2004)
}
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 @@ ENCODER(euc_jis_2004)
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 @@ DECODER(euc_jis_2004)
/* 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 @@ DECODER(euc_jis_2004)
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 @@ DECODER(euc_jis_2004)
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 @@ ENCODER(euc_jp)
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 @@ ENCODER(euc_jp)
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 @@ DECODER(euc_jp)
/* 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 @@ DECODER(euc_jp)
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 @@ DECODER(euc_jp)
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 @@ DECODER(euc_jp)
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 @@ ENCODER(shift_jis)
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 @@ ENCODER(shift_jis)
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 @@ DECODER(shift_jis)
#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 @@ DECODER(shift_jis)
else
return 1;
- NEXT(1, 1) /* JIS X 0201 */
+ NEXT_IN(1); /* JIS X 0201 */
}
return 0;
@@ -540,30 +563,29 @@ DECODER(shift_jis)
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 @@ ENCODER(shift_jis_2004)
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 @@ ENCODER(shift_jis_2004)
}
}
}
- 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 @@ ENCODER(shift_jis_2004)
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 @@ ENCODER(shift_jis_2004)
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 @@ DECODER(shift_jis_2004)
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 f5697dd2f6..1ad41a7851 100644
--- a/Modules/cjkcodecs/_codecs_kr.c
+++ b/Modules/cjkcodecs/_codecs_kr.c
@@ -33,51 +33,56 @@ static const unsigned char u2cgk_jongseong[28] = {
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
* 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 @@ static const unsigned char cgk2u_jongseong[] = { /* [A1, BE] */
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 @@ DECODER(euc_kr)
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 @@ DECODER(euc_kr)
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;
+
+ REQUIRE_OUTBUF(2);
+ if (TRYMAP_ENC(cp949, code, c))
+ ;
+ else
+ return 1;
- OUT1((code >> 8) | 0x80)
+ OUTBYTE1((code >> 8) | 0x80);
if (code & 0x8000)
- OUT2(code & 0xFF) /* MSB set: CP949 */
+ OUTBYTE2(code & 0xFF); /* MSB set: CP949 */
else
- OUT2((code & 0xFF) | 0x80) /* MSB unset: ks x 1001 */
- NEXT(1, 2)
+ OUTBYTE2((code & 0xFF) | 0x80); /* MSB unset: ks x 1001 */
+ NEXT(1, 2);
}
return 0;
@@ -195,22 +204,24 @@ ENCODER(cp949)
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 @@ static const DBCHAR u2johabjamo[] = {
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 @@ ENCODER(johab)
}
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 @@ ENCODER(johab)
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 @@ ENCODER(johab)
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 @@ static const unsigned char johabjamo_jongseong[32] = {
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 @@ DECODER(johab)
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 @@ DECODER(johab)
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 916298d167..722b26b128 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);
+
+ if (TRYMAP_ENC(big5, code, c))
+ ;
+ else
+ return 1;
- OUT1(code >> 8)
- OUT2(code & 0xFF)
- NEXT(1, 2)
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xFF);
+ NEXT(1, 2);
}
return 0;
@@ -41,19 +45,19 @@ ENCODER(big5)
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 @@ DECODER(big5)
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;
+
+ REQUIRE_OUTBUF(2);
+ if (TRYMAP_ENC(cp950ext, code, c))
+ ;
+ else if (TRYMAP_ENC(big5, code, c))
+ ;
+ else
+ return 1;
- OUT1(code >> 8)
- OUT2(code & 0xFF)
- NEXT(1, 2)
+ OUTBYTE1(code >> 8);
+ OUTBYTE2(code & 0xFF);
+ NEXT(1, 2);
}
return 0;
@@ -95,23 +104,25 @@ ENCODER(cp950)
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 0bc7db5399..3034b5ab9d 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 ab0682a9fa..25bab41cf3 100644
--- a/Modules/cjkcodecs/cjkcodecs.h
+++ b/Modules/cjkcodecs/cjkcodecs.h
@@ -33,7 +33,7 @@ struct dbcs_index {
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 dbcs_map {
};
struct pair_encodemap {
- ucs4_t uniseq;
+ Py_UCS4 uniseq;
DBCHAR code;
};
@@ -72,7 +72,8 @@ static const struct dbcs_map *mapping_list;
#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 const struct dbcs_map *mapping_list;
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;
-
-#define IN1 ((*inbuf)[0])
-#define IN2 ((*inbuf)[1])
-#define IN3 ((*inbuf)[2])
-#define IN4 ((*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 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);
-
-#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
+ do { \
+ if (outleft < (n)) \
+ return MBERR_TOOSMALL; \
+ } while (0)
+
+#define INBYTE1 ((*inbuf)[0])
+#define INBYTE2 ((*inbuf)[1])
+#define INBYTE3 ((*inbuf)[2])
+#define INBYTE4 ((*inbuf)[3])
+
+#define INCHAR1 (PyUnicode_READ(kind, data, *inpos))
+#define INCHAR2 (PyUnicode_READ(kind, data, *inpos + 1))
+
+#define OUTCHAR(c) \
+ do { \
+ if (_PyUnicodeWriter_WriteChar(writer, (c)) < 0) \
+ return MBERR_EXCEPTION; \
+ } while (0)
+
+#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 @@ find_pairencmap(ucs2_t body, ucs2_t modifier,
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 @@ importmap(const char *modname, const char *symbol,
{
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 4227fb29dc..a5d5a7063d 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(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; \
+ }
-#define EMULATE_JISX0213_2000_DECODE_PLANE2(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 a6dcebfe4a..1f8c299d24 100644
--- a/Modules/cjkcodecs/mappings_cn.h
+++ b/Modules/cjkcodecs/mappings_cn.h
@@ -4049,7 +4049,7 @@ __gb18030ext_encmap+3126,0,100},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0
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 eda8e9e819..729e4bcbe6 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 c032cdb0ed..087ae9b1af 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 *incrementalkwarglist[] = {"input", "final", NULL};
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 @@ expand_encodebuffer(MultibyteEncodeBuffer *buf, Py_ssize_t esize)
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 @@ multibytecodec_encerror(MultibyteCodec *codec,
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 @@ multibytecodec_encerror(MultibyteCodec *codec,
}
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 @@ multibytecodec_encerror(MultibyteCodec *codec,
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 @@ multibytecodec_encerror(MultibyteCodec *codec,
}
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 @@ multibytecodec_encerror(MultibyteCodec *codec,
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 @@ multibytecodec_decerror(MultibyteCodec *codec,
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 @@ multibytecodec_decerror(MultibyteCodec *codec,
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 @@ multibytecodec_decerror(MultibyteCodec *codec,
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 @@ multibytecodec_decerror(MultibyteCodec *codec,
}
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 @@ multibytecodec_decerror(MultibyteCodec *codec,
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 @@ errorexit:
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 @@ multibytecodec_encode(MultibyteCodec *codec,
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 @@ multibytecodec_encode(MultibyteCodec *codec,
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 @@ MultibyteCodec_Encode(MultibyteCodecObject *self,
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 @@ MultibyteCodec_Encode(MultibyteCodecObject *self,
}
}
- 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 @@ MultibyteCodec_Encode(MultibyteCodecObject *self,
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_Decode(MultibyteCodecObject *self,
{
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 @@ MultibyteCodec_Decode(MultibyteCodecObject *self,
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 @@ MultibyteCodec_Decode(MultibyteCodecObject *self,
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 @@ encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
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 @@ encoder_encode_stateful(MultibyteStatefulEncoderContext *ctx,
}
}
- 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 @@ decoder_prepare_buffer(MultibyteDecodeBuffer *buf, const char *data,
{
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 @@ decoder_feed_buffer(MultibyteStatefulDecoderContext *ctx,
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 @@ mbiencoder_reset(MultibyteIncrementalEncoderObject *self)
if (r != 0)
return NULL;
}
- self->pendingsize = 0;
+ Py_CLEAR(self->pending);
Py_RETURN_NONE;
}
@@ -963,7 +937,7 @@ mbiencoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
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 @@ mbidecoder_decode(MultibyteIncrementalDecoderObject *self,
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 @@ mbidecoder_decode(MultibyteIncrementalDecoderObject *self,
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 @@ mbidecoder_decode(MultibyteIncrementalDecoderObject *self,
}
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 @@ mbidecoder_decode(MultibyteIncrementalDecoderObject *self,
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 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
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 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
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 @@ mbstreamreader_iread(MultibyteStreamReaderObject *self,
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 @@ mbstreamwriter_iwrite(MultibyteStreamWriterObject *self,
PyObject *unistr)
{
PyObject *str, *wr;
- _Py_IDENTIFIER(write);
str = encoder_encode_stateful(STATEFUL_ECTX(self), unistr, 0);
if (str == NULL)
@@ -1649,25 +1624,22 @@ mbstreamwriter_writelines(MultibyteStreamWriterObject *self, PyObject *lines)
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 @@ mbstreamwriter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 1b6ef55855..5b8c22276b 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 @@ typedef union {
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 (*mbencodereset_func)(MultibyteCodec_State *state,
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 @@ typedef struct {
#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 @@ typedef struct {
#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 0000000000..8a201a08de
--- /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 0000000000..c1ad8824af
--- /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 0000000000..a20a61e6f5
--- /dev/null
+++ b/Modules/clinic/_pickle.c.h
@@ -0,0 +1,491 @@
+/*[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___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___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=f965b6c7018c898d input=a9049054013a1b77]*/
diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h
new file mode 100644
index 0000000000..40ef5e2dc4
--- /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 0000000000..5247180a41
--- /dev/null
+++ b/Modules/clinic/binascii.c.h
@@ -0,0 +1,478 @@
+/*[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_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_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=68e2bcc6956b6213 input=a9049054013a1b77]*/
diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h
new file mode 100644
index 0000000000..f54a805377
--- /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 36bf4a1e3d..91b369a2f5 100644
--- a/Modules/cmathmodule.c
+++ b/Modules/cmathmodule.c
@@ -1060,7 +1060,7 @@ static PyObject *
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 f35aa36ba8..0ac0317b8e 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 44772e21dd..9a8f85dd25 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 b9cd7a4513..fd6bf7a3d1 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 680f630ebd..fff960fa96 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 @@ typedef struct {
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,13 +135,11 @@ static PyObject*
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;
@@ -448,7 +450,7 @@ faulthandler_thread(void *unused)
/* 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 +478,7 @@ cancel_dump_traceback_later(void)
Py_CLEAR(thread.file);
if (thread.header) {
- free(thread.header);
+ PyMem_Free(thread.header);
thread.header = NULL;
}
}
@@ -505,7 +507,7 @@ format_timeout(double timeout)
"Timeout (%lu:%02lu:%02lu)!\n",
hour, min, sec);
- return strdup(buffer);
+ return _PyMem_Strdup(buffer);
}
static PyObject*
@@ -571,7 +573,7 @@ faulthandler_dump_traceback_later(PyObject *self,
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 +732,10 @@ faulthandler_register_py(PyObject *self,
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];
@@ -1047,9 +1050,11 @@ static int
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 +1142,7 @@ void _PyFaulthandler_Fini(void)
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 6769098203..cf0ac19976 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -208,11 +208,7 @@ fcntl_ioctl(PyObject *self, PyObject *args)
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 @@ fcntl_lockf(PyObject *self, PyObject *args)
&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 @@ fcntl_lockf(PyObject *self, PyObject *args)
}
Py_INCREF(Py_None);
return Py_None;
-#endif /* defined(PYOS_OS2) && defined(PYCC_GCC) */
}
PyDoc_STRVAR(lockf_doc,
@@ -432,188 +422,179 @@ a file or socket object.");
/* 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);
-#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_GWROPT)) return -1;
+#endif
+ 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 @@ static struct PyModuleDef fcntlmodule = {
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 @@ PyInit_fcntl(void)
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 6af2f82f70..052b83480d 100644
--- a/Modules/fpectlmodule.c
+++ b/Modules/fpectlmodule.c
@@ -70,10 +70,6 @@ extern "C" {
#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 @@ static void fpe_reset(Sigfunc *handler)
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 @@ static PyObject *turnoff_sigfpe(PyObject *self,PyObject *args)
#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 c66dd38126..6281a7c343 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -168,6 +168,18 @@ static Py_ssize_t long_lived_pending = 0;
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 @@ GC_TENTATIVELY_UNREACHABLE
#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 @@ update_refs(PyGC_Head *containers)
{
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 @@ update_refs(PyGC_Head *containers)
* 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 @@ visit_decref(PyObject *op, void *data)
* 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 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
{
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 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
* 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 @@ visit_reachable(PyObject *op, PyGC_Head *reachable)
* 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 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
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 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
*/
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 @@ move_unreachable(PyGC_Head *young, PyGC_Head *unreachable)
*/
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 @@ untrack_dicts(PyGC_Head *head)
}
}
-/* 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 @@ move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers)
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 @@ visit_move(PyObject *op, PyGC_Head *tolist)
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 @@ visit_move(PyObject *op, PyGC_Head *tolist)
* 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 @@ debug_cycle(char *msg, PyObject *op)
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 @@ debug_cycle(char *msg, PyObject *op)
* 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 @@ handle_finalizers(PyGC_Head *finalizers, PyGC_Head *old)
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,62 @@ handle_finalizers(PyGC_Head *finalizers, PyGC_Head *old)
return 0;
}
+static void
+finalize_garbage(PyGC_Head *collectable, PyGC_Head *old)
+{
+ destructor finalize;
+ PyGC_Head *gc = collectable->gc.gc_next;
+
+ for (; gc != collectable; gc = gc->gc.gc_next) {
+ PyObject *op = FROM_GC(gc);
+
+ 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);
+ if (Py_REFCNT(op) == 1) {
+ /* op will be destroyed */
+ gc = gc->gc.gc_prev;
+ }
+ Py_DECREF(op);
+ }
+ }
+}
+
+/* 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 +845,6 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)
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 +858,7 @@ delete_garbage(PyGC_Head *collectable, PyGC_Head *old)
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 +905,8 @@ get_time(void)
/* 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 +917,7 @@ collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable)
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 +981,15 @@ collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable)
}
/* 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 +1005,20 @@ collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable)
/* 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, old);
+
+ 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 +1049,7 @@ collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable)
* 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 +1058,25 @@ collect(int generation, Py_ssize_t *n_collected, Py_ssize_t *n_uncollectable)
}
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 +1125,7 @@ collect_with_callback(int generation)
{
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 +1423,52 @@ gc_get_objects(PyObject *self, PyObject *noargs)
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 +1498,7 @@ PyDoc_STRVAR(gc__doc__,
"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 +1520,7 @@ static PyMethodDef GcMethods[] = {
{"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 +1608,29 @@ PyGC_Collect(void)
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 +1641,12 @@ _PyGC_Fini(void)
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 +1655,7 @@ _PyGC_Fini(void)
PyErr_WriteUnraisable(garbage);
else {
PySys_WriteStderr(
- " %s\n",
+ " %s\n",
PyBytes_AS_STRING(bytes)
);
}
@@ -1510,7 +1663,13 @@ _PyGC_Fini(void)
Py_XDECREF(bytes);
}
}
+}
+
+void
+_PyGC_Fini(void)
+{
Py_CLEAR(callbacks);
+ Py_CLEAR(tmod);
}
/* for debugging */
@@ -1555,7 +1714,8 @@ _PyObject_GC_Malloc(size_t basicsize)
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 +1742,15 @@ _PyObject_GC_New(PyTypeObject *tp)
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 ff14fdd6cd..c057737ec2 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 prefix[MAXPATHLEN+1];
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 @@ find_env_config_value(FILE * env_file, const wchar_t * key, wchar_t * value)
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 @@ search_for_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_prefix)
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 @@ search_for_prefix(wchar_t *argv0_path, wchar_t *home, wchar_t *_prefix)
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 @@ calculate_path(void)
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 @@ calculate_path(void)
}
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 @@ calculate_path(void)
/* 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 @@ calculate_path(void)
}
}
- 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 @@ calculate_path(void)
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 @@ calculate_path(void)
*/
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 @@ calculate_path(void)
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);
+ }
+ else
+ buf[0] = '\0';
- /* Next goes merge of compile-time $PYTHONPATH with
- * dynamically located prefix.
- */
- defpath = _pythonpath;
- while (1) {
- wchar_t *delim = wcschr(defpath, DELIM);
+ /* Next is the default zip path */
+ wcscat(buf, zip_path);
+ wcscat(buf, delimiter);
- if (defpath[0] != SEP) {
- wcscat(buf, prefix);
- wcscat(buf, separator);
- }
+ /* Next goes merge of compile-time $PYTHONPATH with
+ * dynamically located prefix.
+ */
+ defpath = _pythonpath;
+ while (1) {
+ wchar_t *delim = wcschr(defpath, DELIM);
- 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;
+ if (defpath[0] != SEP) {
+ wcscat(buf, prefix);
+ wcscat(buf, separator);
}
- 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;
+ 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 @@ calculate_path(void)
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 @@ void
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 042cf0554a..c8a93723ea 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -58,17 +58,12 @@ mkgrent(struct group *p)
#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
@@ -210,9 +205,14 @@ PyInit_grp(void)
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 459914605f..51c68f6aa7 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 0000000000..221ed53b9f
--- /dev/null
+++ b/Modules/hashtable.c
@@ -0,0 +1,518 @@
+/* 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=%zu/%zu (%.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=%zu, %zu 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 0000000000..539e490c31
--- /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 0123181612..db7cdfeefe 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -401,7 +401,7 @@ static PyTypeObject _grouper_type = {
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 {
typedef struct {
PyObject_HEAD
teedataobject *dataobj;
- int index;
+ int index; /* 0 <= index <= LINKCELLS */
PyObject *weakreflist;
} teeobject;
@@ -2057,6 +2057,18 @@ product_dealloc(productobject *lz)
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)
{
@@ -2226,6 +2238,8 @@ static PyMethodDef product_methods[] = {
reduce_doc},
{"__setstate__", (PyCFunction)product_setstate, METH_O,
setstate_doc},
+ {"__sizeof__", (PyCFunction)product_sizeof, METH_NOARGS,
+ sizeof_doc},
{NULL, NULL} /* sentinel */
};
@@ -2366,6 +2380,16 @@ combinations_dealloc(combinationsobject *co)
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)
{
@@ -2537,6 +2561,8 @@ static PyMethodDef combinations_methods[] = {
reduce_doc},
{"__setstate__", (PyCFunction)combinations_setstate, METH_O,
setstate_doc},
+ {"__sizeof__", (PyCFunction)combinations_sizeof, METH_NOARGS,
+ sizeof_doc},
{NULL, NULL} /* sentinel */
};
@@ -2695,6 +2721,16 @@ cwr_dealloc(cwrobject *co)
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)
{
@@ -2854,6 +2890,8 @@ static PyMethodDef cwr_methods[] = {
reduce_doc},
{"__setstate__", (PyCFunction)cwr_setstate, METH_O,
setstate_doc},
+ {"__sizeof__", (PyCFunction)cwr_sizeof, METH_NOARGS,
+ sizeof_doc},
{NULL, NULL} /* sentinel */
};
@@ -3030,6 +3068,17 @@ permutations_dealloc(permutationsobject *po)
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)
{
@@ -3235,6 +3284,8 @@ static PyMethodDef permuations_methods[] = {
reduce_doc},
{"__setstate__", (PyCFunction)permutations_setstate, METH_O,
setstate_doc},
+ {"__sizeof__", (PyCFunction)permutations_sizeof, METH_NOARGS,
+ sizeof_doc},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/main.c b/Modules/main.c
index 3cfc9c3bd4..87a21d7c30 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 wchar_t **orig_argv;
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 @@ Options and arguments (and corresponding environment variables):\n\
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 @@ usage(int exitcode, wchar_t* program)
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 RunStartupFile(PyCompilerFlags *cf)
}
}
+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 @@ static int RunModule(wchar_t *modname, int set_argv0)
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 @@ static int RunModule(wchar_t *modname, int set_argv0)
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 @@ RunMainFromImporter(wchar_t *filename)
/* 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 @@ Py_Main(int argc, wchar_t **argv)
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_Main(int argc, wchar_t **argv)
Py_InteractiveFlag++;
break;
+ case 'I':
+ Py_IsolatedFlag++;
+ Py_NoUserSiteDirectory++;
+ Py_IgnoreEnvironmentFlag++;
+ break;
+
/* case 'J': reserved for Jython */
case 'O':
@@ -475,7 +493,7 @@ Py_Main(int argc, wchar_t **argv)
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 @@ Py_Main(int argc, wchar_t **argv)
*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 @@ Py_Main(int argc, wchar_t **argv)
warning = wcstok(NULL, L",")) {
PySys_AddWarnOption(warning);
}
- free(buf);
+ PyMem_RawFree(buf);
}
#else
if ((p = Py_GETENV("PYTHONWARNINGS")) && *p != '\0') {
@@ -514,12 +532,12 @@ Py_Main(int argc, wchar_t **argv)
/* 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_Main(int argc, wchar_t **argv)
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 @@ Py_Main(int argc, wchar_t **argv)
#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 @@ Py_Main(int argc, wchar_t **argv)
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 @@ Py_Main(int argc, wchar_t **argv)
if (command) {
sts = run_command(command, &cf);
- free(command);
+ PyMem_RawFree(command);
} else if (module) {
sts = (RunModule(module, 1) != 0);
}
@@ -691,6 +697,7 @@ Py_Main(int argc, wchar_t **argv)
if (filename == NULL && stdin_is_interactive) {
Py_InspectFlag = 0; /* do exit on SystemExit */
RunStartupFile(&cf);
+ RunInteractiveHook();
}
/* XXX */
@@ -756,6 +763,7 @@ Py_Main(int argc, wchar_t **argv)
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/md5module.c b/Modules/md5module.c
index 12e187cb94..5cb3d36c9b 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -91,10 +91,6 @@ typedef struct {
(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 @@ md5_process(struct md5_state *md5, const unsigned char *in, Py_ssize_t inlen)
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 @@ MD5_get_block_size(PyObject *self, void *closure)
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 @@ static struct PyModuleDef _md5module = {
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 1107eb8f6e..07b5c6bcd1 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 @@ typedef struct {
int fd;
#endif
+ PyObject *weakreflist;
access_mode access;
} mmap_object;
@@ -134,6 +136,8 @@ mmap_object_dealloc(mmap_object *m_obj)
}
#endif /* UNIX */
+ if (m_obj->weakreflist != NULL)
+ PyObject_ClearWeakRefs((PyObject *) m_obj);
Py_TYPE(m_obj)->tp_free((PyObject*)m_obj);
}
@@ -1032,7 +1036,7 @@ static PyTypeObject mmap_object_type = {
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 +1158,6 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
(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 +1188,7 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
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 +1202,18 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
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 +1393,7 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
/* 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 817e20428c..be90016347 100644
--- a/Modules/ossaudiodev.c
+++ b/Modules/ossaudiodev.c
@@ -115,7 +115,9 @@ newossobject(PyObject *arg)
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 @@ newossmixerobject(PyObject *arg)
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 @@ _do_ioctl_1(int fd, PyObject *args, char *fname, int cmd)
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 @@ _do_ioctl_1_internal(int fd, PyObject *args, char *fname, int cmd)
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 @@ _do_ioctl_0(int fd, PyObject *args, char *fname, int cmd)
int rv;
assert(strlen(fname) <= 30);
- strcat(argfmt, fname);
+ strncat(argfmt, fname, 30);
if (!PyArg_ParseTuple(args, argfmt))
return NULL;
diff --git a/Modules/overlapped.c b/Modules/overlapped.c
new file mode 100644
index 0000000000..6842efbb30
--- /dev/null
+++ b/Modules/overlapped.c
@@ -0,0 +1,1380 @@
+/*
+ * 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;
+
+typedef struct {
+ OVERLAPPED *Overlapped;
+ HANDLE IocpHandle;
+ char Address[1];
+} WaitNamedPipeAndConnectContext;
+
+/*
+ * 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;
+}
+
+/*
+ * 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);
+ Py_RETURN_NONE;
+ 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);
+ Py_RETURN_NONE;
+ 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_NONE;
+ case ERROR_SUCCESS:
+ case ERROR_IO_PENDING:
+ Py_RETURN_NONE;
+ default:
+ self->type = TYPE_NOT_STARTED;
+ return SetFromWindowsErr(err);
+ }
+}
+
+/* Unfortunately there is no way to do an overlapped connect to a
+ pipe. We instead use WaitNamedPipe() and CreateFile() in a thread
+ pool thread. If a connection succeeds within a time limit (10
+ seconds) then PostQueuedCompletionStatus() is used to return the
+ pipe handle to the completion port. */
+
+static DWORD WINAPI
+WaitNamedPipeAndConnectInThread(WaitNamedPipeAndConnectContext *ctx)
+{
+ HANDLE PipeHandle = INVALID_HANDLE_VALUE;
+ DWORD Start = GetTickCount();
+ DWORD Deadline = Start + 10*1000;
+ DWORD Error = 0;
+ DWORD Timeout;
+ BOOL Success;
+
+ for ( ; ; ) {
+ Timeout = Deadline - GetTickCount();
+ if ((int)Timeout < 0)
+ break;
+ Success = WaitNamedPipe(ctx->Address, Timeout);
+ Error = Success ? ERROR_SUCCESS : GetLastError();
+ switch (Error) {
+ case ERROR_SUCCESS:
+ PipeHandle = CreateFile(ctx->Address,
+ GENERIC_READ | GENERIC_WRITE,
+ 0, NULL, OPEN_EXISTING,
+ FILE_FLAG_OVERLAPPED, NULL);
+ if (PipeHandle == INVALID_HANDLE_VALUE)
+ continue;
+ break;
+ case ERROR_SEM_TIMEOUT:
+ continue;
+ }
+ break;
+ }
+ if (!PostQueuedCompletionStatus(ctx->IocpHandle, Error,
+ (ULONG_PTR)PipeHandle, ctx->Overlapped))
+ CloseHandle(PipeHandle);
+ free(ctx);
+ return 0;
+}
+
+PyDoc_STRVAR(
+ Overlapped_WaitNamedPipeAndConnect_doc,
+ "WaitNamedPipeAndConnect(addr, iocp_handle) -> Overlapped[pipe_handle]\n\n"
+ "Start overlapped connection to address, notifying iocp_handle when\n"
+ "finished");
+
+static PyObject *
+Overlapped_WaitNamedPipeAndConnect(OverlappedObject *self, PyObject *args)
+{
+ char *Address;
+ Py_ssize_t AddressLength;
+ HANDLE IocpHandle;
+ OVERLAPPED Overlapped;
+ BOOL ret;
+ DWORD err;
+ WaitNamedPipeAndConnectContext *ctx;
+ Py_ssize_t ContextLength;
+
+ if (!PyArg_ParseTuple(args, "s#" F_HANDLE F_POINTER,
+ &Address, &AddressLength, &IocpHandle, &Overlapped))
+ return NULL;
+
+ if (self->type != TYPE_NONE) {
+ PyErr_SetString(PyExc_ValueError, "operation already attempted");
+ return NULL;
+ }
+
+ ContextLength = (AddressLength +
+ offsetof(WaitNamedPipeAndConnectContext, Address));
+ ctx = calloc(1, ContextLength + 1);
+ if (ctx == NULL)
+ return PyErr_NoMemory();
+ memcpy(ctx->Address, Address, AddressLength + 1);
+ ctx->Overlapped = &self->overlapped;
+ ctx->IocpHandle = IocpHandle;
+
+ self->type = TYPE_WAIT_NAMED_PIPE_AND_CONNECT;
+ self->handle = NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ ret = QueueUserWorkItem(WaitNamedPipeAndConnectInThread, ctx,
+ WT_EXECUTELONGFUNCTION);
+ Py_END_ALLOW_THREADS
+
+ mark_as_completed(&self->overlapped);
+
+ self->error = err = ret ? ERROR_SUCCESS : GetLastError();
+ if (!ret)
+ return SetFromWindowsErr(err);
+ Py_RETURN_NONE;
+}
+
+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},
+ {"WaitNamedPipeAndConnect",
+ (PyCFunction) Overlapped_WaitNamedPipeAndConnect,
+ METH_VARARGS, Overlapped_WaitNamedPipeAndConnect_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},
+ {"CreateEvent", overlapped_CreateEvent,
+ METH_VARARGS, CreateEvent_doc},
+ {"SetEvent", overlapped_SetEvent,
+ METH_VARARGS, SetEvent_doc},
+ {"ResetEvent", overlapped_ResetEvent,
+ METH_VARARGS, ResetEvent_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, 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 e598046074..36e9893da8 100644
--- a/Modules/parsermodule.c
+++ b/Modules/parsermodule.c
@@ -83,54 +83,78 @@ node2tuple(node *n, /* node to convert */
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);
+ }
+
+ if (col_offset == 1) {
+ w = PyLong_FromLong(n->n_col_offset);
+ if (w == NULL)
+ goto error;
+ (void) addelem(result, 3, w);
}
- return (result);
}
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 @@ parser_st2list(PyST_Object *self, PyObject *args, PyObject *kw)
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);
-
- 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);
- }
- }
-
- return (res);
+ ok = PyArg_ParseTupleAndKeywords(args, kw, "|O&:compile", &keywords[1],
+ PyUnicode_FSDecoder, &filename);
+ if (!ok)
+ goto error;
+
+ if (filename == NULL) {
+ filename = PyUnicode_FromString("<syntax-tree>");
+ if (filename == NULL)
+ goto error;
+ }
+
+ 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 @@ build_node_children(PyObject *tuple, node *root, int *line_num)
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 @@ build_node_tree(PyObject *tuple)
* 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 @@ build_node_tree(PyObject *tuple)
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 767a6653c4..dc9bd555b8 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 @@ disguised Unix interface). Refer to the library manual and\n\
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
@@ -132,6 +110,18 @@ corresponding Unix manual entries for more information on calls.");
#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 @@ corresponding Unix manual entries for more information on calls.");
/* 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 @@ corresponding Unix manual entries for more information on calls.");
#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 @@ corresponding Unix manual entries for more information on calls.");
#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 @@ static int win32_can_symlink = 0;
#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 @@ static int win32_can_symlink = 0;
#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 @@ static int win32_can_symlink = 0;
#endif
#endif
+#define DWORD_MAX 4294967295U
+
#ifdef MS_WINDOWS
static int
@@ -436,108 +411,213 @@ _PyLong_FromGid(gid_t gid)
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 */
@@ -560,25 +640,29 @@ static int
_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 +710,7 @@ dir_fd_converter(PyObject *o, void *p)
* 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 +762,8 @@ dir_fd_converter(PyObject *o, void *p)
* 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 +774,9 @@ typedef struct {
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 +824,14 @@ path_converter(PyObject *o, void *p) {
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 +889,7 @@ path_converter(PyObject *o, void *p) {
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 +1190,6 @@ convertenviron(void)
#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 +1258,6 @@ convertenviron(void)
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 +1268,6 @@ posix_error(void)
{
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 +1286,13 @@ win32_error(char* function, const char* filename)
}
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 +1301,30 @@ win32_error_object(char* function, PyObject* filename)
#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 +1348,31 @@ posix_fildes(PyObject *fdobj, int (*func)(int))
}
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 +1381,18 @@ win32_1str(PyObject* args, char* func,
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 +1406,24 @@ win32_chdir(LPCSTR path)
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 +1434,7 @@ win32_wchdir(LPCWSTR path)
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 +1449,13 @@ win32_wchdir(LPCWSTR path)
#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 +1514,8 @@ attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, stru
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 +1523,9 @@ attribute_data_to_stat(BY_HANDLE_FILE_INFORMATION *info, ULONG reparse_tag, stru
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 +1578,7 @@ attributes_from_dir_w(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *
}
/* 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 +1589,7 @@ check_GetFinalPathNameByHandle()
DWORD);
/* only recheck */
- if (!has_GetFinalPathNameByHandle)
+ if (-1 == has_GetFinalPathNameByHandle)
{
hKernel32 = GetModuleHandleW(L"KERNEL32");
*(FARPROC*)&Py_GetFinalPathNameByHandleA = GetProcAddress(hKernel32,
@@ -1687,7 +1615,7 @@ get_target_path(HANDLE hdl, wchar_t **target_path)
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 +1625,12 @@ get_target_path(HANDLE hdl, wchar_t **target_path)
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 +1721,7 @@ win32_xstat_impl(const char *path, struct win32_stat *result,
return -1;
code = win32_xstat_impl_w(target_path, result, FALSE);
- free(target_path);
+ PyMem_Free(target_path);
return code;
}
} else
@@ -1889,7 +1817,7 @@ win32_xstat_impl_w(const wchar_t *path, struct win32_stat *result,
return -1;
code = win32_xstat_impl_w(target_path, result, FALSE);
- free(target_path);
+ PyMem_Free(target_path);
return code;
}
} else
@@ -2288,7 +2216,9 @@ _pystat_fromstructstat(STRUCT_STAT *st)
#else
PyStructSequence_SET_ITEM(v, 1, PyLong_FromLong((long)st->st_ino));
#endif
-#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS)
+#ifdef MS_WINDOWS
+ PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev));
+#elif defined(HAVE_LONG_LONG)
PyStructSequence_SET_ITEM(v, 2,
PyLong_FromLongLong((PY_LONG_LONG)st->st_dev));
#else
@@ -2423,53 +2353,158 @@ posix_do_stat(char *function_name, path_t *path,
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 *
+os_stat_impl(PyModuleDef *module, path_t *path, int dir_fd, int follow_symlinks);
static PyObject *
-posix_stat(PyObject *self, PyObject *args, PyObject *kwargs)
+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 +2520,7 @@ posix_lstat(PyObject *self, PyObject *args, PyObject *kwargs)
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 +2530,122 @@ posix_lstat(PyObject *self, PyObject *args, PyObject *kwargs)
#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.");
-static PyObject *
-posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
+#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 *
+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 +2654,6 @@ posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
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 +2666,10 @@ posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
#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 +2681,7 @@ posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
* (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 +2697,11 @@ posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
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 +2709,6 @@ posix_access(PyObject *self, PyObject *args, PyObject *kwargs)
#ifndef HAVE_FACCESSAT
exit:
#endif
- path_cleanup(&path);
return return_value;
}
@@ -2623,35 +2725,68 @@ exit:
#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;
- char *ret;
+ PyObject *return_value = NULL;
+ int fd;
+ char *_return_value;
- if (!PyArg_ParseTuple(args, "i:ttyname", &id))
- return NULL;
+ 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);
-#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
+exit:
+ return return_value;
+}
+
+static char *
+os_ttyname_impl(PyModuleDef *module, int fd)
+/*[clinic end generated code: output=cee7bc4cffec01a2 input=5f72ca83e76b3b45]*/
+{
+ char *ret;
+
+ 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 +2828,7 @@ posix_chdir(PyObject *self, PyObject *args, PyObject *kwargs)
static char *keywords[] = {"path", NULL};
memset(&path, 0, sizeof(path));
+ path.function_name = "chdir";
#ifdef HAVE_FCHDIR
path.allow_fd = 1;
#endif
@@ -2708,8 +2844,6 @@ posix_chdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +2855,7 @@ posix_chdir(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_error("chdir", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -2785,6 +2919,7 @@ posix_chmod(PyObject *self, PyObject *args, PyObject *kwargs)
#endif
memset(&path, 0, sizeof(path));
+ path.function_name = "chmod";
#ifdef HAVE_FCHMOD
path.allow_fd = 1;
#endif
@@ -2810,7 +2945,7 @@ posix_chmod(PyObject *self, PyObject *args, PyObject *kwargs)
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 +2960,7 @@ posix_chmod(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3014,7 @@ posix_chmod(PyObject *self, PyObject *args, PyObject *kwargs)
}
else
#endif
- return_value = path_error("chmod", &path);
+ return_value = path_error(&path);
goto exit;
}
#endif
@@ -2923,20 +3058,23 @@ Equivalent to chmod(path, mode, follow_symlinks=False).");
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 +3102,7 @@ posix_chflags(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3123,7 @@ posix_chflags(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_posix_error("chflags", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -3007,22 +3146,24 @@ Equivalent to chflags(path, flags, follow_symlinks=False).");
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 +3175,7 @@ Change root directory to path.");
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 +3257,7 @@ posix_chown(PyObject *self, PyObject *args, PyObject *kwargs)
"follow_symlinks", NULL};
memset(&path, 0, sizeof(path));
+ path.function_name = "chown";
#ifdef HAVE_FCHOWN
path.allow_fd = 1;
#endif
@@ -3173,7 +3315,7 @@ posix_chown(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_posix_error("chown", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -3222,30 +3364,32 @@ Equivalent to os.chown(path, uid, gid, follow_symlinks=False).");
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 +3403,12 @@ posix_getcwd(int use_bytes)
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 +3418,13 @@ posix_getcwd(int use_bytes)
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 +3433,7 @@ posix_getcwd(int use_bytes)
#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 +3461,6 @@ posix_getcwd_bytes(PyObject *self)
{
return posix_getcwd(1);
}
-#endif
#if ((!defined(HAVE_LINK)) && defined(MS_WINDOWS))
#define HAVE_LINK 1
@@ -3358,6 +3499,8 @@ posix_link(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3531,7 @@ posix_link(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3549,7 @@ posix_link(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_error("link", &dst);
+ return_value = path_error2(&src, &dst);
goto exit;
}
#endif
@@ -3436,72 +3579,35 @@ On some platforms, path may also be specified as an open file descriptor;\n\
the file descriptor must refer to a directory.\n\
If this functionality is unavailable, using it raises NotImplementedError.");
+#if defined(MS_WINDOWS) && !defined(HAVE_OPENDIR)
static PyObject *
-posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
+_listdir_windows_no_opendir(path_t *path, PyObject *list)
{
- 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)
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 +3615,8 @@ posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3630,7 @@ posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3659,19 @@ posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3686,7 @@ posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3714,7 @@ posix_listdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +3724,35 @@ exit:
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, "*.*");
-
- 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);
- }
+#else /* thus POSIX, ie: not (MS_WINDOWS and not HAVE_OPENDIR) */
-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 +3764,10 @@ exit:
#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 +3780,14 @@ exit:
}
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 +3803,7 @@ exit:
break;
} else {
Py_DECREF(list);
- list = path_error("listdir", &path);
+ list = path_error(path);
goto exit;
}
}
@@ -3785,17 +3833,44 @@ exit:
#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 +3878,14 @@ static PyObject *
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 +3897,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
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 +3907,7 @@ posix__getfullpathname(PyObject *self, PyObject *args)
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 +3977,7 @@ posix__getfinalpathname(PyObject *self, PyObject *args)
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 +3991,11 @@ posix__getfinalpathname(PyObject *self, PyObject *args)
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 +4034,55 @@ check:
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 +4107,7 @@ posix_mkdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +4127,7 @@ posix_mkdir(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (!result) {
- return_value = win32_error_object("mkdir", path.object);
+ return_value = path_error(&path);
goto exit;
}
#else
@@ -4044,7 +4144,7 @@ posix_mkdir(PyObject *self, PyObject *args, PyObject *kwargs)
#endif
Py_END_ALLOW_THREADS
if (result < 0) {
- return_value = path_error("mkdir", &path);
+ return_value = path_error(&path);
goto exit;
}
#endif
@@ -4162,6 +4262,8 @@ internal_rename(PyObject *args, PyObject *kwargs, int is_replace)
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 +4297,7 @@ internal_rename(PyObject *args, PyObject *kwargs, int is_replace)
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 +4312,7 @@ internal_rename(PyObject *args, PyObject *kwargs, int is_replace)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_error(function_name, &dst);
+ return_value = path_error2(&src, &dst);
goto exit;
}
#endif
@@ -4274,6 +4376,7 @@ posix_rmdir(PyObject *self, PyObject *args, PyObject *kwargs)
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 +4405,7 @@ posix_rmdir(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_error("rmdir", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -4430,6 +4533,7 @@ posix_unlink(PyObject *self, PyObject *args, PyObject *kwargs)
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 +4562,7 @@ posix_unlink(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_error("unlink", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -4761,6 +4865,7 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
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 +4901,9 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
}
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 +4961,13 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
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 +4978,7 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
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 +5061,10 @@ int fsconvert_strdup(PyObject *o, char**out)
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 +5092,10 @@ parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
}
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 +5116,6 @@ parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
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 +5131,6 @@ parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
envlist[envc++] = p;
Py_DECREF(key2);
Py_DECREF(val2);
-#if defined(PYOS_OS2)
- }
-#endif
}
Py_DECREF(vals);
Py_DECREF(keys);
@@ -5159,6 +5256,7 @@ posix_execve(PyObject *self, PyObject *args, PyObject *kwargs)
like posix.environ. */
memset(&path, 0, sizeof(path));
+ path.function_name = "execve";
#ifdef HAVE_FEXECVE
path.allow_fd = 1;
#endif
@@ -5198,7 +5296,7 @@ posix_execve(PyObject *self, PyObject *args, PyObject *kwargs)
/* 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 +5372,12 @@ posix_spawnv(PyObject *self, PyObject *args)
}
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 +5385,7 @@ posix_spawnv(PyObject *self, PyObject *args)
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 +5461,17 @@ posix_spawnve(PyObject *self, PyObject *args)
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 +5483,6 @@ posix_spawnve(PyObject *self, PyObject *args)
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 +5985,7 @@ Open a pseudo-terminal, returning open fd's for both master and slave end.\n");
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 +5998,56 @@ posix_openpty(PyObject *self, PyObject *noargs)
#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 +6059,16 @@ posix_openpty(PyObject *self, PyObject *noargs)
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 +6561,8 @@ posix_kill(PyObject *self, PyObject *args)
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 +6600,17 @@ static PyObject *
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 +6620,7 @@ win32_kill(PyObject *self, PyObject *args)
/* 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 +7026,7 @@ posix_waitpid(PyObject *self, PyObject *args)
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 +7035,7 @@ posix_waitpid(PyObject *self, PyObject *args)
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 +7086,7 @@ posix_readlink(PyObject *self, PyObject *args, PyObject *kwargs)
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 +7107,7 @@ posix_readlink(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (length < 0) {
- return_value = path_posix_error("readlink", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -7226,8 +7143,9 @@ dir_fd may not be implemented on your platform.\n\
/* 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 +7159,57 @@ check_CreateSymbolicLink()
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 +7218,19 @@ void _joinW(WCHAR *dest_path, const WCHAR *root, const WCHAR *rest) {
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 +7240,15 @@ void _joinA(char *dest_path, const char *root, const char *rest) {
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 +7264,19 @@ int _check_dirW(WCHAR *src, WCHAR *dest)
);
}
-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 +7302,10 @@ posix_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
#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 +7358,7 @@ posix_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (!result) {
- return_value = win32_error_object("symlink", src.object);
+ return_value = path_error2(&src, &dst);
goto exit;
}
@@ -7448,7 +7374,7 @@ posix_symlink(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_error("symlink", &dst);
+ return_value = path_error2(&src, &dst);
goto exit;
}
#endif
@@ -7610,31 +7536,7 @@ Return an object containing floating point numbers indicating process\n\
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 +7558,7 @@ posix_times(PyObject *self, PyObject *noargs)
(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 +7678,10 @@ posix_tcsetpgrp(PyObject *self, PyObject *args)
/* 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 +7701,14 @@ posix_open(PyObject *self, PyObject *args, PyObject *kwargs)
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 +7720,12 @@ posix_open(PyObject *self, PyObject *args, PyObject *kwargs)
))
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,15 +7741,16 @@ posix_open(PyObject *self, PyObject *args, PyObject *kwargs)
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);
@@ -7893,13 +7812,14 @@ static PyObject *
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 +7829,82 @@ PyDoc_STRVAR(posix_dup2__doc__,
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 +7948,7 @@ static PyObject *
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 +7976,7 @@ posix_lseek(PyObject *self, PyObject *args)
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 +8188,7 @@ posix_write(PyObject *self, PyObject *args)
}
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 +8225,13 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict)
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 +8355,12 @@ posix_fstat(PyObject *self, PyObject *args)
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 +8393,69 @@ Create a pipe.");
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);
+#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 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 */
+ 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 */
@@ -8741,6 +8758,7 @@ posix_truncate(PyObject *self, PyObject *args, PyObject *kwargs)
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 +8776,7 @@ posix_truncate(PyObject *self, PyObject *args, PyObject *kwargs)
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;
@@ -9181,6 +9199,10 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) {
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 +9252,7 @@ posix_statvfs(PyObject *self, PyObject *args, PyObject *kwargs)
struct statvfs st;
memset(&path, 0, sizeof(path));
+ path.function_name = "statvfs";
#ifdef HAVE_FSTATVFS
path.allow_fd = 1;
#endif
@@ -9256,7 +9279,7 @@ posix_statvfs(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS
if (result) {
- return_value = path_posix_error("statvfs", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -9493,6 +9516,7 @@ posix_pathconf(PyObject *self, PyObject *args, PyObject *kwargs)
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 +9537,7 @@ posix_pathconf(PyObject *self, PyObject *args, PyObject *kwargs)
/* 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 +9719,7 @@ posix_confstr(PyObject *self, PyObject *args)
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 +9736,7 @@ posix_confstr(PyObject *self, PyObject *args)
}
}
- if ((unsigned int)len >= sizeof(buffer)) {
+ if (len >= sizeof(buffer)) {
char *buf = PyMem_Malloc(len);
if (buf == NULL)
return PyErr_NoMemory();
@@ -10242,7 +10266,7 @@ posix_sysconf(PyObject *self, PyObject *args)
int name;
if (PyArg_ParseTuple(args, "O&:sysconf", conv_sysconf_confname, &name)) {
- int value;
+ long value;
errno = 0;
value = sysconf(name);
@@ -10572,6 +10596,8 @@ posix_getxattr(PyObject *self, PyObject *args, PyObject *kwargs)
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 +10614,7 @@ posix_getxattr(PyObject *self, PyObject *args, PyObject *kwargs)
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 +10636,7 @@ posix_getxattr(PyObject *self, PyObject *args, PyObject *kwargs)
buffer = NULL;
if (errno == ERANGE)
continue;
- path_error("getxattr", &path);
+ path_error(&path);
goto exit;
}
@@ -10649,6 +10675,7 @@ posix_setxattr(PyObject *self, PyObject *args, PyObject *kwargs)
"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 +10703,7 @@ posix_setxattr(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS;
if (result) {
- return_value = path_error("setxattr", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -10710,7 +10737,9 @@ posix_removexattr(PyObject *self, PyObject *args, PyObject *kwargs)
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 +10761,7 @@ posix_removexattr(PyObject *self, PyObject *args, PyObject *kwargs)
Py_END_ALLOW_THREADS;
if (result) {
- return_value = path_error("removexattr", &path);
+ return_value = path_error(&path);
goto exit;
}
@@ -10768,6 +10797,7 @@ posix_listxattr(PyObject *self, PyObject *args, PyObject *kwargs)
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 +10816,7 @@ posix_listxattr(PyObject *self, PyObject *args, PyObject *kwargs)
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 +10840,7 @@ posix_listxattr(PyObject *self, PyObject *args, PyObject *kwargs)
buffer = NULL;
continue;
}
- path_error("listxattr", &path);
+ path_error(&path);
break;
}
@@ -10988,14 +11018,154 @@ get_terminal_size(PyObject *self, PyObject *args)
}
#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 +11203,10 @@ static PyMethodDef posix_methods[] = {
#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 +11249,6 @@ static PyMethodDef posix_methods[] = {
{"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 +11283,6 @@ static PyMethodDef posix_methods[] = {
#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 +11430,8 @@ static PyMethodDef posix_methods[] = {
{"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
@@ -11400,9 +11562,9 @@ static PyMethodDef posix_methods[] = {
#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 +11600,20 @@ static PyMethodDef posix_methods[] = {
#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 +11644,410 @@ enable_symlink()
#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 +12056,6 @@ all_ins(PyObject *d)
#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 +12243,23 @@ INITFUNC(void)
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 +12272,15 @@ INITFUNC(void)
#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 +12298,13 @@ INITFUNC(void)
#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 +12382,6 @@ INITFUNC(void)
initialized = 1;
return m;
-
}
#ifdef __cplusplus
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 285fd9c984..ebb8712018 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -69,18 +69,10 @@ mkpwent(struct passwd *p)
#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 @@ pwd_getpwall(PyObject *self)
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 @@ PyInit_pwd(void)
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 45680ae962..a71ecc530e 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -10,6 +10,9 @@
#define FIX_TRACE
+static XML_Memory_Handling_Suite ExpatMemoryHandler = {
+ PyObject_Malloc, PyObject_Realloc, PyObject_Free};
+
enum HandlerTypes {
StartElement,
EndElement,
@@ -403,6 +406,10 @@ static void
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 +444,9 @@ my_StartElementHandler(void *userData,
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
@@ -520,6 +530,8 @@ my_##NAME##Handler PARAMS {\
INIT \
\
if (have_handler(self, NAME)) { \
+ if (PyErr_Occurred()) \
+ return RETURN; \
if (flush_character_buffer(self) < 0) \
return RETURN; \
args = Py_BuildValue PARAM_FORMAT ;\
@@ -634,6 +646,9 @@ my_ElementDeclHandler(void *userData,
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));
@@ -819,7 +834,8 @@ xmlparse_Parse(xmlparseobject *self, PyObject *args)
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)
@@ -1001,7 +1017,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
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 +1034,7 @@ xmlparse_ExternalEntityParserCreate(xmlparseobject *self, PyObject *args)
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 +1142,19 @@ PyUnknownEncodingHandler(void *encodingHandlerData,
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 +1200,26 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
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 +1227,7 @@ newxmlparseobject(char *encoding, char *namespace_separator, PyObject *intern)
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 +1254,11 @@ xmlparse_dealloc(xmlparseobject *self)
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 +1458,7 @@ xmlparse_setattro(xmlparseobject *self, PyObject *name, PyObject *v)
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 +1469,7 @@ xmlparse_setattro(xmlparseobject *self, PyObject *name, PyObject *v)
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 +1531,9 @@ xmlparse_setattro(xmlparseobject *self, PyObject *name, PyObject *v)
}
}
/* 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 f781d9a525..9811c01d49 100644
--- a/Modules/python.c
+++ b/Modules/python.c
@@ -23,9 +23,12 @@ main(int argc, char **argv)
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 @@ main(int argc, char **argv)
* 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 @@ main(int argc, char **argv)
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 8fac526be3..4bba0db80b 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 @@ on_completion_display_matches_hook(char **matches,
(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 @@ parse_and_bind(PyObject *self, PyObject *args)
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 @@ set_hook(const char *funcname, PyObject **hook_var, PyObject *args)
/* 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 @@ once each time matches need to be displayed.");
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 @@ before readline prints the first prompt.");
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 @@ characters.");
/* 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 @@ Get the type of completion being attempted.");
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 @@ get the beginning index of the readline tab-completion scope");
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 @@ get the readline word delimiters for tab-completion");
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 @@ It should return the next possible completion starting with 'text'.");
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 @@ on_hook(PyObject *func)
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 @@ on_hook(PyObject *func)
PyErr_Clear();
Py_XDECREF(r);
done:
-#ifdef WITH_THREAD
- PyGILState_Release(gilstate);
-#endif
return result;
}
return result;
@@ -779,7 +821,15 @@ on_startup_hook(void)
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(void)
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 @@ on_completion_display_matches_hook(char **matches,
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 @@ static char *
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 @@ on_completion(const char *text, int state)
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 @@ setup_readline(void)
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,8 @@ setup_readline(void)
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);
/* Initialize (allows .inputrc to override)
*
* XXX: A bug in the readline-2.2 library causes a memory leak
@@ -988,7 +1050,7 @@ rlhandler(char *text)
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 +1125,7 @@ onintr(int sig)
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 +1152,7 @@ readline_until_enter_or_signal(char *prompt, int *signal)
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 +1183,7 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
/* 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 +1211,7 @@ call_readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
/* 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 +1237,12 @@ static struct PyModuleDef readlinemodule = {
PyModuleDef_HEAD_INIT,
"readline",
doc_module,
- -1,
+ sizeof(readlinestate),
readline_methods,
NULL,
- NULL,
- NULL,
- NULL
+ readline_traverse,
+ readline_clear,
+ readline_free
};
@@ -1188,6 +1250,7 @@ PyMODINIT_FUNC
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 +1267,8 @@ PyInit_readline(void)
if (m == NULL)
return NULL;
+ mod_state = (readlinestate *) PyModule_GetState(m);
PyOS_ReadlineFunctionPointer = call_readline;
- setup_readline();
+ setup_readline(mod_state);
return m;
}
diff --git a/Modules/resource.c b/Modules/resource.c
index b294a8cfe1..3a1cf094c7 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -106,6 +106,44 @@ resource_getrusage(PyObject *self, PyObject *args)
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 @@ resource_getrlimit(PyObject *self, PyObject *args)
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 @@ resource_setrlimit(PyObject *self, PyObject *args)
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())
- goto error;
- rl.rlim_max = PyLong_AsLong(maxobj);
- if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred())
+ if (py2rlimit(curobj, maxobj, &rl) < 0) {
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 @@ resource_setrlimit(PyObject *self, PyObject *args)
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 @@ static struct PyMethodDef
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 @@ PyInit_resource(void)
/* 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 952a0919d4..ffaf865df2 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -47,19 +47,11 @@ extern void bzero(void *, int);
#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 @@ select_select(PyObject *self, PyObject *args)
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 @@ select_select(PyObject *self, PyObject *args)
#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 @@ select_select(PyObject *self, PyObject *args)
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 @@ typedef struct {
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 @@ internal_devpoll_register(devpollObject *self, PyObject *args, int remove)
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 @@ devpoll_unregister(devpollObject *self, PyObject *o)
{
int fd;
+ if (self->fd_devpoll < 0)
+ return devpoll_err_closed();
+
fd = PyObject_AsFileDescriptor( o );
if (fd == -1)
return NULL;
@@ -838,6 +848,9 @@ devpoll_poll(devpollObject *self, PyObject *args)
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 @@ devpoll_poll(devpollObject *self, PyObject *args)
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 @@ static PyMethodDef devpoll_methods[] = {
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 @@ newDevPollObject(void)
*/
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 @@ newDevPollObject(void)
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 @@ static PyTypeObject devpoll_Type = {
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 PyTypeObject pyEpoll_Type;
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 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
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 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
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 @@ pyepoll_internal_ctl(int epfd, int op, PyObject *pfd, unsigned int events)
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 @@ pyepoll_internal_ctl(int epfd, int op, PyObject *pfd, unsigned int events)
}
Py_END_ALLOW_THREADS
break;
- default:
+ default:
result = -1;
errno = EINVAL;
}
@@ -1378,7 +1462,9 @@ pyepoll_poll(pyEpoll_Object *self, PyObject *args, PyObject *kwds)
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 @@ pyepoll_poll(pyEpoll_Object *self, PyObject *args, PyObject *kwds)
evs = PyMem_New(struct epoll_event, maxevents);
if (evs == NULL) {
- Py_DECREF(self);
PyErr_NoMemory();
return NULL;
}
@@ -1432,6 +1517,24 @@ Wait for events on the epoll file descriptor for a maximum time of timeout\n\
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 @@ static PyMethodDef pyepoll_methods[] = {
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 @@ static PyTypeObject kqueue_queue_Type;
* 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 @@ kqueue_event_init(kqueue_event_Object *self, PyObject *args, PyObject *kwds)
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 @@ kqueue_event_richcompare(kqueue_event_Object *s, kqueue_event_Object *o,
}
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 PyTypeObject kqueue_event_Type = {
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 @@ newKqueue_Object(PyTypeObject *type, SOCKET fd)
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 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
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 @@ arguments; each contains the subset of the corresponding file descriptors\n\
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 @@ PyDoc_STRVAR(module_doc,
"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 @@ PyInit_select(void)
#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 @@ PyInit_select(void)
#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 @@ PyInit_select(void)
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 d0f318d3fd..b44fe189d2 100644
--- a/Modules/sha1module.c
+++ b/Modules/sha1module.c
@@ -92,10 +92,6 @@ typedef struct {
(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 @@ sha1_process(struct sha1_state *sha1,
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 @@ SHA1_get_block_size(PyObject *self, void *closure)
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 @@ static struct PyModuleDef _sha1module = {
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 9f6b41639c..b05bfc172f 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 @@ typedef struct {
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 @@ typedef struct {
/* 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 @@ static void longReverse(SHA_INT32 *buffer, int byteCount, int Endianness)
*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_transform(SHAobject *sha_info)
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 @@ sha_transform(SHAobject *sha_info)
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 @@ sha_init(SHAobject *sha_info)
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 @@ sha_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count)
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_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count)
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 @@ static PyObject *
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 @@ static struct PyModuleDef _sha256module = {
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 5536fd5c1c..47c57e5c42 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 @@ typedef struct {
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 @@ typedef struct {
/* 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 @@ static void longReverse(SHA_INT64 *buffer, int byteCount, int Endianness)
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 @@ sha512_transform(SHAobject *sha_info)
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 @@ sha512_transform(SHAobject *sha_info)
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 @@ sha512_init(SHAobject *sha_info)
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 @@ sha512_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count)
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_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count)
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 @@ static PyObject *
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 @@ static struct PyModuleDef _sha512module = {
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 704c9f591b..fedaddff35 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 @@ checksignals_witharg(void * unused)
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 @@ signal_handler(int sig_num)
{
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 @@ signal_handler(int sig_num)
* 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 @@ signal_sigtimedwait(PyObject *self, PyObject *args)
&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 @@ PyInit_signal(void)
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 32b4eba2f2..a1e5da8bc0 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -15,7 +15,7 @@ Limitations:
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,
@@ -95,18 +95,16 @@ Local naming conventions:
#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 @@ bind(addr) -- bind the socket to a local address\n\
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_indextoname(index) -- return the corresponding interface name\n\
#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 @@ if_indextoname(index) -- return the corresponding interface name\n\
# 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 @@ if_indextoname(index) -- return the corresponding interface name\n\
# 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 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#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 @@ dup_socket(SOCKET handle)
#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 @@ dup_socket(SOCKET handle)
#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 @@ dup_socket(SOCKET handle)
#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 @@ select_error(void)
(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 @@ set_error(void)
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 @@ set_gaierror(int error)
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 @@ internal_setblocking(PySocketSockObject *s, int block)
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 @@ setipaddr(char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int af)
{
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 @@ setipaddr(char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int af)
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 @@ setipaddr(char *name, struct sockaddr *addr_ret, size_t addr_ret_size, int af)
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
@@ -1329,11 +1268,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
}
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);
@@ -1658,6 +1593,8 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
case AF_CAN:
switch (s->sock_proto) {
case CAN_RAW:
+ /* fall-through */
+ case CAN_BCM:
{
struct sockaddr_can *addr;
PyObject *interfaceName;
@@ -1948,8 +1885,22 @@ cmsg_min_space(struct msghdr *msg, struct cmsghdr *cmsgh, size_t space)
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 @@ sock_accept(PySocketSockObject *s)
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 @@ sock_accept(PySocketSockObject *s)
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 @@ sock_accept(PySocketSockObject *s)
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 @@ sock_getsockopt(PySocketSockObject *s, PyObject *args)
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 @@ sock_detach(PySocketSockObject *s)
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 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
{
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 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
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 @@ sock_recv_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags)
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 @@ sock_recvfrom_guts(PySocketSockObject *s, char* cbuf, Py_ssize_t len, int flags,
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 @@ sock_send(PySocketSockObject *s, PyObject *args)
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 @@ sock_sendall(PySocketSockObject *s, PyObject *args)
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 @@ sock_sendto(PySocketSockObject *s, PyObject *args)
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) {
@@ -3952,6 +3906,12 @@ sock_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
/* 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 +3921,13 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwds)
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 +3972,74 @@ sock_initobj(PyObject *self, PyObject *args, PyObject *kwds)
}
}
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 +4605,36 @@ socket_dup(PyObject *self, PyObject *fdobj)
{
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 +4662,12 @@ socket_socketpair(PyObject *self, PyObject *args)
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 +4677,38 @@ socket_socketpair(PyObject *self, PyObject *args)
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 +4730,7 @@ finally:
}
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 +4864,6 @@ binary format used in low-level network functions.");
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 +4905,7 @@ socket_inet_aton(PyObject *self, PyObject *args)
/* 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 +4953,7 @@ socket_inet_ntoa(PyObject *self, PyObject *args)
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 +4961,10 @@ PyDoc_STRVAR(inet_pton_doc,
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 +4972,7 @@ socket_inet_pton(PyObject *self, PyObject *args)
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 +5009,52 @@ socket_inet_pton(PyObject *self, PyObject *args)
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 +5063,7 @@ socket_inet_ntop(PyObject *self, PyObject *args)
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 +5108,70 @@ socket_inet_ntop(PyObject *self, PyObject *args)
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 +5193,7 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
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 +5238,9 @@ socket_getaddrinfo(PyObject *self, PyObject *args, PyObject* kwargs)
#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
@@ -5451,7 +5638,7 @@ static PyMethodDef socket_methods[] = {
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 +5713,6 @@ os_init(void)
#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 +5769,16 @@ PyInit__socket(void)
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 +5832,187 @@ PyInit__socket(void)
/* 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 +6044,463 @@ PyInit__socket(void)
#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_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, 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_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 +6511,353 @@ PyInit__socket(void)
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 +6877,14 @@ PyInit__socket(void)
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 0435878721..b83f9af3bd 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 @@ typedef int socklen_t;
#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 194ae196ba..68ea1b5ea4 100644
--- a/Modules/spwdmodule.c
+++ b/Modules/spwdmodule.c
@@ -26,22 +26,24 @@ You have to be root to be able to use this module.");
#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 @@ static PyObject *mkspent(struct spwd *p)
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 @@ PyInit_spwd(void)
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 0a8f0cfe3d..621e2d88d5 100644
--- a/Modules/sre.h
+++ b/Modules/sre.h
@@ -31,9 +31,7 @@ typedef struct {
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 @@ typedef struct {
/* 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;
@@ -89,6 +86,7 @@ typedef struct {
SRE_REPEAT *repeat;
/* hooks */
SRE_TOLOWER_HOOK lower;
+ int match_all;
} SRE_STATE;
typedef struct {
diff --git a/Modules/sre_constants.h b/Modules/sre_constants.h
index 13c89583e7..5940d5a50f 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 0000000000..df86697690
--- /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);
+
+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);
+ 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)
+{
+ 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 = state->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->match_all || 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 &&
+ (!ctx->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);
+ 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);
+ 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);
+ 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);
+ 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 37df82d8b0..cdb4ffcbd8 100644
--- a/Modules/symtablemodule.c
+++ b/Modules/symtablemodule.c
@@ -11,12 +11,12 @@ symtable_symtable(PyObject *self, PyObject *args)
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 @@ symtable_symtable(PyObject *self, PyObject *args)
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 @@ PyInit__symtable(void)
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 fc3f37595b..f2d44ff5e6 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -277,44 +277,44 @@ PyInit_syslog(void)
/* 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 @@ PyInit_syslog(void)
#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 42ec3662e8..d0917a4073 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 @@ time_clock_settime(PyObject *self, PyObject *args)
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 @@ parse_time_t_args(PyObject *args, char *format, time_t *pwhen)
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 @@ checktm(struct tm* buf)
/* 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 @@ time_strftime(PyObject *self, PyObject *args)
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 @@ time_strftime(PyObject *self, PyObject *args)
#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 @@ PyDoc_STRVAR(strptime_doc,
"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_mktime(PyObject *self, PyObject *tup)
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 @@ time_tzset(PyObject *self, PyObject *unused)
/* 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 @@ PyInit_timezone(PyObject *m) {
#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_time(void)
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 @@ floatsleep(double secs)
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 @@ floatsleep(double secs)
}
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 f4d3608750..3253db21f1 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -17,6 +17,12 @@
#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 +113,63 @@ static Py_UCS4 getuchar(PyUnicodeObject *obj)
/* --- 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)
+{
+ 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]*/
{
- PyUnicodeObject *v;
- PyObject *defobj = NULL;
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 +189,14 @@ unicodedata_decimal(PyObject *self, PyObject *args)
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);
@@ -1250,7 +1294,7 @@ unicodedata_lookup(PyObject* self, PyObject* args)
/* 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 +1371,6 @@ this database is based on the UnicodeData.txt file version\n\
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 5d5dca80af..ec11fa1da4 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 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{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 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{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 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{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 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{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 @@ const _PyUnicode_DatabaseRecord _PyUnicode_Database_Records[] = {
{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 @@ const char *_PyUnicode_BidirectionalNames[] = {
"S",
"WS",
"ON",
+ "LRI",
+ "RLI",
+ "FSI",
+ "PDI",
NULL
};
const char *_PyUnicode_EastAsianWidthNames[] = {
@@ -1273,35 +1281,35 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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,
+ 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, 170, 170, 170, 170, 170, 170,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 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, 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, 48, 48, 0, 48, 48, 48, 48, 0, 0, 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, 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, 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, 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, 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, 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, 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 @@ static unsigned short index2[] = {
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
26, 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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 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 @@ static unsigned short index2[] = {
170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
170, 170, 170, 170, 170, 170, 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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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,498 +2068,496 @@ static unsigned short index2[] = {
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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 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, 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, 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,
+ 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,
- 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,
+ 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, 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,
+ 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 48, 48, 48, 48, 48, 48, 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,
+ 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, 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,
+ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 44, 44, 44, 44, 44, 44,
+ 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, 44, 44, 44, 44, 44, 44, 44, 47, 47, 47,
+ 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, 47, 47, 47, 47, 47, 47,
- 47, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+ 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, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 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, 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, 107, 107, 107, 107,
- 107, 107, 0, 0, 107, 0, 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, 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, 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, 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,
- 316, 316, 316, 316, 316, 316, 0, 0, 0, 138, 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, 107, 107, 107, 107, 107, 0, 0, 0, 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 0,
+ 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,
- 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,
+ 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,
- 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, 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, 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, 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, 316, 316, 104, 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, 107, 107, 0, 0, 0, 138, 138, 138, 138, 138, 138, 138, 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, 107, 107, 107, 107, 0, 0, 316, 316, 316, 316, 316, 316, 316, 316,
+ 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, 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,
+ 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, 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,
+ 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,
- 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, 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, 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,
+ 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, 135, 135, 139, 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, 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, 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, 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, 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, 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, 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, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
48, 48, 48, 48, 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,
+ 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, 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,
+ 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, 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, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0,
+ 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, 48, 48, 48, 48, 48, 48,
+ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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,
+ 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, 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,
+ 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, 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, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 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,
+ 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, 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, 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,
- 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,
+ 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, 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,
+ 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,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 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,
- 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,
+ 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, 26, 26, 26, 26, 26, 26, 26, 26, 26, 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 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, 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, 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, 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, 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, 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, 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,
@@ -2561,76 +2567,76 @@ static unsigned short index2[] = {
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 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, 0, 0,
- 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, 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, 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, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 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, 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,
- 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
- 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
- 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 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, 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, 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, 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, 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 @@ static unsigned short index2[] = {
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 @@ static const change_record change_records_3_2_0[] = {
{ 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 @@ static const change_record change_records_3_2_0[] = {
{ 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 const change_record change_records_3_2_0[] = {
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 @@ static unsigned char changes_3_2_0_index[] = {
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 @@ static unsigned char changes_3_2_0_index[] = {
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 @@ static unsigned char changes_3_2_0_index[] = {
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 @@ static unsigned char changes_3_2_0_index[] = {
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 @@ static unsigned char changes_3_2_0_data[] = {
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,59 +5793,54 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 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,
- 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, 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, 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, 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, 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, 9, 9, 9, 0, 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, 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, 9, 9, 9, 9, 9, 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, 9, 9, 9, 9, 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, 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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, 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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, 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, 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,
+ 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, 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, 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
@@ -5849,119 +5850,124 @@ static unsigned char changes_3_2_0_data[] = {
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 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, 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, 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 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, 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, 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, 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,
+ 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,
- 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,
+ 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, 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, 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, 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,
+ 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, 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,
+ 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, 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, 9, 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 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, 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, 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, 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, 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, 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,
- 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, 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,
@@ -5970,82 +5976,82 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 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,
+ 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, 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, 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, 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, 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,
- 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, 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, 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, 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, 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, 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, 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, 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 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,
+ 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, 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, 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, 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, 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, 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, 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, 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, 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,
@@ -6055,35 +6061,35 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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,
- 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, 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, 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, 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, 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, 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, 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, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 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, 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,
@@ -6091,102 +6097,102 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 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,
+ 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, 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, 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, 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, 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, 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,
+ 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, 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, 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,
+ 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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,
+ 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, 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,
- 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 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, 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, 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,
- 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 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,
+ 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, 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, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 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, 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, 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, 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,
@@ -6194,302 +6200,302 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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,
+ 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,
- 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, 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
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,
+ 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, 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, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 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,
+ 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 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,
+ 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, 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,
+ 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, 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,
+ 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, 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,
+ 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, 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, 0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0,
+ 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, 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,
+ 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 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, 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, 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,
+ 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, 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, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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,
+ 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, 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, 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,
+ 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, 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 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, 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,
- 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, 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, 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, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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, 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, 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,
+ 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, 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, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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,
+ 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, 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, 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, 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,
- 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 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,
+ 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, 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,
+ 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, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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,
+ 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, 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, 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, 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, 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, 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,
+ 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, 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, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 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,
+ 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, 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, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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,
+ 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, 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, 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, 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, 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, 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, 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,
@@ -6497,25 +6503,25 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 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, 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, 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, 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, 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,
@@ -6524,24 +6530,24 @@ static unsigned char changes_3_2_0_data[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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,
+ 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, 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, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 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 38388822b9..7ccb1261f5 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 @@ static unsigned char lexicon[] = {
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 @@ static unsigned char lexicon[] = {
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 @@ static unsigned char lexicon[] = {
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 @@ static unsigned char lexicon[] = {
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 @@ static unsigned char lexicon[] = {
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 @@ static unsigned char lexicon[] = {
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 @@ static unsigned int lexicon_offset[] = {
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 @@ static unsigned int lexicon_offset[] = {
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 @@ static unsigned int lexicon_offset[] = {
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 @@ static unsigned int lexicon_offset[] = {
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 @@ static unsigned char phrasebook[] = {
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 @@ static unsigned char phrasebook[] = {
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 @@ static unsigned int phrasebook_offset2[] = {
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, 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,
- 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,
+ 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, 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, 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,
+ 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 110710, 110715, 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,
- 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, 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, 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,
+ 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,
+ 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, 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,
0, 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,
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, 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, 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, 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 @@ static unsigned int phrasebook_offset2[] = {
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, 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,
- 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, 0, 0, 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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
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 @@ static unsigned int code_hash[] = {
#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 @@ static const unsigned int name_aliases[] = {
0x01A2,
0x01A3,
0x034F,
+ 0x061C,
+ 0x0709,
0x0CDE,
0x0E9D,
0x0E9F,
@@ -20005,6 +20027,10 @@ static const unsigned int name_aliases[] = {
0x202F,
0x205F,
0x2060,
+ 0x2066,
+ 0x2067,
+ 0x2068,
+ 0x2069,
0x2118,
0x2448,
0x2449,
@@ -20029,6 +20055,8 @@ static const unsigned int name_aliases[] = {
0xFEFF,
0xFEFF,
0xFEFF,
+ 0x122D4,
+ 0x122D5,
0x1D0C5,
0xE0100,
0xE0101,
@@ -20278,7 +20306,7 @@ typedef struct NamedSequence {
} 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 @@ static const named_sequence named_sequences[] = {
{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 661b6e294a..eecdab9697 100644
--- a/Modules/xxlimited.c
+++ b/Modules/xxlimited.c
@@ -44,7 +44,7 @@ static void
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 2feb2a827c..8fe919539f 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -14,6 +14,10 @@ struct st_zip_searchorder {
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 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
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 @@ zipimporter_init(ZipImporter *self, PyObject *args, PyObject *kwds)
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 @@ zipimporter_load_module(PyObject *obj, PyObject *args)
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_get_data(PyObject *obj, PyObject *args)
{
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 @@ read_directory(PyObject *archive)
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 @@ read_directory(PyObject *archive)
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 @@ read_directory(PyObject *archive)
/* 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 @@ read_directory(PyObject *archive)
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 @@ read_directory(PyObject *archive)
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 @@ read_directory(PyObject *archive)
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 @@ get_data(PyObject *archive, PyObject *toc_entry)
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 @@ get_data(PyObject *archive, PyObject *toc_entry)
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 @@ get_data(PyObject *archive, PyObject *toc_entry)
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 @@ normalize_line_endings(PyObject *source)
}
/* 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 f310bb0fcd..f22aabaef5 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 @@ Changes in 1.2.3.4 (21 Dec 2009)
- 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 1a22750a58..99b7cf92e4 100644
--- a/Modules/zlib/FAQ
+++ b/Modules/zlib/FAQ
@@ -44,8 +44,8 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
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 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
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 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
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 f6c51ca175..2ba0641204 100644
--- a/Modules/zlib/INDEX
+++ b/Modules/zlib/INDEX
@@ -7,6 +7,9 @@ Makefile.in template for Unix Makefile
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 Man page for zlib
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 @@ uncompr.c
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 5b15bd00d7..c61aa3008d 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 @@ CPP=$(CC) -E
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 @@ mandir = ${prefix}/share/man
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 @@ check: test
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 @@ match.lo: match.S
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
+
+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: minigzip.c zlib.h zconf.h
- $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.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 @@ minigzip64.o: minigzip.c zlib.h zconf.h
$(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 @@ install-libs: $(LIBS)
-@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 @@ install: install-libs
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 @@ clean:
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 d4219bf889..5ca9d127ed 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 @@ Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
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 @@ http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
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 @@ Acknowledgments:
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 65ad6a5adc..a868f073d8 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 @@ local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
#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 { \
+ unsigned long tmp = a >> 16; \
+ a &= 0xffffUL; \
+ a += (tmp << 4) - tmp; \
+ } while (0)
+# define MOD28(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); \
+ 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 @@ uLong ZEXPORT adler32(adler, buf, len)
}
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 @@ local uLong adler32_combine_(adler1, adler2, len2)
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 b022dde312..c97f495020 100644
--- a/Modules/zlib/algorithm.txt
+++ b/Modules/zlib/algorithm.txt
@@ -121,7 +121,7 @@ At least for deflate's output that generates new trees every several 10's of
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 @@ Compression,'' IEEE Transactions on Information Theory, Vol. 23, No. 3,
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 ea4dfbe9d7..6e9762676a 100644
--- a/Modules/zlib/compress.c
+++ b/Modules/zlib/compress.c
@@ -29,7 +29,7 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
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 bd9edd26cd..b77a8a8cf9 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 @@ includedir=${includedir-'${prefix}/include'}
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 @@ case "$1" in
-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 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
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 @@ else
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 @@ else
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 @@ if test $shared -eq 0; then
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 @@ int main(void) {
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." | 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 unistd.h... No."
+ 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
-
-rm -f $test.[co] $test $test$shared_ext
-
-# udpate Makefile
+# 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
+
+# udpate Makefile with the configure results
sed < Makefile.in "
/^CC *=/s#=.*#=$CC#
/^CFLAGS *=/s#=.*#=$CFLAGS#
@@ -557,7 +784,8 @@ sed < Makefile.in "
/^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 @@ sed < Makefile.in "
/^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 @@ sed < zlib.pc.in "
/^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 < zlib.pc.in "
" | sed -e "
s/\@VERSION\@/$VER/g;
" > zlib.pc
+
+# done
+leave 0
diff --git a/Modules/zlib/crc32.c b/Modules/zlib/crc32.c
index 91be372d22..979a7190a3 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 OF((void));
*/
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 @@ local void make_crc_table()
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 @@ local void make_crc_table()
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 @@ local void make_crc_table()
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 @@ local void make_crc_table()
#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 @@ local void write_table(out, table)
/* =========================================================================
* 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 @@ unsigned long ZEXPORT crc32(crc, buf, len)
#ifdef BYFOUR
if (sizeof(void *) == sizeof(ptrdiff_t)) {
- u4 endian;
+ z_crc_t endian;
endian = 1;
if (*((unsigned char *)(&endian)))
@@ -266,17 +249,17 @@ local unsigned long crc32_little(crc, buf, len)
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 @@ local unsigned long crc32_big(crc, buf, len)
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 @@ local unsigned long crc32_big(crc, buf, len)
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 8053b6117c..9e0c778102 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 bcef67cb95..696957705b 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 @@ local const config configuration_table[10] = {
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 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */
* 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 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
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 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
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 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
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;
- if (s->wrap)
- strm->adler = adler32(strm->adler, dictionary, dictLength);
+ wrap = s->wrap;
+ if (wrap == 2 || (wrap == 1 && s->status != INIT_STATE) || s->lookahead)
+ return Z_STREAM_ERROR;
- 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 */
+ /* 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 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 @@ int ZEXPORT deflateReset (strm)
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 deflateSetHeader (strm, head)
}
/* ========================================================================= */
+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 @@ int ZEXPORT deflateParams(strm, level, strategy)
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 putShortMSB (s, b)
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 @@ int ZEXPORT deflate (strm, flush)
* 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 @@ int ZEXPORT deflate (strm, flush)
if (s->lookahead == 0) {
s->strstart = 0;
s->block_start = 0L;
+ s->insert = 0;
}
}
}
@@ -945,12 +1029,12 @@ int ZEXPORT deflateCopy (dest, source)
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 @@ int ZEXPORT deflateCopy (dest, source)
}
/* 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 @@ local int read_buf(strm, buf, size)
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 @@ local void lm_init (s)
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 @@ local void fill_window(s)
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 @@ local void fill_window(s)
#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 @@ local void fill_window(s)
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 @@ local void fill_window(s)
s->high_water += init;
}
}
+
+ Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+ "not enough room for search");
}
/* ===========================================================================
@@ -1506,8 +1608,14 @@ local block_state deflate_stored(s, flush)
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 @@ local block_state deflate_fast(s, flush)
}
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 @@ local block_state deflate_slow(s, flush)
_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 @@ local block_state deflate_rle(s, flush)
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 @@ local block_state deflate_rle(s, flush)
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 @@ local block_state deflate_rle(s, flush)
}
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 @@ local block_state deflate_huff(s, flush)
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 cbf0d1ea5d..ce0299edd1 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 @@ typedef struct internal_state {
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 @@ typedef struct internal_state {
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 @@ typedef struct internal_state {
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 @@ void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
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 604736f15f..138a699bd5 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 hello[] = "hello, hello!";
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 @@ void test_dict_inflate OF((Byte *compr, uLong comprLen,
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 @@ void test_gzio(fname, uncompr, uncomprLen)
#endif
}
+#endif /* Z_SOLO */
+
/* ===========================================================================
* Test deflate() with small buffers
*/
@@ -174,14 +205,14 @@ void test_deflate(compr, comprLen)
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 @@ void test_inflate(compr, comprLen, uncompr, uncomprLen)
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 @@ void test_large_deflate(compr, comprLen, uncompr, uncomprLen)
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 @@ void test_large_inflate(compr, comprLen, uncompr, uncomprLen)
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 @@ void test_flush(compr, comprLen)
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 @@ void test_sync(compr, comprLen, uncompr, uncomprLen)
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 @@ void test_dict_deflate(compr, comprLen)
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 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
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 @@ void test_dict_inflate(compr, comprLen, uncompr, uncomprLen)
exit(1);
}
err = inflateSetDictionary(&d_stream, (const Bytef*)dictionary,
- sizeof(dictionary));
+ (int)sizeof(dictionary));
}
CHECK_ERR(err, "inflate with dict");
}
@@ -540,10 +571,15 @@ int main(argc, argv)
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 0f8fb79f87..d87659d031 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 7e90f4928f..0000000000
--- 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 603e60ed54..fae202ef89 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 @@ char ZLIB_INTERNAL *gz_strwinerror (error)
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 @@ local gzFile gz_open(path, fd, mode)
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 @@ local gzFile gz_open(path, fd, mode)
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 @@ local gzFile gz_open(path, fd, mode)
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 @@ local gzFile gz_open(path, fd, mode)
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
+#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
- (state->mode == GZ_READ ?
- O_RDONLY :
- (O_WRONLY | O_CREAT | (
- state->mode == GZ_WRITE ?
- O_TRUNC :
- O_APPEND))),
- 0666);
+ open((const char *)path, oflag, 0666));
if (state->fd == -1) {
free(state->path);
free(state);
@@ -216,15 +288,29 @@ gzFile ZEXPORT gzdopen(fd, mode)
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 @@ int ZEXPORT gzbuffer(file, size)
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 @@ int ZEXPORT gzrewind(file)
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 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
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 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
/* 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 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
/* 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 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
state->seek = 1;
state->skip = offset;
}
- return state->pos + offset;
+ return state->x.pos + offset;
}
/* -- see zlib.h -- */
@@ -373,7 +461,7 @@ z_off64_t ZEXPORT gztell64(file)
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 @@ int ZEXPORT gzeof(file)
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 @@ const char * ZEXPORT gzerror(file, errnum)
/* 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 @@ void ZEXPORT gzclearerr(file)
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 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
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 548201ab00..bf4538eb27 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 @@ local int gz_load(state, buf, len, have)
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 @@ local int gz_head(state)
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 @@ local int gz_head(state)
}
}
- /* 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;
+ }
+
+ /* 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, 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;
+ /* 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 @@ local int gz_head(state)
}
/* 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 @@ local int gz_decomp(state)
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 @@ local int gz_decomp(state)
}
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 @@ local int gz_skip(state, len)
/* 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 @@ local int gz_skip(state, len)
/* 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 @@ int ZEXPORT gzread(file, buf, len)
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 @@ int ZEXPORT gzread(file, buf, len)
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 @@ int ZEXPORT gzread(file, buf, len)
}
/* -- see zlib.h -- */
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+#else
+# undef gzgetc
+#endif
int ZEXPORT gzgetc(file)
gzFile file;
{
@@ -462,15 +396,16 @@ int ZEXPORT gzgetc(file)
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 @@ int ZEXPORT gzgetc(file)
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 @@ int ZEXPORT gzungetc(c, file)
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 @@ int ZEXPORT gzungetc(c, file)
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 @@ char * ZEXPORT gzgets(file, buf, len)
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 @@ char * ZEXPORT gzgets(file, buf, len)
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 @@ int ZEXPORT gzdirect(file)
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 gzdirect(file)
int ZEXPORT gzclose_r(file)
gzFile file;
{
- int ret;
+ int ret, err;
gz_statep state;
/* get internal structure */
@@ -645,9 +585,10 @@ int ZEXPORT gzclose_r(file)
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 e8defc6887..aa767fbf63 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 @@ local int gz_init(state)
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 @@ local int gz_comp(state, flush)
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 @@ local int gz_comp(state, flush)
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 @@ local int gz_comp(state, flush)
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 @@ local int gz_zero(state, len)
}
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 @@ int ZEXPORT gzwrite(file, buf, len)
unsigned len;
{
unsigned put = len;
- unsigned n;
gz_statep state;
z_streamp strm;
@@ -163,7 +184,7 @@ int ZEXPORT gzwrite(file, buf, len)
/* 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 @@ int ZEXPORT gzwrite(file, buf, len)
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 @@ int ZEXPORT gzwrite(file, buf, len)
/* 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 @@ int ZEXPORT gzputc(file, c)
gzFile file;
int c;
{
+ unsigned have;
unsigned char buf[1];
gz_statep state;
z_streamp strm;
@@ -245,19 +270,23 @@ int ZEXPORT gzputc(file, c)
/* 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 @@ int ZEXPORT gzputs(file, str)
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 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
/* 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 @@ int ZEXPORTVA gzprintf (gzFile file, const char *format, ...)
/* 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 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
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 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
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 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
/* 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 gzsetparams(file, level, strategy)
int ZEXPORT gzclose_w(file)
gzFile file;
{
- int ret = 0;
+ int ret = Z_OK;
gz_statep state;
/* get internal structure */
@@ -515,17 +554,24 @@ int ZEXPORT gzclose_w(file)
/* 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 af3a8c965d..f3833c2e43 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 @@ int stream_size;
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 @@ out_func out;
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 @@ void FAR *out_desc;
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 2f1d60b43b..bda59ceb6a 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 @@ z_streamp strm;
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 75ed4b5978..d628327769 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 a8431abeac..870f89bb4d 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 @@ z_streamp strm;
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 @@ z_streamp strm;
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 @@ int stream_size;
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 @@ void makefixed()
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 @@ void makefixed()
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 @@ unsigned out;
}
/* 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 @@ unsigned out;
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 @@ z_streamp strm;
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 @@ int flush;
#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 @@ int flush;
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 @@ int flush;
PULLBYTE();
}
if (here.val < 16) {
- NEEDBITS(here.bits);
DROPBITS(here.bits);
state->lens[state->have++] = here.val;
}
@@ -980,7 +995,7 @@ int flush;
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 @@ int flush;
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 @@ int flush;
#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 @@ int flush;
*/
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 @@ z_streamp strm;
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 @@ uInt dictLength;
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 @@ gz_headerp head;
*/
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 @@ z_streamp source;
}
/* 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 11e9c52acc..44d89cf24e 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 @@ unsigned short FAR *work;
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 @@ unsigned short FAR *work;
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 @@ unsigned short FAR *work;
/* 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 @@ unsigned short FAR *work;
}
}
- /*
- 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 24230c5452..baa53a0b1a 100644
--- a/Modules/zlib/inftrees.h
+++ b/Modules/zlib/inftrees.h
@@ -41,7 +41,7 @@ typedef struct {
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 6576490e65..65e9d0cbc8 100644
--- a/Modules/zlib/make_vms.com
+++ b/Modules/zlib/make_vms.com
@@ -3,7 +3,7 @@ $! Martin P.J. Zinser
$!
$! 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.02 20061008 Adapt to new Makefile.in
$! 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 @@ $ s_case = False
$!
$! 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 @@ $! Look for the compiler used
$!
$ gosub check_compiler
$ close topt
+$ close optf
$!
$ if its_decc
$ then
@@ -83,6 +103,15 @@ $ ccopt = "/decc" + ccopt
$ 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 @@ $ gosub check_config
$ 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 @@ $! Build the thing plain or with mms
$!
$ 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 @@ $ CALL MAKE zutil.OBJ "CC ''CCOPT' zutil" -
$ 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
+$ endif
$!
-$! Alpha gets a shareable image
+$! Create 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
+$ 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 @@ $ERR_EXIT:
$ 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 @@ $ copy sys$input: out
$ 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 @@ OBJS = adler32.obj, compress.obj, crc32.obj, gzclose.obj, gzlib.obj\
$ 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 @@ example.exe : example.obj libz.olb
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 @@ adler32.obj : adler32.c zutil.h zlib.h zconf.h
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 @@ gzwrite.obj : gzwrite.c zutil.h zlib.h zconf.h
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,133 +703,165 @@ $ endif
$ 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
+$! Write configuration to both permanent and temporary config file
$!
$! 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
+$! 0.01 20031029 First version to receive a number
+$!
+$WRITE_CONFIG: SUBROUTINE
+$ write aconf 'p1'
+$ open/append confh 'th'
+$ write confh 'p1'
+$ 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
$!
-$ 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
+$ SAY "MAP_2_SHOPT-E-NOSUCHFILE: Error, inputfile ''p1' not available"
+$ goto exit_m2s
$ ENDIF
$ IF "''P2'" .EQS. ""
$ THEN
-$ SAY "ANAL_OBJ_AXP: Error, no output file provided"
-$ goto exit_aa
+$ SAY "MAP_2_SHOPT: Error, no output file provided"
+$ goto exit_m2s
$ 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)
+$!
+$ 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
-$ 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)
+$ 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
-$ 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
+$ EXIT_M2S:
+$ close/nolog map
+$ close/nolog libopt
$ endsubroutine
-$!------------------------------------------------------------------------------
-$!
-$! Write configuration to both permanent and temporary config file
-$!
-$! Version history
-$! 0.01 20031029 First version to receive a number
-$!
-$WRITE_CONFIG: SUBROUTINE
-$ write aconf 'p1'
-$ open/append confh 'th'
-$ write confh 'p1'
-$ close confh
-$ENDSUBROUTINE
-$!------------------------------------------------------------------------------
diff --git a/Modules/zlib/minigzip.c b/Modules/zlib/minigzip.c
index 9825ccc3a7..b3025a489a 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 @@ static void pwinerror (s)
# 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 @@ void file_compress(file, mode)
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 @@ void file_uncompress(file)
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 @@ void file_uncompress(file)
} 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 @@ int main(argc, argv)
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 56e9bb1c11..1fd7759ef0 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 @@ local const uch bl_order[BL_CODES]
* 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 void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
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 @@ void ZLIB_INTERNAL _tr_init(s)
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 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
}
/* ===========================================================================
+ * 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 @@ void ZLIB_INTERNAL _tr_align(s)
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 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
} 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 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
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 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
*/
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 @@ local void compress_block(s, ltree, dtree)
} while (lx < s->last_lit);
send_code(s, END_BLOCK, ltree);
- s->last_eob_len = ltree[END_BLOCK].Len;
}
/* ===========================================================================
@@ -1226,7 +1209,6 @@ local void copy_block(s, buf, len, header)
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 ad98be3a5d..242e9493df 100644
--- a/Modules/zlib/uncompr.c
+++ b/Modules/zlib/uncompr.c
@@ -30,7 +30,7 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen)
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 02ce56c431..9987a77553 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 uLong FAR uLongf;
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 @@ typedef uLong FAR uLongf;
* 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 @@ typedef uLong FAR uLongf;
# 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 a2f71b1f32..043019cda1 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 uLong FAR uLongf;
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 @@ typedef uLong FAR uLongf;
* 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 @@ typedef uLong FAR uLongf;
# 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 02ce56c431..9987a77553 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 uLong FAR uLongf;
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 @@ typedef uLong FAR uLongf;
* 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 @@ typedef uLong FAR uLongf;
# 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 03a9431c8b..0000000000
--- 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 27adc4cd10..0160e62b69 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 @@ All functions of the compression library are documented in the file
.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 @@ A Python interface to
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 @@ http://zlib.net/
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 @@ before asking for help.
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 79a187ce83..3e0c7672ac 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 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address));
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 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
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 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
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 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
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 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
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 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
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,8 +702,28 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
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,
@@ -703,8 +737,9 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
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 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
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 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
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 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
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 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
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 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
27-31: 0 (reserved)
*/
+#ifndef Z_SOLO
/* utility functions */
@@ -1149,10 +1207,11 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
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 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
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 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
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 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
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 gzsetparams OF((gzFile file, int level, int strategy));
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 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
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 gzputc OF((gzFile file, int c));
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 gzeof OF((gzFile file));
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 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
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 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file));
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 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
file that is being written concurrently.
*/
+#endif /* !Z_SOLO */
/* checksum functions */
@@ -1492,16 +1592,17 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
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 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
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 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
* 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 int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
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 int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
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 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
/* 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 f282d3624a..55c6647eb4 100644
--- a/Modules/zlib/zlib.map
+++ b/Modules/zlib/zlib.map
@@ -66,3 +66,18 @@ ZLIB_1.2.3.5 {
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 898ed345b0..23d2ebef00 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 @@ uLong ZEXPORT zlibCompileFlags()
#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 @@ void ZLIB_INTERNAL zmemzero(dest, len)
}
#endif
+#ifndef Z_SOLO
#ifdef SYS16BIT
@@ -316,3 +320,5 @@ void ZLIB_INTERNAL zcfree (opaque, ptr)
}
#endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/Modules/zlib/zutil.h b/Modules/zlib/zutil.h
index 258fa88799..24ab06b1cf 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 unsigned short ush;
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 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#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 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#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 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# 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 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* 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 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# 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 1d1072dcea..52744b967e 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -8,6 +8,7 @@
#include "structmember.h"
#include "zlib.h"
+
#ifdef WITH_THREAD
#include "pythread.h"
#define ENTER_ZLIB(obj) \
@@ -27,10 +28,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 +80,13 @@ zlib_error(z_stream zst, int err, char *msg)
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 +110,63 @@ newcompobject(PyTypeObject *type)
}
#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 +176,9 @@ PyZlib_compress(PyObject *self, PyObject *args)
/* 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 +219,100 @@ PyZlib_compress(PyObject *self, PyObject *args)
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 +349,18 @@ PyZlib_decompress(PyObject *self, PyObject *args)
/* 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 +378,67 @@ PyZlib_decompress(PyObject *self, PyObject *args)
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;
}
+/*[clinic input]
+zlib.compressobj
+
+ 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 *
-PyZlib_compressobj(PyObject *selfptr, PyObject *args, PyObject *kwargs)
+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;
- 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};
-
- 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;
+ 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 +465,28 @@ PyZlib_compressobj(PyObject *selfptr, PyObject *args, PyObject *kwargs)
error:
Py_CLEAR(self);
success:
- if (zdict.buf != NULL)
- PyBuffer_Release(&zdict);
return (PyObject*)self;
}
+/*[clinic input]
+zlib.decompressobj
+
+ 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 *
-PyZlib_decompressobj(PyObject *selfptr, PyObject *args, PyObject *kwargs)
+zlib_decompressobj_impl(PyModuleDef *module, int wbits, PyObject *zdict)
+/*[clinic end generated code: output=8ccd583fbd631798 input=67f05145a6920127]*/
{
- static char *kwlist[] = {"wbits", "zdict", NULL};
- int wbits=DEF_WBITS, err;
+ int err;
compobject *self;
- PyObject *zdict=NULL;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|iO:decompressobj",
- kwlist, &wbits, &zdict))
- return NULL;
if (zdict != NULL && !PyObject_CheckBuffer(zdict)) {
PyErr_SetString(PyExc_TypeError,
"zdict argument must support the buffer protocol");
@@ -419,8 +496,9 @@ PyZlib_decompressobj(PyObject *selfptr, PyObject *args, PyObject *kwargs)
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 +554,41 @@ Decomp_dealloc(compobject *self)
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 +605,18 @@ PyZlib_objcompress(compobject *self, PyObject *args)
/* 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 +629,15 @@ PyZlib_objcompress(compobject *self, PyObject *args)
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 +653,7 @@ save_unconsumed_input(compobject *self, int err)
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 +684,50 @@ save_unconsumed_input(compobject *self, int err)
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 +742,21 @@ PyZlib_objdecompress(compobject *self, PyObject *args)
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 +782,7 @@ PyZlib_objdecompress(compobject *self, PyObject *args)
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 +816,39 @@ PyZlib_objdecompress(compobject *self, PyObject *args)
}
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 +863,34 @@ PyZlib_flush(compobject *self, PyObject *args)
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 +913,7 @@ PyZlib_flush(compobject *self, PyObject *args)
}
if (_PyBytes_Resize(&RetVal, self->zst.total_out - start_total_out) < 0) {
- Py_DECREF(RetVal);
- RetVal = NULL;
+ Py_CLEAR(RetVal);
}
error:
@@ -837,11 +923,16 @@ PyZlib_flush(compobject *self, PyObject *args)
}
#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 +982,15 @@ error:
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 +1042,43 @@ error:
}
#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 +1090,17 @@ PyZlib_unflush(compobject *self, PyObject *args)
/* 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 +1127,7 @@ PyZlib_unflush(compobject *self, PyObject *args)
}
if (_PyBytes_Resize(&retval, self->zst.total_out - start_total_out) < 0) {
- Py_DECREF(retval);
- retval = NULL;
+ Py_CLEAR(retval);
}
error:
@@ -1031,28 +1137,24 @@ error:
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 +1167,95 @@ static PyMemberDef Decomp_members[] = {
{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 +1366,21 @@ PyInit_zlib(void)
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_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, 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_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 124e7664fc..38ddb0f3df 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -64,49 +64,72 @@ PyObject_Length(PyObject *o)
}
#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;
+ }
+ result = PyObject_CallFunctionObjArgs(hint, NULL);
+ Py_DECREF(hint);
+ if (result == NULL) {
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ PyErr_Clear();
return defaultvalue;
+ }
+ return -1;
}
- ro = PyObject_CallFunctionObjArgs(hintmeth, NULL);
- Py_DECREF(hintmeth);
- if (ro == NULL) {
- if (!PyErr_ExceptionMatches(PyExc_TypeError))
- return -1;
- PyErr_Clear();
+ else if (result == Py_NotImplemented) {
+ Py_DECREF(result);
return defaultvalue;
}
- rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue;
- Py_DECREF(ro);
- return rv;
+ 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 @@ PyObject_DelItem(PyObject *o, PyObject *key)
}
int
-PyObject_DelItemString(PyObject *o, char *key)
+PyObject_DelItemString(PyObject *o, const char *key)
{
PyObject *okey;
int ret;
@@ -1162,6 +1185,15 @@ PyNumber_Index(PyObject *item)
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;
}
@@ -1640,7 +1672,7 @@ PySequence_Tuple(PyObject *v)
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 +1932,7 @@ PyMapping_Length(PyObject *o)
#define PyMapping_Length PyMapping_Size
PyObject *
-PyMapping_GetItemString(PyObject *o, char *key)
+PyMapping_GetItemString(PyObject *o, const char *key)
{
PyObject *okey, *r;
@@ -1916,7 +1948,7 @@ PyMapping_GetItemString(PyObject *o, char *key)
}
int
-PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
+PyMapping_SetItemString(PyObject *o, const char *key, PyObject *value)
{
PyObject *okey;
int r;
@@ -1935,7 +1967,7 @@ PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)
}
int
-PyMapping_HasKeyString(PyObject *o, char *key)
+PyMapping_HasKeyString(PyObject *o, const char *key)
{
PyObject *v;
@@ -2034,10 +2066,16 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
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 +2110,7 @@ call_function_tail(PyObject *callable, PyObject *args)
}
PyObject *
-PyObject_CallFunction(PyObject *callable, char *format, ...)
+PyObject_CallFunction(PyObject *callable, const char *format, ...)
{
va_list va;
PyObject *args;
@@ -2087,12 +2125,14 @@ PyObject_CallFunction(PyObject *callable, char *format, ...)
}
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 +2152,7 @@ _PyObject_CallFunction_SizeT(PyObject *callable, char *format, ...)
}
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 +2181,7 @@ callmethod(PyObject* func, char *format, va_list va, int is_size_t)
}
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;
@@ -2162,7 +2202,8 @@ PyObject_CallMethod(PyObject *o, char *name, char *format, ...)
}
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;
@@ -2183,7 +2224,8 @@ _PyObject_CallMethodId(PyObject *o, _Py_Identifier *name, char *format, ...)
}
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;
@@ -2203,7 +2245,8 @@ _PyObject_CallMethod_SizeT(PyObject *o, char *name, char *format, ...)
}
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 +2316,7 @@ PyObject_CallMethodObjArgs(PyObject *callable, PyObject *name, ...)
}
PyObject *
-_PyObject_CallMethodObjIdArgs(PyObject *callable,
+_PyObject_CallMethodIdObjArgs(PyObject *callable,
struct _Py_Identifier *name, ...)
{
PyObject *args, *tmp;
@@ -2648,8 +2691,8 @@ PyIter_Next(PyObject *iter)
* 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 +2700,7 @@ _PySequence_BytesToCharpArray(PyObject* self)
char **array;
Py_ssize_t i, argc;
PyObject *item = NULL;
+ Py_ssize_t size;
argc = PySequence_Size(self);
if (argc == -1)
@@ -2669,7 +2713,7 @@ _PySequence_BytesToCharpArray(PyObject* self)
return NULL;
}
- array = malloc((argc + 1) * sizeof(char *));
+ array = PyMem_Malloc((argc + 1) * sizeof(char *));
if (array == NULL) {
PyErr_NoMemory();
return NULL;
@@ -2688,11 +2732,13 @@ _PySequence_BytesToCharpArray(PyObject* self)
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 +2758,7 @@ _Py_FreeCharPArray(char *const array[])
{
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 50667a646a..5b75705abf 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -150,6 +150,7 @@ PyByteArray_FromStringAndSize(const char *bytes, Py_ssize_t size)
}
Py_SIZE(new) = size;
new->ob_alloc = alloc;
+ new->ob_start = new->ob_bytes;
new->ob_exports = 0;
return (PyObject *)new;
@@ -177,48 +178,70 @@ int
PyByteArray_Resize(PyObject *self, Py_ssize_t size)
{
void *sval;
- Py_ssize_t alloc = ((PyByteArrayObject *)self)->ob_alloc;
+ PyByteArrayObject *obj = ((PyByteArrayObject *)self);
+ Py_ssize_t alloc = obj->ob_alloc;
+ Py_ssize_t logical_offset = obj->ob_start - obj->ob_bytes;
assert(self != NULL);
assert(PyByteArray_Check(self));
assert(size >= 0);
+ assert(logical_offset >= 0);
+ assert(logical_offset <= alloc);
if (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) {
- PyErr_NoMemory();
- return -1;
+ if (logical_offset > 0) {
+ sval = PyObject_Malloc(alloc);
+ if (sval == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
+ memcpy(sval, PyByteArray_AS_STRING(self), Py_MIN(size, Py_SIZE(self)));
+ PyObject_Free(obj->ob_bytes);
+ }
+ else {
+ sval = PyObject_Realloc(obj->ob_bytes, alloc);
+ if (sval == NULL) {
+ PyErr_NoMemory();
+ return -1;
+ }
}
- ((PyByteArrayObject *)self)->ob_bytes = sval;
+ 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;
}
@@ -288,13 +311,13 @@ bytearray_iconcat(PyByteArrayObject *self, PyObject *other)
}
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 +354,7 @@ bytearray_irepeat(PyByteArrayObject *self, Py_ssize_t count)
{
Py_ssize_t mysize;
Py_ssize_t size;
+ char *buf;
if (count < 0)
count = 0;
@@ -338,19 +362,16 @@ bytearray_irepeat(PyByteArrayObject *self, Py_ssize_t count)
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 +387,7 @@ bytearray_getitem(PyByteArrayObject *self, Py_ssize_t i)
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 +406,7 @@ bytearray_subscript(PyByteArrayObject *self, PyObject *index)
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 +419,8 @@ bytearray_subscript(PyByteArrayObject *self, PyObject *index)
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 +446,94 @@ bytearray_subscript(PyByteArrayObject *self, PyObject *index)
}
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;
@@ -467,50 +572,9 @@ bytearray_setslice(PyByteArrayObject *self, Py_ssize_t lo, Py_ssize_t hi,
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 +597,7 @@ bytearray_setitem(PyByteArrayObject *self, Py_ssize_t i, PyObject *value)
if (!_getbytevalue(value, &ival))
return -1;
- self->ob_bytes[i] = ival;
+ PyByteArray_AS_STRING(self)[i] = ival;
return 0;
}
@@ -541,7 +605,8 @@ static int
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 +633,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
int ival;
if (!_getbytevalue(values, &ival))
return -1;
- self->ob_bytes[i] = (char)ival;
+ buf[i] = (char)ival;
return 0;
}
}
@@ -606,7 +671,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
}
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 +679,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
(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 +706,14 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
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 +735,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu
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 +815,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds)
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 +828,8 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds)
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 +873,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds)
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 +897,10 @@ bytearray_repr(PyByteArrayObject *self)
/* 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 +935,12 @@ bytearray_repr(PyByteArrayObject *self)
*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')
@@ -1038,6 +1075,7 @@ bytearray_dealloc(PyByteArrayObject *self)
#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 +1087,7 @@ bytearray_dealloc(PyByteArrayObject *self)
#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"
@@ -1429,9 +1468,9 @@ table, which must be a bytes object of length 256.");
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;
@@ -2192,7 +2231,7 @@ bytearray_reverse(PyByteArrayObject *self, PyObject *unused)
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 +2252,7 @@ bytearray_insert(PyByteArrayObject *self, PyObject *args)
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 +2266,7 @@ bytearray_insert(PyByteArrayObject *self, PyObject *args)
return NULL;
if (PyByteArray_Resize((PyObject *)self, n + 1) < 0)
return NULL;
+ buf = PyByteArray_AS_STRING(self);
if (where < 0) {
where += n;
@@ -2234,8 +2275,8 @@ bytearray_insert(PyByteArrayObject *self, PyObject *args)
}
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 +2301,7 @@ bytearray_append(PyByteArrayObject *self, PyObject *arg)
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 +2332,7 @@ bytearray_extend(PyByteArrayObject *self, PyObject *arg)
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 +2394,7 @@ bytearray_pop(PyByteArrayObject *self, PyObject *args)
{
int value;
Py_ssize_t where = -1, n = Py_SIZE(self);
+ char *buf;
if (!PyArg_ParseTuple(args, "|n:pop", &where))
return NULL;
@@ -2371,8 +2413,9 @@ bytearray_pop(PyByteArrayObject *self, PyObject *args)
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 +2431,13 @@ bytearray_remove(PyByteArrayObject *self, PyObject *arg)
{
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 +2447,7 @@ bytearray_remove(PyByteArrayObject *self, PyObject *arg)
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 +2457,21 @@ bytearray_remove(PyByteArrayObject *self, PyObject *arg)
/* 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 +2486,7 @@ static PyObject *
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))
@@ -2454,10 +2498,10 @@ bytearray_strip(PyByteArrayObject *self, PyObject *args)
else {
if (_getbuffer(arg, &varg) < 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 +2510,7 @@ bytearray_strip(PyByteArrayObject *self, PyObject *args)
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 +2523,7 @@ static PyObject *
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))
@@ -2491,16 +2535,16 @@ bytearray_lstrip(PyByteArrayObject *self, PyObject *args)
else {
if (_getbuffer(arg, &varg) < 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 +2557,7 @@ static PyObject *
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))
@@ -2525,15 +2569,15 @@ bytearray_rstrip(PyByteArrayObject *self, PyObject *args)
else {
if (_getbuffer(arg, &varg) < 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 +2622,9 @@ Concatenate any number of bytes/bytearray objects, with B\n\
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 +2728,7 @@ _common_reduce(PyByteArrayObject *self, int proto)
{
PyObject *dict;
_Py_IDENTIFIER(__dict__);
+ char *buf;
dict = _PyObject_GetAttrId((PyObject *)self, &PyId___dict__);
if (dict == NULL) {
@@ -2756,19 +2737,20 @@ _common_reduce(PyByteArrayObject *self, int proto)
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 +2831,7 @@ bytearray_methods[] = {
{"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 +2982,7 @@ bytearrayiter_next(bytesiterobject *it)
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 ef3c2f729d..4e8107b491 100644
--- a/Objects/bytes_methods.c
+++ b/Objects/bytes_methods.c
@@ -10,9 +10,9 @@ and there is at least one character in B, False otherwise.");
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 @@ and there is at least one character in B, False otherwise.");
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 @@ and there is at least one character in B, False otherwise.");
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 @@ and there is at least one character in B, False otherwise.");
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 @@ at least one cased character in B, False otherwise.");
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 @@ at least one cased character in B, False otherwise.");
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 @@ otherwise.");
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 @@ _Py_bytes_istitle(const char *cptr, Py_ssize_t len)
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)
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index f6d16dafdb..b93b9ef10d 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -10,9 +10,18 @@
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)
+ PyBufferProcs *bufferprocs;
+ if (PyBytes_CheckExact(obj)) {
+ /* Fast path, e.g. for .join() of many bytes objects */
+ Py_INCREF(obj);
+ view->obj = obj;
+ view->buf = PyBytes_AS_STRING(obj);
+ view->len = PyBytes_GET_SIZE(obj);
+ return view->len;
+ }
+
+ bufferprocs = Py_TYPE(obj)->tp_as_buffer;
+ if (bufferprocs == NULL || bufferprocs->bf_getbuffer == NULL)
{
PyErr_Format(PyExc_TypeError,
"Type %.100s doesn't support the buffer API",
@@ -20,7 +29,7 @@ _getbuffer(PyObject *obj, Py_buffer *view)
return -1;
}
- if (buffer->bf_getbuffer(obj, view, PyBUF_SIMPLE) < 0)
+ if (bufferprocs->bf_getbuffer(obj, view, PyBUF_SIMPLE) < 0)
return -1;
return view->len;
}
@@ -65,7 +74,7 @@ static PyBytesObject *nullstring;
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 +107,7 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size)
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 +126,8 @@ PyBytes_FromStringAndSize(const char *str, Py_ssize_t size)
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 +155,7 @@ PyBytes_FromString(const char *str)
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 +526,7 @@ PyObject *PyBytes_DecodeEscape(const char *s,
/* object api */
Py_ssize_t
-PyBytes_Size(register PyObject *op)
+PyBytes_Size(PyObject *op)
{
if (!PyBytes_Check(op)) {
PyErr_Format(PyExc_TypeError,
@@ -528,7 +537,7 @@ PyBytes_Size(register PyObject *op)
}
char *
-PyBytes_AsString(register PyObject *op)
+PyBytes_AsString(PyObject *op)
{
if (!PyBytes_Check(op)) {
PyErr_Format(PyExc_TypeError,
@@ -539,9 +548,9 @@ PyBytes_AsString(register PyObject *op)
}
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 +582,7 @@ PyBytes_AsStringAndSize(register PyObject *obj,
#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 +592,7 @@ PyBytes_AsStringAndSize(register PyObject *obj,
PyObject *
PyBytes_Repr(PyObject *obj, int smartquotes)
{
- register PyBytesObject* op = (PyBytesObject*) obj;
+ PyBytesObject* op = (PyBytesObject*) obj;
Py_ssize_t i, length = Py_SIZE(op);
size_t newsize, squotes, dquotes;
PyObject *v;
@@ -721,12 +731,12 @@ bytes_concat(PyObject *a, PyObject *b)
}
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;
@@ -752,7 +762,7 @@ bytes_repeat(register PyBytesObject *a, register Py_ssize_t n)
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) {
@@ -796,7 +806,7 @@ bytes_contains(PyObject *self, PyObject *arg)
}
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");
@@ -805,6 +815,23 @@ bytes_item(PyBytesObject *a, register Py_ssize_t i)
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)
{
@@ -825,53 +852,55 @@ bytes_richcompare(PyBytesObject *a, PyBytesObject *b, int op)
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;
- }
- 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;
+ 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;
}
- result = c ? Py_True : Py_False;
- out:
+
Py_INCREF(result);
return result;
}
@@ -881,7 +910,7 @@ bytes_hash(PyBytesObject *a)
{
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;
}
@@ -1125,94 +1154,9 @@ Concatenate any number of bytes objects, with B in between each pair.\n\
Example: b'.'.join([b'ab', b'pq', b'rs']) -> b'ab.pq.rs'.");
static PyObject *
-bytes_join(PyObject *self, PyObject *orig)
-{
- 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;
+bytes_join(PyObject *self, PyObject *iterable)
+{
+ return stringlib_bytes_join(self, iterable);
}
PyObject *
@@ -1435,7 +1379,7 @@ do_argstrip(PyBytesObject *self, int striptype, PyObject *args)
{
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) {
@@ -1549,9 +1493,9 @@ table, which must be a bytes object of length 256.");
static PyObject *
bytes_translate(PyBytesObject *self, PyObject *args)
{
- register char *input, *output;
+ char *input, *output;
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;
@@ -2329,8 +2273,6 @@ bytes_decode(PyObject *self, PyObject *args, PyObject *kwargs)
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
return NULL;
- if (encoding == NULL)
- encoding = PyUnicode_GetDefaultEncoding();
return PyUnicode_FromEncodedObject(self, encoding, errors);
}
@@ -2460,7 +2402,7 @@ bytes_methods[] = {
{"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,
@@ -2692,7 +2634,7 @@ PyBytes_FromObject(PyObject *x)
}
/* 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
@@ -2750,9 +2692,8 @@ PyBytes_FromObject(PyObject *x)
return new;
error:
- /* Error handling when new != NULL */
Py_XDECREF(it);
- Py_DECREF(new);
+ Py_XDECREF(new);
return NULL;
}
@@ -2838,9 +2779,9 @@ PyTypeObject PyBytes_Type = {
};
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;
@@ -2854,7 +2795,7 @@ PyBytes_Concat(register PyObject **pv, register PyObject *w)
}
void
-PyBytes_ConcatAndDel(register PyObject **pv, register PyObject *w)
+PyBytes_ConcatAndDel(PyObject **pv, PyObject *w)
{
PyBytes_Concat(pv, w);
Py_XDECREF(w);
@@ -2878,8 +2819,8 @@ PyBytes_ConcatAndDel(register PyObject **pv, register PyObject *w)
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 cdc9b1c647..0c0bd47fbb 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -44,7 +44,7 @@ PyMethod_Self(PyObject *im)
PyObject *
PyMethod_New(PyObject *func, PyObject *self)
{
- register PyMethodObject *im;
+ PyMethodObject *im;
if (self == NULL) {
PyErr_BadInternalCall();
return NULL;
@@ -52,7 +52,7 @@ PyMethod_New(PyObject *func, PyObject *self)
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 @@ PyMethod_New(PyObject *func, PyObject *self)
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 @@ method_new(PyTypeObject* type, PyObject* args, PyObject *kw)
}
static void
-method_dealloc(register PyMethodObject *im)
+method_dealloc(PyMethodObject *im)
{
_PyObject_GC_UNTRACK(im);
if (im->im_weakreflist != NULL)
@@ -367,7 +391,7 @@ PyTypeObject PyMethod_Type = {
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 @@ instancemethod_call(PyObject *self, PyObject *arg, PyObject *kw)
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 9713f61b24..353f414a38 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -74,6 +74,11 @@ PyCode_New(int argcount, int kwonlyargcount,
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 b08aa6f001..a5b76f0460 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -211,13 +211,13 @@ complex_subtype_from_c_complex(PyTypeObject *type, Py_complex cval)
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 +271,12 @@ try_complex_special_method(PyObject *op) {
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 +302,6 @@ PyComplex_AsCComplex(PyObject *op)
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 +705,7 @@ complex__format__(PyObject* self, PyObject* args)
if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
return NULL;
- _PyUnicodeWriter_Init(&writer, 0);
+ _PyUnicodeWriter_Init(&writer);
ret = _PyComplex_FormatAdvancedWriter(
&writer,
self,
@@ -773,8 +773,9 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
goto error;
}
else if (PyObject_AsCharBuffer(v, &s, &len)) {
- 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(v)->tp_name);
return NULL;
}
@@ -953,8 +954,9 @@ complex_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 ba98a30c14..2df5ac5f73 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -115,7 +115,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
((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 @@ method_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
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 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwds)
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 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args,
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 @@ wrapperdescr_call(PyWrapperDescrObject *descr, PyObject *args, PyObject *kwds)
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 @@ descr_get_qualname(PyDescrObject *descr)
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 PyMemberDef descr_members[] = {
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 PyGetSetDef getset_getset[] = {
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 @@ PyTypeObject PyMethodDescr_Type = {
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 @@ PyTypeObject PyClassMethodDescr_Type = {
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 @@ PyTypeObject PyMemberDescr_Type = {
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 @@ PyTypeObject PyWrapperDescr_Type = {
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 @@ wrapper_dealloc(wrapperobject *wp)
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 @@ wrapper_repr(wrapperobject *wp)
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 @@ wrapper_name(wrapperobject *wp)
}
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 @@ static PyGetSetDef wrapper_getsets[] = {
{"__name__", (getter)wrapper_name},
{"__qualname__", (getter)wrapper_qualname},
{"__doc__", (getter)wrapper_doc},
+ {"__text_signature__", (getter)wrapper_text_signature},
{0}
};
@@ -1193,7 +1233,7 @@ PyTypeObject _PyMethodWrapper_Type = {
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 7aa5ea83d3..1ccea6ef2a 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -69,6 +69,11 @@ to the combined-table form.
#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 @@ To avoid slowing down lookups on a near-full table, we resize the table when
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 @@ PyDict_Fini(void)
* #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 @@ static PyObject *
new_dict(PyDictKeysObject *keys, PyObject **values)
{
PyDictObject *mp;
+ assert(keys != NULL);
if (numfree) {
mp = free_list[--numfree];
assert (mp != NULL);
@@ -431,7 +423,10 @@ new_dict_with_shared_keys(PyDictKeysObject *keys)
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 @@ static PyDictKeyEntry *
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 @@ static PyDictKeyEntry *
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 @@ static PyDictKeyEntry *
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 @@ static PyDictKeyEntry *
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);
@@ -1237,7 +1232,7 @@ PyDict_DelItem(PyObject *op, PyObject *key)
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 @@ dict_dealloc(PyDictObject *mp)
}
DK_DECREF(keys);
}
- else {
+ else if (keys != NULL) {
assert(keys->dk_refcnt == 1);
DK_DECREF(keys);
}
@@ -1407,9 +1402,9 @@ static PyObject *
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 @@ dict_repr(PyDictObject *mp)
}
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;
- }
-
- /* 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;
-
- 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);
+ 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);
+ }
+
+ writer.overallocate = 0;
+ if (_PyUnicodeWriter_WriteChar(&writer, '}') < 0)
+ goto error;
+
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 @@ dict_length(PyDictObject *mp)
}
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 @@ dict_subscript(PyDictObject *mp, register PyObject *key)
else if (PyErr_Occurred())
return NULL;
}
- set_key_error(key);
+ _PyErr_SetKeyError(key);
return NULL;
}
else
@@ -1547,10 +1544,10 @@ static PyMappingMethods dict_as_mapping = {
};
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 @@ dict_keys(register PyDictObject *mp)
}
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 @@ dict_values(register PyDictObject *mp)
}
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 @@ dict_items(register PyDictObject *mp)
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_impl(PyTypeObject *type, PyObject *iterable, PyObject *value);
+
static PyObject *
-dict_fromkeys(PyObject *cls, PyObject *args)
+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 @@ dict_fromkeys(PyObject *cls, PyObject *args)
}
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 @@ dict_fromkeys(PyObject *cls, PyObject *args)
}
}
- it = PyObject_GetIter(seq);
+ it = PyObject_GetIter(iterable);
if (it == NULL){
Py_DECREF(d);
return NULL;
@@ -1908,8 +1940,8 @@ PyDict_Update(PyObject *a, PyObject *b)
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 @@ PyDict_Merge(PyObject *a, PyObject *b, int override)
}
static PyObject *
-dict_copy(register PyDictObject *mp)
+dict_copy(PyDictObject *mp)
{
return PyDict_Copy((PyObject*)mp);
}
@@ -2118,13 +2150,18 @@ dict_equal(PyDictObject *a, PyDictObject *b)
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 @@ dict_richcompare(PyObject *v, PyObject *w, int op)
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 @@ dict_contains(register PyDictObject *mp, PyObject *key)
}
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 @@ dict_get(register PyDictObject *mp, PyObject *args)
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 @@ dict_setdefault(register PyDictObject *mp, PyObject *args)
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 @@ dict_pop(PyDictObject *mp, PyObject *args)
Py_INCREF(deflt);
return deflt;
}
- set_key_error(key);
+ _PyErr_SetKeyError(key);
return NULL;
}
if (!PyUnicode_CheckExact(key) ||
@@ -2296,7 +2367,7 @@ dict_pop(PyDictObject *mp, PyObject *args)
Py_INCREF(deflt);
return deflt;
}
- set_key_error(key);
+ _PyErr_SetKeyError(key);
return NULL;
}
*value_addr = NULL;
@@ -2437,9 +2508,6 @@ _PyDict_KeysSize(PyDictKeysObject *keys)
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 @@ PyDoc_STRVAR(popitem__doc__,
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 @@ PyDoc_STRVAR(values__doc__,
"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 @@ static PyMethodDef mapp_methods[] = {
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 @@ static PyObject *
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 @@ _PyDict_GetItemId(PyObject *dp, struct _Py_Identifier *key)
{
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 @@ PyDict_GetItemString(PyObject *v, const char *key)
{
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 @@ PyDict_SetItemString(PyObject *v, const char *key, PyObject *item)
}
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 PyMethodDef dictiter_methods[] = {
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 @@ PyTypeObject PyDictIterKey_Type = {
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 @@ PyTypeObject PyDictIterValue_Type = {
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 6b04700621..44e60dd044 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -16,9 +16,6 @@ PyObject *PyExc_IOError = NULL;
#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 @@ BaseException_str(PyBaseExceptionObject *self)
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 @@ ComplexExtendsException(PyExc_Exception, ImportError,
* 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 @@ oserror_parse_args(PyObject **p_args,
{
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 @@ oserror_parse_args(PyObject **p_args,
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 @@ oserror_parse_args(PyObject **p_args,
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 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
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 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args,
/* Steals the reference to args */
Py_CLEAR(self->args);
self->args = args;
- args = NULL;
+ *p_args = args = NULL;
return 0;
}
@@ -880,17 +889,20 @@ static PyObject *
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 @@ OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto error;
}
+ Py_XDECREF(args);
return (PyObject *) self;
error:
@@ -943,7 +956,8 @@ error:
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 @@ OSError_init(PyOSErrorObject *self, PyObject *args, PyObject *kwds)
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 @@ OSError_clear(PyOSErrorObject *self)
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 @@ OSError_traverse(PyOSErrorObject *self, visitproc visit,
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 @@ OSError_traverse(PyOSErrorObject *self, visitproc visit,
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 @@ OSError_reduce(PyOSErrorObject *self)
/* 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 @@ OSError_reduce(PyOSErrorObject *self)
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 @@ static PyMemberDef OSError_members[] = {
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")},
@@ -2327,7 +2379,7 @@ PyObject *PyExc_RecursionErrorInst = NULL;
}
#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 +2523,6 @@ _PyExc_Init(PyObject *bltinmod)
#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 +2640,134 @@ _PyExc_Fini(void)
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;
+}
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 98f42a9f34..596f909755 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -26,8 +26,8 @@ extern "C" {
/* 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 @@ stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
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 a08a85272c..05b7679553 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 @@ PyFloat_GetInfo(void)
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 @@ PyFloat_FromDouble(double fval)
return PyErr_NoMemory();
}
/* Inline PyObject_New */
- PyObject_INIT(op, &PyFloat_Type);
+ (void)PyObject_INIT(op, &PyFloat_Type);
op->ob_fval = fval;
return (PyObject *) op;
}
@@ -149,8 +144,9 @@ PyFloat_FromString(PyObject *v)
}
}
else if (PyObject_AsCharBuffer(v, &s, &len)) {
- PyErr_SetString(PyExc_TypeError,
- "float() argument must be a string or a number");
+ 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;
@@ -246,7 +242,7 @@ PyFloat_AsDouble(PyObject *op)
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 +1127,7 @@ float_hex(PyObject *v)
}
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 +1281,8 @@ float_fromhex(PyObject *cls, PyObject *arg)
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 +1338,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
/* 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 +1417,7 @@ Create a floating-point number from a hexadecimal string.\n\
>>> float.fromhex('0x1.ffffp10')\n\
2047.984375\n\
>>> float.fromhex('-0x1p-1074')\n\
--4.9406564584124654e-324");
+-5e-324");
static PyObject *
@@ -1711,7 +1707,7 @@ float__format__(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
return NULL;
- _PyUnicodeWriter_Init(&writer, 0);
+ _PyUnicodeWriter_Init(&writer);
ret = _PyFloat_FormatAdvancedWriter(
&writer,
self,
@@ -1858,7 +1854,7 @@ PyTypeObject PyFloat_Type = {
float_new, /* tp_new */
};
-void
+int
_PyFloat_Init(void)
{
/* We attempt to determine if this machine is using IEEE
@@ -1908,8 +1904,11 @@ _PyFloat_Init(void)
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 b31213098a..0d6229360e 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 PyMemberDef frame_memberlist[] = {
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 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
/* 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 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
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 @@ static int
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 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg)
}
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 @@ frame_clear(PyFrameObject *f)
*/
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 @@ frame_clear(PyFrameObject *f)
}
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 @@ PyDoc_STRVAR(sizeof__doc__,
"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 @@ PyTypeObject PyFrame_Type = {
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 @@ PyTypeObject PyFrame_Type = {
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 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
}
#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 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
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 @@ PyFrame_BlockPop(PyFrameObject *f)
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)
{
@@ -775,14 +791,19 @@ map_to_dict(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
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 @@ dict_to_map(PyObject *map, Py_ssize_t nmap, PyObject *dict, PyObject **values,
}
}
-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 @@ PyFrame_FastToLocals(PyFrameObject *f)
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 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
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 @@ void
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 49415b95e1..b04393415a 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
+ PyFunctionObject *op;
+ PyObject *doc, *consts, *module;
+ static PyObject *__name__ = NULL;
+
+ 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;
- 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.
- */
- 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);
}
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 2e74b8c939..08d30bf4b7 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -15,6 +15,31 @@ gen_traverse(PyGenObject *gen, visitproc visit, void *arg)
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 @@ gen_dealloc(PyGenObject *gen)
_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 @@ gen_dealloc(PyGenObject *gen)
PyObject_GC_Del(gen);
}
-
static PyObject *
gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
{
@@ -76,7 +96,6 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
/* 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 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
* 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 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc)
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 @@ gen_close(PyGenObject *gen, PyObject *args)
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 @@ PyTypeObject PyGen_Type = {
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 @@ PyTypeObject PyGen_Type = {
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 @@ PyGen_New(PyFrameObject *f)
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 3cfbeaf2e3..77ff8106fd 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 @@ iter_len(seqiterobject *it)
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 ae365770ea..fd5a72af8d 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -213,11 +213,11 @@ PyList_GetItem(PyObject *op, Py_ssize_t i)
}
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 @@ static PyObject *
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 @@ list_ass_slice(PyListObject *a, Py_ssize_t ilow, Py_ssize_t ihigh, PyObject *v)
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 @@ listextend(PyListObject *self, PyObject *b)
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 @@ listextend(PyListObject *self, PyObject *b)
}
/* 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 @@ listpop(PyListObject *self, PyObject *args)
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 @@ sortslice_advance(sortslice *slice, Py_ssize_t n)
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 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
PyObject **garbage;
size_t cur;
Py_ssize_t i;
+ int res;
if (slicelength <= 0)
return 0;
@@ -2526,14 +2534,14 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
}
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 @@ PyTypeObject PyList_Type = {
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 @@ listiter_reduce(listiterobject *it)
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 @@ listiter_reduce_general(void *_it, int forward)
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 2245ece899..7036c0ea4a 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 @@ maybe_small_long(PyLongObject *v)
/* 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 @@ maybe_small_long(PyLongObject *v)
*/
#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 @@ maybe_small_long(PyLongObject *v)
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 @@ _PyLong_FromNbInt(PyObject *integral)
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 @@ long
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 @@ _PyLong_AsInt(PyObject *obj)
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 @@ PyLong_AsSsize_t(PyObject *vv) {
unsigned long
PyLong_AsUnsignedLong(PyObject *vv)
{
- register PyLongObject *v;
+ PyLongObject *v;
unsigned long x, prev;
Py_ssize_t i;
@@ -575,7 +590,7 @@ PyLong_AsUnsignedLong(PyObject *vv)
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 @@ PyLong_AsUnsignedLong(PyObject *vv)
size_t
PyLong_AsSize_t(PyObject *vv)
{
- register PyLongObject *v;
+ PyLongObject *v;
size_t x, prev;
Py_ssize_t i;
@@ -632,7 +647,7 @@ PyLong_AsSize_t(PyObject *vv)
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 @@ _PyLong_AsUnsignedLongMask(PyObject *vv)
}
unsigned long
-PyLong_AsUnsignedLongMask(register PyObject *op)
+PyLong_AsUnsignedLongMask(PyObject *op)
{
PyLongObject *lo;
unsigned long val;
@@ -975,9 +990,6 @@ PyObject *
PyLong_FromVoidPtr(void *p)
{
#if SIZEOF_VOID_P <= SIZEOF_LONG
- /* special-case null pointer */
- if (!p)
- return PyLong_FromLong(0);
return PyLong_FromUnsignedLong((unsigned long)(Py_uintptr_t)p);
#else
@@ -987,9 +999,6 @@ PyLong_FromVoidPtr(void *p)
#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 @@ PyLong_AsVoidPtr(PyObject *vv)
* 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 @@ PyLong_AsLongLong(PyObject *vv)
{
PyLongObject *v;
PY_LONG_LONG bytes;
- int one = 1;
int res;
int do_decref = 0; /* if nb_int was called */
@@ -1220,7 +1227,7 @@ PyLong_AsLongLong(PyObject *vv)
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 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
{
PyLongObject *v;
unsigned PY_LONG_LONG bytes;
- int one = 1;
int res;
if (vv == NULL) {
@@ -1260,7 +1266,7 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
}
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 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
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 @@ _PyLong_AsUnsignedLongLongMask(PyObject *vv)
}
unsigned PY_LONG_LONG
-PyLong_AsUnsignedLongLongMask(register PyObject *op)
+PyLong_AsUnsignedLongLongMask(PyObject *op)
{
PyLongObject *lo;
unsigned PY_LONG_LONG val;
@@ -1325,7 +1331,6 @@ PyLong_AsUnsignedLongLongMask(register PyObject *op)
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 @@ PY_LONG_LONG
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 @@ long_to_decimal_string_internal(PyObject *aa,
*/
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 @@ long_to_decimal_string_internal(PyObject *aa,
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 @@ static int
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 @@ long_format_binary(PyObject *aa, int base, int alternate,
/* 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 @@ unsigned char _PyLong_DigitValue[256] = {
* 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 @@ long_from_binary_base(char **str, int base)
* 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 @@ that triggers it(!). Instead the code was tested by artificially allocating
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 @@ digit beyond the first.
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 @@ _PyLong_FromBytes(const char *s, Py_ssize_t len, int base)
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 @@ PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base)
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 @@ PyLong_FromUnicodeObject(PyObject *u, int base)
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 @@ long_divrem(PyLongObject *a, PyLongObject *b,
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 @@ PyLong_AsDouble(PyObject *v)
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 @@ x_sub(PyLongObject *a, PyLongObject *b)
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 @@ kmul_split(PyLongObject *n,
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 @@ k_lopsided_mul(PyLongObject *a, PyLongObject *b)
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 @@ long_mul(PyLongObject *a, PyLongObject *b)
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 @@ long_true_divide(PyObject *v, PyObject *w)
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 @@ long_true_divide(PyObject *v, PyObject *w)
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 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
Py_DECREF(c);
c = temp;
temp = NULL;
- NEGATE(c);
+ _PyLong_Negate(&c);
+ if (c == NULL)
+ goto Error;
}
/* if modulus == 1:
@@ -3964,10 +3983,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
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 @@ long_lshift(PyObject *v, PyObject *w)
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 @@ long_lshift(PyObject *v, PyObject *w)
++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 @@ long_lshift(PyObject *v, PyObject *w)
else
assert(!accum);
z = long_normalize(z);
- lshift_error:
return (PyObject *) maybe_small_long(z);
}
@@ -4153,7 +4170,7 @@ v_complement(digit *z, digit *a, Py_ssize_t m)
static PyObject *
long_bitwise(PyLongObject *a,
- int op, /* '&', '|', '^' */
+ char op, /* '&', '|', '^' */
PyLongObject *b)
{
int nega, negb, negz;
@@ -4328,8 +4345,7 @@ static PyObject *
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 @@ long_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ long__format__(PyObject *self, PyObject *args)
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 @@ _PyLong_Init(void)
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 189af88c6e..cb644b822b 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -2402,7 +2402,7 @@ static PyMappingMethods memory_as_mapping = {
/* 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 +2742,7 @@ memory_hash(PyMemoryViewObject *self)
}
/* 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 f0685dd606..f2616d4ef0 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -13,6 +13,15 @@ static int numfree = 0;
#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 @@ PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module)
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 @@ PyCFunction_GetFlags(PyObject *op)
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 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
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 @@ PyCFunction_Call(PyObject *func, PyObject *arg, PyObject *kw)
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 @@ meth_dealloc(PyCFunctionObject *m)
}
static PyObject *
-meth_get__doc__(PyCFunctionObject *m, void *closure)
+meth_reduce(PyCFunctionObject *m)
{
- const char *doc = m->m_ml->ml_doc;
+ PyObject *builtins;
+ PyObject *getattr;
+ _Py_IDENTIFIER(getattr);
- if (doc != NULL)
- return PyUnicode_FromString(doc);
- Py_INCREF(Py_None);
- return Py_None;
+ 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)
+{
+ return _PyType_GetDocFromInternalDoc(m->m_ml->ml_name, m->m_ml->ml_doc);
}
static PyObject *
@@ -211,6 +257,7 @@ static PyGetSetDef meth_getsets [] = {
{"__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 @@ PyTypeObject PyCFunction_Type = {
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 @@ _PyCFunction_DebugMallocStats(FILE *out)
"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 72978aef53..f509932a30 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -11,6 +11,8 @@ typedef struct {
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 PyTypeObject moduledef_type = {
};
+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 @@ PyModule_NewObject(PyObject *name)
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 @@ PyModule_GetState(PyObject* m)
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 @@ _PyModule_Clear(PyObject *m)
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 @@ module_init(PyModuleObject *m, PyObject *args, PyObject *kwds)
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 @@ static void
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 @@ module_dealloc(PyModuleObject *m)
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 @@ PyTypeObject PyModule_Type = {
(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 ff278d3347..720ac0d30f 100644
--- a/Objects/namespaceobject.c
+++ b/Objects/namespaceobject.c
@@ -44,7 +44,7 @@ namespace_init(_PyNamespaceObject *ns, PyObject *args, PyObject *kwds)
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 @@ namespace_dealloc(_PyNamespaceObject *ns)
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;
+
+ name = (Py_TYPE(ns) == &_PyNamespace_Type) ? "namespace"
+ : ns->ob_type->tp_name;
- i = Py_ReprEnter((PyObject *)ns);
+ 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 @@ namespace_repr(_PyNamespaceObject *ns)
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 @@ namespace_repr(_PyNamespaceObject *ns)
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 @@ error:
Py_XDECREF(d);
Py_XDECREF(keys);
Py_XDECREF(keys_iter);
- Py_ReprLeave((PyObject *)ns);
+ Py_ReprLeave(ns);
return repr;
}
@@ -158,14 +161,49 @@ namespace_clear(_PyNamespaceObject *ns)
}
+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 @@ PyTypeObject _PyNamespace_Type = {
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 e079d5104b..c634e707ba 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 @@ _Py_GetRefTotal(void)
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 @@ _PyObject_NewVar(PyTypeObject *tp, Py_ssize_t nitems)
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 @@ _PyObject_Dump(PyObject* op)
#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 @@ PyObject_Repr(PyObject *v)
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 @@ PyObject_Str(PyObject *v)
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 @@ PyObject_ASCII(PyObject *v)
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 *
PyObject_Bytes(PyObject *v)
{
PyObject *result, *func;
- _Py_IDENTIFIER(__bytes__);
if (v == NULL)
return PyBytes_FromString("<NULL>");
@@ -636,150 +731,6 @@ PyObject_RichCompareBool(PyObject *v, PyObject *w, int op)
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 @@ PyObject_HashNotImplemented(PyObject *v)
return -1;
}
-_Py_HashSecret_t _Py_HashSecret;
-
Py_hash_t
PyObject_Hash(PyObject *v)
{
@@ -859,7 +808,6 @@ _PyObject_IsAbstract(PyObject *obj)
{
int res;
PyObject* isabstract;
- _Py_IDENTIFIER(__isabstractmethod__);
if (obj == NULL)
return 0;
@@ -1032,8 +980,12 @@ PyObject_SelfIter(PyObject *obj)
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 @@ static PyObject *
_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 @@ static PyObject *
_dir_object(PyObject *obj)
{
PyObject *result, *sorted;
- _Py_IDENTIFIER(__dir__);
PyObject *dirfunc = _PyObject_LookupSpecial(obj, &PyId___dir__);
assert(obj);
@@ -1515,6 +1465,17 @@ NotImplemented_repr(PyObject *op)
}
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 @@ notimplemented_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
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 @@ PyTypeObject _PyNotImplemented_Type = {
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 @@ _Py_ReadyTypes(void)
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 @@ _Py_NewReference(PyObject *op)
}
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 @@ PyTypeObject *_PyCapsule_hack = &PyCapsule_Type;
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 @@ _PyObject_DebugTypeStats(FILE *out)
_PyFrame_DebugMallocStats(out);
_PyList_DebugMallocStats(out);
_PyMethod_DebugMallocStats(out);
- _PySet_DebugMallocStats(out);
_PyTuple_DebugMallocStats(out);
}
@@ -1901,8 +1841,6 @@ _PyObject_DebugTypeStats(FILE *out)
See dictobject.c and listobject.c for examples of use.
*/
-#define KEY "Py_Repr"
-
int
Py_ReprEnter(PyObject *obj)
{
@@ -1913,12 +1851,12 @@ Py_ReprEnter(PyObject *obj)
dict = PyThreadState_GetDict();
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 +1865,8 @@ Py_ReprEnter(PyObject *obj)
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 +1876,18 @@ Py_ReprLeave(PyObject *obj)
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 +1896,10 @@ Py_ReprLeave(PyObject *obj)
break;
}
}
+
+finally:
+ /* ignore exceptions because there is no way to report them. */
+ PyErr_Restore(error_type, error_value, error_traceback);
}
/* Trashcan support. */
@@ -1972,7 +1920,7 @@ void
_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 +1932,7 @@ _PyTrash_thread_deposit_object(PyObject *op)
{
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 c261b689be..004cfaac61 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 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
-#ifdef HAVE_MMAP
- #include <sys/mman.h>
- #ifdef MAP_ANONYMOUS
- #define ARENAS_USE_MMAP
+#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 @@ static size_t ntimes_arena_allocated = 0;
/* 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 @@ new_arena(void)
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 @@ new_arena(void)
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 @@ new_arena(void)
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 @@ int Py_ADDRESS_IN_RANGE(void *P, poolp pool) Py_NO_INLINE;
* 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 @@ PyObject_Malloc(size_t nbytes)
#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 @@ PyObject_Malloc(size_t nbytes)
* and free list are already initialized.
*/
bp = pool->freeblock;
+ assert(bp != NULL);
pool->freeblock = *(block **)bp;
UNLOCK();
return (void *)bp;
@@ -956,16 +1310,19 @@ redirect:
* 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 @@ PyObject_Free(void *p)
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 @@ PyObject_Free(void *p)
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 @@ PyObject_Free(void *p)
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 @@ redirect:
* 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 @@ PyObject_Realloc(void *p, size_t nbytes)
#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 @@ PyObject_Realloc(void *p, size_t nbytes)
}
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 @@ PyObject_Realloc(void *p, size_t nbytes)
* 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 @@ PyObject_Realloc(void *p, size_t nbytes)
/* 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)
-{
- return PyMem_MALLOC(n);
-}
-
-void *
-PyObject_Realloc(void *p, size_t n)
+Py_ssize_t
+_Py_GetAllocatedBlocks(void)
{
- return PyMem_REALLOC(p, n);
+ return 0;
}
-void
-PyObject_Free(void *p)
-{
- PyMem_FREE(p);
-}
#endif /* WITH_PYMALLOC */
#ifdef PYMALLOC_DEBUG
@@ -1316,10 +1652,6 @@ PyObject_Free(void *p)
#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 @@ pool_is_in_list(const poolp target, poolp list)
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,58 +1736,18 @@ p[2*S: 2*S+n]
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)
-{
- 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)
+static void *
+_PyMem_DebugMalloc(void *ctx, 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 */
@@ -1464,14 +1758,14 @@ _PyObject_DebugMallocApi(char id, size_t nbytes)
/* overflow: can't represent total as a size_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,35 +1783,37 @@ _PyObject_DebugMallocApi(char id, size_t nbytes)
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;
@@ -1525,24 +1821,26 @@ _PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
/* overflow: can't represent total as a size_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 @@ _PyObject_DebugReallocApi(char api, void *p, size_t nbytes)
* 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 @@ error:
}
/* 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 f2030c3cd2..d6b42793b1 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -318,195 +318,6 @@ range_item(rangeobject *r, Py_ssize_t i)
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 @@ compute_slice(rangeobject *r, PyObject *_slice)
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 @@ compute_slice(rangeobject *r, PyObject *_slice)
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 ea5a24c516..34e43b92de 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);
-}
-
-/* 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() */
+static PyObject _dummy_struct;
-#ifdef Py_REF_DEBUG
-PyObject *
-_PySet_Dummy(void)
-{
- return dummy;
-}
-#endif
+#define dummy (&_dummy_struct)
-#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)
+/* ======================================================================== */
+/* ======= Begin logic for probing the hash table ========================= */
-/* Reuse scheme to save calls to malloc, free, and memset */
-#ifndef PySet_MAXFREELIST
-#define PySet_MAXFREELIST 80
+/* Set this to zero to turn-off linear probing */
+#ifndef LINEAR_PROBES
+#define LINEAR_PROBES 9
#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.
-*/
+/* This must be >= 1 */
+#define PERTURB_SHIFT 5
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;
-
- i = (size_t)hash & mask;
- entry = &table[i];
- if (entry->key == NULL || entry->key == key)
+ 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;
+
+ 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 (cmp > 0)
- return entry;
- }
- else {
- /* The compare did major nasty stuff to the
- * set: start over.
- */
+ if (table != so->table || entry->key != startkey)
return set_lookkey(so, key, hash);
- }
+ if (cmp > 0)
+ return entry;
}
- freeslot = NULL;
- }
+ if (entry->key == dummy && freeslot == NULL)
+ freeslot = entry;
- /* 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) {
- 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) {
+ 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)
- break;
- }
- else {
- /* The compare did major nasty stuff to the
- * set: start over.
- */
- return set_lookkey(so, key, hash);
+ return entry;
}
+ if (entry->key == dummy && freeslot == NULL)
+ freeslot = entry;
}
- else 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;
}
- return entry;
+ found_null:
+ return freeslot == NULL ? entry : freeslot;
}
/*
@@ -157,14 +121,15 @@ set_lookkey(PySetObject *so, PyObject *key, register Py_hash_t hash)
* 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 @@ set_lookkey_unicode(PySetObject *so, PyObject *key, register Py_hash_t hash)
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)
+
+ entry = &table[i & mask];
+ if (entry->key == NULL)
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;
+ 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 @@ set_insert_key(register PySetObject *so, PyObject *key, Py_hash_t hash)
entry->key = key;
entry->hash = hash;
so->used++;
- Py_DECREF(dummy);
} else {
/* ACTIVE */
Py_DECREF(key);
@@ -239,35 +251,6 @@ set_insert_key(register PySetObject *so, PyObject *key, Py_hash_t hash)
}
/*
-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 @@ set_table_resize(PySetObject *so, Py_ssize_t minused)
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 @@ set_table_resize(PySetObject *so, Py_ssize_t minused)
/* 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 @@ set_add_entry(register PySetObject *so, setentry *entry)
}
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 @@ set_add_key(register PySetObject *so, PyObject *key)
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 @@ set_discard_entry(PySetObject *so, setentry *oldentry)
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 @@ set_discard_entry(PySetObject *so, setentry *oldentry)
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 @@ set_discard_key(PySetObject *so, PyObject *key)
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 @@ set_clear_internal(PySetObject *so)
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 @@ set_clear_internal(PySetObject *so)
*/
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 @@ set_clear_internal(PySetObject *so)
*/
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 @@ set_clear_internal(PySetObject *so)
#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 @@ set_next(PySetObject *so, Py_ssize_t *pos_ptr, setentry **entry_ptr)
{
Py_ssize_t i;
Py_ssize_t mask;
- register setentry *table;
+ setentry *table;
assert (PyAnySet_Check(so));
i = *pos_ptr;
@@ -553,7 +536,7 @@ set_next(PySetObject *so, Py_ssize_t *pos_ptr, setentry **entry_ptr)
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 @@ set_dealloc(PySetObject *so)
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 @@ set_merge(PySetObject *so, PyObject *otherset)
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 @@ set_contains_entry(PySetObject *so, setentry *entry)
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 @@ set_pop(PySetObject *so)
}
}
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 @@ set_traverse(PySetObject *so, visitproc visit, void *arg)
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 @@ frozenset_hash(PyObject *self)
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 PyMethodDef setiter_methods[] = {
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 @@ PyDoc_STRVAR(update_doc,
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 @@ frozenset_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ set_remove(PySetObject *so, PyObject *key)
}
if (rv == DISCARD_NOTFOUND) {
- set_key_error(key);
+ _PyErr_SetKeyError(key);
return NULL;
}
Py_RETURN_NONE;
@@ -2396,6 +2355,9 @@ _PySet_Update(PyObject *set, PyObject *iterable)
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 @@ test_c_api(PySetObject *so)
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 @@ test_c_api(PySetObject *so)
#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 1593335263..104952333a 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -33,6 +33,17 @@ ellipsis_repr(PyObject *op)
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 @@ PyTypeObject PyEllipsis_Type = {
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 @@ static PyMemberDef slice_members[] = {
{0}
};
+/* Helper function to convert a slice argument to a PyLong, and raise TypeError
+ with a suitable message on failure. */
+
static PyObject*
-slice_indices(PySliceObject* self, PyObject* len)
+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)
{
- Py_ssize_t ilen, start, stop, step, slicelength;
+ 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;
+ }
- ilen = PyNumber_AsSsize_t(len, PyExc_OverflowError);
+ /* Find lower and upper bounds for start and stop. */
+ if (step_is_negative) {
+ lower = PyLong_FromLong(-1L);
+ if (lower == NULL)
+ goto error;
- if (ilen == -1 && PyErr_Occurred()) {
- return NULL;
+ upper = PyNumber_Add(length, lower);
+ if (upper == NULL)
+ goto error;
}
+ else {
+ lower = PyLong_FromLong(0L);
+ if (lower == NULL)
+ goto error;
- if (PySlice_GetIndicesEx((PyObject*)self, ilen, &start, &stop,
- &step, &slicelength) < 0) {
+ 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)
+{
+ PyObject *start, *stop, *step;
+ PyObject *length;
+ int error;
+
+ /* Convert length to an integer if necessary; raise for negative length. */
+ length = PyNumber_Index(len);
+ if (length == NULL)
+ return NULL;
+
+ if (_PyLong_Sign(length) < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "length should not be negative");
+ Py_DECREF(length);
return NULL;
}
- return Py_BuildValue("(nnn)", start, stop, step);
+ error = _PySlice_GetLongIndices(self, length, &start, &stop, &step);
+ Py_DECREF(length);
+ if (error == -1)
+ return NULL;
+ else
+ return Py_BuildValue("(NNN)", start, stop, step);
}
PyDoc_STRVAR(slice_indices_doc,
diff --git a/Objects/stringlib/asciilib.h b/Objects/stringlib/asciilib.h
index f62813d2fd..d0fc18d22f 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 f353367013..2eb2d1412f 100644
--- a/Objects/stringlib/codecs.h
+++ b/Objects/stringlib/codecs.h
@@ -38,8 +38,8 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end,
*/
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 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end,
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 @@ STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e,
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 @@ STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e,
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 @@ STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e,
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 @@ IllegalSurrogate:
#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 @@ STRINGLIB(utf16_encode)(unsigned short *out,
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
-#undef SWAB2
}
+#endif
+
#endif /* STRINGLIB_IS_UNICODE */
diff --git a/Objects/stringlib/eq.h b/Objects/stringlib/eq.h
index 3e5f510e36..f8fd384a37 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 55ac77dd70..cd7cac40fa 100644
--- a/Objects/stringlib/fastsearch.h
+++ b/Objects/stringlib/fastsearch.h
@@ -142,6 +142,8 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
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 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
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 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
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 06559c8a9f..eb3fe886e2 100644
--- a/Objects/stringlib/find_max_char.h
+++ b/Objects/stringlib/find_max_char.h
@@ -24,7 +24,7 @@ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end)
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 @@ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end)
#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 0000000000..5568b31dab
--- /dev/null
+++ b/Objects/stringlib/join.h
@@ -0,0 +1,133 @@
+/* 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
+ * buffer-compatible.
+ */
+ for (i = 0, nbufs = 0; i < seqlen; i++) {
+ Py_ssize_t itemlen;
+ item = PySequence_Fast_GET_ITEM(seq, i);
+ if (_getbuffer(item, &buffers[i]) < 0) {
+ PyErr_Format(PyExc_TypeError,
+ "sequence item %zd: expected bytes, bytearray, "
+ "or an object with the buffer interface, %.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 40cb5129d5..ed32a6f2b3 100644
--- a/Objects/stringlib/partition.h
+++ b/Objects/stringlib/partition.h
@@ -29,6 +29,11 @@ STRINGLIB(partition)(PyObject* str_obj,
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 @@ STRINGLIB(rpartition)(PyObject* str_obj,
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 0000000000..ef318ed6dd
--- /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 947dd28e6c..31f77a7724 100644
--- a/Objects/stringlib/split.h
+++ b/Objects/stringlib/split.h
@@ -345,8 +345,8 @@ STRINGLIB(splitlines)(PyObject* str_obj,
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 7bb91a7a5b..ce27f3e408 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 90fa129b32..dd00976eac 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;
size_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 e8c6fcb85f..ce1eb57f0d 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 45e572963d..f900cb65f8 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 647a27e233..86a480f1e3 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 03117ec443..f9d3f1d332 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 d4719a578b..aec221acff 100644
--- a/Objects/stringlib/unicode_format.h
+++ b/Objects/stringlib/unicode_format.h
@@ -543,7 +543,7 @@ done:
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 @@ parse_field(SubString *str, SubString *field_name, SubString *format_spec,
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 @@ parse_field(SubString *str, SubString *field_name, SubString *format_spec,
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 if (c != '}') {
+ PyErr_SetString(PyExc_ValueError, "expected '}' before end of string");
+ return 0;
}
- else
- /* end of string, there's no format_spec or conversion */
- field_name->end = str->start;
return 1;
}
@@ -638,10 +668,9 @@ MarkupIterator_next(MarkupIterator *self, SubString *literal,
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 @@ MarkupIterator_next(MarkupIterator *self, SubString *literal,
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 @@ do_markup(SubString *input, PyObject *args, PyObject *kwargs,
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 @@ build_string(SubString *input, PyObject *args, PyObject *kwargs,
int recursion_depth, AutoNumber *auto_number)
{
_PyUnicodeWriter writer;
- Py_ssize_t minlen;
/* check the recursion level */
if (recursion_depth <= 0) {
@@ -929,8 +911,9 @@ build_string(SubString *input, PyObject *args, PyObject *kwargs,
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 f16f21e60c..3db5629e11 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 c3b9a72989..664344be6c 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -11,17 +11,20 @@ static char unnamed_fields_key[] = "n_unnamed_fields";
/* 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 @@ static void
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 @@ structseq_repr(PyStructSequence *obj)
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 @@ structseq_reduce(PyStructSequence* self)
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 @@ structseq_reduce(PyStructSequence* self)
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 @@ structseq_reduce(PyStructSequence* self)
Py_DECREF(dict);
return result;
+
+error:
+ Py_XDECREF(tup);
+ Py_XDECREF(dict);
+ return NULL;
}
static PyMethodDef structseq_methods[] = {
@@ -315,12 +320,13 @@ static PyTypeObject _struct_sequence_template = {
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 @@ PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
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 @@ PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc)
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 f81559504f..6fd4db3ae0 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -63,9 +63,9 @@ _PyTuple_DebugMallocStats(FILE *out)
}
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 @@ PyTuple_New(register Py_ssize_t size)
}
Py_ssize_t
-PyTuple_Size(register PyObject *op)
+PyTuple_Size(PyObject *op)
{
if (!PyTuple_Check(op)) {
PyErr_BadInternalCall();
@@ -133,7 +133,7 @@ PyTuple_Size(register PyObject *op)
}
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 @@ PyTuple_GetItem(register PyObject *op, register Py_ssize_t i)
}
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 @@ PyTuple_Pack(Py_ssize_t n, ...)
/* 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 @@ static PyObject *
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 @@ tuplerepr(PyTupleObject *v)
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 (_PyUnicodeWriter_WriteStr(&writer, s) < 0) {
+ Py_DECREF(s);
goto error;
- if (s == NULL || _PyAccu_Accumulate(&acc, s))
+ }
+ Py_DECREF(s);
+ }
+
+ writer.overallocate = 0;
+ if (n > 1) {
+ if (_PyUnicodeWriter_WriteChar(&writer, ')') < 0)
+ goto error;
+ }
+ else {
+ if (_PyUnicodeWriter_WriteASCIIString(&writer, ",)", 2) < 0)
goto error;
- Py_CLEAR(s);
}
- if (n > 1)
- s = PyUnicode_FromString(")");
- else
- s = PyUnicode_FromString(",)");
- if (s == NULL || _PyAccu_Accumulate(&acc, s))
- 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;
}
@@ -322,15 +332,18 @@ error:
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 @@ tuplecontains(PyTupleObject *a, PyObject *el)
}
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 @@ tupleitem(register PyTupleObject *a, register Py_ssize_t i)
}
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 @@ PyTuple_GetSlice(PyObject *op, Py_ssize_t i, Py_ssize_t j)
}
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 @@ PyTypeObject PyTuple_Type = {
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 @@ PyTuple_Fini(void)
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 @@ static PyObject *
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 @@ tupleiter_reduce(tupleiterobject *it)
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 8851faeeee..df8f351238 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -35,19 +35,127 @@ struct method_cache_entry {
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 @@ PyType_Modified(PyTypeObject *type)
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 @@ type_set_qualname(PyTypeObject *type, PyObject *value, void *context)
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 @@ type_module(PyTypeObject *type, void *context)
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_abstractmethods(PyTypeObject *type, void *context)
/* 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 @@ type_set_abstractmethods(PyTypeObject *type, PyObject *value, void *context)
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 mro_internal(PyTypeObject *);
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 @@ mro_subclasses(PyTypeObject *type, PyObject* temp)
{
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 @@ type_set_bases(PyTypeObject *type, PyObject *value, void *context)
/* 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 @@ static PyObject *
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 @@ type_get_doc(PyTypeObject *type, void *context)
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 @@ static PyGetSetDef type_getsets[] = {
(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 @@ type_repr(PyTypeObject *type)
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 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 @@ PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
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 @@ subtype_dealloc(PyObject *self)
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 @@ subtype_dealloc(PyObject *self)
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 @@ subtype_dealloc(PyObject *self)
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 @@ pmerge(PyObject *acc, PyObject* to_merge) {
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 @@ pmerge(PyObject *acc, PyObject* to_merge) {
}
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 @@ type_init(PyObject *cls, PyObject *args, PyObject *kwds)
return res;
}
-long
+unsigned long
PyType_GetFlags(PyTypeObject *type)
{
return type->tp_flags;
@@ -2108,7 +2253,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
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 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
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 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
/* 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 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
/* 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,6 +2472,9 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
type->tp_dictoffset = slotoffset;
slotoffset += sizeof(PyObject *);
}
+ else if (!type->tp_dictoffset) {
+ type->tp_dictoffset = base->tp_dictoffset;
+ }
if (type->tp_dictoffset) {
et->ht_cached_keys = _PyDict_NewKeysForClass();
}
@@ -2401,7 +2551,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
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 +2572,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
type->tp_name = spec->name;
if (!type->tp_name)
goto fail;
-
+
/* Adjust for empty tuple bases */
if (!bases) {
base = &PyBaseObject_Type;
@@ -2482,11 +2632,14 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
/* 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;
}
}
@@ -2506,7 +2659,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
/* 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 +2676,19 @@ PyType_FromSpec(PyType_Spec *spec)
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 +2861,14 @@ static void
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 +2893,7 @@ static PyObject *
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 +2901,9 @@ type_subclasses(PyTypeObject *type, PyObject *args_ignored)
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 +3036,8 @@ static PyMethodDef type_methods[] = {
};
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 +3094,8 @@ type_clear(PyTypeObject *type)
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 +3312,7 @@ object_repr(PyObject *self)
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>",
@@ -3313,7 +3484,7 @@ object_set_class(PyObject *self, PyObject *value, void *closure)
"__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,151 +3537,424 @@ import_copyreg(void)
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);
+ getstate = _PyObject_GetAttrId(obj, &PyId___getstate__);
+ if (getstate == NULL) {
+ PyObject *slotnames;
- 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;
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ return NULL;
}
- }
- else {
PyErr_Clear();
- args = PyTuple_New(0);
- }
- if (args == NULL)
- goto end;
- getstate = _PyObject_GetAttrId(obj, &PyId___getstate__);
- if (getstate != NULL) {
- state = PyObject_CallObject(getstate, NULL);
- Py_DECREF(getstate);
- if (state == NULL)
- goto end;
- }
- 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));
+ {
+ 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)
- 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++) {
+ 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(names, i);
+
+ name = PyList_GET_ITEM(slotnames, i);
value = PyObject_GetAttr(obj, name);
- if (value == NULL)
+ 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);
+ int err = PyDict_SetItem(slots, name, value);
Py_DECREF(value);
- if (err)
- goto end;
- n++;
+ 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 (n) {
- state = Py_BuildValue("(NO)", state, slots);
- if (state == NULL)
- goto end;
+
+ /* 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)
+ return NULL;
+ }
+
+ 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;
newobj = _PyObject_GetAttrId(copyreg, &PyId___newobj__);
@@ -3521,6 +3965,7 @@ reduce_2(PyObject *obj)
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 +3979,7 @@ reduce_2(PyObject *obj)
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 +4007,9 @@ _common_reduce(PyObject *self, int proto)
{
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 +4114,9 @@ object_format(PyObject *self, PyObject *args)
/* 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 +4226,8 @@ PyTypeObject PyBaseObject_Type = {
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 +4271,7 @@ add_methods(PyTypeObject *type, PyMethodDef *meth)
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 +4541,10 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
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. */
@@ -4252,14 +4694,20 @@ PyType_Ready(PyTypeObject *type)
*/
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 +4751,11 @@ PyType_Ready(PyTypeObject *type)
/* 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 +4772,57 @@ PyType_Ready(PyTypeObject *type)
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 +5179,18 @@ wrap_call(PyObject *self, PyObject *args, void *wrapped, PyObject *kwds)
}
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;
@@ -4891,8 +5357,9 @@ tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds)
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 +5370,7 @@ add_tp_new_wrapper(PyTypeObject *type)
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 +5482,6 @@ FUNCNAME(PyObject *self, ARG1TYPE arg1, ARG2TYPE arg2) \
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 +5542,6 @@ static int
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 +5591,6 @@ static int
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 +5641,6 @@ slot_nb_bool(PyObject *self)
PyObject *func, *args;
int result = -1;
int using_len = 0;
- _Py_IDENTIFIER(__len__);
_Py_IDENTIFIER(__bool__);
func = lookup_maybe(self, &PyId___bool__);
@@ -5281,28 +5742,11 @@ slot_tp_str(PyObject *self)
_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 +6042,6 @@ slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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 +6065,12 @@ slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
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 +6087,6 @@ slot_tp_del(PyObject *self)
/* 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 +6131,22 @@ typedef struct wrapperbase slotdef;
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 +6154,85 @@ static slotdef slotdefs[] = {
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 +6244,9 @@ static slotdef slotdefs[] = {
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,
@@ -5863,45 +6276,48 @@ static slotdef slotdefs[] = {
IBSLOT("__itruediv__", nb_inplace_true_divide,
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 +6600,14 @@ recurse_down_subclasses(PyTypeObject *type, PyObject *name,
{
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 +6753,8 @@ super_getattro(PyObject *self, PyObject *name)
/* 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) {
@@ -6545,8 +6960,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
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 a572c12bcc..ea540d605d 100644
--- a/Objects/unicodectype.c
+++ b/Objects/unicodectype.c
@@ -61,7 +61,7 @@ gettyperecord(Py_UCS4 code)
/* 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 4085d22b71..ec22239d3b 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -47,13 +47,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#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 @@ extern "C" {
/* 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 @@ extern "C" {
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 @@ static PyObject *unicode_empty = NULL;
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 @@ unicode_result_wchar(PyObject *unicode)
#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 @@ unicode_result_wchar(PyObject *unicode)
}
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 @@ unicode_result_ready(PyObject *unicode)
}
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 OSVERSIONINFOEX winver;
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 @@ static BLOOM_MASK bloom_linebreak = ~(BLOOM_MASK)0;
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 @@ make_bloom_mask(int kind, void* ptr, Py_ssize_t len)
#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 @@ make_bloom_mask(int kind, void* ptr, Py_ssize_t len)
#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 @@ make_bloom_mask(int kind, void* ptr, Py_ssize_t len)
#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 @@ Py_LOCAL_INLINE(Py_ssize_t) findchar(void *s, int kind,
}
}
+#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 @@ resize_compact(PyObject *unicode, Py_ssize_t length)
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 @@ resize_compact(PyObject *unicode, Py_ssize_t length)
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 @@ resize_inplace(PyObject *unicode, Py_ssize_t length)
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 @@ resize_inplace(PyObject *unicode, Py_ssize_t length)
}
_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 @@ resize_copy(PyObject *unicode, Py_ssize_t length)
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 @@ resize_copy(PyObject *unicode, Py_ssize_t length)
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 @@ _PyUnicode_New(Py_ssize_t length)
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_New(Py_ssize_t length)
*/
_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;
}
@@ -1078,11 +1135,7 @@ PyUnicode_New(Py_ssize_t size, Py_UCS4 maxchar)
}
}
#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 +1565,7 @@ _PyUnicode_Ready(PyObject *unicode)
}
static void
-unicode_dealloc(register PyObject *unicode)
+unicode_dealloc(PyObject *unicode)
{
switch (PyUnicode_CHECK_INTERNED(unicode)) {
case SSTATE_NOT_INTERNED:
@@ -1644,38 +1697,6 @@ PyUnicode_Resize(PyObject **p_unicode, Py_ssize_t length)
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 +1713,14 @@ unicode_write_cstr(PyObject *unicode, Py_ssize_t index,
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 +1749,6 @@ unicode_write_cstr(PyObject *unicode, Py_ssize_t index,
}
}
-
static PyObject*
get_latin1_char(unsigned char ch)
{
@@ -1737,6 +1765,34 @@ get_latin1_char(unsigned char ch)
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 +1990,8 @@ _PyUnicode_FromUCS2(const Py_UCS2 *u, Py_ssize_t size)
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 +2016,8 @@ _PyUnicode_FromUCS4(const Py_UCS4 *u, Py_ssize_t size)
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 +2293,7 @@ PyUnicode_AsUCS4Copy(PyObject *string)
#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 +2313,9 @@ PyUnicode_FromWideChar(register const wchar_t *w, Py_ssize_t size)
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,44 +2340,139 @@ makefmt(char *fmt, int longflag, int longlongflag, int size_tflag,
*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;
- /* parse the width.precision part, e.g. "%2.5s" => width=2, precision=5 */
+ p = f;
f++;
- width = 0;
- while (Py_ISDIGIT((unsigned)*f))
- width = (width*10) + *f++ - '0';
- precision = 0;
+ zeropad = 0;
+ if (*f == '0') {
+ zeropad = 1;
+ f++;
+ }
+
+ /* parse the width.precision part, e.g. "%2.5s" => width=2, precision=5 */
+ 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 (*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;
@@ -2367,499 +2491,284 @@ parse_format_flags(const char *f,
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;
- 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)
+ if (f[1] == '\0')
+ writer->overallocate = 0;
-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;
+ 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;
+ }
- 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++) {
- 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;
+ 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;
- else if (*f == 'd' || *f=='u' || *f=='i' || *f=='x' || *f=='p') {
+ 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
- if (longlongflag) {
- if (width < MAX_LONG_LONG_CHARS)
- width = MAX_LONG_LONG_CHARS;
- }
- else
+ else if (longlongflag)
+ len = sprintf(buffer, fmt,
+ va_arg(*vargs, unsigned PY_LONG_LONG));
#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 (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;
}
- 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);
+
+ 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;
}
- /* 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();
+
+ 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;
}
- callresult = callresults;
+ else {
+ assert(str != NULL);
+ if (unicode_fromformat_write_cstr(writer, str, width, precision) < 0)
+ return NULL;
+ }
+ break;
}
- /* step 2.5: allocate memory for the results of formating numbers */
- if (numbersize) {
- numberresults = PyObject_Malloc(numbersize);
- if (!numberresults) {
- PyErr_NoMemory();
- goto fail;
+
+ 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;
}
- numberresult = numberresults;
+ Py_DECREF(str);
+ break;
}
- /* 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;
+ 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;
+ }
- 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;
+ 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;
+}
+
+PyObject *
+PyUnicode_FromFormatV(const char *format, va_list vargs)
+{
+ va_list vargs2;
+ const char *f;
+ _PyUnicodeWriter writer;
+
+ _PyUnicodeWriter_Init(&writer);
+ writer.min_length = strlen(format) + 100;
+ writer.overallocate = 1;
- for (i = 0, f = format; *f; f++) {
+ /* 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 == '%') {
- const char* p;
+ f = unicode_fromformat_arg(&writer, f, &vargs2);
+ if (f == NULL)
+ goto fail;
+ }
+ else {
+ const char *p;
+ Py_ssize_t len;
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':
+ do
{
- 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);
+ 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;
}
- ++callresult;
- break;
+ p++;
}
- 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;
- }
- }
- }
- else {
- assert(i < PyUnicode_GET_LENGTH(string));
- PyUnicode_WRITE(kind, data, i++, *f);
+ while (*p != '\0' && *p != '%');
+ len = p - f;
+
+ if (*p == '\0')
+ writer.overallocate = 0;
+
+ if (_PyUnicodeWriter_WriteASCIIString(&writer, f, len) < 0)
+ goto fail;
+
+ f = p;
}
}
- assert(i == PyUnicode_GET_LENGTH(string));
+ return _PyUnicodeWriter_Finish(&writer);
- 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;
- }
- PyObject_Free(callresults);
- }
- if (numberresults)
- PyObject_Free(numberresults);
+ _PyUnicodeWriter_Dealloc(&writer);
return NULL;
}
@@ -2966,26 +2875,17 @@ PyUnicode_AsWideCharString(PyObject *unicode,
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 ?! */
@@ -3007,7 +2907,7 @@ PyUnicode_FromObject(register PyObject *obj)
}
PyObject *
-PyUnicode_FromEncodedObject(register PyObject *obj,
+PyUnicode_FromEncodedObject(PyObject *obj,
const char *encoding,
const char *errors)
{
@@ -3059,14 +2959,17 @@ PyUnicode_FromEncodedObject(register PyObject *obj,
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;
}
@@ -3108,7 +3011,8 @@ PyUnicode_Decode(const char *s,
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)
@@ -3134,8 +3038,10 @@ PyUnicode_Decode(const char *s,
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;
}
@@ -3193,8 +3099,10 @@ PyUnicode_AsDecodedUnicode(PyObject *unicode,
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;
}
@@ -3342,7 +3250,7 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors)
}
if (surrogateescape) {
- /* locale encoding with surrogateescape */
+ /* "surrogateescape" error handler */
char *str;
str = _Py_wchar2char(wstr, &error_pos);
@@ -3362,6 +3270,7 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors)
PyMem_Free(str);
}
else {
+ /* strict mode */
size_t len, len2;
len = wcstombs(NULL, wstr, 0);
@@ -3400,7 +3309,7 @@ encode_error:
wstr = _Py_char2wchar(errmsg, &errlen);
if (wstr != NULL) {
reason = PyUnicode_FromWideChar(wstr, errlen);
- PyMem_Free(wstr);
+ PyMem_RawFree(wstr);
} else
errmsg = NULL;
}
@@ -3478,7 +3387,8 @@ PyUnicode_AsEncodedString(PyObject *unicode,
}
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)
@@ -3503,7 +3413,8 @@ PyUnicode_AsEncodedString(PyObject *unicode,
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);
@@ -3516,8 +3427,10 @@ PyUnicode_AsEncodedString(PyObject *unicode,
}
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;
}
@@ -3543,8 +3456,10 @@ PyUnicode_AsEncodedUnicode(PyObject *unicode,
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;
}
@@ -3607,8 +3522,8 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
return NULL;
}
- if (surrogateescape)
- {
+ if (surrogateescape) {
+ /* "surrogateescape" error handler */
wstr = _Py_char2wchar(str, &wlen);
if (wstr == NULL) {
if (wlen == (size_t)-1)
@@ -3619,9 +3534,10 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
}
unicode = PyUnicode_FromWideChar(wstr, wlen);
- PyMem_Free(wstr);
+ PyMem_RawFree(wstr);
}
else {
+ /* strict mode */
#ifndef HAVE_BROKEN_MBSTOWCS
wlen = mbstowcs(NULL, str, 0);
#else
@@ -3641,7 +3557,6 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
return PyErr_NoMemory();
}
- /* This shouldn't fail now */
wlen2 = mbstowcs(wstr, str, wlen+1);
if (wlen2 == (size_t)-1) {
if (wstr != smallbuf)
@@ -3667,7 +3582,7 @@ decode_error:
wstr = _Py_char2wchar(errmsg, &errlen);
if (wstr != NULL) {
reason = PyUnicode_FromWideChar(wstr, errlen);
- PyMem_Free(wstr);
+ PyMem_RawFree(wstr);
} else
errmsg = NULL;
}
@@ -3735,18 +3650,20 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
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)
{
@@ -3850,6 +3767,7 @@ PyUnicode_AsUTF8AndSize(PyObject *unicode, Py_ssize_t *psize)
return NULL;
_PyUnicode_UTF8(unicode) = PyObject_MALLOC(PyBytes_GET_SIZE(bytes) + 1);
if (_PyUnicode_UTF8(unicode) == NULL) {
+ PyErr_NoMemory();
Py_DECREF(bytes);
return NULL;
}
@@ -4018,6 +3936,9 @@ PyUnicode_GetLength(PyObject *unicode)
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;
@@ -4026,7 +3947,9 @@ PyUnicode_ReadChar(PyObject *unicode, Py_ssize_t index)
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
@@ -4084,6 +4007,7 @@ onError:
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
@@ -4092,11 +4016,12 @@ onError:
*/
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";
@@ -4107,12 +4032,11 @@ unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler,
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);
@@ -4137,8 +4061,6 @@ unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler,
}
if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, &repunicode, &newpos))
goto onError;
- if (PyUnicode_READY(repunicode) == -1)
- goto onError;
/* Copy back the bytes variables, which might have been modified by the
callback */
@@ -4162,54 +4084,118 @@ unicode_decode_call_errorhandler(const char *errors, PyObject **errorHandler,
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 + replen + insize-newpos;
- if (requiredsize > outsize) {
- if (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)
+ 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 + repwlen + insize-newpos;
+ if (requiredsize > outsize) {
+ if (requiredsize < 2*outsize)
+ requiredsize = 2*outsize;
+ if (unicode_resize(output, requiredsize) < 0)
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)
+ wcsncpy(_PyUnicode_WSTR(*output) + *outpos, repwstr, repwlen);
+ *outpos += repwlen;
+
+ *endinpos = newpos;
+ *inptr = *input + newpos;
+
+ /* we made it! */
+ Py_XDECREF(restuple);
+ return 0;
+
+ 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;
- /* 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 + repwlen + insize-newpos;
- if (requiredsize > outsize) {
- if (requiredsize < 2*outsize)
- requiredsize = 2*outsize;
- if (unicode_resize(output, requiredsize) < 0)
- goto onError;
- }
- wcsncpy(_PyUnicode_WSTR(*output) + *outpos, repwstr, repwlen);
- *outpos += repwlen;
}
+
+ 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
+ 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;
+ }
+
+ if (PyUnicode_READY(repunicode) < 0)
+ goto onError;
+ replen = PyUnicode_GET_LENGTH(repunicode);
+ writer->min_length += replen;
+ if (replen > 1)
+ writer->overallocate = 1;
+ 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;
+ return -1;
}
/* --- UTF-7 Codec -------------------------------------------------------- */
@@ -4317,9 +4303,8 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
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;
@@ -4329,17 +4314,17 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
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) {
@@ -4362,13 +4347,13 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
/* 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;
}
@@ -4378,7 +4363,7 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
surrogate = outCh;
}
else {
- if (unicode_putchar(&unicode, &outpos, outCh) < 0)
+ if (_PyUnicodeWriter_WriteCharInline(&writer, outCh) < 0)
goto onError;
}
}
@@ -4387,7 +4372,7 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
inShift = 0;
s++;
if (surrogate) {
- if (unicode_putchar(&unicode, &outpos, surrogate) < 0)
+ if (_PyUnicodeWriter_WriteCharInline(&writer, surrogate) < 0)
goto onError;
surrogate = 0;
}
@@ -4408,7 +4393,7 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
if (ch != '-') {
/* '-' is absorbed; other terminating
characters are preserved */
- if (unicode_putchar(&unicode, &outpos, ch) < 0)
+ if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
goto onError;
}
}
@@ -4418,20 +4403,20 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
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;
@@ -4442,11 +4427,11 @@ PyUnicode_DecodeUTF7Stateful(const char *s,
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;
}
@@ -4458,11 +4443,11 @@ utf7Error:
(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;
@@ -4473,32 +4458,29 @@ utf7Error:
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;
}
@@ -4581,7 +4563,7 @@ encode_char:
/* 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;
@@ -4682,9 +4664,9 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
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)
@@ -4707,8 +4689,8 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest)
/* 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)
@@ -4733,10 +4715,9 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
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;
@@ -4757,29 +4738,26 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
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) {
@@ -4803,35 +4781,31 @@ PyUnicode_DecodeUTF8Stateful(const char *s,
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;
}
@@ -4841,7 +4815,7 @@ onError:
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)
@@ -4854,7 +4828,7 @@ _Py_DecodeUTF8_surrogateescape(const char *s, Py_ssize_t size)
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;
@@ -4977,17 +4951,11 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
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;
@@ -5001,107 +4969,118 @@ PyUnicode_DecodeUTF32Stateful(const char *s,
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;
- }
-#else
- if (bom == 0x0000FEFF) {
- q += 4;
- bo = 1;
- }
- else if (bom == 0xFFFE0000) {
- q += 4;
- bo = -1;
- }
-#endif
+ 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 (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;
+ if (q == e) {
+ if (consumed)
+ *consumed = size;
+ _Py_RETURN_UNICODE_EMPTY();
}
- /* 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;
+#ifdef WORDS_BIGENDIAN
+ le = bo < 0;
+#else
+ le = bo <= 0;
+#endif
+ encoding = le ? "utf-32-le" : "utf-32-be";
- while (q < e) {
- Py_UCS4 ch;
- /* remaining bytes at the end? (size should be divisible by 4) */
- if (e-q<4) {
- if (consumed)
+ _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 (Py_UNICODE_IS_SURROGATE(ch)) {
+ errmsg = "codepoint 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]];
-
- if (ch >= 0x110000)
- {
+ else {
+ if (ch < 0x110000) {
+ if (_PyUnicodeWriter_WriteCharInline(&writer, ch) < 0)
+ goto onError;
+ q += 4;
+ continue;
+ }
errmsg = "codepoint not in range(0x110000)";
- startinpos = ((const char *)q)-starts;
- endinpos = startinpos+4;
- goto utf32Error;
+ startinpos = ((const char *)q) - starts;
+ endinpos = startinpos + 4;
}
- 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;
@@ -5119,11 +5098,15 @@ _PyUnicode_EncodeUTF32(PyObject *str,
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 { \
@@ -5155,7 +5138,7 @@ _PyUnicode_EncodeUTF32(PyObject *str,
if (byteorder == 0)
STORECHAR(0xFEFF);
if (len == 0)
- goto done;
+ return v;
if (byteorder == -1) {
/* force LE */
@@ -5163,6 +5146,7 @@ _PyUnicode_EncodeUTF32(PyObject *str,
iorder[1] = 1;
iorder[2] = 2;
iorder[3] = 3;
+ encoding = "utf-32-le";
}
else if (byteorder == 1) {
/* force BE */
@@ -5170,13 +5154,103 @@ _PyUnicode_EncodeUTF32(PyObject *str,
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
}
@@ -5222,14 +5296,14 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
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;
@@ -5261,40 +5335,42 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
_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);
}
}
@@ -5330,23 +5406,22 @@ PyUnicode_DecodeUTF16Stateful(const char *s,
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;
}
@@ -5354,16 +5429,12 @@ End:
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;
@@ -5379,13 +5450,17 @@ _PyUnicode_EncodeUTF16(PyObject *str,
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();
@@ -5407,8 +5482,8 @@ _PyUnicode_EncodeUTF16(PyObject *str,
}
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;
@@ -5420,25 +5495,107 @@ _PyUnicode_EncodeUTF16(PyObject *str,
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;
+ if (kind == PyUnicode_1BYTE_KIND) {
+ ucs1lib_utf16_encode((const Py_UCS1 *)data, len, &out, native_ordering);
+ goto done;
}
- default:
- assert(0);
+
+ 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 *
@@ -5529,27 +5686,26 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
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
@@ -5557,15 +5713,11 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
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) {
@@ -5573,13 +5725,11 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
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;
}
@@ -5591,18 +5741,14 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
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;
@@ -5726,35 +5872,32 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
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;
@@ -5907,23 +6050,22 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
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;
@@ -5933,7 +6075,8 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
/* 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;
}
@@ -5945,7 +6088,8 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
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 ||
@@ -5953,7 +6097,7 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
(*s != 'u' && *s != 'U')) {
continue;
}
- outpos--;
+ writer.pos--;
count = *s=='u' ? 4 : 8;
s++;
@@ -5962,11 +6106,11 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
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;
}
@@ -5979,28 +6123,27 @@ PyUnicode_DecodeRawUnicodeEscape(const char *s,
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;
@@ -6100,8 +6243,7 @@ _PyUnicode_DecodeUnicodeInternal(const char *s,
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;
@@ -6112,15 +6254,17 @@ _PyUnicode_DecodeUnicodeInternal(const char *s,
1))
return NULL;
- /* XXX overflow detection missing */
- v = PyUnicode_New((size+Py_UNICODE_SIZE-1)/ Py_UNICODE_SIZE, 127);
- if (v == NULL)
+ if (size == 0)
+ _Py_RETURN_UNICODE_EMPTY();
+
+ _PyUnicodeWriter_Init(&writer);
+ if (size / Py_UNICODE_SIZE > PY_SSIZE_T_MAX - 1) {
+ PyErr_NoMemory();
goto onError;
- if (PyUnicode_GET_LENGTH(v) == 0)
- return v;
- outpos = 0;
- end = s + size;
+ }
+ writer.min_length = (size + (Py_UNICODE_SIZE - 1)) / Py_UNICODE_SIZE;
+ end = s + size;
while (s < end) {
Py_UNICODE uch;
Py_UCS4 ch;
@@ -6162,28 +6306,26 @@ _PyUnicode_DecodeUnicodeInternal(const char *s,
}
#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;
@@ -6546,7 +6688,7 @@ PyUnicode_DecodeASCII(const char *s,
const char *errors)
{
const char *starts = s;
- PyObject *unicode;
+ _PyUnicodeWriter writer;
int kind;
void *data;
Py_ssize_t startinpos;
@@ -6563,46 +6705,46 @@ PyUnicode_DecodeASCII(const char *s,
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;
@@ -6634,7 +6776,7 @@ _PyUnicode_AsASCIIString(PyObject *unicode, const char *errors)
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);
@@ -6712,8 +6854,8 @@ decode_code_page_flags(UINT code_page)
* 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,
@@ -6764,7 +6906,7 @@ error:
* 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
@@ -6783,7 +6925,8 @@ decode_code_page_errors(UINT code_page,
/* 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;
@@ -6863,7 +7006,7 @@ decode_code_page_errors(UINT code_page,
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,
@@ -7019,7 +7162,7 @@ encode_code_page_flags(UINT code_page, const char *errors)
* 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,
@@ -7053,10 +7196,11 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes,
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)
@@ -7093,7 +7237,7 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes,
/* Do the conversion */
outsize = WideCharToMultiByte(code_page, flags,
- p, size,
+ p, (int)size,
out, outsize,
NULL, pusedDefaultChar);
Py_CLEAR(substring);
@@ -7115,7 +7259,7 @@ error:
* 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
@@ -7201,9 +7345,8 @@ encode_code_page_errors(UINT code_page, PyObject **outbytes,
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;
}
@@ -7396,220 +7539,258 @@ PyUnicode_AsMBCSString(PyObject *unicode)
/* --- Character Mapping Codec -------------------------------------------- */
-PyObject *
-PyUnicode_DecodeCharmap(const char *s,
- Py_ssize_t size,
- PyObject *mapping,
- const char *errors)
+static int
+charmap_decode_string(const char *s,
+ Py_ssize_t size,
+ PyObject *mapping,
+ const char *errors,
+ _PyUnicodeWriter *writer)
{
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;
+ 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;
- /* Default to Latin-1 */
- if (mapping == NULL)
- return PyUnicode_DecodeLatin1(s, size, errors);
+ maplen = PyUnicode_GET_LENGTH(mapping);
+ mapdata = PyUnicode_DATA(mapping);
+ mapkind = PyUnicode_KIND(mapping);
- v = PyUnicode_New(size, 127);
- if (v == NULL)
- goto onError;
- if (size == 0)
- return v;
- outpos = 0;
e = s + size;
- if (PyUnicode_CheckExact(mapping)) {
- Py_ssize_t maplen;
- enum PyUnicode_Kind mapkind;
- void *mapdata;
- Py_UCS4 x;
- if (PyUnicode_READY(mapping) == -1)
- return NULL;
+ 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;
- maplen = PyUnicode_GET_LENGTH(mapping);
- mapdata = PyUnicode_DATA(mapping);
- mapkind = PyUnicode_KIND(mapping);
+ assert (writer->kind == PyUnicode_1BYTE_KIND);
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;
+ 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;
}
- 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;
+ 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;
+ }
+ ch = *s;
- if (ch < maplen)
- x = PyUnicode_READ(mapkind, mapdata, ch);
- else
- x = 0xfffe; /* invalid value */
+ 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 (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;
- if (unicode_putchar(&v, &outpos, x) < 0)
+ 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;
- ++s;
}
- }
- 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)
+ /* 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;
- 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 (_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 (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);
+ if (_PyUnicodeWriter_WriteCharInline(writer, value) < 0)
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;
+ writer->overallocate = 1;
+ if (_PyUnicodeWriter_WriteStr(writer, item) == -1)
+ goto onError;
}
- Py_DECREF(x);
- ++s;
- continue;
+ }
+ 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_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;
- }
+ /* 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;
}
}
- if (unicode_resize(&v, outpos) < 0)
- goto onError;
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
- return unicode_result(v);
+ return 0;
- onError:
+onError:
+ Py_XDECREF(item);
Py_XDECREF(errorHandler);
Py_XDECREF(exc);
- Py_XDECREF(v);
+ return -1;
+}
+
+PyObject *
+PyUnicode_DecodeCharmap(const char *s,
+ Py_ssize_t size,
+ PyObject *mapping,
+ const char *errors)
+{
+ _PyUnicodeWriter writer;
+
+ /* Default to Latin-1 */
+ if (mapping == NULL)
+ return PyUnicode_DecodeLatin1(s, size, errors);
+
+ if (size == 0)
+ _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)) {
+ if (charmap_decode_string(s, size, mapping, errors, &writer) < 0)
+ goto onError;
+ }
+ else {
+ if (charmap_decode_mapping(s, size, mapping, errors, &writer) < 0)
+ goto onError;
+ }
+ return _PyUnicodeWriter_Finish(&writer);
+
+ onError:
+ _PyUnicodeWriter_Dealloc(&writer);
return NULL;
}
@@ -8123,10 +8304,14 @@ _PyUnicode_EncodeCharmap(PyObject *unicode,
* -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)
@@ -8141,7 +8326,7 @@ _PyUnicode_EncodeCharmap(PyObject *unicode,
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 */
@@ -8226,19 +8411,6 @@ make_translate_exception(PyObject **exceptionObject,
}
}
-/* 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
@@ -8514,8 +8686,10 @@ _PyUnicode_TranslateCharmap(PyObject *input,
}
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 */
@@ -9107,7 +9281,7 @@ tailmatch(PyObject *self,
if (PyUnicode_READY(self) == -1 ||
PyUnicode_READY(substring) == -1)
- return 0;
+ return -1;
if (PyUnicode_GET_LENGTH(substring) == 0)
return 1;
@@ -9145,7 +9319,6 @@ tailmatch(PyObject *self,
/* 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))
@@ -9607,41 +9780,49 @@ PyUnicode_Join(PyObject *separator, PyObject *seq)
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);
@@ -10033,6 +10214,31 @@ anylib_count(int kind, PyObject *sstr, void* sbuf, Py_ssize_t slen,
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)
@@ -10049,7 +10255,7 @@ replace(PyObject *self, PyObject *str1,
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;
@@ -10058,15 +10264,16 @@ replace(PyObject *self, PyObject *str1,
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) {
@@ -10076,35 +10283,19 @@ replace(PyObject *self, PyObject *str1,
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;
@@ -10416,9 +10607,24 @@ unicode_center(PyObject *self, PyObject *args)
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);
@@ -10426,19 +10632,116 @@ unicode_compare(PyObject *str1, PyObject *str2)
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)
{
@@ -10446,6 +10749,11 @@ PyUnicode_Compare(PyObject *left, PyObject *right)
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,
@@ -10456,29 +10764,59 @@ PyUnicode_Compare(PyObject *left, PyObject *right)
}
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;
+ }
}
@@ -10489,36 +10827,43 @@ PyObject *
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)
- 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);
+ if (!PyUnicode_Check(left) || !PyUnicode_Check(right))
+ Py_RETURN_NOTIMPLEMENTED;
- /* Convert the return value to a Boolean */
+ if (PyUnicode_READY(left) == -1 ||
+ PyUnicode_READY(right) == -1)
+ return NULL;
+
+ if (left == right) {
switch (op) {
case Py_EQ:
- v = TEST_COND(result == 0);
+ case Py_LE:
+ case Py_GE:
+ /* a string is equal to itself */
+ v = Py_True;
break;
case Py_NE:
- v = TEST_COND(result != 0);
+ case Py_LT:
+ case Py_GT:
+ v = Py_False;
break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+ }
+ 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_LE:
v = TEST_COND(result <= 0);
break;
@@ -10535,18 +10880,16 @@ PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)
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;
@@ -10565,23 +10908,18 @@ PyUnicode_Contains(PyObject *container, PyObject *element)
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);
@@ -10591,7 +10929,7 @@ PyUnicode_Contains(PyObject *container, PyObject *element)
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;
@@ -10609,7 +10947,7 @@ PyUnicode_Contains(PyObject *container, PyObject *element)
Py_DECREF(str);
Py_DECREF(sub);
- if (kind2 != kind)
+ if (kind2 != kind1)
PyMem_Free(buf2);
return result;
@@ -10685,7 +11023,8 @@ PyUnicode_Append(PyObject **p_left, PyObject *right)
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;
@@ -10725,15 +11064,9 @@ PyUnicode_Append(PyObject **p_left, PyObject *right)
&& !(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);
}
@@ -10789,8 +11122,10 @@ unicode_count(PyObject *self, PyObject *args)
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);
@@ -10861,23 +11196,25 @@ unicode_encode(PyObject *self, PyObject *args, PyObject *kwargs)
}
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)
@@ -10968,10 +11305,14 @@ unicode_find(PyObject *self, PyObject *args)
&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);
@@ -10989,7 +11330,6 @@ unicode_getitem(PyObject *self, Py_ssize_t index)
void *data;
enum PyUnicode_Kind kind;
Py_UCS4 ch;
- PyObject *res;
if (!PyUnicode_Check(self) || PyUnicode_READY(self) == -1) {
PyErr_BadArgument();
@@ -11002,17 +11342,7 @@ unicode_getitem(PyObject *self, Py_ssize_t index)
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
@@ -11039,43 +11369,11 @@ unicode_hash(PyObject *self)
_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\
@@ -11094,10 +11392,14 @@ unicode_index(PyObject *self, PyObject *args)
&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);
@@ -11627,6 +11929,7 @@ _PyUnicode_XStrip(PyObject *self, int striptype, PyObject *sepobj)
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;
@@ -11634,24 +11937,35 @@ _PyUnicode_XStrip(PyObject *self, int striptype, PyObject *sepobj)
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++;
}
@@ -11698,30 +12012,63 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end)
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);
@@ -11733,7 +12080,7 @@ do_argstrip(PyObject *self, int striptype, PyObject *args)
{
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) {
@@ -11945,7 +12292,7 @@ unicode_repr(PyObject *unicode)
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)
@@ -11956,7 +12303,7 @@ unicode_repr(PyObject *unicode)
/* Compute length of output, quote characters, and
maximum character */
- osize = 2; /* quotes */
+ osize = 0;
max = 127;
squote = dquote = 0;
ikind = PyUnicode_KIND(unicode);
@@ -11987,7 +12334,9 @@ unicode_repr(PyObject *unicode)
}
quote = '\'';
+ unchanged = (osize == isize);
if (squote) {
+ unchanged = 0;
if (dquote)
/* Both squote and dquote present. Use squote,
and escape them */
@@ -11995,6 +12344,7 @@ unicode_repr(PyObject *unicode)
else
quote = '"';
}
+ osize += 2; /* quotes */
repr = PyUnicode_New(osize, max);
if (repr == NULL)
@@ -12004,82 +12354,88 @@ unicode_repr(PyObject *unicode)
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;
- }
+ /* 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 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]);
- }
+ /* 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);
- }
+ /* 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]);
+ /* 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]);
+ }
}
- /* Map 21-bit characters to '\U00xxxxxx' */
+ /* Copy characters as-is */
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]);
+ PyUnicode_WRITE(okind, odata, o++, ch);
}
}
- /* Copy characters as-is */
- else {
- PyUnicode_WRITE(okind, odata, o++, ch);
- }
}
}
/* Closing quote already added at the beginning */
@@ -12108,10 +12464,14 @@ unicode_rfind(PyObject *self, PyObject *args)
&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);
@@ -12140,10 +12500,14 @@ unicode_rindex(PyObject *self, PyObject *args)
&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);
@@ -12500,28 +12864,76 @@ unicode_swapcase(PyObject *self)
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 *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 *x, *y = NULL, *z = NULL;
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;
@@ -12732,6 +13144,8 @@ unicode_startswith(PyObject *self,
return NULL;
result = tailmatch(self, substring, start, end, -1);
Py_DECREF(substring);
+ if (result == -1)
+ return NULL;
if (result) {
Py_RETURN_TRUE;
}
@@ -12748,6 +13162,8 @@ unicode_startswith(PyObject *self,
}
result = tailmatch(self, substring, start, end, -1);
Py_DECREF(substring);
+ if (result == -1)
+ return NULL;
return PyBool_FromLong(result);
}
@@ -12781,6 +13197,8 @@ unicode_endswith(PyObject *self,
return NULL;
result = tailmatch(self, substring, start, end, +1);
Py_DECREF(substring);
+ if (result == -1)
+ return NULL;
if (result) {
Py_RETURN_TRUE;
}
@@ -12796,33 +13214,48 @@ unicode_endswith(PyObject *self,
}
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;
@@ -12834,29 +13267,30 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
}
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 */
@@ -12874,7 +13308,6 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
return -1;
}
writer->buffer = newbuffer;
- _PyUnicodeWriter_Update(writer);
}
else if (maxchar > writer->maxchar) {
assert(!writer->readonly);
@@ -12885,12 +13318,30 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
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
_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str)
{
Py_UCS4 maxchar;
@@ -12904,11 +13355,10 @@ _PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str)
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;
}
@@ -12921,28 +13371,142 @@ _PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer, PyObject *str)
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
@@ -12977,7 +13541,7 @@ unicode__format__(PyObject* self, PyObject* args)
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));
@@ -13046,7 +13610,8 @@ static PyMethodDef unicode_methods[] = {
{"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__},
@@ -13058,7 +13623,8 @@ static PyMethodDef unicode_methods[] = {
{"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__},
@@ -13080,8 +13646,7 @@ static PyMethodDef unicode_methods[] = {
{"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. */
@@ -13196,16 +13761,39 @@ static PyMappingMethods unicode_as_mapping = {
/* 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");
@@ -13214,33 +13802,42 @@ getnextarg(PyObject *args, Py_ssize_t arglen, Py_ssize_t *p_argidx)
/* 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);
@@ -13267,7 +13864,7 @@ formatfloat(PyObject *v, int flags, int prec, int type,
* 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;
@@ -13277,6 +13874,8 @@ formatlong(PyObject *val, int flags, int prec, int type)
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) {
@@ -13288,13 +13887,14 @@ formatlong(PyObject *val, int flags, int prec, int type)
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;
@@ -13305,8 +13905,6 @@ formatlong(PyObject *val, int flags, int prec, int type)
numnondigits = 2;
result = PyNumber_ToBase(val, 16);
break;
- default:
- assert(!"'type' not in [duoxX]");
}
if (!result)
return NULL;
@@ -13317,12 +13915,14 @@ formatlong(PyObject *val, int flags, int prec, int type)
/* 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;
@@ -13334,7 +13934,7 @@ formatlong(PyObject *val, int flags, int prec, int type)
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' ||
@@ -13379,15 +13979,121 @@ formatlong(PyObject *val, int flags, int prec, int type)
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)
{
@@ -13399,8 +14105,30 @@ formatchar(PyObject *v)
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;
@@ -13420,540 +14148,588 @@ formatchar(PyObject *v)
return (Py_UCS4) -1;
}
-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;
+/* Parse options of an argument: flags, width, precision.
+ Handle also "%(name)" syntax.
- if (format == NULL || args == NULL) {
- PyErr_BadInternalCall();
- return NULL;
- }
- uformat = PyUnicode_FromObject(format);
- if (uformat == NULL)
- return NULL;
- if (PyUnicode_READY(uformat) == -1) {
- Py_DECREF(uformat);
- return NULL;
- }
+ 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)
- fmt = PyUnicode_DATA(uformat);
- fmtkind = PyUnicode_KIND(uformat);
- fmtcnt = PyUnicode_GET_LENGTH(uformat);
- fmtpos = 0;
+ PyObject *v;
- _PyUnicodeWriter_Init(&writer, fmtcnt + 100);
+ 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 (PyTuple_Check(args)) {
- arglen = PyTuple_Size(args);
- argidx = 0;
- }
- else {
- arglen = -1;
- argidx = -2;
+ 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;
}
- if (PyMapping_Check(args) && !PyTuple_Check(args) && !PyUnicode_Check(args))
- dict = args;
-
- while (--fmtcnt >= 0) {
- if (PyUnicode_READ(fmtkind, fmt, 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;
+ /* 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;
}
- 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;
- }
+ 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;
}
- 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');
- }
+ 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;
}
- 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++);
+ 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');
}
- if (fmtcnt < 0) {
- PyErr_SetString(PyExc_ValueError,
- "incomplete format");
- 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;
+ /* 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;
- v = getnextarg(args, arglen, &argidx);
- if (v == NULL)
- goto onError;
+#undef FORMAT_READ
+}
- 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;
- }
+/* Format one argument. Supported conversion specifiers:
- 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;
+ - "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)
- 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;
- }
- }
+ When possible, the output is written directly into the Unicode writer
+ (ctx->writer). A string is created when padding is required.
- isnumok = 0;
- if (PyNumber_Check(v)) {
- PyObject *iobj=NULL;
+ 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 (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;
+ if (ctx->fmtcnt == 0)
+ ctx->writer.overallocate = 0;
- 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;
- }
+ if (arg->ch == '%') {
+ if (_PyUnicodeWriter_WriteCharInline(writer, '%') < 0)
+ return -1;
+ return 1;
+ }
- sign = 1;
- if (flags & F_ZERO)
- fill = '0';
- if (formatfloat(v, flags, prec, c, &temp, NULL) == -1)
- temp = NULL;
- break;
+ v = unicode_format_getnextarg(ctx);
+ if (v == NULL)
+ return -1;
- 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));
+ 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 (width == -1 && prec == -1
- && !(flags & (F_SIGN | F_BLANK)))
- {
- /* Fast path */
- if (_PyUnicodeWriter_WriteStr(&writer, temp) == -1)
- goto onError;
- goto nextarg;
- }
+ 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;
- if (PyUnicode_READY(temp) == -1) {
- Py_CLEAR(temp);
- goto onError;
- }
- kind = PyUnicode_KIND(temp);
- pbuf = PyUnicode_DATA(temp);
- len = PyUnicode_GET_LENGTH(temp);
+ 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;
+ }
- if (c == 's' || c == 'r' || c == 'a') {
- if (prec >= 0 && len > prec)
- len = prec;
- }
+ 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;
+ }
- /* 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);
+ arg->sign = 1;
+ if (formatfloat(v, arg, p_str, NULL) == -1)
+ return -1;
+ break;
- buflen = width;
- if (sign && len == width)
- buflen++;
+ 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;
+ }
- if (_PyUnicodeWriter_Prepare(&writer, buflen, bufmaxchar) == -1)
- goto onError;
+ 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;
+}
- /* 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;
- }
- }
+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;
+ }
- if (len) {
- _PyUnicode_FastCopyCharacters(writer.buffer, writer.pos,
- temp, pindex, len);
- writer.pos += len;
+ /* 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)
+{
+ struct unicode_formatter_t ctx;
+
+ if (format == NULL || args == NULL) {
+ PyErr_BadInternalCall();
+ return NULL;
+ }
+
+ ctx.fmtstr = PyUnicode_FromObject(format);
+ if (ctx.fmtstr == NULL)
+ return NULL;
+ 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;
+
+ _PyUnicodeWriter_Init(&ctx.writer);
+ ctx.writer.min_length = ctx.fmtcnt + 100;
+ ctx.writer.overallocate = 1;
+
+ if (PyTuple_Check(args)) {
+ ctx.arglen = PyTuple_Size(args);
+ ctx.argidx = 0;
+ }
+ else {
+ ctx.arglen = -1;
+ ctx.argidx = -2;
+ }
+ ctx.args_owned = 0;
+ if (PyMapping_Check(args) && !PyTuple_Check(args) && !PyUnicode_Check(args))
+ ctx.dict = args;
+ else
+ ctx.dict = NULL;
+ ctx.args = args;
+
+ while (--ctx.fmtcnt >= 0) {
+ if (PyUnicode_READ(ctx.fmtkind, ctx.fmtdata, ctx.fmtpos) != '%') {
+ Py_ssize_t nonfmtpos;
+
+ nonfmtpos = ctx.fmtpos++;
+ while (ctx.fmtcnt >= 0 &&
+ PyUnicode_READ(ctx.fmtkind, ctx.fmtdata, ctx.fmtpos) != '%') {
+ ctx.fmtpos++;
+ ctx.fmtcnt--;
}
- if (width > len) {
- sublen = width - len;
- FILL(writer.kind, writer.data, ' ', writer.pos, sublen);
- writer.pos += sublen;
+ if (ctx.fmtcnt < 0) {
+ ctx.fmtpos--;
+ ctx.writer.overallocate = 0;
}
-nextarg:
- if (dict && (argidx < arglen) && c != '%') {
- PyErr_SetString(PyExc_TypeError,
- "not all arguments converted during string formatting");
+ if (_PyUnicodeWriter_WriteSubstring(&ctx.writer, ctx.fmtstr,
+ nonfmtpos, ctx.fmtpos) < 0)
goto onError;
- }
- Py_CLEAR(temp);
- } /* '%' */
- } /* until end */
- if (argidx < arglen && !dict) {
+ }
+ else {
+ ctx.fmtpos++;
+ if (unicode_format_arg(&ctx) == -1)
+ goto onError;
+ }
+ }
+
+ 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;
}
@@ -14213,7 +14989,7 @@ _PyUnicode_Fini(void)
void
PyUnicode_InternInPlace(PyObject **p)
{
- register PyObject *s = *p;
+ PyObject *s = *p;
PyObject *t;
#ifdef Py_DEBUG
assert(s != NULL);
@@ -14242,12 +15018,12 @@ PyUnicode_InternInPlace(PyObject **p)
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) {
@@ -14550,7 +15326,7 @@ Py_UNICODE_strcmp(const Py_UNICODE *s1, const Py_UNICODE *s2)
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 46a92bbd44..1fdc092a3d 100644
--- a/Objects/unicodetype_db.h
+++ b/Objects/unicodetype_db.h
@@ -1589,7 +1589,7 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ static unsigned short index2[] = {
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 @@ double _PyUnicode_ToNumeric(Py_UCS4 ch)
case 0x12435:
case 0x1244A:
case 0x12450:
+ case 0x12456:
case 0x12459:
case 0x1D361:
case 0x1D7D0:
@@ -3427,6 +3428,8 @@ double _PyUnicode_ToNumeric(Py_UCS4 ch)
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 @@ double _PyUnicode_ToNumeric(Py_UCS4 ch)
case 0x1243B:
case 0x1244B:
case 0x12451:
+ case 0x12457:
case 0x1D362:
case 0x1D7D1:
case 0x1D7DB:
@@ -3721,6 +3725,8 @@ double _PyUnicode_ToNumeric(Py_UCS4 ch)
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 @@ double _PyUnicode_ToNumeric(Py_UCS4 ch)
/* 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 @@ int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)
case 0x0085:
case 0x00A0:
case 0x1680:
- case 0x180E:
case 0x2000:
case 0x2001:
case 0x2002:
@@ -4313,7 +4318,7 @@ int _PyUnicode_IsWhitespace(register const Py_UCS4 ch)
* 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 b49dcee1ad..c083f8fce5 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -338,6 +338,11 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)
}
+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 @@ _PyWeakref_RefType = {
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 1c98eac126..0000000000
--- 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 d1eb217a49..0000000000
--- 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 8dc0cdd8f6..0000000000
--- 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 76a61bc597..0000000000
--- 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 e1b8470070..0000000000
--- 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 55ee8f2259..0000000000
--- 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 3869938007..0000000000
--- 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 e8bb993475..0000000000
--- 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 877a61454c..0000000000
--- 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 0eaa25a1f0..0000000000
--- 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 5d69f590c1..0000000000
--- 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 95af084afe..0000000000
--- 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 e5ca92c89d..0000000000
--- 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 352cbad59d..0000000000
--- 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 a735e123bf..0000000000
--- 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 87b2ebc598..0000000000
--- 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 561c9ef94d..0000000000
--- 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 fa8b772a09..0000000000
--- 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 0ce98d14eb..0000000000
--- 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 e9c325c56d..0000000000
--- 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 f978f8503a..0000000000
--- 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 b8d6823a2a..0000000000
--- 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 a9eadd7c6a..0000000000
--- 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 d0e528c349..0000000000
--- 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 ed6780ad93..0000000000
--- 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 a04db67e41..0000000000
--- 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 6a6403c3ab..0000000000
--- 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 6e09b9b74b..0000000000
--- 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 216dd30c35..0000000000
--- 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 c359d88997..0000000000
--- 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 e8e8a2ce77..0000000000
--- 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 ba2b9d9906..0000000000
--- 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 d4fd447876..0000000000
--- 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 ffed8e458a..0000000000
--- 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 9f7d991852..0000000000
--- 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 8476a6379e..0000000000
--- 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 56d65fefb3..0000000000
--- 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 01978424fb..0000000000
--- 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 5f7341680a..0000000000
--- 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 fa9acf12dd..0000000000
--- 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 f6be3c05f7..0000000000
--- 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 2e9f4e3bd0..0000000000
--- 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 0b005a1a24..0000000000
--- 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 6a87f74c2d..0000000000
--- 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 47f24ca3cb..0000000000
--- 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 1875e194ba..0000000000
--- 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 2aa2b66401..0000000000
--- 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 d0c8a5df0d..0000000000
--- 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 fffa4eb722..0000000000
--- 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 720f19c6b3..0000000000
--- 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 e0739face8..0000000000
--- 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 171101d591..0000000000
--- 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 ca6a3c0ff4..0000000000
--- 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 80b4401f05..0000000000
--- 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 2e7f6ad3fb..0000000000
--- 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 05c4184658..0000000000
--- 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 47d7f5096d..0000000000
--- 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 bfd8a7049a..0000000000
--- 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 43c8576e79..0000000000
--- 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 a910a794a9..0000000000
--- 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 8252d45c7b..0000000000
--- 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 7f47f9b112..0000000000
--- 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 b9f3b4ea32..0000000000
--- 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 bc4cf39100..0000000000
--- 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 8973233d22..0000000000
--- 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 097241ef98..0000000000
--- 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 457da72f04..0000000000
--- 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 f031e2e77a..0000000000
--- 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 99971c6b00..0000000000
--- 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 8f1cafc92a..0000000000
--- 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 8abd982f79..0000000000
--- 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 64f19f1b48..0000000000
--- 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 d9267a481e..0000000000
--- 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 9700bdea74..0000000000
--- 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 d11edf2024..0000000000
--- 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 9bc818676f..0000000000
--- 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 4c67ae3ac2..0000000000
--- 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 a37b5bfd93..0000000000
--- 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 357b08b66c..0000000000
--- 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 dc13ef5709..0000000000
--- 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 ea59039b97..0000000000
--- 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 1f11979321..0000000000
--- 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 bc643cb6be..0000000000
--- 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 a4990a8365..0000000000
--- 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 edcbe36ae0..0000000000
--- 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 123e704bae..0000000000
--- 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 bb323d31d0..0000000000
--- 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 e9be3301f2..0000000000
--- 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 8efa07a364..0000000000
--- 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 fb5cccd957..0000000000
--- 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 9dbf10d95a..0000000000
--- 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 9aca4aaa8c..0000000000
--- 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 38c5f18ed3..0000000000
--- 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 26cfc2d0dd..0000000000
--- 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 34c21e15c5..0000000000
--- 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 313a30b782..0000000000
--- 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 b59e4eca15..0000000000
--- 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 131bd3fabc..0000000000
--- 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 2f47c0ee8d..0000000000
--- 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 a75bb9debb..0000000000
--- 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 5037b7845d..0000000000
--- 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 08def90651..0000000000
--- 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 18e170557f..0000000000
--- 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 0429e19ebc..0000000000
--- 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 671fc166cc..0000000000
--- 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 9afbe5de4e..0000000000
--- 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 83003289f8..0000000000
--- 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 f0d635e6e3..0000000000
--- 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 4cf7d23869..0000000000
--- 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 e14d206d12..0000000000
--- 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 d379357c49..0000000000
--- 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 9f88d443fe..0000000000
--- 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 f7100f1c5f..82c57ae25f 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 97aa294689..b47dc2740c 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
index 76ad2d86c3..14d910dfdf 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 bb323d31d0..604731f3f8 100644
--- a/PC/VS9.0/kill_python.c
+++ b/PC/VS9.0/kill_python.c
@@ -106,7 +106,7 @@ main(int argc, char **argv)
/*
* 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 8f8cbb6225..ba7f69cfad 100644
--- a/PC/VS9.0/pcbuild.sln
+++ b/PC/VS9.0/pcbuild.sln
@@ -20,11 +20,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj",
{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 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcpr
{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 @@ Global
{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 @@ Global
{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 ff3759e459..88af242a89 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,7 +58,7 @@
/>
<UserMacro
Name="lzmaDir"
- Value="$(externalsDir)\xz-5.0.3"
+ Value="$(externalsDir)\xz-5.0.5"
/>
<UserMacro
Name="opensslDir"
diff --git a/PC/VS9.0/pythoncore.vcproj b/PC/VS9.0/pythoncore.vcproj
index 9fb63ff105..cf60470ce2 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 7a85b00fbe..0000000000
--- 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 0b5b94ec23..6a99b40cda 100644
--- a/PC/_msi.c
+++ b/PC/_msi.c
@@ -55,7 +55,7 @@ static FNFCIFREE(cb_free)
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 FNFCIOPEN(cb_open)
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 FNFCIREAD(cb_read)
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 FNFCIWRITE(cb_write)
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 FNFCICLOSE(cb_close)
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 @@ static FNFCIGETOPENINFO(cb_getopeninfo)
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 @@ PyInit__msi(void)
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_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_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, MSICOLINFO_NAMES);
+ PyModule_AddIntMacro(m, MSICOLINFO_TYPES);
+
+ 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_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 c11d45de22..e9401d9f3f 100644
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -743,7 +743,7 @@ do_run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv)
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);
diff --git a/PC/config.c b/PC/config.c
index 57b5073c71..72c9381130 100644
--- a/PC/config.c
+++ b/PC/config.c
@@ -13,11 +13,12 @@ extern PyObject* PyInit_binascii(void);
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__pickle(void);
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 @@ struct _inittab _PyImport_Inittab[] = {
{"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 @@ struct _inittab _PyImport_Inittab[] = {
{"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 @@ struct _inittab _PyImport_Inittab[] = {
{"_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 fba00b6c1d..df36341137 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 b5bf325f46..deb40e76f3 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 @@ getpythonregpath(HKEY keyBase, int skipcore)
/* 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 @@ getpythonregpath(HKEY keyBase, int skipcore)
/* 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 @@ getpythonregpath(HKEY keyBase, int skipcore)
/* 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 @@ getpythonregpath(HKEY keyBase, int skipcore)
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 @@ getpythonregpath(HKEY keyBase, int skipcore)
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 @@ find_env_config_value(FILE * env_file, const wchar_t * key, wchar_t * value)
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 @@ calculate_path(void)
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 @@ calculate_path(void)
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 @@ calculate_path(void)
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 @@ void
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 @@ Py_SetPath(const wchar_t *path)
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 216a562603..ee3cd44ddc 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 @@ skip_whitespace(wchar_t * p)
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 @@ error(int rc, wchar_t * format, ... )
#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 @@ error(int rc, wchar_t * format, ... )
#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 @@ locate_python(wchar_t * wanted_ver)
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 @@ run_child(wchar_t * cmdline)
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 @@ invoke_child(wchar_t * executable, wchar_t * suffix, wchar_t * cmdline)
}
}
-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 void read_commands()
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 @@ parse_shebang(wchar_t * shebang_line, int nchars, wchar_t ** command,
*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 @@ parse_shebang(wchar_t * shebang_line, int nchars, wchar_t ** command,
break;
}
}
- if (*vpp == NULL) {
+ if (vpp->shebang == NULL) {
/*
* Not found in builtins - look in customized commands.
*
@@ -856,7 +927,7 @@ typedef struct {
} 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 @@ maybe_handle_shebang(wchar_t ** argv, wchar_t * cmdline)
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 @@ of bytes: %d\n", header_len);
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 @@ of bytes: %d\n", header_len);
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 @@ process(int argc, wchar_t ** argv)
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 @@ process(int argc, wchar_t ** argv)
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 @@ process(int argc, wchar_t ** argv)
}
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 @@ process(int argc, wchar_t ** argv)
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 @@ installed", &p[1]);
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 @@ installed", &p[1]);
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 04d2088d29..18dec6dbe8 100644
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -113,11 +113,12 @@ os.O_BINARY.");
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 800610e53e..0000000000
--- 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 61cf6dfc70..0000000000
--- 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 5879110aa6..0000000000
--- 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 ebda9cd94b..0000000000
--- 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 f73ae69513..0000000000
--- 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 9ccca1c8c8..0000000000
--- 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 0d73774ce0..0000000000
--- 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 e56105af57..0000000000
--- 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 256726be63..0000000000
--- 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 ba47f4b224..0000000000
--- 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 49dab8da23..0000000000
--- 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 b26b5217da..0000000000
--- 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 5bc2827a89..0000000000
--- 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 e2f0adcb7e..0000000000
--- 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 aa12c96455..0000000000
--- 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 2765b44d50..0000000000
--- 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 a525c2a67b..0000000000
--- 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 dc586045ae..0000000000
--- 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 0b96539fdd..ccf75f3736 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -74,8 +74,6 @@ WIN32 is still required for the locale module.
#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 @@ WIN32 is still required for the locale module.
#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 @@ typedef _W64 int ssize_t;
#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 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
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 */
@@ -731,6 +725,9 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* 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 a76510628b..0000000000
--- 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 966e6c95f0..37e454bd5d 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 9cf180750d..fb8e7aac09 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
index 21b9f56982..180ce11fd2 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 @@ line = inp.readline() # LIBRARY
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
index db1a5463da..3074cf3f42 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_ClearFreeList
PyCFunction_GetFlags
PyCFunction_GetFunction
PyCFunction_GetSelf
+PyCFunction_New
PyCFunction_NewEx
PyCFunction_Type
PyCallIter_New
@@ -517,6 +518,7 @@ PyType_FromSpecWithBases
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 fdc09abf9f..60f231e513 100644
--- a/PC/readme.txt
+++ b/PC/readme.txt
@@ -79,19 +79,6 @@ Legacy support for older versions of Visual Studio
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 b3978dd42d..0000000000
--- 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 3347eb7c4a..d23810b65d 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -937,14 +937,14 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
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 +954,14 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
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 +1796,9 @@ PyMODINIT_FUNC PyInit_winreg(void)
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/_overlapped.vcxproj b/PCbuild/_overlapped.vcxproj
new file mode 100644
index 0000000000..d0ee72fb5a
--- /dev/null
+++ b/PCbuild/_overlapped.vcxproj
@@ -0,0 +1,234 @@
+<?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="PGInstrument|Win32">
+ <Configuration>PGInstrument</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGInstrument|x64">
+ <Configuration>PGInstrument</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGUpdate|Win32">
+ <Configuration>PGUpdate</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="PGUpdate|x64">
+ <Configuration>PGUpdate</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>{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>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>NotSet</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <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="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="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="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="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="pyd.props" />
+ <Import Project="x64.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="pyd.props" />
+ <Import Project="x64.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="pyd.props" />
+ <Import Project="x64.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="pyd_d.props" />
+ <Import Project="x64.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_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'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Link>
+ <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>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <BaseAddress>0x1D110000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Link>
+ <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>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <BaseAddress>0x1D110000</BaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'">
+ <Link>
+ <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>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <BaseAddress>0x1D110000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'">
+ <Link>
+ <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>
+ <Link>
+ <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <BaseAddress>0x1D110000</BaseAddress>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <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">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/PCbuild/w9xpopen.vcxproj.filters b/PCbuild/_overlapped.vcxproj.filters
index dec67add2d..78de895055 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 392dad1a65..ed35d5bc0c 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 88e5fdbb9a..dce77c96a8 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 ae71d19dc5..7378794b3d 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 0000000000..83c7ad21e7
--- /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 0000000000..dea54d4ad4
--- /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
index d1afe22c9b..84984ff2f7 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/_testimportmultiple.vcxproj.filters b/PCbuild/_testimportmultiple.vcxproj.filters
new file mode 100644
index 0000000000..db0d0a65e1
--- /dev/null
+++ b/PCbuild/_testimportmultiple.vcxproj.filters
@@ -0,0 +1,13 @@
+<?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>{1ec38ad9-1abf-4b80-8628-ac43ccba324b}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\Modules\_testimportmultiple.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project>
diff --git a/PCbuild/build_ssl.bat b/PCbuild/build_ssl.bat
index 357b08b66c..805d77a6dc 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_tkinter.py b/PCbuild/build_tkinter.py
index 4196cf32e8..c807e7b19c 100644
--- a/PCbuild/build_tkinter.py
+++ b/PCbuild/build_tkinter.py
@@ -11,16 +11,12 @@ import sys
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 bb323d31d0..604731f3f8 100644
--- a/PCbuild/kill_python.c
+++ b/PCbuild/kill_python.c
@@ -106,7 +106,7 @@ main(int argc, char **argv)
/*
* 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 d6a022f517..f45903db31 100644
--- a/PCbuild/pcbuild.sln
+++ b/PCbuild/pcbuild.sln
@@ -14,8 +14,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vc
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 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6
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 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pywlauncher", "pywlauncher.
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 @@ Global
{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 @@ Global
{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,54 @@ Global
{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
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Debug|Win32.ActiveCfg = Debug|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Debug|Win32.Build.0 = Debug|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Debug|x64.ActiveCfg = Debug|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Debug|x64.Build.0 = Debug|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.PGUpdate|x64.Build.0 = PGUpdate|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Release|Win32.ActiveCfg = Release|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Release|Win32.Build.0 = Release|Win32
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.Release|x64.ActiveCfg = Release|x64
+ {254A0C05-6696-4B08-8CB2-EF7D533AEE01}.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 = PGInstrument|Win32
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGInstrument|x64.Build.0 = PGInstrument|x64
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
+ {6DAC66D9-E703-4624-BE03-49112AB5AA62}.PGUpdate|x64.Build.0 = PGUpdate|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
+ {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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 815523188f..5f40b1576e 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>
+ <sqlite3Dir>$(externalsDir)\sqlite-3.8.3.1</sqlite3Dir>
<bz2Dir>$(externalsDir)\bzip2-1.0.6</bz2Dir>
- <lzmaDir>$(externalsDir)\xz-5.0.3</lzmaDir>
+ <lzmaDir>$(externalsDir)\xz-5.0.5</lzmaDir>
<opensslDir>$(externalsDir)\openssl-1.0.1e</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 d0a9de0b06..bd12624596 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 8b5c42f0ec..2296f0bb60 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -492,6 +492,7 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 @@ IF %ERRORLEVEL% NEQ 0 (
<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 5647febdb7..8c652475a6 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 6f07689ce5..619f6a8b0f 100644
--- a/PCbuild/readme.txt
+++ b/PCbuild/readme.txt
@@ -1,200 +1,258 @@
-Building Python using VC++ 10.0
--------------------------------
-
-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.
-
-For other Windows platforms and compilers, see ../PC/readme.txt.
-
-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.
-
-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.
-
-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.
-
-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. 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.
+Building Python using Microsoft Visual C++
+------------------------------------------
+
+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:
+Visual C++ 2010 Express Edition
+ Required for building 32-bit Debug and Release configuration builds.
+ This edition does not support "solution folders", which pcbuild.sln
+ uses; this will not prevent building.
+Visual Studio 2010 Standard Edition
+ Required for building 64-bit Debug and Release configuration builds
+Visual Studio 2010 Professional Edition
+ Required for building Release configuration builds that make use of
+ Profile Guided Optimization (PGO), on either platform. The official
+ Python releases are built with Professional Edition using PGO.
+
+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 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.
+
+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 Professional 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.
+
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.
+
+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
+------------
-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 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.
-
- Get the source code through
-
- 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
+ Python wrapper for version 1.0.1e of the OpenSSL secure sockets
+ library, which is built by ssl.vcxproj
+ Homepage:
+ http://www.openssl.org/
+
+ 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 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 ..\..\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 ..\.. (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 ..\..\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 +260,54 @@ The external-amd64.bat file contains this for tcl:
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?
-
-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.
-
-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):
+Note that the above command is called from within ..\..\tcl-8.6.1.0\win
+(relative to this directory); don't forget to build Tk as well as Tcl!
- C:\..\python\trunk\external <- already exists and has built versions
- of the external subprojects
+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.
- 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.
-
-Building Python Using the free MS Toolkit Compiler
---------------------------------------------------
+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 either Standard Edition or better, or Express Edition with the
+Windows SDK 64-bit compilers to be available in order to build 64-bit
+binaries.
-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.
+
+See
+ http://msdn.microsoft.com/en-us/library/e7k32f4k(VS.100).aspx
+for more on this topic.
-http://msdn.microsoft.com/en-us/library/e7k32f4k(VS.100).aspx
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 +316,7 @@ The PCbuild solution makes heavy use of Visual Studio property files
(*.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 +329,18 @@ Manager (View -> Other Windows -> Property Manager).
+-- 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/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj
index 26bc20d6ec..f9770d9ffd 100644
--- a/PCbuild/xxlimited.vcxproj
+++ b/PCbuild/xxlimited.vcxproj
@@ -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 c24d840619..debd89edb8 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 @@ module Python
| 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 @@ module Python
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 08aa05b897..fc1b16c668 100644
--- a/Parser/asdl.py
+++ b/Parser/asdl.py
@@ -16,8 +16,9 @@ import traceback
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 @@ class ASDLParser(spark.GenericParser, object):
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 @@ class ASDLParser(spark.GenericParser, object):
" 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 @@ class Sum(AST):
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 @@ def parse(file):
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 @@ if __name__ == "__main__":
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 4b84e0fd6b..d6086e68bf 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -209,6 +209,11 @@ class StructVisitor(EmitVisitor):
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 @@ class Obj2ModVisitor(PickleVisitor):
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 @@ class Obj2ModVisitor(PickleVisitor):
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 @@ class PyTypesDeclareVisitor(PickleVisitor):
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 @@ static PyObject* ast2obj_object(void *o)
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 @@ static PyObject* ast2obj_int(long b)
/* 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 @@ static int add_ast_fields(void)
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 @@ static int add_ast_fields(void)
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 @@ class ASTModuleVisitor(PickleVisitor):
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 @@ class ObjVisitor(PickleVisitor):
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 @@ class PartingShots(StaticVisitor):
CODE = """
PyObject* PyAST_mod2obj(mod_ty t)
{
- init_types();
+ if (!init_types())
+ return NULL;
return ast2obj_mod(t);
}
@@ -1160,7 +1213,8 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
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 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
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 f2a25cab0c..b598294a4a 100644
--- a/Parser/grammar.c
+++ b/Parser/grammar.c
@@ -29,7 +29,7 @@ newgrammar(int start)
}
dfa *
-adddfa(grammar *g, int type, char *name)
+adddfa(grammar *g, int type, const char *name)
{
dfa *d;
@@ -63,7 +63,7 @@ addstate(dfa *d)
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 @@ addarc(dfa *d, int from, int to, int lbl)
}
int
-addlabel(labellist *ll, int type, char *str)
+addlabel(labellist *ll, int type, const char *str)
{
int i;
label *lb;
@@ -105,13 +105,13 @@ addlabel(labellist *ll, int type, char *str)
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 440ba44cb0..30a6f07cad 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 @@ PyGrammar_FindDFA(grammar *g, register int type)
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 @@ PyGrammar_FindDFA(grammar *g, register int type)
#endif
}
-char *
+const char *
PyGrammar_LabelRepr(label *lb)
{
static char buf[100];
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 9f1fc1eb50..28c7b6d7ff 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 @@ my_fgets(char *buf, int len, FILE *fp)
*/
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 @@ my_fgets(char *buf, int len, FILE *fp)
/* 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 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
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 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
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 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
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 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
if (PyOS_ReadlineFunctionPointer == NULL) {
-#ifdef __VMS
- PyOS_ReadlineFunctionPointer = vms__StdioReadline;
-#else
PyOS_ReadlineFunctionPointer = PyOS_StdioReadline;
-#endif
}
#ifdef WITH_THREAD
@@ -221,5 +218,14 @@ PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, char *prompt)
_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 1e4f0dab4b..564bd91fe5 100644
--- a/Parser/node.c
+++ b/Parser/node.c
@@ -76,7 +76,7 @@ fancy_roundup(int n)
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 @@ PyNode_AddChild(register node *n1, int type, char *str, int lineno, int col_offs
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 b505fe0ecd..56ec5148d3 100644
--- a/Parser/parser.c
+++ b/Parser/parser.c
@@ -35,9 +35,9 @@ s_reset(stack *s)
#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 @@ s_push(register stack *s, dfa *d, node *parent)
#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 @@ PyParser_Delete(parser_state *ps)
/* 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 @@ shift(register stack *s, int type, char *str, int newstate, int lineno, int col_
}
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 @@ push(register stack *s, int type, dfa *d, int newstate, int lineno, int col_offs
/* 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 @@ classify(parser_state *ps, int type, char *str)
}
{
- 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 @@ future_hack(parser_state *ps)
#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 @@ PyParser_AddToken(register parser_state *ps, register int type, char *str,
/* 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 7beb735d15..629dee565c 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 @@ PyParser_ParseStringFlagsFilename(const char *s, const char *filename,
}
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 @@ PyParser_ParseStringFlagsFilenameEx(const char *s, const char *filename,
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 @@ PyParser_ParseFile(FILE *fp, const char *filename, grammar *g, int start,
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 @@ PyParser_ParseFileFlags(FILE *fp, const char *filename, const char *enc,
}
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 @@ PyParser_ParseFileFlagsEx(FILE *fp, const char *filename,
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 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
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 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
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 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
}
#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 @@ done:
}
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 @@ initerr(perrdetail *err_ret, const char *filename)
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 52b8380c33..017a4f9274 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -113,6 +113,7 @@ getgrammar(char *filename)
Py_Exit(1);
}
g = pgen(n);
+ PyNode_Free(n);
if (g == NULL) {
printf("Bad grammar.\n");
Py_Exit(1);
@@ -137,7 +138,7 @@ Py_FatalError(const char *msg)
/* 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 660c0f042b..7283058fc8 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 @@ static void tok_backup(struct tok_state *tok, int c);
/* Token names */
-char *_PyParser_TokenNames[] = {
+const char *_PyParser_TokenNames[] = {
"ENDMARKER",
"NAME",
"NUMBER",
@@ -691,7 +691,8 @@ translate_into_utf8(const char* str, const char* enc) {
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 @@ PyTokenizer_FromString(const char *str, int exec_input)
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 @@ PyTokenizer_FromUTF8(const char *str, int exec_input)
/* 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 @@ PyTokenizer_Free(struct tok_state *tok)
/* 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 @@ tok_nextc(register struct tok_state *tok)
/* 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 @@ verify_identifier(struct tok_state *tok)
/* 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 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
/* 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);
@@ -1749,10 +1751,15 @@ PyTokenizer_FindEncodingFilename(int fd, PyObject *filename)
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 ed1f3aa147..1ce6eeba8c 100644
--- a/Parser/tokenizer.h
+++ b/Parser/tokenizer.h
@@ -35,7 +35,7 @@ struct tok_state {
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 @@ struct tok_state {
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 8543b66574..44fdafc50a 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -271,6 +271,10 @@ static PyTypeObject *Bytes_type;
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 char *ExceptHandler_fields[]={
static PyTypeObject *arguments_type;
static PyObject* ast2obj_arguments(void*);
_Py_IDENTIFIER(vararg);
-_Py_IDENTIFIER(varargannotation);
_Py_IDENTIFIER(kwonlyargs);
+_Py_IDENTIFIER(kw_defaults);
_Py_IDENTIFIER(kwarg);
-_Py_IDENTIFIER(kwargannotation);
_Py_IDENTIFIER(defaults);
-_Py_IDENTIFIER(kw_defaults);
static char *arguments_fields[]={
"args",
"vararg",
- "varargannotation",
"kwonlyargs",
+ "kw_defaults",
"kwarg",
- "kwargannotation",
"defaults",
- "kw_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 @@ static PyObject* ast2obj_object(void *o)
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 @@ static PyObject* ast2obj_int(long b)
/* 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 @@ static int add_ast_fields(void)
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 @@ static int init_types(void)
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 @@ static int init_types(void)
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 @@ static int init_types(void)
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 @@ Bytes(bytes s, int lineno, int col_offset, PyArena *arena)
}
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 @@ ExceptHandler(expr_ty type, identifier name, asdl_seq * body, int lineno, int
}
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 @@ arguments(asdl_seq * args, identifier vararg, expr_ty varargannotation,
return NULL;
p->args = args;
p->vararg = vararg;
- p->varargannotation = varargannotation;
p->kwonlyargs = kwonlyargs;
+ p->kw_defaults = kw_defaults;
p->kwarg = kwarg;
- p->kwargannotation = kwargannotation;
p->defaults = defaults;
- p->kw_defaults = kw_defaults;
return p;
}
@@ -2943,6 +2997,15 @@ ast2obj_expr(void* _o)
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 @@ ast2obj_arguments(void* _o)
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 @@ ast2obj_arguments(void* _o)
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 @@ ast2obj_arg(void* _o)
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 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
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 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
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 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
} 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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
} 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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
} 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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena)
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 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
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 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
} 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 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
} 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 @@ obj2ast_slice(PyObject* obj, slice_ty* out, PyArena* arena)
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 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena)
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 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
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 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
} 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 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena)
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 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
{
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 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
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 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
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 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
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,76 +6613,66 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena)
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)) {
+ if (_PyObject_HasAttrId(obj, &PyId_kw_defaults)) {
int res;
Py_ssize_t len;
Py_ssize_t i;
- tmp = _PyObject_GetAttrId(obj, &PyId_defaults);
+ tmp = _PyObject_GetAttrId(obj, &PyId_kw_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);
+ PyErr_Format(PyExc_TypeError, "arguments field \"kw_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;
+ kw_defaults = _Py_asdl_seq_new(len, arena);
+ if (kw_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);
+ asdl_seq_SET(kw_defaults, i, value);
}
Py_CLEAR(tmp);
} else {
- PyErr_SetString(PyExc_TypeError, "required field \"defaults\" missing from arguments");
+ PyErr_SetString(PyExc_TypeError, "required field \"kw_defaults\" missing from arguments");
return 1;
}
- if (_PyObject_HasAttrId(obj, &PyId_kw_defaults)) {
+ 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_kw_defaults);
+ tmp = _PyObject_GetAttrId(obj, &PyId_defaults);
if (tmp == NULL) goto failed;
if (!PyList_Check(tmp)) {
- PyErr_Format(PyExc_TypeError, "arguments field \"kw_defaults\" must be a list, not a %.200s", tmp->ob_type->tp_name);
+ 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);
- kw_defaults = asdl_seq_new(len, arena);
- if (kw_defaults == NULL) goto failed;
+ 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(kw_defaults, i, value);
+ asdl_seq_SET(defaults, i, value);
}
Py_CLEAR(tmp);
} else {
- PyErr_SetString(PyExc_TypeError, "required field \"kw_defaults\" missing from arguments");
+ PyErr_SetString(PyExc_TypeError, "required field \"defaults\" missing from arguments");
return 1;
}
- *out = arguments(args, vararg, varargannotation, kwonlyargs, kwarg,
- kwargannotation, defaults, kw_defaults, arena);
+ *out = arguments(args, vararg, kwonlyargs, kw_defaults, kwarg, defaults,
+ arena);
return 0;
failed:
Py_XDECREF(tmp);
@@ -6634,7 +6697,7 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena)
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 @@ obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena)
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 @@ obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena)
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 @@ PyInit__ast(void)
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 @@ PyInit__ast(void)
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 @@ PyInit__ast(void)
PyObject* PyAST_mod2obj(mod_ty t)
{
- init_types();
+ if (!init_types())
+ return NULL;
return ast2obj_mod(t);
}
@@ -6967,7 +7033,8 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
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 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
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 f33e477ad7..6013d7d7d4 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -13,6 +13,8 @@ static PyObject *_filters; /* List */
static PyObject *_once_registry; /* Dict */
static PyObject *_default_action; /* String */
+_Py_IDENTIFIER(argv);
+_Py_IDENTIFIER(stderr);
static int
check_matched(PyObject *obj, PyObject *arg)
@@ -99,7 +101,7 @@ get_default_action(void)
/* 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 +146,28 @@ get_filter(PyObject *category, PyObject *text, Py_ssize_t lineno,
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");
@@ -192,23 +201,26 @@ static PyObject *
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 +265,63 @@ show_warning(PyObject *filename, int lineno, PyObject *text, PyObject
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++;
-
- PyFile_WriteString(source_line_str, f_stderr);
+ int kind;
+ void *data;
+ Py_ssize_t i, len;
+ Py_UCS4 ch;
+ PyObject *truncated;
+
+ 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 +332,16 @@ warn_explicit(PyObject *category, PyObject *message,
{
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 +397,7 @@ warn_explicit(PyObject *category, PyObject *message,
if (action == NULL)
goto cleanup;
- if (strcmp(action, "error") == 0) {
+ if (PyUnicode_CompareWithASCIIString(action, "error") == 0) {
PyErr_SetObject(category, message);
goto cleanup;
}
@@ -362,13 +405,13 @@ warn_explicit(PyObject *category, PyObject *message,
/* 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 +420,15 @@ warn_explicit(PyObject *category, PyObject *message,
/* _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 +562,12 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
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 +587,8 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
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 +682,7 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
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 +740,14 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
/* 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);
}
@@ -786,11 +819,26 @@ PyErr_Warn(PyObject *category, char *text)
/* 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 +848,12 @@ PyErr_WarnExplicit(PyObject *category, const char *text,
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 +862,49 @@ PyErr_WarnExplicit(PyObject *category, const char *text,
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.");
diff --git a/Python/asdl.c b/Python/asdl.c
index e7e3280678..74fa9410e4 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_seq_new(Py_ssize_t size, PyArena *arena)
}
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 9a0b0649db..5668755346 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -109,22 +109,14 @@ validate_arguments(arguments_ty args)
{
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 @@ validate_expr(expr_ty exp, expr_context_ty ctx)
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 @@ PyAST_Validate(mod_ty mod)
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 @@ new_identifier(const char *n, struct compiling *c)
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 @@ static int
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 @@ num_stmts(const node *n)
*/
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 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
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 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
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 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
}
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 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
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 @@ PyAST_FromNode(const node *n, PyCompilerFlags *flags, const char *filename,
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 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
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 @@ set_context(struct compiling *c, expr_ty e, expr_context_ty ctx, const node *n)
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 @@ seq_for_testlist(struct compiling *c, const node *n)
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 @@ ast_for_arg(struct compiling *c, const node *n)
identifier name;
expr_ty annotation = NULL;
node *ch;
+ arg_ty tmp;
assert(TYPE(n) == tfpdef || TYPE(n) == vfpdef);
ch = CHILD(n, 0);
@@ -1134,7 +1139,13 @@ ast_for_arg(struct compiling *c, const node *n)
return NULL;
}
- return arg(name, annotation, c->c_arena);
+ tmp = arg(name, annotation, c->c_arena);
+ if (!tmp)
+ return NULL;
+
+ tmp->lineno = LINENO(n);
+ tmp->col_offset = n->n_col_offset;
+ return tmp;
}
/* returns -1 if failed to handle keyword only arguments
@@ -1192,6 +1203,8 @@ handle_keywordonly_args(struct compiling *c, const node *n, int start,
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 +1243,13 @@ ast_for_arguments(struct compiling *c, const node *n)
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 +1281,22 @@ ast_for_arguments(struct compiling *c, const node *n)
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 +1355,10 @@ ast_for_arguments(struct compiling *c, const node *n)
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 +1373,9 @@ ast_for_arguments(struct compiling *c, const node *n)
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 +1385,7 @@ ast_for_arguments(struct compiling *c, const node *n)
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 +1464,7 @@ ast_for_decorators(struct compiling *c, const node *n)
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 +1550,7 @@ ast_for_lambdef(struct compiling *c, const node *n)
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 +1660,7 @@ ast_for_comprehension(struct compiling *c, const node *n)
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 +1701,7 @@ ast_for_comprehension(struct compiling *c, const node *n)
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 +1813,21 @@ ast_for_atom(struct compiling *c, const node *n)
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 +1852,15 @@ ast_for_atom(struct compiling *c, const node *n)
}
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 +1871,10 @@ ast_for_atom(struct compiling *c, const node *n)
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 +1923,7 @@ ast_for_atom(struct compiling *c, const node *n)
/* 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 +1942,11 @@ ast_for_atom(struct compiling *c, const node *n)
} 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;
@@ -2093,15 +2103,22 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
if (NCH(n) == 2)
return Call(left_expr, NULL, NULL, NULL, NULL, LINENO(n),
n->n_col_offset, c->c_arena);
- else
- return ast_for_call(c, CHILD(n, 1), left_expr);
+ else {
+ expr_ty tmp = ast_for_call(c, CHILD(n, 1), left_expr);
+ if (!tmp)
+ return NULL;
+
+ tmp->lineno = LINENO(n);
+ tmp->col_offset = n->n_col_offset;
+ return tmp;
+ }
}
else if (TYPE(CHILD(n, 0)) == DOT ) {
PyObject *attr_id = NEW_IDENTIFIER(CHILD(n, 1));
if (!attr_id)
return NULL;
return Attribute(left_expr, attr_id, Load,
- LINENO(n), n->n_col_offset, c->c_arena);
+ LINENO(CHILD(n, 1)), CHILD(n, 1)->n_col_offset, c->c_arena);
}
else {
REQ(CHILD(n, 0), LSQB);
@@ -2124,7 +2141,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
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 +2157,7 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
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) {
@@ -2202,8 +2219,6 @@ ast_for_power(struct compiling *c, const node *n)
tmp = ast_for_trailer(c, ch, e);
if (!tmp)
return NULL;
- tmp->lineno = e->lineno;
- tmp->col_offset = e->col_offset;
e = tmp;
}
if (TYPE(CHILD(n, NCH(n) - 1)) == factor) {
@@ -2275,7 +2290,7 @@ ast_for_expr(struct compiling *c, const node *n)
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 +2326,10 @@ ast_for_expr(struct compiling *c, const node *n)
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 +2455,10 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func)
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 +2635,7 @@ ast_for_expr_stmt(struct compiling *c, const node *n)
/* 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 +2676,7 @@ ast_for_exprlist(struct compiling *c, const node *n, expr_context_ty context)
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 +2861,19 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
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 +2906,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
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 +2968,7 @@ ast_for_import_stmt(struct compiling *c, const node *n)
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 +3007,7 @@ ast_for_global_stmt(struct compiling *c, const node *n)
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 +3028,7 @@ ast_for_nonlocal_stmt(struct compiling *c, const node *n)
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 +3081,7 @@ ast_for_suite(struct compiling *c, const node *n)
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 +3200,7 @@ ast_for_if_stmt(struct compiling *c, const node *n)
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 +3224,7 @@ ast_for_if_stmt(struct compiling *c, const node *n)
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 +3436,7 @@ ast_for_try_stmt(struct compiling *c, const node *n)
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 +3487,7 @@ ast_for_with_stmt(struct compiling *c, const node *n)
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 +3653,16 @@ parsenumber(struct compiling *c, const char *s)
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 +3685,8 @@ parsenumber(struct compiling *c, const char *s)
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 c94daea027..745457fed9 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -32,8 +32,19 @@ const char *Py_FileSystemDefaultEncoding = NULL; /* set by initfsencoding() */
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 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
PyObject *cls = NULL;
Py_ssize_t nargs;
int isclass;
- _Py_IDENTIFIER(__prepare__);
assert(args != NULL);
if (!PyTuple_Check(args)) {
@@ -57,6 +67,11 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
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 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
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 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
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 @@ builtin_bin(PyObject *self, PyObject *v)
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 *
@@ -572,8 +593,7 @@ static PyObject *
builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
{
char *str;
- PyObject *filename_obj;
- char *filename;
+ PyObject *filename;
char *startstr;
int mode = -1;
int dont_inherit = 0;
@@ -589,12 +609,11 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
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 +671,24 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
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);
if (str == NULL)
goto error;
- result = Py_CompileStringExFlags(str, filename, start[mode], &cf, optimize);
+ result = Py_CompileStringObject(str, filename, start[mode], &cf, optimize);
goto finally;
error:
result = NULL;
finally:
- Py_DECREF(filename_obj);
+ Py_DECREF(filename);
return result;
}
@@ -750,8 +769,11 @@ builtin_eval(PyObject *self, PyObject *args)
}
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 +785,9 @@ builtin_eval(PyObject *self, PyObject *args)
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;
}
@@ -815,6 +837,8 @@ builtin_exec(PyObject *self, PyObject *args)
globals = PyEval_GetGlobals();
if (locals == Py_None) {
locals = PyEval_GetLocals();
+ if (locals == NULL)
+ return NULL;
}
if (!globals || !locals) {
PyErr_SetString(PyExc_SystemError,
@@ -836,9 +860,9 @@ builtin_exec(PyObject *self, PyObject *args)
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;
}
@@ -1256,7 +1280,11 @@ builtin_hex(PyObject *self, PyObject *v)
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,7 +1325,7 @@ builtin_len(PyObject *self, PyObject *v)
}
PyDoc_STRVAR(len_doc,
-"len(object) -> integer\n\
+"len(module, object)\n\
\n\
Return the number of items of a sequence or mapping.");
@@ -1322,26 +1350,35 @@ static PyObject *
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 +1422,18 @@ min_max(PyObject *args, PyObject *kwds, int op)
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 +1444,6 @@ Fail_it:
Py_XDECREF(maxval);
Py_XDECREF(maxitem);
Py_DECREF(it);
- Py_XDECREF(keyfunc);
return NULL;
}
@@ -1444,7 +1484,11 @@ builtin_oct(PyObject *self, PyObject *v)
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 +1574,12 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
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 +1633,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
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 +1659,9 @@ static PyObject *
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 +1732,6 @@ builtin_input(PyObject *self, PyObject *args)
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 +1857,9 @@ For most object types, eval(repr(object)) == object.");
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 +1870,21 @@ builtin_round(PyObject *self, PyObject *args, PyObject *kwds)
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 +1902,6 @@ builtin_sorted(PyObject *self, PyObject *args, PyObject *kwds)
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 +1949,11 @@ builtin_vars(PyObject *self, PyObject *args)
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 +2450,12 @@ PyObject *
_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 2b1619163b..5db88be620 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -37,7 +37,7 @@ typedef unsigned long long uint64;
static void
ppc_getcounter(uint64 *v)
{
- register unsigned long tbu, tb, tbu2;
+ unsigned long tbu, tb, tbu2;
loop:
asm volatile ("mftbu %0" : "=r" (tbu) );
@@ -123,13 +123,16 @@ static PyObject * load_args(PyObject ***, int);
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 +145,6 @@ static PyObject * special_lookup(PyObject *, _Py_Identifier *);
#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 +365,28 @@ PyEval_ReleaseThread(PyThreadState *tstate)
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 +399,9 @@ PyEval_ReInitThreads(void)
else
Py_DECREF(result);
Py_DECREF(threading);
+
+ /* Destroy all threads except the current one */
+ _PyThreadState_DeleteExcept(current_tstate);
}
#else
@@ -742,7 +745,6 @@ _Py_CheckRecursiveCall(char *where)
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 +755,7 @@ enum why_code {
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 +795,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#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 +1139,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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 +1149,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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,6 +1185,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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) {
@@ -1206,14 +1203,16 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#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 +1234,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#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 +1250,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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)) {
@@ -1276,13 +1273,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#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 +1289,24 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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 +1353,99 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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;
+ Py_INCREF(value);
+ PUSH(value);
+ FAST_DISPATCH();
+ }
- TARGET(LOAD_CONST)
- x = GETITEM(consts, oparg);
- Py_INCREF(x);
- PUSH(x);
+ 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 +1458,464 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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(v);
- skip_decref_vx:
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) DISPATCH();
- break;
-
- TARGET(BINARY_SUBTRACT)
- w = POP();
- v = TOP();
- x = PyNumber_Subtract(v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) DISPATCH();
- break;
-
- 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;
+ Py_DECREF(right);
+ SET_TOP(sum);
+ if (sum == 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(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_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(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_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(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_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(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_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(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(LIST_APPEND)
- w = POP();
- v = PEEK(oparg);
- err = PyList_Append(v, w);
- Py_DECREF(w);
- if (err == 0) {
- PREDICT(JUMP_ABSOLUTE);
- DISPATCH();
- }
- break;
+ 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(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(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(INPLACE_POWER)
- w = POP();
- v = TOP();
- x = PyNumber_InPlacePower(v, w, Py_None);
+ TARGET(LIST_APPEND) {
+ PyObject *v = POP();
+ PyObject *list = PEEK(oparg);
+ int err;
+ err = PyList_Append(list, 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(INPLACE_MULTIPLY)
- w = POP();
- v = TOP();
- x = PyNumber_InPlaceMultiply(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(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_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(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_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(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_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(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(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(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;
- }
- if (err == 0) {
- x = PyTuple_Pack(1, v);
- if (x == NULL)
- err = -1;
+ Py_DECREF(value);
+ goto error;
}
- 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;
-
- TARGET(STORE_LOCALS)
- x = POP();
- v = f->f_locals;
- Py_XDECREF(v);
- f->f_locals = x;
- DISPATCH();
+ goto error;
+ }
- 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_CallMethodId(reciever, &PyId_send, "O", v);
}
- 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 +1923,38 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
/* 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 +1967,280 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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 */
- Py_DECREF(v);
- break;
+ 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)
- w = GETITEM(names, oparg);
- v = POP();
- err = PyDict_SetItem(f->f_globals, w, v);
+ TARGET(STORE_GLOBAL) {
+ PyObject *name = GETITEM(names, oparg);
+ PyObject *v = POP();
+ int err;
+ err = PyDict_SetItem(f->f_globals, name, v);
Py_DECREF(v);
- if (err == 0) DISPATCH();
- break;
+ if (err != 0)
+ goto error;
+ DISPATCH();
+ }
- 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;
+ PyExc_NameError, NAME_ERROR_MSG, name);
+ goto error;
+ }
+ DISPATCH();
+ }
- TARGET(LOAD_NAME)
- w = GETITEM(names, oparg);
- if ((v = f->f_locals) == NULL) {
+ 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", w);
- why = WHY_EXCEPTION;
- break;
+ "no locals when loading %R", name);
+ goto error;
}
- if (PyDict_CheckExact(v)) {
- x = PyDict_GetItem(v, w);
- Py_XINCREF(x);
+ 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 +2249,312 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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_CLOSURE) {
+ PyObject *cell = freevars[oparg];
+ Py_INCREF(cell);
+ PUSH(cell);
+ DISPATCH();
+ }
- TARGET(LOAD_DEREF)
- x = freevars[oparg];
- w = PyCell_Get(x);
- if (w != NULL) {
- PUSH(w);
- 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);
}
- err = -1;
- format_exc_unbound(co, oparg);
- break;
+ else {
+ value = PyObject_GetItem(locals, name);
+ if (value == NULL && PyErr_Occurred()) {
+ if (!PyErr_ExceptionMatches(PyExc_KeyError))
+ goto error;
+ PyErr_Clear();
+ }
+ }
+ if (!value) {
+ PyObject *cell = freevars[oparg];
+ value = PyCell_GET(cell);
+ if (value == NULL) {
+ format_exc_unbound(co, oparg);
+ goto error;
+ }
+ Py_INCREF(value);
+ }
+ PUSH(value);
+ DISPATCH();
+ }
- TARGET(STORE_DEREF)
- w = POP();
- x = freevars[oparg];
- PyCell_Set(x, w);
- Py_DECREF(w);
+ TARGET(LOAD_DEREF) {
+ PyObject *cell = freevars[oparg];
+ PyObject *value = PyCell_GET(cell);
+ if (value == NULL) {
+ format_exc_unbound(co, oparg);
+ goto error;
+ }
+ Py_INCREF(value);
+ PUSH(value);
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(STORE_DEREF) {
+ PyObject *v = POP();
+ PyObject *cell = freevars[oparg];
+ PyCell_Set(cell, v);
+ Py_DECREF(v);
+ DISPATCH();
+ }
+
+ 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);
}
- break;
+ PUSH(tup);
+ DISPATCH();
+ }
- TARGET(BUILD_LIST)
- x = PyList_New(oparg);
- if (x != NULL) {
- for (; --oparg >= 0;) {
- w = POP();
- PyList_SET_ITEM(x, oparg, w);
- }
- PUSH(x);
- 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);
}
- break;
+ PUSH(list);
+ DISPATCH();
+ }
- 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 (err != 0) {
- Py_DECREF(x);
- break;
- }
- PUSH(x);
- 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);
}
- break;
+ if (err != 0) {
+ Py_DECREF(set);
+ goto error;
+ }
+ PUSH(set);
+ DISPATCH();
+ }
- TARGET(BUILD_MAP)
- x = _PyDict_NewPresized((Py_ssize_t)oparg);
- PUSH(x);
- if (x != NULL) DISPATCH();
- break;
+ TARGET(BUILD_MAP) {
+ PyObject *map = _PyDict_NewPresized((Py_ssize_t)oparg);
+ if (map == NULL)
+ goto error;
+ PUSH(map);
+ DISPATCH();
+ }
- TARGET(STORE_MAP)
- w = TOP(); /* key */
- u = SECOND(); /* value */
- v = THIRD(); /* dict */
+ TARGET(STORE_MAP) {
+ PyObject *key = TOP();
+ PyObject *value = SECOND();
+ PyObject *map = THIRD();
+ int err;
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;
+ 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)
- w = TOP(); /* key */
- u = SECOND(); /* value */
+ TARGET(MAP_ADD) {
+ PyObject *key = TOP();
+ PyObject *value = SECOND();
+ PyObject *map;
+ int err;
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();
- }
- break;
+ 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)
- w = GETITEM(names, oparg);
- v = TOP();
- x = PyObject_GetAttr(v, w);
- Py_DECREF(v);
- SET_TOP(x);
- if (x != NULL) DISPATCH();
- break;
+ 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)
- w = POP();
- v = TOP();
- x = cmp_outcome(oparg, v, w);
- Py_DECREF(v);
- Py_DECREF(w);
- SET_TOP(x);
- if (x == NULL) break;
+ 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)
- {
+ TARGET(IMPORT_NAME) {
_Py_IDENTIFIER(__import__);
- w = GETITEM(names, oparg);
- x = _PyDict_GetItemId(f->f_builtins, &PyId___import__);
- if (x == NULL) {
+ 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");
- break;
+ goto error;
}
- Py_INCREF(x);
- v = POP();
- u = TOP();
- if (PyLong_AsLong(u) != -1 || PyErr_Occurred())
- w = PyTuple_Pack(5,
- w,
+ 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,
- v,
- u);
+ from,
+ level);
else
- w = PyTuple_Pack(4,
- w,
+ args = PyTuple_Pack(4,
+ name,
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;
+ from);
+ Py_DECREF(level);
+ Py_DECREF(from);
+ if (args == NULL) {
+ Py_DECREF(func);
+ STACKADJ(-1);
+ goto error;
}
READ_TIMESTAMP(intr0);
- v = x;
- x = PyEval_CallObject(v, w);
- Py_DECREF(v);
+ res = PyEval_CallObject(func, args);
READ_TIMESTAMP(intr1);
- Py_DECREF(w);
- SET_TOP(x);
- if (x != NULL) DISPATCH();
- break;
+ Py_DECREF(args);
+ Py_DECREF(func);
+ SET_TOP(res);
+ if (res == NULL)
+ goto error;
+ DISPATCH();
}
- TARGET(IMPORT_STAR)
- v = POP();
- PyFrame_FastToLocals(f);
- if ((x = f->f_locals) == NULL) {
+ 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 +2562,63 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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 +2632,62 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
#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 +2696,35 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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 +2751,42 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
*/
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 +2797,53 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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 +2866,156 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
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;
+ if (kwdefaults > 0) {
+ PyObject *defs = PyDict_New();
+ if (defs == NULL) {
+ Py_DECREF(func);
+ goto error;
}
- while (--posdefaults >= 0) {
- w = POP();
- PyTuple_SET_ITEM(v, posdefaults, w);
+ while (--kwdefaults >= 0) {
+ 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_SetDefaults(x, v) != 0) {
+ if (PyFunction_SetKwDefaults(func, defs) != 0) {
/* Can't happen unless
- PyFunction_SetDefaults changes. */
- why = WHY_EXCEPTION;
+ PyFunction_SetKwDefaults changes. */
+ Py_DECREF(func);
+ Py_DECREF(defs);
+ goto error;
}
- Py_DECREF(v);
+ Py_DECREF(defs);
}
- if (x != NULL && kwdefaults > 0) {
- v = PyDict_New();
- if (v == NULL) {
- Py_DECREF(x);
- x = NULL;
- break;
- }
- 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);
+ if (posdefaults > 0) {
+ PyObject *defs = PyTuple_New(posdefaults);
+ if (defs == NULL) {
+ Py_DECREF(func);
+ goto error;
}
- if (PyFunction_SetKwDefaults(x, v) != 0) {
+ while (--posdefaults >= 0)
+ PyTuple_SET_ITEM(defs, posdefaults, POP());
+ if (PyFunction_SetDefaults(func, defs) != 0) {
/* Can't happen unless
- PyFunction_SetKwDefaults changes. */
- why = WHY_EXCEPTION;
+ PyFunction_SetDefaults changes. */
+ Py_DECREF(defs);
+ Py_DECREF(func);
+ goto error;
}
- Py_DECREF(v);
+ Py_DECREF(defs);
}
- PUSH(x);
- break;
+ 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 +3026,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
PyFrame_GetLineNumber(f),
opcode);
PyErr_SetString(PyExc_SystemError, "unknown opcode");
- why = WHY_EXCEPTION;
- break;
+ goto error;
#ifdef CASE_TOO_BIG
}
@@ -2867,71 +3034,36 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
} /* 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 */
-
- 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 */
+ assert(why == WHY_NOT);
+ why = WHY_EXCEPTION;
- 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,
+ tstate, 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;
+fast_block_end:
+ assert(why != WHY_NOT);
/* Unwind stacks if a (pseudo) exception occurred */
-
-fast_block_end:
while (why != WHY_NOT && f->f_iblock > 0) {
/* Peek at the current block. */
PyTryBlock *b = &f->f_blockstack[f->f_iblock - 1];
@@ -2978,7 +3110,10 @@ fast_block_end:
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,18 +3145,23 @@ fast_block_end:
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)) {
/* The purpose of this block is to put aside the generator's exception
@@ -3046,26 +3186,27 @@ fast_yield:
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 +3217,7 @@ fast_yield:
/* pop frame */
exit_eval_frame:
Py_LeaveRecursiveCall();
+ f->f_executing = 0;
tstate->frame = f->f_back;
return retval;
@@ -3241,9 +3383,9 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
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 +3661,7 @@ restore_and_clear_exc_state(PyThreadState *tstate, PyFrameObject *f)
/* 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 +3676,13 @@ do_raise(PyObject *exc, PyObject *cause)
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 +3745,13 @@ do_raise(PyObject *exc, PyObject *cause)
/* 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 +3848,43 @@ prtrace(PyObject *v, char *str)
#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 +3899,10 @@ call_trace_protected(Py_tracefunc func, PyObject *obj, PyFrameObject *frame,
}
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 +3918,7 @@ call_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame,
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 +3935,8 @@ _PyEval_CallTracing(PyObject *func, PyObject *args)
/* 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 +3956,7 @@ maybe_call_line_trace(Py_tracefunc func, PyObject *obj,
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 +4012,15 @@ PyObject *
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 +4030,9 @@ PyEval_GetGlobals(void)
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 +4074,13 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
{
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 +4103,9 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw)
result = PyObject_Call(func, arg, kw);
Py_DECREF(arg);
+
+ assert((result != NULL && !PyErr_Occurred())
+ || (result == NULL && PyErr_Occurred()));
return result;
}
@@ -3991,10 +4152,9 @@ err_args(PyObject *func, int flags, int nargs)
#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 +4163,14 @@ if (tstate->use_tracing && tstate->c_profilefunc) { \
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 +4222,15 @@ call_function(PyObject ***pp_stack, int oparg
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 +4255,8 @@ call_function(PyObject ***pp_stack, int oparg
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 +4267,9 @@ call_function(PyObject ***pp_stack, int oparg
Py_DECREF(w);
PCALL(PCALL_POP);
}
+
+ assert((x != NULL && !PyErr_Occurred())
+ || (x == NULL && PyErr_Occurred()));
return x;
}
@@ -4383,6 +4553,8 @@ ext_call_fail:
Py_XDECREF(callargs);
Py_XDECREF(kwdict);
Py_XDECREF(stararg);
+ assert((result != NULL && !PyErr_Occurred())
+ || (result == NULL && PyErr_Occurred()));
return result;
}
@@ -4421,7 +4593,7 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi)
"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 +4651,7 @@ import_from(PyObject *v, PyObject *name)
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 0b736c1715..e06d6e0922 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -53,7 +53,7 @@ int PyCodec_Register(PyObject *search_function)
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 @@ PyObject *normalizestring(const char *string)
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
@@ -360,6 +360,22 @@ PyObject *PyCodec_StreamWriter(const char *encoding,
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 +395,10 @@ _PyCodec_EncodeInternal(PyObject *object,
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 +441,10 @@ _PyCodec_DecodeInternal(PyObject *object,
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 +609,7 @@ int PyCodec_RegisterError(const char *name, PyObject *error)
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 +625,7 @@ PyObject *PyCodec_LookupError(const char *name)
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
@@ -881,6 +901,65 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
}
}
+#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 *
@@ -888,37 +967,77 @@ PyCodec_SurrogatePassErrors(PyObject *exc)
{
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);
+
+ 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);
@@ -930,34 +1049,64 @@ PyCodec_SurrogatePassErrors(PyObject *exc)
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);
@@ -1174,7 +1323,7 @@ static int _PyCodecRegistry_Init(void)
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 6d66255c98..9978eb3a1d 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -94,6 +94,7 @@ enum {
COMPILER_SCOPE_MODULE,
COMPILER_SCOPE_CLASS,
COMPILER_SCOPE_FUNCTION,
+ COMPILER_SCOPE_LAMBDA,
COMPILER_SCOPE_COMPREHENSION,
};
@@ -119,8 +120,8 @@ struct compiler_unit {
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 @@ handled by the symbol analysis pass.
*/
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 basicblock *compiler_new_block(struct compiler *);
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 inplace_binop(struct compiler *, operator_ty);
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 @@ compiler_init(struct compiler *c)
}
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 @@ PyAST_CompileEx(mod_ty mod, const char *filename, PyCompilerFlags *flags,
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 @@ PyAST_CompileEx(mod_ty mod, const char *filename, PyCompilerFlags *flags,
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 @@ PyAST_CompileEx(mod_ty mod, const char *filename, PyCompilerFlags *flags,
}
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 @@ compiler_free(struct compiler *c)
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 @@ list2dict(PyObject *list)
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 @@ each key.
*/
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 @@ dictbytype(PyObject *src, int scope_type, int flag, int offset)
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_enter_scope(struct compiler *c, identifier name,
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 @@ compiler_enter_scope(struct compiler *c, identifier name,
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 @@ compiler_exit_scope(struct compiler *c)
}
-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;
- }
+ base = NULL;
+ stack_size = PyList_GET_SIZE(c->c_stack);
+ 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;
+ }
- seq = PyList_New(0);
- if (seq == NULL)
- return NULL;
+ 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;
+ }
+ }
+ }
- 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;
+ 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 = 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;
+ return 1;
}
/* Allocate a new block and return a pointer to it.
@@ -784,8 +853,8 @@ compiler_set_lineno(struct compiler *c, int off)
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 @@ opcode_stack_effect(int opcode, int oparg)
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 @@ opcode_stack_effect(int opcode, int oparg)
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 @@ compiler_addop(struct compiler *c, int opcode)
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 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
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 @@ static int
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 @@ static int
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 @@ compiler_addop_name(struct compiler *c, int opcode, PyObject *dict,
*/
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,16 +1402,19 @@ compiler_mod(struct compiler *c, mod_ty mod)
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)
@@ -1365,9 +1440,9 @@ compiler_lookup_arg(PyObject *dict, PyObject *name)
}
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;
@@ -1457,9 +1532,16 @@ compiler_visit_argannotation(struct compiler *c, identifier id,
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 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args,
*/
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 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args,
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 @@ compiler_visit_annotations(struct compiler *c, arguments_ty args,
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 @@ compiler_function(struct compiler *c, stmt_ty s)
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 @@ compiler_function(struct compiler *c, stmt_ty s)
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 @@ compiler_function(struct compiler *c, stmt_ty s)
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 @@ compiler_class(struct compiler *c, stmt_ty s)
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 @@ compiler_class(struct compiler *c, stmt_ty s)
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_class(struct compiler *c, stmt_ty s)
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 @@ compiler_lambda(struct compiler *c, expr_ty e)
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 @@ compiler_lambda(struct compiler *c, expr_ty e)
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 @@ compiler_lambda(struct compiler *c, expr_ty e)
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);
@@ -2097,7 +2177,7 @@ static int
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 +2343,7 @@ compiler_import(struct compiler *c, stmt_ty s)
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 +2368,11 @@ compiler_import(struct compiler *c, stmt_ty s)
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 +2387,7 @@ compiler_import(struct compiler *c, stmt_ty s)
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 +2463,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
{
static PyObject *assertion_error = NULL;
basicblock *end;
+ PyObject* msg;
if (c->c_optimize)
return 1;
@@ -2390,11 +2474,17 @@ compiler_assert(struct compiler *c, stmt_ty s)
}
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 +2504,7 @@ compiler_assert(struct compiler *c, stmt_ty s)
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 +2552,12 @@ compiler_visit_stmt(struct compiler *c, stmt_ty s)
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 +2717,8 @@ inplace_binop(struct compiler *c, operator_ty op)
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 +2729,10 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
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 +2768,9 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx)
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 +2844,8 @@ static int
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 +2871,7 @@ compiler_boolop(struct compiler *c, expr_ty e)
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 +2904,7 @@ compiler_list(struct compiler *c, expr_ty e)
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 +2937,7 @@ compiler_tuple(struct compiler *c, expr_ty e)
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 +2993,11 @@ compiler_call(struct compiler *c, expr_ty e)
/* 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 +3058,7 @@ compiler_comprehension_generator(struct compiler *c,
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 +3183,10 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, identifier name,
}
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 +3296,18 @@ expr_constant(struct compiler *c, expr_ty e)
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 +3397,7 @@ compiler_with(struct compiler *c, stmt_ty s, int pos)
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 +3426,8 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
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 +3485,9 @@ compiler_visit_expr(struct compiler *c, expr_ty e)
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 +3657,12 @@ compiler_error(struct compiler *c, const char *errstr)
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 +3775,7 @@ compiler_visit_slice(struct compiler *c, slice_ty s, expr_context_ty ctx)
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 +3834,7 @@ dfs(struct compiler *c, basicblock *b, struct assembler *a)
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 +3842,13 @@ stackdepth_walk(struct compiler *c, basicblock *b, int depth, int maxdepth)
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() */
@@ -3790,7 +3906,7 @@ assemble_init(struct assembler *a, int nblocks, int firstlineno)
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 +3959,7 @@ static int
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 +4150,7 @@ assemble_jump_offsets(struct assembler *a, struct compiler *c)
}
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 +4175,10 @@ static int
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 +4200,9 @@ compute_code_flags(struct compiler *c)
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 +4221,10 @@ makecode(struct compiler *c, struct assembler *a)
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 +4243,11 @@ makecode(struct compiler *c, struct assembler *a)
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 +4262,13 @@ makecode(struct compiler *c, struct assembler *a)
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 +4384,3 @@ PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags,
return PyAST_CompileEx(mod, filename, flags, -1, arena);
}
-
diff --git a/Python/condvar.h b/Python/condvar.h
index bbb40ba18e..e022dc7938 100644
--- a/Python/condvar.h
+++ b/Python/condvar.h
@@ -241,7 +241,7 @@ _PyCOND_WAIT_MS(PyCOND_T *cv, PyMUTEX_T *cs, DWORD ms)
* 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 f40a0be65b..5ac30ed5f1 100644
--- a/Python/dynload_aix.c
+++ b/Python/dynload_aix.c
@@ -30,11 +30,11 @@ const char *_PyImport_DynLoadFiletab[] = {".so", NULL};
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 @@ aix_loaderror(const char *pathname)
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 0e1b907b8c..0000000000
--- 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 75544ed3bc..5cd1efdf76 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 @@ const char *_PyImport_DynLoadFiletab[] = {
#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 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
}
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 626b16e46f..996292a044 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -20,6 +20,9 @@ extern char *strerror(int);
extern "C" {
#endif
+_Py_IDENTIFIER(builtins);
+_Py_IDENTIFIER(stderr);
+
void
PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback)
@@ -71,6 +74,11 @@ PyErr_SetObject(PyObject *exception, PyObject *value)
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_SetObject(PyObject *exception, PyObject *value)
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 @@ PyErr_NormalizeException(PyObject **exc, PyObject **val, PyObject **tb)
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)
@@ -366,6 +397,12 @@ PyErr_BadArgument(void)
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 +410,12 @@ PyErr_NoMemory(void)
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 +486,15 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
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 +511,11 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
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 +527,7 @@ PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
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 +536,7 @@ PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename)
PyObject *
PyErr_SetFromErrno(PyObject *exc)
{
- return PyErr_SetFromErrnoWithFilenameObject(exc, NULL);
+ return PyErr_SetFromErrnoWithFilenameObjects(exc, NULL, NULL);
}
#ifdef MS_WINDOWS
@@ -499,6 +546,16 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject(
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 +591,15 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilenameObject(
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 +620,10 @@ PyObject *PyErr_SetExcFromWindowsErrWithFilename(
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 +636,10 @@ PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename(
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 +651,18 @@ PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
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 +674,9 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
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 +710,11 @@ PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
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 +742,7 @@ _PyErr_BadInternalCall(const char *filename, int lineno)
void
PyErr_BadInternalCall(void)
{
+ assert(0 && "bad argument to internal function");
PyErr_Format(PyExc_SystemError,
"bad argument to internal function");
}
@@ -694,6 +762,12 @@ PyErr_Format(PyObject *exception, const char *format, ...)
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 +869,84 @@ PyErr_WriteUnraisable(PyObject *obj)
{
_Py_IDENTIFIER(__module__);
PyObject *f, *t, *v, *tb;
+ PyObject *moduleName = NULL;
+ char* className;
+
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;
- }
- 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);
+ 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;
}
- PyFile_WriteString(" ignored\n", f);
- PyErr_Clear(); /* Just in case */
}
+ 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 +956,7 @@ PyErr_SyntaxLocation(const char *filename, int lineno) {
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 +990,10 @@ PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
}
}
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 +1023,33 @@ PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset)
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 +1080,26 @@ PyErr_ProgramText(const char *filename, int lineno)
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 d25111f4bb..a55064ffdc 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 @@ extern int _Py_normalize_encoding(const char *, char *, size_t);
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
@@ -202,7 +221,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size)
unsigned char *in;
wchar_t *out;
- res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t));
+ res = PyMem_RawMalloc((strlen(arg)+1)*sizeof(wchar_t));
if (!res)
return NULL;
@@ -230,7 +249,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size)
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
@@ -255,9 +274,9 @@ _Py_char2wchar(const char* arg, size_t *size)
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
@@ -284,7 +303,7 @@ _Py_char2wchar(const char* arg, size_t *size)
argsize = mbstowcs(NULL, arg, 0);
#endif
if (argsize != (size_t)-1) {
- res = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t));
+ res = (wchar_t *)PyMem_RawMalloc((argsize+1)*sizeof(wchar_t));
if (!res)
goto oom;
count = mbstowcs(res, arg, argsize+1);
@@ -293,7 +312,7 @@ _Py_char2wchar(const char* arg, size_t *size)
/* 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)
@@ -301,7 +320,7 @@ _Py_char2wchar(const char* arg, size_t *size)
return res;
}
}
- PyMem_Free(res);
+ PyMem_RawFree(res);
}
/* Conversion failed. Fall back to escaping with surrogateescape. */
#ifdef HAVE_MBRTOWC
@@ -310,7 +329,7 @@ _Py_char2wchar(const char* arg, size_t *size)
/* Overallocate; as multi-byte characters are in the argument, the
actual output could use less memory. */
argsize = strlen(arg) + 1;
- 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;
@@ -326,7 +345,7 @@ _Py_char2wchar(const char* arg, size_t *size)
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;
@@ -339,7 +358,7 @@ _Py_char2wchar(const char* arg, size_t *size)
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;
@@ -548,14 +567,215 @@ _Py_stat(PyObject *path, struct stat *statbuf)
#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;
+#elif defined(HAVE_SYS_IOCTL_H) && defined(FIOCLEX) && defined(FIONCLEX)
+ int request;
+ int err;
+#elif defined(HAVE_FCNTL_H)
+ 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;
+
+#elif defined(HAVE_SYS_IOCTL_H) && defined(FIOCLEX) && defined(FIONCLEX)
+ if (inheritable)
+ request = FIONCLEX;
+ else
+ request = FIOCLEX;
+ err = ioctl(fd, request, NULL);
+ if (err) {
+ if (raise)
+ PyErr_SetFromErrno(PyExc_OSError);
+ return -1;
+ }
+ return 0;
+
+#else
+ 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;
@@ -569,21 +789,42 @@ _Py_wfopen(const wchar_t *path, const wchar_t *mode)
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;
+}
- Return the new file object on success, or NULL if the file cannot be open or
- (if PyErr_Occurred()) on unicode error */
+/* 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. */
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];
@@ -603,16 +844,21 @@ _Py_fopen(PyObject *path, const char *mode)
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
@@ -649,12 +895,12 @@ _Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
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
@@ -690,12 +936,12 @@ _Py_wrealpath(const wchar_t *path,
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
@@ -708,7 +954,8 @@ wchar_t*
_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;
@@ -720,12 +967,81 @@ _Py_wgetcwd(wchar_t *buf, size_t size)
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 a6516dceeb..0a3cc593d6 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -315,7 +315,7 @@ calc_padding(Py_ssize_t nchars, Py_ssize_t width, Py_UCS4 align,
/* 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 +556,7 @@ fill_number(_PyUnicodeWriter *writer, const NumberFieldWidths *spec,
{
/* 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 +757,8 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format,
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,9 +771,13 @@ format_string_internal(PyObject *value, const InternalFormatSpec *format,
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)
@@ -977,8 +982,7 @@ format_float_internal(PyObject *value,
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 +1053,24 @@ format_float_internal(PyObject *value,
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;
@@ -1133,8 +1137,7 @@ format_complex_internal(PyObject *value,
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;
diff --git a/Python/frozen.c b/Python/frozen.c
index 25fdc17b3f..9bc662b994 100644
--- a/Python/frozen.c
+++ b/Python/frozen.c
@@ -28,7 +28,7 @@ static unsigned char M___hello__[] = {
#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 @@ static struct _frozen _PyImport_FrozenModules[] = {
/* 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 8b1f2d4bbe..55d05fc26f 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -16,19 +16,19 @@ int
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 @@ Py_FrozenMain(int argc, char **argv)
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 @@ Py_FrozenMain(int argc, char **argv)
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 d24ae416ff..81eab54dd6 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 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, const char *filename)
} 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 @@ future_check_features(PyFutureFeatures *ff, stmt_ty s, const char *filename)
}
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 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
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 @@ future_parse(PyFutureFeatures *ff, mod_ty mod, const char *filename)
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
- done = 1;
- }
- else if (s->kind == Expr_kind && !found_docstring) {
- expr_ty e = s->v.Expr.value;
- if (e->kind != Str_kind)
+ else {
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 @@ PyFuture_FromAST(mod_ty mod, const char *filename)
}
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 ae931b92aa..946faf2d7e 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -46,14 +46,16 @@ typedef struct {
} 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 @@ cleanreturn(int retval, freelist_t *freelist)
freelist->entries[index].item);
}
}
- PyMem_FREE(freelist->entries);
+ if (freelist->entries_malloced)
+ PyMem_FREE(freelist->entries);
return retval;
}
@@ -206,8 +209,13 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
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 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
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 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
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 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
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 @@ seterror(int iarg, const char *msg, int *levels, const char *fname,
}
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 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
int n = 0;
const char *format = *p_format;
int i;
+ Py_ssize_t len;
for (;;) {
int c = *format++;
@@ -443,12 +455,20 @@ converttuple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
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 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
"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
@@ -1419,9 +1439,15 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
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 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
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 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
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 @@ PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t m
/* 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 @@ _PyArg_NoKeywords(const char *funcname, PyObject *kw)
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 4bedbd1f75..0000000000
--- 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 26f82cf29b..7972f8612f 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 @@ struct _inittab *PyImport_Inittab = _PyImport_Inittab;
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 @@ _PyImportZip_Init(void)
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 @@ _PyImport_ReInitLock(void)
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 @@ _PyImport_ReInitLock(void)
#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 @@ imp_lock_held(PyObject *self, PyObject *noargs)
#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_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(PyObject *self, PyObject *noargs)
+_imp_acquire_lock_impl(PyModuleDef *module)
+/*[clinic end generated code: output=478f1fa089fdb9a4 input=4a2d4381866d5fdc]*/
{
#ifdef WITH_THREAD
_PyImport_AcquireLock();
@@ -236,8 +307,37 @@ imp_acquire_lock(PyObject *self, PyObject *noargs)
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 @@ static char* sys_deletes[] = {
"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 @@ static char* sys_files[] = {
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 @@ PyImport_Cleanup(void)
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);
- }
- 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);
- }
+ PySys_WriteStderr("# clear sys.%s\n", *p);
+ PyDict_SetItemString(interp->sysdict, *p, Py_None);
}
-
- /* First, delete __main__ */
- value = PyDict_GetItemString(modules, "__main__");
- if (value != NULL && PyModule_Check(value)) {
+ for (p = sys_files; *p != NULL; p+=2) {
if (Py_VerboseFlag)
- PySys_WriteStderr("# cleanup __main__\n");
- _PyModule_Clear(value);
- PyDict_SetItemString(modules, "__main__", Py_None);
+ 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, value);
+ STORE_MODULE_WEAKREF(key, value);
+ PyDict_SetItem(modules, key, Py_None);
+ }
}
- /* The special treatment of "builtins" here is because even
+ /* 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();
+
+ /* 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++;
- }
- }
- } 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)
+ assert(PyModule_Check(mod));
+ dict = PyModule_GetDict(mod);
+ if (dict == interp->builtins || dict == interp->sysdict)
continue;
- if (Py_VerboseFlag)
- PySys_FormatStderr("# cleanup[2] %U\n", key);
- _PyModule_Clear(value);
- PyDict_SetItem(modules, key, Py_None);
+ Py_INCREF(mod);
+ if (Py_VerboseFlag && PyUnicode_Check(name))
+ PySys_FormatStderr("# cleanup[3] wiping %U\n", name);
+ _PyModule_Clear(mod);
+ Py_DECREF(mod);
}
+ 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 @@ PyImport_GetMagicTag(void)
/* 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 @@ int
_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 @@ _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
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 @@ _PyImport_FixupBuiltin(PyObject *mod, char *name)
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 @@ remove_module(PyObject *name)
* 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 @@ PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname,
"no interpreter!");
}
- pathobj = _PyObject_CallMethodObjIdArgs(interp->importlib,
+ pathobj = _PyObject_CallMethodIdObjArgs(interp->importlib,
&PyId__get_sourcefile, cpathobj,
NULL);
if (pathobj == NULL)
@@ -805,35 +934,66 @@ update_compiled_module(PyCodeObject *co, PyObject *newname)
Py_DECREF(oldname);
}
-static PyObject *
-imp_fix_co_filename(PyObject *self, PyObject *args)
-{
- PyObject *co;
- PyObject *file_path;
+/*[clinic input]
+_imp._fix_co_filename
- if (!PyArg_ParseTuple(args, "OO:_fix_co_filename", &co, &file_path))
- return NULL;
+ code: object(type="PyCodeObject *", subclass_of="&PyCode_Type")
+ Code object to change.
- if (!PyCode_Check(co)) {
- PyErr_SetString(PyExc_TypeError,
- "first argument must be a code object");
- return NULL;
- }
+ path: unicode
+ File path to use.
+ /
- if (!PyUnicode_Check(file_path)) {
- PyErr_SetString(PyExc_TypeError,
- "second argument must be a string");
- return NULL;
- }
+Changes code.co_filename to specify the passed-in file path.
+[clinic start generated code]*/
- update_compiled_module((PyCodeObject*)co, file_path);
+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_impl(PyModuleDef *module, PyCodeObject *code, PyObject *path);
+
+static PyObject *
+_imp__fix_co_filename(PyModuleDef *module, PyObject *args)
+{
+ PyObject *return_value = NULL;
+ PyCodeObject *code;
+ PyObject *path;
+
+ 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);
+
+exit:
+ return return_value;
+}
+
+static PyObject *
+_imp__fix_co_filename_impl(PyModuleDef *module, PyCodeObject *code, PyObject *path)
+/*[clinic end generated code: output=6b4b1edeb0d55c5d input=895ba50e78b82f05]*/
+
+{
+ 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 +1075,11 @@ PyAPI_FUNC(PyObject *)
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 +1096,12 @@ static int
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 +1134,10 @@ init_builtin(PyObject *name)
/* 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 +1154,7 @@ find_frozen(PyObject *name)
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 +1172,13 @@ get_frozen_object(PyObject *name)
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,7 +1205,7 @@ is_frozen_package(PyObject *name)
int
PyImport_ImportFrozenModuleObject(PyObject *name)
{
- struct _frozen *p;
+ const struct _frozen *p;
PyObject *co, *m, *path;
int ispackage;
int size;
@@ -1060,7 +1224,7 @@ PyImport_ImportFrozenModuleObject(PyObject *name)
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,19 +1234,17 @@ PyImport_ImportFrozenModuleObject(PyObject *name)
goto err_return;
}
if (ispackage) {
- /* Set __path__ to the package name */
+ /* Set __path__ to the empty list */
PyObject *d, *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)
@@ -1104,7 +1266,7 @@ err_return:
}
int
-PyImport_ImportFrozenModule(char *name)
+PyImport_ImportFrozenModule(const char *name)
{
PyObject *nameobj;
int ret;
@@ -1218,7 +1380,8 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
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 +1517,11 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
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 +1575,21 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
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 +1600,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
}
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 +1618,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
}
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 +1687,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *given_globals,
}
}
else {
- final_mod = _PyObject_CallMethodObjIdArgs(interp->importlib,
+ final_mod = _PyObject_CallMethodIdObjArgs(interp->importlib,
&PyId__handle_fromlist, mod,
fromlist, builtins_import,
NULL);
@@ -1667,8 +1839,33 @@ PyImport_Import(PyObject *module_name)
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_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(PyObject *self, PyObject *noargs)
+_imp_extension_suffixes_impl(PyModuleDef *module)
+/*[clinic end generated code: output=bb30a2438167798c input=ecdeeecfcb6f839e]*/
{
PyObject *list;
const char *suffix;
@@ -1696,14 +1893,50 @@ imp_extension_suffixes(PyObject *self, PyObject *noargs)
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 +1949,50 @@ imp_init_builtin(PyObject *self, PyObject *args)
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_impl(PyModuleDef *module, PyObject *name);
+
static PyObject *
-imp_init_frozen(PyObject *self, PyObject *args)
+_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 +2005,239 @@ imp_init_frozen(PyObject *self, PyObject *args)
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_impl(PyModuleDef *module, PyObject *name);
+
static PyObject *
-imp_get_frozen_object(PyObject *self, PyObject *args)
+_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_impl(PyModuleDef *module, PyObject *name);
+
static PyObject *
-imp_is_builtin(PyObject *self, PyObject *args)
+_imp_is_builtin(PyModuleDef *module, PyObject *args)
{
+ PyObject *return_value = NULL;
PyObject *name;
- if (!PyArg_ParseTuple(args, "U:is_builtin", &name))
- return NULL;
+
+ 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_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(PyObject *self, PyObject *args)
+_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_impl(PyModuleDef *module, PyObject *name, PyObject *path, PyObject *file);
+
static PyObject *
-imp_load_dynamic(PyObject *self, PyObject *args)
+_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 +2245,8 @@ imp_load_dynamic(PyObject *self, PyObject *args)
}
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 +2254,33 @@ imp_load_dynamic(PyObject *self, PyObject *args)
#endif /* HAVE_DYNAMIC_LOADING */
+/*[clinic input]
+dump buffer
+[clinic start generated code]*/
+
+#ifndef _IMP_LOAD_DYNAMIC_METHODDEF
+ #define _IMP_LOAD_DYNAMIC_METHODDEF
+#endif /* !defined(_IMP_LOAD_DYNAMIC_METHODDEF) */
+/*[clinic end generated code: output=d07c1d4a343a9579 input=524ce2e021e4eba6]*/
-/* Doc strings */
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 +2370,4 @@ PyImport_AppendInittab(const char *name, PyObject* (*initfunc)(void))
#ifdef __cplusplus
}
#endif
+
diff --git a/Python/importdl.c b/Python/importdl.c
index 0ea954cae0..b60f1c75fb 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -77,6 +77,8 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp)
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 6b9cf750a4..6a51a91d2c 100644
--- a/Python/importdl.h
+++ b/Python/importdl.h
@@ -18,13 +18,8 @@ extern PyObject *_PyImport_LoadDynamicModule(PyObject *name, PyObject *pathname,
#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 cb6afc52e8..2644b1d94e 100644
--- a/Python/importlib.h
+++ b/Python/importlib.h
@@ -1,286 +1,257 @@
/* 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,213,4,0,0,100,0,0,90,0,0,
+ 100,161,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,
+ 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,71,
+ 100,103,0,100,104,0,132,0,0,100,104,0,131,2,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,101,63,0,131,3,0,90,64,
+ 0,71,100,113,0,100,114,0,132,0,0,100,114,0,131,2,
+ 0,90,65,0,71,100,115,0,100,116,0,132,0,0,100,116,
+ 0,101,65,0,101,64,0,131,4,0,90,66,0,71,100,117,
+ 0,100,118,0,132,0,0,100,118,0,101,65,0,101,63,0,
+ 131,4,0,90,67,0,103,0,0,90,68,0,71,100,119,0,
+ 100,120,0,132,0,0,100,120,0,131,2,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,100,131,
+ 0,100,132,0,132,0,0,90,75,0,100,133,0,100,134,0,
+ 132,0,0,90,76,0,100,53,0,100,135,0,100,136,0,132,
+ 1,0,90,77,0,100,137,0,100,138,0,132,0,0,90,78,
+ 0,100,139,0,90,79,0,101,79,0,100,140,0,23,90,80,
+ 0,100,141,0,100,142,0,132,0,0,90,81,0,100,143,0,
+ 100,144,0,132,0,0,90,82,0,100,53,0,100,80,0,100,
+ 145,0,100,146,0,132,2,0,90,83,0,100,147,0,100,148,
+ 0,132,0,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,
+ 53,0,100,53,0,102,0,0,100,80,0,100,153,0,100,154,
+ 0,132,4,0,90,87,0,100,155,0,100,156,0,132,0,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,53,0,83,41,
+ 162,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,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,
+ 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,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,
- 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,
+ 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,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,
@@ -294,963 +265,691 @@ unsigned char _Py_M__importlib[] = {
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,
- 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,
+ 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,
- 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,
- 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,
+ 0,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,12,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,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,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,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,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,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,20,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,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,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,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,
- 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,
- 108,101,44,32,114,101,116,117,114,110,32,116,104,101,32,112,
- 97,116,104,32,116,111,32,105,116,115,32,46,112,121,32,102,
- 105,108,101,46,10,10,32,32,32,32,84,104,101,32,46,112,
- 121,99,47,46,112,121,111,32,102,105,108,101,32,100,111,101,
- 115,32,110,111,116,32,110,101,101,100,32,116,111,32,101,120,
- 105,115,116,59,32,116,104,105,115,32,115,105,109,112,108,121,
- 32,114,101,116,117,114,110,115,32,116,104,101,32,112,97,116,
- 104,32,116,111,10,32,32,32,32,116,104,101,32,46,112,121,
- 32,102,105,108,101,32,99,97,108,99,117,108,97,116,101,100,
- 32,116,111,32,99,111,114,114,101,115,112,111,110,100,32,116,
- 111,32,116,104,101,32,46,112,121,99,47,46,112,121,111,32,
- 102,105,108,101,46,32,32,73,102,32,112,97,116,104,32,100,
- 111,101,115,10,32,32,32,32,110,111,116,32,99,111,110,102,
- 111,114,109,32,116,111,32,80,69,80,32,51,49,52,55,32,
- 102,111,114,109,97,116,44,32,86,97,108,117,101,69,114,114,
- 111,114,32,119,105,108,108,32,98,101,32,114,97,105,115,101,
- 100,46,32,73,102,10,32,32,32,32,115,121,115,46,105,109,
- 112,108,101,109,101,110,116,97,116,105,111,110,46,99,97,99,
- 104,101,95,116,97,103,32,105,115,32,78,111,110,101,32,116,
- 104,101,110,32,78,111,116,73,109,112,108,101,109,101,110,116,
- 101,100,69,114,114,111,114,32,105,115,32,114,97,105,115,101,
- 100,46,10,10,32,32,32,32,117,36,0,0,0,115,121,115,
- 46,105,109,112,108,101,109,101,110,116,97,116,105,111,110,46,
- 99,97,99,104,101,95,116,97,103,32,105,115,32,78,111,110,
- 101,117,37,0,0,0,123,125,32,110,111,116,32,98,111,116,
- 116,111,109,45,108,101,118,101,108,32,100,105,114,101,99,116,
- 111,114,121,32,105,110,32,123,33,114,125,117,1,0,0,0,
- 46,105,2,0,0,0,117,28,0,0,0,101,120,112,101,99,
- 116,101,100,32,111,110,108,121,32,50,32,100,111,116,115,32,
- 105,110,32,123,33,114,125,105,0,0,0,0,78,40,13,0,
- 0,0,117,3,0,0,0,115,121,115,117,14,0,0,0,105,
- 109,112,108,101,109,101,110,116,97,116,105,111,110,117,9,0,
- 0,0,99,97,99,104,101,95,116,97,103,117,4,0,0,0,
- 78,111,110,101,117,19,0,0,0,78,111,116,73,109,112,108,
- 101,109,101,110,116,101,100,69,114,114,111,114,117,11,0,0,
- 0,95,112,97,116,104,95,115,112,108,105,116,117,8,0,0,
- 0,95,80,89,67,65,67,72,69,117,10,0,0,0,86,97,
- 108,117,101,69,114,114,111,114,117,6,0,0,0,102,111,114,
- 109,97,116,117,5,0,0,0,99,111,117,110,116,117,9,0,
- 0,0,112,97,114,116,105,116,105,111,110,117,10,0,0,0,
- 95,112,97,116,104,95,106,111,105,110,117,15,0,0,0,83,
- 79,85,82,67,69,95,83,85,70,70,73,88,69,83,40,5,
- 0,0,0,117,4,0,0,0,112,97,116,104,117,4,0,0,
- 0,104,101,97,100,117,16,0,0,0,112,121,99,97,99,104,
- 101,95,102,105,108,101,110,97,109,101,117,7,0,0,0,112,
- 121,99,97,99,104,101,117,13,0,0,0,98,97,115,101,95,
- 102,105,108,101,110,97,109,101,40,0,0,0,0,40,0,0,
- 0,0,117,29,0,0,0,60,102,114,111,122,101,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,
- 111,32,118,101,114,105,102,121,32,116,104,97,116,32,116,104,
- 101,32,109,111,100,117,108,101,32,98,101,105,110,103,32,114,
- 101,113,117,101,115,116,101,100,32,109,97,116,99,104,101,115,
- 32,116,104,101,32,111,110,101,32,116,104,101,10,32,32,32,
- 32,108,111,97,100,101,114,32,99,97,110,32,104,97,110,100,
- 108,101,46,10,10,32,32,32,32,84,104,101,32,102,105,114,
- 115,116,32,97,114,103,117,109,101,110,116,32,40,115,101,108,
- 102,41,32,109,117,115,116,32,100,101,102,105,110,101,32,95,
- 110,97,109,101,32,119,104,105,99,104,32,116,104,101,32,115,
- 101,99,111,110,100,32,97,114,103,117,109,101,110,116,32,105,
- 115,10,32,32,32,32,99,111,109,112,97,114,101,100,32,97,
- 103,97,105,110,115,116,46,32,73,102,32,116,104,101,32,99,
- 111,109,112,97,114,105,115,111,110,32,102,97,105,108,115,32,
- 116,104,101,110,32,73,109,112,111,114,116,69,114,114,111,114,
- 32,105,115,32,114,97,105,115,101,100,46,10,10,32,32,32,
- 32,99,2,0,0,0,0,0,0,0,4,0,0,0,5,0,
- 0,0,31,0,0,0,115,83,0,0,0,124,1,0,100,0,
- 0,107,8,0,114,24,0,124,0,0,106,1,0,125,1,0,
- 110,40,0,124,0,0,106,1,0,124,1,0,107,3,0,114,
- 64,0,116,2,0,100,1,0,124,1,0,22,100,2,0,124,
- 1,0,131,1,1,130,1,0,110,0,0,136,0,0,124,0,
- 0,124,1,0,124,2,0,124,3,0,142,2,0,83,40,3,
- 0,0,0,78,117,23,0,0,0,108,111,97,100,101,114,32,
- 99,97,110,110,111,116,32,104,97,110,100,108,101,32,37,115,
- 117,4,0,0,0,110,97,109,101,40,3,0,0,0,117,4,
- 0,0,0,78,111,110,101,117,4,0,0,0,110,97,109,101,
- 117,11,0,0,0,73,109,112,111,114,116,69,114,114,111,114,
- 40,4,0,0,0,117,4,0,0,0,115,101,108,102,117,4,
- 0,0,0,110,97,109,101,117,4,0,0,0,97,114,103,115,
- 117,6,0,0,0,107,119,97,114,103,115,40,1,0,0,0,
- 117,6,0,0,0,109,101,116,104,111,100,40,0,0,0,0,
- 117,29,0,0,0,60,102,114,111,122,101,110,32,105,109,112,
- 111,114,116,108,105,98,46,95,98,111,111,116,115,116,114,97,
- 112,62,117,19,0,0,0,95,99,104,101,99,107,95,110,97,
- 109,101,95,119,114,97,112,112,101,114,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,
+ 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,180,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,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,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,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,218,9,112,97,114,116,105,116,105,111,110,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,13,98,97,115,101,95,102,105,108,
+ 101,110,97,109,101,218,3,115,101,112,114,36,0,0,0,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,31,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,122,0,0,0,114,123,0,0,0,114,124,0,0,0,
+ 114,38,0,0,0,114,125,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,
+ 114,121,0,0,0,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,128,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,114,129,0,0,0,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,3,1,
+ 24,1,21,1,3,1,21,1,19,1,114,135,0,0,0,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,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,138,0,0,0,41,7,114,31,0,0,0,114,32,0,0,
+ 0,218,5,108,111,119,101,114,114,135,0,0,0,114,124,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,90,4,114,
+ 101,115,116,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,142,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,144,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,
+ 146,0,0,0,114,147,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,145,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,152,
+ 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,32,116,104,101,32,111,110,101,32,116,104,101,10,32,
+ 32,32,32,108,111,97,100,101,114,32,99,97,110,32,104,97,
+ 110,100,108,101,46,10,10,32,32,32,32,84,104,101,32,102,
+ 105,114,115,116,32,97,114,103,117,109,101,110,116,32,40,115,
+ 101,108,102,41,32,109,117,115,116,32,100,101,102,105,110,101,
+ 32,95,110,97,109,101,32,119,104,105,99,104,32,116,104,101,
+ 32,115,101,99,111,110,100,32,97,114,103,117,109,101,110,116,
+ 32,105,115,10,32,32,32,32,99,111,109,112,97,114,101,100,
+ 32,97,103,97,105,110,115,116,46,32,73,102,32,116,104,101,
+ 32,99,111,109,112,97,114,105,115,111,110,32,102,97,105,108,
+ 115,32,116,104,101,110,32,73,109,112,111,114,116,69,114,114,
+ 111,114,32,105,115,32,114,97,105,115,101,100,46,10,10,32,
+ 32,32,32,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,154,0,0,0,
+ 114,155,0,0,0,114,4,0,0,0,41,1,114,154,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,156,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,
@@ -1258,3173 +957,3392 @@ unsigned char _Py_M__importlib[] = {
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,
+ 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,153,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,159,0,0,0,114,160,0,
+ 0,0,114,4,0,0,0,41,1,114,159,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,161,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,153,0,0,0,114,47,0,0,0,41,
+ 2,114,71,0,0,0,114,158,0,0,0,41,1,114,159,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,159,0,0,0,114,163,0,0,0,114,4,
+ 0,0,0,41,1,114,159,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,164,0,0,0,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,
- 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,
- 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,
+ 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,158,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,172,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,158,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,
+ 180,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,152,0,0,0,114,153,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,151,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,190,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,152,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,153,0,0,0,114,47,0,0,0,
+ 41,5,114,53,0,0,0,114,67,0,0,0,114,140,0,0,
+ 0,114,141,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,195,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,185,0,0,0,218,6,101,
+ 120,116,101,110,100,114,17,0,0,0,114,191,0,0,0,90,
+ 5,100,117,109,112,115,41,4,114,194,0,0,0,114,183,0,
+ 0,0,114,189,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,198,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,199,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,203,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,205,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,174,
+ 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,179,0,0,0,114,169,
+ 0,0,0,114,177,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,211,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,
+ 208,0,0,0,218,5,95,115,112,101,99,41,2,114,71,0,
+ 0,0,114,179,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,214,0,0,0,218,
+ 13,95,105,110,105,116,105,97,108,105,122,105,110,103,114,213,
+ 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,214,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,152,0,0,0,114,169,
+ 0,0,0,114,215,0,0,0,41,3,114,71,0,0,0,114,
+ 80,0,0,0,114,177,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,212,0,0,0,214,2,
+ 0,0,115,6,0,0,0,12,2,12,4,12,7,114,212,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,169,0,0,0,114,217,0,0,0,114,218,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,169,0,0,0,114,217,0,0,0,114,218,0,0,0,
+ 114,219,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,169,0,0,0,114,217,0,0,
+ 0,218,6,97,112,112,101,110,100,114,220,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,6,1,22,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,13,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,220,0,0,0,114,67,0,0,0,114,169,0,0,
+ 0,114,217,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,209,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,12,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,222,0,0,0,114,217,
+ 0,0,0,114,221,0,0,0,218,8,101,110,100,115,119,105,
+ 116,104,218,5,116,117,112,108,101,114,134,0,0,0,114,132,
+ 0,0,0,114,124,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,225,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,222,0,0,0,41,2,
+ 114,71,0,0,0,114,225,0,0,0,114,4,0,0,0,114,
+ 4,0,0,0,114,5,0,0,0,114,225,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,220,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,221,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,226,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,221,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,226,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,229,0,0,0,218,8,112,114,111,112,
+ 101,114,116,121,114,225,0,0,0,218,6,115,101,116,116,101,
+ 114,114,233,0,0,0,114,226,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,
+ 216,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,216,0,0,0,114,217,0,0,0,114,219,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,169,0,0,0,114,220,0,0,0,114,219,0,
+ 0,0,70,114,217,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,219,0,0,0,114,153,0,
+ 0,0,114,216,0,0,0,41,5,114,67,0,0,0,114,169,
+ 0,0,0,114,217,0,0,0,114,219,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,173,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,173,
+ 0,0,0,114,169,0,0,0,114,220,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,238,0,0,0,114,217,0,0,0,84,
+ 114,219,0,0,0,114,84,0,0,0,41,14,114,60,0,0,
+ 0,114,238,0,0,0,114,153,0,0,0,114,216,0,0,0,
+ 114,221,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,230,0,0,0,114,231,0,0,0,114,169,0,0,
+ 0,218,9,95,80,79,80,85,76,65,84,69,114,219,0,0,
+ 0,114,220,0,0,0,114,38,0,0,0,114,223,0,0,0,
+ 41,9,114,67,0,0,0,218,8,108,111,99,97,116,105,111,
+ 110,114,169,0,0,0,114,220,0,0,0,114,177,0,0,0,
+ 218,12,108,111,97,100,101,114,95,99,108,97,115,115,114,127,
+ 0,0,0,114,219,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,239,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,239,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,217,0,0,0,70,84,41,
+ 13,114,208,0,0,0,114,209,0,0,0,114,57,0,0,0,
+ 114,204,0,0,0,114,210,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,
+ 216,0,0,0,114,221,0,0,0,114,225,0,0,0,114,220,
+ 0,0,0,41,8,114,179,0,0,0,114,169,0,0,0,114,
+ 217,0,0,0,114,177,0,0,0,114,67,0,0,0,114,242,
+ 0,0,0,114,225,0,0,0,114,220,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,247,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,
+ 174,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,
+ 177,0,0,0,41,2,114,71,0,0,0,114,177,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,206,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,177,0,0,0,114,67,0,0,0,114,217,0,0,
+ 0,114,169,0,0,0,114,47,0,0,0,114,226,0,0,0,
+ 41,3,114,71,0,0,0,114,177,0,0,0,114,67,0,0,
+ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+ 114,205,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,66,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,204,0,0,0,218,11,95,95,112,97,99,107,
+ 97,103,101,95,95,114,246,0,0,0,114,210,0,0,0,114,
+ 244,0,0,0,41,20,114,177,0,0,0,114,62,0,0,0,
+ 114,67,0,0,0,114,57,0,0,0,114,209,0,0,0,114,
+ 169,0,0,0,114,220,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,204,0,0,0,
+ 114,233,0,0,0,114,250,0,0,0,114,208,0,0,0,114,
+ 246,0,0,0,114,226,0,0,0,114,217,0,0,0,114,210,
+ 0,0,0,114,225,0,0,0,114,244,0,0,0,41,6,114,
+ 71,0,0,0,114,179,0,0,0,114,248,0,0,0,114,249,
+ 0,0,0,114,177,0,0,0,114,169,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,177,
+ 0,0,0,114,60,0,0,0,114,169,0,0,0,114,255,0,
+ 0,0,114,68,0,0,0,114,67,0,0,0,114,254,0,0,
+ 0,41,3,114,71,0,0,0,114,177,0,0,0,114,179,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,177,0,0,
+ 0,114,169,0,0,0,218,11,101,120,101,99,95,109,111,100,
+ 117,108,101,41,2,114,71,0,0,0,114,179,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,248,0,0,
+ 0,84,114,1,1,0,0,41,16,114,177,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,
+ 153,0,0,0,114,169,0,0,0,114,220,0,0,0,114,254,
+ 0,0,0,114,60,0,0,0,218,11,108,111,97,100,95,109,
+ 111,100,117,108,101,114,2,1,0,0,41,4,114,71,0,0,
+ 0,114,179,0,0,0,114,67,0,0,0,114,171,0,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,
+ 175,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,204,0,0,0,114,250,0,0,0,114,
+ 246,0,0,0,114,116,0,0,0,114,84,0,0,0,114,208,
+ 0,0,0,41,14,114,177,0,0,0,114,169,0,0,0,114,
+ 4,1,0,0,114,67,0,0,0,114,7,0,0,0,114,73,
+ 0,0,0,114,62,0,0,0,114,204,0,0,0,114,209,0,
+ 0,0,114,57,0,0,0,114,250,0,0,0,114,60,0,0,
+ 0,114,32,0,0,0,114,208,0,0,0,41,3,114,71,0,
+ 0,0,114,177,0,0,0,114,179,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,1,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,177,0,
+ 0,0,114,169,0,0,0,114,60,0,0,0,114,5,1,0,
+ 0,114,0,1,0,0,114,212,0,0,0,114,220,0,0,0,
+ 114,153,0,0,0,114,67,0,0,0,114,2,1,0,0,114,
+ 7,0,0,0,114,73,0,0,0,41,2,114,71,0,0,0,
+ 114,179,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,3,1,0,0,114,103,0,0,0,114,177,
+ 0,0,0,114,67,0,0,0,114,6,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,176,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,205,0,0,0,114,254,0,0,0,
+ 114,0,1,0,0,114,2,1,0,0,114,175,0,0,0,114,
+ 5,1,0,0,114,6,1,0,0,114,176,0,0,0,114,4,
+ 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+ 0,0,114,174,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,174,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,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,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,
- 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,
+ 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,179,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,5,0,0,0,114,205,0,0,0,210,
+ 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,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,
+ 217,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,173,0,0,0,41,4,218,3,99,108,115,114,158,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,219,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,10,1,0,0,114,169,0,0,0,41,4,114,8,1,0,
+ 0,114,158,0,0,0,114,35,0,0,0,114,177,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,228,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,204,0,0,0,
+ 114,250,0,0,0,41,3,114,8,1,0,0,114,158,0,0,
+ 0,114,179,0,0,0,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,4,1,0,0,240,4,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,8,1,
+ 0,0,114,158,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,
+ 252,4,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,8,1,0,0,114,158,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,2,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,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,8,1,0,0,114,158,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,5,0,0,0,114,219,0,0,0,8,
+ 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,205,0,0,0,218,
+ 11,99,108,97,115,115,109,101,116,104,111,100,114,10,1,0,
+ 0,114,11,1,0,0,114,161,0,0,0,114,4,1,0,0,
+ 114,12,1,0,0,114,13,1,0,0,114,219,0,0,0,114,
+ 4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+ 0,0,0,114,7,1,0,0,201,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,7,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,205,0,0,0,24,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,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,217,0,0,
+ 0,90,6,102,114,111,122,101,110,41,3,114,106,0,0,0,
+ 114,162,0,0,0,114,173,0,0,0,41,4,114,8,1,0,
+ 0,114,158,0,0,0,114,35,0,0,0,114,9,1,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,
+ 10,1,0,0,33,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,162,0,0,0,41,3,114,8,
+ 1,0,0,114,158,0,0,0,114,35,0,0,0,114,4,0,
+ 0,0,114,4,0,0,0,114,5,0,0,0,114,11,1,0,
+ 0,40,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,208,0,0,0,114,67,0,
+ 0,0,114,106,0,0,0,114,162,0,0,0,114,153,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,175,
+ 0,0,0,114,63,0,0,0,41,3,114,179,0,0,0,114,
+ 67,0,0,0,114,194,0,0,0,114,4,0,0,0,114,4,
+ 0,0,0,114,5,0,0,0,114,1,1,0,0,49,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,180,0,0,0,41,
+ 2,114,8,1,0,0,114,158,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,5,0,0,0,114,4,1,0,0,58,
+ 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,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,
- 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,
- 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,
- 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,
+ 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,18,1,0,0,41,2,114,8,1,0,
+ 0,114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,12,1,0,0,67,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,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,
+ 0,0,0,115,4,0,0,0,100,1,0,83,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,8,
+ 1,0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,
+ 0,0,114,5,0,0,0,114,13,1,0,0,73,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,8,1,0,0,114,158,0,0,
+ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+ 114,219,0,0,0,79,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,14,1,0,0,114,205,0,0,0,114,15,1,0,0,
+ 114,10,1,0,0,114,11,1,0,0,114,1,1,0,0,114,
+ 4,1,0,0,114,164,0,0,0,114,12,1,0,0,114,13,
+ 1,0,0,114,219,0,0,0,114,4,0,0,0,114,4,0,
+ 0,0,114,4,0,0,0,114,5,0,0,0,114,16,1,0,
+ 0,15,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,16,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,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,8,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,98,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,158,0,0,0,90,11,115,121,115,95,
+ 118,101,114,115,105,111,110,114,136,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,22,1,0,0,114,20,1,0,0,90,
+ 10,81,117,101,114,121,86,97,108,117,101,114,40,0,0,0,
+ 41,6,114,8,1,0,0,114,158,0,0,0,90,12,114,101,
+ 103,105,115,116,114,121,95,107,101,121,114,21,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,
+ 105,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,217,0,0,0,41,7,114,28,1,0,0,114,39,0,0,
+ 0,114,40,0,0,0,114,240,0,0,0,114,230,0,0,0,
+ 114,231,0,0,0,114,173,0,0,0,41,8,114,8,1,0,
+ 0,114,158,0,0,0,114,35,0,0,0,114,9,1,0,0,
+ 114,27,1,0,0,114,169,0,0,0,114,127,0,0,0,114,
+ 177,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+ 0,0,0,114,10,1,0,0,120,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,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,10,1,0,0,114,169,0,0,0,41,4,
+ 114,8,1,0,0,114,158,0,0,0,114,35,0,0,0,114,
+ 177,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+ 0,0,0,114,11,1,0,0,135,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,25,1,0,0,114,24,1,0,0,114,23,1,0,
+ 0,114,15,1,0,0,114,22,1,0,0,114,28,1,0,0,
+ 114,10,1,0,0,114,11,1,0,0,114,4,0,0,0,114,
+ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,19,
+ 1,0,0,86,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,19,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,238,0,0,
+ 0,114,34,0,0,0,114,32,0,0,0,41,5,114,71,0,
+ 0,0,114,158,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,219,0,0,0,154,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,
+ 12,1,0,0,114,57,0,0,0,114,153,0,0,0,114,47,
+ 0,0,0,114,114,0,0,0,114,175,0,0,0,114,63,0,
+ 0,0,41,3,114,71,0,0,0,114,179,0,0,0,114,194,
+ 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,
+ 0,0,114,1,1,0,0,162,5,0,0,115,10,0,0,0,
+ 0,2,18,1,12,1,3,1,24,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,219,0,0,
+ 0,114,1,1,0,0,114,180,0,0,0,114,4,1,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,29,1,0,0,149,5,0,0,115,8,0,
+ 0,0,12,3,6,2,12,8,12,8,114,29,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,
+ 175,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,183,0,0,0,41,1,114,32,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,183,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,
+ 141,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,196,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,116,104,101,32,108,
- 111,97,100,101,114,32,116,111,32,114,101,97,100,32,98,121,
+ 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,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,
- 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,
- 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,
+ 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,34,1,0,
+ 0,206,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,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,238,0,
+ 0,0,218,8,103,101,116,95,100,97,116,97,114,40,0,0,
+ 0,114,153,0,0,0,114,203,0,0,0,41,5,114,71,0,
+ 0,0,114,158,0,0,0,114,35,0,0,0,114,201,0,0,
+ 0,218,3,101,120,99,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,13,1,0,0,213,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,175,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,38,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,223,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,45,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,
+ 183,0,0,0,114,187,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,140,0,0,0,114,141,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,
+ 238,0,0,0,114,132,0,0,0,114,124,0,0,0,114,33,
+ 1,0,0,114,31,1,0,0,114,14,0,0,0,114,36,1,
+ 0,0,114,40,0,0,0,114,190,0,0,0,114,153,0,0,
+ 0,114,186,0,0,0,114,152,0,0,0,114,195,0,0,0,
+ 114,41,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,
+ 198,0,0,0,114,31,0,0,0,114,35,1,0,0,41,10,
+ 114,71,0,0,0,114,158,0,0,0,114,141,0,0,0,114,
+ 188,0,0,0,114,140,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,201,
+ 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,
+ 12,1,0,0,231,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,138,0,0,0,41,10,114,57,0,0,0,114,
+ 56,0,0,0,114,58,0,0,0,114,32,1,0,0,114,33,
+ 1,0,0,114,35,1,0,0,114,34,1,0,0,114,13,1,
+ 0,0,114,41,1,0,0,114,12,1,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+ 114,30,1,0,0,173,5,0,0,115,14,0,0,0,12,2,
+ 12,8,12,13,12,10,12,7,12,10,18,8,114,30,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,158,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,32,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,3,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,224,0,0,0,114,63,0,0,0,
+ 41,2,114,71,0,0,0,114,227,0,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,5,0,0,0,114,229,0,0,0,
+ 38,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,42,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,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,
- 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,
+ 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,45,1,0,0,114,
+ 4,1,0,0,41,2,114,71,0,0,0,114,158,0,0,0,
+ 41,1,114,224,0,0,0,114,4,0,0,0,114,5,0,0,
+ 0,114,4,1,0,0,45,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,158,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,5,0,0,0,114,238,0,0,0,57,
+ 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,36,1,0,0,62,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,229,0,0,0,114,47,
+ 1,0,0,114,156,0,0,0,114,4,1,0,0,114,238,0,
+ 0,0,114,36,1,0,0,114,4,0,0,0,114,4,0,0,
+ 0,41,1,114,224,0,0,0,114,5,0,0,0,114,45,1,
+ 0,0,27,6,0,0,115,14,0,0,0,12,3,6,2,12,
+ 6,12,4,12,3,24,12,18,5,114,45,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,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,218,16,83,111,117,114,
+ 99,101,70,105,108,101,76,111,97,100,101,114,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,
+ 183,0,0,0,114,184,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,
+ 43,1,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+ 0,0,0,114,33,1,0,0,72,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,144,0,0,0,114,
+ 34,1,0,0,41,5,114,71,0,0,0,114,141,0,0,0,
+ 114,140,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,35,
+ 1,0,0,77,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,52,1,0,0,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,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,223,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,152,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,52,
+ 1,0,0,114,233,0,0,0,114,131,0,0,0,114,27,0,
+ 0,0,114,23,0,0,0,114,37,1,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,5,0,0,0,114,34,1,0,0,
+ 82,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,41,7,114,57,0,
+ 0,0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,
+ 0,114,33,1,0,0,114,35,1,0,0,114,34,1,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,50,1,0,0,68,6,0,0,115,8,0,
+ 0,0,12,2,6,2,12,5,12,5,114,50,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,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,
- 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,
+ 90,5,0,100,6,0,83,41,7,218,20,83,111,117,114,99,
+ 101,108,101,115,115,70,105,108,101,76,111,97,100,101,114,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,140,0,0,0,41,4,114,238,0,0,0,114,36,1,
+ 0,0,114,190,0,0,0,114,195,0,0,0,41,5,114,71,
+ 0,0,0,114,158,0,0,0,114,35,0,0,0,114,53,0,
+ 0,0,114,44,1,0,0,114,4,0,0,0,114,4,0,0,
+ 0,114,5,0,0,0,114,12,1,0,0,115,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,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,
+ 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,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,158,0,0,0,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,13,1,0,0,121,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,12,1,
+ 0,0,114,13,1,0,0,114,4,0,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,5,0,0,0,114,54,1,0,0,
+ 111,6,0,0,115,6,0,0,0,12,2,6,2,12,6,114,
+ 54,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,138,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,3,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,224,0,0,0,114,63,0,0,0,
+ 41,2,114,71,0,0,0,114,227,0,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,5,0,0,0,114,229,0,0,0,
+ 142,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,46,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,47,1,0,0,146,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,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,
+ 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,246,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,152,0,0,0,114,
+ 219,0,0,0,114,60,0,0,0,114,38,0,0,0,114,246,
+ 0,0,0,114,204,0,0,0,114,57,0,0,0,114,250,0,
+ 0,0,114,32,0,0,0,41,4,114,71,0,0,0,114,158,
+ 0,0,0,114,179,0,0,0,114,219,0,0,0,114,4,0,
+ 0,0,114,4,0,0,0,114,5,0,0,0,114,4,1,0,
+ 0,149,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,170,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,158,0,0,0,114,4,0,0,0,41,1,114,57,
+ 1,0,0,114,5,0,0,0,114,219,0,0,0,167,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,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,
+ 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,158,0,0,0,114,
+ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,12,
+ 1,0,0,173,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,40,2,0,0,0,117,
- 53,0,0,0,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,
+ 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,114,4,0,0,0,41,2,114,71,0,0,0,
+ 114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,13,1,0,0,177,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,158,0,0,0,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,238,0,0,0,181,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,229,0,0,0,114,47,1,0,0,114,156,0,
+ 0,0,114,4,1,0,0,114,219,0,0,0,114,12,1,0,
+ 0,114,13,1,0,0,114,238,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,
+ 55,1,0,0,130,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,
+ 55,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,253,0,0,0,114,231,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,194,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,246,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,233,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,200,
+ 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,65,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,60,1,0,0,
+ 210,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,231,0,0,
+ 0,114,60,1,0,0,114,61,1,0,0,114,62,1,0,0,
+ 114,70,0,0,0,114,169,0,0,0,114,220,0,0,0,114,
+ 253,0,0,0,41,3,114,71,0,0,0,90,11,112,97,114,
+ 101,110,116,95,112,97,116,104,114,177,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,214,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,66,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,227,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,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,
- 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,
- 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,
+ 0,131,0,0,131,1,0,83,41,1,78,41,2,114,31,0,
+ 0,0,114,66,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,230,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,253,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,233,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,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,66,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,236,6,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,253,0,0,0,114,223,0,0,0,41,2,114,71,0,0,
+ 0,114,70,1,0,0,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,223,0,0,0,239,6,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,65,1,0,0,114,60,1,
+ 0,0,114,66,1,0,0,114,68,1,0,0,114,69,1,0,
+ 0,114,101,0,0,0,114,71,1,0,0,114,223,0,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,59,1,0,0,187,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,59,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,251,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,59,
+ 1,0,0,114,253,0,0,0,41,4,114,71,0,0,0,114,
+ 67,0,0,0,114,35,0,0,0,114,63,1,0,0,114,4,
+ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,72,0,
+ 0,0,245,6,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,
- 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,
- 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,
+ 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,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,8,1,0,0,114,179,0,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,5,0,0,0,114,205,0,0,0,
+ 248,6,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,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,158,0,0,0,114,4,0,0,
+ 0,114,4,0,0,0,114,5,0,0,0,114,219,0,0,0,
+ 1,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,158,0,0,0,114,
+ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,13,
+ 1,0,0,4,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,175,0,
+ 0,0,114,39,1,0,0,84,41,1,114,40,1,0,0,41,
+ 2,114,71,0,0,0,114,158,0,0,0,114,4,0,0,0,
+ 114,4,0,0,0,114,5,0,0,0,114,12,1,0,0,7,
+ 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,179,0,0,0,114,4,0,0,0,114,4,0,0,
+ 0,114,5,0,0,0,114,1,1,0,0,10,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,152,0,0,0,
+ 114,253,0,0,0,114,180,0,0,0,41,2,114,71,0,0,
+ 0,114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,
+ 114,5,0,0,0,114,4,1,0,0,13,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,41,11,114,57,0,0,0,114,56,0,
+ 0,0,114,58,0,0,0,114,72,0,0,0,114,15,1,0,
+ 0,114,205,0,0,0,114,219,0,0,0,114,13,1,0,0,
+ 114,12,1,0,0,114,1,1,0,0,114,4,1,0,0,114,
+ 4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+ 0,0,0,114,251,0,0,0,244,6,0,0,115,14,0,0,
+ 0,12,1,12,3,18,9,12,3,12,3,12,3,12,3,114,
+ 251,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,73,
+ 1,0,0,41,2,114,8,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,73,1,0,0,30,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,166,0,
+ 0,0,114,167,0,0,0,114,168,0,0,0,114,153,0,0,
+ 0,41,3,114,8,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,38,
+ 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,74,1,0,0,114,79,0,0,
+ 0,114,78,1,0,0,41,3,114,8,1,0,0,114,35,0,
+ 0,0,114,76,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,55,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,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,165,0,0,0,41,6,114,60,0,0,0,
+ 114,165,0,0,0,114,11,1,0,0,114,173,0,0,0,114,
+ 216,0,0,0,114,220,0,0,0,41,6,114,8,1,0,0,
+ 114,158,0,0,0,114,76,1,0,0,114,169,0,0,0,114,
+ 170,0,0,0,114,177,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,72,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,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,
+ 97,99,107,97,103,101,32,110,97,109,101,46,78,114,10,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,192,0,0,0,218,3,
+ 115,116,114,218,5,98,121,116,101,115,114,79,1,0,0,114,
+ 60,0,0,0,114,10,1,0,0,114,80,1,0,0,114,169,
+ 0,0,0,114,220,0,0,0,114,153,0,0,0,114,197,0,
+ 0,0,114,216,0,0,0,41,9,114,8,1,0,0,114,158,
+ 0,0,0,114,35,0,0,0,114,9,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,76,1,0,0,114,177,0,0,0,114,170,
+ 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,87,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,84,1,0,0,
+ 114,169,0,0,0,114,220,0,0,0,114,217,0,0,0,114,
+ 59,1,0,0,41,6,114,8,1,0,0,114,158,0,0,0,
+ 114,35,0,0,0,114,9,1,0,0,114,177,0,0,0,114,
+ 83,1,0,0,114,4,0,0,0,114,4,0,0,0,114,5,
+ 0,0,0,114,10,1,0,0,119,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,10,1,0,0,114,169,0,0,0,41,
+ 4,114,8,1,0,0,114,158,0,0,0,114,35,0,0,0,
+ 114,177,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,11,1,0,0,141,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,15,1,0,0,114,73,1,
+ 0,0,114,78,1,0,0,114,79,1,0,0,114,80,1,0,
+ 0,114,84,1,0,0,114,10,1,0,0,114,11,1,0,0,
+ 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,72,1,0,0,26,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,72,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,56,
+ 1,0,0,41,1,114,169,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,77,0,0,0,170,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,138,0,0,0,41,7,114,197,
+ 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,127,0,0,0,
+ 114,4,0,0,0,41,1,114,169,0,0,0,114,5,0,0,
+ 0,114,72,0,0,0,164,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,138,0,0,0,41,1,114,87,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,73,1,0,0,178,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,3,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,10,1,0,0,114,169,0,0,0,114,
+ 220,0,0,0,41,3,114,71,0,0,0,114,158,0,0,0,
+ 114,177,0,0,0,114,4,0,0,0,114,4,0,0,0,114,
+ 5,0,0,0,114,165,0,0,0,184,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,169,0,0,0,114,220,0,0,
+ 0,41,1,114,239,0,0,0,41,7,114,71,0,0,0,114,
+ 243,0,0,0,114,158,0,0,0,114,35,0,0,0,114,228,
+ 0,0,0,114,9,1,0,0,114,169,0,0,0,114,4,0,
+ 0,0,114,4,0,0,0,114,5,0,0,0,114,84,1,0,
+ 0,196,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,145,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,138,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,51,1,0,0,114,40,0,0,0,114,87,1,
+ 0,0,218,11,95,102,105,108,108,95,99,97,99,104,101,114,
+ 6,0,0,0,114,90,1,0,0,114,139,0,0,0,114,89,
+ 1,0,0,114,28,0,0,0,114,86,1,0,0,114,44,0,
+ 0,0,114,84,1,0,0,114,46,0,0,0,114,152,0,0,
+ 0,114,47,0,0,0,114,216,0,0,0,114,220,0,0,0,
+ 41,14,114,71,0,0,0,114,158,0,0,0,114,9,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,183,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,56,1,0,0,114,243,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,177,0,0,0,114,4,0,0,0,114,
+ 4,0,0,0,114,5,0,0,0,114,10,1,0,0,201,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,
+ 139,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,19,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,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,
- 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,
+ 111,114,114,7,0,0,0,114,8,0,0,0,114,9,0,0,
+ 0,114,88,1,0,0,114,89,1,0,0,114,121,0,0,0,
+ 114,47,0,0,0,114,139,0,0,0,218,3,97,100,100,114,
+ 10,0,0,0,114,90,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,70,1,0,0,114,67,0,0,0,
+ 114,64,1,0,0,114,56,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,92,1,0,0,246,7,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,153,
+ 0,0,0,41,1,114,35,0,0,0,41,2,114,8,1,0,
+ 0,114,91,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,31,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,8,1,0,0,114,91,1,
+ 0,0,114,98,1,0,0,114,4,0,0,0,41,2,114,8,
+ 1,0,0,114,91,1,0,0,114,5,0,0,0,218,9,112,
+ 97,116,104,95,104,111,111,107,21,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,39,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,73,1,0,
+ 0,114,172,0,0,0,114,11,1,0,0,114,165,0,0,0,
+ 114,84,1,0,0,114,10,1,0,0,114,92,1,0,0,114,
+ 15,1,0,0,114,99,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,85,1,0,0,155,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,85,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,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,
- 0,4,0,0,0,4,0,0,0,67,0,0,0,115,194,0,
- 0,0,116,0,0,124,0,0,116,1,0,131,2,0,115,45,
- 0,116,2,0,100,1,0,106,3,0,116,4,0,124,0,0,
- 131,1,0,131,1,0,131,1,0,130,1,0,110,0,0,124,
- 2,0,100,2,0,107,0,0,114,72,0,116,5,0,100,3,
- 0,131,1,0,130,1,0,110,0,0,124,1,0,114,156,0,
- 116,0,0,124,1,0,116,1,0,131,2,0,115,108,0,116,
- 2,0,100,4,0,131,1,0,130,1,0,113,156,0,124,1,
- 0,116,6,0,106,7,0,107,7,0,114,156,0,100,5,0,
- 125,3,0,116,8,0,124,3,0,106,3,0,124,1,0,131,
- 1,0,131,1,0,130,1,0,113,156,0,110,0,0,124,0,
- 0,12,114,190,0,124,2,0,100,2,0,107,2,0,114,190,
- 0,116,5,0,100,6,0,131,1,0,130,1,0,110,0,0,
- 100,7,0,83,40,8,0,0,0,117,28,0,0,0,86,101,
- 114,105,102,121,32,97,114,103,117,109,101,110,116,115,32,97,
- 114,101,32,34,115,97,110,101,34,46,117,31,0,0,0,109,
- 111,100,117,108,101,32,110,97,109,101,32,109,117,115,116,32,
- 98,101,32,115,116,114,44,32,110,111,116,32,123,125,105,0,
- 0,0,0,117,18,0,0,0,108,101,118,101,108,32,109,117,
- 115,116,32,98,101,32,62,61,32,48,117,31,0,0,0,95,
- 95,112,97,99,107,97,103,101,95,95,32,110,111,116,32,115,
- 101,116,32,116,111,32,97,32,115,116,114,105,110,103,117,61,
- 0,0,0,80,97,114,101,110,116,32,109,111,100,117,108,101,
- 32,123,33,114,125,32,110,111,116,32,108,111,97,100,101,100,
- 44,32,99,97,110,110,111,116,32,112,101,114,102,111,114,109,
- 32,114,101,108,97,116,105,118,101,32,105,109,112,111,114,116,
- 117,17,0,0,0,69,109,112,116,121,32,109,111,100,117,108,
- 101,32,110,97,109,101,78,40,9,0,0,0,117,10,0,0,
- 0,105,115,105,110,115,116,97,110,99,101,117,3,0,0,0,
- 115,116,114,117,9,0,0,0,84,121,112,101,69,114,114,111,
- 114,117,6,0,0,0,102,111,114,109,97,116,117,4,0,0,
- 0,116,121,112,101,117,10,0,0,0,86,97,108,117,101,69,
- 114,114,111,114,117,3,0,0,0,115,121,115,117,7,0,0,
- 0,109,111,100,117,108,101,115,117,11,0,0,0,83,121,115,
- 116,101,109,69,114,114,111,114,40,4,0,0,0,117,4,0,
- 0,0,110,97,109,101,117,7,0,0,0,112,97,99,107,97,
- 103,101,117,5,0,0,0,108,101,118,101,108,117,3,0,0,
- 0,109,115,103,40,0,0,0,0,40,0,0,0,0,117,29,
- 0,0,0,60,102,114,111,122,101,110,32,105,109,112,111,114,
- 116,108,105,98,46,95,98,111,111,116,115,116,114,97,112,62,
- 117,13,0,0,0,95,115,97,110,105,116,121,95,99,104,101,
- 99,107,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,
- 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,
+ 46,78,41,2,114,106,0,0,0,114,3,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,49,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,53,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,100,1,0,0,45,8,0,0,115,6,0,0,
+ 0,12,2,6,2,12,4,114,100,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,90,4,98,97,115,101,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,58,8,0,0,115,10,0,0,
+ 0,0,2,22,1,18,1,15,1,10,1,114,103,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,11,
+ 1,0,0,114,173,0,0,0,41,4,114,76,1,0,0,114,
+ 67,0,0,0,114,35,0,0,0,114,169,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,
+ 67,8,0,0,115,8,0,0,0,0,3,18,1,12,1,4,
+ 1,114,104,1,0,0,99,3,0,0,0,0,0,0,0,9,
+ 0,0,0,27,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,166,0,0,0,114,167,0,
+ 0,0,114,168,0,0,0,114,73,0,0,0,114,100,1,0,
+ 0,114,10,1,0,0,114,209,0,0,0,114,104,1,0,0,
+ 114,208,0,0,0,41,9,114,67,0,0,0,114,35,0,0,
+ 0,114,9,1,0,0,90,9,105,115,95,114,101,108,111,97,
+ 100,114,76,1,0,0,114,10,1,0,0,114,177,0,0,0,
+ 114,179,0,0,0,114,208,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,76,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,106,
+ 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,131,1,0,131,1,
+ 0,131,1,0,130,1,0,110,0,0,124,2,0,100,2,0,
+ 107,0,0,114,72,0,116,5,0,100,3,0,131,1,0,130,
+ 1,0,110,0,0,124,1,0,114,156,0,116,0,0,124,1,
+ 0,116,1,0,131,2,0,115,108,0,116,2,0,100,4,0,
+ 131,1,0,130,1,0,113,156,0,124,1,0,116,6,0,106,
+ 7,0,107,7,0,114,156,0,100,5,0,125,3,0,116,8,
+ 0,124,3,0,106,3,0,124,1,0,131,1,0,131,1,0,
+ 130,1,0,113,156,0,110,0,0,124,0,0,12,114,190,0,
+ 124,2,0,100,2,0,107,2,0,114,190,0,116,5,0,100,
+ 6,0,131,1,0,130,1,0,110,0,0,100,7,0,83,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,
+ 192,0,0,0,114,81,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,101,1,0,0,114,102,1,0,0,114,171,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,116,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,
+ 109,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,246,0,0,0,114,209,0,0,0,218,8,95,69,82,82,
+ 95,77,83,71,114,47,0,0,0,114,153,0,0,0,114,106,
+ 1,0,0,114,174,0,0,0,114,6,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,233,0,0,0,90,13,112,97,
+ 114,101,110,116,95,109,111,100,117,108,101,114,171,0,0,0,
+ 114,177,0,0,0,114,179,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,136,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,112,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,112,1,0,0,41,
+ 2,114,67,0,0,0,114,111,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,163,8,0,0,115,4,
+ 0,0,0,0,2,13,1,114,113,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,109,1,0,0,114,103,1,0,0,114,106,0,0,
+ 0,114,3,1,0,0,114,7,0,0,0,114,73,0,0,0,
+ 114,113,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,153,0,0,
+ 0,114,112,0,0,0,41,5,114,67,0,0,0,114,101,1,
+ 0,0,114,102,1,0,0,114,179,0,0,0,114,151,0,0,
+ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,
+ 114,114,1,0,0,169,8,0,0,115,26,0,0,0,0,9,
+ 16,1,12,1,21,1,10,1,15,1,13,1,13,1,12,1,
+ 10,2,15,1,21,1,10,1,114,114,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,246,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,245,0,0,0,218,
+ 6,114,101,109,111,118,101,114,197,0,0,0,114,116,1,0,
+ 0,114,47,0,0,0,114,57,0,0,0,114,114,0,0,0,
+ 114,153,0,0,0,114,81,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,179,0,0,0,218,8,102,114,
+ 111,109,108,105,115,116,114,111,1,0,0,114,16,0,0,0,
+ 90,9,102,114,111,109,95,110,97,109,101,114,37,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,193,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,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,
+ 17,1,18,4,21,1,15,1,9,1,32,1,114,120,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,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,
- 116,108,105,98,32,98,121,32,105,109,112,111,114,116,105,110,
- 103,32,110,101,101,100,101,100,32,98,117,105,108,116,45,105,
- 110,32,109,111,100,117,108,101,115,32,97,110,100,32,105,110,
- 106,101,99,116,105,110,103,32,116,104,101,109,10,32,32,32,
- 32,105,110,116,111,32,116,104,101,32,103,108,111,98,97,108,
- 32,110,97,109,101,115,112,97,99,101,46,10,10,32,32,32,
- 32,65,115,32,115,121,115,32,105,115,32,110,101,101,100,101,
- 100,32,102,111,114,32,115,121,115,46,109,111,100,117,108,101,
- 115,32,97,99,99,101,115,115,32,97,110,100,32,95,105,109,
- 112,32,105,115,32,110,101,101,100,101,100,32,116,111,32,108,
- 111,97,100,32,98,117,105,108,116,45,105,110,10,32,32,32,
- 32,109,111,100,117,108,101,115,44,32,116,104,111,115,101,32,
- 116,119,111,32,109,111,100,117,108,101,115,32,109,117,115,116,
- 32,98,101,32,101,120,112,108,105,99,105,116,108,121,32,112,
- 97,115,115,101,100,32,105,110,46,10,10,32,32,32,32,117,
- 10,0,0,0,95,95,108,111,97,100,101,114,95,95,117,3,
- 0,0,0,95,105,111,117,9,0,0,0,95,119,97,114,110,
- 105,110,103,115,117,8,0,0,0,98,117,105,108,116,105,110,
- 115,117,7,0,0,0,109,97,114,115,104,97,108,117,5,0,
- 0,0,112,111,115,105,120,117,1,0,0,0,47,117,2,0,
- 0,0,110,116,117,1,0,0,0,92,117,3,0,0,0,111,
- 115,50,99,1,0,0,0,0,0,0,0,2,0,0,0,3,
+ 0,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,250,0,0,0,78,114,57,0,0,0,114,
+ 246,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,101,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,225,8,0,0,
+ 115,12,0,0,0,0,7,15,1,12,1,10,1,12,1,25,
+ 1,114,122,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,55,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,50,1,0,0,114,
+ 134,0,0,0,114,54,1,0,0,114,232,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,240,0,
+ 0,0,240,8,0,0,115,8,0,0,0,0,5,18,1,12,
+ 1,12,1,114,240,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,
+ 114,1,0,0,114,122,1,0,0,114,121,0,0,0,114,31,
+ 0,0,0,114,7,0,0,0,114,73,0,0,0,114,57,0,
+ 0,0,114,120,1,0,0,41,9,114,67,0,0,0,114,121,
+ 1,0,0,218,6,108,111,99,97,108,115,114,119,1,0,0,
+ 114,102,1,0,0,114,179,0,0,0,90,8,103,108,111,98,
+ 97,108,115,95,114,101,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,251,8,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,125,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,7,1,0,0,114,10,1,0,0,114,153,0,
+ 0,0,114,174,0,0,0,114,6,1,0,0,41,3,114,67,
+ 0,0,0,114,177,0,0,0,114,178,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,
+ 30,9,0,0,115,10,0,0,0,0,1,15,1,12,1,19,
+ 1,12,1,114,126,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,106,101,99,116,105,110,103,
+ 32,116,104,101,109,10,32,32,32,32,105,110,116,111,32,116,
+ 104,101,32,103,108,111,98,97,108,32,110,97,109,101,115,112,
+ 97,99,101,46,10,10,32,32,32,32,65,115,32,115,121,115,
+ 32,105,115,32,110,101,101,100,101,100,32,102,111,114,32,115,
+ 121,115,46,109,111,100,117,108,101,115,32,97,99,99,101,115,
+ 115,32,97,110,100,32,95,105,109,112,32,105,115,32,110,101,
+ 101,100,101,100,32,116,111,32,108,111,97,100,32,98,117,105,
+ 108,116,45,105,110,10,32,32,32,32,109,111,100,117,108,101,
+ 115,44,32,116,104,111,115,101,32,116,119,111,32,109,111,100,
+ 117,108,101,115,32,109,117,115,116,32,98,101,32,101,120,112,
+ 108,105,99,105,116,108,121,32,112,97,115,115,101,100,32,105,
+ 110,46,10,10,32,32,32,32,114,49,0,0,0,114,166,0,
+ 0,0,218,8,98,117,105,108,116,105,110,115,114,191,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,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,
- 0,3,0,0,0,67,0,0,0,115,136,0,0,0,116,0,
- 0,124,0,0,124,1,0,131,2,0,1,116,1,0,131,0,
- 0,125,2,0,116,2,0,106,3,0,106,4,0,116,5,0,
- 106,6,0,124,2,0,140,0,0,103,1,0,131,1,0,1,
- 116,2,0,106,7,0,106,8,0,116,9,0,131,1,0,1,
- 116,2,0,106,7,0,106,8,0,116,10,0,131,1,0,1,
- 116,11,0,106,12,0,100,1,0,107,2,0,114,116,0,116,
- 2,0,106,7,0,106,8,0,116,13,0,131,1,0,1,110,
- 0,0,116,2,0,106,7,0,106,8,0,116,14,0,131,1,
- 0,1,100,2,0,83,40,3,0,0,0,117,50,0,0,0,
- 73,110,115,116,97,108,108,32,105,109,112,111,114,116,108,105,
- 98,32,97,115,32,116,104,101,32,105,109,112,108,101,109,101,
- 110,116,97,116,105,111,110,32,111,102,32,105,109,112,111,114,
- 116,46,117,2,0,0,0,110,116,78,40,15,0,0,0,117,
- 6,0,0,0,95,115,101,116,117,112,117,27,0,0,0,95,
- 103,101,116,95,115,117,112,112,111,114,116,101,100,95,102,105,
- 108,101,95,108,111,97,100,101,114,115,117,3,0,0,0,115,
- 121,115,117,10,0,0,0,112,97,116,104,95,104,111,111,107,
- 115,117,6,0,0,0,101,120,116,101,110,100,117,10,0,0,
- 0,70,105,108,101,70,105,110,100,101,114,117,9,0,0,0,
- 112,97,116,104,95,104,111,111,107,117,9,0,0,0,109,101,
- 116,97,95,112,97,116,104,117,6,0,0,0,97,112,112,101,
- 110,100,117,15,0,0,0,66,117,105,108,116,105,110,73,109,
- 112,111,114,116,101,114,117,14,0,0,0,70,114,111,122,101,
- 110,73,109,112,111,114,116,101,114,117,3,0,0,0,95,111,
- 115,117,8,0,0,0,95,95,110,97,109,101,95,95,117,21,
- 0,0,0,87,105,110,100,111,119,115,82,101,103,105,115,116,
- 114,121,70,105,110,100,101,114,117,10,0,0,0,80,97,116,
- 104,70,105,110,100,101,114,40,3,0,0,0,117,10,0,0,
- 0,115,121,115,95,109,111,100,117,108,101,117,11,0,0,0,
- 95,105,109,112,95,109,111,100,117,108,101,117,17,0,0,0,
- 115,117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,
- 115,40,0,0,0,0,40,0,0,0,0,117,29,0,0,0,
- 60,102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,
- 98,46,95,98,111,111,116,115,116,114,97,112,62,117,8,0,
- 0,0,95,105,110,115,116,97,108,108,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,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,130,0,0,0,114,4,0,0,0,114,4,0,
+ 0,0,114,5,0,0,0,114,77,0,0,0,82,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,20,
+ 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,232,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,192,0,0,0,114,157,0,0,0,114,7,1,0,
+ 0,114,162,0,0,0,114,16,1,0,0,114,247,0,0,0,
+ 114,174,0,0,0,114,254,0,0,0,114,57,0,0,0,114,
+ 126,1,0,0,114,61,0,0,0,218,3,97,108,108,114,100,
+ 0,0,0,114,153,0,0,0,114,26,0,0,0,114,11,0,
+ 0,0,114,58,1,0,0,114,197,0,0,0,114,123,1,0,
+ 0,114,134,0,0,0,114,223,0,0,0,114,19,1,0,0,
+ 114,23,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,179,0,0,0,114,169,0,0,0,114,177,0,0,
+ 0,114,178,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,38,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,135,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,106,6,0,124,2,0,140,
+ 0,0,103,1,0,131,1,0,1,116,2,0,106,7,0,106,
+ 8,0,116,9,0,131,1,0,1,116,2,0,106,7,0,106,
+ 8,0,116,10,0,131,1,0,1,116,11,0,106,12,0,100,
+ 1,0,107,2,0,114,116,0,116,2,0,106,7,0,106,8,
+ 0,116,13,0,131,1,0,1,110,0,0,116,2,0,106,7,
+ 0,106,8,0,116,14,0,131,1,0,1,100,2,0,83,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,129,1,0,0,78,41,15,114,135,1,
+ 0,0,114,240,0,0,0,114,7,0,0,0,114,77,1,0,
+ 0,114,197,0,0,0,114,85,1,0,0,114,99,1,0,0,
+ 114,105,1,0,0,114,223,0,0,0,114,7,1,0,0,114,
+ 16,1,0,0,114,3,0,0,0,114,57,0,0,0,114,19,
+ 1,0,0,114,72,1,0,0,41,3,114,133,1,0,0,114,
+ 134,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,
+ 125,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,136,1,0,0,41,3,
+ 122,3,119,105,110,114,1,0,0,0,114,2,0,0,0,41,
+ 91,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,193,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,185,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,125,0,0,0,114,134,
+ 0,0,0,114,119,0,0,0,114,120,0,0,0,114,132,0,
+ 0,0,114,135,0,0,0,114,142,0,0,0,114,144,0,0,
+ 0,114,152,0,0,0,114,156,0,0,0,114,161,0,0,0,
+ 114,164,0,0,0,114,172,0,0,0,114,180,0,0,0,114,
+ 190,0,0,0,114,195,0,0,0,114,198,0,0,0,114,203,
+ 0,0,0,114,211,0,0,0,114,212,0,0,0,114,216,0,
+ 0,0,114,173,0,0,0,218,6,111,98,106,101,99,116,114,
+ 241,0,0,0,114,239,0,0,0,114,247,0,0,0,114,174,
+ 0,0,0,114,7,1,0,0,114,16,1,0,0,114,19,1,
+ 0,0,114,29,1,0,0,114,30,1,0,0,114,45,1,0,
+ 0,114,50,1,0,0,114,54,1,0,0,114,58,1,0,0,
+ 114,55,1,0,0,114,59,1,0,0,114,251,0,0,0,114,
+ 72,1,0,0,114,85,1,0,0,114,100,1,0,0,114,103,
+ 1,0,0,114,104,1,0,0,114,106,1,0,0,114,109,1,
+ 0,0,114,118,1,0,0,114,110,1,0,0,114,112,1,0,
+ 0,114,113,1,0,0,114,114,1,0,0,114,120,1,0,0,
+ 114,122,1,0,0,114,240,0,0,0,114,125,1,0,0,114,
+ 126,1,0,0,114,135,1,0,0,114,136,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,168,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,
+ 232,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 cc17329913..dc5411c1ff 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 @@ typedef struct {
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 @@ w_more(int c, WFILE *p)
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_pstring(const char *s, Py_ssize_t n, WFILE *p)
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 @@ w_pstring(const char *s, Py_ssize_t n, WFILE *p)
#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 @@ w_PyLong(const PyLongObject *ob, WFILE *p)
} 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 @@ w_object(PyObject *v, WFILE *p)
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 @@ w_object(PyObject *v, WFILE *p)
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 @@ w_object(PyObject *v, WFILE *p)
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 @@ w_object(PyObject *v, WFILE *p)
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 @@ w_object(PyObject *v, WFILE *p)
}
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 @@ w_object(PyObject *v, WFILE *p)
}
}
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);
+ }
+ }
+ 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);
}
- w_byte(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 @@ w_object(PyObject *v, WFILE *p)
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 @@ w_object(PyObject *v, WFILE *p)
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 @@ w_object(PyObject *v, WFILE *p)
}
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);
@@ -421,15 +537,14 @@ w_object(PyObject *v, WFILE *p)
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 @@ PyMarshal_WriteLongToFile(long x, FILE *fp, int version)
wf.fp = fp;
wf.error = WFERR_OK;
wf.depth = 0;
+ wf.refs = NULL;
wf.version = version;
w_long(x, &wf);
}
@@ -451,81 +567,107 @@ PyMarshal_WriteObjectToFile(PyObject *x, FILE *fp, int version)
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);
-
- 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);
+ _Py_IDENTIFIER(readinto);
+ PyObject *res, *mview;
+ Py_buffer buf;
+
+ 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 @@ r_byte(RFILE *p)
static int
r_short(RFILE *p)
{
- register short x;
- unsigned char buffer[2];
-
- 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);
+ short x = -1;
+ unsigned char *buffer;
+
+ 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];
-
- r_string((char *) buffer, 4, p);
- x = buffer[0];
- x |= (long)buffer[1] << 8;
- x |= (long)buffer[2] << 16;
- x |= (long)buffer[3] << 24;
+ long x = -1;
+ unsigned char *buffer;
+
+ 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 @@ r_PyLong(RFILE *p)
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 @@ r_PyLong(RFILE *p)
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 @@ r_object(RFILE *p)
/* 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 @@ r_object(RFILE *p)
return NULL;
}
- switch (type) {
+ flag = code & FLAG_REF;
+ type = code & ~FLAG_REF;
- case EOF:
- PyErr_SetString(PyExc_EOFError,
- "EOF read where object expected");
- retval = NULL;
- break;
+#define R_REF(O) do{\
+ if (flag) \
+ O = r_ref(O, flag, p);\
+} while (0)
+
+ switch (type) {
case TYPE_NULL:
- retval = NULL;
break;
case TYPE_NONE:
@@ -726,67 +904,66 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
"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;
}
+
+ 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 (string size out of range)");
- retval = NULL;
+ PyErr_SetString(PyExc_ValueError, "bad marshal data (unicode size out of range)");
break;
}
- v = PyBytes_FromStringAndSize((char *)NULL, n);
- if (v == NULL) {
- retval = NULL;
+ 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;
}
- if (r_string(PyBytes_AS_STRING(v), n, p) != n) {
- Py_DECREF(v);
- retval = NULL;
+ _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;
}
- retval = v;
- 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 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
}
Py_DECREF(v2);
}
+ if (type != TYPE_SET)
+ v = r_ref_insert(v, idx, flag, p);
retval = v;
break;
@@ -1029,6 +1255,10 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
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 @@ r_object(RFILE *p)
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 @@ int
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 @@ PyMarshal_ReadObjectFromFile(FILE *fp)
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,13 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
wf.error = WFERR_OK;
wf.depth = 0;
wf.version = version;
+ if (version >= 3) {
+ if ((wf.refs = PyDict_New()) == NULL)
+ 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 +1599,8 @@ marshal_load(PyObject *self, PyObject *f)
* 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 +1616,15 @@ marshal_load(PyObject *self, PyObject *f)
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 +1681,11 @@ marshal_loads(PyObject *self, PyObject *args)
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 +1725,7 @@ Variables:\n\
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 428914f378..6c938ddd79 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -161,7 +161,17 @@ do_mktuple(const char **p_format, va_list *p_va, int endchar, int n, int flags)
/* 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 8a54cbf403..98429d4b42 100644
--- a/Python/mystrtoul.c
+++ b/Python/mystrtoul.c
@@ -92,11 +92,11 @@ static int digitlimit[] = {
** 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
while (Py_ISSPACE(Py_CHARMASK(*str)))
++str;
if (ptr)
- *ptr = str;
+ *ptr = (char *)str;
return 0;
}
}
@@ -157,7 +157,7 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* 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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* catch silly bases */
if (base < 2 || base > 36) {
if (ptr)
- *ptr = str;
+ *ptr = (char *)str;
return 0;
}
@@ -213,7 +213,7 @@ PyOS_strtoul(register char *str, char **ptr, int base)
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 @@ PyOS_strtoul(register char *str, char **ptr, int base)
/* set pointer to point to the last character scanned */
if (ptr)
- *ptr = str;
+ *ptr = (char *)str;
return result;
@@ -248,7 +248,7 @@ overflowed:
/* 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 @@ overflowed:
#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 2d6bcda513..f90a17a7ee 100644
--- a/Python/opcode_targets.h
+++ b/Python/opcode_targets.h
@@ -68,7 +68,7 @@ static void *opcode_targets[256] = {
&&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 @@ static void *opcode_targets[256] = {
&&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 5d536779ac..4185462b34 100644
--- a/Python/peephole.c
+++ b/Python/peephole.c
@@ -275,6 +275,7 @@ fold_unaryops_on_constants(unsigned char *codestr, PyObject *consts, PyObject *v
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 @@ markblocks(unsigned char *code, Py_ssize_t len)
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 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
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 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
/* 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 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
/* 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 @@ PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names,
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 02a31d8ff0..103603fcdf 100644
--- a/Python/pyarena.c
+++ b/Python/pyarena.c
@@ -77,7 +77,7 @@ block_new(size_t size)
{
/* 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 @@ static void
block_free(block *b) {
while (b) {
block *next = b->ab_next;
- free(b);
+ PyMem_Free(b);
b = next;
}
}
@@ -127,20 +127,20 @@ block_alloc(block *b, size_t size)
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 @@ PyArena_Free(PyArena *arena)
*/
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 0000000000..97cb54759b
--- /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 772aa53168..2ac2fd5274 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 *
PyInterpreterState_New(void)
{
PyInterpreterState *interp = (PyInterpreterState *)
- malloc(sizeof(PyInterpreterState));
+ PyMem_RawMalloc(sizeof(PyInterpreterState));
if (interp != NULL) {
HEAD_INIT();
@@ -72,6 +72,7 @@ PyInterpreterState_New(void)
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 @@ PyInterpreterState_Clear(PyInterpreterState *interp)
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 @@ PyInterpreterState_Delete(PyInterpreterState *interp)
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 @@ threadstate_getframe(PyThreadState *self)
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 @@ new_threadstate(PyInterpreterState *interp, int init)
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 @@ new_threadstate(PyInterpreterState *interp, int init)
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 @@ PyState_RemoveModule(struct PyModuleDef* def)
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 @@ static void
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 @@ PyThreadState_DeleteCurrent()
#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 @@ _PyGILState_NoteThreadState(PyThreadState* tstate)
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 @@ PyGILState_GetThisThreadState(void)
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 @@ PyGILState_Ensure(void)
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 4ab8f08d22..b8dd919a26 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -164,7 +164,7 @@ static double
_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;
@@ -923,7 +923,7 @@ static char *uc_float_strings[] = {
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 @@ format_float_short(double d, char format_code,
/* 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 91d56b78ee..e9947e9ff6 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -35,12 +35,42 @@
#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 +87,7 @@ static int initfsencoding(PyInterpreterState *interp);
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 +98,15 @@ static void call_py_exitfuncs(void);
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 +127,7 @@ int Py_IgnoreEnvironmentFlag; /* e.g. PYTHONPATH, PYTHONHOME */
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 +153,45 @@ Py_IsInitialized(void)
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 +220,6 @@ get_codec_name(const char *encoding)
{
char *name_utf8, *name_str;
PyObject *codec, *name = NULL;
- _Py_IDENTIFIER(name);
codec = _PyCodec_Lookup(encoding);
if (!codec)
@@ -160,7 +233,7 @@ get_codec_name(const char *encoding)
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 +386,8 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
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 +396,8 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
/* 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 +428,7 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
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 +456,9 @@ _Py_InitializeEx_Private(int install_sigs, int install_importlib)
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 +516,9 @@ file_is_closed(PyObject *fobj)
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 +608,6 @@ Py_Finalize(void)
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 +633,10 @@ Py_Finalize(void)
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 +650,8 @@ Py_Finalize(void)
#ifdef COUNT_ALLOCS
dump_counts(stdout);
#endif
+ /* dump hash stats */
+ _PyHash_Fini();
PRINT_TOTAL_REFS();
@@ -596,11 +676,6 @@ Py_Finalize(void)
_PyExc_Fini();
- /* Cleanup auto-thread-state */
-#ifdef WITH_THREAD
- _PyGILState_Fini();
-#endif /* WITH_THREAD */
-
/* Sundry finalizers */
PyMethod_Fini();
PyFrame_Fini();
@@ -614,17 +689,15 @@ Py_Finalize(void)
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 +709,15 @@ Py_Finalize(void)
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 +800,7 @@ Py_NewInterpreter(void)
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 +855,9 @@ Py_EndInterpreter(PyThreadState *tstate)
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 +887,7 @@ Py_GetProgramName(void)
}
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 +917,7 @@ Py_GetPythonHome(void)
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 +938,8 @@ initmain(PyInterpreterState *interp)
* 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 +989,7 @@ initsite(void)
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 +1012,6 @@ create_stdio(PyObject* io,
_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 +1121,7 @@ initstdio(void)
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 +1153,28 @@ initstdio(void)
}
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 +1194,7 @@ initstdio(void)
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 +1209,7 @@ initstdio(void)
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 +1229,24 @@ initstdio(void)
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 +1255,16 @@ initstdio(void)
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 +1289,47 @@ PyRun_AnyFileExFlags(FILE *fp, const char *filename, int closeit,
}
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 +1357,25 @@ static int PARSER_FLAGS(PyCompilerFlags *flags)
#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 +1384,7 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
PyErr_Clear();
}
}
- v = PySys_GetObject("ps1");
+ v = _PySys_GetObjectId(&PyId_ps1);
if (v != NULL) {
v = PyObject_Str(v);
if (v == NULL)
@@ -1265,7 +1397,7 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
}
}
}
- w = PySys_GetObject("ps2");
+ w = _PySys_GetObjectId(&PyId_ps2);
if (w != NULL) {
w = PyObject_Str(w);
if (w == NULL)
@@ -1285,9 +1417,9 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
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 +1432,7 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
PyErr_Print();
return -1;
}
- m = PyImport_AddModule("__main__");
+ m = PyImport_AddModuleObject(mod_name);
if (m == NULL) {
PyArena_Free(arena);
return -1;
@@ -1317,6 +1449,23 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
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 +1506,8 @@ maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit)
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 +1574,7 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
/* 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 +1633,8 @@ PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
}
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 +1645,7 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
_Py_IDENTIFIER(text);
*message = NULL;
+ *filename = NULL;
/* new style errors. `err' is an instance */
*message = _PyObject_GetAttrId(err, &PyId_msg);
@@ -1507,13 +1657,13 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
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 +1697,13 @@ parse_syntax_error(PyObject *err, PyObject **message, const char **filename,
*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 +1714,15 @@ PyErr_Print(void)
}
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 +1781,12 @@ handle_system_exit(void)
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 +1829,11 @@ PyErr_PrintEx(int set_sys_last_vars)
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 +1883,11 @@ print_exception(PyObject *f, PyObject *value)
_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 +1900,30 @@ print_exception(PyObject *f, PyObject *value)
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 +1952,9 @@ print_exception(PyObject *f, PyObject *value)
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 +2047,7 @@ void
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 +2083,54 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals,
{
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();
+ PyArena *arena = NULL;
+ PyObject *filename;
+
+ filename = PyUnicode_DecodeFSDefault(filename_str);
+ if (filename == NULL)
+ goto exit;
+
+ arena = PyArena_New();
if (arena == NULL)
- return NULL;
+ goto exit;
- mod = PyParser_ASTFromFile(fp, filename, NULL, start, 0, 0,
- flags, NULL, arena);
+ 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 +2139,11 @@ flush_io(void)
{
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 +2151,7 @@ flush_io(void)
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 +2164,12 @@ flush_io(void)
}
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 +2211,8 @@ run_pyc_file(FILE *fp, const char *filename, PyObject *globals,
}
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 +2220,7 @@ Py_CompileStringExFlags(const char *str, const char *filename, int start,
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 +2230,24 @@ Py_CompileStringExFlags(const char *str, const char *filename, int start,
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 +2257,62 @@ PyCompileString(const char *str, const char *filename, int start)
}
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 +2324,40 @@ PyParser_ASTFromString(const char *s, const char *filename, int start,
}
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 +2370,23 @@ PyParser_ASTFromFile(FILE *fp, const char *filename, const char* enc,
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 +2723,9 @@ initsigs(void)
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 beeab87e2c..de6a41fe00 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -152,7 +152,7 @@ _PyLong_FromTime_t(time_t t)
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 @@ _PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator,
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 @@ _PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator,
return -1;
}
- floatpart *= denominator;
*numerator = (long)floatpart;
return 0;
}
@@ -188,12 +201,18 @@ _PyTime_ObjectToDenominator(PyObject *obj, time_t *sec, long *numerator,
}
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 @@ _PyTime_ObjectToTime_t(PyObject *obj, time_t *sec)
}
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 337be86087..cdace0036b 100644
--- a/Python/random.c
+++ b/Python/random.c
@@ -12,13 +12,6 @@ static int _Py_HashSecret_Initialized = 0;
#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;
@@ -26,29 +19,9 @@ 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;
@@ -77,7 +50,7 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
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)
@@ -95,40 +68,20 @@ win32_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
#endif /* MS_WINDOWS */
-#ifdef __VMS
-/* Use openssl random routine */
-#include <openssl/rand.h>
-static int
-vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise)
-{
- 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");
- }
- return -1;
- }
- return 0;
-}
-#endif /* __VMS */
-
-
-#if !defined(MS_WINDOWS) && !defined(__VMS)
+#ifndef MS_WINDOWS
+static int urandom_fd = -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");
@@ -160,18 +113,30 @@ dev_urandom_python(char *buffer, Py_ssize_t size)
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");
+ if (urandom_fd >= 0)
+ fd = urandom_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_fd >= 0) {
+ /* urandom_fd was initialized by another thread while we were
+ not holding the GIL, keep it. */
+ close(fd);
+ fd = urandom_fd;
+ }
else
- PyErr_SetFromErrno(PyExc_OSError);
- return -1;
+ urandom_fd = fd;
}
Py_BEGIN_ALLOW_THREADS
@@ -195,13 +160,21 @@ dev_urandom_python(char *buffer, Py_ssize_t size)
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_fd >= 0) {
+ close(urandom_fd);
+ urandom_fd = -1;
+ }
+}
+
+#endif /* MS_WINDOWS */
/* Fill buffer with pseudo-random bytes generated by a linear congruent
generator (LCG):
@@ -243,11 +216,7 @@ _PyOS_URandom(void *buffer, Py_ssize_t size)
#ifdef MS_WINDOWS
return win32_urandom((unsigned char *)buffer, size, 1);
#else
-# ifdef __VMS
- return vms_urandom((unsigned char *)buffer, size, 1);
-# else
return dev_urandom_python((char*)buffer, size);
-# endif
#endif
}
@@ -255,8 +224,9 @@ void
_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 +254,22 @@ _PyRandom_Init(void)
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);
+#else
+ dev_urandom_noraise(secret, secret_size);
#endif
}
}
+
+void
+_PyRandom_Fini(void)
+{
+#ifndef MS_WINDOWS
+ dev_urandom_close();
+#endif
+}
diff --git a/Python/strdup.c b/Python/strdup.c
index 20187e0f0a..769d3db130 100644
--- a/Python/strdup.c
+++ b/Python/strdup.c
@@ -6,7 +6,7 @@ char *
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 1e13b790de..da164aa877 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -37,24 +37,14 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
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_new(struct symtable *st, identifier name, _Py_block_ty block,
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 @@ ste_dealloc(PySTEntryObject *ste)
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 int symtable_visit_withitem(struct symtable *st, withitem_ty item);
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 @@ symtable_new(void)
#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 @@ PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
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 @@ PySymtable_Build(mod_ty mod, const char *filename, PyFutureFeatures *future)
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 @@ PyST_GetScope(PySTEntryObject *ste, PyObject *name)
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 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags,
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 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags,
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 @@ analyze_name(PySTEntryObject *ste, PyObject *scopes, PyObject *name, long flags,
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 @@ analyze_cells(PyObject *scopes, PyObject *free, const char *restricted)
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 @@ analyze_cells(PyObject *scopes, PyObject *free, const char *restricted)
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 @@ check_unoptimized(const PySTEntryObject* ste) {
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 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
/* 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 @@ analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free,
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 @@ symtable_analyze(struct symtable *st)
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 @@ symtable_add_def(struct symtable *st, PyObject *name, int flag)
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 @@ symtable_new_tmpname(struct symtable *st)
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 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
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 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
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 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
}
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 @@ symtable_visit_stmt(struct symtable *st, stmt_ty s)
}
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 @@ symtable_visit_expr(struct symtable *st, expr_ty e)
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 @@ symtable_visit_annotations(struct symtable *st, stmt_ty s)
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 @@ symtable_visit_arguments(struct symtable *st, arguments_ty a)
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 @@ symtable_visit_alias(struct symtable *st, alias_ty a)
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 2f700e6507..9ec3bfa07b 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -32,15 +32,31 @@ extern void *PyWin_DLLhModule;
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 @@ PySys_GetObject(const char *name)
}
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 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
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 @@ sys_displayhook_unencodable(PyObject *outf, PyObject *o)
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 @@ sys_displayhook(PyObject *self, PyObject *o)
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 @@ sys_displayhook(PyObject *self, PyObject *o)
}
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 @@ sys_displayhook(PyObject *self, PyObject *o)
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 @@ trace_init(void)
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 @@ call_trampoline(PyThreadState *tstate, PyObject* callback,
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 @@ static int
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 @@ static int
trace_trampoline(PyObject *self, PyFrameObject *frame,
int what, PyObject *arg)
{
- PyThreadState *tstate = frame->f_tstate;
PyObject *callback;
PyObject *result;
@@ -392,7 +427,7 @@ trace_trampoline(PyObject *self, PyFrameObject *frame,
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 @@ PyDoc_STRVAR(hash_info_doc,
"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 @@ static PyStructSequence_Field hash_info_fields[] = {
{"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 @@ static PyStructSequence_Desc hash_info_desc = {
"sys.hash_info",
hash_info_doc,
hash_info_fields,
- 5,
+ 9,
};
static PyObject *
@@ -640,9 +680,11 @@ get_hash_info(void)
{
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 @@ get_hash_info(void)
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 @@ Set the flags used by the interpreter for dlopen calls, such as when the\n\
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 @@ PyDoc_STRVAR(getdlopenflags_doc,
"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 */
@@ -821,7 +871,6 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds)
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))
@@ -897,6 +946,19 @@ one higher than you might expect, because it includes the (temporary)\n\
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 +1127,8 @@ static PyMethodDef sys_methods[] = {
{"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 +1181,7 @@ static PyMethodDef sys_methods[] = {
{"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,6 +1350,7 @@ exec_prefix -- prefix used to find the machine-specific Python library\n\
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\
@@ -1352,14 +1417,12 @@ static PyStructSequence_Field flags_fields[] = {
{"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 +1430,7 @@ static PyStructSequence_Desc flags_desc = {
"sys.flags", /* name */
flags__doc__, /* doc */
flags_fields, /* fields */
-#ifdef RISCOS
13
-#else
- 12
-#endif
};
static PyObject*
@@ -1396,14 +1455,12 @@ make_flags(void)
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()) {
@@ -1564,18 +1621,35 @@ static struct PyModuleDef sysmodule = {
PyObject *
_PySys_Init(void)
{
- PyObject *m, *v, *sysdict, *version_info;
- char *s;
+ PyObject *m, *sysdict, *version_info;
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 { \
+ int res; \
+ 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 { \
+ int res; \
+ 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 +1671,10 @@ _PySys_Init(void)
/* 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 +1708,24 @@ _PySys_Init(void)
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;
-
- s = (char *) &number;
- if (s[0] == 0)
- value = "big";
- else
- value = "little";
- SET_SYS_FROM_STRING("byteorder",
- PyUnicode_FromString(value));
- }
+#if PY_BIG_ENDIAN
+ SET_SYS_FROM_STRING("byteorder",
+ PyUnicode_FromString("big"));
+#else
+ SET_SYS_FROM_STRING("byteorder",
+ PyUnicode_FromString("little"));
+#endif
+
#ifdef MS_COREDLL
SET_SYS_FROM_STRING("dllhandle",
PyLong_FromVoidPtr(PyWin_DLLhModule));
@@ -1668,22 +1738,22 @@ _PySys_Init(void)
#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 */
@@ -1694,8 +1764,10 @@ _PySys_Init(void)
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;
@@ -1705,7 +1777,9 @@ _PySys_Init(void)
#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;
@@ -1769,7 +1843,7 @@ PySys_SetPath(const wchar_t *path)
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 +1862,7 @@ makeargvobject(int argc, wchar_t **argv)
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 +1897,7 @@ sys_update_path(int argc, wchar_t **argv)
wchar_t fullpath[MAX_PATH];
#endif
- path = PySys_GetObject("path");
+ path = _PySys_GetObjectId(&PyId_path);
if (path == NULL)
return;
@@ -1937,7 +1996,7 @@ PySys_SetArgvEx(int argc, wchar_t **argv, int updatepath)
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 +2007,6 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
{
PyObject *writer = NULL, *args = NULL, *result = NULL;
int err;
- _Py_IDENTIFIER(write);
if (file == NULL)
return -1;
@@ -2025,7 +2083,7 @@ sys_pyfile_write(const char *text, PyObject *file)
*/
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 +2091,7 @@ sys_write(char *name, FILE *fp, const char *format, va_list va)
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 +2111,7 @@ PySys_WriteStdout(const char *format, ...)
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 +2121,19 @@ PySys_WriteStderr(const char *format, ...)
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 +2153,7 @@ PySys_FormatStdout(const char *format, ...)
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 +2163,6 @@ PySys_FormatStderr(const char *format, ...)
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 e55d34244e..d1cb0e6f9d 100644
--- a/Python/thread.c
+++ b/Python/thread.c
@@ -91,10 +91,6 @@ static size_t _pythread_stacksize = 0;
#include "thread_nt.h"
#endif
-#ifdef OS2_THREADS
-#define PYTHREAD_NAME "os2"
-#include "thread_os2.h"
-#endif
/*
#ifdef FOOBAR_THREADS
@@ -209,7 +205,7 @@ static int nkeys = 0; /* PyThread_create_key() hands out nkeys+1 next */
* 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,8 +215,11 @@ find_key(int key, void *value)
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
* in a tight loop with the lock held. A similar check is done
@@ -231,11 +230,11 @@ find_key(int key, void *value)
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 @@ PyThread_delete_key(int key)
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_delete_key(int key)
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 @@ PyThread_set_key_value(int key, void *value)
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 @@ PyThread_delete_key_value(int key)
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 @@ PyThread_ReInitTLS(void)
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 @@ PyThread_GetInfo(void)
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 938bf1e3fe..ee2079fc61 100644
--- a/Python/thread_nt.h
+++ b/Python/thread_nt.h
@@ -34,7 +34,7 @@ typedef NRMUTEX *PNRMUTEX;
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 @@ AllocNonRecursiveMutex()
m->locked = 0;
return m;
fail:
- free(m);
+ PyMem_RawFree(m);
return NULL;
}
@@ -56,7 +56,7 @@ FreeNonRecursiveMutex(PNRMUTEX mutex)
if (mutex) {
PyCOND_FINI(&mutex->cv);
PyMUTEX_FINI(&mutex->cs);
- free(mutex);
+ PyMem_RawFree(mutex);
}
}
@@ -107,7 +107,7 @@ LeaveNonRecursiveMutex(PNRMUTEX mutex)
result = PyCOND_SIGNAL(&mutex->cv);
result &= PyMUTEX_UNLOCK(&mutex->cs);
return result;
-}
+}
#else /* if ! _PY_USE_CV_LOCKS */
@@ -130,7 +130,7 @@ FreeNonRecursiveMutex(PNRMUTEX mutex)
DWORD
EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
{
- return WaitForSingleObject(mutex, milliseconds);
+ return WaitForSingleObjectEx(mutex, milliseconds, FALSE);
}
BOOL
@@ -389,20 +389,11 @@ PyThread_delete_key(int key)
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 1b264b5ad5..0000000000
--- 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 5704266a03..0000000000
--- 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 e90ae7e5b9..d9f7c76f2a 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -282,14 +282,14 @@ PyThread_allocate_lock(void)
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 @@ PyThread_free_lock(PyThread_type_lock lock)
status = sem_destroy(thelock);
CHECK_STATUS("sem_destroy");
- free((void *)thelock);
+ PyMem_RawFree((void *)thelock);
}
/*
@@ -410,7 +410,7 @@ PyThread_allocate_lock(void)
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 @@ PyThread_allocate_lock(void)
CHECK_STATUS("pthread_cond_init");
if (error) {
- free((void *)lock);
+ PyMem_RawFree((void *)lock);
lock = 0;
}
}
@@ -457,7 +457,7 @@ PyThread_free_lock(PyThread_type_lock lock)
status = pthread_mutex_destroy( &thelock->mut );
CHECK_STATUS("pthread_mutex_destroy");
- free((void *)thelock);
+ PyMem_RawFree((void *)thelock);
}
PyLockStatus
@@ -627,9 +627,6 @@ int
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 74075c9481..2ece192db9 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)
{
@@ -152,7 +157,6 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *
const char* filepath;
Py_ssize_t len;
PyObject* result;
- _Py_IDENTIFIER(open);
filebytes = PyUnicode_EncodeFSDefault(filename);
if (filebytes == NULL) {
@@ -169,7 +173,7 @@ _Py_FindSourceFile(PyObject *filename, char* namebuf, size_t namelen, PyObject *
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 +236,6 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
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 +247,12 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
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 +264,8 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
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) {
@@ -469,13 +474,13 @@ dump_decimal(int fd, int value)
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 +547,15 @@ dump_ascii(int fd, PyObject *text)
}
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 +606,7 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header)
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 +644,8 @@ write_thread_id(int fd, PyThreadState *tstate, int is_current)
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 387be9800f..790b947e01 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
-This is Python version 3.3.5
-============================
+This is Python version 3.4.0 release candidate 1
+================================================
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
2012, 2013, 2014 Python Software Foundation. All rights reserved.
@@ -52,9 +52,9 @@ What's New
----------
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 @@ entitled "Installing multiple versions".
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 @@ backported versions of certain key Python 3.x features.
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 @@ same prefix you must decide which version (if any) is your "primary" version.
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 @@ http://www.python.org/dev/peps/.
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 d2ff255247..4c3b67b55f 100644
--- a/Tools/buildbot/external-amd64.bat
+++ b/Tools/buildbot/external-amd64.bat
@@ -4,18 +4,18 @@
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 DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all
+ nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install
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=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 clean
+ nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 all
+ nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 install
cd ..\..
)
diff --git a/Tools/buildbot/external-common.bat b/Tools/buildbot/external-common.bat
index c6278b2673..c63e8895dd 100644
--- a/Tools/buildbot/external-common.bat
+++ b/Tools/buildbot/external-common.bat
@@ -30,19 +30,20 @@ if not exist openssl-1.0.1e (
)
@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 http://svn.python.org/projects/external/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 http://svn.python.org/projects/external/tk-8.6.1.0
@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 http://svn.python.org/projects/external/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 http://svn.python.org/projects/external/xz-5.0.5
)
diff --git a/Tools/buildbot/external.bat b/Tools/buildbot/external.bat
index ed5c10e835..c580a14970 100644
--- a/Tools/buildbot/external.bat
+++ b/Tools/buildbot/external.bat
@@ -4,18 +4,18 @@
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
+ cd tcl-8.6.1.0\win
+ nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk clean all
nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install
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=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 clean
+ nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 all
+ nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 install
cd ..\..
)
diff --git a/Tools/buildbot/test-amd64.bat b/Tools/buildbot/test-amd64.bat
index 1bf124cd92..de64f25fbe 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 4f4c6aa9e1..4e4db10d7e 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 0000000000..68a14361fd
--- /dev/null
+++ b/Tools/clinic/clinic.py
@@ -0,0 +1,4199 @@
+#!/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
+ # supress 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 != 'O&') and
+ (cls.format_unit not in legacy_converters)):
+ legacy_converters[cls.format_unit] = cls
+ if cls.format_unit:
+ 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 preceeding 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 contruct 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 0000000000..cd21000c05
--- /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 0000000000..e099590a33
--- /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 0e895f2816..58246fa2ad 100644
--- a/Tools/freeze/bkfile.py
+++ b/Tools/freeze/bkfile.py
@@ -7,11 +7,11 @@ class _BkFile:
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 a41267ae7d..479ca3c14b 100755
--- a/Tools/freeze/freeze.py
+++ b/Tools/freeze/freeze.py
@@ -125,7 +125,7 @@ def main():
# default the exclude list for each platform
if win: exclude = exclude + [
'dos', 'dospath', 'mac', 'macpath', 'macfs', 'MACFS', 'posix',
- 'os2', 'ce',
+ 'ce',
]
fail_import = exclude[:]
@@ -311,7 +311,7 @@ def main():
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:
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 1c2c3cb5d2..2ad22e2bbe 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -939,21 +939,26 @@ class PyFrameObjectPtr(PyObjectPtr):
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 @@ class PySetObjectPtr(PyObjectPtr):
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 @@ class PyUnicodeObjectPtr(PyObjectPtr):
# 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 8b92ae1fc3..10887ce338 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 @@ def print_differences(data, olddata):
(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 cd90691bf1..b0751a1ffc 100755
--- a/Tools/i18n/msgfmt.py
+++ b/Tools/i18n/msgfmt.py
@@ -218,7 +218,7 @@ def main():
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 714c0e427f..635dd56d16 100644
--- a/Tools/importbench/importbench.py
+++ b/Tools/importbench/importbench.py
@@ -46,8 +46,7 @@ def from_cache(seconds, repeat):
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 @@ def builtin_mod(seconds, repeat):
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 @@ def source_wo_bytecode(seconds, repeat):
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 @@ def _wo_bytecode(module):
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 _writing_bytecode(module):
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 @@ def source_using_bytecode(seconds, repeat):
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(module):
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 530bc79d5c..712e58472e 100644
--- a/Tools/iobench/iobench.py
+++ b/Tools/iobench/iobench.py
@@ -24,6 +24,8 @@ def text_open(fn, mode, encoding=None):
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 @@ def prepare_files():
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 5ed025d794..e399ddeafa 100644
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -99,7 +99,9 @@ extensions = [
'_multiprocessing.pyd',
'_lzma.pyd',
'_decimal.pyd',
- '_testbuffer.pyd'
+ '_testbuffer.pyd',
+ '_testimportmultiple.pyd',
+ '_overlapped.pyd',
]
# Well-known component UUIDs
@@ -119,6 +121,7 @@ pythondll_uuid = {
"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 @@ def add_ui(db):
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 @@ def add_ui(db):
("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 @@ def add_ui(db):
# 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 @@ def add_ui(db):
("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 @@ def add_ui(db):
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 @@ def add_features(db):
# (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 @@ def add_features(db):
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 @@ def add_features(db):
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 @@ def add_files(db):
# 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()
@@ -1185,6 +1203,8 @@ def add_registry(db):
"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 +1222,7 @@ def add_registry(db):
[(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 +1290,10 @@ def add_registry(db):
"{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 +1309,9 @@ def add_registry(db):
"", 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",
@@ -1297,8 +1324,6 @@ def add_registry(db):
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"),
]
add_data(db, "Shortcut",
tcltkshortcuts +
@@ -1313,6 +1338,8 @@ def add_registry(db):
("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY.doc",
"[#%s]" % docfile, None,
None, None, None, None, None, None),
+ ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "python.exe",
+ default_feature.id, r'-m pydoc -b', None, None, "python_icon.exe", 0, None, "TARGETDIR"),
("Uninstall", "MenuDir", "UNINST|Uninstall Python", "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 b55e2c6235..837cd81aaf 100644
--- a/Tools/parser/unparse.py
+++ b/Tools/parser/unparse.py
@@ -307,6 +307,9 @@ class Unparser:
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 @@ class Unparser:
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 @@ class Unparser:
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 d65d1fd474..c6b2282edf 100644
--- a/Tools/scripts/README
+++ b/Tools/scripts/README
@@ -2,64 +2,68 @@ This directory contains a collection of executable Python scripts that are
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 b79ff37e8c..736a441761 100755
--- a/Tools/scripts/byext.py
+++ b/Tools/scripts/byext.py
@@ -25,7 +25,7 @@ class Stats:
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 490b37f0bf..f58c34608f 100755
--- a/Tools/scripts/byteyears.py
+++ b/Tools/scripts/byteyears.py
@@ -43,7 +43,7 @@ def main():
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 0000000000..8a64eda34a
--- /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 d4fdce2515..bbaa3d1328 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 @@ def main():
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 @@ def main():
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 e0220b5443..715683f125 100755
--- a/Tools/scripts/copytime.py
+++ b/Tools/scripts/copytime.py
@@ -13,12 +13,12 @@ def main():
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 f9b14bf5e5..8be527fd62 100755
--- a/Tools/scripts/diff.py
+++ b/Tools/scripts/diff.py
@@ -38,9 +38,9 @@ def main():
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 f24a702966..a705f56203 100755
--- a/Tools/scripts/finddiv.py
+++ b/Tools/scripts/finddiv.py
@@ -70,7 +70,7 @@ def process(filename, listnames):
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 b4c09ef1ce..b924f27b09 100755
--- a/Tools/scripts/findlinksto.py
+++ b/Tools/scripts/findlinksto.py
@@ -36,7 +36,7 @@ def visit(prog, dirname, names):
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 87e2a0929f..1e4c428851 100755
--- a/Tools/scripts/fixcid.py
+++ b/Tools/scripts/fixcid.py
@@ -97,7 +97,7 @@ def recursedown(dirname):
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 @@ def fix(filename):
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/ftpmirror.py b/Tools/scripts/ftpmirror.py
index 9e8be1daf8..a1b683a319 100755
--- a/Tools/scripts/ftpmirror.py
+++ b/Tools/scripts/ftpmirror.py
@@ -108,7 +108,7 @@ def mirrorsubdir(f, localdir):
if verbose: print('Creating local directory', repr(localdir))
try:
makedir(localdir)
- except os.error as msg:
+ except OSError as msg:
print("Failed to establish local directory", repr(localdir))
return
infofilename = os.path.join(localdir, '.mirrorinfo')
@@ -183,7 +183,7 @@ def mirrorsubdir(f, localdir):
continue
try:
os.unlink(tempname)
- except os.error:
+ except OSError:
pass
if mode[0] == 'l':
if verbose:
@@ -218,11 +218,11 @@ def mirrorsubdir(f, localdir):
fp1.close()
try:
os.unlink(fullname)
- except os.error:
+ except OSError:
pass # Ignore the error
try:
os.rename(tempname, fullname)
- except os.error as msg:
+ except OSError as msg:
print("Can't rename %r to %r: %s" % (tempname, fullname, msg))
continue
info[filename] = infostuff
@@ -255,7 +255,7 @@ def mirrorsubdir(f, localdir):
try:
if not localdir: names = os.listdir(os.curdir)
else: names = os.listdir(localdir)
- except os.error:
+ except OSError:
names = []
for name in names:
if name[0] == '.' or name in info or name in subdirs:
@@ -312,7 +312,7 @@ def remove(fullname):
if os.path.isdir(fullname) and not os.path.islink(fullname):
try:
names = os.listdir(fullname)
- except os.error:
+ except OSError:
names = []
ok = 1
for name in names:
@@ -322,13 +322,13 @@ def remove(fullname):
return 0
try:
os.rmdir(fullname)
- except os.error as msg:
+ except OSError as msg:
print("Can't remove local directory %r: %s" % (fullname, msg))
return 0
else:
try:
os.unlink(fullname)
- except os.error as msg:
+ except OSError as msg:
print("Can't remove local file %r: %s" % (fullname, msg))
return 0
return 1
@@ -386,7 +386,7 @@ def writedict(dict, filename):
backup = os.path.join(dir, fname + '~')
try:
os.unlink(backup)
- except os.error:
+ except OSError:
pass
fp = open(tempname, 'w')
fp.write('{\n')
@@ -396,7 +396,7 @@ def writedict(dict, filename):
fp.close()
try:
os.rename(filename, backup)
- except os.error:
+ except OSError:
pass
os.rename(tempname, filename)
diff --git a/Tools/scripts/linktree.py b/Tools/scripts/linktree.py
index 982f4800ba..e83f198593 100755
--- a/Tools/scripts/linktree.py
+++ b/Tools/scripts/linktree.py
@@ -32,13 +32,13 @@ def main():
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 @@ def linknames(old, new, link):
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/ndiff.py b/Tools/scripts/ndiff.py
index 2422091dcc..c6d09b8f24 100755
--- a/Tools/scripts/ndiff.py
+++ b/Tools/scripts/ndiff.py
@@ -60,7 +60,7 @@ def fail(msg):
# 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 0000000000..c011328b01
--- /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/pathfix.py b/Tools/scripts/pathfix.py
index 13ca866a78..22432d1639 100755
--- a/Tools/scripts/pathfix.py
+++ b/Tools/scripts/pathfix.py
@@ -73,7 +73,7 @@ def recursedown(dirname):
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 @@ def fix(filename):
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 2872dc047e..33334204a4 100755
--- a/Tools/scripts/pindent.py
+++ b/Tools/scripts/pindent.py
@@ -376,13 +376,13 @@ def make_backup(filename):
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/reindent.py b/Tools/scripts/reindent.py
index 4a916ea149..18424dea14 100755
--- a/Tools/scripts/reindent.py
+++ b/Tools/scripts/reindent.py
@@ -52,8 +52,8 @@ verbose = False
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 b2649c474e..652d3940a4 100755
--- a/Tools/scripts/treesync.py
+++ b/Tools/scripts/treesync.py
@@ -78,7 +78,7 @@ def process(slave, master):
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 4b67c15154..861c83ced9 100755
--- a/Tools/scripts/untabify.py
+++ b/Tools/scripts/untabify.py
@@ -39,11 +39,11 @@ def process(filename, tabsize, verbose=True):
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 4fc37a027c..df54ce032c 100755
--- a/Tools/scripts/which.py
+++ b/Tools/scripts/which.py
@@ -29,7 +29,7 @@ def main():
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 9259b441f7..c85bea576f 100644
--- a/Tools/scripts/win_add2path.py
+++ b/Tools/scripts/win_add2path.py
@@ -30,7 +30,7 @@ def modify():
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/test_multiple_versions.py b/Tools/ssl/test_multiple_versions.py
new file mode 100644
index 0000000000..dd57dcf18b
--- /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 142b3cadc5..5abc25a572 100644
--- a/Tools/stringbench/stringbench.py
+++ b/Tools/stringbench/stringbench.py
@@ -808,7 +808,7 @@ standard libraries, and can be learned in a few days. Many Python
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 f5a1af380e..f4c7c038c4 100644
--- a/Tools/unicode/gencodec.py
+++ b/Tools/unicode/gencodec.py
@@ -290,27 +290,27 @@ import codecs
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 @@ def getregentry():
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 bc3d0cb746..0942508dff 100644
--- a/Tools/unicode/makeunicodedata.py
+++ b/Tools/unicode/makeunicodedata.py
@@ -37,7 +37,7 @@ SCRIPT = sys.argv[0]
VERSION = "3.2"
# The Unicode Database
-UNIDATA_VERSION = "6.1.0"
+UNIDATA_VERSION = "6.3.0"
UNICODE_DATA = "UnicodeData%s.txt"
COMPOSITION_EXCLUSIONS = "CompositionExclusions%s.txt"
EASTASIAN_WIDTH = "EastAsianWidth%s.txt"
@@ -68,7 +68,7 @@ CATEGORY_NAMES = [ "Cn", "Lu", "Ll", "Lt", "Mn", "Mc", "Me", "Nd",
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 +552,7 @@ def makeunicodetype(unicode, trace):
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 +570,7 @@ def makeunicodetype(unicode, trace):
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 0000000000..7bb5e1836b
--- /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/configure b/configure
index 6be41f506c..101dd4462f 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 @@ MAKEFLAGS=
# 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 @@ ac_includes_default="\
#endif"
ac_subst_vars='LTLIBOBJS
+ENSUREPIP
SRCDIRS
THREADHEADERS
+LIBPL
+PY_ENABLE_SHARED
EXT_SUFFIX
SOABI
LIBC
@@ -710,6 +713,7 @@ _PYTHON_HOST_PLATFORM
MACHDEP
FRAMEWORKINSTALLAPPSPREFIX
FRAMEWORKUNIXTOOLSPREFIX
+FRAMEWORKPYTHONW
FRAMEWORKALTINSTALLLAST
FRAMEWORKALTINSTALLFIRST
FRAMEWORKINSTALLLAST
@@ -790,6 +794,7 @@ with_suffix
enable_shared
enable_profiling
with_pydebug
+with_hash_algorithm
with_libs
with_system_expat
with_system_ffi
@@ -811,6 +816,7 @@ with_libm
with_libc
enable_big_digits
with_computed_gotos
+with_ensurepip
'
ac_precious_vars='build_alias
host_alias
@@ -1362,7 +1368,7 @@ if test "$ac_init_help" = "long"; then
# 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 +1433,7 @@ fi
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 +1459,7 @@ Optional Packages:
--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 +1469,8 @@ Optional Packages:
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 +1500,8 @@ Optional Packages:
--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
@@ -1570,7 +1580,7 @@ fi
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 +2419,7 @@ cat >config.log <<_ACEOF
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 $@
@@ -2979,7 +2989,7 @@ rm confdefs.h
mv confdefs.h.new confdefs.h
-VERSION=3.3
+VERSION=3.4
# Version number of Python's own shared library file.
@@ -3035,7 +3045,7 @@ if test "${enable_universalsdk+set}" = set; then :
# 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 +3088,7 @@ fi
+ARCH_RUN_32BIT=""
# For backward compatibility reasons we prefer to select '32-bit' if available,
# otherwise use 'intel'
@@ -3086,7 +3097,7 @@ if test "`uname -s`" = "Darwin"
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,21 +3111,20 @@ $as_echo_n "checking for --with-universal-archs... " >&6; }
# 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
+fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5
+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.
if test "${with_framework_name+set}" = set; then :
withval=$with_framework_name;
@@ -3147,6 +3157,7 @@ if test "${enable_framework+set}" = set; then :
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
+ FRAMEWORKPYTHONW=
if test "x${prefix}" = "xNONE"; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
@@ -3161,6 +3172,7 @@ if test "${enable_framework+set}" = set; then :
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+ FRAMEWORKPYTHONW="frameworkpythonw"
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "x${prefix}" = "xNONE" ; then
@@ -3228,6 +3240,7 @@ else
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
+ FRAMEWORKPYTHONW=
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
@@ -3250,6 +3263,7 @@ fi
+
##AC_ARG_WITH(dyld,
## AS_HELP_STRING([--with-dyld],
## [Use (OpenStep|Rhapsody) dynamic linker]))
@@ -3431,6 +3445,21 @@ $as_echo "#define _POSIX_C_SOURCE 200809L" >>confdefs.h
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 +4830,16 @@ fi
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 +5613,7 @@ fi
# Other platforms follow
if test $enable_shared = "yes"; then
+ PY_ENABLE_SHARED=1
$as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
@@ -5641,6 +5671,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h
esac
else # shared is disabled
+ PY_ENABLE_SHARED=0
case $ac_sys_system in
CYGWIN*)
BLDLIBRARY='$(LIBRARY)'
@@ -6381,6 +6412,49 @@ $as_echo "$ac_cv_disable_unused_result_warning" >&6; }
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
+ BASECFLAGS="$BASECFLAGS -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 +6468,124 @@ $as_echo "$ac_cv_disable_unused_result_warning" >&6; }
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
-
-
- 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"
-
- 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"
-
- 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"
-
- 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"
-
- 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}}
+ fi
- # 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=''
+ 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
+
+ CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
+ LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+ if test "${UNIVERSALSDK}" != "/"
+ then
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
+ fi
+ fi
- ;;
+ # 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!
+
+ { $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=`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
+ 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}}
+
+ # 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; }
+
+ # end of Darwin* tests
+ ;;
esac
;;
@@ -6527,44 +6612,6 @@ then
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).
@@ -6936,7 +6983,8 @@ sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
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"
@@ -7229,7 +7277,7 @@ done
# 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 +7358,43 @@ $as_echo "#define HAVE_MAKEDEV 1" >>confdefs.h
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 +8361,6 @@ case $ac_sys_system/$ac_sys_release in
esac
-ARCH_RUN_32BIT=""
case $ac_sys_system/$ac_sys_release in
Darwin/[01567]\..*)
@@ -8348,14 +8432,12 @@ fi
;;
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"
@@ -8483,9 +8565,6 @@ then
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.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"
@@ -8613,6 +8692,12 @@ then
# -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)'
@@ -8967,6 +9052,79 @@ rm -f core conftest.err conftest.$ac_objext \
*) ;;
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; }
@@ -10308,7 +10466,7 @@ fi
# 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 \
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
@@ -10328,7 +10486,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
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 +10739,35 @@ $as_echo "no" >&6; }
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 +11599,6 @@ esac
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 +13952,10 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
{ $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
@@ -15185,8 +15363,33 @@ $as_echo "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h
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 +15900,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# 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 +15962,7 @@ _ACEOF
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 +16093,7 @@ do
"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 6a64bff46e..25e1dc88d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl * Please run autoreconf to test your changes! *
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)
@@ -152,7 +152,7 @@ AC_ARG_ENABLE(universalsdk,
# 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 +189,7 @@ fi
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 +198,7 @@ if test "`uname -s`" = "Darwin"
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 +208,17 @@ fi
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 +250,7 @@ AC_ARG_ENABLE(framework,
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
+ FRAMEWORKPYTHONW=
if test "x${prefix}" = "xNONE"; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
@@ -262,6 +265,7 @@ AC_ARG_ENABLE(framework,
FRAMEWORKALTINSTALLFIRST="frameworkinstallstructure "
FRAMEWORKINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools"
FRAMEWORKALTINSTALLLAST="frameworkinstallmaclib frameworkinstallapps frameworkaltinstallunixtools"
+ FRAMEWORKPYTHONW="frameworkpythonw"
FRAMEWORKINSTALLAPPSPREFIX="/Applications"
if test "x${prefix}" = "xNONE" ; then
@@ -323,6 +327,7 @@ AC_ARG_ENABLE(framework,
FRAMEWORKINSTALLLAST=
FRAMEWORKALTINSTALLFIRST=
FRAMEWORKALTINSTALLLAST=
+ FRAMEWORKPYTHONW=
if test "x${prefix}" = "xNONE" ; then
FRAMEWORKUNIXTOOLSPREFIX="${ac_default_prefix}"
else
@@ -340,6 +345,7 @@ AC_SUBST(FRAMEWORKINSTALLFIRST)
AC_SUBST(FRAMEWORKINSTALLLAST)
AC_SUBST(FRAMEWORKALTINSTALLFIRST)
AC_SUBST(FRAMEWORKALTINSTALLLAST)
+AC_SUBST(FRAMEWORKPYTHONW)
AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
@@ -516,6 +522,19 @@ then
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 +710,7 @@ then
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 +936,7 @@ fi
# 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*)
@@ -972,6 +992,7 @@ if test $enable_shared = "yes"; then
esac
else # shared is disabled
+ PY_ENABLE_SHARED=0
case $ac_sys_system in
CYGWIN*)
BLDLIBRARY='$(LIBRARY)'
@@ -1182,6 +1203,28 @@ yes)
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
+ BASECFLAGS="$BASECFLAGS -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 +1238,120 @@ yes)
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
-
-
- 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"
-
- 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"
-
- 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"
-
- 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"
-
- else
- AC_MSG_ERROR([proper usage is --with-universal-arch=32-bit|64-bit|all|intel|3-way])
- 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
+ # 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
- # 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=''
+ 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
+
+ CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
+ LDFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
+ if test "${UNIVERSALSDK}" != "/"
+ then
+ CPPFLAGS="-isysroot ${UNIVERSALSDK} ${CPPFLAGS}"
+ fi
+ fi
- ;;
+ # 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!
+
+ AC_MSG_CHECKING(which MACOSX_DEPLOYMENT_TARGET to use)
+ 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
+ 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}}
+
+ # 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)
+
+ # end of Darwin* tests
+ ;;
esac
;;
@@ -1326,24 +1378,6 @@ then
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).
@@ -1526,7 +1560,8 @@ sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \
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)
CPPFLAGS=$ac_save_cppflags
AC_HEADER_DIRENT
AC_HEADER_MAJOR
@@ -1566,7 +1601,7 @@ AC_CHECK_HEADERS(linux/netlink.h,,,[
])
# 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 +1632,22 @@ if test "$ac_cv_has_makedev" = "yes"; then
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 +1849,6 @@ case $ac_sys_system/$ac_sys_release in
esac
-ARCH_RUN_32BIT=""
AC_SUBST(LIBTOOL_CRUFT)
case $ac_sys_system/$ac_sys_release in
Darwin/@<:@01567@:>@\..*)
@@ -1855,14 +1905,12 @@ case $ac_sys_system/$ac_sys_release in
;;
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
@@ -1982,9 +2030,6 @@ then
if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.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"
@@ -2108,6 +2153,12 @@ then
# -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)'
@@ -2212,6 +2263,59 @@ case "$ac_sys_system" in
*) ;;
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
@@ -2823,7 +2927,7 @@ fi
# 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 \
getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
@@ -2843,7 +2947,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
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 +3014,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
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 +3224,7 @@ AC_CHECK_FUNCS(memmove)
# 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 +4097,11 @@ AC_MSG_CHECKING(LDVERSION)
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)
@@ -4661,8 +4780,23 @@ if test "$have_gcc_asm_for_x87" = yes; then
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 0020300873..3574f67322 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,9 +326,6 @@
/* 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
@@ -411,6 +414,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 +510,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 +636,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
@@ -924,6 +936,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 +1136,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 +1205,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 +1382,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 906401404d..8269e1caba 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
@@ -259,8 +261,9 @@ class PyBuildExt(build_ext):
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 +328,11 @@ class PyBuildExt(build_ext):
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 +594,14 @@ class PyBuildExt(build_ext):
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
@@ -784,10 +794,10 @@ class PyBuildExt(build_ext):
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
@@ -1509,10 +1519,6 @@ class PyBuildExt(build_ext):
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',
@@ -1533,7 +1539,7 @@ class PyBuildExt(build_ext):
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
@@ -2156,7 +2162,7 @@ is also usable as an extension language for applications that need a
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.