From 2baaf6c2e973bc79cab3f23cc86210119eb6bb09 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Wed, 8 Jul 2020 20:13:10 +0800 Subject: [PATCH 001/197] PyType_GetSlot() could accept static types --- Doc/c-api/type.rst | 5 +++-- Include/typeslots.h | 21 +++++++++++++++++++ .../2020-07-08-21-01-49.bpo-41073.VqQZON.rst | 1 + Objects/typeobject.c | 2 +- Objects/typeslots.inc | 18 ++++++++++++++++ 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/C API/2020-07-08-21-01-49.bpo-41073.VqQZON.rst diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index f387279d143eec..b1666a8813ab6f 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -105,10 +105,11 @@ Type Objects See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument. - An exception is raised if *type* is not a heap type. - .. versionadded:: 3.4 + .. versionchanged:: 3.10 + :c:func:`PyType_GetSlot` could accept static types. + .. c:function:: PyObject* PyType_GetModule(PyTypeObject *type) Return the module object associated with the given type when the type was diff --git a/Include/typeslots.h b/Include/typeslots.h index 64f6fff5144493..e50c66c7c5dcc3 100644 --- a/Include/typeslots.h +++ b/Include/typeslots.h @@ -88,3 +88,24 @@ /* New in 3.5 */ #define Py_tp_finalize 80 #endif +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x031000a1 +/* New in 3.10 */ +#define Py_tp_as_async 81 +#define Py_tp_as_buffer 82 +#define Py_tp_as_mapping 83 +#define Py_tp_as_number 84 +#define Py_tp_as_sequence 85 +#define Py_tp_basicsize 86 +#define Py_tp_cache 87 +#define Py_tp_dict 88 +#define Py_tp_dictoffset 89 +#define Py_tp_flags 90 +#define Py_tp_itemsize 91 +#define Py_tp_mro 92 +#define Py_tp_name 93 +#define Py_tp_subclasses 94 +#define Py_tp_vectorcall_offset 95 +#define Py_tp_version_tag 96 +#define Py_tp_weaklist 97 +#define Py_tp_weaklistoffset 98 +#endif diff --git a/Misc/NEWS.d/next/C API/2020-07-08-21-01-49.bpo-41073.VqQZON.rst b/Misc/NEWS.d/next/C API/2020-07-08-21-01-49.bpo-41073.VqQZON.rst new file mode 100644 index 00000000000000..668bfb2c2e2791 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-07-08-21-01-49.bpo-41073.VqQZON.rst @@ -0,0 +1 @@ +:c:func:`PyType_GetSlot()` could accept static types. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 16f95f0e1bf7f9..e2bb2273caceaa 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3110,7 +3110,7 @@ PyType_FromSpec(PyType_Spec *spec) void * PyType_GetSlot(PyTypeObject *type, int slot) { - if (!_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE) || slot < 0) { + if (slot < 0) { PyErr_BadInternalCall(); return NULL; } diff --git a/Objects/typeslots.inc b/Objects/typeslots.inc index ffc9bb2e1c7710..58b11d678827a2 100644 --- a/Objects/typeslots.inc +++ b/Objects/typeslots.inc @@ -79,3 +79,21 @@ offsetof(PyHeapTypeObject, as_async.am_await), offsetof(PyHeapTypeObject, as_async.am_aiter), offsetof(PyHeapTypeObject, as_async.am_anext), offsetof(PyHeapTypeObject, ht_type.tp_finalize), +offsetof(PyHeapTypeObject, ht_type.tp_as_async), +offsetof(PyHeapTypeObject, ht_type.tp_as_buffer), +offsetof(PyHeapTypeObject, ht_type.tp_as_mapping), +offsetof(PyHeapTypeObject, ht_type.tp_as_number), +offsetof(PyHeapTypeObject, ht_type.tp_as_sequence), +offsetof(PyHeapTypeObject, ht_type.tp_basicsize), +offsetof(PyHeapTypeObject, ht_type.tp_cache), +offsetof(PyHeapTypeObject, ht_type.tp_dict), +offsetof(PyHeapTypeObject, ht_type.tp_dictoffset), +offsetof(PyHeapTypeObject, ht_type.tp_flags), +offsetof(PyHeapTypeObject, ht_type.tp_itemsize), +offsetof(PyHeapTypeObject, ht_type.tp_mro), +offsetof(PyHeapTypeObject, ht_type.tp_name), +offsetof(PyHeapTypeObject, ht_type.tp_subclasses), +offsetof(PyHeapTypeObject, ht_type.tp_vectorcall_offset), +offsetof(PyHeapTypeObject, ht_type.tp_version_tag), +offsetof(PyHeapTypeObject, ht_type.tp_weaklist), +offsetof(PyHeapTypeObject, ht_type.tp_weaklistoffset), From 9fb5ed491a4b029f953f42d307838701cdce3883 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Wed, 8 Jul 2020 21:45:45 +0800 Subject: [PATCH 002/197] update docs' style --- Doc/c-api/type.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst index b1666a8813ab6f..2694585660d286 100644 --- a/Doc/c-api/type.rst +++ b/Doc/c-api/type.rst @@ -108,7 +108,7 @@ Type Objects .. versionadded:: 3.4 .. versionchanged:: 3.10 - :c:func:`PyType_GetSlot` could accept static types. + :c:func:`PyType_GetSlot` could accept static types. .. c:function:: PyObject* PyType_GetModule(PyTypeObject *type) From ddb08f59b09e2010ba61cd2fa55281e6e1d3c934 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 8 Jul 2020 00:20:37 +0200 Subject: [PATCH 003/197] bpo-29778: test_embed tests the path configuration (GH-21306) --- Include/internal/pycore_pathconfig.h | 1 + Lib/test/test_embed.py | 82 +++++++++++++++++++++++----- Modules/_testinternalcapi.c | 45 +-------------- Python/initconfig.c | 14 ++++- Python/pathconfig.c | 74 +++++++++++++++++++++++++ 5 files changed, 154 insertions(+), 62 deletions(-) diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index 42d61b1ca26bdf..15447f54490fb4 100644 --- a/Include/internal/pycore_pathconfig.h +++ b/Include/internal/pycore_pathconfig.h @@ -65,6 +65,7 @@ extern wchar_t* _Py_GetDLLPath(void); extern PyStatus _PyConfig_WritePathConfig(const PyConfig *config); extern void _Py_DumpPathConfig(PyThreadState *tstate); +extern PyObject* _PyPathConfig_AsDict(void); #ifdef __cplusplus } diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 44d2596d9eb30f..2b740521e723ca 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -471,6 +471,31 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): ('Py_LegacyWindowsStdioFlag', 'legacy_windows_stdio'), )) + # path config + if MS_WINDOWS: + PATH_CONFIG = { + 'isolated': -1, + 'site_import': -1, + 'python3_dll': GET_DEFAULT_CONFIG, + } + else: + PATH_CONFIG = {} + # other keys are copied by COPY_PATH_CONFIG + + COPY_PATH_CONFIG = [ + # Copy core config to global config for expected values + 'prefix', + 'exec_prefix', + 'program_name', + 'home', + # program_full_path and module_search_path are copied indirectly from + # the core configuration in check_path_config(). + ] + if MS_WINDOWS: + COPY_PATH_CONFIG.extend(( + 'base_executable', + )) + EXPECTED_CONFIG = None @classmethod @@ -535,7 +560,8 @@ def _get_expected_config(self): configs[config_key] = config return configs - def get_expected_config(self, expected_preconfig, expected, env, api, + def get_expected_config(self, expected_preconfig, expected, + expected_pathconfig, env, api, modify_path_cb=None): cls = self.__class__ configs = self._get_expected_config() @@ -545,6 +571,11 @@ def get_expected_config(self, expected_preconfig, expected, env, api, if value is self.GET_DEFAULT_CONFIG: expected_preconfig[key] = pre_config[key] + path_config = configs['path_config'] + for key, value in expected_pathconfig.items(): + if value is self.GET_DEFAULT_CONFIG: + expected_pathconfig[key] = path_config[key] + if not expected_preconfig['configure_locale'] or api == API_COMPAT: # there is no easy way to get the locale encoding before # setlocale(LC_CTYPE, "") is called: don't test encodings @@ -637,8 +668,19 @@ def check_global_config(self, configs): self.assertEqual(configs['global_config'], expected) + def check_path_config(self, configs, expected): + config = configs['config'] + + for key in self.COPY_PATH_CONFIG: + expected[key] = config[key] + expected['module_search_path'] = os.path.pathsep.join(config['module_search_paths']) + expected['program_full_path'] = config['executable'] + + self.assertEqual(configs['path_config'], expected) + def check_all_configs(self, testname, expected_config=None, - expected_preconfig=None, modify_path_cb=None, + expected_preconfig=None, expected_pathconfig=None, + modify_path_cb=None, stderr=None, *, api, preconfig_api=None, env=None, ignore_stderr=False, cwd=None): new_env = remove_python_envvars() @@ -657,9 +699,14 @@ def check_all_configs(self, testname, expected_config=None, if expected_preconfig is None: expected_preconfig = {} expected_preconfig = dict(default_preconfig, **expected_preconfig) + if expected_config is None: expected_config = {} + if expected_pathconfig is None: + expected_pathconfig = {} + expected_pathconfig = dict(self.PATH_CONFIG, **expected_pathconfig) + if api == API_PYTHON: default_config = self.CONFIG_PYTHON elif api == API_ISOLATED: @@ -669,7 +716,9 @@ def check_all_configs(self, testname, expected_config=None, expected_config = dict(default_config, **expected_config) self.get_expected_config(expected_preconfig, - expected_config, env, + expected_config, + expected_pathconfig, + env, api, modify_path_cb) out, err = self.run_embedded_interpreter(testname, @@ -686,6 +735,7 @@ def check_all_configs(self, testname, expected_config=None, self.check_pre_config(configs, expected_preconfig) self.check_config(configs, expected_config) self.check_global_config(configs) + self.check_path_config(configs, expected_pathconfig) return configs def test_init_default_config(self): @@ -1258,22 +1308,24 @@ def test_init_pyvenv_cfg(self): 'executable': executable, 'module_search_paths': paths, } + path_config = {} if MS_WINDOWS: config['base_prefix'] = pyvenv_home config['prefix'] = pyvenv_home - env = self.copy_paths_by_env(config) - actual = self.check_all_configs("test_init_compat_config", config, - api=API_COMPAT, env=env, - ignore_stderr=True, cwd=tmpdir) - if MS_WINDOWS: - self.assertEqual( - actual['windows']['python3_dll'], - os.path.join( - tmpdir, - os.path.basename(self.EXPECTED_CONFIG['windows']['python3_dll']) - ) - ) + ver = sys.version_info + dll = f'python{ver.major}' + if debug_build(executable): + dll += '_d' + dll += '.DLL' + dll = os.path.join(os.path.dirname(executable), dll) + path_config['python3_dll'] = dll + + env = self.copy_paths_by_env(config) + self.check_all_configs("test_init_compat_config", config, + expected_pathconfig=path_config, + api=API_COMPAT, env=env, + ignore_stderr=True, cwd=tmpdir) def test_global_pathconfig(self): # Test C API functions getting the path configuration: diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index f08bf8d83d4743..ad74af8363ef45 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -18,53 +18,10 @@ #include "pycore_gc.h" // PyGC_Head -#ifdef MS_WINDOWS -#include - -static int -_add_windows_config(PyObject *configs) -{ - HMODULE hPython3; - wchar_t py3path[MAX_PATH]; - PyObject *dict = PyDict_New(); - PyObject *obj = NULL; - if (!dict) { - return -1; - } - - hPython3 = GetModuleHandleW(PY3_DLLNAME); - if (hPython3 && GetModuleFileNameW(hPython3, py3path, MAX_PATH)) { - obj = PyUnicode_FromWideChar(py3path, -1); - } else { - obj = Py_None; - Py_INCREF(obj); - } - if (obj && - !PyDict_SetItemString(dict, "python3_dll", obj) && - !PyDict_SetItemString(configs, "windows", dict)) { - Py_DECREF(obj); - Py_DECREF(dict); - return 0; - } - Py_DECREF(obj); - Py_DECREF(dict); - return -1; -} -#endif - - static PyObject * get_configs(PyObject *self, PyObject *Py_UNUSED(args)) { - PyObject *dict = _Py_GetConfigsAsDict(); -#ifdef MS_WINDOWS - if (dict) { - if (_add_windows_config(dict) < 0) { - Py_CLEAR(dict); - } - } -#endif - return dict; + return _Py_GetConfigsAsDict(); } diff --git a/Python/initconfig.c b/Python/initconfig.c index 86285c77e2307c..64286763b621ed 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -868,9 +868,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2) static PyObject * config_as_dict(const PyConfig *config) { - PyObject *dict; - - dict = PyDict_New(); + PyObject *dict = PyDict_New(); if (dict == NULL) { return NULL; } @@ -2643,6 +2641,16 @@ _Py_GetConfigsAsDict(void) } Py_CLEAR(dict); + /* path config */ + dict = _PyPathConfig_AsDict(); + if (dict == NULL) { + goto error; + } + if (PyDict_SetItemString(result, "path_config", dict) < 0) { + goto error; + } + Py_CLEAR(dict); + return result; error: diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 9a302213e77b65..12a684a66b718e 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -186,6 +186,80 @@ pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) return status; } +PyObject * +_PyPathConfig_AsDict(void) +{ + PyObject *dict = PyDict_New(); + if (dict == NULL) { + return NULL; + } + +#define SET_ITEM(KEY, EXPR) \ + do { \ + PyObject *obj = (EXPR); \ + if (obj == NULL) { \ + goto fail; \ + } \ + int res = PyDict_SetItemString(dict, KEY, obj); \ + Py_DECREF(obj); \ + if (res < 0) { \ + goto fail; \ + } \ + } while (0) +#define SET_ITEM_STR(KEY) \ + SET_ITEM(#KEY, \ + (_Py_path_config.KEY \ + ? PyUnicode_FromWideChar(_Py_path_config.KEY, -1) \ + : (Py_INCREF(Py_None), Py_None))) +#define SET_ITEM_INT(KEY) \ + SET_ITEM(#KEY, PyLong_FromLong(_Py_path_config.KEY)) + + SET_ITEM_STR(program_full_path); + SET_ITEM_STR(prefix); + SET_ITEM_STR(exec_prefix); + SET_ITEM_STR(module_search_path); + SET_ITEM_STR(program_name); + SET_ITEM_STR(home); +#ifdef MS_WINDOWS + SET_ITEM_INT(isolated); + SET_ITEM_INT(site_import); + SET_ITEM_STR(base_executable); + + { + wchar_t py3path[MAX_PATH]; + HMODULE hPython3 = GetModuleHandleW(PY3_DLLNAME); + PyObject *obj; + if (hPython3 + && GetModuleFileNameW(hPython3, py3path, Py_ARRAY_LENGTH(py3path))) + { + obj = PyUnicode_FromWideChar(py3path, -1); + if (obj == NULL) { + goto fail; + } + } + else { + obj = Py_None; + Py_INCREF(obj); + } + if (PyDict_SetItemString(dict, "python3_dll", obj) < 0) { + Py_DECREF(obj); + goto fail; + } + Py_DECREF(obj); + } +#endif + +#undef SET_ITEM +#undef SET_ITEM_STR +#undef SET_ITEM_INT + + return dict; + +fail: + Py_DECREF(dict); + return NULL; +} + PyStatus _PyConfig_WritePathConfig(const PyConfig *config) From 72c57f5d3b9bb3e62b056fbcd9148de8097c61cb Mon Sep 17 00:00:00 2001 From: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> Date: Tue, 7 Jul 2020 20:09:56 -0300 Subject: [PATCH 004/197] bpo-41224: Document is_annotated() in symtable module and update doc strings (GH-21369) * Document is_annotate() and update doc strings * Move quotes to the next line. Co-authored-by: Pablo Galindo Co-authored-by: Pablo Galindo --- Doc/library/symtable.rst | 4 +++ Lib/symtable.py | 78 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index 3efdecb5af7102..c9521d649b893e 100644 --- a/Doc/library/symtable.rst +++ b/Doc/library/symtable.rst @@ -156,6 +156,10 @@ Examining Symbol Tables Return ``True`` if the symbol is local to its block. + .. method:: is_annotated() + + Return ``True`` if the symbol is annotated. + .. method:: is_free() Return ``True`` if the symbol is referenced in its block, but not assigned diff --git a/Lib/symtable.py b/Lib/symtable.py index a711676582f649..9ff27ef74ffe83 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -10,6 +10,11 @@ __all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"] def symtable(code, filename, compile_type): + """ Return the toplevel *SymbolTable* for the source code. + + *filename* is the name of the file with the code + and *compile_type* is the *compile()* mode argument. + """ top = _symtable.symtable(code, filename, compile_type) return _newSymbolTable(top, filename) @@ -55,6 +60,11 @@ def __repr__(self): self._filename) def get_type(self): + """Return the type of the symbol table. + + The values retuned are 'class', 'module' and + 'function'. + """ if self._table.type == _symtable.TYPE_MODULE: return "module" if self._table.type == _symtable.TYPE_FUNCTION: @@ -65,27 +75,51 @@ def get_type(self): "unexpected type: {0}".format(self._table.type) def get_id(self): + """Return an identifier for the table. + """ return self._table.id def get_name(self): + """Return the table's name. + + This corresponds to the name of the class, function + or 'top' if the table is for a class, function or + global respectively. + """ return self._table.name def get_lineno(self): + """Return the number of the first line in the + block for the table. + """ return self._table.lineno def is_optimized(self): + """Return *True* if the locals in the table + are optimizable. + """ return bool(self._table.type == _symtable.TYPE_FUNCTION) def is_nested(self): + """Return *True* if the block is a nested class + or function.""" return bool(self._table.nested) def has_children(self): + """Return *True* if the block has nested namespaces. + """ return bool(self._table.children) def get_identifiers(self): + """Return a list of names of symbols in the table. + """ return self._table.symbols.keys() def lookup(self, name): + """Lookup a *name* in the table. + + Returns a *Symbol* instance. + """ sym = self._symbols.get(name) if sym is None: flags = self._table.symbols[name] @@ -94,6 +128,9 @@ def lookup(self, name): return sym def get_symbols(self): + """Return a list of *Symbol* instances for + names in the table. + """ return [self.lookup(ident) for ident in self.get_identifiers()] def __check_children(self, name): @@ -102,6 +139,8 @@ def __check_children(self, name): if st.name == name] def get_children(self): + """Return a list of the nested symbol tables. + """ return [_newSymbolTable(st, self._filename) for st in self._table.children] @@ -120,11 +159,15 @@ def __idents_matching(self, test_func): if test_func(self._table.symbols[ident])) def get_parameters(self): + """Return a tuple of parameters to the function. + """ if self.__params is None: self.__params = self.__idents_matching(lambda x:x & DEF_PARAM) return self.__params def get_locals(self): + """Return a tuple of locals in the function. + """ if self.__locals is None: locs = (LOCAL, CELL) test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs @@ -132,6 +175,8 @@ def get_locals(self): return self.__locals def get_globals(self): + """Return a tuple of globals in the function. + """ if self.__globals is None: glob = (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT) test = lambda x:((x >> SCOPE_OFF) & SCOPE_MASK) in glob @@ -139,11 +184,15 @@ def get_globals(self): return self.__globals def get_nonlocals(self): + """Return a tuple of nonlocals in the function. + """ if self.__nonlocals is None: self.__nonlocals = self.__idents_matching(lambda x:x & DEF_NONLOCAL) return self.__nonlocals def get_frees(self): + """Return a tuple of free variables in the function. + """ if self.__frees is None: is_free = lambda x:((x >> SCOPE_OFF) & SCOPE_MASK) == FREE self.__frees = self.__idents_matching(is_free) @@ -155,6 +204,8 @@ class Class(SymbolTable): __methods = None def get_methods(self): + """Return a tuple of methods declared in the class. + """ if self.__methods is None: d = {} for st in self._table.children: @@ -175,40 +226,63 @@ def __repr__(self): return "".format(self.__name) def get_name(self): + """Return a name of a symbol. + """ return self.__name def is_referenced(self): + """Return *True* if the symbol is used in + its block. + """ return bool(self.__flags & _symtable.USE) def is_parameter(self): + """Return *True* if the symbol is a parameter. + """ return bool(self.__flags & DEF_PARAM) def is_global(self): + """Return *True* if the sysmbol is global. + """ return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)) def is_nonlocal(self): + """Return *True* if the symbol is nonlocal.""" return bool(self.__flags & DEF_NONLOCAL) def is_declared_global(self): + """Return *True* if the symbol is declared global + with a global statement.""" return bool(self.__scope == GLOBAL_EXPLICIT) def is_local(self): + """Return *True* if the symbol is local. + """ return bool(self.__scope in (LOCAL, CELL)) def is_annotated(self): + """Return *True* if the symbol is annotated. + """ return bool(self.__flags & DEF_ANNOT) def is_free(self): + """Return *True* if a referenced symbol is + not assigned to. + """ return bool(self.__scope == FREE) def is_imported(self): + """Return *True* if the symbol is created from + an import statement. + """ return bool(self.__flags & DEF_IMPORT) def is_assigned(self): + """Return *True* if a symbol is assigned to.""" return bool(self.__flags & DEF_LOCAL) def is_namespace(self): - """Returns true if name binding introduces new namespace. + """Returns *True* if name binding introduces new namespace. If the name is used as the target of a function or class statement, this will be true. @@ -225,7 +299,7 @@ def get_namespaces(self): return self.__namespaces def get_namespace(self): - """Returns the single namespace bound to this name. + """Return the single namespace bound to this name. Raises ValueError if the name is bound to multiple namespaces. """ From 4f2a589bdc70eadd52cbe7709c946304074c7ff9 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 8 Jul 2020 00:24:39 +0100 Subject: [PATCH 005/197] bpo-41173: Copy test results file from ARM worker before uploading (GH-21305) --- Tools/buildbot/test.bat | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat index a0fc6b9a9458bc..25c796a60e173d 100644 --- a/Tools/buildbot/test.bat +++ b/Tools/buildbot/test.bat @@ -36,8 +36,10 @@ if NOT "%REMOTE_PYTHON_DIR:~-1,1%"=="\" (set REMOTE_PYTHON_DIR=%REMOTE_PYTHON_DI set TEMP_ARGS=--temp %REMOTE_PYTHON_DIR%temp set rt_args=%rt_opts% %dashU% -rwW --slowest --timeout=1200 --fail-env-changed %regrtest_args% %TEMP_ARGS% -ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args% -exit /b %ERRORLEVEL% +ssh %SSH_SERVER% "set TEMP=%REMOTE_PYTHON_DIR%temp& cd %REMOTE_PYTHON_DIR% & %REMOTE_PYTHON_DIR%PCbuild\rt.bat" %rt_args% +set ERR=%ERRORLEVEL% +scp %SSH_SERVER%:"%REMOTE_PYTHON_DIR%test-results.xml" "%PYTHON_SOURCE%\test-results.xml" +exit /b %ERR% :Arm32SshHelp echo SSH_SERVER environment variable must be set to administrator@[ip address] From 4165234f44e2dc63eccaba4f290873a2ef14141b Mon Sep 17 00:00:00 2001 From: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> Date: Tue, 7 Jul 2020 21:45:45 -0300 Subject: [PATCH 006/197] Add a test for get_id() (GH-21370) --- Lib/test/test_symtable.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index d19355888e4b34..fa514917a1f021 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -63,6 +63,13 @@ def test_type(self): self.assertEqual(self.spam.get_type(), "function") self.assertEqual(self.internal.get_type(), "function") + def test_id(self): + self.assertGreater(self.top.get_id(), 0) + self.assertGreater(self.Mine.get_id(), 0) + self.assertGreater(self.a_method.get_id(), 0) + self.assertGreater(self.spam.get_id(), 0) + self.assertGreater(self.internal.get_id(), 0) + def test_optimized(self): self.assertFalse(self.top.is_optimized()) From 6e362d861d7af05c29cd6b90e61a26ea386575a3 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Tue, 7 Jul 2020 22:21:58 -0600 Subject: [PATCH 007/197] closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385) --- .../next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst | 1 + Modules/_ssl.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst diff --git a/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst b/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst new file mode 100644 index 00000000000000..c55275bb1c622b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst @@ -0,0 +1 @@ +Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 5e82fe41a76ec2..58064178a1a343 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4309,8 +4309,10 @@ _ssl__SSLContext_load_dh_params(PySSLContext *self, PyObject *filepath) } return NULL; } - if (SSL_CTX_set_tmp_dh(self->ctx, dh) == 0) - _setSSLError(NULL, 0, __FILE__, __LINE__); + if (!SSL_CTX_set_tmp_dh(self->ctx, dh)) { + DH_free(dh); + return _setSSLError(NULL, 0, __FILE__, __LINE__); + } DH_free(dh); Py_RETURN_NONE; } From e4512c06961b4799bd129f2a2748b526c841a96b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 8 Jul 2020 11:02:23 +0200 Subject: [PATCH 008/197] Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390) This partially reverts commit 45ec5b99aefa54552947049086e87ec01bc2fc9a. --- Include/object.h | 12 ++++++++++-- .../C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst diff --git a/Include/object.h b/Include/object.h index 537567040f9871..10f1d6a3dff2dd 100644 --- a/Include/object.h +++ b/Include/object.h @@ -637,8 +637,16 @@ times. static inline int -PyType_HasFeature(PyTypeObject *type, unsigned long feature) { - return ((PyType_GetFlags(type) & feature) != 0); +PyType_HasFeature(PyTypeObject *type, unsigned long feature) +{ + unsigned long flags; +#ifdef Py_LIMITED_API + // PyTypeObject is opaque in the limited C API + flags = PyType_GetFlags(type); +#else + flags = type->tp_flags; +#endif + return ((flags & feature) != 0); } #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) diff --git a/Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst b/Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst new file mode 100644 index 00000000000000..760a3ff4d17b44 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst @@ -0,0 +1,4 @@ +Revert :c:func:`PyType_HasFeature` change: it reads again directly the +:c:member:`PyTypeObject.tp_flags` member when the limited C API is not used, +rather than always calling :c:func:`PyType_GetFlags` which hides implementation +details. From a747cbb1fb08406a4e0a87616b778b581de25d8f Mon Sep 17 00:00:00 2001 From: Tony Solomonik Date: Wed, 8 Jul 2020 22:27:31 +0300 Subject: [PATCH 009/197] bpo-41247: asyncio.set_running_loop() cache running loop holder (GH-21401) The running loop holder cache variable was always set to NULL when calling set_running_loop. Now set_running_loop saves the newly created running loop holder in the cache variable for faster access in get_running_loop. Automerge-Triggered-By: @1st1 --- .../2020-07-08-22-03-54.bpo-41247.PndYIk.rst | 2 ++ Modules/_asynciomodule.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst new file mode 100644 index 00000000000000..08699b6e4a1f01 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst @@ -0,0 +1,2 @@ +Always cache the running loop holder when running +``asyncio.set_running_loop``. diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index b378742648b2a2..4a1c91e9eddd67 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -291,10 +291,13 @@ get_running_loop(PyObject **loop) static int set_running_loop(PyObject *loop) { - cached_running_holder = NULL; - cached_running_holder_tsid = 0; + PyObject *ts_dict = NULL; + + PyThreadState *tstate = PyThreadState_Get(); + if (tstate != NULL) { + ts_dict = _PyThreadState_GetDict(tstate); // borrowed + } - PyObject *ts_dict = PyThreadState_GetDict(); // borrowed if (ts_dict == NULL) { PyErr_SetString( PyExc_RuntimeError, "thread-local storage is not available"); @@ -314,6 +317,9 @@ set_running_loop(PyObject *loop) } Py_DECREF(rl); + cached_running_holder = (PyObject *)rl; + cached_running_holder_tsid = PyThreadState_GetID(tstate); + return 0; } From badce8af39f78ffa13ea2a1d9438103efaae7ce6 Mon Sep 17 00:00:00 2001 From: stratakis Date: Wed, 8 Jul 2020 22:39:41 +0200 Subject: [PATCH 010/197] bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240) The issue is triggered by the bytearray() + bytearray() operation. Detected by GCC 10 static analysis tool. --- .../2020-06-30-20-17-31.bpo-41175.acJoXB.rst | 2 ++ Objects/bytearrayobject.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst new file mode 100644 index 00000000000000..844fb804c0c8d4 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst @@ -0,0 +1,2 @@ +Guard against a NULL pointer dereference within bytearrayobject triggered by +the ``bytearray() + bytearray()`` operation. diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 83c79b200a0a13..70350619330983 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -266,7 +266,9 @@ PyByteArray_Concat(PyObject *a, PyObject *b) result = (PyByteArrayObject *) \ PyByteArray_FromStringAndSize(NULL, va.len + vb.len); - if (result != NULL) { + // result->ob_bytes is NULL if result is an empty string: + // if va.len + vb.len equals zero. + if (result != NULL && result->ob_bytes != NULL) { memcpy(result->ob_bytes, va.buf, va.len); memcpy(result->ob_bytes + va.len, vb.buf, vb.len); } From aee8f10e9898d21602397f35c9040c00fd3caae4 Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Wed, 8 Jul 2020 14:00:35 -0700 Subject: [PATCH 011/197] bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542) --- Lib/email/contentmanager.py | 2 +- Lib/test/test_email/test_contentmanager.py | 13 +++++++++++++ .../2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst diff --git a/Lib/email/contentmanager.py b/Lib/email/contentmanager.py index 2b4b8757f46f62..b91fb0e5bca7a8 100644 --- a/Lib/email/contentmanager.py +++ b/Lib/email/contentmanager.py @@ -146,7 +146,7 @@ def embedded_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. - if max(len(x) for x in lines) <= policy.max_line_length: + if max((len(x) for x in lines), default=0) <= policy.max_line_length: try: return '7bit', normal_body(lines).decode('ascii') except UnicodeDecodeError: diff --git a/Lib/test/test_email/test_contentmanager.py b/Lib/test/test_email/test_contentmanager.py index 64dca2d017e629..f4f6bb715acdce 100644 --- a/Lib/test/test_email/test_contentmanager.py +++ b/Lib/test/test_email/test_contentmanager.py @@ -303,6 +303,19 @@ def test_set_text_plain(self): self.assertEqual(m.get_payload(decode=True).decode('utf-8'), content) self.assertEqual(m.get_content(), content) + def test_set_text_plain_null(self): + m = self._make_message() + content = '' + raw_data_manager.set_content(m, content) + self.assertEqual(str(m), textwrap.dedent("""\ + Content-Type: text/plain; charset="utf-8" + Content-Transfer-Encoding: 7bit + + + """)) + self.assertEqual(m.get_payload(decode=True).decode('utf-8'), '\n') + self.assertEqual(m.get_content(), '\n') + def test_set_text_html(self): m = self._make_message() content = "

Simple message.

\n" diff --git a/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst b/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst new file mode 100644 index 00000000000000..482ae624da079d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst @@ -0,0 +1 @@ +Fixed email.contentmanager to allow set_content() to set a null string. From e8ab7093c316e560e14b80be4451b5505369a567 Mon Sep 17 00:00:00 2001 From: Julien Palard Date: Thu, 9 Jul 2020 11:38:41 +0200 Subject: [PATCH 012/197] Doc: Builtins functions: faster jump table (GH-21376) --- Doc/library/functions.rst | 50 +++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index f4110c3585a0bc..3c36b59befab91 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -7,24 +7,38 @@ Built-in Functions The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order. -=================== ================= ================== ================== ==================== -.. .. Built-in Functions .. .. -=================== ================= ================== ================== ==================== -:func:`abs` :func:`delattr` :func:`hash` |func-memoryview|_ |func-set|_ -:func:`all` |func-dict|_ :func:`help` :func:`min` :func:`setattr` -:func:`any` :func:`dir` :func:`hex` :func:`next` :func:`slice` -:func:`ascii` :func:`divmod` :func:`id` :func:`object` :func:`sorted` -:func:`bin` :func:`enumerate` :func:`input` :func:`oct` :func:`staticmethod` -:func:`bool` :func:`eval` :func:`int` :func:`open` |func-str|_ -:func:`breakpoint` :func:`exec` :func:`isinstance` :func:`ord` :func:`sum` -|func-bytearray|_ :func:`filter` :func:`issubclass` :func:`pow` :func:`super` -|func-bytes|_ :func:`float` :func:`iter` :func:`print` |func-tuple|_ -:func:`callable` :func:`format` :func:`len` :func:`property` :func:`type` -:func:`chr` |func-frozenset|_ |func-list|_ |func-range|_ :func:`vars` -:func:`classmethod` :func:`getattr` :func:`locals` :func:`repr` :func:`zip` -:func:`compile` :func:`globals` :func:`map` :func:`reversed` :func:`__import__` -:func:`complex` :func:`hasattr` :func:`max` :func:`round` -=================== ================= ================== ================== ==================== ++---------------------------------------------------------------------------------------------------+ +| Built-in Functions | ++=========================+=======================+=======================+=========================+ +| | **A** | | **E** | | **L** | | **R** | +| | :func:`abs` | | :func:`enumerate` | | :func:`len` | | |func-range|_ | +| | :func:`all` | | :func:`eval` | | |func-list|_ | | :func:`repr` | +| | :func:`any` | | :func:`exec` | | :func:`locals` | | :func:`reversed` | +| | :func:`ascii` | | | | | | :func:`round` | +| | | | **F** | | **M** | | | +| | **B** | | :func:`filter` | | :func:`map` | | **S** | +| | :func:`bin` | | :func:`float` | | :func:`max` | | |func-set|_ | +| | :func:`bool` | | :func:`format` | | |func-memoryview|_ | | :func:`setattr` | +| | :func:`breakpoint` | | |func-frozenset|_ | | :func:`min` | | :func:`slice` | +| | |func-bytearray|_ | | | | | | :func:`sorted` | +| | |func-bytes|_ | | **G** | | **N** | | :func:`staticmethod` | +| | | | :func:`getattr` | | :func:`next` | | |func-str|_ | +| | **C** | | :func:`globals` | | | | :func:`sum` | +| | :func:`callable` | | | | **O** | | :func:`super` | +| | :func:`chr` | | **H** | | :func:`object` | | | +| | :func:`classmethod` | | :func:`hasattr` | | :func:`oct` | | **T** | +| | :func:`compile` | | :func:`hash` | | :func:`open` | | |func-tuple|_ | +| | :func:`complex` | | :func:`help` | | :func:`ord` | | :func:`type` | +| | | | :func:`hex` | | | | | +| | **D** | | | | **P** | | **V** | +| | :func:`delattr` | | **I** | | :func:`pow` | | :func:`vars` | +| | |func-dict|_ | | :func:`id` | | :func:`print` | | | +| | :func:`dir` | | :func:`input` | | :func:`property` | | **Z** | +| | :func:`divmod` | | :func:`int` | | | | :func:`zip` | +| | | | :func:`isinstance` | | | | | +| | | | :func:`issubclass` | | | | **_** | +| | | | :func:`iter` | | | | :func:`__import__` | ++-------------------------+-----------------------+-----------------------+-------------------------+ .. using :func:`dict` would create a link to another page, so local targets are used, with replacement texts to make the output in the table consistent From e8e841462533f1d2858a9750c47abe698c277839 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Thu, 9 Jul 2020 04:00:21 -0600 Subject: [PATCH 013/197] bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407) --- .../Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst | 1 + Modules/_ssl.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst new file mode 100644 index 00000000000000..65f3189c83ec64 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst @@ -0,0 +1 @@ +Fix incorrect refcounting in _ssl.c's ``_servername_callback()``. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 58064178a1a343..a8c339d9f33344 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4545,11 +4545,12 @@ _servername_callback(SSL *s, int *al, void *args) * back into a str object, but still as an A-label (bpo-28414) */ servername_str = PyUnicode_FromEncodedObject(servername_bytes, "ascii", NULL); - Py_DECREF(servername_bytes); if (servername_str == NULL) { PyErr_WriteUnraisable(servername_bytes); + Py_DECREF(servername_bytes); goto error; } + Py_DECREF(servername_bytes); result = PyObject_CallFunctionObjArgs( ssl_ctx->set_sni_cb, ssl_socket, servername_str, ssl_ctx, NULL); From 10ddc13626bb0e0316dd4861efb6d6689a229395 Mon Sep 17 00:00:00 2001 From: marload Date: Thu, 9 Jul 2020 21:13:47 +0900 Subject: [PATCH 014/197] bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413) Automerge-Triggered-By: @ericvsmith --- Doc/library/dataclasses.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index fe63d20671dd74..6e74af062d9e72 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -23,7 +23,7 @@ using :pep:`526` type annotations. For example this code:: @dataclass class InventoryItem: - '''Class for keeping track of an item in inventory.''' + """Class for keeping track of an item in inventory.""" name: str unit_price: float quantity_on_hand: int = 0 From d4ae3c02adfd784ff7305916c289893a6677b448 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Thu, 9 Jul 2020 21:25:10 +0800 Subject: [PATCH 015/197] bpo-40275: Use new test.support helper submodules in tests (GH-21412) --- Lib/test/test_cmd_line_script.py | 100 +++++++++--------- Lib/test/test_codeop.py | 3 +- Lib/test/test_contextlib.py | 3 +- Lib/test/test_dbm_ndbm.py | 3 +- Lib/test/test_getargs2.py | 3 +- Lib/test/test_gettext.py | 5 +- Lib/test/test_glob.py | 4 +- Lib/test/test_import/__init__.py | 23 ++-- Lib/test/test_locale.py | 3 +- Lib/test/test_mailbox.py | 41 +++---- .../test_multiprocessing_main_handling.py | 36 ++++--- Lib/test/test_osx_env.py | 2 +- Lib/test/test_pkgutil.py | 4 +- Lib/test/test_plistlib.py | 7 +- Lib/test/test_ttk_guionly.py | 3 +- Lib/test/test_turtle.py | 4 +- Lib/test/test_xxtestfuzz.py | 4 +- Lib/test/test_zipimport.py | 40 +++---- 18 files changed, 154 insertions(+), 134 deletions(-) diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 15fca7b8a5191e..6c8c28f40b564b 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -14,6 +14,8 @@ import textwrap from test import support +from test.support import import_helper +from test.support import os_helper from test.support.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, assert_python_ok, assert_python_failure, spawn_python, kill_python) @@ -214,7 +216,7 @@ def test_repl_stderr_flush_separate_stderr(self): self.check_repl_stderr_flush(True) def test_basic_script(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script') self._check_script(script_name, script_name, script_name, script_dir, None, @@ -224,7 +226,7 @@ def test_basic_script(self): def test_script_abspath(self): # pass the script using the relative path, expect the absolute path # in __file__ - with support.temp_cwd() as script_dir: + with os_helper.temp_cwd() as script_dir: self.assertTrue(os.path.isabs(script_dir), script_dir) script_name = _make_test_script(script_dir, 'script') @@ -234,46 +236,46 @@ def test_script_abspath(self): importlib.machinery.SourceFileLoader) def test_script_compiled(self): - with support.temp_dir() as script_dir: + with os_helper.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) + pyc_file = import_helper.make_legacy_pyc(script_name) self._check_script(pyc_file, pyc_file, pyc_file, script_dir, None, importlib.machinery.SourcelessFileLoader) def test_directory(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') self._check_script(script_dir, script_name, script_dir, script_dir, '', importlib.machinery.SourceFileLoader) def test_directory_compiled(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') py_compile.compile(script_name, doraise=True) os.remove(script_name) - pyc_file = support.make_legacy_pyc(script_name) + pyc_file = import_helper.make_legacy_pyc(script_name) self._check_script(script_dir, pyc_file, script_dir, script_dir, '', importlib.machinery.SourcelessFileLoader) def test_directory_error(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: msg = "can't find '__main__' module in %r" % script_dir self._check_import_error(script_dir, msg) def test_zipfile(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name) self._check_script(zip_name, run_name, zip_name, zip_name, '', zipimport.zipimporter) def test_zipfile_compiled_timestamp(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') compiled_name = py_compile.compile( script_name, doraise=True, @@ -283,7 +285,7 @@ def test_zipfile_compiled_timestamp(self): zipimport.zipimporter) def test_zipfile_compiled_checked_hash(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') compiled_name = py_compile.compile( script_name, doraise=True, @@ -293,7 +295,7 @@ def test_zipfile_compiled_checked_hash(self): zipimport.zipimporter) def test_zipfile_compiled_unchecked_hash(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__') compiled_name = py_compile.compile( script_name, doraise=True, @@ -303,14 +305,14 @@ def test_zipfile_compiled_unchecked_hash(self): zipimport.zipimporter) def test_zipfile_error(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'not_main') zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name) msg = "can't find '__main__' module in %r" % zip_name self._check_import_error(zip_name, msg) def test_module_in_package(self): - with support.temp_dir() as script_dir: + with os_helper.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, 'script') @@ -320,14 +322,14 @@ def test_module_in_package(self): cwd=script_dir) def test_module_in_package_in_zipfile(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script') self._check_script(["-m", "test_pkg.script"], run_name, run_name, script_dir, 'test_pkg', zipimport.zipimporter, PYTHONPATH=zip_name, cwd=script_dir) def test_module_in_subpackage_in_zipfile(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script', depth=2) self._check_script(["-m", "test_pkg.test_pkg.script"], run_name, run_name, script_dir, 'test_pkg.test_pkg', @@ -335,7 +337,7 @@ def test_module_in_subpackage_in_zipfile(self): PYTHONPATH=zip_name, cwd=script_dir) def test_package(self): - with support.temp_dir() as script_dir: + with os_helper.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__') @@ -345,20 +347,20 @@ def test_package(self): cwd=script_dir) def test_package_compiled(self): - with support.temp_dir() as script_dir: + with os_helper.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__') compiled_name = py_compile.compile(script_name, doraise=True) os.remove(script_name) - pyc_file = support.make_legacy_pyc(script_name) + pyc_file = import_helper.make_legacy_pyc(script_name) self._check_script(["-m", "test_pkg"], pyc_file, pyc_file, script_dir, 'test_pkg', importlib.machinery.SourcelessFileLoader, cwd=script_dir) def test_package_error(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: pkg_dir = os.path.join(script_dir, 'test_pkg') make_pkg(pkg_dir) msg = ("'test_pkg' is a package and cannot " @@ -366,7 +368,7 @@ def test_package_error(self): self._check_import_error(["-m", "test_pkg"], msg, cwd=script_dir) def test_package_recursion(self): - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: pkg_dir = os.path.join(script_dir, 'test_pkg') make_pkg(pkg_dir) main_dir = os.path.join(pkg_dir, '__main__') @@ -379,8 +381,8 @@ def test_package_recursion(self): def test_issue8202(self): # Make sure package __init__ modules see "-m" in sys.argv0 while # searching for the module to execute - with support.temp_dir() as script_dir: - with support.change_cwd(path=script_dir): + with os_helper.temp_dir() as script_dir: + with os_helper.change_cwd(path=script_dir): 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') @@ -396,8 +398,8 @@ def test_issue8202(self): def test_issue8202_dash_c_file_ignored(self): # Make sure a "-c" file in the current directory # does not alter the value of sys.path[0] - with support.temp_dir() as script_dir: - with support.change_cwd(path=script_dir): + with os_helper.temp_dir() as script_dir: + with os_helper.change_cwd(path=script_dir): with open("-c", "w") as f: f.write("data") rc, out, err = assert_python_ok('-c', @@ -411,9 +413,9 @@ def test_issue8202_dash_c_file_ignored(self): def test_issue8202_dash_m_file_ignored(self): # Make sure a "-m" file in the current directory # does not alter the value of sys.path[0] - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'other') - with support.change_cwd(path=script_dir): + with os_helper.change_cwd(path=script_dir): with open("-m", "w") as f: f.write("data") rc, out, err = assert_python_ok('-m', 'other', *example_args, @@ -425,7 +427,7 @@ def test_issue8202_dash_m_file_ignored(self): def test_issue20884(self): # On Windows, script with encoding cookie and LF line ending # will be failed. - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = os.path.join(script_dir, "issue20884.py") with open(script_name, "w", newline='\n') as f: f.write("#coding: iso-8859-1\n") @@ -434,15 +436,15 @@ def test_issue20884(self): f.write('x'*80 + '\n') f.write('"""\n') - with support.change_cwd(path=script_dir): + with os_helper.change_cwd(path=script_dir): rc, out, err = assert_python_ok(script_name) self.assertEqual(b"", out) self.assertEqual(b"", err) @contextlib.contextmanager def setup_test_pkg(self, *args): - with support.temp_dir() as script_dir, \ - support.change_cwd(path=script_dir): + with os_helper.temp_dir() as script_dir, \ + os_helper.change_cwd(path=script_dir): pkg_dir = os.path.join(script_dir, 'test_pkg') make_pkg(pkg_dir, *args) yield pkg_dir @@ -486,8 +488,8 @@ def test_dash_m_errors(self): self.assertNotIn(b'Traceback', err) def test_dash_m_bad_pyc(self): - with support.temp_dir() as script_dir, \ - support.change_cwd(path=script_dir): + with os_helper.temp_dir() as script_dir, \ + os_helper.change_cwd(path=script_dir): os.mkdir('test_pkg') # Create invalid *.pyc as empty file with open('test_pkg/__init__.pyc', 'wb'): @@ -500,8 +502,8 @@ def test_dash_m_bad_pyc(self): self.assertNotIn(b'Traceback', err) def test_hint_when_triying_to_import_a_py_file(self): - with support.temp_dir() as script_dir, \ - support.change_cwd(path=script_dir): + with os_helper.temp_dir() as script_dir, \ + os_helper.change_cwd(path=script_dir): # Create invalid *.pyc as empty file with open('asyncio.py', 'wb'): pass @@ -542,7 +544,7 @@ def test_pep_409_verbiage(self): except: raise NameError from None """) - with support.temp_dir() as script_dir: + with os_helper.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').split('\n') @@ -555,18 +557,18 @@ def test_non_ascii(self): # Mac OS X denies the creation of a file with an invalid UTF-8 name. # Windows allows creating a name with an arbitrary bytes name, but # Python cannot a undecodable bytes argument to a subprocess. - if (support.TESTFN_UNDECODABLE + if (os_helper.TESTFN_UNDECODABLE and sys.platform not in ('win32', 'darwin')): - name = os.fsdecode(support.TESTFN_UNDECODABLE) - elif support.TESTFN_NONASCII: - name = support.TESTFN_NONASCII + name = os.fsdecode(os_helper.TESTFN_UNDECODABLE) + elif os_helper.TESTFN_NONASCII: + name = os_helper.TESTFN_NONASCII else: - self.skipTest("need support.TESTFN_NONASCII") + self.skipTest("need os_helper.TESTFN_NONASCII") # Issue #16218 source = 'print(ascii(__file__))\n' script_name = _make_test_script(os.getcwd(), name, source) - self.addCleanup(support.unlink, script_name) + self.addCleanup(os_helper.unlink, script_name) rc, stdout, stderr = assert_python_ok(script_name) self.assertEqual( ascii(script_name), @@ -586,7 +588,7 @@ def test_issue20500_exit_with_exception_value(self): if error: sys.exit(error) """) - with support.temp_dir() as script_dir: + with os_helper.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') @@ -594,7 +596,7 @@ def test_issue20500_exit_with_exception_value(self): def test_syntaxerror_unindented_caret_position(self): script = "1 + 1 = 2\n" - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script', script) exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read() @@ -606,7 +608,7 @@ def test_syntaxerror_indented_caret_position(self): if True: 1 + 1 = 2 """) - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script', script) exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read() @@ -626,7 +628,7 @@ def test_syntaxerror_indented_caret_position(self): def test_syntaxerror_multi_line_fstring(self): script = 'foo = f"""{}\nfoo"""\n' - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script', script) exitcode, stdout, stderr = assert_python_failure(script_name) self.assertEqual( @@ -640,7 +642,7 @@ def test_syntaxerror_multi_line_fstring(self): def test_syntaxerror_invalid_escape_sequence_multi_line(self): script = 'foo = """\\q"""\n' - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script', script) exitcode, stdout, stderr = assert_python_failure( '-Werror', script_name, @@ -667,7 +669,7 @@ def test_consistent_sys_path_for_direct_execution(self): """) # Always show full path diffs on errors self.maxDiff = None - with support.temp_dir() as work_dir, support.temp_dir() as script_dir: + with os_helper.temp_dir() as work_dir, os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__', script) # Reference output comes from directly executing __main__.py # We omit PYTHONPATH and user site to align with isolated mode @@ -699,7 +701,7 @@ def test_consistent_sys_path_for_module_execution(self): """) # Always show full path diffs on errors self.maxDiff = None - with support.temp_dir() as work_dir: + with os_helper.temp_dir() as work_dir: script_dir = os.path.join(work_dir, "script_pkg") os.mkdir(script_dir) script_name = _make_test_script(script_dir, '__main__', script) diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index 45cb1a7b74e903..6e821df6b0e707 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -5,6 +5,7 @@ import sys import unittest from test import support +from test.support import warnings_helper from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT import io @@ -305,7 +306,7 @@ def test_filename(self): def test_warning(self): # Test that the warning is only returned once. - with support.check_warnings((".*literal", SyntaxWarning)) as w: + with warnings_helper.check_warnings((".*literal", SyntaxWarning)) as w: compile_command("0 is 0") self.assertEqual(len(w.warnings), 1) diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index 024f912647295a..50943c1a17e9cb 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -7,6 +7,7 @@ import unittest from contextlib import * # Tests __all__ from test import support +from test.support import os_helper import weakref @@ -327,7 +328,7 @@ def testWithOpen(self): 1 / 0 self.assertTrue(f.closed) finally: - support.unlink(tfn) + os_helper.unlink(tfn) class LockContextTestCase(unittest.TestCase): diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py index 7ac75c5fea1b5e..278fca2cf23152 100644 --- a/Lib/test/test_dbm_ndbm.py +++ b/Lib/test/test_dbm_ndbm.py @@ -1,5 +1,6 @@ from test import support -support.import_module("dbm.ndbm") #skip if not supported +from test.support import import_helper +import_helper.import_module("dbm.ndbm") #skip if not supported import os import unittest import dbm.ndbm diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 0dec5b1874e6d6..d39ea56ae9e9ca 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -3,8 +3,9 @@ import string import sys from test import support +from test.support import import_helper # Skip this test if the _testcapi module isn't available. -_testcapi = support.import_module('_testcapi') +_testcapi = import_helper.import_module('_testcapi') from _testcapi import getargs_keywords, getargs_keyword_only # > How about the following counterproposal. This also changes some of diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index baf300b0572495..df9eae39eac3e3 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -5,6 +5,7 @@ import unittest from test import support +from test.support import os_helper # TODO: @@ -129,14 +130,14 @@ def setUp(self): fp.write(base64.decodebytes(UMO_DATA)) with open(MMOFILE, 'wb') as fp: fp.write(base64.decodebytes(MMO_DATA)) - self.env = support.EnvironmentVarGuard() + self.env = os_helper.EnvironmentVarGuard() self.env['LANGUAGE'] = 'xx' gettext._translations.clear() def tearDown(self): self.env.__exit__() del self.env - support.rmtree(os.path.split(LOCALEDIR)[0]) + os_helper.rmtree(os.path.split(LOCALEDIR)[0]) GNU_MO_DATA_ISSUE_17898 = b'''\ 3hIElQAAAAABAAAAHAAAACQAAAAAAAAAAAAAAAAAAAAsAAAAggAAAC0AAAAAUGx1cmFsLUZvcm1z diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py index f8158523a04695..96db31b26814b1 100644 --- a/Lib/test/test_glob.py +++ b/Lib/test/test_glob.py @@ -4,8 +4,8 @@ import sys import unittest -from test.support import (TESTFN, skip_unless_symlink, - can_symlink, create_empty_file, change_cwd) +from test.support.os_helper import (TESTFN, skip_unless_symlink, + can_symlink, create_empty_file, change_cwd) class GlobTests(unittest.TestCase): diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index a04cf65945e935..f4a83d2e7a13a1 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -19,11 +19,12 @@ from unittest import mock import test.support -from test.support import ( - TESTFN, forget, is_jython, - make_legacy_pyc, rmtree, swap_attr, swap_item, temp_umask, - unlink, unload, cpython_only, TESTFN_UNENCODABLE, - temp_dir, DirsOnSysPath) +from test.support import os_helper +from test.support import (is_jython, swap_attr, swap_item, cpython_only) +from test.support.import_helper import ( + forget, make_legacy_pyc, unlink, unload, DirsOnSysPath) +from test.support.os_helper import ( + TESTFN, rmtree, temp_umask, TESTFN_UNENCODABLE, temp_dir) from test.support import script_helper from test.support import threading_helper from test.test_importlib.util import uncache @@ -997,22 +998,22 @@ class TestSymbolicallyLinkedPackage(unittest.TestCase): tagged = package_name + '-tagged' def setUp(self): - test.support.rmtree(self.tagged) - test.support.rmtree(self.package_name) + os_helper.rmtree(self.tagged) + os_helper.rmtree(self.package_name) self.orig_sys_path = sys.path[:] # create a sample package; imagine you have a package with a tag and # you want to symbolically link it from its untagged name. os.mkdir(self.tagged) - self.addCleanup(test.support.rmtree, self.tagged) + self.addCleanup(os_helper.rmtree, self.tagged) init_file = os.path.join(self.tagged, '__init__.py') - test.support.create_empty_file(init_file) + os_helper.create_empty_file(init_file) assert os.path.exists(init_file) # now create a symlink to the tagged package # sample -> sample-tagged os.symlink(self.tagged, self.package_name, target_is_directory=True) - self.addCleanup(test.support.unlink, self.package_name) + self.addCleanup(os_helper.unlink, self.package_name) importlib.invalidate_caches() self.assertEqual(os.path.isdir(self.package_name), True) @@ -1027,7 +1028,7 @@ def tearDown(self): not hasattr(sys, 'getwindowsversion') or sys.getwindowsversion() >= (6, 0), "Windows Vista or later required") - @test.support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_symlinked_dir_importable(self): # make sure sample can only be imported from the current directory. sys.path[:] = ['.'] diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index 2863d200e25c2e..bd08c4f3007fc7 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -1,4 +1,5 @@ -from test.support import verbose, is_android, check_warnings +from test.support import verbose, is_android +from test.support.warnings_helper import check_warnings import unittest import locale import sys diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 6f891d413cd8f1..346c9f1c559cd5 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -9,6 +9,7 @@ import io import tempfile from test import support +from test.support import os_helper import unittest import textwrap import mailbox @@ -38,9 +39,9 @@ def _check_sample(self, msg): def _delete_recursively(self, target): # Delete a file or delete a directory recursively if os.path.isdir(target): - support.rmtree(target) + os_helper.rmtree(target) elif os.path.exists(target): - support.unlink(target) + os_helper.unlink(target) class TestMailbox(TestBase): @@ -51,7 +52,7 @@ class TestMailbox(TestBase): _template = 'From: foo\n\n%s\n' def setUp(self): - self._path = support.TESTFN + self._path = os_helper.TESTFN self._delete_recursively(self._path) self._box = self._factory(self._path) @@ -926,7 +927,7 @@ def refreshed(): # the mtime and should cause a re-read. Note that "sleep # emulation" is still in effect, as skewfactor is -3. filename = os.path.join(self._path, 'cur', 'stray-file') - support.create_empty_file(filename) + os_helper.create_empty_file(filename) os.unlink(filename) self._box._refresh() self.assertTrue(refreshed()) @@ -980,7 +981,7 @@ def tearDown(self): self._box.close() self._delete_recursively(self._path) for lock_remnant in glob.glob(glob.escape(self._path) + '.*'): - support.unlink(lock_remnant) + os_helper.unlink(lock_remnant) def assertMailboxEmpty(self): with open(self._path) as f: @@ -1312,7 +1313,7 @@ def tearDown(self): self._box.close() self._delete_recursively(self._path) for lock_remnant in glob.glob(glob.escape(self._path) + '.*'): - support.unlink(lock_remnant) + os_helper.unlink(lock_remnant) def test_labels(self): # Get labels from the mailbox @@ -1369,7 +1370,7 @@ class TestMessage(TestBase, unittest.TestCase): _factory = mailbox.Message # Overridden by subclasses to reuse tests def setUp(self): - self._path = support.TESTFN + self._path = os_helper.TESTFN def tearDown(self): self._delete_recursively(self._path) @@ -2019,7 +2020,7 @@ def _test_close(self, proxy): class TestProxyFile(TestProxyFileBase, unittest.TestCase): def setUp(self): - self._path = support.TESTFN + self._path = os_helper.TESTFN self._file = open(self._path, 'wb+') def tearDown(self): @@ -2068,7 +2069,7 @@ def test_close(self): class TestPartialFile(TestProxyFileBase, unittest.TestCase): def setUp(self): - self._path = support.TESTFN + self._path = os_helper.TESTFN self._file = open(self._path, 'wb+') def tearDown(self): @@ -2131,11 +2132,11 @@ class MaildirTestCase(unittest.TestCase): def setUp(self): # create a new maildir mailbox to work with: - self._dir = support.TESTFN + self._dir = os_helper.TESTFN if os.path.isdir(self._dir): - support.rmtree(self._dir) + os_helper.rmtree(self._dir) elif os.path.isfile(self._dir): - support.unlink(self._dir) + os_helper.unlink(self._dir) os.mkdir(self._dir) os.mkdir(os.path.join(self._dir, "cur")) os.mkdir(os.path.join(self._dir, "tmp")) @@ -2145,10 +2146,10 @@ def setUp(self): def tearDown(self): list(map(os.unlink, self._msgfiles)) - support.rmdir(os.path.join(self._dir, "cur")) - support.rmdir(os.path.join(self._dir, "tmp")) - support.rmdir(os.path.join(self._dir, "new")) - support.rmdir(self._dir) + os_helper.rmdir(os.path.join(self._dir, "cur")) + os_helper.rmdir(os.path.join(self._dir, "tmp")) + os_helper.rmdir(os.path.join(self._dir, "new")) + os_helper.rmdir(self._dir) def createMessage(self, dir, mbox=False): t = int(time.time() % 1000000) @@ -2174,7 +2175,7 @@ def test_empty_maildir(self): """Test an empty maildir mailbox""" # Test for regression on bug #117490: # Make sure the boxes attribute actually gets set. - self.mbox = mailbox.Maildir(support.TESTFN) + self.mbox = mailbox.Maildir(os_helper.TESTFN) #self.assertTrue(hasattr(self.mbox, "boxes")) #self.assertEqual(len(self.mbox.boxes), 0) self.assertIsNone(self.mbox.next()) @@ -2182,7 +2183,7 @@ def test_empty_maildir(self): def test_nonempty_maildir_cur(self): self.createMessage("cur") - self.mbox = mailbox.Maildir(support.TESTFN) + self.mbox = mailbox.Maildir(os_helper.TESTFN) #self.assertEqual(len(self.mbox.boxes), 1) self.assertIsNotNone(self.mbox.next()) self.assertIsNone(self.mbox.next()) @@ -2190,7 +2191,7 @@ def test_nonempty_maildir_cur(self): def test_nonempty_maildir_new(self): self.createMessage("new") - self.mbox = mailbox.Maildir(support.TESTFN) + self.mbox = mailbox.Maildir(os_helper.TESTFN) #self.assertEqual(len(self.mbox.boxes), 1) self.assertIsNotNone(self.mbox.next()) self.assertIsNone(self.mbox.next()) @@ -2199,7 +2200,7 @@ def test_nonempty_maildir_new(self): def test_nonempty_maildir_both(self): self.createMessage("cur") self.createMessage("new") - self.mbox = mailbox.Maildir(support.TESTFN) + self.mbox = mailbox.Maildir(os_helper.TESTFN) #self.assertEqual(len(self.mbox.boxes), 2) self.assertIsNotNone(self.mbox.next()) self.assertIsNotNone(self.mbox.next()) diff --git a/Lib/test/test_multiprocessing_main_handling.py b/Lib/test/test_multiprocessing_main_handling.py index be1ff10e03a55a..510d8d3a7597e1 100644 --- a/Lib/test/test_multiprocessing_main_handling.py +++ b/Lib/test/test_multiprocessing_main_handling.py @@ -1,7 +1,8 @@ # tests __main__ module handling in multiprocessing from test import support +from test.support import import_helper # Skip tests if _multiprocessing wasn't built. -support.import_module('_multiprocessing') +import_helper.import_module('_multiprocessing') import importlib import importlib.machinery @@ -11,6 +12,7 @@ import os.path import py_compile +from test.support import os_helper from test.support.script_helper import ( make_pkg, make_script, make_zip_pkg, make_zip_script, assert_python_ok) @@ -167,12 +169,12 @@ def _check_script(self, script_name, *cmd_line_switches): self._check_output(script_name, rc, out, err) def test_basic_script(self): - with support.temp_dir() as script_dir: + with os_helper.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 support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script', omit_suffix=True) self._check_script(script_name) @@ -183,7 +185,7 @@ def test_ipython_workaround(self): # a workaround for that case # See https://github.com/ipython/ipython/issues/4698 source = test_source_main_skipped_in_children - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'ipython', source=source) self._check_script(script_name) @@ -193,33 +195,33 @@ def test_ipython_workaround(self): self._check_script(script_no_suffix) def test_script_compiled(self): - with support.temp_dir() as script_dir: + with os_helper.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) + pyc_file = import_helper.make_legacy_pyc(script_name) self._check_script(pyc_file) def test_directory(self): source = self.main_in_children_source - with support.temp_dir() as script_dir: + with os_helper.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 support.temp_dir() as script_dir: + with os_helper.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) + pyc_file = import_helper.make_legacy_pyc(script_name) self._check_script(script_dir) def test_zipfile(self): source = self.main_in_children_source - with support.temp_dir() as script_dir: + with os_helper.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) @@ -227,7 +229,7 @@ def test_zipfile(self): def test_zipfile_compiled(self): source = self.main_in_children_source - with support.temp_dir() as script_dir: + with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, '__main__', source=source) compiled_name = py_compile.compile(script_name, doraise=True) @@ -235,7 +237,7 @@ def test_zipfile_compiled(self): self._check_script(zip_name) def test_module_in_package(self): - with support.temp_dir() as script_dir: + with os_helper.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') @@ -244,20 +246,20 @@ def test_module_in_package(self): self._check_script(launch_name) def test_module_in_package_in_zipfile(self): - with support.temp_dir() as script_dir: + with os_helper.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 support.temp_dir() as script_dir: + with os_helper.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 support.temp_dir() as script_dir: + with os_helper.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__', @@ -267,14 +269,14 @@ def test_package(self): def test_package_compiled(self): source = self.main_in_children_source - with support.temp_dir() as script_dir: + with os_helper.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) + pyc_file = import_helper.make_legacy_pyc(script_name) launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') self._check_script(launch_name) diff --git a/Lib/test/test_osx_env.py b/Lib/test/test_osx_env.py index 8a3bc5a46e547b..80198edcb80b73 100644 --- a/Lib/test/test_osx_env.py +++ b/Lib/test/test_osx_env.py @@ -2,7 +2,7 @@ Test suite for OS X interpreter environment variables. """ -from test.support import EnvironmentVarGuard +from test.support.os_helper import EnvironmentVarGuard import subprocess import sys import sysconfig diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index b162f9949ff697..bf9722a229611d 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -1,4 +1,6 @@ -from test.support import run_unittest, unload, check_warnings, CleanImport +from test.support import run_unittest +from test.support.import_helper import unload, CleanImport +from test.support.warnings_helper import check_warnings import unittest import sys import importlib diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py index e82a53c533df03..e5038d2e7f10a2 100644 --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -10,6 +10,7 @@ import binascii import collections from test import support +from test.support import os_helper from io import BytesIO from plistlib import UID @@ -110,7 +111,7 @@ class TestPlistlib(unittest.TestCase): def tearDown(self): try: - os.unlink(support.TESTFN) + os.unlink(os_helper.TESTFN) except: pass @@ -148,10 +149,10 @@ def test_create(self): def test_io(self): pl = self._create() - with open(support.TESTFN, 'wb') as fp: + with open(os_helper.TESTFN, 'wb') as fp: plistlib.dump(pl, fp) - with open(support.TESTFN, 'rb') as fp: + with open(os_helper.TESTFN, 'rb') as fp: pl2 = plistlib.load(fp) self.assertEqual(dict(pl), dict(pl2)) diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py index 462665db5f3e75..abb26433652f17 100644 --- a/Lib/test/test_ttk_guionly.py +++ b/Lib/test/test_ttk_guionly.py @@ -1,8 +1,9 @@ import unittest from test import support +from test.support import import_helper # Skip this test if _tkinter wasn't built. -support.import_module('_tkinter') +import_helper.import_module('_tkinter') # Skip test if tk cannot be initialized. support.requires('gui') diff --git a/Lib/test/test_turtle.py b/Lib/test/test_turtle.py index 38448c791be66c..39b3d96fb43bbb 100644 --- a/Lib/test/test_turtle.py +++ b/Lib/test/test_turtle.py @@ -1,8 +1,10 @@ import pickle import unittest from test import support +from test.support import import_helper -turtle = support.import_module('turtle') + +turtle = import_helper.import_module('turtle') Vec2D = turtle.Vec2D test_config = """\ diff --git a/Lib/test/test_xxtestfuzz.py b/Lib/test/test_xxtestfuzz.py index 15924aaeff3851..3304c6e703a173 100644 --- a/Lib/test/test_xxtestfuzz.py +++ b/Lib/test/test_xxtestfuzz.py @@ -1,8 +1,8 @@ import faulthandler -import test.support +from test.support import import_helper import unittest -_xxtestfuzz = test.support.import_module('_xxtestfuzz') +_xxtestfuzz = import_helper.import_module('_xxtestfuzz') class TestFuzzer(unittest.TestCase): diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 560286071c6902..8df7489f754d3f 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -9,6 +9,8 @@ import unittest.mock from test import support +from test.support import import_helper +from test.support import os_helper from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED @@ -68,14 +70,14 @@ def setUp(self): self.meta_path = sys.meta_path[:] self.path_hooks = sys.path_hooks[:] sys.path_importer_cache.clear() - self.modules_before = support.modules_setup() + self.modules_before = import_helper.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) + import_helper.modules_cleanup(*self.modules_before) class UncompressedZipImportTestCase(ImportHooksBaseTestCase): @@ -92,7 +94,7 @@ def setUp(self): def makeTree(self, files, dirName=TEMP_DIR): # Create a filesystem based set of modules/packages # defined by files under the directory dirName. - self.addCleanup(support.rmtree, dirName) + self.addCleanup(os_helper.rmtree, dirName) for name, (mtime, data) in files.items(): path = os.path.join(dirName, name) @@ -110,7 +112,7 @@ def makeZip(self, files, zipName=TEMP_ZIP, **kw): # Create a zip archive based set of modules/packages # defined by files in the zip file zipName. If the # key 'stuff' exists in kw it is prepended to the archive. - self.addCleanup(support.unlink, zipName) + self.addCleanup(os_helper.unlink, zipName) with ZipFile(zipName, "w") as z: for name, (mtime, data) in files.items(): @@ -438,7 +440,7 @@ def testZipImporterMethods(self): packdir2 + TESTMOD + pyc_ext: (NOW, test_pyc), "spam" + pyc_ext: (NOW, test_pyc)} - self.addCleanup(support.unlink, TEMP_ZIP) + self.addCleanup(os_helper.unlink, TEMP_ZIP) with ZipFile(TEMP_ZIP, "w") as z: for name, (mtime, data) in files.items(): zinfo = ZipInfo(name, time.localtime(mtime)) @@ -492,7 +494,7 @@ def testZipImporterMethodsInSubDirectory(self): files = {packdir2 + "__init__" + pyc_ext: (NOW, test_pyc), packdir2 + TESTMOD + pyc_ext: (NOW, test_pyc)} - self.addCleanup(support.unlink, TEMP_ZIP) + self.addCleanup(os_helper.unlink, TEMP_ZIP) with ZipFile(TEMP_ZIP, "w") as z: for name, (mtime, data) in files.items(): zinfo = ZipInfo(name, time.localtime(mtime)) @@ -536,7 +538,7 @@ def testZipImporterMethodsInSubDirectory(self): self.assertEqual(loader.get_filename(mod_name), mod.__file__) def testGetData(self): - self.addCleanup(support.unlink, TEMP_ZIP) + self.addCleanup(os_helper.unlink, TEMP_ZIP) with ZipFile(TEMP_ZIP, "w") as z: z.compression = self.compression name = "testdata.dat" @@ -644,11 +646,11 @@ def testTraceback(self): files = {TESTMOD + ".py": (NOW, raise_src)} self.doTest(None, files, TESTMOD, call=self.doTraceback) - @unittest.skipIf(support.TESTFN_UNENCODABLE is None, + @unittest.skipIf(os_helper.TESTFN_UNENCODABLE is None, "need an unencodable filename") def testUnencodable(self): - filename = support.TESTFN_UNENCODABLE + ".zip" - self.addCleanup(support.unlink, filename) + filename = os_helper.TESTFN_UNENCODABLE + ".zip" + self.addCleanup(os_helper.unlink, filename) with ZipFile(filename, "w") as z: zinfo = ZipInfo(TESTMOD + ".py", time.localtime(NOW)) zinfo.compress_type = self.compression @@ -656,8 +658,8 @@ def testUnencodable(self): zipimport.zipimporter(filename).load_module(TESTMOD) def testBytesPath(self): - filename = support.TESTFN + ".zip" - self.addCleanup(support.unlink, filename) + filename = os_helper.TESTFN + ".zip" + self.addCleanup(os_helper.unlink, filename) with ZipFile(filename, "w") as z: zinfo = ZipInfo(TESTMOD + ".py", time.localtime(NOW)) zinfo.compress_type = self.compression @@ -709,12 +711,12 @@ def testFilenameTooLong(self): self.assertZipFailure('A' * 33000) def testEmptyFile(self): - support.unlink(TESTMOD) - support.create_empty_file(TESTMOD) + os_helper.unlink(TESTMOD) + os_helper.create_empty_file(TESTMOD) self.assertZipFailure(TESTMOD) def testFileUnreadable(self): - support.unlink(TESTMOD) + os_helper.unlink(TESTMOD) fd = os.open(TESTMOD, os.O_CREAT, 000) try: os.close(fd) @@ -725,10 +727,10 @@ def testFileUnreadable(self): # If we leave "the read-only bit" set on Windows, nothing can # delete TESTMOD, and later tests suffer bogus failures. os.chmod(TESTMOD, 0o666) - support.unlink(TESTMOD) + os_helper.unlink(TESTMOD) def testNotZipFile(self): - support.unlink(TESTMOD) + os_helper.unlink(TESTMOD) fp = open(TESTMOD, 'w+') fp.write('a' * 22) fp.close() @@ -736,7 +738,7 @@ def testNotZipFile(self): # XXX: disabled until this works on Big-endian machines def _testBogusZipFile(self): - support.unlink(TESTMOD) + os_helper.unlink(TESTMOD) fp = open(TESTMOD, 'w+') fp.write(struct.pack('=I', 0x06054B50)) fp.write('a' * 18) @@ -771,7 +773,7 @@ def test_main(): BadFileZipImportTestCase, ) finally: - support.unlink(TESTMOD) + os_helper.unlink(TESTMOD) if __name__ == "__main__": test_main() From 3d19985fe18a48506b97cdcfd5d46ae2401e426d Mon Sep 17 00:00:00 2001 From: Chris Jerdonek Date: Thu, 9 Jul 2020 06:27:23 -0700 Subject: [PATCH 016/197] bpo-29590: fix stack trace for gen.throw() with yield from (#19896) * Add failing test. * bpo-29590: fix stack trace for gen.throw() with yield from (GH-NNNN) When gen.throw() is called on a generator after a "yield from", the intermediate stack trace entries are lost. This commit fixes that. --- Lib/test/test_generators.py | 49 +++++++++++++++++++ .../2020-05-03-22-26-00.bpo-29590.aRz3l7.rst | 2 + Objects/genobject.c | 10 ++++ 3 files changed, 61 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index bf482213c178a5..3bf152280868e8 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -415,6 +415,55 @@ def g(): gen.throw(ValueError) +class GeneratorStackTraceTest(unittest.TestCase): + + def check_stack_names(self, frame, expected): + names = [] + while frame: + name = frame.f_code.co_name + # Stop checking frames when we get to our test helper. + if name.startswith('check_') or name.startswith('call_'): + break + + names.append(name) + frame = frame.f_back + + self.assertEqual(names, expected) + + def check_yield_from_example(self, call_method): + def f(): + self.check_stack_names(sys._getframe(), ['f', 'g']) + try: + yield + except Exception: + pass + self.check_stack_names(sys._getframe(), ['f', 'g']) + + def g(): + self.check_stack_names(sys._getframe(), ['g']) + yield from f() + self.check_stack_names(sys._getframe(), ['g']) + + gen = g() + gen.send(None) + try: + call_method(gen) + except StopIteration: + pass + + def test_send_with_yield_from(self): + def call_send(gen): + gen.send(None) + + self.check_yield_from_example(call_send) + + def test_throw_with_yield_from(self): + def call_throw(gen): + gen.throw(RuntimeError) + + self.check_yield_from_example(call_throw) + + class YieldFromTests(unittest.TestCase): def test_generator_gi_yieldfrom(self): def a(): diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst b/Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst new file mode 100644 index 00000000000000..2570c4f2c7c0fd --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst @@ -0,0 +1,2 @@ +Make the stack trace correct after calling :meth:`generator.throw` +on a generator that has yielded from a ``yield from``. diff --git a/Objects/genobject.c b/Objects/genobject.c index 6a68c9484a6ae9..a379fa6088e16a 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -415,11 +415,21 @@ _gen_throw(PyGenObject *gen, int close_on_genexit, } if (PyGen_CheckExact(yf) || PyCoro_CheckExact(yf)) { /* `yf` is a generator or a coroutine. */ + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *f = tstate->frame; + gen->gi_running = 1; + /* Since we are fast-tracking things by skipping the eval loop, + we need to update the current frame so the stack trace + will be reported correctly to the user. */ + /* XXX We should probably be updating the current frame + somewhere in ceval.c. */ + tstate->frame = gen->gi_frame; /* Close the generator that we are currently iterating with 'yield from' or awaiting on with 'await'. */ ret = _gen_throw((PyGenObject *)yf, close_on_genexit, typ, val, tb); + tstate->frame = f; gen->gi_running = 0; } else { /* `yf` is an iterator or a coroutine-like object. */ From 10a0fd679ee429de4ef3ee706c55ecf845d4a470 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 9 Jul 2020 18:52:43 +0100 Subject: [PATCH 017/197] bpo-41172: Fix check for compiler in test suite (GH-21400) --- Lib/test/support/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f8f60fb6c27b91..b21978a61cd2f1 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1673,9 +1673,15 @@ def missing_compiler_executable(cmd_names=[]): missing. """ - from distutils import ccompiler, sysconfig, spawn + from distutils import ccompiler, sysconfig, spawn, errors compiler = ccompiler.new_compiler() sysconfig.customize_compiler(compiler) + if compiler.compiler_type == "msvc": + # MSVC has no executables, so check whether initialization succeeds + try: + compiler.initialize() + except errors.DistutilsPlatformError: + return "msvc" for name in compiler.executables: if cmd_names and name not in cmd_names: continue From ae339e3e7b2593c7d5c1438595aa88dd9ae081b4 Mon Sep 17 00:00:00 2001 From: E-Paine <63801254+E-Paine@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:18:34 +0200 Subject: [PATCH 018/197] Remove trailing >>> in enum docs (GH-21358) The >>> as the last line serve no purpose and are not colored correctly by Sphinx. --- Doc/library/enum.rst | 1 - Misc/ACKS | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 4b4f5eb1944cc5..b327a0ad15f96c 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -113,7 +113,6 @@ The *type* of an enumeration member is the enumeration it belongs to:: >>> isinstance(Color.GREEN, Color) True - >>> Enum members also have a property that contains just their item name:: diff --git a/Misc/ACKS b/Misc/ACKS index 641ef0cace00e2..b585769608f4e9 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1266,6 +1266,7 @@ Richard Oudkerk Russel Owen Joonas Paalasmaa Martin Packman +Elisha Paine Shriphani Palakodety Julien Palard Aviv Palivoda From 4afdfebfb38506fba3e740e689d35a5a59d79edc Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 9 Jul 2020 18:08:33 -0400 Subject: [PATCH 019/197] bpo-37765: Add keywords to IDLE tab completions (GH-15138) Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key. Rewrite Completions doc. Co-authored-by: Cheryl Sabella --- Doc/library/idle.rst | 90 ++++++++++--------- Lib/idlelib/NEWS.txt | 3 + Lib/idlelib/autocomplete.py | 6 +- Lib/idlelib/help.html | 85 ++++++++++-------- Lib/idlelib/idle_test/test_autocomplete.py | 7 +- .../2020-07-07-18-44-30.bpo-37765.umc1o8.rst | 2 + 6 files changed, 110 insertions(+), 83 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index b1192e7bb46552..75b6fa3861b23d 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -147,7 +147,7 @@ Go to Line Clear any selection and update the line and column status. Show Completions - Open a scrollable list allowing selection of keywords and attributes. See + Open a scrollable list allowing selection of existing names. See :ref:`Completions ` in the Editing and navigation section below. Expand Word @@ -469,52 +469,58 @@ are restricted to four spaces due to Tcl/Tk limitations. See also the indent/dedent region commands on the :ref:`Format menu `. - .. _completions: 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 namespaces, 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. +Completions are supplied, when requested and available, for module +names, attributes of classes or functions, or filenames. Each request +method displays a completion box with existing names. (See tab +completions below for an exception.) For any box, change the name +being completed and the item highlighted in the box by +typing and deleting characters; by hitting :kbd:`Up`, :kbd:`Down`, +:kbd:`PageUp`, :kbd:`PageDown`, :kbd:`Home`, and :kbd:`End` keys; +and by a single click within the box. Close the box with :kbd:`Escape`, +:kbd:`Enter`, and double :kbd:`Tab` keys or clicks outside the box. +A double click within the box selects and closes. + +One way to open a box is to type a key character and wait for a +predefined interval. This defaults to 2 seconds; customize it +in the settings dialog. (To prevent auto popups, set the delay to a +large number of milliseconds, such as 100000000.) For imported module +names or class or function attributes, type '.'. +For filenames in the root directory, type :data:`os.sep` or +data:`os.altsep` immediately after an opening quote. (On Windows, +one can specify a drive first.) Move into subdirectories by typing a +directory name and a separator. + +Instead of waiting, or after a box is closed, open a completion box +immediately with Show Completions on the Edit menu. The default hot +key is :kbd:`C-space`. If one types a prefix for the desired name +before opening the box, the first match or near miss is made visible. +The result is the same as if one enters a prefix +after the box is displayed. Show Completions after a quote completes +filenames in the current directory instead of a root directory. + +Hitting :kbd:`Tab` after a prefix usually has the same effect as Show +Completions. (With no prefix, it indents.) However, if there is only +one match to the prefix, that match is immediately added to the editor +text without opening a box. + +Invoking 'Show Completions', or hitting :kbd:`Tab` after a prefix, +outside of a string and without a preceding '.' opens a box with +keywords, builtin names, and available module-level names. + +When editing code in an editor (as oppose to Shell), increase the +available module-level names by running your code +and not restarting the Shell thereafter. This is especially useful +after adding imports at the top of a file. This also increases +possible attribute completions. + +Completion boxes intially exclude names beginning with '_' or, for +modules, not included in '__all__'. The hidden names can be accessed +by typing '_' after '.', either before or after the box is opened. .. _calltips: diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 7ae29af0b30ce3..1c5c03da86efc5 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-37765: Add keywords to module name completion list. Rewrite +Completions section of IDLE doc. + bpo-41152: The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is now always UTF-8. diff --git a/Lib/idlelib/autocomplete.py b/Lib/idlelib/autocomplete.py index c623d45a153423..e1e9e17311eda1 100644 --- a/Lib/idlelib/autocomplete.py +++ b/Lib/idlelib/autocomplete.py @@ -4,6 +4,7 @@ pop up a list of candidates. """ import __main__ +import keyword import os import string import sys @@ -171,10 +172,13 @@ def fetch_completions(self, what, mode): (what, mode), {}) else: if mode == ATTRS: - if what == "": + if what == "": # Main module names. namespace = {**__main__.__builtins__.__dict__, **__main__.__dict__} bigl = eval("dir()", namespace) + kwds = (s for s in keyword.kwlist + if s not in {'True', 'False', 'None'}) + bigl.extend(kwds) bigl.sort() if "__all__" in bigl: smalll = sorted(eval("__all__", namespace)) diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index 424c6b50f339e1..81ce5100bb8ad5 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -4,7 +4,7 @@ - IDLE — Python 3.9.0a4 documentation + IDLE — Python 3.10.0a0 documentation @@ -17,7 +17,7 @@ @@ -71,7 +71,7 @@

Navigation

  • - 3.9.0a4 Documentation » + 3.10.0a0 Documentation »
  • @@ -201,7 +201,7 @@

    Edit menu (Shell and Editor)Completions in the Editing and navigation section below.

    Expand Word

    Expand a prefix you have typed to match a full word in the same window; @@ -465,38 +465,47 @@

    Automatic indentation

    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 -Tab will supply that completion without opening the ACW.

    -

    ‘Show Completions’ will force open a completions window, by default the -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 namespaces, 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 tab will -cause the longest non-ambiguous match to be entered in the Editor window or -Shell. Two 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 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.

    +

    Completions are supplied, when requested and available, for module +names, attributes of classes or functions, or filenames. Each request +method displays a completion box with existing names. (See tab +completions below for an exception.) For any box, change the name +being completed and the item highlighted in the box by +typing and deleting characters; by hitting Up, Down, +PageUp, PageDown, Home, and End keys; +and by a single click within the box. Close the box with Escape, +Enter, and double Tab keys or clicks outside the box. +A double click within the box selects and closes.

    +

    One way to open a box is to type a key character and wait for a +predefined interval. This defaults to 2 seconds; customize it +in the settings dialog. (To prevent auto popups, set the delay to a +large number of milliseconds, such as 100000000.) For imported module +names or class or function attributes, type ‘.’. +For filenames in the root directory, type os.sep or +data:os.altsep immediately after an opening quote. (On Windows, +one can specify a drive first.) Move into subdirectories by typing a +directory name and a separator.

    +

    Instead of waiting, or after a box is closed. open a completion box +immediately with Show Completions on the Edit menu. The default hot +key is C-space. If one types a prefix for the desired name +before opening the box, the first match is displayed. +The result is the same as if one enters a prefix +after the box is displayed. Show Completions after a quote completes +filenames in the current directory instead of a root directory.

    +

    Hitting Tab after a prefix usually has the same effect as Show +Completions. (With no prefix, it indents.) However, if there is only +one match to the prefix, that match is immediately added to the editor +text without opening a box.

    +

    Invoking ‘Show Completions’, or hitting Tab after a prefix, +outside of a string and without a preceding ‘.’ opens a box with +keywords, builtin names, and available module-level names.

    +

    When editing code in an editor (as oppose to Shell), increase the +available module-level names by running your code +and not restarting the Shell thereafter. This is especially useful +after adding imports at the top of a file. This also increases +possible attribute completions.

    +

    Completion boxes intially exclude names beginning with ‘_’ or, for +modules, not included in ‘__all__’. The hidden names can be accessed +by typing ‘_’ after ‘.’, either before or after the box is opened.

    Calltips

    @@ -935,7 +944,7 @@

    Navigation

  • - 3.9.0a4 Documentation » + 3.10.0a0 Documentation »
  • @@ -966,7 +975,7 @@

    Navigation



    - Last updated on Mar 07, 2020. + Last updated on Jul 08, 2020. Found a bug?
    diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py index 1841495fcf1a0c..9c113bd893f137 100644 --- a/Lib/idlelib/idle_test/test_autocomplete.py +++ b/Lib/idlelib/idle_test/test_autocomplete.py @@ -240,8 +240,11 @@ def test_fetch_completions(self): with patch.dict('__main__.__dict__', {'__all__': ['a', 'b']}): s, b = acp.fetch_completions('', ac.ATTRS) self.assertEqual(s, ['a', 'b']) - self.assertIn('__name__', b) # From __main__.__dict__ - self.assertIn('sum', b) # From __main__.__builtins__.__dict__ + self.assertIn('__name__', b) # From __main__.__dict__. + self.assertIn('sum', b) # From __main__.__builtins__.__dict__. + self.assertIn('nonlocal', b) # From keyword.kwlist. + pos = b.index('False') # Test False not included twice. + self.assertNotEqual(b[pos+1], 'False') # Test attributes with name entity. mock = Mock() diff --git a/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst b/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst new file mode 100644 index 00000000000000..f8b53ca482a21e --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst @@ -0,0 +1,2 @@ +Add keywords to module name completion list. Rewrite Completions +section of IDLE doc. From 8b69fa92fd65ee84ae9312600f54a36ceed863e1 Mon Sep 17 00:00:00 2001 From: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> Date: Thu, 9 Jul 2020 21:36:35 -0300 Subject: [PATCH 020/197] bpo-23802: patch: __deepcopy__ memo dict argument usage (GH-21326) * Clarify __deepcopy__ memo dict argument usage * Add full stop --- Doc/library/copy.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index a8e8bfb1e832bb..176e01db6f9faf 100644 --- a/Doc/library/copy.rst +++ b/Doc/library/copy.rst @@ -86,6 +86,7 @@ The latter is called to implement the deep copy operation; it is passed one argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` implementation needs to make a deep copy of a component, it should call the :func:`deepcopy` function with the component as first argument and the memo dictionary as second argument. +The memo dictionary should be treated as an opaque object. .. seealso:: From 34e0077ec2ffe2a408c07acd9a79f995f90e2d0d Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 10 Jul 2020 10:12:04 +0300 Subject: [PATCH 021/197] bpo-41263: Convert code.__new__ to Argument Clinic (GH-21426) --- Objects/clinic/codeobject.c.h | 138 +++++++++++++++++++++++++++++++++- Objects/codeobject.c | 73 +++++++++--------- 2 files changed, 173 insertions(+), 38 deletions(-) diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index aef505ffc3f612..c7395375e64692 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -2,6 +2,142 @@ preserve [clinic start generated code]*/ +PyDoc_STRVAR(code_new__doc__, +"code(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize,\n" +" flags, codestring, constants, names, varnames, filename, name,\n" +" firstlineno, lnotab, freevars=(), cellvars=(), /)\n" +"--\n" +"\n" +"Create a code object. Not for the faint of heart."); + +static PyObject * +code_new_impl(PyTypeObject *type, int argcount, int posonlyargcount, + int kwonlyargcount, int nlocals, int stacksize, int flags, + PyObject *code, PyObject *consts, PyObject *names, + PyObject *varnames, PyObject *filename, PyObject *name, + int firstlineno, PyObject *lnotab, PyObject *freevars, + PyObject *cellvars); + +static PyObject * +code_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) +{ + PyObject *return_value = NULL; + int argcount; + int posonlyargcount; + int kwonlyargcount; + int nlocals; + int stacksize; + int flags; + PyObject *code; + PyObject *consts; + PyObject *names; + PyObject *varnames; + PyObject *filename; + PyObject *name; + int firstlineno; + PyObject *lnotab; + PyObject *freevars = NULL; + PyObject *cellvars = NULL; + + if ((type == &PyCode_Type) && + !_PyArg_NoKeywords("code", kwargs)) { + goto exit; + } + if (!_PyArg_CheckPositional("code", PyTuple_GET_SIZE(args), 14, 16)) { + goto exit; + } + argcount = _PyLong_AsInt(PyTuple_GET_ITEM(args, 0)); + if (argcount == -1 && PyErr_Occurred()) { + goto exit; + } + posonlyargcount = _PyLong_AsInt(PyTuple_GET_ITEM(args, 1)); + if (posonlyargcount == -1 && PyErr_Occurred()) { + goto exit; + } + kwonlyargcount = _PyLong_AsInt(PyTuple_GET_ITEM(args, 2)); + if (kwonlyargcount == -1 && PyErr_Occurred()) { + goto exit; + } + nlocals = _PyLong_AsInt(PyTuple_GET_ITEM(args, 3)); + if (nlocals == -1 && PyErr_Occurred()) { + goto exit; + } + stacksize = _PyLong_AsInt(PyTuple_GET_ITEM(args, 4)); + if (stacksize == -1 && PyErr_Occurred()) { + goto exit; + } + flags = _PyLong_AsInt(PyTuple_GET_ITEM(args, 5)); + if (flags == -1 && PyErr_Occurred()) { + goto exit; + } + if (!PyBytes_Check(PyTuple_GET_ITEM(args, 6))) { + _PyArg_BadArgument("code", "argument 7", "bytes", PyTuple_GET_ITEM(args, 6)); + goto exit; + } + code = PyTuple_GET_ITEM(args, 6); + if (!PyTuple_Check(PyTuple_GET_ITEM(args, 7))) { + _PyArg_BadArgument("code", "argument 8", "tuple", PyTuple_GET_ITEM(args, 7)); + goto exit; + } + consts = PyTuple_GET_ITEM(args, 7); + if (!PyTuple_Check(PyTuple_GET_ITEM(args, 8))) { + _PyArg_BadArgument("code", "argument 9", "tuple", PyTuple_GET_ITEM(args, 8)); + goto exit; + } + names = PyTuple_GET_ITEM(args, 8); + if (!PyTuple_Check(PyTuple_GET_ITEM(args, 9))) { + _PyArg_BadArgument("code", "argument 10", "tuple", PyTuple_GET_ITEM(args, 9)); + goto exit; + } + varnames = PyTuple_GET_ITEM(args, 9); + if (!PyUnicode_Check(PyTuple_GET_ITEM(args, 10))) { + _PyArg_BadArgument("code", "argument 11", "str", PyTuple_GET_ITEM(args, 10)); + goto exit; + } + if (PyUnicode_READY(PyTuple_GET_ITEM(args, 10)) == -1) { + goto exit; + } + filename = PyTuple_GET_ITEM(args, 10); + if (!PyUnicode_Check(PyTuple_GET_ITEM(args, 11))) { + _PyArg_BadArgument("code", "argument 12", "str", PyTuple_GET_ITEM(args, 11)); + goto exit; + } + if (PyUnicode_READY(PyTuple_GET_ITEM(args, 11)) == -1) { + goto exit; + } + name = PyTuple_GET_ITEM(args, 11); + firstlineno = _PyLong_AsInt(PyTuple_GET_ITEM(args, 12)); + if (firstlineno == -1 && PyErr_Occurred()) { + goto exit; + } + if (!PyBytes_Check(PyTuple_GET_ITEM(args, 13))) { + _PyArg_BadArgument("code", "argument 14", "bytes", PyTuple_GET_ITEM(args, 13)); + goto exit; + } + lnotab = PyTuple_GET_ITEM(args, 13); + if (PyTuple_GET_SIZE(args) < 15) { + goto skip_optional; + } + if (!PyTuple_Check(PyTuple_GET_ITEM(args, 14))) { + _PyArg_BadArgument("code", "argument 15", "tuple", PyTuple_GET_ITEM(args, 14)); + goto exit; + } + freevars = PyTuple_GET_ITEM(args, 14); + if (PyTuple_GET_SIZE(args) < 16) { + goto skip_optional; + } + if (!PyTuple_Check(PyTuple_GET_ITEM(args, 15))) { + _PyArg_BadArgument("code", "argument 16", "tuple", PyTuple_GET_ITEM(args, 15)); + goto exit; + } + cellvars = PyTuple_GET_ITEM(args, 15); +skip_optional: + return_value = code_new_impl(type, argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, code, consts, names, varnames, filename, name, firstlineno, lnotab, freevars, cellvars); + +exit: + return return_value; +} + PyDoc_STRVAR(code_replace__doc__, "replace($self, /, *, co_argcount=-1, co_posonlyargcount=-1,\n" " co_kwonlyargcount=-1, co_nlocals=-1, co_stacksize=-1,\n" @@ -218,4 +354,4 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=f9f23e912a3955b9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=18c31941ec09e9ca input=a9049054013a1b77]*/ diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 49011db1014e7d..4ca22fc5029b82 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -442,46 +442,45 @@ validate_and_copy_tuple(PyObject *tup) return newtuple; } -PyDoc_STRVAR(code_doc, -"code(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize,\n\ - flags, codestring, constants, names, varnames, filename, name,\n\ - firstlineno, lnotab[, freevars[, cellvars]])\n\ -\n\ -Create a code object. Not for the faint of heart."); +/*[clinic input] +@classmethod +code.__new__ as code_new + + argcount: int + posonlyargcount: int + kwonlyargcount: int + nlocals: int + stacksize: int + flags: int + codestring as code: object(subclass_of="&PyBytes_Type") + constants as consts: object(subclass_of="&PyTuple_Type") + names: object(subclass_of="&PyTuple_Type") + varnames: object(subclass_of="&PyTuple_Type") + filename: unicode + name: unicode + firstlineno: int + lnotab: object(subclass_of="&PyBytes_Type") + freevars: object(subclass_of="&PyTuple_Type", c_default="NULL") = () + cellvars: object(subclass_of="&PyTuple_Type", c_default="NULL") = () + / + +Create a code object. Not for the faint of heart. +[clinic start generated code]*/ static PyObject * -code_new(PyTypeObject *type, PyObject *args, PyObject *kw) +code_new_impl(PyTypeObject *type, int argcount, int posonlyargcount, + int kwonlyargcount, int nlocals, int stacksize, int flags, + PyObject *code, PyObject *consts, PyObject *names, + PyObject *varnames, PyObject *filename, PyObject *name, + int firstlineno, PyObject *lnotab, PyObject *freevars, + PyObject *cellvars) +/*[clinic end generated code: output=612aac5395830184 input=85e678ea4178f234]*/ { - int argcount; - int posonlyargcount; - int kwonlyargcount; - int nlocals; - int stacksize; - int flags; PyObject *co = NULL; - PyObject *code; - PyObject *consts; - PyObject *names, *ournames = NULL; - PyObject *varnames, *ourvarnames = NULL; - PyObject *freevars = NULL, *ourfreevars = NULL; - PyObject *cellvars = NULL, *ourcellvars = NULL; - PyObject *filename; - PyObject *name; - int firstlineno; - PyObject *lnotab; - - if (!PyArg_ParseTuple(args, "iiiiiiSO!O!O!UUiS|O!O!:code", - &argcount, &posonlyargcount, &kwonlyargcount, - &nlocals, &stacksize, &flags, - &code, - &PyTuple_Type, &consts, - &PyTuple_Type, &names, - &PyTuple_Type, &varnames, - &filename, &name, - &firstlineno, &lnotab, - &PyTuple_Type, &freevars, - &PyTuple_Type, &cellvars)) - return NULL; + PyObject *ournames = NULL; + PyObject *ourvarnames = NULL; + PyObject *ourfreevars = NULL; + PyObject *ourcellvars = NULL; if (PySys_Audit("code.__new__", "OOOiiiiii", code, filename, name, argcount, posonlyargcount, @@ -963,7 +962,7 @@ PyTypeObject PyCode_Type = { 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ - code_doc, /* tp_doc */ + code_new__doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ code_richcompare, /* tp_richcompare */ From 3e15a13e72ea9aab1c4e7007adc735478f09e7d4 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 10 Jul 2020 11:17:21 +0300 Subject: [PATCH 022/197] bpo-36346: Do not use legacy Unicode C API in ctypes. (#21429) --- Modules/_ctypes/_ctypes.c | 33 ++++++++++++++------------------- Modules/_ctypes/callproc.c | 10 +++++----- Modules/_ctypes/cfield.c | 7 ++----- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index ceae67ebb16127..0ac48b92bff8ba 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1366,8 +1366,6 @@ WCharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) static int WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { - Py_ssize_t result = 0; - if (value == NULL) { PyErr_SetString(PyExc_TypeError, "can't delete attribute"); @@ -1378,29 +1376,24 @@ WCharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored "unicode string expected instead of %s instance", Py_TYPE(value)->tp_name); return -1; - } else - Py_INCREF(value); + } + Py_ssize_t size = self->b_size / sizeof(wchar_t); Py_ssize_t len = PyUnicode_AsWideChar(value, NULL, 0); if (len < 0) { return -1; } // PyUnicode_AsWideChar() returns number of wchars including trailing null byte, // when it is called with NULL. - if (((size_t)len-1) > self->b_size/sizeof(wchar_t)) { + assert(len > 0); + if (len - 1 > size) { PyErr_SetString(PyExc_ValueError, "string too long"); - result = -1; - goto done; - } - result = PyUnicode_AsWideChar(value, - (wchar_t *)self->b_ptr, - self->b_size/sizeof(wchar_t)); - if (result >= 0 && (size_t)result < self->b_size/sizeof(wchar_t)) - ((wchar_t *)self->b_ptr)[result] = (wchar_t)0; - done: - Py_DECREF(value); - - return result >= 0 ? 0 : -1; + return -1; + } + if (PyUnicode_AsWideChar(value, (wchar_t *)self->b_ptr, size) < 0) { + return -1; + } + return 0; } static PyGetSetDef WCharArray_getsets[] = { @@ -3484,10 +3477,12 @@ _validate_paramflags(PyTypeObject *type, PyObject *paramflags) for (i = 0; i < len; ++i) { PyObject *item = PyTuple_GET_ITEM(paramflags, i); int flag; - char *name; + PyObject *name = Py_None; PyObject *defval; PyObject *typ; - if (!PyArg_ParseTuple(item, "i|ZO", &flag, &name, &defval)) { + if (!PyArg_ParseTuple(item, "i|OO", &flag, &name, &defval) || + !(name == Py_None || PyUnicode_Check(name))) + { PyErr_SetString(PyExc_TypeError, "paramflags must be a sequence of (int [,string [,value]]) tuples"); return 0; diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 6030cc3d43670d..261ae5ceb9e48a 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1300,7 +1300,6 @@ module. load_flags are as defined for LoadLibraryEx in the\n\ Windows API.\n"; static PyObject *load_library(PyObject *self, PyObject *args) { - const WCHAR *name; PyObject *nameobj; int load_flags = 0; HMODULE hMod; @@ -1309,14 +1308,14 @@ static PyObject *load_library(PyObject *self, PyObject *args) if (!PyArg_ParseTuple(args, "U|i:LoadLibrary", &nameobj, &load_flags)) return NULL; - name = _PyUnicode_AsUnicode(nameobj); - if (!name) - return NULL; - if (PySys_Audit("ctypes.dlopen", "O", nameobj) < 0) { return NULL; } + WCHAR *name = PyUnicode_AsWideCharString(nameobj, NULL); + if (!name) + return NULL; + Py_BEGIN_ALLOW_THREADS /* bpo-36085: Limit DLL search directories to avoid pre-loading * attacks and enable use of the AddDllDirectory function. @@ -1325,6 +1324,7 @@ static PyObject *load_library(PyObject *self, PyObject *args) err = hMod ? 0 : GetLastError(); Py_END_ALLOW_THREADS + PyMem_Free(name); if (err == ERROR_MOD_NOT_FOUND) { PyErr_Format(PyExc_FileNotFoundError, ("Could not find module '%.500S' (or one of its " diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 3a9b7119201cf0..3bd9ae438db440 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1220,11 +1220,8 @@ U_set(void *ptr, PyObject *value, Py_ssize_t length) "string too long (%zd, maximum length %zd)", size, length); return NULL; - } else if (size < length-1) - /* copy terminating NUL character if there is space */ - size += 1; - - if (PyUnicode_AsWideChar(value, (wchar_t *)ptr, size) == -1) { + } + if (PyUnicode_AsWideChar(value, (wchar_t *)ptr, length) == -1) { return NULL; } From 4cb6c2fc6858d2c00f473ecf49b161280716fea8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 10 Jul 2020 12:40:38 +0200 Subject: [PATCH 023/197] bpo-39573: Use the Py_TYPE() macro (GH-21433) Replace obj->ob_type with Py_TYPE(obj). --- Modules/_elementtree.c | 2 +- Objects/abstract.c | 4 ++-- Objects/genericaliasobject.c | 2 +- Objects/unicodeobject.c | 4 ++-- PC/_msi.c | 6 +++--- PC/winreg.c | 4 ++-- Tools/scripts/combinerefs.py | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 2c92a8aedb5a88..85fdfa7e5ed42c 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -2040,7 +2040,7 @@ element_attrib_setter(ElementObject *self, PyObject *value, void *closure) if (!PyDict_Check(value)) { PyErr_Format(PyExc_TypeError, "attrib must be dict, not %.200s", - value->ob_type->tp_name); + Py_TYPE(value)->tp_name); return -1; } if (!self->extra) { diff --git a/Objects/abstract.c b/Objects/abstract.c index 3494f33ce380ca..7bd72c9b5dcc26 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1382,7 +1382,7 @@ PyNumber_Long(PyObject *o) if (!PyLong_Check(result)) { PyErr_Format(PyExc_TypeError, "__int__ returned non-int (type %.200s)", - result->ob_type->tp_name); + Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } @@ -1391,7 +1391,7 @@ PyNumber_Long(PyObject *o) "__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_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 4d511a239063ce..87bd1ae5c1430b 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -20,7 +20,7 @@ ga_dealloc(PyObject *self) Py_XDECREF(alias->origin); Py_XDECREF(alias->args); Py_XDECREF(alias->parameters); - self->ob_type->tp_free(self); + Py_TYPE(self)->tp_free(self); } static int diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 809ed85895f86f..648dd15ca09f58 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3325,7 +3325,7 @@ _PyUnicode_WideCharString_Converter(PyObject *obj, void *ptr) } PyErr_Format(PyExc_TypeError, "argument must be str, not %.50s", - obj->ob_type->tp_name); + Py_TYPE(obj)->tp_name); return 0; } @@ -3361,7 +3361,7 @@ _PyUnicode_WideCharString_Opt_Converter(PyObject *obj, void *ptr) } PyErr_Format(PyExc_TypeError, "argument must be str or None, not %.50s", - obj->ob_type->tp_name); + Py_TYPE(obj)->tp_name); return 0; } diff --git a/PC/_msi.c b/PC/_msi.c index f725c816206e72..504899d0757b78 100644 --- a/PC/_msi.c +++ b/PC/_msi.c @@ -193,7 +193,7 @@ static FNFCIGETNEXTCABINET(cb_getnextcabinet) if (!PyBytes_Check(result)) { PyErr_Format(PyExc_TypeError, "Incorrect return type %s from getnextcabinet", - result->ob_type->tp_name); + Py_TYPE(result)->tp_name); Py_DECREF(result); return FALSE; } @@ -879,7 +879,7 @@ _msi_View_Execute(msiobj *self, PyObject *oparams) MSIHANDLE params = 0; if (oparams != Py_None) { - if (oparams->ob_type != &record_Type) { + if (!Py_IS_TYPE(oparams, &record_Type)) { PyErr_SetString(PyExc_TypeError, "Execute argument must be a record"); return NULL; } @@ -955,7 +955,7 @@ _msi_View_Modify_impl(msiobj *self, int kind, PyObject *data) { int status; - if (data->ob_type != &record_Type) { + if (!Py_IS_TYPE(data, &record_Type)) { PyErr_SetString(PyExc_TypeError, "Modify expects a record object"); return NULL; } diff --git a/PC/winreg.c b/PC/winreg.c index 7c3b2f4be85c96..b2725b857d0c22 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -112,7 +112,7 @@ typedef struct { HKEY hkey; } PyHKEYObject; -#define PyHKEY_Check(op) ((op)->ob_type == &PyHKEY_Type) +#define PyHKEY_Check(op) Py_IS_TYPE(op, &PyHKEY_Type) static char *failMsg = "bad operand type"; @@ -693,7 +693,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) PyErr_Format(PyExc_TypeError, "Objects of type '%s' can not " "be used as binary registry values", - value->ob_type->tp_name); + Py_TYPE(value)->tp_name); return FALSE; } diff --git a/Tools/scripts/combinerefs.py b/Tools/scripts/combinerefs.py index 49ccca73909fc8..848bae5658ca3a 100755 --- a/Tools/scripts/combinerefs.py +++ b/Tools/scripts/combinerefs.py @@ -33,7 +33,7 @@ if the refcount changed. -typename is object->ob_type->tp_name, extracted from the second PYTHONDUMPREFS +typename is Py_TYPE(object)->tp_name, extracted from the second PYTHONDUMPREFS output block. repr is repr(object), extracted from the first PYTHONDUMPREFS output block. From 75fec26d0e42cabe1127ad81cddcbbb31c25090d Mon Sep 17 00:00:00 2001 From: marload Date: Sat, 11 Jul 2020 00:43:31 +0900 Subject: [PATCH 024/197] Fix typo in docs: 'created by th' -> 'created by the' (GH-21384) --- Doc/library/asyncio-protocol.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst index 3079716f03ecc0..9dbd3ab46a3f68 100644 --- a/Doc/library/asyncio-protocol.rst +++ b/Doc/library/asyncio-protocol.rst @@ -993,7 +993,7 @@ loop.subprocess_exec() and SubprocessProtocol An example of a subprocess protocol used to get the output of a subprocess and to wait for the subprocess exit. -The subprocess is created by th :meth:`loop.subprocess_exec` method:: +The subprocess is created by the :meth:`loop.subprocess_exec` method:: import asyncio import sys From ae7a1492f93ff0103a160ff124682a9219a9905c Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Fri, 10 Jul 2020 11:43:37 -0600 Subject: [PATCH 025/197] bpo-20179: Convert the _overlapped module to the Argument Clinic (GH-14275) --- Modules/clinic/overlapped.c.h | 908 ++++++++++++++++++++++++++++++++++ Modules/overlapped.c | 865 +++++++++++++++++--------------- 2 files changed, 1364 insertions(+), 409 deletions(-) create mode 100644 Modules/clinic/overlapped.c.h diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h new file mode 100644 index 00000000000000..efecd9028b7760 --- /dev/null +++ b/Modules/clinic/overlapped.c.h @@ -0,0 +1,908 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +PyDoc_STRVAR(_overlapped_CreateIoCompletionPort__doc__, +"CreateIoCompletionPort($module, handle, port, key, concurrency, /)\n" +"--\n" +"\n" +"Create a completion port or register a handle with a port."); + +#define _OVERLAPPED_CREATEIOCOMPLETIONPORT_METHODDEF \ + {"CreateIoCompletionPort", (PyCFunction)(void(*)(void))_overlapped_CreateIoCompletionPort, METH_FASTCALL, _overlapped_CreateIoCompletionPort__doc__}, + +static PyObject * +_overlapped_CreateIoCompletionPort_impl(PyObject *module, HANDLE FileHandle, + HANDLE ExistingCompletionPort, + ULONG_PTR CompletionKey, + DWORD NumberOfConcurrentThreads); + +static PyObject * +_overlapped_CreateIoCompletionPort(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE FileHandle; + HANDLE ExistingCompletionPort; + ULONG_PTR CompletionKey; + DWORD NumberOfConcurrentThreads; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE""F_HANDLE""F_ULONG_PTR"k:CreateIoCompletionPort", + &FileHandle, &ExistingCompletionPort, &CompletionKey, &NumberOfConcurrentThreads)) { + goto exit; + } + return_value = _overlapped_CreateIoCompletionPort_impl(module, FileHandle, ExistingCompletionPort, CompletionKey, NumberOfConcurrentThreads); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_GetQueuedCompletionStatus__doc__, +"GetQueuedCompletionStatus($module, port, msecs, /)\n" +"--\n" +"\n" +"Get a message from completion port.\n" +"\n" +"Wait for up to msecs milliseconds."); + +#define _OVERLAPPED_GETQUEUEDCOMPLETIONSTATUS_METHODDEF \ + {"GetQueuedCompletionStatus", (PyCFunction)(void(*)(void))_overlapped_GetQueuedCompletionStatus, METH_FASTCALL, _overlapped_GetQueuedCompletionStatus__doc__}, + +static PyObject * +_overlapped_GetQueuedCompletionStatus_impl(PyObject *module, + HANDLE CompletionPort, + DWORD Milliseconds); + +static PyObject * +_overlapped_GetQueuedCompletionStatus(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE CompletionPort; + DWORD Milliseconds; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"k:GetQueuedCompletionStatus", + &CompletionPort, &Milliseconds)) { + goto exit; + } + return_value = _overlapped_GetQueuedCompletionStatus_impl(module, CompletionPort, Milliseconds); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_PostQueuedCompletionStatus__doc__, +"PostQueuedCompletionStatus($module, port, bytes, key, address, /)\n" +"--\n" +"\n" +"Post a message to completion port."); + +#define _OVERLAPPED_POSTQUEUEDCOMPLETIONSTATUS_METHODDEF \ + {"PostQueuedCompletionStatus", (PyCFunction)(void(*)(void))_overlapped_PostQueuedCompletionStatus, METH_FASTCALL, _overlapped_PostQueuedCompletionStatus__doc__}, + +static PyObject * +_overlapped_PostQueuedCompletionStatus_impl(PyObject *module, + HANDLE CompletionPort, + DWORD NumberOfBytes, + ULONG_PTR CompletionKey, + OVERLAPPED *Overlapped); + +static PyObject * +_overlapped_PostQueuedCompletionStatus(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE CompletionPort; + DWORD NumberOfBytes; + ULONG_PTR CompletionKey; + OVERLAPPED *Overlapped; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"k"F_ULONG_PTR""F_POINTER":PostQueuedCompletionStatus", + &CompletionPort, &NumberOfBytes, &CompletionKey, &Overlapped)) { + goto exit; + } + return_value = _overlapped_PostQueuedCompletionStatus_impl(module, CompletionPort, NumberOfBytes, CompletionKey, Overlapped); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_RegisterWaitWithQueue__doc__, +"RegisterWaitWithQueue($module, Object, CompletionPort, Overlapped,\n" +" Timeout, /)\n" +"--\n" +"\n" +"Register wait for Object; when complete CompletionPort is notified."); + +#define _OVERLAPPED_REGISTERWAITWITHQUEUE_METHODDEF \ + {"RegisterWaitWithQueue", (PyCFunction)(void(*)(void))_overlapped_RegisterWaitWithQueue, METH_FASTCALL, _overlapped_RegisterWaitWithQueue__doc__}, + +static PyObject * +_overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object, + HANDLE CompletionPort, + OVERLAPPED *Overlapped, + DWORD Milliseconds); + +static PyObject * +_overlapped_RegisterWaitWithQueue(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE Object; + HANDLE CompletionPort; + OVERLAPPED *Overlapped; + DWORD Milliseconds; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE""F_HANDLE""F_POINTER"k:RegisterWaitWithQueue", + &Object, &CompletionPort, &Overlapped, &Milliseconds)) { + goto exit; + } + return_value = _overlapped_RegisterWaitWithQueue_impl(module, Object, CompletionPort, Overlapped, Milliseconds); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_UnregisterWait__doc__, +"UnregisterWait($module, WaitHandle, /)\n" +"--\n" +"\n" +"Unregister wait handle."); + +#define _OVERLAPPED_UNREGISTERWAIT_METHODDEF \ + {"UnregisterWait", (PyCFunction)_overlapped_UnregisterWait, METH_O, _overlapped_UnregisterWait__doc__}, + +static PyObject * +_overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle); + +static PyObject * +_overlapped_UnregisterWait(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + HANDLE WaitHandle; + + if (!PyArg_Parse(arg, ""F_HANDLE":UnregisterWait", &WaitHandle)) { + goto exit; + } + return_value = _overlapped_UnregisterWait_impl(module, WaitHandle); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_UnregisterWaitEx__doc__, +"UnregisterWaitEx($module, WaitHandle, Event, /)\n" +"--\n" +"\n" +"Unregister wait handle."); + +#define _OVERLAPPED_UNREGISTERWAITEX_METHODDEF \ + {"UnregisterWaitEx", (PyCFunction)(void(*)(void))_overlapped_UnregisterWaitEx, METH_FASTCALL, _overlapped_UnregisterWaitEx__doc__}, + +static PyObject * +_overlapped_UnregisterWaitEx_impl(PyObject *module, HANDLE WaitHandle, + HANDLE Event); + +static PyObject * +_overlapped_UnregisterWaitEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE WaitHandle; + HANDLE Event; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE""F_HANDLE":UnregisterWaitEx", + &WaitHandle, &Event)) { + goto exit; + } + return_value = _overlapped_UnregisterWaitEx_impl(module, WaitHandle, Event); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_CreateEvent__doc__, +"CreateEvent($module, EventAttributes, ManualReset, InitialState, Name,\n" +" /)\n" +"--\n" +"\n" +"Create an event.\n" +"\n" +"EventAttributes must be None."); + +#define _OVERLAPPED_CREATEEVENT_METHODDEF \ + {"CreateEvent", (PyCFunction)(void(*)(void))_overlapped_CreateEvent, METH_FASTCALL, _overlapped_CreateEvent__doc__}, + +static PyObject * +_overlapped_CreateEvent_impl(PyObject *module, PyObject *EventAttributes, + BOOL ManualReset, BOOL InitialState, + const Py_UNICODE *Name); + +static PyObject * +_overlapped_CreateEvent(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *EventAttributes; + BOOL ManualReset; + BOOL InitialState; + const Py_UNICODE *Name; + + if (!_PyArg_ParseStack(args, nargs, "OiiO&:CreateEvent", + &EventAttributes, &ManualReset, &InitialState, _PyUnicode_WideCharString_Opt_Converter, &Name)) { + goto exit; + } + return_value = _overlapped_CreateEvent_impl(module, EventAttributes, ManualReset, InitialState, Name); + +exit: + /* Cleanup for Name */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)Name); + #endif /* USE_UNICODE_WCHAR_CACHE */ + + return return_value; +} + +PyDoc_STRVAR(_overlapped_SetEvent__doc__, +"SetEvent($module, Handle, /)\n" +"--\n" +"\n" +"Set event."); + +#define _OVERLAPPED_SETEVENT_METHODDEF \ + {"SetEvent", (PyCFunction)_overlapped_SetEvent, METH_O, _overlapped_SetEvent__doc__}, + +static PyObject * +_overlapped_SetEvent_impl(PyObject *module, HANDLE Handle); + +static PyObject * +_overlapped_SetEvent(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + HANDLE Handle; + + if (!PyArg_Parse(arg, ""F_HANDLE":SetEvent", &Handle)) { + goto exit; + } + return_value = _overlapped_SetEvent_impl(module, Handle); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_ResetEvent__doc__, +"ResetEvent($module, Handle, /)\n" +"--\n" +"\n" +"Reset event."); + +#define _OVERLAPPED_RESETEVENT_METHODDEF \ + {"ResetEvent", (PyCFunction)_overlapped_ResetEvent, METH_O, _overlapped_ResetEvent__doc__}, + +static PyObject * +_overlapped_ResetEvent_impl(PyObject *module, HANDLE Handle); + +static PyObject * +_overlapped_ResetEvent(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + HANDLE Handle; + + if (!PyArg_Parse(arg, ""F_HANDLE":ResetEvent", &Handle)) { + goto exit; + } + return_value = _overlapped_ResetEvent_impl(module, Handle); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_BindLocal__doc__, +"BindLocal($module, handle, family, /)\n" +"--\n" +"\n" +"Bind a socket handle to an arbitrary local port.\n" +"\n" +"family should be AF_INET or AF_INET6."); + +#define _OVERLAPPED_BINDLOCAL_METHODDEF \ + {"BindLocal", (PyCFunction)(void(*)(void))_overlapped_BindLocal, METH_FASTCALL, _overlapped_BindLocal__doc__}, + +static PyObject * +_overlapped_BindLocal_impl(PyObject *module, HANDLE Socket, int Family); + +static PyObject * +_overlapped_BindLocal(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE Socket; + int Family; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"i:BindLocal", + &Socket, &Family)) { + goto exit; + } + return_value = _overlapped_BindLocal_impl(module, Socket, Family); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_FormatMessage__doc__, +"FormatMessage($module, error_code, /)\n" +"--\n" +"\n" +"Return error message for an error code."); + +#define _OVERLAPPED_FORMATMESSAGE_METHODDEF \ + {"FormatMessage", (PyCFunction)_overlapped_FormatMessage, METH_O, _overlapped_FormatMessage__doc__}, + +static PyObject * +_overlapped_FormatMessage_impl(PyObject *module, DWORD code); + +static PyObject * +_overlapped_FormatMessage(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + DWORD code; + + if (!PyArg_Parse(arg, "k:FormatMessage", &code)) { + goto exit; + } + return_value = _overlapped_FormatMessage_impl(module, code); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped__doc__, +"Overlapped(event=_overlapped.INVALID_HANDLE_VALUE)\n" +"--\n" +"\n" +"OVERLAPPED structure wrapper."); + +static PyObject * +_overlapped_Overlapped_impl(PyTypeObject *type, HANDLE event); + +static PyObject * +_overlapped_Overlapped(PyTypeObject *type, PyObject *args, PyObject *kwargs) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"event", NULL}; + static _PyArg_Parser _parser = {"|"F_HANDLE":Overlapped", _keywords, 0}; + HANDLE event = INVALID_HANDLE_VALUE; + + if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser, + &event)) { + goto exit; + } + return_value = _overlapped_Overlapped_impl(type, event); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_cancel__doc__, +"cancel($self, /)\n" +"--\n" +"\n" +"Cancel overlapped operation."); + +#define _OVERLAPPED_OVERLAPPED_CANCEL_METHODDEF \ + {"cancel", (PyCFunction)_overlapped_Overlapped_cancel, METH_NOARGS, _overlapped_Overlapped_cancel__doc__}, + +static PyObject * +_overlapped_Overlapped_cancel_impl(OverlappedObject *self); + +static PyObject * +_overlapped_Overlapped_cancel(OverlappedObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _overlapped_Overlapped_cancel_impl(self); +} + +PyDoc_STRVAR(_overlapped_Overlapped_getresult__doc__, +"getresult($self, wait=False, /)\n" +"--\n" +"\n" +"Retrieve result of operation.\n" +"\n" +"If wait is true then it blocks until the operation is finished. If wait\n" +"is false and the operation is still pending then an error is raised."); + +#define _OVERLAPPED_OVERLAPPED_GETRESULT_METHODDEF \ + {"getresult", (PyCFunction)(void(*)(void))_overlapped_Overlapped_getresult, METH_FASTCALL, _overlapped_Overlapped_getresult__doc__}, + +static PyObject * +_overlapped_Overlapped_getresult_impl(OverlappedObject *self, BOOL wait); + +static PyObject * +_overlapped_Overlapped_getresult(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + BOOL wait = FALSE; + + if (!_PyArg_ParseStack(args, nargs, "|i:getresult", + &wait)) { + goto exit; + } + return_value = _overlapped_Overlapped_getresult_impl(self, wait); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_ReadFile__doc__, +"ReadFile($self, handle, size, /)\n" +"--\n" +"\n" +"Start overlapped read."); + +#define _OVERLAPPED_OVERLAPPED_READFILE_METHODDEF \ + {"ReadFile", (PyCFunction)(void(*)(void))_overlapped_Overlapped_ReadFile, METH_FASTCALL, _overlapped_Overlapped_ReadFile__doc__}, + +static PyObject * +_overlapped_Overlapped_ReadFile_impl(OverlappedObject *self, HANDLE handle, + DWORD size); + +static PyObject * +_overlapped_Overlapped_ReadFile(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + DWORD size; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"k:ReadFile", + &handle, &size)) { + goto exit; + } + return_value = _overlapped_Overlapped_ReadFile_impl(self, handle, size); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_ReadFileInto__doc__, +"ReadFileInto($self, handle, buf, /)\n" +"--\n" +"\n" +"Start overlapped receive."); + +#define _OVERLAPPED_OVERLAPPED_READFILEINTO_METHODDEF \ + {"ReadFileInto", (PyCFunction)(void(*)(void))_overlapped_Overlapped_ReadFileInto, METH_FASTCALL, _overlapped_Overlapped_ReadFileInto__doc__}, + +static PyObject * +_overlapped_Overlapped_ReadFileInto_impl(OverlappedObject *self, + HANDLE handle, PyObject *bufobj); + +static PyObject * +_overlapped_Overlapped_ReadFileInto(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + PyObject *bufobj; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"O:ReadFileInto", + &handle, &bufobj)) { + goto exit; + } + return_value = _overlapped_Overlapped_ReadFileInto_impl(self, handle, bufobj); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_WSARecv__doc__, +"WSARecv($self, handle, size, flags=0, /)\n" +"--\n" +"\n" +"Start overlapped receive."); + +#define _OVERLAPPED_OVERLAPPED_WSARECV_METHODDEF \ + {"WSARecv", (PyCFunction)(void(*)(void))_overlapped_Overlapped_WSARecv, METH_FASTCALL, _overlapped_Overlapped_WSARecv__doc__}, + +static PyObject * +_overlapped_Overlapped_WSARecv_impl(OverlappedObject *self, HANDLE handle, + DWORD size, DWORD flags); + +static PyObject * +_overlapped_Overlapped_WSARecv(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + DWORD size; + DWORD flags = 0; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"k|k:WSARecv", + &handle, &size, &flags)) { + goto exit; + } + return_value = _overlapped_Overlapped_WSARecv_impl(self, handle, size, flags); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_WSARecvInto__doc__, +"WSARecvInto($self, handle, buf, flags, /)\n" +"--\n" +"\n" +"Start overlapped receive."); + +#define _OVERLAPPED_OVERLAPPED_WSARECVINTO_METHODDEF \ + {"WSARecvInto", (PyCFunction)(void(*)(void))_overlapped_Overlapped_WSARecvInto, METH_FASTCALL, _overlapped_Overlapped_WSARecvInto__doc__}, + +static PyObject * +_overlapped_Overlapped_WSARecvInto_impl(OverlappedObject *self, + HANDLE handle, PyObject *bufobj, + DWORD flags); + +static PyObject * +_overlapped_Overlapped_WSARecvInto(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + PyObject *bufobj; + DWORD flags; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"Ok:WSARecvInto", + &handle, &bufobj, &flags)) { + goto exit; + } + return_value = _overlapped_Overlapped_WSARecvInto_impl(self, handle, bufobj, flags); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_WriteFile__doc__, +"WriteFile($self, handle, buf, /)\n" +"--\n" +"\n" +"Start overlapped write."); + +#define _OVERLAPPED_OVERLAPPED_WRITEFILE_METHODDEF \ + {"WriteFile", (PyCFunction)(void(*)(void))_overlapped_Overlapped_WriteFile, METH_FASTCALL, _overlapped_Overlapped_WriteFile__doc__}, + +static PyObject * +_overlapped_Overlapped_WriteFile_impl(OverlappedObject *self, HANDLE handle, + PyObject *bufobj); + +static PyObject * +_overlapped_Overlapped_WriteFile(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + PyObject *bufobj; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"O:WriteFile", + &handle, &bufobj)) { + goto exit; + } + return_value = _overlapped_Overlapped_WriteFile_impl(self, handle, bufobj); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_WSASend__doc__, +"WSASend($self, handle, buf, flags, /)\n" +"--\n" +"\n" +"Start overlapped send."); + +#define _OVERLAPPED_OVERLAPPED_WSASEND_METHODDEF \ + {"WSASend", (PyCFunction)(void(*)(void))_overlapped_Overlapped_WSASend, METH_FASTCALL, _overlapped_Overlapped_WSASend__doc__}, + +static PyObject * +_overlapped_Overlapped_WSASend_impl(OverlappedObject *self, HANDLE handle, + PyObject *bufobj, DWORD flags); + +static PyObject * +_overlapped_Overlapped_WSASend(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + PyObject *bufobj; + DWORD flags; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"Ok:WSASend", + &handle, &bufobj, &flags)) { + goto exit; + } + return_value = _overlapped_Overlapped_WSASend_impl(self, handle, bufobj, flags); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_AcceptEx__doc__, +"AcceptEx($self, listen_handle, accept_handle, /)\n" +"--\n" +"\n" +"Start overlapped wait for client to connect."); + +#define _OVERLAPPED_OVERLAPPED_ACCEPTEX_METHODDEF \ + {"AcceptEx", (PyCFunction)(void(*)(void))_overlapped_Overlapped_AcceptEx, METH_FASTCALL, _overlapped_Overlapped_AcceptEx__doc__}, + +static PyObject * +_overlapped_Overlapped_AcceptEx_impl(OverlappedObject *self, + HANDLE ListenSocket, + HANDLE AcceptSocket); + +static PyObject * +_overlapped_Overlapped_AcceptEx(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE ListenSocket; + HANDLE AcceptSocket; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE""F_HANDLE":AcceptEx", + &ListenSocket, &AcceptSocket)) { + goto exit; + } + return_value = _overlapped_Overlapped_AcceptEx_impl(self, ListenSocket, AcceptSocket); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_ConnectEx__doc__, +"ConnectEx($self, client_handle, address_as_bytes, /)\n" +"--\n" +"\n" +"Start overlapped connect.\n" +"\n" +"client_handle should be unbound."); + +#define _OVERLAPPED_OVERLAPPED_CONNECTEX_METHODDEF \ + {"ConnectEx", (PyCFunction)(void(*)(void))_overlapped_Overlapped_ConnectEx, METH_FASTCALL, _overlapped_Overlapped_ConnectEx__doc__}, + +static PyObject * +_overlapped_Overlapped_ConnectEx_impl(OverlappedObject *self, + HANDLE ConnectSocket, + PyObject *AddressObj); + +static PyObject * +_overlapped_Overlapped_ConnectEx(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE ConnectSocket; + PyObject *AddressObj; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"O!:ConnectEx", + &ConnectSocket, &PyTuple_Type, &AddressObj)) { + goto exit; + } + return_value = _overlapped_Overlapped_ConnectEx_impl(self, ConnectSocket, AddressObj); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_DisconnectEx__doc__, +"DisconnectEx($self, handle, flags, /)\n" +"--\n" +"\n"); + +#define _OVERLAPPED_OVERLAPPED_DISCONNECTEX_METHODDEF \ + {"DisconnectEx", (PyCFunction)(void(*)(void))_overlapped_Overlapped_DisconnectEx, METH_FASTCALL, _overlapped_Overlapped_DisconnectEx__doc__}, + +static PyObject * +_overlapped_Overlapped_DisconnectEx_impl(OverlappedObject *self, + HANDLE Socket, DWORD flags); + +static PyObject * +_overlapped_Overlapped_DisconnectEx(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE Socket; + DWORD flags; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"k:DisconnectEx", + &Socket, &flags)) { + goto exit; + } + return_value = _overlapped_Overlapped_DisconnectEx_impl(self, Socket, flags); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_TransmitFile__doc__, +"TransmitFile($self, socket, file, offset, offset_high, count_to_write,\n" +" count_per_send, flags, /)\n" +"--\n" +"\n" +"Transmit file data over a connected socket."); + +#define _OVERLAPPED_OVERLAPPED_TRANSMITFILE_METHODDEF \ + {"TransmitFile", (PyCFunction)(void(*)(void))_overlapped_Overlapped_TransmitFile, METH_FASTCALL, _overlapped_Overlapped_TransmitFile__doc__}, + +static PyObject * +_overlapped_Overlapped_TransmitFile_impl(OverlappedObject *self, + HANDLE Socket, HANDLE File, + DWORD offset, DWORD offset_high, + DWORD count_to_write, + DWORD count_per_send, DWORD flags); + +static PyObject * +_overlapped_Overlapped_TransmitFile(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE Socket; + HANDLE File; + DWORD offset; + DWORD offset_high; + DWORD count_to_write; + DWORD count_per_send; + DWORD flags; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE""F_HANDLE"kkkkk:TransmitFile", + &Socket, &File, &offset, &offset_high, &count_to_write, &count_per_send, &flags)) { + goto exit; + } + return_value = _overlapped_Overlapped_TransmitFile_impl(self, Socket, File, offset, offset_high, count_to_write, count_per_send, flags); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_ConnectNamedPipe__doc__, +"ConnectNamedPipe($self, handle, /)\n" +"--\n" +"\n" +"Start overlapped wait for a client to connect."); + +#define _OVERLAPPED_OVERLAPPED_CONNECTNAMEDPIPE_METHODDEF \ + {"ConnectNamedPipe", (PyCFunction)_overlapped_Overlapped_ConnectNamedPipe, METH_O, _overlapped_Overlapped_ConnectNamedPipe__doc__}, + +static PyObject * +_overlapped_Overlapped_ConnectNamedPipe_impl(OverlappedObject *self, + HANDLE Pipe); + +static PyObject * +_overlapped_Overlapped_ConnectNamedPipe(OverlappedObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + HANDLE Pipe; + + if (!PyArg_Parse(arg, ""F_HANDLE":ConnectNamedPipe", &Pipe)) { + goto exit; + } + return_value = _overlapped_Overlapped_ConnectNamedPipe_impl(self, Pipe); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_ConnectPipe__doc__, +"ConnectPipe($self, addr, /)\n" +"--\n" +"\n" +"Connect to the pipe for asynchronous I/O (overlapped)."); + +#define _OVERLAPPED_OVERLAPPED_CONNECTPIPE_METHODDEF \ + {"ConnectPipe", (PyCFunction)_overlapped_Overlapped_ConnectPipe, METH_O, _overlapped_Overlapped_ConnectPipe__doc__}, + +static PyObject * +_overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self, + const Py_UNICODE *Address); + +static PyObject * +_overlapped_Overlapped_ConnectPipe(OverlappedObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + const Py_UNICODE *Address; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("ConnectPipe", "argument", "str", arg); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + Address = _PyUnicode_AsUnicode(arg); + #else /* USE_UNICODE_WCHAR_CACHE */ + Address = PyUnicode_AsWideCharString(arg, NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (Address == NULL) { + goto exit; + } + return_value = _overlapped_Overlapped_ConnectPipe_impl(self, Address); + +exit: + /* Cleanup for Address */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)Address); + #endif /* USE_UNICODE_WCHAR_CACHE */ + + return return_value; +} + +PyDoc_STRVAR(_overlapped_WSAConnect__doc__, +"WSAConnect($module, client_handle, address_as_bytes, /)\n" +"--\n" +"\n" +"Bind a remote address to a connectionless (UDP) socket."); + +#define _OVERLAPPED_WSACONNECT_METHODDEF \ + {"WSAConnect", (PyCFunction)(void(*)(void))_overlapped_WSAConnect, METH_FASTCALL, _overlapped_WSAConnect__doc__}, + +static PyObject * +_overlapped_WSAConnect_impl(PyObject *module, HANDLE ConnectSocket, + PyObject *AddressObj); + +static PyObject * +_overlapped_WSAConnect(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE ConnectSocket; + PyObject *AddressObj; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"O:WSAConnect", + &ConnectSocket, &AddressObj)) { + goto exit; + } + return_value = _overlapped_WSAConnect_impl(module, ConnectSocket, AddressObj); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_WSASendTo__doc__, +"WSASendTo($self, handle, buf, flags, address_as_bytes, /)\n" +"--\n" +"\n" +"Start overlapped sendto over a connectionless (UDP) socket."); + +#define _OVERLAPPED_OVERLAPPED_WSASENDTO_METHODDEF \ + {"WSASendTo", (PyCFunction)(void(*)(void))_overlapped_Overlapped_WSASendTo, METH_FASTCALL, _overlapped_Overlapped_WSASendTo__doc__}, + +static PyObject * +_overlapped_Overlapped_WSASendTo_impl(OverlappedObject *self, HANDLE handle, + PyObject *bufobj, DWORD flags, + PyObject *AddressObj); + +static PyObject * +_overlapped_Overlapped_WSASendTo(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + PyObject *bufobj; + DWORD flags; + PyObject *AddressObj; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"OkO:WSASendTo", + &handle, &bufobj, &flags, &AddressObj)) { + goto exit; + } + return_value = _overlapped_Overlapped_WSASendTo_impl(self, handle, bufobj, flags, AddressObj); + +exit: + return return_value; +} + +PyDoc_STRVAR(_overlapped_Overlapped_WSARecvFrom__doc__, +"WSARecvFrom($self, handle, size, flags=0, /)\n" +"--\n" +"\n" +"Start overlapped receive."); + +#define _OVERLAPPED_OVERLAPPED_WSARECVFROM_METHODDEF \ + {"WSARecvFrom", (PyCFunction)(void(*)(void))_overlapped_Overlapped_WSARecvFrom, METH_FASTCALL, _overlapped_Overlapped_WSARecvFrom__doc__}, + +static PyObject * +_overlapped_Overlapped_WSARecvFrom_impl(OverlappedObject *self, + HANDLE handle, DWORD size, + DWORD flags); + +static PyObject * +_overlapped_Overlapped_WSARecvFrom(OverlappedObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + DWORD size; + DWORD flags = 0; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"k|k:WSARecvFrom", + &handle, &size, &flags)) { + goto exit; + } + return_value = _overlapped_Overlapped_WSARecvFrom_impl(self, handle, size, flags); + +exit: + return return_value; +} +/*[clinic end generated code: output=ee2ec2f93c8d334b input=a9049054013a1b77]*/ diff --git a/Modules/overlapped.c b/Modules/overlapped.c index eed8fbf0393002..9c4e2da9dfbd35 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -37,6 +37,36 @@ #define T_HANDLE T_POINTER +/*[python input] +class OVERLAPPED_converter(CConverter): + type = 'OVERLAPPED *' + format_unit = '"F_POINTER"' + +class HANDLE_converter(CConverter): + type = 'HANDLE' + format_unit = '"F_HANDLE"' + +class ULONG_PTR_converter(CConverter): + type = 'ULONG_PTR' + format_unit = '"F_ULONG_PTR"' + +class DWORD_converter(CConverter): + type = 'DWORD' + format_unit = 'k' + +class BOOL_converter(CConverter): + type = 'BOOL' + format_unit = 'i' +[python start generated code]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=83bb8c2c2514f2a8]*/ + +/*[clinic input] +module _overlapped +class _overlapped.Overlapped "OverlappedObject *" "&OverlappedType" +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=92e5a799db35b96c]*/ + + enum {TYPE_NONE, TYPE_NOT_STARTED, TYPE_READ, TYPE_READINTO, TYPE_WRITE, TYPE_ACCEPT, TYPE_CONNECT, TYPE_DISCONNECT, TYPE_CONNECT_NAMED_PIPE, TYPE_WAIT_NAMED_PIPE_AND_CONNECT, TYPE_TRANSMIT_FILE, TYPE_READ_FROM, @@ -150,25 +180,27 @@ initialize_function_pointers(void) * 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."); +/*[clinic input] +_overlapped.CreateIoCompletionPort + + handle as FileHandle: HANDLE + port as ExistingCompletionPort: HANDLE + key as CompletionKey: ULONG_PTR + concurrency as NumberOfConcurrentThreads: DWORD + / + +Create a completion port or register a handle with a port. +[clinic start generated code]*/ static PyObject * -overlapped_CreateIoCompletionPort(PyObject *self, PyObject *args) +_overlapped_CreateIoCompletionPort_impl(PyObject *module, HANDLE FileHandle, + HANDLE ExistingCompletionPort, + ULONG_PTR CompletionKey, + DWORD NumberOfConcurrentThreads) +/*[clinic end generated code: output=24ede2b0f05e5433 input=847bae4d0efe1976]*/ { - 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); @@ -179,26 +211,30 @@ overlapped_CreateIoCompletionPort(PyObject *self, PyObject *args) 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."); +/*[clinic input] +_overlapped.GetQueuedCompletionStatus + + port as CompletionPort: HANDLE + msecs as Milliseconds: DWORD + / + +Get a message from completion port. + +Wait for up to msecs milliseconds. +[clinic start generated code]*/ static PyObject * -overlapped_GetQueuedCompletionStatus(PyObject *self, PyObject *args) +_overlapped_GetQueuedCompletionStatus_impl(PyObject *module, + HANDLE CompletionPort, + DWORD Milliseconds) +/*[clinic end generated code: output=68314171628dddb7 input=94a042d14c4f6410]*/ { - 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); @@ -215,25 +251,28 @@ overlapped_GetQueuedCompletionStatus(PyObject *self, PyObject *args) err, NumberOfBytes, CompletionKey, Overlapped); } -PyDoc_STRVAR( - PostQueuedCompletionStatus_doc, - "PostQueuedCompletionStatus(port, bytes, key, address) -> None\n\n" - "Post a message to completion port."); +/*[clinic input] +_overlapped.PostQueuedCompletionStatus + + port as CompletionPort: HANDLE + bytes as NumberOfBytes: DWORD + key as CompletionKey: ULONG_PTR + address as Overlapped: OVERLAPPED + / + +Post a message to completion port. +[clinic start generated code]*/ static PyObject * -overlapped_PostQueuedCompletionStatus(PyObject *self, PyObject *args) +_overlapped_PostQueuedCompletionStatus_impl(PyObject *module, + HANDLE CompletionPort, + DWORD NumberOfBytes, + ULONG_PTR CompletionKey, + OVERLAPPED *Overlapped) +/*[clinic end generated code: output=93e73f2933a43e9e input=e936202d87937aca]*/ { - 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); @@ -264,26 +303,27 @@ PostToQueueCallback(PVOID lpParameter, BOOL TimerOrWaitFired) PyMem_RawFree(p); } -PyDoc_STRVAR( - RegisterWaitWithQueue_doc, - "RegisterWaitWithQueue(Object, CompletionPort, Overlapped, Timeout)\n" - " -> WaitHandle\n\n" - "Register wait for Object; when complete CompletionPort is notified.\n"); +/*[clinic input] +_overlapped.RegisterWaitWithQueue + + Object: HANDLE + CompletionPort: HANDLE + Overlapped: OVERLAPPED + Timeout as Milliseconds: DWORD + / + +Register wait for Object; when complete CompletionPort is notified. +[clinic start generated code]*/ static PyObject * -overlapped_RegisterWaitWithQueue(PyObject *self, PyObject *args) +_overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object, + HANDLE CompletionPort, + OVERLAPPED *Overlapped, + DWORD Milliseconds) +/*[clinic end generated code: output=c2ace732e447fe45 input=2dd4efee44abe8ee]*/ { 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; + struct PostCallbackData data = {CompletionPort, Overlapped}, *pdata; /* Use PyMem_RawMalloc() rather than PyMem_Malloc(), since PostToQueueCallback() will call PyMem_Free() from a new C thread @@ -306,20 +346,21 @@ overlapped_RegisterWaitWithQueue(PyObject *self, PyObject *args) return Py_BuildValue(F_HANDLE, NewWaitObject); } -PyDoc_STRVAR( - UnregisterWait_doc, - "UnregisterWait(WaitHandle) -> None\n\n" - "Unregister wait handle.\n"); +/*[clinic input] +_overlapped.UnregisterWait + + WaitHandle: HANDLE + / + +Unregister wait handle. +[clinic start generated code]*/ static PyObject * -overlapped_UnregisterWait(PyObject *self, PyObject *args) +_overlapped_UnregisterWait_impl(PyObject *module, HANDLE WaitHandle) +/*[clinic end generated code: output=ec90cd955a9a617d input=a56709544cb2df0f]*/ { - HANDLE WaitHandle; BOOL ret; - if (!PyArg_ParseTuple(args, F_HANDLE, &WaitHandle)) - return NULL; - Py_BEGIN_ALLOW_THREADS ret = UnregisterWait(WaitHandle); Py_END_ALLOW_THREADS @@ -329,20 +370,23 @@ overlapped_UnregisterWait(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR( - UnregisterWaitEx_doc, - "UnregisterWaitEx(WaitHandle, Event) -> None\n\n" - "Unregister wait handle.\n"); +/*[clinic input] +_overlapped.UnregisterWaitEx + + WaitHandle: HANDLE + Event: HANDLE + / + +Unregister wait handle. +[clinic start generated code]*/ static PyObject * -overlapped_UnregisterWaitEx(PyObject *self, PyObject *args) +_overlapped_UnregisterWaitEx_impl(PyObject *module, HANDLE WaitHandle, + HANDLE Event) +/*[clinic end generated code: output=2e3d84c1d5f65b92 input=953cddc1de50fab9]*/ { - HANDLE WaitHandle, Event; BOOL ret; - if (!PyArg_ParseTuple(args, F_HANDLE F_HANDLE, &WaitHandle, &Event)) - return NULL; - Py_BEGIN_ALLOW_THREADS ret = UnregisterWaitEx(WaitHandle, Event); Py_END_ALLOW_THREADS @@ -356,26 +400,28 @@ overlapped_UnregisterWaitEx(PyObject *self, PyObject *args) * 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"); +/*[clinic input] +_overlapped.CreateEvent + + EventAttributes: object + ManualReset: BOOL + InitialState: BOOL + Name: Py_UNICODE(accept={str, NoneType}) + / + +Create an event. + +EventAttributes must be None. +[clinic start generated code]*/ static PyObject * -overlapped_CreateEvent(PyObject *self, PyObject *args) +_overlapped_CreateEvent_impl(PyObject *module, PyObject *EventAttributes, + BOOL ManualReset, BOOL InitialState, + const Py_UNICODE *Name) +/*[clinic end generated code: output=8e04f0916c17b13d input=dbc36ae14375ba24]*/ { - 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; @@ -390,20 +436,21 @@ overlapped_CreateEvent(PyObject *self, PyObject *args) return Py_BuildValue(F_HANDLE, Event); } -PyDoc_STRVAR( - SetEvent_doc, - "SetEvent(Handle) -> None\n\n" - "Set event.\n"); +/*[clinic input] +_overlapped.SetEvent + + Handle: HANDLE + / + +Set event. +[clinic start generated code]*/ static PyObject * -overlapped_SetEvent(PyObject *self, PyObject *args) +_overlapped_SetEvent_impl(PyObject *module, HANDLE Handle) +/*[clinic end generated code: output=5b8d974216b0e569 input=d8b0d26eb7391e80]*/ { - HANDLE Handle; BOOL ret; - if (!PyArg_ParseTuple(args, F_HANDLE, &Handle)) - return NULL; - Py_BEGIN_ALLOW_THREADS ret = SetEvent(Handle); Py_END_ALLOW_THREADS @@ -413,20 +460,21 @@ overlapped_SetEvent(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR( - ResetEvent_doc, - "ResetEvent(Handle) -> None\n\n" - "Reset event.\n"); +/*[clinic input] +_overlapped.ResetEvent + + Handle: HANDLE + / + +Reset event. +[clinic start generated code]*/ static PyObject * -overlapped_ResetEvent(PyObject *self, PyObject *args) +_overlapped_ResetEvent_impl(PyObject *module, HANDLE Handle) +/*[clinic end generated code: output=066537a8405cddb2 input=d4e089c9ba84ff2f]*/ { - HANDLE Handle; BOOL ret; - if (!PyArg_ParseTuple(args, F_HANDLE, &Handle)) - return NULL; - Py_BEGIN_ALLOW_THREADS ret = ResetEvent(Handle); Py_END_ALLOW_THREADS @@ -440,36 +488,40 @@ overlapped_ResetEvent(PyObject *self, PyObject *args) * 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"); +/*[clinic input] +_overlapped.BindLocal + + handle as Socket: HANDLE + family as Family: int + / + +Bind a socket handle to an arbitrary local port. + +family should be AF_INET or AF_INET6. +[clinic start generated code]*/ static PyObject * -overlapped_BindLocal(PyObject *self, PyObject *args) +_overlapped_BindLocal_impl(PyObject *module, HANDLE Socket, int Family) +/*[clinic end generated code: output=edb93862697aed9c input=a0e7b5c2f541170c]*/ { - 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; + ret = bind((SOCKET)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; + ret = bind((SOCKET)Socket, (SOCKADDR*)&addr, sizeof(addr)) + != SOCKET_ERROR; } else { PyErr_SetString(PyExc_ValueError, "expected tuple of length 2 or 4"); return NULL; @@ -484,21 +536,23 @@ overlapped_BindLocal(PyObject *self, PyObject *args) * 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."); +/*[clinic input] +_overlapped.FormatMessage + + error_code as code: DWORD + / + +Return error message for an error code. +[clinic start generated code]*/ static PyObject * -overlapped_FormatMessage(PyObject *ignore, PyObject *args) +_overlapped_FormatMessage_impl(PyObject *module, DWORD code) +/*[clinic end generated code: output=02c964ff22407c6b input=644bb5b80326179e]*/ { - DWORD code, n; + DWORD n; WCHAR *lpMsgBuf; PyObject *res; - if (!PyArg_ParseTuple(args, F_DWORD, &code)) - return NULL; - n = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, @@ -538,19 +592,20 @@ mark_as_completed(OVERLAPPED *ov) * for overlapped I/O */ -PyDoc_STRVAR( - Overlapped_doc, - "Overlapped object"); +/*[clinic input] +@classmethod +_overlapped.Overlapped.__new__ + + event: HANDLE(c_default='INVALID_HANDLE_VALUE') = _overlapped.INVALID_HANDLE_VALUE + +OVERLAPPED structure wrapper. +[clinic start generated code]*/ static PyObject * -Overlapped_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +_overlapped_Overlapped_impl(PyTypeObject *type, HANDLE event) +/*[clinic end generated code: output=6da60504a18eb421 input=26b8a7429e629e95]*/ { 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); @@ -720,13 +775,15 @@ unparse_address(LPSOCKADDR Address, DWORD Length) } } -PyDoc_STRVAR( - Overlapped_cancel_doc, - "cancel() -> None\n\n" - "Cancel overlapped operation"); +/*[clinic input] +_overlapped.Overlapped.cancel + +Cancel overlapped operation. +[clinic start generated code]*/ static PyObject * -Overlapped_cancel(OverlappedObject *self, PyObject *Py_UNUSED(ignored)) +_overlapped_Overlapped_cancel_impl(OverlappedObject *self) +/*[clinic end generated code: output=54ad7aeece89901c input=80eb67c7b57dbcf1]*/ { BOOL ret = TRUE; @@ -749,25 +806,27 @@ Overlapped_cancel(OverlappedObject *self, PyObject *Py_UNUSED(ignored)) 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."); +/*[clinic input] +_overlapped.Overlapped.getresult + + wait: BOOL(c_default='FALSE') = False + / + +Retrieve result of operation. + +If wait is true then it blocks until the operation is finished. If wait +is false and the operation is still pending then an error is raised. +[clinic start generated code]*/ static PyObject * -Overlapped_getresult(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_getresult_impl(OverlappedObject *self, BOOL wait) +/*[clinic end generated code: output=8c9bd04d08994f6c input=aa5b03e9897ca074]*/ { - BOOL wait = FALSE; DWORD transferred = 0; BOOL ret; DWORD err; PyObject *addr; - if (!PyArg_ParseTuple(args, "|" F_BOOL, &wait)) - return NULL; - if (self->type == TYPE_NONE) { PyErr_SetString(PyExc_ValueError, "operation not yet attempted"); return NULL; @@ -879,21 +938,23 @@ do_ReadFile(OverlappedObject *self, HANDLE handle, } } -PyDoc_STRVAR( - Overlapped_ReadFile_doc, - "ReadFile(handle, size) -> Overlapped[message]\n\n" - "Start overlapped read"); +/*[clinic input] +_overlapped.Overlapped.ReadFile + + handle: HANDLE + size: DWORD + / + +Start overlapped read. +[clinic start generated code]*/ static PyObject * -Overlapped_ReadFile(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_ReadFile_impl(OverlappedObject *self, HANDLE handle, + DWORD size) +/*[clinic end generated code: output=4c8557e16941e4ae input=98c495baa0342425]*/ { - HANDLE handle; - DWORD size; PyObject *buf; - 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; @@ -913,20 +974,21 @@ Overlapped_ReadFile(OverlappedObject *self, PyObject *args) return do_ReadFile(self, handle, PyBytes_AS_STRING(buf), size); } -PyDoc_STRVAR( - Overlapped_ReadFileInto_doc, - "ReadFileInto(handle, buf) -> Overlapped[bytes_transferred]\n\n" - "Start overlapped receive"); +/*[clinic input] +_overlapped.Overlapped.ReadFileInto -static PyObject * -Overlapped_ReadFileInto(OverlappedObject *self, PyObject *args) -{ - HANDLE handle; - PyObject *bufobj; + handle: HANDLE + buf as bufobj: object + / - if (!PyArg_ParseTuple(args, F_HANDLE "O", &handle, &bufobj)) - return NULL; +Start overlapped receive. +[clinic start generated code]*/ +static PyObject * +_overlapped_Overlapped_ReadFileInto_impl(OverlappedObject *self, + HANDLE handle, PyObject *bufobj) +/*[clinic end generated code: output=1e9e712e742e5b2a input=16f6cc268d1d0387]*/ +{ if (self->type != TYPE_NONE) { PyErr_SetString(PyExc_ValueError, "operation already attempted"); return NULL; @@ -982,23 +1044,24 @@ do_WSARecv(OverlappedObject *self, HANDLE handle, } } -PyDoc_STRVAR( - Overlapped_WSARecv_doc, - "RecvFile(handle, size, flags) -> Overlapped[message]\n\n" - "Start overlapped receive"); +/*[clinic input] +_overlapped.Overlapped.WSARecv + + handle: HANDLE + size: DWORD + flags: DWORD = 0 + / + +Start overlapped receive. +[clinic start generated code]*/ static PyObject * -Overlapped_WSARecv(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_WSARecv_impl(OverlappedObject *self, HANDLE handle, + DWORD size, DWORD flags) +/*[clinic end generated code: output=3a5e9c61ff040906 input=8c04e506cc3d741a]*/ { - HANDLE handle; - DWORD size; - DWORD flags = 0; PyObject *buf; - 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; @@ -1018,22 +1081,23 @@ Overlapped_WSARecv(OverlappedObject *self, PyObject *args) return do_WSARecv(self, handle, PyBytes_AS_STRING(buf), size, flags); } -PyDoc_STRVAR( - Overlapped_WSARecvInto_doc, - "WSARecvInto(handle, buf, flags) -> Overlapped[bytes_transferred]\n\n" - "Start overlapped receive"); +/*[clinic input] +_overlapped.Overlapped.WSARecvInto -static PyObject * -Overlapped_WSARecvInto(OverlappedObject *self, PyObject *args) -{ - HANDLE handle; - PyObject *bufobj; - DWORD flags; + handle: HANDLE + buf as bufobj: object + flags: DWORD + / - if (!PyArg_ParseTuple(args, F_HANDLE "O" F_DWORD, - &handle, &bufobj, &flags)) - return NULL; +Start overlapped receive. +[clinic start generated code]*/ +static PyObject * +_overlapped_Overlapped_WSARecvInto_impl(OverlappedObject *self, + HANDLE handle, PyObject *bufobj, + DWORD flags) +/*[clinic end generated code: output=9a438abc436fe87c input=4f87c38fc381d525]*/ +{ if (self->type != TYPE_NONE) { PyErr_SetString(PyExc_ValueError, "operation already attempted"); return NULL; @@ -1057,23 +1121,25 @@ Overlapped_WSARecvInto(OverlappedObject *self, PyObject *args) (DWORD)self->user_buffer.len, flags); } -PyDoc_STRVAR( - Overlapped_WriteFile_doc, - "WriteFile(handle, buf) -> Overlapped[bytes_transferred]\n\n" - "Start overlapped write"); +/*[clinic input] +_overlapped.Overlapped.WriteFile + + handle: HANDLE + buf as bufobj: object + / + +Start overlapped write. +[clinic start generated code]*/ static PyObject * -Overlapped_WriteFile(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_WriteFile_impl(OverlappedObject *self, HANDLE handle, + PyObject *bufobj) +/*[clinic end generated code: output=c376230b6120d877 input=b8d9a7608d8a1e72]*/ { - 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; @@ -1110,26 +1176,27 @@ Overlapped_WriteFile(OverlappedObject *self, PyObject *args) } } -PyDoc_STRVAR( - Overlapped_WSASend_doc, - "WSASend(handle, buf, flags) -> Overlapped[bytes_transferred]\n\n" - "Start overlapped send"); +/*[clinic input] +_overlapped.Overlapped.WSASend + + handle: HANDLE + buf as bufobj: object + flags: DWORD + / + +Start overlapped send. +[clinic start generated code]*/ static PyObject * -Overlapped_WSASend(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_WSASend_impl(OverlappedObject *self, HANDLE handle, + PyObject *bufobj, DWORD flags) +/*[clinic end generated code: output=316031c7467040cc input=932e7cba6d18f708]*/ { - 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; @@ -1167,26 +1234,28 @@ Overlapped_WSASend(OverlappedObject *self, PyObject *args) } } -PyDoc_STRVAR( - Overlapped_AcceptEx_doc, - "AcceptEx(listen_handle, accept_handle) -> Overlapped[address_as_bytes]\n\n" - "Start overlapped wait for client to connect"); +/*[clinic input] +_overlapped.Overlapped.AcceptEx + + listen_handle as ListenSocket: HANDLE + accept_handle as AcceptSocket: HANDLE + / + +Start overlapped wait for client to connect. +[clinic start generated code]*/ static PyObject * -Overlapped_AcceptEx(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_AcceptEx_impl(OverlappedObject *self, + HANDLE ListenSocket, + HANDLE AcceptSocket) +/*[clinic end generated code: output=9a7381d4232af889 input=b83473224fc3a1c5]*/ { - 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; @@ -1198,12 +1267,13 @@ Overlapped_AcceptEx(OverlappedObject *self, PyObject *args) return NULL; self->type = TYPE_ACCEPT; - self->handle = (HANDLE)ListenSocket; + self->handle = ListenSocket; self->allocated_buffer = buf; Py_BEGIN_ALLOW_THREADS - ret = Py_AcceptEx(ListenSocket, AcceptSocket, PyBytes_AS_STRING(buf), - 0, size, size, &BytesReceived, &self->overlapped); + ret = Py_AcceptEx((SOCKET)ListenSocket, (SOCKET)AcceptSocket, + PyBytes_AS_STRING(buf), 0, size, size, &BytesReceived, + &self->overlapped); Py_END_ALLOW_THREADS self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError(); @@ -1257,28 +1327,30 @@ parse_address(PyObject *obj, SOCKADDR *Address, int 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."); +/*[clinic input] +_overlapped.Overlapped.ConnectEx + + client_handle as ConnectSocket: HANDLE + address_as_bytes as AddressObj: object(subclass_of='&PyTuple_Type') + / + +Start overlapped connect. + +client_handle should be unbound. +[clinic start generated code]*/ static PyObject * -Overlapped_ConnectEx(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_ConnectEx_impl(OverlappedObject *self, + HANDLE ConnectSocket, + PyObject *AddressObj) +/*[clinic end generated code: output=5aebbbdb4f022833 input=d6bbd2d84b156fc1]*/ { - 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!:ConnectEx", - &ConnectSocket, &PyTuple_Type, &AddressObj)) - { - return NULL; - } - if (self->type != TYPE_NONE) { PyErr_SetString(PyExc_ValueError, "operation already attempted"); return NULL; @@ -1290,10 +1362,10 @@ Overlapped_ConnectEx(OverlappedObject *self, PyObject *args) return NULL; self->type = TYPE_CONNECT; - self->handle = (HANDLE)ConnectSocket; + self->handle = ConnectSocket; Py_BEGIN_ALLOW_THREADS - ret = Py_ConnectEx(ConnectSocket, Address, Length, + ret = Py_ConnectEx((SOCKET)ConnectSocket, Address, Length, NULL, 0, NULL, &self->overlapped); Py_END_ALLOW_THREADS @@ -1308,32 +1380,33 @@ Overlapped_ConnectEx(OverlappedObject *self, PyObject *args) } } -PyDoc_STRVAR( - Overlapped_DisconnectEx_doc, - "DisconnectEx(handle, flags) -> Overlapped[None]\n\n" - "Start overlapped connect. client_handle should be unbound."); +/*[clinic input] +_overlapped.Overlapped.DisconnectEx + + handle as Socket: HANDLE + flags: DWORD + / + +[clinic start generated code]*/ static PyObject * -Overlapped_DisconnectEx(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_DisconnectEx_impl(OverlappedObject *self, + HANDLE Socket, DWORD flags) +/*[clinic end generated code: output=8d64ddb8c93c2126 input=680845cdcdf820eb]*/ { - 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; + self->handle = Socket; Py_BEGIN_ALLOW_THREADS - ret = Py_DisconnectEx(Socket, &self->overlapped, flags, 0); + ret = Py_DisconnectEx((SOCKET)Socket, &self->overlapped, flags, 0); Py_END_ALLOW_THREADS self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError(); @@ -1347,48 +1420,45 @@ Overlapped_DisconnectEx(OverlappedObject *self, PyObject *args) } } -PyDoc_STRVAR( - Overlapped_TransmitFile_doc, - "TransmitFile(socket, file, offset, offset_high, " - "count_to_write, count_per_send, flags) " - "-> Overlapped[None]\n\n" - "Transmit file data over a connected socket."); +/*[clinic input] +_overlapped.Overlapped.TransmitFile + + socket as Socket: HANDLE + file as File: HANDLE + offset: DWORD + offset_high: DWORD + count_to_write: DWORD + count_per_send: DWORD + flags: DWORD + / + +Transmit file data over a connected socket. +[clinic start generated code]*/ static PyObject * -Overlapped_TransmitFile(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_TransmitFile_impl(OverlappedObject *self, + HANDLE Socket, HANDLE File, + DWORD offset, DWORD offset_high, + DWORD count_to_write, + DWORD count_per_send, DWORD flags) +/*[clinic end generated code: output=03f3ca5512e678fd input=7e6f97b391f60e8c]*/ { - SOCKET Socket; - HANDLE File; - DWORD offset; - DWORD offset_high; - DWORD count_to_write; - DWORD count_per_send; - DWORD flags; BOOL ret; DWORD err; - if (!PyArg_ParseTuple(args, - F_HANDLE F_HANDLE F_DWORD F_DWORD - F_DWORD F_DWORD F_DWORD, - &Socket, &File, &offset, &offset_high, - &count_to_write, &count_per_send, - &flags)) - return NULL; - if (self->type != TYPE_NONE) { PyErr_SetString(PyExc_ValueError, "operation already attempted"); return NULL; } self->type = TYPE_TRANSMIT_FILE; - self->handle = (HANDLE)Socket; + self->handle = Socket; self->overlapped.Offset = offset; self->overlapped.OffsetHigh = offset_high; Py_BEGIN_ALLOW_THREADS - ret = Py_TransmitFile(Socket, File, count_to_write, count_per_send, - &self->overlapped, - NULL, flags); + ret = Py_TransmitFile((SOCKET)Socket, File, count_to_write, + count_per_send, &self->overlapped, NULL, flags); Py_END_ALLOW_THREADS self->error = err = ret ? ERROR_SUCCESS : WSAGetLastError(); @@ -1402,21 +1472,23 @@ Overlapped_TransmitFile(OverlappedObject *self, PyObject *args) } } -PyDoc_STRVAR( - Overlapped_ConnectNamedPipe_doc, - "ConnectNamedPipe(handle) -> Overlapped[None]\n\n" - "Start overlapped wait for a client to connect."); +/*[clinic input] +_overlapped.Overlapped.ConnectNamedPipe + + handle as Pipe: HANDLE + / + +Start overlapped wait for a client to connect. +[clinic start generated code]*/ static PyObject * -Overlapped_ConnectNamedPipe(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_ConnectNamedPipe_impl(OverlappedObject *self, + HANDLE Pipe) +/*[clinic end generated code: output=3e69adfe55818abe input=8b0d4cef8a72f7bc]*/ { - 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; @@ -1443,25 +1515,22 @@ Overlapped_ConnectNamedPipe(OverlappedObject *self, PyObject *args) } } -PyDoc_STRVAR( - ConnectPipe_doc, - "ConnectPipe(addr) -> pipe_handle\n\n" - "Connect to the pipe for asynchronous I/O (overlapped)."); +/*[clinic input] +_overlapped.Overlapped.ConnectPipe + + addr as Address: Py_UNICODE + / + +Connect to the pipe for asynchronous I/O (overlapped). +[clinic start generated code]*/ static PyObject * -overlapped_ConnectPipe(PyObject *self, PyObject *args) +_overlapped_Overlapped_ConnectPipe_impl(OverlappedObject *self, + const Py_UNICODE *Address) +/*[clinic end generated code: output=3cc9661667d459d4 input=167c06a274efcefc]*/ { - PyObject *AddressObj; - wchar_t *Address; HANDLE PipeHandle; - if (!PyArg_ParseTuple(args, "U", &AddressObj)) - return NULL; - - Address = PyUnicode_AsWideCharString(AddressObj, NULL); - if (Address == NULL) - return NULL; - Py_BEGIN_ALLOW_THREADS PipeHandle = CreateFileW(Address, GENERIC_READ | GENERIC_WRITE, @@ -1469,7 +1538,6 @@ overlapped_ConnectPipe(PyObject *self, PyObject *args) FILE_FLAG_OVERLAPPED, NULL); Py_END_ALLOW_THREADS - PyMem_Free(Address); if (PipeHandle == INVALID_HANDLE_VALUE) return SetFromWindowsErr(0); return Py_BuildValue(F_HANDLE, PipeHandle); @@ -1512,29 +1580,31 @@ Overlapped_traverse(OverlappedObject *self, visitproc visit, void *arg) // UDP functions -PyDoc_STRVAR( - WSAConnect_doc, - "WSAConnect(client_handle, address_as_bytes) -> Overlapped[None]\n\n" - "Bind a remote address to a connectionless (UDP) socket"); - /* * Note: WSAConnect does not support Overlapped I/O so this function should * _only_ be used for connectionless sockets (UDP). */ + +/*[clinic input] +_overlapped.WSAConnect + + client_handle as ConnectSocket: HANDLE + address_as_bytes as AddressObj: object + / + +Bind a remote address to a connectionless (UDP) socket. +[clinic start generated code]*/ + static PyObject * -overlapped_WSAConnect(PyObject *self, PyObject *args) +_overlapped_WSAConnect_impl(PyObject *module, HANDLE ConnectSocket, + PyObject *AddressObj) +/*[clinic end generated code: output=ea0b4391e94dad63 input=169f8075e9ae7fa4]*/ { - SOCKET ConnectSocket; - PyObject *AddressObj; char AddressBuf[sizeof(struct sockaddr_in6)]; SOCKADDR *Address = (SOCKADDR*)AddressBuf; int Length; int err; - if (!PyArg_ParseTuple(args, F_HANDLE "O", &ConnectSocket, &AddressObj)) { - return NULL; - } - Length = sizeof(AddressBuf); Length = parse_address(AddressObj, Address, Length); if (Length < 0) { @@ -1544,7 +1614,7 @@ overlapped_WSAConnect(PyObject *self, PyObject *args) Py_BEGIN_ALLOW_THREADS // WSAConnect does not support overlapped I/O so this call will // successfully complete immediately. - err = WSAConnect(ConnectSocket, Address, Length, + err = WSAConnect((SOCKET)ConnectSocket, Address, Length, NULL, NULL, NULL, NULL); Py_END_ALLOW_THREADS @@ -1556,19 +1626,24 @@ overlapped_WSAConnect(PyObject *self, PyObject *args) } } -PyDoc_STRVAR( - Overlapped_WSASendTo_doc, - "WSASendTo(handle, buf, flags, address_as_bytes) -> " - "Overlapped[bytes_transferred]\n\n" - "Start overlapped sendto over a connectionless (UDP) socket"); +/*[clinic input] +_overlapped.Overlapped.WSASendTo + + handle: HANDLE + buf as bufobj: object + flags: DWORD + address_as_bytes as AddressObj: object + / + +Start overlapped sendto over a connectionless (UDP) socket. +[clinic start generated code]*/ static PyObject * -Overlapped_WSASendTo(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_WSASendTo_impl(OverlappedObject *self, HANDLE handle, + PyObject *bufobj, DWORD flags, + PyObject *AddressObj) +/*[clinic end generated code: output=fe0ff55eb60d65e1 input=f709e6ecebd9bc18]*/ { - HANDLE handle; - PyObject *bufobj; - DWORD flags; - PyObject *AddressObj; char AddressBuf[sizeof(struct sockaddr_in6)]; SOCKADDR *Address = (SOCKADDR*)AddressBuf; int AddressLength; @@ -1577,12 +1652,6 @@ Overlapped_WSASendTo(OverlappedObject *self, PyObject *args) int ret; DWORD err; - if (!PyArg_ParseTuple(args, F_HANDLE "O" F_DWORD "O", - &handle, &bufobj, &flags, &AddressObj)) - { - return NULL; - } - // Parse the "to" address AddressLength = sizeof(AddressBuf); AddressLength = parse_address(AddressObj, Address, AddressLength); @@ -1637,24 +1706,29 @@ PyDoc_STRVAR( "RecvFile(handle, size, flags) -> Overlapped[(message, (host, port))]\n\n" "Start overlapped receive"); +/*[clinic input] +_overlapped.Overlapped.WSARecvFrom + + handle: HANDLE + size: DWORD + flags: DWORD = 0 + / + +Start overlapped receive. +[clinic start generated code]*/ + static PyObject * -Overlapped_WSARecvFrom(OverlappedObject *self, PyObject *args) +_overlapped_Overlapped_WSARecvFrom_impl(OverlappedObject *self, + HANDLE handle, DWORD size, + DWORD flags) +/*[clinic end generated code: output=13832a2025b86860 input=1b2663fa130e0286]*/ { - 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; @@ -1700,38 +1774,24 @@ Overlapped_WSARecvFrom(OverlappedObject *self, PyObject *args) } } +#include "clinic/overlapped.c.h" 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}, - {"ReadFileInto", (PyCFunction) Overlapped_ReadFileInto, - METH_VARARGS, Overlapped_ReadFileInto_doc}, - {"WSARecv", (PyCFunction) Overlapped_WSARecv, - METH_VARARGS, Overlapped_WSARecv_doc}, - {"WSARecvInto", (PyCFunction) Overlapped_WSARecvInto, - METH_VARARGS, Overlapped_WSARecvInto_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}, - {"TransmitFile", (PyCFunction) Overlapped_TransmitFile, - METH_VARARGS, Overlapped_TransmitFile_doc}, - {"ConnectNamedPipe", (PyCFunction) Overlapped_ConnectNamedPipe, - METH_VARARGS, Overlapped_ConnectNamedPipe_doc}, - {"WSARecvFrom", (PyCFunction) Overlapped_WSARecvFrom, - METH_VARARGS, Overlapped_WSARecvFrom_doc }, - {"WSASendTo", (PyCFunction) Overlapped_WSASendTo, - METH_VARARGS, Overlapped_WSASendTo_doc }, + _OVERLAPPED_OVERLAPPED_GETRESULT_METHODDEF + _OVERLAPPED_OVERLAPPED_CANCEL_METHODDEF + _OVERLAPPED_OVERLAPPED_READFILE_METHODDEF + _OVERLAPPED_OVERLAPPED_READFILEINTO_METHODDEF + _OVERLAPPED_OVERLAPPED_WSARECV_METHODDEF + _OVERLAPPED_OVERLAPPED_WSARECVINTO_METHODDEF + _OVERLAPPED_OVERLAPPED_WRITEFILE_METHODDEF + _OVERLAPPED_OVERLAPPED_WSASEND_METHODDEF + _OVERLAPPED_OVERLAPPED_ACCEPTEX_METHODDEF + _OVERLAPPED_OVERLAPPED_CONNECTEX_METHODDEF + _OVERLAPPED_OVERLAPPED_DISCONNECTEX_METHODDEF + _OVERLAPPED_OVERLAPPED_TRANSMITFILE_METHODDEF + _OVERLAPPED_OVERLAPPED_CONNECTNAMEDPIPE_METHODDEF + _OVERLAPPED_OVERLAPPED_WSARECVFROM_METHODDEF + _OVERLAPPED_OVERLAPPED_WSASENDTO_METHODDEF {NULL} }; @@ -1774,7 +1834,7 @@ PyTypeObject OverlappedType = { /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ Py_TPFLAGS_DEFAULT, - /* tp_doc */ "OVERLAPPED structure wrapper", + /* tp_doc */ _overlapped_Overlapped__doc__, /* tp_traverse */ (traverseproc)Overlapped_traverse, /* tp_clear */ 0, /* tp_richcompare */ 0, @@ -1791,36 +1851,23 @@ PyTypeObject OverlappedType = { /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, - /* tp_new */ Overlapped_new, + /* tp_new */ _overlapped_Overlapped, }; static PyMethodDef overlapped_functions[] = { - {"CreateIoCompletionPort", overlapped_CreateIoCompletionPort, - METH_VARARGS, CreateIoCompletionPort_doc}, - {"GetQueuedCompletionStatus", overlapped_GetQueuedCompletionStatus, - METH_VARARGS, GetQueuedCompletionStatus_doc}, - {"PostQueuedCompletionStatus", overlapped_PostQueuedCompletionStatus, - METH_VARARGS, PostQueuedCompletionStatus_doc}, - {"FormatMessage", overlapped_FormatMessage, - METH_VARARGS, FormatMessage_doc}, - {"BindLocal", overlapped_BindLocal, - METH_VARARGS, BindLocal_doc}, - {"RegisterWaitWithQueue", overlapped_RegisterWaitWithQueue, - METH_VARARGS, RegisterWaitWithQueue_doc}, - {"UnregisterWait", overlapped_UnregisterWait, - METH_VARARGS, UnregisterWait_doc}, - {"UnregisterWaitEx", overlapped_UnregisterWaitEx, - METH_VARARGS, UnregisterWaitEx_doc}, - {"CreateEvent", overlapped_CreateEvent, - METH_VARARGS, CreateEvent_doc}, - {"SetEvent", overlapped_SetEvent, - METH_VARARGS, SetEvent_doc}, - {"ResetEvent", overlapped_ResetEvent, - METH_VARARGS, ResetEvent_doc}, - {"ConnectPipe", overlapped_ConnectPipe, - METH_VARARGS, ConnectPipe_doc}, - {"WSAConnect", overlapped_WSAConnect, - METH_VARARGS, WSAConnect_doc}, + _OVERLAPPED_CREATEIOCOMPLETIONPORT_METHODDEF + _OVERLAPPED_GETQUEUEDCOMPLETIONSTATUS_METHODDEF + _OVERLAPPED_POSTQUEUEDCOMPLETIONSTATUS_METHODDEF + _OVERLAPPED_FORMATMESSAGE_METHODDEF + _OVERLAPPED_BINDLOCAL_METHODDEF + _OVERLAPPED_REGISTERWAITWITHQUEUE_METHODDEF + _OVERLAPPED_UNREGISTERWAIT_METHODDEF + _OVERLAPPED_UNREGISTERWAITEX_METHODDEF + _OVERLAPPED_CREATEEVENT_METHODDEF + _OVERLAPPED_SETEVENT_METHODDEF + _OVERLAPPED_RESETEVENT_METHODDEF + _OVERLAPPED_OVERLAPPED_CONNECTPIPE_METHODDEF + _OVERLAPPED_WSACONNECT_METHODDEF {NULL} }; From 11ce0895737bb48e4100e7f392c23a6d90abb465 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 10 Jul 2020 23:26:06 +0300 Subject: [PATCH 026/197] bpo-36346: Make using the legacy Unicode C API optional (GH-21437) Add compile time option USE_UNICODE_WCHAR_CACHE. Setting it to 0 makes the interpreter not using the wchar_t cache and the legacy Unicode C API. --- Include/cpython/unicodeobject.h | 4 +- Lib/test/support/__init__.py | 8 ++++ Lib/test/test_csv.py | 2 +- Lib/test/test_decimal.py | 5 +- Lib/test/test_getargs2.py | 4 ++ Lib/test/test_unicode.py | 4 ++ Modules/_io/fileio.c | 12 +++++ Modules/_testcapimodule.c | 16 ++++++- Modules/_winapi.c | 17 +++---- Modules/clinic/_winapi.c.h | 64 +++++++++++++++++++++----- Modules/overlapped.c | 64 ++++++++++++++++++++------ Modules/posixmodule.c | 70 ++++++++++++++++++++++++---- Objects/unicodeobject.c | 81 +++++++++++++++++++++++---------- PC/clinic/winreg.c.h | 14 +++--- PC/winreg.c | 61 +++++++++++++++++++------ Python/dynload_win.c | 10 +++- Python/fileutils.c | 23 ++++++++-- 17 files changed, 360 insertions(+), 99 deletions(-) diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index 49ad32d5d199e1..615b4a971d5f47 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -11,7 +11,9 @@ /* --- Internal Unicode Operations ---------------------------------------- */ -#define USE_UNICODE_WCHAR_CACHE 1 +#ifndef USE_UNICODE_WCHAR_CACHE +# define USE_UNICODE_WCHAR_CACHE 1 +#endif /* USE_UNICODE_WCHAR_CACHE */ /* Since splitting on whitespace is an important use case, and whitespace in most situations is solely ASCII whitespace, we diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index b21978a61cd2f1..1ce3a78fdbbe57 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -36,6 +36,11 @@ from .testresult import get_test_runner +try: + from _testcapi import unicode_legacy_string +except ImportError: + unicode_legacy_string = None + __all__ = [ # globals "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast", @@ -426,6 +431,9 @@ def requires_lzma(reason='requires lzma'): lzma = None return unittest.skipUnless(lzma, reason) +requires_legacy_unicode_capi = unittest.skipUnless(unicode_legacy_string, + 'requires legacy Unicode C API') + is_jython = sys.platform.startswith('java') is_android = hasattr(sys, 'getandroidapilevel') diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py index d421be075ca27f..a92870c24a1b45 100644 --- a/Lib/test/test_csv.py +++ b/Lib/test/test_csv.py @@ -250,9 +250,9 @@ def test_writerows_errors(self): self.assertRaises(OSError, writer.writerows, BadIterable()) @support.cpython_only + @support.requires_legacy_unicode_capi def test_writerows_legacy_strings(self): import _testcapi - c = _testcapi.unicode_legacy_string('a') with TemporaryFile("w+", newline='') as fileobj: writer = csv.writer(fileobj) diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 716e6eb7fb127e..9dbae449fb61d9 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -33,7 +33,8 @@ import numbers import locale from test.support import (run_unittest, run_doctest, is_resource_enabled, - requires_IEEE_754, requires_docstrings) + requires_IEEE_754, requires_docstrings, + requires_legacy_unicode_capi) from test.support import (TestFailed, run_with_locale, cpython_only) from test.support.import_helper import import_fresh_module @@ -582,6 +583,7 @@ def test_explicit_from_string(self): self.assertRaises(InvalidOperation, Decimal, "1_2_\u00003") @cpython_only + @requires_legacy_unicode_capi def test_from_legacy_strings(self): import _testcapi Decimal = self.decimal.Decimal @@ -2817,6 +2819,7 @@ def test_none_args(self): Overflow]) @cpython_only + @requires_legacy_unicode_capi def test_from_legacy_strings(self): import _testcapi c = self.decimal.Context() diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index d39ea56ae9e9ca..09560197913059 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -976,6 +976,7 @@ def test_et_hash(self): buf = bytearray() self.assertRaises(ValueError, getargs_et_hash, 'abc\xe9', 'latin1', buf) + @support.requires_legacy_unicode_capi def test_u(self): from _testcapi import getargs_u self.assertEqual(getargs_u('abc\xe9'), 'abc\xe9') @@ -985,6 +986,7 @@ def test_u(self): self.assertRaises(TypeError, getargs_u, memoryview(b'memoryview')) self.assertRaises(TypeError, getargs_u, None) + @support.requires_legacy_unicode_capi def test_u_hash(self): from _testcapi import getargs_u_hash self.assertEqual(getargs_u_hash('abc\xe9'), 'abc\xe9') @@ -994,6 +996,7 @@ def test_u_hash(self): self.assertRaises(TypeError, getargs_u_hash, memoryview(b'memoryview')) self.assertRaises(TypeError, getargs_u_hash, None) + @support.requires_legacy_unicode_capi def test_Z(self): from _testcapi import getargs_Z self.assertEqual(getargs_Z('abc\xe9'), 'abc\xe9') @@ -1003,6 +1006,7 @@ def test_Z(self): self.assertRaises(TypeError, getargs_Z, memoryview(b'memoryview')) self.assertIsNone(getargs_Z(None)) + @support.requires_legacy_unicode_capi def test_Z_hash(self): from _testcapi import getargs_Z_hash self.assertEqual(getargs_Z_hash('abc\xe9'), 'abc\xe9') diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index afc95555db0269..d485bc7ede2b92 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -723,6 +723,7 @@ def test_isidentifier(self): self.assertFalse("0".isidentifier()) @support.cpython_only + @support.requires_legacy_unicode_capi def test_isidentifier_legacy(self): import _testcapi u = '𝖀𝖓𝖎𝖈𝖔𝖉𝖊' @@ -2350,6 +2351,7 @@ def test_getnewargs(self): self.assertEqual(len(args), 1) @support.cpython_only + @support.requires_legacy_unicode_capi def test_resize(self): from _testcapi import getargs_u for length in range(1, 100, 7): @@ -2920,6 +2922,7 @@ def test_copycharacters(self): self.assertRaises(SystemError, unicode_copycharacters, s, 0, b'', 0, 0) @support.cpython_only + @support.requires_legacy_unicode_capi def test_encode_decimal(self): from _testcapi import unicode_encodedecimal self.assertEqual(unicode_encodedecimal('123'), @@ -2936,6 +2939,7 @@ def test_encode_decimal(self): unicode_encodedecimal, "123\u20ac", "replace") @support.cpython_only + @support.requires_legacy_unicode_capi def test_transform_decimal(self): from _testcapi import unicode_transformdecimaltoascii as transform_decimal self.assertEqual(transform_decimal('123'), diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 7c8ba37c4fe940..b9856b3b631657 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -270,7 +270,14 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, if (!PyUnicode_FSDecoder(nameobj, &stringobj)) { return -1; } +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS widename = PyUnicode_AsUnicode(stringobj); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + widename = PyUnicode_AsWideCharString(stringobj, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (widename == NULL) return -1; #else @@ -491,6 +498,11 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode, internal_close(self); done: +#ifdef MS_WINDOWS +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(widename); +#endif /* USE_UNICODE_WCHAR_CACHE */ +#endif Py_CLEAR(stringobj); return ret; } diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 1e4c31fefb206f..fca94a83a5d04e 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -1668,6 +1668,7 @@ parse_tuple_and_keywords(PyObject *self, PyObject *args) static volatile int x; +#if USE_UNICODE_WCHAR_CACHE /* Ignore use of deprecated APIs */ _Py_COMP_DIAG_PUSH _Py_COMP_DIAG_IGNORE_DEPR_DECLS @@ -1772,6 +1773,8 @@ test_Z_code(PyObject *self, PyObject *Py_UNUSED(ignored)) Py_DECREF(tuple); Py_RETURN_NONE; } +_Py_COMP_DIAG_POP +#endif /* USE_UNICODE_WCHAR_CACHE */ static PyObject * test_widechar(PyObject *self, PyObject *Py_UNUSED(ignored)) @@ -1824,6 +1827,10 @@ test_widechar(PyObject *self, PyObject *Py_UNUSED(ignored)) return raiseTestError("test_widechar", "PyUnicode_FromWideChar(L\"\\U00110000\", 1) didn't fail"); +#if USE_UNICODE_WCHAR_CACHE +/* Ignore use of deprecated APIs */ +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wide = PyUnicode_FromUnicode(invalid, 1); if (wide == NULL) PyErr_Clear(); @@ -1844,11 +1851,12 @@ test_widechar(PyObject *self, PyObject *Py_UNUSED(ignored)) return raiseTestError("test_widechar", "PyUnicode_Ready() didn't fail"); } +_Py_COMP_DIAG_POP +#endif /* USE_UNICODE_WCHAR_CACHE */ #endif Py_RETURN_NONE; } -_Py_COMP_DIAG_POP static PyObject * unicode_aswidechar(PyObject *self, PyObject *args) @@ -2024,6 +2032,7 @@ unicode_copycharacters(PyObject *self, PyObject *args) return Py_BuildValue("(Nn)", to_copy, copied); } +#if USE_UNICODE_WCHAR_CACHE /* Ignore use of deprecated APIs */ _Py_COMP_DIAG_PUSH _Py_COMP_DIAG_IGNORE_DEPR_DECLS @@ -2096,6 +2105,7 @@ unicode_legacy_string(PyObject *self, PyObject *args) return u; } _Py_COMP_DIAG_POP +#endif /* USE_UNICODE_WCHAR_CACHE */ static PyObject * getargs_w_star(PyObject *self, PyObject *args) @@ -5398,8 +5408,10 @@ static PyMethodDef TestMethods[] = { {"codec_incrementaldecoder", (PyCFunction)codec_incrementaldecoder, METH_VARARGS}, {"test_s_code", test_s_code, METH_NOARGS}, +#if USE_UNICODE_WCHAR_CACHE {"test_u_code", test_u_code, METH_NOARGS}, {"test_Z_code", test_Z_code, METH_NOARGS}, +#endif /* USE_UNICODE_WCHAR_CACHE */ {"test_widechar", test_widechar, METH_NOARGS}, {"unicode_aswidechar", unicode_aswidechar, METH_VARARGS}, {"unicode_aswidecharstring",unicode_aswidecharstring, METH_VARARGS}, @@ -5408,9 +5420,11 @@ static PyMethodDef TestMethods[] = { {"unicode_asutf8andsize", unicode_asutf8andsize, METH_VARARGS}, {"unicode_findchar", unicode_findchar, METH_VARARGS}, {"unicode_copycharacters", unicode_copycharacters, METH_VARARGS}, +#if USE_UNICODE_WCHAR_CACHE {"unicode_encodedecimal", unicode_encodedecimal, METH_VARARGS}, {"unicode_transformdecimaltoascii", unicode_transformdecimaltoascii, METH_VARARGS}, {"unicode_legacy_string", unicode_legacy_string, METH_VARARGS}, +#endif /* USE_UNICODE_WCHAR_CACHE */ {"_test_thread_state", test_thread_state, METH_VARARGS}, {"_pending_threadfunc", pending_threadfunc, METH_VARARGS}, #ifdef HAVE_GETTIMEOFDAY diff --git a/Modules/_winapi.c b/Modules/_winapi.c index e1672c478522e8..ddb11aa5a82042 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -164,10 +164,11 @@ create_converter('LPCVOID', '" F_POINTER "') create_converter('BOOL', 'i') # F_BOOL used previously (always 'i') create_converter('DWORD', 'k') # F_DWORD is always "k" (which is much shorter) create_converter('LPCTSTR', 's') -create_converter('LPCWSTR', 'u') -create_converter('LPWSTR', 'u') create_converter('UINT', 'I') # F_UINT used previously (always 'I') +class LPCWSTR_converter(Py_UNICODE_converter): + type = 'LPCWSTR' + class HANDLE_return_converter(CReturnConverter): type = 'HANDLE' @@ -197,7 +198,7 @@ class LPVOID_return_converter(CReturnConverter): data.return_conversion.append( 'return_value = HANDLE_TO_PYNUM(_return_value);\n') [python start generated code]*/ -/*[python end generated code: output=da39a3ee5e6b4b0d input=79464c61a31ae932]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=011ee0c3a2244bfe]*/ #include "clinic/_winapi.c.h" @@ -520,15 +521,15 @@ _winapi_CreateFileMapping_impl(PyObject *module, HANDLE file_handle, /*[clinic input] _winapi.CreateJunction - src_path: LPWSTR - dst_path: LPWSTR + src_path: LPCWSTR + dst_path: LPCWSTR / [clinic start generated code]*/ static PyObject * -_winapi_CreateJunction_impl(PyObject *module, LPWSTR src_path, - LPWSTR dst_path) -/*[clinic end generated code: output=66b7eb746e1dfa25 input=8cd1f9964b6e3d36]*/ +_winapi_CreateJunction_impl(PyObject *module, LPCWSTR src_path, + LPCWSTR dst_path) +/*[clinic end generated code: output=44b3f5e9bbcc4271 input=963d29b44b9384a7]*/ { /* Privilege adjustment */ HANDLE token = NULL; diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index 6022dfe0db4b28..a9630d55998d3d 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -195,8 +195,8 @@ _winapi_CreateFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t na LPCWSTR name; HANDLE _return_value; - if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "" F_POINTER "kkku:CreateFileMapping", - &file_handle, &security_attributes, &protect, &max_size_high, &max_size_low, &name)) { + if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "" F_POINTER "kkkO&:CreateFileMapping", + &file_handle, &security_attributes, &protect, &max_size_high, &max_size_low, _PyUnicode_WideCharString_Converter, &name)) { goto exit; } _return_value = _winapi_CreateFileMapping_impl(module, file_handle, security_attributes, protect, max_size_high, max_size_low, name); @@ -209,6 +209,11 @@ _winapi_CreateFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t na return_value = HANDLE_TO_PYNUM(_return_value); exit: + /* Cleanup for name */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)name); + #endif /* USE_UNICODE_WCHAR_CACHE */ + return return_value; } @@ -221,23 +226,55 @@ PyDoc_STRVAR(_winapi_CreateJunction__doc__, {"CreateJunction", (PyCFunction)(void(*)(void))_winapi_CreateJunction, METH_FASTCALL, _winapi_CreateJunction__doc__}, static PyObject * -_winapi_CreateJunction_impl(PyObject *module, LPWSTR src_path, - LPWSTR dst_path); +_winapi_CreateJunction_impl(PyObject *module, LPCWSTR src_path, + LPCWSTR dst_path); static PyObject * _winapi_CreateJunction(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - LPWSTR src_path; - LPWSTR dst_path; + LPCWSTR src_path; + LPCWSTR dst_path; - if (!_PyArg_ParseStack(args, nargs, "uu:CreateJunction", - &src_path, &dst_path)) { + if (!_PyArg_CheckPositional("CreateJunction", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("CreateJunction", "argument 1", "str", args[0]); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + src_path = _PyUnicode_AsUnicode(args[0]); + #else /* USE_UNICODE_WCHAR_CACHE */ + src_path = PyUnicode_AsWideCharString(args[0], NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (src_path == NULL) { + goto exit; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("CreateJunction", "argument 2", "str", args[1]); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + dst_path = _PyUnicode_AsUnicode(args[1]); + #else /* USE_UNICODE_WCHAR_CACHE */ + dst_path = PyUnicode_AsWideCharString(args[1], NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (dst_path == NULL) { goto exit; } return_value = _winapi_CreateJunction_impl(module, src_path, dst_path); exit: + /* Cleanup for src_path */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)src_path); + #endif /* USE_UNICODE_WCHAR_CACHE */ + /* Cleanup for dst_path */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)dst_path); + #endif /* USE_UNICODE_WCHAR_CACHE */ + return return_value; } @@ -715,8 +752,8 @@ _winapi_OpenFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t narg LPCWSTR name; HANDLE _return_value; - if (!_PyArg_ParseStack(args, nargs, "kiu:OpenFileMapping", - &desired_access, &inherit_handle, &name)) { + if (!_PyArg_ParseStack(args, nargs, "kiO&:OpenFileMapping", + &desired_access, &inherit_handle, _PyUnicode_WideCharString_Converter, &name)) { goto exit; } _return_value = _winapi_OpenFileMapping_impl(module, desired_access, inherit_handle, name); @@ -729,6 +766,11 @@ _winapi_OpenFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t narg return_value = HANDLE_TO_PYNUM(_return_value); exit: + /* Cleanup for name */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)name); + #endif /* USE_UNICODE_WCHAR_CACHE */ + return return_value; } @@ -1106,4 +1148,4 @@ _winapi_GetFileType(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P exit: return return_value; } -/*[clinic end generated code: output=db87076a32fa7abe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1f10e03f64ff9777 input=a9049054013a1b77]*/ diff --git a/Modules/overlapped.c b/Modules/overlapped.c index 9c4e2da9dfbd35..4f0ba85d7983e0 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -1291,6 +1291,7 @@ _overlapped_Overlapped_AcceptEx_impl(OverlappedObject *self, static int parse_address(PyObject *obj, SOCKADDR *Address, int Length) { + PyObject *Host_obj; Py_UNICODE *Host; unsigned short Port; unsigned long FlowInfo; @@ -1298,33 +1299,66 @@ parse_address(PyObject *obj, SOCKADDR *Address, int Length) memset(Address, 0, Length); - if (PyArg_ParseTuple(obj, "uH", &Host, &Port)) - { + switch (PyTuple_GET_SIZE(obj)) { + case 2: { + if (!PyArg_ParseTuple(obj, "UH", &Host_obj, &Port)) { + return -1; + } +#if USE_UNICODE_WCHAR_CACHE + Host = (wchar_t *)_PyUnicode_AsUnicode(Host_obj); +#else /* USE_UNICODE_WCHAR_CACHE */ + Host = PyUnicode_AsWideCharString(Host_obj, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ + if (Host == NULL) { + return -1; + } Address->sa_family = AF_INET; if (WSAStringToAddressW(Host, AF_INET, NULL, Address, &Length) < 0) { SetFromWindowsErr(WSAGetLastError()); - return -1; + Length = -1; + } + else { + ((SOCKADDR_IN*)Address)->sin_port = htons(Port); } - ((SOCKADDR_IN*)Address)->sin_port = htons(Port); +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(Host); +#endif /* USE_UNICODE_WCHAR_CACHE */ return Length; } - else if (PyArg_ParseTuple(obj, - "uHkk;ConnectEx(): illegal address_as_bytes " - "argument", &Host, &Port, &FlowInfo, &ScopeId)) - { - PyErr_Clear(); + case 4: { + if (!PyArg_ParseTuple(obj, + "UHkk;ConnectEx(): illegal address_as_bytes argument", + &Host_obj, &Port, &FlowInfo, &ScopeId)) + { + return -1; + } +#if USE_UNICODE_WCHAR_CACHE + Host = (wchar_t *)_PyUnicode_AsUnicode(Host_obj); +#else /* USE_UNICODE_WCHAR_CACHE */ + Host = PyUnicode_AsWideCharString(Host_obj, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ + if (Host == NULL) { + return -1; + } Address->sa_family = AF_INET6; if (WSAStringToAddressW(Host, AF_INET6, NULL, Address, &Length) < 0) { SetFromWindowsErr(WSAGetLastError()); - return -1; + Length = -1; + } + else { + ((SOCKADDR_IN6*)Address)->sin6_port = htons(Port); + ((SOCKADDR_IN6*)Address)->sin6_flowinfo = FlowInfo; + ((SOCKADDR_IN6*)Address)->sin6_scope_id = ScopeId; } - ((SOCKADDR_IN6*)Address)->sin6_port = htons(Port); - ((SOCKADDR_IN6*)Address)->sin6_flowinfo = FlowInfo; - ((SOCKADDR_IN6*)Address)->sin6_scope_id = ScopeId; +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(Host); +#endif /* USE_UNICODE_WCHAR_CACHE */ return Length; } - - return -1; + default: + PyErr_SetString(PyExc_ValueError, "illegal address_as_bytes argument"); + return -1; + } } /*[clinic input] diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index a411f28987ee71..efd99544f5a997 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -988,6 +988,11 @@ typedef struct { static void path_cleanup(path_t *path) { +#if !USE_UNICODE_WCHAR_CACHE + wchar_t *wide = (wchar_t *)path->wide; + path->wide = NULL; + PyMem_Free(wide); +#endif /* USE_UNICODE_WCHAR_CACHE */ Py_CLEAR(path->object); Py_CLEAR(path->cleanup); } @@ -1002,7 +1007,7 @@ path_converter(PyObject *o, void *p) const char *narrow; #ifdef MS_WINDOWS PyObject *wo = NULL; - const wchar_t *wide; + wchar_t *wide = NULL; #endif #define FORMAT_EXCEPTION(exc, fmt) \ @@ -1075,7 +1080,14 @@ path_converter(PyObject *o, void *p) if (is_unicode) { #ifdef MS_WINDOWS +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wide = PyUnicode_AsUnicodeAndSize(o, &length); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + wide = PyUnicode_AsWideCharString(o, &length); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (!wide) { goto error_exit; } @@ -1091,6 +1103,9 @@ path_converter(PyObject *o, void *p) path->wide = wide; path->narrow = FALSE; path->fd = -1; +#if !USE_UNICODE_WCHAR_CACHE + wide = NULL; +#endif /* USE_UNICODE_WCHAR_CACHE */ goto success_exit; #else if (!PyUnicode_FSConverter(o, &bytes)) { @@ -1166,7 +1181,15 @@ path_converter(PyObject *o, void *p) goto error_exit; } +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS wide = PyUnicode_AsUnicodeAndSize(wo, &length); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + wide = PyUnicode_AsWideCharString(wo, &length); + Py_DECREF(wo); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (!wide) { goto error_exit; } @@ -1180,8 +1203,12 @@ path_converter(PyObject *o, void *p) } path->wide = wide; path->narrow = TRUE; - path->cleanup = wo; Py_DECREF(bytes); +#if USE_UNICODE_WCHAR_CACHE + path->cleanup = wo; +#else /* USE_UNICODE_WCHAR_CACHE */ + wide = NULL; +#endif /* USE_UNICODE_WCHAR_CACHE */ #else path->wide = NULL; path->narrow = narrow; @@ -1205,7 +1232,11 @@ path_converter(PyObject *o, void *p) Py_XDECREF(o); Py_XDECREF(bytes); #ifdef MS_WINDOWS +#if USE_UNICODE_WCHAR_CACHE Py_XDECREF(wo); +#else /* USE_UNICODE_WCHAR_CACHE */ + PyMem_Free(wide); +#endif /* USE_UNICODE_WCHAR_CACHE */ #endif return 0; } @@ -12824,7 +12855,15 @@ DirEntry_fetch_stat(PyObject *module, DirEntry *self, int follow_symlinks) #ifdef MS_WINDOWS if (!PyUnicode_FSDecoder(self->path, &ub)) return NULL; +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS const wchar_t *path = PyUnicode_AsUnicode(ub); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + wchar_t *path = PyUnicode_AsWideCharString(ub, NULL); + Py_DECREF(ub); +#endif /* USE_UNICODE_WCHAR_CACHE */ #else /* POSIX */ if (!PyUnicode_FSConverter(self->path, &ub)) return NULL; @@ -12834,6 +12873,7 @@ DirEntry_fetch_stat(PyObject *module, DirEntry *self, int follow_symlinks) result = fstatat(self->dir_fd, path, &st, follow_symlinks ? 0 : AT_SYMLINK_NOFOLLOW); #else + Py_DECREF(ub); PyErr_SetString(PyExc_NotImplementedError, "can't fetch stat"); return NULL; #endif /* HAVE_FSTATAT */ @@ -12846,7 +12886,11 @@ DirEntry_fetch_stat(PyObject *module, DirEntry *self, int follow_symlinks) else result = LSTAT(path, &st); } +#if defined(MS_WINDOWS) && !USE_UNICODE_WCHAR_CACHE + PyMem_Free(path); +#else /* USE_UNICODE_WCHAR_CACHE */ Py_DECREF(ub); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (result != 0) return path_object_error(self->path); @@ -13035,15 +13079,24 @@ os_DirEntry_inode_impl(DirEntry *self) #ifdef MS_WINDOWS if (!self->got_file_index) { PyObject *unicode; - const wchar_t *path; STRUCT_STAT stat; int result; if (!PyUnicode_FSDecoder(self->path, &unicode)) return NULL; - path = PyUnicode_AsUnicode(unicode); +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS + const wchar_t *path = PyUnicode_AsUnicode(unicode); result = LSTAT(path, &stat); Py_DECREF(unicode); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + wchar_t *path = PyUnicode_AsWideCharString(unicode, NULL); + Py_DECREF(unicode); + result = LSTAT(path, &stat); + PyMem_Free(path); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (result != 0) return path_object_error(self->path); @@ -13597,10 +13650,9 @@ os_scandir_impl(PyObject *module, path_t *path) iterator->dirp = NULL; #endif - memcpy(&iterator->path, path, sizeof(path_t)); /* Move the ownership to iterator->path */ - path->object = NULL; - path->cleanup = NULL; + memcpy(&iterator->path, path, sizeof(path_t)); + memset(path, 0, sizeof(path_t)); #ifdef MS_WINDOWS iterator->first_time = 1; @@ -13622,9 +13674,9 @@ os_scandir_impl(PyObject *module, path_t *path) #else /* POSIX */ errno = 0; #ifdef HAVE_FDOPENDIR - if (path->fd != -1) { + if (iterator->path.fd != -1) { /* closedir() closes the FD, so we duplicate it */ - fd = _Py_dup(path->fd); + fd = _Py_dup(iterator->path.fd); if (fd == -1) goto error; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 648dd15ca09f58..2e1045ad3a7b6e 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3150,9 +3150,11 @@ unicode_get_widechar_size(PyObject *unicode) assert(unicode != NULL); assert(_PyUnicode_CHECK(unicode)); +#if USE_UNICODE_WCHAR_CACHE if (_PyUnicode_WSTR(unicode) != NULL) { return PyUnicode_WSTR_LENGTH(unicode); } +#endif /* USE_UNICODE_WCHAR_CACHE */ assert(PyUnicode_IS_READY(unicode)); res = _PyUnicode_LENGTH(unicode); @@ -3173,16 +3175,21 @@ unicode_get_widechar_size(PyObject *unicode) static void unicode_copy_as_widechar(PyObject *unicode, wchar_t *w, Py_ssize_t size) { - const wchar_t *wstr; - assert(unicode != NULL); assert(_PyUnicode_CHECK(unicode)); - wstr = _PyUnicode_WSTR(unicode); +#if USE_UNICODE_WCHAR_CACHE + const wchar_t *wstr = _PyUnicode_WSTR(unicode); if (wstr != NULL) { memcpy(w, wstr, size * sizeof(wchar_t)); return; } +#else /* USE_UNICODE_WCHAR_CACHE */ + if (PyUnicode_KIND(unicode) == sizeof(wchar_t)) { + memcpy(w, PyUnicode_DATA(unicode), size * sizeof(wchar_t)); + return; + } +#endif /* USE_UNICODE_WCHAR_CACHE */ assert(PyUnicode_IS_READY(unicode)); if (PyUnicode_KIND(unicode) == PyUnicode_1BYTE_KIND) { @@ -4378,7 +4385,6 @@ unicode_decode_call_errorhandler_wchar( Py_ssize_t requiredsize; Py_ssize_t newpos; PyObject *inputobj = NULL; - wchar_t *repwstr; Py_ssize_t repwlen; if (*errorHandler == NULL) { @@ -4424,9 +4430,19 @@ unicode_decode_call_errorhandler_wchar( goto onError; } - repwstr = PyUnicode_AsUnicodeAndSize(repunicode, &repwlen); - if (repwstr == NULL) +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS + repwlen = PyUnicode_GetSize(repunicode); + if (repwlen < 0) + goto onError; +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + repwlen = PyUnicode_AsWideChar(repunicode, NULL, 0); + if (repwlen < 0) goto onError; + repwlen--; +#endif /* USE_UNICODE_WCHAR_CACHE */ /* 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 @@ -4446,7 +4462,7 @@ unicode_decode_call_errorhandler_wchar( goto onError; } } - wcsncpy(*buf + *outpos, repwstr, repwlen); + PyUnicode_AsWideChar(repunicode, *buf + *outpos, repwlen); *outpos += repwlen; *endinpos = newpos; *inptr = *input + newpos; @@ -7748,6 +7764,7 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, /* Create a substring so that we can get the UTF-16 representation of just the slice under consideration. */ PyObject *substring; + int ret = -1; assert(len > 0); @@ -7759,11 +7776,22 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, substring = PyUnicode_Substring(unicode, offset, offset+len); if (substring == NULL) return -1; +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS p = PyUnicode_AsUnicodeAndSize(substring, &size); if (p == NULL) { Py_DECREF(substring); return -1; } +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + p = PyUnicode_AsWideCharString(substring, &size); + Py_CLEAR(substring); + if (p == NULL) { + return -1; + } +#endif /* USE_UNICODE_WCHAR_CACHE */ assert(size <= INT_MAX); /* First get the size of the result */ @@ -7775,16 +7803,15 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, goto error; /* If we used a default char, then we failed! */ if (pusedDefaultChar && *pusedDefaultChar) { - Py_DECREF(substring); - return -2; + ret = -2; + goto done; } if (*outbytes == NULL) { /* Create string object */ *outbytes = PyBytes_FromStringAndSize(NULL, outsize); if (*outbytes == NULL) { - Py_DECREF(substring); - return -1; + goto done; } out = PyBytes_AS_STRING(*outbytes); } @@ -7793,12 +7820,10 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, const Py_ssize_t n = PyBytes_Size(*outbytes); if (outsize > PY_SSIZE_T_MAX - n) { PyErr_NoMemory(); - Py_DECREF(substring); - return -1; + goto done; } if (_PyBytes_Resize(outbytes, n + outsize) < 0) { - Py_DECREF(substring); - return -1; + goto done; } out = PyBytes_AS_STRING(*outbytes) + n; } @@ -7808,19 +7833,29 @@ encode_code_page_strict(UINT code_page, PyObject **outbytes, p, (int)size, out, outsize, NULL, pusedDefaultChar); - Py_CLEAR(substring); if (outsize <= 0) goto error; - if (pusedDefaultChar && *pusedDefaultChar) - return -2; - return 0; + if (pusedDefaultChar && *pusedDefaultChar) { + ret = -2; + goto done; + } + ret = 0; + +done: +#if USE_UNICODE_WCHAR_CACHE + Py_DECREF(substring); +#else /* USE_UNICODE_WCHAR_CACHE */ + PyMem_Free(p); +#endif /* USE_UNICODE_WCHAR_CACHE */ + return ret; error: - Py_XDECREF(substring); - if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) - return -2; + if (GetLastError() == ERROR_NO_UNICODE_TRANSLATION) { + ret = -2; + goto done; + } PyErr_SetFromWindowsErr(0); - return -1; + goto done; } /* diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 3301bed9713aa9..183301f061866b 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -1143,8 +1143,7 @@ PyDoc_STRVAR(winreg_SetValue__doc__, static PyObject * winreg_SetValue_impl(PyObject *module, HKEY key, const Py_UNICODE *sub_key, - DWORD type, const Py_UNICODE *value, - Py_ssize_clean_t value_length); + DWORD type, PyObject *value_obj); static PyObject * winreg_SetValue(PyObject *module, PyObject *const *args, Py_ssize_t nargs) @@ -1153,14 +1152,13 @@ winreg_SetValue(PyObject *module, PyObject *const *args, Py_ssize_t nargs) HKEY key; const Py_UNICODE *sub_key; DWORD type; - const Py_UNICODE *value; - Py_ssize_clean_t value_length; + PyObject *value_obj; - if (!_PyArg_ParseStack(args, nargs, "O&O&ku#:SetValue", - clinic_HKEY_converter, &key, _PyUnicode_WideCharString_Opt_Converter, &sub_key, &type, &value, &value_length)) { + if (!_PyArg_ParseStack(args, nargs, "O&O&kU:SetValue", + clinic_HKEY_converter, &key, _PyUnicode_WideCharString_Opt_Converter, &sub_key, &type, &value_obj)) { goto exit; } - return_value = winreg_SetValue_impl(module, key, sub_key, type, value, value_length); + return_value = winreg_SetValue_impl(module, key, sub_key, type, value_obj); exit: /* Cleanup for sub_key */ @@ -1348,4 +1346,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=30b1311886c13907 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=497a2e804821d5c9 input=a9049054013a1b77]*/ diff --git a/PC/winreg.c b/PC/winreg.c index b2725b857d0c22..a24d784c773c02 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -640,16 +640,25 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) for (j = 0; j < i; j++) { PyObject *t; - wchar_t *wstr; Py_ssize_t len; t = PyList_GET_ITEM(value, j); if (!PyUnicode_Check(t)) return FALSE; - wstr = PyUnicode_AsUnicodeAndSize(t, &len); - if (wstr == NULL) +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS + len = PyUnicode_GetSize(t); + if (len < 0) return FALSE; - size += Py_SAFE_DOWNCAST((len + 1) * sizeof(wchar_t), + len++; +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + len = PyUnicode_AsWideChar(t, NULL, 0); + if (len < 0) + return FALSE; +#endif /* USE_UNICODE_WCHAR_CACHE */ + size += Py_SAFE_DOWNCAST(len * sizeof(wchar_t), size_t, DWORD); } @@ -665,17 +674,18 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) for (j = 0; j < i; j++) { PyObject *t; - wchar_t *wstr; Py_ssize_t len; t = PyList_GET_ITEM(value, j); - wstr = PyUnicode_AsUnicodeAndSize(t, &len); - assert(wstr); - wcscpy(P, wstr); - P += (len + 1); + assert(size > 0); + len = PyUnicode_AsWideChar(t, P, size); + assert(len >= 0); + assert(len < size); + size -= (DWORD)len + 1; + P += len + 1; } /* And doubly-terminate the list... */ - *P = '\0'; + *P = L'\0'; break; } case REG_BINARY: @@ -1669,7 +1679,7 @@ winreg.SetValue type: DWORD An integer that specifies the type of the data. Currently this must be REG_SZ, meaning only strings are supported. - value: Py_UNICODE(zeroes=True) + value as value_obj: unicode A string that specifies the new value. / @@ -1688,30 +1698,51 @@ KEY_SET_VALUE access. static PyObject * winreg_SetValue_impl(PyObject *module, HKEY key, const Py_UNICODE *sub_key, - DWORD type, const Py_UNICODE *value, - Py_ssize_clean_t value_length) -/*[clinic end generated code: output=686bedb1cbb4367b input=2cd2adab79339c53]*/ + DWORD type, PyObject *value_obj) +/*[clinic end generated code: output=d4773dc9c372311a input=bf088494ae2d24fd]*/ { + Py_ssize_t value_length; long rc; if (type != REG_SZ) { PyErr_SetString(PyExc_TypeError, "type must be winreg.REG_SZ"); return NULL; } - if ((size_t)value_length >= PY_DWORD_MAX) { + +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS + const wchar_t *value = PyUnicode_AsUnicodeAndSize(value_obj, &value_length); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + wchar_t *value = PyUnicode_AsWideCharString(value_obj, &value_length); +#endif /* USE_UNICODE_WCHAR_CACHE */ + if (value == NULL) { + return NULL; + } + if ((Py_ssize_t)(DWORD)value_length != value_length) { PyErr_SetString(PyExc_OverflowError, "value is too long"); +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(value); +#endif /* USE_UNICODE_WCHAR_CACHE */ return NULL; } if (PySys_Audit("winreg.SetValue", "nunu#", (Py_ssize_t)key, sub_key, (Py_ssize_t)type, value, value_length) < 0) { +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(value); +#endif /* USE_UNICODE_WCHAR_CACHE */ return NULL; } Py_BEGIN_ALLOW_THREADS rc = RegSetValueW(key, sub_key, REG_SZ, value, (DWORD)(value_length + 1)); Py_END_ALLOW_THREADS +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(value); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (rc != ERROR_SUCCESS) return PyErr_SetFromWindowsErrWithFunction(rc, "RegSetValue"); Py_RETURN_NONE; diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 8431c5b3b2f308..5702ab2cd71ba1 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -166,11 +166,14 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, { dl_funcptr p; char funcname[258], *import_python; - const wchar_t *wpathname; _Py_CheckPython3(); - wpathname = _PyUnicode_AsUnicode(pathname); +#if USE_UNICODE_WCHAR_CACHE + const wchar_t *wpathname = _PyUnicode_AsUnicode(pathname); +#else /* USE_UNICODE_WCHAR_CACHE */ + wchar_t *wpathname = PyUnicode_AsWideCharString(pathname, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (wpathname == NULL) return NULL; @@ -192,6 +195,9 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR); Py_END_ALLOW_THREADS +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(wpathname); +#endif /* USE_UNICODE_WCHAR_CACHE */ /* restore old error mode settings */ SetErrorMode(old_mode); diff --git a/Python/fileutils.c b/Python/fileutils.c index 2c86828ba989ac..50ef3c174acc84 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1008,15 +1008,21 @@ _Py_stat(PyObject *path, struct stat *statbuf) #ifdef MS_WINDOWS int err; struct _stat wstatbuf; - const wchar_t *wpath; - wpath = _PyUnicode_AsUnicode(path); +#if USE_UNICODE_WCHAR_CACHE + const wchar_t *wpath = _PyUnicode_AsUnicode(path); +#else /* USE_UNICODE_WCHAR_CACHE */ + wchar_t *wpath = PyUnicode_AsWideCharString(path, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (wpath == NULL) return -2; err = _wstat(wpath, &wstatbuf); if (!err) statbuf->st_mode = wstatbuf.st_mode; +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(wpath); +#endif /* USE_UNICODE_WCHAR_CACHE */ return err; #else int ret; @@ -1433,7 +1439,6 @@ _Py_fopen_obj(PyObject *path, const char *mode) FILE *f; int async_err = 0; #ifdef MS_WINDOWS - const wchar_t *wpath; wchar_t wmode[10]; int usize; @@ -1448,7 +1453,11 @@ _Py_fopen_obj(PyObject *path, const char *mode) Py_TYPE(path)); return NULL; } - wpath = _PyUnicode_AsUnicode(path); +#if USE_UNICODE_WCHAR_CACHE + const wchar_t *wpath = _PyUnicode_AsUnicode(path); +#else /* USE_UNICODE_WCHAR_CACHE */ + wchar_t *wpath = PyUnicode_AsWideCharString(path, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (wpath == NULL) return NULL; @@ -1456,6 +1465,9 @@ _Py_fopen_obj(PyObject *path, const char *mode) wmode, Py_ARRAY_LENGTH(wmode)); if (usize == 0) { PyErr_SetFromWindowsErr(0); +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(wpath); +#endif /* USE_UNICODE_WCHAR_CACHE */ return NULL; } @@ -1465,6 +1477,9 @@ _Py_fopen_obj(PyObject *path, const char *mode) Py_END_ALLOW_THREADS } while (f == NULL && errno == EINTR && !(async_err = PyErr_CheckSignals())); +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(wpath); +#endif /* USE_UNICODE_WCHAR_CACHE */ #else PyObject *bytes; const char *path_bytes; From 2a67b47757beebf9095a5e6bceed104ccba5655b Mon Sep 17 00:00:00 2001 From: Nima Dini Date: Fri, 10 Jul 2020 18:54:53 -0700 Subject: [PATCH 027/197] bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372) --- Doc/library/calendar.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 56b75ef0f850a6..c3c04db853ed2d 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -349,7 +349,7 @@ For simple text calendars this module provides the following functions. .. function:: monthcalendar(year, month) Returns a matrix representing a month's calendar. Each row represents a week; - days outside of the month a represented by zeros. Each week begins with Monday + days outside of the month are represented by zeros. Each week begins with Monday unless set by :func:`setfirstweekday`. From 57379f2f316f330204b7dd0a60051999356fef27 Mon Sep 17 00:00:00 2001 From: Sergey Golitsynskiy Date: Sat, 11 Jul 2020 19:18:31 -0400 Subject: [PATCH 028/197] Fix error in docstrings in bisect module (GH-21422) The docstrings for `bisect_right()` and `bisect_left()` contain sample code that has a bug: `a.insert(x)` should be `a.insert(i, x)`. --- Lib/bisect.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/bisect.py b/Lib/bisect.py index 8f3f6a3fe35ffe..8336a4ed9ca0f8 100644 --- a/Lib/bisect.py +++ b/Lib/bisect.py @@ -16,7 +16,7 @@ def bisect_right(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e <= x, and all e in - a[i:] have e > x. So if x already appears in the list, a.insert(x) will + a[i:] have e > x. So if x already appears in the list, a.insert(i, x) will insert just after the rightmost x already there. Optional args lo (default 0) and hi (default len(a)) bound the @@ -51,7 +51,7 @@ def bisect_left(a, x, lo=0, hi=None): """Return the index where to insert item x in list a, assuming a is sorted. The return value i is such that all e in a[:i] have e < x, and all e in - a[i:] have e >= x. So if x already appears in the list, a.insert(x) will + a[i:] have e >= x. So if x already appears in the list, a.insert(i, x) will insert just before the leftmost x already there. Optional args lo (default 0) and hi (default len(a)) bound the From 62910721f9311139919efff218cb050c2fbee614 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Sun, 12 Jul 2020 10:01:03 -0600 Subject: [PATCH 029/197] bpo-20181: Convert the readline module to the Argument Clinic (#14326) --- Modules/clinic/readline.c.h | 686 ++++++++++++++++++++++++++++++++++++ Modules/readline.c | 583 +++++++++++++++++------------- 2 files changed, 1022 insertions(+), 247 deletions(-) create mode 100644 Modules/clinic/readline.c.h diff --git a/Modules/clinic/readline.c.h b/Modules/clinic/readline.c.h new file mode 100644 index 00000000000000..80207caf071100 --- /dev/null +++ b/Modules/clinic/readline.c.h @@ -0,0 +1,686 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +PyDoc_STRVAR(readline_parse_and_bind__doc__, +"parse_and_bind($module, string, /)\n" +"--\n" +"\n" +"Execute the init line provided in the string argument."); + +#define READLINE_PARSE_AND_BIND_METHODDEF \ + {"parse_and_bind", (PyCFunction)readline_parse_and_bind, METH_O, readline_parse_and_bind__doc__}, + +PyDoc_STRVAR(readline_read_init_file__doc__, +"read_init_file($module, filename=None, /)\n" +"--\n" +"\n" +"Execute a readline initialization file.\n" +"\n" +"The default filename is the last filename used."); + +#define READLINE_READ_INIT_FILE_METHODDEF \ + {"read_init_file", (PyCFunction)(void(*)(void))readline_read_init_file, METH_FASTCALL, readline_read_init_file__doc__}, + +static PyObject * +readline_read_init_file_impl(PyObject *module, PyObject *filename_obj); + +static PyObject * +readline_read_init_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *filename_obj = Py_None; + + if (!_PyArg_CheckPositional("read_init_file", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + filename_obj = args[0]; +skip_optional: + return_value = readline_read_init_file_impl(module, filename_obj); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_read_history_file__doc__, +"read_history_file($module, filename=None, /)\n" +"--\n" +"\n" +"Load a readline history file.\n" +"\n" +"The default filename is ~/.history."); + +#define READLINE_READ_HISTORY_FILE_METHODDEF \ + {"read_history_file", (PyCFunction)(void(*)(void))readline_read_history_file, METH_FASTCALL, readline_read_history_file__doc__}, + +static PyObject * +readline_read_history_file_impl(PyObject *module, PyObject *filename_obj); + +static PyObject * +readline_read_history_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *filename_obj = Py_None; + + if (!_PyArg_CheckPositional("read_history_file", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + filename_obj = args[0]; +skip_optional: + return_value = readline_read_history_file_impl(module, filename_obj); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_write_history_file__doc__, +"write_history_file($module, filename=None, /)\n" +"--\n" +"\n" +"Save a readline history file.\n" +"\n" +"The default filename is ~/.history."); + +#define READLINE_WRITE_HISTORY_FILE_METHODDEF \ + {"write_history_file", (PyCFunction)(void(*)(void))readline_write_history_file, METH_FASTCALL, readline_write_history_file__doc__}, + +static PyObject * +readline_write_history_file_impl(PyObject *module, PyObject *filename_obj); + +static PyObject * +readline_write_history_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *filename_obj = Py_None; + + if (!_PyArg_CheckPositional("write_history_file", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + filename_obj = args[0]; +skip_optional: + return_value = readline_write_history_file_impl(module, filename_obj); + +exit: + return return_value; +} + +#if defined(HAVE_RL_APPEND_HISTORY) + +PyDoc_STRVAR(readline_append_history_file__doc__, +"append_history_file($module, nelements, filename=None, /)\n" +"--\n" +"\n" +"Append the last nelements items of the history list to file.\n" +"\n" +"The default filename is ~/.history."); + +#define READLINE_APPEND_HISTORY_FILE_METHODDEF \ + {"append_history_file", (PyCFunction)(void(*)(void))readline_append_history_file, METH_FASTCALL, readline_append_history_file__doc__}, + +static PyObject * +readline_append_history_file_impl(PyObject *module, int nelements, + PyObject *filename_obj); + +static PyObject * +readline_append_history_file(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int nelements; + PyObject *filename_obj = Py_None; + + if (!_PyArg_CheckPositional("append_history_file", nargs, 1, 2)) { + goto exit; + } + nelements = _PyLong_AsInt(args[0]); + if (nelements == -1 && PyErr_Occurred()) { + goto exit; + } + if (nargs < 2) { + goto skip_optional; + } + filename_obj = args[1]; +skip_optional: + return_value = readline_append_history_file_impl(module, nelements, filename_obj); + +exit: + return return_value; +} + +#endif /* defined(HAVE_RL_APPEND_HISTORY) */ + +PyDoc_STRVAR(readline_set_history_length__doc__, +"set_history_length($module, length, /)\n" +"--\n" +"\n" +"Set the maximal number of lines which will be written to the history file.\n" +"\n" +"A negative length is used to inhibit history truncation."); + +#define READLINE_SET_HISTORY_LENGTH_METHODDEF \ + {"set_history_length", (PyCFunction)readline_set_history_length, METH_O, readline_set_history_length__doc__}, + +static PyObject * +readline_set_history_length_impl(PyObject *module, int length); + +static PyObject * +readline_set_history_length(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int length; + + length = _PyLong_AsInt(arg); + if (length == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = readline_set_history_length_impl(module, length); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_get_history_length__doc__, +"get_history_length($module, /)\n" +"--\n" +"\n" +"Return the maximum number of lines that will be written to the history file."); + +#define READLINE_GET_HISTORY_LENGTH_METHODDEF \ + {"get_history_length", (PyCFunction)readline_get_history_length, METH_NOARGS, readline_get_history_length__doc__}, + +static PyObject * +readline_get_history_length_impl(PyObject *module); + +static PyObject * +readline_get_history_length(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_history_length_impl(module); +} + +PyDoc_STRVAR(readline_set_completion_display_matches_hook__doc__, +"set_completion_display_matches_hook($module, function=None, /)\n" +"--\n" +"\n" +"Set or remove the completion display function.\n" +"\n" +"The function is called as\n" +" function(substitution, [matches], longest_match_length)\n" +"once each time matches need to be displayed."); + +#define READLINE_SET_COMPLETION_DISPLAY_MATCHES_HOOK_METHODDEF \ + {"set_completion_display_matches_hook", (PyCFunction)(void(*)(void))readline_set_completion_display_matches_hook, METH_FASTCALL, readline_set_completion_display_matches_hook__doc__}, + +static PyObject * +readline_set_completion_display_matches_hook_impl(PyObject *module, + PyObject *function); + +static PyObject * +readline_set_completion_display_matches_hook(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *function = Py_None; + + if (!_PyArg_CheckPositional("set_completion_display_matches_hook", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + function = args[0]; +skip_optional: + return_value = readline_set_completion_display_matches_hook_impl(module, function); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_set_startup_hook__doc__, +"set_startup_hook($module, function=None, /)\n" +"--\n" +"\n" +"Set or remove the function invoked by the rl_startup_hook callback.\n" +"\n" +"The function is called with no arguments just\n" +"before readline prints the first prompt."); + +#define READLINE_SET_STARTUP_HOOK_METHODDEF \ + {"set_startup_hook", (PyCFunction)(void(*)(void))readline_set_startup_hook, METH_FASTCALL, readline_set_startup_hook__doc__}, + +static PyObject * +readline_set_startup_hook_impl(PyObject *module, PyObject *function); + +static PyObject * +readline_set_startup_hook(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *function = Py_None; + + if (!_PyArg_CheckPositional("set_startup_hook", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + function = args[0]; +skip_optional: + return_value = readline_set_startup_hook_impl(module, function); + +exit: + return return_value; +} + +#if defined(HAVE_RL_PRE_INPUT_HOOK) + +PyDoc_STRVAR(readline_set_pre_input_hook__doc__, +"set_pre_input_hook($module, function=None, /)\n" +"--\n" +"\n" +"Set or remove the function invoked by the rl_pre_input_hook callback.\n" +"\n" +"The function is called with no arguments after the first prompt\n" +"has been printed and just before readline starts reading input\n" +"characters."); + +#define READLINE_SET_PRE_INPUT_HOOK_METHODDEF \ + {"set_pre_input_hook", (PyCFunction)(void(*)(void))readline_set_pre_input_hook, METH_FASTCALL, readline_set_pre_input_hook__doc__}, + +static PyObject * +readline_set_pre_input_hook_impl(PyObject *module, PyObject *function); + +static PyObject * +readline_set_pre_input_hook(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *function = Py_None; + + if (!_PyArg_CheckPositional("set_pre_input_hook", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + function = args[0]; +skip_optional: + return_value = readline_set_pre_input_hook_impl(module, function); + +exit: + return return_value; +} + +#endif /* defined(HAVE_RL_PRE_INPUT_HOOK) */ + +PyDoc_STRVAR(readline_get_completion_type__doc__, +"get_completion_type($module, /)\n" +"--\n" +"\n" +"Get the type of completion being attempted."); + +#define READLINE_GET_COMPLETION_TYPE_METHODDEF \ + {"get_completion_type", (PyCFunction)readline_get_completion_type, METH_NOARGS, readline_get_completion_type__doc__}, + +static PyObject * +readline_get_completion_type_impl(PyObject *module); + +static PyObject * +readline_get_completion_type(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_completion_type_impl(module); +} + +PyDoc_STRVAR(readline_get_begidx__doc__, +"get_begidx($module, /)\n" +"--\n" +"\n" +"Get the beginning index of the completion scope."); + +#define READLINE_GET_BEGIDX_METHODDEF \ + {"get_begidx", (PyCFunction)readline_get_begidx, METH_NOARGS, readline_get_begidx__doc__}, + +static PyObject * +readline_get_begidx_impl(PyObject *module); + +static PyObject * +readline_get_begidx(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_begidx_impl(module); +} + +PyDoc_STRVAR(readline_get_endidx__doc__, +"get_endidx($module, /)\n" +"--\n" +"\n" +"Get the ending index of the completion scope."); + +#define READLINE_GET_ENDIDX_METHODDEF \ + {"get_endidx", (PyCFunction)readline_get_endidx, METH_NOARGS, readline_get_endidx__doc__}, + +static PyObject * +readline_get_endidx_impl(PyObject *module); + +static PyObject * +readline_get_endidx(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_endidx_impl(module); +} + +PyDoc_STRVAR(readline_set_completer_delims__doc__, +"set_completer_delims($module, string, /)\n" +"--\n" +"\n" +"Set the word delimiters for completion."); + +#define READLINE_SET_COMPLETER_DELIMS_METHODDEF \ + {"set_completer_delims", (PyCFunction)readline_set_completer_delims, METH_O, readline_set_completer_delims__doc__}, + +PyDoc_STRVAR(readline_remove_history_item__doc__, +"remove_history_item($module, pos, /)\n" +"--\n" +"\n" +"Remove history item given by its position."); + +#define READLINE_REMOVE_HISTORY_ITEM_METHODDEF \ + {"remove_history_item", (PyCFunction)readline_remove_history_item, METH_O, readline_remove_history_item__doc__}, + +static PyObject * +readline_remove_history_item_impl(PyObject *module, int entry_number); + +static PyObject * +readline_remove_history_item(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int entry_number; + + entry_number = _PyLong_AsInt(arg); + if (entry_number == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = readline_remove_history_item_impl(module, entry_number); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_replace_history_item__doc__, +"replace_history_item($module, pos, line, /)\n" +"--\n" +"\n" +"Replaces history item given by its position with contents of line."); + +#define READLINE_REPLACE_HISTORY_ITEM_METHODDEF \ + {"replace_history_item", (PyCFunction)(void(*)(void))readline_replace_history_item, METH_FASTCALL, readline_replace_history_item__doc__}, + +static PyObject * +readline_replace_history_item_impl(PyObject *module, int entry_number, + PyObject *line); + +static PyObject * +readline_replace_history_item(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int entry_number; + PyObject *line; + + if (!_PyArg_CheckPositional("replace_history_item", nargs, 2, 2)) { + goto exit; + } + entry_number = _PyLong_AsInt(args[0]); + if (entry_number == -1 && PyErr_Occurred()) { + goto exit; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("replace_history_item", "argument 2", "str", args[1]); + goto exit; + } + if (PyUnicode_READY(args[1]) == -1) { + goto exit; + } + line = args[1]; + return_value = readline_replace_history_item_impl(module, entry_number, line); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_add_history__doc__, +"add_history($module, string, /)\n" +"--\n" +"\n" +"Add an item to the history buffer."); + +#define READLINE_ADD_HISTORY_METHODDEF \ + {"add_history", (PyCFunction)readline_add_history, METH_O, readline_add_history__doc__}, + +PyDoc_STRVAR(readline_set_auto_history__doc__, +"set_auto_history($module, enabled, /)\n" +"--\n" +"\n" +"Enables or disables automatic history."); + +#define READLINE_SET_AUTO_HISTORY_METHODDEF \ + {"set_auto_history", (PyCFunction)readline_set_auto_history, METH_O, readline_set_auto_history__doc__}, + +static PyObject * +readline_set_auto_history_impl(PyObject *module, + int _should_auto_add_history); + +static PyObject * +readline_set_auto_history(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int _should_auto_add_history; + + _should_auto_add_history = PyObject_IsTrue(arg); + if (_should_auto_add_history < 0) { + goto exit; + } + return_value = readline_set_auto_history_impl(module, _should_auto_add_history); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_get_completer_delims__doc__, +"get_completer_delims($module, /)\n" +"--\n" +"\n" +"Get the word delimiters for completion."); + +#define READLINE_GET_COMPLETER_DELIMS_METHODDEF \ + {"get_completer_delims", (PyCFunction)readline_get_completer_delims, METH_NOARGS, readline_get_completer_delims__doc__}, + +static PyObject * +readline_get_completer_delims_impl(PyObject *module); + +static PyObject * +readline_get_completer_delims(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_completer_delims_impl(module); +} + +PyDoc_STRVAR(readline_set_completer__doc__, +"set_completer($module, function=None, /)\n" +"--\n" +"\n" +"Set or remove the completer function.\n" +"\n" +"The function is called as function(text, state),\n" +"for state in 0, 1, 2, ..., until it returns a non-string.\n" +"It should return the next possible completion starting with \'text\'."); + +#define READLINE_SET_COMPLETER_METHODDEF \ + {"set_completer", (PyCFunction)(void(*)(void))readline_set_completer, METH_FASTCALL, readline_set_completer__doc__}, + +static PyObject * +readline_set_completer_impl(PyObject *module, PyObject *function); + +static PyObject * +readline_set_completer(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *function = Py_None; + + if (!_PyArg_CheckPositional("set_completer", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + function = args[0]; +skip_optional: + return_value = readline_set_completer_impl(module, function); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_get_completer__doc__, +"get_completer($module, /)\n" +"--\n" +"\n" +"Get the current completer function."); + +#define READLINE_GET_COMPLETER_METHODDEF \ + {"get_completer", (PyCFunction)readline_get_completer, METH_NOARGS, readline_get_completer__doc__}, + +static PyObject * +readline_get_completer_impl(PyObject *module); + +static PyObject * +readline_get_completer(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_completer_impl(module); +} + +PyDoc_STRVAR(readline_get_history_item__doc__, +"get_history_item($module, index, /)\n" +"--\n" +"\n" +"Return the current contents of history item at index."); + +#define READLINE_GET_HISTORY_ITEM_METHODDEF \ + {"get_history_item", (PyCFunction)readline_get_history_item, METH_O, readline_get_history_item__doc__}, + +static PyObject * +readline_get_history_item_impl(PyObject *module, int idx); + +static PyObject * +readline_get_history_item(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int idx; + + idx = _PyLong_AsInt(arg); + if (idx == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = readline_get_history_item_impl(module, idx); + +exit: + return return_value; +} + +PyDoc_STRVAR(readline_get_current_history_length__doc__, +"get_current_history_length($module, /)\n" +"--\n" +"\n" +"Return the current (not the maximum) length of history."); + +#define READLINE_GET_CURRENT_HISTORY_LENGTH_METHODDEF \ + {"get_current_history_length", (PyCFunction)readline_get_current_history_length, METH_NOARGS, readline_get_current_history_length__doc__}, + +static PyObject * +readline_get_current_history_length_impl(PyObject *module); + +static PyObject * +readline_get_current_history_length(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_current_history_length_impl(module); +} + +PyDoc_STRVAR(readline_get_line_buffer__doc__, +"get_line_buffer($module, /)\n" +"--\n" +"\n" +"Return the current contents of the line buffer."); + +#define READLINE_GET_LINE_BUFFER_METHODDEF \ + {"get_line_buffer", (PyCFunction)readline_get_line_buffer, METH_NOARGS, readline_get_line_buffer__doc__}, + +static PyObject * +readline_get_line_buffer_impl(PyObject *module); + +static PyObject * +readline_get_line_buffer(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_get_line_buffer_impl(module); +} + +#if defined(HAVE_RL_COMPLETION_APPEND_CHARACTER) + +PyDoc_STRVAR(readline_clear_history__doc__, +"clear_history($module, /)\n" +"--\n" +"\n" +"Clear the current readline history."); + +#define READLINE_CLEAR_HISTORY_METHODDEF \ + {"clear_history", (PyCFunction)readline_clear_history, METH_NOARGS, readline_clear_history__doc__}, + +static PyObject * +readline_clear_history_impl(PyObject *module); + +static PyObject * +readline_clear_history(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_clear_history_impl(module); +} + +#endif /* defined(HAVE_RL_COMPLETION_APPEND_CHARACTER) */ + +PyDoc_STRVAR(readline_insert_text__doc__, +"insert_text($module, string, /)\n" +"--\n" +"\n" +"Insert text into the line buffer at the cursor position."); + +#define READLINE_INSERT_TEXT_METHODDEF \ + {"insert_text", (PyCFunction)readline_insert_text, METH_O, readline_insert_text__doc__}, + +PyDoc_STRVAR(readline_redisplay__doc__, +"redisplay($module, /)\n" +"--\n" +"\n" +"Change what\'s displayed on the screen to reflect contents of the line buffer."); + +#define READLINE_REDISPLAY_METHODDEF \ + {"redisplay", (PyCFunction)readline_redisplay, METH_NOARGS, readline_redisplay__doc__}, + +static PyObject * +readline_redisplay_impl(PyObject *module); + +static PyObject * +readline_redisplay(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return readline_redisplay_impl(module); +} + +#ifndef READLINE_APPEND_HISTORY_FILE_METHODDEF + #define READLINE_APPEND_HISTORY_FILE_METHODDEF +#endif /* !defined(READLINE_APPEND_HISTORY_FILE_METHODDEF) */ + +#ifndef READLINE_SET_PRE_INPUT_HOOK_METHODDEF + #define READLINE_SET_PRE_INPUT_HOOK_METHODDEF +#endif /* !defined(READLINE_SET_PRE_INPUT_HOOK_METHODDEF) */ + +#ifndef READLINE_CLEAR_HISTORY_METHODDEF + #define READLINE_CLEAR_HISTORY_METHODDEF +#endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */ +/*[clinic end generated code: output=cb44f391ccbfb565 input=a9049054013a1b77]*/ diff --git a/Modules/readline.c b/Modules/readline.c index 12d6cc78e38a77..bbab0f882e3f16 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -94,6 +94,11 @@ get_readline_state(PyObject *module) return (readlinestate *)state; } +/*[clinic input] +module readline +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ad49da781b9c8721]*/ + static int readline_clear(PyObject *m) { @@ -148,8 +153,18 @@ decode(const char *s) /* Exported function to send one line to readline's init file parser */ +/*[clinic input] +readline.parse_and_bind + + string: object + / + +Execute the init line provided in the string argument. +[clinic start generated code]*/ + static PyObject * -parse_and_bind(PyObject *self, PyObject *string) +readline_parse_and_bind(PyObject *module, PyObject *string) +/*[clinic end generated code: output=1a1ede8afb9546c1 input=8a28a00bb4d61eec]*/ { char *copy; PyObject *encoded = encode(string); @@ -170,23 +185,28 @@ parse_and_bind(PyObject *self, PyObject *string) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_parse_and_bind, -"parse_and_bind(string) -> None\n\ -Execute the init line provided in the string argument."); +/* Exported function to parse a readline init file */ +/*[clinic input] +readline.read_init_file -/* Exported function to parse a readline init file */ + filename as filename_obj: object = None + / + +Execute a readline initialization file. + +The default filename is the last filename used. +[clinic start generated code]*/ static PyObject * -read_init_file(PyObject *self, PyObject *args) +readline_read_init_file_impl(PyObject *module, PyObject *filename_obj) +/*[clinic end generated code: output=8e059b676142831e input=4c80c473e448139d]*/ { - PyObject *filename_obj = Py_None, *filename_bytes; - if (!PyArg_ParseTuple(args, "|O:read_init_file", &filename_obj)) - return NULL; + PyObject *filename_bytes; if (filename_obj != Py_None) { if (!PyUnicode_FSConverter(filename_obj, &filename_bytes)) return NULL; - errno = rl_read_init_file(PyBytes_AsString(filename_bytes)); + errno = rl_read_init_file(PyBytes_AS_STRING(filename_bytes)); Py_DECREF(filename_bytes); } else errno = rl_read_init_file(NULL); @@ -195,24 +215,28 @@ read_init_file(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_read_init_file, -"read_init_file([filename]) -> None\n\ -Execute a readline initialization file.\n\ -The default filename is the last filename used."); +/* Exported function to load a readline history file */ +/*[clinic input] +readline.read_history_file -/* Exported function to load a readline history file */ + filename as filename_obj: object = None + / + +Load a readline history file. + +The default filename is ~/.history. +[clinic start generated code]*/ static PyObject * -read_history_file(PyObject *self, PyObject *args) +readline_read_history_file_impl(PyObject *module, PyObject *filename_obj) +/*[clinic end generated code: output=66a951836fb54fbb input=3d29d755b7e6932e]*/ { - PyObject *filename_obj = Py_None, *filename_bytes; - if (!PyArg_ParseTuple(args, "|O:read_history_file", &filename_obj)) - return NULL; + PyObject *filename_bytes; if (filename_obj != Py_None) { if (!PyUnicode_FSConverter(filename_obj, &filename_bytes)) return NULL; - errno = read_history(PyBytes_AsString(filename_bytes)); + errno = read_history(PyBytes_AS_STRING(filename_bytes)); Py_DECREF(filename_bytes); } else errno = read_history(NULL); @@ -222,26 +246,31 @@ read_history_file(PyObject *self, PyObject *args) } static int _history_length = -1; /* do not truncate history by default */ -PyDoc_STRVAR(doc_read_history_file, -"read_history_file([filename]) -> None\n\ -Load a readline history file.\n\ -The default filename is ~/.history."); - /* Exported function to save a readline history file */ +/*[clinic input] +readline.write_history_file + + filename as filename_obj: object = None + / + +Save a readline history file. + +The default filename is ~/.history. +[clinic start generated code]*/ + static PyObject * -write_history_file(PyObject *self, PyObject *args) +readline_write_history_file_impl(PyObject *module, PyObject *filename_obj) +/*[clinic end generated code: output=fbcad13d8ef59ae6 input=28a8e062fe363703]*/ { - PyObject *filename_obj = Py_None, *filename_bytes; + PyObject *filename_bytes; const char *filename; int err; - if (!PyArg_ParseTuple(args, "|O:write_history_file", &filename_obj)) - return NULL; if (filename_obj != Py_None) { if (!PyUnicode_FSConverter(filename_obj, &filename_bytes)) return NULL; - filename = PyBytes_AsString(filename_bytes); + filename = PyBytes_AS_STRING(filename_bytes); } else { filename_bytes = NULL; filename = NULL; @@ -256,28 +285,33 @@ write_history_file(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_write_history_file, -"write_history_file([filename]) -> None\n\ -Save a readline history file.\n\ -The default filename is ~/.history."); - - #ifdef HAVE_RL_APPEND_HISTORY /* Exported function to save part of a readline history file */ +/*[clinic input] +readline.append_history_file + + nelements: int + filename as filename_obj: object = None + / + +Append the last nelements items of the history list to file. + +The default filename is ~/.history. +[clinic start generated code]*/ + static PyObject * -append_history_file(PyObject *self, PyObject *args) +readline_append_history_file_impl(PyObject *module, int nelements, + PyObject *filename_obj) +/*[clinic end generated code: output=5df06fc9da56e4e4 input=784b774db3a4b7c5]*/ { - int nelements; - PyObject *filename_obj = Py_None, *filename_bytes; + PyObject *filename_bytes; const char *filename; int err; - if (!PyArg_ParseTuple(args, "i|O:append_history_file", &nelements, &filename_obj)) - return NULL; if (filename_obj != Py_None) { if (!PyUnicode_FSConverter(filename_obj, &filename_bytes)) return NULL; - filename = PyBytes_AsString(filename_bytes); + filename = PyBytes_AS_STRING(filename_bytes); } else { filename_bytes = NULL; filename = NULL; @@ -291,57 +325,50 @@ append_history_file(PyObject *self, PyObject *args) return PyErr_SetFromErrno(PyExc_OSError); Py_RETURN_NONE; } - -PyDoc_STRVAR(doc_append_history_file, -"append_history_file(nelements[, filename]) -> None\n\ -Append the last nelements items of the history list to file.\n\ -The default filename is ~/.history."); #endif /* Set history length */ -static PyObject* -set_history_length(PyObject *self, PyObject *args) +/*[clinic input] +readline.set_history_length + + length: int + / + +Set the maximal number of lines which will be written to the history file. + +A negative length is used to inhibit history truncation. +[clinic start generated code]*/ + +static PyObject * +readline_set_history_length_impl(PyObject *module, int length) +/*[clinic end generated code: output=e161a53e45987dc7 input=b8901bf16488b760]*/ { - int length = _history_length; - if (!PyArg_ParseTuple(args, "i:set_history_length", &length)) - return NULL; _history_length = length; Py_RETURN_NONE; } -PyDoc_STRVAR(set_history_length_doc, -"set_history_length(length) -> None\n\ -set the maximal number of lines which will be written to\n\ -the history file. A negative length is used to inhibit\n\ -history truncation."); +/* Get history length */ +/*[clinic input] +readline.get_history_length -/* Get history length */ +Return the maximum number of lines that will be written to the history file. +[clinic start generated code]*/ -static PyObject* -get_history_length(PyObject *self, PyObject *noarg) +static PyObject * +readline_get_history_length_impl(PyObject *module) +/*[clinic end generated code: output=83a2eeae35b6d2b9 input=5dce2eeba4327817]*/ { return PyLong_FromLong(_history_length); } -PyDoc_STRVAR(get_history_length_doc, -"get_history_length() -> int\n\ -return the maximum number of lines that will be written to\n\ -the history file."); - - /* Generic hook function setter */ static PyObject * -set_hook(const char *funcname, PyObject **hook_var, PyObject *args) +set_hook(const char *funcname, PyObject **hook_var, PyObject *function) { - PyObject *function = Py_None; - char buf[80]; - PyOS_snprintf(buf, sizeof(buf), "|O:set_%.50s", funcname); - if (!PyArg_ParseTuple(args, buf, &function)) - return NULL; if (function == Py_None) { Py_CLEAR(*hook_var); } @@ -358,12 +385,27 @@ set_hook(const char *funcname, PyObject **hook_var, PyObject *args) Py_RETURN_NONE; } +/*[clinic input] +readline.set_completion_display_matches_hook + + function: object = None + / + +Set or remove the completion display function. + +The function is called as + function(substitution, [matches], longest_match_length) +once each time matches need to be displayed. +[clinic start generated code]*/ static PyObject * -set_completion_display_matches_hook(PyObject *self, PyObject *args) +readline_set_completion_display_matches_hook_impl(PyObject *module, + PyObject *function) +/*[clinic end generated code: output=516e5cb8db75a328 input=4f0bfd5ab0179a26]*/ { PyObject *result = set_hook("completion_display_matches_hook", - &readlinestate_global->completion_display_matches_hook, args); + &readlinestate_global->completion_display_matches_hook, + function); #ifdef HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK /* We cannot set this hook globally, since it replaces the default completion display. */ @@ -379,90 +421,114 @@ set_completion_display_matches_hook(PyObject *self, PyObject *args) } -PyDoc_STRVAR(doc_set_completion_display_matches_hook, -"set_completion_display_matches_hook([function]) -> None\n\ -Set or remove the completion display function.\n\ -The function is called as\n\ - function(substitution, [matches], longest_match_length)\n\ -once each time matches need to be displayed."); +/*[clinic input] +readline.set_startup_hook + + function: object = None + / + +Set or remove the function invoked by the rl_startup_hook callback. + +The function is called with no arguments just +before readline prints the first prompt. +[clinic start generated code]*/ static PyObject * -set_startup_hook(PyObject *self, PyObject *args) +readline_set_startup_hook_impl(PyObject *module, PyObject *function) +/*[clinic end generated code: output=02cd0e0c4fa082ad input=7783b4334b26d16d]*/ { - return set_hook("startup_hook", &readlinestate_global->startup_hook, args); + return set_hook("startup_hook", &readlinestate_global->startup_hook, + function); } -PyDoc_STRVAR(doc_set_startup_hook, -"set_startup_hook([function]) -> None\n\ -Set or remove the function invoked by the rl_startup_hook callback.\n\ -The function is called with no arguments just\n\ -before readline prints the first prompt."); - - #ifdef HAVE_RL_PRE_INPUT_HOOK /* Set pre-input hook */ +/*[clinic input] +readline.set_pre_input_hook + + function: object = None + / + +Set or remove the function invoked by the rl_pre_input_hook callback. + +The function is called with no arguments after the first prompt +has been printed and just before readline starts reading input +characters. +[clinic start generated code]*/ + static PyObject * -set_pre_input_hook(PyObject *self, PyObject *args) +readline_set_pre_input_hook_impl(PyObject *module, PyObject *function) +/*[clinic end generated code: output=fe1a96505096f464 input=4f3eaeaf7ce1fdbe]*/ { - return set_hook("pre_input_hook", &readlinestate_global->pre_input_hook, args); + return set_hook("pre_input_hook", &readlinestate_global->pre_input_hook, + function); } - -PyDoc_STRVAR(doc_set_pre_input_hook, -"set_pre_input_hook([function]) -> None\n\ -Set or remove the function invoked by the rl_pre_input_hook callback.\n\ -The function is called with no arguments after the first prompt\n\ -has been printed and just before readline starts reading input\n\ -characters."); - #endif /* Get the completion type for the scope of the tab-completion */ + +/*[clinic input] +readline.get_completion_type + +Get the type of completion being attempted. +[clinic start generated code]*/ + static PyObject * -get_completion_type(PyObject *self, PyObject *noarg) +readline_get_completion_type_impl(PyObject *module) +/*[clinic end generated code: output=5c54d58a04997c07 input=04b92bc7a82dac91]*/ { return PyLong_FromLong(rl_completion_type); } -PyDoc_STRVAR(doc_get_completion_type, -"get_completion_type() -> int\n\ -Get the type of completion being attempted."); +/* Get the beginning index for the scope of the tab-completion */ +/*[clinic input] +readline.get_begidx -/* Get the beginning index for the scope of the tab-completion */ +Get the beginning index of the completion scope. +[clinic start generated code]*/ static PyObject * -get_begidx(PyObject *self, PyObject *noarg) +readline_get_begidx_impl(PyObject *module) +/*[clinic end generated code: output=362616ee8ed1b2b1 input=e083b81c8eb4bac3]*/ { Py_INCREF(readlinestate_global->begidx); return readlinestate_global->begidx; } -PyDoc_STRVAR(doc_get_begidx, -"get_begidx() -> int\n\ -get the beginning index of the completion scope"); +/* Get the ending index for the scope of the tab-completion */ +/*[clinic input] +readline.get_endidx -/* Get the ending index for the scope of the tab-completion */ +Get the ending index of the completion scope. +[clinic start generated code]*/ static PyObject * -get_endidx(PyObject *self, PyObject *noarg) +readline_get_endidx_impl(PyObject *module) +/*[clinic end generated code: output=7f763350b12d7517 input=d4c7e34a625fd770]*/ { Py_INCREF(readlinestate_global->endidx); return readlinestate_global->endidx; } -PyDoc_STRVAR(doc_get_endidx, -"get_endidx() -> int\n\ -get the ending index of the completion scope"); +/* Set the tab-completion word-delimiters that readline uses */ + +/*[clinic input] +readline.set_completer_delims + string: object + / -/* Set the tab-completion word-delimiters that readline uses */ +Set the word delimiters for completion. +[clinic start generated code]*/ static PyObject * -set_completer_delims(PyObject *self, PyObject *string) +readline_set_completer_delims(PyObject *module, PyObject *string) +/*[clinic end generated code: output=4305b266106c4f1f input=ae945337ebd01e20]*/ { char *break_chars; PyObject *encoded = encode(string); @@ -484,10 +550,6 @@ set_completer_delims(PyObject *self, PyObject *string) return PyErr_NoMemory(); } -PyDoc_STRVAR(doc_set_completer_delims, -"set_completer_delims(string) -> None\n\ -set the word delimiters for completion"); - /* _py_free_history_entry: Utility function to free a history entry. */ #if defined(RL_READLINE_VERSION) && RL_READLINE_VERSION >= 0x0500 @@ -520,14 +582,21 @@ _py_free_history_entry(HIST_ENTRY *entry) #endif +/*[clinic input] +readline.remove_history_item + + pos as entry_number: int + / + +Remove history item given by its position. +[clinic start generated code]*/ + static PyObject * -py_remove_history(PyObject *self, PyObject *args) +readline_remove_history_item_impl(PyObject *module, int entry_number) +/*[clinic end generated code: output=ab114f029208c7e8 input=c8520ac3da50224e]*/ { - int entry_number; HIST_ENTRY *entry; - if (!PyArg_ParseTuple(args, "i:remove_history_item", &entry_number)) - return NULL; if (entry_number < 0) { PyErr_SetString(PyExc_ValueError, "History index cannot be negative"); @@ -545,22 +614,24 @@ py_remove_history(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_remove_history, -"remove_history_item(pos) -> None\n\ -remove history item given by its position"); +/*[clinic input] +readline.replace_history_item + + pos as entry_number: int + line: unicode + / + +Replaces history item given by its position with contents of line. +[clinic start generated code]*/ static PyObject * -py_replace_history(PyObject *self, PyObject *args) +readline_replace_history_item_impl(PyObject *module, int entry_number, + PyObject *line) +/*[clinic end generated code: output=f8cec2770ca125eb input=b7ccef0780ae041b]*/ { - int entry_number; - PyObject *line; PyObject *encoded; HIST_ENTRY *old_entry; - if (!PyArg_ParseTuple(args, "iU:replace_history_item", &entry_number, - &line)) { - return NULL; - } if (entry_number < 0) { PyErr_SetString(PyExc_ValueError, "History index cannot be negative"); @@ -583,14 +654,20 @@ py_replace_history(PyObject *self, PyObject *args) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_replace_history, -"replace_history_item(pos, line) -> None\n\ -replaces history item given by its position with contents of line"); - /* Add a line to the history buffer */ +/*[clinic input] +readline.add_history + + string: object + / + +Add an item to the history buffer. +[clinic start generated code]*/ + static PyObject * -py_add_history(PyObject *self, PyObject *string) +readline_add_history(PyObject *module, PyObject *string) +/*[clinic end generated code: output=b107b7e8106e803d input=e57c1cf6bc68d7e3]*/ { PyObject *encoded = encode(string); if (encoded == NULL) { @@ -601,60 +678,75 @@ py_add_history(PyObject *self, PyObject *string) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_add_history, -"add_history(string) -> None\n\ -add an item to the history buffer"); - static int should_auto_add_history = 1; /* Enable or disable automatic history */ +/*[clinic input] +readline.set_auto_history + + enabled as _should_auto_add_history: bool + / + +Enables or disables automatic history. +[clinic start generated code]*/ + static PyObject * -py_set_auto_history(PyObject *self, PyObject *args) +readline_set_auto_history_impl(PyObject *module, + int _should_auto_add_history) +/*[clinic end generated code: output=619c6968246fd82b input=3d413073a1a03355]*/ { - if (!PyArg_ParseTuple(args, "p:set_auto_history", - &should_auto_add_history)) { - return NULL; - } + should_auto_add_history = _should_auto_add_history; Py_RETURN_NONE; } -PyDoc_STRVAR(doc_set_auto_history, -"set_auto_history(enabled) -> None\n\ -Enables or disables automatic history."); - /* Get the tab-completion word-delimiters that readline uses */ +/*[clinic input] +readline.get_completer_delims + +Get the word delimiters for completion. +[clinic start generated code]*/ + static PyObject * -get_completer_delims(PyObject *self, PyObject *noarg) +readline_get_completer_delims_impl(PyObject *module) +/*[clinic end generated code: output=6b060280fa68ef43 input=e36eb14fb8a1f08a]*/ { return decode(rl_completer_word_break_characters); } -PyDoc_STRVAR(doc_get_completer_delims, -"get_completer_delims() -> string\n\ -get the word delimiters for completion"); +/* Set the completer function */ +/*[clinic input] +readline.set_completer -/* Set the completer function */ + function: object = None + / + +Set or remove the completer function. + +The function is called as function(text, state), +for state in 0, 1, 2, ..., until it returns a non-string. +It should return the next possible completion starting with 'text'. +[clinic start generated code]*/ static PyObject * -set_completer(PyObject *self, PyObject *args) +readline_set_completer_impl(PyObject *module, PyObject *function) +/*[clinic end generated code: output=171a2a60f81d3204 input=51e81e13118eb877]*/ { - return set_hook("completer", &readlinestate_global->completer, args); + return set_hook("completer", &readlinestate_global->completer, function); } -PyDoc_STRVAR(doc_set_completer, -"set_completer([function]) -> None\n\ -Set or remove the completer function.\n\ -The function is called as function(text, state),\n\ -for state in 0, 1, 2, ..., until it returns a non-string.\n\ -It should return the next possible completion starting with 'text'."); +/*[clinic input] +readline.get_completer +Get the current completer function. +[clinic start generated code]*/ static PyObject * -get_completer(PyObject *self, PyObject *noargs) +readline_get_completer_impl(PyObject *module) +/*[clinic end generated code: output=6e6bbd8226d14475 input=6457522e56d70d13]*/ { if (readlinestate_global->completer == NULL) { Py_RETURN_NONE; @@ -663,11 +755,6 @@ get_completer(PyObject *self, PyObject *noargs) return readlinestate_global->completer; } -PyDoc_STRVAR(doc_get_completer, -"get_completer() -> function\n\ -\n\ -Returns current completer function."); - /* Private function to get current length of history. XXX It may be * possible to replace this with a direct use of history_length instead, * but it's not clear whether BSD's libedit keeps history_length up to date. @@ -689,14 +776,21 @@ _py_get_history_length(void) /* Exported function to get any element of history */ +/*[clinic input] +readline.get_history_item + + index as idx: int + / + +Return the current contents of history item at index. +[clinic start generated code]*/ + static PyObject * -get_history_item(PyObject *self, PyObject *args) +readline_get_history_item_impl(PyObject *module, int idx) +/*[clinic end generated code: output=83d3e53ea5f34b3d input=63fff0c3c4323269]*/ { - int idx = 0; HIST_ENTRY *hist_ent; - if (!PyArg_ParseTuple(args, "i:get_history_item", &idx)) - return NULL; if (using_libedit_emulation) { /* Older versions of libedit's readline emulation * use 0-based indexes, while readline and newer @@ -723,58 +817,70 @@ get_history_item(PyObject *self, PyObject *args) } } -PyDoc_STRVAR(doc_get_history_item, -"get_history_item() -> string\n\ -return the current contents of history item at index."); +/* Exported function to get current length of history */ +/*[clinic input] +readline.get_current_history_length -/* Exported function to get current length of history */ +Return the current (not the maximum) length of history. +[clinic start generated code]*/ static PyObject * -get_current_history_length(PyObject *self, PyObject *noarg) +readline_get_current_history_length_impl(PyObject *module) +/*[clinic end generated code: output=436b294f12ba1e3f input=9cb3f431a68d071f]*/ { return PyLong_FromLong((long)_py_get_history_length()); } -PyDoc_STRVAR(doc_get_current_history_length, -"get_current_history_length() -> integer\n\ -return the current (not the maximum) length of history."); +/* Exported function to read the current line buffer */ +/*[clinic input] +readline.get_line_buffer -/* Exported function to read the current line buffer */ +Return the current contents of the line buffer. +[clinic start generated code]*/ static PyObject * -get_line_buffer(PyObject *self, PyObject *noarg) +readline_get_line_buffer_impl(PyObject *module) +/*[clinic end generated code: output=d22f9025ecad80e4 input=5f5fbc0d12c69412]*/ { return decode(rl_line_buffer); } -PyDoc_STRVAR(doc_get_line_buffer, -"get_line_buffer() -> string\n\ -return the current contents of the line buffer."); - - #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER /* Exported function to clear the current history */ +/*[clinic input] +readline.clear_history + +Clear the current readline history. +[clinic start generated code]*/ + static PyObject * -py_clear_history(PyObject *self, PyObject *noarg) +readline_clear_history_impl(PyObject *module) +/*[clinic end generated code: output=1f2dbb0dfa5d5ebb input=208962c4393f5d16]*/ { clear_history(); Py_RETURN_NONE; } - -PyDoc_STRVAR(doc_clear_history, -"clear_history() -> None\n\ -Clear the current readline history."); #endif /* Exported function to insert text into the line buffer */ +/*[clinic input] +readline.insert_text + + string: object + / + +Insert text into the line buffer at the cursor position. +[clinic start generated code]*/ + static PyObject * -insert_text(PyObject *self, PyObject *string) +readline_insert_text(PyObject *module, PyObject *string) +/*[clinic end generated code: output=23d792821d320c19 input=bc96c3c848d5ccb5]*/ { PyObject *encoded = encode(string); if (encoded == NULL) { @@ -785,77 +891,60 @@ insert_text(PyObject *self, PyObject *string) Py_RETURN_NONE; } -PyDoc_STRVAR(doc_insert_text, -"insert_text(string) -> None\n\ -Insert text into the line buffer at the cursor position."); +/* Redisplay the line buffer */ +/*[clinic input] +readline.redisplay -/* Redisplay the line buffer */ +Change what's displayed on the screen to reflect contents of the line buffer. +[clinic start generated code]*/ static PyObject * -redisplay(PyObject *self, PyObject *noarg) +readline_redisplay_impl(PyObject *module) +/*[clinic end generated code: output=a8b9725827c3c34b input=b485151058d75edc]*/ { rl_redisplay(); Py_RETURN_NONE; } -PyDoc_STRVAR(doc_redisplay, -"redisplay() -> None\n\ -Change what's displayed on the screen to reflect the current\n\ -contents of the line buffer."); - +#include "clinic/readline.c.h" /* Table of functions exported by the module */ static struct PyMethodDef readline_methods[] = { - {"parse_and_bind", parse_and_bind, METH_O, doc_parse_and_bind}, - {"get_line_buffer", get_line_buffer, METH_NOARGS, doc_get_line_buffer}, - {"insert_text", insert_text, METH_O, doc_insert_text}, - {"redisplay", redisplay, METH_NOARGS, doc_redisplay}, - {"read_init_file", read_init_file, METH_VARARGS, doc_read_init_file}, - {"read_history_file", read_history_file, - METH_VARARGS, doc_read_history_file}, - {"write_history_file", write_history_file, - METH_VARARGS, doc_write_history_file}, + READLINE_PARSE_AND_BIND_METHODDEF + READLINE_GET_LINE_BUFFER_METHODDEF + READLINE_INSERT_TEXT_METHODDEF + READLINE_REDISPLAY_METHODDEF + READLINE_READ_INIT_FILE_METHODDEF + READLINE_READ_HISTORY_FILE_METHODDEF + READLINE_WRITE_HISTORY_FILE_METHODDEF #ifdef HAVE_RL_APPEND_HISTORY - {"append_history_file", append_history_file, - METH_VARARGS, doc_append_history_file}, + READLINE_APPEND_HISTORY_FILE_METHODDEF #endif - {"get_history_item", get_history_item, - METH_VARARGS, doc_get_history_item}, - {"get_current_history_length", (PyCFunction)get_current_history_length, - METH_NOARGS, doc_get_current_history_length}, - {"set_history_length", set_history_length, - METH_VARARGS, set_history_length_doc}, - {"get_history_length", get_history_length, - METH_NOARGS, get_history_length_doc}, - {"set_completer", set_completer, METH_VARARGS, doc_set_completer}, - {"get_completer", get_completer, METH_NOARGS, doc_get_completer}, - {"get_completion_type", get_completion_type, - METH_NOARGS, doc_get_completion_type}, - {"get_begidx", get_begidx, METH_NOARGS, doc_get_begidx}, - {"get_endidx", get_endidx, METH_NOARGS, doc_get_endidx}, - - {"set_completer_delims", set_completer_delims, - METH_O, doc_set_completer_delims}, - {"set_auto_history", py_set_auto_history, METH_VARARGS, doc_set_auto_history}, - {"add_history", py_add_history, METH_O, doc_add_history}, - {"remove_history_item", py_remove_history, METH_VARARGS, doc_remove_history}, - {"replace_history_item", py_replace_history, METH_VARARGS, doc_replace_history}, - {"get_completer_delims", get_completer_delims, - METH_NOARGS, doc_get_completer_delims}, - - {"set_completion_display_matches_hook", set_completion_display_matches_hook, - METH_VARARGS, doc_set_completion_display_matches_hook}, - {"set_startup_hook", set_startup_hook, - METH_VARARGS, doc_set_startup_hook}, + READLINE_GET_HISTORY_ITEM_METHODDEF + READLINE_GET_CURRENT_HISTORY_LENGTH_METHODDEF + READLINE_SET_HISTORY_LENGTH_METHODDEF + READLINE_GET_HISTORY_LENGTH_METHODDEF + READLINE_SET_COMPLETER_METHODDEF + READLINE_GET_COMPLETER_METHODDEF + READLINE_GET_COMPLETION_TYPE_METHODDEF + READLINE_GET_BEGIDX_METHODDEF + READLINE_GET_ENDIDX_METHODDEF + READLINE_SET_COMPLETER_DELIMS_METHODDEF + READLINE_SET_AUTO_HISTORY_METHODDEF + READLINE_ADD_HISTORY_METHODDEF + READLINE_REMOVE_HISTORY_ITEM_METHODDEF + READLINE_REPLACE_HISTORY_ITEM_METHODDEF + READLINE_GET_COMPLETER_DELIMS_METHODDEF + READLINE_SET_COMPLETION_DISPLAY_MATCHES_HOOK_METHODDEF + READLINE_SET_STARTUP_HOOK_METHODDEF #ifdef HAVE_RL_PRE_INPUT_HOOK - {"set_pre_input_hook", set_pre_input_hook, - METH_VARARGS, doc_set_pre_input_hook}, + READLINE_SET_PRE_INPUT_HOOK_METHODDEF #endif #ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER - {"clear_history", py_clear_history, METH_NOARGS, doc_clear_history}, + READLINE_CLEAR_HISTORY_METHODDEF #endif {0, 0} }; From 0ec7ea9719bc17f786e33f7ba7b8a00d760ea11e Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Sun, 12 Jul 2020 10:11:11 -0600 Subject: [PATCH 030/197] bpo-20175: Convert Modules/_multiprocessing to the Argument Clinic (GH-14245) --- .../clinic/multiprocessing.c.h | 151 +++++++ Modules/_multiprocessing/clinic/semaphore.c.h | 402 ++++++++++++++++++ Modules/_multiprocessing/multiprocessing.c | 92 ++-- Modules/_multiprocessing/multiprocessing.h | 2 +- Modules/_multiprocessing/semaphore.c | 244 ++++++++--- 5 files changed, 797 insertions(+), 94 deletions(-) create mode 100644 Modules/_multiprocessing/clinic/multiprocessing.c.h create mode 100644 Modules/_multiprocessing/clinic/semaphore.c.h diff --git a/Modules/_multiprocessing/clinic/multiprocessing.c.h b/Modules/_multiprocessing/clinic/multiprocessing.c.h new file mode 100644 index 00000000000000..7096442bd0b52a --- /dev/null +++ b/Modules/_multiprocessing/clinic/multiprocessing.c.h @@ -0,0 +1,151 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_closesocket__doc__, +"closesocket($module, handle, /)\n" +"--\n" +"\n"); + +#define _MULTIPROCESSING_CLOSESOCKET_METHODDEF \ + {"closesocket", (PyCFunction)_multiprocessing_closesocket, METH_O, _multiprocessing_closesocket__doc__}, + +static PyObject * +_multiprocessing_closesocket_impl(PyObject *module, HANDLE handle); + +static PyObject * +_multiprocessing_closesocket(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + HANDLE handle; + + if (!PyArg_Parse(arg, ""F_HANDLE":closesocket", &handle)) { + goto exit; + } + return_value = _multiprocessing_closesocket_impl(module, handle); + +exit: + return return_value; +} + +#endif /* defined(MS_WINDOWS) */ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_recv__doc__, +"recv($module, handle, size, /)\n" +"--\n" +"\n"); + +#define _MULTIPROCESSING_RECV_METHODDEF \ + {"recv", (PyCFunction)(void(*)(void))_multiprocessing_recv, METH_FASTCALL, _multiprocessing_recv__doc__}, + +static PyObject * +_multiprocessing_recv_impl(PyObject *module, HANDLE handle, int size); + +static PyObject * +_multiprocessing_recv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + int size; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"i:recv", + &handle, &size)) { + goto exit; + } + return_value = _multiprocessing_recv_impl(module, handle, size); + +exit: + return return_value; +} + +#endif /* defined(MS_WINDOWS) */ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_send__doc__, +"send($module, handle, buf, /)\n" +"--\n" +"\n"); + +#define _MULTIPROCESSING_SEND_METHODDEF \ + {"send", (PyCFunction)(void(*)(void))_multiprocessing_send, METH_FASTCALL, _multiprocessing_send__doc__}, + +static PyObject * +_multiprocessing_send_impl(PyObject *module, HANDLE handle, Py_buffer *buf); + +static PyObject * +_multiprocessing_send(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + HANDLE handle; + Py_buffer buf = {NULL, NULL}; + + if (!_PyArg_ParseStack(args, nargs, ""F_HANDLE"y*:send", + &handle, &buf)) { + goto exit; + } + return_value = _multiprocessing_send_impl(module, handle, &buf); + +exit: + /* Cleanup for buf */ + if (buf.obj) { + PyBuffer_Release(&buf); + } + + return return_value; +} + +#endif /* defined(MS_WINDOWS) */ + +PyDoc_STRVAR(_multiprocessing_sem_unlink__doc__, +"sem_unlink($module, name, /)\n" +"--\n" +"\n"); + +#define _MULTIPROCESSING_SEM_UNLINK_METHODDEF \ + {"sem_unlink", (PyCFunction)_multiprocessing_sem_unlink, METH_O, _multiprocessing_sem_unlink__doc__}, + +static PyObject * +_multiprocessing_sem_unlink_impl(PyObject *module, const char *name); + +static PyObject * +_multiprocessing_sem_unlink(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + const char *name; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("sem_unlink", "argument", "str", arg); + goto exit; + } + Py_ssize_t name_length; + name = PyUnicode_AsUTF8AndSize(arg, &name_length); + if (name == NULL) { + goto exit; + } + if (strlen(name) != (size_t)name_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + return_value = _multiprocessing_sem_unlink_impl(module, name); + +exit: + return return_value; +} + +#ifndef _MULTIPROCESSING_CLOSESOCKET_METHODDEF + #define _MULTIPROCESSING_CLOSESOCKET_METHODDEF +#endif /* !defined(_MULTIPROCESSING_CLOSESOCKET_METHODDEF) */ + +#ifndef _MULTIPROCESSING_RECV_METHODDEF + #define _MULTIPROCESSING_RECV_METHODDEF +#endif /* !defined(_MULTIPROCESSING_RECV_METHODDEF) */ + +#ifndef _MULTIPROCESSING_SEND_METHODDEF + #define _MULTIPROCESSING_SEND_METHODDEF +#endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */ +/*[clinic end generated code: output=418191c446cd5751 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/semaphore.c.h b/Modules/_multiprocessing/clinic/semaphore.c.h new file mode 100644 index 00000000000000..e1b9309e9f280b --- /dev/null +++ b/Modules/_multiprocessing/clinic/semaphore.c.h @@ -0,0 +1,402 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_SemLock_acquire__doc__, +"acquire($self, /, block=True, timeout=None)\n" +"--\n" +"\n" +"Acquire the semaphore/lock."); + +#define _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF \ + {"acquire", (PyCFunction)(void(*)(void))_multiprocessing_SemLock_acquire, METH_FASTCALL|METH_KEYWORDS, _multiprocessing_SemLock_acquire__doc__}, + +static PyObject * +_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking, + PyObject *timeout_obj); + +static PyObject * +_multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"block", "timeout", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "acquire", 0}; + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + int blocking = 1; + PyObject *timeout_obj = Py_None; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf); + if (!args) { + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[0]) { + blocking = _PyLong_AsInt(args[0]); + if (blocking == -1 && PyErr_Occurred()) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } + timeout_obj = args[1]; +skip_optional_pos: + return_value = _multiprocessing_SemLock_acquire_impl(self, blocking, timeout_obj); + +exit: + return return_value; +} + +#endif /* defined(MS_WINDOWS) */ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__, +"release($self, /)\n" +"--\n" +"\n" +"Release the semaphore/lock."); + +#define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \ + {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, + +static PyObject * +_multiprocessing_SemLock_release_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock_release(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock_release_impl(self); +} + +#endif /* defined(MS_WINDOWS) */ + +#if !defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_SemLock_acquire__doc__, +"acquire($self, /, block=True, timeout=None)\n" +"--\n" +"\n" +"Acquire the semaphore/lock."); + +#define _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF \ + {"acquire", (PyCFunction)(void(*)(void))_multiprocessing_SemLock_acquire, METH_FASTCALL|METH_KEYWORDS, _multiprocessing_SemLock_acquire__doc__}, + +static PyObject * +_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking, + PyObject *timeout_obj); + +static PyObject * +_multiprocessing_SemLock_acquire(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"block", "timeout", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "acquire", 0}; + PyObject *argsbuf[2]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + int blocking = 1; + PyObject *timeout_obj = Py_None; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 2, 0, argsbuf); + if (!args) { + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[0]) { + blocking = _PyLong_AsInt(args[0]); + if (blocking == -1 && PyErr_Occurred()) { + goto exit; + } + if (!--noptargs) { + goto skip_optional_pos; + } + } + timeout_obj = args[1]; +skip_optional_pos: + return_value = _multiprocessing_SemLock_acquire_impl(self, blocking, timeout_obj); + +exit: + return return_value; +} + +#endif /* !defined(MS_WINDOWS) */ + +#if !defined(MS_WINDOWS) + +PyDoc_STRVAR(_multiprocessing_SemLock_release__doc__, +"release($self, /)\n" +"--\n" +"\n" +"Release the semaphore/lock."); + +#define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF \ + {"release", (PyCFunction)_multiprocessing_SemLock_release, METH_NOARGS, _multiprocessing_SemLock_release__doc__}, + +static PyObject * +_multiprocessing_SemLock_release_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock_release(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock_release_impl(self); +} + +#endif /* !defined(MS_WINDOWS) */ + +static PyObject * +_multiprocessing_SemLock_impl(PyTypeObject *type, int kind, int value, + int maxvalue, const char *name, int unlink); + +static PyObject * +_multiprocessing_SemLock(PyTypeObject *type, PyObject *args, PyObject *kwargs) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"kind", "value", "maxvalue", "name", "unlink", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "SemLock", 0}; + PyObject *argsbuf[5]; + PyObject * const *fastargs; + Py_ssize_t nargs = PyTuple_GET_SIZE(args); + int kind; + int value; + int maxvalue; + const char *name; + int unlink; + + fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 5, 5, 0, argsbuf); + if (!fastargs) { + goto exit; + } + kind = _PyLong_AsInt(fastargs[0]); + if (kind == -1 && PyErr_Occurred()) { + goto exit; + } + value = _PyLong_AsInt(fastargs[1]); + if (value == -1 && PyErr_Occurred()) { + goto exit; + } + maxvalue = _PyLong_AsInt(fastargs[2]); + if (maxvalue == -1 && PyErr_Occurred()) { + goto exit; + } + if (!PyUnicode_Check(fastargs[3])) { + _PyArg_BadArgument("SemLock", "argument 'name'", "str", fastargs[3]); + goto exit; + } + Py_ssize_t name_length; + name = PyUnicode_AsUTF8AndSize(fastargs[3], &name_length); + if (name == NULL) { + goto exit; + } + if (strlen(name) != (size_t)name_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + unlink = _PyLong_AsInt(fastargs[4]); + if (unlink == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _multiprocessing_SemLock_impl(type, kind, value, maxvalue, name, unlink); + +exit: + return return_value; +} + +PyDoc_STRVAR(_multiprocessing_SemLock__rebuild__doc__, +"_rebuild($type, handle, kind, maxvalue, name, /)\n" +"--\n" +"\n"); + +#define _MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF \ + {"_rebuild", (PyCFunction)(void(*)(void))_multiprocessing_SemLock__rebuild, METH_FASTCALL|METH_CLASS, _multiprocessing_SemLock__rebuild__doc__}, + +static PyObject * +_multiprocessing_SemLock__rebuild_impl(PyTypeObject *type, SEM_HANDLE handle, + int kind, int maxvalue, + const char *name); + +static PyObject * +_multiprocessing_SemLock__rebuild(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + SEM_HANDLE handle; + int kind; + int maxvalue; + const char *name; + + if (!_PyArg_ParseStack(args, nargs, ""F_SEM_HANDLE"iiz:_rebuild", + &handle, &kind, &maxvalue, &name)) { + goto exit; + } + return_value = _multiprocessing_SemLock__rebuild_impl(type, handle, kind, maxvalue, name); + +exit: + return return_value; +} + +PyDoc_STRVAR(_multiprocessing_SemLock__count__doc__, +"_count($self, /)\n" +"--\n" +"\n" +"Num of `acquire()`s minus num of `release()`s for this process."); + +#define _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF \ + {"_count", (PyCFunction)_multiprocessing_SemLock__count, METH_NOARGS, _multiprocessing_SemLock__count__doc__}, + +static PyObject * +_multiprocessing_SemLock__count_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock__count(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock__count_impl(self); +} + +PyDoc_STRVAR(_multiprocessing_SemLock__is_mine__doc__, +"_is_mine($self, /)\n" +"--\n" +"\n" +"Whether the lock is owned by this thread."); + +#define _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF \ + {"_is_mine", (PyCFunction)_multiprocessing_SemLock__is_mine, METH_NOARGS, _multiprocessing_SemLock__is_mine__doc__}, + +static PyObject * +_multiprocessing_SemLock__is_mine_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock__is_mine(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock__is_mine_impl(self); +} + +PyDoc_STRVAR(_multiprocessing_SemLock__get_value__doc__, +"_get_value($self, /)\n" +"--\n" +"\n" +"Get the value of the semaphore."); + +#define _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF \ + {"_get_value", (PyCFunction)_multiprocessing_SemLock__get_value, METH_NOARGS, _multiprocessing_SemLock__get_value__doc__}, + +static PyObject * +_multiprocessing_SemLock__get_value_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock__get_value(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock__get_value_impl(self); +} + +PyDoc_STRVAR(_multiprocessing_SemLock__is_zero__doc__, +"_is_zero($self, /)\n" +"--\n" +"\n" +"Return whether semaphore has value zero."); + +#define _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF \ + {"_is_zero", (PyCFunction)_multiprocessing_SemLock__is_zero, METH_NOARGS, _multiprocessing_SemLock__is_zero__doc__}, + +static PyObject * +_multiprocessing_SemLock__is_zero_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock__is_zero(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock__is_zero_impl(self); +} + +PyDoc_STRVAR(_multiprocessing_SemLock__after_fork__doc__, +"_after_fork($self, /)\n" +"--\n" +"\n" +"Rezero the net acquisition count after fork()."); + +#define _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF \ + {"_after_fork", (PyCFunction)_multiprocessing_SemLock__after_fork, METH_NOARGS, _multiprocessing_SemLock__after_fork__doc__}, + +static PyObject * +_multiprocessing_SemLock__after_fork_impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock__after_fork(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock__after_fork_impl(self); +} + +PyDoc_STRVAR(_multiprocessing_SemLock___enter____doc__, +"__enter__($self, /)\n" +"--\n" +"\n" +"Enter the semaphore/lock."); + +#define _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF \ + {"__enter__", (PyCFunction)_multiprocessing_SemLock___enter__, METH_NOARGS, _multiprocessing_SemLock___enter____doc__}, + +static PyObject * +_multiprocessing_SemLock___enter___impl(SemLockObject *self); + +static PyObject * +_multiprocessing_SemLock___enter__(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +{ + return _multiprocessing_SemLock___enter___impl(self); +} + +PyDoc_STRVAR(_multiprocessing_SemLock___exit____doc__, +"__exit__($self, exc_type=None, exc_value=None, exc_tb=None, /)\n" +"--\n" +"\n" +"Exit the semaphore/lock."); + +#define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF \ + {"__exit__", (PyCFunction)(void(*)(void))_multiprocessing_SemLock___exit__, METH_FASTCALL, _multiprocessing_SemLock___exit____doc__}, + +static PyObject * +_multiprocessing_SemLock___exit___impl(SemLockObject *self, + PyObject *exc_type, + PyObject *exc_value, PyObject *exc_tb); + +static PyObject * +_multiprocessing_SemLock___exit__(SemLockObject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *exc_type = Py_None; + PyObject *exc_value = Py_None; + PyObject *exc_tb = Py_None; + + if (!_PyArg_CheckPositional("__exit__", nargs, 0, 3)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + exc_type = args[0]; + if (nargs < 2) { + goto skip_optional; + } + exc_value = args[1]; + if (nargs < 3) { + goto skip_optional; + } + exc_tb = args[2]; +skip_optional: + return_value = _multiprocessing_SemLock___exit___impl(self, exc_type, exc_value, exc_tb); + +exit: + return return_value; +} + +#ifndef _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF + #define _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF +#endif /* !defined(_MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF) */ + +#ifndef _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF + #define _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF +#endif /* !defined(_MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF) */ +/*[clinic end generated code: output=e7fd938150601fe5 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index 806e638340f7af..77e6c854068c0f 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -9,6 +9,20 @@ #include "multiprocessing.h" +/*[python input] +class HANDLE_converter(CConverter): + type = "HANDLE" + format_unit = '"F_HANDLE"' + +[python start generated code]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=9fad6080b79ace91]*/ + +/*[clinic input] +module _multiprocessing +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=01e0745f380ac6e3]*/ + +#include "clinic/multiprocessing.c.h" /* * Function which raises exceptions based on error codes @@ -50,15 +64,20 @@ _PyMp_SetError(PyObject *Type, int num) } #ifdef MS_WINDOWS +/*[clinic input] +_multiprocessing.closesocket + + handle: HANDLE + / + +[clinic start generated code]*/ + static PyObject * -multiprocessing_closesocket(PyObject *self, PyObject *args) +_multiprocessing_closesocket_impl(PyObject *module, HANDLE handle) +/*[clinic end generated code: output=214f359f900966f4 input=8a20706dd386c6cc]*/ { - HANDLE handle; int ret; - if (!PyArg_ParseTuple(args, F_HANDLE ":closesocket" , &handle)) - return NULL; - Py_BEGIN_ALLOW_THREADS ret = closesocket((SOCKET) handle); Py_END_ALLOW_THREADS @@ -68,16 +87,22 @@ multiprocessing_closesocket(PyObject *self, PyObject *args) Py_RETURN_NONE; } +/*[clinic input] +_multiprocessing.recv + + handle: HANDLE + size: int + / + +[clinic start generated code]*/ + static PyObject * -multiprocessing_recv(PyObject *self, PyObject *args) +_multiprocessing_recv_impl(PyObject *module, HANDLE handle, int size) +/*[clinic end generated code: output=92322781ba9ff598 input=6a5b0834372cee5b]*/ { - HANDLE handle; - int size, nread; + int nread; PyObject *buf; - if (!PyArg_ParseTuple(args, F_HANDLE "i:recv" , &handle, &size)) - return NULL; - buf = PyBytes_FromStringAndSize(NULL, size); if (!buf) return NULL; @@ -94,23 +119,27 @@ multiprocessing_recv(PyObject *self, PyObject *args) return buf; } +/*[clinic input] +_multiprocessing.send + + handle: HANDLE + buf: Py_buffer + / + +[clinic start generated code]*/ + static PyObject * -multiprocessing_send(PyObject *self, PyObject *args) +_multiprocessing_send_impl(PyObject *module, HANDLE handle, Py_buffer *buf) +/*[clinic end generated code: output=52d7df0519c596cb input=41dce742f98d2210]*/ { - HANDLE handle; - Py_buffer buf; int ret, length; - if (!PyArg_ParseTuple(args, F_HANDLE "y*:send" , &handle, &buf)) - return NULL; - - length = (int)Py_MIN(buf.len, INT_MAX); + length = (int)Py_MIN(buf->len, INT_MAX); Py_BEGIN_ALLOW_THREADS - ret = send((SOCKET) handle, buf.buf, length, 0); + ret = send((SOCKET) handle, buf->buf, length, 0); Py_END_ALLOW_THREADS - PyBuffer_Release(&buf); if (ret < 0) return PyErr_SetExcFromWindowsErr(PyExc_OSError, WSAGetLastError()); return PyLong_FromLong(ret); @@ -118,18 +147,33 @@ multiprocessing_send(PyObject *self, PyObject *args) #endif +/*[clinic input] +_multiprocessing.sem_unlink + + name: str + / + +[clinic start generated code]*/ + +static PyObject * +_multiprocessing_sem_unlink_impl(PyObject *module, const char *name) +/*[clinic end generated code: output=fcbfeb1ed255e647 input=bf939aff9564f1d5]*/ +{ + return _PyMp_sem_unlink(name); +} + /* * Function table */ static PyMethodDef module_methods[] = { #ifdef MS_WINDOWS - {"closesocket", multiprocessing_closesocket, METH_VARARGS, ""}, - {"recv", multiprocessing_recv, METH_VARARGS, ""}, - {"send", multiprocessing_send, METH_VARARGS, ""}, + _MULTIPROCESSING_CLOSESOCKET_METHODDEF + _MULTIPROCESSING_RECV_METHODDEF + _MULTIPROCESSING_SEND_METHODDEF #endif #if !defined(POSIX_SEMAPHORES_NOT_ENABLED) && !defined(__ANDROID__) - {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""}, + _MULTIPROCESSING_SEM_UNLINK_METHODDEF #endif {NULL} }; diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h index fe78135d4669ec..277963bc1575bb 100644 --- a/Modules/_multiprocessing/multiprocessing.h +++ b/Modules/_multiprocessing/multiprocessing.h @@ -88,6 +88,6 @@ PyObject *_PyMp_SetError(PyObject *Type, int num); */ extern PyTypeObject _PyMp_SemLockType; -extern PyObject *_PyMp_sem_unlink(PyObject *ignore, PyObject *args); +extern PyObject *_PyMp_sem_unlink(const char *name); #endif /* MULTIPROCESSING_H */ diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c index ee490256d2a27e..8732750e11be8c 100644 --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -21,6 +21,22 @@ typedef struct { char *name; } SemLockObject; +/*[python input] +class SEM_HANDLE_converter(CConverter): + type = "SEM_HANDLE" + format_unit = '"F_SEM_HANDLE"' + +[python start generated code]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=3e0ad43e482d8716]*/ + +/*[clinic input] +module _multiprocessing +class _multiprocessing.SemLock "SemLockObject *" "&_PyMp_SemLockType" +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=935fb41b7d032599]*/ + +#include "clinic/semaphore.c.h" + #define ISMINE(o) (o->count > 0 && PyThread_get_thread_ident() == o->last_tid) @@ -58,21 +74,24 @@ _GetSemaphoreValue(HANDLE handle, long *value) } } +/*[clinic input] +_multiprocessing.SemLock.acquire + + block as blocking: bool(accept={int}) = True + timeout as timeout_obj: object = None + +Acquire the semaphore/lock. +[clinic start generated code]*/ + static PyObject * -semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds) +_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking, + PyObject *timeout_obj) +/*[clinic end generated code: output=f9998f0b6b0b0872 input=86f05662cf753eb4]*/ { - int blocking = 1; double timeout; - PyObject *timeout_obj = Py_None; DWORD res, full_msecs, nhandles; HANDLE handles[2], sigint_event; - static char *kwlist[] = {"block", "timeout", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist, - &blocking, &timeout_obj)) - return NULL; - /* calculate timeout */ if (!blocking) { full_msecs = 0; @@ -146,8 +165,15 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds) } } +/*[clinic input] +_multiprocessing.SemLock.release + +Release the semaphore/lock. +[clinic start generated code]*/ + static PyObject * -semlock_release(SemLockObject *self, PyObject *args) +_multiprocessing_SemLock_release_impl(SemLockObject *self) +/*[clinic end generated code: output=b22f53ba96b0d1db input=ba7e63a961885d3d]*/ { if (self->kind == RECURSIVE_MUTEX) { if (!ISMINE(self)) { @@ -264,19 +290,23 @@ sem_timedwait_save(sem_t *sem, struct timespec *deadline, PyThreadState *_save) #endif /* !HAVE_SEM_TIMEDWAIT */ +/*[clinic input] +_multiprocessing.SemLock.acquire + + block as blocking: bool(accept={int}) = True + timeout as timeout_obj: object = None + +Acquire the semaphore/lock. +[clinic start generated code]*/ + static PyObject * -semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds) +_multiprocessing_SemLock_acquire_impl(SemLockObject *self, int blocking, + PyObject *timeout_obj) +/*[clinic end generated code: output=f9998f0b6b0b0872 input=86f05662cf753eb4]*/ { - int blocking = 1, res, err = 0; - PyObject *timeout_obj = Py_None; + int res, err = 0; struct timespec deadline = {0}; - static char *kwlist[] = {"block", "timeout", NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "|iO", kwlist, - &blocking, &timeout_obj)) - return NULL; - if (self->kind == RECURSIVE_MUTEX && ISMINE(self)) { ++self->count; Py_RETURN_TRUE; @@ -345,8 +375,15 @@ semlock_acquire(SemLockObject *self, PyObject *args, PyObject *kwds) Py_RETURN_TRUE; } +/*[clinic input] +_multiprocessing.SemLock.release + +Release the semaphore/lock. +[clinic start generated code]*/ + static PyObject * -semlock_release(SemLockObject *self, PyObject *args) +_multiprocessing_SemLock_release_impl(SemLockObject *self) +/*[clinic end generated code: output=b22f53ba96b0d1db input=ba7e63a961885d3d]*/ { if (self->kind == RECURSIVE_MUTEX) { if (!ISMINE(self)) { @@ -429,19 +466,26 @@ newsemlockobject(PyTypeObject *type, SEM_HANDLE handle, int kind, int maxvalue, return (PyObject*)self; } +/*[clinic input] +@classmethod +_multiprocessing.SemLock.__new__ + + kind: int + value: int + maxvalue: int + name: str + unlink: bool(accept={int}) + +[clinic start generated code]*/ + static PyObject * -semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +_multiprocessing_SemLock_impl(PyTypeObject *type, int kind, int value, + int maxvalue, const char *name, int unlink) +/*[clinic end generated code: output=30727e38f5f7577a input=b378c3ee27d3a0fa]*/ { SEM_HANDLE handle = SEM_FAILED; - int kind, maxvalue, value, unlink; PyObject *result; - char *name, *name_copy = NULL; - static char *kwlist[] = {"kind", "value", "maxvalue", "name", "unlink", - NULL}; - - if (!PyArg_ParseTupleAndKeywords(args, kwds, "iiisi", kwlist, - &kind, &value, &maxvalue, &name, &unlink)) - return NULL; + char *name_copy = NULL; if (kind != RECURSIVE_MUTEX && kind != SEMAPHORE) { PyErr_SetString(PyExc_ValueError, "unrecognized kind"); @@ -481,16 +525,25 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } +/*[clinic input] +@classmethod +_multiprocessing.SemLock._rebuild + + handle: SEM_HANDLE + kind: int + maxvalue: int + name: str(accept={str, NoneType}) + / + +[clinic start generated code]*/ + static PyObject * -semlock_rebuild(PyTypeObject *type, PyObject *args) +_multiprocessing_SemLock__rebuild_impl(PyTypeObject *type, SEM_HANDLE handle, + int kind, int maxvalue, + const char *name) +/*[clinic end generated code: output=2aaee14f063f3bd9 input=f7040492ac6d9962]*/ { - SEM_HANDLE handle; - int kind, maxvalue; - char *name, *name_copy = NULL; - - if (!PyArg_ParseTuple(args, F_SEM_HANDLE "iiz", - &handle, &kind, &maxvalue, &name)) - return NULL; + char *name_copy = NULL; if (name != NULL) { name_copy = PyMem_Malloc(strlen(name) + 1); @@ -521,21 +574,42 @@ semlock_dealloc(SemLockObject* self) PyObject_Del(self); } +/*[clinic input] +_multiprocessing.SemLock._count + +Num of `acquire()`s minus num of `release()`s for this process. +[clinic start generated code]*/ + static PyObject * -semlock_count(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +_multiprocessing_SemLock__count_impl(SemLockObject *self) +/*[clinic end generated code: output=5ba8213900e517bb input=36fc59b1cd1025ab]*/ { return PyLong_FromLong((long)self->count); } +/*[clinic input] +_multiprocessing.SemLock._is_mine + +Whether the lock is owned by this thread. +[clinic start generated code]*/ + static PyObject * -semlock_ismine(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +_multiprocessing_SemLock__is_mine_impl(SemLockObject *self) +/*[clinic end generated code: output=92dc98863f4303be input=a96664cb2f0093ba]*/ { /* only makes sense for a lock */ return PyBool_FromLong(ISMINE(self)); } +/*[clinic input] +_multiprocessing.SemLock._get_value + +Get the value of the semaphore. +[clinic start generated code]*/ + static PyObject * -semlock_getvalue(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +_multiprocessing_SemLock__get_value_impl(SemLockObject *self) +/*[clinic end generated code: output=64bc1b89bda05e36 input=cb10f9a769836203]*/ { #ifdef HAVE_BROKEN_SEM_GETVALUE PyErr_SetNone(PyExc_NotImplementedError); @@ -552,8 +626,15 @@ semlock_getvalue(SemLockObject *self, PyObject *Py_UNUSED(ignored)) #endif } +/*[clinic input] +_multiprocessing.SemLock._is_zero + +Return whether semaphore has value zero. +[clinic start generated code]*/ + static PyObject * -semlock_iszero(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +_multiprocessing_SemLock__is_zero_impl(SemLockObject *self) +/*[clinic end generated code: output=815d4c878c806ed7 input=294a446418d31347]*/ { #ifdef HAVE_BROKEN_SEM_GETVALUE if (sem_trywait(self->handle) < 0) { @@ -573,38 +654,68 @@ semlock_iszero(SemLockObject *self, PyObject *Py_UNUSED(ignored)) #endif } +/*[clinic input] +_multiprocessing.SemLock._after_fork + +Rezero the net acquisition count after fork(). +[clinic start generated code]*/ + static PyObject * -semlock_afterfork(SemLockObject *self, PyObject *Py_UNUSED(ignored)) +_multiprocessing_SemLock__after_fork_impl(SemLockObject *self) +/*[clinic end generated code: output=718bb27914c6a6c1 input=190991008a76621e]*/ { self->count = 0; Py_RETURN_NONE; } +/*[clinic input] +_multiprocessing.SemLock.__enter__ + +Enter the semaphore/lock. +[clinic start generated code]*/ + +static PyObject * +_multiprocessing_SemLock___enter___impl(SemLockObject *self) +/*[clinic end generated code: output=beeb2f07c858511f input=c5e27d594284690b]*/ +{ + return _multiprocessing_SemLock_acquire_impl(self, 1, Py_None); +} + +/*[clinic input] +_multiprocessing.SemLock.__exit__ + + exc_type: object = None + exc_value: object = None + exc_tb: object = None + / + +Exit the semaphore/lock. +[clinic start generated code]*/ + +static PyObject * +_multiprocessing_SemLock___exit___impl(SemLockObject *self, + PyObject *exc_type, + PyObject *exc_value, PyObject *exc_tb) +/*[clinic end generated code: output=3b37c1a9f8b91a03 input=7d644b64a89903f8]*/ +{ + return _multiprocessing_SemLock_release_impl(self); +} + /* * Semaphore methods */ static PyMethodDef semlock_methods[] = { - {"acquire", (PyCFunction)(void(*)(void))semlock_acquire, METH_VARARGS | METH_KEYWORDS, - "acquire the semaphore/lock"}, - {"release", (PyCFunction)semlock_release, METH_NOARGS, - "release the semaphore/lock"}, - {"__enter__", (PyCFunction)(void(*)(void))semlock_acquire, METH_VARARGS | METH_KEYWORDS, - "enter the semaphore/lock"}, - {"__exit__", (PyCFunction)semlock_release, METH_VARARGS, - "exit the semaphore/lock"}, - {"_count", (PyCFunction)semlock_count, METH_NOARGS, - "num of `acquire()`s minus num of `release()`s for this process"}, - {"_is_mine", (PyCFunction)semlock_ismine, METH_NOARGS, - "whether the lock is owned by this thread"}, - {"_get_value", (PyCFunction)semlock_getvalue, METH_NOARGS, - "get the value of the semaphore"}, - {"_is_zero", (PyCFunction)semlock_iszero, METH_NOARGS, - "returns whether semaphore has value zero"}, - {"_rebuild", (PyCFunction)semlock_rebuild, METH_VARARGS | METH_CLASS, - ""}, - {"_after_fork", (PyCFunction)semlock_afterfork, METH_NOARGS, - "rezero the net acquisition count after fork()"}, + _MULTIPROCESSING_SEMLOCK_ACQUIRE_METHODDEF + _MULTIPROCESSING_SEMLOCK_RELEASE_METHODDEF + _MULTIPROCESSING_SEMLOCK___ENTER___METHODDEF + _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF + _MULTIPROCESSING_SEMLOCK__COUNT_METHODDEF + _MULTIPROCESSING_SEMLOCK__IS_MINE_METHODDEF + _MULTIPROCESSING_SEMLOCK__GET_VALUE_METHODDEF + _MULTIPROCESSING_SEMLOCK__IS_ZERO_METHODDEF + _MULTIPROCESSING_SEMLOCK__REBUILD_METHODDEF + _MULTIPROCESSING_SEMLOCK__AFTER_FORK_METHODDEF {NULL} }; @@ -666,7 +777,7 @@ PyTypeObject _PyMp_SemLockType = { /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, - /* tp_new */ semlock_new, + /* tp_new */ _multiprocessing_SemLock, }; /* @@ -674,13 +785,8 @@ PyTypeObject _PyMp_SemLockType = { */ PyObject * -_PyMp_sem_unlink(PyObject *ignore, PyObject *args) +_PyMp_sem_unlink(const char *name) { - char *name; - - if (!PyArg_ParseTuple(args, "s", &name)) - return NULL; - if (SEM_UNLINK(name) < 0) { _PyMp_SetError(NULL, MP_STANDARD_ERROR); return NULL; From f5868551c93b16a04367bcec48b92db800494b01 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 12 Jul 2020 19:15:20 +0300 Subject: [PATCH 031/197] bpo-41146: Convert signal.default_int_handler() to Argument Clinic (GH-21197) --- Modules/clinic/signalmodule.c.h | 38 ++++++++++++++++++++++++++++++++- Modules/signalmodule.c | 23 +++++++++++++------- 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 33a278e488f943..4713bab7486acb 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -2,6 +2,42 @@ preserve [clinic start generated code]*/ +PyDoc_STRVAR(signal_default_int_handler__doc__, +"default_int_handler($module, signalnum, frame, /)\n" +"--\n" +"\n" +"The default handler for SIGINT installed by Python.\n" +"\n" +"It raises KeyboardInterrupt."); + +#define SIGNAL_DEFAULT_INT_HANDLER_METHODDEF \ + {"default_int_handler", (PyCFunction)(void(*)(void))signal_default_int_handler, METH_FASTCALL, signal_default_int_handler__doc__}, + +static PyObject * +signal_default_int_handler_impl(PyObject *module, int signalnum, + PyObject *frame); + +static PyObject * +signal_default_int_handler(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int signalnum; + PyObject *frame; + + if (!_PyArg_CheckPositional("default_int_handler", nargs, 2, 2)) { + goto exit; + } + signalnum = _PyLong_AsInt(args[0]); + if (signalnum == -1 && PyErr_Occurred()) { + goto exit; + } + frame = args[1]; + return_value = signal_default_int_handler_impl(module, signalnum, frame); + +exit: + return return_value; +} + #if defined(HAVE_ALARM) PyDoc_STRVAR(signal_alarm__doc__, @@ -662,4 +698,4 @@ signal_pidfd_send_signal(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF #endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */ -/*[clinic end generated code: output=dff93c869101f043 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=59c33f0af42aebb5 input=a9049054013a1b77]*/ diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index ef3536a210b04c..7bc1b535e6e2ca 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -189,19 +189,26 @@ itimer_retval(struct itimerval *iv) } #endif +/*[clinic input] +signal.default_int_handler + signalnum: int + frame: object + / + +The default handler for SIGINT installed by Python. + +It raises KeyboardInterrupt. +[clinic start generated code]*/ + static PyObject * -signal_default_int_handler(PyObject *self, PyObject *args) +signal_default_int_handler_impl(PyObject *module, int signalnum, + PyObject *frame) +/*[clinic end generated code: output=bb11c2eb115ace4e input=efcd4a56a207acfd]*/ { PyErr_SetNone(PyExc_KeyboardInterrupt); return NULL; } -PyDoc_STRVAR(default_int_handler_doc, -"default_int_handler(...)\n\ -\n\ -The default handler for SIGINT installed by Python.\n\ -It raises KeyboardInterrupt."); - static int report_wakeup_write_error(void *data) @@ -1297,7 +1304,7 @@ signal_pidfd_send_signal_impl(PyObject *module, int pidfd, int signalnum, /* List of functions defined in the module -- some of the methoddefs are defined to nothing if the corresponding C function is not available. */ static PyMethodDef signal_methods[] = { - {"default_int_handler", signal_default_int_handler, METH_VARARGS, default_int_handler_doc}, + SIGNAL_DEFAULT_INT_HANDLER_METHODDEF SIGNAL_ALARM_METHODDEF SIGNAL_SETITIMER_METHODDEF SIGNAL_GETITIMER_METHODDEF From 36f7b63fd6835431c48589e69aa1b5ae4a394ea0 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 13 Jul 2020 15:49:26 +0300 Subject: [PATCH 032/197] bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) Automerge-Triggered-By: @tiran --- Lib/test/pickletester.py | 18 ++++++++++++ .../2020-07-13-15-06-35.bpo-41288.8mn5P-.rst | 2 ++ Modules/_pickle.c | 29 ++++++++++++++----- 3 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index afbc2b3bf0a79c..fb972a3ba5e9b0 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -1176,6 +1176,24 @@ def test_compat_unpickle(self): self.assertIs(type(unpickled), collections.UserDict) self.assertEqual(unpickled, collections.UserDict({1: 2})) + def test_bad_reduce(self): + self.assertEqual(self.loads(b'cbuiltins\nint\n)R.'), 0) + self.check_unpickling_error(TypeError, b'N)R.') + self.check_unpickling_error(TypeError, b'cbuiltins\nint\nNR.') + + def test_bad_newobj(self): + error = (pickle.UnpicklingError, TypeError) + self.assertEqual(self.loads(b'cbuiltins\nint\n)\x81.'), 0) + self.check_unpickling_error(error, b'cbuiltins\nlen\n)\x81.') + self.check_unpickling_error(error, b'cbuiltins\nint\nN\x81.') + + def test_bad_newobj_ex(self): + error = (pickle.UnpicklingError, TypeError) + self.assertEqual(self.loads(b'cbuiltins\nint\n)}\x92.'), 0) + self.check_unpickling_error(error, b'cbuiltins\nlen\n)}\x92.') + self.check_unpickling_error(error, b'cbuiltins\nint\nN}\x92.') + self.check_unpickling_error(error, b'cbuiltins\nint\n)N\x92.') + def test_bad_stack(self): badpickles = [ b'.', # STOP diff --git a/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst b/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst new file mode 100644 index 00000000000000..3c3adbabf16ff1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst @@ -0,0 +1,2 @@ +Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now +UnpicklingError instead of crashing. diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 25e888db19c235..611da7afdf80ec 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -5988,23 +5988,30 @@ load_newobj_ex(UnpicklerObject *self) } if (!PyType_Check(cls)) { - Py_DECREF(kwargs); - Py_DECREF(args); PyErr_Format(st->UnpicklingError, "NEWOBJ_EX class argument must be a type, not %.200s", Py_TYPE(cls)->tp_name); - Py_DECREF(cls); - return -1; + goto error; } 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; + goto error; + } + if (!PyTuple_Check(args)) { + PyErr_Format(st->UnpicklingError, + "NEWOBJ_EX args argument must be a tuple, not %.200s", + Py_TYPE(args)->tp_name); + goto error; + } + if (!PyDict_Check(kwargs)) { + PyErr_Format(st->UnpicklingError, + "NEWOBJ_EX kwargs argument must be a dict, not %.200s", + Py_TYPE(kwargs)->tp_name); + goto error; } + obj = ((PyTypeObject *)cls)->tp_new((PyTypeObject *)cls, args, kwargs); Py_DECREF(kwargs); Py_DECREF(args); @@ -6014,6 +6021,12 @@ load_newobj_ex(UnpicklerObject *self) } PDATA_PUSH(self->stack, obj, -1); return 0; + +error: + Py_DECREF(kwargs); + Py_DECREF(args); + Py_DECREF(cls); + return -1; } static int From ecb1620fcd156f015009b71ef67a35c855f45ad1 Mon Sep 17 00:00:00 2001 From: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> Date: Mon, 13 Jul 2020 18:31:02 -0300 Subject: [PATCH 033/197] bpo-32192: A basic lazy importer example (GH-21330) * Add example on lazy imports * Use four spaces for indentation * change to console --- Doc/library/importlib.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 99bfeacbbc7407..f7286d2ade8bd1 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1719,6 +1719,29 @@ To import a Python source file directly, use the following recipe spec.loader.exec_module(module) +Implementing lazy imports +''''''''''''''''''''''''' + +The example below shows how to implement lazy imports:: + + >>> import importlib.util + >>> import sys + >>> def lazy_import(name): + ... spec = importlib.util.find_spec(name) + ... loader = importlib.util.LazyLoader(spec.loader) + ... spec.loader = loader + ... module = importlib.util.module_from_spec(spec) + ... sys.modules[name] = module + ... loader.exec_module(module) + ... return module + ... + >>> lazy_typing = lazy_import("typing") + >>> #lazy_typing is a real module object, + >>> #but it is not loaded in memory yet. + >>> lazy_typing.TYPE_CHECKING + False + + Setting up an importer '''''''''''''''''''''' From 1538dd5137348f95e92677c6b8bd10dc9204aefe Mon Sep 17 00:00:00 2001 From: Paul McMillan Date: Mon, 13 Jul 2020 18:26:23 -0700 Subject: [PATCH 034/197] Fix repeated words in Classes tutorial (GH-21455) The phrase "At any time during execution," was repeated twice. Automerge-Triggered-By: @Mariatta --- Doc/tutorial/classes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 250d2a9ddb416b..685552f99f440e 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -114,8 +114,8 @@ accessible. "Directly accessible" here means that an unqualified reference to a name attempts to find the name in the namespace. Although scopes are determined statically, they are used dynamically. At any -time during execution, At any time during execution, there are 3 or 4 nested -scopes whose namespaces are directly accessible: +time during execution, there are 3 or 4 nested scopes whose namespaces are +directly accessible: * the innermost scope, which is searched first, contains the local names * the scopes of any enclosing functions, which are searched starting with the From 001bb5592f8d7618cc2f98ba288c0e0d066085ca Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Tue, 14 Jul 2020 17:22:43 +0000 Subject: [PATCH 035/197] bpo-32528: Document the change in inheritance of asyncio.CancelledError (GH-21474) #msg373510 [bpo-32528]()/#13528 changed `asyncio.CancelledError` such that it no longer inherits from `concurrent.futures.CancelledError`. As this affects existing code, specifically when catching the latter instead of the former in exception handling, it should be documented in the "What's new in 3.8?" document. Automerge-Triggered-By: @1st1 --- Doc/whatsnew/3.8.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index b6ed2da36889a3..a2fa17811b3fc8 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -646,7 +646,8 @@ loop on every invocation: (Contributed by Yury Selivanov in :issue:`37028`.) The exception :class:`asyncio.CancelledError` now inherits from -:class:`BaseException` rather than :class:`Exception`. +:class:`BaseException` rather than :class:`Exception` and no longer inherits +from :class:`concurrent.futures.CancelledError`. (Contributed by Yury Selivanov in :issue:`32528`.) On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`. @@ -1951,7 +1952,8 @@ Changes in the Python API (Contributed by Anthony Sottile in :issue:`36264`.) * The exception :class:`asyncio.CancelledError` now inherits from - :class:`BaseException` rather than :class:`Exception`. + :class:`BaseException` rather than :class:`Exception` and no longer inherits + from :class:`concurrent.futures.CancelledError`. (Contributed by Yury Selivanov in :issue:`32528`.) * The function :func:`asyncio.wait_for` now correctly waits for cancellation From 1ec0151263a835d4c55b8643ef5ae8921aee403d Mon Sep 17 00:00:00 2001 From: Tony Solomonik Date: Tue, 14 Jul 2020 22:41:24 +0300 Subject: [PATCH 036/197] bpo-41273: asyncio's proactor read transport's better performance by using recv_into instead of recv (#21442) * bpo-41273: Proactor transport read loop to use recv_into By using recv_into instead of recv we do not allocate a new buffer each time _loop_reading calls recv. This betters performance for any stream using proactor (basically any asyncio stream on windows). * bpo-41273: Double proactor read transport buffer size By doubling the read buffer size we get better performance. --- Lib/asyncio/proactor_events.py | 40 ++++++----- Lib/test/test_asyncio/test_proactor_events.py | 70 ++++++++++++------- .../2020-07-11-00-15-01.bpo-41273.SVrsJh.rst | 3 + 3 files changed, 67 insertions(+), 46 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index 8338449aaa0a3e..d0b7100f5e0563 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -179,11 +179,12 @@ class _ProactorReadPipeTransport(_ProactorBasePipeTransport, """Transport for read pipes.""" def __init__(self, loop, sock, protocol, waiter=None, - extra=None, server=None): - self._pending_data = None + extra=None, server=None, buffer_size=65536): + self._pending_data_length = -1 self._paused = True super().__init__(loop, sock, protocol, waiter, extra, server) + self._data = bytearray(buffer_size) self._loop.call_soon(self._loop_reading) self._paused = False @@ -217,12 +218,12 @@ def resume_reading(self): if self._read_fut is None: self._loop.call_soon(self._loop_reading, None) - data = self._pending_data - self._pending_data = None - if data is not None: + length = self._pending_data_length + self._pending_data_length = -1 + if length > -1: # Call the protocol methode after calling _loop_reading(), # since the protocol can decide to pause reading again. - self._loop.call_soon(self._data_received, data) + self._loop.call_soon(self._data_received, self._data[:length], length) if self._loop.get_debug(): logger.debug("%r resumes reading", self) @@ -243,15 +244,15 @@ def _eof_received(self): if not keep_open: self.close() - def _data_received(self, data): + def _data_received(self, data, length): if self._paused: # Don't call any protocol method while reading is paused. # The protocol will be called on resume_reading(). - assert self._pending_data is None - self._pending_data = data + assert self._pending_data_length == -1 + self._pending_data_length = length return - if not data: + if length == 0: self._eof_received() return @@ -269,6 +270,7 @@ def _data_received(self, data): self._protocol.data_received(data) def _loop_reading(self, fut=None): + length = -1 data = None try: if fut is not None: @@ -277,18 +279,18 @@ def _loop_reading(self, fut=None): self._read_fut = None if fut.done(): # deliver data later in "finally" clause - data = fut.result() + length = fut.result() + if length == 0: + # we got end-of-file so no need to reschedule a new read + return + + data = self._data[:length] else: # the future will be replaced by next proactor.recv call fut.cancel() 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 # bpo-33694: buffer_updated() has currently no fast path because of @@ -296,7 +298,7 @@ def _loop_reading(self, fut=None): if not self._paused: # reschedule a new read - self._read_fut = self._loop._proactor.recv(self._sock, 32768) + self._read_fut = self._loop._proactor.recv_into(self._sock, self._data) except ConnectionAbortedError as exc: if not self._closing: self._fatal_error(exc, 'Fatal read error on pipe transport') @@ -314,8 +316,8 @@ def _loop_reading(self, fut=None): if not self._paused: self._read_fut.add_done_callback(self._loop_reading) finally: - if data is not None: - self._data_received(data) + if length > -1: + self._data_received(data, length) class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index b5d1df93efd650..50ba4c19d425ca 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -40,6 +40,7 @@ def setUp(self): self.loop._proactor = self.proactor self.protocol = test_utils.make_test_protocol(asyncio.Protocol) self.sock = mock.Mock(socket.socket) + self.buffer_size = 65536 def socket_transport(self, waiter=None): transport = _ProactorSocketTransport(self.loop, self.sock, @@ -53,28 +54,32 @@ def test_ctor(self): test_utils.run_briefly(self.loop) self.assertIsNone(fut.result()) self.protocol.connection_made(tr) - self.proactor.recv.assert_called_with(self.sock, 32768) + self.proactor.recv_into.assert_called_with(self.sock, bytearray(self.buffer_size)) def test_loop_reading(self): tr = self.socket_transport() tr._loop_reading() - self.loop._proactor.recv.assert_called_with(self.sock, 32768) + self.loop._proactor.recv_into.assert_called_with(self.sock, bytearray(self.buffer_size)) self.assertFalse(self.protocol.data_received.called) self.assertFalse(self.protocol.eof_received.called) def test_loop_reading_data(self): + buf = b'data' res = self.loop.create_future() - res.set_result(b'data') + res.set_result(len(buf)) tr = self.socket_transport() tr._read_fut = res + tr._data[:len(buf)] = buf tr._loop_reading(res) - self.loop._proactor.recv.assert_called_with(self.sock, 32768) - self.protocol.data_received.assert_called_with(b'data') + called_buf = bytearray(self.buffer_size) + called_buf[:len(buf)] = buf + self.loop._proactor.recv_into.assert_called_with(self.sock, called_buf) + self.protocol.data_received.assert_called_with(bytearray(buf)) def test_loop_reading_no_data(self): res = self.loop.create_future() - res.set_result(b'') + res.set_result(0) tr = self.socket_transport() self.assertRaises(AssertionError, tr._loop_reading, res) @@ -82,12 +87,12 @@ def test_loop_reading_no_data(self): tr.close = mock.Mock() tr._read_fut = res tr._loop_reading(res) - self.assertFalse(self.loop._proactor.recv.called) + self.assertFalse(self.loop._proactor.recv_into.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() + err = self.loop._proactor.recv_into.side_effect = ConnectionAbortedError() tr = self.socket_transport() tr._fatal_error = mock.Mock() @@ -97,7 +102,7 @@ def test_loop_reading_aborted(self): 'Fatal read error on pipe transport') def test_loop_reading_aborted_closing(self): - self.loop._proactor.recv.side_effect = ConnectionAbortedError() + self.loop._proactor.recv_into.side_effect = ConnectionAbortedError() tr = self.socket_transport() tr._closing = True @@ -106,7 +111,7 @@ def test_loop_reading_aborted_closing(self): self.assertFalse(tr._fatal_error.called) def test_loop_reading_aborted_is_fatal(self): - self.loop._proactor.recv.side_effect = ConnectionAbortedError() + self.loop._proactor.recv_into.side_effect = ConnectionAbortedError() tr = self.socket_transport() tr._closing = False tr._fatal_error = mock.Mock() @@ -114,7 +119,7 @@ def test_loop_reading_aborted_is_fatal(self): self.assertTrue(tr._fatal_error.called) def test_loop_reading_conn_reset_lost(self): - err = self.loop._proactor.recv.side_effect = ConnectionResetError() + err = self.loop._proactor.recv_into.side_effect = ConnectionResetError() tr = self.socket_transport() tr._closing = False @@ -125,7 +130,7 @@ def test_loop_reading_conn_reset_lost(self): tr._force_close.assert_called_with(err) def test_loop_reading_exception(self): - err = self.loop._proactor.recv.side_effect = (OSError()) + err = self.loop._proactor.recv_into.side_effect = (OSError()) tr = self.socket_transport() tr._fatal_error = mock.Mock() @@ -351,20 +356,31 @@ def test_write_eof_duplex_pipe(self): def test_pause_resume_reading(self): tr = self.socket_transport() - futures = [] - for msg in [b'data1', b'data2', b'data3', b'data4', b'data5', b'']: + index = 0 + msgs = [b'data1', b'data2', b'data3', b'data4', b'data5', b''] + reversed_msgs = list(reversed(msgs)) + + def recv_into(sock, data): f = self.loop.create_future() - f.set_result(msg) - futures.append(f) + msg = reversed_msgs.pop() + + result = f.result + def monkey(): + data[:len(msg)] = msg + return result() + f.result = monkey + + f.set_result(len(msg)) + return f - self.loop._proactor.recv.side_effect = futures + self.loop._proactor.recv_into.side_effect = recv_into self.loop._run_once() self.assertFalse(tr._paused) self.assertTrue(tr.is_reading()) - 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') + + for msg in msgs[:2]: + self.loop._run_once() + self.protocol.data_received.assert_called_with(bytearray(msg)) tr.pause_reading() tr.pause_reading() @@ -372,23 +388,23 @@ def test_pause_resume_reading(self): self.assertFalse(tr.is_reading()) for i in range(10): self.loop._run_once() - self.protocol.data_received.assert_called_with(b'data2') + self.protocol.data_received.assert_called_with(bytearray(msgs[1])) tr.resume_reading() tr.resume_reading() self.assertFalse(tr._paused) self.assertTrue(tr.is_reading()) - 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') + + for msg in msgs[2:4]: + self.loop._run_once() + self.protocol.data_received.assert_called_with(bytearray(msg)) tr.pause_reading() tr.resume_reading() self.loop.call_exception_handler = mock.Mock() self.loop._run_once() self.loop.call_exception_handler.assert_not_called() - self.protocol.data_received.assert_called_with(b'data5') + self.protocol.data_received.assert_called_with(bytearray(msgs[4])) tr.close() self.assertFalse(tr.is_reading()) diff --git a/Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst b/Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst new file mode 100644 index 00000000000000..c08204b9908c63 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst @@ -0,0 +1,3 @@ +Speed up any transport using ``_ProactorReadPipeTransport`` by calling +``recv_into`` instead of ``recv``, thus not creating a new buffer for each +``recv`` call in the transport's read loop. From dee90c86951077730d12caaa68f01c8ead23e4ec Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Wed, 15 Jul 2020 03:07:34 -0600 Subject: [PATCH 037/197] bpo-20183: Convert _locale to the Argument Clinic (GH-14201) --- Modules/_localemodule.c | 290 +++++++++------ Modules/clinic/_localemodule.c.h | 587 +++++++++++++++++++++++++++++++ 2 files changed, 760 insertions(+), 117 deletions(-) create mode 100644 Modules/clinic/_localemodule.c.h diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 0819d0e1924087..0fe2e08b41f9f6 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -53,10 +53,14 @@ get_locale_state(PyObject *m) return (_locale_state *)state; } -/* support functions for formatting floating point numbers */ +#include "clinic/_localemodule.c.h" + +/*[clinic input] +module _locale +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=ed98569b726feada]*/ -PyDoc_STRVAR(setlocale__doc__, -"(integer,string=None) -> string. Activates/queries locale processing."); +/* support functions for formatting floating point numbers */ /* the grouping is terminated by either 0 or CHAR_MAX */ static PyObject* @@ -91,20 +95,27 @@ copy_grouping(const char* s) return result; } -static PyObject* -PyLocale_setlocale(PyObject* self, PyObject* args) +/*[clinic input] +_locale.setlocale + + category: int + locale: str(accept={str, NoneType}) = NULL + / + +Activates/queries locale processing. +[clinic start generated code]*/ + +static PyObject * +_locale_setlocale_impl(PyObject *module, int category, const char *locale) +/*[clinic end generated code: output=a0e777ae5d2ff117 input=dbe18f1d66c57a6a]*/ { - int category; - char *locale = NULL, *result; + char *result; PyObject *result_object; - if (!PyArg_ParseTuple(args, "i|z:setlocale", &category, &locale)) - return NULL; - #if defined(MS_WINDOWS) if (category < LC_MIN || category > LC_MAX) { - PyErr_SetString(get_locale_state(self)->Error, + PyErr_SetString(get_locale_state(module)->Error, "invalid locale category"); return NULL; } @@ -115,7 +126,7 @@ PyLocale_setlocale(PyObject* self, PyObject* args) result = setlocale(category, locale); if (!result) { /* operation failed, no setting was changed */ - PyErr_SetString(get_locale_state(self)->Error, + PyErr_SetString(get_locale_state(module)->Error, "unsupported locale setting"); return NULL; } @@ -126,7 +137,7 @@ PyLocale_setlocale(PyObject* self, PyObject* args) /* get locale */ result = setlocale(category, NULL); if (!result) { - PyErr_SetString(get_locale_state(self)->Error, + PyErr_SetString(get_locale_state(module)->Error, "locale query failed"); return NULL; } @@ -211,11 +222,15 @@ locale_decode_monetary(PyObject *dict, struct lconv *lc) return res; } -PyDoc_STRVAR(localeconv__doc__, -"() -> dict. Returns numeric and monetary locale-specific parameters."); +/*[clinic input] +_locale.localeconv -static PyObject* -PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) +Returns numeric and monetary locale-specific parameters. +[clinic start generated code]*/ + +static PyObject * +_locale_localeconv_impl(PyObject *module) +/*[clinic end generated code: output=43a54515e0a2aef5 input=f1132d15accf4444]*/ { PyObject* result; struct lconv *lc; @@ -307,17 +322,24 @@ PyLocale_localeconv(PyObject* self, PyObject *Py_UNUSED(ignored)) } #if defined(HAVE_WCSCOLL) -PyDoc_STRVAR(strcoll__doc__, -"string,string -> int. Compares two strings according to the locale."); -static PyObject* -PyLocale_strcoll(PyObject* self, PyObject* args) +/*[clinic input] +_locale.strcoll + + os1: unicode + os2: unicode + / + +Compares two strings according to the locale. +[clinic start generated code]*/ + +static PyObject * +_locale_strcoll_impl(PyObject *module, PyObject *os1, PyObject *os2) +/*[clinic end generated code: output=82ddc6d62c76d618 input=693cd02bcbf38dd8]*/ { - PyObject *os1, *os2, *result = NULL; + PyObject *result = NULL; wchar_t *ws1 = NULL, *ws2 = NULL; - if (!PyArg_ParseTuple(args, "UU:strcoll", &os1, &os2)) - return NULL; /* Convert the unicode strings to wchar[]. */ ws1 = PyUnicode_AsWideCharString(os1, NULL); if (ws1 == NULL) @@ -336,23 +358,25 @@ PyLocale_strcoll(PyObject* self, PyObject* args) #endif #ifdef HAVE_WCSXFRM -PyDoc_STRVAR(strxfrm__doc__, -"strxfrm(string) -> string.\n\ -\n\ -Return a string that can be used as a key for locale-aware comparisons."); -static PyObject* -PyLocale_strxfrm(PyObject* self, PyObject* args) +/*[clinic input] +_locale.strxfrm + + string as str: unicode + / + +Return a string that can be used as a key for locale-aware comparisons. +[clinic start generated code]*/ + +static PyObject * +_locale_strxfrm_impl(PyObject *module, PyObject *str) +/*[clinic end generated code: output=3081866ebffc01af input=1378bbe6a88b4780]*/ { - PyObject *str; Py_ssize_t n1; wchar_t *s = NULL, *buf = NULL; size_t n2; PyObject *result = NULL; - if (!PyArg_ParseTuple(args, "U:strxfrm", &str)) - return NULL; - s = PyUnicode_AsWideCharString(str, &n1); if (s == NULL) goto exit; @@ -399,8 +423,15 @@ PyLocale_strxfrm(PyObject* self, PyObject* args) #endif #if defined(MS_WINDOWS) -static PyObject* -PyLocale_getdefaultlocale(PyObject* self, PyObject *Py_UNUSED(ignored)) + +/*[clinic input] +_locale._getdefaultlocale + +[clinic start generated code]*/ + +static PyObject * +_locale__getdefaultlocale_impl(PyObject *module) +/*[clinic end generated code: output=e6254088579534c2 input=003ea41acd17f7c7]*/ { char encoding[20]; char locale[100]; @@ -544,16 +575,20 @@ static struct langinfo_constant{ {0, 0} }; -PyDoc_STRVAR(nl_langinfo__doc__, -"nl_langinfo(key) -> string\n" -"Return the value for the locale information associated with key."); +/*[clinic input] +_locale.nl_langinfo -static PyObject* -PyLocale_nl_langinfo(PyObject* self, PyObject* args) + key as item: int + / + +Return the value for the locale information associated with key. +[clinic start generated code]*/ + +static PyObject * +_locale_nl_langinfo_impl(PyObject *module, int item) +/*[clinic end generated code: output=6aea457b47e077a3 input=00798143eecfeddc]*/ { - int item, i; - if (!PyArg_ParseTuple(args, "i:nl_langinfo", &item)) - return NULL; + int i; /* Check whether this is a supported constant. GNU libc sometimes returns numeric values in the char* return value, which would crash PyUnicode_FromString. */ @@ -572,56 +607,75 @@ PyLocale_nl_langinfo(PyObject* self, PyObject* args) #ifdef HAVE_LIBINTL_H -PyDoc_STRVAR(gettext__doc__, -"gettext(msg) -> string\n" -"Return translation of msg."); +/*[clinic input] +_locale.gettext -static PyObject* -PyIntl_gettext(PyObject* self, PyObject *args) + msg as in: str + / + +gettext(msg) -> string + +Return translation of msg. +[clinic start generated code]*/ + +static PyObject * +_locale_gettext_impl(PyObject *module, const char *in) +/*[clinic end generated code: output=493bb4b38a4704fe input=949fc8efc2bb3bc3]*/ { - char *in; - if (!PyArg_ParseTuple(args, "s", &in)) - return 0; return PyUnicode_DecodeLocale(gettext(in), NULL); } -PyDoc_STRVAR(dgettext__doc__, -"dgettext(domain, msg) -> string\n" -"Return translation of msg in domain."); +/*[clinic input] +_locale.dgettext -static PyObject* -PyIntl_dgettext(PyObject* self, PyObject *args) + domain: str(accept={str, NoneType}) + msg as in: str + / + +dgettext(domain, msg) -> string + +Return translation of msg in domain. +[clinic start generated code]*/ + +static PyObject * +_locale_dgettext_impl(PyObject *module, const char *domain, const char *in) +/*[clinic end generated code: output=3c0cd5287b972c8f input=a277388a635109d8]*/ { - char *domain, *in; - if (!PyArg_ParseTuple(args, "zs", &domain, &in)) - return 0; return PyUnicode_DecodeLocale(dgettext(domain, in), NULL); } -PyDoc_STRVAR(dcgettext__doc__, -"dcgettext(domain, msg, category) -> string\n" -"Return translation of msg in domain and category."); +/*[clinic input] +_locale.dcgettext -static PyObject* -PyIntl_dcgettext(PyObject *self, PyObject *args) + domain: str(accept={str, NoneType}) + msg as msgid: str + category: int + / + +Return translation of msg in domain and category. +[clinic start generated code]*/ + +static PyObject * +_locale_dcgettext_impl(PyObject *module, const char *domain, + const char *msgid, int category) +/*[clinic end generated code: output=0f4cc4fce0aa283f input=ec5f8fed4336de67]*/ { - char *domain, *msgid; - int category; - if (!PyArg_ParseTuple(args, "zsi", &domain, &msgid, &category)) - return 0; return PyUnicode_DecodeLocale(dcgettext(domain,msgid,category), NULL); } -PyDoc_STRVAR(textdomain__doc__, -"textdomain(domain) -> string\n" -"Set the C library's textdmain to domain, returning the new domain."); +/*[clinic input] +_locale.textdomain -static PyObject* -PyIntl_textdomain(PyObject* self, PyObject* args) + domain: str(accept={str, NoneType}) + / + +Set the C library's textdmain to domain, returning the new domain. +[clinic start generated code]*/ + +static PyObject * +_locale_textdomain_impl(PyObject *module, const char *domain) +/*[clinic end generated code: output=7992df06aadec313 input=66359716f5eb1d38]*/ { - char *domain; - if (!PyArg_ParseTuple(args, "z", &domain)) - return 0; domain = textdomain(domain); if (!domain) { PyErr_SetFromErrno(PyExc_OSError); @@ -630,20 +684,26 @@ PyIntl_textdomain(PyObject* self, PyObject* args) return PyUnicode_DecodeLocale(domain, NULL); } -PyDoc_STRVAR(bindtextdomain__doc__, -"bindtextdomain(domain, dir) -> string\n" -"Bind the C library's domain to dir."); +/*[clinic input] +_locale.bindtextdomain -static PyObject* -PyIntl_bindtextdomain(PyObject* self, PyObject*args) + domain: str + dir as dirname_obj: object + / + +Bind the C library's domain to dir. +[clinic start generated code]*/ + +static PyObject * +_locale_bindtextdomain_impl(PyObject *module, const char *domain, + PyObject *dirname_obj) +/*[clinic end generated code: output=6d6f3c7b345d785c input=c0dff085acfe272b]*/ { - const char *domain, *dirname, *current_dirname; - PyObject *dirname_obj, *dirname_bytes = NULL, *result; + const char *dirname, *current_dirname; + PyObject *dirname_bytes = NULL, *result; - if (!PyArg_ParseTuple(args, "sO", &domain, &dirname_obj)) - return 0; if (!strlen(domain)) { - PyErr_SetString(get_locale_state(self)->Error, + PyErr_SetString(get_locale_state(module)->Error, "domain must be a non-empty string"); return 0; } @@ -667,16 +727,22 @@ PyIntl_bindtextdomain(PyObject* self, PyObject*args) } #ifdef HAVE_BIND_TEXTDOMAIN_CODESET -PyDoc_STRVAR(bind_textdomain_codeset__doc__, -"bind_textdomain_codeset(domain, codeset) -> string\n" -"Bind the C library's domain to codeset."); -static PyObject* -PyIntl_bind_textdomain_codeset(PyObject* self,PyObject*args) +/*[clinic input] +_locale.bind_textdomain_codeset + + domain: str + codeset: str(accept={str, NoneType}) + / + +Bind the C library's domain to codeset. +[clinic start generated code]*/ + +static PyObject * +_locale_bind_textdomain_codeset_impl(PyObject *module, const char *domain, + const char *codeset) +/*[clinic end generated code: output=fa452f9c8b1b9e89 input=23fbe3540400f259]*/ { - char *domain,*codeset; - if (!PyArg_ParseTuple(args, "sz", &domain, &codeset)) - return NULL; codeset = bind_textdomain_codeset(domain, codeset); if (codeset) { return PyUnicode_DecodeLocale(codeset, NULL); @@ -688,38 +754,28 @@ PyIntl_bind_textdomain_codeset(PyObject* self,PyObject*args) #endif static struct PyMethodDef PyLocale_Methods[] = { - {"setlocale", (PyCFunction) PyLocale_setlocale, - METH_VARARGS, setlocale__doc__}, - {"localeconv", PyLocale_localeconv, METH_NOARGS, localeconv__doc__}, + _LOCALE_SETLOCALE_METHODDEF + _LOCALE_LOCALECONV_METHODDEF #ifdef HAVE_WCSCOLL - {"strcoll", (PyCFunction) PyLocale_strcoll, - METH_VARARGS, strcoll__doc__}, + _LOCALE_STRCOLL_METHODDEF #endif #ifdef HAVE_WCSXFRM - {"strxfrm", (PyCFunction) PyLocale_strxfrm, - METH_VARARGS, strxfrm__doc__}, + _LOCALE_STRXFRM_METHODDEF #endif #if defined(MS_WINDOWS) - {"_getdefaultlocale", PyLocale_getdefaultlocale, METH_NOARGS}, + _LOCALE__GETDEFAULTLOCALE_METHODDEF #endif #ifdef HAVE_LANGINFO_H - {"nl_langinfo", (PyCFunction) PyLocale_nl_langinfo, - METH_VARARGS, nl_langinfo__doc__}, + _LOCALE_NL_LANGINFO_METHODDEF #endif #ifdef HAVE_LIBINTL_H - {"gettext",(PyCFunction)PyIntl_gettext,METH_VARARGS, - gettext__doc__}, - {"dgettext",(PyCFunction)PyIntl_dgettext,METH_VARARGS, - dgettext__doc__}, - {"dcgettext",(PyCFunction)PyIntl_dcgettext,METH_VARARGS, - dcgettext__doc__}, - {"textdomain",(PyCFunction)PyIntl_textdomain,METH_VARARGS, - textdomain__doc__}, - {"bindtextdomain",(PyCFunction)PyIntl_bindtextdomain,METH_VARARGS, - bindtextdomain__doc__}, + _LOCALE_GETTEXT_METHODDEF + _LOCALE_DGETTEXT_METHODDEF + _LOCALE_DCGETTEXT_METHODDEF + _LOCALE_TEXTDOMAIN_METHODDEF + _LOCALE_BINDTEXTDOMAIN_METHODDEF #ifdef HAVE_BIND_TEXTDOMAIN_CODESET - {"bind_textdomain_codeset",(PyCFunction)PyIntl_bind_textdomain_codeset, - METH_VARARGS, bind_textdomain_codeset__doc__}, + _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF #endif #endif {NULL, NULL} diff --git a/Modules/clinic/_localemodule.c.h b/Modules/clinic/_localemodule.c.h new file mode 100644 index 00000000000000..5d1db3ece796d8 --- /dev/null +++ b/Modules/clinic/_localemodule.c.h @@ -0,0 +1,587 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +PyDoc_STRVAR(_locale_setlocale__doc__, +"setlocale($module, category, locale=, /)\n" +"--\n" +"\n" +"Activates/queries locale processing."); + +#define _LOCALE_SETLOCALE_METHODDEF \ + {"setlocale", (PyCFunction)(void(*)(void))_locale_setlocale, METH_FASTCALL, _locale_setlocale__doc__}, + +static PyObject * +_locale_setlocale_impl(PyObject *module, int category, const char *locale); + +static PyObject * +_locale_setlocale(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int category; + const char *locale = NULL; + + if (!_PyArg_CheckPositional("setlocale", nargs, 1, 2)) { + goto exit; + } + category = _PyLong_AsInt(args[0]); + if (category == -1 && PyErr_Occurred()) { + goto exit; + } + if (nargs < 2) { + goto skip_optional; + } + if (args[1] == Py_None) { + locale = NULL; + } + else if (PyUnicode_Check(args[1])) { + Py_ssize_t locale_length; + locale = PyUnicode_AsUTF8AndSize(args[1], &locale_length); + if (locale == NULL) { + goto exit; + } + if (strlen(locale) != (size_t)locale_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + } + else { + _PyArg_BadArgument("setlocale", "argument 2", "str or None", args[1]); + goto exit; + } +skip_optional: + return_value = _locale_setlocale_impl(module, category, locale); + +exit: + return return_value; +} + +PyDoc_STRVAR(_locale_localeconv__doc__, +"localeconv($module, /)\n" +"--\n" +"\n" +"Returns numeric and monetary locale-specific parameters."); + +#define _LOCALE_LOCALECONV_METHODDEF \ + {"localeconv", (PyCFunction)_locale_localeconv, METH_NOARGS, _locale_localeconv__doc__}, + +static PyObject * +_locale_localeconv_impl(PyObject *module); + +static PyObject * +_locale_localeconv(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _locale_localeconv_impl(module); +} + +#if defined(HAVE_WCSCOLL) + +PyDoc_STRVAR(_locale_strcoll__doc__, +"strcoll($module, os1, os2, /)\n" +"--\n" +"\n" +"Compares two strings according to the locale."); + +#define _LOCALE_STRCOLL_METHODDEF \ + {"strcoll", (PyCFunction)(void(*)(void))_locale_strcoll, METH_FASTCALL, _locale_strcoll__doc__}, + +static PyObject * +_locale_strcoll_impl(PyObject *module, PyObject *os1, PyObject *os2); + +static PyObject * +_locale_strcoll(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *os1; + PyObject *os2; + + if (!_PyArg_CheckPositional("strcoll", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("strcoll", "argument 1", "str", args[0]); + goto exit; + } + if (PyUnicode_READY(args[0]) == -1) { + goto exit; + } + os1 = args[0]; + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("strcoll", "argument 2", "str", args[1]); + goto exit; + } + if (PyUnicode_READY(args[1]) == -1) { + goto exit; + } + os2 = args[1]; + return_value = _locale_strcoll_impl(module, os1, os2); + +exit: + return return_value; +} + +#endif /* defined(HAVE_WCSCOLL) */ + +#if defined(HAVE_WCSXFRM) + +PyDoc_STRVAR(_locale_strxfrm__doc__, +"strxfrm($module, string, /)\n" +"--\n" +"\n" +"Return a string that can be used as a key for locale-aware comparisons."); + +#define _LOCALE_STRXFRM_METHODDEF \ + {"strxfrm", (PyCFunction)_locale_strxfrm, METH_O, _locale_strxfrm__doc__}, + +static PyObject * +_locale_strxfrm_impl(PyObject *module, PyObject *str); + +static PyObject * +_locale_strxfrm(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *str; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("strxfrm", "argument", "str", arg); + goto exit; + } + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + str = arg; + return_value = _locale_strxfrm_impl(module, str); + +exit: + return return_value; +} + +#endif /* defined(HAVE_WCSXFRM) */ + +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(_locale__getdefaultlocale__doc__, +"_getdefaultlocale($module, /)\n" +"--\n" +"\n"); + +#define _LOCALE__GETDEFAULTLOCALE_METHODDEF \ + {"_getdefaultlocale", (PyCFunction)_locale__getdefaultlocale, METH_NOARGS, _locale__getdefaultlocale__doc__}, + +static PyObject * +_locale__getdefaultlocale_impl(PyObject *module); + +static PyObject * +_locale__getdefaultlocale(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _locale__getdefaultlocale_impl(module); +} + +#endif /* defined(MS_WINDOWS) */ + +#if defined(HAVE_LANGINFO_H) + +PyDoc_STRVAR(_locale_nl_langinfo__doc__, +"nl_langinfo($module, key, /)\n" +"--\n" +"\n" +"Return the value for the locale information associated with key."); + +#define _LOCALE_NL_LANGINFO_METHODDEF \ + {"nl_langinfo", (PyCFunction)_locale_nl_langinfo, METH_O, _locale_nl_langinfo__doc__}, + +static PyObject * +_locale_nl_langinfo_impl(PyObject *module, int item); + +static PyObject * +_locale_nl_langinfo(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int item; + + item = _PyLong_AsInt(arg); + if (item == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _locale_nl_langinfo_impl(module, item); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LANGINFO_H) */ + +#if defined(HAVE_LIBINTL_H) + +PyDoc_STRVAR(_locale_gettext__doc__, +"gettext($module, msg, /)\n" +"--\n" +"\n" +"gettext(msg) -> string\n" +"\n" +"Return translation of msg."); + +#define _LOCALE_GETTEXT_METHODDEF \ + {"gettext", (PyCFunction)_locale_gettext, METH_O, _locale_gettext__doc__}, + +static PyObject * +_locale_gettext_impl(PyObject *module, const char *in); + +static PyObject * +_locale_gettext(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + const char *in; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("gettext", "argument", "str", arg); + goto exit; + } + Py_ssize_t in_length; + in = PyUnicode_AsUTF8AndSize(arg, &in_length); + if (in == NULL) { + goto exit; + } + if (strlen(in) != (size_t)in_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + return_value = _locale_gettext_impl(module, in); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LIBINTL_H) */ + +#if defined(HAVE_LIBINTL_H) + +PyDoc_STRVAR(_locale_dgettext__doc__, +"dgettext($module, domain, msg, /)\n" +"--\n" +"\n" +"dgettext(domain, msg) -> string\n" +"\n" +"Return translation of msg in domain."); + +#define _LOCALE_DGETTEXT_METHODDEF \ + {"dgettext", (PyCFunction)(void(*)(void))_locale_dgettext, METH_FASTCALL, _locale_dgettext__doc__}, + +static PyObject * +_locale_dgettext_impl(PyObject *module, const char *domain, const char *in); + +static PyObject * +_locale_dgettext(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *domain; + const char *in; + + if (!_PyArg_CheckPositional("dgettext", nargs, 2, 2)) { + goto exit; + } + if (args[0] == Py_None) { + domain = NULL; + } + else if (PyUnicode_Check(args[0])) { + Py_ssize_t domain_length; + domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length); + if (domain == NULL) { + goto exit; + } + if (strlen(domain) != (size_t)domain_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + } + else { + _PyArg_BadArgument("dgettext", "argument 1", "str or None", args[0]); + goto exit; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("dgettext", "argument 2", "str", args[1]); + goto exit; + } + Py_ssize_t in_length; + in = PyUnicode_AsUTF8AndSize(args[1], &in_length); + if (in == NULL) { + goto exit; + } + if (strlen(in) != (size_t)in_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + return_value = _locale_dgettext_impl(module, domain, in); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LIBINTL_H) */ + +#if defined(HAVE_LIBINTL_H) + +PyDoc_STRVAR(_locale_dcgettext__doc__, +"dcgettext($module, domain, msg, category, /)\n" +"--\n" +"\n" +"Return translation of msg in domain and category."); + +#define _LOCALE_DCGETTEXT_METHODDEF \ + {"dcgettext", (PyCFunction)(void(*)(void))_locale_dcgettext, METH_FASTCALL, _locale_dcgettext__doc__}, + +static PyObject * +_locale_dcgettext_impl(PyObject *module, const char *domain, + const char *msgid, int category); + +static PyObject * +_locale_dcgettext(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *domain; + const char *msgid; + int category; + + if (!_PyArg_CheckPositional("dcgettext", nargs, 3, 3)) { + goto exit; + } + if (args[0] == Py_None) { + domain = NULL; + } + else if (PyUnicode_Check(args[0])) { + Py_ssize_t domain_length; + domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length); + if (domain == NULL) { + goto exit; + } + if (strlen(domain) != (size_t)domain_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + } + else { + _PyArg_BadArgument("dcgettext", "argument 1", "str or None", args[0]); + goto exit; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("dcgettext", "argument 2", "str", args[1]); + goto exit; + } + Py_ssize_t msgid_length; + msgid = PyUnicode_AsUTF8AndSize(args[1], &msgid_length); + if (msgid == NULL) { + goto exit; + } + if (strlen(msgid) != (size_t)msgid_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + category = _PyLong_AsInt(args[2]); + if (category == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _locale_dcgettext_impl(module, domain, msgid, category); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LIBINTL_H) */ + +#if defined(HAVE_LIBINTL_H) + +PyDoc_STRVAR(_locale_textdomain__doc__, +"textdomain($module, domain, /)\n" +"--\n" +"\n" +"Set the C library\'s textdmain to domain, returning the new domain."); + +#define _LOCALE_TEXTDOMAIN_METHODDEF \ + {"textdomain", (PyCFunction)_locale_textdomain, METH_O, _locale_textdomain__doc__}, + +static PyObject * +_locale_textdomain_impl(PyObject *module, const char *domain); + +static PyObject * +_locale_textdomain(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + const char *domain; + + if (arg == Py_None) { + domain = NULL; + } + else if (PyUnicode_Check(arg)) { + Py_ssize_t domain_length; + domain = PyUnicode_AsUTF8AndSize(arg, &domain_length); + if (domain == NULL) { + goto exit; + } + if (strlen(domain) != (size_t)domain_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + } + else { + _PyArg_BadArgument("textdomain", "argument", "str or None", arg); + goto exit; + } + return_value = _locale_textdomain_impl(module, domain); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LIBINTL_H) */ + +#if defined(HAVE_LIBINTL_H) + +PyDoc_STRVAR(_locale_bindtextdomain__doc__, +"bindtextdomain($module, domain, dir, /)\n" +"--\n" +"\n" +"Bind the C library\'s domain to dir."); + +#define _LOCALE_BINDTEXTDOMAIN_METHODDEF \ + {"bindtextdomain", (PyCFunction)(void(*)(void))_locale_bindtextdomain, METH_FASTCALL, _locale_bindtextdomain__doc__}, + +static PyObject * +_locale_bindtextdomain_impl(PyObject *module, const char *domain, + PyObject *dirname_obj); + +static PyObject * +_locale_bindtextdomain(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *domain; + PyObject *dirname_obj; + + if (!_PyArg_CheckPositional("bindtextdomain", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("bindtextdomain", "argument 1", "str", args[0]); + goto exit; + } + Py_ssize_t domain_length; + domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length); + if (domain == NULL) { + goto exit; + } + if (strlen(domain) != (size_t)domain_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + dirname_obj = args[1]; + return_value = _locale_bindtextdomain_impl(module, domain, dirname_obj); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LIBINTL_H) */ + +#if defined(HAVE_LIBINTL_H) && defined(HAVE_BIND_TEXTDOMAIN_CODESET) + +PyDoc_STRVAR(_locale_bind_textdomain_codeset__doc__, +"bind_textdomain_codeset($module, domain, codeset, /)\n" +"--\n" +"\n" +"Bind the C library\'s domain to codeset."); + +#define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF \ + {"bind_textdomain_codeset", (PyCFunction)(void(*)(void))_locale_bind_textdomain_codeset, METH_FASTCALL, _locale_bind_textdomain_codeset__doc__}, + +static PyObject * +_locale_bind_textdomain_codeset_impl(PyObject *module, const char *domain, + const char *codeset); + +static PyObject * +_locale_bind_textdomain_codeset(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *domain; + const char *codeset; + + if (!_PyArg_CheckPositional("bind_textdomain_codeset", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("bind_textdomain_codeset", "argument 1", "str", args[0]); + goto exit; + } + Py_ssize_t domain_length; + domain = PyUnicode_AsUTF8AndSize(args[0], &domain_length); + if (domain == NULL) { + goto exit; + } + if (strlen(domain) != (size_t)domain_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (args[1] == Py_None) { + codeset = NULL; + } + else if (PyUnicode_Check(args[1])) { + Py_ssize_t codeset_length; + codeset = PyUnicode_AsUTF8AndSize(args[1], &codeset_length); + if (codeset == NULL) { + goto exit; + } + if (strlen(codeset) != (size_t)codeset_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + } + else { + _PyArg_BadArgument("bind_textdomain_codeset", "argument 2", "str or None", args[1]); + goto exit; + } + return_value = _locale_bind_textdomain_codeset_impl(module, domain, codeset); + +exit: + return return_value; +} + +#endif /* defined(HAVE_LIBINTL_H) && defined(HAVE_BIND_TEXTDOMAIN_CODESET) */ + +#ifndef _LOCALE_STRCOLL_METHODDEF + #define _LOCALE_STRCOLL_METHODDEF +#endif /* !defined(_LOCALE_STRCOLL_METHODDEF) */ + +#ifndef _LOCALE_STRXFRM_METHODDEF + #define _LOCALE_STRXFRM_METHODDEF +#endif /* !defined(_LOCALE_STRXFRM_METHODDEF) */ + +#ifndef _LOCALE__GETDEFAULTLOCALE_METHODDEF + #define _LOCALE__GETDEFAULTLOCALE_METHODDEF +#endif /* !defined(_LOCALE__GETDEFAULTLOCALE_METHODDEF) */ + +#ifndef _LOCALE_NL_LANGINFO_METHODDEF + #define _LOCALE_NL_LANGINFO_METHODDEF +#endif /* !defined(_LOCALE_NL_LANGINFO_METHODDEF) */ + +#ifndef _LOCALE_GETTEXT_METHODDEF + #define _LOCALE_GETTEXT_METHODDEF +#endif /* !defined(_LOCALE_GETTEXT_METHODDEF) */ + +#ifndef _LOCALE_DGETTEXT_METHODDEF + #define _LOCALE_DGETTEXT_METHODDEF +#endif /* !defined(_LOCALE_DGETTEXT_METHODDEF) */ + +#ifndef _LOCALE_DCGETTEXT_METHODDEF + #define _LOCALE_DCGETTEXT_METHODDEF +#endif /* !defined(_LOCALE_DCGETTEXT_METHODDEF) */ + +#ifndef _LOCALE_TEXTDOMAIN_METHODDEF + #define _LOCALE_TEXTDOMAIN_METHODDEF +#endif /* !defined(_LOCALE_TEXTDOMAIN_METHODDEF) */ + +#ifndef _LOCALE_BINDTEXTDOMAIN_METHODDEF + #define _LOCALE_BINDTEXTDOMAIN_METHODDEF +#endif /* !defined(_LOCALE_BINDTEXTDOMAIN_METHODDEF) */ + +#ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF + #define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF +#endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */ +/*[clinic end generated code: output=fe944779cd572d8e input=a9049054013a1b77]*/ From ad7df484480b0fcfb4b9d72e3a31d1efed65a8ce Mon Sep 17 00:00:00 2001 From: Rishi Date: Wed, 15 Jul 2020 13:51:00 +0200 Subject: [PATCH 038/197] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907). --- Lib/tarfile.py | 2 ++ Lib/test/recursion.tar | Bin 0 -> 516 bytes Lib/test/test_tarfile.py | 7 +++++++ .../2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst | 1 + 4 files changed, 10 insertions(+) create mode 100644 Lib/test/recursion.tar create mode 100644 Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst diff --git a/Lib/tarfile.py b/Lib/tarfile.py index e2b60532f693d4..6769066cabd6fc 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1249,6 +1249,8 @@ def _proc_pax(self, tarfile): length, keyword = match.groups() length = int(length) + if length == 0: + raise InvalidHeaderError("invalid header") value = buf[match.end(2) + 1:match.start(1) + length - 1] # Normally, we could just use "utf-8" as the encoding and "strict" diff --git a/Lib/test/recursion.tar b/Lib/test/recursion.tar new file mode 100644 index 0000000000000000000000000000000000000000..b8237251964983f54ed1966297e887636cd0c5f4 GIT binary patch literal 516 zcmYdFPRz+kEn=W0Fn}74P8%Xw3X=l~85kIuo0>8xq$A1Gm}!7)KUsFc41m#O8A5+e I1_}|j06>QaCIA2c literal 0 HcmV?d00001 diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index d60d35b5be04ae..3ddeb97f5268fe 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -429,6 +429,13 @@ def test_premature_end_of_archive(self): with self.assertRaisesRegex(tarfile.ReadError, "unexpected end of data"): tar.extractfile(t).read() + def test_length_zero_header(self): + # bpo-39017 (CVE-2019-20907): reading a zero-length header should fail + # with an exception + with self.assertRaisesRegex(tarfile.ReadError, "file could not be opened successfully"): + with tarfile.open(support.findfile('recursion.tar')) as tar: + pass + class MiscReadTestBase(CommonReadTest): def requires_name_attribute(self): pass diff --git a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst new file mode 100644 index 00000000000000..ad26676f8b8563 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst @@ -0,0 +1 @@ +Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907). From 961b9e57c335bea8622a901f2b5c5d40b66a3c7d Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Wed, 15 Jul 2020 20:14:11 +0800 Subject: [PATCH 039/197] bpo-41302: Fix build with system libmpdec (GH-21481) Move definition of UNUSED from modified headers of libmpdec to _decimal.c itself. This makes the vendored source closer to the standalone library and fixes build with --with-system-libmpdec. Tested to build fine with either system libmpdec or the vendored one. --- Modules/_decimal/_decimal.c | 5 +++++ Modules/_decimal/libmpdec/mpdecimal.h | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index ff7c647c2220c1..fb4e020f1260e6 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -56,6 +56,11 @@ #define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) + #define UNUSED __attribute__((unused)) +#else + #define UNUSED +#endif /* _Py_DEC_MINALLOC >= MPD_MINALLOC */ #define _Py_DEC_MINALLOC 4 diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index 35ce429f60124a..5a2439690c3509 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -61,12 +61,6 @@ extern "C" { #define MPD_HIDE_SYMBOLS_END #endif -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) - #define UNUSED __attribute__((unused)) -#else - #define UNUSED -#endif - #if defined(_MSC_VER) #include "vccompat.h" #define EXTINLINE extern inline From af9b1f7532e495b76b72830a4e78fa6a2c0ce9fc Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 15 Jul 2020 06:12:05 -0700 Subject: [PATCH 040/197] Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477) --- Python/thread_pthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index cf4e854d829cb5..e6910b3083a892 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -134,7 +134,7 @@ do { \ static pthread_condattr_t *condattr_monotonic = NULL; static void -init_condattr() +init_condattr(void) { #ifdef CONDATTR_MONOTONIC static pthread_condattr_t ca; From 577e0a78a0d684f69f5cd5f1399a5454f0f592ce Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 15 Jul 2020 10:02:14 -0700 Subject: [PATCH 041/197] Fix -Wstring-prototypes warnings in _zoneinfo.c. (GH-21478) --- Modules/_zoneinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index a2883495fe7fdd..319d6c7b7760e2 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -2468,7 +2468,7 @@ clear_strong_cache(const PyTypeObject *const type) } static PyObject * -new_weak_cache() +new_weak_cache(void) { PyObject *weakref_module = PyImport_ImportModule("weakref"); if (weakref_module == NULL) { @@ -2482,7 +2482,7 @@ new_weak_cache() } static int -initialize_caches() +initialize_caches(void) { // TODO: Move to a PyModule_GetState / PEP 573 based caching system. if (TIMEDELTA_CACHE == NULL) { From c1e53d70cbc32a0164e37bcc4cfc64c08adf0341 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Wed, 15 Jul 2020 12:43:00 -0600 Subject: [PATCH 042/197] bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() call (GH-19686) --- Modules/overlapped.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Modules/overlapped.c b/Modules/overlapped.c index 4f0ba85d7983e0..5e7a1bbba76787 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -293,7 +293,7 @@ struct PostCallbackData { }; static VOID CALLBACK -PostToQueueCallback(PVOID lpParameter, BOOL TimerOrWaitFired) +PostToQueueCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired) { struct PostCallbackData *p = (struct PostCallbackData*) lpParameter; @@ -335,8 +335,7 @@ _overlapped_RegisterWaitWithQueue_impl(PyObject *module, HANDLE Object, *pdata = data; if (!RegisterWaitForSingleObject( - &NewWaitObject, Object, (WAITORTIMERCALLBACK)PostToQueueCallback, - pdata, Milliseconds, + &NewWaitObject, Object, PostToQueueCallback, pdata, Milliseconds, WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE)) { PyMem_RawFree(pdata); From 17e73a43e1b73654455abdc34cbb2b3308f7f930 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 15 Jul 2020 22:56:49 +0100 Subject: [PATCH 043/197] bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) --- Lib/test/test_site.py | 36 +++++++++++++++++-- .../2020-07-15-20-15-08.bpo-41304.vNEeYA.rst | 1 + PC/getpathp.c | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 9751c64c99e74a..ec86c645981b36 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -598,12 +598,19 @@ def test_startup_interactivehook_isolated_explicit(self): @unittest.skipUnless(sys.platform == 'win32', "only supported on Windows") class _pthFileTests(unittest.TestCase): - def _create_underpth_exe(self, lines): + def _create_underpth_exe(self, lines, exe_pth=True): + import _winapi temp_dir = tempfile.mkdtemp() self.addCleanup(test.support.rmtree, temp_dir) exe_file = os.path.join(temp_dir, os.path.split(sys.executable)[1]) + dll_src_file = _winapi.GetModuleFileName(sys.dllhandle) + dll_file = os.path.join(temp_dir, os.path.split(dll_src_file)[1]) shutil.copy(sys.executable, exe_file) - _pth_file = os.path.splitext(exe_file)[0] + '._pth' + shutil.copy(dll_src_file, dll_file) + if exe_pth: + _pth_file = os.path.splitext(exe_file)[0] + '._pth' + else: + _pth_file = os.path.splitext(dll_file)[0] + '._pth' with open(_pth_file, 'w') as f: for line in lines: print(line, file=f) @@ -671,5 +678,30 @@ def test_underpth_file(self): self.assertTrue(rc, "sys.path is incorrect") + def test_underpth_dll_file(self): + libpath = os.path.dirname(os.path.dirname(encodings.__file__)) + exe_prefix = os.path.dirname(sys.executable) + exe_file = self._create_underpth_exe([ + 'fake-path-name', + *[libpath for _ in range(200)], + '', + '# comment', + 'import site' + ], exe_pth=False) + sys_prefix = os.path.dirname(exe_file) + env = os.environ.copy() + env['PYTHONPATH'] = 'from-env' + env['PATH'] = '{};{}'.format(exe_prefix, os.getenv('PATH')) + rc = subprocess.call([exe_file, '-c', + 'import sys; sys.exit(not sys.flags.no_site and ' + '%r in sys.path and %r in sys.path and %r not in sys.path and ' + 'all("\\r" not in p and "\\n" not in p for p in sys.path))' % ( + os.path.join(sys_prefix, 'fake-path-name'), + libpath, + os.path.join(sys_prefix, 'from-env'), + )], env=env) + self.assertTrue(rc, "sys.path is incorrect") + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst b/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst new file mode 100644 index 00000000000000..90423e9a665fce --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst @@ -0,0 +1 @@ +Fixes `python3x._pth` being ignored on Windows diff --git a/PC/getpathp.c b/PC/getpathp.c index 0939c5fa9842cd..53da3a6d05faee 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -669,7 +669,7 @@ static int get_pth_filename(PyCalculatePath *calculate, wchar_t *filename, const _PyPathConfig *pathconfig) { - if (get_dllpath(filename) && + if (!get_dllpath(filename) && !change_ext(filename, filename, L"._pth") && exists(filename)) { From c3ac6f3d6e800df6e7c022a13839367904ff4634 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Thu, 16 Jul 2020 09:13:05 +0300 Subject: [PATCH 044/197] bpo-31844: Remove _markupbase.ParserBase.error() (GH-8562) --- Doc/whatsnew/3.9.rst | 5 +++ Lib/_markupbase.py | 35 ++++++++++--------- .../2018-07-30-12-48-17.bpo-31844.0_GKsD.rst | 4 +++ 3 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2018-07-30-12-48-17.bpo-31844.0_GKsD.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index c2db9bc74ccdd6..18cc5588bf2372 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -887,6 +887,11 @@ Removed :func:`asyncio.current_task` and :func:`asyncio.all_tasks` instead. (Contributed by Rémi Lapeyre in :issue:`40967`) +* The ``ParserBase.error()`` method from the private and undocumented ``_markupbase`` + module has been removed. :class:`html.parser.HTMLParser` is the only subclass of + ``ParserBase`` and its ``error()`` implementation has already been removed in + Python 3.5. + (Contributed by Berker Peksag in :issue:`31844`.) Porting to Python 3.9 ===================== diff --git a/Lib/_markupbase.py b/Lib/_markupbase.py index 2af5f1c23b6066..3ad7e279960f7e 100644 --- a/Lib/_markupbase.py +++ b/Lib/_markupbase.py @@ -29,10 +29,6 @@ def __init__(self): raise RuntimeError( "_markupbase.ParserBase must be subclassed") - def error(self, message): - raise NotImplementedError( - "subclasses of ParserBase must override error()") - def reset(self): self.lineno = 1 self.offset = 0 @@ -131,12 +127,11 @@ def parse_declaration(self, i): # also in data attribute specifications of attlist declaration # also link type declaration subsets in linktype declarations # also link attribute specification lists in link declarations - self.error("unsupported '[' char in %s declaration" % decltype) + raise AssertionError("unsupported '[' char in %s declaration" % decltype) else: - self.error("unexpected '[' char in declaration") + raise AssertionError("unexpected '[' char in declaration") else: - self.error( - "unexpected %r char in declaration" % rawdata[j]) + raise AssertionError("unexpected %r char in declaration" % rawdata[j]) if j < 0: return j return -1 # incomplete @@ -156,7 +151,9 @@ def parse_marked_section(self, i, report=1): # look for MS Office ]> ending match= _msmarkedsectionclose.search(rawdata, i+3) else: - self.error('unknown status keyword %r in marked section' % rawdata[i+3:j]) + raise AssertionError( + 'unknown status keyword %r in marked section' % rawdata[i+3:j] + ) if not match: return -1 if report: @@ -168,7 +165,7 @@ def parse_marked_section(self, i, report=1): def parse_comment(self, i, report=1): rawdata = self.rawdata if rawdata[i:i+4] != ' x:JUMP_IF_FALSE_OR_POP z + x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_TRUE_OR_POP z + --> x:POP_JUMP_IF_FALSE y+1 + where y+1 is the instruction following the second test. + */ + case JUMP_IF_FALSE_OR_POP: + switch(target->i_opcode) { + case POP_JUMP_IF_FALSE: + *inst = *target; + break; + case JUMP_ABSOLUTE: + case JUMP_FORWARD: + case JUMP_IF_FALSE_OR_POP: + inst->i_target = target->i_target; + break; + case JUMP_IF_TRUE_OR_POP: + assert (inst->i_target->b_iused == 1); + inst->i_opcode = POP_JUMP_IF_FALSE; + inst->i_target = inst->i_target->b_next; + break; + } + break; + + case JUMP_IF_TRUE_OR_POP: + switch(target->i_opcode) { + case POP_JUMP_IF_TRUE: + *inst = *target; + break; + case JUMP_ABSOLUTE: + case JUMP_FORWARD: + case JUMP_IF_TRUE_OR_POP: + inst->i_target = target->i_target; + break; + case JUMP_IF_FALSE_OR_POP: + assert (inst->i_target->b_iused == 1); + inst->i_opcode = POP_JUMP_IF_TRUE; + inst->i_target = inst->i_target->b_next; + break; + } + break; + + case POP_JUMP_IF_FALSE: + switch(target->i_opcode) { + case JUMP_ABSOLUTE: + case JUMP_FORWARD: + inst->i_target = target->i_target; + break; + } + break; + + case POP_JUMP_IF_TRUE: + switch(target->i_opcode) { + case JUMP_ABSOLUTE: + case JUMP_FORWARD: + inst->i_target = target->i_target; + break; + } + break; + + case JUMP_ABSOLUTE: + case JUMP_FORWARD: + switch(target->i_opcode) { + case JUMP_FORWARD: + inst->i_target = target->i_target; + break; + case JUMP_ABSOLUTE: + case RETURN_VALUE: + case RERAISE: + case RAISE_VARARGS: + lineno = inst->i_lineno; + *inst = *target; + inst->i_lineno = lineno; + break; + } + break; + } + } + return 0; +error: + return -1; +} + + +static void +clean_basic_block(basicblock *bb) { + /* Remove NOPs and any code following a return or re-raise. */ + int dest = 0; + for (int src = 0; src < bb->b_iused; src++) { + switch(bb->b_instr[src].i_opcode) { + case NOP: + /* skip */ + break; + case RETURN_VALUE: + case RERAISE: + bb->b_next = NULL; + bb->b_instr[dest] = bb->b_instr[src]; + dest++; + goto end; + default: + if (dest != src) { + bb->b_instr[dest] = bb->b_instr[src]; + } + dest++; + break; + } + } +end: + assert(dest <= bb->b_iused); + bb->b_iused = dest; +} + +static int +mark_reachable(struct assembler *a) { + basicblock **stack, **sp; + sp = stack = (basicblock **)PyObject_Malloc(sizeof(basicblock *) * a->a_nblocks); + if (stack == NULL) { + return -1; + } + basicblock *entry = a->a_reverse_postorder[0]; + entry->b_reachable = 1; + *sp++ = entry; + while (sp > stack) { + basicblock *b = *(--sp); + if (b->b_next && b->b_next->b_reachable == 0) { + b->b_next->b_reachable = 1; + *sp++ = b->b_next; + } + for (int i = 0; i < b->b_iused; i++) { + basicblock *target; + if (b->b_instr[i].i_jrel || b->b_instr[i].i_jabs) { + target = b->b_instr[i].i_target; + if (target->b_reachable == 0) { + target->b_reachable = 1; + *sp++ = target; + } + } + } + } + PyObject_Free(stack); + return 0; +} + + +/* Perform basic peephole optimizations on a control flow graph. + The consts object should still be in list form to allow new constants + to be appended. + + All transformations keep the code size the same or smaller. + For those that reduce size, the gaps are initially filled with + NOPs. Later those NOPs are removed. +*/ + +static int +optimize_cfg(struct assembler *a, PyObject *consts) +{ + for (int i = 0; i < a->a_nblocks; i++) { + if (optimize_basic_block(a->a_reverse_postorder[i], consts)) { + return -1; + } + clean_basic_block(a->a_reverse_postorder[i]); + assert(a->a_reverse_postorder[i]->b_reachable == 0); + } + if (mark_reachable(a)) { + return -1; + } + /* Delete unreachable instructions */ + for (int i = 0; i < a->a_nblocks; i++) { + if (a->a_reverse_postorder[i]->b_reachable == 0) { + a->a_reverse_postorder[i]->b_iused = 0; + } + } + return 0; +} + +/* Retained for API compatibility. + * Optimization is now done in optimize_cfg */ + +PyObject * +PyCode_Optimize(PyObject *code, PyObject* Py_UNUSED(consts), + PyObject *Py_UNUSED(names), PyObject *Py_UNUSED(lnotab_obj)) +{ + Py_INCREF(code); + return code; +} + diff --git a/Python/importlib.h b/Python/importlib.h index 1fb877a7534197..00d1f3570b3229 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -475,215 +475,214 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 114,101,115,95,102,114,111,122,101,110,250,0,0,0,115,6, 0,0,0,0,2,12,5,10,1,114,91,0,0,0,99,2, 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,3, - 0,0,0,67,0,0,0,115,62,0,0,0,116,0,124,1, + 0,0,0,67,0,0,0,115,58,0,0,0,116,0,124,1, 124,0,131,2,125,2,124,1,116,1,106,2,118,0,114,50, 116,1,106,2,124,1,25,0,125,3,116,3,124,2,124,3, 131,2,1,0,116,1,106,2,124,1,25,0,83,0,116,4, - 124,2,131,1,83,0,100,1,83,0,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, - 5,218,16,115,112,101,99,95,102,114,111,109,95,108,111,97, - 100,101,114,114,15,0,0,0,218,7,109,111,100,117,108,101, - 115,218,5,95,101,120,101,99,218,5,95,108,111,97,100,41, - 4,114,30,0,0,0,114,82,0,0,0,218,4,115,112,101, - 99,218,6,109,111,100,117,108,101,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,17,95,108,111,97,100,95, - 109,111,100,117,108,101,95,115,104,105,109,6,1,0,0,115, - 12,0,0,0,0,6,10,1,10,1,10,1,10,1,10,2, - 114,98,0,0,0,99,1,0,0,0,0,0,0,0,0,0, - 0,0,5,0,0,0,8,0,0,0,67,0,0,0,115,218, - 0,0,0,116,0,124,0,100,1,100,0,131,3,125,1,116, - 1,124,1,100,2,131,2,114,54,122,12,124,1,160,2,124, - 0,161,1,87,0,83,0,4,0,116,3,121,52,1,0,1, - 0,1,0,89,0,110,2,48,0,122,10,124,0,106,4,125, - 2,87,0,110,18,4,0,116,5,121,82,1,0,1,0,1, - 0,89,0,110,18,48,0,124,2,100,0,117,1,114,100,116, - 6,124,2,131,1,83,0,122,10,124,0,106,7,125,3,87, - 0,110,22,4,0,116,5,121,132,1,0,1,0,1,0,100, - 3,125,3,89,0,110,2,48,0,122,10,124,0,106,8,125, - 4,87,0,110,56,4,0,116,5,121,200,1,0,1,0,1, - 0,124,1,100,0,117,0,114,180,100,4,160,9,124,3,161, - 1,6,0,89,0,83,0,100,5,160,9,124,3,124,1,161, - 2,6,0,89,0,83,0,89,0,110,14,48,0,100,6,160, - 9,124,3,124,4,161,2,83,0,100,0,83,0,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,250,13,60,109, - 111,100,117,108,101,32,123,33,114,125,62,250,20,60,109,111, - 100,117,108,101,32,123,33,114,125,32,40,123,33,114,125,41, - 62,250,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,6,0,0, - 0,114,4,0,0,0,114,100,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, - 218,22,95,109,111,100,117,108,101,95,114,101,112,114,95,102, - 114,111,109,95,115,112,101,99,114,1,0,0,0,218,8,95, - 95,102,105,108,101,95,95,114,46,0,0,0,41,5,114,97, - 0,0,0,218,6,108,111,97,100,101,114,114,96,0,0,0, - 114,17,0,0,0,218,8,102,105,108,101,110,97,109,101,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,12, - 95,109,111,100,117,108,101,95,114,101,112,114,22,1,0,0, - 115,46,0,0,0,0,2,12,1,10,4,2,1,12,1,12, - 1,6,1,2,1,10,1,12,1,6,2,8,1,8,4,2, - 1,10,1,12,1,10,1,2,1,10,1,12,1,8,1,14, - 2,22,2,114,112,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, - 0,115,114,0,0,0,101,0,90,1,100,0,90,2,100,1, - 90,3,100,2,100,2,100,2,100,3,156,3,100,4,100,5, - 132,2,90,4,100,6,100,7,132,0,90,5,100,8,100,9, - 132,0,90,6,101,7,100,10,100,11,132,0,131,1,90,8, - 101,8,106,9,100,12,100,11,132,0,131,1,90,8,101,7, - 100,13,100,14,132,0,131,1,90,10,101,7,100,15,100,16, - 132,0,131,1,90,11,101,11,106,9,100,17,100,16,132,0, - 131,1,90,11,100,2,83,0,41,18,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,78,41,3,218,6, - 111,114,105,103,105,110,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,0,0,0,0,3,0,0,0,6,0,0, - 0,2,0,0,0,67,0,0,0,115,54,0,0,0,124,1, - 124,0,95,0,124,2,124,0,95,1,124,3,124,0,95,2, - 124,4,124,0,95,3,124,5,114,32,103,0,110,2,100,0, - 124,0,95,4,100,1,124,0,95,5,100,0,124,0,95,6, - 100,0,83,0,41,2,78,70,41,7,114,17,0,0,0,114, - 110,0,0,0,114,114,0,0,0,114,115,0,0,0,218,26, + 124,2,131,1,83,0,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,5,218,16,115, + 112,101,99,95,102,114,111,109,95,108,111,97,100,101,114,114, + 15,0,0,0,218,7,109,111,100,117,108,101,115,218,5,95, + 101,120,101,99,218,5,95,108,111,97,100,41,4,114,30,0, + 0,0,114,82,0,0,0,218,4,115,112,101,99,218,6,109, + 111,100,117,108,101,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,17,95,108,111,97,100,95,109,111,100,117, + 108,101,95,115,104,105,109,6,1,0,0,115,12,0,0,0, + 0,6,10,1,10,1,10,1,10,1,10,2,114,98,0,0, + 0,99,1,0,0,0,0,0,0,0,0,0,0,0,5,0, + 0,0,8,0,0,0,67,0,0,0,115,210,0,0,0,116, + 0,124,0,100,1,100,0,131,3,125,1,116,1,124,1,100, + 2,131,2,114,54,122,12,124,1,160,2,124,0,161,1,87, + 0,83,0,4,0,116,3,121,52,1,0,1,0,1,0,89, + 0,110,2,48,0,122,10,124,0,106,4,125,2,87,0,110, + 18,4,0,116,5,121,82,1,0,1,0,1,0,89,0,110, + 18,48,0,124,2,100,0,117,1,114,100,116,6,124,2,131, + 1,83,0,122,10,124,0,106,7,125,3,87,0,110,22,4, + 0,116,5,121,132,1,0,1,0,1,0,100,3,125,3,89, + 0,110,2,48,0,122,10,124,0,106,8,125,4,87,0,110, + 52,4,0,116,5,121,196,1,0,1,0,1,0,124,1,100, + 0,117,0,114,180,100,4,160,9,124,3,161,1,6,0,89, + 0,83,0,100,5,160,9,124,3,124,1,161,2,6,0,89, + 0,83,0,48,0,100,6,160,9,124,3,124,4,161,2,83, + 0,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, + 250,13,60,109,111,100,117,108,101,32,123,33,114,125,62,250, + 20,60,109,111,100,117,108,101,32,123,33,114,125,32,40,123, + 33,114,125,41,62,250,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,6,0,0,0,114,4,0,0,0,114,100,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,218,22,95,109,111,100,117,108,101,95,114,101, + 112,114,95,102,114,111,109,95,115,112,101,99,114,1,0,0, + 0,218,8,95,95,102,105,108,101,95,95,114,46,0,0,0, + 41,5,114,97,0,0,0,218,6,108,111,97,100,101,114,114, + 96,0,0,0,114,17,0,0,0,218,8,102,105,108,101,110, + 97,109,101,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,218,12,95,109,111,100,117,108,101,95,114,101,112,114, + 22,1,0,0,115,46,0,0,0,0,2,12,1,10,4,2, + 1,12,1,12,1,6,1,2,1,10,1,12,1,6,2,8, + 1,8,4,2,1,10,1,12,1,10,1,2,1,10,1,12, + 1,8,1,14,2,18,2,114,112,0,0,0,99,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, + 0,64,0,0,0,115,114,0,0,0,101,0,90,1,100,0, + 90,2,100,1,90,3,100,2,100,2,100,2,100,3,156,3, + 100,4,100,5,132,2,90,4,100,6,100,7,132,0,90,5, + 100,8,100,9,132,0,90,6,101,7,100,10,100,11,132,0, + 131,1,90,8,101,8,106,9,100,12,100,11,132,0,131,1, + 90,8,101,7,100,13,100,14,132,0,131,1,90,10,101,7, + 100,15,100,16,132,0,131,1,90,11,101,11,106,9,100,17, + 100,16,132,0,131,1,90,11,100,2,83,0,41,18,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,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,30,0,0,0,114,17,0,0,0,114,110, - 0,0,0,114,114,0,0,0,114,115,0,0,0,114,116,0, + 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,78, + 41,3,218,6,111,114,105,103,105,110,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,0,0,0,0,3,0,0, + 0,6,0,0,0,2,0,0,0,67,0,0,0,115,54,0, + 0,0,124,1,124,0,95,0,124,2,124,0,95,1,124,3, + 124,0,95,2,124,4,124,0,95,3,124,5,114,32,103,0, + 110,2,100,0,124,0,95,4,100,1,124,0,95,5,100,0, + 124,0,95,6,100,0,83,0,41,2,78,70,41,7,114,17, + 0,0,0,114,110,0,0,0,114,114,0,0,0,114,115,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,30,0,0,0,114,17,0, + 0,0,114,110,0,0,0,114,114,0,0,0,114,115,0,0, + 0,114,116,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,31,0,0,0,95,1,0,0,115,14, + 0,0,0,0,2,6,1,6,1,6,1,6,1,14,3,6, + 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,0, + 0,0,0,2,0,0,0,6,0,0,0,67,0,0,0,115, + 102,0,0,0,100,1,160,0,124,0,106,1,161,1,100,2, + 160,0,124,0,106,2,161,1,103,2,125,1,124,0,106,3, + 100,0,117,1,114,52,124,1,160,4,100,3,160,0,124,0, + 106,3,161,1,161,1,1,0,124,0,106,5,100,0,117,1, + 114,80,124,1,160,4,100,4,160,0,124,0,106,5,161,1, + 161,1,1,0,100,5,160,0,124,0,106,6,106,7,100,6, + 160,8,124,1,161,1,161,2,83,0,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, + 46,0,0,0,114,17,0,0,0,114,110,0,0,0,114,114, + 0,0,0,218,6,97,112,112,101,110,100,114,117,0,0,0, + 218,9,95,95,99,108,97,115,115,95,95,114,1,0,0,0, + 218,4,106,111,105,110,41,2,114,30,0,0,0,114,56,0, 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,114,31,0,0,0,95,1,0,0,115,14,0,0,0,0, - 2,6,1,6,1,6,1,6,1,14,3,6,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,0,0,0,0,2, - 0,0,0,6,0,0,0,67,0,0,0,115,102,0,0,0, - 100,1,160,0,124,0,106,1,161,1,100,2,160,0,124,0, - 106,2,161,1,103,2,125,1,124,0,106,3,100,0,117,1, - 114,52,124,1,160,4,100,3,160,0,124,0,106,3,161,1, - 161,1,1,0,124,0,106,5,100,0,117,1,114,80,124,1, - 160,4,100,4,160,0,124,0,106,5,161,1,161,1,1,0, - 100,5,160,0,124,0,106,6,106,7,100,6,160,8,124,1, - 161,1,161,2,83,0,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,46,0,0,0, - 114,17,0,0,0,114,110,0,0,0,114,114,0,0,0,218, - 6,97,112,112,101,110,100,114,117,0,0,0,218,9,95,95, - 99,108,97,115,115,95,95,114,1,0,0,0,218,4,106,111, - 105,110,41,2,114,30,0,0,0,114,56,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,49,0, - 0,0,107,1,0,0,115,20,0,0,0,0,1,10,1,10, - 255,4,2,10,1,18,1,10,1,8,1,4,255,6,2,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,0,0,0, - 0,3,0,0,0,8,0,0,0,67,0,0,0,115,106,0, - 0,0,124,0,106,0,125,2,122,72,124,0,106,1,124,1, - 106,1,107,2,111,76,124,0,106,2,124,1,106,2,107,2, - 111,76,124,0,106,3,124,1,106,3,107,2,111,76,124,2, - 124,1,106,0,107,2,111,76,124,0,106,4,124,1,106,4, - 107,2,111,76,124,0,106,5,124,1,106,5,107,2,87,0, - 83,0,4,0,116,6,121,100,1,0,1,0,1,0,116,7, - 6,0,89,0,83,0,48,0,100,0,83,0,114,13,0,0, + 0,114,49,0,0,0,107,1,0,0,115,20,0,0,0,0, + 1,10,1,10,255,4,2,10,1,18,1,10,1,8,1,4, + 255,6,2,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,0,0,0,0,3,0,0,0,8,0,0,0,67,0,0, + 0,115,102,0,0,0,124,0,106,0,125,2,122,72,124,0, + 106,1,124,1,106,1,107,2,111,76,124,0,106,2,124,1, + 106,2,107,2,111,76,124,0,106,3,124,1,106,3,107,2, + 111,76,124,2,124,1,106,0,107,2,111,76,124,0,106,4, + 124,1,106,4,107,2,111,76,124,0,106,5,124,1,106,5, + 107,2,87,0,83,0,4,0,116,6,121,100,1,0,1,0, + 1,0,116,7,6,0,89,0,83,0,48,0,114,13,0,0, 0,41,8,114,117,0,0,0,114,17,0,0,0,114,110,0, 0,0,114,114,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,107,0, @@ -716,335 +715,477 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 0,0,114,10,0,0,0,114,11,0,0,0,114,123,0,0, 0,138,1,0,0,115,2,0,0,0,0,2,99,1,0,0, 0,0,0,0,0,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,36,0,0,0,124,0,106,0,100,1, + 0,67,0,0,0,115,32,0,0,0,124,0,106,0,100,1, 117,0,114,26,124,0,106,1,160,2,100,2,161,1,100,3, - 25,0,83,0,124,0,106,1,83,0,100,1,83,0,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,218,1,46,114,22,0,0,0,41,3,114,117,0, - 0,0,114,17,0,0,0,218,10,114,112,97,114,116,105,116, - 105,111,110,114,48,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,6,112,97,114,101,110,116,142, - 1,0,0,115,6,0,0,0,0,3,10,1,16,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,0,0,0,0,1,0, - 0,0,1,0,0,0,67,0,0,0,115,6,0,0,0,124, - 0,106,0,83,0,114,13,0,0,0,41,1,114,118,0,0, - 0,114,48,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,0,0,0,114,124,0,0,0,150,1,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,0,0,0,0,2,0,0,0,2, - 0,0,0,67,0,0,0,115,14,0,0,0,116,0,124,1, - 131,1,124,0,95,1,100,0,83,0,114,13,0,0,0,41, - 2,218,4,98,111,111,108,114,118,0,0,0,41,2,114,30, - 0,0,0,218,5,118,97,108,117,101,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,124,0,0,0,154,1, - 0,0,115,2,0,0,0,0,2,41,12,114,1,0,0,0, - 114,0,0,0,0,114,2,0,0,0,114,3,0,0,0,114, - 31,0,0,0,114,49,0,0,0,114,126,0,0,0,218,8, - 112,114,111,112,101,114,116,121,114,123,0,0,0,218,6,115, - 101,116,116,101,114,114,131,0,0,0,114,124,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,114,113,0,0,0,58,1,0,0,115,32,0,0, - 0,8,1,4,36,4,1,2,255,12,12,8,10,8,12,2, - 1,10,8,4,1,10,3,2,1,10,7,2,1,10,3,4, - 1,114,113,0,0,0,169,2,114,114,0,0,0,114,116,0, - 0,0,99,2,0,0,0,0,0,0,0,2,0,0,0,6, - 0,0,0,8,0,0,0,67,0,0,0,115,152,0,0,0, - 116,0,124,1,100,1,131,2,114,74,116,1,100,2,117,0, - 114,22,116,2,130,1,116,1,106,3,125,4,124,3,100,2, - 117,0,114,48,124,4,124,0,124,1,100,3,141,2,83,0, - 124,3,114,56,103,0,110,2,100,2,125,5,124,4,124,0, - 124,1,124,5,100,4,141,3,83,0,124,3,100,2,117,0, - 114,136,116,0,124,1,100,5,131,2,114,132,122,14,124,1, - 160,4,124,0,161,1,125,3,87,0,113,136,4,0,116,5, - 121,128,1,0,1,0,1,0,100,2,125,3,89,0,113,136, - 48,0,110,4,100,6,125,3,116,6,124,0,124,1,124,2, - 124,3,100,7,141,4,83,0,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,90,12,103,101,116,95,102,105,108,101,110,97,109,101,78, - 41,1,114,110,0,0,0,41,2,114,110,0,0,0,114,117, - 0,0,0,114,116,0,0,0,70,114,136,0,0,0,41,7, - 114,4,0,0,0,114,127,0,0,0,114,128,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,116,0,0,0,114,80,0, - 0,0,114,113,0,0,0,41,6,114,17,0,0,0,114,110, - 0,0,0,114,114,0,0,0,114,116,0,0,0,114,137,0, - 0,0,90,6,115,101,97,114,99,104,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,92,0,0,0,159,1, - 0,0,115,36,0,0,0,0,2,10,1,8,1,4,1,6, - 2,8,1,12,1,12,1,6,1,2,255,6,3,8,1,10, - 1,2,1,14,1,12,1,12,3,4,2,114,92,0,0,0, - 99,3,0,0,0,0,0,0,0,0,0,0,0,8,0,0, - 0,8,0,0,0,67,0,0,0,115,42,1,0,0,122,10, - 124,0,106,0,125,3,87,0,110,18,4,0,116,1,121,28, - 1,0,1,0,1,0,89,0,110,14,48,0,124,3,100,0, - 117,1,114,42,124,3,83,0,124,0,106,2,125,4,124,1, - 100,0,117,0,114,86,122,10,124,0,106,3,125,1,87,0, - 110,18,4,0,116,1,121,84,1,0,1,0,1,0,89,0, - 110,2,48,0,122,10,124,0,106,4,125,5,87,0,110,22, - 4,0,116,1,121,118,1,0,1,0,1,0,100,0,125,5, - 89,0,110,2,48,0,124,2,100,0,117,0,114,176,124,5, - 100,0,117,0,114,172,122,10,124,1,106,5,125,2,87,0, - 113,176,4,0,116,1,121,168,1,0,1,0,1,0,100,0, - 125,2,89,0,113,176,48,0,110,4,124,5,125,2,122,10, - 124,0,106,6,125,6,87,0,110,22,4,0,116,1,121,208, - 1,0,1,0,1,0,100,0,125,6,89,0,110,2,48,0, - 122,14,116,7,124,0,106,8,131,1,125,7,87,0,110,22, - 4,0,116,1,121,246,1,0,1,0,1,0,100,0,125,7, - 89,0,110,2,48,0,116,9,124,4,124,1,124,2,100,1, - 141,3,125,3,124,5,100,0,117,0,144,1,114,20,100,2, - 110,2,100,3,124,3,95,10,124,6,124,3,95,11,124,7, - 124,3,95,12,124,3,83,0,41,4,78,169,1,114,114,0, - 0,0,70,84,41,13,114,106,0,0,0,114,107,0,0,0, - 114,1,0,0,0,114,99,0,0,0,114,109,0,0,0,218, - 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,113,0,0,0,114,118,0,0,0,114,123, - 0,0,0,114,117,0,0,0,41,8,114,97,0,0,0,114, - 110,0,0,0,114,114,0,0,0,114,96,0,0,0,114,17, - 0,0,0,90,8,108,111,99,97,116,105,111,110,114,123,0, - 0,0,114,117,0,0,0,114,10,0,0,0,114,10,0,0, - 0,114,11,0,0,0,218,17,95,115,112,101,99,95,102,114, - 111,109,95,109,111,100,117,108,101,185,1,0,0,115,72,0, - 0,0,0,2,2,1,10,1,12,1,6,2,8,1,4,2, - 6,1,8,1,2,1,10,1,12,2,6,1,2,1,10,1, - 12,1,10,1,8,1,8,1,2,1,10,1,12,1,12,2, - 4,1,2,1,10,1,12,1,10,1,2,1,14,1,12,1, - 10,2,14,1,20,1,6,1,6,1,114,143,0,0,0,70, - 169,1,218,8,111,118,101,114,114,105,100,101,99,2,0,0, - 0,0,0,0,0,1,0,0,0,5,0,0,0,8,0,0, - 0,67,0,0,0,115,210,1,0,0,124,2,115,20,116,0, - 124,1,100,1,100,0,131,3,100,0,117,0,114,52,122,12, - 124,0,106,1,124,1,95,2,87,0,110,18,4,0,116,3, - 121,50,1,0,1,0,1,0,89,0,110,2,48,0,124,2, - 115,72,116,0,124,1,100,2,100,0,131,3,100,0,117,0, - 114,174,124,0,106,4,125,3,124,3,100,0,117,0,114,144, - 124,0,106,5,100,0,117,1,114,144,116,6,100,0,117,0, - 114,108,116,7,130,1,116,6,106,8,125,4,124,4,160,9, - 124,4,161,1,125,3,124,0,106,5,124,3,95,10,124,3, - 124,0,95,4,100,0,124,1,95,11,122,10,124,3,124,1, - 95,12,87,0,110,18,4,0,116,3,121,172,1,0,1,0, - 1,0,89,0,110,2,48,0,124,2,115,194,116,0,124,1, - 100,3,100,0,131,3,100,0,117,0,114,226,122,12,124,0, - 106,13,124,1,95,14,87,0,110,18,4,0,116,3,121,224, - 1,0,1,0,1,0,89,0,110,2,48,0,122,10,124,0, - 124,1,95,15,87,0,110,18,4,0,116,3,121,254,1,0, - 1,0,1,0,89,0,110,2,48,0,124,2,144,1,115,24, - 116,0,124,1,100,4,100,0,131,3,100,0,117,0,144,1, - 114,70,124,0,106,5,100,0,117,1,144,1,114,70,122,12, - 124,0,106,5,124,1,95,16,87,0,110,20,4,0,116,3, - 144,1,121,68,1,0,1,0,1,0,89,0,110,2,48,0, - 124,0,106,17,144,1,114,206,124,2,144,1,115,102,116,0, - 124,1,100,5,100,0,131,3,100,0,117,0,144,1,114,136, - 122,12,124,0,106,18,124,1,95,11,87,0,110,20,4,0, - 116,3,144,1,121,134,1,0,1,0,1,0,89,0,110,2, - 48,0,124,2,144,1,115,160,116,0,124,1,100,6,100,0, - 131,3,100,0,117,0,144,1,114,206,124,0,106,19,100,0, - 117,1,144,1,114,206,122,12,124,0,106,19,124,1,95,20, - 87,0,110,20,4,0,116,3,144,1,121,204,1,0,1,0, - 1,0,89,0,110,2,48,0,124,1,83,0,41,7,78,114, - 1,0,0,0,114,99,0,0,0,218,11,95,95,112,97,99, - 107,97,103,101,95,95,114,142,0,0,0,114,109,0,0,0, - 114,140,0,0,0,41,21,114,6,0,0,0,114,17,0,0, - 0,114,1,0,0,0,114,107,0,0,0,114,110,0,0,0, - 114,117,0,0,0,114,127,0,0,0,114,128,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,90,5,95,112,97,116, - 104,114,109,0,0,0,114,99,0,0,0,114,131,0,0,0, - 114,146,0,0,0,114,106,0,0,0,114,142,0,0,0,114, - 124,0,0,0,114,114,0,0,0,114,123,0,0,0,114,140, - 0,0,0,41,5,114,96,0,0,0,114,97,0,0,0,114, - 145,0,0,0,114,110,0,0,0,114,147,0,0,0,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,218,18,95, - 105,110,105,116,95,109,111,100,117,108,101,95,97,116,116,114, - 115,230,1,0,0,115,96,0,0,0,0,4,20,1,2,1, - 12,1,12,1,6,2,20,1,6,1,8,2,10,1,8,1, - 4,1,6,2,10,1,8,1,6,11,6,1,2,1,10,1, - 12,1,6,2,20,1,2,1,12,1,12,1,6,2,2,1, - 10,1,12,1,6,2,24,1,12,1,2,1,12,1,14,1, - 6,2,8,1,24,1,2,1,12,1,14,1,6,2,24,1, - 12,1,2,1,12,1,14,1,6,1,114,149,0,0,0,99, - 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, - 3,0,0,0,67,0,0,0,115,82,0,0,0,100,1,125, - 1,116,0,124,0,106,1,100,2,131,2,114,30,124,0,106, - 1,160,2,124,0,161,1,125,1,110,20,116,0,124,0,106, - 1,100,3,131,2,114,50,116,3,100,4,131,1,130,1,124, - 1,100,1,117,0,114,68,116,4,124,0,106,5,131,1,125, - 1,116,6,124,0,124,1,131,2,1,0,124,1,83,0,41, - 5,122,43,67,114,101,97,116,101,32,97,32,109,111,100,117, - 108,101,32,98,97,115,101,100,32,111,110,32,116,104,101,32, - 112,114,111,118,105,100,101,100,32,115,112,101,99,46,78,218, - 13,99,114,101,97,116,101,95,109,111,100,117,108,101,218,11, - 101,120,101,99,95,109,111,100,117,108,101,122,66,108,111,97, - 100,101,114,115,32,116,104,97,116,32,100,101,102,105,110,101, - 32,101,120,101,99,95,109,111,100,117,108,101,40,41,32,109, - 117,115,116,32,97,108,115,111,32,100,101,102,105,110,101,32, - 99,114,101,97,116,101,95,109,111,100,117,108,101,40,41,41, - 7,114,4,0,0,0,114,110,0,0,0,114,150,0,0,0, - 114,80,0,0,0,114,18,0,0,0,114,17,0,0,0,114, - 149,0,0,0,169,2,114,96,0,0,0,114,97,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 16,109,111,100,117,108,101,95,102,114,111,109,95,115,112,101, - 99,46,2,0,0,115,18,0,0,0,0,3,4,1,12,3, - 14,1,12,1,8,2,8,1,10,1,10,1,114,153,0,0, - 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,4,0,0,0,67,0,0,0,115,106,0,0,0,124, - 0,106,0,100,1,117,0,114,14,100,2,110,4,124,0,106, - 0,125,1,124,0,106,1,100,1,117,0,114,66,124,0,106, - 2,100,1,117,0,114,50,100,3,160,3,124,1,161,1,83, - 0,100,4,160,3,124,1,124,0,106,2,161,2,83,0,110, - 36,124,0,106,4,114,86,100,5,160,3,124,1,124,0,106, - 1,161,2,83,0,100,6,160,3,124,0,106,0,124,0,106, - 1,161,2,83,0,100,1,83,0,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,101,0,0,0,114,102,0,0,0,114,103, - 0,0,0,114,104,0,0,0,250,18,60,109,111,100,117,108, - 101,32,123,33,114,125,32,40,123,125,41,62,41,5,114,17, - 0,0,0,114,114,0,0,0,114,110,0,0,0,114,46,0, - 0,0,114,124,0,0,0,41,2,114,96,0,0,0,114,17, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,114,108,0,0,0,63,2,0,0,115,16,0,0,0, - 0,3,20,1,10,1,10,1,10,2,16,2,6,1,14,2, - 114,108,0,0,0,99,2,0,0,0,0,0,0,0,0,0, - 0,0,4,0,0,0,10,0,0,0,67,0,0,0,115,250, - 0,0,0,124,0,106,0,125,2,116,1,124,2,131,1,143, - 216,1,0,116,2,106,3,160,4,124,2,161,1,124,1,117, - 1,114,54,100,1,160,5,124,2,161,1,125,3,116,6,124, - 3,124,2,100,2,141,2,130,1,122,132,124,0,106,7,100, - 3,117,0,114,106,124,0,106,8,100,3,117,0,114,90,116, - 6,100,4,124,0,106,0,100,2,141,2,130,1,116,9,124, - 0,124,1,100,5,100,6,141,3,1,0,110,52,116,9,124, - 0,124,1,100,5,100,6,141,3,1,0,116,10,124,0,106, - 7,100,7,131,2,115,146,124,0,106,7,160,11,124,2,161, - 1,1,0,110,12,124,0,106,7,160,12,124,1,161,1,1, - 0,87,0,116,2,106,3,160,13,124,0,106,0,161,1,125, - 1,124,1,116,2,106,3,124,0,106,0,60,0,110,28,116, - 2,106,3,160,13,124,0,106,0,161,1,125,1,124,1,116, - 2,106,3,124,0,106,0,60,0,48,0,87,0,100,3,4, - 0,4,0,131,3,1,0,110,16,49,0,115,236,48,0,1, - 0,1,0,1,0,89,0,1,0,124,1,83,0,41,8,122, - 70,69,120,101,99,117,116,101,32,116,104,101,32,115,112,101, - 99,39,115,32,115,112,101,99,105,102,105,101,100,32,109,111, - 100,117,108,101,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,16,0,0,0,78,250,14,109, - 105,115,115,105,110,103,32,108,111,97,100,101,114,84,114,144, - 0,0,0,114,151,0,0,0,41,14,114,17,0,0,0,114, - 51,0,0,0,114,15,0,0,0,114,93,0,0,0,114,35, - 0,0,0,114,46,0,0,0,114,80,0,0,0,114,110,0, - 0,0,114,117,0,0,0,114,149,0,0,0,114,4,0,0, - 0,218,11,108,111,97,100,95,109,111,100,117,108,101,114,151, - 0,0,0,218,3,112,111,112,41,4,114,96,0,0,0,114, - 97,0,0,0,114,17,0,0,0,218,3,109,115,103,114,10, - 0,0,0,114,10,0,0,0,114,11,0,0,0,114,94,0, - 0,0,80,2,0,0,115,38,0,0,0,0,2,6,1,10, - 1,16,1,10,1,12,1,2,1,10,1,10,1,14,2,16, - 2,14,1,12,4,14,2,14,4,14,1,14,255,14,1,44, - 1,114,94,0,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, - 20,1,0,0,122,18,124,0,106,0,160,1,124,0,106,2, - 161,1,1,0,87,0,110,52,1,0,1,0,1,0,124,0, - 106,2,116,3,106,4,118,0,114,64,116,3,106,4,160,5, - 124,0,106,2,161,1,125,1,124,1,116,3,106,4,124,0, - 106,2,60,0,130,0,89,0,110,2,48,0,116,3,106,4, + 25,0,83,0,124,0,106,1,83,0,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,218, + 1,46,114,22,0,0,0,41,3,114,117,0,0,0,114,17, + 0,0,0,218,10,114,112,97,114,116,105,116,105,111,110,114, + 48,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,6,112,97,114,101,110,116,142,1,0,0,115, + 6,0,0,0,0,3,10,1,16,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,0,0,0,0,1,0,0,0,1,0, + 0,0,67,0,0,0,115,6,0,0,0,124,0,106,0,83, + 0,114,13,0,0,0,41,1,114,118,0,0,0,114,48,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,114,124,0,0,0,150,1,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,0,0,0,0,2,0,0,0,2,0,0,0,67, + 0,0,0,115,14,0,0,0,116,0,124,1,131,1,124,0, + 95,1,100,0,83,0,114,13,0,0,0,41,2,218,4,98, + 111,111,108,114,118,0,0,0,41,2,114,30,0,0,0,218, + 5,118,97,108,117,101,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,124,0,0,0,154,1,0,0,115,2, + 0,0,0,0,2,41,12,114,1,0,0,0,114,0,0,0, + 0,114,2,0,0,0,114,3,0,0,0,114,31,0,0,0, + 114,49,0,0,0,114,126,0,0,0,218,8,112,114,111,112, + 101,114,116,121,114,123,0,0,0,218,6,115,101,116,116,101, + 114,114,131,0,0,0,114,124,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 113,0,0,0,58,1,0,0,115,32,0,0,0,8,1,4, + 36,4,1,2,255,12,12,8,10,8,12,2,1,10,8,4, + 1,10,3,2,1,10,7,2,1,10,3,4,1,114,113,0, + 0,0,169,2,114,114,0,0,0,114,116,0,0,0,99,2, + 0,0,0,0,0,0,0,2,0,0,0,6,0,0,0,8, + 0,0,0,67,0,0,0,115,150,0,0,0,116,0,124,1, + 100,1,131,2,114,74,116,1,100,2,117,0,114,22,116,2, + 130,1,116,1,106,3,125,4,124,3,100,2,117,0,114,48, + 124,4,124,0,124,1,100,3,141,2,83,0,124,3,114,56, + 103,0,110,2,100,2,125,5,124,4,124,0,124,1,124,5, + 100,4,141,3,83,0,124,3,100,2,117,0,114,134,116,0, + 124,1,100,5,131,2,114,130,122,14,124,1,160,4,124,0, + 161,1,125,3,87,0,110,26,4,0,116,5,121,128,1,0, + 1,0,1,0,100,2,125,3,89,0,110,6,48,0,100,6, + 125,3,116,6,124,0,124,1,124,2,124,3,100,7,141,4, + 83,0,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,90,12,103,101,116, + 95,102,105,108,101,110,97,109,101,78,41,1,114,110,0,0, + 0,41,2,114,110,0,0,0,114,117,0,0,0,114,116,0, + 0,0,70,114,136,0,0,0,41,7,114,4,0,0,0,114, + 127,0,0,0,114,128,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,116,0,0,0,114,80,0,0,0,114,113,0,0, + 0,41,6,114,17,0,0,0,114,110,0,0,0,114,114,0, + 0,0,114,116,0,0,0,114,137,0,0,0,90,6,115,101, + 97,114,99,104,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,92,0,0,0,159,1,0,0,115,36,0,0, + 0,0,2,10,1,8,1,4,1,6,2,8,1,12,1,12, + 1,6,1,2,255,6,3,8,1,10,1,2,1,14,1,12, + 1,10,3,4,2,114,92,0,0,0,99,3,0,0,0,0, + 0,0,0,0,0,0,0,8,0,0,0,8,0,0,0,67, + 0,0,0,115,40,1,0,0,122,10,124,0,106,0,125,3, + 87,0,110,18,4,0,116,1,121,28,1,0,1,0,1,0, + 89,0,110,14,48,0,124,3,100,0,117,1,114,42,124,3, + 83,0,124,0,106,2,125,4,124,1,100,0,117,0,114,86, + 122,10,124,0,106,3,125,1,87,0,110,18,4,0,116,1, + 121,84,1,0,1,0,1,0,89,0,110,2,48,0,122,10, + 124,0,106,4,125,5,87,0,110,22,4,0,116,1,121,118, + 1,0,1,0,1,0,100,0,125,5,89,0,110,2,48,0, + 124,2,100,0,117,0,114,174,124,5,100,0,117,0,114,170, + 122,10,124,1,106,5,125,2,87,0,110,26,4,0,116,1, + 121,168,1,0,1,0,1,0,100,0,125,2,89,0,110,6, + 48,0,124,5,125,2,122,10,124,0,106,6,125,6,87,0, + 110,22,4,0,116,1,121,206,1,0,1,0,1,0,100,0, + 125,6,89,0,110,2,48,0,122,14,116,7,124,0,106,8, + 131,1,125,7,87,0,110,22,4,0,116,1,121,244,1,0, + 1,0,1,0,100,0,125,7,89,0,110,2,48,0,116,9, + 124,4,124,1,124,2,100,1,141,3,125,3,124,5,100,0, + 117,0,144,1,114,18,100,2,110,2,100,3,124,3,95,10, + 124,6,124,3,95,11,124,7,124,3,95,12,124,3,83,0, + 41,4,78,169,1,114,114,0,0,0,70,84,41,13,114,106, + 0,0,0,114,107,0,0,0,114,1,0,0,0,114,99,0, + 0,0,114,109,0,0,0,218,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,113,0,0, + 0,114,118,0,0,0,114,123,0,0,0,114,117,0,0,0, + 41,8,114,97,0,0,0,114,110,0,0,0,114,114,0,0, + 0,114,96,0,0,0,114,17,0,0,0,90,8,108,111,99, + 97,116,105,111,110,114,123,0,0,0,114,117,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,17, + 95,115,112,101,99,95,102,114,111,109,95,109,111,100,117,108, + 101,185,1,0,0,115,72,0,0,0,0,2,2,1,10,1, + 12,1,6,2,8,1,4,2,6,1,8,1,2,1,10,1, + 12,2,6,1,2,1,10,1,12,1,10,1,8,1,8,1, + 2,1,10,1,12,1,10,2,4,1,2,1,10,1,12,1, + 10,1,2,1,14,1,12,1,10,2,14,1,20,1,6,1, + 6,1,114,143,0,0,0,70,169,1,218,8,111,118,101,114, + 114,105,100,101,99,2,0,0,0,0,0,0,0,1,0,0, + 0,5,0,0,0,8,0,0,0,67,0,0,0,115,210,1, + 0,0,124,2,115,20,116,0,124,1,100,1,100,0,131,3, + 100,0,117,0,114,52,122,12,124,0,106,1,124,1,95,2, + 87,0,110,18,4,0,116,3,121,50,1,0,1,0,1,0, + 89,0,110,2,48,0,124,2,115,72,116,0,124,1,100,2, + 100,0,131,3,100,0,117,0,114,174,124,0,106,4,125,3, + 124,3,100,0,117,0,114,144,124,0,106,5,100,0,117,1, + 114,144,116,6,100,0,117,0,114,108,116,7,130,1,116,6, + 106,8,125,4,124,4,160,9,124,4,161,1,125,3,124,0, + 106,5,124,3,95,10,124,3,124,0,95,4,100,0,124,1, + 95,11,122,10,124,3,124,1,95,12,87,0,110,18,4,0, + 116,3,121,172,1,0,1,0,1,0,89,0,110,2,48,0, + 124,2,115,194,116,0,124,1,100,3,100,0,131,3,100,0, + 117,0,114,226,122,12,124,0,106,13,124,1,95,14,87,0, + 110,18,4,0,116,3,121,224,1,0,1,0,1,0,89,0, + 110,2,48,0,122,10,124,0,124,1,95,15,87,0,110,18, + 4,0,116,3,121,254,1,0,1,0,1,0,89,0,110,2, + 48,0,124,2,144,1,115,24,116,0,124,1,100,4,100,0, + 131,3,100,0,117,0,144,1,114,70,124,0,106,5,100,0, + 117,1,144,1,114,70,122,12,124,0,106,5,124,1,95,16, + 87,0,110,20,4,0,116,3,144,1,121,68,1,0,1,0, + 1,0,89,0,110,2,48,0,124,0,106,17,144,1,114,206, + 124,2,144,1,115,102,116,0,124,1,100,5,100,0,131,3, + 100,0,117,0,144,1,114,136,122,12,124,0,106,18,124,1, + 95,11,87,0,110,20,4,0,116,3,144,1,121,134,1,0, + 1,0,1,0,89,0,110,2,48,0,124,2,144,1,115,160, + 116,0,124,1,100,6,100,0,131,3,100,0,117,0,144,1, + 114,206,124,0,106,19,100,0,117,1,144,1,114,206,122,12, + 124,0,106,19,124,1,95,20,87,0,110,20,4,0,116,3, + 144,1,121,204,1,0,1,0,1,0,89,0,110,2,48,0, + 124,1,83,0,41,7,78,114,1,0,0,0,114,99,0,0, + 0,218,11,95,95,112,97,99,107,97,103,101,95,95,114,142, + 0,0,0,114,109,0,0,0,114,140,0,0,0,41,21,114, + 6,0,0,0,114,17,0,0,0,114,1,0,0,0,114,107, + 0,0,0,114,110,0,0,0,114,117,0,0,0,114,127,0, + 0,0,114,128,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,90,5,95,112,97,116,104,114,109,0,0,0,114,99, + 0,0,0,114,131,0,0,0,114,146,0,0,0,114,106,0, + 0,0,114,142,0,0,0,114,124,0,0,0,114,114,0,0, + 0,114,123,0,0,0,114,140,0,0,0,41,5,114,96,0, + 0,0,114,97,0,0,0,114,145,0,0,0,114,110,0,0, + 0,114,147,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,18,95,105,110,105,116,95,109,111,100, + 117,108,101,95,97,116,116,114,115,230,1,0,0,115,96,0, + 0,0,0,4,20,1,2,1,12,1,12,1,6,2,20,1, + 6,1,8,2,10,1,8,1,4,1,6,2,10,1,8,1, + 6,11,6,1,2,1,10,1,12,1,6,2,20,1,2,1, + 12,1,12,1,6,2,2,1,10,1,12,1,6,2,24,1, + 12,1,2,1,12,1,14,1,6,2,8,1,24,1,2,1, + 12,1,14,1,6,2,24,1,12,1,2,1,12,1,14,1, + 6,1,114,149,0,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,82,0,0,0,100,1,125,1,116,0,124,0,106,1,100, + 2,131,2,114,30,124,0,106,1,160,2,124,0,161,1,125, + 1,110,20,116,0,124,0,106,1,100,3,131,2,114,50,116, + 3,100,4,131,1,130,1,124,1,100,1,117,0,114,68,116, + 4,124,0,106,5,131,1,125,1,116,6,124,0,124,1,131, + 2,1,0,124,1,83,0,41,5,122,43,67,114,101,97,116, + 101,32,97,32,109,111,100,117,108,101,32,98,97,115,101,100, + 32,111,110,32,116,104,101,32,112,114,111,118,105,100,101,100, + 32,115,112,101,99,46,78,218,13,99,114,101,97,116,101,95, + 109,111,100,117,108,101,218,11,101,120,101,99,95,109,111,100, + 117,108,101,122,66,108,111,97,100,101,114,115,32,116,104,97, + 116,32,100,101,102,105,110,101,32,101,120,101,99,95,109,111, + 100,117,108,101,40,41,32,109,117,115,116,32,97,108,115,111, + 32,100,101,102,105,110,101,32,99,114,101,97,116,101,95,109, + 111,100,117,108,101,40,41,41,7,114,4,0,0,0,114,110, + 0,0,0,114,150,0,0,0,114,80,0,0,0,114,18,0, + 0,0,114,17,0,0,0,114,149,0,0,0,169,2,114,96, + 0,0,0,114,97,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,16,109,111,100,117,108,101,95, + 102,114,111,109,95,115,112,101,99,46,2,0,0,115,18,0, + 0,0,0,3,4,1,12,3,14,1,12,1,8,2,8,1, + 10,1,10,1,114,153,0,0,0,99,1,0,0,0,0,0, + 0,0,0,0,0,0,2,0,0,0,4,0,0,0,67,0, + 0,0,115,100,0,0,0,124,0,106,0,100,1,117,0,114, + 14,100,2,110,4,124,0,106,0,125,1,124,0,106,1,100, + 1,117,0,114,64,124,0,106,2,100,1,117,0,114,50,100, + 3,160,3,124,1,161,1,83,0,100,4,160,3,124,1,124, + 0,106,2,161,2,83,0,124,0,106,4,114,84,100,5,160, + 3,124,1,124,0,106,1,161,2,83,0,100,6,160,3,124, + 0,106,0,124,0,106,1,161,2,83,0,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,101,0,0,0,114,102,0,0,0, + 114,103,0,0,0,114,104,0,0,0,250,18,60,109,111,100, + 117,108,101,32,123,33,114,125,32,40,123,125,41,62,41,5, + 114,17,0,0,0,114,114,0,0,0,114,110,0,0,0,114, + 46,0,0,0,114,124,0,0,0,41,2,114,96,0,0,0, + 114,17,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,108,0,0,0,63,2,0,0,115,16,0, + 0,0,0,3,20,1,10,1,10,1,10,2,14,2,6,1, + 14,2,114,108,0,0,0,99,2,0,0,0,0,0,0,0, + 0,0,0,0,4,0,0,0,10,0,0,0,67,0,0,0, + 115,250,0,0,0,124,0,106,0,125,2,116,1,124,2,131, + 1,143,216,1,0,116,2,106,3,160,4,124,2,161,1,124, + 1,117,1,114,54,100,1,160,5,124,2,161,1,125,3,116, + 6,124,3,124,2,100,2,141,2,130,1,122,132,124,0,106, + 7,100,3,117,0,114,106,124,0,106,8,100,3,117,0,114, + 90,116,6,100,4,124,0,106,0,100,2,141,2,130,1,116, + 9,124,0,124,1,100,5,100,6,141,3,1,0,110,52,116, + 9,124,0,124,1,100,5,100,6,141,3,1,0,116,10,124, + 0,106,7,100,7,131,2,115,146,124,0,106,7,160,11,124, + 2,161,1,1,0,110,12,124,0,106,7,160,12,124,1,161, + 1,1,0,87,0,116,2,106,3,160,13,124,0,106,0,161, + 1,125,1,124,1,116,2,106,3,124,0,106,0,60,0,110, + 28,116,2,106,3,160,13,124,0,106,0,161,1,125,1,124, + 1,116,2,106,3,124,0,106,0,60,0,48,0,87,0,100, + 3,4,0,4,0,131,3,1,0,110,16,49,0,115,236,48, + 0,1,0,1,0,1,0,89,0,1,0,124,1,83,0,41, + 8,122,70,69,120,101,99,117,116,101,32,116,104,101,32,115, + 112,101,99,39,115,32,115,112,101,99,105,102,105,101,100,32, + 109,111,100,117,108,101,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,16,0,0,0,78,250, + 14,109,105,115,115,105,110,103,32,108,111,97,100,101,114,84, + 114,144,0,0,0,114,151,0,0,0,41,14,114,17,0,0, + 0,114,51,0,0,0,114,15,0,0,0,114,93,0,0,0, + 114,35,0,0,0,114,46,0,0,0,114,80,0,0,0,114, + 110,0,0,0,114,117,0,0,0,114,149,0,0,0,114,4, + 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, + 114,151,0,0,0,218,3,112,111,112,41,4,114,96,0,0, + 0,114,97,0,0,0,114,17,0,0,0,218,3,109,115,103, + 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, + 94,0,0,0,80,2,0,0,115,38,0,0,0,0,2,6, + 1,10,1,16,1,10,1,12,1,2,1,10,1,10,1,14, + 2,16,2,14,1,12,4,14,2,14,4,14,1,14,255,14, + 1,44,1,114,94,0,0,0,99,1,0,0,0,0,0,0, + 0,0,0,0,0,2,0,0,0,8,0,0,0,67,0,0, + 0,115,20,1,0,0,122,18,124,0,106,0,160,1,124,0, + 106,2,161,1,1,0,87,0,110,52,1,0,1,0,1,0, + 124,0,106,2,116,3,106,4,118,0,114,64,116,3,106,4, 160,5,124,0,106,2,161,1,125,1,124,1,116,3,106,4, - 124,0,106,2,60,0,116,6,124,1,100,1,100,0,131,3, - 100,0,117,0,114,146,122,12,124,0,106,0,124,1,95,7, - 87,0,110,18,4,0,116,8,121,144,1,0,1,0,1,0, - 89,0,110,2,48,0,116,6,124,1,100,2,100,0,131,3, - 100,0,117,0,114,222,122,40,124,1,106,9,124,1,95,10, - 116,11,124,1,100,3,131,2,115,200,124,0,106,2,160,12, - 100,4,161,1,100,5,25,0,124,1,95,10,87,0,110,18, - 4,0,116,8,121,220,1,0,1,0,1,0,89,0,110,2, - 48,0,116,6,124,1,100,6,100,0,131,3,100,0,117,0, - 144,1,114,16,122,10,124,0,124,1,95,13,87,0,110,20, - 4,0,116,8,144,1,121,14,1,0,1,0,1,0,89,0, - 110,2,48,0,124,1,83,0,41,7,78,114,99,0,0,0, - 114,146,0,0,0,114,142,0,0,0,114,129,0,0,0,114, - 22,0,0,0,114,106,0,0,0,41,14,114,110,0,0,0, - 114,156,0,0,0,114,17,0,0,0,114,15,0,0,0,114, - 93,0,0,0,114,157,0,0,0,114,6,0,0,0,114,99, - 0,0,0,114,107,0,0,0,114,1,0,0,0,114,146,0, - 0,0,114,4,0,0,0,114,130,0,0,0,114,106,0,0, - 0,114,152,0,0,0,114,10,0,0,0,114,10,0,0,0, - 114,11,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, - 110,2,0,0,115,54,0,0,0,0,4,2,1,18,1,6, - 1,12,1,14,1,12,1,8,3,14,1,12,1,16,1,2, - 1,12,1,12,1,6,1,16,1,2,4,8,1,10,1,22, - 1,12,1,6,1,18,1,2,1,10,1,14,1,6,1,114, - 159,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, - 0,2,0,0,0,11,0,0,0,67,0,0,0,115,224,0, - 0,0,124,0,106,0,100,0,117,1,114,30,116,1,124,0, - 106,0,100,1,131,2,115,30,116,2,124,0,131,1,83,0, - 116,3,124,0,131,1,125,1,100,2,124,0,95,4,122,166, - 124,1,116,5,106,6,124,0,106,7,60,0,122,52,124,0, - 106,0,100,0,117,0,114,96,124,0,106,8,100,0,117,0, - 114,108,116,9,100,3,124,0,106,7,100,4,141,2,130,1, - 110,12,124,0,106,0,160,10,124,1,161,1,1,0,87,0, - 110,48,1,0,1,0,1,0,122,14,116,5,106,6,124,0, - 106,7,61,0,87,0,110,18,4,0,116,11,121,150,1,0, - 1,0,1,0,89,0,110,2,48,0,130,0,89,0,110,2, - 48,0,116,5,106,6,160,12,124,0,106,7,161,1,125,1, - 124,1,116,5,106,6,124,0,106,7,60,0,116,13,100,5, - 124,0,106,7,124,0,106,0,131,3,1,0,87,0,100,6, - 124,0,95,4,110,8,100,6,124,0,95,4,48,0,124,1, - 83,0,41,7,78,114,151,0,0,0,84,114,155,0,0,0, - 114,16,0,0,0,122,18,105,109,112,111,114,116,32,123,33, - 114,125,32,35,32,123,33,114,125,70,41,14,114,110,0,0, - 0,114,4,0,0,0,114,159,0,0,0,114,153,0,0,0, - 90,13,95,105,110,105,116,105,97,108,105,122,105,110,103,114, - 15,0,0,0,114,93,0,0,0,114,17,0,0,0,114,117, - 0,0,0,114,80,0,0,0,114,151,0,0,0,114,64,0, - 0,0,114,157,0,0,0,114,77,0,0,0,114,152,0,0, + 124,0,106,2,60,0,130,0,89,0,110,2,48,0,116,3, + 106,4,160,5,124,0,106,2,161,1,125,1,124,1,116,3, + 106,4,124,0,106,2,60,0,116,6,124,1,100,1,100,0, + 131,3,100,0,117,0,114,146,122,12,124,0,106,0,124,1, + 95,7,87,0,110,18,4,0,116,8,121,144,1,0,1,0, + 1,0,89,0,110,2,48,0,116,6,124,1,100,2,100,0, + 131,3,100,0,117,0,114,222,122,40,124,1,106,9,124,1, + 95,10,116,11,124,1,100,3,131,2,115,200,124,0,106,2, + 160,12,100,4,161,1,100,5,25,0,124,1,95,10,87,0, + 110,18,4,0,116,8,121,220,1,0,1,0,1,0,89,0, + 110,2,48,0,116,6,124,1,100,6,100,0,131,3,100,0, + 117,0,144,1,114,16,122,10,124,0,124,1,95,13,87,0, + 110,20,4,0,116,8,144,1,121,14,1,0,1,0,1,0, + 89,0,110,2,48,0,124,1,83,0,41,7,78,114,99,0, + 0,0,114,146,0,0,0,114,142,0,0,0,114,129,0,0, + 0,114,22,0,0,0,114,106,0,0,0,41,14,114,110,0, + 0,0,114,156,0,0,0,114,17,0,0,0,114,15,0,0, + 0,114,93,0,0,0,114,157,0,0,0,114,6,0,0,0, + 114,99,0,0,0,114,107,0,0,0,114,1,0,0,0,114, + 146,0,0,0,114,4,0,0,0,114,130,0,0,0,114,106, + 0,0,0,114,152,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,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,110,2,0,0,115,54,0,0,0,0,4,2,1,18, + 1,6,1,12,1,14,1,12,1,8,3,14,1,12,1,16, + 1,2,1,12,1,12,1,6,1,16,1,2,4,8,1,10, + 1,22,1,12,1,6,1,18,1,2,1,10,1,14,1,6, + 1,114,159,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,11,0,0,0,67,0,0,0,115, + 216,0,0,0,124,0,106,0,100,0,117,1,114,30,116,1, + 124,0,106,0,100,1,131,2,115,30,116,2,124,0,131,1, + 83,0,116,3,124,0,131,1,125,1,100,2,124,0,95,4, + 122,158,124,1,116,5,106,6,124,0,106,7,60,0,122,52, + 124,0,106,0,100,0,117,0,114,96,124,0,106,8,100,0, + 117,0,114,108,116,9,100,3,124,0,106,7,100,4,141,2, + 130,1,110,12,124,0,106,0,160,10,124,1,161,1,1,0, + 87,0,110,40,1,0,1,0,1,0,122,14,116,5,106,6, + 124,0,106,7,61,0,87,0,130,0,4,0,116,11,121,150, + 1,0,1,0,1,0,89,0,130,0,48,0,116,5,106,6, + 160,12,124,0,106,7,161,1,125,1,124,1,116,5,106,6, + 124,0,106,7,60,0,116,13,100,5,124,0,106,7,124,0, + 106,0,131,3,1,0,87,0,100,6,124,0,95,4,110,8, + 100,6,124,0,95,4,48,0,124,1,83,0,41,7,78,114, + 151,0,0,0,84,114,155,0,0,0,114,16,0,0,0,122, + 18,105,109,112,111,114,116,32,123,33,114,125,32,35,32,123, + 33,114,125,70,41,14,114,110,0,0,0,114,4,0,0,0, + 114,159,0,0,0,114,153,0,0,0,90,13,95,105,110,105, + 116,105,97,108,105,122,105,110,103,114,15,0,0,0,114,93, + 0,0,0,114,17,0,0,0,114,117,0,0,0,114,80,0, + 0,0,114,151,0,0,0,114,64,0,0,0,114,157,0,0, + 0,114,77,0,0,0,114,152,0,0,0,114,10,0,0,0, + 114,10,0,0,0,114,11,0,0,0,218,14,95,108,111,97, + 100,95,117,110,108,111,99,107,101,100,147,2,0,0,115,44, + 0,0,0,0,2,10,2,12,1,8,2,8,5,6,1,2, + 1,12,1,2,1,10,1,10,1,16,3,16,1,6,1,2, + 1,14,1,12,1,6,6,14,1,12,1,18,2,16,2,114, + 160,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, + 0,1,0,0,0,8,0,0,0,67,0,0,0,115,54,0, + 0,0,116,0,124,0,106,1,131,1,143,24,1,0,116,2, + 124,0,131,1,87,0,2,0,100,1,4,0,4,0,131,3, + 1,0,83,0,49,0,115,40,48,0,1,0,1,0,1,0, + 89,0,1,0,100,1,83,0,41,2,122,191,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,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,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,99,108,111,98,98, + 101,114,101,100,46,10,10,32,32,32,32,78,41,3,114,51, + 0,0,0,114,17,0,0,0,114,160,0,0,0,41,1,114, + 96,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,95,0,0,0,189,2,0,0,115,4,0,0, + 0,0,9,12,1,114,95,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, + 0,0,0,115,140,0,0,0,101,0,90,1,100,0,90,2, + 100,1,90,3,100,2,90,4,101,5,100,3,100,4,132,0, + 131,1,90,6,101,7,100,20,100,6,100,7,132,1,131,1, + 90,8,101,7,100,21,100,8,100,9,132,1,131,1,90,9, + 101,7,100,10,100,11,132,0,131,1,90,10,101,7,100,12, + 100,13,132,0,131,1,90,11,101,7,101,12,100,14,100,15, + 132,0,131,1,131,1,90,13,101,7,101,12,100,16,100,17, + 132,0,131,1,131,1,90,14,101,7,101,12,100,18,100,19, + 132,0,131,1,131,1,90,15,101,7,101,16,131,1,90,17, + 100,5,83,0,41,22,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,122,8,98,117,105,108,116, + 45,105,110,99,1,0,0,0,0,0,0,0,0,0,0,0, + 1,0,0,0,5,0,0,0,67,0,0,0,115,22,0,0, + 0,100,1,124,0,106,0,155,2,100,2,116,1,106,2,155, + 0,100,3,157,5,83,0,41,4,250,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,8, + 60,109,111,100,117,108,101,32,122,2,32,40,122,2,41,62, + 41,3,114,1,0,0,0,114,161,0,0,0,114,139,0,0, + 0,41,1,114,97,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,114,100,0,0,0,215,2,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,0,0, + 0,0,4,0,0,0,5,0,0,0,67,0,0,0,115,42, + 0,0,0,124,2,100,0,117,1,114,12,100,0,83,0,116, + 0,160,1,124,1,161,1,114,38,116,2,124,1,124,0,124, + 0,106,3,100,1,141,3,83,0,100,0,83,0,169,2,78, + 114,138,0,0,0,41,4,114,58,0,0,0,90,10,105,115, + 95,98,117,105,108,116,105,110,114,92,0,0,0,114,139,0, + 0,0,169,4,218,3,99,108,115,114,82,0,0,0,218,4, + 112,97,116,104,218,6,116,97,114,103,101,116,114,10,0,0, + 0,114,10,0,0,0,114,11,0,0,0,218,9,102,105,110, + 100,95,115,112,101,99,224,2,0,0,115,10,0,0,0,0, + 2,8,1,4,1,10,1,16,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,0,0,0, + 0,4,0,0,0,4,0,0,0,67,0,0,0,115,30,0, + 0,0,124,0,160,0,124,1,124,2,161,2,125,3,124,3, + 100,1,117,1,114,26,124,3,106,1,83,0,100,1,83,0, + 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,168,0,0,0,114,110,0,0,0, + 41,4,114,165,0,0,0,114,82,0,0,0,114,166,0,0, + 0,114,96,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,11,102,105,110,100,95,109,111,100,117, + 108,101,233,2,0,0,115,4,0,0,0,0,9,12,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,0,0,0,0,2,0,0,0,4,0,0, + 0,67,0,0,0,115,46,0,0,0,124,1,106,0,116,1, + 106,2,118,1,114,34,116,3,100,1,160,4,124,1,106,0, + 161,1,124,1,106,0,100,2,141,2,130,1,116,5,116,6, + 106,7,124,1,131,2,83,0,41,3,122,24,67,114,101,97, + 116,101,32,97,32,98,117,105,108,116,45,105,110,32,109,111, + 100,117,108,101,114,78,0,0,0,114,16,0,0,0,41,8, + 114,17,0,0,0,114,15,0,0,0,114,79,0,0,0,114, + 80,0,0,0,114,46,0,0,0,114,68,0,0,0,114,58, + 0,0,0,90,14,99,114,101,97,116,101,95,98,117,105,108, + 116,105,110,41,2,114,30,0,0,0,114,96,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,150, + 0,0,0,245,2,0,0,115,10,0,0,0,0,3,12,1, + 12,1,4,255,6,2,122,29,66,117,105,108,116,105,110,73, + 109,112,111,114,116,101,114,46,99,114,101,97,116,101,95,109, + 111,100,117,108,101,99,2,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,16, + 0,0,0,116,0,116,1,106,2,124,1,131,2,1,0,100, + 1,83,0,41,2,122,22,69,120,101,99,32,97,32,98,117, + 105,108,116,45,105,110,32,109,111,100,117,108,101,78,41,3, + 114,68,0,0,0,114,58,0,0,0,90,12,101,120,101,99, + 95,98,117,105,108,116,105,110,41,2,114,30,0,0,0,114, + 97,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,114,151,0,0,0,253,2,0,0,115,2,0,0, + 0,0,3,122,27,66,117,105,108,116,105,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,0,0,0,0,2,0,0, + 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, + 83,0,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,10,0,0,0,169,2,114,165,0,0,0,114,82,0,0, 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, - 218,14,95,108,111,97,100,95,117,110,108,111,99,107,101,100, - 147,2,0,0,115,46,0,0,0,0,2,10,2,12,1,8, - 2,8,5,6,1,2,1,12,1,2,1,10,1,10,1,16, - 3,16,1,6,1,2,1,14,1,12,1,6,1,8,5,14, - 1,12,1,18,2,16,2,114,160,0,0,0,99,1,0,0, - 0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0, - 0,67,0,0,0,115,54,0,0,0,116,0,124,0,106,1, - 131,1,143,24,1,0,116,2,124,0,131,1,87,0,2,0, - 100,1,4,0,4,0,131,3,1,0,83,0,49,0,115,40, - 48,0,1,0,1,0,1,0,89,0,1,0,100,1,83,0, - 41,2,122,191,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,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,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,99,108,111,98,98,101,114,101,100,46,10,10,32, - 32,32,32,78,41,3,114,51,0,0,0,114,17,0,0,0, - 114,160,0,0,0,41,1,114,96,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,95,0,0,0, - 189,2,0,0,115,4,0,0,0,0,9,12,1,114,95,0, - 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,4,0,0,0,64,0,0,0,115,140,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,90,4, - 101,5,100,3,100,4,132,0,131,1,90,6,101,7,100,20, - 100,6,100,7,132,1,131,1,90,8,101,7,100,21,100,8, - 100,9,132,1,131,1,90,9,101,7,100,10,100,11,132,0, - 131,1,90,10,101,7,100,12,100,13,132,0,131,1,90,11, - 101,7,101,12,100,14,100,15,132,0,131,1,131,1,90,13, - 101,7,101,12,100,16,100,17,132,0,131,1,131,1,90,14, - 101,7,101,12,100,18,100,19,132,0,131,1,131,1,90,15, - 101,7,101,16,131,1,90,17,100,5,83,0,41,22,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, + 218,8,103,101,116,95,99,111,100,101,2,3,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,0,0,0,0,2,0,0,0, + 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, + 0,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,10, + 0,0,0,114,170,0,0,0,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,10,103,101,116,95,115,111,117, + 114,99,101,8,3,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,0,0,0,0,2,0,0,0,1,0,0,0,67, + 0,0,0,115,4,0,0,0,100,1,83,0,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,10,0,0,0,114,170,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,116, + 0,0,0,14,3,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,2,78,78,41,1, + 78,41,18,114,1,0,0,0,114,0,0,0,0,114,2,0, + 0,0,114,3,0,0,0,114,139,0,0,0,218,12,115,116, + 97,116,105,99,109,101,116,104,111,100,114,100,0,0,0,218, + 11,99,108,97,115,115,109,101,116,104,111,100,114,168,0,0, + 0,114,169,0,0,0,114,150,0,0,0,114,151,0,0,0, + 114,87,0,0,0,114,171,0,0,0,114,172,0,0,0,114, + 116,0,0,0,114,98,0,0,0,114,156,0,0,0,114,10, + 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, + 0,0,114,161,0,0,0,204,2,0,0,115,44,0,0,0, + 8,2,4,7,4,2,2,1,10,8,2,1,12,8,2,1, + 12,11,2,1,10,7,2,1,10,4,2,1,2,1,12,4, + 2,1,2,1,12,4,2,1,2,1,12,4,114,161,0,0, + 0,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,64,0,0,0,115,144,0,0,0,101, + 0,90,1,100,0,90,2,100,1,90,3,100,2,90,4,101, + 5,100,3,100,4,132,0,131,1,90,6,101,7,100,22,100, + 6,100,7,132,1,131,1,90,8,101,7,100,23,100,8,100, + 9,132,1,131,1,90,9,101,7,100,10,100,11,132,0,131, + 1,90,10,101,5,100,12,100,13,132,0,131,1,90,11,101, + 7,100,14,100,15,132,0,131,1,90,12,101,7,101,13,100, + 16,100,17,132,0,131,1,131,1,90,14,101,7,101,13,100, + 18,100,19,132,0,131,1,131,1,90,15,101,7,101,13,100, + 20,100,21,132,0,131,1,131,1,90,16,100,5,83,0,41, + 24,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, @@ -1052,163 +1193,19 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,122,8,98,117,105,108,116,45,105,110,99,1,0,0,0, - 0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0, - 67,0,0,0,115,22,0,0,0,100,1,124,0,106,0,155, - 2,100,2,116,1,106,2,155,0,100,3,157,5,83,0,41, - 4,250,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,8,60,109,111,100,117,108,101,32, - 122,2,32,40,122,2,41,62,41,3,114,1,0,0,0,114, - 161,0,0,0,114,139,0,0,0,41,1,114,97,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 100,0,0,0,215,2,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,0,0,0,0,4,0,0,0,5,0, - 0,0,67,0,0,0,115,46,0,0,0,124,2,100,0,117, - 1,114,12,100,0,83,0,116,0,160,1,124,1,161,1,114, - 38,116,2,124,1,124,0,124,0,106,3,100,1,141,3,83, - 0,100,0,83,0,100,0,83,0,169,2,78,114,138,0,0, - 0,41,4,114,58,0,0,0,90,10,105,115,95,98,117,105, - 108,116,105,110,114,92,0,0,0,114,139,0,0,0,169,4, - 218,3,99,108,115,114,82,0,0,0,218,4,112,97,116,104, - 218,6,116,97,114,103,101,116,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,9,102,105,110,100,95,115,112, - 101,99,224,2,0,0,115,10,0,0,0,0,2,8,1,4, - 1,10,1,16,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,0,0,0,0,4,0,0, - 0,4,0,0,0,67,0,0,0,115,30,0,0,0,124,0, - 160,0,124,1,124,2,161,2,125,3,124,3,100,1,117,1, - 114,26,124,3,106,1,83,0,100,1,83,0,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,168,0,0,0,114,110,0,0,0,41,4,114,165, - 0,0,0,114,82,0,0,0,114,166,0,0,0,114,96,0, - 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,11,102,105,110,100,95,109,111,100,117,108,101,233,2, - 0,0,115,4,0,0,0,0,9,12,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,0,0,0,0,2,0,0,0,4,0,0,0,67,0,0, - 0,115,46,0,0,0,124,1,106,0,116,1,106,2,118,1, - 114,34,116,3,100,1,160,4,124,1,106,0,161,1,124,1, - 106,0,100,2,141,2,130,1,116,5,116,6,106,7,124,1, - 131,2,83,0,41,3,122,24,67,114,101,97,116,101,32,97, - 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, - 114,78,0,0,0,114,16,0,0,0,41,8,114,17,0,0, - 0,114,15,0,0,0,114,79,0,0,0,114,80,0,0,0, - 114,46,0,0,0,114,68,0,0,0,114,58,0,0,0,90, - 14,99,114,101,97,116,101,95,98,117,105,108,116,105,110,41, - 2,114,30,0,0,0,114,96,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,150,0,0,0,245, - 2,0,0,115,10,0,0,0,0,3,12,1,12,1,4,255, - 6,2,122,29,66,117,105,108,116,105,110,73,109,112,111,114, - 116,101,114,46,99,114,101,97,116,101,95,109,111,100,117,108, - 101,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, - 0,0,3,0,0,0,67,0,0,0,115,16,0,0,0,116, - 0,116,1,106,2,124,1,131,2,1,0,100,1,83,0,41, - 2,122,22,69,120,101,99,32,97,32,98,117,105,108,116,45, - 105,110,32,109,111,100,117,108,101,78,41,3,114,68,0,0, - 0,114,58,0,0,0,90,12,101,120,101,99,95,98,117,105, - 108,116,105,110,41,2,114,30,0,0,0,114,97,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,114, - 151,0,0,0,253,2,0,0,115,2,0,0,0,0,3,122, - 27,66,117,105,108,116,105,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,0,0,0,0,2,0,0,0,1,0,0, - 0,67,0,0,0,115,4,0,0,0,100,1,83,0,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,10,0,0, - 0,169,2,114,165,0,0,0,114,82,0,0,0,114,10,0, - 0,0,114,10,0,0,0,114,11,0,0,0,218,8,103,101, - 116,95,99,111,100,101,2,3,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,0,0,0,0,2,0,0,0,1,0,0,0, - 67,0,0,0,115,4,0,0,0,100,1,83,0,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,10,0,0,0,114, - 170,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,8, - 3,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,0, - 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, - 4,0,0,0,100,1,83,0,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,10,0,0,0,114,170,0,0,0,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,116,0,0,0,14, - 3,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,2,78,78,41,1,78,41,18,114, - 1,0,0,0,114,0,0,0,0,114,2,0,0,0,114,3, - 0,0,0,114,139,0,0,0,218,12,115,116,97,116,105,99, - 109,101,116,104,111,100,114,100,0,0,0,218,11,99,108,97, - 115,115,109,101,116,104,111,100,114,168,0,0,0,114,169,0, - 0,0,114,150,0,0,0,114,151,0,0,0,114,87,0,0, - 0,114,171,0,0,0,114,172,0,0,0,114,116,0,0,0, - 114,98,0,0,0,114,156,0,0,0,114,10,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,114,161, - 0,0,0,204,2,0,0,115,44,0,0,0,8,2,4,7, - 4,2,2,1,10,8,2,1,12,8,2,1,12,11,2,1, - 10,7,2,1,10,4,2,1,2,1,12,4,2,1,2,1, - 12,4,2,1,2,1,12,4,114,161,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0, - 0,0,64,0,0,0,115,144,0,0,0,101,0,90,1,100, - 0,90,2,100,1,90,3,100,2,90,4,101,5,100,3,100, - 4,132,0,131,1,90,6,101,7,100,22,100,6,100,7,132, - 1,131,1,90,8,101,7,100,23,100,8,100,9,132,1,131, - 1,90,9,101,7,100,10,100,11,132,0,131,1,90,10,101, - 5,100,12,100,13,132,0,131,1,90,11,101,7,100,14,100, - 15,132,0,131,1,90,12,101,7,101,13,100,16,100,17,132, - 0,131,1,131,1,90,14,101,7,101,13,100,18,100,19,132, - 0,131,1,131,1,90,15,101,7,101,13,100,20,100,21,132, - 0,131,1,131,1,90,16,100,5,83,0,41,24,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,90,6,102, - 114,111,122,101,110,99,1,0,0,0,0,0,0,0,0,0, - 0,0,1,0,0,0,4,0,0,0,67,0,0,0,115,16, - 0,0,0,100,1,160,0,124,0,106,1,116,2,106,3,161, - 2,83,0,41,2,114,162,0,0,0,114,154,0,0,0,41, - 4,114,46,0,0,0,114,1,0,0,0,114,175,0,0,0, - 114,139,0,0,0,41,1,218,1,109,114,10,0,0,0,114, - 10,0,0,0,114,11,0,0,0,114,100,0,0,0,34,3, - 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,0, - 0,0,0,4,0,0,0,5,0,0,0,67,0,0,0,115, - 34,0,0,0,116,0,160,1,124,1,161,1,114,26,116,2, - 124,1,124,0,124,0,106,3,100,1,141,3,83,0,100,0, + 32,90,6,102,114,111,122,101,110,99,1,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,4,0,0,0,67,0, + 0,0,115,16,0,0,0,100,1,160,0,124,0,106,1,116, + 2,106,3,161,2,83,0,41,2,114,162,0,0,0,114,154, + 0,0,0,41,4,114,46,0,0,0,114,1,0,0,0,114, + 175,0,0,0,114,139,0,0,0,41,1,218,1,109,114,10, + 0,0,0,114,10,0,0,0,114,11,0,0,0,114,100,0, + 0,0,34,3,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,0,0,0,0,4,0,0,0,5,0,0,0,67, + 0,0,0,115,30,0,0,0,116,0,160,1,124,1,161,1, + 114,26,116,2,124,1,124,0,124,0,106,3,100,1,141,3, 83,0,100,0,83,0,114,163,0,0,0,41,4,114,58,0, 0,0,114,89,0,0,0,114,92,0,0,0,114,139,0,0, 0,114,164,0,0,0,114,10,0,0,0,114,10,0,0,0, @@ -1379,11 +1376,11 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 100,95,115,112,101,99,95,108,101,103,97,99,121,124,3,0, 0,115,8,0,0,0,0,3,12,1,8,1,4,1,114,191, 0,0,0,99,3,0,0,0,0,0,0,0,0,0,0,0, - 10,0,0,0,10,0,0,0,67,0,0,0,115,32,1,0, + 10,0,0,0,10,0,0,0,67,0,0,0,115,28,1,0, 0,116,0,106,1,125,3,124,3,100,1,117,0,114,22,116, 2,100,2,131,1,130,1,124,3,115,38,116,3,160,4,100, 3,116,5,161,2,1,0,124,0,116,0,106,6,118,0,125, - 4,124,3,68,0,93,230,125,5,116,7,131,0,143,94,1, + 4,124,3,68,0,93,226,125,5,116,7,131,0,143,94,1, 0,122,10,124,5,106,8,125,6,87,0,110,54,4,0,116, 9,121,128,1,0,1,0,1,0,116,10,124,5,124,0,124, 1,131,3,125,7,124,7,100,1,117,0,114,124,89,0,87, @@ -1391,422 +1388,421 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 14,48,0,124,6,124,0,124,1,124,2,131,3,125,7,87, 0,100,1,4,0,4,0,131,3,1,0,110,16,49,0,115, 162,48,0,1,0,1,0,1,0,89,0,1,0,124,7,100, - 1,117,1,114,52,124,4,144,1,115,18,124,0,116,0,106, - 6,118,0,144,1,114,18,116,0,106,6,124,0,25,0,125, + 1,117,1,114,52,124,4,144,1,115,16,124,0,116,0,106, + 6,118,0,144,1,114,16,116,0,106,6,124,0,25,0,125, 8,122,10,124,8,106,11,125,9,87,0,110,26,4,0,116, 9,121,244,1,0,1,0,1,0,124,7,6,0,89,0,2, 0,1,0,83,0,48,0,124,9,100,1,117,0,144,1,114, 8,124,7,2,0,1,0,83,0,124,9,2,0,1,0,83, - 0,113,52,124,7,2,0,1,0,83,0,113,52,100,1,83, - 0,41,4,122,21,70,105,110,100,32,97,32,109,111,100,117, - 108,101,39,115,32,115,112,101,99,46,78,122,53,115,121,115, - 46,109,101,116,97,95,112,97,116,104,32,105,115,32,78,111, - 110,101,44,32,80,121,116,104,111,110,32,105,115,32,108,105, - 107,101,108,121,32,115,104,117,116,116,105,110,103,32,100,111, - 119,110,122,22,115,121,115,46,109,101,116,97,95,112,97,116, - 104,32,105,115,32,101,109,112,116,121,41,12,114,15,0,0, - 0,218,9,109,101,116,97,95,112,97,116,104,114,80,0,0, - 0,218,9,95,119,97,114,110,105,110,103,115,218,4,119,97, - 114,110,218,13,73,109,112,111,114,116,87,97,114,110,105,110, - 103,114,93,0,0,0,114,180,0,0,0,114,168,0,0,0, - 114,107,0,0,0,114,191,0,0,0,114,106,0,0,0,41, - 10,114,17,0,0,0,114,166,0,0,0,114,167,0,0,0, - 114,192,0,0,0,90,9,105,115,95,114,101,108,111,97,100, - 114,190,0,0,0,114,168,0,0,0,114,96,0,0,0,114, - 97,0,0,0,114,106,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,10,95,102,105,110,100,95, - 115,112,101,99,133,3,0,0,115,54,0,0,0,0,2,6, - 1,8,2,8,3,4,1,12,5,10,1,8,1,8,1,2, - 1,10,1,12,1,12,1,8,1,22,2,42,1,8,2,18, - 1,10,1,2,1,10,1,12,4,14,2,10,1,8,2,10, - 2,10,2,114,196,0,0,0,99,3,0,0,0,0,0,0, - 0,0,0,0,0,3,0,0,0,5,0,0,0,67,0,0, - 0,115,108,0,0,0,116,0,124,0,116,1,131,2,115,28, - 116,2,100,1,160,3,116,4,124,0,131,1,161,1,131,1, - 130,1,124,2,100,2,107,0,114,44,116,5,100,3,131,1, - 130,1,124,2,100,2,107,4,114,84,116,0,124,1,116,1, - 131,2,115,72,116,2,100,4,131,1,130,1,110,12,124,1, - 115,84,116,6,100,5,131,1,130,1,124,0,115,104,124,2, - 100,2,107,2,114,104,116,5,100,6,131,1,130,1,100,7, - 83,0,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,22,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,54,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,119,105,116,104,32,110,111, - 32,107,110,111,119,110,32,112,97,114,101,110,116,32,112,97, - 99,107,97,103,101,122,17,69,109,112,116,121,32,109,111,100, - 117,108,101,32,110,97,109,101,78,41,7,218,10,105,115,105, - 110,115,116,97,110,99,101,218,3,115,116,114,218,9,84,121, - 112,101,69,114,114,111,114,114,46,0,0,0,114,14,0,0, - 0,218,10,86,97,108,117,101,69,114,114,111,114,114,80,0, - 0,0,169,3,114,17,0,0,0,114,187,0,0,0,114,188, - 0,0,0,114,10,0,0,0,114,10,0,0,0,114,11,0, - 0,0,218,13,95,115,97,110,105,116,121,95,99,104,101,99, - 107,180,3,0,0,115,22,0,0,0,0,2,10,1,18,1, - 8,1,8,1,8,1,10,1,10,1,4,1,8,2,12,1, - 114,202,0,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,0,0,0,0,9,0,0,0,8,0, - 0,0,67,0,0,0,115,22,1,0,0,100,0,125,2,124, - 0,160,0,100,1,161,1,100,2,25,0,125,3,124,3,114, - 132,124,3,116,1,106,2,118,1,114,42,116,3,124,1,124, - 3,131,2,1,0,124,0,116,1,106,2,118,0,114,62,116, - 1,106,2,124,0,25,0,83,0,116,1,106,2,124,3,25, - 0,125,4,122,10,124,4,106,4,125,2,87,0,110,48,4, - 0,116,5,121,130,1,0,1,0,1,0,116,6,100,3,23, - 0,160,7,124,0,124,3,161,2,125,5,116,8,124,5,124, - 0,100,4,141,2,100,0,130,2,89,0,110,2,48,0,116, - 9,124,0,124,2,131,2,125,6,124,6,100,0,117,0,114, - 170,116,8,116,6,160,7,124,0,161,1,124,0,100,4,141, - 2,130,1,110,8,116,10,124,6,131,1,125,7,124,3,144, - 1,114,18,116,1,106,2,124,3,25,0,125,4,124,0,160, - 0,100,1,161,1,100,5,25,0,125,8,122,16,116,11,124, - 4,124,8,124,7,131,3,1,0,87,0,110,48,4,0,116, - 5,144,1,121,16,1,0,1,0,1,0,100,6,124,3,155, - 2,100,7,124,8,155,2,157,4,125,5,116,12,160,13,124, - 5,116,14,161,2,1,0,89,0,110,2,48,0,124,7,83, - 0,41,8,78,114,129,0,0,0,114,22,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,16,0,0,0,233,2,0,0, - 0,122,27,67,97,110,110,111,116,32,115,101,116,32,97,110, - 32,97,116,116,114,105,98,117,116,101,32,111,110,32,122,18, - 32,102,111,114,32,99,104,105,108,100,32,109,111,100,117,108, - 101,32,41,15,114,130,0,0,0,114,15,0,0,0,114,93, - 0,0,0,114,68,0,0,0,114,142,0,0,0,114,107,0, - 0,0,218,8,95,69,82,82,95,77,83,71,114,46,0,0, - 0,218,19,77,111,100,117,108,101,78,111,116,70,111,117,110, - 100,69,114,114,111,114,114,196,0,0,0,114,160,0,0,0, - 114,5,0,0,0,114,193,0,0,0,114,194,0,0,0,114, - 195,0,0,0,41,9,114,17,0,0,0,218,7,105,109,112, - 111,114,116,95,114,166,0,0,0,114,131,0,0,0,90,13, - 112,97,114,101,110,116,95,109,111,100,117,108,101,114,158,0, - 0,0,114,96,0,0,0,114,97,0,0,0,90,5,99,104, - 105,108,100,114,10,0,0,0,114,10,0,0,0,114,11,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,199,3,0,0,115, - 52,0,0,0,0,1,4,1,14,1,4,1,10,1,10,2, - 10,1,10,1,10,1,2,1,10,1,12,1,16,1,20,1, - 10,1,8,1,20,2,8,1,6,2,10,1,14,1,2,1, - 16,1,14,1,16,1,18,1,114,207,0,0,0,99,2,0, - 0,0,0,0,0,0,0,0,0,0,4,0,0,0,8,0, - 0,0,67,0,0,0,115,128,0,0,0,116,0,124,0,131, - 1,143,62,1,0,116,1,106,2,160,3,124,0,116,4,161, - 2,125,2,124,2,116,4,117,0,114,56,116,5,124,0,124, - 1,131,2,87,0,2,0,100,1,4,0,4,0,131,3,1, - 0,83,0,87,0,100,1,4,0,4,0,131,3,1,0,110, - 16,49,0,115,76,48,0,1,0,1,0,1,0,89,0,1, - 0,124,2,100,1,117,0,114,116,100,2,160,6,124,0,161, - 1,125,3,116,7,124,3,124,0,100,3,141,2,130,1,116, - 8,124,0,131,1,1,0,124,2,83,0,41,4,122,25,70, - 105,110,100,32,97,110,100,32,108,111,97,100,32,116,104,101, - 32,109,111,100,117,108,101,46,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,16,0,0,0,41,9,114,51,0,0,0,114, - 15,0,0,0,114,93,0,0,0,114,35,0,0,0,218,14, - 95,78,69,69,68,83,95,76,79,65,68,73,78,71,114,207, - 0,0,0,114,46,0,0,0,114,205,0,0,0,114,66,0, - 0,0,41,4,114,17,0,0,0,114,206,0,0,0,114,97, - 0,0,0,114,76,0,0,0,114,10,0,0,0,114,10,0, - 0,0,114,11,0,0,0,218,14,95,102,105,110,100,95,97, - 110,100,95,108,111,97,100,234,3,0,0,115,22,0,0,0, - 0,2,10,1,14,1,8,1,54,2,8,1,4,1,2,255, - 4,2,12,2,8,1,114,209,0,0,0,114,22,0,0,0, - 99,3,0,0,0,0,0,0,0,0,0,0,0,3,0,0, - 0,4,0,0,0,67,0,0,0,115,42,0,0,0,116,0, - 124,0,124,1,124,2,131,3,1,0,124,2,100,1,107,4, - 114,32,116,1,124,0,124,1,124,2,131,3,125,0,116,2, - 124,0,116,3,131,2,83,0,41,2,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,22,0,0,0,41,4,114,202,0,0,0,114,189,0, - 0,0,114,209,0,0,0,218,11,95,103,99,100,95,105,109, - 112,111,114,116,114,201,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,114,210,0,0,0,250,3,0, - 0,115,8,0,0,0,0,9,12,1,8,1,12,1,114,210, - 0,0,0,169,1,218,9,114,101,99,117,114,115,105,118,101, - 99,3,0,0,0,0,0,0,0,1,0,0,0,8,0,0, - 0,11,0,0,0,67,0,0,0,115,232,0,0,0,124,1, - 68,0,93,222,125,4,116,0,124,4,116,1,131,2,115,66, - 124,3,114,34,124,0,106,2,100,1,23,0,125,5,110,4, - 100,2,125,5,116,3,100,3,124,5,155,0,100,4,116,4, - 124,4,131,1,106,2,155,0,157,4,131,1,130,1,113,4, - 124,4,100,5,107,2,114,108,124,3,115,226,116,5,124,0, - 100,6,131,2,114,226,116,6,124,0,124,0,106,7,124,2, - 100,7,100,8,141,4,1,0,113,4,116,5,124,0,124,4, - 131,2,115,4,100,9,160,8,124,0,106,2,124,4,161,2, - 125,6,122,14,116,9,124,2,124,6,131,2,1,0,87,0, - 113,4,4,0,116,10,121,224,1,0,125,7,1,0,122,54, - 124,7,106,11,124,6,107,2,114,202,116,12,106,13,160,14, - 124,6,116,15,161,2,100,10,117,1,114,202,87,0,89,0, - 100,10,125,7,126,7,113,4,130,0,87,0,89,0,100,10, - 125,7,126,7,113,4,100,10,125,7,126,7,48,0,48,0, - 113,4,124,0,83,0,41,11,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,122,8,46,95,95,97,108,108, - 95,95,122,13,96,96,102,114,111,109,32,108,105,115,116,39, - 39,122,8,73,116,101,109,32,105,110,32,122,18,32,109,117, - 115,116,32,98,101,32,115,116,114,44,32,110,111,116,32,250, - 1,42,218,7,95,95,97,108,108,95,95,84,114,211,0,0, - 0,114,184,0,0,0,78,41,16,114,197,0,0,0,114,198, - 0,0,0,114,1,0,0,0,114,199,0,0,0,114,14,0, - 0,0,114,4,0,0,0,218,16,95,104,97,110,100,108,101, - 95,102,114,111,109,108,105,115,116,114,214,0,0,0,114,46, - 0,0,0,114,68,0,0,0,114,205,0,0,0,114,17,0, - 0,0,114,15,0,0,0,114,93,0,0,0,114,35,0,0, - 0,114,208,0,0,0,41,8,114,97,0,0,0,218,8,102, - 114,111,109,108,105,115,116,114,206,0,0,0,114,212,0,0, - 0,218,1,120,90,5,119,104,101,114,101,90,9,102,114,111, - 109,95,110,97,109,101,90,3,101,120,99,114,10,0,0,0, - 114,10,0,0,0,114,11,0,0,0,114,215,0,0,0,9, - 4,0,0,115,48,0,0,0,0,10,8,1,10,1,4,1, - 12,2,4,1,10,1,8,255,10,2,8,1,14,1,10,1, - 2,255,8,2,10,1,14,1,2,1,14,1,14,4,10,1, - 16,255,2,2,12,1,26,1,114,215,0,0,0,99,1,0, - 0,0,0,0,0,0,0,0,0,0,3,0,0,0,6,0, - 0,0,67,0,0,0,115,146,0,0,0,124,0,160,0,100, - 1,161,1,125,1,124,0,160,0,100,2,161,1,125,2,124, - 1,100,3,117,1,114,82,124,2,100,3,117,1,114,78,124, - 1,124,2,106,1,107,3,114,78,116,2,106,3,100,4,124, - 1,155,2,100,5,124,2,106,1,155,2,100,6,157,5,116, - 4,100,7,100,8,141,3,1,0,124,1,83,0,124,2,100, - 3,117,1,114,96,124,2,106,1,83,0,116,2,106,3,100, - 9,116,4,100,7,100,8,141,3,1,0,124,0,100,10,25, - 0,125,1,100,11,124,0,118,1,114,142,124,1,160,5,100, - 12,161,1,100,13,25,0,125,1,124,1,83,0,41,14,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,146,0,0,0,114,106,0, - 0,0,78,122,32,95,95,112,97,99,107,97,103,101,95,95, - 32,33,61,32,95,95,115,112,101,99,95,95,46,112,97,114, - 101,110,116,32,40,122,4,32,33,61,32,250,1,41,233,3, - 0,0,0,41,1,90,10,115,116,97,99,107,108,101,118,101, - 108,122,89,99,97,110,39,116,32,114,101,115,111,108,118,101, - 32,112,97,99,107,97,103,101,32,102,114,111,109,32,95,95, - 115,112,101,99,95,95,32,111,114,32,95,95,112,97,99,107, - 97,103,101,95,95,44,32,102,97,108,108,105,110,103,32,98, - 97,99,107,32,111,110,32,95,95,110,97,109,101,95,95,32, - 97,110,100,32,95,95,112,97,116,104,95,95,114,1,0,0, - 0,114,142,0,0,0,114,129,0,0,0,114,22,0,0,0, - 41,6,114,35,0,0,0,114,131,0,0,0,114,193,0,0, - 0,114,194,0,0,0,114,195,0,0,0,114,130,0,0,0, - 41,3,218,7,103,108,111,98,97,108,115,114,187,0,0,0, + 0,124,7,2,0,1,0,83,0,100,1,83,0,41,4,122, + 21,70,105,110,100,32,97,32,109,111,100,117,108,101,39,115, + 32,115,112,101,99,46,78,122,53,115,121,115,46,109,101,116, + 97,95,112,97,116,104,32,105,115,32,78,111,110,101,44,32, + 80,121,116,104,111,110,32,105,115,32,108,105,107,101,108,121, + 32,115,104,117,116,116,105,110,103,32,100,111,119,110,122,22, + 115,121,115,46,109,101,116,97,95,112,97,116,104,32,105,115, + 32,101,109,112,116,121,41,12,114,15,0,0,0,218,9,109, + 101,116,97,95,112,97,116,104,114,80,0,0,0,218,9,95, + 119,97,114,110,105,110,103,115,218,4,119,97,114,110,218,13, + 73,109,112,111,114,116,87,97,114,110,105,110,103,114,93,0, + 0,0,114,180,0,0,0,114,168,0,0,0,114,107,0,0, + 0,114,191,0,0,0,114,106,0,0,0,41,10,114,17,0, + 0,0,114,166,0,0,0,114,167,0,0,0,114,192,0,0, + 0,90,9,105,115,95,114,101,108,111,97,100,114,190,0,0, + 0,114,168,0,0,0,114,96,0,0,0,114,97,0,0,0, + 114,106,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,218,10,95,102,105,110,100,95,115,112,101,99, + 133,3,0,0,115,54,0,0,0,0,2,6,1,8,2,8, + 3,4,1,12,5,10,1,8,1,8,1,2,1,10,1,12, + 1,12,1,8,1,22,2,42,1,8,2,18,1,10,1,2, + 1,10,1,12,4,14,2,10,1,8,2,8,2,8,2,114, + 196,0,0,0,99,3,0,0,0,0,0,0,0,0,0,0, + 0,3,0,0,0,5,0,0,0,67,0,0,0,115,108,0, + 0,0,116,0,124,0,116,1,131,2,115,28,116,2,100,1, + 160,3,116,4,124,0,131,1,161,1,131,1,130,1,124,2, + 100,2,107,0,114,44,116,5,100,3,131,1,130,1,124,2, + 100,2,107,4,114,84,116,0,124,1,116,1,131,2,115,72, + 116,2,100,4,131,1,130,1,110,12,124,1,115,84,116,6, + 100,5,131,1,130,1,124,0,115,104,124,2,100,2,107,2, + 114,104,116,5,100,6,131,1,130,1,100,7,83,0,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, + 22,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,54,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,119,105,116,104,32,110,111,32,107,110,111, + 119,110,32,112,97,114,101,110,116,32,112,97,99,107,97,103, + 101,122,17,69,109,112,116,121,32,109,111,100,117,108,101,32, + 110,97,109,101,78,41,7,218,10,105,115,105,110,115,116,97, + 110,99,101,218,3,115,116,114,218,9,84,121,112,101,69,114, + 114,111,114,114,46,0,0,0,114,14,0,0,0,218,10,86, + 97,108,117,101,69,114,114,111,114,114,80,0,0,0,169,3, + 114,17,0,0,0,114,187,0,0,0,114,188,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,13, + 95,115,97,110,105,116,121,95,99,104,101,99,107,180,3,0, + 0,115,22,0,0,0,0,2,10,1,18,1,8,1,8,1, + 8,1,10,1,10,1,4,1,8,2,12,1,114,202,0,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,0,0,0,0,9,0,0,0,8,0,0,0,67,0, + 0,0,115,22,1,0,0,100,0,125,2,124,0,160,0,100, + 1,161,1,100,2,25,0,125,3,124,3,114,132,124,3,116, + 1,106,2,118,1,114,42,116,3,124,1,124,3,131,2,1, + 0,124,0,116,1,106,2,118,0,114,62,116,1,106,2,124, + 0,25,0,83,0,116,1,106,2,124,3,25,0,125,4,122, + 10,124,4,106,4,125,2,87,0,110,48,4,0,116,5,121, + 130,1,0,1,0,1,0,116,6,100,3,23,0,160,7,124, + 0,124,3,161,2,125,5,116,8,124,5,124,0,100,4,141, + 2,100,0,130,2,89,0,110,2,48,0,116,9,124,0,124, + 2,131,2,125,6,124,6,100,0,117,0,114,170,116,8,116, + 6,160,7,124,0,161,1,124,0,100,4,141,2,130,1,110, + 8,116,10,124,6,131,1,125,7,124,3,144,1,114,18,116, + 1,106,2,124,3,25,0,125,4,124,0,160,0,100,1,161, + 1,100,5,25,0,125,8,122,16,116,11,124,4,124,8,124, + 7,131,3,1,0,87,0,110,48,4,0,116,5,144,1,121, + 16,1,0,1,0,1,0,100,6,124,3,155,2,100,7,124, + 8,155,2,157,4,125,5,116,12,160,13,124,5,116,14,161, + 2,1,0,89,0,110,2,48,0,124,7,83,0,41,8,78, + 114,129,0,0,0,114,22,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,16,0,0,0,233,2,0,0,0,122,27,67, + 97,110,110,111,116,32,115,101,116,32,97,110,32,97,116,116, + 114,105,98,117,116,101,32,111,110,32,122,18,32,102,111,114, + 32,99,104,105,108,100,32,109,111,100,117,108,101,32,41,15, + 114,130,0,0,0,114,15,0,0,0,114,93,0,0,0,114, + 68,0,0,0,114,142,0,0,0,114,107,0,0,0,218,8, + 95,69,82,82,95,77,83,71,114,46,0,0,0,218,19,77, + 111,100,117,108,101,78,111,116,70,111,117,110,100,69,114,114, + 111,114,114,196,0,0,0,114,160,0,0,0,114,5,0,0, + 0,114,193,0,0,0,114,194,0,0,0,114,195,0,0,0, + 41,9,114,17,0,0,0,218,7,105,109,112,111,114,116,95, + 114,166,0,0,0,114,131,0,0,0,90,13,112,97,114,101, + 110,116,95,109,111,100,117,108,101,114,158,0,0,0,114,96, + 0,0,0,114,97,0,0,0,90,5,99,104,105,108,100,114, + 10,0,0,0,114,10,0,0,0,114,11,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,199,3,0,0,115,52,0,0,0, + 0,1,4,1,14,1,4,1,10,1,10,2,10,1,10,1, + 10,1,2,1,10,1,12,1,16,1,20,1,10,1,8,1, + 20,2,8,1,6,2,10,1,14,1,2,1,16,1,14,1, + 16,1,18,1,114,207,0,0,0,99,2,0,0,0,0,0, + 0,0,0,0,0,0,4,0,0,0,8,0,0,0,67,0, + 0,0,115,128,0,0,0,116,0,124,0,131,1,143,62,1, + 0,116,1,106,2,160,3,124,0,116,4,161,2,125,2,124, + 2,116,4,117,0,114,56,116,5,124,0,124,1,131,2,87, + 0,2,0,100,1,4,0,4,0,131,3,1,0,83,0,87, + 0,100,1,4,0,4,0,131,3,1,0,110,16,49,0,115, + 76,48,0,1,0,1,0,1,0,89,0,1,0,124,2,100, + 1,117,0,114,116,100,2,160,6,124,0,161,1,125,3,116, + 7,124,3,124,0,100,3,141,2,130,1,116,8,124,0,131, + 1,1,0,124,2,83,0,41,4,122,25,70,105,110,100,32, + 97,110,100,32,108,111,97,100,32,116,104,101,32,109,111,100, + 117,108,101,46,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, + 16,0,0,0,41,9,114,51,0,0,0,114,15,0,0,0, + 114,93,0,0,0,114,35,0,0,0,218,14,95,78,69,69, + 68,83,95,76,79,65,68,73,78,71,114,207,0,0,0,114, + 46,0,0,0,114,205,0,0,0,114,66,0,0,0,41,4, + 114,17,0,0,0,114,206,0,0,0,114,97,0,0,0,114, + 76,0,0,0,114,10,0,0,0,114,10,0,0,0,114,11, + 0,0,0,218,14,95,102,105,110,100,95,97,110,100,95,108, + 111,97,100,234,3,0,0,115,22,0,0,0,0,2,10,1, + 14,1,8,1,54,2,8,1,4,1,2,255,4,2,12,2, + 8,1,114,209,0,0,0,114,22,0,0,0,99,3,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0, + 0,67,0,0,0,115,42,0,0,0,116,0,124,0,124,1, + 124,2,131,3,1,0,124,2,100,1,107,4,114,32,116,1, + 124,0,124,1,124,2,131,3,125,0,116,2,124,0,116,3, + 131,2,83,0,41,2,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,22,0, + 0,0,41,4,114,202,0,0,0,114,189,0,0,0,114,209, + 0,0,0,218,11,95,103,99,100,95,105,109,112,111,114,116, + 114,201,0,0,0,114,10,0,0,0,114,10,0,0,0,114, + 11,0,0,0,114,210,0,0,0,250,3,0,0,115,8,0, + 0,0,0,9,12,1,8,1,12,1,114,210,0,0,0,169, + 1,218,9,114,101,99,117,114,115,105,118,101,99,3,0,0, + 0,0,0,0,0,1,0,0,0,8,0,0,0,11,0,0, + 0,67,0,0,0,115,232,0,0,0,124,1,68,0,93,222, + 125,4,116,0,124,4,116,1,131,2,115,66,124,3,114,34, + 124,0,106,2,100,1,23,0,125,5,110,4,100,2,125,5, + 116,3,100,3,124,5,155,0,100,4,116,4,124,4,131,1, + 106,2,155,0,157,4,131,1,130,1,113,4,124,4,100,5, + 107,2,114,108,124,3,115,226,116,5,124,0,100,6,131,2, + 114,226,116,6,124,0,124,0,106,7,124,2,100,7,100,8, + 141,4,1,0,113,4,116,5,124,0,124,4,131,2,115,4, + 100,9,160,8,124,0,106,2,124,4,161,2,125,6,122,14, + 116,9,124,2,124,6,131,2,1,0,87,0,113,4,4,0, + 116,10,121,224,1,0,125,7,1,0,122,54,124,7,106,11, + 124,6,107,2,114,202,116,12,106,13,160,14,124,6,116,15, + 161,2,100,10,117,1,114,202,87,0,89,0,100,10,125,7, + 126,7,113,4,130,0,87,0,89,0,100,10,125,7,126,7, + 113,4,100,10,125,7,126,7,48,0,48,0,113,4,124,0, + 83,0,41,11,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,122,8,46,95,95,97,108,108,95,95,122,13, + 96,96,102,114,111,109,32,108,105,115,116,39,39,122,8,73, + 116,101,109,32,105,110,32,122,18,32,109,117,115,116,32,98, + 101,32,115,116,114,44,32,110,111,116,32,250,1,42,218,7, + 95,95,97,108,108,95,95,84,114,211,0,0,0,114,184,0, + 0,0,78,41,16,114,197,0,0,0,114,198,0,0,0,114, + 1,0,0,0,114,199,0,0,0,114,14,0,0,0,114,4, + 0,0,0,218,16,95,104,97,110,100,108,101,95,102,114,111, + 109,108,105,115,116,114,214,0,0,0,114,46,0,0,0,114, + 68,0,0,0,114,205,0,0,0,114,17,0,0,0,114,15, + 0,0,0,114,93,0,0,0,114,35,0,0,0,114,208,0, + 0,0,41,8,114,97,0,0,0,218,8,102,114,111,109,108, + 105,115,116,114,206,0,0,0,114,212,0,0,0,218,1,120, + 90,5,119,104,101,114,101,90,9,102,114,111,109,95,110,97, + 109,101,90,3,101,120,99,114,10,0,0,0,114,10,0,0, + 0,114,11,0,0,0,114,215,0,0,0,9,4,0,0,115, + 48,0,0,0,0,10,8,1,10,1,4,1,12,2,4,1, + 10,1,8,255,10,2,8,1,14,1,10,1,2,255,8,2, + 10,1,14,1,2,1,14,1,14,4,10,1,16,255,2,2, + 12,1,26,1,114,215,0,0,0,99,1,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,6,0,0,0,67,0, + 0,0,115,146,0,0,0,124,0,160,0,100,1,161,1,125, + 1,124,0,160,0,100,2,161,1,125,2,124,1,100,3,117, + 1,114,82,124,2,100,3,117,1,114,78,124,1,124,2,106, + 1,107,3,114,78,116,2,106,3,100,4,124,1,155,2,100, + 5,124,2,106,1,155,2,100,6,157,5,116,4,100,7,100, + 8,141,3,1,0,124,1,83,0,124,2,100,3,117,1,114, + 96,124,2,106,1,83,0,116,2,106,3,100,9,116,4,100, + 7,100,8,141,3,1,0,124,0,100,10,25,0,125,1,100, + 11,124,0,118,1,114,142,124,1,160,5,100,12,161,1,100, + 13,25,0,125,1,124,1,83,0,41,14,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,146,0,0,0,114,106,0,0,0,78,122, + 32,95,95,112,97,99,107,97,103,101,95,95,32,33,61,32, + 95,95,115,112,101,99,95,95,46,112,97,114,101,110,116,32, + 40,122,4,32,33,61,32,250,1,41,233,3,0,0,0,41, + 1,90,10,115,116,97,99,107,108,101,118,101,108,122,89,99, + 97,110,39,116,32,114,101,115,111,108,118,101,32,112,97,99, + 107,97,103,101,32,102,114,111,109,32,95,95,115,112,101,99, + 95,95,32,111,114,32,95,95,112,97,99,107,97,103,101,95, + 95,44,32,102,97,108,108,105,110,103,32,98,97,99,107,32, + 111,110,32,95,95,110,97,109,101,95,95,32,97,110,100,32, + 95,95,112,97,116,104,95,95,114,1,0,0,0,114,142,0, + 0,0,114,129,0,0,0,114,22,0,0,0,41,6,114,35, + 0,0,0,114,131,0,0,0,114,193,0,0,0,114,194,0, + 0,0,114,195,0,0,0,114,130,0,0,0,41,3,218,7, + 103,108,111,98,97,108,115,114,187,0,0,0,114,96,0,0, + 0,114,10,0,0,0,114,10,0,0,0,114,11,0,0,0, + 218,17,95,99,97,108,99,95,95,95,112,97,99,107,97,103, + 101,95,95,46,4,0,0,115,42,0,0,0,0,7,10,1, + 10,1,8,1,18,1,6,1,2,255,4,1,4,255,6,2, + 4,254,6,3,4,1,8,1,6,2,6,2,4,254,6,3, + 8,1,8,1,14,1,114,221,0,0,0,114,10,0,0,0, + 99,5,0,0,0,0,0,0,0,0,0,0,0,9,0,0, + 0,5,0,0,0,67,0,0,0,115,174,0,0,0,124,4, + 100,1,107,2,114,18,116,0,124,0,131,1,125,5,110,36, + 124,1,100,2,117,1,114,30,124,1,110,2,105,0,125,6, + 116,1,124,6,131,1,125,7,116,0,124,0,124,7,124,4, + 131,3,125,5,124,3,115,148,124,4,100,1,107,2,114,84, + 116,0,124,0,160,2,100,3,161,1,100,1,25,0,131,1, + 83,0,124,0,115,92,124,5,83,0,116,3,124,0,131,1, + 116,3,124,0,160,2,100,3,161,1,100,1,25,0,131,1, + 24,0,125,8,116,4,106,5,124,5,106,6,100,2,116,3, + 124,5,106,6,131,1,124,8,24,0,133,2,25,0,25,0, + 83,0,116,7,124,5,100,4,131,2,114,170,116,8,124,5, + 124,3,116,0,131,3,83,0,124,5,83,0,41,5,97,215, + 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,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,22,0,0,0,78, + 114,129,0,0,0,114,142,0,0,0,41,9,114,210,0,0, + 0,114,221,0,0,0,218,9,112,97,114,116,105,116,105,111, + 110,114,186,0,0,0,114,15,0,0,0,114,93,0,0,0, + 114,1,0,0,0,114,4,0,0,0,114,215,0,0,0,41, + 9,114,17,0,0,0,114,220,0,0,0,218,6,108,111,99, + 97,108,115,114,216,0,0,0,114,188,0,0,0,114,97,0, + 0,0,90,8,103,108,111,98,97,108,115,95,114,187,0,0, + 0,90,7,99,117,116,95,111,102,102,114,10,0,0,0,114, + 10,0,0,0,114,11,0,0,0,218,10,95,95,105,109,112, + 111,114,116,95,95,73,4,0,0,115,30,0,0,0,0,11, + 8,1,10,2,16,1,8,1,12,1,4,3,8,1,18,1, + 4,1,4,4,26,3,30,1,10,1,12,2,114,224,0,0, + 0,99,1,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,38,0,0,0,116, + 0,160,1,124,0,161,1,125,1,124,1,100,0,117,0,114, + 30,116,2,100,1,124,0,23,0,131,1,130,1,116,3,124, + 1,131,1,83,0,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,4,114,161,0,0,0,114,168,0,0,0,114, + 80,0,0,0,114,160,0,0,0,41,2,114,17,0,0,0, 114,96,0,0,0,114,10,0,0,0,114,10,0,0,0,114, - 11,0,0,0,218,17,95,99,97,108,99,95,95,95,112,97, - 99,107,97,103,101,95,95,46,4,0,0,115,42,0,0,0, - 0,7,10,1,10,1,8,1,18,1,6,1,2,255,4,1, - 4,255,6,2,4,254,6,3,4,1,8,1,6,2,6,2, - 4,254,6,3,8,1,8,1,14,1,114,221,0,0,0,114, - 10,0,0,0,99,5,0,0,0,0,0,0,0,0,0,0, - 0,9,0,0,0,5,0,0,0,67,0,0,0,115,180,0, - 0,0,124,4,100,1,107,2,114,18,116,0,124,0,131,1, - 125,5,110,36,124,1,100,2,117,1,114,30,124,1,110,2, - 105,0,125,6,116,1,124,6,131,1,125,7,116,0,124,0, - 124,7,124,4,131,3,125,5,124,3,115,150,124,4,100,1, - 107,2,114,84,116,0,124,0,160,2,100,3,161,1,100,1, - 25,0,131,1,83,0,124,0,115,92,124,5,83,0,116,3, - 124,0,131,1,116,3,124,0,160,2,100,3,161,1,100,1, - 25,0,131,1,24,0,125,8,116,4,106,5,124,5,106,6, - 100,2,116,3,124,5,106,6,131,1,124,8,24,0,133,2, - 25,0,25,0,83,0,110,26,116,7,124,5,100,4,131,2, - 114,172,116,8,124,5,124,3,116,0,131,3,83,0,124,5, - 83,0,100,2,83,0,41,5,97,215,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,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,22,0,0,0,78,114,129,0,0,0,114, - 142,0,0,0,41,9,114,210,0,0,0,114,221,0,0,0, - 218,9,112,97,114,116,105,116,105,111,110,114,186,0,0,0, - 114,15,0,0,0,114,93,0,0,0,114,1,0,0,0,114, - 4,0,0,0,114,215,0,0,0,41,9,114,17,0,0,0, - 114,220,0,0,0,218,6,108,111,99,97,108,115,114,216,0, - 0,0,114,188,0,0,0,114,97,0,0,0,90,8,103,108, - 111,98,97,108,115,95,114,187,0,0,0,90,7,99,117,116, - 95,111,102,102,114,10,0,0,0,114,10,0,0,0,114,11, - 0,0,0,218,10,95,95,105,109,112,111,114,116,95,95,73, - 4,0,0,115,30,0,0,0,0,11,8,1,10,2,16,1, - 8,1,12,1,4,3,8,1,18,1,4,1,4,4,26,3, - 32,1,10,1,12,2,114,224,0,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,160,1,124,0,161, - 1,125,1,124,1,100,0,117,0,114,30,116,2,100,1,124, - 0,23,0,131,1,130,1,116,3,124,1,131,1,83,0,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,4,114, - 161,0,0,0,114,168,0,0,0,114,80,0,0,0,114,160, - 0,0,0,41,2,114,17,0,0,0,114,96,0,0,0,114, - 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,18, - 95,98,117,105,108,116,105,110,95,102,114,111,109,95,110,97, - 109,101,110,4,0,0,115,8,0,0,0,0,1,10,1,8, - 1,12,1,114,225,0,0,0,99,2,0,0,0,0,0,0, - 0,0,0,0,0,10,0,0,0,5,0,0,0,67,0,0, - 0,115,166,0,0,0,124,1,97,0,124,0,97,1,116,2, - 116,1,131,1,125,2,116,1,106,3,160,4,161,0,68,0, - 93,72,92,2,125,3,125,4,116,5,124,4,124,2,131,2, - 114,26,124,3,116,1,106,6,118,0,114,60,116,7,125,5, - 110,18,116,0,160,8,124,3,161,1,114,26,116,9,125,5, - 110,2,113,26,116,10,124,4,124,5,131,2,125,6,116,11, - 124,6,124,4,131,2,1,0,113,26,116,1,106,3,116,12, - 25,0,125,7,100,1,68,0,93,46,125,8,124,8,116,1, - 106,3,118,1,114,138,116,13,124,8,131,1,125,9,110,10, - 116,1,106,3,124,8,25,0,125,9,116,14,124,7,124,8, - 124,9,131,3,1,0,113,114,100,2,83,0,41,3,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,41,3,114,23,0,0, - 0,114,193,0,0,0,114,65,0,0,0,78,41,15,114,58, - 0,0,0,114,15,0,0,0,114,14,0,0,0,114,93,0, - 0,0,218,5,105,116,101,109,115,114,197,0,0,0,114,79, - 0,0,0,114,161,0,0,0,114,89,0,0,0,114,175,0, - 0,0,114,143,0,0,0,114,149,0,0,0,114,1,0,0, - 0,114,225,0,0,0,114,5,0,0,0,41,10,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,17,0,0,0,114,97,0,0,0,114,110,0, - 0,0,114,96,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,114,10,0,0,0,114,10,0,0,0,114,11,0,0, - 0,218,6,95,115,101,116,117,112,117,4,0,0,115,36,0, - 0,0,0,9,4,1,4,3,8,1,18,1,10,1,10,1, - 6,1,10,1,6,2,2,1,10,1,12,3,10,1,8,1, - 10,1,10,2,10,1,114,229,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,38,0,0,0,116,0,124,0,124,1,131, - 2,1,0,116,1,106,2,160,3,116,4,161,1,1,0,116, - 1,106,2,160,3,116,5,161,1,1,0,100,1,83,0,41, - 2,122,48,73,110,115,116,97,108,108,32,105,109,112,111,114, - 116,101,114,115,32,102,111,114,32,98,117,105,108,116,105,110, - 32,97,110,100,32,102,114,111,122,101,110,32,109,111,100,117, - 108,101,115,78,41,6,114,229,0,0,0,114,15,0,0,0, - 114,192,0,0,0,114,120,0,0,0,114,161,0,0,0,114, - 175,0,0,0,41,2,114,227,0,0,0,114,228,0,0,0, - 114,10,0,0,0,114,10,0,0,0,114,11,0,0,0,218, - 8,95,105,110,115,116,97,108,108,152,4,0,0,115,6,0, - 0,0,0,2,10,2,12,1,114,230,0,0,0,99,0,0, - 0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0, - 0,0,67,0,0,0,115,32,0,0,0,100,1,100,2,108, - 0,125,0,124,0,97,1,124,0,160,2,116,3,106,4,116, - 5,25,0,161,1,1,0,100,2,83,0,41,3,122,57,73, - 110,115,116,97,108,108,32,105,109,112,111,114,116,101,114,115, - 32,116,104,97,116,32,114,101,113,117,105,114,101,32,101,120, - 116,101,114,110,97,108,32,102,105,108,101,115,121,115,116,101, - 109,32,97,99,99,101,115,115,114,22,0,0,0,78,41,6, - 218,26,95,102,114,111,122,101,110,95,105,109,112,111,114,116, - 108,105,98,95,101,120,116,101,114,110,97,108,114,127,0,0, - 0,114,230,0,0,0,114,15,0,0,0,114,93,0,0,0, - 114,1,0,0,0,41,1,114,231,0,0,0,114,10,0,0, - 0,114,10,0,0,0,114,11,0,0,0,218,27,95,105,110, - 115,116,97,108,108,95,101,120,116,101,114,110,97,108,95,105, - 109,112,111,114,116,101,114,115,160,4,0,0,115,6,0,0, - 0,0,3,8,1,4,1,114,232,0,0,0,41,2,78,78, - 41,1,78,41,2,78,114,22,0,0,0,41,4,78,78,114, - 10,0,0,0,114,22,0,0,0,41,50,114,3,0,0,0, - 114,127,0,0,0,114,12,0,0,0,114,18,0,0,0,114, - 60,0,0,0,114,34,0,0,0,114,44,0,0,0,114,19, - 0,0,0,114,20,0,0,0,114,50,0,0,0,114,51,0, - 0,0,114,54,0,0,0,114,66,0,0,0,114,68,0,0, - 0,114,77,0,0,0,114,87,0,0,0,114,91,0,0,0, - 114,98,0,0,0,114,112,0,0,0,114,113,0,0,0,114, - 92,0,0,0,114,143,0,0,0,114,149,0,0,0,114,153, - 0,0,0,114,108,0,0,0,114,94,0,0,0,114,159,0, - 0,0,114,160,0,0,0,114,95,0,0,0,114,161,0,0, - 0,114,175,0,0,0,114,180,0,0,0,114,189,0,0,0, - 114,191,0,0,0,114,196,0,0,0,114,202,0,0,0,90, - 15,95,69,82,82,95,77,83,71,95,80,82,69,70,73,88, - 114,204,0,0,0,114,207,0,0,0,218,6,111,98,106,101, - 99,116,114,208,0,0,0,114,209,0,0,0,114,210,0,0, - 0,114,215,0,0,0,114,221,0,0,0,114,224,0,0,0, - 114,225,0,0,0,114,229,0,0,0,114,230,0,0,0,114, - 232,0,0,0,114,10,0,0,0,114,10,0,0,0,114,10, - 0,0,0,114,11,0,0,0,218,8,60,109,111,100,117,108, - 101,62,1,0,0,0,115,94,0,0,0,4,24,4,2,8, - 8,8,8,4,2,4,3,16,4,14,77,14,21,14,16,8, - 37,8,17,8,11,14,8,8,11,8,12,8,16,8,36,14, - 101,16,26,10,45,14,72,8,17,8,17,8,30,8,37,8, - 42,8,15,14,75,14,79,14,13,8,9,8,9,10,47,8, - 16,4,1,8,2,8,32,6,3,8,16,10,15,14,37,8, - 27,10,37,8,7,8,35,8,8, + 11,0,0,0,218,18,95,98,117,105,108,116,105,110,95,102, + 114,111,109,95,110,97,109,101,110,4,0,0,115,8,0,0, + 0,0,1,10,1,8,1,12,1,114,225,0,0,0,99,2, + 0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,5, + 0,0,0,67,0,0,0,115,166,0,0,0,124,1,97,0, + 124,0,97,1,116,2,116,1,131,1,125,2,116,1,106,3, + 160,4,161,0,68,0,93,72,92,2,125,3,125,4,116,5, + 124,4,124,2,131,2,114,26,124,3,116,1,106,6,118,0, + 114,60,116,7,125,5,110,18,116,0,160,8,124,3,161,1, + 114,26,116,9,125,5,110,2,113,26,116,10,124,4,124,5, + 131,2,125,6,116,11,124,6,124,4,131,2,1,0,113,26, + 116,1,106,3,116,12,25,0,125,7,100,1,68,0,93,46, + 125,8,124,8,116,1,106,3,118,1,114,138,116,13,124,8, + 131,1,125,9,110,10,116,1,106,3,124,8,25,0,125,9, + 116,14,124,7,124,8,124,9,131,3,1,0,113,114,100,2, + 83,0,41,3,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, + 41,3,114,23,0,0,0,114,193,0,0,0,114,65,0,0, + 0,78,41,15,114,58,0,0,0,114,15,0,0,0,114,14, + 0,0,0,114,93,0,0,0,218,5,105,116,101,109,115,114, + 197,0,0,0,114,79,0,0,0,114,161,0,0,0,114,89, + 0,0,0,114,175,0,0,0,114,143,0,0,0,114,149,0, + 0,0,114,1,0,0,0,114,225,0,0,0,114,5,0,0, + 0,41,10,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,17,0,0,0,114,97, + 0,0,0,114,110,0,0,0,114,96,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,114,10,0,0,0,114,10,0, + 0,0,114,11,0,0,0,218,6,95,115,101,116,117,112,117, + 4,0,0,115,36,0,0,0,0,9,4,1,4,3,8,1, + 18,1,10,1,10,1,6,1,10,1,6,2,2,1,10,1, + 12,3,10,1,8,1,10,1,10,2,10,1,114,229,0,0, + 0,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,38,0,0,0,116, + 0,124,0,124,1,131,2,1,0,116,1,106,2,160,3,116, + 4,161,1,1,0,116,1,106,2,160,3,116,5,161,1,1, + 0,100,1,83,0,41,2,122,48,73,110,115,116,97,108,108, + 32,105,109,112,111,114,116,101,114,115,32,102,111,114,32,98, + 117,105,108,116,105,110,32,97,110,100,32,102,114,111,122,101, + 110,32,109,111,100,117,108,101,115,78,41,6,114,229,0,0, + 0,114,15,0,0,0,114,192,0,0,0,114,120,0,0,0, + 114,161,0,0,0,114,175,0,0,0,41,2,114,227,0,0, + 0,114,228,0,0,0,114,10,0,0,0,114,10,0,0,0, + 114,11,0,0,0,218,8,95,105,110,115,116,97,108,108,152, + 4,0,0,115,6,0,0,0,0,2,10,2,12,1,114,230, + 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 1,0,0,0,4,0,0,0,67,0,0,0,115,32,0,0, + 0,100,1,100,2,108,0,125,0,124,0,97,1,124,0,160, + 2,116,3,106,4,116,5,25,0,161,1,1,0,100,2,83, + 0,41,3,122,57,73,110,115,116,97,108,108,32,105,109,112, + 111,114,116,101,114,115,32,116,104,97,116,32,114,101,113,117, + 105,114,101,32,101,120,116,101,114,110,97,108,32,102,105,108, + 101,115,121,115,116,101,109,32,97,99,99,101,115,115,114,22, + 0,0,0,78,41,6,218,26,95,102,114,111,122,101,110,95, + 105,109,112,111,114,116,108,105,98,95,101,120,116,101,114,110, + 97,108,114,127,0,0,0,114,230,0,0,0,114,15,0,0, + 0,114,93,0,0,0,114,1,0,0,0,41,1,114,231,0, + 0,0,114,10,0,0,0,114,10,0,0,0,114,11,0,0, + 0,218,27,95,105,110,115,116,97,108,108,95,101,120,116,101, + 114,110,97,108,95,105,109,112,111,114,116,101,114,115,160,4, + 0,0,115,6,0,0,0,0,3,8,1,4,1,114,232,0, + 0,0,41,2,78,78,41,1,78,41,2,78,114,22,0,0, + 0,41,4,78,78,114,10,0,0,0,114,22,0,0,0,41, + 50,114,3,0,0,0,114,127,0,0,0,114,12,0,0,0, + 114,18,0,0,0,114,60,0,0,0,114,34,0,0,0,114, + 44,0,0,0,114,19,0,0,0,114,20,0,0,0,114,50, + 0,0,0,114,51,0,0,0,114,54,0,0,0,114,66,0, + 0,0,114,68,0,0,0,114,77,0,0,0,114,87,0,0, + 0,114,91,0,0,0,114,98,0,0,0,114,112,0,0,0, + 114,113,0,0,0,114,92,0,0,0,114,143,0,0,0,114, + 149,0,0,0,114,153,0,0,0,114,108,0,0,0,114,94, + 0,0,0,114,159,0,0,0,114,160,0,0,0,114,95,0, + 0,0,114,161,0,0,0,114,175,0,0,0,114,180,0,0, + 0,114,189,0,0,0,114,191,0,0,0,114,196,0,0,0, + 114,202,0,0,0,90,15,95,69,82,82,95,77,83,71,95, + 80,82,69,70,73,88,114,204,0,0,0,114,207,0,0,0, + 218,6,111,98,106,101,99,116,114,208,0,0,0,114,209,0, + 0,0,114,210,0,0,0,114,215,0,0,0,114,221,0,0, + 0,114,224,0,0,0,114,225,0,0,0,114,229,0,0,0, + 114,230,0,0,0,114,232,0,0,0,114,10,0,0,0,114, + 10,0,0,0,114,10,0,0,0,114,11,0,0,0,218,8, + 60,109,111,100,117,108,101,62,1,0,0,0,115,94,0,0, + 0,4,24,4,2,8,8,8,8,4,2,4,3,16,4,14, + 77,14,21,14,16,8,37,8,17,8,11,14,8,8,11,8, + 12,8,16,8,36,14,101,16,26,10,45,14,72,8,17,8, + 17,8,30,8,37,8,42,8,15,14,75,14,79,14,13,8, + 9,8,9,10,47,8,16,4,1,8,2,8,32,6,3,8, + 16,10,15,14,37,8,27,10,37,8,7,8,35,8,8, }; diff --git a/Python/importlib_external.h b/Python/importlib_external.h index a5a7c383d785e4..0ef1b45594fbf7 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -163,829 +163,828 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 95,112,97,116,104,95,106,111,105,110,62,0,0,0,115,6, 0,0,0,0,2,10,1,2,255,114,38,0,0,0,99,1, 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,5, - 0,0,0,67,0,0,0,115,96,0,0,0,116,0,116,1, + 0,0,0,67,0,0,0,115,94,0,0,0,116,0,116,1, 131,1,100,1,107,2,114,36,124,0,160,2,116,3,161,1, 92,3,125,1,125,2,125,3,124,1,124,3,102,2,83,0, - 116,4,124,0,131,1,68,0,93,42,125,4,124,4,116,1, + 116,4,124,0,131,1,68,0,93,40,125,4,124,4,116,1, 118,0,114,44,124,0,106,5,124,4,100,1,100,2,141,2, 92,2,125,1,125,3,124,1,124,3,102,2,2,0,1,0, - 83,0,113,44,100,3,124,0,102,2,83,0,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,41,1,90,8,109,97,120,115,112,108,105, - 116,218,0,41,6,114,23,0,0,0,114,31,0,0,0,218, - 10,114,112,97,114,116,105,116,105,111,110,114,35,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,20,0,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,11, - 95,112,97,116,104,95,115,112,108,105,116,68,0,0,0,115, - 16,0,0,0,0,2,12,1,16,1,8,1,12,1,8,1, - 18,1,14,1,114,47,0,0,0,99,1,0,0,0,0,0, - 0,0,0,0,0,0,1,0,0,0,3,0,0,0,67,0, - 0,0,115,10,0,0,0,116,0,160,1,124,0,161,1,83, - 0,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,4,0,0,0,90,4,115,116,97,116, - 169,1,114,44,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,8,0,0,0,218,10,95,112,97,116,104,95,115,116, - 97,116,80,0,0,0,115,2,0,0,0,0,7,114,49,0, - 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,8,0,0,0,67,0,0,0,115,48,0,0,0, - 122,12,116,0,124,0,131,1,125,2,87,0,110,20,4,0, - 116,1,121,32,1,0,1,0,1,0,89,0,100,1,83,0, - 48,0,124,2,106,2,100,2,64,0,124,1,107,2,83,0, - 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,49,0, - 0,0,218,7,79,83,69,114,114,111,114,218,7,115,116,95, - 109,111,100,101,41,3,114,44,0,0,0,218,4,109,111,100, - 101,90,9,115,116,97,116,95,105,110,102,111,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,218,18,95,112,97, - 116,104,95,105,115,95,109,111,100,101,95,116,121,112,101,90, - 0,0,0,115,10,0,0,0,0,2,2,1,12,1,12,1, - 8,1,114,53,0,0,0,99,1,0,0,0,0,0,0,0, + 83,0,100,3,124,0,102,2,83,0,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,41,1,90,8,109,97,120,115,112,108,105,116,218, + 0,41,6,114,23,0,0,0,114,31,0,0,0,218,10,114, + 112,97,114,116,105,116,105,111,110,114,35,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,20,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,218,11,95,112, + 97,116,104,95,115,112,108,105,116,68,0,0,0,115,16,0, + 0,0,0,2,12,1,16,1,8,1,12,1,8,1,18,1, + 12,1,114,47,0,0,0,99,1,0,0,0,0,0,0,0, 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, - 115,10,0,0,0,116,0,124,0,100,1,131,2,83,0,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,53,0,0,0,114,48, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,218,12,95,112,97,116,104,95,105,115,102,105,108,101, - 99,0,0,0,115,2,0,0,0,0,2,114,54,0,0,0, - 99,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0, - 0,3,0,0,0,67,0,0,0,115,22,0,0,0,124,0, - 115,12,116,0,160,1,161,0,125,0,116,2,124,0,100,1, - 131,2,83,0,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,4,0, - 0,0,218,6,103,101,116,99,119,100,114,53,0,0,0,114, - 48,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,11,95,112,97,116,104,95,105,115,100,105,114, - 104,0,0,0,115,6,0,0,0,0,2,4,1,8,1,114, - 56,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, - 0,1,0,0,0,3,0,0,0,67,0,0,0,115,26,0, - 0,0,124,0,160,0,116,1,161,1,112,24,124,0,100,1, - 100,2,133,2,25,0,116,2,118,0,83,0,41,3,122,142, - 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,97,98,115,46,10,10, - 32,32,32,32,67,111,110,115,105,100,101,114,115,32,97,32, - 87,105,110,100,111,119,115,32,100,114,105,118,101,45,114,101, - 108,97,116,105,118,101,32,112,97,116,104,32,40,110,111,32, - 100,114,105,118,101,44,32,98,117,116,32,115,116,97,114,116, - 115,32,119,105,116,104,32,115,108,97,115,104,41,32,116,111, - 10,32,32,32,32,115,116,105,108,108,32,98,101,32,34,97, - 98,115,111,108,117,116,101,34,46,10,32,32,32,32,114,39, - 0,0,0,233,3,0,0,0,41,3,114,11,0,0,0,114, - 31,0,0,0,218,20,95,112,97,116,104,115,101,112,115,95, - 119,105,116,104,95,99,111,108,111,110,114,48,0,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,11, - 95,112,97,116,104,95,105,115,97,98,115,111,0,0,0,115, - 2,0,0,0,0,6,114,59,0,0,0,233,182,1,0,0, - 99,3,0,0,0,0,0,0,0,0,0,0,0,6,0,0, - 0,11,0,0,0,67,0,0,0,115,178,0,0,0,100,1, - 160,0,124,0,116,1,124,0,131,1,161,2,125,3,116,2, - 160,3,124,3,116,2,106,4,116,2,106,5,66,0,116,2, - 106,6,66,0,124,2,100,2,64,0,161,3,125,4,122,70, - 116,7,160,8,124,4,100,3,161,2,143,26,125,5,124,5, - 160,9,124,1,161,1,1,0,87,0,100,4,4,0,4,0, - 131,3,1,0,110,16,49,0,115,94,48,0,1,0,1,0, - 1,0,89,0,1,0,116,2,160,10,124,3,124,0,161,2, - 1,0,87,0,110,54,4,0,116,11,121,172,1,0,1,0, - 1,0,122,14,116,2,160,12,124,3,161,1,1,0,87,0, - 110,18,4,0,116,11,121,164,1,0,1,0,1,0,89,0, - 110,2,48,0,130,0,89,0,110,2,48,0,100,4,83,0, - 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,250,5,123,125,46,123,125,114,60,0, - 0,0,90,2,119,98,78,41,13,218,6,102,111,114,109,97, - 116,218,2,105,100,114,4,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,50,0,0,0,90,6,117, - 110,108,105,110,107,41,6,114,44,0,0,0,114,26,0,0, - 0,114,52,0,0,0,90,8,112,97,116,104,95,116,109,112, - 90,2,102,100,218,4,102,105,108,101,114,5,0,0,0,114, - 5,0,0,0,114,8,0,0,0,218,13,95,119,114,105,116, - 101,95,97,116,111,109,105,99,120,0,0,0,115,28,0,0, - 0,0,5,16,1,6,1,22,255,4,2,2,3,14,1,40, - 1,16,1,12,1,2,1,14,1,12,1,6,1,114,69,0, - 0,0,105,97,13,0,0,114,28,0,0,0,114,17,0,0, - 0,115,2,0,0,0,13,10,90,11,95,95,112,121,99,97, - 99,104,101,95,95,122,4,111,112,116,45,122,3,46,112,121, - 122,4,46,112,121,99,78,41,1,218,12,111,112,116,105,109, - 105,122,97,116,105,111,110,99,2,0,0,0,0,0,0,0, - 1,0,0,0,12,0,0,0,5,0,0,0,67,0,0,0, - 115,88,1,0,0,124,1,100,1,117,1,114,52,116,0,160, - 1,100,2,116,2,161,2,1,0,124,2,100,1,117,1,114, - 40,100,3,125,3,116,3,124,3,131,1,130,1,124,1,114, - 48,100,4,110,2,100,5,125,2,116,4,160,5,124,0,161, - 1,125,0,116,6,124,0,131,1,92,2,125,4,125,5,124, - 5,160,7,100,6,161,1,92,3,125,6,125,7,125,8,116, - 8,106,9,106,10,125,9,124,9,100,1,117,0,114,114,116, - 11,100,7,131,1,130,1,100,4,160,12,124,6,114,126,124, - 6,110,2,124,8,124,7,124,9,103,3,161,1,125,10,124, - 2,100,1,117,0,114,172,116,8,106,13,106,14,100,8,107, - 2,114,164,100,4,125,2,110,8,116,8,106,13,106,14,125, - 2,116,15,124,2,131,1,125,2,124,2,100,4,107,3,114, - 224,124,2,160,16,161,0,115,210,116,17,100,9,160,18,124, - 2,161,1,131,1,130,1,100,10,160,18,124,10,116,19,124, - 2,161,3,125,10,124,10,116,20,100,8,25,0,23,0,125, - 11,116,8,106,21,100,1,117,1,144,1,114,76,116,22,124, - 4,131,1,144,1,115,16,116,23,116,4,160,24,161,0,124, - 4,131,2,125,4,124,4,100,5,25,0,100,11,107,2,144, - 1,114,56,124,4,100,8,25,0,116,25,118,1,144,1,114, - 56,124,4,100,12,100,1,133,2,25,0,125,4,116,23,116, - 8,106,21,124,4,160,26,116,25,161,1,124,11,131,3,83, - 0,116,23,124,4,116,27,124,11,131,3,83,0,41,13,97, - 254,2,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,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,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,10,10,32,32, - 32,32,84,104,101,32,39,111,112,116,105,109,105,122,97,116, - 105,111,110,39,32,112,97,114,97,109,101,116,101,114,32,99, - 111,110,116,114,111,108,115,32,116,104,101,32,112,114,101,115, - 117,109,101,100,32,111,112,116,105,109,105,122,97,116,105,111, - 110,32,108,101,118,101,108,32,111,102,10,32,32,32,32,116, - 104,101,32,98,121,116,101,99,111,100,101,32,102,105,108,101, - 46,32,73,102,32,39,111,112,116,105,109,105,122,97,116,105, - 111,110,39,32,105,115,32,110,111,116,32,78,111,110,101,44, - 32,116,104,101,32,115,116,114,105,110,103,32,114,101,112,114, - 101,115,101,110,116,97,116,105,111,110,10,32,32,32,32,111, - 102,32,116,104,101,32,97,114,103,117,109,101,110,116,32,105, - 115,32,116,97,107,101,110,32,97,110,100,32,118,101,114,105, - 102,105,101,100,32,116,111,32,98,101,32,97,108,112,104,97, - 110,117,109,101,114,105,99,32,40,101,108,115,101,32,86,97, - 108,117,101,69,114,114,111,114,10,32,32,32,32,105,115,32, - 114,97,105,115,101,100,41,46,10,10,32,32,32,32,84,104, - 101,32,100,101,98,117,103,95,111,118,101,114,114,105,100,101, - 32,112,97,114,97,109,101,116,101,114,32,105,115,32,100,101, - 112,114,101,99,97,116,101,100,46,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,10,32,32,32,32,97,32,84, - 114,117,101,32,118,97,108,117,101,32,105,115,32,116,104,101, - 32,115,97,109,101,32,97,115,32,115,101,116,116,105,110,103, - 32,39,111,112,116,105,109,105,122,97,116,105,111,110,39,32, - 116,111,32,116,104,101,32,101,109,112,116,121,32,115,116,114, - 105,110,103,10,32,32,32,32,119,104,105,108,101,32,97,32, - 70,97,108,115,101,32,118,97,108,117,101,32,105,115,32,101, - 113,117,105,118,97,108,101,110,116,32,116,111,32,115,101,116, - 116,105,110,103,32,39,111,112,116,105,109,105,122,97,116,105, - 111,110,39,32,116,111,32,39,49,39,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,122,70,116,104,101,32,100,101,98,117,103,95,111, - 118,101,114,114,105,100,101,32,112,97,114,97,109,101,116,101, - 114,32,105,115,32,100,101,112,114,101,99,97,116,101,100,59, - 32,117,115,101,32,39,111,112,116,105,109,105,122,97,116,105, - 111,110,39,32,105,110,115,116,101,97,100,122,50,100,101,98, - 117,103,95,111,118,101,114,114,105,100,101,32,111,114,32,111, - 112,116,105,109,105,122,97,116,105,111,110,32,109,117,115,116, - 32,98,101,32,115,101,116,32,116,111,32,78,111,110,101,114, - 40,0,0,0,114,39,0,0,0,218,1,46,250,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,233,0,0,0,0,122,24,123,33,114,125,32,105,115, - 32,110,111,116,32,97,108,112,104,97,110,117,109,101,114,105, - 99,122,7,123,125,46,123,125,123,125,250,1,58,114,28,0, - 0,0,41,28,218,9,95,119,97,114,110,105,110,103,115,218, - 4,119,97,114,110,218,18,68,101,112,114,101,99,97,116,105, - 111,110,87,97,114,110,105,110,103,218,9,84,121,112,101,69, - 114,114,111,114,114,4,0,0,0,218,6,102,115,112,97,116, - 104,114,47,0,0,0,114,41,0,0,0,114,1,0,0,0, - 218,14,105,109,112,108,101,109,101,110,116,97,116,105,111,110, - 218,9,99,97,99,104,101,95,116,97,103,218,19,78,111,116, - 73,109,112,108,101,109,101,110,116,101,100,69,114,114,111,114, - 114,36,0,0,0,114,2,0,0,0,218,8,111,112,116,105, - 109,105,122,101,218,3,115,116,114,218,7,105,115,97,108,110, - 117,109,218,10,86,97,108,117,101,69,114,114,111,114,114,62, - 0,0,0,218,4,95,79,80,84,218,17,66,89,84,69,67, - 79,68,69,95,83,85,70,70,73,88,69,83,218,14,112,121, - 99,97,99,104,101,95,112,114,101,102,105,120,114,59,0,0, - 0,114,38,0,0,0,114,55,0,0,0,114,31,0,0,0, - 218,6,108,115,116,114,105,112,218,8,95,80,89,67,65,67, - 72,69,41,12,114,44,0,0,0,90,14,100,101,98,117,103, - 95,111,118,101,114,114,105,100,101,114,70,0,0,0,218,7, - 109,101,115,115,97,103,101,218,4,104,101,97,100,114,46,0, - 0,0,90,4,98,97,115,101,218,3,115,101,112,218,4,114, - 101,115,116,90,3,116,97,103,90,15,97,108,109,111,115,116, - 95,102,105,108,101,110,97,109,101,218,8,102,105,108,101,110, - 97,109,101,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,218,17,99,97,99,104,101,95,102,114,111,109,95,115, - 111,117,114,99,101,45,1,0,0,115,72,0,0,0,0,18, - 8,1,6,1,2,255,4,2,8,1,4,1,8,1,12,1, - 10,1,12,1,16,1,8,1,8,1,8,1,24,1,8,1, - 12,1,6,2,8,1,8,1,8,1,8,1,14,1,14,1, - 12,1,12,9,10,1,14,5,28,1,12,4,2,1,4,1, - 8,1,2,253,4,5,114,97,0,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,10,0,0,0,5,0,0,0, - 67,0,0,0,115,46,1,0,0,116,0,106,1,106,2,100, - 1,117,0,114,20,116,3,100,2,131,1,130,1,116,4,160, - 5,124,0,161,1,125,0,116,6,124,0,131,1,92,2,125, - 1,125,2,100,3,125,3,116,0,106,7,100,1,117,1,114, - 102,116,0,106,7,160,8,116,9,161,1,125,4,124,1,160, - 10,124,4,116,11,23,0,161,1,114,102,124,1,116,12,124, - 4,131,1,100,1,133,2,25,0,125,1,100,4,125,3,124, - 3,115,144,116,6,124,1,131,1,92,2,125,1,125,5,124, - 5,116,13,107,3,114,144,116,14,116,13,155,0,100,5,124, - 0,155,2,157,3,131,1,130,1,124,2,160,15,100,6,161, - 1,125,6,124,6,100,7,118,1,114,178,116,14,100,8,124, - 2,155,2,157,2,131,1,130,1,110,92,124,6,100,9,107, - 2,144,1,114,14,124,2,160,16,100,6,100,10,161,2,100, - 11,25,0,125,7,124,7,160,10,116,17,161,1,115,228,116, - 14,100,12,116,17,155,2,157,2,131,1,130,1,124,7,116, - 12,116,17,131,1,100,1,133,2,25,0,125,8,124,8,160, - 18,161,0,144,1,115,14,116,14,100,13,124,7,155,2,100, - 14,157,3,131,1,130,1,124,2,160,19,100,6,161,1,100, - 15,25,0,125,9,116,20,124,1,124,9,116,21,100,15,25, - 0,23,0,131,2,83,0,41,16,97,110,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,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,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,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,47, - 52,56,56,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,114,72,0, - 0,0,70,84,122,31,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,114,71,0,0,0,62,2,0,0,0,114, - 28,0,0,0,114,57,0,0,0,122,29,101,120,112,101,99, - 116,101,100,32,111,110,108,121,32,50,32,111,114,32,51,32, - 100,111,116,115,32,105,110,32,114,57,0,0,0,114,28,0, - 0,0,233,254,255,255,255,122,53,111,112,116,105,109,105,122, - 97,116,105,111,110,32,112,111,114,116,105,111,110,32,111,102, - 32,102,105,108,101,110,97,109,101,32,100,111,101,115,32,110, - 111,116,32,115,116,97,114,116,32,119,105,116,104,32,122,19, - 111,112,116,105,109,105,122,97,116,105,111,110,32,108,101,118, - 101,108,32,122,29,32,105,115,32,110,111,116,32,97,110,32, - 97,108,112,104,97,110,117,109,101,114,105,99,32,118,97,108, - 117,101,114,73,0,0,0,41,22,114,1,0,0,0,114,80, - 0,0,0,114,81,0,0,0,114,82,0,0,0,114,4,0, - 0,0,114,79,0,0,0,114,47,0,0,0,114,89,0,0, - 0,114,30,0,0,0,114,31,0,0,0,114,11,0,0,0, - 114,35,0,0,0,114,23,0,0,0,114,91,0,0,0,114, - 86,0,0,0,218,5,99,111,117,110,116,114,43,0,0,0, - 114,87,0,0,0,114,85,0,0,0,218,9,112,97,114,116, - 105,116,105,111,110,114,38,0,0,0,218,15,83,79,85,82, - 67,69,95,83,85,70,70,73,88,69,83,41,10,114,44,0, - 0,0,114,93,0,0,0,90,16,112,121,99,97,99,104,101, - 95,102,105,108,101,110,97,109,101,90,23,102,111,117,110,100, - 95,105,110,95,112,121,99,97,99,104,101,95,112,114,101,102, - 105,120,90,13,115,116,114,105,112,112,101,100,95,112,97,116, - 104,90,7,112,121,99,97,99,104,101,90,9,100,111,116,95, - 99,111,117,110,116,114,70,0,0,0,90,9,111,112,116,95, - 108,101,118,101,108,90,13,98,97,115,101,95,102,105,108,101, - 110,97,109,101,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,17,115,111,117,114,99,101,95,102,114,111,109, - 95,99,97,99,104,101,116,1,0,0,115,60,0,0,0,0, - 9,12,1,8,1,10,1,12,1,4,1,10,1,12,1,14, - 1,16,1,4,1,4,1,12,1,8,1,8,1,2,255,8, - 2,10,1,8,1,16,1,10,1,16,1,10,1,4,1,2, - 255,8,2,16,1,10,1,16,2,14,1,114,102,0,0,0, - 99,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0, - 0,9,0,0,0,67,0,0,0,115,124,0,0,0,116,0, - 124,0,131,1,100,1,107,2,114,16,100,2,83,0,124,0, - 160,1,100,3,161,1,92,3,125,1,125,2,125,3,124,1, - 114,56,124,3,160,2,161,0,100,4,100,5,133,2,25,0, - 100,6,107,3,114,60,124,0,83,0,122,12,116,3,124,0, - 131,1,125,4,87,0,110,34,4,0,116,4,116,5,102,2, - 121,106,1,0,1,0,1,0,124,0,100,2,100,5,133,2, - 25,0,125,4,89,0,110,2,48,0,116,6,124,4,131,1, - 114,120,124,4,83,0,124,0,83,0,41,7,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,73,0,0,0,78, - 114,71,0,0,0,233,253,255,255,255,233,255,255,255,255,90, - 2,112,121,41,7,114,23,0,0,0,114,41,0,0,0,218, - 5,108,111,119,101,114,114,102,0,0,0,114,82,0,0,0, - 114,86,0,0,0,114,54,0,0,0,41,5,218,13,98,121, - 116,101,99,111,100,101,95,112,97,116,104,114,95,0,0,0, - 114,45,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,5,0, - 0,0,114,5,0,0,0,114,8,0,0,0,218,15,95,103, - 101,116,95,115,111,117,114,99,101,102,105,108,101,156,1,0, - 0,115,20,0,0,0,0,7,12,1,4,1,16,1,24,1, - 4,1,2,1,12,1,16,1,18,1,114,108,0,0,0,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 8,0,0,0,67,0,0,0,115,72,0,0,0,124,0,160, - 0,116,1,116,2,131,1,161,1,114,46,122,10,116,3,124, - 0,131,1,87,0,83,0,4,0,116,4,121,42,1,0,1, - 0,1,0,89,0,113,68,48,0,110,22,124,0,160,0,116, - 1,116,5,131,1,161,1,114,64,124,0,83,0,100,0,83, - 0,100,0,83,0,169,1,78,41,6,218,8,101,110,100,115, - 119,105,116,104,218,5,116,117,112,108,101,114,101,0,0,0, - 114,97,0,0,0,114,82,0,0,0,114,88,0,0,0,41, - 1,114,96,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,0,0,0,218,11,95,103,101,116,95,99,97,99,104, - 101,100,175,1,0,0,115,16,0,0,0,0,1,14,1,2, - 1,10,1,12,1,8,1,14,1,4,2,114,112,0,0,0, - 99,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,8,0,0,0,67,0,0,0,115,50,0,0,0,122,14, - 116,0,124,0,131,1,106,1,125,1,87,0,110,22,4,0, - 116,2,121,36,1,0,1,0,1,0,100,1,125,1,89,0, - 110,2,48,0,124,1,100,2,79,0,125,1,124,1,83,0, - 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,114,60,0,0,0,233,128,0,0, - 0,41,3,114,49,0,0,0,114,51,0,0,0,114,50,0, - 0,0,41,2,114,44,0,0,0,114,52,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,218,10,95, - 99,97,108,99,95,109,111,100,101,187,1,0,0,115,12,0, - 0,0,0,2,2,1,14,1,12,1,10,3,8,1,114,114, + 115,10,0,0,0,116,0,160,1,124,0,161,1,83,0,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,4,0,0,0,90,4,115,116,97,116,169,1, + 114,44,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,218,10,95,112,97,116,104,95,115,116,97,116, + 80,0,0,0,115,2,0,0,0,0,7,114,49,0,0,0, + 99,2,0,0,0,0,0,0,0,0,0,0,0,3,0,0, + 0,8,0,0,0,67,0,0,0,115,48,0,0,0,122,12, + 116,0,124,0,131,1,125,2,87,0,110,20,4,0,116,1, + 121,32,1,0,1,0,1,0,89,0,100,1,83,0,48,0, + 124,2,106,2,100,2,64,0,124,1,107,2,83,0,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,49,0,0,0, + 218,7,79,83,69,114,114,111,114,218,7,115,116,95,109,111, + 100,101,41,3,114,44,0,0,0,218,4,109,111,100,101,90, + 9,115,116,97,116,95,105,110,102,111,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,218,18,95,112,97,116,104, + 95,105,115,95,109,111,100,101,95,116,121,112,101,90,0,0, + 0,115,10,0,0,0,0,2,2,1,12,1,12,1,8,1, + 114,53,0,0,0,99,1,0,0,0,0,0,0,0,0,0, + 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,10, + 0,0,0,116,0,124,0,100,1,131,2,83,0,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,53,0,0,0,114,48,0,0, + 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, + 218,12,95,112,97,116,104,95,105,115,102,105,108,101,99,0, + 0,0,115,2,0,0,0,0,2,114,54,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,3, + 0,0,0,67,0,0,0,115,22,0,0,0,124,0,115,12, + 116,0,160,1,161,0,125,0,116,2,124,0,100,1,131,2, + 83,0,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,4,0,0,0, + 218,6,103,101,116,99,119,100,114,53,0,0,0,114,48,0, + 0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0, + 0,218,11,95,112,97,116,104,95,105,115,100,105,114,104,0, + 0,0,115,6,0,0,0,0,2,4,1,8,1,114,56,0, + 0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,26,0,0,0, + 124,0,160,0,116,1,161,1,112,24,124,0,100,1,100,2, + 133,2,25,0,116,2,118,0,83,0,41,3,122,142,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,97,98,115,46,10,10,32,32, + 32,32,67,111,110,115,105,100,101,114,115,32,97,32,87,105, + 110,100,111,119,115,32,100,114,105,118,101,45,114,101,108,97, + 116,105,118,101,32,112,97,116,104,32,40,110,111,32,100,114, + 105,118,101,44,32,98,117,116,32,115,116,97,114,116,115,32, + 119,105,116,104,32,115,108,97,115,104,41,32,116,111,10,32, + 32,32,32,115,116,105,108,108,32,98,101,32,34,97,98,115, + 111,108,117,116,101,34,46,10,32,32,32,32,114,39,0,0, + 0,233,3,0,0,0,41,3,114,11,0,0,0,114,31,0, + 0,0,218,20,95,112,97,116,104,115,101,112,115,95,119,105, + 116,104,95,99,111,108,111,110,114,48,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,218,11,95,112, + 97,116,104,95,105,115,97,98,115,111,0,0,0,115,2,0, + 0,0,0,6,114,59,0,0,0,233,182,1,0,0,99,3, + 0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,11, + 0,0,0,67,0,0,0,115,172,0,0,0,100,1,160,0, + 124,0,116,1,124,0,131,1,161,2,125,3,116,2,160,3, + 124,3,116,2,106,4,116,2,106,5,66,0,116,2,106,6, + 66,0,124,2,100,2,64,0,161,3,125,4,122,70,116,7, + 160,8,124,4,100,3,161,2,143,26,125,5,124,5,160,9, + 124,1,161,1,1,0,87,0,100,4,4,0,4,0,131,3, + 1,0,110,16,49,0,115,94,48,0,1,0,1,0,1,0, + 89,0,1,0,116,2,160,10,124,3,124,0,161,2,1,0, + 87,0,110,48,4,0,116,11,121,166,1,0,1,0,1,0, + 122,14,116,2,160,12,124,3,161,1,1,0,87,0,130,0, + 4,0,116,11,121,164,1,0,1,0,1,0,89,0,130,0, + 48,0,48,0,100,4,83,0,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,250,5, + 123,125,46,123,125,114,60,0,0,0,90,2,119,98,78,41, + 13,218,6,102,111,114,109,97,116,218,2,105,100,114,4,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,50,0,0,0,90,6,117,110,108,105,110,107,41,6,114, + 44,0,0,0,114,26,0,0,0,114,52,0,0,0,90,8, + 112,97,116,104,95,116,109,112,90,2,102,100,218,4,102,105, + 108,101,114,5,0,0,0,114,5,0,0,0,114,8,0,0, + 0,218,13,95,119,114,105,116,101,95,97,116,111,109,105,99, + 120,0,0,0,115,28,0,0,0,0,5,16,1,6,1,22, + 255,4,2,2,3,14,1,40,1,16,1,12,1,2,1,14, + 1,12,1,6,1,114,69,0,0,0,105,97,13,0,0,114, + 28,0,0,0,114,17,0,0,0,115,2,0,0,0,13,10, + 90,11,95,95,112,121,99,97,99,104,101,95,95,122,4,111, + 112,116,45,122,3,46,112,121,122,4,46,112,121,99,78,41, + 1,218,12,111,112,116,105,109,105,122,97,116,105,111,110,99, + 2,0,0,0,0,0,0,0,1,0,0,0,12,0,0,0, + 5,0,0,0,67,0,0,0,115,88,1,0,0,124,1,100, + 1,117,1,114,52,116,0,160,1,100,2,116,2,161,2,1, + 0,124,2,100,1,117,1,114,40,100,3,125,3,116,3,124, + 3,131,1,130,1,124,1,114,48,100,4,110,2,100,5,125, + 2,116,4,160,5,124,0,161,1,125,0,116,6,124,0,131, + 1,92,2,125,4,125,5,124,5,160,7,100,6,161,1,92, + 3,125,6,125,7,125,8,116,8,106,9,106,10,125,9,124, + 9,100,1,117,0,114,114,116,11,100,7,131,1,130,1,100, + 4,160,12,124,6,114,126,124,6,110,2,124,8,124,7,124, + 9,103,3,161,1,125,10,124,2,100,1,117,0,114,172,116, + 8,106,13,106,14,100,8,107,2,114,164,100,4,125,2,110, + 8,116,8,106,13,106,14,125,2,116,15,124,2,131,1,125, + 2,124,2,100,4,107,3,114,224,124,2,160,16,161,0,115, + 210,116,17,100,9,160,18,124,2,161,1,131,1,130,1,100, + 10,160,18,124,10,116,19,124,2,161,3,125,10,124,10,116, + 20,100,8,25,0,23,0,125,11,116,8,106,21,100,1,117, + 1,144,1,114,76,116,22,124,4,131,1,144,1,115,16,116, + 23,116,4,160,24,161,0,124,4,131,2,125,4,124,4,100, + 5,25,0,100,11,107,2,144,1,114,56,124,4,100,8,25, + 0,116,25,118,1,144,1,114,56,124,4,100,12,100,1,133, + 2,25,0,125,4,116,23,116,8,106,21,124,4,160,26,116, + 25,161,1,124,11,131,3,83,0,116,23,124,4,116,27,124, + 11,131,3,83,0,41,13,97,254,2,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,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,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,10,10,32,32,32,32,84,104,101,32,39,111, + 112,116,105,109,105,122,97,116,105,111,110,39,32,112,97,114, + 97,109,101,116,101,114,32,99,111,110,116,114,111,108,115,32, + 116,104,101,32,112,114,101,115,117,109,101,100,32,111,112,116, + 105,109,105,122,97,116,105,111,110,32,108,101,118,101,108,32, + 111,102,10,32,32,32,32,116,104,101,32,98,121,116,101,99, + 111,100,101,32,102,105,108,101,46,32,73,102,32,39,111,112, + 116,105,109,105,122,97,116,105,111,110,39,32,105,115,32,110, + 111,116,32,78,111,110,101,44,32,116,104,101,32,115,116,114, + 105,110,103,32,114,101,112,114,101,115,101,110,116,97,116,105, + 111,110,10,32,32,32,32,111,102,32,116,104,101,32,97,114, + 103,117,109,101,110,116,32,105,115,32,116,97,107,101,110,32, + 97,110,100,32,118,101,114,105,102,105,101,100,32,116,111,32, + 98,101,32,97,108,112,104,97,110,117,109,101,114,105,99,32, + 40,101,108,115,101,32,86,97,108,117,101,69,114,114,111,114, + 10,32,32,32,32,105,115,32,114,97,105,115,101,100,41,46, + 10,10,32,32,32,32,84,104,101,32,100,101,98,117,103,95, + 111,118,101,114,114,105,100,101,32,112,97,114,97,109,101,116, + 101,114,32,105,115,32,100,101,112,114,101,99,97,116,101,100, + 46,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, + 10,32,32,32,32,97,32,84,114,117,101,32,118,97,108,117, + 101,32,105,115,32,116,104,101,32,115,97,109,101,32,97,115, + 32,115,101,116,116,105,110,103,32,39,111,112,116,105,109,105, + 122,97,116,105,111,110,39,32,116,111,32,116,104,101,32,101, + 109,112,116,121,32,115,116,114,105,110,103,10,32,32,32,32, + 119,104,105,108,101,32,97,32,70,97,108,115,101,32,118,97, + 108,117,101,32,105,115,32,101,113,117,105,118,97,108,101,110, + 116,32,116,111,32,115,101,116,116,105,110,103,32,39,111,112, + 116,105,109,105,122,97,116,105,111,110,39,32,116,111,32,39, + 49,39,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,122,70,116,104,101, + 32,100,101,98,117,103,95,111,118,101,114,114,105,100,101,32, + 112,97,114,97,109,101,116,101,114,32,105,115,32,100,101,112, + 114,101,99,97,116,101,100,59,32,117,115,101,32,39,111,112, + 116,105,109,105,122,97,116,105,111,110,39,32,105,110,115,116, + 101,97,100,122,50,100,101,98,117,103,95,111,118,101,114,114, + 105,100,101,32,111,114,32,111,112,116,105,109,105,122,97,116, + 105,111,110,32,109,117,115,116,32,98,101,32,115,101,116,32, + 116,111,32,78,111,110,101,114,40,0,0,0,114,39,0,0, + 0,218,1,46,250,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,233,0,0,0,0,122, + 24,123,33,114,125,32,105,115,32,110,111,116,32,97,108,112, + 104,97,110,117,109,101,114,105,99,122,7,123,125,46,123,125, + 123,125,250,1,58,114,28,0,0,0,41,28,218,9,95,119, + 97,114,110,105,110,103,115,218,4,119,97,114,110,218,18,68, + 101,112,114,101,99,97,116,105,111,110,87,97,114,110,105,110, + 103,218,9,84,121,112,101,69,114,114,111,114,114,4,0,0, + 0,218,6,102,115,112,97,116,104,114,47,0,0,0,114,41, + 0,0,0,114,1,0,0,0,218,14,105,109,112,108,101,109, + 101,110,116,97,116,105,111,110,218,9,99,97,99,104,101,95, + 116,97,103,218,19,78,111,116,73,109,112,108,101,109,101,110, + 116,101,100,69,114,114,111,114,114,36,0,0,0,114,2,0, + 0,0,218,8,111,112,116,105,109,105,122,101,218,3,115,116, + 114,218,7,105,115,97,108,110,117,109,218,10,86,97,108,117, + 101,69,114,114,111,114,114,62,0,0,0,218,4,95,79,80, + 84,218,17,66,89,84,69,67,79,68,69,95,83,85,70,70, + 73,88,69,83,218,14,112,121,99,97,99,104,101,95,112,114, + 101,102,105,120,114,59,0,0,0,114,38,0,0,0,114,55, + 0,0,0,114,31,0,0,0,218,6,108,115,116,114,105,112, + 218,8,95,80,89,67,65,67,72,69,41,12,114,44,0,0, + 0,90,14,100,101,98,117,103,95,111,118,101,114,114,105,100, + 101,114,70,0,0,0,218,7,109,101,115,115,97,103,101,218, + 4,104,101,97,100,114,46,0,0,0,90,4,98,97,115,101, + 218,3,115,101,112,218,4,114,101,115,116,90,3,116,97,103, + 90,15,97,108,109,111,115,116,95,102,105,108,101,110,97,109, + 101,218,8,102,105,108,101,110,97,109,101,114,5,0,0,0, + 114,5,0,0,0,114,8,0,0,0,218,17,99,97,99,104, + 101,95,102,114,111,109,95,115,111,117,114,99,101,45,1,0, + 0,115,72,0,0,0,0,18,8,1,6,1,2,255,4,2, + 8,1,4,1,8,1,12,1,10,1,12,1,16,1,8,1, + 8,1,8,1,24,1,8,1,12,1,6,2,8,1,8,1, + 8,1,8,1,14,1,14,1,12,1,12,9,10,1,14,5, + 28,1,12,4,2,1,4,1,8,1,2,253,4,5,114,97, 0,0,0,99,1,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,8,0,0,0,3,0,0,0,115,66,0,0, - 0,100,6,135,0,102,1,100,2,100,3,132,9,125,1,122, - 10,116,0,106,1,125,2,87,0,110,26,4,0,116,2,121, - 50,1,0,1,0,1,0,100,4,100,5,132,0,125,2,89, - 0,110,2,48,0,124,2,124,1,136,0,131,2,1,0,124, - 1,83,0,41,7,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,0,0,0, - 0,4,0,0,0,4,0,0,0,31,0,0,0,115,72,0, - 0,0,124,1,100,0,117,0,114,16,124,0,106,0,125,1, - 110,32,124,0,106,0,124,1,107,3,114,48,116,1,100,1, - 124,0,106,0,124,1,102,2,22,0,124,1,100,2,141,2, - 130,1,136,0,124,0,124,1,103,2,124,2,162,1,82,0, - 105,0,124,3,164,1,142,1,83,0,41,3,78,122,30,108, - 111,97,100,101,114,32,102,111,114,32,37,115,32,99,97,110, - 110,111,116,32,104,97,110,100,108,101,32,37,115,169,1,218, - 4,110,97,109,101,41,2,114,116,0,0,0,218,11,73,109, - 112,111,114,116,69,114,114,111,114,41,4,218,4,115,101,108, - 102,114,116,0,0,0,218,4,97,114,103,115,218,6,107,119, - 97,114,103,115,169,1,218,6,109,101,116,104,111,100,114,5, - 0,0,0,114,8,0,0,0,218,19,95,99,104,101,99,107, - 95,110,97,109,101,95,119,114,97,112,112,101,114,207,1,0, - 0,115,18,0,0,0,0,1,8,1,8,1,10,1,4,1, - 8,255,2,1,2,255,6,2,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,99,2,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,7,0,0,0,83,0,0,0,115,56,0,0,0, - 100,1,68,0,93,32,125,2,116,0,124,1,124,2,131,2, - 114,4,116,1,124,0,124,2,116,2,124,1,124,2,131,2, - 131,3,1,0,113,4,124,0,106,3,160,4,124,1,106,3, - 161,1,1,0,100,0,83,0,41,2,78,41,4,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,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,67,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,8,0,0,0,218,5,95,119,114,97,112, - 218,1,0,0,115,8,0,0,0,0,1,8,1,10,1,20, - 1,122,26,95,99,104,101,99,107,95,110,97,109,101,46,60, - 108,111,99,97,108,115,62,46,95,119,114,97,112,41,1,78, - 41,3,218,10,95,98,111,111,116,115,116,114,97,112,114,133, - 0,0,0,218,9,78,97,109,101,69,114,114,111,114,41,3, - 114,122,0,0,0,114,123,0,0,0,114,133,0,0,0,114, - 5,0,0,0,114,121,0,0,0,114,8,0,0,0,218,11, - 95,99,104,101,99,107,95,110,97,109,101,199,1,0,0,115, - 14,0,0,0,0,8,14,7,2,1,10,1,12,2,14,5, - 10,1,114,136,0,0,0,99,2,0,0,0,0,0,0,0, - 0,0,0,0,5,0,0,0,6,0,0,0,67,0,0,0, - 115,60,0,0,0,124,0,160,0,124,1,161,1,92,2,125, - 2,125,3,124,2,100,1,117,0,114,56,116,1,124,3,131, - 1,114,56,100,2,125,4,116,2,160,3,124,4,160,4,124, - 3,100,3,25,0,161,1,116,5,161,2,1,0,124,2,83, - 0,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, - 73,0,0,0,41,6,218,11,102,105,110,100,95,108,111,97, - 100,101,114,114,23,0,0,0,114,75,0,0,0,114,76,0, - 0,0,114,62,0,0,0,218,13,73,109,112,111,114,116,87, - 97,114,110,105,110,103,41,5,114,118,0,0,0,218,8,102, - 117,108,108,110,97,109,101,218,6,108,111,97,100,101,114,218, - 8,112,111,114,116,105,111,110,115,218,3,109,115,103,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,218,17,95, - 102,105,110,100,95,109,111,100,117,108,101,95,115,104,105,109, - 227,1,0,0,115,10,0,0,0,0,10,14,1,16,1,4, - 1,22,1,114,143,0,0,0,99,3,0,0,0,0,0,0, - 0,0,0,0,0,6,0,0,0,4,0,0,0,67,0,0, - 0,115,166,0,0,0,124,0,100,1,100,2,133,2,25,0, - 125,3,124,3,116,0,107,3,114,64,100,3,124,1,155,2, - 100,4,124,3,155,2,157,4,125,4,116,1,160,2,100,5, - 124,4,161,2,1,0,116,3,124,4,102,1,105,0,124,2, - 164,1,142,1,130,1,116,4,124,0,131,1,100,6,107,0, - 114,106,100,7,124,1,155,2,157,2,125,4,116,1,160,2, - 100,5,124,4,161,2,1,0,116,5,124,4,131,1,130,1, - 116,6,124,0,100,2,100,8,133,2,25,0,131,1,125,5, - 124,5,100,9,64,0,114,162,100,10,124,5,155,2,100,11, - 124,1,155,2,157,4,125,4,116,3,124,4,102,1,105,0, - 124,2,164,1,142,1,130,1,124,5,83,0,41,12,97,84, - 2,0,0,80,101,114,102,111,114,109,32,98,97,115,105,99, - 32,118,97,108,105,100,105,116,121,32,99,104,101,99,107,105, - 110,103,32,111,102,32,97,32,112,121,99,32,104,101,97,100, - 101,114,32,97,110,100,32,114,101,116,117,114,110,32,116,104, - 101,32,102,108,97,103,115,32,102,105,101,108,100,44,10,32, - 32,32,32,119,104,105,99,104,32,100,101,116,101,114,109,105, - 110,101,115,32,104,111,119,32,116,104,101,32,112,121,99,32, - 115,104,111,117,108,100,32,98,101,32,102,117,114,116,104,101, - 114,32,118,97,108,105,100,97,116,101,100,32,97,103,97,105, - 110,115,116,32,116,104,101,32,115,111,117,114,99,101,46,10, - 10,32,32,32,32,42,100,97,116,97,42,32,105,115,32,116, - 104,101,32,99,111,110,116,101,110,116,115,32,111,102,32,116, - 104,101,32,112,121,99,32,102,105,108,101,46,32,40,79,110, - 108,121,32,116,104,101,32,102,105,114,115,116,32,49,54,32, - 98,121,116,101,115,32,97,114,101,10,32,32,32,32,114,101, - 113,117,105,114,101,100,44,32,116,104,111,117,103,104,46,41, - 10,10,32,32,32,32,42,110,97,109,101,42,32,105,115,32, - 116,104,101,32,110,97,109,101,32,111,102,32,116,104,101,32, - 109,111,100,117,108,101,32,98,101,105,110,103,32,105,109,112, - 111,114,116,101,100,46,32,73,116,32,105,115,32,117,115,101, - 100,32,102,111,114,32,108,111,103,103,105,110,103,46,10,10, - 32,32,32,32,42,101,120,99,95,100,101,116,97,105,108,115, - 42,32,105,115,32,97,32,100,105,99,116,105,111,110,97,114, - 121,32,112,97,115,115,101,100,32,116,111,32,73,109,112,111, - 114,116,69,114,114,111,114,32,105,102,32,105,116,32,114,97, - 105,115,101,100,32,102,111,114,10,32,32,32,32,105,109,112, - 114,111,118,101,100,32,100,101,98,117,103,103,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,119,104,101,110,32,116,104,101,32,102,108,97,103,115, - 10,32,32,32,32,102,105,101,108,100,32,105,115,32,105,110, - 118,97,108,105,100,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,32,116,114,117,110,99,97,116,101,100, - 46,10,10,32,32,32,32,78,114,16,0,0,0,122,20,98, - 97,100,32,109,97,103,105,99,32,110,117,109,98,101,114,32, - 105,110,32,122,2,58,32,250,2,123,125,233,16,0,0,0, - 122,40,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,112,121,99,32, - 104,101,97,100,101,114,32,111,102,32,233,8,0,0,0,233, - 252,255,255,255,122,14,105,110,118,97,108,105,100,32,102,108, - 97,103,115,32,122,4,32,105,110,32,41,7,218,12,77,65, - 71,73,67,95,78,85,77,66,69,82,114,134,0,0,0,218, - 16,95,118,101,114,98,111,115,101,95,109,101,115,115,97,103, - 101,114,117,0,0,0,114,23,0,0,0,218,8,69,79,70, - 69,114,114,111,114,114,27,0,0,0,41,6,114,26,0,0, - 0,114,116,0,0,0,218,11,101,120,99,95,100,101,116,97, - 105,108,115,90,5,109,97,103,105,99,114,92,0,0,0,114, - 2,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,13,95,99,108,97,115,115,105,102,121,95,112, - 121,99,244,1,0,0,115,28,0,0,0,0,16,12,1,8, - 1,16,1,12,1,16,1,12,1,10,1,12,1,8,1,16, - 2,8,1,16,1,16,1,114,152,0,0,0,99,5,0,0, - 0,0,0,0,0,0,0,0,0,6,0,0,0,4,0,0, - 0,67,0,0,0,115,120,0,0,0,116,0,124,0,100,1, - 100,2,133,2,25,0,131,1,124,1,100,3,64,0,107,3, - 114,62,100,4,124,3,155,2,157,2,125,5,116,1,160,2, - 100,5,124,5,161,2,1,0,116,3,124,5,102,1,105,0, - 124,4,164,1,142,1,130,1,124,2,100,6,117,1,114,116, - 116,0,124,0,100,2,100,7,133,2,25,0,131,1,124,2, - 100,3,64,0,107,3,114,116,116,3,100,4,124,3,155,2, - 157,2,102,1,105,0,124,4,164,1,142,1,130,1,100,6, - 83,0,41,8,97,7,2,0,0,86,97,108,105,100,97,116, - 101,32,97,32,112,121,99,32,97,103,97,105,110,115,116,32, - 116,104,101,32,115,111,117,114,99,101,32,108,97,115,116,45, - 109,111,100,105,102,105,101,100,32,116,105,109,101,46,10,10, - 32,32,32,32,42,100,97,116,97,42,32,105,115,32,116,104, - 101,32,99,111,110,116,101,110,116,115,32,111,102,32,116,104, - 101,32,112,121,99,32,102,105,108,101,46,32,40,79,110,108, - 121,32,116,104,101,32,102,105,114,115,116,32,49,54,32,98, - 121,116,101,115,32,97,114,101,10,32,32,32,32,114,101,113, - 117,105,114,101,100,46,41,10,10,32,32,32,32,42,115,111, - 117,114,99,101,95,109,116,105,109,101,42,32,105,115,32,116, - 104,101,32,108,97,115,116,32,109,111,100,105,102,105,101,100, - 32,116,105,109,101,115,116,97,109,112,32,111,102,32,116,104, - 101,32,115,111,117,114,99,101,32,102,105,108,101,46,10,10, - 32,32,32,32,42,115,111,117,114,99,101,95,115,105,122,101, - 42,32,105,115,32,78,111,110,101,32,111,114,32,116,104,101, - 32,115,105,122,101,32,111,102,32,116,104,101,32,115,111,117, - 114,99,101,32,102,105,108,101,32,105,110,32,98,121,116,101, - 115,46,10,10,32,32,32,32,42,110,97,109,101,42,32,105, - 115,32,116,104,101,32,110,97,109,101,32,111,102,32,116,104, - 101,32,109,111,100,117,108,101,32,98,101,105,110,103,32,105, - 109,112,111,114,116,101,100,46,32,73,116,32,105,115,32,117, - 115,101,100,32,102,111,114,32,108,111,103,103,105,110,103,46, - 10,10,32,32,32,32,42,101,120,99,95,100,101,116,97,105, - 108,115,42,32,105,115,32,97,32,100,105,99,116,105,111,110, - 97,114,121,32,112,97,115,115,101,100,32,116,111,32,73,109, - 112,111,114,116,69,114,114,111,114,32,105,102,32,105,116,32, - 114,97,105,115,101,100,32,102,111,114,10,32,32,32,32,105, - 109,112,114,111,118,101,100,32,100,101,98,117,103,103,105,110, - 103,46,10,10,32,32,32,32,65,110,32,73,109,112,111,114, - 116,69,114,114,111,114,32,105,115,32,114,97,105,115,101,100, - 32,105,102,32,116,104,101,32,98,121,116,101,99,111,100,101, - 32,105,115,32,115,116,97,108,101,46,10,10,32,32,32,32, - 114,146,0,0,0,233,12,0,0,0,114,15,0,0,0,122, - 22,98,121,116,101,99,111,100,101,32,105,115,32,115,116,97, - 108,101,32,102,111,114,32,114,144,0,0,0,78,114,145,0, - 0,0,41,4,114,27,0,0,0,114,134,0,0,0,114,149, - 0,0,0,114,117,0,0,0,41,6,114,26,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,116,0,0,0,114, - 151,0,0,0,114,92,0,0,0,114,5,0,0,0,114,5, - 0,0,0,114,8,0,0,0,218,23,95,118,97,108,105,100, - 97,116,101,95,116,105,109,101,115,116,97,109,112,95,112,121, - 99,21,2,0,0,115,16,0,0,0,0,19,24,1,10,1, - 12,1,16,1,8,1,22,255,2,2,114,156,0,0,0,99, - 4,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, - 4,0,0,0,67,0,0,0,115,42,0,0,0,124,0,100, - 1,100,2,133,2,25,0,124,1,107,3,114,38,116,0,100, - 3,124,2,155,2,157,2,102,1,105,0,124,3,164,1,142, - 1,130,1,100,4,83,0,41,5,97,243,1,0,0,86,97, - 108,105,100,97,116,101,32,97,32,104,97,115,104,45,98,97, - 115,101,100,32,112,121,99,32,98,121,32,99,104,101,99,107, - 105,110,103,32,116,104,101,32,114,101,97,108,32,115,111,117, - 114,99,101,32,104,97,115,104,32,97,103,97,105,110,115,116, - 32,116,104,101,32,111,110,101,32,105,110,10,32,32,32,32, - 116,104,101,32,112,121,99,32,104,101,97,100,101,114,46,10, - 10,32,32,32,32,42,100,97,116,97,42,32,105,115,32,116, - 104,101,32,99,111,110,116,101,110,116,115,32,111,102,32,116, - 104,101,32,112,121,99,32,102,105,108,101,46,32,40,79,110, - 108,121,32,116,104,101,32,102,105,114,115,116,32,49,54,32, - 98,121,116,101,115,32,97,114,101,10,32,32,32,32,114,101, - 113,117,105,114,101,100,46,41,10,10,32,32,32,32,42,115, - 111,117,114,99,101,95,104,97,115,104,42,32,105,115,32,116, - 104,101,32,105,109,112,111,114,116,108,105,98,46,117,116,105, - 108,46,115,111,117,114,99,101,95,104,97,115,104,40,41,32, - 111,102,32,116,104,101,32,115,111,117,114,99,101,32,102,105, - 108,101,46,10,10,32,32,32,32,42,110,97,109,101,42,32, - 105,115,32,116,104,101,32,110,97,109,101,32,111,102,32,116, - 104,101,32,109,111,100,117,108,101,32,98,101,105,110,103,32, - 105,109,112,111,114,116,101,100,46,32,73,116,32,105,115,32, - 117,115,101,100,32,102,111,114,32,108,111,103,103,105,110,103, - 46,10,10,32,32,32,32,42,101,120,99,95,100,101,116,97, - 105,108,115,42,32,105,115,32,97,32,100,105,99,116,105,111, - 110,97,114,121,32,112,97,115,115,101,100,32,116,111,32,73, - 109,112,111,114,116,69,114,114,111,114,32,105,102,32,105,116, - 32,114,97,105,115,101,100,32,102,111,114,10,32,32,32,32, - 105,109,112,114,111,118,101,100,32,100,101,98,117,103,103,105, - 110,103,46,10,10,32,32,32,32,65,110,32,73,109,112,111, + 10,0,0,0,5,0,0,0,67,0,0,0,115,46,1,0, + 0,116,0,106,1,106,2,100,1,117,0,114,20,116,3,100, + 2,131,1,130,1,116,4,160,5,124,0,161,1,125,0,116, + 6,124,0,131,1,92,2,125,1,125,2,100,3,125,3,116, + 0,106,7,100,1,117,1,114,102,116,0,106,7,160,8,116, + 9,161,1,125,4,124,1,160,10,124,4,116,11,23,0,161, + 1,114,102,124,1,116,12,124,4,131,1,100,1,133,2,25, + 0,125,1,100,4,125,3,124,3,115,144,116,6,124,1,131, + 1,92,2,125,1,125,5,124,5,116,13,107,3,114,144,116, + 14,116,13,155,0,100,5,124,0,155,2,157,3,131,1,130, + 1,124,2,160,15,100,6,161,1,125,6,124,6,100,7,118, + 1,114,178,116,14,100,8,124,2,155,2,157,2,131,1,130, + 1,110,92,124,6,100,9,107,2,144,1,114,14,124,2,160, + 16,100,6,100,10,161,2,100,11,25,0,125,7,124,7,160, + 10,116,17,161,1,115,228,116,14,100,12,116,17,155,2,157, + 2,131,1,130,1,124,7,116,12,116,17,131,1,100,1,133, + 2,25,0,125,8,124,8,160,18,161,0,144,1,115,14,116, + 14,100,13,124,7,155,2,100,14,157,3,131,1,130,1,124, + 2,160,19,100,6,161,1,100,15,25,0,125,9,116,20,124, + 1,124,9,116,21,100,15,25,0,23,0,131,2,83,0,41, + 16,97,110,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,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,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,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,47,52,56,56,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,114,72,0,0,0,70,84,122,31,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,114,71,0, + 0,0,62,2,0,0,0,114,28,0,0,0,114,57,0,0, + 0,122,29,101,120,112,101,99,116,101,100,32,111,110,108,121, + 32,50,32,111,114,32,51,32,100,111,116,115,32,105,110,32, + 114,57,0,0,0,114,28,0,0,0,233,254,255,255,255,122, + 53,111,112,116,105,109,105,122,97,116,105,111,110,32,112,111, + 114,116,105,111,110,32,111,102,32,102,105,108,101,110,97,109, + 101,32,100,111,101,115,32,110,111,116,32,115,116,97,114,116, + 32,119,105,116,104,32,122,19,111,112,116,105,109,105,122,97, + 116,105,111,110,32,108,101,118,101,108,32,122,29,32,105,115, + 32,110,111,116,32,97,110,32,97,108,112,104,97,110,117,109, + 101,114,105,99,32,118,97,108,117,101,114,73,0,0,0,41, + 22,114,1,0,0,0,114,80,0,0,0,114,81,0,0,0, + 114,82,0,0,0,114,4,0,0,0,114,79,0,0,0,114, + 47,0,0,0,114,89,0,0,0,114,30,0,0,0,114,31, + 0,0,0,114,11,0,0,0,114,35,0,0,0,114,23,0, + 0,0,114,91,0,0,0,114,86,0,0,0,218,5,99,111, + 117,110,116,114,43,0,0,0,114,87,0,0,0,114,85,0, + 0,0,218,9,112,97,114,116,105,116,105,111,110,114,38,0, + 0,0,218,15,83,79,85,82,67,69,95,83,85,70,70,73, + 88,69,83,41,10,114,44,0,0,0,114,93,0,0,0,90, + 16,112,121,99,97,99,104,101,95,102,105,108,101,110,97,109, + 101,90,23,102,111,117,110,100,95,105,110,95,112,121,99,97, + 99,104,101,95,112,114,101,102,105,120,90,13,115,116,114,105, + 112,112,101,100,95,112,97,116,104,90,7,112,121,99,97,99, + 104,101,90,9,100,111,116,95,99,111,117,110,116,114,70,0, + 0,0,90,9,111,112,116,95,108,101,118,101,108,90,13,98, + 97,115,101,95,102,105,108,101,110,97,109,101,114,5,0,0, + 0,114,5,0,0,0,114,8,0,0,0,218,17,115,111,117, + 114,99,101,95,102,114,111,109,95,99,97,99,104,101,116,1, + 0,0,115,60,0,0,0,0,9,12,1,8,1,10,1,12, + 1,4,1,10,1,12,1,14,1,16,1,4,1,4,1,12, + 1,8,1,8,1,2,255,8,2,10,1,8,1,16,1,10, + 1,16,1,10,1,4,1,2,255,8,2,16,1,10,1,16, + 2,14,1,114,102,0,0,0,99,1,0,0,0,0,0,0, + 0,0,0,0,0,5,0,0,0,9,0,0,0,67,0,0, + 0,115,124,0,0,0,116,0,124,0,131,1,100,1,107,2, + 114,16,100,2,83,0,124,0,160,1,100,3,161,1,92,3, + 125,1,125,2,125,3,124,1,114,56,124,3,160,2,161,0, + 100,4,100,5,133,2,25,0,100,6,107,3,114,60,124,0, + 83,0,122,12,116,3,124,0,131,1,125,4,87,0,110,34, + 4,0,116,4,116,5,102,2,121,106,1,0,1,0,1,0, + 124,0,100,2,100,5,133,2,25,0,125,4,89,0,110,2, + 48,0,116,6,124,4,131,1,114,120,124,4,83,0,124,0, + 83,0,41,7,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,73,0,0,0,78,114,71,0,0,0,233,253,255, + 255,255,233,255,255,255,255,90,2,112,121,41,7,114,23,0, + 0,0,114,41,0,0,0,218,5,108,111,119,101,114,114,102, + 0,0,0,114,82,0,0,0,114,86,0,0,0,114,54,0, + 0,0,41,5,218,13,98,121,116,101,99,111,100,101,95,112, + 97,116,104,114,95,0,0,0,114,45,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,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,218,15,95,103,101,116,95,115,111,117,114,99, + 101,102,105,108,101,156,1,0,0,115,20,0,0,0,0,7, + 12,1,4,1,16,1,24,1,4,1,2,1,12,1,16,1, + 18,1,114,108,0,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,1,0,0,0,8,0,0,0,67,0,0,0, + 115,70,0,0,0,124,0,160,0,116,1,116,2,131,1,161, + 1,114,44,122,10,116,3,124,0,131,1,87,0,83,0,4, + 0,116,4,121,42,1,0,1,0,1,0,89,0,110,24,48, + 0,124,0,160,0,116,1,116,5,131,1,161,1,114,62,124, + 0,83,0,100,0,83,0,100,0,83,0,169,1,78,41,6, + 218,8,101,110,100,115,119,105,116,104,218,5,116,117,112,108, + 101,114,101,0,0,0,114,97,0,0,0,114,82,0,0,0, + 114,88,0,0,0,41,1,114,96,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,8,0,0,0,218,11,95,103,101, + 116,95,99,97,99,104,101,100,175,1,0,0,115,16,0,0, + 0,0,1,14,1,2,1,10,1,12,1,6,1,14,1,4, + 2,114,112,0,0,0,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, + 50,0,0,0,122,14,116,0,124,0,131,1,106,1,125,1, + 87,0,110,22,4,0,116,2,121,36,1,0,1,0,1,0, + 100,1,125,1,89,0,110,2,48,0,124,1,100,2,79,0, + 125,1,124,1,83,0,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,114,60,0, + 0,0,233,128,0,0,0,41,3,114,49,0,0,0,114,51, + 0,0,0,114,50,0,0,0,41,2,114,44,0,0,0,114, + 52,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,218,10,95,99,97,108,99,95,109,111,100,101,187, + 1,0,0,115,12,0,0,0,0,2,2,1,14,1,12,1, + 10,3,8,1,114,114,0,0,0,99,1,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,8,0,0,0,3,0, + 0,0,115,66,0,0,0,100,6,135,0,102,1,100,2,100, + 3,132,9,125,1,122,10,116,0,106,1,125,2,87,0,110, + 26,4,0,116,2,121,50,1,0,1,0,1,0,100,4,100, + 5,132,0,125,2,89,0,110,2,48,0,124,2,124,1,136, + 0,131,2,1,0,124,1,83,0,41,7,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,0,0,0,0,4,0,0,0,4,0,0,0,31, + 0,0,0,115,72,0,0,0,124,1,100,0,117,0,114,16, + 124,0,106,0,125,1,110,32,124,0,106,0,124,1,107,3, + 114,48,116,1,100,1,124,0,106,0,124,1,102,2,22,0, + 124,1,100,2,141,2,130,1,136,0,124,0,124,1,103,2, + 124,2,162,1,82,0,105,0,124,3,164,1,142,1,83,0, + 41,3,78,122,30,108,111,97,100,101,114,32,102,111,114,32, + 37,115,32,99,97,110,110,111,116,32,104,97,110,100,108,101, + 32,37,115,169,1,218,4,110,97,109,101,41,2,114,116,0, + 0,0,218,11,73,109,112,111,114,116,69,114,114,111,114,41, + 4,218,4,115,101,108,102,114,116,0,0,0,218,4,97,114, + 103,115,218,6,107,119,97,114,103,115,169,1,218,6,109,101, + 116,104,111,100,114,5,0,0,0,114,8,0,0,0,218,19, + 95,99,104,101,99,107,95,110,97,109,101,95,119,114,97,112, + 112,101,114,207,1,0,0,115,18,0,0,0,0,1,8,1, + 8,1,10,1,4,1,8,255,2,1,2,255,6,2,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,99,2,0,0,0,0,0,0, + 0,0,0,0,0,3,0,0,0,7,0,0,0,83,0,0, + 0,115,56,0,0,0,100,1,68,0,93,32,125,2,116,0, + 124,1,124,2,131,2,114,4,116,1,124,0,124,2,116,2, + 124,1,124,2,131,2,131,3,1,0,113,4,124,0,106,3, + 160,4,124,1,106,3,161,1,1,0,100,0,83,0,41,2, + 78,41,4,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, + 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,67,0,0,0, + 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218, + 5,95,119,114,97,112,218,1,0,0,115,8,0,0,0,0, + 1,8,1,10,1,20,1,122,26,95,99,104,101,99,107,95, + 110,97,109,101,46,60,108,111,99,97,108,115,62,46,95,119, + 114,97,112,41,1,78,41,3,218,10,95,98,111,111,116,115, + 116,114,97,112,114,133,0,0,0,218,9,78,97,109,101,69, + 114,114,111,114,41,3,114,122,0,0,0,114,123,0,0,0, + 114,133,0,0,0,114,5,0,0,0,114,121,0,0,0,114, + 8,0,0,0,218,11,95,99,104,101,99,107,95,110,97,109, + 101,199,1,0,0,115,14,0,0,0,0,8,14,7,2,1, + 10,1,12,2,14,5,10,1,114,136,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,5,0,0,0,6,0, + 0,0,67,0,0,0,115,60,0,0,0,124,0,160,0,124, + 1,161,1,92,2,125,2,125,3,124,2,100,1,117,0,114, + 56,116,1,124,3,131,1,114,56,100,2,125,4,116,2,160, + 3,124,4,160,4,124,3,100,3,25,0,161,1,116,5,161, + 2,1,0,124,2,83,0,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,73,0,0,0,41,6,218,11,102,105, + 110,100,95,108,111,97,100,101,114,114,23,0,0,0,114,75, + 0,0,0,114,76,0,0,0,114,62,0,0,0,218,13,73, + 109,112,111,114,116,87,97,114,110,105,110,103,41,5,114,118, + 0,0,0,218,8,102,117,108,108,110,97,109,101,218,6,108, + 111,97,100,101,114,218,8,112,111,114,116,105,111,110,115,218, + 3,109,115,103,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,218,17,95,102,105,110,100,95,109,111,100,117,108, + 101,95,115,104,105,109,227,1,0,0,115,10,0,0,0,0, + 10,14,1,16,1,4,1,22,1,114,143,0,0,0,99,3, + 0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,4, + 0,0,0,67,0,0,0,115,166,0,0,0,124,0,100,1, + 100,2,133,2,25,0,125,3,124,3,116,0,107,3,114,64, + 100,3,124,1,155,2,100,4,124,3,155,2,157,4,125,4, + 116,1,160,2,100,5,124,4,161,2,1,0,116,3,124,4, + 102,1,105,0,124,2,164,1,142,1,130,1,116,4,124,0, + 131,1,100,6,107,0,114,106,100,7,124,1,155,2,157,2, + 125,4,116,1,160,2,100,5,124,4,161,2,1,0,116,5, + 124,4,131,1,130,1,116,6,124,0,100,2,100,8,133,2, + 25,0,131,1,125,5,124,5,100,9,64,0,114,162,100,10, + 124,5,155,2,100,11,124,1,155,2,157,4,125,4,116,3, + 124,4,102,1,105,0,124,2,164,1,142,1,130,1,124,5, + 83,0,41,12,97,84,2,0,0,80,101,114,102,111,114,109, + 32,98,97,115,105,99,32,118,97,108,105,100,105,116,121,32, + 99,104,101,99,107,105,110,103,32,111,102,32,97,32,112,121, + 99,32,104,101,97,100,101,114,32,97,110,100,32,114,101,116, + 117,114,110,32,116,104,101,32,102,108,97,103,115,32,102,105, + 101,108,100,44,10,32,32,32,32,119,104,105,99,104,32,100, + 101,116,101,114,109,105,110,101,115,32,104,111,119,32,116,104, + 101,32,112,121,99,32,115,104,111,117,108,100,32,98,101,32, + 102,117,114,116,104,101,114,32,118,97,108,105,100,97,116,101, + 100,32,97,103,97,105,110,115,116,32,116,104,101,32,115,111, + 117,114,99,101,46,10,10,32,32,32,32,42,100,97,116,97, + 42,32,105,115,32,116,104,101,32,99,111,110,116,101,110,116, + 115,32,111,102,32,116,104,101,32,112,121,99,32,102,105,108, + 101,46,32,40,79,110,108,121,32,116,104,101,32,102,105,114, + 115,116,32,49,54,32,98,121,116,101,115,32,97,114,101,10, + 32,32,32,32,114,101,113,117,105,114,101,100,44,32,116,104, + 111,117,103,104,46,41,10,10,32,32,32,32,42,110,97,109, + 101,42,32,105,115,32,116,104,101,32,110,97,109,101,32,111, + 102,32,116,104,101,32,109,111,100,117,108,101,32,98,101,105, + 110,103,32,105,109,112,111,114,116,101,100,46,32,73,116,32, + 105,115,32,117,115,101,100,32,102,111,114,32,108,111,103,103, + 105,110,103,46,10,10,32,32,32,32,42,101,120,99,95,100, + 101,116,97,105,108,115,42,32,105,115,32,97,32,100,105,99, + 116,105,111,110,97,114,121,32,112,97,115,115,101,100,32,116, + 111,32,73,109,112,111,114,116,69,114,114,111,114,32,105,102, + 32,105,116,32,114,97,105,115,101,100,32,102,111,114,10,32, + 32,32,32,105,109,112,114,111,118,101,100,32,100,101,98,117, + 103,103,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,105,102,32,116,104,101,32,98,121,116,101,99,111,100, - 101,32,105,115,32,115,116,97,108,101,46,10,10,32,32,32, - 32,114,146,0,0,0,114,145,0,0,0,122,46,104,97,115, - 104,32,105,110,32,98,121,116,101,99,111,100,101,32,100,111, - 101,115,110,39,116,32,109,97,116,99,104,32,104,97,115,104, - 32,111,102,32,115,111,117,114,99,101,32,78,41,1,114,117, - 0,0,0,41,4,114,26,0,0,0,218,11,115,111,117,114, - 99,101,95,104,97,115,104,114,116,0,0,0,114,151,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 218,18,95,118,97,108,105,100,97,116,101,95,104,97,115,104, - 95,112,121,99,49,2,0,0,115,12,0,0,0,0,17,16, - 1,2,1,8,255,4,2,2,254,114,158,0,0,0,99,4, - 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,5, - 0,0,0,67,0,0,0,115,80,0,0,0,116,0,160,1, - 124,0,161,1,125,4,116,2,124,4,116,3,131,2,114,56, - 116,4,160,5,100,1,124,2,161,2,1,0,124,3,100,2, - 117,1,114,52,116,6,160,7,124,4,124,3,161,2,1,0, - 124,4,83,0,116,8,100,3,160,9,124,2,161,1,124,1, - 124,2,100,4,141,3,130,1,100,2,83,0,41,5,122,35, - 67,111,109,112,105,108,101,32,98,121,116,101,99,111,100,101, - 32,97,115,32,102,111,117,110,100,32,105,110,32,97,32,112, - 121,99,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,169,2,114,116,0,0,0,114,44,0,0,0, - 41,10,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,134,0,0,0,114, - 149,0,0,0,218,4,95,105,109,112,90,16,95,102,105,120, - 95,99,111,95,102,105,108,101,110,97,109,101,114,117,0,0, - 0,114,62,0,0,0,41,5,114,26,0,0,0,114,116,0, - 0,0,114,106,0,0,0,114,107,0,0,0,218,4,99,111, - 100,101,114,5,0,0,0,114,5,0,0,0,114,8,0,0, - 0,218,17,95,99,111,109,112,105,108,101,95,98,121,116,101, - 99,111,100,101,73,2,0,0,115,18,0,0,0,0,2,10, - 1,10,1,12,1,8,1,12,1,4,2,10,1,4,255,114, - 165,0,0,0,114,73,0,0,0,99,3,0,0,0,0,0, - 0,0,0,0,0,0,4,0,0,0,5,0,0,0,67,0, - 0,0,115,70,0,0,0,116,0,116,1,131,1,125,3,124, - 3,160,2,116,3,100,1,131,1,161,1,1,0,124,3,160, - 2,116,3,124,1,131,1,161,1,1,0,124,3,160,2,116, - 3,124,2,131,1,161,1,1,0,124,3,160,2,116,4,160, - 5,124,0,161,1,161,1,1,0,124,3,83,0,41,2,122, - 43,80,114,111,100,117,99,101,32,116,104,101,32,100,97,116, - 97,32,102,111,114,32,97,32,116,105,109,101,115,116,97,109, - 112,45,98,97,115,101,100,32,112,121,99,46,114,73,0,0, - 0,41,6,218,9,98,121,116,101,97,114,114,97,121,114,148, - 0,0,0,218,6,101,120,116,101,110,100,114,21,0,0,0, - 114,160,0,0,0,218,5,100,117,109,112,115,41,4,114,164, - 0,0,0,218,5,109,116,105,109,101,114,155,0,0,0,114, - 26,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,22,95,99,111,100,101,95,116,111,95,116,105, - 109,101,115,116,97,109,112,95,112,121,99,86,2,0,0,115, - 12,0,0,0,0,2,8,1,14,1,14,1,14,1,16,1, - 114,170,0,0,0,84,99,3,0,0,0,0,0,0,0,0, - 0,0,0,5,0,0,0,5,0,0,0,67,0,0,0,115, - 80,0,0,0,116,0,116,1,131,1,125,3,100,1,124,2, - 100,1,62,0,66,0,125,4,124,3,160,2,116,3,124,4, - 131,1,161,1,1,0,116,4,124,1,131,1,100,2,107,2, - 115,50,74,0,130,1,124,3,160,2,124,1,161,1,1,0, - 124,3,160,2,116,5,160,6,124,0,161,1,161,1,1,0, - 124,3,83,0,41,3,122,38,80,114,111,100,117,99,101,32, - 116,104,101,32,100,97,116,97,32,102,111,114,32,97,32,104, - 97,115,104,45,98,97,115,101,100,32,112,121,99,46,114,39, - 0,0,0,114,146,0,0,0,41,7,114,166,0,0,0,114, - 148,0,0,0,114,167,0,0,0,114,21,0,0,0,114,23, - 0,0,0,114,160,0,0,0,114,168,0,0,0,41,5,114, - 164,0,0,0,114,157,0,0,0,90,7,99,104,101,99,107, - 101,100,114,26,0,0,0,114,2,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,218,17,95,99,111, - 100,101,95,116,111,95,104,97,115,104,95,112,121,99,96,2, - 0,0,115,14,0,0,0,0,2,8,1,12,1,14,1,16, - 1,10,1,16,1,114,171,0,0,0,99,1,0,0,0,0, - 0,0,0,0,0,0,0,5,0,0,0,6,0,0,0,67, - 0,0,0,115,62,0,0,0,100,1,100,2,108,0,125,1, - 116,1,160,2,124,0,161,1,106,3,125,2,124,1,160,4, - 124,2,161,1,125,3,116,1,160,5,100,2,100,3,161,2, - 125,4,124,4,160,6,124,0,160,6,124,3,100,1,25,0, - 161,1,161,1,83,0,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,73,0,0,0,78,84,41,7,218,8,116,111, - 107,101,110,105,122,101,114,64,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,172,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,5,0,0,0,114,5, - 0,0,0,114,8,0,0,0,218,13,100,101,99,111,100,101, - 95,115,111,117,114,99,101,107,2,0,0,115,10,0,0,0, - 0,5,8,1,12,1,10,1,12,1,114,176,0,0,0,169, - 2,114,140,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,99,2,0,0,0,0,0,0,0,2,0,0,0,9, - 0,0,0,8,0,0,0,67,0,0,0,115,12,1,0,0, - 124,1,100,1,117,0,114,58,100,2,125,1,116,0,124,2, - 100,3,131,2,114,68,122,14,124,2,160,1,124,0,161,1, - 125,1,87,0,113,68,4,0,116,2,121,54,1,0,1,0, - 1,0,89,0,113,68,48,0,110,10,116,3,160,4,124,1, - 161,1,125,1,116,5,106,6,124,0,124,2,124,1,100,4, - 141,3,125,4,100,5,124,4,95,7,124,2,100,1,117,0, - 114,152,116,8,131,0,68,0,93,42,92,2,125,5,125,6, - 124,1,160,9,116,10,124,6,131,1,161,1,114,104,124,5, - 124,0,124,1,131,2,125,2,124,2,124,4,95,11,1,0, - 113,152,113,104,100,1,83,0,124,3,116,12,117,0,114,216, - 116,0,124,2,100,6,131,2,114,222,122,14,124,2,160,13, - 124,0,161,1,125,7,87,0,110,18,4,0,116,2,121,202, - 1,0,1,0,1,0,89,0,113,222,48,0,124,7,114,222, - 103,0,124,4,95,14,110,6,124,3,124,4,95,14,124,4, - 106,14,103,0,107,2,144,1,114,8,124,1,144,1,114,8, - 116,15,124,1,131,1,100,7,25,0,125,8,124,4,106,14, - 160,16,124,8,161,1,1,0,124,4,83,0,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,218,12,103,101, - 116,95,102,105,108,101,110,97,109,101,169,1,218,6,111,114, - 105,103,105,110,84,218,10,105,115,95,112,97,99,107,97,103, - 101,114,73,0,0,0,41,17,114,128,0,0,0,114,179,0, - 0,0,114,117,0,0,0,114,4,0,0,0,114,79,0,0, - 0,114,134,0,0,0,218,10,77,111,100,117,108,101,83,112, - 101,99,90,13,95,115,101,116,95,102,105,108,101,97,116,116, - 114,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,110, - 0,0,0,114,111,0,0,0,114,140,0,0,0,218,9,95, - 80,79,80,85,76,65,84,69,114,182,0,0,0,114,178,0, - 0,0,114,47,0,0,0,218,6,97,112,112,101,110,100,41, - 9,114,116,0,0,0,90,8,108,111,99,97,116,105,111,110, - 114,140,0,0,0,114,178,0,0,0,218,4,115,112,101,99, - 218,12,108,111,97,100,101,114,95,99,108,97,115,115,218,8, - 115,117,102,102,105,120,101,115,114,182,0,0,0,90,7,100, - 105,114,110,97,109,101,114,5,0,0,0,114,5,0,0,0, - 114,8,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,124,2, - 0,0,115,62,0,0,0,0,12,8,4,4,1,10,2,2, - 1,14,1,12,1,8,2,10,8,16,1,6,3,8,1,14, - 1,14,1,10,1,6,1,6,2,4,3,8,2,10,1,2, - 1,14,1,12,1,6,2,4,1,8,2,6,1,12,1,6, - 1,12,1,12,2,114,190,0,0,0,99,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,64, - 0,0,0,115,80,0,0,0,101,0,90,1,100,0,90,2, - 100,1,90,3,100,2,90,4,100,3,90,5,100,4,90,6, - 101,7,100,5,100,6,132,0,131,1,90,8,101,7,100,7, - 100,8,132,0,131,1,90,9,101,7,100,14,100,10,100,11, - 132,1,131,1,90,10,101,7,100,15,100,12,100,13,132,1, - 131,1,90,11,100,9,83,0,41,16,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,0,0,0,0,2, - 0,0,0,8,0,0,0,67,0,0,0,115,54,0,0,0, - 122,16,116,0,160,1,116,0,106,2,124,1,161,2,87,0, - 83,0,4,0,116,3,121,48,1,0,1,0,1,0,116,0, - 160,1,116,0,106,4,124,1,161,2,6,0,89,0,83,0, - 48,0,100,0,83,0,114,109,0,0,0,41,5,218,6,119, + 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,119,104,101,110,32,116,104,101, + 32,102,108,97,103,115,10,32,32,32,32,102,105,101,108,100, + 32,105,115,32,105,110,118,97,108,105,100,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,32,116,114,117, + 110,99,97,116,101,100,46,10,10,32,32,32,32,78,114,16, + 0,0,0,122,20,98,97,100,32,109,97,103,105,99,32,110, + 117,109,98,101,114,32,105,110,32,122,2,58,32,250,2,123, + 125,233,16,0,0,0,122,40,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,112,121,99,32,104,101,97,100,101,114,32,111,102,32, + 233,8,0,0,0,233,252,255,255,255,122,14,105,110,118,97, + 108,105,100,32,102,108,97,103,115,32,122,4,32,105,110,32, + 41,7,218,12,77,65,71,73,67,95,78,85,77,66,69,82, + 114,134,0,0,0,218,16,95,118,101,114,98,111,115,101,95, + 109,101,115,115,97,103,101,114,117,0,0,0,114,23,0,0, + 0,218,8,69,79,70,69,114,114,111,114,114,27,0,0,0, + 41,6,114,26,0,0,0,114,116,0,0,0,218,11,101,120, + 99,95,100,101,116,97,105,108,115,90,5,109,97,103,105,99, + 114,92,0,0,0,114,2,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,218,13,95,99,108,97,115, + 115,105,102,121,95,112,121,99,244,1,0,0,115,28,0,0, + 0,0,16,12,1,8,1,16,1,12,1,16,1,12,1,10, + 1,12,1,8,1,16,2,8,1,16,1,16,1,114,152,0, + 0,0,99,5,0,0,0,0,0,0,0,0,0,0,0,6, + 0,0,0,4,0,0,0,67,0,0,0,115,120,0,0,0, + 116,0,124,0,100,1,100,2,133,2,25,0,131,1,124,1, + 100,3,64,0,107,3,114,62,100,4,124,3,155,2,157,2, + 125,5,116,1,160,2,100,5,124,5,161,2,1,0,116,3, + 124,5,102,1,105,0,124,4,164,1,142,1,130,1,124,2, + 100,6,117,1,114,116,116,0,124,0,100,2,100,7,133,2, + 25,0,131,1,124,2,100,3,64,0,107,3,114,116,116,3, + 100,4,124,3,155,2,157,2,102,1,105,0,124,4,164,1, + 142,1,130,1,100,6,83,0,41,8,97,7,2,0,0,86, + 97,108,105,100,97,116,101,32,97,32,112,121,99,32,97,103, + 97,105,110,115,116,32,116,104,101,32,115,111,117,114,99,101, + 32,108,97,115,116,45,109,111,100,105,102,105,101,100,32,116, + 105,109,101,46,10,10,32,32,32,32,42,100,97,116,97,42, + 32,105,115,32,116,104,101,32,99,111,110,116,101,110,116,115, + 32,111,102,32,116,104,101,32,112,121,99,32,102,105,108,101, + 46,32,40,79,110,108,121,32,116,104,101,32,102,105,114,115, + 116,32,49,54,32,98,121,116,101,115,32,97,114,101,10,32, + 32,32,32,114,101,113,117,105,114,101,100,46,41,10,10,32, + 32,32,32,42,115,111,117,114,99,101,95,109,116,105,109,101, + 42,32,105,115,32,116,104,101,32,108,97,115,116,32,109,111, + 100,105,102,105,101,100,32,116,105,109,101,115,116,97,109,112, + 32,111,102,32,116,104,101,32,115,111,117,114,99,101,32,102, + 105,108,101,46,10,10,32,32,32,32,42,115,111,117,114,99, + 101,95,115,105,122,101,42,32,105,115,32,78,111,110,101,32, + 111,114,32,116,104,101,32,115,105,122,101,32,111,102,32,116, + 104,101,32,115,111,117,114,99,101,32,102,105,108,101,32,105, + 110,32,98,121,116,101,115,46,10,10,32,32,32,32,42,110, + 97,109,101,42,32,105,115,32,116,104,101,32,110,97,109,101, + 32,111,102,32,116,104,101,32,109,111,100,117,108,101,32,98, + 101,105,110,103,32,105,109,112,111,114,116,101,100,46,32,73, + 116,32,105,115,32,117,115,101,100,32,102,111,114,32,108,111, + 103,103,105,110,103,46,10,10,32,32,32,32,42,101,120,99, + 95,100,101,116,97,105,108,115,42,32,105,115,32,97,32,100, + 105,99,116,105,111,110,97,114,121,32,112,97,115,115,101,100, + 32,116,111,32,73,109,112,111,114,116,69,114,114,111,114,32, + 105,102,32,105,116,32,114,97,105,115,101,100,32,102,111,114, + 10,32,32,32,32,105,109,112,114,111,118,101,100,32,100,101, + 98,117,103,103,105,110,103,46,10,10,32,32,32,32,65,110, + 32,73,109,112,111,114,116,69,114,114,111,114,32,105,115,32, + 114,97,105,115,101,100,32,105,102,32,116,104,101,32,98,121, + 116,101,99,111,100,101,32,105,115,32,115,116,97,108,101,46, + 10,10,32,32,32,32,114,146,0,0,0,233,12,0,0,0, + 114,15,0,0,0,122,22,98,121,116,101,99,111,100,101,32, + 105,115,32,115,116,97,108,101,32,102,111,114,32,114,144,0, + 0,0,78,114,145,0,0,0,41,4,114,27,0,0,0,114, + 134,0,0,0,114,149,0,0,0,114,117,0,0,0,41,6, + 114,26,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,116,0,0,0,114,151,0,0,0,114,92,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,23, + 95,118,97,108,105,100,97,116,101,95,116,105,109,101,115,116, + 97,109,112,95,112,121,99,21,2,0,0,115,16,0,0,0, + 0,19,24,1,10,1,12,1,16,1,8,1,22,255,2,2, + 114,156,0,0,0,99,4,0,0,0,0,0,0,0,0,0, + 0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,42, + 0,0,0,124,0,100,1,100,2,133,2,25,0,124,1,107, + 3,114,38,116,0,100,3,124,2,155,2,157,2,102,1,105, + 0,124,3,164,1,142,1,130,1,100,4,83,0,41,5,97, + 243,1,0,0,86,97,108,105,100,97,116,101,32,97,32,104, + 97,115,104,45,98,97,115,101,100,32,112,121,99,32,98,121, + 32,99,104,101,99,107,105,110,103,32,116,104,101,32,114,101, + 97,108,32,115,111,117,114,99,101,32,104,97,115,104,32,97, + 103,97,105,110,115,116,32,116,104,101,32,111,110,101,32,105, + 110,10,32,32,32,32,116,104,101,32,112,121,99,32,104,101, + 97,100,101,114,46,10,10,32,32,32,32,42,100,97,116,97, + 42,32,105,115,32,116,104,101,32,99,111,110,116,101,110,116, + 115,32,111,102,32,116,104,101,32,112,121,99,32,102,105,108, + 101,46,32,40,79,110,108,121,32,116,104,101,32,102,105,114, + 115,116,32,49,54,32,98,121,116,101,115,32,97,114,101,10, + 32,32,32,32,114,101,113,117,105,114,101,100,46,41,10,10, + 32,32,32,32,42,115,111,117,114,99,101,95,104,97,115,104, + 42,32,105,115,32,116,104,101,32,105,109,112,111,114,116,108, + 105,98,46,117,116,105,108,46,115,111,117,114,99,101,95,104, + 97,115,104,40,41,32,111,102,32,116,104,101,32,115,111,117, + 114,99,101,32,102,105,108,101,46,10,10,32,32,32,32,42, + 110,97,109,101,42,32,105,115,32,116,104,101,32,110,97,109, + 101,32,111,102,32,116,104,101,32,109,111,100,117,108,101,32, + 98,101,105,110,103,32,105,109,112,111,114,116,101,100,46,32, + 73,116,32,105,115,32,117,115,101,100,32,102,111,114,32,108, + 111,103,103,105,110,103,46,10,10,32,32,32,32,42,101,120, + 99,95,100,101,116,97,105,108,115,42,32,105,115,32,97,32, + 100,105,99,116,105,111,110,97,114,121,32,112,97,115,115,101, + 100,32,116,111,32,73,109,112,111,114,116,69,114,114,111,114, + 32,105,102,32,105,116,32,114,97,105,115,101,100,32,102,111, + 114,10,32,32,32,32,105,109,112,114,111,118,101,100,32,100, + 101,98,117,103,103,105,110,103,46,10,10,32,32,32,32,65, + 110,32,73,109,112,111,114,116,69,114,114,111,114,32,105,115, + 32,114,97,105,115,101,100,32,105,102,32,116,104,101,32,98, + 121,116,101,99,111,100,101,32,105,115,32,115,116,97,108,101, + 46,10,10,32,32,32,32,114,146,0,0,0,114,145,0,0, + 0,122,46,104,97,115,104,32,105,110,32,98,121,116,101,99, + 111,100,101,32,100,111,101,115,110,39,116,32,109,97,116,99, + 104,32,104,97,115,104,32,111,102,32,115,111,117,114,99,101, + 32,78,41,1,114,117,0,0,0,41,4,114,26,0,0,0, + 218,11,115,111,117,114,99,101,95,104,97,115,104,114,116,0, + 0,0,114,151,0,0,0,114,5,0,0,0,114,5,0,0, + 0,114,8,0,0,0,218,18,95,118,97,108,105,100,97,116, + 101,95,104,97,115,104,95,112,121,99,49,2,0,0,115,12, + 0,0,0,0,17,16,1,2,1,8,255,4,2,2,254,114, + 158,0,0,0,99,4,0,0,0,0,0,0,0,0,0,0, + 0,5,0,0,0,5,0,0,0,67,0,0,0,115,80,0, + 0,0,116,0,160,1,124,0,161,1,125,4,116,2,124,4, + 116,3,131,2,114,56,116,4,160,5,100,1,124,2,161,2, + 1,0,124,3,100,2,117,1,114,52,116,6,160,7,124,4, + 124,3,161,2,1,0,124,4,83,0,116,8,100,3,160,9, + 124,2,161,1,124,1,124,2,100,4,141,3,130,1,100,2, + 83,0,41,5,122,35,67,111,109,112,105,108,101,32,98,121, + 116,101,99,111,100,101,32,97,115,32,102,111,117,110,100,32, + 105,110,32,97,32,112,121,99,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,169,2,114,116,0,0, + 0,114,44,0,0,0,41,10,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,134,0,0,0,114,149,0,0,0,218,4,95,105,109,112, + 90,16,95,102,105,120,95,99,111,95,102,105,108,101,110,97, + 109,101,114,117,0,0,0,114,62,0,0,0,41,5,114,26, + 0,0,0,114,116,0,0,0,114,106,0,0,0,114,107,0, + 0,0,218,4,99,111,100,101,114,5,0,0,0,114,5,0, + 0,0,114,8,0,0,0,218,17,95,99,111,109,112,105,108, + 101,95,98,121,116,101,99,111,100,101,73,2,0,0,115,18, + 0,0,0,0,2,10,1,10,1,12,1,8,1,12,1,4, + 2,10,1,4,255,114,165,0,0,0,114,73,0,0,0,99, + 3,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, + 5,0,0,0,67,0,0,0,115,70,0,0,0,116,0,116, + 1,131,1,125,3,124,3,160,2,116,3,100,1,131,1,161, + 1,1,0,124,3,160,2,116,3,124,1,131,1,161,1,1, + 0,124,3,160,2,116,3,124,2,131,1,161,1,1,0,124, + 3,160,2,116,4,160,5,124,0,161,1,161,1,1,0,124, + 3,83,0,41,2,122,43,80,114,111,100,117,99,101,32,116, + 104,101,32,100,97,116,97,32,102,111,114,32,97,32,116,105, + 109,101,115,116,97,109,112,45,98,97,115,101,100,32,112,121, + 99,46,114,73,0,0,0,41,6,218,9,98,121,116,101,97, + 114,114,97,121,114,148,0,0,0,218,6,101,120,116,101,110, + 100,114,21,0,0,0,114,160,0,0,0,218,5,100,117,109, + 112,115,41,4,114,164,0,0,0,218,5,109,116,105,109,101, + 114,155,0,0,0,114,26,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,218,22,95,99,111,100,101, + 95,116,111,95,116,105,109,101,115,116,97,109,112,95,112,121, + 99,86,2,0,0,115,12,0,0,0,0,2,8,1,14,1, + 14,1,14,1,16,1,114,170,0,0,0,84,99,3,0,0, + 0,0,0,0,0,0,0,0,0,5,0,0,0,5,0,0, + 0,67,0,0,0,115,80,0,0,0,116,0,116,1,131,1, + 125,3,100,1,124,2,100,1,62,0,66,0,125,4,124,3, + 160,2,116,3,124,4,131,1,161,1,1,0,116,4,124,1, + 131,1,100,2,107,2,115,50,74,0,130,1,124,3,160,2, + 124,1,161,1,1,0,124,3,160,2,116,5,160,6,124,0, + 161,1,161,1,1,0,124,3,83,0,41,3,122,38,80,114, + 111,100,117,99,101,32,116,104,101,32,100,97,116,97,32,102, + 111,114,32,97,32,104,97,115,104,45,98,97,115,101,100,32, + 112,121,99,46,114,39,0,0,0,114,146,0,0,0,41,7, + 114,166,0,0,0,114,148,0,0,0,114,167,0,0,0,114, + 21,0,0,0,114,23,0,0,0,114,160,0,0,0,114,168, + 0,0,0,41,5,114,164,0,0,0,114,157,0,0,0,90, + 7,99,104,101,99,107,101,100,114,26,0,0,0,114,2,0, + 0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0, + 0,218,17,95,99,111,100,101,95,116,111,95,104,97,115,104, + 95,112,121,99,96,2,0,0,115,14,0,0,0,0,2,8, + 1,12,1,14,1,16,1,10,1,16,1,114,171,0,0,0, + 99,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0, + 0,6,0,0,0,67,0,0,0,115,62,0,0,0,100,1, + 100,2,108,0,125,1,116,1,160,2,124,0,161,1,106,3, + 125,2,124,1,160,4,124,2,161,1,125,3,116,1,160,5, + 100,2,100,3,161,2,125,4,124,4,160,6,124,0,160,6, + 124,3,100,1,25,0,161,1,161,1,83,0,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,73,0,0,0,78,84, + 41,7,218,8,116,111,107,101,110,105,122,101,114,64,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,172,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, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,13, + 100,101,99,111,100,101,95,115,111,117,114,99,101,107,2,0, + 0,115,10,0,0,0,0,5,8,1,12,1,10,1,12,1, + 114,176,0,0,0,169,2,114,140,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,99,2,0,0,0,0,0,0, + 0,2,0,0,0,9,0,0,0,8,0,0,0,67,0,0, + 0,115,10,1,0,0,124,1,100,1,117,0,114,56,100,2, + 125,1,116,0,124,2,100,3,131,2,114,66,122,14,124,2, + 160,1,124,0,161,1,125,1,87,0,110,28,4,0,116,2, + 121,54,1,0,1,0,1,0,89,0,110,12,48,0,116,3, + 160,4,124,1,161,1,125,1,116,5,106,6,124,0,124,2, + 124,1,100,4,141,3,125,4,100,5,124,4,95,7,124,2, + 100,1,117,0,114,150,116,8,131,0,68,0,93,42,92,2, + 125,5,125,6,124,1,160,9,116,10,124,6,131,1,161,1, + 114,102,124,5,124,0,124,1,131,2,125,2,124,2,124,4, + 95,11,1,0,113,150,113,102,100,1,83,0,124,3,116,12, + 117,0,114,214,116,0,124,2,100,6,131,2,114,220,122,14, + 124,2,160,13,124,0,161,1,125,7,87,0,110,18,4,0, + 116,2,121,200,1,0,1,0,1,0,89,0,110,20,48,0, + 124,7,114,220,103,0,124,4,95,14,110,6,124,3,124,4, + 95,14,124,4,106,14,103,0,107,2,144,1,114,6,124,1, + 144,1,114,6,116,15,124,1,131,1,100,7,25,0,125,8, + 124,4,106,14,160,16,124,8,161,1,1,0,124,4,83,0, + 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, + 218,12,103,101,116,95,102,105,108,101,110,97,109,101,169,1, + 218,6,111,114,105,103,105,110,84,218,10,105,115,95,112,97, + 99,107,97,103,101,114,73,0,0,0,41,17,114,128,0,0, + 0,114,179,0,0,0,114,117,0,0,0,114,4,0,0,0, + 114,79,0,0,0,114,134,0,0,0,218,10,77,111,100,117, + 108,101,83,112,101,99,90,13,95,115,101,116,95,102,105,108, + 101,97,116,116,114,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,110,0,0,0,114,111,0,0,0,114,140,0,0, + 0,218,9,95,80,79,80,85,76,65,84,69,114,182,0,0, + 0,114,178,0,0,0,114,47,0,0,0,218,6,97,112,112, + 101,110,100,41,9,114,116,0,0,0,90,8,108,111,99,97, + 116,105,111,110,114,140,0,0,0,114,178,0,0,0,218,4, + 115,112,101,99,218,12,108,111,97,100,101,114,95,99,108,97, + 115,115,218,8,115,117,102,102,105,120,101,115,114,182,0,0, + 0,90,7,100,105,114,110,97,109,101,114,5,0,0,0,114, + 5,0,0,0,114,8,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,124,2,0,0,115,62,0,0,0,0,12,8,4,4, + 1,10,2,2,1,14,1,12,1,6,2,10,8,16,1,6, + 3,8,1,14,1,14,1,10,1,6,1,6,2,4,3,8, + 2,10,1,2,1,14,1,12,1,6,2,4,1,8,2,6, + 1,12,1,6,1,12,1,12,2,114,190,0,0,0,99,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4, + 0,0,0,64,0,0,0,115,80,0,0,0,101,0,90,1, + 100,0,90,2,100,1,90,3,100,2,90,4,100,3,90,5, + 100,4,90,6,101,7,100,5,100,6,132,0,131,1,90,8, + 101,7,100,7,100,8,132,0,131,1,90,9,101,7,100,14, + 100,10,100,11,132,1,131,1,90,10,101,7,100,15,100,12, + 100,13,132,1,131,1,90,11,100,9,83,0,41,16,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,0, + 0,0,0,2,0,0,0,8,0,0,0,67,0,0,0,115, + 50,0,0,0,122,16,116,0,160,1,116,0,106,2,124,1, + 161,2,87,0,83,0,4,0,116,3,121,48,1,0,1,0, + 1,0,116,0,160,1,116,0,106,4,124,1,161,2,6,0, + 89,0,83,0,48,0,114,109,0,0,0,41,5,218,6,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,50,0,0,0,90,18,72,75,69,89,95,76,79,67, @@ -1025,1666 +1024,1664 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 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,0,0,0, - 0,8,0,0,0,8,0,0,0,67,0,0,0,115,120,0, + 0,8,0,0,0,8,0,0,0,67,0,0,0,115,118,0, 0,0,124,0,160,0,124,1,161,1,125,4,124,4,100,0, 117,0,114,22,100,0,83,0,122,12,116,1,124,4,131,1, 1,0,87,0,110,20,4,0,116,2,121,54,1,0,1,0, 1,0,89,0,100,0,83,0,48,0,116,3,131,0,68,0, - 93,52,92,2,125,5,125,6,124,4,160,4,116,5,124,6, + 93,50,92,2,125,5,125,6,124,4,160,4,116,5,124,6, 131,1,161,1,114,62,116,6,106,7,124,1,124,5,124,1, 124,4,131,2,124,4,100,1,141,3,125,7,124,7,2,0, - 1,0,83,0,113,62,100,0,83,0,41,2,78,114,180,0, - 0,0,41,8,114,200,0,0,0,114,49,0,0,0,114,50, - 0,0,0,114,184,0,0,0,114,110,0,0,0,114,111,0, - 0,0,114,134,0,0,0,218,16,115,112,101,99,95,102,114, - 111,109,95,108,111,97,100,101,114,41,8,114,193,0,0,0, - 114,139,0,0,0,114,44,0,0,0,218,6,116,97,114,103, - 101,116,114,199,0,0,0,114,140,0,0,0,114,189,0,0, + 1,0,83,0,100,0,83,0,41,2,78,114,180,0,0,0, + 41,8,114,200,0,0,0,114,49,0,0,0,114,50,0,0, + 0,114,184,0,0,0,114,110,0,0,0,114,111,0,0,0, + 114,134,0,0,0,218,16,115,112,101,99,95,102,114,111,109, + 95,108,111,97,100,101,114,41,8,114,193,0,0,0,114,139, + 0,0,0,114,44,0,0,0,218,6,116,97,114,103,101,116, + 114,199,0,0,0,114,140,0,0,0,114,189,0,0,0,114, + 187,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,218,9,102,105,110,100,95,115,112,101,99,226,2, + 0,0,115,28,0,0,0,0,2,10,1,8,1,4,1,2, + 1,12,1,12,1,8,1,14,1,14,1,6,1,8,1,2, + 254,6,3,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,0,0,0, + 0,4,0,0,0,4,0,0,0,67,0,0,0,115,30,0, + 0,0,124,0,160,0,124,1,124,2,161,2,125,3,124,3, + 100,1,117,1,114,26,124,3,106,1,83,0,100,1,83,0, + 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,169,2,114,203,0,0,0,114,140,0,0,0,169,4,114, + 193,0,0,0,114,139,0,0,0,114,44,0,0,0,114,187, + 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, + 0,0,218,11,102,105,110,100,95,109,111,100,117,108,101,242, + 2,0,0,115,8,0,0,0,0,7,12,1,8,1,6,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,2,78,78,41,1,78,41,12,114,125,0,0, + 0,114,124,0,0,0,114,126,0,0,0,114,127,0,0,0, + 114,197,0,0,0,114,196,0,0,0,114,195,0,0,0,218, + 11,99,108,97,115,115,109,101,116,104,111,100,114,194,0,0, + 0,114,200,0,0,0,114,203,0,0,0,114,206,0,0,0, + 114,5,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,114,191,0,0,0,192,2,0,0,115,28,0, + 0,0,8,2,4,3,2,255,2,4,2,255,2,3,4,2, + 2,1,10,6,2,1,10,14,2,1,12,15,2,1,114,191, + 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,2,0,0,0,64,0,0,0,115,48,0,0, + 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, + 3,132,0,90,4,100,4,100,5,132,0,90,5,100,6,100, + 7,132,0,90,6,100,8,100,9,132,0,90,7,100,10,83, + 0,41,11,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, + 0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,0, + 115,64,0,0,0,116,0,124,0,160,1,124,1,161,1,131, + 1,100,1,25,0,125,2,124,2,160,2,100,2,100,1,161, + 2,100,3,25,0,125,3,124,1,160,3,100,2,161,1,100, + 4,25,0,125,4,124,3,100,5,107,2,111,62,124,4,100, + 5,107,3,83,0,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,39,0,0,0,114,71,0,0,0, + 114,73,0,0,0,114,28,0,0,0,218,8,95,95,105,110, + 105,116,95,95,41,4,114,47,0,0,0,114,179,0,0,0, + 114,43,0,0,0,114,41,0,0,0,41,5,114,118,0,0, + 0,114,139,0,0,0,114,96,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,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,114,182,0,0,0,5,3,0,0,115,8,0, + 0,0,0,3,18,1,16,1,14,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,0,0,0, + 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, + 0,0,100,1,83,0,169,2,122,42,85,115,101,32,100,101, + 102,97,117,108,116,32,115,101,109,97,110,116,105,99,115,32, + 102,111,114,32,109,111,100,117,108,101,32,99,114,101,97,116, + 105,111,110,46,78,114,5,0,0,0,169,2,114,118,0,0, 0,114,187,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,0,0,0,218,9,102,105,110,100,95,115,112,101,99, - 226,2,0,0,115,28,0,0,0,0,2,10,1,8,1,4, - 1,2,1,12,1,12,1,8,1,14,1,14,1,6,1,8, - 1,2,254,6,3,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,0, - 0,0,0,4,0,0,0,4,0,0,0,67,0,0,0,115, - 34,0,0,0,124,0,160,0,124,1,124,2,161,2,125,3, - 124,3,100,1,117,1,114,26,124,3,106,1,83,0,100,1, - 83,0,100,1,83,0,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,169,2,114,203,0,0,0,114,140, - 0,0,0,169,4,114,193,0,0,0,114,139,0,0,0,114, - 44,0,0,0,114,187,0,0,0,114,5,0,0,0,114,5, - 0,0,0,114,8,0,0,0,218,11,102,105,110,100,95,109, - 111,100,117,108,101,242,2,0,0,115,8,0,0,0,0,7, - 12,1,8,1,6,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,2,78,78,41,1,78, - 41,12,114,125,0,0,0,114,124,0,0,0,114,126,0,0, - 0,114,127,0,0,0,114,197,0,0,0,114,196,0,0,0, - 114,195,0,0,0,218,11,99,108,97,115,115,109,101,116,104, - 111,100,114,194,0,0,0,114,200,0,0,0,114,203,0,0, - 0,114,206,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,8,0,0,0,114,191,0,0,0,192, - 2,0,0,115,28,0,0,0,8,2,4,3,2,255,2,4, - 2,255,2,3,4,2,2,1,10,6,2,1,10,14,2,1, - 12,15,2,1,114,191,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, - 0,0,115,48,0,0,0,101,0,90,1,100,0,90,2,100, - 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, - 0,90,5,100,6,100,7,132,0,90,6,100,8,100,9,132, - 0,90,7,100,10,83,0,41,11,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,0,0,0,0,5,0,0,0,4,0, - 0,0,67,0,0,0,115,64,0,0,0,116,0,124,0,160, - 1,124,1,161,1,131,1,100,1,25,0,125,2,124,2,160, - 2,100,2,100,1,161,2,100,3,25,0,125,3,124,1,160, - 3,100,2,161,1,100,4,25,0,125,4,124,3,100,5,107, - 2,111,62,124,4,100,5,107,3,83,0,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,39,0,0, - 0,114,71,0,0,0,114,73,0,0,0,114,28,0,0,0, - 218,8,95,95,105,110,105,116,95,95,41,4,114,47,0,0, - 0,114,179,0,0,0,114,43,0,0,0,114,41,0,0,0, - 41,5,114,118,0,0,0,114,139,0,0,0,114,96,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,5,0,0,0, - 114,5,0,0,0,114,8,0,0,0,114,182,0,0,0,5, - 3,0,0,115,8,0,0,0,0,3,18,1,16,1,14,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, + 114,8,0,0,0,218,13,99,114,101,97,116,101,95,109,111, + 100,117,108,101,13,3,0,0,115,2,0,0,0,0,1,122, + 27,95,76,111,97,100,101,114,66,97,115,105,99,115,46,99, + 114,101,97,116,101,95,109,111,100,117,108,101,99,2,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,5,0,0, + 0,67,0,0,0,115,56,0,0,0,124,0,160,0,124,1, + 106,1,161,1,125,2,124,2,100,1,117,0,114,36,116,2, + 100,2,160,3,124,1,106,1,161,1,131,1,130,1,116,4, + 160,5,116,6,124,2,124,1,106,7,161,3,1,0,100,1, + 83,0,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,8,218,8,103,101,116,95,99,111,100,101,114,125,0,0, + 0,114,117,0,0,0,114,62,0,0,0,114,134,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,218,4,101,120,101, + 99,114,131,0,0,0,41,3,114,118,0,0,0,218,6,109, + 111,100,117,108,101,114,164,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,218,11,101,120,101,99,95, + 109,111,100,117,108,101,16,3,0,0,115,12,0,0,0,0, + 2,12,1,8,1,6,1,4,255,6,2,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,99,2,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,115, + 12,0,0,0,116,0,160,1,124,0,124,1,161,2,83,0, + 41,1,122,26,84,104,105,115,32,109,111,100,117,108,101,32, + 105,115,32,100,101,112,114,101,99,97,116,101,100,46,41,2, + 114,134,0,0,0,218,17,95,108,111,97,100,95,109,111,100, + 117,108,101,95,115,104,105,109,169,2,114,118,0,0,0,114, + 139,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,218,11,108,111,97,100,95,109,111,100,117,108,101, + 24,3,0,0,115,2,0,0,0,0,2,122,25,95,76,111, + 97,100,101,114,66,97,115,105,99,115,46,108,111,97,100,95, + 109,111,100,117,108,101,78,41,8,114,125,0,0,0,114,124, + 0,0,0,114,126,0,0,0,114,127,0,0,0,114,182,0, + 0,0,114,212,0,0,0,114,217,0,0,0,114,220,0,0, + 0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,114,208,0,0,0,0,3,0,0,115,10, + 0,0,0,8,2,4,3,8,8,8,3,8,8,114,208,0, + 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,3,0,0,0,64,0,0,0,115,74,0,0,0, + 101,0,90,1,100,0,90,2,100,1,100,2,132,0,90,3, + 100,3,100,4,132,0,90,4,100,5,100,6,132,0,90,5, + 100,7,100,8,132,0,90,6,100,9,100,10,132,0,90,7, + 100,11,100,12,156,1,100,13,100,14,132,2,90,8,100,15, + 100,16,132,0,90,9,100,17,83,0,41,18,218,12,83,111, + 117,114,99,101,76,111,97,100,101,114,99,2,0,0,0,0, 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,83,0,169,2,122,42, - 85,115,101,32,100,101,102,97,117,108,116,32,115,101,109,97, - 110,116,105,99,115,32,102,111,114,32,109,111,100,117,108,101, - 32,99,114,101,97,116,105,111,110,46,78,114,5,0,0,0, - 169,2,114,118,0,0,0,114,187,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,218,13,99,114,101, - 97,116,101,95,109,111,100,117,108,101,13,3,0,0,115,2, - 0,0,0,0,1,122,27,95,76,111,97,100,101,114,66,97, - 115,105,99,115,46,99,114,101,97,116,101,95,109,111,100,117, - 108,101,99,2,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,5,0,0,0,67,0,0,0,115,56,0,0,0, - 124,0,160,0,124,1,106,1,161,1,125,2,124,2,100,1, - 117,0,114,36,116,2,100,2,160,3,124,1,106,1,161,1, - 131,1,130,1,116,4,160,5,116,6,124,2,124,1,106,7, - 161,3,1,0,100,1,83,0,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,8,218,8,103,101,116,95,99,111, - 100,101,114,125,0,0,0,114,117,0,0,0,114,62,0,0, - 0,114,134,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,218,4,101,120,101,99,114,131,0,0,0,41,3,114,118, - 0,0,0,218,6,109,111,100,117,108,101,114,164,0,0,0, - 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218, - 11,101,120,101,99,95,109,111,100,117,108,101,16,3,0,0, - 115,12,0,0,0,0,2,12,1,8,1,6,1,4,255,6, - 2,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,99,2,0,0, + 0,0,0,115,8,0,0,0,116,0,130,1,100,1,83,0, + 41,2,122,165,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,32,40, + 97,32,115,116,114,41,46,10,10,32,32,32,32,32,32,32, + 32,82,97,105,115,101,115,32,79,83,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,114,50,0,0, + 0,169,2,114,118,0,0,0,114,44,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,218,10,112,97, + 116,104,95,109,116,105,109,101,31,3,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,0,0,0,0,2,0,0,0,4,0,0, - 0,67,0,0,0,115,12,0,0,0,116,0,160,1,124,0, - 124,1,161,2,83,0,41,1,122,26,84,104,105,115,32,109, - 111,100,117,108,101,32,105,115,32,100,101,112,114,101,99,97, - 116,101,100,46,41,2,114,134,0,0,0,218,17,95,108,111, - 97,100,95,109,111,100,117,108,101,95,115,104,105,109,169,2, - 114,118,0,0,0,114,139,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,8,0,0,0,218,11,108,111,97,100,95, - 109,111,100,117,108,101,24,3,0,0,115,2,0,0,0,0, - 2,122,25,95,76,111,97,100,101,114,66,97,115,105,99,115, - 46,108,111,97,100,95,109,111,100,117,108,101,78,41,8,114, - 125,0,0,0,114,124,0,0,0,114,126,0,0,0,114,127, - 0,0,0,114,182,0,0,0,114,212,0,0,0,114,217,0, - 0,0,114,220,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,114,208,0,0,0, - 0,3,0,0,115,10,0,0,0,8,2,4,3,8,8,8, - 3,8,8,114,208,0,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, - 0,115,74,0,0,0,101,0,90,1,100,0,90,2,100,1, - 100,2,132,0,90,3,100,3,100,4,132,0,90,4,100,5, - 100,6,132,0,90,5,100,7,100,8,132,0,90,6,100,9, - 100,10,132,0,90,7,100,11,100,12,156,1,100,13,100,14, - 132,2,90,8,100,15,100,16,132,0,90,9,100,17,83,0, - 41,18,218,12,83,111,117,114,99,101,76,111,97,100,101,114, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,1,0,0,0,67,0,0,0,115,8,0,0,0,116,0, - 130,1,100,1,83,0,41,2,122,165,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,32,40,97,32,115,116,114,41,46,10,10,32, - 32,32,32,32,32,32,32,82,97,105,115,101,115,32,79,83, - 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,114,50,0,0,0,169,2,114,118,0,0,0,114,44, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,218,10,112,97,116,104,95,109,116,105,109,101,31,3, - 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,0,0,0,0,2, - 0,0,0,4,0,0,0,67,0,0,0,115,14,0,0,0, - 100,1,124,0,160,0,124,1,161,1,105,1,83,0,41,2, - 97,158,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, - 10,32,32,32,32,32,32,32,32,112,97,116,104,32,40,97, - 32,115,116,114,41,46,10,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,79,83,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,169,0,0,0,41,1,114,223,0,0,0,114, - 222,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,10,112,97,116,104,95,115,116,97,116,115,39, - 3,0,0,115,2,0,0,0,0,12,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,0,0,0,0, - 4,0,0,0,4,0,0,0,67,0,0,0,115,12,0,0, - 0,124,0,160,0,124,2,124,3,161,2,83,0,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,118,0,0,0,114,107,0,0,0,90,10,99, - 97,99,104,101,95,112,97,116,104,114,26,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,218,15,95, - 99,97,99,104,101,95,98,121,116,101,99,111,100,101,53,3, - 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, - 0,0,0,0,3,0,0,0,1,0,0,0,67,0,0,0, - 115,4,0,0,0,100,1,83,0,41,2,122,150,79,112,116, - 105,111,110,97,108,32,109,101,116,104,111,100,32,119,104,105, - 99,104,32,119,114,105,116,101,115,32,100,97,116,97,32,40, - 98,121,116,101,115,41,32,116,111,32,97,32,102,105,108,101, - 32,112,97,116,104,32,40,97,32,115,116,114,41,46,10,10, - 32,32,32,32,32,32,32,32,73,109,112,108,101,109,101,110, - 116,105,110,103,32,116,104,105,115,32,109,101,116,104,111,100, - 32,97,108,108,111,119,115,32,102,111,114,32,116,104,101,32, - 119,114,105,116,105,110,103,32,111,102,32,98,121,116,101,99, - 111,100,101,32,102,105,108,101,115,46,10,32,32,32,32,32, - 32,32,32,78,114,5,0,0,0,41,3,114,118,0,0,0, - 114,44,0,0,0,114,26,0,0,0,114,5,0,0,0,114, - 5,0,0,0,114,8,0,0,0,114,225,0,0,0,63,3, - 0,0,115,2,0,0,0,0,1,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,0,0,0,0,5,0,0, - 0,10,0,0,0,67,0,0,0,115,84,0,0,0,124,0, - 160,0,124,1,161,1,125,2,122,14,124,0,160,1,124,2, - 161,1,125,3,87,0,110,50,4,0,116,2,121,74,1,0, - 125,4,1,0,122,26,116,3,100,1,124,1,100,2,141,2, - 124,4,130,2,87,0,89,0,100,3,125,4,126,4,110,10, - 100,3,125,4,126,4,48,0,48,0,116,4,124,3,131,1, - 83,0,41,4,122,52,67,111,110,99,114,101,116,101,32,105, + 0,67,0,0,0,115,14,0,0,0,100,1,124,0,160,0, + 124,1,161,1,105,1,83,0,41,2,97,158,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,10,32,32,32,32,32, + 32,32,32,112,97,116,104,32,40,97,32,115,116,114,41,46, + 10,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,79,83,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,169,0, + 0,0,41,1,114,223,0,0,0,114,222,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,218,10,112, + 97,116,104,95,115,116,97,116,115,39,3,0,0,115,2,0, + 0,0,0,12,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,0,0,0,0,4,0,0,0,4,0, + 0,0,67,0,0,0,115,12,0,0,0,124,0,160,0,124, + 2,124,3,161,2,83,0,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,118,0, + 0,0,114,107,0,0,0,90,10,99,97,99,104,101,95,112, + 97,116,104,114,26,0,0,0,114,5,0,0,0,114,5,0, + 0,0,114,8,0,0,0,218,15,95,99,97,99,104,101,95, + 98,121,116,101,99,111,100,101,53,3,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,0,0,0,0,3,0, + 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, + 1,83,0,41,2,122,150,79,112,116,105,111,110,97,108,32, + 109,101,116,104,111,100,32,119,104,105,99,104,32,119,114,105, + 116,101,115,32,100,97,116,97,32,40,98,121,116,101,115,41, + 32,116,111,32,97,32,102,105,108,101,32,112,97,116,104,32, + 40,97,32,115,116,114,41,46,10,10,32,32,32,32,32,32, + 32,32,73,109,112,108,101,109,101,110,116,105,110,103,32,116, + 104,105,115,32,109,101,116,104,111,100,32,97,108,108,111,119, + 115,32,102,111,114,32,116,104,101,32,119,114,105,116,105,110, + 103,32,111,102,32,98,121,116,101,99,111,100,101,32,102,105, + 108,101,115,46,10,32,32,32,32,32,32,32,32,78,114,5, + 0,0,0,41,3,114,118,0,0,0,114,44,0,0,0,114, + 26,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,114,225,0,0,0,63,3,0,0,115,2,0,0, + 0,0,1,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,0,0,0,0,5,0,0,0,10,0,0,0,67, + 0,0,0,115,84,0,0,0,124,0,160,0,124,1,161,1, + 125,2,122,14,124,0,160,1,124,2,161,1,125,3,87,0, + 110,50,4,0,116,2,121,74,1,0,125,4,1,0,122,26, + 116,3,100,1,124,1,100,2,141,2,124,4,130,2,87,0, + 89,0,100,3,125,4,126,4,110,10,100,3,125,4,126,4, + 48,0,48,0,116,4,124,3,131,1,83,0,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,115,0, + 0,0,78,41,5,114,179,0,0,0,218,8,103,101,116,95, + 100,97,116,97,114,50,0,0,0,114,117,0,0,0,114,176, + 0,0,0,41,5,114,118,0,0,0,114,139,0,0,0,114, + 44,0,0,0,114,174,0,0,0,218,3,101,120,99,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,218,10,103, + 101,116,95,115,111,117,114,99,101,70,3,0,0,115,20,0, + 0,0,0,2,10,1,2,1,14,1,14,1,4,1,2,255, + 4,1,2,255,24,2,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,114, + 104,0,0,0,41,1,218,9,95,111,112,116,105,109,105,122, + 101,99,3,0,0,0,0,0,0,0,1,0,0,0,4,0, + 0,0,8,0,0,0,67,0,0,0,115,22,0,0,0,116, + 0,106,1,116,2,124,1,124,2,100,1,100,2,124,3,100, + 3,141,6,83,0,41,4,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,215,0,0,0, + 84,41,2,218,12,100,111,110,116,95,105,110,104,101,114,105, + 116,114,83,0,0,0,41,3,114,134,0,0,0,114,214,0, + 0,0,218,7,99,111,109,112,105,108,101,41,4,114,118,0, + 0,0,114,26,0,0,0,114,44,0,0,0,114,230,0,0, + 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, + 218,14,115,111,117,114,99,101,95,116,111,95,99,111,100,101, + 80,3,0,0,115,6,0,0,0,0,5,12,1,4,255,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,0,0,0,0,15,0,0,0,9,0,0, + 0,67,0,0,0,115,24,2,0,0,124,0,160,0,124,1, + 161,1,125,2,100,1,125,3,100,1,125,4,100,1,125,5, + 100,2,125,6,100,3,125,7,122,12,116,1,124,2,131,1, + 125,8,87,0,110,24,4,0,116,2,121,66,1,0,1,0, + 1,0,100,1,125,8,89,0,144,1,110,42,48,0,122,14, + 124,0,160,3,124,2,161,1,125,9,87,0,110,20,4,0, + 116,4,121,102,1,0,1,0,1,0,89,0,144,1,110,6, + 48,0,116,5,124,9,100,4,25,0,131,1,125,3,122,14, + 124,0,160,6,124,8,161,1,125,10,87,0,110,18,4,0, + 116,4,121,148,1,0,1,0,1,0,89,0,110,216,48,0, + 124,1,124,8,100,5,156,2,125,11,122,148,116,7,124,10, + 124,1,124,11,131,3,125,12,116,8,124,10,131,1,100,6, + 100,1,133,2,25,0,125,13,124,12,100,7,64,0,100,8, + 107,3,125,6,124,6,144,1,114,30,124,12,100,9,64,0, + 100,8,107,3,125,7,116,9,106,10,100,10,107,3,144,1, + 114,50,124,7,115,248,116,9,106,10,100,11,107,2,144,1, + 114,50,124,0,160,6,124,2,161,1,125,4,116,9,160,11, + 116,12,124,4,161,2,125,5,116,13,124,10,124,5,124,1, + 124,11,131,4,1,0,110,20,116,14,124,10,124,3,124,9, + 100,12,25,0,124,1,124,11,131,5,1,0,87,0,110,24, + 4,0,116,15,116,16,102,2,144,1,121,76,1,0,1,0, + 1,0,89,0,110,32,48,0,116,17,160,18,100,13,124,8, + 124,2,161,3,1,0,116,19,124,13,124,1,124,8,124,2, + 100,14,141,4,83,0,124,4,100,1,117,0,144,1,114,128, + 124,0,160,6,124,2,161,1,125,4,124,0,160,20,124,4, + 124,2,161,2,125,14,116,17,160,18,100,15,124,2,161,2, + 1,0,116,21,106,22,144,2,115,20,124,8,100,1,117,1, + 144,2,114,20,124,3,100,1,117,1,144,2,114,20,124,6, + 144,1,114,220,124,5,100,1,117,0,144,1,114,206,116,9, + 160,11,124,4,161,1,125,5,116,23,124,14,124,5,124,7, + 131,3,125,10,110,16,116,24,124,14,124,3,116,25,124,4, + 131,1,131,3,125,10,122,18,124,0,160,26,124,2,124,8, + 124,10,161,3,1,0,87,0,110,20,4,0,116,2,144,2, + 121,18,1,0,1,0,1,0,89,0,110,2,48,0,124,14, + 83,0,41,16,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,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,115,0,0,0,78,41,5,114,179,0,0,0, - 218,8,103,101,116,95,100,97,116,97,114,50,0,0,0,114, - 117,0,0,0,114,176,0,0,0,41,5,114,118,0,0,0, - 114,139,0,0,0,114,44,0,0,0,114,174,0,0,0,218, - 3,101,120,99,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,10,103,101,116,95,115,111,117,114,99,101,70, - 3,0,0,115,20,0,0,0,0,2,10,1,2,1,14,1, - 14,1,4,1,2,255,4,1,2,255,24,2,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,114,104,0,0,0,41,1,218,9,95,111, - 112,116,105,109,105,122,101,99,3,0,0,0,0,0,0,0, - 1,0,0,0,4,0,0,0,8,0,0,0,67,0,0,0, - 115,22,0,0,0,116,0,106,1,116,2,124,1,124,2,100, - 1,100,2,124,3,100,3,141,6,83,0,41,4,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,215,0,0,0,84,41,2,218,12,100,111,110,116,95, - 105,110,104,101,114,105,116,114,83,0,0,0,41,3,114,134, - 0,0,0,114,214,0,0,0,218,7,99,111,109,112,105,108, - 101,41,4,114,118,0,0,0,114,26,0,0,0,114,44,0, - 0,0,114,230,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,8,0,0,0,218,14,115,111,117,114,99,101,95,116, - 111,95,99,111,100,101,80,3,0,0,115,6,0,0,0,0, - 5,12,1,4,255,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,0,0,0,0,15, - 0,0,0,9,0,0,0,67,0,0,0,115,24,2,0,0, - 124,0,160,0,124,1,161,1,125,2,100,1,125,3,100,1, - 125,4,100,1,125,5,100,2,125,6,100,3,125,7,122,12, - 116,1,124,2,131,1,125,8,87,0,110,24,4,0,116,2, - 121,66,1,0,1,0,1,0,100,1,125,8,89,0,144,1, - 110,42,48,0,122,14,124,0,160,3,124,2,161,1,125,9, - 87,0,110,20,4,0,116,4,121,102,1,0,1,0,1,0, - 89,0,144,1,110,6,48,0,116,5,124,9,100,4,25,0, - 131,1,125,3,122,14,124,0,160,6,124,8,161,1,125,10, - 87,0,110,18,4,0,116,4,121,148,1,0,1,0,1,0, - 89,0,110,216,48,0,124,1,124,8,100,5,156,2,125,11, - 122,148,116,7,124,10,124,1,124,11,131,3,125,12,116,8, - 124,10,131,1,100,6,100,1,133,2,25,0,125,13,124,12, - 100,7,64,0,100,8,107,3,125,6,124,6,144,1,114,30, - 124,12,100,9,64,0,100,8,107,3,125,7,116,9,106,10, - 100,10,107,3,144,1,114,50,124,7,115,248,116,9,106,10, - 100,11,107,2,144,1,114,50,124,0,160,6,124,2,161,1, - 125,4,116,9,160,11,116,12,124,4,161,2,125,5,116,13, - 124,10,124,5,124,1,124,11,131,4,1,0,110,20,116,14, - 124,10,124,3,124,9,100,12,25,0,124,1,124,11,131,5, - 1,0,87,0,110,24,4,0,116,15,116,16,102,2,144,1, - 121,76,1,0,1,0,1,0,89,0,110,32,48,0,116,17, - 160,18,100,13,124,8,124,2,161,3,1,0,116,19,124,13, - 124,1,124,8,124,2,100,14,141,4,83,0,124,4,100,1, - 117,0,144,1,114,128,124,0,160,6,124,2,161,1,125,4, - 124,0,160,20,124,4,124,2,161,2,125,14,116,17,160,18, - 100,15,124,2,161,2,1,0,116,21,106,22,144,2,115,20, - 124,8,100,1,117,1,144,2,114,20,124,3,100,1,117,1, - 144,2,114,20,124,6,144,1,114,220,124,5,100,1,117,0, - 144,1,114,206,116,9,160,11,124,4,161,1,125,5,116,23, - 124,14,124,5,124,7,131,3,125,10,110,16,116,24,124,14, - 124,3,116,25,124,4,131,1,131,3,125,10,122,18,124,0, - 160,26,124,2,124,8,124,10,161,3,1,0,87,0,110,20, - 4,0,116,2,144,2,121,18,1,0,1,0,1,0,89,0, - 110,2,48,0,124,14,83,0,41,16,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,70,84,114,169,0, - 0,0,114,159,0,0,0,114,145,0,0,0,114,39,0,0, - 0,114,73,0,0,0,114,28,0,0,0,90,5,110,101,118, - 101,114,90,6,97,108,119,97,121,115,218,4,115,105,122,101, - 122,13,123,125,32,109,97,116,99,104,101,115,32,123,125,41, - 3,114,116,0,0,0,114,106,0,0,0,114,107,0,0,0, - 122,19,99,111,100,101,32,111,98,106,101,99,116,32,102,114, - 111,109,32,123,125,41,27,114,179,0,0,0,114,97,0,0, - 0,114,82,0,0,0,114,224,0,0,0,114,50,0,0,0, - 114,18,0,0,0,114,227,0,0,0,114,152,0,0,0,218, - 10,109,101,109,111,114,121,118,105,101,119,114,163,0,0,0, - 90,21,99,104,101,99,107,95,104,97,115,104,95,98,97,115, - 101,100,95,112,121,99,115,114,157,0,0,0,218,17,95,82, - 65,87,95,77,65,71,73,67,95,78,85,77,66,69,82,114, - 158,0,0,0,114,156,0,0,0,114,117,0,0,0,114,150, - 0,0,0,114,134,0,0,0,114,149,0,0,0,114,165,0, - 0,0,114,233,0,0,0,114,1,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,171,0,0,0,114,170,0,0,0,114,23,0,0,0, - 114,226,0,0,0,41,15,114,118,0,0,0,114,139,0,0, - 0,114,107,0,0,0,114,154,0,0,0,114,174,0,0,0, - 114,157,0,0,0,90,10,104,97,115,104,95,98,97,115,101, - 100,90,12,99,104,101,99,107,95,115,111,117,114,99,101,114, - 106,0,0,0,218,2,115,116,114,26,0,0,0,114,151,0, - 0,0,114,2,0,0,0,90,10,98,121,116,101,115,95,100, - 97,116,97,90,11,99,111,100,101,95,111,98,106,101,99,116, + 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,70,84,114,169,0,0,0,114,159,0,0, + 0,114,145,0,0,0,114,39,0,0,0,114,73,0,0,0, + 114,28,0,0,0,90,5,110,101,118,101,114,90,6,97,108, + 119,97,121,115,218,4,115,105,122,101,122,13,123,125,32,109, + 97,116,99,104,101,115,32,123,125,41,3,114,116,0,0,0, + 114,106,0,0,0,114,107,0,0,0,122,19,99,111,100,101, + 32,111,98,106,101,99,116,32,102,114,111,109,32,123,125,41, + 27,114,179,0,0,0,114,97,0,0,0,114,82,0,0,0, + 114,224,0,0,0,114,50,0,0,0,114,18,0,0,0,114, + 227,0,0,0,114,152,0,0,0,218,10,109,101,109,111,114, + 121,118,105,101,119,114,163,0,0,0,90,21,99,104,101,99, + 107,95,104,97,115,104,95,98,97,115,101,100,95,112,121,99, + 115,114,157,0,0,0,218,17,95,82,65,87,95,77,65,71, + 73,67,95,78,85,77,66,69,82,114,158,0,0,0,114,156, + 0,0,0,114,117,0,0,0,114,150,0,0,0,114,134,0, + 0,0,114,149,0,0,0,114,165,0,0,0,114,233,0,0, + 0,114,1,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,171,0,0,0, + 114,170,0,0,0,114,23,0,0,0,114,226,0,0,0,41, + 15,114,118,0,0,0,114,139,0,0,0,114,107,0,0,0, + 114,154,0,0,0,114,174,0,0,0,114,157,0,0,0,90, + 10,104,97,115,104,95,98,97,115,101,100,90,12,99,104,101, + 99,107,95,115,111,117,114,99,101,114,106,0,0,0,218,2, + 115,116,114,26,0,0,0,114,151,0,0,0,114,2,0,0, + 0,90,10,98,121,116,101,115,95,100,97,116,97,90,11,99, + 111,100,101,95,111,98,106,101,99,116,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,114,213,0,0,0,88,3, + 0,0,115,152,0,0,0,0,7,10,1,4,1,4,1,4, + 1,4,1,4,1,2,1,12,1,12,1,12,2,2,1,14, + 1,12,1,8,2,12,1,2,1,14,1,12,1,6,3,2, + 1,2,254,6,4,2,1,12,1,16,1,12,1,6,1,12, + 1,12,1,2,255,2,2,8,254,4,3,10,1,4,1,2, + 1,2,254,4,4,8,1,2,255,6,3,2,1,2,1,2, + 1,6,1,2,1,2,251,8,7,18,1,6,2,8,1,2, + 255,4,2,6,1,2,1,2,254,6,3,10,1,10,1,12, + 1,12,1,18,1,6,255,4,2,6,1,10,1,10,1,14, + 2,6,1,6,255,4,2,2,1,18,1,14,1,6,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,41,10,114,125,0,0,0,114,124, + 0,0,0,114,126,0,0,0,114,223,0,0,0,114,224,0, + 0,0,114,226,0,0,0,114,225,0,0,0,114,229,0,0, + 0,114,233,0,0,0,114,213,0,0,0,114,5,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114, - 213,0,0,0,88,3,0,0,115,152,0,0,0,0,7,10, - 1,4,1,4,1,4,1,4,1,4,1,2,1,12,1,12, - 1,12,2,2,1,14,1,12,1,8,2,12,1,2,1,14, - 1,12,1,6,3,2,1,2,254,6,4,2,1,12,1,16, - 1,12,1,6,1,12,1,12,1,2,255,2,2,8,254,4, - 3,10,1,4,1,2,1,2,254,4,4,8,1,2,255,6, - 3,2,1,2,1,2,1,6,1,2,1,2,251,8,7,18, - 1,6,2,8,1,2,255,4,2,6,1,2,1,2,254,6, - 3,10,1,10,1,12,1,12,1,18,1,6,255,4,2,6, - 1,10,1,10,1,14,2,6,1,6,255,4,2,2,1,18, - 1,14,1,6,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,41,10,114, - 125,0,0,0,114,124,0,0,0,114,126,0,0,0,114,223, - 0,0,0,114,224,0,0,0,114,226,0,0,0,114,225,0, - 0,0,114,229,0,0,0,114,233,0,0,0,114,213,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,0,0,0,114,221,0,0,0,29,3,0,0,115,14, - 0,0,0,8,2,8,8,8,14,8,10,8,7,8,10,14, - 8,114,221,0,0,0,99,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,115, - 92,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, - 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, - 100,6,100,7,132,0,90,6,101,7,135,0,102,1,100,8, - 100,9,132,8,131,1,90,8,101,7,100,10,100,11,132,0, - 131,1,90,9,100,12,100,13,132,0,90,10,101,7,100,14, - 100,15,132,0,131,1,90,11,135,0,4,0,90,12,83,0, - 41,16,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, - 0,0,0,0,3,0,0,0,2,0,0,0,67,0,0,0, - 115,16,0,0,0,124,1,124,0,95,0,124,2,124,0,95, - 1,100,1,83,0,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,114,159,0,0,0,41,3,114,118,0,0, - 0,114,139,0,0,0,114,44,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,8,0,0,0,114,209,0,0,0,178, - 3,0,0,115,4,0,0,0,0,3,6,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,0,0,0,0,2,0, - 0,0,2,0,0,0,67,0,0,0,115,24,0,0,0,124, - 0,106,0,124,1,106,0,107,2,111,22,124,0,106,1,124, - 1,106,1,107,2,83,0,114,109,0,0,0,169,2,218,9, - 95,95,99,108,97,115,115,95,95,114,131,0,0,0,169,2, - 114,118,0,0,0,90,5,111,116,104,101,114,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,218,6,95,95,101, - 113,95,95,184,3,0,0,115,6,0,0,0,0,1,12,1, - 10,255,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,0,0, - 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,20, - 0,0,0,116,0,124,0,106,1,131,1,116,0,124,0,106, - 2,131,1,65,0,83,0,114,109,0,0,0,169,3,218,4, - 104,97,115,104,114,116,0,0,0,114,44,0,0,0,169,1, - 114,118,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 8,0,0,0,218,8,95,95,104,97,115,104,95,95,188,3, - 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,0,0,0,0,2,0,0,0,3, - 0,0,0,3,0,0,0,115,16,0,0,0,116,0,116,1, - 124,0,131,2,160,2,124,1,161,1,83,0,41,1,122,100, - 76,111,97,100,32,97,32,109,111,100,117,108,101,32,102,114, - 111,109,32,97,32,102,105,108,101,46,10,10,32,32,32,32, - 32,32,32,32,84,104,105,115,32,109,101,116,104,111,100,32, - 105,115,32,100,101,112,114,101,99,97,116,101,100,46,32,32, - 85,115,101,32,101,120,101,99,95,109,111,100,117,108,101,40, - 41,32,105,110,115,116,101,97,100,46,10,10,32,32,32,32, - 32,32,32,32,41,3,218,5,115,117,112,101,114,114,239,0, - 0,0,114,220,0,0,0,114,219,0,0,0,169,1,114,241, - 0,0,0,114,5,0,0,0,114,8,0,0,0,114,220,0, - 0,0,191,3,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,0,0, - 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,6, - 0,0,0,124,0,106,0,83,0,169,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,114,48,0,0,0,114,219,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,179,0,0,0,203,3,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,0,0,0,0,3,0,0,0,8,0,0,0,67,0, - 0,0,115,126,0,0,0,116,0,124,0,116,1,116,2,102, - 2,131,2,114,70,116,3,160,4,116,5,124,1,131,1,161, - 1,143,24,125,2,124,2,160,6,161,0,87,0,2,0,100, - 1,4,0,4,0,131,3,1,0,83,0,49,0,115,58,48, - 0,1,0,1,0,1,0,89,0,1,0,110,52,116,3,160, - 7,124,1,100,2,161,2,143,24,125,2,124,2,160,6,161, - 0,87,0,2,0,100,1,4,0,4,0,131,3,1,0,83, - 0,49,0,115,112,48,0,1,0,1,0,1,0,89,0,1, - 0,100,1,83,0,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, - 78,218,1,114,41,8,114,161,0,0,0,114,221,0,0,0, - 218,19,69,120,116,101,110,115,105,111,110,70,105,108,101,76, - 111,97,100,101,114,114,64,0,0,0,90,9,111,112,101,110, - 95,99,111,100,101,114,84,0,0,0,90,4,114,101,97,100, - 114,65,0,0,0,41,3,114,118,0,0,0,114,44,0,0, - 0,114,68,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,0,0,0,114,227,0,0,0,208,3,0,0,115,10, - 0,0,0,0,2,14,1,16,1,40,2,14,1,122,19,70, - 105,108,101,76,111,97,100,101,114,46,103,101,116,95,100,97, - 116,97,99,2,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,2,0,0,0,67,0,0,0,115,20,0,0,0, - 100,1,100,2,108,0,109,1,125,2,1,0,124,2,124,0, - 131,1,83,0,41,3,78,114,73,0,0,0,41,1,218,10, - 70,105,108,101,82,101,97,100,101,114,41,2,90,17,105,109, - 112,111,114,116,108,105,98,46,114,101,97,100,101,114,115,114, - 253,0,0,0,41,3,114,118,0,0,0,114,216,0,0,0, - 114,253,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 8,0,0,0,218,19,103,101,116,95,114,101,115,111,117,114, - 99,101,95,114,101,97,100,101,114,217,3,0,0,115,4,0, - 0,0,0,2,12,1,122,30,70,105,108,101,76,111,97,100, - 101,114,46,103,101,116,95,114,101,115,111,117,114,99,101,95, - 114,101,97,100,101,114,41,13,114,125,0,0,0,114,124,0, - 0,0,114,126,0,0,0,114,127,0,0,0,114,209,0,0, - 0,114,243,0,0,0,114,247,0,0,0,114,136,0,0,0, - 114,220,0,0,0,114,179,0,0,0,114,227,0,0,0,114, - 254,0,0,0,90,13,95,95,99,108,97,115,115,99,101,108, - 108,95,95,114,5,0,0,0,114,5,0,0,0,114,249,0, - 0,0,114,8,0,0,0,114,239,0,0,0,173,3,0,0, - 115,22,0,0,0,8,2,4,3,8,6,8,4,8,3,2, - 1,14,11,2,1,10,4,8,9,2,1,114,239,0,0,0, - 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,64,0,0,0,115,46,0,0,0,101,0, - 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, - 90,4,100,4,100,5,132,0,90,5,100,6,100,7,156,1, - 100,8,100,9,132,2,90,6,100,10,83,0,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,0,0,0,0,3,0,0, - 0,3,0,0,0,67,0,0,0,115,22,0,0,0,116,0, - 124,1,131,1,125,2,124,2,106,1,124,2,106,2,100,1, - 156,2,83,0,41,2,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,41,2,114,169,0,0,0, - 114,234,0,0,0,41,3,114,49,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,118,0,0,0,114,44,0,0,0,114,238,0,0,0, - 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114, - 224,0,0,0,227,3,0,0,115,4,0,0,0,0,2,8, - 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,0,0,0,0,5,0,0,0,5, - 0,0,0,67,0,0,0,115,24,0,0,0,116,0,124,1, - 131,1,125,4,124,0,106,1,124,2,124,3,124,4,100,1, - 141,3,83,0,41,2,78,169,1,218,5,95,109,111,100,101, - 41,2,114,114,0,0,0,114,225,0,0,0,41,5,114,118, - 0,0,0,114,107,0,0,0,114,106,0,0,0,114,26,0, - 0,0,114,52,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,8,0,0,0,114,226,0,0,0,232,3,0,0,115, - 4,0,0,0,0,2,8,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,60,0,0,0,114, - 1,1,0,0,99,3,0,0,0,0,0,0,0,1,0,0, - 0,9,0,0,0,11,0,0,0,67,0,0,0,115,252,0, - 0,0,116,0,124,1,131,1,92,2,125,4,125,5,103,0, - 125,6,124,4,114,52,116,1,124,4,131,1,115,52,116,0, - 124,4,131,1,92,2,125,4,125,7,124,6,160,2,124,7, - 161,1,1,0,113,16,116,3,124,6,131,1,68,0,93,104, - 125,7,116,4,124,4,124,7,131,2,125,4,122,14,116,5, - 160,6,124,4,161,1,1,0,87,0,113,60,4,0,116,7, - 121,110,1,0,1,0,1,0,89,0,113,60,89,0,113,60, - 4,0,116,8,121,162,1,0,125,8,1,0,122,30,116,9, - 160,10,100,1,124,4,124,8,161,3,1,0,87,0,89,0, - 100,2,125,8,126,8,1,0,100,2,83,0,100,2,125,8, - 126,8,48,0,48,0,113,60,122,28,116,11,124,1,124,2, - 124,3,131,3,1,0,116,9,160,10,100,3,124,1,161,2, - 1,0,87,0,110,52,4,0,116,8,144,0,121,246,1,0, - 125,8,1,0,122,26,116,9,160,10,100,1,124,1,124,8, - 161,3,1,0,87,0,89,0,100,2,125,8,126,8,110,10, - 100,2,125,8,126,8,48,0,48,0,100,2,83,0,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,12,114,47,0,0,0, - 114,56,0,0,0,114,186,0,0,0,114,42,0,0,0,114, - 38,0,0,0,114,4,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,50,0,0,0,114,134,0,0,0,114,149,0,0,0, - 114,69,0,0,0,41,9,114,118,0,0,0,114,44,0,0, - 0,114,26,0,0,0,114,2,1,0,0,218,6,112,97,114, - 101,110,116,114,96,0,0,0,114,37,0,0,0,114,33,0, - 0,0,114,228,0,0,0,114,5,0,0,0,114,5,0,0, - 0,114,8,0,0,0,114,225,0,0,0,237,3,0,0,115, - 46,0,0,0,0,2,12,1,4,2,12,1,12,1,12,2, - 12,1,10,1,2,1,14,1,12,2,8,1,14,3,6,1, - 4,255,4,2,28,1,2,1,12,1,16,1,16,2,8,1, - 2,255,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,125,0,0,0,114,124,0,0,0,114,126,0,0,0,114, - 127,0,0,0,114,224,0,0,0,114,226,0,0,0,114,225, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,114,255,0,0,0,223,3,0,0, - 115,8,0,0,0,8,2,4,2,8,5,8,5,114,255,0, - 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,64,0,0,0,115,32,0,0,0, - 101,0,90,1,100,0,90,2,100,1,90,3,100,2,100,3, - 132,0,90,4,100,4,100,5,132,0,90,5,100,6,83,0, - 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, - 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0, - 115,68,0,0,0,124,0,160,0,124,1,161,1,125,2,124, - 0,160,1,124,2,161,1,125,3,124,1,124,2,100,1,156, - 2,125,4,116,2,124,3,124,1,124,4,131,3,1,0,116, - 3,116,4,124,3,131,1,100,2,100,0,133,2,25,0,124, - 1,124,2,100,3,141,3,83,0,41,4,78,114,159,0,0, - 0,114,145,0,0,0,41,2,114,116,0,0,0,114,106,0, - 0,0,41,5,114,179,0,0,0,114,227,0,0,0,114,152, - 0,0,0,114,165,0,0,0,114,235,0,0,0,41,5,114, - 118,0,0,0,114,139,0,0,0,114,44,0,0,0,114,26, - 0,0,0,114,151,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,114,213,0,0,0,16,4,0,0, - 115,22,0,0,0,0,1,10,1,10,4,2,1,2,254,6, - 4,12,1,2,1,14,1,2,1,2,253,122,29,83,111,117, - 114,99,101,108,101,115,115,70,105,108,101,76,111,97,100,101, - 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,4,0,0,0,100,1,83,0,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,5,0,0,0,114,219,0, - 0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0, - 0,114,229,0,0,0,32,4,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,125,0,0,0,114,124,0,0,0,114, - 126,0,0,0,114,127,0,0,0,114,213,0,0,0,114,229, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,114,5,1,0,0,12,4,0,0, - 115,6,0,0,0,8,2,4,2,8,16,114,5,1,0,0, + 221,0,0,0,29,3,0,0,115,14,0,0,0,8,2,8, + 8,8,14,8,10,8,7,8,10,14,8,114,221,0,0,0, 99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,64,0,0,0,115,92,0,0,0,101,0, + 0,4,0,0,0,0,0,0,0,115,92,0,0,0,101,0, 90,1,100,0,90,2,100,1,90,3,100,2,100,3,132,0, 90,4,100,4,100,5,132,0,90,5,100,6,100,7,132,0, - 90,6,100,8,100,9,132,0,90,7,100,10,100,11,132,0, - 90,8,100,12,100,13,132,0,90,9,100,14,100,15,132,0, - 90,10,100,16,100,17,132,0,90,11,101,12,100,18,100,19, - 132,0,131,1,90,13,100,20,83,0,41,21,114,252,0,0, - 0,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,0,0,0,0,3,0,0, - 0,2,0,0,0,67,0,0,0,115,16,0,0,0,124,1, - 124,0,95,0,124,2,124,0,95,1,100,0,83,0,114,109, - 0,0,0,114,159,0,0,0,41,3,114,118,0,0,0,114, - 116,0,0,0,114,44,0,0,0,114,5,0,0,0,114,5, - 0,0,0,114,8,0,0,0,114,209,0,0,0,49,4,0, - 0,115,4,0,0,0,0,1,6,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,0,0,0,0,2,0,0,0,2,0,0,0,67,0,0, - 0,115,24,0,0,0,124,0,106,0,124,1,106,0,107,2, - 111,22,124,0,106,1,124,1,106,1,107,2,83,0,114,109, - 0,0,0,114,240,0,0,0,114,242,0,0,0,114,5,0, - 0,0,114,5,0,0,0,114,8,0,0,0,114,243,0,0, - 0,53,4,0,0,115,6,0,0,0,0,1,12,1,10,255, - 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,0,0,0,0,1,0,0,0,3,0,0, - 0,67,0,0,0,115,20,0,0,0,116,0,124,0,106,1, - 131,1,116,0,124,0,106,2,131,1,65,0,83,0,114,109, - 0,0,0,114,244,0,0,0,114,246,0,0,0,114,5,0, - 0,0,114,5,0,0,0,114,8,0,0,0,114,247,0,0, - 0,57,4,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,0,0,0,0,3,0,0,0,5,0,0,0,67, - 0,0,0,115,36,0,0,0,116,0,160,1,116,2,106,3, - 124,1,161,2,125,2,116,0,160,4,100,1,124,1,106,5, - 124,0,106,6,161,3,1,0,124,2,83,0,41,2,122,38, - 67,114,101,97,116,101,32,97,110,32,117,110,105,116,105,97, - 108,105,122,101,100,32,101,120,116,101,110,115,105,111,110,32, - 109,111,100,117,108,101,122,38,101,120,116,101,110,115,105,111, - 110,32,109,111,100,117,108,101,32,123,33,114,125,32,108,111, - 97,100,101,100,32,102,114,111,109,32,123,33,114,125,41,7, - 114,134,0,0,0,114,214,0,0,0,114,163,0,0,0,90, - 14,99,114,101,97,116,101,95,100,121,110,97,109,105,99,114, - 149,0,0,0,114,116,0,0,0,114,44,0,0,0,41,3, - 114,118,0,0,0,114,187,0,0,0,114,216,0,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,212, - 0,0,0,60,4,0,0,115,14,0,0,0,0,2,4,1, - 6,255,4,2,6,1,8,255,4,2,122,33,69,120,116,101, - 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46, - 99,114,101,97,116,101,95,109,111,100,117,108,101,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,5,0, - 0,0,67,0,0,0,115,36,0,0,0,116,0,160,1,116, - 2,106,3,124,1,161,2,1,0,116,0,160,4,100,1,124, - 0,106,5,124,0,106,6,161,3,1,0,100,2,83,0,41, - 3,122,30,73,110,105,116,105,97,108,105,122,101,32,97,110, - 32,101,120,116,101,110,115,105,111,110,32,109,111,100,117,108, - 101,122,40,101,120,116,101,110,115,105,111,110,32,109,111,100, - 117,108,101,32,123,33,114,125,32,101,120,101,99,117,116,101, - 100,32,102,114,111,109,32,123,33,114,125,78,41,7,114,134, - 0,0,0,114,214,0,0,0,114,163,0,0,0,90,12,101, - 120,101,99,95,100,121,110,97,109,105,99,114,149,0,0,0, - 114,116,0,0,0,114,44,0,0,0,169,2,114,118,0,0, - 0,114,216,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,0,0,0,114,217,0,0,0,68,4,0,0,115,8, - 0,0,0,0,2,14,1,6,1,8,255,122,31,69,120,116, - 101,110,115,105,111,110,70,105,108,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,0,0,0,0,2,0,0,0,4,0,0, - 0,3,0,0,0,115,36,0,0,0,116,0,124,0,106,1, - 131,1,100,1,25,0,137,0,116,2,135,0,102,1,100,2, - 100,3,132,8,116,3,68,0,131,1,131,1,83,0,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,39,0,0,0,99,1,0,0,0,0,0,0, - 0,0,0,0,0,2,0,0,0,4,0,0,0,51,0,0, - 0,115,26,0,0,0,124,0,93,18,125,1,136,0,100,0, - 124,1,23,0,107,2,86,0,1,0,113,2,100,1,83,0, - 41,2,114,209,0,0,0,78,114,5,0,0,0,169,2,114, - 32,0,0,0,218,6,115,117,102,102,105,120,169,1,90,9, - 102,105,108,101,95,110,97,109,101,114,5,0,0,0,114,8, - 0,0,0,218,9,60,103,101,110,101,120,112,114,62,77,4, - 0,0,115,4,0,0,0,4,1,2,255,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,47,0,0,0,114,44,0,0,0,218,3,97,110,121,218, - 18,69,88,84,69,78,83,73,79,78,95,83,85,70,70,73, - 88,69,83,114,219,0,0,0,114,5,0,0,0,114,9,1, - 0,0,114,8,0,0,0,114,182,0,0,0,74,4,0,0, - 115,8,0,0,0,0,2,14,1,12,1,2,255,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,0,0,0,0,2,0,0,0,1,0, - 0,0,67,0,0,0,115,4,0,0,0,100,1,83,0,41, - 2,122,63,82,101,116,117,114,110,32,78,111,110,101,32,97, - 115,32,97,110,32,101,120,116,101,110,115,105,111,110,32,109, - 111,100,117,108,101,32,99,97,110,110,111,116,32,99,114,101, - 97,116,101,32,97,32,99,111,100,101,32,111,98,106,101,99, - 116,46,78,114,5,0,0,0,114,219,0,0,0,114,5,0, - 0,0,114,5,0,0,0,114,8,0,0,0,114,213,0,0, - 0,80,4,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,0,0,0,0,2,0,0,0,1,0,0,0,67, - 0,0,0,115,4,0,0,0,100,1,83,0,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,5,0,0,0,114,219,0,0,0, - 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114, - 229,0,0,0,84,4,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, + 90,6,101,7,135,0,102,1,100,8,100,9,132,8,131,1, + 90,8,101,7,100,10,100,11,132,0,131,1,90,9,100,12, + 100,13,132,0,90,10,101,7,100,14,100,15,132,0,131,1, + 90,11,135,0,4,0,90,12,83,0,41,16,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,0,0,0,0,3,0, + 0,0,2,0,0,0,67,0,0,0,115,16,0,0,0,124, + 1,124,0,95,0,124,2,124,0,95,1,100,1,83,0,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,114, + 159,0,0,0,41,3,114,118,0,0,0,114,139,0,0,0, + 114,44,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,114,209,0,0,0,178,3,0,0,115,4,0, + 0,0,0,3,6,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,0,0,0,0,2,0,0,0,2,0,0,0, + 67,0,0,0,115,24,0,0,0,124,0,106,0,124,1,106, + 0,107,2,111,22,124,0,106,1,124,1,106,1,107,2,83, + 0,114,109,0,0,0,169,2,218,9,95,95,99,108,97,115, + 115,95,95,114,131,0,0,0,169,2,114,118,0,0,0,90, + 5,111,116,104,101,114,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,218,6,95,95,101,113,95,95,184,3,0, + 0,115,6,0,0,0,0,1,12,1,10,255,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,0,0,0,0,1,0,0,0, + 3,0,0,0,67,0,0,0,115,20,0,0,0,116,0,124, + 0,106,1,131,1,116,0,124,0,106,2,131,1,65,0,83, + 0,114,109,0,0,0,169,3,218,4,104,97,115,104,114,116, + 0,0,0,114,44,0,0,0,169,1,114,118,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,8, + 95,95,104,97,115,104,95,95,188,3,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,0,0,0,0,2,0,0,0,3,0,0,0,3,0,0, + 0,115,16,0,0,0,116,0,116,1,124,0,131,2,160,2, + 124,1,161,1,83,0,41,1,122,100,76,111,97,100,32,97, + 32,109,111,100,117,108,101,32,102,114,111,109,32,97,32,102, + 105,108,101,46,10,10,32,32,32,32,32,32,32,32,84,104, + 105,115,32,109,101,116,104,111,100,32,105,115,32,100,101,112, + 114,101,99,97,116,101,100,46,32,32,85,115,101,32,101,120, + 101,99,95,109,111,100,117,108,101,40,41,32,105,110,115,116, + 101,97,100,46,10,10,32,32,32,32,32,32,32,32,41,3, + 218,5,115,117,112,101,114,114,239,0,0,0,114,220,0,0, + 0,114,219,0,0,0,169,1,114,241,0,0,0,114,5,0, + 0,0,114,8,0,0,0,114,220,0,0,0,191,3,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,0,0,0,0,2,0,0,0, 1,0,0,0,67,0,0,0,115,6,0,0,0,124,0,106, - 0,83,0,114,250,0,0,0,114,48,0,0,0,114,219,0, - 0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0, - 0,114,179,0,0,0,88,4,0,0,115,2,0,0,0,0, - 3,122,32,69,120,116,101,110,115,105,111,110,70,105,108,101, + 0,83,0,169,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,114,48,0,0,0,114,219,0,0,0,114,5,0,0,0, + 114,5,0,0,0,114,8,0,0,0,114,179,0,0,0,203, + 3,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,78,41,14,114,125,0,0,0,114,124,0,0,0, - 114,126,0,0,0,114,127,0,0,0,114,209,0,0,0,114, - 243,0,0,0,114,247,0,0,0,114,212,0,0,0,114,217, - 0,0,0,114,182,0,0,0,114,213,0,0,0,114,229,0, - 0,0,114,136,0,0,0,114,179,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,252,0,0,0,41,4,0,0,115,22,0,0,0,8,2, - 4,6,8,4,8,4,8,3,8,8,8,6,8,6,8,4, - 8,4,2,1,114,252,0,0,0,99,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, - 0,0,115,104,0,0,0,101,0,90,1,100,0,90,2,100, - 1,90,3,100,2,100,3,132,0,90,4,100,4,100,5,132, - 0,90,5,100,6,100,7,132,0,90,6,100,8,100,9,132, - 0,90,7,100,10,100,11,132,0,90,8,100,12,100,13,132, - 0,90,9,100,14,100,15,132,0,90,10,100,16,100,17,132, - 0,90,11,100,18,100,19,132,0,90,12,100,20,100,21,132, - 0,90,13,100,22,100,23,132,0,90,14,100,24,83,0,41, - 25,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,0,0,0,0,4,0,0,0,3,0,0, - 0,67,0,0,0,115,36,0,0,0,124,1,124,0,95,0, - 124,2,124,0,95,1,116,2,124,0,160,3,161,0,131,1, - 124,0,95,4,124,3,124,0,95,5,100,0,83,0,114,109, - 0,0,0,41,6,218,5,95,110,97,109,101,218,5,95,112, - 97,116,104,114,111,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,169,4,114,118,0, - 0,0,114,116,0,0,0,114,44,0,0,0,90,11,112,97, - 116,104,95,102,105,110,100,101,114,114,5,0,0,0,114,5, - 0,0,0,114,8,0,0,0,114,209,0,0,0,101,4,0, - 0,115,8,0,0,0,0,1,6,1,6,1,14,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, - 0,0,0,0,4,0,0,0,3,0,0,0,67,0,0,0, - 115,38,0,0,0,124,0,106,0,160,1,100,1,161,1,92, - 3,125,1,125,2,125,3,124,2,100,2,107,2,114,30,100, - 3,83,0,124,1,100,4,102,2,83,0,41,5,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,71,0, - 0,0,114,40,0,0,0,41,2,114,1,0,0,0,114,44, - 0,0,0,90,8,95,95,112,97,116,104,95,95,41,2,114, - 14,1,0,0,114,41,0,0,0,41,4,114,118,0,0,0, - 114,4,1,0,0,218,3,100,111,116,90,2,109,101,114,5, - 0,0,0,114,5,0,0,0,114,8,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,107,4,0,0,115,8,0,0,0,0, - 2,18,1,8,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,0,0,0,0,3,0,0,0, - 3,0,0,0,67,0,0,0,115,28,0,0,0,124,0,160, - 0,161,0,92,2,125,1,125,2,116,1,116,2,106,3,124, - 1,25,0,124,2,131,2,83,0,114,109,0,0,0,41,4, - 114,21,1,0,0,114,130,0,0,0,114,1,0,0,0,218, - 7,109,111,100,117,108,101,115,41,3,114,118,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,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,114,16,1,0,0,117,4,0,0,115,4,0,0,0, - 0,1,12,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,0,0, - 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,80, - 0,0,0,116,0,124,0,160,1,161,0,131,1,125,1,124, - 1,124,0,106,2,107,3,114,74,124,0,160,3,124,0,106, - 4,124,1,161,2,125,2,124,2,100,0,117,1,114,68,124, - 2,106,5,100,0,117,0,114,68,124,2,106,6,114,68,124, - 2,106,6,124,0,95,7,124,1,124,0,95,2,124,0,106, - 7,83,0,114,109,0,0,0,41,8,114,111,0,0,0,114, - 16,1,0,0,114,17,1,0,0,114,18,1,0,0,114,14, - 1,0,0,114,140,0,0,0,114,178,0,0,0,114,15,1, - 0,0,41,3,114,118,0,0,0,90,11,112,97,114,101,110, - 116,95,112,97,116,104,114,187,0,0,0,114,5,0,0,0, - 114,5,0,0,0,114,8,0,0,0,218,12,95,114,101,99, - 97,108,99,117,108,97,116,101,121,4,0,0,115,16,0,0, - 0,0,2,12,1,10,1,14,3,18,1,6,1,8,1,6, - 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,0,0,0,0,1,0,0,0,3, - 0,0,0,67,0,0,0,115,12,0,0,0,116,0,124,0, - 160,1,161,0,131,1,83,0,114,109,0,0,0,41,2,218, - 4,105,116,101,114,114,23,1,0,0,114,246,0,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,8, - 95,95,105,116,101,114,95,95,134,4,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,2,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,2,0,0, - 0,67,0,0,0,115,12,0,0,0,124,0,160,0,161,0, - 124,1,25,0,83,0,114,109,0,0,0,169,1,114,23,1, - 0,0,41,2,114,118,0,0,0,218,5,105,110,100,101,120, - 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218, - 11,95,95,103,101,116,105,116,101,109,95,95,137,4,0,0, - 115,2,0,0,0,0,1,122,26,95,78,97,109,101,115,112, - 97,99,101,80,97,116,104,46,95,95,103,101,116,105,116,101, - 109,95,95,99,3,0,0,0,0,0,0,0,0,0,0,0, - 3,0,0,0,3,0,0,0,67,0,0,0,115,14,0,0, - 0,124,2,124,0,106,0,124,1,60,0,100,0,83,0,114, - 109,0,0,0,41,1,114,15,1,0,0,41,3,114,118,0, - 0,0,114,27,1,0,0,114,44,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,218,11,95,95,115, - 101,116,105,116,101,109,95,95,140,4,0,0,115,2,0,0, - 0,0,1,122,26,95,78,97,109,101,115,112,97,99,101,80, - 97,116,104,46,95,95,115,101,116,105,116,101,109,95,95,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 3,0,0,0,67,0,0,0,115,12,0,0,0,116,0,124, - 0,160,1,161,0,131,1,83,0,114,109,0,0,0,41,2, - 114,23,0,0,0,114,23,1,0,0,114,246,0,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,7, - 95,95,108,101,110,95,95,143,4,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,0,0,0,0,1,0,0,0,3,0,0,0,67, - 0,0,0,115,12,0,0,0,100,1,160,0,124,0,106,1, - 161,1,83,0,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, - 62,0,0,0,114,15,1,0,0,114,246,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,218,8,95, - 95,114,101,112,114,95,95,146,4,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,0,0,0,0,2,0,0,0,3,0,0,0, - 67,0,0,0,115,12,0,0,0,124,1,124,0,160,0,161, - 0,118,0,83,0,114,109,0,0,0,114,26,1,0,0,169, - 2,114,118,0,0,0,218,4,105,116,101,109,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,218,12,95,95,99, - 111,110,116,97,105,110,115,95,95,149,4,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,0,0,0,0,2,0, - 0,0,3,0,0,0,67,0,0,0,115,16,0,0,0,124, - 0,106,0,160,1,124,1,161,1,1,0,100,0,83,0,114, - 109,0,0,0,41,2,114,15,1,0,0,114,186,0,0,0, - 114,32,1,0,0,114,5,0,0,0,114,5,0,0,0,114, - 8,0,0,0,114,186,0,0,0,152,4,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,15,114,125, - 0,0,0,114,124,0,0,0,114,126,0,0,0,114,127,0, - 0,0,114,209,0,0,0,114,21,1,0,0,114,16,1,0, - 0,114,23,1,0,0,114,25,1,0,0,114,28,1,0,0, - 114,29,1,0,0,114,30,1,0,0,114,31,1,0,0,114, - 34,1,0,0,114,186,0,0,0,114,5,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,114,13,1, - 0,0,94,4,0,0,115,24,0,0,0,8,1,4,6,8, - 6,8,10,8,4,8,13,8,3,8,3,8,3,8,3,8, - 3,8,3,114,13,1,0,0,99,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,3,0,0,0,64,0,0, - 0,115,80,0,0,0,101,0,90,1,100,0,90,2,100,1, - 100,2,132,0,90,3,101,4,100,3,100,4,132,0,131,1, - 90,5,100,5,100,6,132,0,90,6,100,7,100,8,132,0, - 90,7,100,9,100,10,132,0,90,8,100,11,100,12,132,0, - 90,9,100,13,100,14,132,0,90,10,100,15,100,16,132,0, - 90,11,100,17,83,0,41,18,218,16,95,78,97,109,101,115, - 112,97,99,101,76,111,97,100,101,114,99,4,0,0,0,0, - 0,0,0,0,0,0,0,4,0,0,0,4,0,0,0,67, - 0,0,0,115,18,0,0,0,116,0,124,1,124,2,124,3, - 131,3,124,0,95,1,100,0,83,0,114,109,0,0,0,41, - 2,114,13,1,0,0,114,15,1,0,0,114,19,1,0,0, + 97,109,101,99,2,0,0,0,0,0,0,0,0,0,0,0, + 3,0,0,0,8,0,0,0,67,0,0,0,115,126,0,0, + 0,116,0,124,0,116,1,116,2,102,2,131,2,114,70,116, + 3,160,4,116,5,124,1,131,1,161,1,143,24,125,2,124, + 2,160,6,161,0,87,0,2,0,100,1,4,0,4,0,131, + 3,1,0,83,0,49,0,115,58,48,0,1,0,1,0,1, + 0,89,0,1,0,110,52,116,3,160,7,124,1,100,2,161, + 2,143,24,125,2,124,2,160,6,161,0,87,0,2,0,100, + 1,4,0,4,0,131,3,1,0,83,0,49,0,115,112,48, + 0,1,0,1,0,1,0,89,0,1,0,100,1,83,0,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,78,218,1,114,41,8, + 114,161,0,0,0,114,221,0,0,0,218,19,69,120,116,101, + 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,114, + 64,0,0,0,90,9,111,112,101,110,95,99,111,100,101,114, + 84,0,0,0,90,4,114,101,97,100,114,65,0,0,0,41, + 3,114,118,0,0,0,114,44,0,0,0,114,68,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114, - 209,0,0,0,158,4,0,0,115,2,0,0,0,0,1,122, - 25,95,78,97,109,101,115,112,97,99,101,76,111,97,100,101, - 114,46,95,95,105,110,105,116,95,95,99,2,0,0,0,0, - 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67, - 0,0,0,115,12,0,0,0,100,1,160,0,124,1,106,1, - 161,1,83,0,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,62,0,0,0,114,125,0, - 0,0,41,2,114,193,0,0,0,114,216,0,0,0,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,218,11,109, - 111,100,117,108,101,95,114,101,112,114,161,4,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,0,0,0,0, - 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, - 0,100,1,83,0,41,2,78,84,114,5,0,0,0,114,219, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,114,182,0,0,0,170,4,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,0,0,0,0,2,0,0,0, - 1,0,0,0,67,0,0,0,115,4,0,0,0,100,1,83, - 0,41,2,78,114,40,0,0,0,114,5,0,0,0,114,219, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,114,229,0,0,0,173,4,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,0,0,0,0,2,0,0,0, - 6,0,0,0,67,0,0,0,115,16,0,0,0,116,0,100, - 1,100,2,100,3,100,4,100,5,141,4,83,0,41,6,78, - 114,40,0,0,0,122,8,60,115,116,114,105,110,103,62,114, - 215,0,0,0,84,41,1,114,231,0,0,0,41,1,114,232, + 227,0,0,0,208,3,0,0,115,10,0,0,0,0,2,14, + 1,16,1,40,2,14,1,122,19,70,105,108,101,76,111,97, + 100,101,114,46,103,101,116,95,100,97,116,97,99,2,0,0, + 0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0, + 0,67,0,0,0,115,20,0,0,0,100,1,100,2,108,0, + 109,1,125,2,1,0,124,2,124,0,131,1,83,0,41,3, + 78,114,73,0,0,0,41,1,218,10,70,105,108,101,82,101, + 97,100,101,114,41,2,90,17,105,109,112,111,114,116,108,105, + 98,46,114,101,97,100,101,114,115,114,253,0,0,0,41,3, + 114,118,0,0,0,114,216,0,0,0,114,253,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,218,19, + 103,101,116,95,114,101,115,111,117,114,99,101,95,114,101,97, + 100,101,114,217,3,0,0,115,4,0,0,0,0,2,12,1, + 122,30,70,105,108,101,76,111,97,100,101,114,46,103,101,116, + 95,114,101,115,111,117,114,99,101,95,114,101,97,100,101,114, + 41,13,114,125,0,0,0,114,124,0,0,0,114,126,0,0, + 0,114,127,0,0,0,114,209,0,0,0,114,243,0,0,0, + 114,247,0,0,0,114,136,0,0,0,114,220,0,0,0,114, + 179,0,0,0,114,227,0,0,0,114,254,0,0,0,90,13, + 95,95,99,108,97,115,115,99,101,108,108,95,95,114,5,0, + 0,0,114,5,0,0,0,114,249,0,0,0,114,8,0,0, + 0,114,239,0,0,0,173,3,0,0,115,22,0,0,0,8, + 2,4,3,8,6,8,4,8,3,2,1,14,11,2,1,10, + 4,8,9,2,1,114,239,0,0,0,99,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,64, + 0,0,0,115,46,0,0,0,101,0,90,1,100,0,90,2, + 100,1,90,3,100,2,100,3,132,0,90,4,100,4,100,5, + 132,0,90,5,100,6,100,7,156,1,100,8,100,9,132,2, + 90,6,100,10,83,0,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,0,0,0,0,3,0,0,0,3,0,0,0,67, + 0,0,0,115,22,0,0,0,116,0,124,1,131,1,125,2, + 124,2,106,1,124,2,106,2,100,1,156,2,83,0,41,2, + 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,41,2,114,169,0,0,0,114,234,0,0,0,41, + 3,114,49,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,118,0,0,0, + 114,44,0,0,0,114,238,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,114,224,0,0,0,227,3, + 0,0,115,4,0,0,0,0,2,8,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,0,0,0,0,5,0,0,0,5,0,0,0,67,0,0, + 0,115,24,0,0,0,116,0,124,1,131,1,125,4,124,0, + 106,1,124,2,124,3,124,4,100,1,141,3,83,0,41,2, + 78,169,1,218,5,95,109,111,100,101,41,2,114,114,0,0, + 0,114,225,0,0,0,41,5,114,118,0,0,0,114,107,0, + 0,0,114,106,0,0,0,114,26,0,0,0,114,52,0,0, + 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, + 114,226,0,0,0,232,3,0,0,115,4,0,0,0,0,2, + 8,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,60,0,0,0,114,1,1,0,0,99,3, + 0,0,0,0,0,0,0,1,0,0,0,9,0,0,0,11, + 0,0,0,67,0,0,0,115,248,0,0,0,116,0,124,1, + 131,1,92,2,125,4,125,5,103,0,125,6,124,4,114,52, + 116,1,124,4,131,1,115,52,116,0,124,4,131,1,92,2, + 125,4,125,7,124,6,160,2,124,7,161,1,1,0,113,16, + 116,3,124,6,131,1,68,0,93,102,125,7,116,4,124,4, + 124,7,131,2,125,4,122,14,116,5,160,6,124,4,161,1, + 1,0,87,0,113,60,4,0,116,7,121,110,1,0,1,0, + 1,0,89,0,113,60,89,0,113,60,4,0,116,8,121,162, + 1,0,125,8,1,0,122,30,116,9,160,10,100,1,124,4, + 124,8,161,3,1,0,87,0,89,0,100,2,125,8,126,8, + 1,0,100,2,83,0,100,2,125,8,126,8,48,0,48,0, + 122,28,116,11,124,1,124,2,124,3,131,3,1,0,116,9, + 160,10,100,3,124,1,161,2,1,0,87,0,110,50,4,0, + 116,8,121,242,1,0,125,8,1,0,122,26,116,9,160,10, + 100,1,124,1,124,8,161,3,1,0,87,0,89,0,100,2, + 125,8,126,8,110,10,100,2,125,8,126,8,48,0,48,0, + 100,2,83,0,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, + 12,114,47,0,0,0,114,56,0,0,0,114,186,0,0,0, + 114,42,0,0,0,114,38,0,0,0,114,4,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,50,0,0,0,114,134,0,0, + 0,114,149,0,0,0,114,69,0,0,0,41,9,114,118,0, + 0,0,114,44,0,0,0,114,26,0,0,0,114,2,1,0, + 0,218,6,112,97,114,101,110,116,114,96,0,0,0,114,37, + 0,0,0,114,33,0,0,0,114,228,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,114,225,0,0, + 0,237,3,0,0,115,46,0,0,0,0,2,12,1,4,2, + 12,1,12,1,12,2,12,1,10,1,2,1,14,1,12,2, + 8,1,14,3,6,1,4,255,4,2,26,1,2,1,12,1, + 16,1,14,2,8,1,2,255,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,125,0,0,0,114,124,0,0,0, + 114,126,0,0,0,114,127,0,0,0,114,224,0,0,0,114, + 226,0,0,0,114,225,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,255,0, + 0,0,223,3,0,0,115,8,0,0,0,8,2,4,2,8, + 5,8,5,114,255,0,0,0,99,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, + 0,115,32,0,0,0,101,0,90,1,100,0,90,2,100,1, + 90,3,100,2,100,3,132,0,90,4,100,4,100,5,132,0, + 90,5,100,6,83,0,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,0,0,0,0,5,0,0,0,5,0, + 0,0,67,0,0,0,115,68,0,0,0,124,0,160,0,124, + 1,161,1,125,2,124,0,160,1,124,2,161,1,125,3,124, + 1,124,2,100,1,156,2,125,4,116,2,124,3,124,1,124, + 4,131,3,1,0,116,3,116,4,124,3,131,1,100,2,100, + 0,133,2,25,0,124,1,124,2,100,3,141,3,83,0,41, + 4,78,114,159,0,0,0,114,145,0,0,0,41,2,114,116, + 0,0,0,114,106,0,0,0,41,5,114,179,0,0,0,114, + 227,0,0,0,114,152,0,0,0,114,165,0,0,0,114,235, + 0,0,0,41,5,114,118,0,0,0,114,139,0,0,0,114, + 44,0,0,0,114,26,0,0,0,114,151,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,213,0, + 0,0,16,4,0,0,115,22,0,0,0,0,1,10,1,10, + 4,2,1,2,254,6,4,12,1,2,1,14,1,2,1,2, + 253,122,29,83,111,117,114,99,101,108,101,115,115,70,105,108, + 101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, + 83,0,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,5, 0,0,0,114,219,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,114,213,0,0,0,176,4,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,0,0,0,0,2, - 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, - 100,1,83,0,114,210,0,0,0,114,5,0,0,0,114,211, + 0,0,114,8,0,0,0,114,229,0,0,0,32,4,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,125,0,0,0, + 114,124,0,0,0,114,126,0,0,0,114,127,0,0,0,114, + 213,0,0,0,114,229,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,5,1, + 0,0,12,4,0,0,115,6,0,0,0,8,2,4,2,8, + 16,114,5,1,0,0,99,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,3,0,0,0,64,0,0,0,115, + 92,0,0,0,101,0,90,1,100,0,90,2,100,1,90,3, + 100,2,100,3,132,0,90,4,100,4,100,5,132,0,90,5, + 100,6,100,7,132,0,90,6,100,8,100,9,132,0,90,7, + 100,10,100,11,132,0,90,8,100,12,100,13,132,0,90,9, + 100,14,100,15,132,0,90,10,100,16,100,17,132,0,90,11, + 101,12,100,18,100,19,132,0,131,1,90,13,100,20,83,0, + 41,21,114,252,0,0,0,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,0, + 0,0,0,3,0,0,0,2,0,0,0,67,0,0,0,115, + 16,0,0,0,124,1,124,0,95,0,124,2,124,0,95,1, + 100,0,83,0,114,109,0,0,0,114,159,0,0,0,41,3, + 114,118,0,0,0,114,116,0,0,0,114,44,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,209, + 0,0,0,49,4,0,0,115,4,0,0,0,0,1,6,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,0,0,0,0,2,0,0,0,2, + 0,0,0,67,0,0,0,115,24,0,0,0,124,0,106,0, + 124,1,106,0,107,2,111,22,124,0,106,1,124,1,106,1, + 107,2,83,0,114,109,0,0,0,114,240,0,0,0,114,242, 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,114,212,0,0,0,179,4,0,0,115,2,0,0,0, - 0,1,122,30,95,78,97,109,101,115,112,97,99,101,76,111, - 97,100,101,114,46,99,114,101,97,116,101,95,109,111,100,117, + 0,0,114,243,0,0,0,53,4,0,0,115,6,0,0,0, + 0,1,12,1,10,255,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,0,0,0,0,1, + 0,0,0,3,0,0,0,67,0,0,0,115,20,0,0,0, + 116,0,124,0,106,1,131,1,116,0,124,0,106,2,131,1, + 65,0,83,0,114,109,0,0,0,114,244,0,0,0,114,246, + 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, + 0,0,114,247,0,0,0,57,4,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,0,0,0,0,3,0,0, + 0,5,0,0,0,67,0,0,0,115,36,0,0,0,116,0, + 160,1,116,2,106,3,124,1,161,2,125,2,116,0,160,4, + 100,1,124,1,106,5,124,0,106,6,161,3,1,0,124,2, + 83,0,41,2,122,38,67,114,101,97,116,101,32,97,110,32, + 117,110,105,116,105,97,108,105,122,101,100,32,101,120,116,101, + 110,115,105,111,110,32,109,111,100,117,108,101,122,38,101,120, + 116,101,110,115,105,111,110,32,109,111,100,117,108,101,32,123, + 33,114,125,32,108,111,97,100,101,100,32,102,114,111,109,32, + 123,33,114,125,41,7,114,134,0,0,0,114,214,0,0,0, + 114,163,0,0,0,90,14,99,114,101,97,116,101,95,100,121, + 110,97,109,105,99,114,149,0,0,0,114,116,0,0,0,114, + 44,0,0,0,41,3,114,118,0,0,0,114,187,0,0,0, + 114,216,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,114,212,0,0,0,60,4,0,0,115,14,0, + 0,0,0,2,4,1,6,255,4,2,6,1,8,255,4,2, + 122,33,69,120,116,101,110,115,105,111,110,70,105,108,101,76, + 111,97,100,101,114,46,99,114,101,97,116,101,95,109,111,100, + 117,108,101,99,2,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,5,0,0,0,67,0,0,0,115,36,0,0, + 0,116,0,160,1,116,2,106,3,124,1,161,2,1,0,116, + 0,160,4,100,1,124,0,106,5,124,0,106,6,161,3,1, + 0,100,2,83,0,41,3,122,30,73,110,105,116,105,97,108, + 105,122,101,32,97,110,32,101,120,116,101,110,115,105,111,110, + 32,109,111,100,117,108,101,122,40,101,120,116,101,110,115,105, + 111,110,32,109,111,100,117,108,101,32,123,33,114,125,32,101, + 120,101,99,117,116,101,100,32,102,114,111,109,32,123,33,114, + 125,78,41,7,114,134,0,0,0,114,214,0,0,0,114,163, + 0,0,0,90,12,101,120,101,99,95,100,121,110,97,109,105, + 99,114,149,0,0,0,114,116,0,0,0,114,44,0,0,0, + 169,2,114,118,0,0,0,114,216,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,8,0,0,0,114,217,0,0,0, + 68,4,0,0,115,8,0,0,0,0,2,14,1,6,1,8, + 255,122,31,69,120,116,101,110,115,105,111,110,70,105,108,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,0,0,0,0,2, - 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, - 100,0,83,0,114,109,0,0,0,114,5,0,0,0,114,6, - 1,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,114,217,0,0,0,182,4,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, + 0,0,0,4,0,0,0,3,0,0,0,115,36,0,0,0, + 116,0,124,0,106,1,131,1,100,1,25,0,137,0,116,2, + 135,0,102,1,100,2,100,3,132,8,116,3,68,0,131,1, + 131,1,83,0,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,39,0,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,51,0,0,0,115,26,0,0,0,124,0,93,18, + 125,1,136,0,100,0,124,1,23,0,107,2,86,0,1,0, + 113,2,100,1,83,0,41,2,114,209,0,0,0,78,114,5, + 0,0,0,169,2,114,32,0,0,0,218,6,115,117,102,102, + 105,120,169,1,90,9,102,105,108,101,95,110,97,109,101,114, + 5,0,0,0,114,8,0,0,0,218,9,60,103,101,110,101, + 120,112,114,62,77,4,0,0,115,4,0,0,0,4,1,2, + 255,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,47,0,0,0,114,44,0,0,0, + 218,3,97,110,121,218,18,69,88,84,69,78,83,73,79,78, + 95,83,85,70,70,73,88,69,83,114,219,0,0,0,114,5, + 0,0,0,114,9,1,0,0,114,8,0,0,0,114,182,0, + 0,0,74,4,0,0,115,8,0,0,0,0,2,14,1,12, + 1,2,255,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,0,0,0,0, + 2,0,0,0,1,0,0,0,67,0,0,0,115,4,0,0, + 0,100,1,83,0,41,2,122,63,82,101,116,117,114,110,32, + 78,111,110,101,32,97,115,32,97,110,32,101,120,116,101,110, + 115,105,111,110,32,109,111,100,117,108,101,32,99,97,110,110, + 111,116,32,99,114,101,97,116,101,32,97,32,99,111,100,101, + 32,111,98,106,101,99,116,46,78,114,5,0,0,0,114,219, + 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, + 0,0,114,213,0,0,0,80,4,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,0,0,0,0,2,0,0, - 0,4,0,0,0,67,0,0,0,115,26,0,0,0,116,0, - 160,1,100,1,124,0,106,2,161,2,1,0,116,0,160,3, - 124,0,124,1,161,2,83,0,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,4,114,134,0,0,0,114,149,0, - 0,0,114,15,1,0,0,114,218,0,0,0,114,219,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,220,0,0,0,185,4,0,0,115,8,0,0,0,0,7, - 6,1,4,255,4,2,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,12,114,125,0,0,0,114,124,0,0, - 0,114,126,0,0,0,114,209,0,0,0,114,207,0,0,0, - 114,36,1,0,0,114,182,0,0,0,114,229,0,0,0,114, - 213,0,0,0,114,212,0,0,0,114,217,0,0,0,114,220, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,114,35,1,0,0,157,4,0,0, - 115,18,0,0,0,8,1,8,3,2,1,10,8,8,3,8, - 3,8,3,8,3,8,3,114,35,1,0,0,99,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0, - 0,64,0,0,0,115,118,0,0,0,101,0,90,1,100,0, - 90,2,100,1,90,3,101,4,100,2,100,3,132,0,131,1, - 90,5,101,4,100,4,100,5,132,0,131,1,90,6,101,4, - 100,6,100,7,132,0,131,1,90,7,101,4,100,8,100,9, - 132,0,131,1,90,8,101,4,100,19,100,11,100,12,132,1, - 131,1,90,9,101,4,100,20,100,13,100,14,132,1,131,1, - 90,10,101,4,100,21,100,15,100,16,132,1,131,1,90,11, - 101,4,100,17,100,18,132,0,131,1,90,12,100,10,83,0, - 41,22,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,0,0,0,0,3,0,0,0,4, - 0,0,0,67,0,0,0,115,64,0,0,0,116,0,116,1, - 106,2,160,3,161,0,131,1,68,0,93,44,92,2,125,1, - 125,2,124,2,100,1,117,0,114,40,116,1,106,2,124,1, - 61,0,113,14,116,4,124,2,100,2,131,2,114,14,124,2, - 160,5,161,0,1,0,113,14,100,1,83,0,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,78,218,17, - 105,110,118,97,108,105,100,97,116,101,95,99,97,99,104,101, - 115,41,6,218,4,108,105,115,116,114,1,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,5,105,116,101,109,115,114,128,0,0,0,114, - 38,1,0,0,41,3,114,193,0,0,0,114,116,0,0,0, - 218,6,102,105,110,100,101,114,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,114,38,1,0,0,203,4,0,0, - 115,10,0,0,0,0,4,22,1,8,1,10,1,10,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,0,0,0,0,3,0,0,0,9,0, - 0,0,67,0,0,0,115,82,0,0,0,116,0,106,1,100, - 1,117,1,114,28,116,0,106,1,115,28,116,2,160,3,100, - 2,116,4,161,2,1,0,116,0,106,1,68,0,93,42,125, - 2,122,14,124,2,124,1,131,1,87,0,2,0,1,0,83, - 0,4,0,116,5,121,74,1,0,1,0,1,0,89,0,113, - 34,89,0,113,34,48,0,113,34,100,1,83,0,41,3,122, - 46,83,101,97,114,99,104,32,115,121,115,46,112,97,116,104, - 95,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,78, - 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,41,6,114,1,0,0,0, - 218,10,112,97,116,104,95,104,111,111,107,115,114,75,0,0, - 0,114,76,0,0,0,114,138,0,0,0,114,117,0,0,0, - 41,3,114,193,0,0,0,114,44,0,0,0,90,4,104,111, - 111,107,114,5,0,0,0,114,5,0,0,0,114,8,0,0, - 0,218,11,95,112,97,116,104,95,104,111,111,107,115,213,4, - 0,0,115,16,0,0,0,0,3,16,1,12,1,10,1,2, - 1,14,1,12,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,0,0,0,0,3,0,0,0, - 8,0,0,0,67,0,0,0,115,100,0,0,0,124,1,100, - 1,107,2,114,42,122,12,116,0,160,1,161,0,125,1,87, - 0,110,20,4,0,116,2,121,40,1,0,1,0,1,0,89, - 0,100,2,83,0,48,0,122,14,116,3,106,4,124,1,25, - 0,125,2,87,0,110,38,4,0,116,5,121,94,1,0,1, - 0,1,0,124,0,160,6,124,1,161,1,125,2,124,2,116, - 3,106,4,124,1,60,0,89,0,110,2,48,0,124,2,83, - 0,41,3,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,40,0,0,0,78,41,7,114, - 4,0,0,0,114,55,0,0,0,218,17,70,105,108,101,78, - 111,116,70,111,117,110,100,69,114,114,111,114,114,1,0,0, - 0,114,40,1,0,0,218,8,75,101,121,69,114,114,111,114, - 114,44,1,0,0,41,3,114,193,0,0,0,114,44,0,0, - 0,114,42,1,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,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,226,4,0,0,115, - 22,0,0,0,0,8,8,1,2,1,12,1,12,3,8,1, - 2,1,14,1,12,1,10,1,16,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,0,0,0,0,6,0,0,0,4,0,0,0, - 67,0,0,0,115,82,0,0,0,116,0,124,2,100,1,131, - 2,114,26,124,2,160,1,124,1,161,1,92,2,125,3,125, - 4,110,14,124,2,160,2,124,1,161,1,125,3,103,0,125, - 4,124,3,100,0,117,1,114,60,116,3,160,4,124,1,124, - 3,161,2,83,0,116,3,160,5,124,1,100,0,161,2,125, - 5,124,4,124,5,95,6,124,5,83,0,41,2,78,114,137, - 0,0,0,41,7,114,128,0,0,0,114,137,0,0,0,114, - 206,0,0,0,114,134,0,0,0,114,201,0,0,0,114,183, - 0,0,0,114,178,0,0,0,41,6,114,193,0,0,0,114, - 139,0,0,0,114,42,1,0,0,114,140,0,0,0,114,141, - 0,0,0,114,187,0,0,0,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,218,16,95,108,101,103,97,99,121, - 95,103,101,116,95,115,112,101,99,248,4,0,0,115,18,0, - 0,0,0,4,10,1,16,2,10,1,4,1,8,1,12,1, - 12,1,6,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,0,0,0,0,9, - 0,0,0,5,0,0,0,67,0,0,0,115,166,0,0,0, - 103,0,125,4,124,2,68,0,93,134,125,5,116,0,124,5, - 116,1,116,2,102,2,131,2,115,28,113,8,124,0,160,3, - 124,5,161,1,125,6,124,6,100,1,117,1,114,8,116,4, - 124,6,100,2,131,2,114,70,124,6,160,5,124,1,124,3, - 161,2,125,7,110,12,124,0,160,6,124,1,124,6,161,2, - 125,7,124,7,100,1,117,0,114,92,113,8,124,7,106,7, - 100,1,117,1,114,110,124,7,2,0,1,0,83,0,124,7, - 106,8,125,8,124,8,100,1,117,0,114,132,116,9,100,3, - 131,1,130,1,124,4,160,10,124,8,161,1,1,0,113,8, - 116,11,160,12,124,1,100,1,161,2,125,7,124,4,124,7, - 95,8,124,7,83,0,41,4,122,63,70,105,110,100,32,116, - 104,101,32,108,111,97,100,101,114,32,111,114,32,110,97,109, - 101,115,112,97,99,101,95,112,97,116,104,32,102,111,114,32, - 116,104,105,115,32,109,111,100,117,108,101,47,112,97,99,107, - 97,103,101,32,110,97,109,101,46,78,114,203,0,0,0,122, - 19,115,112,101,99,32,109,105,115,115,105,110,103,32,108,111, - 97,100,101,114,41,13,114,161,0,0,0,114,84,0,0,0, - 218,5,98,121,116,101,115,114,47,1,0,0,114,128,0,0, - 0,114,203,0,0,0,114,48,1,0,0,114,140,0,0,0, - 114,178,0,0,0,114,117,0,0,0,114,167,0,0,0,114, - 134,0,0,0,114,183,0,0,0,41,9,114,193,0,0,0, - 114,139,0,0,0,114,44,0,0,0,114,202,0,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,42,1,0,0,114,187,0,0,0, - 114,141,0,0,0,114,5,0,0,0,114,5,0,0,0,114, - 8,0,0,0,218,9,95,103,101,116,95,115,112,101,99,7, - 5,0,0,115,40,0,0,0,0,5,4,1,8,1,14,1, - 2,1,10,1,8,1,10,1,14,2,12,1,8,1,2,1, - 10,1,8,1,6,1,8,1,8,5,12,2,12,1,6,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,0, - 0,0,0,6,0,0,0,5,0,0,0,67,0,0,0,115, - 100,0,0,0,124,2,100,1,117,0,114,14,116,0,106,1, - 125,2,124,0,160,2,124,1,124,2,124,3,161,3,125,4, - 124,4,100,1,117,0,114,40,100,1,83,0,124,4,106,3, - 100,1,117,0,114,92,124,4,106,4,125,5,124,5,114,86, - 100,1,124,4,95,5,116,6,124,1,124,5,124,0,106,2, - 131,3,124,4,95,4,124,4,83,0,100,1,83,0,110,4, - 124,4,83,0,100,1,83,0,41,2,122,141,84,114,121,32, - 116,111,32,102,105,110,100,32,97,32,115,112,101,99,32,102, - 111,114,32,39,102,117,108,108,110,97,109,101,39,32,111,110, - 32,115,121,115,46,112,97,116,104,32,111,114,32,39,112,97, - 116,104,39,46,10,10,32,32,32,32,32,32,32,32,84,104, - 101,32,115,101,97,114,99,104,32,105,115,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,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,32,32,32,32,32,32,32,32,78,41,7,114,1,0,0, - 0,114,44,0,0,0,114,51,1,0,0,114,140,0,0,0, - 114,178,0,0,0,114,181,0,0,0,114,13,1,0,0,41, - 6,114,193,0,0,0,114,139,0,0,0,114,44,0,0,0, - 114,202,0,0,0,114,187,0,0,0,114,50,1,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,203, - 0,0,0,39,5,0,0,115,26,0,0,0,0,6,8,1, - 6,1,14,1,8,1,4,1,10,1,6,1,4,3,6,1, - 16,1,4,2,6,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,0,0,0,0,4,0,0,0,4,0,0, - 0,67,0,0,0,115,30,0,0,0,124,0,160,0,124,1, - 124,2,161,2,125,3,124,3,100,1,117,0,114,24,100,1, - 83,0,124,3,106,1,83,0,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,114,204,0,0,0,114,205,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,206,0,0,0,63,5,0,0,115,8,0,0,0,0,8, - 12,1,8,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,99,1, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,4, - 0,0,0,79,0,0,0,115,28,0,0,0,100,1,100,2, - 108,0,109,1,125,3,1,0,124,3,106,2,124,1,105,0, - 124,2,164,1,142,1,83,0,41,3,97,32,1,0,0,10, - 32,32,32,32,32,32,32,32,70,105,110,100,32,100,105,115, - 116,114,105,98,117,116,105,111,110,115,46,10,10,32,32,32, - 32,32,32,32,32,82,101,116,117,114,110,32,97,110,32,105, - 116,101,114,97,98,108,101,32,111,102,32,97,108,108,32,68, - 105,115,116,114,105,98,117,116,105,111,110,32,105,110,115,116, - 97,110,99,101,115,32,99,97,112,97,98,108,101,32,111,102, - 10,32,32,32,32,32,32,32,32,108,111,97,100,105,110,103, - 32,116,104,101,32,109,101,116,97,100,97,116,97,32,102,111, - 114,32,112,97,99,107,97,103,101,115,32,109,97,116,99,104, - 105,110,103,32,96,96,99,111,110,116,101,120,116,46,110,97, - 109,101,96,96,10,32,32,32,32,32,32,32,32,40,111,114, - 32,97,108,108,32,110,97,109,101,115,32,105,102,32,96,96, - 78,111,110,101,96,96,32,105,110,100,105,99,97,116,101,100, - 41,32,97,108,111,110,103,32,116,104,101,32,112,97,116,104, - 115,32,105,110,32,116,104,101,32,108,105,115,116,10,32,32, - 32,32,32,32,32,32,111,102,32,100,105,114,101,99,116,111, - 114,105,101,115,32,96,96,99,111,110,116,101,120,116,46,112, - 97,116,104,96,96,46,10,32,32,32,32,32,32,32,32,114, - 73,0,0,0,41,1,218,18,77,101,116,97,100,97,116,97, - 80,97,116,104,70,105,110,100,101,114,41,3,90,18,105,109, - 112,111,114,116,108,105,98,46,109,101,116,97,100,97,116,97, - 114,52,1,0,0,218,18,102,105,110,100,95,100,105,115,116, - 114,105,98,117,116,105,111,110,115,41,4,114,193,0,0,0, - 114,119,0,0,0,114,120,0,0,0,114,52,1,0,0,114, - 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,53, - 1,0,0,76,5,0,0,115,4,0,0,0,0,10,12,1, - 122,29,80,97,116,104,70,105,110,100,101,114,46,102,105,110, - 100,95,100,105,115,116,114,105,98,117,116,105,111,110,115,41, - 1,78,41,2,78,78,41,1,78,41,13,114,125,0,0,0, - 114,124,0,0,0,114,126,0,0,0,114,127,0,0,0,114, - 207,0,0,0,114,38,1,0,0,114,44,1,0,0,114,47, - 1,0,0,114,48,1,0,0,114,51,1,0,0,114,203,0, - 0,0,114,206,0,0,0,114,53,1,0,0,114,5,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,37,1,0,0,199,4,0,0,115,34,0,0,0,8,2, - 4,2,2,1,10,9,2,1,10,12,2,1,10,21,2,1, - 10,14,2,1,12,31,2,1,12,23,2,1,12,12,2,1, - 114,37,1,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,64,0,0,0,115,90, - 0,0,0,101,0,90,1,100,0,90,2,100,1,90,3,100, - 2,100,3,132,0,90,4,100,4,100,5,132,0,90,5,101, - 6,90,7,100,6,100,7,132,0,90,8,100,8,100,9,132, - 0,90,9,100,19,100,11,100,12,132,1,90,10,100,13,100, - 14,132,0,90,11,101,12,100,15,100,16,132,0,131,1,90, - 13,100,17,100,18,132,0,90,14,100,10,83,0,41,20,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,0,0,0,0,5,0,0,0,6,0,0,0,7,0, - 0,0,115,84,0,0,0,103,0,125,3,124,2,68,0,93, - 32,92,2,137,0,125,4,124,3,160,0,135,0,102,1,100, - 1,100,2,132,8,124,4,68,0,131,1,161,1,1,0,113, - 8,124,3,124,0,95,1,124,1,112,54,100,3,124,0,95, - 2,100,4,124,0,95,3,116,4,131,0,124,0,95,5,116, - 4,131,0,124,0,95,6,100,5,83,0,41,6,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,0,0,0,0,2,0,0,0,3,0,0,0,51,0, - 0,0,115,22,0,0,0,124,0,93,14,125,1,124,1,136, - 0,102,2,86,0,1,0,113,2,100,0,83,0,114,109,0, - 0,0,114,5,0,0,0,114,7,1,0,0,169,1,114,140, - 0,0,0,114,5,0,0,0,114,8,0,0,0,114,10,1, - 0,0,105,5,0,0,243,0,0,0,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,71,0,0,0,114,104,0,0,0,78,41,7, - 114,167,0,0,0,218,8,95,108,111,97,100,101,114,115,114, - 44,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,118,0,0,0,114, - 44,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,189,0, - 0,0,114,5,0,0,0,114,55,1,0,0,114,8,0,0, - 0,114,209,0,0,0,99,5,0,0,115,16,0,0,0,0, - 4,4,1,12,1,26,1,6,2,10,1,6,1,8,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,0,0,0, - 0,1,0,0,0,2,0,0,0,67,0,0,0,115,10,0, - 0,0,100,1,124,0,95,0,100,2,83,0,41,3,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, - 104,0,0,0,78,41,1,114,58,1,0,0,114,246,0,0, + 0,1,0,0,0,67,0,0,0,115,4,0,0,0,100,1, + 83,0,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,5,0,0, + 0,114,219,0,0,0,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,114,229,0,0,0,84,4,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,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,6, + 0,0,0,124,0,106,0,83,0,114,250,0,0,0,114,48, + 0,0,0,114,219,0,0,0,114,5,0,0,0,114,5,0, + 0,0,114,8,0,0,0,114,179,0,0,0,88,4,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,14,114,125,0,0, + 0,114,124,0,0,0,114,126,0,0,0,114,127,0,0,0, + 114,209,0,0,0,114,243,0,0,0,114,247,0,0,0,114, + 212,0,0,0,114,217,0,0,0,114,182,0,0,0,114,213, + 0,0,0,114,229,0,0,0,114,136,0,0,0,114,179,0, + 0,0,114,5,0,0,0,114,5,0,0,0,114,5,0,0, + 0,114,8,0,0,0,114,252,0,0,0,41,4,0,0,115, + 22,0,0,0,8,2,4,6,8,4,8,4,8,3,8,8, + 8,6,8,6,8,4,8,4,2,1,114,252,0,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 2,0,0,0,64,0,0,0,115,104,0,0,0,101,0,90, + 1,100,0,90,2,100,1,90,3,100,2,100,3,132,0,90, + 4,100,4,100,5,132,0,90,5,100,6,100,7,132,0,90, + 6,100,8,100,9,132,0,90,7,100,10,100,11,132,0,90, + 8,100,12,100,13,132,0,90,9,100,14,100,15,132,0,90, + 10,100,16,100,17,132,0,90,11,100,18,100,19,132,0,90, + 12,100,20,100,21,132,0,90,13,100,22,100,23,132,0,90, + 14,100,24,83,0,41,25,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,0,0,0,0,4, + 0,0,0,3,0,0,0,67,0,0,0,115,36,0,0,0, + 124,1,124,0,95,0,124,2,124,0,95,1,116,2,124,0, + 160,3,161,0,131,1,124,0,95,4,124,3,124,0,95,5, + 100,0,83,0,114,109,0,0,0,41,6,218,5,95,110,97, + 109,101,218,5,95,112,97,116,104,114,111,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,169,4,114,118,0,0,0,114,116,0,0,0,114,44,0, + 0,0,90,11,112,97,116,104,95,102,105,110,100,101,114,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,209, + 0,0,0,101,4,0,0,115,8,0,0,0,0,1,6,1, + 6,1,14,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,0,0,0,0,4,0,0,0,3,0, + 0,0,67,0,0,0,115,38,0,0,0,124,0,106,0,160, + 1,100,1,161,1,92,3,125,1,125,2,125,3,124,2,100, + 2,107,2,114,30,100,3,83,0,124,1,100,4,102,2,83, + 0,41,5,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,71,0,0,0,114,40,0,0,0,41,2,114, + 1,0,0,0,114,44,0,0,0,90,8,95,95,112,97,116, + 104,95,95,41,2,114,14,1,0,0,114,41,0,0,0,41, + 4,114,118,0,0,0,114,4,1,0,0,218,3,100,111,116, + 90,2,109,101,114,5,0,0,0,114,5,0,0,0,114,8, + 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,107,4,0,0, + 115,8,0,0,0,0,2,18,1,8,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,0,0, + 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,28, + 0,0,0,124,0,160,0,161,0,92,2,125,1,125,2,116, + 1,116,2,106,3,124,1,25,0,124,2,131,2,83,0,114, + 109,0,0,0,41,4,114,21,1,0,0,114,130,0,0,0, + 114,1,0,0,0,218,7,109,111,100,117,108,101,115,41,3, + 114,118,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,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,16,1,0,0,117,4,0, + 0,115,4,0,0,0,0,1,12,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,0,0,0,0,3,0,0,0,4,0,0,0, + 67,0,0,0,115,80,0,0,0,116,0,124,0,160,1,161, + 0,131,1,125,1,124,1,124,0,106,2,107,3,114,74,124, + 0,160,3,124,0,106,4,124,1,161,2,125,2,124,2,100, + 0,117,1,114,68,124,2,106,5,100,0,117,0,114,68,124, + 2,106,6,114,68,124,2,106,6,124,0,95,7,124,1,124, + 0,95,2,124,0,106,7,83,0,114,109,0,0,0,41,8, + 114,111,0,0,0,114,16,1,0,0,114,17,1,0,0,114, + 18,1,0,0,114,14,1,0,0,114,140,0,0,0,114,178, + 0,0,0,114,15,1,0,0,41,3,114,118,0,0,0,90, + 11,112,97,114,101,110,116,95,112,97,116,104,114,187,0,0, 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,38,1,0,0,113,5,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,0,0,0,0,3,0,0,0,3, - 0,0,0,67,0,0,0,115,42,0,0,0,124,0,160,0, - 124,1,161,1,125,2,124,2,100,1,117,0,114,26,100,1, - 103,0,102,2,83,0,124,2,106,1,124,2,106,2,112,38, - 103,0,102,2,83,0,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,203,0,0,0,114,140,0,0,0,114,178,0,0, - 0,41,3,114,118,0,0,0,114,139,0,0,0,114,187,0, + 218,12,95,114,101,99,97,108,99,117,108,97,116,101,121,4, + 0,0,115,16,0,0,0,0,2,12,1,10,1,14,3,18, + 1,6,1,8,1,6,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,0,0,0, + 0,1,0,0,0,3,0,0,0,67,0,0,0,115,12,0, + 0,0,116,0,124,0,160,1,161,0,131,1,83,0,114,109, + 0,0,0,41,2,218,4,105,116,101,114,114,23,1,0,0, + 114,246,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,218,8,95,95,105,116,101,114,95,95,134,4, + 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,2,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,2,0,0,0,67,0,0,0,115,12,0,0,0, + 124,0,160,0,161,0,124,1,25,0,83,0,114,109,0,0, + 0,169,1,114,23,1,0,0,41,2,114,118,0,0,0,218, + 5,105,110,100,101,120,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,218,11,95,95,103,101,116,105,116,101,109, + 95,95,137,4,0,0,115,2,0,0,0,0,1,122,26,95, + 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95, + 103,101,116,105,116,101,109,95,95,99,3,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,3,0,0,0,67,0, + 0,0,115,14,0,0,0,124,2,124,0,106,0,124,1,60, + 0,100,0,83,0,114,109,0,0,0,41,1,114,15,1,0, + 0,41,3,114,118,0,0,0,114,27,1,0,0,114,44,0, 0,0,114,5,0,0,0,114,5,0,0,0,114,8,0,0, - 0,114,137,0,0,0,119,5,0,0,115,8,0,0,0,0, - 7,10,1,8,1,8,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,0,0,0,0,7,0,0,0, - 6,0,0,0,67,0,0,0,115,26,0,0,0,124,1,124, - 2,124,3,131,2,125,6,116,0,124,2,124,3,124,6,124, - 4,100,1,141,4,83,0,41,2,78,114,177,0,0,0,41, - 1,114,190,0,0,0,41,7,114,118,0,0,0,114,188,0, - 0,0,114,139,0,0,0,114,44,0,0,0,90,4,115,109, - 115,108,114,202,0,0,0,114,140,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,114,51,1,0,0, - 131,5,0,0,115,8,0,0,0,0,1,10,1,8,1,2, - 255,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,0,0,0,0,14,0,0,0,8,0,0,0,67,0,0, - 0,115,96,1,0,0,100,1,125,3,124,1,160,0,100,2, - 161,1,100,3,25,0,125,4,122,24,116,1,124,0,106,2, - 112,34,116,3,160,4,161,0,131,1,106,5,125,5,87,0, - 110,22,4,0,116,6,121,64,1,0,1,0,1,0,100,4, - 125,5,89,0,110,2,48,0,124,5,124,0,106,7,107,3, - 114,90,124,0,160,8,161,0,1,0,124,5,124,0,95,7, - 116,9,131,0,114,112,124,0,106,10,125,6,124,4,160,11, - 161,0,125,7,110,10,124,0,106,12,125,6,124,4,125,7, - 124,7,124,6,118,0,114,216,116,13,124,0,106,2,124,4, - 131,2,125,8,124,0,106,14,68,0,93,58,92,2,125,9, - 125,10,100,5,124,9,23,0,125,11,116,13,124,8,124,11, - 131,2,125,12,116,15,124,12,131,1,114,148,124,0,160,16, - 124,10,124,1,124,12,124,8,103,1,124,2,161,5,2,0, - 1,0,83,0,113,148,116,17,124,8,131,1,125,3,124,0, - 106,14,68,0,93,82,92,2,125,9,125,10,116,13,124,0, - 106,2,124,4,124,9,23,0,131,2,125,12,116,18,106,19, - 100,6,124,12,100,3,100,7,141,3,1,0,124,7,124,9, - 23,0,124,6,118,0,114,222,116,15,124,12,131,1,114,222, - 124,0,160,16,124,10,124,1,124,12,100,8,124,2,161,5, - 2,0,1,0,83,0,113,222,124,3,144,1,114,92,116,18, - 160,19,100,9,124,8,161,2,1,0,116,18,160,20,124,1, - 100,8,161,2,125,13,124,8,103,1,124,13,95,21,124,13, - 83,0,100,8,83,0,41,10,122,111,84,114,121,32,116,111, + 0,218,11,95,95,115,101,116,105,116,101,109,95,95,140,4, + 0,0,115,2,0,0,0,0,1,122,26,95,78,97,109,101, + 115,112,97,99,101,80,97,116,104,46,95,95,115,101,116,105, + 116,101,109,95,95,99,1,0,0,0,0,0,0,0,0,0, + 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,12, + 0,0,0,116,0,124,0,160,1,161,0,131,1,83,0,114, + 109,0,0,0,41,2,114,23,0,0,0,114,23,1,0,0, + 114,246,0,0,0,114,5,0,0,0,114,5,0,0,0,114, + 8,0,0,0,218,7,95,95,108,101,110,95,95,143,4,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,0,0,0,0,1,0,0, + 0,3,0,0,0,67,0,0,0,115,12,0,0,0,100,1, + 160,0,124,0,106,1,161,1,83,0,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,62,0,0,0,114,15,1,0,0,114, + 246,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,218,8,95,95,114,101,112,114,95,95,146,4,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,0,0,0,0,2,0, + 0,0,3,0,0,0,67,0,0,0,115,12,0,0,0,124, + 1,124,0,160,0,161,0,118,0,83,0,114,109,0,0,0, + 114,26,1,0,0,169,2,114,118,0,0,0,218,4,105,116, + 101,109,114,5,0,0,0,114,5,0,0,0,114,8,0,0, + 0,218,12,95,95,99,111,110,116,97,105,110,115,95,95,149, + 4,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, + 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, + 115,16,0,0,0,124,0,106,0,160,1,124,1,161,1,1, + 0,100,0,83,0,114,109,0,0,0,41,2,114,15,1,0, + 0,114,186,0,0,0,114,32,1,0,0,114,5,0,0,0, + 114,5,0,0,0,114,8,0,0,0,114,186,0,0,0,152, + 4,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,15,114,125,0,0,0,114,124,0,0,0,114,126, + 0,0,0,114,127,0,0,0,114,209,0,0,0,114,21,1, + 0,0,114,16,1,0,0,114,23,1,0,0,114,25,1,0, + 0,114,28,1,0,0,114,29,1,0,0,114,30,1,0,0, + 114,31,1,0,0,114,34,1,0,0,114,186,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,114,13,1,0,0,94,4,0,0,115,24,0,0, + 0,8,1,4,6,8,6,8,10,8,4,8,13,8,3,8, + 3,8,3,8,3,8,3,8,3,114,13,1,0,0,99,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3, + 0,0,0,64,0,0,0,115,80,0,0,0,101,0,90,1, + 100,0,90,2,100,1,100,2,132,0,90,3,101,4,100,3, + 100,4,132,0,131,1,90,5,100,5,100,6,132,0,90,6, + 100,7,100,8,132,0,90,7,100,9,100,10,132,0,90,8, + 100,11,100,12,132,0,90,9,100,13,100,14,132,0,90,10, + 100,15,100,16,132,0,90,11,100,17,83,0,41,18,218,16, + 95,78,97,109,101,115,112,97,99,101,76,111,97,100,101,114, + 99,4,0,0,0,0,0,0,0,0,0,0,0,4,0,0, + 0,4,0,0,0,67,0,0,0,115,18,0,0,0,116,0, + 124,1,124,2,124,3,131,3,124,0,95,1,100,0,83,0, + 114,109,0,0,0,41,2,114,13,1,0,0,114,15,1,0, + 0,114,19,1,0,0,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,114,209,0,0,0,158,4,0,0,115,2, + 0,0,0,0,1,122,25,95,78,97,109,101,115,112,97,99, + 101,76,111,97,100,101,114,46,95,95,105,110,105,116,95,95, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,3,0,0,0,67,0,0,0,115,12,0,0,0,100,1, + 160,0,124,1,106,1,161,1,83,0,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,62, + 0,0,0,114,125,0,0,0,41,2,114,193,0,0,0,114, + 216,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, + 0,0,0,218,11,109,111,100,117,108,101,95,114,101,112,114, + 161,4,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,0,0,0,0,2,0,0,0,1,0,0,0,67,0, + 0,0,115,4,0,0,0,100,1,83,0,41,2,78,84,114, + 5,0,0,0,114,219,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,182,0,0,0,170,4,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,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, + 0,0,0,100,1,83,0,41,2,78,114,40,0,0,0,114, + 5,0,0,0,114,219,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,229,0,0,0,173,4,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,0,0, + 0,0,2,0,0,0,6,0,0,0,67,0,0,0,115,16, + 0,0,0,116,0,100,1,100,2,100,3,100,4,100,5,141, + 4,83,0,41,6,78,114,40,0,0,0,122,8,60,115,116, + 114,105,110,103,62,114,215,0,0,0,84,41,1,114,231,0, + 0,0,41,1,114,232,0,0,0,114,219,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,213,0, + 0,0,176,4,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,0,0,0,0,2,0,0,0,1,0,0,0,67,0,0, + 0,115,4,0,0,0,100,1,83,0,114,210,0,0,0,114, + 5,0,0,0,114,211,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,212,0,0,0,179,4,0, + 0,115,2,0,0,0,0,1,122,30,95,78,97,109,101,115, + 112,97,99,101,76,111,97,100,101,114,46,99,114,101,97,116, + 101,95,109,111,100,117,108,101,99,2,0,0,0,0,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,83,0,114,109,0,0,0,114, + 5,0,0,0,114,6,1,0,0,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,217,0,0,0,182,4,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,0, + 0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,115, + 26,0,0,0,116,0,160,1,100,1,124,0,106,2,161,2, + 1,0,116,0,160,3,124,0,124,1,161,2,83,0,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,4,114,134, + 0,0,0,114,149,0,0,0,114,15,1,0,0,114,218,0, + 0,0,114,219,0,0,0,114,5,0,0,0,114,5,0,0, + 0,114,8,0,0,0,114,220,0,0,0,185,4,0,0,115, + 8,0,0,0,0,7,6,1,4,255,4,2,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,12,114,125,0, + 0,0,114,124,0,0,0,114,126,0,0,0,114,209,0,0, + 0,114,207,0,0,0,114,36,1,0,0,114,182,0,0,0, + 114,229,0,0,0,114,213,0,0,0,114,212,0,0,0,114, + 217,0,0,0,114,220,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,35,1, + 0,0,157,4,0,0,115,18,0,0,0,8,1,8,3,2, + 1,10,8,8,3,8,3,8,3,8,3,8,3,114,35,1, + 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,4,0,0,0,64,0,0,0,115,118,0,0,0, + 101,0,90,1,100,0,90,2,100,1,90,3,101,4,100,2, + 100,3,132,0,131,1,90,5,101,4,100,4,100,5,132,0, + 131,1,90,6,101,4,100,6,100,7,132,0,131,1,90,7, + 101,4,100,8,100,9,132,0,131,1,90,8,101,4,100,19, + 100,11,100,12,132,1,131,1,90,9,101,4,100,20,100,13, + 100,14,132,1,131,1,90,10,101,4,100,21,100,15,100,16, + 132,1,131,1,90,11,101,4,100,17,100,18,132,0,131,1, + 90,12,100,10,83,0,41,22,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,0,0,0, + 0,3,0,0,0,4,0,0,0,67,0,0,0,115,64,0, + 0,0,116,0,116,1,106,2,160,3,161,0,131,1,68,0, + 93,44,92,2,125,1,125,2,124,2,100,1,117,0,114,40, + 116,1,106,2,124,1,61,0,113,14,116,4,124,2,100,2, + 131,2,114,14,124,2,160,5,161,0,1,0,113,14,100,1, + 83,0,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,78,218,17,105,110,118,97,108,105,100,97,116,101, + 95,99,97,99,104,101,115,41,6,218,4,108,105,115,116,114, + 1,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,5,105,116,101,109,115, + 114,128,0,0,0,114,38,1,0,0,41,3,114,193,0,0, + 0,114,116,0,0,0,218,6,102,105,110,100,101,114,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,38,1, + 0,0,203,4,0,0,115,10,0,0,0,0,4,22,1,8, + 1,10,1,10,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,0,0,0,0, + 3,0,0,0,9,0,0,0,67,0,0,0,115,80,0,0, + 0,116,0,106,1,100,1,117,1,114,28,116,0,106,1,115, + 28,116,2,160,3,100,2,116,4,161,2,1,0,116,0,106, + 1,68,0,93,40,125,2,122,14,124,2,124,1,131,1,87, + 0,2,0,1,0,83,0,4,0,116,5,121,74,1,0,1, + 0,1,0,89,0,113,34,89,0,113,34,48,0,100,1,83, + 0,41,3,122,46,83,101,97,114,99,104,32,115,121,115,46, + 112,97,116,104,95,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,78,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,41,6,114, + 1,0,0,0,218,10,112,97,116,104,95,104,111,111,107,115, + 114,75,0,0,0,114,76,0,0,0,114,138,0,0,0,114, + 117,0,0,0,41,3,114,193,0,0,0,114,44,0,0,0, + 90,4,104,111,111,107,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,218,11,95,112,97,116,104,95,104,111,111, + 107,115,213,4,0,0,115,16,0,0,0,0,3,16,1,12, + 1,10,1,2,1,14,1,12,1,10,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,0,0,0,0, + 3,0,0,0,8,0,0,0,67,0,0,0,115,100,0,0, + 0,124,1,100,1,107,2,114,42,122,12,116,0,160,1,161, + 0,125,1,87,0,110,20,4,0,116,2,121,40,1,0,1, + 0,1,0,89,0,100,2,83,0,48,0,122,14,116,3,106, + 4,124,1,25,0,125,2,87,0,110,38,4,0,116,5,121, + 94,1,0,1,0,1,0,124,0,160,6,124,1,161,1,125, + 2,124,2,116,3,106,4,124,1,60,0,89,0,110,2,48, + 0,124,2,83,0,41,3,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,40,0,0,0, + 78,41,7,114,4,0,0,0,114,55,0,0,0,218,17,70, + 105,108,101,78,111,116,70,111,117,110,100,69,114,114,111,114, + 114,1,0,0,0,114,40,1,0,0,218,8,75,101,121,69, + 114,114,111,114,114,44,1,0,0,41,3,114,193,0,0,0, + 114,44,0,0,0,114,42,1,0,0,114,5,0,0,0,114, + 5,0,0,0,114,8,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,226, + 4,0,0,115,22,0,0,0,0,8,8,1,2,1,12,1, + 12,3,8,1,2,1,14,1,12,1,10,1,16,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,0,0,0,0,6,0,0,0, + 4,0,0,0,67,0,0,0,115,82,0,0,0,116,0,124, + 2,100,1,131,2,114,26,124,2,160,1,124,1,161,1,92, + 2,125,3,125,4,110,14,124,2,160,2,124,1,161,1,125, + 3,103,0,125,4,124,3,100,0,117,1,114,60,116,3,160, + 4,124,1,124,3,161,2,83,0,116,3,160,5,124,1,100, + 0,161,2,125,5,124,4,124,5,95,6,124,5,83,0,41, + 2,78,114,137,0,0,0,41,7,114,128,0,0,0,114,137, + 0,0,0,114,206,0,0,0,114,134,0,0,0,114,201,0, + 0,0,114,183,0,0,0,114,178,0,0,0,41,6,114,193, + 0,0,0,114,139,0,0,0,114,42,1,0,0,114,140,0, + 0,0,114,141,0,0,0,114,187,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,8,0,0,0,218,16,95,108,101, + 103,97,99,121,95,103,101,116,95,115,112,101,99,248,4,0, + 0,115,18,0,0,0,0,4,10,1,16,2,10,1,4,1, + 8,1,12,1,12,1,6,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,0, + 0,0,0,9,0,0,0,5,0,0,0,67,0,0,0,115, + 166,0,0,0,103,0,125,4,124,2,68,0,93,134,125,5, + 116,0,124,5,116,1,116,2,102,2,131,2,115,28,113,8, + 124,0,160,3,124,5,161,1,125,6,124,6,100,1,117,1, + 114,8,116,4,124,6,100,2,131,2,114,70,124,6,160,5, + 124,1,124,3,161,2,125,7,110,12,124,0,160,6,124,1, + 124,6,161,2,125,7,124,7,100,1,117,0,114,92,113,8, + 124,7,106,7,100,1,117,1,114,110,124,7,2,0,1,0, + 83,0,124,7,106,8,125,8,124,8,100,1,117,0,114,132, + 116,9,100,3,131,1,130,1,124,4,160,10,124,8,161,1, + 1,0,113,8,116,11,160,12,124,1,100,1,161,2,125,7, + 124,4,124,7,95,8,124,7,83,0,41,4,122,63,70,105, + 110,100,32,116,104,101,32,108,111,97,100,101,114,32,111,114, + 32,110,97,109,101,115,112,97,99,101,95,112,97,116,104,32, + 102,111,114,32,116,104,105,115,32,109,111,100,117,108,101,47, + 112,97,99,107,97,103,101,32,110,97,109,101,46,78,114,203, + 0,0,0,122,19,115,112,101,99,32,109,105,115,115,105,110, + 103,32,108,111,97,100,101,114,41,13,114,161,0,0,0,114, + 84,0,0,0,218,5,98,121,116,101,115,114,47,1,0,0, + 114,128,0,0,0,114,203,0,0,0,114,48,1,0,0,114, + 140,0,0,0,114,178,0,0,0,114,117,0,0,0,114,167, + 0,0,0,114,134,0,0,0,114,183,0,0,0,41,9,114, + 193,0,0,0,114,139,0,0,0,114,44,0,0,0,114,202, + 0,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,42,1,0,0,114, + 187,0,0,0,114,141,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,218,9,95,103,101,116,95,115, + 112,101,99,7,5,0,0,115,40,0,0,0,0,5,4,1, + 8,1,14,1,2,1,10,1,8,1,10,1,14,2,12,1, + 8,1,2,1,10,1,8,1,6,1,8,1,8,5,12,2, + 12,1,6,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,0,0,0,0,6,0,0,0,5,0,0,0,67, + 0,0,0,115,94,0,0,0,124,2,100,1,117,0,114,14, + 116,0,106,1,125,2,124,0,160,2,124,1,124,2,124,3, + 161,3,125,4,124,4,100,1,117,0,114,40,100,1,83,0, + 124,4,106,3,100,1,117,0,114,90,124,4,106,4,125,5, + 124,5,114,86,100,1,124,4,95,5,116,6,124,1,124,5, + 124,0,106,2,131,3,124,4,95,4,124,4,83,0,100,1, + 83,0,124,4,83,0,41,2,122,141,84,114,121,32,116,111, 32,102,105,110,100,32,97,32,115,112,101,99,32,102,111,114, + 32,39,102,117,108,108,110,97,109,101,39,32,111,110,32,115, + 121,115,46,112,97,116,104,32,111,114,32,39,112,97,116,104, + 39,46,10,10,32,32,32,32,32,32,32,32,84,104,101,32, + 115,101,97,114,99,104,32,105,115,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,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,32, + 32,32,32,32,32,32,32,78,41,7,114,1,0,0,0,114, + 44,0,0,0,114,51,1,0,0,114,140,0,0,0,114,178, + 0,0,0,114,181,0,0,0,114,13,1,0,0,41,6,114, + 193,0,0,0,114,139,0,0,0,114,44,0,0,0,114,202, + 0,0,0,114,187,0,0,0,114,50,1,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,114,203,0,0, + 0,39,5,0,0,115,26,0,0,0,0,6,8,1,6,1, + 14,1,8,1,4,1,10,1,6,1,4,3,6,1,16,1, + 4,2,4,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,0,0,0,0,4,0,0,0,4,0,0,0,67, + 0,0,0,115,30,0,0,0,124,0,160,0,124,1,124,2, + 161,2,125,3,124,3,100,1,117,0,114,24,100,1,83,0, + 124,3,106,1,83,0,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,114,204,0,0,0,114,205,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,206, + 0,0,0,63,5,0,0,115,8,0,0,0,0,8,12,1, + 8,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,99,1,0,0, + 0,0,0,0,0,0,0,0,0,4,0,0,0,4,0,0, + 0,79,0,0,0,115,28,0,0,0,100,1,100,2,108,0, + 109,1,125,3,1,0,124,3,106,2,124,1,105,0,124,2, + 164,1,142,1,83,0,41,3,97,32,1,0,0,10,32,32, + 32,32,32,32,32,32,70,105,110,100,32,100,105,115,116,114, + 105,98,117,116,105,111,110,115,46,10,10,32,32,32,32,32, + 32,32,32,82,101,116,117,114,110,32,97,110,32,105,116,101, + 114,97,98,108,101,32,111,102,32,97,108,108,32,68,105,115, + 116,114,105,98,117,116,105,111,110,32,105,110,115,116,97,110, + 99,101,115,32,99,97,112,97,98,108,101,32,111,102,10,32, + 32,32,32,32,32,32,32,108,111,97,100,105,110,103,32,116, + 104,101,32,109,101,116,97,100,97,116,97,32,102,111,114,32, + 112,97,99,107,97,103,101,115,32,109,97,116,99,104,105,110, + 103,32,96,96,99,111,110,116,101,120,116,46,110,97,109,101, + 96,96,10,32,32,32,32,32,32,32,32,40,111,114,32,97, + 108,108,32,110,97,109,101,115,32,105,102,32,96,96,78,111, + 110,101,96,96,32,105,110,100,105,99,97,116,101,100,41,32, + 97,108,111,110,103,32,116,104,101,32,112,97,116,104,115,32, + 105,110,32,116,104,101,32,108,105,115,116,10,32,32,32,32, + 32,32,32,32,111,102,32,100,105,114,101,99,116,111,114,105, + 101,115,32,96,96,99,111,110,116,101,120,116,46,112,97,116, + 104,96,96,46,10,32,32,32,32,32,32,32,32,114,73,0, + 0,0,41,1,218,18,77,101,116,97,100,97,116,97,80,97, + 116,104,70,105,110,100,101,114,41,3,90,18,105,109,112,111, + 114,116,108,105,98,46,109,101,116,97,100,97,116,97,114,52, + 1,0,0,218,18,102,105,110,100,95,100,105,115,116,114,105, + 98,117,116,105,111,110,115,41,4,114,193,0,0,0,114,119, + 0,0,0,114,120,0,0,0,114,52,1,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,114,53,1,0, + 0,76,5,0,0,115,4,0,0,0,0,10,12,1,122,29, + 80,97,116,104,70,105,110,100,101,114,46,102,105,110,100,95, + 100,105,115,116,114,105,98,117,116,105,111,110,115,41,1,78, + 41,2,78,78,41,1,78,41,13,114,125,0,0,0,114,124, + 0,0,0,114,126,0,0,0,114,127,0,0,0,114,207,0, + 0,0,114,38,1,0,0,114,44,1,0,0,114,47,1,0, + 0,114,48,1,0,0,114,51,1,0,0,114,203,0,0,0, + 114,206,0,0,0,114,53,1,0,0,114,5,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,37, + 1,0,0,199,4,0,0,115,34,0,0,0,8,2,4,2, + 2,1,10,9,2,1,10,12,2,1,10,21,2,1,10,14, + 2,1,12,31,2,1,12,23,2,1,12,12,2,1,114,37, + 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,3,0,0,0,64,0,0,0,115,90,0,0, + 0,101,0,90,1,100,0,90,2,100,1,90,3,100,2,100, + 3,132,0,90,4,100,4,100,5,132,0,90,5,101,6,90, + 7,100,6,100,7,132,0,90,8,100,8,100,9,132,0,90, + 9,100,19,100,11,100,12,132,1,90,10,100,13,100,14,132, + 0,90,11,101,12,100,15,100,16,132,0,131,1,90,13,100, + 17,100,18,132,0,90,14,100,10,83,0,41,20,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, + 0,0,0,0,5,0,0,0,6,0,0,0,7,0,0,0, + 115,84,0,0,0,103,0,125,3,124,2,68,0,93,32,92, + 2,137,0,125,4,124,3,160,0,135,0,102,1,100,1,100, + 2,132,8,124,4,68,0,131,1,161,1,1,0,113,8,124, + 3,124,0,95,1,124,1,112,54,100,3,124,0,95,2,100, + 4,124,0,95,3,116,4,131,0,124,0,95,5,116,4,131, + 0,124,0,95,6,100,5,83,0,41,6,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, + 0,0,0,0,2,0,0,0,3,0,0,0,51,0,0,0, + 115,22,0,0,0,124,0,93,14,125,1,124,1,136,0,102, + 2,86,0,1,0,113,2,100,0,83,0,114,109,0,0,0, + 114,5,0,0,0,114,7,1,0,0,169,1,114,140,0,0, + 0,114,5,0,0,0,114,8,0,0,0,114,10,1,0,0, + 105,5,0,0,243,0,0,0,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,71,0,0,0,114,104,0,0,0,78,41,7,114,167, + 0,0,0,218,8,95,108,111,97,100,101,114,115,114,44,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,118,0,0,0,114,44,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,189,0,0,0, + 114,5,0,0,0,114,55,1,0,0,114,8,0,0,0,114, + 209,0,0,0,99,5,0,0,115,16,0,0,0,0,4,4, + 1,12,1,26,1,6,2,10,1,6,1,8,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,0,0,0,0,1, + 0,0,0,2,0,0,0,67,0,0,0,115,10,0,0,0, + 100,1,124,0,95,0,100,2,83,0,41,3,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,104,0, + 0,0,78,41,1,114,58,1,0,0,114,246,0,0,0,114, + 5,0,0,0,114,5,0,0,0,114,8,0,0,0,114,38, + 1,0,0,113,5,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,0,0,0,0,3,0,0,0,3,0,0, + 0,67,0,0,0,115,42,0,0,0,124,0,160,0,124,1, + 161,1,125,2,124,2,100,1,117,0,114,26,100,1,103,0, + 102,2,83,0,124,2,106,1,124,2,106,2,112,38,103,0, + 102,2,83,0,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,46,10,10,32,32,32,32,32,32,32,32, - 82,101,116,117,114,110,115,32,116,104,101,32,109,97,116,99, - 104,105,110,103,32,115,112,101,99,44,32,111,114,32,78,111, - 110,101,32,105,102,32,110,111,116,32,102,111,117,110,100,46, - 10,32,32,32,32,32,32,32,32,70,114,71,0,0,0,114, - 28,0,0,0,114,104,0,0,0,114,209,0,0,0,122,9, - 116,114,121,105,110,103,32,123,125,41,1,90,9,118,101,114, - 98,111,115,105,116,121,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,41,22,114,41,0,0,0,114,49,0,0,0,114,44, - 0,0,0,114,4,0,0,0,114,55,0,0,0,114,0,1, - 0,0,114,50,0,0,0,114,58,1,0,0,218,11,95,102, - 105,108,108,95,99,97,99,104,101,114,9,0,0,0,114,61, - 1,0,0,114,105,0,0,0,114,60,1,0,0,114,38,0, - 0,0,114,57,1,0,0,114,54,0,0,0,114,51,1,0, - 0,114,56,0,0,0,114,134,0,0,0,114,149,0,0,0, - 114,183,0,0,0,114,178,0,0,0,41,14,114,118,0,0, - 0,114,139,0,0,0,114,202,0,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,169,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,8,1,0,0, - 114,188,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, - 187,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,114,203,0,0,0,136,5,0,0,115,72,0,0, - 0,0,5,4,1,14,1,2,1,24,1,12,1,10,1,10, - 1,8,1,6,2,6,1,6,1,10,2,6,1,4,2,8, - 1,12,1,14,1,8,1,10,1,8,1,26,4,8,2,14, - 1,16,1,16,1,12,1,8,1,10,1,4,255,10,2,6, - 1,12,1,12,1,8,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,0,0,0,0,9,0,0,0, - 10,0,0,0,67,0,0,0,115,188,0,0,0,124,0,106, - 0,125,1,122,22,116,1,160,2,124,1,112,22,116,1,160, - 3,161,0,161,1,125,2,87,0,110,28,4,0,116,4,116, - 5,116,6,102,3,121,56,1,0,1,0,1,0,103,0,125, - 2,89,0,110,2,48,0,116,7,106,8,160,9,100,1,161, - 1,115,82,116,10,124,2,131,1,124,0,95,11,110,74,116, - 10,131,0,125,3,124,2,68,0,93,56,125,4,124,4,160, - 12,100,2,161,1,92,3,125,5,125,6,125,7,124,6,114, - 134,100,3,160,13,124,5,124,7,160,14,161,0,161,2,125, - 8,110,4,124,5,125,8,124,3,160,15,124,8,161,1,1, - 0,113,92,124,3,124,0,95,11,116,7,106,8,160,9,116, - 16,161,1,114,184,100,4,100,5,132,0,124,2,68,0,131, - 1,124,0,95,17,100,6,83,0,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,71,0,0,0,114,61,0,0,0, - 99,1,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,4,0,0,0,83,0,0,0,115,20,0,0,0,104,0, - 124,0,93,12,125,1,124,1,160,0,161,0,146,2,113,4, - 83,0,114,5,0,0,0,41,1,114,105,0,0,0,41,2, - 114,32,0,0,0,90,2,102,110,114,5,0,0,0,114,5, - 0,0,0,114,8,0,0,0,218,9,60,115,101,116,99,111, - 109,112,62,213,5,0,0,114,56,1,0,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,44,0,0,0,114, - 4,0,0,0,90,7,108,105,115,116,100,105,114,114,55,0, - 0,0,114,45,1,0,0,218,15,80,101,114,109,105,115,115, - 105,111,110,69,114,114,111,114,218,18,78,111,116,65,68,105, - 114,101,99,116,111,114,121,69,114,114,111,114,114,1,0,0, - 0,114,10,0,0,0,114,11,0,0,0,114,59,1,0,0, - 114,60,1,0,0,114,100,0,0,0,114,62,0,0,0,114, - 105,0,0,0,218,3,97,100,100,114,12,0,0,0,114,61, - 1,0,0,41,9,114,118,0,0,0,114,44,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,33,1,0,0,114,116,0,0,0,114,20,1,0,0,114, - 8,1,0,0,90,8,110,101,119,95,110,97,109,101,114,5, - 0,0,0,114,5,0,0,0,114,8,0,0,0,114,63,1, - 0,0,184,5,0,0,115,34,0,0,0,0,2,6,1,2, - 1,22,1,18,3,10,3,12,1,12,7,6,1,8,1,16, - 1,4,1,18,2,4,1,12,1,6,1,12,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,0,0, - 0,0,3,0,0,0,3,0,0,0,7,0,0,0,115,18, - 0,0,0,135,0,135,1,102,2,100,1,100,2,132,8,125, - 2,124,2,83,0,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,0,0,0,0,1,0,0, - 0,4,0,0,0,19,0,0,0,115,36,0,0,0,116,0, - 124,0,131,1,115,20,116,1,100,1,124,0,100,2,141,2, - 130,1,136,0,124,0,103,1,136,1,162,1,82,0,142,0, - 83,0,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,48,0,0,0,41,2,114,56,0,0,0,114, - 117,0,0,0,114,48,0,0,0,169,2,114,193,0,0,0, - 114,62,1,0,0,114,5,0,0,0,114,8,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,225,5,0,0,115,6,0, - 0,0,0,2,8,1,12,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,5,0,0,0,41,3,114,193,0,0,0,114,62,1,0, - 0,114,69,1,0,0,114,5,0,0,0,114,68,1,0,0, - 114,8,0,0,0,218,9,112,97,116,104,95,104,111,111,107, - 215,5,0,0,115,4,0,0,0,0,10,14,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,0,0,0,0, - 1,0,0,0,3,0,0,0,67,0,0,0,115,12,0,0, - 0,100,1,160,0,124,0,106,1,161,1,83,0,41,2,78, - 122,16,70,105,108,101,70,105,110,100,101,114,40,123,33,114, - 125,41,41,2,114,62,0,0,0,114,44,0,0,0,114,246, - 0,0,0,114,5,0,0,0,114,5,0,0,0,114,8,0, - 0,0,114,31,1,0,0,233,5,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,1,78,41,15,114,125,0,0, - 0,114,124,0,0,0,114,126,0,0,0,114,127,0,0,0, - 114,209,0,0,0,114,38,1,0,0,114,143,0,0,0,114, - 206,0,0,0,114,137,0,0,0,114,51,1,0,0,114,203, - 0,0,0,114,63,1,0,0,114,207,0,0,0,114,70,1, - 0,0,114,31,1,0,0,114,5,0,0,0,114,5,0,0, - 0,114,5,0,0,0,114,8,0,0,0,114,54,1,0,0, - 90,5,0,0,115,22,0,0,0,8,2,4,7,8,14,8, - 4,4,2,8,12,8,5,10,48,8,31,2,1,10,17,114, - 54,1,0,0,99,4,0,0,0,0,0,0,0,0,0,0, - 0,6,0,0,0,8,0,0,0,67,0,0,0,115,144,0, - 0,0,124,0,160,0,100,1,161,1,125,4,124,0,160,0, - 100,2,161,1,125,5,124,4,115,66,124,5,114,36,124,5, - 106,1,125,4,110,30,124,2,124,3,107,2,114,56,116,2, - 124,1,124,2,131,2,125,4,110,10,116,3,124,1,124,2, - 131,2,125,4,124,5,115,84,116,4,124,1,124,2,124,4, - 100,3,141,3,125,5,122,36,124,5,124,0,100,2,60,0, - 124,4,124,0,100,1,60,0,124,2,124,0,100,4,60,0, - 124,3,124,0,100,5,60,0,87,0,110,18,4,0,116,5, - 121,138,1,0,1,0,1,0,89,0,110,2,48,0,100,0, - 83,0,41,6,78,218,10,95,95,108,111,97,100,101,114,95, - 95,218,8,95,95,115,112,101,99,95,95,114,55,1,0,0, - 90,8,95,95,102,105,108,101,95,95,90,10,95,95,99,97, - 99,104,101,100,95,95,41,6,218,3,103,101,116,114,140,0, - 0,0,114,5,1,0,0,114,255,0,0,0,114,190,0,0, - 0,218,9,69,120,99,101,112,116,105,111,110,41,6,90,2, - 110,115,114,116,0,0,0,90,8,112,97,116,104,110,97,109, - 101,90,9,99,112,97,116,104,110,97,109,101,114,140,0,0, - 0,114,187,0,0,0,114,5,0,0,0,114,5,0,0,0, - 114,8,0,0,0,218,14,95,102,105,120,95,117,112,95,109, - 111,100,117,108,101,239,5,0,0,115,34,0,0,0,0,2, - 10,1,10,1,4,1,4,1,8,1,8,1,12,2,10,1, - 4,1,14,1,2,1,8,1,8,1,8,1,12,1,12,2, - 114,75,1,0,0,99,0,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,3,0,0,0,67,0,0,0,115,38, - 0,0,0,116,0,116,1,160,2,161,0,102,2,125,0,116, - 3,116,4,102,2,125,1,116,5,116,6,102,2,125,2,124, - 0,124,1,124,2,103,3,83,0,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,252, - 0,0,0,114,163,0,0,0,218,18,101,120,116,101,110,115, - 105,111,110,95,115,117,102,102,105,120,101,115,114,255,0,0, - 0,114,101,0,0,0,114,5,1,0,0,114,88,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, + 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,203,0,0,0,114,140,0,0,0,114,178,0,0,0,41, + 3,114,118,0,0,0,114,139,0,0,0,114,187,0,0,0, 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,114, - 184,0,0,0,6,6,0,0,115,8,0,0,0,0,5,12, - 1,8,1,8,1,114,184,0,0,0,99,1,0,0,0,0, - 0,0,0,0,0,0,0,10,0,0,0,9,0,0,0,67, - 0,0,0,115,132,1,0,0,124,0,97,0,116,0,106,1, - 97,1,116,0,106,2,97,2,116,1,106,3,116,4,25,0, - 125,1,100,1,100,2,103,1,102,2,100,3,100,4,100,2, - 103,2,102,2,102,2,125,2,124,2,68,0,93,108,92,2, - 125,3,125,4,116,5,100,5,100,6,132,0,124,4,68,0, - 131,1,131,1,115,82,74,0,130,1,124,4,100,7,25,0, - 125,5,124,3,116,1,106,3,118,0,114,116,116,1,106,3, - 124,3,25,0,125,6,1,0,113,170,113,52,122,20,116,0, - 160,6,124,3,161,1,125,6,87,0,1,0,113,170,87,0, - 113,52,4,0,116,7,121,158,1,0,1,0,1,0,89,0, - 113,52,89,0,113,52,48,0,113,52,116,7,100,8,131,1, - 130,1,116,8,124,1,100,9,124,6,131,3,1,0,116,8, - 124,1,100,10,124,5,131,3,1,0,116,8,124,1,100,11, - 100,12,160,9,124,4,161,1,131,3,1,0,116,8,124,1, - 100,13,100,14,100,15,132,0,124,4,68,0,131,1,131,3, - 1,0,103,0,100,16,162,1,125,7,124,3,100,3,107,2, - 144,1,114,6,124,7,160,10,100,17,161,1,1,0,124,7, - 68,0,93,52,125,8,124,8,116,1,106,3,118,1,144,1, - 114,38,116,0,160,6,124,8,161,1,125,9,110,10,116,1, - 106,3,124,8,25,0,125,9,116,8,124,1,124,8,124,9, - 131,3,1,0,144,1,113,10,116,8,124,1,100,18,116,11, - 131,0,131,3,1,0,116,12,160,13,116,2,160,14,161,0, - 161,1,1,0,124,3,100,3,107,2,144,1,114,128,116,15, - 160,10,100,19,161,1,1,0,100,20,116,12,118,0,144,1, - 114,128,100,21,116,16,95,17,100,22,83,0,41,23,122,205, - 83,101,116,117,112,32,116,104,101,32,112,97,116,104,45,98, - 97,115,101,100,32,105,109,112,111,114,116,101,114,115,32,102, - 111,114,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, - 10,32,32,32,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,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,79,116,104,101,114,32,99, - 111,109,112,111,110,101,110,116,115,32,97,114,101,32,101,120, - 116,114,97,99,116,101,100,32,102,114,111,109,32,116,104,101, - 32,99,111,114,101,32,98,111,111,116,115,116,114,97,112,32, - 109,111,100,117,108,101,46,10,10,32,32,32,32,90,5,112, - 111,115,105,120,250,1,47,90,2,110,116,250,1,92,99,1, - 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,3, - 0,0,0,115,0,0,0,115,26,0,0,0,124,0,93,18, - 125,1,116,0,124,1,131,1,100,0,107,2,86,0,1,0, - 113,2,100,1,83,0,41,2,114,39,0,0,0,78,41,1, - 114,23,0,0,0,41,2,114,32,0,0,0,114,94,0,0, - 0,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,10,1,0,0,35,6,0,0,114,56,1,0,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,73,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,4, - 0,0,0,114,35,0,0,0,114,31,0,0,0,114,40,0, - 0,0,114,58,0,0,0,99,1,0,0,0,0,0,0,0, - 0,0,0,0,2,0,0,0,4,0,0,0,83,0,0,0, - 115,22,0,0,0,104,0,124,0,93,14,125,1,100,0,124, - 1,155,0,157,2,146,2,113,4,83,0,41,1,114,74,0, - 0,0,114,5,0,0,0,41,2,114,32,0,0,0,218,1, - 115,114,5,0,0,0,114,5,0,0,0,114,8,0,0,0, - 114,64,1,0,0,52,6,0,0,114,56,1,0,0,122,25, - 95,115,101,116,117,112,46,60,108,111,99,97,108,115,62,46, - 60,115,101,116,99,111,109,112,62,41,3,114,64,0,0,0, - 114,75,0,0,0,114,160,0,0,0,114,192,0,0,0,114, - 9,0,0,0,122,4,46,112,121,119,122,6,95,100,46,112, - 121,100,84,78,41,18,114,134,0,0,0,114,1,0,0,0, - 114,163,0,0,0,114,22,1,0,0,114,125,0,0,0,218, - 3,97,108,108,90,18,95,98,117,105,108,116,105,110,95,102, - 114,111,109,95,110,97,109,101,114,117,0,0,0,114,129,0, - 0,0,114,36,0,0,0,114,186,0,0,0,114,14,0,0, - 0,114,12,1,0,0,114,167,0,0,0,114,76,1,0,0, - 114,101,0,0,0,114,191,0,0,0,114,195,0,0,0,41, - 10,218,17,95,98,111,111,116,115,116,114,97,112,95,109,111, - 100,117,108,101,90,11,115,101,108,102,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,31,0,0,0,114,35, - 0,0,0,90,9,111,115,95,109,111,100,117,108,101,90,13, - 98,117,105,108,116,105,110,95,110,97,109,101,115,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,114,5,0,0,0, - 114,5,0,0,0,114,8,0,0,0,218,6,95,115,101,116, - 117,112,17,6,0,0,115,70,0,0,0,0,8,4,1,6, - 1,6,2,10,3,22,1,12,2,22,1,8,1,10,1,10, - 1,6,2,2,1,10,1,10,1,12,1,12,2,8,2,12, - 1,12,1,18,1,22,3,8,1,10,1,10,1,8,1,12, - 1,12,2,10,1,16,3,14,1,14,1,10,1,10,1,10, - 1,114,82,1,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,2,0,0,0,4,0,0,0,67,0,0,0,115, - 50,0,0,0,116,0,124,0,131,1,1,0,116,1,131,0, - 125,1,116,2,106,3,160,4,116,5,106,6,124,1,142,0, - 103,1,161,1,1,0,116,2,106,7,160,8,116,9,161,1, - 1,0,100,1,83,0,41,2,122,41,73,110,115,116,97,108, - 108,32,116,104,101,32,112,97,116,104,45,98,97,115,101,100, - 32,105,109,112,111,114,116,32,99,111,109,112,111,110,101,110, - 116,115,46,78,41,10,114,82,1,0,0,114,184,0,0,0, - 114,1,0,0,0,114,43,1,0,0,114,167,0,0,0,114, - 54,1,0,0,114,70,1,0,0,218,9,109,101,116,97,95, - 112,97,116,104,114,186,0,0,0,114,37,1,0,0,41,2, - 114,81,1,0,0,90,17,115,117,112,112,111,114,116,101,100, - 95,108,111,97,100,101,114,115,114,5,0,0,0,114,5,0, - 0,0,114,8,0,0,0,218,8,95,105,110,115,116,97,108, - 108,74,6,0,0,115,8,0,0,0,0,2,8,1,6,1, - 20,1,114,84,1,0,0,41,1,114,60,0,0,0,41,1, - 78,41,3,78,78,78,41,2,114,73,0,0,0,114,73,0, - 0,0,41,1,84,41,1,78,41,1,78,41,63,114,127,0, - 0,0,114,13,0,0,0,90,37,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,95,66,89,84,69,83,95,75,69,89,114,12, - 0,0,0,114,14,0,0,0,114,21,0,0,0,114,27,0, - 0,0,114,29,0,0,0,114,38,0,0,0,114,47,0,0, - 0,114,49,0,0,0,114,53,0,0,0,114,54,0,0,0, - 114,56,0,0,0,114,59,0,0,0,114,69,0,0,0,218, - 4,116,121,112,101,218,8,95,95,99,111,100,101,95,95,114, - 162,0,0,0,114,19,0,0,0,114,148,0,0,0,114,18, - 0,0,0,114,24,0,0,0,114,236,0,0,0,114,91,0, - 0,0,114,87,0,0,0,114,101,0,0,0,114,88,0,0, - 0,90,23,68,69,66,85,71,95,66,89,84,69,67,79,68, - 69,95,83,85,70,70,73,88,69,83,90,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,97,0,0,0,114,102,0,0, - 0,114,108,0,0,0,114,112,0,0,0,114,114,0,0,0, - 114,136,0,0,0,114,143,0,0,0,114,152,0,0,0,114, - 156,0,0,0,114,158,0,0,0,114,165,0,0,0,114,170, - 0,0,0,114,171,0,0,0,114,176,0,0,0,218,6,111, - 98,106,101,99,116,114,185,0,0,0,114,190,0,0,0,114, - 191,0,0,0,114,208,0,0,0,114,221,0,0,0,114,239, - 0,0,0,114,255,0,0,0,114,5,1,0,0,114,12,1, - 0,0,114,252,0,0,0,114,13,1,0,0,114,35,1,0, - 0,114,37,1,0,0,114,54,1,0,0,114,75,1,0,0, - 114,184,0,0,0,114,82,1,0,0,114,84,1,0,0,114, - 5,0,0,0,114,5,0,0,0,114,5,0,0,0,114,8, - 0,0,0,218,8,60,109,111,100,117,108,101,62,1,0,0, - 0,115,126,0,0,0,4,22,4,1,4,1,2,1,2,255, - 4,4,8,17,8,5,8,5,8,6,8,6,8,12,8,10, - 8,9,8,5,8,7,8,9,10,22,10,127,0,20,16,1, - 12,2,4,1,4,2,6,2,6,2,8,2,16,71,8,40, - 8,19,8,12,8,12,8,28,8,17,8,33,8,28,8,24, - 10,13,10,10,10,11,8,14,6,3,4,1,2,255,12,68, - 14,64,14,29,16,127,0,17,14,50,18,45,18,26,4,3, - 18,53,14,63,14,42,14,127,0,20,14,127,0,22,10,23, - 8,11,8,57, + 137,0,0,0,119,5,0,0,115,8,0,0,0,0,7,10, + 1,8,1,8,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,0,0,0,0,7,0,0,0,6,0, + 0,0,67,0,0,0,115,26,0,0,0,124,1,124,2,124, + 3,131,2,125,6,116,0,124,2,124,3,124,6,124,4,100, + 1,141,4,83,0,41,2,78,114,177,0,0,0,41,1,114, + 190,0,0,0,41,7,114,118,0,0,0,114,188,0,0,0, + 114,139,0,0,0,114,44,0,0,0,90,4,115,109,115,108, + 114,202,0,0,0,114,140,0,0,0,114,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,114,51,1,0,0,131,5, + 0,0,115,8,0,0,0,0,1,10,1,8,1,2,255,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,0, + 0,0,0,14,0,0,0,8,0,0,0,67,0,0,0,115, + 92,1,0,0,100,1,125,3,124,1,160,0,100,2,161,1, + 100,3,25,0,125,4,122,24,116,1,124,0,106,2,112,34, + 116,3,160,4,161,0,131,1,106,5,125,5,87,0,110,22, + 4,0,116,6,121,64,1,0,1,0,1,0,100,4,125,5, + 89,0,110,2,48,0,124,5,124,0,106,7,107,3,114,90, + 124,0,160,8,161,0,1,0,124,5,124,0,95,7,116,9, + 131,0,114,112,124,0,106,10,125,6,124,4,160,11,161,0, + 125,7,110,10,124,0,106,12,125,6,124,4,125,7,124,7, + 124,6,118,0,114,214,116,13,124,0,106,2,124,4,131,2, + 125,8,124,0,106,14,68,0,93,56,92,2,125,9,125,10, + 100,5,124,9,23,0,125,11,116,13,124,8,124,11,131,2, + 125,12,116,15,124,12,131,1,114,148,124,0,160,16,124,10, + 124,1,124,12,124,8,103,1,124,2,161,5,2,0,1,0, + 83,0,116,17,124,8,131,1,125,3,124,0,106,14,68,0, + 93,80,92,2,125,9,125,10,116,13,124,0,106,2,124,4, + 124,9,23,0,131,2,125,12,116,18,106,19,100,6,124,12, + 100,3,100,7,141,3,1,0,124,7,124,9,23,0,124,6, + 118,0,114,220,116,15,124,12,131,1,114,220,124,0,160,16, + 124,10,124,1,124,12,100,8,124,2,161,5,2,0,1,0, + 83,0,124,3,144,1,114,88,116,18,160,19,100,9,124,8, + 161,2,1,0,116,18,160,20,124,1,100,8,161,2,125,13, + 124,8,103,1,124,13,95,21,124,13,83,0,100,8,83,0, + 41,10,122,111,84,114,121,32,116,111,32,102,105,110,100,32, + 97,32,115,112,101,99,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,46, + 10,10,32,32,32,32,32,32,32,32,82,101,116,117,114,110, + 115,32,116,104,101,32,109,97,116,99,104,105,110,103,32,115, + 112,101,99,44,32,111,114,32,78,111,110,101,32,105,102,32, + 110,111,116,32,102,111,117,110,100,46,10,32,32,32,32,32, + 32,32,32,70,114,71,0,0,0,114,28,0,0,0,114,104, + 0,0,0,114,209,0,0,0,122,9,116,114,121,105,110,103, + 32,123,125,41,1,90,9,118,101,114,98,111,115,105,116,121, + 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,41,22,114,41, + 0,0,0,114,49,0,0,0,114,44,0,0,0,114,4,0, + 0,0,114,55,0,0,0,114,0,1,0,0,114,50,0,0, + 0,114,58,1,0,0,218,11,95,102,105,108,108,95,99,97, + 99,104,101,114,9,0,0,0,114,61,1,0,0,114,105,0, + 0,0,114,60,1,0,0,114,38,0,0,0,114,57,1,0, + 0,114,54,0,0,0,114,51,1,0,0,114,56,0,0,0, + 114,134,0,0,0,114,149,0,0,0,114,183,0,0,0,114, + 178,0,0,0,41,14,114,118,0,0,0,114,139,0,0,0, + 114,202,0,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,169,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,8,1,0,0,114,188,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,187,0,0,0,114,5, + 0,0,0,114,5,0,0,0,114,8,0,0,0,114,203,0, + 0,0,136,5,0,0,115,72,0,0,0,0,5,4,1,14, + 1,2,1,24,1,12,1,10,1,10,1,8,1,6,2,6, + 1,6,1,10,2,6,1,4,2,8,1,12,1,14,1,8, + 1,10,1,8,1,24,4,8,2,14,1,16,1,16,1,12, + 1,8,1,10,1,4,255,8,2,6,1,12,1,12,1,8, + 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,0,0,0,0,9,0,0,0,10,0,0,0,67,0, + 0,0,115,188,0,0,0,124,0,106,0,125,1,122,22,116, + 1,160,2,124,1,112,22,116,1,160,3,161,0,161,1,125, + 2,87,0,110,28,4,0,116,4,116,5,116,6,102,3,121, + 56,1,0,1,0,1,0,103,0,125,2,89,0,110,2,48, + 0,116,7,106,8,160,9,100,1,161,1,115,82,116,10,124, + 2,131,1,124,0,95,11,110,74,116,10,131,0,125,3,124, + 2,68,0,93,56,125,4,124,4,160,12,100,2,161,1,92, + 3,125,5,125,6,125,7,124,6,114,134,100,3,160,13,124, + 5,124,7,160,14,161,0,161,2,125,8,110,4,124,5,125, + 8,124,3,160,15,124,8,161,1,1,0,113,92,124,3,124, + 0,95,11,116,7,106,8,160,9,116,16,161,1,114,184,100, + 4,100,5,132,0,124,2,68,0,131,1,124,0,95,17,100, + 6,83,0,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,71,0,0,0,114,61,0,0,0,99,1,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,83, + 0,0,0,115,20,0,0,0,104,0,124,0,93,12,125,1, + 124,1,160,0,161,0,146,2,113,4,83,0,114,5,0,0, + 0,41,1,114,105,0,0,0,41,2,114,32,0,0,0,90, + 2,102,110,114,5,0,0,0,114,5,0,0,0,114,8,0, + 0,0,218,9,60,115,101,116,99,111,109,112,62,213,5,0, + 0,114,56,1,0,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,44,0,0,0,114,4,0,0,0,90,7, + 108,105,115,116,100,105,114,114,55,0,0,0,114,45,1,0, + 0,218,15,80,101,114,109,105,115,115,105,111,110,69,114,114, + 111,114,218,18,78,111,116,65,68,105,114,101,99,116,111,114, + 121,69,114,114,111,114,114,1,0,0,0,114,10,0,0,0, + 114,11,0,0,0,114,59,1,0,0,114,60,1,0,0,114, + 100,0,0,0,114,62,0,0,0,114,105,0,0,0,218,3, + 97,100,100,114,12,0,0,0,114,61,1,0,0,41,9,114, + 118,0,0,0,114,44,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,33,1,0,0,114, + 116,0,0,0,114,20,1,0,0,114,8,1,0,0,90,8, + 110,101,119,95,110,97,109,101,114,5,0,0,0,114,5,0, + 0,0,114,8,0,0,0,114,63,1,0,0,184,5,0,0, + 115,34,0,0,0,0,2,6,1,2,1,22,1,18,3,10, + 3,12,1,12,7,6,1,8,1,16,1,4,1,18,2,4, + 1,12,1,6,1,12,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,0,0,0,0,3,0,0,0, + 3,0,0,0,7,0,0,0,115,18,0,0,0,135,0,135, + 1,102,2,100,1,100,2,132,8,125,2,124,2,83,0,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,0,0,0,0,1,0,0,0,4,0,0,0,19, + 0,0,0,115,36,0,0,0,116,0,124,0,131,1,115,20, + 116,1,100,1,124,0,100,2,141,2,130,1,136,0,124,0, + 103,1,136,1,162,1,82,0,142,0,83,0,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,48,0, + 0,0,41,2,114,56,0,0,0,114,117,0,0,0,114,48, + 0,0,0,169,2,114,193,0,0,0,114,62,1,0,0,114, + 5,0,0,0,114,8,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,225,5,0,0,115,6,0,0,0,0,2,8,1, + 12,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,5,0,0,0,41, + 3,114,193,0,0,0,114,62,1,0,0,114,69,1,0,0, + 114,5,0,0,0,114,68,1,0,0,114,8,0,0,0,218, + 9,112,97,116,104,95,104,111,111,107,215,5,0,0,115,4, + 0,0,0,0,10,14,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,0,0,0,0,1,0,0,0,3,0, + 0,0,67,0,0,0,115,12,0,0,0,100,1,160,0,124, + 0,106,1,161,1,83,0,41,2,78,122,16,70,105,108,101, + 70,105,110,100,101,114,40,123,33,114,125,41,41,2,114,62, + 0,0,0,114,44,0,0,0,114,246,0,0,0,114,5,0, + 0,0,114,5,0,0,0,114,8,0,0,0,114,31,1,0, + 0,233,5,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,1,78,41,15,114,125,0,0,0,114,124,0,0,0, + 114,126,0,0,0,114,127,0,0,0,114,209,0,0,0,114, + 38,1,0,0,114,143,0,0,0,114,206,0,0,0,114,137, + 0,0,0,114,51,1,0,0,114,203,0,0,0,114,63,1, + 0,0,114,207,0,0,0,114,70,1,0,0,114,31,1,0, + 0,114,5,0,0,0,114,5,0,0,0,114,5,0,0,0, + 114,8,0,0,0,114,54,1,0,0,90,5,0,0,115,22, + 0,0,0,8,2,4,7,8,14,8,4,4,2,8,12,8, + 5,10,48,8,31,2,1,10,17,114,54,1,0,0,99,4, + 0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,8, + 0,0,0,67,0,0,0,115,144,0,0,0,124,0,160,0, + 100,1,161,1,125,4,124,0,160,0,100,2,161,1,125,5, + 124,4,115,66,124,5,114,36,124,5,106,1,125,4,110,30, + 124,2,124,3,107,2,114,56,116,2,124,1,124,2,131,2, + 125,4,110,10,116,3,124,1,124,2,131,2,125,4,124,5, + 115,84,116,4,124,1,124,2,124,4,100,3,141,3,125,5, + 122,36,124,5,124,0,100,2,60,0,124,4,124,0,100,1, + 60,0,124,2,124,0,100,4,60,0,124,3,124,0,100,5, + 60,0,87,0,110,18,4,0,116,5,121,138,1,0,1,0, + 1,0,89,0,110,2,48,0,100,0,83,0,41,6,78,218, + 10,95,95,108,111,97,100,101,114,95,95,218,8,95,95,115, + 112,101,99,95,95,114,55,1,0,0,90,8,95,95,102,105, + 108,101,95,95,90,10,95,95,99,97,99,104,101,100,95,95, + 41,6,218,3,103,101,116,114,140,0,0,0,114,5,1,0, + 0,114,255,0,0,0,114,190,0,0,0,218,9,69,120,99, + 101,112,116,105,111,110,41,6,90,2,110,115,114,116,0,0, + 0,90,8,112,97,116,104,110,97,109,101,90,9,99,112,97, + 116,104,110,97,109,101,114,140,0,0,0,114,187,0,0,0, + 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218, + 14,95,102,105,120,95,117,112,95,109,111,100,117,108,101,239, + 5,0,0,115,34,0,0,0,0,2,10,1,10,1,4,1, + 4,1,8,1,8,1,12,2,10,1,4,1,14,1,2,1, + 8,1,8,1,8,1,12,1,12,2,114,75,1,0,0,99, + 0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, + 3,0,0,0,67,0,0,0,115,38,0,0,0,116,0,116, + 1,160,2,161,0,102,2,125,0,116,3,116,4,102,2,125, + 1,116,5,116,6,102,2,125,2,124,0,124,1,124,2,103, + 3,83,0,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,252,0,0,0,114,163,0, + 0,0,218,18,101,120,116,101,110,115,105,111,110,95,115,117, + 102,102,105,120,101,115,114,255,0,0,0,114,101,0,0,0, + 114,5,1,0,0,114,88,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,5,0,0,0,114, + 5,0,0,0,114,8,0,0,0,114,184,0,0,0,6,6, + 0,0,115,8,0,0,0,0,5,12,1,8,1,8,1,114, + 184,0,0,0,99,1,0,0,0,0,0,0,0,0,0,0, + 0,10,0,0,0,9,0,0,0,67,0,0,0,115,130,1, + 0,0,124,0,97,0,116,0,106,1,97,1,116,0,106,2, + 97,2,116,1,106,3,116,4,25,0,125,1,100,1,100,2, + 103,1,102,2,100,3,100,4,100,2,103,2,102,2,102,2, + 125,2,124,2,68,0,93,106,92,2,125,3,125,4,116,5, + 100,5,100,6,132,0,124,4,68,0,131,1,131,1,115,82, + 74,0,130,1,124,4,100,7,25,0,125,5,124,3,116,1, + 106,3,118,0,114,116,116,1,106,3,124,3,25,0,125,6, + 1,0,113,168,113,52,122,20,116,0,160,6,124,3,161,1, + 125,6,87,0,1,0,113,168,87,0,113,52,4,0,116,7, + 121,158,1,0,1,0,1,0,89,0,113,52,89,0,113,52, + 48,0,116,7,100,8,131,1,130,1,116,8,124,1,100,9, + 124,6,131,3,1,0,116,8,124,1,100,10,124,5,131,3, + 1,0,116,8,124,1,100,11,100,12,160,9,124,4,161,1, + 131,3,1,0,116,8,124,1,100,13,100,14,100,15,132,0, + 124,4,68,0,131,1,131,3,1,0,103,0,100,16,162,1, + 125,7,124,3,100,3,107,2,144,1,114,4,124,7,160,10, + 100,17,161,1,1,0,124,7,68,0,93,52,125,8,124,8, + 116,1,106,3,118,1,144,1,114,36,116,0,160,6,124,8, + 161,1,125,9,110,10,116,1,106,3,124,8,25,0,125,9, + 116,8,124,1,124,8,124,9,131,3,1,0,144,1,113,8, + 116,8,124,1,100,18,116,11,131,0,131,3,1,0,116,12, + 160,13,116,2,160,14,161,0,161,1,1,0,124,3,100,3, + 107,2,144,1,114,126,116,15,160,10,100,19,161,1,1,0, + 100,20,116,12,118,0,144,1,114,126,100,21,116,16,95,17, + 100,22,83,0,41,23,122,205,83,101,116,117,112,32,116,104, + 101,32,112,97,116,104,45,98,97,115,101,100,32,105,109,112, + 111,114,116,101,114,115,32,102,111,114,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,10,32,32,32,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, + 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,79,116,104,101,114,32,99,111,109,112,111,110,101,110,116, + 115,32,97,114,101,32,101,120,116,114,97,99,116,101,100,32, + 102,114,111,109,32,116,104,101,32,99,111,114,101,32,98,111, + 111,116,115,116,114,97,112,32,109,111,100,117,108,101,46,10, + 10,32,32,32,32,90,5,112,111,115,105,120,250,1,47,90, + 2,110,116,250,1,92,99,1,0,0,0,0,0,0,0,0, + 0,0,0,2,0,0,0,3,0,0,0,115,0,0,0,115, + 26,0,0,0,124,0,93,18,125,1,116,0,124,1,131,1, + 100,0,107,2,86,0,1,0,113,2,100,1,83,0,41,2, + 114,39,0,0,0,78,41,1,114,23,0,0,0,41,2,114, + 32,0,0,0,114,94,0,0,0,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,10,1,0,0,35,6,0, + 0,114,56,1,0,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,73,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,4,0,0,0,114,35,0,0,0, + 114,31,0,0,0,114,40,0,0,0,114,58,0,0,0,99, + 1,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 4,0,0,0,83,0,0,0,115,22,0,0,0,104,0,124, + 0,93,14,125,1,100,0,124,1,155,0,157,2,146,2,113, + 4,83,0,41,1,114,74,0,0,0,114,5,0,0,0,41, + 2,114,32,0,0,0,218,1,115,114,5,0,0,0,114,5, + 0,0,0,114,8,0,0,0,114,64,1,0,0,52,6,0, + 0,114,56,1,0,0,122,25,95,115,101,116,117,112,46,60, + 108,111,99,97,108,115,62,46,60,115,101,116,99,111,109,112, + 62,41,3,114,64,0,0,0,114,75,0,0,0,114,160,0, + 0,0,114,192,0,0,0,114,9,0,0,0,122,4,46,112, + 121,119,122,6,95,100,46,112,121,100,84,78,41,18,114,134, + 0,0,0,114,1,0,0,0,114,163,0,0,0,114,22,1, + 0,0,114,125,0,0,0,218,3,97,108,108,90,18,95,98, + 117,105,108,116,105,110,95,102,114,111,109,95,110,97,109,101, + 114,117,0,0,0,114,129,0,0,0,114,36,0,0,0,114, + 186,0,0,0,114,14,0,0,0,114,12,1,0,0,114,167, + 0,0,0,114,76,1,0,0,114,101,0,0,0,114,191,0, + 0,0,114,195,0,0,0,41,10,218,17,95,98,111,111,116, + 115,116,114,97,112,95,109,111,100,117,108,101,90,11,115,101, + 108,102,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,31,0,0,0,114,35,0,0,0,90,9,111,115,95, + 109,111,100,117,108,101,90,13,98,117,105,108,116,105,110,95, + 110,97,109,101,115,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,114,5,0,0,0,114,5,0,0,0,114,8,0, + 0,0,218,6,95,115,101,116,117,112,17,6,0,0,115,70, + 0,0,0,0,8,4,1,6,1,6,2,10,3,22,1,12, + 2,22,1,8,1,10,1,10,1,6,2,2,1,10,1,10, + 1,12,1,10,2,8,2,12,1,12,1,18,1,22,3,8, + 1,10,1,10,1,8,1,12,1,12,2,10,1,16,3,14, + 1,14,1,10,1,10,1,10,1,114,82,1,0,0,99,1, + 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,4, + 0,0,0,67,0,0,0,115,50,0,0,0,116,0,124,0, + 131,1,1,0,116,1,131,0,125,1,116,2,106,3,160,4, + 116,5,106,6,124,1,142,0,103,1,161,1,1,0,116,2, + 106,7,160,8,116,9,161,1,1,0,100,1,83,0,41,2, + 122,41,73,110,115,116,97,108,108,32,116,104,101,32,112,97, + 116,104,45,98,97,115,101,100,32,105,109,112,111,114,116,32, + 99,111,109,112,111,110,101,110,116,115,46,78,41,10,114,82, + 1,0,0,114,184,0,0,0,114,1,0,0,0,114,43,1, + 0,0,114,167,0,0,0,114,54,1,0,0,114,70,1,0, + 0,218,9,109,101,116,97,95,112,97,116,104,114,186,0,0, + 0,114,37,1,0,0,41,2,114,81,1,0,0,90,17,115, + 117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,115, + 114,5,0,0,0,114,5,0,0,0,114,8,0,0,0,218, + 8,95,105,110,115,116,97,108,108,74,6,0,0,115,8,0, + 0,0,0,2,8,1,6,1,20,1,114,84,1,0,0,41, + 1,114,60,0,0,0,41,1,78,41,3,78,78,78,41,2, + 114,73,0,0,0,114,73,0,0,0,41,1,84,41,1,78, + 41,1,78,41,63,114,127,0,0,0,114,13,0,0,0,90, + 37,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,95,66,89,84, + 69,83,95,75,69,89,114,12,0,0,0,114,14,0,0,0, + 114,21,0,0,0,114,27,0,0,0,114,29,0,0,0,114, + 38,0,0,0,114,47,0,0,0,114,49,0,0,0,114,53, + 0,0,0,114,54,0,0,0,114,56,0,0,0,114,59,0, + 0,0,114,69,0,0,0,218,4,116,121,112,101,218,8,95, + 95,99,111,100,101,95,95,114,162,0,0,0,114,19,0,0, + 0,114,148,0,0,0,114,18,0,0,0,114,24,0,0,0, + 114,236,0,0,0,114,91,0,0,0,114,87,0,0,0,114, + 101,0,0,0,114,88,0,0,0,90,23,68,69,66,85,71, + 95,66,89,84,69,67,79,68,69,95,83,85,70,70,73,88, + 69,83,90,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, + 97,0,0,0,114,102,0,0,0,114,108,0,0,0,114,112, + 0,0,0,114,114,0,0,0,114,136,0,0,0,114,143,0, + 0,0,114,152,0,0,0,114,156,0,0,0,114,158,0,0, + 0,114,165,0,0,0,114,170,0,0,0,114,171,0,0,0, + 114,176,0,0,0,218,6,111,98,106,101,99,116,114,185,0, + 0,0,114,190,0,0,0,114,191,0,0,0,114,208,0,0, + 0,114,221,0,0,0,114,239,0,0,0,114,255,0,0,0, + 114,5,1,0,0,114,12,1,0,0,114,252,0,0,0,114, + 13,1,0,0,114,35,1,0,0,114,37,1,0,0,114,54, + 1,0,0,114,75,1,0,0,114,184,0,0,0,114,82,1, + 0,0,114,84,1,0,0,114,5,0,0,0,114,5,0,0, + 0,114,5,0,0,0,114,8,0,0,0,218,8,60,109,111, + 100,117,108,101,62,1,0,0,0,115,126,0,0,0,4,22, + 4,1,4,1,2,1,2,255,4,4,8,17,8,5,8,5, + 8,6,8,6,8,12,8,10,8,9,8,5,8,7,8,9, + 10,22,10,127,0,20,16,1,12,2,4,1,4,2,6,2, + 6,2,8,2,16,71,8,40,8,19,8,12,8,12,8,28, + 8,17,8,33,8,28,8,24,10,13,10,10,10,11,8,14, + 6,3,4,1,2,255,12,68,14,64,14,29,16,127,0,17, + 14,50,18,45,18,26,4,3,18,53,14,63,14,42,14,127, + 0,20,14,127,0,22,10,23,8,11,8,57, }; diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index be7d24fe1df257..a70d7d2fe78070 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -502,460 +502,459 @@ const unsigned char _Py_M__zipimport[] = { 0,0,114,9,0,0,0,114,10,0,0,0,114,37,0,0, 0,53,1,0,0,115,4,0,0,0,0,4,8,2,114,37, 0,0,0,99,2,0,0,0,0,0,0,0,0,0,0,0, - 7,0,0,0,4,0,0,0,67,0,0,0,115,56,0,0, + 7,0,0,0,4,0,0,0,67,0,0,0,115,54,0,0, 0,116,0,124,0,124,1,131,2,125,2,116,1,68,0,93, - 36,92,3,125,3,125,4,125,5,124,2,124,3,23,0,125, + 34,92,3,125,3,125,4,125,5,124,2,124,3,23,0,125, 6,124,6,124,0,106,2,118,0,114,14,124,5,2,0,1, - 0,83,0,113,14,100,0,83,0,114,86,0,0,0,41,3, - 114,36,0,0,0,218,16,95,122,105,112,95,115,101,97,114, - 99,104,111,114,100,101,114,114,28,0,0,0,41,7,114,32, - 0,0,0,114,38,0,0,0,114,13,0,0,0,218,6,115, - 117,102,102,105,120,218,10,105,115,98,121,116,101,99,111,100, - 101,114,47,0,0,0,114,63,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,114,35,0,0,0,62, - 1,0,0,115,12,0,0,0,0,1,10,1,14,1,8,1, - 10,1,10,1,114,35,0,0,0,99,1,0,0,0,0,0, - 0,0,0,0,0,0,26,0,0,0,9,0,0,0,67,0, - 0,0,115,2,5,0,0,122,14,116,0,160,1,124,0,161, - 1,125,1,87,0,110,36,4,0,116,2,121,50,1,0,1, - 0,1,0,116,3,100,1,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,89,0,110,2,48,0,124,1,144,4,143, - 164,1,0,122,36,124,1,160,4,116,5,11,0,100,3,161, - 2,1,0,124,1,160,6,161,0,125,2,124,1,160,7,116, - 5,161,1,125,3,87,0,110,36,4,0,116,2,121,132,1, - 0,1,0,1,0,116,3,100,4,124,0,155,2,157,2,124, - 0,100,2,141,2,130,1,89,0,110,2,48,0,116,8,124, - 3,131,1,116,5,107,3,114,164,116,3,100,4,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,124,3,100,0,100, - 5,133,2,25,0,116,9,107,3,144,1,114,170,122,24,124, - 1,160,4,100,6,100,3,161,2,1,0,124,1,160,6,161, - 0,125,4,87,0,110,36,4,0,116,2,121,242,1,0,1, - 0,1,0,116,3,100,4,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,89,0,110,2,48,0,116,10,124,4,116, - 11,24,0,116,5,24,0,100,6,131,2,125,5,122,22,124, - 1,160,4,124,5,161,1,1,0,124,1,160,7,161,0,125, - 6,87,0,110,38,4,0,116,2,144,1,121,66,1,0,1, + 0,83,0,100,0,83,0,114,86,0,0,0,41,3,114,36, + 0,0,0,218,16,95,122,105,112,95,115,101,97,114,99,104, + 111,114,100,101,114,114,28,0,0,0,41,7,114,32,0,0, + 0,114,38,0,0,0,114,13,0,0,0,218,6,115,117,102, + 102,105,120,218,10,105,115,98,121,116,101,99,111,100,101,114, + 47,0,0,0,114,63,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,114,35,0,0,0,62,1,0, + 0,115,12,0,0,0,0,1,10,1,14,1,8,1,10,1, + 8,1,114,35,0,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,26,0,0,0,9,0,0,0,67,0,0,0, + 115,2,5,0,0,122,14,116,0,160,1,124,0,161,1,125, + 1,87,0,110,36,4,0,116,2,121,50,1,0,1,0,1, + 0,116,3,100,1,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,89,0,110,2,48,0,124,1,144,4,143,164,1, + 0,122,36,124,1,160,4,116,5,11,0,100,3,161,2,1, + 0,124,1,160,6,161,0,125,2,124,1,160,7,116,5,161, + 1,125,3,87,0,110,36,4,0,116,2,121,132,1,0,1, 0,1,0,116,3,100,4,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,89,0,110,2,48,0,124,6,160,12,116, - 9,161,1,125,7,124,7,100,6,107,0,144,1,114,106,116, - 3,100,7,124,0,155,2,157,2,124,0,100,2,141,2,130, - 1,124,6,124,7,124,7,116,5,23,0,133,2,25,0,125, - 3,116,8,124,3,131,1,116,5,107,3,144,1,114,154,116, - 3,100,8,124,0,155,2,157,2,124,0,100,2,141,2,130, - 1,124,4,116,8,124,6,131,1,24,0,124,7,23,0,125, - 2,116,13,124,3,100,9,100,10,133,2,25,0,131,1,125, - 8,116,13,124,3,100,10,100,11,133,2,25,0,131,1,125, - 9,124,2,124,8,107,0,144,1,114,230,116,3,100,12,124, - 0,155,2,157,2,124,0,100,2,141,2,130,1,124,2,124, - 9,107,0,144,2,114,2,116,3,100,13,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,124,2,124,8,56,0,125, - 2,124,2,124,9,24,0,125,10,124,10,100,6,107,0,144, - 2,114,46,116,3,100,14,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,105,0,125,11,100,6,125,12,122,14,124, - 1,160,4,124,2,161,1,1,0,87,0,110,38,4,0,116, - 2,144,2,121,106,1,0,1,0,1,0,116,3,100,4,124, + 2,141,2,130,1,89,0,110,2,48,0,116,8,124,3,131, + 1,116,5,107,3,114,164,116,3,100,4,124,0,155,2,157, + 2,124,0,100,2,141,2,130,1,124,3,100,0,100,5,133, + 2,25,0,116,9,107,3,144,1,114,170,122,24,124,1,160, + 4,100,6,100,3,161,2,1,0,124,1,160,6,161,0,125, + 4,87,0,110,36,4,0,116,2,121,242,1,0,1,0,1, + 0,116,3,100,4,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,89,0,110,2,48,0,116,10,124,4,116,11,24, + 0,116,5,24,0,100,6,131,2,125,5,122,22,124,1,160, + 4,124,5,161,1,1,0,124,1,160,7,161,0,125,6,87, + 0,110,38,4,0,116,2,144,1,121,66,1,0,1,0,1, + 0,116,3,100,4,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,89,0,110,2,48,0,124,6,160,12,116,9,161, + 1,125,7,124,7,100,6,107,0,144,1,114,106,116,3,100, + 7,124,0,155,2,157,2,124,0,100,2,141,2,130,1,124, + 6,124,7,124,7,116,5,23,0,133,2,25,0,125,3,116, + 8,124,3,131,1,116,5,107,3,144,1,114,154,116,3,100, + 8,124,0,155,2,157,2,124,0,100,2,141,2,130,1,124, + 4,116,8,124,6,131,1,24,0,124,7,23,0,125,2,116, + 13,124,3,100,9,100,10,133,2,25,0,131,1,125,8,116, + 13,124,3,100,10,100,11,133,2,25,0,131,1,125,9,124, + 2,124,8,107,0,144,1,114,230,116,3,100,12,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,124,2,124,9,107, + 0,144,2,114,2,116,3,100,13,124,0,155,2,157,2,124, + 0,100,2,141,2,130,1,124,2,124,8,56,0,125,2,124, + 2,124,9,24,0,125,10,124,10,100,6,107,0,144,2,114, + 46,116,3,100,14,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,105,0,125,11,100,6,125,12,122,14,124,1,160, + 4,124,2,161,1,1,0,87,0,110,38,4,0,116,2,144, + 2,121,106,1,0,1,0,1,0,116,3,100,4,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,89,0,110,2,48, + 0,124,1,160,7,100,15,161,1,125,3,116,8,124,3,131, + 1,100,5,107,0,144,2,114,140,116,14,100,16,131,1,130, + 1,124,3,100,0,100,5,133,2,25,0,100,17,107,3,144, + 2,114,162,144,4,113,208,116,8,124,3,131,1,100,15,107, + 3,144,2,114,184,116,14,100,16,131,1,130,1,116,15,124, + 3,100,18,100,19,133,2,25,0,131,1,125,13,116,15,124, + 3,100,19,100,9,133,2,25,0,131,1,125,14,116,15,124, + 3,100,9,100,20,133,2,25,0,131,1,125,15,116,15,124, + 3,100,20,100,10,133,2,25,0,131,1,125,16,116,13,124, + 3,100,10,100,11,133,2,25,0,131,1,125,17,116,13,124, + 3,100,11,100,21,133,2,25,0,131,1,125,18,116,13,124, + 3,100,21,100,22,133,2,25,0,131,1,125,4,116,15,124, + 3,100,22,100,23,133,2,25,0,131,1,125,19,116,15,124, + 3,100,23,100,24,133,2,25,0,131,1,125,20,116,15,124, + 3,100,24,100,25,133,2,25,0,131,1,125,21,116,13,124, + 3,100,26,100,15,133,2,25,0,131,1,125,22,124,19,124, + 20,23,0,124,21,23,0,125,8,124,22,124,9,107,4,144, + 3,114,144,116,3,100,27,124,0,155,2,157,2,124,0,100, + 2,141,2,130,1,124,22,124,10,55,0,125,22,122,14,124, + 1,160,7,124,19,161,1,125,23,87,0,110,38,4,0,116, + 2,144,3,121,204,1,0,1,0,1,0,116,3,100,4,124, 0,155,2,157,2,124,0,100,2,141,2,130,1,89,0,110, - 2,48,0,124,1,160,7,100,15,161,1,125,3,116,8,124, - 3,131,1,100,5,107,0,144,2,114,140,116,14,100,16,131, - 1,130,1,124,3,100,0,100,5,133,2,25,0,100,17,107, - 3,144,2,114,162,144,4,113,208,116,8,124,3,131,1,100, - 15,107,3,144,2,114,184,116,14,100,16,131,1,130,1,116, - 15,124,3,100,18,100,19,133,2,25,0,131,1,125,13,116, - 15,124,3,100,19,100,9,133,2,25,0,131,1,125,14,116, - 15,124,3,100,9,100,20,133,2,25,0,131,1,125,15,116, - 15,124,3,100,20,100,10,133,2,25,0,131,1,125,16,116, - 13,124,3,100,10,100,11,133,2,25,0,131,1,125,17,116, - 13,124,3,100,11,100,21,133,2,25,0,131,1,125,18,116, - 13,124,3,100,21,100,22,133,2,25,0,131,1,125,4,116, - 15,124,3,100,22,100,23,133,2,25,0,131,1,125,19,116, - 15,124,3,100,23,100,24,133,2,25,0,131,1,125,20,116, - 15,124,3,100,24,100,25,133,2,25,0,131,1,125,21,116, - 13,124,3,100,26,100,15,133,2,25,0,131,1,125,22,124, - 19,124,20,23,0,124,21,23,0,125,8,124,22,124,9,107, - 4,144,3,114,144,116,3,100,27,124,0,155,2,157,2,124, - 0,100,2,141,2,130,1,124,22,124,10,55,0,125,22,122, - 14,124,1,160,7,124,19,161,1,125,23,87,0,110,38,4, - 0,116,2,144,3,121,204,1,0,1,0,1,0,116,3,100, - 4,124,0,155,2,157,2,124,0,100,2,141,2,130,1,89, - 0,110,2,48,0,116,8,124,23,131,1,124,19,107,3,144, - 3,114,238,116,3,100,4,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,122,50,116,8,124,1,160,7,124,8,124, - 19,24,0,161,1,131,1,124,8,124,19,24,0,107,3,144, - 4,114,30,116,3,100,4,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,87,0,110,38,4,0,116,2,144,4,121, - 70,1,0,1,0,1,0,116,3,100,4,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,89,0,110,2,48,0,124, - 13,100,28,64,0,144,4,114,92,124,23,160,16,161,0,125, - 23,110,52,122,14,124,23,160,16,100,29,161,1,125,23,87, - 0,110,36,4,0,116,17,144,4,121,142,1,0,1,0,1, - 0,124,23,160,16,100,30,161,1,160,18,116,19,161,1,125, - 23,89,0,110,2,48,0,124,23,160,20,100,31,116,21,161, - 2,125,23,116,22,160,23,124,0,124,23,161,2,125,24,124, - 24,124,14,124,18,124,4,124,22,124,15,124,16,124,17,102, - 8,125,25,124,25,124,11,124,23,60,0,124,12,100,32,55, - 0,125,12,144,2,113,108,87,0,100,0,4,0,4,0,131, - 3,1,0,110,18,49,0,144,4,115,230,48,0,1,0,1, - 0,1,0,89,0,1,0,116,24,160,25,100,33,124,12,124, - 0,161,3,1,0,124,11,83,0,41,34,78,122,21,99,97, - 110,39,116,32,111,112,101,110,32,90,105,112,32,102,105,108, - 101,58,32,114,12,0,0,0,114,84,0,0,0,250,21,99, - 97,110,39,116,32,114,101,97,100,32,90,105,112,32,102,105, - 108,101,58,32,233,4,0,0,0,114,0,0,0,0,122,16, - 110,111,116,32,97,32,90,105,112,32,102,105,108,101,58,32, - 122,18,99,111,114,114,117,112,116,32,90,105,112,32,102,105, - 108,101,58,32,233,12,0,0,0,233,16,0,0,0,233,20, - 0,0,0,122,28,98,97,100,32,99,101,110,116,114,97,108, - 32,100,105,114,101,99,116,111,114,121,32,115,105,122,101,58, - 32,122,30,98,97,100,32,99,101,110,116,114,97,108,32,100, - 105,114,101,99,116,111,114,121,32,111,102,102,115,101,116,58, - 32,122,38,98,97,100,32,99,101,110,116,114,97,108,32,100, - 105,114,101,99,116,111,114,121,32,115,105,122,101,32,111,114, - 32,111,102,102,115,101,116,58,32,233,46,0,0,0,250,27, - 69,79,70,32,114,101,97,100,32,119,104,101,114,101,32,110, - 111,116,32,101,120,112,101,99,116,101,100,115,4,0,0,0, - 80,75,1,2,233,8,0,0,0,233,10,0,0,0,233,14, - 0,0,0,233,24,0,0,0,233,28,0,0,0,233,30,0, - 0,0,233,32,0,0,0,233,34,0,0,0,233,42,0,0, - 0,122,25,98,97,100,32,108,111,99,97,108,32,104,101,97, - 100,101,114,32,111,102,102,115,101,116,58,32,105,0,8,0, - 0,218,5,97,115,99,105,105,90,6,108,97,116,105,110,49, - 250,1,47,114,5,0,0,0,122,33,122,105,112,105,109,112, - 111,114,116,58,32,102,111,117,110,100,32,123,125,32,110,97, - 109,101,115,32,105,110,32,123,33,114,125,41,26,218,3,95, - 105,111,218,9,111,112,101,110,95,99,111,100,101,114,22,0, - 0,0,114,3,0,0,0,218,4,115,101,101,107,218,20,69, - 78,68,95,67,69,78,84,82,65,76,95,68,73,82,95,83, - 73,90,69,90,4,116,101,108,108,218,4,114,101,97,100,114, - 51,0,0,0,218,18,83,84,82,73,78,71,95,69,78,68, - 95,65,82,67,72,73,86,69,218,3,109,97,120,218,15,77, - 65,88,95,67,79,77,77,69,78,84,95,76,69,78,218,5, - 114,102,105,110,100,114,2,0,0,0,218,8,69,79,70,69, - 114,114,111,114,114,1,0,0,0,114,62,0,0,0,218,18, - 85,110,105,99,111,100,101,68,101,99,111,100,101,69,114,114, - 111,114,218,9,116,114,97,110,115,108,97,116,101,218,11,99, - 112,52,51,55,95,116,97,98,108,101,114,19,0,0,0,114, - 20,0,0,0,114,21,0,0,0,114,30,0,0,0,114,76, - 0,0,0,114,77,0,0,0,41,26,114,29,0,0,0,218, - 2,102,112,90,15,104,101,97,100,101,114,95,112,111,115,105, - 116,105,111,110,218,6,98,117,102,102,101,114,218,9,102,105, - 108,101,95,115,105,122,101,90,17,109,97,120,95,99,111,109, - 109,101,110,116,95,115,116,97,114,116,218,4,100,97,116,97, - 90,3,112,111,115,218,11,104,101,97,100,101,114,95,115,105, - 122,101,90,13,104,101,97,100,101,114,95,111,102,102,115,101, - 116,90,10,97,114,99,95,111,102,102,115,101,116,114,33,0, - 0,0,218,5,99,111,117,110,116,218,5,102,108,97,103,115, - 218,8,99,111,109,112,114,101,115,115,218,4,116,105,109,101, - 218,4,100,97,116,101,218,3,99,114,99,218,9,100,97,116, - 97,95,115,105,122,101,218,9,110,97,109,101,95,115,105,122, - 101,218,10,101,120,116,114,97,95,115,105,122,101,90,12,99, - 111,109,109,101,110,116,95,115,105,122,101,218,11,102,105,108, - 101,95,111,102,102,115,101,116,114,59,0,0,0,114,13,0, - 0,0,218,1,116,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,114,27,0,0,0,93,1,0,0,115,212,0, - 0,0,0,1,2,1,14,1,12,1,24,2,8,1,2,1, - 14,1,8,1,14,1,12,1,24,1,12,1,18,1,18,3, - 2,1,12,1,12,1,12,1,10,1,2,255,12,2,8,1, - 2,255,2,1,2,255,4,2,2,1,10,1,12,1,14,1, - 10,1,2,255,12,2,10,1,10,1,10,1,2,255,6,2, - 16,1,14,1,10,1,2,255,6,2,16,2,16,1,16,1, - 10,1,18,1,10,1,18,1,8,1,8,1,10,1,18,2, - 4,2,4,1,2,1,14,1,14,1,24,2,10,1,14,1, - 8,2,18,1,4,1,14,1,8,1,16,1,16,1,16,1, - 16,1,16,1,16,1,16,1,16,1,16,1,16,1,16,1, - 12,1,10,1,18,1,8,2,2,1,14,1,14,1,24,1, - 14,1,18,4,2,1,28,1,22,1,14,1,24,2,10,2, - 10,3,2,1,14,1,14,1,22,2,12,1,12,1,20,1, - 8,1,44,1,14,1,114,27,0,0,0,117,190,1,0,0, - 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, - 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, - 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, - 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63, - 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79, - 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95, - 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111, - 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, - 195,135,195,188,195,169,195,162,195,164,195,160,195,165,195,167, - 195,170,195,171,195,168,195,175,195,174,195,172,195,132,195,133, - 195,137,195,166,195,134,195,180,195,182,195,178,195,187,195,185, - 195,191,195,150,195,156,194,162,194,163,194,165,226,130,167,198, - 146,195,161,195,173,195,179,195,186,195,177,195,145,194,170,194, - 186,194,191,226,140,144,194,172,194,189,194,188,194,161,194,171, - 194,187,226,150,145,226,150,146,226,150,147,226,148,130,226,148, - 164,226,149,161,226,149,162,226,149,150,226,149,149,226,149,163, - 226,149,145,226,149,151,226,149,157,226,149,156,226,149,155,226, - 148,144,226,148,148,226,148,180,226,148,172,226,148,156,226,148, - 128,226,148,188,226,149,158,226,149,159,226,149,154,226,149,148, - 226,149,169,226,149,166,226,149,160,226,149,144,226,149,172,226, - 149,167,226,149,168,226,149,164,226,149,165,226,149,153,226,149, - 152,226,149,146,226,149,147,226,149,171,226,149,170,226,148,152, - 226,148,140,226,150,136,226,150,132,226,150,140,226,150,144,226, - 150,128,206,177,195,159,206,147,207,128,206,163,207,131,194,181, - 207,132,206,166,206,152,206,169,206,180,226,136,158,207,134,206, - 181,226,136,169,226,137,161,194,177,226,137,165,226,137,164,226, - 140,160,226,140,161,195,183,226,137,136,194,176,226,136,153,194, - 183,226,136,154,226,129,191,194,178,226,150,160,194,160,99,0, - 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8, - 0,0,0,67,0,0,0,115,110,0,0,0,116,0,114,22, - 116,1,160,2,100,1,161,1,1,0,116,3,100,2,131,1, - 130,1,100,3,97,0,122,62,122,16,100,4,100,5,108,4, - 109,5,125,0,1,0,87,0,110,36,4,0,116,6,121,80, - 1,0,1,0,1,0,116,1,160,2,100,1,161,1,1,0, - 116,3,100,2,131,1,130,1,89,0,110,2,48,0,87,0, - 100,6,97,0,110,6,100,6,97,0,48,0,116,1,160,2, - 100,7,161,1,1,0,124,0,83,0,41,8,78,122,27,122, - 105,112,105,109,112,111,114,116,58,32,122,108,105,98,32,85, - 78,65,86,65,73,76,65,66,76,69,250,41,99,97,110,39, - 116,32,100,101,99,111,109,112,114,101,115,115,32,100,97,116, - 97,59,32,122,108,105,98,32,110,111,116,32,97,118,97,105, - 108,97,98,108,101,84,114,0,0,0,0,169,1,218,10,100, - 101,99,111,109,112,114,101,115,115,70,122,25,122,105,112,105, - 109,112,111,114,116,58,32,122,108,105,98,32,97,118,97,105, - 108,97,98,108,101,41,7,218,15,95,105,109,112,111,114,116, - 105,110,103,95,122,108,105,98,114,76,0,0,0,114,77,0, - 0,0,114,3,0,0,0,90,4,122,108,105,98,114,139,0, - 0,0,218,9,69,120,99,101,112,116,105,111,110,114,138,0, - 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,218,20,95,103,101,116,95,100,101,99,111,109,112,114,101, - 115,115,95,102,117,110,99,251,1,0,0,115,24,0,0,0, - 0,2,4,3,10,1,8,2,4,1,4,1,16,1,12,1, - 10,1,16,2,12,2,10,1,114,142,0,0,0,99,2,0, - 0,0,0,0,0,0,0,0,0,0,17,0,0,0,9,0, - 0,0,67,0,0,0,115,144,1,0,0,124,1,92,8,125, - 2,125,3,125,4,125,5,125,6,125,7,125,8,125,9,124, - 4,100,1,107,0,114,36,116,0,100,2,131,1,130,1,116, - 1,160,2,124,0,161,1,144,1,143,14,125,10,122,14,124, - 10,160,3,124,6,161,1,1,0,87,0,110,36,4,0,116, - 4,121,100,1,0,1,0,1,0,116,0,100,3,124,0,155, - 2,157,2,124,0,100,4,141,2,130,1,89,0,110,2,48, - 0,124,10,160,5,100,5,161,1,125,11,116,6,124,11,131, - 1,100,5,107,3,114,132,116,7,100,6,131,1,130,1,124, - 11,100,0,100,7,133,2,25,0,100,8,107,3,114,166,116, - 0,100,9,124,0,155,2,157,2,124,0,100,4,141,2,130, - 1,116,8,124,11,100,10,100,11,133,2,25,0,131,1,125, - 12,116,8,124,11,100,11,100,5,133,2,25,0,131,1,125, - 13,100,5,124,12,23,0,124,13,23,0,125,14,124,6,124, - 14,55,0,125,6,122,14,124,10,160,3,124,6,161,1,1, - 0,87,0,110,38,4,0,116,4,144,1,121,14,1,0,1, - 0,1,0,116,0,100,3,124,0,155,2,157,2,124,0,100, - 4,141,2,130,1,89,0,110,2,48,0,124,10,160,5,124, - 4,161,1,125,15,116,6,124,15,131,1,124,4,107,3,144, - 1,114,48,116,4,100,12,131,1,130,1,87,0,100,0,4, - 0,4,0,131,3,1,0,110,18,49,0,144,1,115,70,48, - 0,1,0,1,0,1,0,89,0,1,0,124,3,100,1,107, - 2,144,1,114,94,124,15,83,0,122,10,116,9,131,0,125, - 16,87,0,110,28,4,0,116,10,144,1,121,132,1,0,1, - 0,1,0,116,0,100,13,131,1,130,1,89,0,110,2,48, - 0,124,16,124,15,100,14,131,2,83,0,41,15,78,114,0, - 0,0,0,122,18,110,101,103,97,116,105,118,101,32,100,97, - 116,97,32,115,105,122,101,114,90,0,0,0,114,12,0,0, - 0,114,102,0,0,0,114,96,0,0,0,114,91,0,0,0, - 115,4,0,0,0,80,75,3,4,122,23,98,97,100,32,108, - 111,99,97,108,32,102,105,108,101,32,104,101,97,100,101,114, - 58,32,233,26,0,0,0,114,101,0,0,0,122,26,122,105, - 112,105,109,112,111,114,116,58,32,99,97,110,39,116,32,114, - 101,97,100,32,100,97,116,97,114,137,0,0,0,105,241,255, - 255,255,41,11,114,3,0,0,0,114,108,0,0,0,114,109, - 0,0,0,114,110,0,0,0,114,22,0,0,0,114,112,0, - 0,0,114,51,0,0,0,114,117,0,0,0,114,1,0,0, - 0,114,142,0,0,0,114,141,0,0,0,41,17,114,29,0, - 0,0,114,54,0,0,0,90,8,100,97,116,97,112,97,116, - 104,114,128,0,0,0,114,132,0,0,0,114,123,0,0,0, - 114,135,0,0,0,114,129,0,0,0,114,130,0,0,0,114, - 131,0,0,0,114,121,0,0,0,114,122,0,0,0,114,133, - 0,0,0,114,134,0,0,0,114,125,0,0,0,90,8,114, - 97,119,95,100,97,116,97,114,139,0,0,0,114,9,0,0, - 0,114,9,0,0,0,114,10,0,0,0,114,52,0,0,0, - 16,2,0,0,115,62,0,0,0,0,1,20,1,8,1,8, - 2,14,2,2,1,14,1,12,1,24,1,10,1,12,1,8, - 2,16,2,18,2,16,1,16,1,12,1,8,1,2,1,14, - 1,14,1,24,1,10,1,14,1,40,2,10,2,4,3,2, - 1,10,1,14,1,14,1,114,52,0,0,0,99,2,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,3,0,0, - 0,67,0,0,0,115,16,0,0,0,116,0,124,0,124,1, - 24,0,131,1,100,1,107,1,83,0,41,2,78,114,5,0, - 0,0,41,1,218,3,97,98,115,41,2,90,2,116,49,90, - 2,116,50,114,9,0,0,0,114,9,0,0,0,114,10,0, - 0,0,218,9,95,101,113,95,109,116,105,109,101,62,2,0, - 0,115,2,0,0,0,0,2,114,145,0,0,0,99,5,0, - 0,0,0,0,0,0,0,0,0,0,14,0,0,0,8,0, - 0,0,67,0,0,0,115,56,1,0,0,124,3,124,2,100, - 1,156,2,125,5,122,18,116,0,160,1,124,4,124,3,124, - 5,161,3,125,6,87,0,110,20,4,0,116,2,121,48,1, - 0,1,0,1,0,89,0,100,0,83,0,48,0,124,6,100, - 2,64,0,100,3,107,3,125,7,124,7,114,178,124,6,100, - 4,64,0,100,3,107,3,125,8,116,3,106,4,100,5,107, - 3,114,176,124,8,115,102,116,3,106,4,100,6,107,2,114, - 176,116,5,124,0,124,2,131,2,125,9,124,9,100,0,117, - 1,114,176,116,3,160,6,116,0,106,7,124,9,161,2,125, - 10,122,20,116,0,160,8,124,4,124,10,124,3,124,5,161, - 4,1,0,87,0,110,20,4,0,116,2,121,174,1,0,1, - 0,1,0,89,0,100,0,83,0,48,0,110,84,116,9,124, - 0,124,2,131,2,92,2,125,11,125,12,124,11,144,1,114, - 6,116,10,116,11,124,4,100,7,100,8,133,2,25,0,131, - 1,124,11,131,2,114,242,116,11,124,4,100,8,100,9,133, - 2,25,0,131,1,124,12,107,3,144,1,114,6,116,12,160, - 13,100,10,124,3,155,2,157,2,161,1,1,0,100,0,83, - 0,116,14,160,15,124,4,100,9,100,0,133,2,25,0,161, - 1,125,13,116,16,124,13,116,17,131,2,144,1,115,52,116, - 18,100,11,124,1,155,2,100,12,157,3,131,1,130,1,124, - 13,83,0,41,13,78,41,2,114,59,0,0,0,114,13,0, - 0,0,114,5,0,0,0,114,0,0,0,0,114,84,0,0, - 0,90,5,110,101,118,101,114,90,6,97,108,119,97,121,115, - 114,97,0,0,0,114,92,0,0,0,114,93,0,0,0,122, - 22,98,121,116,101,99,111,100,101,32,105,115,32,115,116,97, - 108,101,32,102,111,114,32,122,16,99,111,109,112,105,108,101, - 100,32,109,111,100,117,108,101,32,122,21,32,105,115,32,110, - 111,116,32,97,32,99,111,100,101,32,111,98,106,101,99,116, - 41,19,114,21,0,0,0,90,13,95,99,108,97,115,115,105, - 102,121,95,112,121,99,114,75,0,0,0,218,4,95,105,109, - 112,90,21,99,104,101,99,107,95,104,97,115,104,95,98,97, - 115,101,100,95,112,121,99,115,218,15,95,103,101,116,95,112, - 121,99,95,115,111,117,114,99,101,218,11,115,111,117,114,99, - 101,95,104,97,115,104,90,17,95,82,65,87,95,77,65,71, - 73,67,95,78,85,77,66,69,82,90,18,95,118,97,108,105, - 100,97,116,101,95,104,97,115,104,95,112,121,99,218,29,95, - 103,101,116,95,109,116,105,109,101,95,97,110,100,95,115,105, - 122,101,95,111,102,95,115,111,117,114,99,101,114,145,0,0, - 0,114,2,0,0,0,114,76,0,0,0,114,77,0,0,0, - 218,7,109,97,114,115,104,97,108,90,5,108,111,97,100,115, - 114,15,0,0,0,218,10,95,99,111,100,101,95,116,121,112, - 101,218,9,84,121,112,101,69,114,114,111,114,41,14,114,32, - 0,0,0,114,53,0,0,0,114,63,0,0,0,114,38,0, - 0,0,114,124,0,0,0,90,11,101,120,99,95,100,101,116, - 97,105,108,115,114,127,0,0,0,90,10,104,97,115,104,95, - 98,97,115,101,100,90,12,99,104,101,99,107,95,115,111,117, - 114,99,101,90,12,115,111,117,114,99,101,95,98,121,116,101, - 115,114,148,0,0,0,90,12,115,111,117,114,99,101,95,109, - 116,105,109,101,90,11,115,111,117,114,99,101,95,115,105,122, - 101,114,46,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,15,95,117,110,109,97,114,115,104,97, - 108,95,99,111,100,101,72,2,0,0,115,82,0,0,0,0, - 2,2,1,2,254,6,5,2,1,18,1,12,1,8,2,12, - 1,4,1,12,1,10,1,2,255,2,1,8,255,2,2,10, - 1,8,1,4,1,4,1,2,254,4,5,2,1,4,1,8, - 255,8,2,12,1,10,3,8,255,6,3,6,3,22,1,18, - 255,4,2,4,1,8,255,4,2,4,2,18,1,12,1,16, - 1,114,153,0,0,0,99,1,0,0,0,0,0,0,0,0, - 0,0,0,1,0,0,0,4,0,0,0,67,0,0,0,115, - 28,0,0,0,124,0,160,0,100,1,100,2,161,2,125,0, - 124,0,160,0,100,3,100,2,161,2,125,0,124,0,83,0, - 41,4,78,115,2,0,0,0,13,10,243,1,0,0,0,10, - 243,1,0,0,0,13,41,1,114,19,0,0,0,41,1,218, - 6,115,111,117,114,99,101,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,218,23,95,110,111,114,109,97,108,105, - 122,101,95,108,105,110,101,95,101,110,100,105,110,103,115,123, - 2,0,0,115,6,0,0,0,0,1,12,1,12,1,114,157, - 0,0,0,99,2,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,6,0,0,0,67,0,0,0,115,24,0,0, - 0,116,0,124,1,131,1,125,1,116,1,124,1,124,0,100, - 1,100,2,100,3,141,4,83,0,41,4,78,114,74,0,0, - 0,84,41,1,90,12,100,111,110,116,95,105,110,104,101,114, - 105,116,41,2,114,157,0,0,0,218,7,99,111,109,112,105, - 108,101,41,2,114,53,0,0,0,114,156,0,0,0,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,218,15,95, - 99,111,109,112,105,108,101,95,115,111,117,114,99,101,130,2, - 0,0,115,4,0,0,0,0,1,8,1,114,159,0,0,0, - 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, - 0,11,0,0,0,67,0,0,0,115,68,0,0,0,116,0, - 160,1,124,0,100,1,63,0,100,2,23,0,124,0,100,3, - 63,0,100,4,64,0,124,0,100,5,64,0,124,1,100,6, - 63,0,124,1,100,3,63,0,100,7,64,0,124,1,100,5, - 64,0,100,8,20,0,100,9,100,9,100,9,102,9,161,1, - 83,0,41,10,78,233,9,0,0,0,105,188,7,0,0,233, - 5,0,0,0,233,15,0,0,0,233,31,0,0,0,233,11, - 0,0,0,233,63,0,0,0,114,84,0,0,0,114,14,0, - 0,0,41,2,114,129,0,0,0,90,6,109,107,116,105,109, - 101,41,2,218,1,100,114,136,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,218,14,95,112,97,114, - 115,101,95,100,111,115,116,105,109,101,136,2,0,0,115,18, - 0,0,0,0,1,4,1,10,1,10,1,6,1,6,1,10, - 1,10,1,6,249,114,167,0,0,0,99,2,0,0,0,0, - 0,0,0,0,0,0,0,6,0,0,0,10,0,0,0,67, - 0,0,0,115,114,0,0,0,122,82,124,1,100,1,100,0, - 133,2,25,0,100,2,118,0,115,22,74,0,130,1,124,1, - 100,0,100,1,133,2,25,0,125,1,124,0,106,0,124,1, - 25,0,125,2,124,2,100,3,25,0,125,3,124,2,100,4, - 25,0,125,4,124,2,100,5,25,0,125,5,116,1,124,4, - 124,3,131,2,124,5,102,2,87,0,83,0,4,0,116,2, - 116,3,116,4,102,3,121,108,1,0,1,0,1,0,89,0, - 100,6,83,0,48,0,100,0,83,0,41,7,78,114,14,0, - 0,0,169,2,218,1,99,218,1,111,114,161,0,0,0,233, - 6,0,0,0,233,3,0,0,0,41,2,114,0,0,0,0, - 114,0,0,0,0,41,5,114,28,0,0,0,114,167,0,0, - 0,114,26,0,0,0,218,10,73,110,100,101,120,69,114,114, - 111,114,114,152,0,0,0,41,6,114,32,0,0,0,114,13, - 0,0,0,114,54,0,0,0,114,129,0,0,0,114,130,0, - 0,0,90,17,117,110,99,111,109,112,114,101,115,115,101,100, - 95,115,105,122,101,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,114,149,0,0,0,149,2,0,0,115,20,0, - 0,0,0,1,2,2,20,1,12,1,10,3,8,1,8,1, - 8,1,16,1,18,1,114,149,0,0,0,99,2,0,0,0, - 0,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0, - 67,0,0,0,115,84,0,0,0,124,1,100,1,100,0,133, - 2,25,0,100,2,118,0,115,20,74,0,130,1,124,1,100, - 0,100,1,133,2,25,0,125,1,122,14,124,0,106,0,124, - 1,25,0,125,2,87,0,110,20,4,0,116,1,121,66,1, - 0,1,0,1,0,89,0,100,0,83,0,48,0,116,2,124, - 0,106,3,124,2,131,2,83,0,100,0,83,0,41,3,78, - 114,14,0,0,0,114,168,0,0,0,41,4,114,28,0,0, - 0,114,26,0,0,0,114,52,0,0,0,114,29,0,0,0, - 41,3,114,32,0,0,0,114,13,0,0,0,114,54,0,0, - 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, - 114,147,0,0,0,168,2,0,0,115,14,0,0,0,0,2, - 20,1,12,2,2,1,14,1,12,1,8,2,114,147,0,0, - 0,99,2,0,0,0,0,0,0,0,0,0,0,0,11,0, - 0,0,9,0,0,0,67,0,0,0,115,196,0,0,0,116, - 0,124,0,124,1,131,2,125,2,116,1,68,0,93,158,92, - 3,125,3,125,4,125,5,124,2,124,3,23,0,125,6,116, - 2,106,3,100,1,124,0,106,4,116,5,124,6,100,2,100, - 3,141,5,1,0,122,14,124,0,106,6,124,6,25,0,125, - 7,87,0,110,18,4,0,116,7,121,86,1,0,1,0,1, - 0,89,0,113,14,48,0,124,7,100,4,25,0,125,8,116, - 8,124,0,106,4,124,7,131,2,125,9,124,4,114,130,116, - 9,124,0,124,8,124,6,124,1,124,9,131,5,125,10,110, - 10,116,10,124,8,124,9,131,2,125,10,124,10,100,0,117, - 0,114,150,113,14,124,7,100,4,25,0,125,8,124,10,124, - 5,124,8,102,3,2,0,1,0,83,0,113,14,116,11,100, - 5,124,1,155,2,157,2,124,1,100,6,141,2,130,1,100, - 0,83,0,41,7,78,122,13,116,114,121,105,110,103,32,123, - 125,123,125,123,125,114,84,0,0,0,41,1,90,9,118,101, - 114,98,111,115,105,116,121,114,0,0,0,0,114,57,0,0, - 0,114,58,0,0,0,41,12,114,36,0,0,0,114,87,0, - 0,0,114,76,0,0,0,114,77,0,0,0,114,29,0,0, - 0,114,20,0,0,0,114,28,0,0,0,114,26,0,0,0, - 114,52,0,0,0,114,153,0,0,0,114,159,0,0,0,114, - 3,0,0,0,41,11,114,32,0,0,0,114,38,0,0,0, - 114,13,0,0,0,114,88,0,0,0,114,89,0,0,0,114, - 47,0,0,0,114,63,0,0,0,114,54,0,0,0,114,40, - 0,0,0,114,124,0,0,0,114,46,0,0,0,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,114,44,0,0, - 0,183,2,0,0,115,36,0,0,0,0,1,10,1,14,1, - 8,1,22,1,2,1,14,1,12,1,6,2,8,1,12,1, - 4,1,18,2,10,1,8,3,2,1,8,1,16,2,114,44, - 0,0,0,41,44,114,82,0,0,0,90,26,95,102,114,111, - 122,101,110,95,105,109,112,111,114,116,108,105,98,95,101,120, - 116,101,114,110,97,108,114,21,0,0,0,114,1,0,0,0, - 114,2,0,0,0,90,17,95,102,114,111,122,101,110,95,105, - 109,112,111,114,116,108,105,98,114,76,0,0,0,114,146,0, - 0,0,114,108,0,0,0,114,150,0,0,0,114,67,0,0, - 0,114,129,0,0,0,90,7,95,95,97,108,108,95,95,114, - 20,0,0,0,90,15,112,97,116,104,95,115,101,112,97,114, - 97,116,111,114,115,114,18,0,0,0,114,75,0,0,0,114, - 3,0,0,0,114,25,0,0,0,218,4,116,121,112,101,114, - 70,0,0,0,114,111,0,0,0,114,113,0,0,0,114,115, - 0,0,0,114,4,0,0,0,114,87,0,0,0,114,36,0, - 0,0,114,37,0,0,0,114,35,0,0,0,114,27,0,0, - 0,114,120,0,0,0,114,140,0,0,0,114,142,0,0,0, - 114,52,0,0,0,114,145,0,0,0,114,153,0,0,0,218, - 8,95,95,99,111,100,101,95,95,114,151,0,0,0,114,157, - 0,0,0,114,159,0,0,0,114,167,0,0,0,114,149,0, - 0,0,114,147,0,0,0,114,44,0,0,0,114,9,0,0, - 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, - 218,8,60,109,111,100,117,108,101,62,1,0,0,0,115,84, - 0,0,0,4,16,8,1,16,1,8,1,8,1,8,1,8, - 1,8,1,8,2,8,3,6,1,14,3,16,4,4,2,8, - 2,4,1,4,1,4,2,14,127,0,125,12,1,12,1,2, - 1,2,252,4,9,8,4,8,9,8,31,8,126,2,254,2, - 29,4,5,8,21,8,46,8,10,8,46,10,5,8,7,8, - 6,8,13,8,19,8,15, + 2,48,0,116,8,124,23,131,1,124,19,107,3,144,3,114, + 238,116,3,100,4,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,122,50,116,8,124,1,160,7,124,8,124,19,24, + 0,161,1,131,1,124,8,124,19,24,0,107,3,144,4,114, + 30,116,3,100,4,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,87,0,110,38,4,0,116,2,144,4,121,70,1, + 0,1,0,1,0,116,3,100,4,124,0,155,2,157,2,124, + 0,100,2,141,2,130,1,89,0,110,2,48,0,124,13,100, + 28,64,0,144,4,114,92,124,23,160,16,161,0,125,23,110, + 52,122,14,124,23,160,16,100,29,161,1,125,23,87,0,110, + 36,4,0,116,17,144,4,121,142,1,0,1,0,1,0,124, + 23,160,16,100,30,161,1,160,18,116,19,161,1,125,23,89, + 0,110,2,48,0,124,23,160,20,100,31,116,21,161,2,125, + 23,116,22,160,23,124,0,124,23,161,2,125,24,124,24,124, + 14,124,18,124,4,124,22,124,15,124,16,124,17,102,8,125, + 25,124,25,124,11,124,23,60,0,124,12,100,32,55,0,125, + 12,144,2,113,108,87,0,100,0,4,0,4,0,131,3,1, + 0,110,18,49,0,144,4,115,230,48,0,1,0,1,0,1, + 0,89,0,1,0,116,24,160,25,100,33,124,12,124,0,161, + 3,1,0,124,11,83,0,41,34,78,122,21,99,97,110,39, + 116,32,111,112,101,110,32,90,105,112,32,102,105,108,101,58, + 32,114,12,0,0,0,114,84,0,0,0,250,21,99,97,110, + 39,116,32,114,101,97,100,32,90,105,112,32,102,105,108,101, + 58,32,233,4,0,0,0,114,0,0,0,0,122,16,110,111, + 116,32,97,32,90,105,112,32,102,105,108,101,58,32,122,18, + 99,111,114,114,117,112,116,32,90,105,112,32,102,105,108,101, + 58,32,233,12,0,0,0,233,16,0,0,0,233,20,0,0, + 0,122,28,98,97,100,32,99,101,110,116,114,97,108,32,100, + 105,114,101,99,116,111,114,121,32,115,105,122,101,58,32,122, + 30,98,97,100,32,99,101,110,116,114,97,108,32,100,105,114, + 101,99,116,111,114,121,32,111,102,102,115,101,116,58,32,122, + 38,98,97,100,32,99,101,110,116,114,97,108,32,100,105,114, + 101,99,116,111,114,121,32,115,105,122,101,32,111,114,32,111, + 102,102,115,101,116,58,32,233,46,0,0,0,250,27,69,79, + 70,32,114,101,97,100,32,119,104,101,114,101,32,110,111,116, + 32,101,120,112,101,99,116,101,100,115,4,0,0,0,80,75, + 1,2,233,8,0,0,0,233,10,0,0,0,233,14,0,0, + 0,233,24,0,0,0,233,28,0,0,0,233,30,0,0,0, + 233,32,0,0,0,233,34,0,0,0,233,42,0,0,0,122, + 25,98,97,100,32,108,111,99,97,108,32,104,101,97,100,101, + 114,32,111,102,102,115,101,116,58,32,105,0,8,0,0,218, + 5,97,115,99,105,105,90,6,108,97,116,105,110,49,250,1, + 47,114,5,0,0,0,122,33,122,105,112,105,109,112,111,114, + 116,58,32,102,111,117,110,100,32,123,125,32,110,97,109,101, + 115,32,105,110,32,123,33,114,125,41,26,218,3,95,105,111, + 218,9,111,112,101,110,95,99,111,100,101,114,22,0,0,0, + 114,3,0,0,0,218,4,115,101,101,107,218,20,69,78,68, + 95,67,69,78,84,82,65,76,95,68,73,82,95,83,73,90, + 69,90,4,116,101,108,108,218,4,114,101,97,100,114,51,0, + 0,0,218,18,83,84,82,73,78,71,95,69,78,68,95,65, + 82,67,72,73,86,69,218,3,109,97,120,218,15,77,65,88, + 95,67,79,77,77,69,78,84,95,76,69,78,218,5,114,102, + 105,110,100,114,2,0,0,0,218,8,69,79,70,69,114,114, + 111,114,114,1,0,0,0,114,62,0,0,0,218,18,85,110, + 105,99,111,100,101,68,101,99,111,100,101,69,114,114,111,114, + 218,9,116,114,97,110,115,108,97,116,101,218,11,99,112,52, + 51,55,95,116,97,98,108,101,114,19,0,0,0,114,20,0, + 0,0,114,21,0,0,0,114,30,0,0,0,114,76,0,0, + 0,114,77,0,0,0,41,26,114,29,0,0,0,218,2,102, + 112,90,15,104,101,97,100,101,114,95,112,111,115,105,116,105, + 111,110,218,6,98,117,102,102,101,114,218,9,102,105,108,101, + 95,115,105,122,101,90,17,109,97,120,95,99,111,109,109,101, + 110,116,95,115,116,97,114,116,218,4,100,97,116,97,90,3, + 112,111,115,218,11,104,101,97,100,101,114,95,115,105,122,101, + 90,13,104,101,97,100,101,114,95,111,102,102,115,101,116,90, + 10,97,114,99,95,111,102,102,115,101,116,114,33,0,0,0, + 218,5,99,111,117,110,116,218,5,102,108,97,103,115,218,8, + 99,111,109,112,114,101,115,115,218,4,116,105,109,101,218,4, + 100,97,116,101,218,3,99,114,99,218,9,100,97,116,97,95, + 115,105,122,101,218,9,110,97,109,101,95,115,105,122,101,218, + 10,101,120,116,114,97,95,115,105,122,101,90,12,99,111,109, + 109,101,110,116,95,115,105,122,101,218,11,102,105,108,101,95, + 111,102,102,115,101,116,114,59,0,0,0,114,13,0,0,0, + 218,1,116,114,9,0,0,0,114,9,0,0,0,114,10,0, + 0,0,114,27,0,0,0,93,1,0,0,115,212,0,0,0, + 0,1,2,1,14,1,12,1,24,2,8,1,2,1,14,1, + 8,1,14,1,12,1,24,1,12,1,18,1,18,3,2,1, + 12,1,12,1,12,1,10,1,2,255,12,2,8,1,2,255, + 2,1,2,255,4,2,2,1,10,1,12,1,14,1,10,1, + 2,255,12,2,10,1,10,1,10,1,2,255,6,2,16,1, + 14,1,10,1,2,255,6,2,16,2,16,1,16,1,10,1, + 18,1,10,1,18,1,8,1,8,1,10,1,18,2,4,2, + 4,1,2,1,14,1,14,1,24,2,10,1,14,1,8,2, + 18,1,4,1,14,1,8,1,16,1,16,1,16,1,16,1, + 16,1,16,1,16,1,16,1,16,1,16,1,16,1,12,1, + 10,1,18,1,8,2,2,1,14,1,14,1,24,1,14,1, + 18,4,2,1,28,1,22,1,14,1,24,2,10,2,10,3, + 2,1,14,1,14,1,22,2,12,1,12,1,20,1,8,1, + 44,1,14,1,114,27,0,0,0,117,190,1,0,0,0,1, + 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17, + 18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33, + 34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49, + 50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65, + 66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81, + 82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97, + 98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113, + 114,115,116,117,118,119,120,121,122,123,124,125,126,127,195,135, + 195,188,195,169,195,162,195,164,195,160,195,165,195,167,195,170, + 195,171,195,168,195,175,195,174,195,172,195,132,195,133,195,137, + 195,166,195,134,195,180,195,182,195,178,195,187,195,185,195,191, + 195,150,195,156,194,162,194,163,194,165,226,130,167,198,146,195, + 161,195,173,195,179,195,186,195,177,195,145,194,170,194,186,194, + 191,226,140,144,194,172,194,189,194,188,194,161,194,171,194,187, + 226,150,145,226,150,146,226,150,147,226,148,130,226,148,164,226, + 149,161,226,149,162,226,149,150,226,149,149,226,149,163,226,149, + 145,226,149,151,226,149,157,226,149,156,226,149,155,226,148,144, + 226,148,148,226,148,180,226,148,172,226,148,156,226,148,128,226, + 148,188,226,149,158,226,149,159,226,149,154,226,149,148,226,149, + 169,226,149,166,226,149,160,226,149,144,226,149,172,226,149,167, + 226,149,168,226,149,164,226,149,165,226,149,153,226,149,152,226, + 149,146,226,149,147,226,149,171,226,149,170,226,148,152,226,148, + 140,226,150,136,226,150,132,226,150,140,226,150,144,226,150,128, + 206,177,195,159,206,147,207,128,206,163,207,131,194,181,207,132, + 206,166,206,152,206,169,206,180,226,136,158,207,134,206,181,226, + 136,169,226,137,161,194,177,226,137,165,226,137,164,226,140,160, + 226,140,161,195,183,226,137,136,194,176,226,136,153,194,183,226, + 136,154,226,129,191,194,178,226,150,160,194,160,99,0,0,0, + 0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0, + 0,67,0,0,0,115,110,0,0,0,116,0,114,22,116,1, + 160,2,100,1,161,1,1,0,116,3,100,2,131,1,130,1, + 100,3,97,0,122,62,122,16,100,4,100,5,108,4,109,5, + 125,0,1,0,87,0,110,36,4,0,116,6,121,80,1,0, + 1,0,1,0,116,1,160,2,100,1,161,1,1,0,116,3, + 100,2,131,1,130,1,89,0,110,2,48,0,87,0,100,6, + 97,0,110,6,100,6,97,0,48,0,116,1,160,2,100,7, + 161,1,1,0,124,0,83,0,41,8,78,122,27,122,105,112, + 105,109,112,111,114,116,58,32,122,108,105,98,32,85,78,65, + 86,65,73,76,65,66,76,69,250,41,99,97,110,39,116,32, + 100,101,99,111,109,112,114,101,115,115,32,100,97,116,97,59, + 32,122,108,105,98,32,110,111,116,32,97,118,97,105,108,97, + 98,108,101,84,114,0,0,0,0,169,1,218,10,100,101,99, + 111,109,112,114,101,115,115,70,122,25,122,105,112,105,109,112, + 111,114,116,58,32,122,108,105,98,32,97,118,97,105,108,97, + 98,108,101,41,7,218,15,95,105,109,112,111,114,116,105,110, + 103,95,122,108,105,98,114,76,0,0,0,114,77,0,0,0, + 114,3,0,0,0,90,4,122,108,105,98,114,139,0,0,0, + 218,9,69,120,99,101,112,116,105,111,110,114,138,0,0,0, + 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, + 20,95,103,101,116,95,100,101,99,111,109,112,114,101,115,115, + 95,102,117,110,99,251,1,0,0,115,24,0,0,0,0,2, + 4,3,10,1,8,2,4,1,4,1,16,1,12,1,10,1, + 16,2,12,2,10,1,114,142,0,0,0,99,2,0,0,0, + 0,0,0,0,0,0,0,0,17,0,0,0,9,0,0,0, + 67,0,0,0,115,144,1,0,0,124,1,92,8,125,2,125, + 3,125,4,125,5,125,6,125,7,125,8,125,9,124,4,100, + 1,107,0,114,36,116,0,100,2,131,1,130,1,116,1,160, + 2,124,0,161,1,144,1,143,14,125,10,122,14,124,10,160, + 3,124,6,161,1,1,0,87,0,110,36,4,0,116,4,121, + 100,1,0,1,0,1,0,116,0,100,3,124,0,155,2,157, + 2,124,0,100,4,141,2,130,1,89,0,110,2,48,0,124, + 10,160,5,100,5,161,1,125,11,116,6,124,11,131,1,100, + 5,107,3,114,132,116,7,100,6,131,1,130,1,124,11,100, + 0,100,7,133,2,25,0,100,8,107,3,114,166,116,0,100, + 9,124,0,155,2,157,2,124,0,100,4,141,2,130,1,116, + 8,124,11,100,10,100,11,133,2,25,0,131,1,125,12,116, + 8,124,11,100,11,100,5,133,2,25,0,131,1,125,13,100, + 5,124,12,23,0,124,13,23,0,125,14,124,6,124,14,55, + 0,125,6,122,14,124,10,160,3,124,6,161,1,1,0,87, + 0,110,38,4,0,116,4,144,1,121,14,1,0,1,0,1, + 0,116,0,100,3,124,0,155,2,157,2,124,0,100,4,141, + 2,130,1,89,0,110,2,48,0,124,10,160,5,124,4,161, + 1,125,15,116,6,124,15,131,1,124,4,107,3,144,1,114, + 48,116,4,100,12,131,1,130,1,87,0,100,0,4,0,4, + 0,131,3,1,0,110,18,49,0,144,1,115,70,48,0,1, + 0,1,0,1,0,89,0,1,0,124,3,100,1,107,2,144, + 1,114,94,124,15,83,0,122,10,116,9,131,0,125,16,87, + 0,110,28,4,0,116,10,144,1,121,132,1,0,1,0,1, + 0,116,0,100,13,131,1,130,1,89,0,110,2,48,0,124, + 16,124,15,100,14,131,2,83,0,41,15,78,114,0,0,0, + 0,122,18,110,101,103,97,116,105,118,101,32,100,97,116,97, + 32,115,105,122,101,114,90,0,0,0,114,12,0,0,0,114, + 102,0,0,0,114,96,0,0,0,114,91,0,0,0,115,4, + 0,0,0,80,75,3,4,122,23,98,97,100,32,108,111,99, + 97,108,32,102,105,108,101,32,104,101,97,100,101,114,58,32, + 233,26,0,0,0,114,101,0,0,0,122,26,122,105,112,105, + 109,112,111,114,116,58,32,99,97,110,39,116,32,114,101,97, + 100,32,100,97,116,97,114,137,0,0,0,105,241,255,255,255, + 41,11,114,3,0,0,0,114,108,0,0,0,114,109,0,0, + 0,114,110,0,0,0,114,22,0,0,0,114,112,0,0,0, + 114,51,0,0,0,114,117,0,0,0,114,1,0,0,0,114, + 142,0,0,0,114,141,0,0,0,41,17,114,29,0,0,0, + 114,54,0,0,0,90,8,100,97,116,97,112,97,116,104,114, + 128,0,0,0,114,132,0,0,0,114,123,0,0,0,114,135, + 0,0,0,114,129,0,0,0,114,130,0,0,0,114,131,0, + 0,0,114,121,0,0,0,114,122,0,0,0,114,133,0,0, + 0,114,134,0,0,0,114,125,0,0,0,90,8,114,97,119, + 95,100,97,116,97,114,139,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,114,52,0,0,0,16,2, + 0,0,115,62,0,0,0,0,1,20,1,8,1,8,2,14, + 2,2,1,14,1,12,1,24,1,10,1,12,1,8,2,16, + 2,18,2,16,1,16,1,12,1,8,1,2,1,14,1,14, + 1,24,1,10,1,14,1,40,2,10,2,4,3,2,1,10, + 1,14,1,14,1,114,52,0,0,0,99,2,0,0,0,0, + 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,67, + 0,0,0,115,16,0,0,0,116,0,124,0,124,1,24,0, + 131,1,100,1,107,1,83,0,41,2,78,114,5,0,0,0, + 41,1,218,3,97,98,115,41,2,90,2,116,49,90,2,116, + 50,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 218,9,95,101,113,95,109,116,105,109,101,62,2,0,0,115, + 2,0,0,0,0,2,114,145,0,0,0,99,5,0,0,0, + 0,0,0,0,0,0,0,0,14,0,0,0,8,0,0,0, + 67,0,0,0,115,60,1,0,0,124,3,124,2,100,1,156, + 2,125,5,122,18,116,0,160,1,124,4,124,3,124,5,161, + 3,125,6,87,0,110,20,4,0,116,2,121,48,1,0,1, + 0,1,0,89,0,100,0,83,0,48,0,124,6,100,2,64, + 0,100,3,107,3,125,7,124,7,114,182,124,6,100,4,64, + 0,100,3,107,3,125,8,116,3,106,4,100,5,107,3,144, + 1,114,10,124,8,115,106,116,3,106,4,100,6,107,2,144, + 1,114,10,116,5,124,0,124,2,131,2,125,9,124,9,100, + 0,117,1,144,1,114,10,116,3,160,6,116,0,106,7,124, + 9,161,2,125,10,122,20,116,0,160,8,124,4,124,10,124, + 3,124,5,161,4,1,0,87,0,110,104,4,0,116,2,121, + 180,1,0,1,0,1,0,89,0,100,0,83,0,48,0,116, + 9,124,0,124,2,131,2,92,2,125,11,125,12,124,11,144, + 1,114,10,116,10,116,11,124,4,100,7,100,8,133,2,25, + 0,131,1,124,11,131,2,114,246,116,11,124,4,100,8,100, + 9,133,2,25,0,131,1,124,12,107,3,144,1,114,10,116, + 12,160,13,100,10,124,3,155,2,157,2,161,1,1,0,100, + 0,83,0,116,14,160,15,124,4,100,9,100,0,133,2,25, + 0,161,1,125,13,116,16,124,13,116,17,131,2,144,1,115, + 56,116,18,100,11,124,1,155,2,100,12,157,3,131,1,130, + 1,124,13,83,0,41,13,78,41,2,114,59,0,0,0,114, + 13,0,0,0,114,5,0,0,0,114,0,0,0,0,114,84, + 0,0,0,90,5,110,101,118,101,114,90,6,97,108,119,97, + 121,115,114,97,0,0,0,114,92,0,0,0,114,93,0,0, + 0,122,22,98,121,116,101,99,111,100,101,32,105,115,32,115, + 116,97,108,101,32,102,111,114,32,122,16,99,111,109,112,105, + 108,101,100,32,109,111,100,117,108,101,32,122,21,32,105,115, + 32,110,111,116,32,97,32,99,111,100,101,32,111,98,106,101, + 99,116,41,19,114,21,0,0,0,90,13,95,99,108,97,115, + 115,105,102,121,95,112,121,99,114,75,0,0,0,218,4,95, + 105,109,112,90,21,99,104,101,99,107,95,104,97,115,104,95, + 98,97,115,101,100,95,112,121,99,115,218,15,95,103,101,116, + 95,112,121,99,95,115,111,117,114,99,101,218,11,115,111,117, + 114,99,101,95,104,97,115,104,90,17,95,82,65,87,95,77, + 65,71,73,67,95,78,85,77,66,69,82,90,18,95,118,97, + 108,105,100,97,116,101,95,104,97,115,104,95,112,121,99,218, + 29,95,103,101,116,95,109,116,105,109,101,95,97,110,100,95, + 115,105,122,101,95,111,102,95,115,111,117,114,99,101,114,145, + 0,0,0,114,2,0,0,0,114,76,0,0,0,114,77,0, + 0,0,218,7,109,97,114,115,104,97,108,90,5,108,111,97, + 100,115,114,15,0,0,0,218,10,95,99,111,100,101,95,116, + 121,112,101,218,9,84,121,112,101,69,114,114,111,114,41,14, + 114,32,0,0,0,114,53,0,0,0,114,63,0,0,0,114, + 38,0,0,0,114,124,0,0,0,90,11,101,120,99,95,100, + 101,116,97,105,108,115,114,127,0,0,0,90,10,104,97,115, + 104,95,98,97,115,101,100,90,12,99,104,101,99,107,95,115, + 111,117,114,99,101,90,12,115,111,117,114,99,101,95,98,121, + 116,101,115,114,148,0,0,0,90,12,115,111,117,114,99,101, + 95,109,116,105,109,101,90,11,115,111,117,114,99,101,95,115, + 105,122,101,114,46,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,15,95,117,110,109,97,114,115, + 104,97,108,95,99,111,100,101,72,2,0,0,115,82,0,0, + 0,0,2,2,1,2,254,6,5,2,1,18,1,12,1,8, + 2,12,1,4,1,12,1,12,1,2,255,2,1,8,255,4, + 2,10,1,10,1,4,1,4,1,2,254,4,5,2,1,4, + 1,8,255,8,2,12,1,8,3,8,255,6,3,6,3,22, + 1,18,255,4,2,4,1,8,255,4,2,4,2,18,1,12, + 1,16,1,114,153,0,0,0,99,1,0,0,0,0,0,0, + 0,0,0,0,0,1,0,0,0,4,0,0,0,67,0,0, + 0,115,28,0,0,0,124,0,160,0,100,1,100,2,161,2, + 125,0,124,0,160,0,100,3,100,2,161,2,125,0,124,0, + 83,0,41,4,78,115,2,0,0,0,13,10,243,1,0,0, + 0,10,243,1,0,0,0,13,41,1,114,19,0,0,0,41, + 1,218,6,115,111,117,114,99,101,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,23,95,110,111,114,109,97, + 108,105,122,101,95,108,105,110,101,95,101,110,100,105,110,103, + 115,123,2,0,0,115,6,0,0,0,0,1,12,1,12,1, + 114,157,0,0,0,99,2,0,0,0,0,0,0,0,0,0, + 0,0,2,0,0,0,6,0,0,0,67,0,0,0,115,24, + 0,0,0,116,0,124,1,131,1,125,1,116,1,124,1,124, + 0,100,1,100,2,100,3,141,4,83,0,41,4,78,114,74, + 0,0,0,84,41,1,90,12,100,111,110,116,95,105,110,104, + 101,114,105,116,41,2,114,157,0,0,0,218,7,99,111,109, + 112,105,108,101,41,2,114,53,0,0,0,114,156,0,0,0, + 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, + 15,95,99,111,109,112,105,108,101,95,115,111,117,114,99,101, + 130,2,0,0,115,4,0,0,0,0,1,8,1,114,159,0, + 0,0,99,2,0,0,0,0,0,0,0,0,0,0,0,2, + 0,0,0,11,0,0,0,67,0,0,0,115,68,0,0,0, + 116,0,160,1,124,0,100,1,63,0,100,2,23,0,124,0, + 100,3,63,0,100,4,64,0,124,0,100,5,64,0,124,1, + 100,6,63,0,124,1,100,3,63,0,100,7,64,0,124,1, + 100,5,64,0,100,8,20,0,100,9,100,9,100,9,102,9, + 161,1,83,0,41,10,78,233,9,0,0,0,105,188,7,0, + 0,233,5,0,0,0,233,15,0,0,0,233,31,0,0,0, + 233,11,0,0,0,233,63,0,0,0,114,84,0,0,0,114, + 14,0,0,0,41,2,114,129,0,0,0,90,6,109,107,116, + 105,109,101,41,2,218,1,100,114,136,0,0,0,114,9,0, + 0,0,114,9,0,0,0,114,10,0,0,0,218,14,95,112, + 97,114,115,101,95,100,111,115,116,105,109,101,136,2,0,0, + 115,18,0,0,0,0,1,4,1,10,1,10,1,6,1,6, + 1,10,1,10,1,6,249,114,167,0,0,0,99,2,0,0, + 0,0,0,0,0,0,0,0,0,6,0,0,0,10,0,0, + 0,67,0,0,0,115,110,0,0,0,122,82,124,1,100,1, + 100,0,133,2,25,0,100,2,118,0,115,22,74,0,130,1, + 124,1,100,0,100,1,133,2,25,0,125,1,124,0,106,0, + 124,1,25,0,125,2,124,2,100,3,25,0,125,3,124,2, + 100,4,25,0,125,4,124,2,100,5,25,0,125,5,116,1, + 124,4,124,3,131,2,124,5,102,2,87,0,83,0,4,0, + 116,2,116,3,116,4,102,3,121,108,1,0,1,0,1,0, + 89,0,100,6,83,0,48,0,41,7,78,114,14,0,0,0, + 169,2,218,1,99,218,1,111,114,161,0,0,0,233,6,0, + 0,0,233,3,0,0,0,41,2,114,0,0,0,0,114,0, + 0,0,0,41,5,114,28,0,0,0,114,167,0,0,0,114, + 26,0,0,0,218,10,73,110,100,101,120,69,114,114,111,114, + 114,152,0,0,0,41,6,114,32,0,0,0,114,13,0,0, + 0,114,54,0,0,0,114,129,0,0,0,114,130,0,0,0, + 90,17,117,110,99,111,109,112,114,101,115,115,101,100,95,115, + 105,122,101,114,9,0,0,0,114,9,0,0,0,114,10,0, + 0,0,114,149,0,0,0,149,2,0,0,115,20,0,0,0, + 0,1,2,2,20,1,12,1,10,3,8,1,8,1,8,1, + 16,1,18,1,114,149,0,0,0,99,2,0,0,0,0,0, + 0,0,0,0,0,0,3,0,0,0,8,0,0,0,67,0, + 0,0,115,80,0,0,0,124,1,100,1,100,0,133,2,25, + 0,100,2,118,0,115,20,74,0,130,1,124,1,100,0,100, + 1,133,2,25,0,125,1,122,14,124,0,106,0,124,1,25, + 0,125,2,87,0,110,20,4,0,116,1,121,66,1,0,1, + 0,1,0,89,0,100,0,83,0,48,0,116,2,124,0,106, + 3,124,2,131,2,83,0,41,3,78,114,14,0,0,0,114, + 168,0,0,0,41,4,114,28,0,0,0,114,26,0,0,0, + 114,52,0,0,0,114,29,0,0,0,41,3,114,32,0,0, + 0,114,13,0,0,0,114,54,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,114,147,0,0,0,168, + 2,0,0,115,14,0,0,0,0,2,20,1,12,2,2,1, + 14,1,12,1,8,2,114,147,0,0,0,99,2,0,0,0, + 0,0,0,0,0,0,0,0,11,0,0,0,9,0,0,0, + 67,0,0,0,115,194,0,0,0,116,0,124,0,124,1,131, + 2,125,2,116,1,68,0,93,156,92,3,125,3,125,4,125, + 5,124,2,124,3,23,0,125,6,116,2,106,3,100,1,124, + 0,106,4,116,5,124,6,100,2,100,3,141,5,1,0,122, + 14,124,0,106,6,124,6,25,0,125,7,87,0,110,18,4, + 0,116,7,121,86,1,0,1,0,1,0,89,0,113,14,48, + 0,124,7,100,4,25,0,125,8,116,8,124,0,106,4,124, + 7,131,2,125,9,124,4,114,130,116,9,124,0,124,8,124, + 6,124,1,124,9,131,5,125,10,110,10,116,10,124,8,124, + 9,131,2,125,10,124,10,100,0,117,0,114,150,113,14,124, + 7,100,4,25,0,125,8,124,10,124,5,124,8,102,3,2, + 0,1,0,83,0,116,11,100,5,124,1,155,2,157,2,124, + 1,100,6,141,2,130,1,100,0,83,0,41,7,78,122,13, + 116,114,121,105,110,103,32,123,125,123,125,123,125,114,84,0, + 0,0,41,1,90,9,118,101,114,98,111,115,105,116,121,114, + 0,0,0,0,114,57,0,0,0,114,58,0,0,0,41,12, + 114,36,0,0,0,114,87,0,0,0,114,76,0,0,0,114, + 77,0,0,0,114,29,0,0,0,114,20,0,0,0,114,28, + 0,0,0,114,26,0,0,0,114,52,0,0,0,114,153,0, + 0,0,114,159,0,0,0,114,3,0,0,0,41,11,114,32, + 0,0,0,114,38,0,0,0,114,13,0,0,0,114,88,0, + 0,0,114,89,0,0,0,114,47,0,0,0,114,63,0,0, + 0,114,54,0,0,0,114,40,0,0,0,114,124,0,0,0, + 114,46,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,114,44,0,0,0,183,2,0,0,115,36,0, + 0,0,0,1,10,1,14,1,8,1,22,1,2,1,14,1, + 12,1,6,2,8,1,12,1,4,1,18,2,10,1,8,3, + 2,1,8,1,14,2,114,44,0,0,0,41,44,114,82,0, + 0,0,90,26,95,102,114,111,122,101,110,95,105,109,112,111, + 114,116,108,105,98,95,101,120,116,101,114,110,97,108,114,21, + 0,0,0,114,1,0,0,0,114,2,0,0,0,90,17,95, + 102,114,111,122,101,110,95,105,109,112,111,114,116,108,105,98, + 114,76,0,0,0,114,146,0,0,0,114,108,0,0,0,114, + 150,0,0,0,114,67,0,0,0,114,129,0,0,0,90,7, + 95,95,97,108,108,95,95,114,20,0,0,0,90,15,112,97, + 116,104,95,115,101,112,97,114,97,116,111,114,115,114,18,0, + 0,0,114,75,0,0,0,114,3,0,0,0,114,25,0,0, + 0,218,4,116,121,112,101,114,70,0,0,0,114,111,0,0, + 0,114,113,0,0,0,114,115,0,0,0,114,4,0,0,0, + 114,87,0,0,0,114,36,0,0,0,114,37,0,0,0,114, + 35,0,0,0,114,27,0,0,0,114,120,0,0,0,114,140, + 0,0,0,114,142,0,0,0,114,52,0,0,0,114,145,0, + 0,0,114,153,0,0,0,218,8,95,95,99,111,100,101,95, + 95,114,151,0,0,0,114,157,0,0,0,114,159,0,0,0, + 114,167,0,0,0,114,149,0,0,0,114,147,0,0,0,114, + 44,0,0,0,114,9,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,8,60,109,111,100,117,108, + 101,62,1,0,0,0,115,84,0,0,0,4,16,8,1,16, + 1,8,1,8,1,8,1,8,1,8,1,8,2,8,3,6, + 1,14,3,16,4,4,2,8,2,4,1,4,1,4,2,14, + 127,0,125,12,1,12,1,2,1,2,252,4,9,8,4,8, + 9,8,31,8,126,2,254,2,29,4,5,8,21,8,46,8, + 10,8,46,10,5,8,7,8,6,8,13,8,19,8,15, }; diff --git a/Python/peephole.c b/Python/peephole.c deleted file mode 100644 index fe67de42227b5b..00000000000000 --- a/Python/peephole.c +++ /dev/null @@ -1,537 +0,0 @@ -/* Peephole optimizations for bytecode compiler. */ - -#include "Python.h" - -#include "Python-ast.h" -#include "ast.h" -#include "code.h" -#include "symtable.h" -#include "opcode.h" -#include "wordcode_helpers.h" - -#define UNCONDITIONAL_JUMP(op) (op==JUMP_ABSOLUTE || op==JUMP_FORWARD) -#define CONDITIONAL_JUMP(op) (op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ - || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_NOT_EXC_MATCH) -#define ABSOLUTE_JUMP(op) (op==JUMP_ABSOLUTE \ - || op==POP_JUMP_IF_FALSE || op==POP_JUMP_IF_TRUE \ - || op==JUMP_IF_FALSE_OR_POP || op==JUMP_IF_TRUE_OR_POP || op==JUMP_IF_NOT_EXC_MATCH) -#define JUMPS_ON_TRUE(op) (op==POP_JUMP_IF_TRUE || op==JUMP_IF_TRUE_OR_POP) -#define GETJUMPTGT(arr, i) (get_arg(arr, i) / sizeof(_Py_CODEUNIT) + \ - (ABSOLUTE_JUMP(_Py_OPCODE(arr[i])) ? 0 : i+1)) -#define ISBASICBLOCK(blocks, start, end) \ - (blocks[start]==blocks[end]) - - -/* Scans back N consecutive LOAD_CONST instructions, skipping NOPs, - returns index of the Nth last's LOAD_CONST's EXTENDED_ARG prefix. - Callers are responsible to check CONST_STACK_LEN beforehand. -*/ -static Py_ssize_t -lastn_const_start(const _Py_CODEUNIT *codestr, Py_ssize_t i, Py_ssize_t n) -{ - assert(n > 0); - for (;;) { - i--; - assert(i >= 0); - if (_Py_OPCODE(codestr[i]) == LOAD_CONST) { - if (!--n) { - while (i > 0 && _Py_OPCODE(codestr[i-1]) == EXTENDED_ARG) { - i--; - } - return i; - } - } - else { - assert(_Py_OPCODE(codestr[i]) == EXTENDED_ARG); - } - } -} - -/* Scans through EXTENDED ARGs, seeking the index of the effective opcode */ -static Py_ssize_t -find_op(const _Py_CODEUNIT *codestr, Py_ssize_t codelen, Py_ssize_t i) -{ - while (i < codelen && _Py_OPCODE(codestr[i]) == EXTENDED_ARG) { - i++; - } - return i; -} - -/* Given the index of the effective opcode, - scan back to construct the oparg with EXTENDED_ARG */ -static unsigned int -get_arg(const _Py_CODEUNIT *codestr, Py_ssize_t i) -{ - _Py_CODEUNIT word; - unsigned int oparg = _Py_OPARG(codestr[i]); - if (i >= 1 && _Py_OPCODE(word = codestr[i-1]) == EXTENDED_ARG) { - oparg |= _Py_OPARG(word) << 8; - if (i >= 2 && _Py_OPCODE(word = codestr[i-2]) == EXTENDED_ARG) { - oparg |= _Py_OPARG(word) << 16; - if (i >= 3 && _Py_OPCODE(word = codestr[i-3]) == EXTENDED_ARG) { - oparg |= _Py_OPARG(word) << 24; - } - } - } - return oparg; -} - -/* Fill the region with NOPs. */ -static void -fill_nops(_Py_CODEUNIT *codestr, Py_ssize_t start, Py_ssize_t end) -{ - memset(codestr + start, NOP, (end - start) * sizeof(_Py_CODEUNIT)); -} - -/* Given the index of the effective opcode, - attempt to replace the argument, taking into account EXTENDED_ARG. - Returns -1 on failure, or the new op index on success */ -static Py_ssize_t -set_arg(_Py_CODEUNIT *codestr, Py_ssize_t i, unsigned int oparg) -{ - unsigned int curarg = get_arg(codestr, i); - int curilen, newilen; - if (curarg == oparg) - return i; - curilen = instrsize(curarg); - newilen = instrsize(oparg); - if (curilen < newilen) { - return -1; - } - - write_op_arg(codestr + i + 1 - curilen, _Py_OPCODE(codestr[i]), oparg, newilen); - fill_nops(codestr, i + 1 - curilen + newilen, i + 1); - return i-curilen+newilen; -} - -/* Attempt to write op/arg at end of specified region of memory. - Preceding memory in the region is overwritten with NOPs. - Returns -1 on failure, op index on success */ -static Py_ssize_t -copy_op_arg(_Py_CODEUNIT *codestr, Py_ssize_t i, unsigned char op, - unsigned int oparg, Py_ssize_t maxi) -{ - int ilen = instrsize(oparg); - if (i + ilen > maxi) { - return -1; - } - write_op_arg(codestr + maxi - ilen, op, oparg, ilen); - fill_nops(codestr, i, maxi - ilen); - return maxi - 1; -} - -/* Replace LOAD_CONST c1, LOAD_CONST c2 ... LOAD_CONST cn, BUILD_TUPLE n - with LOAD_CONST (c1, c2, ... cn). - The consts table must still be in list form so that the - new constant (c1, c2, ... cn) can be appended. - Called with codestr pointing to the first LOAD_CONST. -*/ -static Py_ssize_t -fold_tuple_on_constants(_Py_CODEUNIT *codestr, Py_ssize_t codelen, - Py_ssize_t c_start, Py_ssize_t opcode_end, - PyObject *consts, int n) -{ - /* Pre-conditions */ - assert(PyList_CheckExact(consts)); - - /* Buildup new tuple of constants */ - PyObject *newconst = PyTuple_New(n); - if (newconst == NULL) { - return -1; - } - - for (Py_ssize_t i = 0, pos = c_start; i < n; i++, pos++) { - assert(pos < opcode_end); - pos = find_op(codestr, codelen, pos); - assert(_Py_OPCODE(codestr[pos]) == LOAD_CONST); - - unsigned int arg = get_arg(codestr, pos); - PyObject *constant = PyList_GET_ITEM(consts, arg); - Py_INCREF(constant); - PyTuple_SET_ITEM(newconst, i, constant); - } - - Py_ssize_t index = PyList_GET_SIZE(consts); -#if SIZEOF_SIZE_T > SIZEOF_INT - if ((size_t)index >= UINT_MAX - 1) { - Py_DECREF(newconst); - PyErr_SetString(PyExc_OverflowError, "too many constants"); - return -1; - } -#endif - - /* Append folded constant onto consts */ - if (PyList_Append(consts, newconst)) { - Py_DECREF(newconst); - return -1; - } - Py_DECREF(newconst); - - return copy_op_arg(codestr, c_start, LOAD_CONST, - (unsigned int)index, opcode_end); -} - -static unsigned int * -markblocks(_Py_CODEUNIT *code, Py_ssize_t len) -{ - unsigned int *blocks = PyMem_New(unsigned int, len); - int i, j, opcode, blockcnt = 0; - - if (blocks == NULL) { - PyErr_NoMemory(); - return NULL; - } - memset(blocks, 0, len*sizeof(int)); - - /* Mark labels in the first pass */ - for (i = 0; i < len; i++) { - opcode = _Py_OPCODE(code[i]); - switch (opcode) { - case FOR_ITER: - case JUMP_FORWARD: - case JUMP_IF_FALSE_OR_POP: - case JUMP_IF_TRUE_OR_POP: - case POP_JUMP_IF_FALSE: - case POP_JUMP_IF_TRUE: - case JUMP_IF_NOT_EXC_MATCH: - case JUMP_ABSOLUTE: - case SETUP_FINALLY: - case SETUP_WITH: - case SETUP_ASYNC_WITH: - j = GETJUMPTGT(code, i); - assert(j < len); - blocks[j] = 1; - break; - } - } - /* Build block numbers in the second pass */ - for (i = 0; i < len; i++) { - blockcnt += blocks[i]; /* increment blockcnt over labels */ - blocks[i] = blockcnt; - } - return blocks; -} - -/* 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. - - To keep the optimizer simple, it bails when the lineno table has complex - encoding for gaps >= 255. - - Optimizations are restricted to simple transformations occurring within a - single basic block. All transformations keep the code size the same or - smaller. For those that reduce size, the gaps are initially filled with - NOPs. Later those NOPs are removed and the jump addresses retargeted in - a single pass. */ - -PyObject * -PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, - PyObject *lnotab_obj) -{ - Py_ssize_t h, i, nexti, op_start, tgt; - unsigned int j, nops; - unsigned char opcode, nextop; - _Py_CODEUNIT *codestr = NULL; - unsigned char *lnotab; - unsigned int cum_orig_offset, last_offset; - Py_ssize_t tabsiz; - // Count runs of consecutive LOAD_CONSTs - unsigned int cumlc = 0, lastlc = 0; - unsigned int *blocks = NULL; - - /* Bail out if an exception is set */ - if (PyErr_Occurred()) - goto exitError; - - /* Bypass optimization when the lnotab table is too complex */ - assert(PyBytes_Check(lnotab_obj)); - lnotab = (unsigned char*)PyBytes_AS_STRING(lnotab_obj); - tabsiz = PyBytes_GET_SIZE(lnotab_obj); - assert(tabsiz == 0 || Py_REFCNT(lnotab_obj) == 1); - - /* Don't optimize if lnotab contains instruction pointer delta larger - than +255 (encoded as multiple bytes), just to keep the peephole optimizer - simple. The optimizer leaves line number deltas unchanged. */ - - for (i = 0; i < tabsiz; i += 2) { - if (lnotab[i] == 255) { - goto exitUnchanged; - } - } - - assert(PyBytes_Check(code)); - Py_ssize_t codesize = PyBytes_GET_SIZE(code); - assert(codesize % sizeof(_Py_CODEUNIT) == 0); - Py_ssize_t codelen = codesize / sizeof(_Py_CODEUNIT); - if (codelen > INT_MAX) { - /* Python assembler is limited to INT_MAX: see assembler.a_offset in - compile.c. */ - goto exitUnchanged; - } - - /* Make a modifiable copy of the code string */ - codestr = (_Py_CODEUNIT *)PyMem_Malloc(codesize); - if (codestr == NULL) { - PyErr_NoMemory(); - goto exitError; - } - memcpy(codestr, PyBytes_AS_STRING(code), codesize); - - blocks = markblocks(codestr, codelen); - if (blocks == NULL) - goto exitError; - assert(PyList_Check(consts)); - - for (i=find_op(codestr, codelen, 0) ; i= 1 && _Py_OPCODE(codestr[op_start-1]) == EXTENDED_ARG) { - op_start--; - } - - nexti = i + 1; - while (nexti < codelen && _Py_OPCODE(codestr[nexti]) == EXTENDED_ARG) - nexti++; - nextop = nexti < codelen ? _Py_OPCODE(codestr[nexti]) : 0; - - lastlc = cumlc; - cumlc = 0; - - switch (opcode) { - /* Skip over LOAD_CONST trueconst - POP_JUMP_IF_FALSE xx. This improves - "while 1" performance. */ - case LOAD_CONST: - cumlc = lastlc + 1; - if (nextop != POP_JUMP_IF_FALSE || - !ISBASICBLOCK(blocks, op_start, i + 1)) { - break; - } - PyObject* cnt = PyList_GET_ITEM(consts, get_arg(codestr, i)); - int is_true = PyObject_IsTrue(cnt); - if (is_true == -1) { - goto exitError; - } - if (is_true == 1) { - fill_nops(codestr, op_start, nexti + 1); - cumlc = 0; - } - break; - - /* Try to fold tuples of constants. - Skip over BUILD_SEQN 1 UNPACK_SEQN 1. - Replace BUILD_SEQN 2 UNPACK_SEQN 2 with ROT2. - Replace BUILD_SEQN 3 UNPACK_SEQN 3 with ROT3 ROT2. */ - case BUILD_TUPLE: - j = get_arg(codestr, i); - if (j > 0 && lastlc >= j) { - h = lastn_const_start(codestr, op_start, j); - if (ISBASICBLOCK(blocks, h, op_start)) { - h = fold_tuple_on_constants(codestr, codelen, - h, i+1, consts, j); - break; - } - } - if (nextop != UNPACK_SEQUENCE || - !ISBASICBLOCK(blocks, op_start, i + 1) || - j != get_arg(codestr, nexti)) - break; - if (j < 2) { - fill_nops(codestr, op_start, nexti + 1); - } else if (j == 2) { - codestr[op_start] = PACKOPARG(ROT_TWO, 0); - fill_nops(codestr, op_start + 1, nexti + 1); - } else if (j == 3) { - codestr[op_start] = PACKOPARG(ROT_THREE, 0); - codestr[op_start + 1] = PACKOPARG(ROT_TWO, 0); - fill_nops(codestr, op_start + 2, nexti + 1); - } - break; - - /* Simplify conditional jump to conditional jump where the - result of the first test implies the success of a similar - test or the failure of the opposite test. - Arises in code like: - "a and b or c" - "(a and b) and c" - "(a or b) or c" - "(a or b) and c" - x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_FALSE_OR_POP z - --> x:JUMP_IF_FALSE_OR_POP z - x:JUMP_IF_FALSE_OR_POP y y:JUMP_IF_TRUE_OR_POP z - --> x:POP_JUMP_IF_FALSE y+1 - where y+1 is the instruction following the second test. - */ - case JUMP_IF_FALSE_OR_POP: - case JUMP_IF_TRUE_OR_POP: - h = get_arg(codestr, i) / sizeof(_Py_CODEUNIT); - tgt = find_op(codestr, codelen, h); - - j = _Py_OPCODE(codestr[tgt]); - if (CONDITIONAL_JUMP(j)) { - /* NOTE: all possible jumps here are absolute. */ - if (JUMPS_ON_TRUE(j) == JUMPS_ON_TRUE(opcode)) { - /* The second jump will be taken iff the first is. - The current opcode inherits its target's - stack effect */ - h = set_arg(codestr, i, get_arg(codestr, tgt)); - } else { - /* The second jump is not taken if the first is (so - jump past it), and all conditional jumps pop their - argument when they're not taken (so change the - first jump to pop its argument when it's taken). */ - Py_ssize_t arg = (tgt + 1); - /* cannot overflow: codelen <= INT_MAX */ - assert((size_t)arg <= UINT_MAX / sizeof(_Py_CODEUNIT)); - arg *= sizeof(_Py_CODEUNIT); - h = set_arg(codestr, i, (unsigned int)arg); - j = opcode == JUMP_IF_TRUE_OR_POP ? - POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE; - } - - if (h >= 0) { - nexti = h; - codestr[nexti] = PACKOPARG(j, _Py_OPARG(codestr[nexti])); - break; - } - } - /* Intentional fallthrough */ - - /* Replace jumps to unconditional jumps */ - case POP_JUMP_IF_FALSE: - case POP_JUMP_IF_TRUE: - case JUMP_FORWARD: - case JUMP_ABSOLUTE: - h = GETJUMPTGT(codestr, i); - tgt = find_op(codestr, codelen, h); - /* Replace JUMP_* to a RETURN into just a RETURN */ - if (UNCONDITIONAL_JUMP(opcode) && - _Py_OPCODE(codestr[tgt]) == RETURN_VALUE) { - codestr[op_start] = PACKOPARG(RETURN_VALUE, 0); - fill_nops(codestr, op_start + 1, i + 1); - } else if (UNCONDITIONAL_JUMP(_Py_OPCODE(codestr[tgt]))) { - size_t arg = GETJUMPTGT(codestr, tgt); - if (opcode == JUMP_FORWARD) { /* JMP_ABS can go backwards */ - opcode = JUMP_ABSOLUTE; - } else if (!ABSOLUTE_JUMP(opcode)) { - if (arg < (size_t)(i + 1)) { - break; /* No backward relative jumps */ - } - arg -= i + 1; /* Calc relative jump addr */ - } - /* cannot overflow: codelen <= INT_MAX */ - assert(arg <= (UINT_MAX / sizeof(_Py_CODEUNIT))); - arg *= sizeof(_Py_CODEUNIT); - copy_op_arg(codestr, op_start, opcode, - (unsigned int)arg, i + 1); - } - break; - - /* Remove unreachable ops after RETURN */ - case RETURN_VALUE: - h = i + 1; - while (h < codelen && ISBASICBLOCK(blocks, i, h)) - { - /* Leave SETUP_FINALLY and RERAISE in place to help find block limits. */ - if (_Py_OPCODE(codestr[h]) == SETUP_FINALLY || _Py_OPCODE(codestr[h]) == RERAISE) { - while (h > i + 1 && - _Py_OPCODE(codestr[h - 1]) == EXTENDED_ARG) - { - h--; - } - break; - } - h++; - } - if (h > i + 1) { - fill_nops(codestr, i + 1, h); - nexti = find_op(codestr, codelen, h); - } - break; - } - } - - /* Fixup lnotab */ - for (i = 0, nops = 0; i < codelen; i++) { - size_t block = (size_t)i - nops; - /* cannot overflow: codelen <= INT_MAX */ - assert(block <= UINT_MAX); - /* original code offset => new code offset */ - blocks[i] = (unsigned int)block; - if (_Py_OPCODE(codestr[i]) == NOP) { - nops++; - } - } - cum_orig_offset = 0; - last_offset = 0; - for (i=0 ; i < tabsiz ; i+=2) { - unsigned int offset_delta, new_offset; - cum_orig_offset += lnotab[i]; - assert(cum_orig_offset % sizeof(_Py_CODEUNIT) == 0); - new_offset = blocks[cum_orig_offset / sizeof(_Py_CODEUNIT)] * - sizeof(_Py_CODEUNIT); - offset_delta = new_offset - last_offset; - assert(offset_delta <= 255); - lnotab[i] = (unsigned char)offset_delta; - last_offset = new_offset; - } - - /* Remove NOPs and fixup jump targets */ - for (op_start = i = h = 0; i < codelen; i++, op_start = i) { - j = _Py_OPARG(codestr[i]); - while (_Py_OPCODE(codestr[i]) == EXTENDED_ARG) { - i++; - j = j<<8 | _Py_OPARG(codestr[i]); - } - opcode = _Py_OPCODE(codestr[i]); - switch (opcode) { - case NOP:continue; - - case JUMP_ABSOLUTE: - case POP_JUMP_IF_FALSE: - case POP_JUMP_IF_TRUE: - case JUMP_IF_FALSE_OR_POP: - case JUMP_IF_TRUE_OR_POP: - case JUMP_IF_NOT_EXC_MATCH: - j = blocks[j / sizeof(_Py_CODEUNIT)] * sizeof(_Py_CODEUNIT); - break; - - case FOR_ITER: - case JUMP_FORWARD: - case SETUP_FINALLY: - case SETUP_WITH: - case SETUP_ASYNC_WITH: - j = blocks[j / sizeof(_Py_CODEUNIT) + i + 1] - blocks[i] - 1; - j *= sizeof(_Py_CODEUNIT); - break; - } - Py_ssize_t ilen = i - op_start + 1; - if (instrsize(j) > ilen) { - goto exitUnchanged; - } - /* If instrsize(j) < ilen, we'll emit EXTENDED_ARG 0 */ - if (ilen > 4) { - /* Can only happen when PyCode_Optimize() is called with - malformed bytecode. */ - goto exitUnchanged; - } - write_op_arg(codestr + h, opcode, j, (int)ilen); - h += ilen; - } - assert(h + (Py_ssize_t)nops == codelen); - - PyMem_Free(blocks); - code = PyBytes_FromStringAndSize((char *)codestr, h * sizeof(_Py_CODEUNIT)); - PyMem_Free(codestr); - return code; - - exitError: - code = NULL; - - exitUnchanged: - Py_XINCREF(code); - PyMem_Free(blocks); - PyMem_Free(codestr); - return code; -} From 85df5a01e64d406d1f6b70ebd50de7aa1046d3c8 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Fri, 31 Jul 2020 16:20:48 +0530 Subject: [PATCH 105/197] bpo-40360: Handle PendingDeprecationWarning in test_lib2to3. (GH-21694) --- Lib/test/test_lib2to3.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py index 5eaa5164d490a7..159a8387e4e97d 100644 --- a/Lib/test/test_lib2to3.py +++ b/Lib/test/test_lib2to3.py @@ -1,5 +1,8 @@ -from lib2to3.tests import load_tests import unittest +from test.support.warnings_helper import check_warnings + +with check_warnings(("", PendingDeprecationWarning)): + from lib2to3.tests import load_tests if __name__ == '__main__': unittest.main() From fe3549e4bf895861a017f582babedf5a38a19ab0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 1 Aug 2020 01:18:26 -0700 Subject: [PATCH 106/197] bpo-41421: Algebraic simplification for random.paretovariate() (GH-21695) --- Lib/random.py | 2 +- .../next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst diff --git a/Lib/random.py b/Lib/random.py index a6454f520df0a3..37f71110403ad8 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -749,7 +749,7 @@ def paretovariate(self, alpha): # Jain, pg. 495 u = 1.0 - self.random() - return 1.0 / u ** (1.0 / alpha) + return u ** (-1.0 / alpha) def weibullvariate(self, alpha, beta): """Weibull distribution. diff --git a/Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst b/Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst new file mode 100644 index 00000000000000..cf291c60d8ad57 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-01-00-51-15.bpo-41421.dHKRVB.rst @@ -0,0 +1,3 @@ +Make an algebraic simplification to random.paretovariate(). It now is +slightly less subject to round-off error and is slightly faster. Inputs that +used to cause ZeroDivisionError now cause an OverflowError instead. From a6d541621e8622ef9ee19582e71d990fe5c9ce8a Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sun, 2 Aug 2020 12:03:32 -0700 Subject: [PATCH 107/197] random module: Convert a "while 1" to "while True (GH-21700) --- Lib/random.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/random.py b/Lib/random.py index 37f71110403ad8..3ea369b81b3e50 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -682,7 +682,7 @@ def gammavariate(self, alpha, beta): bbb = alpha - LOG4 ccc = alpha + ainv - while 1: + while True: u1 = random() if not 1e-7 < u1 < 0.9999999: continue From 465168a0f7b3a947060802064683b5bd9996d7af Mon Sep 17 00:00:00 2001 From: Luciano Ramalho Date: Sun, 2 Aug 2020 19:32:36 -0300 Subject: [PATCH 108/197] bpo-40979: refactored typing.rst; (mostly) same content, new sub-sections and ordering (#21574) Also added PEP 585 deprecation notes. --- Doc/library/typing.rst | 1547 ++++++++++------- .../2020-07-21-15-23-30.bpo-40979.pLA8rO.rst | 1 + 2 files changed, 879 insertions(+), 669 deletions(-) create mode 100644 Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index e5143c5f8d9e4a..44b537f1669e1a 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1,3 +1,4 @@ +======================================== :mod:`typing` --- Support for type hints ======================================== @@ -34,7 +35,7 @@ In the function ``greeting``, the argument ``name`` is expected to be of type arguments. Type aliases ------------- +============ A type alias is defined by assigning the type to the alias. In this example, ``Vector`` and ``List[float]`` will be treated as interchangeable synonyms:: @@ -72,7 +73,7 @@ Note that ``None`` as a type hint is a special case and is replaced by .. _distinct: NewType -------- +======= Use the :func:`NewType` helper function to create distinct types:: @@ -149,7 +150,7 @@ See :pep:`484` for more details. .. versionadded:: 3.5.2 Callable --------- +======== Frameworks expecting callback functions of specific signatures might be type hinted using ``Callable[[Arg1Type, Arg2Type], ReturnType]``. @@ -172,7 +173,7 @@ for the list of arguments in the type hint: ``Callable[..., ReturnType]``. .. _generics: Generics --------- +======== Since type information about objects kept in containers cannot be statically inferred in a generic way, abstract base classes have been extended to support @@ -199,7 +200,7 @@ called :class:`TypeVar`. User-defined generic types --------------------------- +========================== A user-defined class can be defined as a generic class. @@ -317,7 +318,7 @@ comparable for equality. The :data:`Any` type --------------------- +==================== A special kind of type is :data:`Any`. A static type checker will treat every type as being compatible with :data:`Any` and :data:`Any` as being @@ -395,7 +396,7 @@ manner. Use :data:`Any` to indicate that a value is dynamically typed. Nominal vs structural subtyping -------------------------------- +=============================== Initially :pep:`484` defined Python static type system as using *nominal subtyping*. This means that a class ``A`` is allowed where @@ -434,106 +435,152 @@ Moreover, by subclassing a special class :class:`Protocol`, a user can define new custom protocols to fully enjoy structural subtyping (see examples below). +Module contents +=============== -Classes, functions, and decorators ----------------------------------- +The module defines the following classes, functions and decorators. -The module defines the following classes, functions and decorators: +.. note:: -.. class:: TypeVar + This module defines several types that are subclasses of pre-existing + standard library classes which also extend :class:`Generic` + to support type variables inside ``[]``. + These types became redundant in Python 3.9 when the + corresponding pre-existing classes were enhanced to support ``[]``. - Type variable. + The redundant types are deprecated as of Python 3.9 but no + deprecation warnings will be issued by the interpreter. + It is expected that type checkers will flag the deprecated types + when the checked program targets Python 3.9 or newer. - Usage:: + The deprecated types will be removed from the :mod:`typing` module + in the first Python version released 5 years after the release of Python 3.9.0. + See details in :pep:`585`—*Type Hinting Generics In Standard Collections*. - T = TypeVar('T') # Can be anything - A = TypeVar('A', str, bytes) # Must be str or bytes - Type variables exist primarily for the benefit of static type - checkers. They serve as the parameters for generic types as well - as for generic function definitions. See class Generic for more - information on generic types. Generic functions work as follows:: +Special typing primitives +------------------------- - def repeat(x: T, n: int) -> Sequence[T]: - """Return a list containing n references to x.""" - return [x]*n +Special types +""""""""""""" - def longest(x: A, y: A) -> A: - """Return the longest of two strings.""" - return x if len(x) >= len(y) else y +These can be used as types in annotations and do not support ``[]``. - The latter example's signature is essentially the overloading - of ``(str, str) -> str`` and ``(bytes, bytes) -> bytes``. Also note - that if the arguments are instances of some subclass of :class:`str`, - the return type is still plain :class:`str`. +.. data:: Any - At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, - :func:`isinstance` and :func:`issubclass` should not be used with types. + Special type indicating an unconstrained type. - Type variables may be marked covariant or contravariant by passing - ``covariant=True`` or ``contravariant=True``. See :pep:`484` for more - details. By default type variables are invariant. Alternatively, - a type variable may specify an upper bound using ``bound=``. - This means that an actual type substituted (explicitly or implicitly) - for the type variable must be a subclass of the boundary type, - see :pep:`484`. + * Every type is compatible with :data:`Any`. + * :data:`Any` is compatible with every type. -.. class:: Generic +.. data:: NoReturn - Abstract base class for generic types. + Special type indicating that a function never returns. + For example:: - A generic type is typically declared by inheriting from an - instantiation of this class with one or more type variables. - For example, a generic mapping type might be defined as:: + from typing import NoReturn - class Mapping(Generic[KT, VT]): - def __getitem__(self, key: KT) -> VT: - ... - # Etc. + def stop() -> NoReturn: + raise RuntimeError('no way') - This class can then be used as follows:: + .. versionadded:: 3.5.4 + .. versionadded:: 3.6.2 - X = TypeVar('X') - Y = TypeVar('Y') +Special forms +""""""""""""" - def lookup_name(mapping: Mapping[X, Y], key: X, default: Y) -> Y: - try: - return mapping[key] - except KeyError: - return default +These can be used as types in annotations using ``[]``, each having a unique syntax. -.. class:: Protocol(Generic) +.. data:: Tuple - Base class for protocol classes. Protocol classes are defined like this:: + Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items + with the first item of type X and the second of type Y. The type of + the empty tuple can be written as ``Tuple[()]``. - class Proto(Protocol): - def meth(self) -> int: - ... + Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding + to type variables T1 and T2. ``Tuple[int, float, str]`` is a tuple + of an int, a float and a string. - Such classes are primarily used with static type checkers that recognize - structural subtyping (static duck-typing), for example:: + To specify a variable-length tuple of homogeneous type, + use literal ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` + is equivalent to ``Tuple[Any, ...]``, and in turn to :class:`tuple`. - class C: - def meth(self) -> int: - return 0 + .. deprecated:: 3.9 + :class:`builtins.tuple ` now supports ``[]``. See :pep:`585`. - def func(x: Proto) -> int: - return x.meth() +.. data:: Union - func(C()) # Passes static type check + Union type; ``Union[X, Y]`` means either X or Y. - See :pep:`544` for details. Protocol classes decorated with - :func:`runtime_checkable` (described later) act as simple-minded runtime - protocols that check only the presence of given attributes, ignoring their - type signatures. + To define a union, use e.g. ``Union[int, str]``. Details: - Protocol classes can be generic, for example:: + * The arguments must be types and there must be at least one. - class GenProto(Protocol[T]): - def meth(self) -> T: - ... + * Unions of unions are flattened, e.g.:: - .. versionadded:: 3.8 + Union[Union[int, str], float] == Union[int, str, float] + + * Unions of a single argument vanish, e.g.:: + + Union[int] == int # The constructor actually returns int + + * Redundant arguments are skipped, e.g.:: + + Union[int, str, int] == Union[int, str] + + * When comparing unions, the argument order is ignored, e.g.:: + + Union[int, str] == Union[str, int] + + * You cannot subclass or instantiate a union. + + * You cannot write ``Union[X][Y]``. + + * You can use ``Optional[X]`` as a shorthand for ``Union[X, None]``. + + .. versionchanged:: 3.7 + Don't remove explicit subclasses from unions at runtime. + +.. data:: Optional + + Optional type. + + ``Optional[X]`` is equivalent to ``Union[X, None]``. + + Note that this is not the same concept as an optional argument, + which is one that has a default. An optional argument with a + default does not require the ``Optional`` qualifier on its type + annotation just because it is optional. For example:: + + def foo(arg: int = 0) -> None: + ... + + On the other hand, if an explicit value of ``None`` is allowed, the + use of ``Optional`` is appropriate, whether the argument is optional + or not. For example:: + + def foo(arg: Optional[int] = None) -> None: + ... + +.. data:: Callable + + Callable type; ``Callable[[int], str]`` is a function of (int) -> str. + + The subscription syntax must always be used with exactly two + values: the argument list and the return type. The argument list + must be a list of types or an ellipsis; the return type must be + a single type. + + There is no syntax to indicate optional or keyword arguments; + such function types are rarely used as callback types. + ``Callable[..., ReturnType]`` (literal ellipsis) can be used to + type hint a callable taking any number of arguments and returning + ``ReturnType``. A plain :data:`Callable` is equivalent to + ``Callable[..., Any]``, and in turn to + :class:`collections.abc.Callable`. + + .. deprecated:: 3.9 + :class:`collections.abc.Callable` now supports ``[]``. See :pep:`585`. .. class:: Type(Generic[CT_co]) @@ -577,374 +624,342 @@ The module defines the following classes, functions and decorators: .. versionadded:: 3.5.2 -.. class:: Iterable(Generic[T_co]) + .. deprecated:: 3.9 + :class:`builtins.type ` now supports ``[]``. See :pep:`585`. - A generic version of :class:`collections.abc.Iterable`. +.. data:: Literal -.. class:: Iterator(Iterable[T_co]) + A type that can be used to indicate to type checkers that the + corresponding variable or function parameter has a value equivalent to + the provided literal (or one of several literals). For example:: - A generic version of :class:`collections.abc.Iterator`. + def validate_simple(data: Any) -> Literal[True]: # always returns True + ... -.. class:: Reversible(Iterable[T_co]) + MODE = Literal['r', 'rb', 'w', 'wb'] + def open_helper(file: str, mode: MODE) -> str: + ... - A generic version of :class:`collections.abc.Reversible`. + open_helper('/some/path', 'r') # Passes type check + open_helper('/other/path', 'typo') # Error in type checker -.. class:: SupportsInt + ``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value + is allowed as type argument to ``Literal[...]``, but type checkers may + impose restrictions. See :pep:`586` for more details about literal types. - An ABC with one abstract method ``__int__``. + .. versionadded:: 3.8 -.. class:: SupportsFloat +.. data:: ClassVar - An ABC with one abstract method ``__float__``. + Special type construct to mark class variables. -.. class:: SupportsComplex + As introduced in :pep:`526`, a variable annotation wrapped in ClassVar + indicates that a given attribute is intended to be used as a class variable + and should not be set on instances of that class. Usage:: - An ABC with one abstract method ``__complex__``. + class Starship: + stats: ClassVar[Dict[str, int]] = {} # class variable + damage: int = 10 # instance variable -.. class:: SupportsBytes + :data:`ClassVar` accepts only types and cannot be further subscribed. - An ABC with one abstract method ``__bytes__``. + :data:`ClassVar` is not a class itself, and should not + be used with :func:`isinstance` or :func:`issubclass`. + :data:`ClassVar` does not change Python runtime behavior, but + it can be used by third-party type checkers. For example, a type checker + might flag the following code as an error:: -.. class:: SupportsIndex + enterprise_d = Starship(3000) + enterprise_d.stats = {} # Error, setting class variable on instance + Starship.stats = {} # This is OK - An ABC with one abstract method ``__index__``. + .. versionadded:: 3.5.3 - .. versionadded:: 3.8 +.. data:: Final -.. class:: SupportsAbs + A special typing construct to indicate to type checkers that a name + cannot be re-assigned or overridden in a subclass. For example:: - An ABC with one abstract method ``__abs__`` that is covariant - in its return type. + MAX_SIZE: Final = 9000 + MAX_SIZE += 1 # Error reported by type checker -.. class:: SupportsRound + class Connection: + TIMEOUT: Final[int] = 10 - An ABC with one abstract method ``__round__`` - that is covariant in its return type. + class FastConnector(Connection): + TIMEOUT = 1 # Error reported by type checker -.. class:: Container(Generic[T_co]) + There is no runtime checking of these properties. See :pep:`591` for + more details. - A generic version of :class:`collections.abc.Container`. + .. versionadded:: 3.8 -.. class:: Hashable +.. data:: Annotated - An alias to :class:`collections.abc.Hashable` + A type, introduced in :pep:`593` (``Flexible function and variable + annotations``), to decorate existing types with context-specific metadata + (possibly multiple pieces of it, as ``Annotated`` is variadic). + Specifically, a type ``T`` can be annotated with metadata ``x`` via the + typehint ``Annotated[T, x]``. This metadata can be used for either static + analysis or at runtime. If a library (or tool) encounters a typehint + ``Annotated[T, x]`` and has no special logic for metadata ``x``, it + should ignore it and simply treat the type as ``T``. Unlike the + ``no_type_check`` functionality that currently exists in the ``typing`` + module which completely disables typechecking annotations on a function + or a class, the ``Annotated`` type allows for both static typechecking + of ``T`` (e.g., via mypy or Pyre, which can safely ignore ``x``) + together with runtime access to ``x`` within a specific application. -.. class:: Sized + Ultimately, the responsibility of how to interpret the annotations (if + at all) is the responsibility of the tool or library encountering the + ``Annotated`` type. A tool or library encountering an ``Annotated`` type + can scan through the annotations to determine if they are of interest + (e.g., using ``isinstance()``). - An alias to :class:`collections.abc.Sized` + When a tool or a library does not support annotations or encounters an + unknown annotation it should just ignore it and treat annotated type as + the underlying type. -.. class:: Collection(Sized, Iterable[T_co], Container[T_co]) + It's up to the tool consuming the annotations to decide whether the + client is allowed to have several annotations on one type and how to + merge those annotations. - A generic version of :class:`collections.abc.Collection` + Since the ``Annotated`` type allows you to put several annotations of + the same (or different) type(s) on any node, the tools or libraries + consuming those annotations are in charge of dealing with potential + duplicates. For example, if you are doing value range analysis you might + allow this:: - .. versionadded:: 3.6.0 + T1 = Annotated[int, ValueRange(-10, 5)] + T2 = Annotated[T1, ValueRange(-20, 3)] -.. class:: AbstractSet(Sized, Collection[T_co]) + Passing ``include_extras=True`` to :func:`get_type_hints` lets one + access the extra annotations at runtime. - A generic version of :class:`collections.abc.Set`. + The details of the syntax: -.. class:: MutableSet(AbstractSet[T]) + * The first argument to ``Annotated`` must be a valid type - A generic version of :class:`collections.abc.MutableSet`. + * Multiple type annotations are supported (``Annotated`` supports variadic + arguments):: -.. class:: Mapping(Sized, Collection[KT], Generic[VT_co]) + Annotated[int, ValueRange(3, 10), ctype("char")] - A generic version of :class:`collections.abc.Mapping`. - This type can be used as follows:: + * ``Annotated`` must be called with at least two arguments ( + ``Annotated[int]`` is not valid) - def get_position_in_index(word_list: Mapping[str, int], word: str) -> int: - return word_list[word] + * The order of the annotations is preserved and matters for equality + checks:: -.. class:: MutableMapping(Mapping[KT, VT]) + Annotated[int, ValueRange(3, 10), ctype("char")] != Annotated[ + int, ctype("char"), ValueRange(3, 10) + ] - A generic version of :class:`collections.abc.MutableMapping`. + * Nested ``Annotated`` types are flattened, with metadata ordered + starting with the innermost annotation:: -.. class:: Sequence(Reversible[T_co], Collection[T_co]) + Annotated[Annotated[int, ValueRange(3, 10)], ctype("char")] == Annotated[ + int, ValueRange(3, 10), ctype("char") + ] - A generic version of :class:`collections.abc.Sequence`. + * Duplicated annotations are not removed:: -.. class:: MutableSequence(Sequence[T]) + Annotated[int, ValueRange(3, 10)] != Annotated[ + int, ValueRange(3, 10), ValueRange(3, 10) + ] - A generic version of :class:`collections.abc.MutableSequence`. + * ``Annotated`` can be used with nested and generic aliases:: -.. class:: ByteString(Sequence[int]) + T = TypeVar('T') + Vec = Annotated[List[Tuple[T, T]], MaxLen(10)] + V = Vec[int] - A generic version of :class:`collections.abc.ByteString`. + V == Annotated[List[Tuple[int, int]], MaxLen(10)] - This type represents the types :class:`bytes`, :class:`bytearray`, - and :class:`memoryview` of byte sequences. + .. versionadded:: 3.9 - As a shorthand for this type, :class:`bytes` can be used to - annotate arguments of any of the types mentioned above. +Building generic types +"""""""""""""""""""""" -.. class:: Deque(deque, MutableSequence[T]) +These are not used in annotations. They are building blocks for creating generic types. - A generic version of :class:`collections.deque`. +.. class:: Generic - .. versionadded:: 3.5.4 - .. versionadded:: 3.6.1 + Abstract base class for generic types. -.. class:: List(list, MutableSequence[T]) + A generic type is typically declared by inheriting from an + instantiation of this class with one or more type variables. + For example, a generic mapping type might be defined as:: - Generic version of :class:`list`. - Useful for annotating return types. To annotate arguments it is preferred - to use an abstract collection type such as :class:`Sequence` or - :class:`Iterable`. + class Mapping(Generic[KT, VT]): + def __getitem__(self, key: KT) -> VT: + ... + # Etc. - This type may be used as follows:: + This class can then be used as follows:: - T = TypeVar('T', int, float) + X = TypeVar('X') + Y = TypeVar('Y') - def vec2(x: T, y: T) -> List[T]: - return [x, y] + def lookup_name(mapping: Mapping[X, Y], key: X, default: Y) -> Y: + try: + return mapping[key] + except KeyError: + return default - def keep_positives(vector: Sequence[T]) -> List[T]: - return [item for item in vector if item > 0] +.. class:: TypeVar -.. class:: Set(set, MutableSet[T]) + Type variable. - A generic version of :class:`builtins.set `. - Useful for annotating return types. To annotate arguments it is preferred - to use an abstract collection type such as :class:`AbstractSet`. + Usage:: -.. class:: FrozenSet(frozenset, AbstractSet[T_co]) + T = TypeVar('T') # Can be anything + A = TypeVar('A', str, bytes) # Must be str or bytes - A generic version of :class:`builtins.frozenset `. + Type variables exist primarily for the benefit of static type + checkers. They serve as the parameters for generic types as well + as for generic function definitions. See class Generic for more + information on generic types. Generic functions work as follows:: -.. class:: MappingView(Sized, Iterable[T_co]) + def repeat(x: T, n: int) -> Sequence[T]: + """Return a list containing n references to x.""" + return [x]*n - A generic version of :class:`collections.abc.MappingView`. + def longest(x: A, y: A) -> A: + """Return the longest of two strings.""" + return x if len(x) >= len(y) else y -.. class:: KeysView(MappingView[KT_co], AbstractSet[KT_co]) + The latter example's signature is essentially the overloading + of ``(str, str) -> str`` and ``(bytes, bytes) -> bytes``. Also note + that if the arguments are instances of some subclass of :class:`str`, + the return type is still plain :class:`str`. - A generic version of :class:`collections.abc.KeysView`. + At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`. In general, + :func:`isinstance` and :func:`issubclass` should not be used with types. -.. class:: ItemsView(MappingView, Generic[KT_co, VT_co]) + Type variables may be marked covariant or contravariant by passing + ``covariant=True`` or ``contravariant=True``. See :pep:`484` for more + details. By default type variables are invariant. Alternatively, + a type variable may specify an upper bound using ``bound=``. + This means that an actual type substituted (explicitly or implicitly) + for the type variable must be a subclass of the boundary type, + see :pep:`484`. - A generic version of :class:`collections.abc.ItemsView`. +.. data:: AnyStr -.. class:: ValuesView(MappingView[VT_co]) + ``AnyStr`` is a type variable defined as + ``AnyStr = TypeVar('AnyStr', str, bytes)``. - A generic version of :class:`collections.abc.ValuesView`. + It is meant to be used for functions that may accept any kind of string + without allowing different kinds of strings to mix. For example:: -.. class:: Awaitable(Generic[T_co]) + def concat(a: AnyStr, b: AnyStr) -> AnyStr: + return a + b - A generic version of :class:`collections.abc.Awaitable`. + concat(u"foo", u"bar") # Ok, output has type 'unicode' + concat(b"foo", b"bar") # Ok, output has type 'bytes' + concat(u"foo", b"bar") # Error, cannot mix unicode and bytes - .. versionadded:: 3.5.2 +.. class:: Protocol(Generic) -.. class:: Coroutine(Awaitable[V_co], Generic[T_co T_contra, V_co]) + Base class for protocol classes. Protocol classes are defined like this:: - A generic version of :class:`collections.abc.Coroutine`. - The variance and order of type variables - correspond to those of :class:`Generator`, for example:: + class Proto(Protocol): + def meth(self) -> int: + ... - from typing import List, Coroutine - c = None # type: Coroutine[List[str], str, int] - ... - x = c.send('hi') # type: List[str] - async def bar() -> None: - x = await c # type: int + Such classes are primarily used with static type checkers that recognize + structural subtyping (static duck-typing), for example:: - .. versionadded:: 3.5.3 + class C: + def meth(self) -> int: + return 0 -.. class:: AsyncIterable(Generic[T_co]) + def func(x: Proto) -> int: + return x.meth() - A generic version of :class:`collections.abc.AsyncIterable`. + func(C()) # Passes static type check - .. versionadded:: 3.5.2 + See :pep:`544` for details. Protocol classes decorated with + :func:`runtime_checkable` (described later) act as simple-minded runtime + protocols that check only the presence of given attributes, ignoring their + type signatures. -.. class:: AsyncIterator(AsyncIterable[T_co]) + Protocol classes can be generic, for example:: - A generic version of :class:`collections.abc.AsyncIterator`. + class GenProto(Protocol[T]): + def meth(self) -> T: + ... - .. versionadded:: 3.5.2 + .. versionadded:: 3.8 -.. class:: ContextManager(Generic[T_co]) +.. decorator:: runtime_checkable - A generic version of :class:`contextlib.AbstractContextManager`. + Mark a protocol class as a runtime protocol. - .. versionadded:: 3.5.4 - .. versionadded:: 3.6.0 + Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. + This raises :exc:`TypeError` when applied to a non-protocol class. This + allows a simple-minded structural check, very similar to "one trick ponies" + in :mod:`collections.abc` such as :class:`Iterable`. For example:: -.. class:: AsyncContextManager(Generic[T_co]) + @runtime_checkable + class Closable(Protocol): + def close(self): ... - A generic version of :class:`contextlib.AbstractAsyncContextManager`. + assert isinstance(open('/some/file'), Closable) - .. versionadded:: 3.5.4 - .. versionadded:: 3.6.2 + .. note:: -.. class:: Dict(dict, MutableMapping[KT, VT]) + :func:`runtime_checkable` will check only the presence of the required methods, + not their type signatures! For example, :class:`builtins.complex ` + implements :func:`__float__`, therefore it passes an :func:`issubclass` check + against :class:`SupportsFloat`. However, the ``complex.__float__`` method + exists only to raise a :class:`TypeError` with a more informative message. - A generic version of :class:`dict`. - Useful for annotating return types. To annotate arguments it is preferred - to use an abstract collection type such as :class:`Mapping`. + .. versionadded:: 3.8 - This type can be used as follows:: +Other special directives +"""""""""""""""""""""""" - def count_words(text: str) -> Dict[str, int]: - ... +These are not used in annotations. They are building blocks for declaring types. -.. class:: DefaultDict(collections.defaultdict, MutableMapping[KT, VT]) +.. class:: NamedTuple - A generic version of :class:`collections.defaultdict`. + Typed version of :func:`collections.namedtuple`. - .. versionadded:: 3.5.2 + Usage:: -.. class:: OrderedDict(collections.OrderedDict, MutableMapping[KT, VT]) + class Employee(NamedTuple): + name: str + id: int - A generic version of :class:`collections.OrderedDict`. + This is equivalent to:: - .. versionadded:: 3.7.2 + Employee = collections.namedtuple('Employee', ['name', 'id']) -.. class:: Counter(collections.Counter, Dict[T, int]) + To give a field a default value, you can assign to it in the class body:: - A generic version of :class:`collections.Counter`. + class Employee(NamedTuple): + name: str + id: int = 3 - .. versionadded:: 3.5.4 - .. versionadded:: 3.6.1 + employee = Employee('Guido') + assert employee.id == 3 -.. class:: ChainMap(collections.ChainMap, MutableMapping[KT, VT]) + Fields with a default value must come after any fields without a default. - A generic version of :class:`collections.ChainMap`. + The resulting class has an extra attribute ``__annotations__`` giving a + dict that maps the field names to the field types. (The field names are in + the ``_fields`` attribute and the default values are in the + ``_field_defaults`` attribute both of which are part of the namedtuple + API.) - .. versionadded:: 3.5.4 - .. versionadded:: 3.6.1 + ``NamedTuple`` subclasses can also have docstrings and methods:: -.. class:: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co]) - - A generator can be annotated by the generic type - ``Generator[YieldType, SendType, ReturnType]``. For example:: - - def echo_round() -> Generator[int, float, str]: - sent = yield 0 - while sent >= 0: - sent = yield round(sent) - return 'Done' - - Note that unlike many other generics in the typing module, the ``SendType`` - of :class:`Generator` behaves contravariantly, not covariantly or - invariantly. - - If your generator will only yield values, set the ``SendType`` and - ``ReturnType`` to ``None``:: - - def infinite_stream(start: int) -> Generator[int, None, None]: - while True: - yield start - start += 1 - - Alternatively, annotate your generator as having a return type of - either ``Iterable[YieldType]`` or ``Iterator[YieldType]``:: - - def infinite_stream(start: int) -> Iterator[int]: - while True: - yield start - start += 1 - -.. class:: AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra]) - - An async generator can be annotated by the generic type - ``AsyncGenerator[YieldType, SendType]``. For example:: - - async def echo_round() -> AsyncGenerator[int, float]: - sent = yield 0 - while sent >= 0.0: - rounded = await round(sent) - sent = yield rounded - - Unlike normal generators, async generators cannot return a value, so there - is no ``ReturnType`` type parameter. As with :class:`Generator`, the - ``SendType`` behaves contravariantly. - - If your generator will only yield values, set the ``SendType`` to - ``None``:: - - async def infinite_stream(start: int) -> AsyncGenerator[int, None]: - while True: - yield start - start = await increment(start) - - Alternatively, annotate your generator as having a return type of - either ``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``:: - - async def infinite_stream(start: int) -> AsyncIterator[int]: - while True: - yield start - start = await increment(start) - - .. versionadded:: 3.6.1 - -.. class:: Text - - ``Text`` is an alias for ``str``. It is provided to supply a forward - compatible path for Python 2 code: in Python 2, ``Text`` is an alias for - ``unicode``. - - Use ``Text`` to indicate that a value must contain a unicode string in - a manner that is compatible with both Python 2 and Python 3:: - - def add_unicode_checkmark(text: Text) -> Text: - return text + u' \u2713' - - .. versionadded:: 3.5.2 - -.. class:: IO - TextIO - BinaryIO - - Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` - and ``BinaryIO(IO[bytes])`` - represent the types of I/O streams such as returned by - :func:`open`. - -.. class:: Pattern - Match - - These type aliases - correspond to the return types from :func:`re.compile` and - :func:`re.match`. These types (and the corresponding functions) - are generic in ``AnyStr`` and can be made specific by writing - ``Pattern[str]``, ``Pattern[bytes]``, ``Match[str]``, or - ``Match[bytes]``. - -.. class:: NamedTuple - - Typed version of :func:`collections.namedtuple`. - - Usage:: - - class Employee(NamedTuple): - name: str - id: int - - This is equivalent to:: - - Employee = collections.namedtuple('Employee', ['name', 'id']) - - To give a field a default value, you can assign to it in the class body:: - - class Employee(NamedTuple): - name: str - id: int = 3 - - employee = Employee('Guido') - assert employee.id == 3 - - Fields with a default value must come after any fields without a default. - - The resulting class has an extra attribute ``__annotations__`` giving a - dict that maps the field names to the field types. (The field names are in - the ``_fields`` attribute and the default values are in the - ``_field_defaults`` attribute both of which are part of the namedtuple - API.) - - ``NamedTuple`` subclasses can also have docstrings and methods:: - - class Employee(NamedTuple): - """Represents an employee.""" - name: str - id: int = 3 + class Employee(NamedTuple): + """Represents an employee.""" + name: str + id: int = 3 def __repr__(self) -> str: return f'' @@ -967,13 +982,23 @@ The module defines the following classes, functions and decorators: Removed the ``_field_types`` attribute in favor of the more standard ``__annotations__`` attribute which has the same information. +.. function:: NewType(name, tp) + + A helper function to indicate a distinct type to a typechecker, + see :ref:`distinct`. At runtime it returns a function that returns + its argument. Usage:: + + UserId = NewType('UserId', int) + first_user = UserId(1) + + .. versionadded:: 3.5.2 .. class:: TypedDict(dict) - A simple typed namespace. At runtime it is equivalent to - a plain :class:`dict`. + Special construct to add type hints to a dictionary. + At runtime it is a plain :class:`dict`. - ``TypedDict`` creates a dictionary type that expects all of its + ``TypedDict`` declares a dictionary type that expects all of its instances to have a certain set of keys, where each key is associated with a value of a consistent type. This expectation is not checked at runtime but is only enforced by type checkers. @@ -1014,474 +1039,658 @@ The module defines the following classes, functions and decorators: .. versionadded:: 3.8 -.. class:: ForwardRef +Generic concrete collections +---------------------------- - A class used for internal typing representation of string forward references. - For example, ``List["SomeClass"]`` is implicitly transformed into - ``List[ForwardRef("SomeClass")]``. This class should not be instantiated by - a user, but may be used by introspection tools. +Corresponding to built-in types +""""""""""""""""""""""""""""""" -.. function:: NewType(name, tp) +.. class:: Dict(dict, MutableMapping[KT, VT]) - A helper function to indicate a distinct type to a typechecker, - see :ref:`distinct`. At runtime it returns a function that returns - its argument. Usage:: + A generic version of :class:`dict`. + Useful for annotating return types. To annotate arguments it is preferred + to use an abstract collection type such as :class:`Mapping`. - UserId = NewType('UserId', int) - first_user = UserId(1) + This type can be used as follows:: - .. versionadded:: 3.5.2 + def count_words(text: str) -> Dict[str, int]: + ... -.. function:: cast(typ, val) + .. deprecated:: 3.9 + :class:`builtins.dict ` now supports ``[]``. See :pep:`585`. - Cast a value to a type. +.. class:: List(list, MutableSequence[T]) - This returns the value unchanged. To the type checker this - signals that the return value has the designated type, but at - runtime we intentionally don't check anything (we want this - to be as fast as possible). + Generic version of :class:`list`. + Useful for annotating return types. To annotate arguments it is preferred + to use an abstract collection type such as :class:`Sequence` or + :class:`Iterable`. -.. function:: get_type_hints(obj, globalns=None, localns=None, include_extras=False) + This type may be used as follows:: - Return a dictionary containing type hints for a function, method, module - or class object. + T = TypeVar('T', int, float) - This is often the same as ``obj.__annotations__``. In addition, - forward references encoded as string literals are handled by evaluating - them in ``globals`` and ``locals`` namespaces. If necessary, - ``Optional[t]`` is added for function and method annotations if a default - value equal to ``None`` is set. For a class ``C``, return - a dictionary constructed by merging all the ``__annotations__`` along - ``C.__mro__`` in reverse order. + def vec2(x: T, y: T) -> List[T]: + return [x, y] - The function recursively replaces all ``Annotated[T, ...]`` with ``T``, - unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for - more information). For example:: + def keep_positives(vector: Sequence[T]) -> List[T]: + return [item for item in vector if item > 0] - class Student(NamedTuple): - name: Annotated[str, 'some marker'] + .. deprecated:: 3.9 + :class:`builtins.list ` now supports ``[]``. See :pep:`585`. - get_type_hints(Student) == {'name': str} - get_type_hints(Student, include_extras=False) == {'name': str} - get_type_hints(Student, include_extras=True) == { - 'name': Annotated[str, 'some marker'] - } +.. class:: Set(set, MutableSet[T]) - .. versionchanged:: 3.9 - Added ``include_extras`` parameter as part of :pep:`593`. + A generic version of :class:`builtins.set `. + Useful for annotating return types. To annotate arguments it is preferred + to use an abstract collection type such as :class:`AbstractSet`. -.. function:: get_origin(tp) -.. function:: get_args(tp) + .. deprecated:: 3.9 + :class:`builtins.set ` now supports ``[]``. See :pep:`585`. - Provide basic introspection for generic types and special typing forms. +.. class:: FrozenSet(frozenset, AbstractSet[T_co]) - For a typing object of the form ``X[Y, Z, ...]`` these functions return - ``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or - :mod:`collections` class, it gets normalized to the original class. - For unsupported objects return ``None`` and ``()`` correspondingly. - Examples:: + A generic version of :class:`builtins.frozenset `. - assert get_origin(Dict[str, int]) is dict - assert get_args(Dict[int, str]) == (int, str) + .. deprecated:: 3.9 + :class:`builtins.frozenset ` now supports ``[]``. See :pep:`585`. - assert get_origin(Union[int, str]) is Union - assert get_args(Union[int, str]) == (int, str) +.. note:: :data:`Tuple` is a special form. - .. versionadded:: 3.8 +Corresponding to types in :mod:`collections` +"""""""""""""""""""""""""""""""""""""""""""" -.. decorator:: overload +.. class:: DefaultDict(collections.defaultdict, MutableMapping[KT, VT]) - The ``@overload`` decorator allows describing functions and methods - that support multiple different combinations of argument types. A series - of ``@overload``-decorated definitions must be followed by exactly one - non-``@overload``-decorated definition (for the same function/method). - The ``@overload``-decorated definitions are for the benefit of the - type checker only, since they will be overwritten by the - non-``@overload``-decorated definition, while the latter is used at - runtime but should be ignored by a type checker. At runtime, calling - a ``@overload``-decorated function directly will raise - :exc:`NotImplementedError`. An example of overload that gives a more - precise type than can be expressed using a union or a type variable:: + A generic version of :class:`collections.defaultdict`. - @overload - def process(response: None) -> None: - ... - @overload - def process(response: int) -> Tuple[int, str]: - ... - @overload - def process(response: bytes) -> str: - ... - def process(response): - + .. versionadded:: 3.5.2 - See :pep:`484` for details and comparison with other typing semantics. + .. deprecated:: 3.9 + :class:`collections.defaultdict` now supports ``[]``. See :pep:`585`. -.. decorator:: final +.. class:: OrderedDict(collections.OrderedDict, MutableMapping[KT, VT]) - A decorator to indicate to type checkers that the decorated method - cannot be overridden, and the decorated class cannot be subclassed. - For example:: + A generic version of :class:`collections.OrderedDict`. - class Base: - @final - def done(self) -> None: - ... - class Sub(Base): - def done(self) -> None: # Error reported by type checker - ... + .. versionadded:: 3.7.2 - @final - class Leaf: - ... - class Other(Leaf): # Error reported by type checker - ... + .. deprecated:: 3.9 + :class:`collections.OrderedDict` now supports ``[]``. See :pep:`585`. - There is no runtime checking of these properties. See :pep:`591` for - more details. +.. class:: ChainMap(collections.ChainMap, MutableMapping[KT, VT]) - .. versionadded:: 3.8 + A generic version of :class:`collections.ChainMap`. -.. decorator:: no_type_check + .. versionadded:: 3.5.4 + .. versionadded:: 3.6.1 - Decorator to indicate that annotations are not type hints. + .. deprecated:: 3.9 + :class:`collections.ChainMap` now supports ``[]``. See :pep:`585`. - This works as class or function :term:`decorator`. With a class, it - applies recursively to all methods defined in that class (but not - to methods defined in its superclasses or subclasses). +.. class:: Counter(collections.Counter, Dict[T, int]) - This mutates the function(s) in place. + A generic version of :class:`collections.Counter`. -.. decorator:: no_type_check_decorator + .. versionadded:: 3.5.4 + .. versionadded:: 3.6.1 - Decorator to give another decorator the :func:`no_type_check` effect. + .. deprecated:: 3.9 + :class:`collections.Counter` now supports ``[]``. See :pep:`585`. - This wraps the decorator with something that wraps the decorated - function in :func:`no_type_check`. +.. class:: Deque(deque, MutableSequence[T]) -.. decorator:: type_check_only + A generic version of :class:`collections.deque`. - Decorator to mark a class or function to be unavailable at runtime. + .. versionadded:: 3.5.4 + .. versionadded:: 3.6.1 - This decorator is itself not available at runtime. It is mainly - intended to mark classes that are defined in type stub files if - an implementation returns an instance of a private class:: + .. deprecated:: 3.9 + :class:`collections.deque` now supports ``[]``. See :pep:`585`. - @type_check_only - class Response: # private or not available at runtime - code: int - def get_header(self, name: str) -> str: ... +Other concrete types +"""""""""""""""""""" - def fetch_response() -> Response: ... +.. class:: IO + TextIO + BinaryIO - Note that returning instances of private classes is not recommended. - It is usually preferable to make such classes public. + Generic type ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` + and ``BinaryIO(IO[bytes])`` + represent the types of I/O streams such as returned by + :func:`open`. These types are also in the ``typing.io`` namespace. -.. decorator:: runtime_checkable +.. class:: Pattern + Match - Mark a protocol class as a runtime protocol. + These type aliases + correspond to the return types from :func:`re.compile` and + :func:`re.match`. These types (and the corresponding functions) + are generic in ``AnyStr`` and can be made specific by writing + ``Pattern[str]``, ``Pattern[bytes]``, ``Match[str]``, or + ``Match[bytes]``. These types are also in the ``typing.re`` namespace. - Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. - This raises :exc:`TypeError` when applied to a non-protocol class. This - allows a simple-minded structural check, very similar to "one trick ponies" - in :mod:`collections.abc` such as :class:`Iterable`. For example:: + .. deprecated:: 3.9 + Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :pep:`585`. - @runtime_checkable - class Closable(Protocol): - def close(self): ... +.. class:: Text - assert isinstance(open('/some/file'), Closable) + ``Text`` is an alias for ``str``. It is provided to supply a forward + compatible path for Python 2 code: in Python 2, ``Text`` is an alias for + ``unicode``. - **Warning:** this will check only the presence of the required methods, - not their type signatures! + Use ``Text`` to indicate that a value must contain a unicode string in + a manner that is compatible with both Python 2 and Python 3:: - .. versionadded:: 3.8 + def add_unicode_checkmark(text: Text) -> Text: + return text + u' \u2713' -.. data:: Any + .. versionadded:: 3.5.2 - Special type indicating an unconstrained type. +Abstract Base Classes +--------------------- - * Every type is compatible with :data:`Any`. - * :data:`Any` is compatible with every type. +Corresponding to collections in :mod:`collections.abc` +"""""""""""""""""""""""""""""""""""""""""""""""""""""" -.. data:: NoReturn +.. class:: AbstractSet(Sized, Collection[T_co]) - Special type indicating that a function never returns. - For example:: + A generic version of :class:`collections.abc.Set`. - from typing import NoReturn + .. deprecated:: 3.9 + :class:`collections.abc.Set` now supports ``[]``. See :pep:`585`. - def stop() -> NoReturn: - raise RuntimeError('no way') +.. class:: ByteString(Sequence[int]) - .. versionadded:: 3.5.4 - .. versionadded:: 3.6.2 + A generic version of :class:`collections.abc.ByteString`. -.. data:: Union + This type represents the types :class:`bytes`, :class:`bytearray`, + and :class:`memoryview` of byte sequences. - Union type; ``Union[X, Y]`` means either X or Y. + As a shorthand for this type, :class:`bytes` can be used to + annotate arguments of any of the types mentioned above. - To define a union, use e.g. ``Union[int, str]``. Details: + .. deprecated:: 3.9 + :class:`collections.abc.ByteString` now supports ``[]``. See :pep:`585`. - * The arguments must be types and there must be at least one. +.. class:: Collection(Sized, Iterable[T_co], Container[T_co]) - * Unions of unions are flattened, e.g.:: + A generic version of :class:`collections.abc.Collection` - Union[Union[int, str], float] == Union[int, str, float] + .. versionadded:: 3.6.0 - * Unions of a single argument vanish, e.g.:: + .. deprecated:: 3.9 + :class:`collections.abc.Collection` now supports ``[]``. See :pep:`585`. - Union[int] == int # The constructor actually returns int +.. class:: Container(Generic[T_co]) - * Redundant arguments are skipped, e.g.:: + A generic version of :class:`collections.abc.Container`. - Union[int, str, int] == Union[int, str] + .. deprecated:: 3.9 + :class:`collections.abc.Container` now supports ``[]``. See :pep:`585`. - * When comparing unions, the argument order is ignored, e.g.:: +.. class:: ItemsView(MappingView, Generic[KT_co, VT_co]) - Union[int, str] == Union[str, int] + A generic version of :class:`collections.abc.ItemsView`. - * You cannot subclass or instantiate a union. + .. deprecated:: 3.9 + :class:`collections.abc.ItemsView` now supports ``[]``. See :pep:`585`. - * You cannot write ``Union[X][Y]``. +.. class:: KeysView(MappingView[KT_co], AbstractSet[KT_co]) - * You can use ``Optional[X]`` as a shorthand for ``Union[X, None]``. + A generic version of :class:`collections.abc.KeysView`. - .. versionchanged:: 3.7 - Don't remove explicit subclasses from unions at runtime. + .. deprecated:: 3.9 + :class:`collections.abc.KeysView` now supports ``[]``. See :pep:`585`. -.. data:: Optional +.. class:: Mapping(Sized, Collection[KT], Generic[VT_co]) - Optional type. + A generic version of :class:`collections.abc.Mapping`. + This type can be used as follows:: - ``Optional[X]`` is equivalent to ``Union[X, None]``. + def get_position_in_index(word_list: Mapping[str, int], word: str) -> int: + return word_list[word] - Note that this is not the same concept as an optional argument, - which is one that has a default. An optional argument with a - default does not require the ``Optional`` qualifier on its type - annotation just because it is optional. For example:: + .. deprecated:: 3.9 + :class:`collections.abc.Mapping` now supports ``[]``. See :pep:`585`. - def foo(arg: int = 0) -> None: - ... +.. class:: MappingView(Sized, Iterable[T_co]) - On the other hand, if an explicit value of ``None`` is allowed, the - use of ``Optional`` is appropriate, whether the argument is optional - or not. For example:: + A generic version of :class:`collections.abc.MappingView`. - def foo(arg: Optional[int] = None) -> None: - ... + .. deprecated:: 3.9 + :class:`collections.abc.MappingView` now supports ``[]``. See :pep:`585`. -.. data:: Tuple +.. class:: MutableMapping(Mapping[KT, VT]) - Tuple type; ``Tuple[X, Y]`` is the type of a tuple of two items - with the first item of type X and the second of type Y. The type of - the empty tuple can be written as ``Tuple[()]``. + A generic version of :class:`collections.abc.MutableMapping`. - Example: ``Tuple[T1, T2]`` is a tuple of two elements corresponding - to type variables T1 and T2. ``Tuple[int, float, str]`` is a tuple - of an int, a float and a string. + .. deprecated:: 3.9 + :class:`collections.abc.MutableMapping` now supports ``[]``. See :pep:`585`. - To specify a variable-length tuple of homogeneous type, - use literal ellipsis, e.g. ``Tuple[int, ...]``. A plain :data:`Tuple` - is equivalent to ``Tuple[Any, ...]``, and in turn to :class:`tuple`. +.. class:: MutableSequence(Sequence[T]) -.. data:: Callable + A generic version of :class:`collections.abc.MutableSequence`. - Callable type; ``Callable[[int], str]`` is a function of (int) -> str. + .. deprecated:: 3.9 + :class:`collections.abc.MutableSequence` now supports ``[]``. See :pep:`585`. - The subscription syntax must always be used with exactly two - values: the argument list and the return type. The argument list - must be a list of types or an ellipsis; the return type must be - a single type. +.. class:: MutableSet(AbstractSet[T]) - There is no syntax to indicate optional or keyword arguments; - such function types are rarely used as callback types. - ``Callable[..., ReturnType]`` (literal ellipsis) can be used to - type hint a callable taking any number of arguments and returning - ``ReturnType``. A plain :data:`Callable` is equivalent to - ``Callable[..., Any]``, and in turn to - :class:`collections.abc.Callable`. + A generic version of :class:`collections.abc.MutableSet`. -.. data:: Literal + .. deprecated:: 3.9 + :class:`collections.abc.MutableSet` now supports ``[]``. See :pep:`585`. - A type that can be used to indicate to type checkers that the - corresponding variable or function parameter has a value equivalent to - the provided literal (or one of several literals). For example:: +.. class:: Sequence(Reversible[T_co], Collection[T_co]) - def validate_simple(data: Any) -> Literal[True]: # always returns True - ... + A generic version of :class:`collections.abc.Sequence`. - MODE = Literal['r', 'rb', 'w', 'wb'] - def open_helper(file: str, mode: MODE) -> str: - ... + .. deprecated:: 3.9 + :class:`collections.abc.Sequence` now supports ``[]``. See :pep:`585`. - open_helper('/some/path', 'r') # Passes type check - open_helper('/other/path', 'typo') # Error in type checker +.. class:: ValuesView(MappingView[VT_co]) - ``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value - is allowed as type argument to ``Literal[...]``, but type checkers may - impose restrictions. See :pep:`586` for more details about literal types. + A generic version of :class:`collections.abc.ValuesView`. - .. versionadded:: 3.8 + .. deprecated:: 3.9 + :class:`collections.abc.ValuesView` now supports ``[]``. See :pep:`585`. -.. data:: ClassVar +Corresponding to other types in :mod:`collections.abc` +"""""""""""""""""""""""""""""""""""""""""""""""""""""" - Special type construct to mark class variables. +.. class:: Iterable(Generic[T_co]) - As introduced in :pep:`526`, a variable annotation wrapped in ClassVar - indicates that a given attribute is intended to be used as a class variable - and should not be set on instances of that class. Usage:: + A generic version of :class:`collections.abc.Iterable`. - class Starship: - stats: ClassVar[Dict[str, int]] = {} # class variable - damage: int = 10 # instance variable + .. deprecated:: 3.9 + :class:`collections.abc.Iterable` now supports ``[]``. See :pep:`585`. - :data:`ClassVar` accepts only types and cannot be further subscribed. +.. class:: Iterator(Iterable[T_co]) - :data:`ClassVar` is not a class itself, and should not - be used with :func:`isinstance` or :func:`issubclass`. - :data:`ClassVar` does not change Python runtime behavior, but - it can be used by third-party type checkers. For example, a type checker - might flag the following code as an error:: + A generic version of :class:`collections.abc.Iterator`. - enterprise_d = Starship(3000) - enterprise_d.stats = {} # Error, setting class variable on instance - Starship.stats = {} # This is OK + .. deprecated:: 3.9 + :class:`collections.abc.Iterator` now supports ``[]``. See :pep:`585`. - .. versionadded:: 3.5.3 +.. class:: Generator(Iterator[T_co], Generic[T_co, T_contra, V_co]) -.. data:: Final + A generator can be annotated by the generic type + ``Generator[YieldType, SendType, ReturnType]``. For example:: - A special typing construct to indicate to type checkers that a name - cannot be re-assigned or overridden in a subclass. For example:: + def echo_round() -> Generator[int, float, str]: + sent = yield 0 + while sent >= 0: + sent = yield round(sent) + return 'Done' - MAX_SIZE: Final = 9000 - MAX_SIZE += 1 # Error reported by type checker + Note that unlike many other generics in the typing module, the ``SendType`` + of :class:`Generator` behaves contravariantly, not covariantly or + invariantly. - class Connection: - TIMEOUT: Final[int] = 10 + If your generator will only yield values, set the ``SendType`` and + ``ReturnType`` to ``None``:: - class FastConnector(Connection): - TIMEOUT = 1 # Error reported by type checker + def infinite_stream(start: int) -> Generator[int, None, None]: + while True: + yield start + start += 1 - There is no runtime checking of these properties. See :pep:`591` for - more details. + Alternatively, annotate your generator as having a return type of + either ``Iterable[YieldType]`` or ``Iterator[YieldType]``:: - .. versionadded:: 3.8 + def infinite_stream(start: int) -> Iterator[int]: + while True: + yield start + start += 1 -.. data:: AnyStr + .. deprecated:: 3.9 + :class:`collections.abc.Generator` now supports ``[]``. See :pep:`585`. - ``AnyStr`` is a type variable defined as - ``AnyStr = TypeVar('AnyStr', str, bytes)``. +.. class:: Hashable - It is meant to be used for functions that may accept any kind of string - without allowing different kinds of strings to mix. For example:: + An alias to :class:`collections.abc.Hashable` - def concat(a: AnyStr, b: AnyStr) -> AnyStr: - return a + b +.. class:: Reversible(Iterable[T_co]) - concat(u"foo", u"bar") # Ok, output has type 'unicode' - concat(b"foo", b"bar") # Ok, output has type 'bytes' - concat(u"foo", b"bar") # Error, cannot mix unicode and bytes + A generic version of :class:`collections.abc.Reversible`. -.. data:: TYPE_CHECKING + .. deprecated:: 3.9 + :class:`collections.abc.Reversible` now supports ``[]``. See :pep:`585`. - A special constant that is assumed to be ``True`` by 3rd party static - type checkers. It is ``False`` at runtime. Usage:: +.. class:: Sized - if TYPE_CHECKING: - import expensive_mod + An alias to :class:`collections.abc.Sized` - def fun(arg: 'expensive_mod.SomeType') -> None: - local_var: expensive_mod.AnotherType = other_fun() +Asynchronous programming +"""""""""""""""""""""""" - Note that the first type annotation must be enclosed in quotes, making it a - "forward reference", to hide the ``expensive_mod`` reference from the - interpreter runtime. Type annotations for local variables are not - evaluated, so the second annotation does not need to be enclosed in quotes. +.. class:: Coroutine(Awaitable[V_co], Generic[T_co T_contra, V_co]) + + A generic version of :class:`collections.abc.Coroutine`. + The variance and order of type variables + correspond to those of :class:`Generator`, for example:: + + from typing import List, Coroutine + c = None # type: Coroutine[List[str], str, int] + ... + x = c.send('hi') # type: List[str] + async def bar() -> None: + x = await c # type: int + + .. versionadded:: 3.5.3 + + .. deprecated:: 3.9 + :class:`collections.abc.Coroutine` now supports ``[]``. See :pep:`585`. + +.. class:: AsyncGenerator(AsyncIterator[T_co], Generic[T_co, T_contra]) + + An async generator can be annotated by the generic type + ``AsyncGenerator[YieldType, SendType]``. For example:: + + async def echo_round() -> AsyncGenerator[int, float]: + sent = yield 0 + while sent >= 0.0: + rounded = await round(sent) + sent = yield rounded + + Unlike normal generators, async generators cannot return a value, so there + is no ``ReturnType`` type parameter. As with :class:`Generator`, the + ``SendType`` behaves contravariantly. + + If your generator will only yield values, set the ``SendType`` to + ``None``:: + + async def infinite_stream(start: int) -> AsyncGenerator[int, None]: + while True: + yield start + start = await increment(start) + + Alternatively, annotate your generator as having a return type of + either ``AsyncIterable[YieldType]`` or ``AsyncIterator[YieldType]``:: + + async def infinite_stream(start: int) -> AsyncIterator[int]: + while True: + yield start + start = await increment(start) + + .. versionadded:: 3.6.1 + + .. deprecated:: 3.9 + :class:`collections.abc.AsyncGenerator` now supports ``[]``. See :pep:`585`. + +.. class:: AsyncIterable(Generic[T_co]) + + A generic version of :class:`collections.abc.AsyncIterable`. .. versionadded:: 3.5.2 -.. data:: Annotated + .. deprecated:: 3.9 + :class:`collections.abc.AsyncIterable` now supports ``[]``. See :pep:`585`. - A type, introduced in :pep:`593` (``Flexible function and variable - annotations``), to decorate existing types with context-specific metadata - (possibly multiple pieces of it, as ``Annotated`` is variadic). - Specifically, a type ``T`` can be annotated with metadata ``x`` via the - typehint ``Annotated[T, x]``. This metadata can be used for either static - analysis or at runtime. If a library (or tool) encounters a typehint - ``Annotated[T, x]`` and has no special logic for metadata ``x``, it - should ignore it and simply treat the type as ``T``. Unlike the - ``no_type_check`` functionality that currently exists in the ``typing`` - module which completely disables typechecking annotations on a function - or a class, the ``Annotated`` type allows for both static typechecking - of ``T`` (e.g., via mypy or Pyre, which can safely ignore ``x``) - together with runtime access to ``x`` within a specific application. +.. class:: AsyncIterator(AsyncIterable[T_co]) - Ultimately, the responsibility of how to interpret the annotations (if - at all) is the responsibility of the tool or library encountering the - ``Annotated`` type. A tool or library encountering an ``Annotated`` type - can scan through the annotations to determine if they are of interest - (e.g., using ``isinstance()``). + A generic version of :class:`collections.abc.AsyncIterator`. - When a tool or a library does not support annotations or encounters an - unknown annotation it should just ignore it and treat annotated type as - the underlying type. + .. versionadded:: 3.5.2 - It's up to the tool consuming the annotations to decide whether the - client is allowed to have several annotations on one type and how to - merge those annotations. + .. deprecated:: 3.9 + :class:`collections.abc.AsyncIterator` now supports ``[]``. See :pep:`585`. - Since the ``Annotated`` type allows you to put several annotations of - the same (or different) type(s) on any node, the tools or libraries - consuming those annotations are in charge of dealing with potential - duplicates. For example, if you are doing value range analysis you might - allow this:: +.. class:: Awaitable(Generic[T_co]) - T1 = Annotated[int, ValueRange(-10, 5)] - T2 = Annotated[T1, ValueRange(-20, 3)] + A generic version of :class:`collections.abc.Awaitable`. - Passing ``include_extras=True`` to :func:`get_type_hints` lets one - access the extra annotations at runtime. + .. versionadded:: 3.5.2 - The details of the syntax: + .. deprecated:: 3.9 + :class:`collections.abc.Awaitable` now supports ``[]``. See :pep:`585`. - * The first argument to ``Annotated`` must be a valid type - * Multiple type annotations are supported (``Annotated`` supports variadic - arguments):: +Context manager types +""""""""""""""""""""" - Annotated[int, ValueRange(3, 10), ctype("char")] +.. class:: ContextManager(Generic[T_co]) - * ``Annotated`` must be called with at least two arguments ( - ``Annotated[int]`` is not valid) + A generic version of :class:`contextlib.AbstractContextManager`. - * The order of the annotations is preserved and matters for equality - checks:: + .. versionadded:: 3.5.4 + .. versionadded:: 3.6.0 - Annotated[int, ValueRange(3, 10), ctype("char")] != Annotated[ - int, ctype("char"), ValueRange(3, 10) - ] + .. deprecated:: 3.9 + :class:`collections.contextlib.AbstractContextManager` now supports ``[]``. See :pep:`585`. - * Nested ``Annotated`` types are flattened, with metadata ordered - starting with the innermost annotation:: +.. class:: AsyncContextManager(Generic[T_co]) - Annotated[Annotated[int, ValueRange(3, 10)], ctype("char")] == Annotated[ - int, ValueRange(3, 10), ctype("char") - ] + A generic version of :class:`contextlib.AbstractAsyncContextManager`. - * Duplicated annotations are not removed:: + .. versionadded:: 3.5.4 + .. versionadded:: 3.6.2 - Annotated[int, ValueRange(3, 10)] != Annotated[ - int, ValueRange(3, 10), ValueRange(3, 10) - ] + .. deprecated:: 3.9 + :class:`collections.contextlib.AbstractAsyncContextManager` now supports ``[]``. See :pep:`585`. - * ``Annotated`` can be used with nested and generic aliases:: +Protocols +--------- - T = TypeVar('T') - Vec = Annotated[List[Tuple[T, T]], MaxLen(10)] - V = Vec[int] +These protocols are decorated with :func:`runtime_checkable`. - V == Annotated[List[Tuple[int, int]], MaxLen(10)] +.. class:: SupportsAbs + + An ABC with one abstract method ``__abs__`` that is covariant + in its return type. + +.. class:: SupportsBytes + + An ABC with one abstract method ``__bytes__``. + +.. class:: SupportsComplex + + An ABC with one abstract method ``__complex__``. + +.. class:: SupportsFloat + + An ABC with one abstract method ``__float__``. + +.. class:: SupportsIndex + + An ABC with one abstract method ``__index__``. + + .. versionadded:: 3.8 + +.. class:: SupportsInt + + An ABC with one abstract method ``__int__``. + +.. class:: SupportsRound + + An ABC with one abstract method ``__round__`` + that is covariant in its return type. + +Functions and decorators +------------------------ + +.. function:: cast(typ, val) + + Cast a value to a type. + + This returns the value unchanged. To the type checker this + signals that the return value has the designated type, but at + runtime we intentionally don't check anything (we want this + to be as fast as possible). + +.. decorator:: overload + + The ``@overload`` decorator allows describing functions and methods + that support multiple different combinations of argument types. A series + of ``@overload``-decorated definitions must be followed by exactly one + non-``@overload``-decorated definition (for the same function/method). + The ``@overload``-decorated definitions are for the benefit of the + type checker only, since they will be overwritten by the + non-``@overload``-decorated definition, while the latter is used at + runtime but should be ignored by a type checker. At runtime, calling + a ``@overload``-decorated function directly will raise + :exc:`NotImplementedError`. An example of overload that gives a more + precise type than can be expressed using a union or a type variable:: + + @overload + def process(response: None) -> None: + ... + @overload + def process(response: int) -> Tuple[int, str]: + ... + @overload + def process(response: bytes) -> str: + ... + def process(response): + + + See :pep:`484` for details and comparison with other typing semantics. + +.. decorator:: final + + A decorator to indicate to type checkers that the decorated method + cannot be overridden, and the decorated class cannot be subclassed. + For example:: + + class Base: + @final + def done(self) -> None: + ... + class Sub(Base): + def done(self) -> None: # Error reported by type checker + ... + + @final + class Leaf: + ... + class Other(Leaf): # Error reported by type checker + ... + + There is no runtime checking of these properties. See :pep:`591` for + more details. + + .. versionadded:: 3.8 + +.. decorator:: no_type_check + + Decorator to indicate that annotations are not type hints. + + This works as class or function :term:`decorator`. With a class, it + applies recursively to all methods defined in that class (but not + to methods defined in its superclasses or subclasses). + + This mutates the function(s) in place. + +.. decorator:: no_type_check_decorator + + Decorator to give another decorator the :func:`no_type_check` effect. + + This wraps the decorator with something that wraps the decorated + function in :func:`no_type_check`. + +.. decorator:: type_check_only + + Decorator to mark a class or function to be unavailable at runtime. + + This decorator is itself not available at runtime. It is mainly + intended to mark classes that are defined in type stub files if + an implementation returns an instance of a private class:: + + @type_check_only + class Response: # private or not available at runtime + code: int + def get_header(self, name: str) -> str: ... + + def fetch_response() -> Response: ... + + Note that returning instances of private classes is not recommended. + It is usually preferable to make such classes public. + +Introspection helpers +--------------------- + +.. function:: get_type_hints(obj, globalns=None, localns=None, include_extras=False) + + Return a dictionary containing type hints for a function, method, module + or class object. + + This is often the same as ``obj.__annotations__``. In addition, + forward references encoded as string literals are handled by evaluating + them in ``globals`` and ``locals`` namespaces. If necessary, + ``Optional[t]`` is added for function and method annotations if a default + value equal to ``None`` is set. For a class ``C``, return + a dictionary constructed by merging all the ``__annotations__`` along + ``C.__mro__`` in reverse order. + + The function recursively replaces all ``Annotated[T, ...]`` with ``T``, + unless ``include_extras`` is set to ``True`` (see :class:`Annotated` for + more information). For example:: + + class Student(NamedTuple): + name: Annotated[str, 'some marker'] + + get_type_hints(Student) == {'name': str} + get_type_hints(Student, include_extras=False) == {'name': str} + get_type_hints(Student, include_extras=True) == { + 'name': Annotated[str, 'some marker'] + } + + .. versionchanged:: 3.9 + Added ``include_extras`` parameter as part of :pep:`593`. + +.. function:: get_args(tp) +.. function:: get_origin(tp) + + Provide basic introspection for generic types and special typing forms. + + For a typing object of the form ``X[Y, Z, ...]`` these functions return + ``X`` and ``(Y, Z, ...)``. If ``X`` is a generic alias for a builtin or + :mod:`collections` class, it gets normalized to the original class. + For unsupported objects return ``None`` and ``()`` correspondingly. + Examples:: + + assert get_origin(Dict[str, int]) is dict + assert get_args(Dict[int, str]) == (int, str) + + assert get_origin(Union[int, str]) is Union + assert get_args(Union[int, str]) == (int, str) + + .. versionadded:: 3.8 + +.. class:: ForwardRef + + A class used for internal typing representation of string forward references. + For example, ``List["SomeClass"]`` is implicitly transformed into + ``List[ForwardRef("SomeClass")]``. This class should not be instantiated by + a user, but may be used by introspection tools. + +Constant +-------- + +.. data:: TYPE_CHECKING + + A special constant that is assumed to be ``True`` by 3rd party static + type checkers. It is ``False`` at runtime. Usage:: + + if TYPE_CHECKING: + import expensive_mod + + def fun(arg: 'expensive_mod.SomeType') -> None: + local_var: expensive_mod.AnotherType = other_fun() + + The first type annotation must be enclosed in quotes, making it a + "forward reference", to hide the ``expensive_mod`` reference from the + interpreter runtime. Type annotations for local variables are not + evaluated, so the second annotation does not need to be enclosed in quotes. + + .. note:: + + If ``from __future__ import annotations`` is used in Python 3.7 or later, + annotations are not evaluated at function definition time. + Instead, the are stored as strings in ``__annotations__``, + This makes it unnecessary to use quotes around the annotation. + (see :pep:`563`). + + .. versionadded:: 3.5.2 - .. versionadded:: 3.9 diff --git a/Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst b/Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst new file mode 100644 index 00000000000000..b0ca4327ad61a4 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-07-21-15-23-30.bpo-40979.pLA8rO.rst @@ -0,0 +1 @@ +Refactored typing.rst, arranging more than 70 classes, functions, and decorators into new sub-sections. \ No newline at end of file From a6cced6a1ab4f8f69618066b989db01a34570128 Mon Sep 17 00:00:00 2001 From: Nathan M Date: Sun, 2 Aug 2020 22:13:03 -0400 Subject: [PATCH 109/197] bpo-41424: Remove extra words in Tkinter-Packer documentation (GH-21707) --- Doc/library/tkinter.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 2dc44ad36a7f73..3d90b4be17c979 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -464,12 +464,11 @@ The Packer .. index:: single: packing (widgets) The packer is one of Tk's geometry-management mechanisms. Geometry managers -are used to specify the relative positioning of the positioning of widgets -within their container - their mutual *master*. In contrast to the more -cumbersome *placer* (which is used less commonly, and we do not cover here), the -packer takes qualitative relationship specification - *above*, *to the left of*, -*filling*, etc - and works everything out to determine the exact placement -coordinates for you. +are used to specify the relative positioning of widgets within their container - +their mutual *master*. In contrast to the more cumbersome *placer* (which is +used less commonly, and we do not cover here), the packer takes qualitative +relationship specification - *above*, *to the left of*, *filling*, etc - and +works everything out to determine the exact placement coordinates for you. The size of any *master* widget is determined by the size of the "slave widgets" inside. The packer is used to control where slave widgets appear inside the From 0b2ff3be245847288cc87d6c8907d7b9826b5ffc Mon Sep 17 00:00:00 2001 From: Ankit Chandawala Date: Mon, 3 Aug 2020 05:03:48 +0100 Subject: [PATCH 110/197] bpo-41425: Make tkinter doc example runnable (GH-21706) Co-authored-by: Ankit Chandawala Co-authored-by: Terry Jan Reedy --- Doc/library/tkinter.rst | 30 +++++++++++-------- .../2020-08-03-01-59-48.bpo-41425.KJo6zF.rst | 1 + 2 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst index 3d90b4be17c979..9f954255c8b300 100644 --- a/Doc/library/tkinter.rst +++ b/Doc/library/tkinter.rst @@ -541,31 +541,35 @@ the variable, with no further intervention on your part. For example:: - class App(Frame): - def __init__(self, master=None): + import tkinter as tk + + class App(tk.Frame): + def __init__(self, master): super().__init__(master) self.pack() - self.entrythingy = Entry() + self.entrythingy = tk.Entry() self.entrythingy.pack() - # here is the application variable - self.contents = StringVar() - # set it to some value + # Create the application variable. + self.contents = tk.StringVar() + # Set it to some value. self.contents.set("this is a variable") - # tell the entry widget to watch this variable + # Tell the entry widget to watch this variable. self.entrythingy["textvariable"] = self.contents - # and here we get a callback when the user hits return. - # we will have the program print out the value of the - # application variable when the user hits return + # Define a callback for when the user hits return. + # It prints the current value of the variable. self.entrythingy.bind('', - self.print_contents) + self.print_contents) def print_contents(self, event): - print("hi. contents of entry is now ---->", + print("Hi. The current entry content is:", self.contents.get()) + root = tk.Tk() + myapp = App(root) + myapp.mainloop() The Window Manager ^^^^^^^^^^^^^^^^^^ @@ -860,4 +864,4 @@ use raw reads or ``os.read(file.fileno(), maxbytecount)``. WRITABLE EXCEPTION - Constants used in the *mask* arguments. \ No newline at end of file + Constants used in the *mask* arguments. diff --git a/Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst b/Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst new file mode 100644 index 00000000000000..617df72faeb37f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-03-01-59-48.bpo-41425.KJo6zF.rst @@ -0,0 +1 @@ +Make tkinter doc example runnable. From 54ea8c64d574378bf42d59a675b209279f973326 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 3 Aug 2020 09:04:13 -0700 Subject: [PATCH 111/197] A (very) slight speed improvement for iterating over bytes (#21705) My mentee @xvxvxvxvxv noticed that iterating over array.array is slightly faster than iterating over bytes. Looking at the source I observed that arrayiter_next() calls `getitem(ao, it->index++)` wheras striter_next() uses the idiom (paraphrased) item = PyLong_FromLong(seq->ob_sval[it->it_index]); if (item != NULL) ++it->it_next; return item; I'm not 100% sure but I think that the second version has fewer opportunity for the CPU to overlap the `index++` operation with the rest of the code (which in both cases involves a call). So here I am optimistically incrementing the index -- if the PyLong_FromLong() call fails, this will leave the iterator pointing at the next byte, but honestly I doubt that anyone would seriously consider resuming use of the iterator after that kind of failure (it would have to be a MemoryError). And the author of arrayiter_next() made the same consideration (or never ever gave it a thought :-). With this, a loop like for _ in b: pass is now slightly *faster* than the same thing over an equivalent array, rather than slightly *slower* (in both cases a few percent). --- Objects/bytesobject.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 3a922d32b16e4a..836a736037ba43 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3139,7 +3139,6 @@ static PyObject * striter_next(striterobject *it) { PyBytesObject *seq; - PyObject *item; assert(it != NULL); seq = it->it_seq; @@ -3148,11 +3147,8 @@ striter_next(striterobject *it) assert(PyBytes_Check(seq)); if (it->it_index < PyBytes_GET_SIZE(seq)) { - item = PyLong_FromLong( - (unsigned char)seq->ob_sval[it->it_index]); - if (item != NULL) - ++it->it_index; - return item; + return PyLong_FromLong( + (unsigned char)seq->ob_sval[it->it_index++]); } it->it_seq = NULL; From 67af1004b2616a62e8c34dee0d5d87378986065c Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 4 Aug 2020 00:41:24 +0800 Subject: [PATCH 112/197] bpo-40275: Use new test.support helper submodules in tests (GH-21449) --- Lib/test/test__opcode.py | 2 +- Lib/test/test_asyncore.py | 26 +++---- Lib/test/test_binascii.py | 15 ++-- Lib/test/test_bisect.py | 7 +- Lib/test/test_builtin.py | 6 +- Lib/test/test_concurrent_futures.py | 3 +- Lib/test/test_configparser.py | 7 +- Lib/test/test_coroutines.py | 13 ++-- Lib/test/test_curses.py | 3 +- Lib/test/test_datetime.py | 4 +- Lib/test/test_mmap.py | 5 +- Lib/test/test_signal.py | 3 +- Lib/test/test_ssl.py | 53 +++++++------- Lib/test/test_tarfile.py | 107 ++++++++++++++-------------- Lib/test/test_threading.py | 3 +- Lib/test/test_trace.py | 3 +- Lib/test/test_tracemalloc.py | 13 ++-- Lib/test/test_xml_etree_c.py | 2 +- Lib/unittest/test/test_discovery.py | 5 +- Lib/unittest/test/test_result.py | 6 +- 20 files changed, 154 insertions(+), 132 deletions(-) diff --git a/Lib/test/test__opcode.py b/Lib/test/test__opcode.py index 0fb39eed606425..3bb64a798b3e38 100644 --- a/Lib/test/test__opcode.py +++ b/Lib/test/test__opcode.py @@ -1,5 +1,5 @@ import dis -from test.support import import_module +from test.support.import_helper import import_module import unittest _opcode = import_module("_opcode") diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 2cee6fb2e996a9..06c6bc2e99dc02 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -10,8 +10,10 @@ import threading from test import support +from test.support import os_helper from test.support import socket_helper from test.support import threading_helper +from test.support import warnings_helper from io import BytesIO if support.PGO: @@ -92,7 +94,7 @@ def bind_af_aware(sock, addr): """Helper function to bind a socket according to its family.""" if HAS_UNIX_SOCKETS and sock.family == socket.AF_UNIX: # Make sure the path doesn't exist. - support.unlink(addr) + os_helper.unlink(addr) socket_helper.bind_unix_socket(sock, addr) else: sock.bind(addr) @@ -369,14 +371,14 @@ def test_send(self): class FileWrapperTest(unittest.TestCase): def setUp(self): self.d = b"It's not dead, it's sleeping!" - with open(support.TESTFN, 'wb') as file: + with open(os_helper.TESTFN, 'wb') as file: file.write(self.d) def tearDown(self): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_recv(self): - fd = os.open(support.TESTFN, os.O_RDONLY) + fd = os.open(os_helper.TESTFN, os.O_RDONLY) w = asyncore.file_wrapper(fd) os.close(fd) @@ -390,20 +392,20 @@ def test_recv(self): def test_send(self): d1 = b"Come again?" d2 = b"I want to buy some cheese." - fd = os.open(support.TESTFN, os.O_WRONLY | os.O_APPEND) + fd = os.open(os_helper.TESTFN, os.O_WRONLY | os.O_APPEND) w = asyncore.file_wrapper(fd) os.close(fd) w.write(d1) w.send(d2) w.close() - with open(support.TESTFN, 'rb') as file: + with open(os_helper.TESTFN, 'rb') as file: self.assertEqual(file.read(), self.d + d1 + d2) @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'), 'asyncore.file_dispatcher required') def test_dispatcher(self): - fd = os.open(support.TESTFN, os.O_RDONLY) + fd = os.open(os_helper.TESTFN, os.O_RDONLY) data = [] class FileDispatcher(asyncore.file_dispatcher): def handle_read(self): @@ -415,16 +417,16 @@ def handle_read(self): def test_resource_warning(self): # Issue #11453 - fd = os.open(support.TESTFN, os.O_RDONLY) + fd = os.open(os_helper.TESTFN, os.O_RDONLY) f = asyncore.file_wrapper(fd) os.close(fd) - with support.check_warnings(('', ResourceWarning)): + with warnings_helper.check_warnings(('', ResourceWarning)): f = None support.gc_collect() def test_close_twice(self): - fd = os.open(support.TESTFN, os.O_RDONLY) + fd = os.open(os_helper.TESTFN, os.O_RDONLY) f = asyncore.file_wrapper(fd) os.close(fd) @@ -804,10 +806,10 @@ class TestAPI_UseIPv6Sockets(BaseTestAPI): class TestAPI_UseUnixSockets(BaseTestAPI): if HAS_UNIX_SOCKETS: family = socket.AF_UNIX - addr = support.TESTFN + addr = os_helper.TESTFN def tearDown(self): - support.unlink(self.addr) + os_helper.unlink(self.addr) BaseTestAPI.tearDown(self) class TestAPI_UseIPv4Select(TestAPI_UseIPv4Sockets, unittest.TestCase): diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py index 45327953a7701a..4d1bf2cce1f1e3 100644 --- a/Lib/test/test_binascii.py +++ b/Lib/test/test_binascii.py @@ -4,7 +4,8 @@ import binascii import array import re -from test import support +from test.support import warnings_helper + # Note: "*_hex" functions are aliases for "(un)hexlify" b2a_functions = ['b2a_base64', 'b2a_hex', 'b2a_hqx', 'b2a_qp', 'b2a_uu', @@ -37,7 +38,7 @@ def test_functions(self): self.assertTrue(hasattr(getattr(binascii, name), '__call__')) self.assertRaises(TypeError, getattr(binascii, name)) - @support.ignore_warnings(category=DeprecationWarning) + @warnings_helper.ignore_warnings(category=DeprecationWarning) def test_returned_value(self): # Limit to the minimum of all limits (b2a_uu) MAX_ALL = 45 @@ -181,7 +182,7 @@ def test_uu(self): with self.assertRaises(TypeError): binascii.b2a_uu(b"", True) - @support.ignore_warnings(category=DeprecationWarning) + @warnings_helper.ignore_warnings(category=DeprecationWarning) def test_crc_hqx(self): crc = binascii.crc_hqx(self.type2test(b"Test the CRC-32 of"), 0) crc = binascii.crc_hqx(self.type2test(b" this string."), crc) @@ -201,7 +202,7 @@ def test_crc32(self): self.assertRaises(TypeError, binascii.crc32) - @support.ignore_warnings(category=DeprecationWarning) + @warnings_helper.ignore_warnings(category=DeprecationWarning) def test_hqx(self): # Perform binhex4 style RLE-compression # Then calculate the hexbin4 binary-to-ASCII translation @@ -212,7 +213,7 @@ def test_hqx(self): res = binascii.rledecode_hqx(b) self.assertEqual(res, self.rawdata) - @support.ignore_warnings(category=DeprecationWarning) + @warnings_helper.ignore_warnings(category=DeprecationWarning) def test_rle(self): # test repetition with a repetition longer than the limit of 255 data = (b'a' * 100 + b'b' + b'c' * 300) @@ -359,7 +360,7 @@ def test_qp(self): self.assertEqual(b2a_qp(type2test(b'a.\n')), b'a.\n') self.assertEqual(b2a_qp(type2test(b'.a')[:-1]), b'=2E') - @support.ignore_warnings(category=DeprecationWarning) + @warnings_helper.ignore_warnings(category=DeprecationWarning) def test_empty_string(self): # A test for SF bug #1022953. Make sure SystemError is not raised. empty = self.type2test(b'') @@ -384,7 +385,7 @@ def test_unicode_b2a(self): # crc_hqx needs 2 arguments self.assertRaises(TypeError, binascii.crc_hqx, "test", 0) - @support.ignore_warnings(category=DeprecationWarning) + @warnings_helper.ignore_warnings(category=DeprecationWarning) def test_unicode_a2b(self): # Unicode strings are accepted by a2b_* functions. MAX_ALL = 45 diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py index 580a963f627a34..fc7990d765e53b 100644 --- a/Lib/test/test_bisect.py +++ b/Lib/test/test_bisect.py @@ -1,10 +1,11 @@ import sys import unittest -from test import support +from test.support import import_helper from collections import UserList -py_bisect = support.import_fresh_module('bisect', blocked=['_bisect']) -c_bisect = support.import_fresh_module('bisect', fresh=['_bisect']) + +py_bisect = import_helper.import_fresh_module('bisect', blocked=['_bisect']) +c_bisect = import_helper.import_fresh_module('bisect', fresh=['_bisect']) class Range(object): """A trivial range()-like object that has an insert() method.""" diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 3bc1a3e246fdf8..edb4ec092e3586 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -26,10 +26,10 @@ from types import AsyncGeneratorType, FunctionType from operator import neg from test import support -from test.support import ( - EnvironmentVarGuard, TESTFN, check_warnings, swap_attr, unlink, - maybe_get_event_loop_policy) +from test.support import (swap_attr, maybe_get_event_loop_policy) +from test.support.os_helper import (EnvironmentVarGuard, TESTFN, unlink) from test.support.script_helper import assert_python_ok +from test.support.warnings_helper import check_warnings from unittest.mock import MagicMock, patch try: import pty, signal diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 7da967ea6ced57..a182b14fb9bc05 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -1,8 +1,9 @@ from test import support +from test.support import import_helper from test.support import threading_helper # Skip tests if _multiprocessing wasn't built. -support.import_module('_multiprocessing') +import_helper.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. support.skip_if_broken_multiprocessing_synchronize() diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index f16da116a745f3..230ffc1ccf81a7 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -8,6 +8,7 @@ import warnings from test import support +from test.support import os_helper class SortedDict(collections.UserDict): @@ -1063,17 +1064,17 @@ def setUp(self): cf.add_section(s) for j in range(10): cf.set(s, 'lovely_spam{}'.format(j), self.wonderful_spam) - with open(support.TESTFN, 'w') as f: + with open(os_helper.TESTFN, 'w') as f: cf.write(f) def tearDown(self): - os.unlink(support.TESTFN) + os.unlink(os_helper.TESTFN) def test_dominating_multiline_values(self): # We're reading from file because this is where the code changed # during performance updates in Python 3.2 cf_from_file = self.newconfig() - with open(support.TESTFN) as f: + with open(os_helper.TESTFN) as f: cf_from_file.read_file(f) self.assertEqual(cf_from_file.get('section8', 'lovely_spam4'), self.wonderful_spam.replace('\t\n', '\n')) diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 8d1e0692a24221..145adb67781701 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -7,6 +7,8 @@ import unittest import warnings from test import support +from test.support import import_helper +from test.support import warnings_helper from test.support.script_helper import assert_python_ok @@ -2117,7 +2119,7 @@ class CoroAsyncIOCompatTest(unittest.TestCase): def test_asyncio_1(self): # asyncio cannot be imported when Python is compiled without thread # support - asyncio = support.import_module('asyncio') + asyncio = import_helper.import_module('asyncio') class MyException(Exception): pass @@ -2258,8 +2260,9 @@ async def corofn(): try: warnings._warn_unawaited_coroutine = lambda coro: 1/0 with support.catch_unraisable_exception() as cm, \ - support.check_warnings((r'coroutine .* was never awaited', - RuntimeWarning)): + warnings_helper.check_warnings( + (r'coroutine .* was never awaited', + RuntimeWarning)): # only store repr() to avoid keeping the coroutine alive coro = corofn() coro_repr = repr(coro) @@ -2272,8 +2275,8 @@ async def corofn(): self.assertEqual(cm.unraisable.exc_type, ZeroDivisionError) del warnings._warn_unawaited_coroutine - with support.check_warnings((r'coroutine .* was never awaited', - RuntimeWarning)): + with warnings_helper.check_warnings( + (r'coroutine .* was never awaited', RuntimeWarning)): corofn() support.gc_collect() diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 5e619d13836d26..2c6d14c3f79dda 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -15,7 +15,8 @@ import tempfile import unittest -from test.support import requires, import_module, verbose, SaveSignals +from test.support import requires, verbose, SaveSignals +from test.support.import_helper import import_module # Optionally test curses module. This currently requires that the # 'curses' resource be given on the regrtest command line using the -u diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index d659f369d54e46..bdb9f02e5756a2 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -1,7 +1,9 @@ import unittest import sys -from test.support import import_fresh_module, run_unittest +from test.support import run_unittest +from test.support.import_helper import import_fresh_module + TESTS = 'test.datetimetester' diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index 5400f25f50800b..8f34c182f82eaf 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -1,5 +1,6 @@ -from test.support import (TESTFN, import_module, unlink, - requires, _2G, _4G, gc_collect, cpython_only) +from test.support import (requires, _2G, _4G, gc_collect, cpython_only) +from test.support.import_helper import import_module +from test.support.os_helper import TESTFN, unlink import unittest import os import re diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 45553a6a42de79..c6567906321fe1 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -9,6 +9,7 @@ import time import unittest from test import support +from test.support import os_helper from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi @@ -154,7 +155,7 @@ def test_invalid_call(self): signal.set_wakeup_fd(signal.SIGINT, False) def test_invalid_fd(self): - fd = support.make_bad_fd() + fd = os_helper.make_bad_fd() self.assertRaises((ValueError, OSError), signal.set_wakeup_fd, fd) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index de778d34658b7a..26eec969a82e0d 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4,8 +4,11 @@ import unittest import unittest.mock from test import support +from test.support import import_helper +from test.support import os_helper from test.support import socket_helper from test.support import threading_helper +from test.support import warnings_helper import socket import select import time @@ -27,7 +30,7 @@ except ImportError: ctypes = None -ssl = support.import_module("ssl") +ssl = import_helper.import_module("ssl") from ssl import TLSVersion, _TLSContentType, _TLSMessageType @@ -571,7 +574,7 @@ def test_refcycle(self): s = socket.socket(socket.AF_INET) ss = test_wrap_socket(s) wr = weakref.ref(ss) - with support.check_warnings(("", ResourceWarning)): + with warnings_helper.check_warnings(("", ResourceWarning)): del ss self.assertEqual(wr(), None) @@ -893,7 +896,7 @@ def test_get_default_verify_paths(self): self.assertEqual(len(paths), 6) self.assertIsInstance(paths, ssl.DefaultVerifyPaths) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["SSL_CERT_DIR"] = CAPATH env["SSL_CERT_FILE"] = CERTFILE paths = ssl.get_default_verify_paths() @@ -1605,7 +1608,7 @@ def test_load_default_certs(self): @unittest.skipIf(IS_LIBRESSL, "LibreSSL doesn't support env vars") def test_load_default_certs_env(self): ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["SSL_CERT_DIR"] = CAPATH env["SSL_CERT_FILE"] = CERTFILE ctx.load_default_certs() @@ -1619,7 +1622,7 @@ def test_load_default_certs_env_windows(self): stats = ctx.cert_store_stats() ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["SSL_CERT_DIR"] = CAPATH env["SSL_CERT_FILE"] = CERTFILE ctx.load_default_certs() @@ -4266,9 +4269,9 @@ def test_read_write_after_close_raises_valuerror(self): def test_sendfile(self): TEST_DATA = b"x" * 512 - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(TEST_DATA) - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) context = ssl.SSLContext(ssl.PROTOCOL_TLS) context.verify_mode = ssl.CERT_REQUIRED context.load_verify_locations(SIGNING_CA) @@ -4277,7 +4280,7 @@ def test_sendfile(self): with server: with context.wrap_socket(socket.socket()) as s: s.connect((HOST, server.port)) - with open(support.TESTFN, 'rb') as file: + with open(os_helper.TESTFN, 'rb') as file: s.sendfile(file) self.assertEqual(s.recv(1024), TEST_DATA) @@ -4603,21 +4606,21 @@ def test_bpo37428_pha_cert_none(self): class TestSSLDebug(unittest.TestCase): - def keylog_lines(self, fname=support.TESTFN): + def keylog_lines(self, fname=os_helper.TESTFN): with open(fname) as f: return len(list(f)) @requires_keylog @unittest.skipIf(Py_DEBUG_WIN32, "Avoid mixing debug/release CRT on Windows") def test_keylog_defaults(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) self.assertEqual(ctx.keylog_filename, None) - self.assertFalse(os.path.isfile(support.TESTFN)) - ctx.keylog_filename = support.TESTFN - self.assertEqual(ctx.keylog_filename, support.TESTFN) - self.assertTrue(os.path.isfile(support.TESTFN)) + self.assertFalse(os.path.isfile(os_helper.TESTFN)) + ctx.keylog_filename = os_helper.TESTFN + self.assertEqual(ctx.keylog_filename, os_helper.TESTFN) + self.assertTrue(os.path.isfile(os_helper.TESTFN)) self.assertEqual(self.keylog_lines(), 1) ctx.keylog_filename = None @@ -4626,7 +4629,7 @@ def test_keylog_defaults(self): with self.assertRaises((IsADirectoryError, PermissionError)): # Windows raises PermissionError ctx.keylog_filename = os.path.dirname( - os.path.abspath(support.TESTFN)) + os.path.abspath(os_helper.TESTFN)) with self.assertRaises(TypeError): ctx.keylog_filename = 1 @@ -4634,10 +4637,10 @@ def test_keylog_defaults(self): @requires_keylog @unittest.skipIf(Py_DEBUG_WIN32, "Avoid mixing debug/release CRT on Windows") def test_keylog_filename(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) client_context, server_context, hostname = testing_context() - client_context.keylog_filename = support.TESTFN + client_context.keylog_filename = os_helper.TESTFN server = ThreadedEchoServer(context=server_context, chatty=False) with server: with client_context.wrap_socket(socket.socket(), @@ -4647,7 +4650,7 @@ def test_keylog_filename(self): self.assertEqual(self.keylog_lines(), 6) client_context.keylog_filename = None - server_context.keylog_filename = support.TESTFN + server_context.keylog_filename = os_helper.TESTFN server = ThreadedEchoServer(context=server_context, chatty=False) with server: with client_context.wrap_socket(socket.socket(), @@ -4655,8 +4658,8 @@ def test_keylog_filename(self): s.connect((HOST, server.port)) self.assertGreaterEqual(self.keylog_lines(), 11) - client_context.keylog_filename = support.TESTFN - server_context.keylog_filename = support.TESTFN + client_context.keylog_filename = os_helper.TESTFN + server_context.keylog_filename = os_helper.TESTFN server = ThreadedEchoServer(context=server_context, chatty=False) with server: with client_context.wrap_socket(socket.socket(), @@ -4672,19 +4675,19 @@ def test_keylog_filename(self): "test is not compatible with ignore_environment") @unittest.skipIf(Py_DEBUG_WIN32, "Avoid mixing debug/release CRT on Windows") def test_keylog_env(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) with unittest.mock.patch.dict(os.environ): - os.environ['SSLKEYLOGFILE'] = support.TESTFN - self.assertEqual(os.environ['SSLKEYLOGFILE'], support.TESTFN) + os.environ['SSLKEYLOGFILE'] = os_helper.TESTFN + self.assertEqual(os.environ['SSLKEYLOGFILE'], os_helper.TESTFN) ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) self.assertEqual(ctx.keylog_filename, None) ctx = ssl.create_default_context() - self.assertEqual(ctx.keylog_filename, support.TESTFN) + self.assertEqual(ctx.keylog_filename, os_helper.TESTFN) ctx = ssl._create_stdlib_context() - self.assertEqual(ctx.keylog_filename, support.TESTFN) + self.assertEqual(ctx.keylog_filename, os_helper.TESTFN) def test_msg_callback(self): client_context, server_context, hostname = testing_context() diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 3ddeb97f5268fe..4bf7248767c4b9 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -11,6 +11,7 @@ import tarfile from test import support +from test.support import os_helper from test.support import script_helper # Check for our compression modules. @@ -30,7 +31,7 @@ def sha256sum(data): return sha256(data).hexdigest() -TEMPDIR = os.path.abspath(support.TESTFN) + "-tardir" +TEMPDIR = os.path.abspath(os_helper.TESTFN) + "-tardir" tarextdir = TEMPDIR + '-extract-test' tarname = support.findfile("testtar.tar") gzipname = os.path.join(TEMPDIR, "testtar.tar.gz") @@ -575,21 +576,21 @@ def test_find_members(self): @unittest.skipUnless(hasattr(os, "link"), "Missing hardlink implementation") - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_extract_hardlink(self): # Test hardlink extraction (e.g. bug #857297). with tarfile.open(tarname, errorlevel=1, encoding="iso8859-1") as tar: tar.extract("ustar/regtype", TEMPDIR) - self.addCleanup(support.unlink, os.path.join(TEMPDIR, "ustar/regtype")) + self.addCleanup(os_helper.unlink, os.path.join(TEMPDIR, "ustar/regtype")) tar.extract("ustar/lnktype", TEMPDIR) - self.addCleanup(support.unlink, os.path.join(TEMPDIR, "ustar/lnktype")) + self.addCleanup(os_helper.unlink, os.path.join(TEMPDIR, "ustar/lnktype")) with open(os.path.join(TEMPDIR, "ustar/lnktype"), "rb") as f: data = f.read() self.assertEqual(sha256sum(data), sha256_regtype) tar.extract("ustar/symtype", TEMPDIR) - self.addCleanup(support.unlink, os.path.join(TEMPDIR, "ustar/symtype")) + self.addCleanup(os_helper.unlink, os.path.join(TEMPDIR, "ustar/symtype")) with open(os.path.join(TEMPDIR, "ustar/symtype"), "rb") as f: data = f.read() self.assertEqual(sha256sum(data), sha256_regtype) @@ -622,7 +623,7 @@ def format_mtime(mtime): self.assertEqual(tarinfo.mtime, file_mtime, errmsg) finally: tar.close() - support.rmtree(DIR) + os_helper.rmtree(DIR) def test_extract_directory(self): dirtype = "ustar/dirtype" @@ -637,11 +638,11 @@ def test_extract_directory(self): if sys.platform != "win32": self.assertEqual(os.stat(extracted).st_mode & 0o777, 0o755) finally: - support.rmtree(DIR) + os_helper.rmtree(DIR) def test_extractall_pathlike_name(self): DIR = pathlib.Path(TEMPDIR) / "extractall" - with support.temp_dir(DIR), \ + with os_helper.temp_dir(DIR), \ tarfile.open(tarname, encoding="iso8859-1") as tar: directories = [t for t in tar if t.isdir()] tar.extractall(DIR, directories) @@ -652,7 +653,7 @@ def test_extractall_pathlike_name(self): def test_extract_pathlike_name(self): dirtype = "ustar/dirtype" DIR = pathlib.Path(TEMPDIR) / "extractall" - with support.temp_dir(DIR), \ + with os_helper.temp_dir(DIR), \ tarfile.open(tarname, encoding="iso8859-1") as tar: tarinfo = tar.getmember(dirtype) tar.extract(tarinfo, path=DIR) @@ -676,7 +677,7 @@ def test_init_close_fobj(self): else: self.fail("ReadError not raised") finally: - support.unlink(empty) + os_helper.unlink(empty) def test_parallel_iteration(self): # Issue #16601: Restarting iteration over tarfile continued @@ -1026,7 +1027,7 @@ def _fs_supports_holes(): fobj.write(b'x' * 4096) fobj.truncate() s = os.stat(name) - support.unlink(name) + os_helper.unlink(name) return (s.st_blocks * 512 < s.st_size) else: return False @@ -1171,7 +1172,7 @@ def test_directory_size(self): finally: tar.close() finally: - support.rmdir(path) + os_helper.rmdir(path) # mock the following: # os.listdir: so we know that files are in the wrong order @@ -1193,9 +1194,9 @@ def test_ordered_recursion(self): finally: tar.close() finally: - support.unlink(os.path.join(path, "1")) - support.unlink(os.path.join(path, "2")) - support.rmdir(path) + os_helper.unlink(os.path.join(path, "1")) + os_helper.unlink(os.path.join(path, "2")) + os_helper.rmdir(path) def test_gettarinfo_pathlike_name(self): with tarfile.open(tmpname, self.mode) as tar: @@ -1229,10 +1230,10 @@ def test_link_size(self): finally: tar.close() finally: - support.unlink(target) - support.unlink(link) + os_helper.unlink(target) + os_helper.unlink(link) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_symlink_size(self): path = os.path.join(TEMPDIR, "symlink") os.symlink("link_target", path) @@ -1244,7 +1245,7 @@ def test_symlink_size(self): finally: tar.close() finally: - support.unlink(path) + os_helper.unlink(path) def test_add_self(self): # Test for #1257255. @@ -1257,7 +1258,7 @@ def test_add_self(self): self.assertEqual(tar.getnames(), [], "added the archive to itself") - with support.change_cwd(TEMPDIR): + with os_helper.change_cwd(TEMPDIR): tar.add(dstname) self.assertEqual(tar.getnames(), [], "added the archive to itself") @@ -1270,7 +1271,7 @@ def test_filter(self): try: for name in ("foo", "bar", "baz"): name = os.path.join(tempdir, name) - support.create_empty_file(name) + os_helper.create_empty_file(name) def filter(tarinfo): if os.path.basename(tarinfo.name) == "bar": @@ -1298,7 +1299,7 @@ def filter(tarinfo): finally: tar.close() finally: - support.rmtree(tempdir) + os_helper.rmtree(tempdir) # Guarantee that stored pathnames are not modified. Don't # remove ./ or ../ or double slashes. Still make absolute @@ -1309,7 +1310,7 @@ def _test_pathname(self, path, cmp_path=None, dir=False): # and compare the stored name with the original. foo = os.path.join(TEMPDIR, "foo") if not dir: - support.create_empty_file(foo) + os_helper.create_empty_file(foo) else: os.mkdir(foo) @@ -1326,14 +1327,14 @@ def _test_pathname(self, path, cmp_path=None, dir=False): tar.close() if not dir: - support.unlink(foo) + os_helper.unlink(foo) else: - support.rmdir(foo) + os_helper.rmdir(foo) self.assertEqual(t.name, cmp_path or path.replace(os.sep, "/")) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_extractall_symlinks(self): # Test if extractall works properly when tarfile contains symlinks tempdir = os.path.join(TEMPDIR, "testsymlinks") @@ -1356,8 +1357,8 @@ def test_extractall_symlinks(self): except OSError: self.fail("extractall failed with symlinked files") finally: - support.unlink(temparchive) - support.rmtree(tempdir) + os_helper.unlink(temparchive) + os_helper.rmtree(tempdir) def test_pathnames(self): self._test_pathname("foo") @@ -1385,7 +1386,7 @@ def test_abs_pathnames(self): def test_cwd(self): # Test adding the current working directory. - with support.change_cwd(TEMPDIR): + with os_helper.change_cwd(TEMPDIR): tar = tarfile.open(tmpname, self.mode) try: tar.add(".") @@ -1453,7 +1454,7 @@ def test_file_mode(self): # Test for issue #8464: Create files with correct # permissions. if os.path.exists(tmpname): - support.unlink(tmpname) + os_helper.unlink(tmpname) original_umask = os.umask(0o022) try: @@ -1599,7 +1600,7 @@ def test_headers_written_only_for_device_files(self): self.assertEqual(buf_blk[device_headers], b"0000000\0" * 2) self.assertEqual(buf_reg[device_headers], b"\0" * 16) finally: - support.rmtree(tempdir) + os_helper.rmtree(tempdir) class CreateTest(WriteTestBase, unittest.TestCase): @@ -1609,7 +1610,7 @@ class CreateTest(WriteTestBase, unittest.TestCase): file_path = os.path.join(TEMPDIR, "spameggs42") def setUp(self): - support.unlink(tmpname) + os_helper.unlink(tmpname) @classmethod def setUpClass(cls): @@ -1618,7 +1619,7 @@ def setUpClass(cls): @classmethod def tearDownClass(cls): - support.unlink(cls.file_path) + os_helper.unlink(cls.file_path) def test_create(self): with tarfile.open(tmpname, self.mode) as tobj: @@ -1733,8 +1734,8 @@ def setUp(self): def tearDown(self): self.tar.close() - support.unlink(self.foo) - support.unlink(self.bar) + os_helper.unlink(self.foo) + os_helper.unlink(self.bar) def test_add_twice(self): # The same name will be added as a REGTYPE every @@ -2043,7 +2044,7 @@ class AppendTestBase: def setUp(self): self.tarname = tmpname if os.path.exists(self.tarname): - support.unlink(self.tarname) + os_helper.unlink(self.tarname) def _create_testtar(self, mode="w:"): with tarfile.open(tarname, encoding="iso8859-1") as src: @@ -2288,7 +2289,7 @@ 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) + self.addCleanup(os_helper.unlink, tar_name) with tarfile.open(tar_name, 'w') as tf: for tardata in files: tf.add(tardata, arcname=os.path.basename(tardata)) @@ -2334,7 +2335,7 @@ def test_test_command_invalid_file(self): self.assertEqual(out, b'') self.assertEqual(rc, 1) finally: - support.unlink(tmpname) + os_helper.unlink(tmpname) def test_list_command(self): for tar_name in testtarnames: @@ -2376,7 +2377,7 @@ def test_create_command(self): with tarfile.open(tmpname) as tar: tar.getmembers() finally: - support.unlink(tmpname) + os_helper.unlink(tmpname) def test_create_command_verbose(self): files = [support.findfile('tokenize_tests.txt'), @@ -2390,7 +2391,7 @@ def test_create_command_verbose(self): with tarfile.open(tmpname) as tar: tar.getmembers() finally: - support.unlink(tmpname) + os_helper.unlink(tmpname) def test_create_command_dotless_filename(self): files = [support.findfile('tokenize_tests.txt')] @@ -2400,7 +2401,7 @@ def test_create_command_dotless_filename(self): with tarfile.open(dotlessname) as tar: tar.getmembers() finally: - support.unlink(dotlessname) + os_helper.unlink(dotlessname) def test_create_command_dot_started_filename(self): tar_name = os.path.join(TEMPDIR, ".testtar") @@ -2411,7 +2412,7 @@ def test_create_command_dot_started_filename(self): with tarfile.open(tar_name) as tar: tar.getmembers() finally: - support.unlink(tar_name) + os_helper.unlink(tar_name) def test_create_command_compressed(self): files = [support.findfile('tokenize_tests.txt'), @@ -2426,41 +2427,41 @@ def test_create_command_compressed(self): with filetype.taropen(tar_name) as tar: tar.getmembers() finally: - support.unlink(tar_name) + os_helper.unlink(tar_name) def test_extract_command(self): self.make_simple_tarfile(tmpname) for opt in '-e', '--extract': try: - with support.temp_cwd(tarextdir): + with os_helper.temp_cwd(tarextdir): out = self.tarfilecmd(opt, tmpname) self.assertEqual(out, b'') finally: - support.rmtree(tarextdir) + os_helper.rmtree(tarextdir) def test_extract_command_verbose(self): self.make_simple_tarfile(tmpname) for opt in '-v', '--verbose': try: - with support.temp_cwd(tarextdir): + with os_helper.temp_cwd(tarextdir): out = self.tarfilecmd(opt, '-e', tmpname, PYTHONIOENCODING='utf-8') self.assertIn(b' file is extracted.', out) finally: - support.rmtree(tarextdir) + os_helper.rmtree(tarextdir) def test_extract_command_different_directory(self): self.make_simple_tarfile(tmpname) try: - with support.temp_cwd(tarextdir): + with os_helper.temp_cwd(tarextdir): out = self.tarfilecmd('-e', tmpname, 'spamdir') self.assertEqual(out, b'') finally: - support.rmtree(tarextdir) + os_helper.rmtree(tarextdir) def test_extract_command_invalid_file(self): zipname = support.findfile('zipdir.zip') - with support.temp_cwd(tarextdir): + with os_helper.temp_cwd(tarextdir): rc, out, err = self.tarfilecmd_failure('-e', zipname) self.assertIn(b' is not a tar archive.', err) self.assertEqual(out, b'') @@ -2723,7 +2724,7 @@ def test_keyword_only(self, mock_geteuid): def setUpModule(): - support.unlink(TEMPDIR) + os_helper.unlink(TEMPDIR) os.makedirs(TEMPDIR) global testtarnames @@ -2734,14 +2735,14 @@ def setUpModule(): # Create compressed tarfiles. for c in GzipTest, Bz2Test, LzmaTest: if c.open: - support.unlink(c.tarname) + os_helper.unlink(c.tarname) testtarnames.append(c.tarname) with c.open(c.tarname, "wb") as tar: tar.write(data) def tearDownModule(): if os.path.exists(TEMPDIR): - support.rmtree(TEMPDIR) + os_helper.rmtree(TEMPDIR) if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index ad82e304e32f3d..47e131ae27a148 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -4,7 +4,8 @@ import test.support from test.support import threading_helper -from test.support import verbose, import_module, cpython_only +from test.support import verbose, cpython_only +from test.support.import_helper import import_module from test.support.script_helper import assert_python_ok, assert_python_failure import random diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py index c03982ba72b3f1..75478557e78719 100644 --- a/Lib/test/test_trace.py +++ b/Lib/test/test_trace.py @@ -1,6 +1,7 @@ import os import sys -from test.support import TESTFN, TESTFN_UNICODE, FS_NONASCII, rmtree, unlink, captured_stdout +from test.support import captured_stdout +from test.support.os_helper import (TESTFN, rmtree, unlink) from test.support.script_helper import assert_python_ok, assert_python_failure import textwrap import unittest diff --git a/Lib/test/test_tracemalloc.py b/Lib/test/test_tracemalloc.py index c5ae4e6d653bf7..a0037f81b88f27 100644 --- a/Lib/test/test_tracemalloc.py +++ b/Lib/test/test_tracemalloc.py @@ -7,6 +7,7 @@ from test.support.script_helper import (assert_python_ok, assert_python_failure, interpreter_requires_environment) from test import support +from test.support import os_helper try: import _testcapi @@ -287,11 +288,11 @@ def test_snapshot(self): self.assertGreater(snapshot.traces[1].traceback.total_nframe, 10) # write on disk - snapshot.dump(support.TESTFN) - self.addCleanup(support.unlink, support.TESTFN) + snapshot.dump(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) # load from disk - snapshot2 = tracemalloc.Snapshot.load(support.TESTFN) + snapshot2 = tracemalloc.Snapshot.load(os_helper.TESTFN) self.assertEqual(snapshot2.traces, snapshot.traces) # tracemalloc must be tracing memory allocations to take a snapshot @@ -306,11 +307,11 @@ 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) + snapshot.dump(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) # load() should recreate the attribute - snapshot2 = tracemalloc.Snapshot.load(support.TESTFN) + snapshot2 = tracemalloc.Snapshot.load(os_helper.TESTFN) self.assertEqual(snapshot2.test_attr, "new") def fork_child(self): diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index e26e1714a540bd..e68613bb910dd4 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -2,7 +2,7 @@ import io import struct from test import support -from test.support import import_fresh_module +from test.support.import_helper import import_fresh_module import types import unittest diff --git a/Lib/unittest/test/test_discovery.py b/Lib/unittest/test/test_discovery.py index 16e081e1fb76ec..9d502c51fb36ab 100644 --- a/Lib/unittest/test/test_discovery.py +++ b/Lib/unittest/test/test_discovery.py @@ -5,6 +5,7 @@ import types import pickle from test import support +from test.support import import_helper import test.test_importlib.util import unittest @@ -848,7 +849,7 @@ def _find_tests(start_dir, pattern, namespace=None): with unittest.mock.patch('builtins.__import__', _import): # Since loader.discover() can modify sys.path, restore it when done. - with support.DirsOnSysPath(): + with import_helper.DirsOnSysPath(): # Make sure to remove 'package' from sys.modules when done. with test.test_importlib.util.uncache('package'): suite = loader.discover('package') @@ -865,7 +866,7 @@ def _import(packagename, *args, **kwargs): with unittest.mock.patch('builtins.__import__', _import): # Since loader.discover() can modify sys.path, restore it when done. - with support.DirsOnSysPath(): + with import_helper.DirsOnSysPath(): # Make sure to remove 'package' from sys.modules when done. with test.test_importlib.util.uncache('package'): with self.assertRaises(TypeError) as cm: diff --git a/Lib/unittest/test/test_result.py b/Lib/unittest/test/test_result.py index 0ffb87b40256cf..a4af67bd8d56de 100644 --- a/Lib/unittest/test/test_result.py +++ b/Lib/unittest/test/test_result.py @@ -2,7 +2,7 @@ import sys import textwrap -from test import support +from test.support import warnings_helper import traceback import unittest @@ -458,8 +458,8 @@ def __init__(self, stream=None, descriptions=None, verbosity=None): class Test_OldTestResult(unittest.TestCase): def assertOldResultWarning(self, test, failures): - with support.check_warnings(("TestResult has no add.+ method,", - RuntimeWarning)): + with warnings_helper.check_warnings( + ("TestResult has no add.+ method,", RuntimeWarning)): result = OldResult() test.run(result) self.assertEqual(len(result.failures), failures) From d68c00431268c020053f0e0a8738c47d0798bb9c Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 4 Aug 2020 00:47:42 +0800 Subject: [PATCH 113/197] bpo-40275: Use new test.support helper submodules in tests (GH-21451) --- Lib/test/test_bdb.py | 7 +- Lib/test/test_code_module.py | 5 +- Lib/test/test_embed.py | 10 +- Lib/test/test_gzip.py | 24 +- Lib/test/test_largefile.py | 3 +- Lib/test/test_lltrace.py | 8 +- Lib/test/test_ordered_dict.py | 7 +- Lib/test/test_pathlib.py | 72 ++--- Lib/test/test_pipes.py | 4 +- Lib/test/test_posix.py | 358 +++++++++++++----------- Lib/test/test_pydoc.py | 15 +- Lib/test/test_resource.py | 8 +- Lib/test/test_runpy.py | 6 +- Lib/test/test_sax.py | 30 +- Lib/test/test_sys.py | 7 +- Lib/test/test_syslog.py | 5 +- Lib/test/test_ttk_textonly.py | 4 +- Lib/test/test_unicode_file_functions.py | 20 +- Lib/test/test_urllib2.py | 6 +- Lib/test/test_venv.py | 3 +- 20 files changed, 324 insertions(+), 278 deletions(-) diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index ae168805678829..9bce780e0d041c 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -58,6 +58,9 @@ from contextlib import contextmanager from itertools import islice, repeat import test.support +from test.support import import_helper +from test.support import os_helper + class BdbException(Exception): pass class BdbError(BdbException): """Error raised by the Bdb instance.""" @@ -531,7 +534,7 @@ def gen(a, b): @contextmanager def create_modules(modules): - with test.support.temp_cwd(): + with os_helper.temp_cwd(): sys.path.append(os.getcwd()) try: for m in modules: @@ -543,7 +546,7 @@ def create_modules(modules): yield finally: for m in modules: - test.support.forget(m) + import_helper.forget(m) sys.path.pop() def break_in_func(funcname, fname=__file__, temporary=False, cond=None): diff --git a/Lib/test/test_code_module.py b/Lib/test/test_code_module.py index 24db0ace80122e..226bc3a853b7b9 100644 --- a/Lib/test/test_code_module.py +++ b/Lib/test/test_code_module.py @@ -4,9 +4,10 @@ from textwrap import dedent from contextlib import ExitStack from unittest import mock -from test import support +from test.support import import_helper -code = support.import_module('code') + +code = import_helper.import_module('code') class TestInteractiveConsole(unittest.TestCase): diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 2b740521e723ca..31dc39fd9e8efe 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -1,5 +1,7 @@ # Run the tests in Programs/_testembed.c (tests for the CPython embedding APIs) from test import support +from test.support import import_helper +from test.support import os_helper import unittest from collections import namedtuple @@ -1339,8 +1341,8 @@ def test_global_pathconfig(self): # # The global path configuration (_Py_path_config) must be a copy # of the path configuration of PyInterpreter.config (PyConfig). - ctypes = support.import_module('ctypes') - _testinternalcapi = support.import_module('_testinternalcapi') + ctypes = import_helper.import_module('ctypes') + _testinternalcapi = import_helper.import_module('_testinternalcapi') def get_func(name): func = getattr(ctypes.pythonapi, name) @@ -1418,7 +1420,7 @@ def test_audit_run_file(self): returncode=1) def test_audit_run_interactivehook(self): - startup = os.path.join(self.oldcwd, support.TESTFN) + ".py" + startup = os.path.join(self.oldcwd, os_helper.TESTFN) + ".py" with open(startup, "w", encoding="utf-8") as f: print("import sys", file=f) print("sys.__interactivehook__ = lambda: None", file=f) @@ -1431,7 +1433,7 @@ def test_audit_run_interactivehook(self): os.unlink(startup) def test_audit_run_startup(self): - startup = os.path.join(self.oldcwd, support.TESTFN) + ".py" + startup = os.path.join(self.oldcwd, os_helper.TESTFN) + ".py" with open(startup, "w", encoding="utf-8") as f: print("pass", file=f) try: diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index 0f235d1805e0d3..c3fa9b097f8aaa 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -11,10 +11,12 @@ import unittest from subprocess import PIPE, Popen from test import support +from test.support import import_helper +from test.support import os_helper from test.support import _4G, bigmemtest from test.support.script_helper import assert_python_ok, assert_python_failure -gzip = support.import_module('gzip') +gzip = import_helper.import_module('gzip') data1 = b""" int length=DEFAULTALLOC, err = Z_OK; PyObject *RetVal; @@ -29,7 +31,7 @@ """ -TEMPDIR = os.path.abspath(support.TESTFN) + '-gzdir' +TEMPDIR = os.path.abspath(os_helper.TESTFN) + '-gzdir' class UnseekableIO(io.BytesIO): @@ -44,13 +46,13 @@ def seek(self, *args): class BaseTest(unittest.TestCase): - filename = support.TESTFN + filename = os_helper.TESTFN def setUp(self): - support.unlink(self.filename) + os_helper.unlink(self.filename) def tearDown(self): - support.unlink(self.filename) + os_helper.unlink(self.filename) class TestGzip(BaseTest): @@ -286,7 +288,7 @@ def test_mode(self): self.test_write() with gzip.GzipFile(self.filename, 'r') as f: self.assertEqual(f.myfileobj.mode, 'rb') - support.unlink(self.filename) + os_helper.unlink(self.filename) with gzip.GzipFile(self.filename, 'x') as f: self.assertEqual(f.myfileobj.mode, 'xb') @@ -365,7 +367,7 @@ def test_metadata(self): self.assertEqual(isizeBytes, struct.pack(' Date: Tue, 4 Aug 2020 00:49:18 +0800 Subject: [PATCH 114/197] bpo-40275: Use new test.support helper submodules in tests (GH-21448) --- Lib/test/test_argparse.py | 5 +- Lib/test/test_asyncgen.py | 2 +- Lib/test/test_clinic.py | 3 +- Lib/test/test_codecs.py | 28 ++--- Lib/test/test_doctest.py | 16 +-- Lib/test/test_exceptions.py | 9 +- Lib/test/test_ftplib.py | 3 +- Lib/test/test_gc.py | 5 +- Lib/test/test_genericpath.py | 103 ++++++++++--------- Lib/test/test_imghdr.py | 4 +- Lib/test/test_mimetypes.py | 5 +- Lib/test/test_ntpath.py | 78 +++++++------- Lib/test/test_operator.py | 8 +- Lib/test/test_optparse.py | 29 +++--- Lib/test/test_peg_generator/test_c_parser.py | 3 +- Lib/test/test_queue.py | 7 +- Lib/test/test_spwd.py | 5 +- Lib/test/test_stat.py | 4 +- Lib/test/test_tokenize.py | 5 +- Lib/test/test_webbrowser.py | 17 +-- 20 files changed, 185 insertions(+), 154 deletions(-) diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index 22cae626ccc297..e98c15b11afb31 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -13,6 +13,7 @@ from io import StringIO from test import support +from test.support import os_helper from unittest import mock class StdIOBuffer(StringIO): pass @@ -23,7 +24,7 @@ def setUp(self): # The tests assume that line wrapping occurs at 80 columns, but this # behaviour can be overridden by setting the COLUMNS environment # variable. To ensure that this width is used, set COLUMNS to 80. - env = support.EnvironmentVarGuard() + env = os_helper.EnvironmentVarGuard() env['COLUMNS'] = '80' self.addCleanup(env.__exit__) @@ -3244,7 +3245,7 @@ class TestShortColumns(HelpTestCase): but we don't want any exceptions thrown in such cases. Only ugly representation. ''' def setUp(self): - env = support.EnvironmentVarGuard() + env = os_helper.EnvironmentVarGuard() env.set("COLUMNS", '15') self.addCleanup(env.__exit__) diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py index 62bf8774166529..1f7e05b42be99c 100644 --- a/Lib/test/test_asyncgen.py +++ b/Lib/test/test_asyncgen.py @@ -2,7 +2,7 @@ import types import unittest -from test.support import import_module +from test.support.import_helper import import_module asyncio = import_module("asyncio") diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 3d5dc4759d5018..80b9aec7c2f5bc 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -3,6 +3,7 @@ # Licensed to the PSF under a contributor agreement. from test import support, test_tools +from test.support import os_helper from unittest import TestCase import collections import inspect @@ -797,7 +798,7 @@ def test_external(self): source = support.findfile('clinic.test') with open(source, 'r', encoding='utf-8') as f: original = f.read() - with support.temp_dir() as testdir: + with os_helper.temp_dir() as testdir: testfile = os.path.join(testdir, 'clinic.test.c') with open(testfile, 'w', encoding='utf-8') as f: f.write(original) diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 54a3520802a4f3..f0da35c039e11e 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -8,6 +8,8 @@ from unittest import mock from test import support +from test.support import os_helper +from test.support import warnings_helper try: import _testcapi @@ -709,11 +711,11 @@ def test_bug691291(self): s1 = 'Hello\r\nworld\r\n' s = s1.encode(self.encoding) - self.addCleanup(support.unlink, support.TESTFN) - with open(support.TESTFN, 'wb') as fp: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, 'wb') as fp: fp.write(s) - with support.check_warnings(('', DeprecationWarning)): - reader = codecs.open(support.TESTFN, 'U', encoding=self.encoding) + with warnings_helper.check_warnings(('', DeprecationWarning)): + reader = codecs.open(os_helper.TESTFN, 'U', encoding=self.encoding) with reader: self.assertEqual(reader.read(), s1) @@ -1697,10 +1699,10 @@ def test_all(self): getattr(codecs, api) def test_open(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) for mode in ('w', 'r', 'r+', 'w+', 'a', 'a+'): with self.subTest(mode), \ - codecs.open(support.TESTFN, mode, 'ascii') as file: + codecs.open(os_helper.TESTFN, mode, 'ascii') as file: self.assertIsInstance(file, codecs.StreamReaderWriter) def test_undefined(self): @@ -1718,7 +1720,7 @@ def test_file_closes_if_lookup_error_raised(self): mock_open = mock.mock_open() with mock.patch('builtins.open', mock_open) as file: with self.assertRaises(LookupError): - codecs.open(support.TESTFN, 'wt', 'invalid-encoding') + codecs.open(os_helper.TESTFN, 'wt', 'invalid-encoding') file().close.assert_called() @@ -2516,10 +2518,10 @@ def test_seek0(self): "utf-32", "utf-32-le", "utf-32-be") - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) for encoding in tests: # Check if the BOM is written only once - with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f: + with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f: f.write(data) f.write(data) f.seek(0) @@ -2528,7 +2530,7 @@ def test_seek0(self): self.assertEqual(f.read(), data * 2) # Check that the BOM is written after a seek(0) - with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f: + with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f: f.write(data[0]) self.assertNotEqual(f.tell(), 0) f.seek(0) @@ -2537,7 +2539,7 @@ def test_seek0(self): self.assertEqual(f.read(), data) # (StreamWriter) Check that the BOM is written after a seek(0) - with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f: + with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f: f.writer.write(data[0]) self.assertNotEqual(f.writer.tell(), 0) f.writer.seek(0) @@ -2547,7 +2549,7 @@ def test_seek0(self): # Check that the BOM is not written after a seek() at a position # different than the start - with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f: + with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f: f.write(data) f.seek(f.tell()) f.write(data) @@ -2556,7 +2558,7 @@ def test_seek0(self): # (StreamWriter) Check that the BOM is not written after a seek() # at a position different than the start - with codecs.open(support.TESTFN, 'w+', encoding=encoding) as f: + with codecs.open(os_helper.TESTFN, 'w+', encoding=encoding) as f: f.writer.write(data) f.writer.seek(f.writer.tell()) f.writer.write(data) diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 8d9f8729687754..bff20f9cac9c98 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -3,6 +3,8 @@ """ from test import support +from test.support import import_helper +from test.support import os_helper import doctest import functools import os @@ -441,7 +443,7 @@ def basics(): r""" >>> tests = finder.find(sample_func) >>> print(tests) # doctest: +ELLIPSIS - [] + [] The exact name depends on how test_doctest was invoked, so allow for leading path components. @@ -705,7 +707,7 @@ def test_empty_namespace_package(self): try: mod = importlib.import_module(pkg_name) finally: - support.forget(pkg_name) + import_helper.forget(pkg_name) sys.path.pop() include_empty_finder = doctest.DocTestFinder(exclude_empty=False) @@ -2758,7 +2760,7 @@ def test_lineendings(): r""" >>> dn = tempfile.mkdtemp() >>> pkg = os.path.join(dn, "doctest_testpkg") >>> os.mkdir(pkg) - >>> support.create_empty_file(os.path.join(pkg, "__init__.py")) + >>> os_helper.create_empty_file(os.path.join(pkg, "__init__.py")) >>> fn = os.path.join(pkg, "doctest_testfile.txt") >>> with open(fn, 'wb') as f: ... f.write( @@ -2840,7 +2842,8 @@ def test_CLI(): r""" simple tests and no errors. We'll run both the unadorned doctest command, and the verbose version, and then check the output: - >>> from test.support import script_helper, temp_dir + >>> from test.support import script_helper + >>> from test.support.os_helper import temp_dir >>> with temp_dir() as tmpdir: ... fn = os.path.join(tmpdir, 'myfile.doc') ... with open(fn, 'w') as f: @@ -2891,7 +2894,8 @@ def test_CLI(): r""" file ends in '.py', its handling of python module files (as opposed to straight text files). - >>> from test.support import script_helper, temp_dir + >>> from test.support import script_helper + >>> from test.support.os_helper import temp_dir >>> with temp_dir() as tmpdir: ... fn = os.path.join(tmpdir, 'myfile.doc') ... with open(fn, 'w') as f: @@ -3109,7 +3113,7 @@ def test_main(): def test_coverage(coverdir): - trace = support.import_module('trace') + trace = import_helper.import_module('trace') tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,], trace=0, count=1) tracer.run('test_main()') diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index a67e69bfff7281..2ffe8caa03f812 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -8,10 +8,13 @@ import weakref import errno -from test.support import (TESTFN, captured_stderr, check_impl_detail, - check_warnings, cpython_only, gc_collect, - no_tracing, unlink, import_module, script_helper, +from test.support import (captured_stderr, check_impl_detail, + cpython_only, gc_collect, + no_tracing, script_helper, SuppressCrashReport) +from test.support.import_helper import import_module +from test.support.os_helper import TESTFN, unlink +from test.support.warnings_helper import check_warnings from test import support diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index cb43573318b6a9..65feb3aadedd67 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -21,6 +21,7 @@ from test import support from test.support import threading_helper from test.support import socket_helper +from test.support import warnings_helper from test.support.socket_helper import HOST, HOSTv6 TIMEOUT = support.LOOPBACK_TIMEOUT @@ -623,7 +624,7 @@ def test_storlines(self): f = io.StringIO(RETR_DATA.replace('\r\n', '\n')) # storlines() expects a binary file, not a text file - with support.check_warnings(('', BytesWarning), quiet=True): + with warnings_helper.check_warnings(('', BytesWarning), quiet=True): self.assertRaises(TypeError, self.client.storlines, 'stor foo', f) def test_nlst(self): diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py index c82970827c6728..1b096efdbcf5fb 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -1,8 +1,9 @@ import unittest import unittest.mock from test.support import (verbose, refcount_test, run_unittest, - cpython_only, temp_dir, TESTFN, unlink, - import_module) + cpython_only) +from test.support.import_helper import import_module +from test.support.os_helper import temp_dir, TESTFN, unlink from test.support.script_helper import assert_python_ok, make_script from test.support import threading_helper diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index e7acbcd29088b3..1ff7f75ad3e614 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -7,9 +7,10 @@ import sys import unittest import warnings -from test import support +from test.support import os_helper +from test.support import warnings_helper from test.support.script_helper import assert_python_ok -from test.support import FakePath +from test.support.os_helper import FakePath def create_file(filename, data=b'foo'): @@ -97,8 +98,8 @@ def test_commonprefix(self): self.assertNotEqual(s1[n:n+1], s2[n:n+1]) def test_getsize(self): - filename = support.TESTFN - self.addCleanup(support.unlink, filename) + filename = os_helper.TESTFN + self.addCleanup(os_helper.unlink, filename) create_file(filename, b'Hello') self.assertEqual(self.pathmodule.getsize(filename), 5) @@ -108,8 +109,8 @@ def test_getsize(self): self.assertEqual(self.pathmodule.getsize(filename), 12) def test_filetime(self): - filename = support.TESTFN - self.addCleanup(support.unlink, filename) + filename = os_helper.TESTFN + self.addCleanup(os_helper.unlink, filename) create_file(filename, b'foo') @@ -126,9 +127,9 @@ def test_filetime(self): ) def test_exists(self): - filename = support.TESTFN + filename = os_helper.TESTFN bfilename = os.fsencode(filename) - self.addCleanup(support.unlink, filename) + self.addCleanup(os_helper.unlink, filename) self.assertIs(self.pathmodule.exists(filename), False) self.assertIs(self.pathmodule.exists(bfilename), False) @@ -163,7 +164,7 @@ def test_exists_fd(self): self.assertFalse(self.pathmodule.exists(r)) def test_isdir(self): - filename = support.TESTFN + filename = os_helper.TESTFN bfilename = os.fsencode(filename) self.assertIs(self.pathmodule.isdir(filename), False) self.assertIs(self.pathmodule.isdir(bfilename), False) @@ -178,17 +179,17 @@ def test_isdir(self): self.assertIs(self.pathmodule.isdir(filename), False) self.assertIs(self.pathmodule.isdir(bfilename), False) finally: - support.unlink(filename) + os_helper.unlink(filename) try: os.mkdir(filename) self.assertIs(self.pathmodule.isdir(filename), True) self.assertIs(self.pathmodule.isdir(bfilename), True) finally: - support.rmdir(filename) + os_helper.rmdir(filename) def test_isfile(self): - filename = support.TESTFN + filename = os_helper.TESTFN bfilename = os.fsencode(filename) self.assertIs(self.pathmodule.isfile(filename), False) self.assertIs(self.pathmodule.isfile(bfilename), False) @@ -203,20 +204,20 @@ def test_isfile(self): self.assertIs(self.pathmodule.isfile(filename), True) self.assertIs(self.pathmodule.isfile(bfilename), True) finally: - support.unlink(filename) + os_helper.unlink(filename) try: os.mkdir(filename) self.assertIs(self.pathmodule.isfile(filename), False) self.assertIs(self.pathmodule.isfile(bfilename), False) finally: - support.rmdir(filename) + os_helper.rmdir(filename) def test_samefile(self): - file1 = support.TESTFN - file2 = support.TESTFN + "2" - self.addCleanup(support.unlink, file1) - self.addCleanup(support.unlink, file2) + file1 = os_helper.TESTFN + file2 = os_helper.TESTFN + "2" + self.addCleanup(os_helper.unlink, file1) + self.addCleanup(os_helper.unlink, file2) create_file(file1) self.assertTrue(self.pathmodule.samefile(file1, file1)) @@ -227,10 +228,10 @@ def test_samefile(self): self.assertRaises(TypeError, self.pathmodule.samefile) def _test_samefile_on_link_func(self, func): - test_fn1 = support.TESTFN - test_fn2 = support.TESTFN + "2" - self.addCleanup(support.unlink, test_fn1) - self.addCleanup(support.unlink, test_fn2) + test_fn1 = os_helper.TESTFN + test_fn2 = os_helper.TESTFN + "2" + self.addCleanup(os_helper.unlink, test_fn1) + self.addCleanup(os_helper.unlink, test_fn2) create_file(test_fn1) @@ -241,7 +242,7 @@ def _test_samefile_on_link_func(self, func): create_file(test_fn2) self.assertFalse(self.pathmodule.samefile(test_fn1, test_fn2)) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_samefile_on_symlink(self): self._test_samefile_on_link_func(os.symlink) @@ -252,10 +253,10 @@ def test_samefile_on_link(self): self.skipTest('os.link(): %s' % e) def test_samestat(self): - test_fn1 = support.TESTFN - test_fn2 = support.TESTFN + "2" - self.addCleanup(support.unlink, test_fn1) - self.addCleanup(support.unlink, test_fn2) + test_fn1 = os_helper.TESTFN + test_fn2 = os_helper.TESTFN + "2" + self.addCleanup(os_helper.unlink, test_fn1) + self.addCleanup(os_helper.unlink, test_fn2) create_file(test_fn1) stat1 = os.stat(test_fn1) @@ -268,10 +269,10 @@ def test_samestat(self): self.assertRaises(TypeError, self.pathmodule.samestat) def _test_samestat_on_link_func(self, func): - test_fn1 = support.TESTFN + "1" - test_fn2 = support.TESTFN + "2" - self.addCleanup(support.unlink, test_fn1) - self.addCleanup(support.unlink, test_fn2) + test_fn1 = os_helper.TESTFN + "1" + test_fn2 = os_helper.TESTFN + "2" + self.addCleanup(os_helper.unlink, test_fn1) + self.addCleanup(os_helper.unlink, test_fn2) create_file(test_fn1) func(test_fn1, test_fn2) @@ -283,7 +284,7 @@ def _test_samestat_on_link_func(self, func): self.assertFalse(self.pathmodule.samestat(os.stat(test_fn1), os.stat(test_fn2))) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_samestat_on_symlink(self): self._test_samestat_on_link_func(os.symlink) @@ -294,8 +295,8 @@ def test_samestat_on_link(self): self.skipTest('os.link(): %s' % e) def test_sameopenfile(self): - filename = support.TESTFN - self.addCleanup(support.unlink, filename) + filename = os_helper.TESTFN + self.addCleanup(os_helper.unlink, filename) create_file(filename) with open(filename, "rb", 0) as fp1: @@ -374,7 +375,7 @@ def test_splitdrive(self): def test_expandvars(self): expandvars = self.pathmodule.expandvars - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.clear() env["foo"] = "bar" env["{foo"] = "baz1" @@ -403,14 +404,14 @@ def test_expandvars(self): self.assertEqual(expandvars(b"$foo$foo"), b"barbar") self.assertEqual(expandvars(b"$bar$bar"), b"$bar$bar") - @unittest.skipUnless(support.FS_NONASCII, 'need support.FS_NONASCII') + @unittest.skipUnless(os_helper.FS_NONASCII, 'need os_helper.FS_NONASCII') def test_expandvars_nonascii(self): expandvars = self.pathmodule.expandvars def check(value, expected): self.assertEqual(expandvars(value), expected) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.clear() - nonascii = support.FS_NONASCII + nonascii = os_helper.FS_NONASCII env['spam'] = nonascii env[nonascii] = 'ham' + nonascii check(nonascii, nonascii) @@ -469,31 +470,31 @@ def test_abspath_issue3426(self): # FS encoding is probably ASCII pass else: - with support.temp_cwd(unicwd): + with os_helper.temp_cwd(unicwd): for path in ('', 'fuu', 'f\xf9\xf9', '/fuu', 'U:\\'): self.assertIsInstance(abspath(path), str) def test_nonascii_abspath(self): - if (support.TESTFN_UNDECODABLE + if (os_helper.TESTFN_UNDECODABLE # Mac OS X denies the creation of a directory with an invalid # UTF-8 name. Windows allows creating a directory with an # arbitrary bytes name, but fails to enter this directory # (when the bytes name is used). and sys.platform not in ('win32', 'darwin')): - name = support.TESTFN_UNDECODABLE - elif support.TESTFN_NONASCII: - name = support.TESTFN_NONASCII + name = os_helper.TESTFN_UNDECODABLE + elif os_helper.TESTFN_NONASCII: + name = os_helper.TESTFN_NONASCII else: - self.skipTest("need support.TESTFN_NONASCII") + self.skipTest("need os_helper.TESTFN_NONASCII") with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - with support.temp_cwd(name): + with os_helper.temp_cwd(name): self.test_abspath() def test_join_errors(self): # Check join() raises friendly TypeErrors. - with support.check_warnings(('', BytesWarning), quiet=True): + with warnings_helper.check_warnings(('', BytesWarning), quiet=True): errmsg = "Can't mix strings and bytes in path components" with self.assertRaisesRegex(TypeError, errmsg): self.pathmodule.join(b'bytes', 'str') @@ -513,8 +514,8 @@ def test_join_errors(self): def test_relpath_errors(self): # Check relpath() raises friendly TypeErrors. - with support.check_warnings(('', (BytesWarning, DeprecationWarning)), - quiet=True): + with warnings_helper.check_warnings( + ('', (BytesWarning, DeprecationWarning)), quiet=True): errmsg = "Can't mix strings and bytes in path components" with self.assertRaisesRegex(TypeError, errmsg): self.pathmodule.relpath(b'bytes', 'str') @@ -534,9 +535,9 @@ def test_import(self): class PathLikeTests(unittest.TestCase): def setUp(self): - self.file_name = support.TESTFN - self.file_path = FakePath(support.TESTFN) - self.addCleanup(support.unlink, self.file_name) + self.file_name = os_helper.TESTFN + self.file_path = FakePath(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, self.file_name) create_file(self.file_name, b"test_genericpath.PathLikeTests") def assertPathEqual(self, func): diff --git a/Lib/test/test_imghdr.py b/Lib/test/test_imghdr.py index 476ba95f173c1c..b2d1fc8322a038 100644 --- a/Lib/test/test_imghdr.py +++ b/Lib/test/test_imghdr.py @@ -4,7 +4,9 @@ import pathlib import unittest import warnings -from test.support import findfile, TESTFN, unlink +from test.support import findfile +from test.support.os_helper import TESTFN, unlink + TEST_FILES = ( ('python.png', 'png'), diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 683d393fdb4913..ddeae38e1372f5 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -6,6 +6,7 @@ import unittest from test import support +from test.support import os_helper from platform import win32_edition @@ -60,7 +61,7 @@ def test_read_mime_types(self): # Unreadable file returns None self.assertIsNone(mimetypes.read_mime_types("non-existent")) - with support.temp_dir() as directory: + with os_helper.temp_dir() as directory: data = "x-application/x-unittest pyunit\n" file = pathlib.Path(directory, "sample.mimetype") file.write_text(data) @@ -70,7 +71,7 @@ def test_read_mime_types(self): # bpo-41048: read_mime_types should read the rule file with 'utf-8' encoding. # Not with locale encoding. _bootlocale has been imported because io.open(...) # uses it. - with support.temp_dir() as directory: + with os_helper.temp_dir() as directory: data = "application/no-mans-land Fran\u00E7ais" file = pathlib.Path(directory, "sample.mimetype") file.write_text(data, encoding='utf-8') diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 6f881f197c4f54..69c44710f0b5ad 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -3,7 +3,9 @@ import sys import unittest import warnings -from test.support import TestFailed, FakePath +from test.support import os_helper +from test.support import TestFailed +from test.support.os_helper import FakePath from test import support, test_genericpath from tempfile import TemporaryFile @@ -254,34 +256,34 @@ def test_realpath_pardir(self): tester("ntpath.realpath('\\'.join(['..'] * 50))", ntpath.splitdrive(expected)[0] + '\\') - @support.skip_unless_symlink + @os_helper.skip_unless_symlink @unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname') def test_realpath_basic(self): - ABSTFN = ntpath.abspath(support.TESTFN) + ABSTFN = ntpath.abspath(os_helper.TESTFN) open(ABSTFN, "wb").close() - self.addCleanup(support.unlink, ABSTFN) - self.addCleanup(support.unlink, ABSTFN + "1") + self.addCleanup(os_helper.unlink, ABSTFN) + self.addCleanup(os_helper.unlink, ABSTFN + "1") os.symlink(ABSTFN, ABSTFN + "1") self.assertPathEqual(ntpath.realpath(ABSTFN + "1"), ABSTFN) self.assertPathEqual(ntpath.realpath(os.fsencode(ABSTFN + "1")), os.fsencode(ABSTFN)) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink @unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname') def test_realpath_relative(self): - ABSTFN = ntpath.abspath(support.TESTFN) + ABSTFN = ntpath.abspath(os_helper.TESTFN) open(ABSTFN, "wb").close() - self.addCleanup(support.unlink, ABSTFN) - self.addCleanup(support.unlink, ABSTFN + "1") + self.addCleanup(os_helper.unlink, ABSTFN) + self.addCleanup(os_helper.unlink, ABSTFN + "1") os.symlink(ABSTFN, ntpath.relpath(ABSTFN + "1")) self.assertPathEqual(ntpath.realpath(ABSTFN + "1"), ABSTFN) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink @unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname') def test_realpath_broken_symlinks(self): - ABSTFN = ntpath.abspath(support.TESTFN) + ABSTFN = ntpath.abspath(os_helper.TESTFN) os.mkdir(ABSTFN) self.addCleanup(support.rmtree, ABSTFN) @@ -335,18 +337,18 @@ def test_realpath_broken_symlinks(self): self.assertPathEqual(ntpath.realpath(b"broken5"), os.fsencode(ABSTFN + r"\missing")) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink @unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname') def test_realpath_symlink_loops(self): # Symlink loops are non-deterministic as to which path is returned, but # it will always be the fully resolved path of one member of the cycle - ABSTFN = ntpath.abspath(support.TESTFN) - self.addCleanup(support.unlink, ABSTFN) - self.addCleanup(support.unlink, ABSTFN + "1") - self.addCleanup(support.unlink, ABSTFN + "2") - self.addCleanup(support.unlink, ABSTFN + "y") - self.addCleanup(support.unlink, ABSTFN + "c") - self.addCleanup(support.unlink, ABSTFN + "a") + ABSTFN = ntpath.abspath(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, ABSTFN) + self.addCleanup(os_helper.unlink, ABSTFN + "1") + self.addCleanup(os_helper.unlink, ABSTFN + "2") + self.addCleanup(os_helper.unlink, ABSTFN + "y") + self.addCleanup(os_helper.unlink, ABSTFN + "c") + self.addCleanup(os_helper.unlink, ABSTFN + "a") os.symlink(ABSTFN, ABSTFN) self.assertPathEqual(ntpath.realpath(ABSTFN), ABSTFN) @@ -381,14 +383,14 @@ def test_realpath_symlink_loops(self): # Test using relative path as well. self.assertPathEqual(ntpath.realpath(ntpath.basename(ABSTFN)), ABSTFN) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink @unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname') def test_realpath_symlink_prefix(self): - ABSTFN = ntpath.abspath(support.TESTFN) - self.addCleanup(support.unlink, ABSTFN + "3") - self.addCleanup(support.unlink, "\\\\?\\" + ABSTFN + "3.") - self.addCleanup(support.unlink, ABSTFN + "3link") - self.addCleanup(support.unlink, ABSTFN + "3.link") + ABSTFN = ntpath.abspath(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, ABSTFN + "3") + self.addCleanup(os_helper.unlink, "\\\\?\\" + ABSTFN + "3.") + self.addCleanup(os_helper.unlink, ABSTFN + "3link") + self.addCleanup(os_helper.unlink, ABSTFN + "3.link") with open(ABSTFN + "3", "wb") as f: f.write(b'0') @@ -422,9 +424,9 @@ def test_realpath_nul(self): @unittest.skipUnless(HAVE_GETFINALPATHNAME, 'need _getfinalpathname') @unittest.skipUnless(HAVE_GETSHORTPATHNAME, 'need _getshortpathname') def test_realpath_cwd(self): - ABSTFN = ntpath.abspath(support.TESTFN) + ABSTFN = ntpath.abspath(os_helper.TESTFN) - support.unlink(ABSTFN) + os_helper.unlink(ABSTFN) support.rmtree(ABSTFN) os.mkdir(ABSTFN) self.addCleanup(support.rmtree, ABSTFN) @@ -449,7 +451,7 @@ def test_realpath_cwd(self): self.assertPathEqual(test_file_long, ntpath.realpath("file.txt")) def test_expandvars(self): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.clear() env["foo"] = "bar" env["{foo"] = "baz1" @@ -474,13 +476,13 @@ def test_expandvars(self): tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar") tester('ntpath.expandvars("bar\'%foo%")', "bar\'%foo%") - @unittest.skipUnless(support.FS_NONASCII, 'need support.FS_NONASCII') + @unittest.skipUnless(os_helper.FS_NONASCII, 'need os_helper.FS_NONASCII') def test_expandvars_nonascii(self): def check(value, expected): tester('ntpath.expandvars(%r)' % value, expected) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.clear() - nonascii = support.FS_NONASCII + nonascii = os_helper.FS_NONASCII env['spam'] = nonascii env[nonascii] = 'ham' + nonascii check('$spam bar', '%s bar' % nonascii) @@ -497,7 +499,7 @@ def check(value, expected): def test_expanduser(self): tester('ntpath.expanduser("test")', 'test') - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.clear() tester('ntpath.expanduser("~test")', '~test') @@ -533,7 +535,7 @@ def test_expanduser(self): @unittest.skipUnless(nt, "abspath requires 'nt' module") def test_abspath(self): tester('ntpath.abspath("C:\\")', "C:\\") - with support.temp_cwd(support.TESTFN) as cwd_dir: # bpo-31047 + with os_helper.temp_cwd(os_helper.TESTFN) as cwd_dir: # bpo-31047 tester('ntpath.abspath("")', cwd_dir) tester('ntpath.abspath(" ")', cwd_dir + "\\ ") tester('ntpath.abspath("?")', cwd_dir + "\\?") @@ -545,7 +547,7 @@ def test_relpath(self): tester('ntpath.relpath(ntpath.abspath("a"))', 'a') tester('ntpath.relpath("a/b")', 'a\\b') tester('ntpath.relpath("../a/b")', '..\\a\\b') - with support.temp_cwd(support.TESTFN) as cwd_dir: + with os_helper.temp_cwd(os_helper.TESTFN) as cwd_dir: currentdir = ntpath.basename(cwd_dir) tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a') tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b') @@ -661,7 +663,7 @@ def test_ismount(self): self.assertTrue(ntpath.ismount(b"\\\\.\\c:\\")) self.assertTrue(ntpath.ismount(b"\\\\.\\C:\\")) - with support.temp_dir() as d: + with os_helper.temp_dir() as d: self.assertFalse(ntpath.ismount(d)) if sys.platform == "win32": @@ -725,9 +727,9 @@ class PathLikeTests(NtpathTestCase): path = ntpath def setUp(self): - self.file_name = support.TESTFN - self.file_path = FakePath(support.TESTFN) - self.addCleanup(support.unlink, self.file_name) + self.file_name = os_helper.TESTFN + self.file_path = FakePath(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, self.file_name) with open(self.file_name, 'xb', 0) as file: file.write(b"test_ntpath.PathLikeTests") diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index 29f5e4275c55eb..1ecae85f62f2c9 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -3,9 +3,13 @@ import sys from test import support +from test.support import import_helper -py_operator = support.import_fresh_module('operator', blocked=['_operator']) -c_operator = support.import_fresh_module('operator', fresh=['_operator']) + +py_operator = import_helper.import_fresh_module('operator', + blocked=['_operator']) +c_operator = import_helper.import_fresh_module('operator', + fresh=['_operator']) class Seq1: def __init__(self, lst): diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index 437fdd2be8d85a..ed65b7798e3d2a 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -14,6 +14,7 @@ from io import StringIO from test import support +from test.support import os_helper import optparse @@ -1021,10 +1022,10 @@ def setUp(self): self.parser.add_option("-f", "--file", type="file", dest="file") def tearDown(self): - if os.path.isdir(support.TESTFN): - os.rmdir(support.TESTFN) - elif os.path.isfile(support.TESTFN): - os.unlink(support.TESTFN) + if os.path.isdir(os_helper.TESTFN): + os.rmdir(os_helper.TESTFN) + elif os.path.isfile(os_helper.TESTFN): + os.unlink(os_helper.TESTFN) class MyOption (Option): def check_file(option, opt, value): @@ -1039,21 +1040,21 @@ def check_file(option, opt, value): TYPE_CHECKER["file"] = check_file def test_filetype_ok(self): - support.create_empty_file(support.TESTFN) - self.assertParseOK(["--file", support.TESTFN, "-afoo"], - {'file': support.TESTFN, 'a': 'foo'}, + os_helper.create_empty_file(os_helper.TESTFN) + self.assertParseOK(["--file", os_helper.TESTFN, "-afoo"], + {'file': os_helper.TESTFN, 'a': 'foo'}, []) def test_filetype_noexist(self): - self.assertParseFail(["--file", support.TESTFN, "-afoo"], + self.assertParseFail(["--file", os_helper.TESTFN, "-afoo"], "%s: file does not exist" % - support.TESTFN) + os_helper.TESTFN) def test_filetype_notfile(self): - os.mkdir(support.TESTFN) - self.assertParseFail(["--file", support.TESTFN, "-afoo"], + os.mkdir(os_helper.TESTFN) + self.assertParseFail(["--file", os_helper.TESTFN, "-afoo"], "%s: not a regular file" % - support.TESTFN) + os_helper.TESTFN) class TestExtendAddActions(BaseTest): @@ -1497,7 +1498,7 @@ def make_parser(self, columns): # we must restore its original value -- otherwise, this test # screws things up for other tests when it's part of the Python # test suite. - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env['COLUMNS'] = str(columns) return InterceptingOptionParser(option_list=options) @@ -1522,7 +1523,7 @@ def test_help_long_opts_first(self): self.assertHelpEquals(_expected_help_long_opts_first) def test_help_title_formatter(self): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["COLUMNS"] = "80" self.parser.formatter = TitledHelpFormatter() self.assertHelpEquals(_expected_help_title_formatter) diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index f9935258c861e0..2c13635d37dea3 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -5,6 +5,7 @@ from test import test_tools from test import support +from test.support import os_helper from test.support.script_helper import assert_python_ok test_tools.skip_if_missing("peg_generator") @@ -68,7 +69,7 @@ def setUp(self): self.skipTest("The %r command is not found" % cmd) super(TestCParser, self).setUp() self.tmp_path = self.mkdtemp() - change_cwd = support.change_cwd(self.tmp_path) + change_cwd = os_helper.change_cwd(self.tmp_path) change_cwd.__enter__() self.addCleanup(change_cwd.__exit__, None, None, None) diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py index 7b23699a00f1d0..508b739019593d 100644 --- a/Lib/test/test_queue.py +++ b/Lib/test/test_queue.py @@ -6,11 +6,12 @@ import time import unittest import weakref -from test import support +from test.support import import_helper from test.support import threading_helper -py_queue = support.import_fresh_module('queue', blocked=['_queue']) -c_queue = support.import_fresh_module('queue', fresh=['_queue']) + +py_queue = import_helper.import_fresh_module('queue', blocked=['_queue']) +c_queue = import_helper.import_fresh_module('queue', fresh=['_queue']) need_c_queue = unittest.skipUnless(c_queue, "No _queue module found") QUEUE_SIZE = 5 diff --git a/Lib/test/test_spwd.py b/Lib/test/test_spwd.py index 07793c84c8e912..a143acc659ef6a 100644 --- a/Lib/test/test_spwd.py +++ b/Lib/test/test_spwd.py @@ -1,8 +1,9 @@ import os import unittest -from test import support +from test.support import import_helper -spwd = support.import_module('spwd') + +spwd = import_helper.import_module('spwd') @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0, diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py index d9e4ffde658dbd..83d09e17f93c56 100644 --- a/Lib/test/test_stat.py +++ b/Lib/test/test_stat.py @@ -3,7 +3,9 @@ import socket import sys from test.support import socket_helper -from test.support import TESTFN, import_fresh_module +from test.support.import_helper import import_fresh_module +from test.support.os_helper import TESTFN + c_stat = import_fresh_module('stat', fresh=['_stat']) py_stat = import_fresh_module('stat', blocked=['_stat']) diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 6de7aa87bb2f9e..681f2c72f9c378 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -1,4 +1,5 @@ from test import support +from test.support import os_helper from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP, STRING, ENDMARKER, ENCODING, tok_name, detect_encoding, open as tokenize_open, Untokenizer, generate_tokens, @@ -1265,8 +1266,8 @@ def test_false_encoding(self): self.assertEqual(consumed_lines, [b'print("#coding=fake")']) def test_open(self): - filename = support.TESTFN + '.py' - self.addCleanup(support.unlink, filename) + filename = os_helper.TESTFN + '.py' + self.addCleanup(os_helper.unlink, filename) # test coding cookie for encoding in ('iso-8859-15', 'utf-8'): diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 519a9432abe012..6ceb49069f6564 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -5,6 +5,7 @@ import subprocess from unittest import mock from test import support +from test.support import import_helper URL = 'http://www.example.com' @@ -270,7 +271,7 @@ def test_register_preferred(self): class ImportTest(unittest.TestCase): def test_register(self): - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') self.assertIsNone(webbrowser._tryorder) self.assertFalse(webbrowser._browsers) @@ -284,7 +285,7 @@ class ExampleBrowser: self.assertEqual(webbrowser._browsers['example1'], [ExampleBrowser, None]) def test_get(self): - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') self.assertIsNone(webbrowser._tryorder) self.assertFalse(webbrowser._browsers) @@ -293,24 +294,24 @@ def test_get(self): self.assertIsNotNone(webbrowser._tryorder) def test_synthesize(self): - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') name = os.path.basename(sys.executable).lower() webbrowser.register(name, None, webbrowser.GenericBrowser(name)) webbrowser.get(sys.executable) def test_environment(self): - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') try: browser = webbrowser.get().name except (webbrowser.Error, AttributeError) as err: self.skipTest(str(err)) with support.EnvironmentVarGuard() as env: env["BROWSER"] = browser - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') webbrowser.get() def test_environment_preferred(self): - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') try: webbrowser.get() least_preferred_browser = webbrowser.get(webbrowser._tryorder[-1]).name @@ -319,12 +320,12 @@ def test_environment_preferred(self): with support.EnvironmentVarGuard() as env: env["BROWSER"] = least_preferred_browser - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') self.assertEqual(webbrowser.get().name, least_preferred_browser) with support.EnvironmentVarGuard() as env: env["BROWSER"] = sys.executable - webbrowser = support.import_fresh_module('webbrowser') + webbrowser = import_helper.import_fresh_module('webbrowser') self.assertEqual(webbrowser.get().name, sys.executable) From 8c216e75b64c022a889d91df28c87106a7edb804 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 3 Aug 2020 22:51:23 +0200 Subject: [PATCH 115/197] bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718) regrtest_unraisable_hook() temporarily replaces sys.stderr with sys.__stderr__ to help to display errors when a test captures stderr. --- Lib/test/libregrtest/utils.py | 7 ++++++- Lib/test/test_regrtest.py | 13 +++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index 0368694b2adcb7..71f538f0c45338 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -72,7 +72,12 @@ def regrtest_unraisable_hook(unraisable): global orig_unraisablehook support.environment_altered = True print_warning("Unraisable exception") - orig_unraisablehook(unraisable) + old_stderr = sys.stderr + try: + sys.stderr = sys.__stderr__ + orig_unraisablehook(unraisable) + finally: + sys.stderr = old_stderr def setup_unraisable_hook(): diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 39af0d96d1e54d..38321e04b54a9e 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -1235,10 +1235,12 @@ def test_sleep(self): re.compile('%s timed out' % testname, re.MULTILINE)) def test_unraisable_exc(self): - # --fail-env-changed must catch unraisable exception + # --fail-env-changed must catch unraisable exception. + # The exceptioin must be displayed even if sys.stderr is redirected. code = textwrap.dedent(r""" import unittest import weakref + from test.support import captured_stderr class MyObject: pass @@ -1250,9 +1252,11 @@ class Tests(unittest.TestCase): def test_unraisable_exc(self): obj = MyObject() ref = weakref.ref(obj, weakref_callback) - # call weakref_callback() which logs - # an unraisable exception - obj = None + with captured_stderr() as stderr: + # call weakref_callback() which logs + # an unraisable exception + obj = None + self.assertEqual(stderr.getvalue(), '') """) testname = self.create_test(code=code) @@ -1261,6 +1265,7 @@ def test_unraisable_exc(self): env_changed=[testname], fail_env_changed=True) self.assertIn("Warning -- Unraisable exception", output) + self.assertIn("Exception: weakref callback bug", output) def test_cleanup(self): dirname = os.path.join(self.tmptestdir, "test_python_123") From 012eaf5f1a055e9dc182a505a235dea0634e7274 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 4 Aug 2020 02:38:16 +0200 Subject: [PATCH 116/197] bpo-38156: Fix compiler warning in PyOS_StdioReadline() (GH-21721) incr cannot be larger than INT_MAX: downcast to int explicitly. --- Parser/myreadline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser/myreadline.c b/Parser/myreadline.c index a49c9d892dda9e..143b41f1eab95e 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -317,7 +317,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt) return NULL; } p = pr; - int err = my_fgets(tstate, p + n, incr, sys_stdin); + int err = my_fgets(tstate, p + n, (int)incr, sys_stdin); if (err == 1) { // Interrupt PyMem_RawFree(p); From 8048788328f7c60aa7c2b49c5bb834cabc492727 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 4 Aug 2020 02:40:10 +0200 Subject: [PATCH 117/197] bpo-41467: Fix asyncio recv_into() on Windows (GH-21720) On Windows, fix asyncio recv_into() return value when the socket/pipe is closed (BrokenPipeError): return 0 rather than an empty byte string (b''). --- Lib/asyncio/windows_events.py | 2 +- .../next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py index c07fe3241c569a..a6759b78bd801f 100644 --- a/Lib/asyncio/windows_events.py +++ b/Lib/asyncio/windows_events.py @@ -469,7 +469,7 @@ def recv_into(self, conn, buf, flags=0): else: ov.ReadFileInto(conn.fileno(), buf) except BrokenPipeError: - return self._result(b'') + return self._result(0) def finish_recv(trans, key, ov): try: diff --git a/Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst b/Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst new file mode 100644 index 00000000000000..f12693e117631a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-04-00-20-30.bpo-41467.Z8DgTL.rst @@ -0,0 +1,3 @@ +On Windows, fix asyncio ``recv_into()`` return value when the socket/pipe is +closed (:exc:`BrokenPipeError`): return ``0`` rather than an empty byte +string (``b''``). From 1090b51f25879b5b8593c1a124996b7dfd23f3e4 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 4 Aug 2020 11:08:06 +0900 Subject: [PATCH 118/197] bpo-41431: Optimize dict_merge for copy (GH-21674) --- Lib/test/test_ordered_dict.py | 11 ++- .../2020-08-02-15-53-12.bpo-41431.TblUBT.rst | 2 + Objects/dictobject.c | 96 +++++++++++++------ 3 files changed, 75 insertions(+), 34 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py index 1f27c0e0b57eb2..31759f20d28349 100644 --- a/Lib/test/test_ordered_dict.py +++ b/Lib/test/test_ordered_dict.py @@ -740,20 +740,21 @@ def test_sizeof_exact(self): size = support.calcobjsize check = self.check_sizeof - basicsize = size('nQ2P' + '3PnPn2P') + calcsize('2nP2n') + basicsize = size('nQ2P' + '3PnPn2P') + keysize = calcsize('2nP2n') entrysize = calcsize('n2P') p = calcsize('P') nodesize = calcsize('Pn2P') od = OrderedDict() - check(od, basicsize + 8 + 5*entrysize) # 8byte indices + 8*2//3 * entry table + check(od, basicsize) # 8byte indices + 8*2//3 * entry table od.x = 1 - check(od, basicsize + 8 + 5*entrysize) + check(od, basicsize) od.update([(i, i) for i in range(3)]) - check(od, basicsize + 8*p + 8 + 5*entrysize + 3*nodesize) + check(od, basicsize + keysize + 8*p + 8 + 5*entrysize + 3*nodesize) od.update([(i, i) for i in range(3, 10)]) - check(od, basicsize + 16*p + 16 + 10*entrysize + 10*nodesize) + check(od, basicsize + keysize + 16*p + 16 + 10*entrysize + 10*nodesize) check(od.keys(), size('P')) check(od.items(), size('P')) diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst new file mode 100644 index 00000000000000..fa9d047edc3945 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-08-02-15-53-12.bpo-41431.TblUBT.rst @@ -0,0 +1,2 @@ +Optimize ``dict_merge()`` for copying dict (e.g. ``dict(d)`` and +``{}.update(d)``). diff --git a/Objects/dictobject.c b/Objects/dictobject.c index ba22489539ae7d..1b7ae06d822710 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -674,10 +674,11 @@ new_dict_with_shared_keys(PyDictKeysObject *keys) } -static PyObject * -clone_combined_dict(PyDictObject *orig) +static PyDictKeysObject * +clone_combined_dict_keys(PyDictObject *orig) { - assert(PyDict_CheckExact(orig)); + assert(PyDict_Check(orig)); + assert(Py_TYPE(orig)->tp_iter == (getiterfunc)dict_iter); assert(orig->ma_values == NULL); assert(orig->ma_keys->dk_refcnt == 1); @@ -704,19 +705,6 @@ clone_combined_dict(PyDictObject *orig) } } - PyDictObject *new = (PyDictObject *)new_dict(keys, NULL); - if (new == NULL) { - /* In case of an error, `new_dict()` takes care of - cleaning up `keys`. */ - return NULL; - } - new->ma_used = orig->ma_used; - ASSERT_CONSISTENT(new); - if (_PyObject_GC_IS_TRACKED(orig)) { - /* Maintain tracking. */ - _PyObject_GC_TRACK(new); - } - /* Since we copied the keys table we now have an extra reference in the system. Manually call increment _Py_RefTotal to signal that we have it now; calling dictkeys_incref would be an error as @@ -724,8 +712,7 @@ clone_combined_dict(PyDictObject *orig) #ifdef Py_REF_DEBUG _Py_RefTotal++; #endif - - return (PyObject *)new; + return keys; } PyObject * @@ -2527,12 +2514,45 @@ dict_merge(PyObject *a, PyObject *b, int override) if (other == mp || other->ma_used == 0) /* a.update(a) or a.update({}); nothing to do */ return 0; - if (mp->ma_used == 0) + if (mp->ma_used == 0) { /* Since the target dict is empty, PyDict_GetItem() * always returns NULL. Setting override to 1 * skips the unnecessary test. */ override = 1; + PyDictKeysObject *okeys = other->ma_keys; + + // If other is clean, combined, and just allocated, just clone it. + if (other->ma_values == NULL && + other->ma_used == okeys->dk_nentries && + (okeys->dk_size == PyDict_MINSIZE || + USABLE_FRACTION(okeys->dk_size/2) < other->ma_used)) { + PyDictKeysObject *keys = clone_combined_dict_keys(other); + if (keys == NULL) { + return -1; + } + + dictkeys_decref(mp->ma_keys); + mp->ma_keys = keys; + if (mp->ma_values != NULL) { + if (mp->ma_values != empty_values) { + free_values(mp->ma_values); + } + mp->ma_values = NULL; + } + + mp->ma_used = other->ma_used; + mp->ma_version_tag = DICT_NEXT_VERSION(); + ASSERT_CONSISTENT(mp); + + if (_PyObject_GC_IS_TRACKED(other) && !_PyObject_GC_IS_TRACKED(mp)) { + /* Maintain tracking. */ + _PyObject_GC_TRACK(mp); + } + + return 0; + } + } /* Do one big resize at the start, rather than * incrementally resizing as we insert new items. Expect * that there will be no (or few) overlapping keys. @@ -2718,12 +2738,13 @@ PyDict_Copy(PyObject *o) return (PyObject *)split_copy; } - if (PyDict_CheckExact(mp) && mp->ma_values == NULL && + if (Py_TYPE(mp)->tp_iter == (getiterfunc)dict_iter && + mp->ma_values == NULL && (mp->ma_used >= (mp->ma_keys->dk_nentries * 2) / 3)) { /* Use fast-copy if: - (1) 'mp' is an instance of a subclassed dict; and + (1) type(mp) doesn't override tp_iter; and (2) 'mp' is not a split-dict; and @@ -2735,13 +2756,31 @@ PyDict_Copy(PyObject *o) operations and copied after that. In cases like this, we defer to PyDict_Merge, which produces a compacted copy. */ - return clone_combined_dict(mp); + PyDictKeysObject *keys = clone_combined_dict_keys(mp); + if (keys == NULL) { + return NULL; + } + PyDictObject *new = (PyDictObject *)new_dict(keys, NULL); + if (new == NULL) { + /* In case of an error, `new_dict()` takes care of + cleaning up `keys`. */ + return NULL; + } + + new->ma_used = mp->ma_used; + ASSERT_CONSISTENT(new); + if (_PyObject_GC_IS_TRACKED(mp)) { + /* Maintain tracking. */ + _PyObject_GC_TRACK(new); + } + + return (PyObject *)new; } copy = PyDict_New(); if (copy == NULL) return NULL; - if (PyDict_Merge(copy, o, 1) == 0) + if (dict_merge(copy, o, 1) == 0) return copy; Py_DECREF(copy); return NULL; @@ -3359,16 +3398,15 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds) d = (PyDictObject *)self; /* The object has been implicitly tracked by tp_alloc */ - if (type == &PyDict_Type) + if (type == &PyDict_Type) { _PyObject_GC_UNTRACK(d); + } d->ma_used = 0; d->ma_version_tag = DICT_NEXT_VERSION(); - d->ma_keys = new_keys_object(PyDict_MINSIZE); - if (d->ma_keys == NULL) { - Py_DECREF(self); - return NULL; - } + dictkeys_incref(Py_EMPTY_KEYS); + d->ma_keys = Py_EMPTY_KEYS; + d->ma_values = empty_values; ASSERT_CONSISTENT(d); return self; } From fba514e455b1277145f1eab46a3fa783266bbcb7 Mon Sep 17 00:00:00 2001 From: Hans Petter Jansson Date: Mon, 3 Aug 2020 22:51:33 -0500 Subject: [PATCH 119/197] bpo-36982: Add support for extended color functions in ncurses 6.1 (GH-17536) Co-authored-by: Jeffrey Kintscher --- Doc/library/curses.rst | 9 + Doc/whatsnew/3.10.rst | 10 + Lib/test/test_curses.py | 16 +- Misc/ACKS | 2 + .../2019-05-25-05-27-39.bpo-36982.0UHgfB.rst | 1 + Modules/_cursesmodule.c | 194 ++++++++++++-- Modules/clinic/_cursesmodule.c.h | 250 ++++-------------- 7 files changed, 258 insertions(+), 224 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index c86ca5d9bc5541..0b687db1bd2c4d 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -242,6 +242,15 @@ The module :mod:`curses` defines the following functions: Return ``True`` if the terminal can display colors; otherwise, return ``False``. +.. function:: has_extended_color_support() + + Return ``True`` if the module supports extended colors; otherwise, return + ``False``. Extended color support allows more than 256 color pairs for + terminals that support more than 16 colors (e.g. xterm-256color). + + Extended color support requires ncurses version 6.1 or later. + + .. versionadded:: 3.10 .. function:: has_ic() diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 1865fa227534a5..ec0343f2ce71e8 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -103,6 +103,16 @@ New Modules Improved Modules ================ +curses +------ + +The extended color functions added in ncurses 6.1 will be used transparently +by :func:`curses.color_content`, :func:`curses.init_color`, +:func:`curses.init_pair`, and :func:`curses.pair_content`. A new function, +:func:`curses.has_extended_color_support`, indicates whether extended color +support is provided by the underlying ncurses library. +(Contributed by Jeffrey Kintscher and Hans Petter Jansson in :issue:`36982`.) + glob ---- diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index 2c6d14c3f79dda..cabc10da8365c3 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -232,7 +232,8 @@ def test_module_funcs(self): curses.nocbreak, curses.noecho, curses.nonl, curses.noqiflush, curses.noraw, curses.reset_prog_mode, curses.termattrs, - curses.termname, curses.erasechar]: + curses.termname, curses.erasechar, + curses.has_extended_color_support]: with self.subTest(func=func.__qualname__): func() if hasattr(curses, 'filter'): @@ -293,6 +294,19 @@ def test_colors_funcs(self): if hasattr(curses, 'use_default_colors'): curses.use_default_colors() + self.assertRaises(ValueError, curses.color_content, -1) + self.assertRaises(ValueError, curses.color_content, curses.COLORS + 1) + self.assertRaises(ValueError, curses.color_content, -2**31 - 1) + self.assertRaises(ValueError, curses.color_content, 2**31) + self.assertRaises(ValueError, curses.color_content, -2**63 - 1) + self.assertRaises(ValueError, curses.color_content, 2**63 - 1) + self.assertRaises(ValueError, curses.pair_content, -1) + self.assertRaises(ValueError, curses.pair_content, curses.COLOR_PAIRS) + self.assertRaises(ValueError, curses.pair_content, -2**31 - 1) + self.assertRaises(ValueError, curses.pair_content, 2**31) + self.assertRaises(ValueError, curses.pair_content, -2**63 - 1) + self.assertRaises(ValueError, curses.pair_content, 2**63 - 1) + @requires_curses_func('keyname') def test_keyname(self): curses.keyname(13) diff --git a/Misc/ACKS b/Misc/ACKS index f5e9459276c86c..1599b09c692b75 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -798,6 +798,7 @@ Geert Jansen Jack Jansen Hans-Peter Jansen Bill Janssen +Hans Petter Jansson Jon Janzen Thomas Jarosch Juhana Jauhiainen @@ -882,6 +883,7 @@ Sam Kimbrel Tomohiko Kinebuchi James King W. Trevor King +Jeffrey Kintscher Paul Kippes Steve Kirsch Sebastian Kirsche diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst b/Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst new file mode 100644 index 00000000000000..f105f1857d487f --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-05-25-05-27-39.bpo-36982.0UHgfB.rst @@ -0,0 +1 @@ +Use ncurses extended color functions when available to support terminals with 256 colors, and add the new function :func:`curses.has_extended_color_support` to indicate whether extended color support is provided by the underlying ncurses library. \ No newline at end of file diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index c70b0e2a19fadc..34331017f85c7b 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -134,6 +134,31 @@ typedef chtype attr_t; /* No attr_t type is available */ #define STRICT_SYSV_CURSES #endif +#if defined(NCURSES_EXT_COLORS) && defined(NCURSES_EXT_FUNCS) +#define _NCURSES_EXTENDED_COLOR_FUNCS 1 +#else +#define _NCURSES_EXTENDED_COLOR_FUNCS 0 +#endif /* defined(NCURSES_EXT_COLORS) && defined(NCURSES_EXT_FUNCS) */ + +#if _NCURSES_EXTENDED_COLOR_FUNCS +#define _NCURSES_COLOR_VAL_TYPE int +#define _CURSES_INIT_COLOR_FUNC init_extended_color +#define _CURSES_INIT_PAIR_FUNC init_extended_pair +#define _COLOR_CONTENT_FUNC extended_color_content +#define _CURSES_PAIR_NUMBER_FUNC extended_pair_content +#else +#define _NCURSES_COLOR_VAL_TYPE short +#define _CURSES_INIT_COLOR_FUNC init_color +#define _CURSES_INIT_PAIR_FUNC init_pair +#define _COLOR_CONTENT_FUNC color_content +#define _CURSES_PAIR_NUMBER_FUNC pair_content +#endif /* _NCURSES_EXTENDED_COLOR_FUNCS */ + +#define _CURSES_FUNC_NAME_STR(s) #s + +#define _CURSES_INIT_COLOR_FUNC_NAME _CURSES_FUNC_NAME_STR(_CURSES_INIT_COLOR_FUNC) +#define _CURSES_INIT_PAIR_FUNC_NAME _CURSES_FUNC_NAME_STR(_CURSES_INIT_PAIR_FUNC) + /*[clinic input] module _curses class _curses.window "PyCursesWindowObject *" "&PyCursesWindow_Type" @@ -387,6 +412,104 @@ PyCurses_ConvertToString(PyCursesWindowObject *win, PyObject *obj, return 0; } +static int +color_converter(PyObject *arg, void *ptr) +{ + long color_number; + int overflow; + + color_number = PyLong_AsLongAndOverflow(arg, &overflow); + if (color_number == -1 && PyErr_Occurred()) + return 0; + + if (overflow > 0 || color_number > COLORS) { + PyErr_Format(PyExc_ValueError, + "Color number is greater than COLORS (%d).", + COLORS); + return 0; + } + else if (overflow < 0 || color_number < 0) { + PyErr_SetString(PyExc_ValueError, + "Color number is less than 0."); + return 0; + } + + *(int *)ptr = (int)color_number; + return 1; +} + +/*[python input] +class color_converter(CConverter): + type = 'int' + converter = 'color_converter' +[python start generated code]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=4260d2b6e66b3709]*/ + +static int +pair_converter(PyObject *arg, void *ptr) +{ + long pair_number; + int overflow; + + pair_number = PyLong_AsLongAndOverflow(arg, &overflow); + if (pair_number == -1 && PyErr_Occurred()) + return 0; + + if (overflow > 0 || pair_number > COLOR_PAIRS - 1) { + PyErr_Format(PyExc_ValueError, + "Color pair is greater than COLOR_PAIRS-1 (%d).", + COLOR_PAIRS - 1); + return 0; + } + else if (overflow < 0 || pair_number < 1) { + PyErr_SetString(PyExc_ValueError, + "Color pair is less than 1."); + return 0; + } + + *(int *)ptr = (int)pair_number; + return 1; +} + +/*[python input] +class pair_converter(CConverter): + type = 'int' + converter = 'pair_converter' +[python start generated code]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=1a918ae6a1b32af7]*/ + +static int +component_converter(PyObject *arg, void *ptr) +{ + long component; + int overflow; + + component = PyLong_AsLongAndOverflow(arg, &overflow); + if (component == -1 && PyErr_Occurred()) + return 0; + + if (overflow > 0 || component > 1000) { + PyErr_SetString(PyExc_ValueError, + "Color component is greater than 1000"); + return 0; + } + else if (overflow < 0 || component < 0) { + PyErr_SetString(PyExc_ValueError, + "Color component is less than 0"); + return 0; + } + + *(short *)ptr = (short)component; + return 1; +} + +/*[python input] +class component_converter(CConverter): + type = 'short' + converter = 'component_converter' +[python start generated code]*/ +/*[python end generated code: output=da39a3ee5e6b4b0d input=38e9be01d33927fb]*/ + /* Function versions of the 3 functions for testing whether curses has been initialised or not. */ @@ -2585,7 +2708,7 @@ NoArgOrFlagNoReturnFunctionBody(cbreak, flag) /*[clinic input] _curses.color_content - color_number: short + color_number: color The number of the color (0 - COLORS). / @@ -2596,15 +2719,15 @@ which will be between 0 (no component) and 1000 (maximum amount of component). [clinic start generated code]*/ static PyObject * -_curses_color_content_impl(PyObject *module, short color_number) -/*[clinic end generated code: output=cb15cf3120d4bfc1 input=5555abb1c11e11b7]*/ +_curses_color_content_impl(PyObject *module, int color_number) +/*[clinic end generated code: output=17b466df7054e0de input=c10ef58f694b13ee]*/ { - short r,g,b; + _NCURSES_COLOR_VAL_TYPE r,g,b; PyCursesInitialised; PyCursesInitialisedColor; - if (color_content(color_number, &r, &g, &b) != ERR) + if (_COLOR_CONTENT_FUNC(color_number, &r, &g, &b) != ERR) return Py_BuildValue("(iii)", r, g, b); else { PyErr_SetString(PyCursesError, @@ -2616,7 +2739,7 @@ _curses_color_content_impl(PyObject *module, short color_number) /*[clinic input] _curses.color_pair - color_number: short + color_number: color The number of the color (0 - COLORS). / @@ -2627,8 +2750,8 @@ other A_* attributes. pair_number() is the counterpart to this function. [clinic start generated code]*/ static PyObject * -_curses_color_pair_impl(PyObject *module, short color_number) -/*[clinic end generated code: output=6a84cb6b29ecaf9a input=a9d3eb6f50e4dc12]*/ +_curses_color_pair_impl(PyObject *module, int color_number) +/*[clinic end generated code: output=3fd752e8e24c93fb input=b049033819ab4ef5]*/ { PyCursesInitialised; PyCursesInitialisedColor; @@ -3027,13 +3150,13 @@ _curses_has_key_impl(PyObject *module, int key) /*[clinic input] _curses.init_color - color_number: short + color_number: color The number of the color to be changed (0 - COLORS). - r: short + r: component Red component (0 - 1000). - g: short + g: component Green component (0 - 1000). - b: short + b: component Blue component (0 - 1000). / @@ -3045,24 +3168,24 @@ most terminals; it is active only if can_change_color() returns 1. [clinic start generated code]*/ static PyObject * -_curses_init_color_impl(PyObject *module, short color_number, short r, - short g, short b) -/*[clinic end generated code: output=280236f5efe9776a input=f3a05bd38f619175]*/ +_curses_init_color_impl(PyObject *module, int color_number, short r, short g, + short b) +/*[clinic end generated code: output=d7ed71b2d818cdf2 input=8a2fe94ca9204aa5]*/ { PyCursesInitialised; PyCursesInitialisedColor; - return PyCursesCheckERR(init_color(color_number, r, g, b), "init_color"); + return PyCursesCheckERR(_CURSES_INIT_COLOR_FUNC(color_number, r, g, b), _CURSES_INIT_COLOR_FUNC_NAME); } /*[clinic input] _curses.init_pair - pair_number: short + pair_number: pair The number of the color-pair to be changed (1 - (COLOR_PAIRS-1)). - fg: short + fg: color Foreground color number (0 - COLORS). - bg: short + bg: color Background color number (0 - COLORS). / @@ -3073,14 +3196,13 @@ all occurrences of that color-pair are changed to the new definition. [clinic start generated code]*/ static PyObject * -_curses_init_pair_impl(PyObject *module, short pair_number, short fg, - short bg) -/*[clinic end generated code: output=9c2ce39c22f376b6 input=c9f0b11b17a2ac6d]*/ +_curses_init_pair_impl(PyObject *module, int pair_number, int fg, int bg) +/*[clinic end generated code: output=a0bba03d2bbc3ee6 input=b865583a18061c1f]*/ { PyCursesInitialised; PyCursesInitialisedColor; - return PyCursesCheckERR(init_pair(pair_number, fg, bg), "init_pair"); + return PyCursesCheckERR(_CURSES_INIT_PAIR_FUNC(pair_number, fg, bg), _CURSES_INIT_PAIR_FUNC_NAME); } static PyObject *ModDict; @@ -3697,7 +3819,7 @@ NoArgNoReturnFunctionBody(noraw) /*[clinic input] _curses.pair_content - pair_number: short + pair_number: pair The number of the color pair (1 - (COLOR_PAIRS-1)). / @@ -3705,15 +3827,15 @@ Return a tuple (fg, bg) containing the colors for the requested color pair. [clinic start generated code]*/ static PyObject * -_curses_pair_content_impl(PyObject *module, short pair_number) -/*[clinic end generated code: output=5a72aa1a28bbacf3 input=f4d7fec5643b976b]*/ +_curses_pair_content_impl(PyObject *module, int pair_number) +/*[clinic end generated code: output=4a726dd0e6885f3f input=b42eacf8a4103852]*/ { - short f, b; + _NCURSES_COLOR_VAL_TYPE f, b; PyCursesInitialised; PyCursesInitialisedColor; - if (pair_content(pair_number, &f, &b)==ERR) { + if (_CURSES_PAIR_NUMBER_FUNC(pair_number, &f, &b)==ERR) { PyErr_SetString(PyCursesError, "Argument 1 was out of range. (1..COLOR_PAIRS-1)"); return NULL; @@ -4450,6 +4572,21 @@ make_ncurses_version(void) #endif /* NCURSES_VERSION */ +/*[clinic input] +_curses.has_extended_color_support + +Return True if the module supports extended colors; otherwise, return False. + +Extended color support allows more than 256 color-pairs for terminals +that support more than 16 colors (e.g. xterm-256color). +[clinic start generated code]*/ + +static PyObject * +_curses_has_extended_color_support_impl(PyObject *module) +/*[clinic end generated code: output=68f1be2b57d92e22 input=4b905f046e35ee9f]*/ +{ + return PyBool_FromLong(_NCURSES_EXTENDED_COLOR_FUNCS); +} /* List of functions defined in the module */ @@ -4476,6 +4613,7 @@ static PyMethodDef PyCurses_methods[] = { _CURSES_GETSYX_METHODDEF _CURSES_GETWIN_METHODDEF _CURSES_HAS_COLORS_METHODDEF + _CURSES_HAS_EXTENDED_COLOR_SUPPORT_METHODDEF _CURSES_HAS_IC_METHODDEF _CURSES_HAS_IL_METHODDEF _CURSES_HAS_KEY_METHODDEF diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index f686ded51976c6..c4c2b71e4cc223 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -1967,32 +1967,16 @@ PyDoc_STRVAR(_curses_color_content__doc__, {"color_content", (PyCFunction)_curses_color_content, METH_O, _curses_color_content__doc__}, static PyObject * -_curses_color_content_impl(PyObject *module, short color_number); +_curses_color_content_impl(PyObject *module, int color_number); static PyObject * _curses_color_content(PyObject *module, PyObject *arg) { PyObject *return_value = NULL; - short color_number; + int color_number; - { - long ival = PyLong_AsLong(arg); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - color_number = (short) ival; - } + if (!color_converter(arg, &color_number)) { + goto exit; } return_value = _curses_color_content_impl(module, color_number); @@ -2016,32 +2000,16 @@ PyDoc_STRVAR(_curses_color_pair__doc__, {"color_pair", (PyCFunction)_curses_color_pair, METH_O, _curses_color_pair__doc__}, static PyObject * -_curses_color_pair_impl(PyObject *module, short color_number); +_curses_color_pair_impl(PyObject *module, int color_number); static PyObject * _curses_color_pair(PyObject *module, PyObject *arg) { PyObject *return_value = NULL; - short color_number; + int color_number; - { - long ival = PyLong_AsLong(arg); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - color_number = (short) ival; - } + if (!color_converter(arg, &color_number)) { + goto exit; } return_value = _curses_color_pair_impl(module, color_number); @@ -2590,14 +2558,14 @@ PyDoc_STRVAR(_curses_init_color__doc__, {"init_color", (PyCFunction)(void(*)(void))_curses_init_color, METH_FASTCALL, _curses_init_color__doc__}, static PyObject * -_curses_init_color_impl(PyObject *module, short color_number, short r, - short g, short b); +_curses_init_color_impl(PyObject *module, int color_number, short r, short g, + short b); static PyObject * _curses_init_color(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - short color_number; + int color_number; short r; short g; short b; @@ -2605,81 +2573,17 @@ _curses_init_color(PyObject *module, PyObject *const *args, Py_ssize_t nargs) if (!_PyArg_CheckPositional("init_color", nargs, 4, 4)) { goto exit; } - { - long ival = PyLong_AsLong(args[0]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - color_number = (short) ival; - } + if (!color_converter(args[0], &color_number)) { + goto exit; } - { - long ival = PyLong_AsLong(args[1]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - r = (short) ival; - } + if (!component_converter(args[1], &r)) { + goto exit; } - { - long ival = PyLong_AsLong(args[2]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - g = (short) ival; - } + if (!component_converter(args[2], &g)) { + goto exit; } - { - long ival = PyLong_AsLong(args[3]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - b = (short) ival; - } + if (!component_converter(args[3], &b)) { + goto exit; } return_value = _curses_init_color_impl(module, color_number, r, g, b); @@ -2707,76 +2611,27 @@ PyDoc_STRVAR(_curses_init_pair__doc__, {"init_pair", (PyCFunction)(void(*)(void))_curses_init_pair, METH_FASTCALL, _curses_init_pair__doc__}, static PyObject * -_curses_init_pair_impl(PyObject *module, short pair_number, short fg, - short bg); +_curses_init_pair_impl(PyObject *module, int pair_number, int fg, int bg); static PyObject * _curses_init_pair(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - short pair_number; - short fg; - short bg; + int pair_number; + int fg; + int bg; if (!_PyArg_CheckPositional("init_pair", nargs, 3, 3)) { goto exit; } - { - long ival = PyLong_AsLong(args[0]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - pair_number = (short) ival; - } + if (!pair_converter(args[0], &pair_number)) { + goto exit; } - { - long ival = PyLong_AsLong(args[1]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - fg = (short) ival; - } + if (!color_converter(args[1], &fg)) { + goto exit; } - { - long ival = PyLong_AsLong(args[2]); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - bg = (short) ival; - } + if (!color_converter(args[2], &bg)) { + goto exit; } return_value = _curses_init_pair_impl(module, pair_number, fg, bg); @@ -3554,32 +3409,16 @@ PyDoc_STRVAR(_curses_pair_content__doc__, {"pair_content", (PyCFunction)_curses_pair_content, METH_O, _curses_pair_content__doc__}, static PyObject * -_curses_pair_content_impl(PyObject *module, short pair_number); +_curses_pair_content_impl(PyObject *module, int pair_number); static PyObject * _curses_pair_content(PyObject *module, PyObject *arg) { PyObject *return_value = NULL; - short pair_number; + int pair_number; - { - long ival = PyLong_AsLong(arg); - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - else if (ival < SHRT_MIN) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is less than minimum"); - goto exit; - } - else if (ival > SHRT_MAX) { - PyErr_SetString(PyExc_OverflowError, - "signed short integer is greater than maximum"); - goto exit; - } - else { - pair_number = (short) ival; - } + if (!pair_converter(arg, &pair_number)) { + goto exit; } return_value = _curses_pair_content_impl(module, pair_number); @@ -4337,6 +4176,27 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #endif /* !defined(STRICT_SYSV_CURSES) */ +PyDoc_STRVAR(_curses_has_extended_color_support__doc__, +"has_extended_color_support($module, /)\n" +"--\n" +"\n" +"Return True if the module supports extended colors; otherwise, return False.\n" +"\n" +"Extended color support allows more than 256 color-pairs for terminals\n" +"that support more than 16 colors (e.g. xterm-256color)."); + +#define _CURSES_HAS_EXTENDED_COLOR_SUPPORT_METHODDEF \ + {"has_extended_color_support", (PyCFunction)_curses_has_extended_color_support, METH_NOARGS, _curses_has_extended_color_support__doc__}, + +static PyObject * +_curses_has_extended_color_support_impl(PyObject *module); + +static PyObject * +_curses_has_extended_color_support(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _curses_has_extended_color_support_impl(module); +} + #ifndef _CURSES_WINDOW_ENCLOSE_METHODDEF #define _CURSES_WINDOW_ENCLOSE_METHODDEF #endif /* !defined(_CURSES_WINDOW_ENCLOSE_METHODDEF) */ @@ -4428,4 +4288,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=478d93f7692385eb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=38b2531d17f119e1 input=a9049054013a1b77]*/ From 37fb8f8fbfa9fe9751a59c85b3a0ef429b64d575 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 4 Aug 2020 23:51:43 +0800 Subject: [PATCH 120/197] bpo-40275: Use new test.support helper submodules in tests (GH-21452) --- Lib/test/eintrdata/eintr_tester.py | 13 ++++---- Lib/test/test_email/test_email.py | 2 +- Lib/test/test_multibytecodec.py | 7 +++-- Lib/test/test_pdb.py | 48 +++++++++++++++--------------- Lib/test/test_urllib2_localnet.py | 6 ++-- Lib/test/test_warnings/__init__.py | 40 ++++++++++++++----------- 6 files changed, 62 insertions(+), 54 deletions(-) diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 606f31b0910961..e43b59d064f55a 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -22,6 +22,7 @@ import unittest from test import support +from test.support import os_helper from test.support import socket_helper @contextlib.contextmanager @@ -314,16 +315,16 @@ def test_accept(self): @support.requires_freebsd_version(10, 3) @unittest.skipUnless(hasattr(os, 'mkfifo'), 'needs mkfifo()') def _test_open(self, do_open_close_reader, do_open_close_writer): - filename = support.TESTFN + filename = os_helper.TESTFN # Use a fifo: until the child opens it for reading, the parent will # block when trying to open it for writing. - support.unlink(filename) + os_helper.unlink(filename) try: os.mkfifo(filename) except PermissionError as e: self.skipTest('os.mkfifo(): %s' % e) - self.addCleanup(support.unlink, filename) + self.addCleanup(os_helper.unlink, filename) code = '\n'.join(( 'import os, time', @@ -486,16 +487,16 @@ def test_devpoll(self): class FNTLEINTRTest(EINTRBaseTest): def _lock(self, lock_func, lock_name): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) code = '\n'.join(( "import fcntl, time", - "with open('%s', 'wb') as f:" % support.TESTFN, + "with open('%s', 'wb') as f:" % os_helper.TESTFN, " fcntl.%s(f, fcntl.LOCK_EX)" % lock_name, " time.sleep(%s)" % self.sleep_time)) start_time = time.monotonic() proc = self.subprocess(code) with kill_on_error(proc): - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: while True: # synchronize the subprocess dt = time.monotonic() - start_time if dt > 60.0: diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 1d28e26dec6813..ba4ed69cc9b34b 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -38,7 +38,7 @@ from email import quoprimime from test.support import threading_helper -from test.support import unlink +from test.support.os_helper import unlink from test.test_email import openfile, TestEmailBase # These imports are documented to work, but we are testing them using a diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py index 3cf5d7beb144b3..7c3b67f3cbf6ea 100644 --- a/Lib/test/test_multibytecodec.py +++ b/Lib/test/test_multibytecodec.py @@ -4,7 +4,8 @@ # from test import support -from test.support import TESTFN +from test.support import os_helper +from test.support.os_helper import TESTFN import unittest, io, codecs, sys import _multibytecodec @@ -57,7 +58,7 @@ def test_codingspec(self): code = '# coding: {}\n'.format(enc) exec(code) finally: - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def test_init_segfault(self): # bug #3305: this used to segfault @@ -296,7 +297,7 @@ def test_bug1728403(self): finally: f.close() finally: - support.unlink(TESTFN) + os_helper.unlink(TESTFN) class Test_StreamWriter(unittest.TestCase): def test_gb18030(self): diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 65bca291d96187..1a2bbb382e8642 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -12,7 +12,7 @@ from contextlib import ExitStack from io import StringIO -from test import support +from test.support import os_helper # This little helper class is essential for testing pdb under doctest. from test.test_doctest import _FakeInput from unittest.mock import patch @@ -1188,10 +1188,10 @@ def test_pdb_issue_20766(): class PdbTestCase(unittest.TestCase): def tearDown(self): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def _run_pdb(self, pdb_args, commands): - self.addCleanup(support.rmtree, '__pycache__') + self.addCleanup(os_helper.rmtree, '__pycache__') cmd = [sys.executable, '-m', 'pdb'] + pdb_args with subprocess.Popen( cmd, @@ -1210,13 +1210,13 @@ def run_pdb_script(self, script, commands): filename = 'main.py' with open(filename, 'w') as f: f.write(textwrap.dedent(script)) - self.addCleanup(support.unlink, filename) + self.addCleanup(os_helper.unlink, filename) return self._run_pdb([filename], commands) def run_pdb_module(self, script, commands): """Runs the script code as part of a module""" self.module_name = 't_main' - support.rmtree(self.module_name) + os_helper.rmtree(self.module_name) main_file = self.module_name + '/__main__.py' init_file = self.module_name + '/__init__.py' os.mkdir(self.module_name) @@ -1224,17 +1224,17 @@ def run_pdb_module(self, script, commands): pass with open(main_file, 'w') as f: f.write(textwrap.dedent(script)) - self.addCleanup(support.rmtree, self.module_name) + self.addCleanup(os_helper.rmtree, self.module_name) return self._run_pdb(['-m', self.module_name], commands) def _assert_find_function(self, file_content, func_name, expected): - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(file_content) expected = None if not expected else ( - expected[0], support.TESTFN, expected[1]) + expected[0], os_helper.TESTFN, expected[1]) self.assertEqual( - expected, pdb.find_function(func_name, support.TESTFN)) + expected, pdb.find_function(func_name, os_helper.TESTFN)) def test_find_function_empty_file(self): self._assert_find_function(b'', 'foo', None) @@ -1284,9 +1284,9 @@ def bœr(): def test_issue7964(self): # open the file as binary so we can force \r\n newline - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(b'print("testing my pdb")\r\n') - cmd = [sys.executable, '-m', 'pdb', support.TESTFN] + cmd = [sys.executable, '-m', 'pdb', os_helper.TESTFN] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, @@ -1327,7 +1327,7 @@ def bar(): """ with open('bar.py', 'w') as f: f.write(textwrap.dedent(bar)) - self.addCleanup(support.unlink, 'bar.py') + self.addCleanup(os_helper.unlink, 'bar.py') stdout, stderr = self.run_pdb_script(script, commands) self.assertTrue( any('main.py(5)foo()->None' in l for l in stdout.splitlines()), @@ -1337,7 +1337,7 @@ def test_issue13120(self): # Invoking "continue" on a non-main thread triggered an exception # inside signal.signal. - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(textwrap.dedent(""" import threading import pdb @@ -1349,7 +1349,7 @@ def start_pdb(): t = threading.Thread(target=start_pdb) t.start()""").encode('ascii')) - cmd = [sys.executable, '-u', support.TESTFN] + cmd = [sys.executable, '-u', os_helper.TESTFN] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, @@ -1363,7 +1363,7 @@ def start_pdb(): def test_issue36250(self): - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(textwrap.dedent(""" import threading import pdb @@ -1379,7 +1379,7 @@ def start_pdb(): pdb.Pdb(readrc=False).set_trace() evt.set() t.join()""").encode('ascii')) - cmd = [sys.executable, '-u', support.TESTFN] + cmd = [sys.executable, '-u', os_helper.TESTFN] proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE, @@ -1412,7 +1412,7 @@ def test_readrc_kwarg(self): save_home = os.environ.pop('HOME', None) try: - with support.temp_cwd(): + with os_helper.temp_cwd(): with open('.pdbrc', 'w') as f: f.write("invalid\n") @@ -1437,7 +1437,7 @@ def test_readrc_kwarg(self): def test_readrc_homedir(self): save_home = os.environ.pop("HOME", None) - with support.temp_dir() as temp_dir, patch("os.path.expanduser"): + with os_helper.temp_dir() as temp_dir, patch("os.path.expanduser"): rc_path = os.path.join(temp_dir, ".pdbrc") os.path.expanduser.return_value = rc_path try: @@ -1506,12 +1506,12 @@ def test_run_pdb_with_pdb(self): def test_module_without_a_main(self): module_name = 't_main' - support.rmtree(module_name) + os_helper.rmtree(module_name) init_file = module_name + '/__init__.py' os.mkdir(module_name) with open(init_file, 'w') as f: pass - self.addCleanup(support.rmtree, module_name) + self.addCleanup(os_helper.rmtree, module_name) stdout, stderr = self._run_pdb(['-m', module_name], "") self.assertIn("ImportError: No module named t_main.__main__", stdout.splitlines()) @@ -1531,11 +1531,11 @@ def test_blocks_at_first_code_line(self): def test_relative_imports(self): self.module_name = 't_main' - support.rmtree(self.module_name) + os_helper.rmtree(self.module_name) main_file = self.module_name + '/__main__.py' init_file = self.module_name + '/__init__.py' module_file = self.module_name + '/module.py' - self.addCleanup(support.rmtree, self.module_name) + self.addCleanup(os_helper.rmtree, self.module_name) os.mkdir(self.module_name) with open(init_file, 'w') as f: f.write(textwrap.dedent(""" @@ -1569,11 +1569,11 @@ def test_relative_imports(self): def test_relative_imports_on_plain_module(self): # Validates running a plain module. See bpo32691 self.module_name = 't_main' - support.rmtree(self.module_name) + os_helper.rmtree(self.module_name) main_file = self.module_name + '/runme.py' init_file = self.module_name + '/__init__.py' module_file = self.module_name + '/module.py' - self.addCleanup(support.rmtree, self.module_name) + self.addCleanup(os_helper.rmtree, self.module_name) os.mkdir(self.module_name) with open(init_file, 'w') as f: f.write(textwrap.dedent(""" diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index e568cc45755495..ebb43c30b4d505 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -8,9 +8,9 @@ import unittest import hashlib -from test import support from test.support import hashlib_helper from test.support import threading_helper +from test.support import warnings_helper try: import ssl @@ -567,7 +567,7 @@ def test_https(self): def test_https_with_cafile(self): handler = self.start_https_server(certfile=CERT_localhost) - with support.check_warnings(('', DeprecationWarning)): + with warnings_helper.check_warnings(('', DeprecationWarning)): # Good cert data = self.urlopen("https://localhost:%s/bizarre" % handler.port, cafile=CERT_localhost) @@ -585,7 +585,7 @@ def test_https_with_cafile(self): def test_https_with_cadefault(self): handler = self.start_https_server(certfile=CERT_localhost) # Self-signed cert should fail verification with system certificate store - with support.check_warnings(('', DeprecationWarning)): + with warnings_helper.check_warnings(('', DeprecationWarning)): with self.assertRaises(urllib.error.URLError) as cm: self.urlopen("https://localhost:%s/bizarre" % handler.port, cadefault=True) diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index dcc0ea89b5a85c..04f7560ecc09c1 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -7,14 +7,20 @@ import textwrap import unittest from test import support +from test.support import import_helper +from test.support import os_helper +from test.support import warnings_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.test_warnings.data import stacklevel as warning_tests import warnings as original_warnings -py_warnings = support.import_fresh_module('warnings', blocked=['_warnings']) -c_warnings = support.import_fresh_module('warnings', fresh=['_warnings']) + +py_warnings = import_helper.import_fresh_module('warnings', + blocked=['_warnings']) +c_warnings = import_helper.import_fresh_module('warnings', + fresh=['_warnings']) Py_DEBUG = hasattr(sys, 'gettotalrefcount') @@ -440,7 +446,7 @@ def test_stacklevel(self): def test_stacklevel_import(self): # Issue #24305: With stacklevel=2, module-level warnings should work. - support.unload('test.test_warnings.data.import_warning') + import_helper.unload('test.test_warnings.data.import_warning') with warnings_state(self.module): with original_warnings.catch_warnings(record=True, module=self.module) as w: @@ -543,7 +549,7 @@ class CWarnTests(WarnTests, unittest.TestCase): module = c_warnings # As an early adopter, we sanity check the - # test.support.import_fresh_module utility function + # test.import_helper.import_fresh_module utility function def test_accelerated(self): self.assertIsNot(original_warnings, self.module) self.assertFalse(hasattr(self.module.warn, '__code__')) @@ -552,7 +558,7 @@ class PyWarnTests(WarnTests, unittest.TestCase): module = py_warnings # As an early adopter, we sanity check the - # test.support.import_fresh_module utility function + # test.import_helper.import_fresh_module utility function def test_pure_python(self): self.assertIsNot(original_warnings, self.module) self.assertTrue(hasattr(self.module.warn, '__code__')) @@ -927,9 +933,9 @@ class PyWarningsDisplayTests(WarningsDisplayTests, unittest.TestCase): module = py_warnings def test_tracemalloc(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) - with open(support.TESTFN, 'w') as fp: + with open(os_helper.TESTFN, 'w') as fp: fp.write(textwrap.dedent(""" def func(): f = open(__file__) @@ -949,8 +955,8 @@ def run(*args): return stderr # tracemalloc disabled - filename = os.path.abspath(support.TESTFN) - stderr = run('-Wd', support.TESTFN) + filename = os.path.abspath(os_helper.TESTFN) + stderr = run('-Wd', os_helper.TESTFN) expected = textwrap.dedent(f''' {filename}:5: ResourceWarning: unclosed file <...> f = None @@ -959,7 +965,7 @@ def run(*args): self.assertEqual(stderr, expected) # tracemalloc enabled - stderr = run('-Wd', '-X', 'tracemalloc=2', support.TESTFN) + stderr = run('-Wd', '-X', 'tracemalloc=2', os_helper.TESTFN) expected = textwrap.dedent(f''' {filename}:5: ResourceWarning: unclosed file <...> f = None @@ -1093,7 +1099,7 @@ def test_check_warnings(self): wmod = self.module if wmod is not sys.modules['warnings']: self.skipTest('module to test is not loaded warnings module') - with support.check_warnings(quiet=False) as w: + with warnings_helper.check_warnings(quiet=False) as w: self.assertEqual(w.warnings, []) wmod.simplefilter("always") wmod.warn("foo") @@ -1105,18 +1111,18 @@ def test_check_warnings(self): w.reset() self.assertEqual(w.warnings, []) - with support.check_warnings(): + with warnings_helper.check_warnings(): # defaults to quiet=True without argument pass - with support.check_warnings(('foo', UserWarning)): + with warnings_helper.check_warnings(('foo', UserWarning)): wmod.warn("foo") with self.assertRaises(AssertionError): - with support.check_warnings(('', RuntimeWarning)): + with warnings_helper.check_warnings(('', RuntimeWarning)): # defaults to quiet=False with argument pass with self.assertRaises(AssertionError): - with support.check_warnings(('foo', RuntimeWarning)): + with warnings_helper.check_warnings(('foo', RuntimeWarning)): wmod.warn("foo") class CCatchWarningTests(CatchWarningTests, unittest.TestCase): @@ -1198,7 +1204,7 @@ def test_default_filter_configuration(self): @unittest.skipUnless(sys.getfilesystemencoding() != 'ascii', 'requires non-ascii filesystemencoding') def test_nonascii(self): - PYTHONWARNINGS="ignore:DeprecationWarning" + support.FS_NONASCII + PYTHONWARNINGS="ignore:DeprecationWarning" + os_helper.FS_NONASCII rc, stdout, stderr = assert_python_ok("-c", "import sys; sys.stdout.write(str(sys.warnoptions))", PYTHONIOENCODING="utf-8", @@ -1218,7 +1224,7 @@ def test_issue_8766(self): # "import encodings" emits a warning whereas the warnings is not loaded # or not completely loaded (warnings imports indirectly encodings by # importing linecache) yet - with support.temp_cwd() as cwd, support.temp_cwd('encodings'): + with os_helper.temp_cwd() as cwd, os_helper.temp_cwd('encodings'): # encodings loaded by initfsencoding() assert_python_ok('-c', 'pass', PYTHONPATH=cwd) From 4e872d0c1e2ce2e93bd1df4edb5addb87d80db49 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 4 Aug 2020 23:53:12 +0800 Subject: [PATCH 121/197] bpo-40275: Use new test.support helper submodules in tests (GH-21727) --- Lib/test/test_importlib/fixtures.py | 4 ++-- .../test_importlib/import_/test_packages.py | 3 ++- .../test_importlib/source/test_file_loader.py | 2 +- Lib/test/test_importlib/source/test_finder.py | 2 +- Lib/test/test_importlib/test_abc.py | 5 +++-- Lib/test/test_importlib/test_api.py | 18 ++++++++++-------- Lib/test/test_importlib/test_pkg_import.py | 2 +- Lib/test/test_importlib/test_spec.py | 2 +- .../test_importlib/test_threaded_import.py | 6 +++--- Lib/test/test_importlib/test_windows.py | 3 ++- Lib/test/test_importlib/util.py | 11 ++++++----- Lib/test/test_inspect.py | 4 +++- Lib/test/test_site.py | 4 ++-- Lib/test/test_tools/test_fixcid.py | 15 ++++++++------- Lib/test/test_tools/test_i18n.py | 2 +- Lib/test/test_tools/test_lll.py | 3 ++- Lib/test/test_tools/test_pathfix.py | 9 +++++---- Lib/test/test_tools/test_pindent.py | 3 ++- Lib/test/test_tools/test_sundry.py | 6 +++--- 19 files changed, 58 insertions(+), 46 deletions(-) diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index 2e55d14b9aab97..985277f64615fe 100644 --- a/Lib/test/test_importlib/fixtures.py +++ b/Lib/test/test_importlib/fixtures.py @@ -213,11 +213,11 @@ def build_files(file_defs, prefix=pathlib.Path()): class FileBuilder: def unicode_filename(self): try: - import test.support + from test.support import os_helper except ImportError: # outside CPython, hard-code a unicode snowman return '☃' - return test.support.FS_NONASCII or \ + return os_helper.FS_NONASCII or \ self.skip("File system does not support non-ascii.") diff --git a/Lib/test/test_importlib/import_/test_packages.py b/Lib/test/test_importlib/import_/test_packages.py index 24396044a5bcf1..c73ac63f6eef3d 100644 --- a/Lib/test/test_importlib/import_/test_packages.py +++ b/Lib/test/test_importlib/import_/test_packages.py @@ -2,6 +2,7 @@ import sys import unittest from test import support +from test.support import import_helper class ParentModuleTests: @@ -98,7 +99,7 @@ def module_injection(): try: submodule = self.__import__(subname) finally: - support.unload(subname) + import_helper.unload(subname) (Frozen_ParentTests, diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py index ab44722146e37a..cbd1533b676644 100644 --- a/Lib/test/test_importlib/source/test_file_loader.py +++ b/Lib/test/test_importlib/source/test_file_loader.py @@ -17,7 +17,7 @@ import unittest import warnings -from test.support import make_legacy_pyc, unload +from test.support.import_helper import make_legacy_pyc, unload from test.test_py_compile import without_source_date_epoch from test.test_py_compile import SourceDateEpochTestMeta diff --git a/Lib/test/test_importlib/source/test_finder.py b/Lib/test/test_importlib/source/test_finder.py index f372b850dc7c15..e9207deedc75c8 100644 --- a/Lib/test/test_importlib/source/test_finder.py +++ b/Lib/test/test_importlib/source/test_finder.py @@ -9,7 +9,7 @@ import stat import sys import tempfile -from test.support import make_legacy_pyc +from test.support.import_helper import make_legacy_pyc import unittest import warnings diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index 9816b35ef829a7..605738fae2e378 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -3,6 +3,7 @@ import os import sys from test import support +from test.support import import_helper import types import unittest from unittest import mock @@ -579,8 +580,8 @@ class InspectLoaderLoadModuleTests: module_name = 'blah' def setUp(self): - support.unload(self.module_name) - self.addCleanup(support.unload, self.module_name) + import_helper.unload(self.module_name) + self.addCleanup(import_helper.unload, self.module_name) def load(self, loader): spec = self.util.spec_from_loader(self.module_name, loader) diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index 0fb1346f9eec8f..fd60634e093339 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -7,6 +7,8 @@ import os.path import sys from test import support +from test.support import import_helper +from test.support import os_helper import types import unittest import warnings @@ -200,7 +202,7 @@ class ReloadTests: def test_reload_modules(self): for mod in ('tokenize', 'time', 'marshal'): with self.subTest(module=mod): - with support.CleanImport(mod): + with import_helper.CleanImport(mod): module = self.init.import_module(mod) self.init.reload(module) @@ -221,7 +223,7 @@ def code(): self.assertEqual(reloaded.spam, 3) def test_reload_missing_loader(self): - with support.CleanImport('types'): + with import_helper.CleanImport('types'): import types loader = types.__loader__ del types.__loader__ @@ -232,7 +234,7 @@ def test_reload_missing_loader(self): self.assertEqual(reloaded.__loader__.path, loader.path) def test_reload_loader_replaced(self): - with support.CleanImport('types'): + with import_helper.CleanImport('types'): import types types.__loader__ = None self.init.invalidate_caches() @@ -244,9 +246,9 @@ def test_reload_loader_replaced(self): def test_reload_location_changed(self): name = 'spam' - with support.temp_cwd(None) as cwd: + with os_helper.temp_cwd(None) as cwd: with test_util.uncache('spam'): - with support.DirsOnSysPath(cwd): + with import_helper.DirsOnSysPath(cwd): # Start as a plain module. self.init.invalidate_caches() path = os.path.join(cwd, name + '.py') @@ -257,7 +259,7 @@ def test_reload_location_changed(self): '__cached__': cached, '__doc__': None, } - support.create_empty_file(path) + os_helper.create_empty_file(path) module = self.init.import_module(name) ns = vars(module).copy() loader = ns.pop('__loader__') @@ -295,9 +297,9 @@ def test_reload_location_changed(self): def test_reload_namespace_changed(self): name = 'spam' - with support.temp_cwd(None) as cwd: + with os_helper.temp_cwd(None) as cwd: with test_util.uncache('spam'): - with support.DirsOnSysPath(cwd): + with import_helper.DirsOnSysPath(cwd): # Start as a namespace package. self.init.invalidate_caches() bad_path = os.path.join(cwd, name, '__init.py') diff --git a/Lib/test/test_importlib/test_pkg_import.py b/Lib/test/test_importlib/test_pkg_import.py index 6181dcfab280cf..36e78afa10bfc4 100644 --- a/Lib/test/test_importlib/test_pkg_import.py +++ b/Lib/test/test_importlib/test_pkg_import.py @@ -7,7 +7,7 @@ import unittest from importlib.util import cache_from_source -from test.support import create_empty_file +from test.support.os_helper import create_empty_file class TestImport(unittest.TestCase): diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index 20dacec8664e1d..eed90f29f9286c 100644 --- a/Lib/test/test_importlib/test_spec.py +++ b/Lib/test/test_importlib/test_spec.py @@ -6,7 +6,7 @@ import os.path import pathlib -from test.support import CleanImport +from test.support.import_helper import CleanImport import unittest import sys import warnings diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index 06da18ed396d98..c6a6e1715abade 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -14,9 +14,9 @@ import threading import unittest from unittest import mock -from test.support import ( - verbose, run_unittest, TESTFN, - forget, unlink, rmtree) +from test.support import (verbose, run_unittest) +from test.support.import_helper import forget +from test.support.os_helper import (TESTFN, unlink, rmtree) from test.support import threading_helper def task(N, done, done_tasks, errors): diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py index 005b685cc03cd9..8b3f2009a850da 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -6,11 +6,12 @@ import sys import unittest from test import support +from test.support import import_helper from distutils.util import get_platform from contextlib import contextmanager from .util import temp_module -support.import_module('winreg', required_on=['win']) +import_helper.import_module('winreg', required_on=['win']) from winreg import ( CreateKey, HKEY_CURRENT_USER, SetValue, REG_SZ, KEY_ALL_ACCESS, diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py index 2745c9b7e3c3bf..5c0375e04a6ffb 100644 --- a/Lib/test/test_importlib/util.py +++ b/Lib/test/test_importlib/util.py @@ -13,6 +13,7 @@ from pathlib import Path, PurePath from test import support from test.support import import_helper +from test.support import os_helper import unittest import sys import tempfile @@ -159,9 +160,9 @@ def uncache(*names): @contextlib.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 os_helper.temp_cwd(None) as cwd: with uncache(name, *conflicts): - with support.DirsOnSysPath(cwd): + with import_helper.DirsOnSysPath(cwd): invalidate_caches() location = os.path.join(cwd, name) @@ -397,7 +398,7 @@ def create_modules(*names): state_manager.__exit__(None, None, None) if uncache_manager is not None: uncache_manager.__exit__(None, None, None) - support.rmtree(temp_dir) + os_helper.rmtree(temp_dir) def mock_path_hook(*entries, importer): @@ -573,8 +574,8 @@ def tearDownClass(cls): pass def setUp(self): - modules = support.modules_setup() - self.addCleanup(support.modules_cleanup, *modules) + modules = import_helper.modules_setup() + self.addCleanup(import_helper.modules_cleanup, *modules) class ZipSetup(ZipSetupBase): diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index e3e2be52076c6a..6667dc91edbcec 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -24,8 +24,10 @@ except ImportError: ThreadPoolExecutor = None -from test.support import run_unittest, TESTFN, DirsOnSysPath, cpython_only +from test.support import run_unittest, cpython_only from test.support import MISSING_C_DOCSTRINGS, ALWAYS_EQ +from test.support.import_helper import DirsOnSysPath +from test.support.os_helper import TESTFN from test.support.script_helper import assert_python_ok, assert_python_failure from test import inspect_fodder as mod from test import inspect_fodder2 as mod2 diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index ec86c645981b36..5901939725e185 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -8,8 +8,8 @@ import test.support from test import support from test.support import socket_helper -from test.support import (captured_stderr, TESTFN, EnvironmentVarGuard, - change_cwd) +from test.support import captured_stderr +from test.support.os_helper import TESTFN, EnvironmentVarGuard, change_cwd import builtins import encodings import glob diff --git a/Lib/test/test_tools/test_fixcid.py b/Lib/test/test_tools/test_fixcid.py index bce029b1aac83a..3df13680437194 100644 --- a/Lib/test/test_tools/test_fixcid.py +++ b/Lib/test/test_tools/test_fixcid.py @@ -5,6 +5,7 @@ import runpy import sys from test import support +from test.support import os_helper from test.test_tools import skip_if_missing, scriptsdir import unittest @@ -57,15 +58,15 @@ def test_alter_comments(self): ) def test_directory(self): - os.mkdir(support.TESTFN) - self.addCleanup(support.rmtree, support.TESTFN) - c_filename = os.path.join(support.TESTFN, "file.c") + os.mkdir(os_helper.TESTFN) + self.addCleanup(os_helper.rmtree, os_helper.TESTFN) + c_filename = os.path.join(os_helper.TESTFN, "file.c") with open(c_filename, "w") as file: file.write("int xx;\n") - with open(os.path.join(support.TESTFN, "file.py"), "w") as file: + with open(os.path.join(os_helper.TESTFN, "file.py"), "w") as file: file.write("xx = 'unaltered'\n") script = os.path.join(scriptsdir, "fixcid.py") - output = self.run_script(args=(support.TESTFN,)) + output = self.run_script(args=(os_helper.TESTFN,)) self.assertMultiLineEqual(output, "{}:\n" "1\n" @@ -74,10 +75,10 @@ def test_directory(self): ) def run_script(self, input="", *, args=("-",), substfile="xx yy\n"): - substfilename = support.TESTFN + ".subst" + substfilename = os_helper.TESTFN + ".subst" with open(substfilename, "w") as file: file.write(substfile) - self.addCleanup(support.unlink, substfilename) + self.addCleanup(os_helper.unlink, substfilename) argv = ["fixcid.py", "-s", substfilename] + list(args) script = os.path.join(scriptsdir, "fixcid.py") diff --git a/Lib/test/test_tools/test_i18n.py b/Lib/test/test_tools/test_i18n.py index 42e20f8f7716db..8da657907eab87 100644 --- a/Lib/test/test_tools/test_i18n.py +++ b/Lib/test/test_tools/test_i18n.py @@ -7,7 +7,7 @@ from test.support.script_helper import assert_python_ok from test.test_tools import skip_if_missing, toolsdir -from test.support import temp_cwd, temp_dir +from test.support.os_helper import temp_cwd, temp_dir skip_if_missing() diff --git a/Lib/test/test_tools/test_lll.py b/Lib/test/test_tools/test_lll.py index 568cbfb5e47460..ec0c97334fdebd 100644 --- a/Lib/test/test_tools/test_lll.py +++ b/Lib/test/test_tools/test_lll.py @@ -3,6 +3,7 @@ import os import tempfile from test import support +from test.support import os_helper from test.test_tools import skip_if_missing, import_tool import unittest @@ -14,7 +15,7 @@ class lllTests(unittest.TestCase): def setUp(self): self.lll = import_tool('lll') - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_lll_multiple_dirs(self): with tempfile.TemporaryDirectory() as dir1, \ tempfile.TemporaryDirectory() as dir2: diff --git a/Lib/test/test_tools/test_pathfix.py b/Lib/test/test_tools/test_pathfix.py index 03ed29d3f974f2..ff61935298b920 100644 --- a/Lib/test/test_tools/test_pathfix.py +++ b/Lib/test/test_tools/test_pathfix.py @@ -3,6 +3,7 @@ import sys import unittest from test import support +from test.support import os_helper from test.test_tools import scriptsdir, skip_if_missing @@ -14,7 +15,7 @@ class TestPathfixFunctional(unittest.TestCase): script = os.path.join(scriptsdir, 'pathfix.py') def setUp(self): - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) def pathfix(self, shebang, pathfix_flags, exitcode=0, stdout='', stderr='', directory=''): @@ -24,7 +25,7 @@ def pathfix(self, shebang, pathfix_flags, exitcode=0, stdout='', stderr='', filename = os.path.join(directory, 'script-A_1.py') pathfix_arg = directory else: - filename = support.TESTFN + filename = os_helper.TESTFN pathfix_arg = filename with open(filename, 'w', encoding='utf8') as f: @@ -56,8 +57,8 @@ def pathfix(self, shebang, pathfix_flags, exitcode=0, stdout='', stderr='', return new_shebang def test_recursive(self): - tmpdir = support.TESTFN + '.d' - self.addCleanup(support.rmtree, tmpdir) + tmpdir = os_helper.TESTFN + '.d' + self.addCleanup(os_helper.rmtree, tmpdir) os.mkdir(tmpdir) expected_stderr = f"recursedown('{os.path.basename(tmpdir)}')\n" self.assertEqual( diff --git a/Lib/test/test_tools/test_pindent.py b/Lib/test/test_tools/test_pindent.py index e293bc872ce51e..e7a547ad7d6127 100644 --- a/Lib/test/test_tools/test_pindent.py +++ b/Lib/test/test_tools/test_pindent.py @@ -6,6 +6,7 @@ import subprocess import textwrap from test import support +from test.support import os_helper from test.support.script_helper import assert_python_ok from test.test_tools import scriptsdir, skip_if_missing @@ -34,7 +35,7 @@ def lstriplines(self, data): def test_selftest(self): self.maxDiff = None - with support.temp_dir() as directory: + with os_helper.temp_dir() as directory: data_path = os.path.join(directory, '_test.py') with open(self.script) as f: closed = f.read() diff --git a/Lib/test/test_tools/test_sundry.py b/Lib/test/test_tools/test_sundry.py index 10eb6941b3be6f..8b5a963e25bd15 100644 --- a/Lib/test/test_tools/test_sundry.py +++ b/Lib/test/test_tools/test_sundry.py @@ -8,7 +8,7 @@ import os import sys import unittest -from test import support +from test.support import import_helper from test.test_tools import scriptsdir, import_tool, skip_if_missing @@ -30,7 +30,7 @@ class TestSundryScripts(unittest.TestCase): skiplist = blacklist + whitelist + windows_only + other def test_sundry(self): - old_modules = support.modules_setup() + old_modules = import_helper.modules_setup() try: for fn in os.listdir(scriptsdir): if not fn.endswith('.py'): @@ -43,7 +43,7 @@ def test_sundry(self): import_tool(name) finally: # Unload all modules loaded in this test - support.modules_cleanup(*old_modules) + import_helper.modules_cleanup(*old_modules) @unittest.skipIf(sys.platform != "win32", "Windows-only test") def test_sundry_windows(self): From fdaafe03e3b9b06db016055427e074d58cc96621 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Tue, 4 Aug 2020 17:30:11 +0100 Subject: [PATCH 122/197] bpo-41463: Generate information about jumps from 'opcode.py' rather than duplicating it in 'compile.c' (GH-21714) Generate information about jumps from 'opcode.py' rather than duplicate it in 'compile.c' --- Include/opcode.h | 22 +++++ Python/compile.c | 132 ++++++++++++++++------------- Tools/scripts/generate_opcode_h.py | 19 +++++ 3 files changed, 114 insertions(+), 59 deletions(-) diff --git a/Include/opcode.h b/Include/opcode.h index 19944fac0b9f2b..420c87aa0f24f3 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -127,6 +127,28 @@ extern "C" { #define SET_UPDATE 163 #define DICT_MERGE 164 #define DICT_UPDATE 165 +#ifdef NEED_OPCODE_JUMP_TABLES +static uint32_t _PyOpcode_RelativeJump[8] = { + 0U, + 0U, + 536870912U, + 67125248U, + 67141632U, + 0U, + 0U, + 0U, +}; +static uint32_t _PyOpcode_Jump[8] = { + 0U, + 0U, + 536870912U, + 101695488U, + 67141632U, + 0U, + 0U, + 0U, +}; +#endif /* OPCODE_TABLES */ /* 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/Python/compile.c b/Python/compile.c index 42b09fd96dfbb9..5dbd9f221fdf14 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -27,6 +27,7 @@ #include "ast.h" #include "code.h" #include "symtable.h" +#define NEED_OPCODE_JUMP_TABLES #include "opcode.h" #include "wordcode_helpers.h" @@ -45,14 +46,38 @@ && (c->u->u_ste->ste_type == ModuleBlock)) struct instr { - unsigned i_jabs : 1; - unsigned i_jrel : 1; unsigned char i_opcode; int i_oparg; struct basicblock_ *i_target; /* target block (if jump instruction) */ int i_lineno; }; +#define LOG_BITS_PER_INT 5 +#define MASK_LOW_LOG_BITS 31 + +static inline int +is_bit_set_in_table(uint32_t *table, int bitindex) { + /* Is the relevant bit set in the relevant word? */ + /* 256 bits fit into 8 32-bits words. + * Word is indexed by (bitindex>>ln(size of int in bits)). + * Bit within word is the low bits of bitindex. + */ + uint32_t word = table[bitindex >> LOG_BITS_PER_INT]; + return (word >> (bitindex & MASK_LOW_LOG_BITS)) & 1; +} + +static inline int +is_relative_jump(struct instr *i) +{ + return is_bit_set_in_table(_PyOpcode_RelativeJump, i->i_opcode); +} + +static inline int +is_jump(struct instr *i) +{ + return is_bit_set_in_table(_PyOpcode_Jump, i->i_opcode); +} + typedef struct basicblock_ { /* Each basicblock in a compilation unit is linked via b_list in the reverse order that the block are allocated. b_list points to the next @@ -182,7 +207,7 @@ static basicblock *compiler_new_block(struct compiler *); static int compiler_next_instr(basicblock *); static int compiler_addop(struct compiler *, int); static int compiler_addop_i(struct compiler *, int, Py_ssize_t); -static int compiler_addop_j(struct compiler *, int, basicblock *, int); +static int compiler_addop_j(struct compiler *, int, basicblock *); static int compiler_error(struct compiler *, const char *); static int compiler_warn(struct compiler *, const char *, ...); static int compiler_nameop(struct compiler *, identifier, expr_context_ty); @@ -1381,7 +1406,7 @@ compiler_addop_i(struct compiler *c, int opcode, Py_ssize_t oparg) } static int -compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) +compiler_addop_j(struct compiler *c, int opcode, basicblock *b) { struct instr *i; int off; @@ -1398,10 +1423,6 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) i = &c->u->u_curblock->b_instr[off]; i->i_opcode = opcode; i->i_target = b; - if (absolute) - i->i_jabs = 1; - else - i->i_jrel = 1; i->i_lineno = c->u->u_lineno; return 1; } @@ -1471,17 +1492,11 @@ compiler_addop_j(struct compiler *c, int opcode, basicblock *b, int absolute) return 0; \ } -#define ADDOP_JABS(C, OP, O) { \ - if (!compiler_addop_j((C), (OP), (O), 1)) \ +#define ADDOP_JUMP(C, OP, O) { \ + if (!compiler_addop_j((C), (OP), (O))) \ return 0; \ } -#define ADDOP_JREL(C, OP, O) { \ - if (!compiler_addop_j((C), (OP), (O), 0)) \ - return 0; \ -} - - #define ADDOP_COMPARE(C, CMP) { \ if (!compiler_addcompare((C), (cmpop_ty)(CMP))) \ return 0; \ @@ -2545,7 +2560,7 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond) return 0; if (!compiler_jump_if(c, e->v.IfExp.body, next, cond)) return 0; - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); compiler_use_next_block(c, next2); if (!compiler_jump_if(c, e->v.IfExp.orelse, next, cond)) return 0; @@ -2568,20 +2583,20 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond) ADDOP(c, DUP_TOP); ADDOP(c, ROT_THREE); ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, i)); - ADDOP_JABS(c, POP_JUMP_IF_FALSE, cleanup); + ADDOP_JUMP(c, POP_JUMP_IF_FALSE, cleanup); NEXT_BLOCK(c); } VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n)); ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, n)); - ADDOP_JABS(c, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE, next); + ADDOP_JUMP(c, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE, next); basicblock *end = compiler_new_block(c); if (end == NULL) return 0; - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); compiler_use_next_block(c, cleanup); ADDOP(c, POP_TOP); if (!cond) { - ADDOP_JREL(c, JUMP_FORWARD, next); + ADDOP_JUMP(c, JUMP_FORWARD, next); } compiler_use_next_block(c, end); return 1; @@ -2596,7 +2611,7 @@ compiler_jump_if(struct compiler *c, expr_ty e, basicblock *next, int cond) /* general implementation */ VISIT(c, expr, e); - ADDOP_JABS(c, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE, next); + ADDOP_JUMP(c, cond ? POP_JUMP_IF_TRUE : POP_JUMP_IF_FALSE, next); return 1; } @@ -2615,7 +2630,7 @@ compiler_ifexp(struct compiler *c, expr_ty e) if (!compiler_jump_if(c, e->v.IfExp.test, next, 0)) return 0; VISIT(c, expr, e->v.IfExp.body); - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); compiler_use_next_block(c, next); VISIT(c, expr, e->v.IfExp.orelse); compiler_use_next_block(c, end); @@ -2721,7 +2736,7 @@ compiler_if(struct compiler *c, stmt_ty s) } VISIT_SEQ(c, stmt, s->v.If.body); if (asdl_seq_LEN(s->v.If.orelse)) { - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); compiler_use_next_block(c, next); VISIT_SEQ(c, stmt, s->v.If.orelse); } @@ -2747,10 +2762,10 @@ compiler_for(struct compiler *c, stmt_ty s) VISIT(c, expr, s->v.For.iter); ADDOP(c, GET_ITER); compiler_use_next_block(c, start); - ADDOP_JREL(c, FOR_ITER, cleanup); + ADDOP_JUMP(c, FOR_ITER, cleanup); VISIT(c, expr, s->v.For.target); VISIT_SEQ(c, stmt, s->v.For.body); - ADDOP_JABS(c, JUMP_ABSOLUTE, start); + ADDOP_JUMP(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, cleanup); compiler_pop_fblock(c, FOR_LOOP, start); @@ -2786,7 +2801,7 @@ compiler_async_for(struct compiler *c, stmt_ty s) return 0; } /* SETUP_FINALLY to guard the __anext__ call */ - ADDOP_JREL(c, SETUP_FINALLY, except); + ADDOP_JUMP(c, SETUP_FINALLY, except); ADDOP(c, GET_ANEXT); ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); @@ -2795,7 +2810,7 @@ compiler_async_for(struct compiler *c, stmt_ty s) /* Success block for __anext__ */ VISIT(c, expr, s->v.AsyncFor.target); VISIT_SEQ(c, stmt, s->v.AsyncFor.body); - ADDOP_JABS(c, JUMP_ABSOLUTE, start); + ADDOP_JUMP(c, JUMP_ABSOLUTE, start); compiler_pop_fblock(c, FOR_LOOP, start); @@ -2859,7 +2874,7 @@ compiler_while(struct compiler *c, stmt_ty s) return 0; } VISIT_SEQ(c, stmt, s->v.While.body); - ADDOP_JABS(c, JUMP_ABSOLUTE, loop); + ADDOP_JUMP(c, JUMP_ABSOLUTE, loop); /* XXX should the two POP instructions be in a separate block if there is no else clause ? @@ -2918,7 +2933,7 @@ compiler_break(struct compiler *c) if (!compiler_unwind_fblock(c, loop, 0)) { return 0; } - ADDOP_JABS(c, JUMP_ABSOLUTE, loop->fb_exit); + ADDOP_JUMP(c, JUMP_ABSOLUTE, loop->fb_exit); return 1; } @@ -2932,7 +2947,7 @@ compiler_continue(struct compiler *c) if (loop == NULL) { return compiler_error(c, "'continue' not properly in loop"); } - ADDOP_JABS(c, JUMP_ABSOLUTE, loop->fb_block); + ADDOP_JUMP(c, JUMP_ABSOLUTE, loop->fb_block); return 1; } @@ -2978,7 +2993,7 @@ compiler_try_finally(struct compiler *c, stmt_ty s) return 0; /* `try` block */ - ADDOP_JREL(c, SETUP_FINALLY, end); + ADDOP_JUMP(c, SETUP_FINALLY, end); compiler_use_next_block(c, body); if (!compiler_push_fblock(c, FINALLY_TRY, body, end, s->v.Try.finalbody)) return 0; @@ -2992,7 +3007,7 @@ compiler_try_finally(struct compiler *c, stmt_ty s) ADDOP(c, POP_BLOCK); compiler_pop_fblock(c, FINALLY_TRY, body); VISIT_SEQ(c, stmt, s->v.Try.finalbody); - ADDOP_JREL(c, JUMP_FORWARD, exit); + ADDOP_JUMP(c, JUMP_FORWARD, exit); /* `finally` block */ compiler_use_next_block(c, end); if (!compiler_push_fblock(c, FINALLY_END, end, NULL, NULL)) @@ -3046,14 +3061,14 @@ compiler_try_except(struct compiler *c, stmt_ty s) end = compiler_new_block(c); if (body == NULL || except == NULL || orelse == NULL || end == NULL) return 0; - ADDOP_JREL(c, SETUP_FINALLY, except); + ADDOP_JUMP(c, SETUP_FINALLY, except); compiler_use_next_block(c, body); if (!compiler_push_fblock(c, EXCEPT, body, NULL, NULL)) return 0; VISIT_SEQ(c, stmt, s->v.Try.body); ADDOP(c, POP_BLOCK); compiler_pop_fblock(c, EXCEPT, body); - ADDOP_JREL(c, JUMP_FORWARD, orelse); + ADDOP_JUMP(c, JUMP_FORWARD, orelse); n = asdl_seq_LEN(s->v.Try.handlers); compiler_use_next_block(c, except); for (i = 0; i < n; i++) { @@ -3068,7 +3083,7 @@ compiler_try_except(struct compiler *c, stmt_ty s) if (handler->v.ExceptHandler.type) { ADDOP(c, DUP_TOP); VISIT(c, expr, handler->v.ExceptHandler.type); - ADDOP_JABS(c, JUMP_IF_NOT_EXC_MATCH, except); + ADDOP_JUMP(c, JUMP_IF_NOT_EXC_MATCH, except); } ADDOP(c, POP_TOP); if (handler->v.ExceptHandler.name) { @@ -3095,7 +3110,7 @@ compiler_try_except(struct compiler *c, stmt_ty s) */ /* second try: */ - ADDOP_JREL(c, SETUP_FINALLY, cleanup_end); + ADDOP_JUMP(c, SETUP_FINALLY, cleanup_end); compiler_use_next_block(c, cleanup_body); if (!compiler_push_fblock(c, HANDLER_CLEANUP, cleanup_body, NULL, handler->v.ExceptHandler.name)) return 0; @@ -3109,7 +3124,7 @@ compiler_try_except(struct compiler *c, stmt_ty s) ADDOP_LOAD_CONST(c, Py_None); compiler_nameop(c, handler->v.ExceptHandler.name, Store); compiler_nameop(c, handler->v.ExceptHandler.name, Del); - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); /* except: */ compiler_use_next_block(c, cleanup_end); @@ -3136,7 +3151,7 @@ compiler_try_except(struct compiler *c, stmt_ty s) VISIT_SEQ(c, stmt, handler->v.ExceptHandler.body); compiler_pop_fblock(c, HANDLER_CLEANUP, cleanup_body); ADDOP(c, POP_EXCEPT); - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); } compiler_use_next_block(c, except); } @@ -3645,7 +3660,7 @@ compiler_boolop(struct compiler *c, expr_ty e) assert(n >= 0); for (i = 0; i < n; ++i) { VISIT(c, expr, (expr_ty)asdl_seq_GET(s, i)); - ADDOP_JABS(c, jumpi, end); + ADDOP_JUMP(c, jumpi, end); basicblock *next = compiler_new_block(c); if (next == NULL) { return 0; @@ -3933,7 +3948,7 @@ compiler_compare(struct compiler *c, expr_ty e) ADDOP(c, DUP_TOP); ADDOP(c, ROT_THREE); ADDOP_COMPARE(c, asdl_seq_GET(e->v.Compare.ops, i)); - ADDOP_JABS(c, JUMP_IF_FALSE_OR_POP, cleanup); + ADDOP_JUMP(c, JUMP_IF_FALSE_OR_POP, cleanup); NEXT_BLOCK(c); } VISIT(c, expr, (expr_ty)asdl_seq_GET(e->v.Compare.comparators, n)); @@ -3941,7 +3956,7 @@ compiler_compare(struct compiler *c, expr_ty e) basicblock *end = compiler_new_block(c); if (end == NULL) return 0; - ADDOP_JREL(c, JUMP_FORWARD, end); + ADDOP_JUMP(c, JUMP_FORWARD, end); compiler_use_next_block(c, cleanup); ADDOP(c, ROT_TWO); ADDOP(c, POP_TOP); @@ -4435,7 +4450,7 @@ compiler_sync_comprehension_generator(struct compiler *c, if (start) { depth++; compiler_use_next_block(c, start); - ADDOP_JREL(c, FOR_ITER, anchor); + ADDOP_JUMP(c, FOR_ITER, anchor); NEXT_BLOCK(c); } VISIT(c, expr, gen->target); @@ -4487,7 +4502,7 @@ compiler_sync_comprehension_generator(struct compiler *c, } compiler_use_next_block(c, if_cleanup); if (start) { - ADDOP_JABS(c, JUMP_ABSOLUTE, start); + ADDOP_JUMP(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, anchor); } @@ -4526,7 +4541,7 @@ compiler_async_comprehension_generator(struct compiler *c, compiler_use_next_block(c, start); - ADDOP_JREL(c, SETUP_FINALLY, except); + ADDOP_JUMP(c, SETUP_FINALLY, except); ADDOP(c, GET_ANEXT); ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); @@ -4577,7 +4592,7 @@ compiler_async_comprehension_generator(struct compiler *c, } } compiler_use_next_block(c, if_cleanup); - ADDOP_JABS(c, JUMP_ABSOLUTE, start); + ADDOP_JUMP(c, JUMP_ABSOLUTE, start); compiler_use_next_block(c, except); ADDOP(c, END_ASYNC_FOR); @@ -4773,7 +4788,7 @@ compiler_with_except_finish(struct compiler *c) { exit = compiler_new_block(c); if (exit == NULL) return 0; - ADDOP_JABS(c, POP_JUMP_IF_TRUE, exit); + ADDOP_JUMP(c, POP_JUMP_IF_TRUE, exit); ADDOP(c, RERAISE); compiler_use_next_block(c, exit); ADDOP(c, POP_TOP); @@ -4835,7 +4850,7 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos) ADDOP_LOAD_CONST(c, Py_None); ADDOP(c, YIELD_FROM); - ADDOP_JREL(c, SETUP_ASYNC_WITH, final); + ADDOP_JUMP(c, SETUP_ASYNC_WITH, final); /* SETUP_ASYNC_WITH pushes a finally block. */ compiler_use_next_block(c, block); @@ -4873,7 +4888,7 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos) ADDOP(c, POP_TOP); - ADDOP_JABS(c, JUMP_ABSOLUTE, exit); + ADDOP_JUMP(c, JUMP_ABSOLUTE, exit); /* For exceptional outcome: */ compiler_use_next_block(c, final); @@ -4927,7 +4942,7 @@ compiler_with(struct compiler *c, stmt_ty s, int pos) /* Evaluate EXPR */ VISIT(c, expr, item->context_expr); /* Will push bound __exit__ */ - ADDOP_JREL(c, SETUP_WITH, final); + ADDOP_JUMP(c, SETUP_WITH, final); /* SETUP_WITH pushes a finally block. */ compiler_use_next_block(c, block); @@ -4961,7 +4976,7 @@ compiler_with(struct compiler *c, stmt_ty s, int pos) if (!compiler_call_exit_with_nones(c)) return 0; ADDOP(c, POP_TOP); - ADDOP_JREL(c, JUMP_FORWARD, exit); + ADDOP_JUMP(c, JUMP_FORWARD, exit); /* For exceptional outcome: */ compiler_use_next_block(c, final); @@ -5492,7 +5507,7 @@ stackdepth(struct compiler *c) maxdepth = new_depth; } assert(depth >= 0); /* invalid code or bug in stackdepth() */ - if (instr->i_jrel || instr->i_jabs) { + if (is_jump(instr)) { effect = stack_effect(instr->i_opcode, instr->i_oparg, 1); assert(effect != PY_INVALID_STACK_EFFECT); int target_depth = depth + effect; @@ -5730,9 +5745,9 @@ assemble_jump_offsets(struct assembler *a, struct compiler *c) the jump instruction. */ bsize += isize; - if (instr->i_jabs || instr->i_jrel) { + if (is_jump(instr)) { instr->i_oparg = instr->i_target->b_offset; - if (instr->i_jrel) { + if (is_relative_jump(instr)) { instr->i_oparg -= bsize; } instr->i_oparg *= sizeof(_Py_CODEUNIT); @@ -5946,8 +5961,8 @@ makecode(struct compiler *c, struct assembler *a, PyObject *consts) static void dump_instr(const struct instr *i) { - const char *jrel = i->i_jrel ? "jrel " : ""; - const char *jabs = i->i_jabs ? "jabs " : ""; + const char *jrel = (is_relative_jump(instr)) ? "jrel " : ""; + const char *jabs = (is_jump(instr) && !is_relative_jump(instr))? "jabs " : ""; char arg[128]; *arg = '\0'; @@ -6122,7 +6137,7 @@ optimize_basic_block(basicblock *bb, PyObject *consts) struct instr *inst = &bb->b_instr[i]; int oparg = inst->i_oparg; int nextop = i+1 < bb->b_iused ? bb->b_instr[i+1].i_opcode : 0; - if (inst->i_jabs || inst->i_jrel) { + if (is_jump(inst)) { /* Skip over empty basic blocks. */ while (inst->i_target->b_iused == 0) { inst->i_target = inst->i_target->b_next; @@ -6148,7 +6163,6 @@ optimize_basic_block(basicblock *bb, PyObject *consts) if (is_true == 1) { inst->i_opcode = NOP; bb->b_instr[i+1].i_opcode = NOP; - bb->b_instr[i+1].i_jabs = 0; } break; @@ -6318,7 +6332,7 @@ mark_reachable(struct assembler *a) { } for (int i = 0; i < b->b_iused; i++) { basicblock *target; - if (b->b_instr[i].i_jrel || b->b_instr[i].i_jabs) { + if (is_jump(&b->b_instr[i])) { target = b->b_instr[i].i_target; if (target->b_reachable == 0) { target->b_reachable = 1; diff --git a/Tools/scripts/generate_opcode_h.py b/Tools/scripts/generate_opcode_h.py index 873f82156e217b..cba13b24213906 100644 --- a/Tools/scripts/generate_opcode_h.py +++ b/Tools/scripts/generate_opcode_h.py @@ -30,6 +30,18 @@ #endif /* !Py_OPCODE_H */ """ +UINT32_MASK = (1<<32)-1 + +def write_int_array_from_ops(name, ops, out): + bits = 0 + for op in ops: + bits |= 1<>= 32 + assert bits == 0 + out.write(f"}};\n") def main(opcode_py, outfile='Include/opcode.h'): opcode = {} @@ -41,6 +53,8 @@ def main(opcode_py, outfile='Include/opcode.h'): code = fp.read() exec(code, opcode) opmap = opcode['opmap'] + hasjrel = opcode['hasjrel'] + hasjabs = opcode['hasjabs'] with open(outfile, 'w') as fobj: fobj.write(header) for name in opcode['opname']: @@ -49,8 +63,13 @@ def main(opcode_py, outfile='Include/opcode.h'): if name == 'POP_EXCEPT': # Special entry for HAVE_ARGUMENT fobj.write("#define %-23s %3d\n" % ('HAVE_ARGUMENT', opcode['HAVE_ARGUMENT'])) + fobj.write("#ifdef NEED_OPCODE_JUMP_TABLES\n") + write_int_array_from_ops("_PyOpcode_RelativeJump", opcode['hasjrel'], fobj) + write_int_array_from_ops("_PyOpcode_Jump", opcode['hasjrel'] + opcode['hasjabs'], fobj) + fobj.write("#endif /* OPCODE_TABLES */\n") fobj.write(footer) + print("%s regenerated from %s" % (outfile, opcode_py)) From ab336e32e63ea540f025d007060d6e4be4e24251 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 5 Aug 2020 10:48:51 +0900 Subject: [PATCH 123/197] bpo-36346: Doc: Update removal schedule of legacy Unicode (GH-21479) See PEP 623 for detail. --- Doc/c-api/unicode.rst | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 0748a1e319489d..f3f0c4c6c2b9b8 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -34,6 +34,11 @@ can internally be in two states depending on how they were created: :c:type:`Py_UNICODE*` representation; you will have to call :c:func:`PyUnicode_READY` on them before calling any other API. +.. note:: + The "legacy" Unicode object will be removed in Python 3.12 with deprecated + APIs. All Unicode objects will be "canonical" since then. See :pep:`623` + for more information. + Unicode Type """""""""""" @@ -107,6 +112,9 @@ access internal read-only data of Unicode objects: .. versionadded:: 3.3 + .. deprecated-removed:: 3.10 3.12 + This API will be removed with :c:func:`PyUnicode_FromUnicode`. + .. c:function:: Py_ssize_t PyUnicode_GET_LENGTH(PyObject *o) @@ -138,6 +146,9 @@ access internal read-only data of Unicode objects: .. versionadded:: 3.3 + .. deprecated-removed:: 3.10 3.12 + ``PyUnicode_WCHAR_KIND`` is deprecated. + .. c:function:: int PyUnicode_KIND(PyObject *o) @@ -203,7 +214,7 @@ access internal read-only data of Unicode objects: code units (this includes surrogate pairs as 2 units). *o* has to be a Unicode object (not checked). - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.12 Part of the old-style Unicode API, please migrate to using :c:func:`PyUnicode_GET_LENGTH`. @@ -213,7 +224,7 @@ access internal read-only data of Unicode objects: Return the size of the deprecated :c:type:`Py_UNICODE` representation in bytes. *o* has to be a Unicode object (not checked). - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.12 Part of the old-style Unicode API, please migrate to using :c:func:`PyUnicode_GET_LENGTH`. @@ -235,7 +246,7 @@ access internal read-only data of Unicode objects: code to use the new :c:func:`PyUnicode_nBYTE_DATA` macros or use :c:func:`PyUnicode_WRITE` or :c:func:`PyUnicode_READ`. - .. deprecated-removed:: 3.3 4.0 + .. deprecated-removed:: 3.3 3.12 Part of the old-style Unicode API, please migrate to using the :c:func:`PyUnicode_nBYTE_DATA` family of macros. @@ -687,8 +698,10 @@ Extension modules can continue using them, as they will not be removed in Python string content has been filled before using any of the access macros such as :c:func:`PyUnicode_KIND`. - Please migrate to using :c:func:`PyUnicode_FromKindAndData`, - :c:func:`PyUnicode_FromWideChar` or :c:func:`PyUnicode_New`. + .. deprecated-removed:: 3.3 3.12 + Part of the old-style Unicode API, please migrate to using + :c:func:`PyUnicode_FromKindAndData`, :c:func:`PyUnicode_FromWideChar`, or + :c:func:`PyUnicode_New`. .. c:function:: Py_UNICODE* PyUnicode_AsUnicode(PyObject *unicode) @@ -701,9 +714,10 @@ Extension modules can continue using them, as they will not be removed in Python embedded null code points, which would cause the string to be truncated when used in most C functions. - Please migrate to using :c:func:`PyUnicode_AsUCS4`, - :c:func:`PyUnicode_AsWideChar`, :c:func:`PyUnicode_ReadChar` or similar new - APIs. + .. deprecated-removed:: 3.3 3.12 + Part of the old-style Unicode API, please migrate to using + :c:func:`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsWideChar`, + :c:func:`PyUnicode_ReadChar` or similar new APIs. .. c:function:: PyObject* PyUnicode_TransformDecimalToASCII(Py_UNICODE *s, Py_ssize_t size) @@ -723,13 +737,20 @@ Extension modules can continue using them, as they will not be removed in Python .. versionadded:: 3.3 + .. deprecated-removed:: 3.3 3.12 + Part of the old-style Unicode API, please migrate to using + :c:func:`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsWideChar`, + :c:func:`PyUnicode_ReadChar` or similar new APIs. + .. c:function:: Py_ssize_t PyUnicode_GetSize(PyObject *unicode) Return the size of the deprecated :c:type:`Py_UNICODE` representation, in code units (this includes surrogate pairs as 2 units). - Please migrate to using :c:func:`PyUnicode_GetLength`. + .. deprecated-removed:: 3.3 3.12 + Part of the old-style Unicode API, please migrate to using + :c:func:`PyUnicode_GET_LENGTH`. .. c:function:: PyObject* PyUnicode_FromObject(PyObject *obj) From 451d41adb717b1f0c1866793acd324e3cae2b334 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Wed, 5 Aug 2020 16:32:32 +0300 Subject: [PATCH 124/197] bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-20312) --- Lib/ast.py | 13 ++++++++++--- Lib/test/test_ast.py | 11 +++++++++++ .../2020-05-22-12-45-58.bpo-40726.7oBdMw.rst | 2 ++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst diff --git a/Lib/ast.py b/Lib/ast.py index 6a5b39e270b9b5..65ebd0100de007 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -180,7 +180,11 @@ def copy_location(new_node, old_node): for attr in 'lineno', 'col_offset', 'end_lineno', 'end_col_offset': if attr in old_node._attributes and attr in new_node._attributes: value = getattr(old_node, attr, None) - if value is not None: + # end_lineno and end_col_offset are optional attributes, and they + # should be copied whether the value is None or not. + if value is not None or ( + hasattr(old_node, attr) and attr.startswith("end_") + ): setattr(new_node, attr, value) return new_node @@ -229,8 +233,11 @@ def increment_lineno(node, n=1): for child in walk(node): if 'lineno' in child._attributes: child.lineno = getattr(child, 'lineno', 0) + n - if 'end_lineno' in child._attributes: - child.end_lineno = getattr(child, 'end_lineno', 0) + n + if ( + "end_lineno" in child._attributes + and (end_lineno := getattr(child, "end_lineno", 0)) is not None + ): + child.end_lineno = end_lineno + n return node diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 78e4a5653d4efd..f5aef61ec6f7c0 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -812,6 +812,12 @@ def test_copy_location(self): 'lineno=1, col_offset=4, end_lineno=1, end_col_offset=5), lineno=1, ' 'col_offset=0, end_lineno=1, end_col_offset=5))' ) + src = ast.Call(col_offset=1, lineno=1, end_lineno=1, end_col_offset=1) + new = ast.copy_location(src, ast.Call(col_offset=None, lineno=None)) + self.assertIsNone(new.end_lineno) + self.assertIsNone(new.end_col_offset) + self.assertEqual(new.lineno, 1) + self.assertEqual(new.col_offset, 1) def test_fix_missing_locations(self): src = ast.parse('write("spam")') @@ -851,6 +857,11 @@ def test_increment_lineno(self): 'lineno=4, col_offset=4, end_lineno=4, end_col_offset=5), lineno=4, ' 'col_offset=0, end_lineno=4, end_col_offset=5))' ) + src = ast.Call( + func=ast.Name("test", ast.Load()), args=[], keywords=[], lineno=1 + ) + self.assertEqual(ast.increment_lineno(src).lineno, 2) + self.assertIsNone(ast.increment_lineno(src).end_lineno) def test_iter_fields(self): node = ast.parse('foo()', mode='eval') diff --git a/Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst b/Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst new file mode 100644 index 00000000000000..7409eb3d80df64 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-05-22-12-45-58.bpo-40726.7oBdMw.rst @@ -0,0 +1,2 @@ +Handle cases where the ``end_lineno`` is ``None`` on +:func:`ast.increment_lineno`. From f48916f31128227a73c0a714e8afe1631c019bb4 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 5 Aug 2020 16:23:10 +0200 Subject: [PATCH 125/197] bpo-40989: Fix compiler warning in winreg.c (GH-21722) Explicitly cast PyHKEYObject* to PyObject* to call _PyObject_Init(). --- PC/winreg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PC/winreg.c b/PC/winreg.c index a24d784c773c02..78c08693a8ace3 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -463,7 +463,7 @@ PyHKEY_FromHKEY(HKEY h) if (op == NULL) { return PyErr_NoMemory(); } - _PyObject_Init(op, &PyHKEY_Type); + _PyObject_Init((PyObject*)op, &PyHKEY_Type); op->hkey = h; return (PyObject *)op; } From cca65d840374885fbca22ea18c979329d2c6fc31 Mon Sep 17 00:00:00 2001 From: "Eric L. Frederich" Date: Wed, 5 Aug 2020 14:44:53 -0400 Subject: [PATCH 126/197] bpo-41482: Fix error in ipaddress.IPv4Network docstring (GH-21736) --- Lib/ipaddress.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index 75b4c352c1d257..bc662c415b2a49 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -1466,7 +1466,7 @@ def __init__(self, address, strict=True): address: A string or integer representing the IP [& network]. '192.0.2.0/24' '192.0.2.0/255.255.255.0' - '192.0.0.2/0.0.0.255' + '192.0.2.0/0.0.0.255' are all functionally the same in IPv4. Similarly, '192.0.2.1' '192.0.2.1/255.255.255.255' From 5b95d6e10550ab29373d57e8473febfe9c60b0bf Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Thu, 6 Aug 2020 19:51:29 +0800 Subject: [PATCH 127/197] bpo-40275: Use new test.support helper submodules in tests (GH-21743) --- Lib/test/test_dbm_gnu.py | 2 +- Lib/test/test_faulthandler.py | 3 ++- Lib/test/test_grp.py | 5 +++-- Lib/test/test_http_cookiejar.py | 18 ++++++++++-------- Lib/test/test_httpservers.py | 4 ++-- Lib/test/test_import/__init__.py | 3 +-- Lib/test/test_ntpath.py | 6 +++--- Lib/test/test_site.py | 3 ++- Lib/test/test_socketserver.py | 9 +++++---- Lib/test/test_statistics.py | 8 +++++--- Lib/test/test_tabnanny.py | 3 ++- Lib/test/test_tcl.py | 15 ++++++++------- Lib/test/test_tools/test_md5sum.py | 8 ++++---- Lib/test/test_turtle.py | 7 ++++--- Lib/test/test_urllib2net.py | 3 ++- Lib/test/test_urllibnet.py | 7 ++++--- Lib/test/test_webbrowser.py | 7 ++++--- Lib/test/test_winsound.py | 4 +++- Lib/tkinter/test/test_tkinter/test_images.py | 11 ++++++----- Lib/tkinter/test/test_tkinter/test_loadtk.py | 3 ++- 20 files changed, 73 insertions(+), 56 deletions(-) diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py index 078bf0e9b92701..017d0ffa658bd6 100644 --- a/Lib/test/test_dbm_gnu.py +++ b/Lib/test/test_dbm_gnu.py @@ -3,7 +3,7 @@ gdbm = import_helper.import_module("dbm.gnu") #skip if not supported import unittest import os -from test.support import TESTFN, TESTFN_NONASCII, unlink +from test.support.os_helper import TESTFN, TESTFN_NONASCII, unlink filename = TESTFN diff --git a/Lib/test/test_faulthandler.py b/Lib/test/test_faulthandler.py index c64afe88c25d6c..80c1f7d90adf0f 100644 --- a/Lib/test/test_faulthandler.py +++ b/Lib/test/test_faulthandler.py @@ -7,6 +7,7 @@ import sys import sysconfig from test import support +from test.support import os_helper from test.support import script_helper, is_android import tempfile import unittest @@ -51,7 +52,7 @@ def temporary_filename(): try: yield filename finally: - support.unlink(filename) + os_helper.unlink(filename) class FaultHandlerTests(unittest.TestCase): def get_output(self, code, filename=None, fd=None): diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py index 0993f091f59560..c7ec03ec0e4388 100644 --- a/Lib/test/test_grp.py +++ b/Lib/test/test_grp.py @@ -1,9 +1,10 @@ """Test script for the grp module.""" import unittest -from test import support +from test.support import import_helper -grp = support.import_module('grp') + +grp = import_helper.import_module('grp') class GroupDatabaseTestCase(unittest.TestCase): diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 2d7077af6da39e..99d038fa15c1e3 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -3,6 +3,8 @@ import os import re import test.support +from test.support import os_helper +from test.support import warnings_helper import time import unittest import urllib.request @@ -328,12 +330,12 @@ def _interact(cookiejar, url, set_cookie_hdrs, hdr_name): class FileCookieJarTests(unittest.TestCase): def test_constructor_with_str(self): - filename = test.support.TESTFN + filename = os_helper.TESTFN c = LWPCookieJar(filename) self.assertEqual(c.filename, filename) def test_constructor_with_path_like(self): - filename = pathlib.Path(test.support.TESTFN) + filename = pathlib.Path(os_helper.TESTFN) c = LWPCookieJar(filename) self.assertEqual(c.filename, os.fspath(filename)) @@ -353,7 +355,7 @@ class A: def test_lwp_valueless_cookie(self): # cookies with no value should be saved and loaded consistently - filename = test.support.TESTFN + filename = os_helper.TESTFN c = LWPCookieJar() interact_netscape(c, "http://www.acme.com/", 'boo') self.assertEqual(c._cookies["www.acme.com"]["/"]["boo"].value, None) @@ -368,7 +370,7 @@ def test_lwp_valueless_cookie(self): def test_bad_magic(self): # OSErrors (eg. file doesn't exist) are allowed to propagate - filename = test.support.TESTFN + filename = os_helper.TESTFN for cookiejar_class in LWPCookieJar, MozillaCookieJar: c = cookiejar_class() try: @@ -475,7 +477,7 @@ def test_domain_return_ok(self): def test_missing_value(self): # missing = sign in Cookie: header is regarded by Mozilla as a missing # name, and by http.cookiejar as a missing value - filename = test.support.TESTFN + filename = os_helper.TESTFN c = MozillaCookieJar(filename) interact_netscape(c, "http://www.acme.com/", 'eggs') interact_netscape(c, "http://www.acme.com/", '"spam"; path=/foo/') @@ -599,7 +601,7 @@ def test_expires(self): c = CookieJar() future = time2netscape(time.time()+3600) - with test.support.check_no_warnings(self): + with warnings_helper.check_no_warnings(self): headers = [f"Set-Cookie: FOO=BAR; path=/; expires={future}"] req = urllib.request.Request("http://www.coyote.com/") res = FakeResponse(headers, "http://www.coyote.com/") @@ -1713,7 +1715,7 @@ def test_rejection(self): self.assertEqual(len(c), 6) # save and restore - filename = test.support.TESTFN + filename = os_helper.TESTFN try: c.save(filename, ignore_discard=True) @@ -1753,7 +1755,7 @@ def test_mozilla(self): # Save / load Mozilla/Netscape cookie file format. year_plus_one = time.localtime()[0] + 1 - filename = test.support.TESTFN + filename = os_helper.TESTFN c = MozillaCookieJar(filename, policy=DefaultCookiePolicy(rfc2965=True)) diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 0c871afca37bdc..a7e1719ab60ee7 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -67,7 +67,7 @@ def stop(self): class BaseTestCase(unittest.TestCase): def setUp(self): self._threads = threading_helper.threading_setup() - os.environ = support.EnvironmentVarGuard() + os.environ = os_helper.EnvironmentVarGuard() self.server_started = threading.Event() self.thread = TestServerThread(self, self.request_handler) self.thread.start() @@ -621,7 +621,7 @@ def setUp(self): # The shebang line should be pure ASCII: use symlink if possible. # See issue #7668. self._pythonexe_symlink = None - if support.can_symlink(): + if os_helper.can_symlink(): self.pythonexe = os.path.join(self.parent_dir, 'python') self._pythonexe_symlink = support.PythonSymlink(self.pythonexe).__enter__() else: diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index f4a83d2e7a13a1..6fd3983a20f68e 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -18,7 +18,6 @@ import unittest from unittest import mock -import test.support from test.support import os_helper from test.support import (is_jython, swap_attr, swap_item, cpython_only) from test.support.import_helper import ( @@ -480,7 +479,7 @@ def test_dll_dependency_import(self): os.path.dirname(pydname), "sqlite3{}.dll".format("_d" if "_d" in pydname else "")) - with test.support.temp_dir() as tmp: + with os_helper.temp_dir() as tmp: tmp2 = os.path.join(tmp, "DLLs") os.mkdir(tmp2) diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 69c44710f0b5ad..0d84ff8bce2c07 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -285,7 +285,7 @@ def test_realpath_relative(self): def test_realpath_broken_symlinks(self): ABSTFN = ntpath.abspath(os_helper.TESTFN) os.mkdir(ABSTFN) - self.addCleanup(support.rmtree, ABSTFN) + self.addCleanup(os_helper.rmtree, ABSTFN) with support.change_cwd(ABSTFN): os.mkdir("subdir") @@ -427,9 +427,9 @@ def test_realpath_cwd(self): ABSTFN = ntpath.abspath(os_helper.TESTFN) os_helper.unlink(ABSTFN) - support.rmtree(ABSTFN) + os_helper.rmtree(ABSTFN) os.mkdir(ABSTFN) - self.addCleanup(support.rmtree, ABSTFN) + self.addCleanup(os_helper.rmtree, ABSTFN) test_dir_long = ntpath.join(ABSTFN, "MyVeryLongDirectoryName") os.mkdir(test_dir_long) diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 5901939725e185..97b5c5de95bbc2 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -7,6 +7,7 @@ import unittest import test.support from test import support +from test.support import os_helper from test.support import socket_helper from test.support import captured_stderr from test.support.os_helper import TESTFN, EnvironmentVarGuard, change_cwd @@ -601,7 +602,7 @@ class _pthFileTests(unittest.TestCase): def _create_underpth_exe(self, lines, exe_pth=True): import _winapi temp_dir = tempfile.mkdtemp() - self.addCleanup(test.support.rmtree, temp_dir) + self.addCleanup(os_helper.rmtree, temp_dir) exe_file = os.path.join(temp_dir, os.path.split(sys.executable)[1]) dll_src_file = _winapi.GetModuleFileName(sys.dllhandle) dll_file = os.path.join(temp_dir, os.path.split(dll_src_file)[1]) diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 5db8cec567afb5..7cdd115a951539 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -15,6 +15,7 @@ import test.support from test.support import reap_children, verbose +from test.support import os_helper from test.support import socket_helper from test.support import threading_helper @@ -299,7 +300,7 @@ class ErrorHandlerTest(unittest.TestCase): KeyboardInterrupt are not passed.""" def tearDown(self): - test.support.unlink(test.support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_sync_handled(self): BaseErrorTestServer(ValueError) @@ -329,7 +330,7 @@ def test_forking_not_handled(self): self.check_result(handled=False) def check_result(self, handled): - with open(test.support.TESTFN) as log: + with open(os_helper.TESTFN) as log: expected = 'Handler called\n' + 'Error handled\n' * handled self.assertEqual(log.read(), expected) @@ -347,7 +348,7 @@ def __init__(self, exception): self.wait_done() def handle_error(self, request, client_address): - with open(test.support.TESTFN, 'a') as log: + with open(os_helper.TESTFN, 'a') as log: log.write('Error handled\n') def wait_done(self): @@ -356,7 +357,7 @@ def wait_done(self): class BadHandler(socketserver.BaseRequestHandler): def handle(self): - with open(test.support.TESTFN, 'a') as log: + with open(os_helper.TESTFN, 'a') as log: log.write('Handler called\n') raise self.server.exception('Test error') diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py index bf415dda557e60..997110732a1765 100644 --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -15,10 +15,10 @@ import sys import unittest from test import support +from test.support import import_helper from decimal import Decimal from fractions import Fraction -from test import support # Module to be tested. @@ -179,8 +179,10 @@ class _DoNothing: # We prefer this for testing numeric values that may not be exactly equal, # and avoid using TestCase.assertAlmostEqual, because it sucks :-) -py_statistics = support.import_fresh_module('statistics', blocked=['_statistics']) -c_statistics = support.import_fresh_module('statistics', fresh=['_statistics']) +py_statistics = import_helper.import_fresh_module('statistics', + blocked=['_statistics']) +c_statistics = import_helper.import_fresh_module('statistics', + fresh=['_statistics']) class TestModules(unittest.TestCase): diff --git a/Lib/test/test_tabnanny.py b/Lib/test/test_tabnanny.py index 95840d6ac0c5f4..4dfbd2985d5b5a 100644 --- a/Lib/test/test_tabnanny.py +++ b/Lib/test/test_tabnanny.py @@ -12,7 +12,8 @@ import tempfile import textwrap from test.support import (captured_stderr, captured_stdout, script_helper, - findfile, unlink) + findfile) +from test.support.os_helper import unlink SOURCE_CODES = { diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index db982dac8d6533..cd2a30e533ae03 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -6,6 +6,7 @@ import warnings from test import support from test.support import import_helper +from test.support import os_helper # Skip this test if the _tkinter module wasn't built. _tkinter = import_helper.import_module('_tkinter') @@ -192,26 +193,26 @@ def test_getboolean(self): def testEvalFile(self): tcl = self.interp - with open(support.TESTFN, 'w') as f: - self.addCleanup(support.unlink, support.TESTFN) + with open(os_helper.TESTFN, 'w') as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) f.write("""set a 1 set b 2 set c [ expr $a + $b ] """) - tcl.evalfile(support.TESTFN) + tcl.evalfile(os_helper.TESTFN) self.assertEqual(tcl.eval('set a'),'1') self.assertEqual(tcl.eval('set b'),'2') self.assertEqual(tcl.eval('set c'),'3') def test_evalfile_null_in_result(self): tcl = self.interp - with open(support.TESTFN, 'w') as f: - self.addCleanup(support.unlink, support.TESTFN) + with open(os_helper.TESTFN, 'w') as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) f.write(""" set a "a\0b" set b "a\\0b" """) - tcl.evalfile(support.TESTFN) + tcl.evalfile(os_helper.TESTFN) self.assertEqual(tcl.eval('set a'), 'a\x00b') self.assertEqual(tcl.eval('set b'), 'a\x00b') @@ -243,7 +244,7 @@ def testLoadWithUNC(self): if not os.path.exists(unc_name): raise unittest.SkipTest('Cannot connect to UNC Path') - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.unset("TCL_LIBRARY") stdout = subprocess.check_output( [unc_name, '-c', 'import tkinter; print(tkinter)']) diff --git a/Lib/test/test_tools/test_md5sum.py b/Lib/test/test_tools/test_md5sum.py index 321bc4bb362826..bfc1f287fff6e1 100644 --- a/Lib/test/test_tools/test_md5sum.py +++ b/Lib/test/test_tools/test_md5sum.py @@ -2,7 +2,7 @@ import os import unittest -from test import support +from test.support import os_helper from test.support import hashlib_helper from test.support.script_helper import assert_python_ok, assert_python_failure @@ -15,8 +15,8 @@ class MD5SumTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.script = os.path.join(scriptsdir, 'md5sum.py') - os.mkdir(support.TESTFN) - cls.fodder = os.path.join(support.TESTFN, 'md5sum.fodder') + os.mkdir(os_helper.TESTFN) + cls.fodder = os.path.join(os_helper.TESTFN, 'md5sum.fodder') with open(cls.fodder, 'wb') as f: f.write(b'md5sum\r\ntest file\r\n') cls.fodder_md5 = b'd38dae2eb1ab346a292ef6850f9e1a0d' @@ -24,7 +24,7 @@ def setUpClass(cls): @classmethod def tearDownClass(cls): - support.rmtree(support.TESTFN) + os_helper.rmtree(os_helper.TESTFN) def test_noargs(self): rc, out, err = assert_python_ok(self.script) diff --git a/Lib/test/test_turtle.py b/Lib/test/test_turtle.py index 39b3d96fb43bbb..46ff4a3aac709a 100644 --- a/Lib/test/test_turtle.py +++ b/Lib/test/test_turtle.py @@ -2,6 +2,7 @@ import unittest from test import support from test.support import import_helper +from test.support import os_helper turtle = import_helper.import_module('turtle') @@ -52,10 +53,10 @@ class TurtleConfigTest(unittest.TestCase): def get_cfg_file(self, cfg_str): - self.addCleanup(support.unlink, support.TESTFN) - with open(support.TESTFN, 'w') as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, 'w') as f: f.write(cfg_str) - return support.TESTFN + return os_helper.TESTFN def test_config_dict(self): diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index cb74685715d35b..c1d55ee8b29b34 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -1,6 +1,7 @@ import errno import unittest from test import support +from test.support import os_helper from test.support import socket_helper from test.test_urllib2 import sanepathname2url @@ -148,7 +149,7 @@ def test_ftp(self): self._test_urls(urls, self._extra_handlers()) def test_file(self): - TESTFN = support.TESTFN + TESTFN = os_helper.TESTFN f = open(TESTFN, 'w') try: f.write('hi there\n') diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index 28680aa6b2405d..773101ce41f602 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import os_helper from test.support import socket_helper import contextlib @@ -162,7 +163,7 @@ def urlretrieve(self, *args, **kwargs): try: yield file_location, info finally: - support.unlink(file_location) + os_helper.unlink(file_location) def test_basic(self): # Test basic functionality. @@ -176,8 +177,8 @@ def test_basic(self): def test_specified_path(self): # Make sure that specifying the location of the file to write to works. with self.urlretrieve(self.logo, - support.TESTFN) as (file_location, info): - self.assertEqual(file_location, support.TESTFN) + os_helper.TESTFN) as (file_location, info): + self.assertEqual(file_location, os_helper.TESTFN) self.assertTrue(os.path.exists(file_location)) with open(file_location, 'rb') as f: self.assertTrue(f.read(), "reading from temporary file failed") diff --git a/Lib/test/test_webbrowser.py b/Lib/test/test_webbrowser.py index 6ceb49069f6564..673cc995d3f5a4 100644 --- a/Lib/test/test_webbrowser.py +++ b/Lib/test/test_webbrowser.py @@ -6,6 +6,7 @@ from unittest import mock from test import support from test.support import import_helper +from test.support import os_helper URL = 'http://www.example.com' @@ -305,7 +306,7 @@ def test_environment(self): browser = webbrowser.get().name except (webbrowser.Error, AttributeError) as err: self.skipTest(str(err)) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["BROWSER"] = browser webbrowser = import_helper.import_fresh_module('webbrowser') webbrowser.get() @@ -318,12 +319,12 @@ def test_environment_preferred(self): except (webbrowser.Error, AttributeError, IndexError) as err: self.skipTest(str(err)) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["BROWSER"] = least_preferred_browser webbrowser = import_helper.import_fresh_module('webbrowser') self.assertEqual(webbrowser.get().name, least_preferred_browser) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env["BROWSER"] = sys.executable webbrowser = import_helper.import_fresh_module('webbrowser') self.assertEqual(webbrowser.get().name, sys.executable) diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py index dca77cb45bfa91..3c3359b9004fd2 100644 --- a/Lib/test/test_winsound.py +++ b/Lib/test/test_winsound.py @@ -5,9 +5,11 @@ import unittest from test import support +from test.support import import_helper + support.requires('audio') -winsound = support.import_module('winsound') +winsound = import_helper.import_module('winsound') # Unless we actually have an ear in the room, we have no idea whether a sound diff --git a/Lib/tkinter/test/test_tkinter/test_images.py b/Lib/tkinter/test/test_tkinter/test_images.py index 2805d35a1f5b1b..6c6cb4e148573f 100644 --- a/Lib/tkinter/test/test_tkinter/test_images.py +++ b/Lib/tkinter/test/test_tkinter/test_images.py @@ -1,6 +1,7 @@ import unittest import tkinter from test import support +from test.support import os_helper from tkinter.test.support import AbstractTkTest, requires_tcl support.requires('gui') @@ -296,12 +297,12 @@ def test_get(self): def test_write(self): image = self.create() - self.addCleanup(support.unlink, support.TESTFN) + self.addCleanup(os_helper.unlink, os_helper.TESTFN) - image.write(support.TESTFN) + image.write(os_helper.TESTFN) image2 = tkinter.PhotoImage('::img::test2', master=self.root, format='ppm', - file=support.TESTFN) + file=os_helper.TESTFN) self.assertEqual(str(image2), '::img::test2') self.assertEqual(image2.type(), 'photo') self.assertEqual(image2.width(), 16) @@ -309,10 +310,10 @@ def test_write(self): self.assertEqual(image2.get(0, 0), image.get(0, 0)) self.assertEqual(image2.get(15, 8), image.get(15, 8)) - image.write(support.TESTFN, format='gif', from_coords=(4, 6, 6, 9)) + image.write(os_helper.TESTFN, format='gif', from_coords=(4, 6, 6, 9)) image3 = tkinter.PhotoImage('::img::test3', master=self.root, format='gif', - file=support.TESTFN) + file=os_helper.TESTFN) self.assertEqual(str(image3), '::img::test3') self.assertEqual(image3.type(), 'photo') self.assertEqual(image3.width(), 2) diff --git a/Lib/tkinter/test/test_tkinter/test_loadtk.py b/Lib/tkinter/test/test_tkinter/test_loadtk.py index bab7bcd37ce318..760ba721340829 100644 --- a/Lib/tkinter/test/test_tkinter/test_loadtk.py +++ b/Lib/tkinter/test/test_tkinter/test_loadtk.py @@ -2,6 +2,7 @@ import sys import unittest import test.support as test_support +from test.support import os_helper from tkinter import Tcl, TclError test_support.requires('gui') @@ -24,7 +25,7 @@ def testLoadTkFailure(self): # XXX Maybe on tk older than 8.4.13 it would be possible, # see tkinter.h. return - with test_support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: if 'DISPLAY' in os.environ: del env['DISPLAY'] # on some platforms, deleting environment variables From 57fed83e8f36a2c570b9c20ad08d6ccef33059fd Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 6 Aug 2020 17:36:22 +0100 Subject: [PATCH 128/197] bpo-41492: Fixes the description appearing in UAC prompts on Windows (GH-21754) --- .azure-pipelines/windows-release/msi-steps.yml | 6 ++++++ .azure-pipelines/windows-release/stage-pack-msix.yml | 8 +++++++- .azure-pipelines/windows-release/stage-sign.yml | 6 ++++++ .../next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst diff --git a/.azure-pipelines/windows-release/msi-steps.yml b/.azure-pipelines/windows-release/msi-steps.yml index a460eb1bac8fe5..307510a40dd4e5 100644 --- a/.azure-pipelines/windows-release/msi-steps.yml +++ b/.azure-pipelines/windows-release/msi-steps.yml @@ -1,6 +1,12 @@ steps: - template: ./checkout.yml + - powershell: | + $d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }}; + Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)" + displayName: 'Update signing description' + condition: and(succeeded(), not(variables['SigningDescription'])) + - task: DownloadPipelineArtifact@1 displayName: 'Download artifact: doc' inputs: diff --git a/.azure-pipelines/windows-release/stage-pack-msix.yml b/.azure-pipelines/windows-release/stage-pack-msix.yml index 07e343a0b4e0c7..26a5712e845ca9 100644 --- a/.azure-pipelines/windows-release/stage-pack-msix.yml +++ b/.azure-pipelines/windows-release/stage-pack-msix.yml @@ -105,9 +105,15 @@ jobs: clean: all steps: - - checkout: none + - template: ./checkout.yml - template: ./find-sdk.yml + - powershell: | + $d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }}; + Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)" + displayName: 'Update signing description' + condition: and(succeeded(), not(variables['SigningDescription'])) + - task: DownloadBuildArtifacts@0 displayName: 'Download Artifact: unsigned_msix' inputs: diff --git a/.azure-pipelines/windows-release/stage-sign.yml b/.azure-pipelines/windows-release/stage-sign.yml index 4d757ae8fca032..584772af8b428e 100644 --- a/.azure-pipelines/windows-release/stage-sign.yml +++ b/.azure-pipelines/windows-release/stage-sign.yml @@ -26,6 +26,12 @@ jobs: - template: ./checkout.yml - template: ./find-sdk.yml + - powershell: | + $d = (.\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }}; + Write-Host "##vso[task.setvariable variable=SigningDescription]Python $($d.PythonVersion)" + displayName: 'Update signing description' + condition: and(succeeded(), not(variables['SigningDescription'])) + - powershell: | Write-Host "##vso[build.addbuildtag]signed" displayName: 'Add build tags' diff --git a/Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst b/Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst new file mode 100644 index 00000000000000..065803e2c20759 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-08-06-16-59-10.bpo-41492.2FQ9cM.rst @@ -0,0 +1 @@ +Fixes the description that appears in UAC prompts. From 77b4e689b004c4df2812aa84e81d11a6f2b17fc9 Mon Sep 17 00:00:00 2001 From: Nathan M Date: Thu, 6 Aug 2020 18:09:40 -0400 Subject: [PATCH 129/197] bpo-41371: Handle lzma lib import error in test_zoneinfo.py (GH-21734) --- Lib/test/test_zoneinfo/test_zoneinfo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py index 1f1fa60f1ffc1f..d16e0d2c331068 100644 --- a/Lib/test/test_zoneinfo/test_zoneinfo.py +++ b/Lib/test/test_zoneinfo/test_zoneinfo.py @@ -6,7 +6,6 @@ import importlib.metadata import io import json -import lzma import os import pathlib import pickle @@ -20,7 +19,9 @@ from . import _support as test_support from ._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase +from test.support.import_helper import import_module +lzma = import_module('lzma') py_zoneinfo, c_zoneinfo = test_support.get_modules() try: From cd571d2fc02a9a9b5fbc37b0ae2bd809fdd5bcef Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 7 Aug 2020 14:08:55 +0900 Subject: [PATCH 130/197] bpo-41493: Refactoring dictresize (GH-21751) Split newsize calculation into new function. dictresize() now accepts exact newsize. --- Objects/dictobject.c | 67 +++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 1b7ae06d822710..6c3fc62d2ecc7e 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -111,6 +111,7 @@ converting the dict to the combined table. #define PyDict_MINSIZE 8 #include "Python.h" +#include "pycore_bitutils.h" // _Py_bit_length #include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() #include "pycore_object.h" // _PyObject_GC_TRACK() #include "pycore_pyerrors.h" // _PyErr_Fetch() @@ -236,7 +237,7 @@ lookdict_unicode_nodummy(PyDictObject *mp, PyObject *key, static Py_ssize_t lookdict_split(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr); -static int dictresize(PyDictObject *mp, Py_ssize_t minused); +static int dictresize(PyDictObject *mp, Py_ssize_t newsize); static PyObject* dict_iter(PyDictObject *dict); @@ -411,18 +412,40 @@ dictkeys_set_index(PyDictKeysObject *keys, Py_ssize_t i, Py_ssize_t ix) */ #define USABLE_FRACTION(n) (((n) << 1)/3) -/* ESTIMATE_SIZE is reverse function of USABLE_FRACTION. +/* Find the smallest dk_size >= minsize. */ +static inline Py_ssize_t +calculate_keysize(Py_ssize_t minsize) +{ +#if SIZEOF_LONG == SIZEOF_SIZE_T + minsize = (minsize | PyDict_MINSIZE) - 1; + return 1LL << _Py_bit_length(minsize | (PyDict_MINSIZE-1)); +#elif defined(_MSC_VER) + // On 64bit Windows, sizeof(long) == 4. + minsize = (minsize | PyDict_MINSIZE) - 1; + unsigned long msb; + _BitScanReverse64(&msb, (uint64_t)minsize); + return 1LL << (msb + 1); +#else + Py_ssize_t size; + for (size = PyDict_MINSIZE; + size < minsize && size > 0; + size <<= 1) + ; + return size; +#endif +} + +/* estimate_keysize is reverse function of USABLE_FRACTION. + * * This can be used to reserve enough size to insert n entries without * resizing. */ -#define ESTIMATE_SIZE(n) (((n)*3+1) >> 1) +static inline Py_ssize_t +estimate_keysize(Py_ssize_t n) +{ + return calculate_keysize((n*3 + 1) / 2); +} -/* Alternative fraction that is otherwise close enough to 2n/3 to make - * little difference. 8 * 2/3 == 8 * 5/8 == 5. 16 * 2/3 == 16 * 5/8 == 10. - * 32 * 2/3 = 21, 32 * 5/8 = 20. - * Its advantage is that it is faster to compute on machines with slow division. - * #define USABLE_FRACTION(n) (((n) >> 1) + ((n) >> 2) - ((n) >> 3)) - */ /* GROWTH_RATE. Growth rate upon hitting maximum load. * Currently set to used*3. @@ -1036,7 +1059,7 @@ find_empty_slot(PyDictKeysObject *keys, Py_hash_t hash) static int insertion_resize(PyDictObject *mp) { - return dictresize(mp, GROWTH_RATE(mp)); + return dictresize(mp, calculate_keysize(GROWTH_RATE(mp))); } /* @@ -1194,22 +1217,19 @@ After resizing a table is always combined, but can be resplit by make_keys_shared(). */ static int -dictresize(PyDictObject *mp, Py_ssize_t minsize) +dictresize(PyDictObject *mp, Py_ssize_t newsize) { - Py_ssize_t newsize, numentries; + Py_ssize_t numentries; PyDictKeysObject *oldkeys; PyObject **oldvalues; PyDictKeyEntry *oldentries, *newentries; - /* Find the smallest table size > minused. */ - for (newsize = PyDict_MINSIZE; - newsize < minsize && newsize > 0; - newsize <<= 1) - ; if (newsize <= 0) { PyErr_NoMemory(); return -1; } + assert(IS_POWER_OF_2(newsize)); + assert(newsize >= PyDict_MINSIZE); oldkeys = mp->ma_keys; @@ -1355,13 +1375,8 @@ _PyDict_NewPresized(Py_ssize_t minused) newsize = max_presize; } else { - Py_ssize_t minsize = ESTIMATE_SIZE(minused); - newsize = PyDict_MINSIZE*2; - while (newsize < minsize) { - newsize <<= 1; - } + newsize = estimate_keysize(minused); } - assert(IS_POWER_OF_2(newsize)); new_keys = new_keys_object(newsize); if (new_keys == NULL) @@ -1930,7 +1945,7 @@ _PyDict_FromKeys(PyObject *cls, PyObject *iterable, PyObject *value) PyObject *key; Py_hash_t hash; - if (dictresize(mp, ESTIMATE_SIZE(PyDict_GET_SIZE(iterable)))) { + if (dictresize(mp, estimate_keysize(PyDict_GET_SIZE(iterable)))) { Py_DECREF(d); return NULL; } @@ -1949,7 +1964,7 @@ _PyDict_FromKeys(PyObject *cls, PyObject *iterable, PyObject *value) PyObject *key; Py_hash_t hash; - if (dictresize(mp, ESTIMATE_SIZE(PySet_GET_SIZE(iterable)))) { + if (dictresize(mp, estimate_keysize(PySet_GET_SIZE(iterable)))) { Py_DECREF(d); return NULL; } @@ -2558,7 +2573,7 @@ dict_merge(PyObject *a, PyObject *b, int override) * that there will be no (or few) overlapping keys. */ if (USABLE_FRACTION(mp->ma_keys->dk_size) < other->ma_used) { - if (dictresize(mp, ESTIMATE_SIZE(mp->ma_used + other->ma_used))) { + if (dictresize(mp, estimate_keysize(mp->ma_used + other->ma_used))) { return -1; } } From 013bf4025491d3f104aa344f0c9d01278e8dd63f Mon Sep 17 00:00:00 2001 From: pxinwr Date: Fri, 7 Aug 2020 13:21:52 +0800 Subject: [PATCH 131/197] bpo-41440: add os.cpu_count() support for VxWorks RTOS (GH-21685) --- Doc/whatsnew/3.10.rst | 6 ++++++ .../next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst | 1 + Modules/posixmodule.c | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index ec0343f2ce71e8..62bb1438416e6c 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -120,6 +120,12 @@ Added the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:`~glob.iglob` which allow to specify the root directory for searching. (Contributed by Serhiy Storchaka in :issue:`38144`.) +os +-- + +Added :func:`os.cpu_count()` support for VxWorks RTOS. +(Contributed by Peixing Xin in :issue:`41440`.) + py_compile ---------- diff --git a/Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst b/Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst new file mode 100644 index 00000000000000..3ee1f656d1870c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-30-14-56-58.bpo-41440.rju34k.rst @@ -0,0 +1 @@ +Add :func:`os.cpu_count()` support for VxWorks RTOS. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index efd99544f5a997..a6a4b9f012f009 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -32,6 +32,9 @@ # include #endif +#ifdef __VXWORKS__ +# include "pycore_bitutils.h" // _Py_popcount32() +#endif #include "pycore_ceval.h" // _PyEval_ReInitThreads() #include "pycore_import.h" // _PyImport_ReInitLock() #include "pycore_initconfig.h" // _PyStatus_EXCEPTION() @@ -12607,6 +12610,8 @@ os_cpu_count_impl(PyObject *module) ncpu = mpctl(MPC_GETNUMSPUS, NULL, NULL); #elif defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN) ncpu = sysconf(_SC_NPROCESSORS_ONLN); +#elif defined(__VXWORKS__) + ncpu = _Py_popcount32(vxCpuEnabledGet()); #elif defined(__DragonFly__) || \ defined(__OpenBSD__) || \ defined(__FreeBSD__) || \ From c76c63db56e1d275f097e6250486b52174848cc6 Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Thu, 6 Aug 2020 23:38:48 -0600 Subject: [PATCH 132/197] bpo-39871: Fix an error in a news entry (GH-21749) --- Misc/NEWS.d/3.9.0a5.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/3.9.0a5.rst b/Misc/NEWS.d/3.9.0a5.rst index 39e017768c3ad0..355a3fc22350cb 100644 --- a/Misc/NEWS.d/3.9.0a5.rst +++ b/Misc/NEWS.d/3.9.0a5.rst @@ -232,7 +232,7 @@ exits before trying to take the GIL. Fix a possible :exc:`SystemError` in ``math.{atan2,copysign,remainder}()`` when the first argument cannot be converted to a :class:`float`. Patch by -Zachary Spytz. +Zackery Spytz. .. From fd92dcef2aaaa6a228630f24659dee09beab35d4 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 7 Aug 2020 16:31:53 +0900 Subject: [PATCH 133/197] bpo-41098: Doc: Add missing deprecated directives (GH-21162) PyUnicodeEncodeError_Create has been deprecated with `Py_DEPRECATED` macro. But it was not documented. --- Doc/c-api/exceptions.rst | 10 ++++++++++ Include/cpython/pyerrors.h | 10 ++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index e7805ba143c584..b4722ff81979f4 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -637,11 +637,21 @@ The following functions are used to create and modify Unicode exceptions from C. *object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are UTF-8 encoded strings. + .. deprecated:: 3.3 3.11 + + ``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to + ``PyObject_CallFunction(PyExc_UnicodeEncodeError, "sOnns", ...)``. + .. c:function:: PyObject* PyUnicodeTranslateError_Create(const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason) Create a :class:`UnicodeTranslateError` object with the attributes *object*, *length*, *start*, *end* and *reason*. *reason* is a UTF-8 encoded string. + .. deprecated:: 3.3 3.11 + + ``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to + ``PyObject_CallFunction(PyExc_UnicodeTranslateError, "Onns", ...)``. + .. c:function:: PyObject* PyUnicodeDecodeError_GetEncoding(PyObject *exc) PyObject* PyUnicodeEncodeError_GetEncoding(PyObject *exc) diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h index 3f347dc2e2d62b..c2500d927bf7f0 100644 --- a/Include/cpython/pyerrors.h +++ b/Include/cpython/pyerrors.h @@ -145,7 +145,10 @@ PyAPI_FUNC(PyObject *) PyErr_ProgramTextObject( PyObject *filename, int lineno); -/* Create a UnicodeEncodeError object */ +/* Create a UnicodeEncodeError object. + * + * TODO: This API will be removed in Python 3.11. + */ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( const char *encoding, /* UTF-8 encoded string */ const Py_UNICODE *object, @@ -155,7 +158,10 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeEncodeError_Create( const char *reason /* UTF-8 encoded string */ ); -/* Create a UnicodeTranslateError object */ +/* Create a UnicodeTranslateError object. + * + * TODO: This API will be removed in Python 3.11. + */ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject *) PyUnicodeTranslateError_Create( const Py_UNICODE *object, Py_ssize_t length, From c7dcf21c744a7ee364512964a507e10a0c1f7a6d Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Fri, 7 Aug 2020 23:18:38 +0800 Subject: [PATCH 134/197] bpo-40275: Use new test.support helper submodules in tests (GH-21764) --- Lib/ctypes/test/test_loading.py | 3 +- Lib/sqlite3/test/hooks.py | 3 +- Lib/test/_test_multiprocessing.py | 32 ++++--- Lib/test/test___all__.py | 5 +- Lib/test/test_asyncio/test_proactor_events.py | 8 +- Lib/test/test_ntpath.py | 12 +-- Lib/test/test_ossaudiodev.py | 3 +- Lib/test/test_platform.py | 2 +- Lib/test/test_posixpath.py | 92 ++++++++++--------- Lib/test/test_py_compile.py | 2 +- Lib/test/test_source_encoding.py | 4 +- Lib/test/test_startfile.py | 3 +- Lib/test/test_sundry.py | 6 +- Lib/test/test_winconsoleio.py | 4 +- Lib/test/test_zoneinfo/_support.py | 2 +- 15 files changed, 97 insertions(+), 84 deletions(-) diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index ba655bceb8b215..38b45f95fefae8 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -5,6 +5,7 @@ import sys import unittest import test.support +from test.support import import_helper from ctypes.util import find_library libc_name = None @@ -117,7 +118,7 @@ def test_1703286_B(self): @unittest.skipUnless(os.name == "nt", 'test specific to Windows') def test_load_dll_with_flags(self): - _sqlite3 = test.support.import_module("_sqlite3") + _sqlite3 = import_helper.import_module("_sqlite3") src = _sqlite3.__file__ if src.lower().endswith("_d.pyd"): ext = "_d.dll" diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py index d74e74bf272275..b08adf1d8097b3 100644 --- a/Lib/sqlite3/test/hooks.py +++ b/Lib/sqlite3/test/hooks.py @@ -24,7 +24,8 @@ import unittest import sqlite3 as sqlite -from test.support import TESTFN, unlink +from test.support.os_helper import TESTFN, unlink + class CollationTests(unittest.TestCase): def CheckCreateCollationNotString(self): diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index bde102ae2e0518..58663c02002e94 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -28,8 +28,10 @@ from test import support from test.support import hashlib_helper from test.support import import_helper +from test.support import os_helper from test.support import socket_helper from test.support import threading_helper +from test.support import warnings_helper # Skip tests if _multiprocessing wasn't built. @@ -615,7 +617,7 @@ def test_lose_target_ref(self): @classmethod def _test_child_fd_inflation(self, evt, q): - q.put(test.support.fd_count()) + q.put(os_helper.fd_count()) evt.wait() def test_child_fd_inflation(self): @@ -819,8 +821,8 @@ def test_stderr_flush(self): if self.TYPE == "threads": self.skipTest('test not appropriate for {}'.format(self.TYPE)) - testfn = test.support.TESTFN - self.addCleanup(test.support.unlink, testfn) + testfn = os_helper.TESTFN + self.addCleanup(os_helper.unlink, testfn) proc = self.Process(target=self._test_stderr_flush, args=(testfn,)) proc.start() proc.join() @@ -849,8 +851,8 @@ def test_sys_exit(self): if self.TYPE == 'threads': self.skipTest('test not appropriate for {}'.format(self.TYPE)) - testfn = test.support.TESTFN - self.addCleanup(test.support.unlink, testfn) + testfn = os_helper.TESTFN + self.addCleanup(os_helper.unlink, testfn) for reason in ( [1, 2, 3], @@ -1114,7 +1116,7 @@ def test_task_done(self): close_queue(queue) def test_no_import_lock_contention(self): - with test.support.temp_cwd(): + with os_helper.temp_cwd(): module_name = 'imported_by_an_imported_module' with open(module_name + '.py', 'w') as f: f.write("""if 1: @@ -1127,7 +1129,7 @@ def test_no_import_lock_contention(self): del q """) - with test.support.DirsOnSysPath(os.getcwd()): + with import_helper.DirsOnSysPath(os.getcwd()): try: __import__(module_name) except pyqueue.Empty: @@ -2688,8 +2690,8 @@ def test_resource_warning(self): # force state to RUN to emit ResourceWarning in __del__() pool._state = multiprocessing.pool.RUN - with support.check_warnings(('unclosed running multiprocessing pool', - ResourceWarning)): + with warnings_helper.check_warnings( + ('unclosed running multiprocessing pool', ResourceWarning)): pool = None support.gc_collect() @@ -3199,14 +3201,14 @@ def test_fd_transfer(self): p = self.Process(target=self._writefd, args=(child_conn, b"foo")) p.daemon = True p.start() - self.addCleanup(test.support.unlink, test.support.TESTFN) - with open(test.support.TESTFN, "wb") as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, "wb") as f: fd = f.fileno() if msvcrt: fd = msvcrt.get_osfhandle(fd) reduction.send_handle(conn, fd, p.pid) p.join() - with open(test.support.TESTFN, "rb") as f: + with open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"foo") @unittest.skipUnless(HAS_REDUCTION, "test needs multiprocessing.reduction") @@ -3225,8 +3227,8 @@ def test_large_fd_transfer(self): p = self.Process(target=self._writefd, args=(child_conn, b"bar", True)) p.daemon = True p.start() - self.addCleanup(test.support.unlink, test.support.TESTFN) - with open(test.support.TESTFN, "wb") as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, "wb") as f: fd = f.fileno() for newfd in range(256, MAXFD): if not self._is_fd_assigned(newfd): @@ -3239,7 +3241,7 @@ def test_large_fd_transfer(self): finally: os.close(newfd) p.join() - with open(test.support.TESTFN, "rb") as f: + with open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"bar") @classmethod diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 0ba243ee4e74e4..0a03dd20065feb 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import warnings_helper import os import sys @@ -15,7 +16,7 @@ class AllTest(unittest.TestCase): def check_all(self, modname): names = {} - with support.check_warnings( + with warnings_helper.check_warnings( (".* (module|package)", DeprecationWarning), (".* (module|package)", PendingDeprecationWarning), ("", ResourceWarning), @@ -31,7 +32,7 @@ def check_all(self, modname): raise NoAll(modname) names = {} with self.subTest(module=modname): - with support.check_warnings( + with warnings_helper.check_warnings( ("", DeprecationWarning), ("", ResourceWarning), quiet=True): diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 50ba4c19d425ca..d0ab38743ecd1f 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -12,7 +12,7 @@ from asyncio.proactor_events import _ProactorWritePipeTransport from asyncio.proactor_events import _ProactorDuplexPipeTransport from asyncio.proactor_events import _ProactorDatagramTransport -from test import support +from test.support import os_helper from test.support import socket_helper from test.test_asyncio import utils as test_utils @@ -935,20 +935,20 @@ async def wait_closed(self): @classmethod def setUpClass(cls): - with open(support.TESTFN, 'wb') as fp: + with open(os_helper.TESTFN, 'wb') as fp: fp.write(cls.DATA) super().setUpClass() @classmethod def tearDownClass(cls): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) super().tearDownClass() def setUp(self): self.loop = asyncio.ProactorEventLoop() self.set_event_loop(self.loop) self.addCleanup(self.loop.close) - self.file = open(support.TESTFN, 'rb') + self.file = open(os_helper.TESTFN, 'rb') self.addCleanup(self.file.close) super().setUp() diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index 0d84ff8bce2c07..a8f764f48ca00f 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -6,7 +6,7 @@ from test.support import os_helper from test.support import TestFailed from test.support.os_helper import FakePath -from test import support, test_genericpath +from test import test_genericpath from tempfile import TemporaryFile @@ -287,7 +287,7 @@ def test_realpath_broken_symlinks(self): os.mkdir(ABSTFN) self.addCleanup(os_helper.rmtree, ABSTFN) - with support.change_cwd(ABSTFN): + with os_helper.change_cwd(ABSTFN): os.mkdir("subdir") os.chdir("subdir") os.symlink(".", "recursive") @@ -443,11 +443,11 @@ def test_realpath_cwd(self): self.assertPathEqual(test_file_long, ntpath.realpath(test_file_short)) - with support.change_cwd(test_dir_long): + with os_helper.change_cwd(test_dir_long): self.assertPathEqual(test_file_long, ntpath.realpath("file.txt")) - with support.change_cwd(test_dir_long.lower()): + with os_helper.change_cwd(test_dir_long.lower()): self.assertPathEqual(test_file_long, ntpath.realpath("file.txt")) - with support.change_cwd(test_dir_short): + with os_helper.change_cwd(test_dir_short): self.assertPathEqual(test_file_long, ntpath.realpath("file.txt")) def test_expandvars(self): @@ -673,7 +673,7 @@ def test_ismount(self): # locations below cannot then refer to mount points # drive, path = ntpath.splitdrive(sys.executable) - with support.change_cwd(ntpath.dirname(sys.executable)): + with os_helper.change_cwd(ntpath.dirname(sys.executable)): self.assertFalse(ntpath.ismount(drive.lower())) self.assertFalse(ntpath.ismount(drive.upper())) diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py index 624fbf21ba7d88..d3766e580b9843 100644 --- a/Lib/test/test_ossaudiodev.py +++ b/Lib/test/test_ossaudiodev.py @@ -1,9 +1,10 @@ from test import support +from test.support import import_helper support.requires('audio') from test.support import findfile -ossaudiodev = support.import_module('ossaudiodev') +ossaudiodev = import_helper.import_module('ossaudiodev') import errno import sys diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 5ad306e0ed5795..b5d21e54610e3d 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -196,7 +196,7 @@ def test_uname_win32_ARCHITEW6432(self): # using it, per # http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx try: - with support.EnvironmentVarGuard() as environ: + with os_helper.EnvironmentVarGuard() as environ: if 'PROCESSOR_ARCHITEW6432' in environ: del environ['PROCESSOR_ARCHITEW6432'] environ['PROCESSOR_ARCHITECTURE'] = 'foo' diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index 18819a5dc1cfee..f37e82505796db 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -2,7 +2,9 @@ import posixpath import unittest from posixpath import realpath, abspath, dirname, basename -from test import support, test_genericpath +from test import test_genericpath +from test.support import import_helper +from test.support import os_helper from test.support import FakePath from unittest import mock @@ -15,7 +17,7 @@ # An absolute path to a temporary filename for testing. We can't rely on TESTFN # being an absolute path, so we need this. -ABSTFN = abspath(support.TESTFN) +ABSTFN = abspath(os_helper.TESTFN) def skip_if_ABSTFN_contains_backslash(test): """ @@ -40,8 +42,8 @@ def setUp(self): def tearDown(self): for suffix in ["", "1", "2"]: - support.unlink(support.TESTFN + suffix) - safe_rmdir(support.TESTFN + suffix) + os_helper.unlink(os_helper.TESTFN + suffix) + safe_rmdir(os_helper.TESTFN + suffix) def test_join(self): self.assertEqual(posixpath.join("/foo", "bar", "/bar", "baz"), @@ -152,25 +154,25 @@ def test_dirname(self): self.assertEqual(posixpath.dirname(b"//foo//bar"), b"//foo") def test_islink(self): - self.assertIs(posixpath.islink(support.TESTFN + "1"), False) - self.assertIs(posixpath.lexists(support.TESTFN + "2"), False) + self.assertIs(posixpath.islink(os_helper.TESTFN + "1"), False) + self.assertIs(posixpath.lexists(os_helper.TESTFN + "2"), False) - with open(support.TESTFN + "1", "wb") as f: + with open(os_helper.TESTFN + "1", "wb") as f: f.write(b"foo") - self.assertIs(posixpath.islink(support.TESTFN + "1"), False) + self.assertIs(posixpath.islink(os_helper.TESTFN + "1"), False) - if support.can_symlink(): - os.symlink(support.TESTFN + "1", support.TESTFN + "2") - self.assertIs(posixpath.islink(support.TESTFN + "2"), True) - os.remove(support.TESTFN + "1") - self.assertIs(posixpath.islink(support.TESTFN + "2"), True) - self.assertIs(posixpath.exists(support.TESTFN + "2"), False) - self.assertIs(posixpath.lexists(support.TESTFN + "2"), True) + if os_helper.can_symlink(): + os.symlink(os_helper.TESTFN + "1", os_helper.TESTFN + "2") + self.assertIs(posixpath.islink(os_helper.TESTFN + "2"), True) + os.remove(os_helper.TESTFN + "1") + self.assertIs(posixpath.islink(os_helper.TESTFN + "2"), True) + self.assertIs(posixpath.exists(os_helper.TESTFN + "2"), False) + self.assertIs(posixpath.lexists(os_helper.TESTFN + "2"), True) - self.assertIs(posixpath.islink(support.TESTFN + "\udfff"), False) - self.assertIs(posixpath.islink(os.fsencode(support.TESTFN) + b"\xff"), False) - self.assertIs(posixpath.islink(support.TESTFN + "\x00"), False) - self.assertIs(posixpath.islink(os.fsencode(support.TESTFN) + b"\x00"), False) + self.assertIs(posixpath.islink(os_helper.TESTFN + "\udfff"), False) + self.assertIs(posixpath.islink(os.fsencode(os_helper.TESTFN) + b"\xff"), False) + self.assertIs(posixpath.islink(os_helper.TESTFN + "\x00"), False) + self.assertIs(posixpath.islink(os.fsencode(os_helper.TESTFN) + b"\x00"), False) def test_ismount(self): self.assertIs(posixpath.ismount("/"), True) @@ -190,7 +192,7 @@ def test_ismount_non_existent(self): self.assertIs(posixpath.ismount('/\x00'), False) self.assertIs(posixpath.ismount(b'/\x00'), False) - @unittest.skipUnless(support.can_symlink(), + @unittest.skipUnless(os_helper.can_symlink(), "Test requires symlink support") def test_ismount_symlinks(self): # Symlinks are never mountpoints. @@ -245,7 +247,7 @@ def test_expanduser(self): self.assertEqual(posixpath.expanduser(b"foo"), b"foo") def test_expanduser_home_envvar(self): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env['HOME'] = '/home/victor' self.assertEqual(posixpath.expanduser("~"), "/home/victor") @@ -261,7 +263,7 @@ def test_expanduser_home_envvar(self): self.assertEqual(posixpath.expanduser("~/foo"), "/foo") def test_expanduser_pwd(self): - pwd = support.import_module('pwd') + pwd = import_helper.import_module('pwd') self.assertIsInstance(posixpath.expanduser("~/"), str) self.assertIsInstance(posixpath.expanduser(b"~/"), bytes) @@ -281,7 +283,7 @@ def test_expanduser_pwd(self): self.assertIsInstance(posixpath.expanduser(b"~root/"), bytes) self.assertIsInstance(posixpath.expanduser(b"~foo/"), bytes) - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: # expanduser should fall back to using the password database del env['HOME'] @@ -348,7 +350,7 @@ def test_realpath_basic(self): os.symlink(ABSTFN+"1", ABSTFN) self.assertEqual(realpath(ABSTFN), ABSTFN+"1") finally: - support.unlink(ABSTFN) + os_helper.unlink(ABSTFN) @unittest.skipUnless(hasattr(os, "symlink"), "Missing symlink implementation") @@ -358,7 +360,7 @@ def test_realpath_relative(self): os.symlink(posixpath.relpath(ABSTFN+"1"), ABSTFN) self.assertEqual(realpath(ABSTFN), ABSTFN+"1") finally: - support.unlink(ABSTFN) + os_helper.unlink(ABSTFN) @unittest.skipUnless(hasattr(os, "symlink"), "Missing symlink implementation") @@ -392,15 +394,15 @@ def test_realpath_symlink_loops(self): self.assertEqual(realpath(ABSTFN+"c"), ABSTFN+"c") # Test using relative path as well. - with support.change_cwd(dirname(ABSTFN)): + with os_helper.change_cwd(dirname(ABSTFN)): self.assertEqual(realpath(basename(ABSTFN)), ABSTFN) finally: - support.unlink(ABSTFN) - support.unlink(ABSTFN+"1") - support.unlink(ABSTFN+"2") - support.unlink(ABSTFN+"y") - support.unlink(ABSTFN+"c") - support.unlink(ABSTFN+"a") + os_helper.unlink(ABSTFN) + os_helper.unlink(ABSTFN+"1") + os_helper.unlink(ABSTFN+"2") + os_helper.unlink(ABSTFN+"y") + os_helper.unlink(ABSTFN+"c") + os_helper.unlink(ABSTFN+"a") @unittest.skipUnless(hasattr(os, "symlink"), "Missing symlink implementation") @@ -413,8 +415,8 @@ def test_realpath_repeated_indirect_symlinks(self): os.symlink('self/self/self', ABSTFN + '/link') self.assertEqual(realpath(ABSTFN + '/link'), ABSTFN) finally: - support.unlink(ABSTFN + '/self') - support.unlink(ABSTFN + '/link') + os_helper.unlink(ABSTFN + '/self') + os_helper.unlink(ABSTFN + '/link') safe_rmdir(ABSTFN) @unittest.skipUnless(hasattr(os, "symlink"), @@ -430,11 +432,11 @@ def test_realpath_deep_recursion(self): self.assertEqual(realpath(ABSTFN + '/%d' % depth), ABSTFN) # Test using relative path as well. - with support.change_cwd(ABSTFN): + with os_helper.change_cwd(ABSTFN): self.assertEqual(realpath('%d' % depth), ABSTFN) finally: for i in range(depth + 1): - support.unlink(ABSTFN + '/%d' % i) + os_helper.unlink(ABSTFN + '/%d' % i) safe_rmdir(ABSTFN) @unittest.skipUnless(hasattr(os, "symlink"), @@ -450,10 +452,10 @@ def test_realpath_resolve_parents(self): os.mkdir(ABSTFN + "/y") os.symlink(ABSTFN + "/y", ABSTFN + "/k") - with support.change_cwd(ABSTFN + "/k"): + with os_helper.change_cwd(ABSTFN + "/k"): self.assertEqual(realpath("a"), ABSTFN + "/y/a") finally: - support.unlink(ABSTFN + "/k") + os_helper.unlink(ABSTFN + "/k") safe_rmdir(ABSTFN + "/y") safe_rmdir(ABSTFN) @@ -477,11 +479,11 @@ def test_realpath_resolve_before_normalizing(self): # Absolute path. self.assertEqual(realpath(ABSTFN + "/link-y/.."), ABSTFN + "/k") # Relative path. - with support.change_cwd(dirname(ABSTFN)): + with os_helper.change_cwd(dirname(ABSTFN)): self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."), ABSTFN + "/k") finally: - support.unlink(ABSTFN + "/link-y") + os_helper.unlink(ABSTFN + "/link-y") safe_rmdir(ABSTFN + "/k/y") safe_rmdir(ABSTFN + "/k") safe_rmdir(ABSTFN) @@ -497,12 +499,12 @@ def test_realpath_resolve_first(self): os.mkdir(ABSTFN) os.mkdir(ABSTFN + "/k") os.symlink(ABSTFN, ABSTFN + "link") - with support.change_cwd(dirname(ABSTFN)): + with os_helper.change_cwd(dirname(ABSTFN)): base = basename(ABSTFN) self.assertEqual(realpath(base + "link"), ABSTFN) self.assertEqual(realpath(base + "link/k"), ABSTFN + "/k") finally: - support.unlink(ABSTFN + "link") + os_helper.unlink(ABSTFN + "link") safe_rmdir(ABSTFN + "/k") safe_rmdir(ABSTFN) @@ -627,9 +629,9 @@ class PathLikeTests(unittest.TestCase): path = posixpath def setUp(self): - self.file_name = support.TESTFN - self.file_path = FakePath(support.TESTFN) - self.addCleanup(support.unlink, self.file_name) + self.file_name = os_helper.TESTFN + self.file_path = FakePath(os_helper.TESTFN) + self.addCleanup(os_helper.unlink, self.file_name) with open(self.file_name, 'xb', 0) as file: file.write(b"test_posixpath.PathLikeTests") diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 009645689f4237..b58f28a4bc8885 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -228,7 +228,7 @@ def setUp(self): file.write('x = 123\n') def tearDown(self): - support.rmtree(self.directory) + os_helper.rmtree(self.directory) def pycompilecmd(self, *args, **kwargs): # assert_python_* helpers don't return proc object. We'll just use diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py index 5ca43461d9940d..b410c03221bf32 100644 --- a/Lib/test/test_source_encoding.py +++ b/Lib/test/test_source_encoding.py @@ -1,7 +1,9 @@ # -*- coding: koi8-r -*- import unittest -from test.support import TESTFN, unlink, unload, rmtree, script_helper, captured_stdout +from test.support import script_helper, captured_stdout +from test.support.os_helper import TESTFN, unlink, rmtree +from test.support.import_helper import unload import importlib import os import sys diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py index 1a26a8025e6243..589ffa25244da9 100644 --- a/Lib/test/test_startfile.py +++ b/Lib/test/test_startfile.py @@ -9,6 +9,7 @@ import unittest from test import support +from test.support import os_helper import os import platform import sys @@ -27,7 +28,7 @@ def test_empty(self): # we're not about to delete. If we're running under -j, that # means the test harness provided directory isn't a safe option. # See http://bugs.python.org/issue15526 for more details - with support.change_cwd(path.dirname(sys.executable)): + with os_helper.change_cwd(path.dirname(sys.executable)): empty = path.join(path.dirname(__file__), "empty.vbs") startfile(empty) startfile(empty, "open") diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py index 2accad1aeebd4f..04e572c00a1969 100644 --- a/Lib/test/test_sundry.py +++ b/Lib/test/test_sundry.py @@ -3,15 +3,17 @@ import platform import sys from test import support +from test.support import import_helper +from test.support import warnings_helper import unittest class TestUntestedModules(unittest.TestCase): def test_untested_modules_can_be_imported(self): untested = ('encodings', 'formatter') - with support.check_warnings(quiet=True): + with warnings_helper.check_warnings(quiet=True): for name in untested: try: - support.import_module('test.test_{}'.format(name)) + import_helper.import_module('test.test_{}'.format(name)) except unittest.SkipTest: importlib.import_module(name) else: diff --git a/Lib/test/test_winconsoleio.py b/Lib/test/test_winconsoleio.py index a44f7bbd27b700..1807e47c66c387 100644 --- a/Lib/test/test_winconsoleio.py +++ b/Lib/test/test_winconsoleio.py @@ -6,7 +6,7 @@ import sys import tempfile import unittest -from test import support +from test.support import os_helper if sys.platform != 'win32': raise unittest.SkipTest("test only relevant on win32") @@ -109,7 +109,7 @@ def test_conin_conout_names(self): def test_conout_path(self): temp_path = tempfile.mkdtemp() - self.addCleanup(support.rmtree, temp_path) + self.addCleanup(os_helper.rmtree, temp_path) conout_path = os.path.join(temp_path, 'CONOUT$') diff --git a/Lib/test/test_zoneinfo/_support.py b/Lib/test/test_zoneinfo/_support.py index 0fe162c2583687..5a76c163fb75bd 100644 --- a/Lib/test/test_zoneinfo/_support.py +++ b/Lib/test/test_zoneinfo/_support.py @@ -3,7 +3,7 @@ import sys import threading import unittest -from test.support import import_fresh_module +from test.support.import_helper import import_fresh_module OS_ENV_LOCK = threading.Lock() TZPATH_LOCK = threading.Lock() From b3ea5c9bfac7cff2a4e81a7c2c07f9b4f85abd41 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Aug 2020 17:56:42 +0200 Subject: [PATCH 135/197] bpo-41477: Make ctypes optional in test_genericalias (GH-21766) --- Lib/test/test_genericalias.py | 80 ++++++++++--------- .../2020-08-07-17-28-49.bpo-41477.GrFexU.rst | 1 + 2 files changed, 43 insertions(+), 38 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 4f3798e8f87d8f..1f24469471428a 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -13,7 +13,10 @@ from dataclasses import Field from functools import partial, partialmethod, cached_property from mailbox import Mailbox, _PartialFile -from ctypes import Array, LibraryLoader +try: + import ctypes +except ImportError: + ctypes = None from difflib import SequenceMatcher from filecmp import dircmp from fileinput import FileInput @@ -46,43 +49,44 @@ class BaseTest(unittest.TestCase): """Test basics.""" def test_subscriptable(self): - for t in (type, tuple, list, dict, set, frozenset, enumerate, - defaultdict, deque, - SequenceMatcher, - dircmp, - FileInput, - OrderedDict, Counter, UserDict, UserList, - Pattern, Match, - partial, partialmethod, cached_property, - AbstractContextManager, AbstractAsyncContextManager, - Awaitable, Coroutine, - AsyncIterable, AsyncIterator, - AsyncGenerator, Generator, - Iterable, Iterator, - Reversible, - Container, Collection, - Callable, - Mailbox, _PartialFile, - ContextVar, Token, - Field, - Set, MutableSet, - Mapping, MutableMapping, MappingView, - KeysView, ItemsView, ValuesView, - Sequence, MutableSequence, - MappingProxyType, AsyncGeneratorType, - DirEntry, - chain, - TemporaryDirectory, SpooledTemporaryFile, - Queue, SimpleQueue, - _AssertRaisesContext, - Array, LibraryLoader, - SplitResult, ParseResult, - ValueProxy, ApplyResult, - WeakSet, ReferenceType, ref, - ShareableList, SimpleQueue, - Future, _WorkItem, - Morsel, - ): + types = [type, tuple, list, dict, set, frozenset, enumerate, + defaultdict, deque, + SequenceMatcher, + dircmp, + FileInput, + OrderedDict, Counter, UserDict, UserList, + Pattern, Match, + partial, partialmethod, cached_property, + AbstractContextManager, AbstractAsyncContextManager, + Awaitable, Coroutine, + AsyncIterable, AsyncIterator, + AsyncGenerator, Generator, + Iterable, Iterator, + Reversible, + Container, Collection, + Callable, + Mailbox, _PartialFile, + ContextVar, Token, + Field, + Set, MutableSet, + Mapping, MutableMapping, MappingView, + KeysView, ItemsView, ValuesView, + Sequence, MutableSequence, + MappingProxyType, AsyncGeneratorType, + DirEntry, + chain, + TemporaryDirectory, SpooledTemporaryFile, + Queue, SimpleQueue, + _AssertRaisesContext, + SplitResult, ParseResult, + ValueProxy, ApplyResult, + WeakSet, ReferenceType, ref, + ShareableList, SimpleQueue, + Future, _WorkItem, + Morsel] + if ctypes is not None: + types.extend((ctypes.Array, ctypes.LibraryLoader)) + for t in types: if t is None: continue tname = t.__name__ diff --git a/Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst b/Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst new file mode 100644 index 00000000000000..bf0f54abecd85d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-08-07-17-28-49.bpo-41477.GrFexU.rst @@ -0,0 +1 @@ +Make ctypes optional in test_genericalias. From b277e8930fa564c6aa3b5d8f146ea9a6d10463ec Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 7 Aug 2020 17:57:56 +0200 Subject: [PATCH 136/197] bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768) gdb 9.2 on Fedora Rawhide is not reliable, see: * https://bugs.python.org/issue41473 * https://bugzilla.redhat.com/show_bug.cgi?id=1866884 --- Lib/test/test_gdb.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 22c75bae987219..44cb9a0f07b75d 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -51,6 +51,11 @@ def get_gdb_version(): "embedding. Saw %s.%s:\n%s" % (gdb_major_version, gdb_minor_version, gdb_version)) +if (gdb_major_version, gdb_minor_version) >= (9, 2): + # gdb 9.2 on Fedora Rawhide is not reliable, see: + # * https://bugs.python.org/issue41473 + # * https://bugzilla.redhat.com/show_bug.cgi?id=1866884 + raise unittest.SkipTest("https://bugzilla.redhat.com/show_bug.cgi?id=1866884") if not sysconfig.is_python_build(): raise unittest.SkipTest("test_gdb only works on source builds at the moment.") From 0b5c0da5d1bd3bd4bd3f4b5b9bfd74f8285dc364 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sat, 8 Aug 2020 05:55:35 +0800 Subject: [PATCH 137/197] bpo-40275: Use new test.support helper submodules in tests (GH-21772) --- Lib/sqlite3/test/dbapi.py | 2 +- Lib/test/libregrtest/refleak.py | 6 ++++-- Lib/test/libregrtest/win_utils.py | 6 ++++-- Lib/test/test_audit.py | 11 +++++++---- Lib/test/test_bytes.py | 5 +++-- Lib/test/test_dbm_ndbm.py | 7 ++++--- Lib/test/test_descr.py | 6 +++--- Lib/test/test_xml_etree.py | 2 +- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index be11337154bdd2..119da12170331f 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -25,7 +25,7 @@ import unittest import sqlite3 as sqlite -from test.support import TESTFN, unlink +from test.support.os_helper import TESTFN, unlink class ModuleTests(unittest.TestCase): diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index 8d221232eb6ce7..77298d318898db 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -4,6 +4,8 @@ import warnings from inspect import isabstract from test import support +from test.support import os_helper + try: from _abc import _get_dump except ImportError: @@ -61,7 +63,7 @@ def get_pooled_int(value): return int_pool.setdefault(value, value) nwarmup, ntracked, fname = ns.huntrleaks - fname = os.path.join(support.SAVEDCWD, fname) + fname = os.path.join(os_helper.SAVEDCWD, fname) repcount = nwarmup + ntracked # Pre-allocate to ensure that the loop doesn't allocate anything new @@ -71,7 +73,7 @@ def get_pooled_int(value): fd_deltas = [0] * repcount getallocatedblocks = sys.getallocatedblocks gettotalrefcount = sys.gettotalrefcount - fd_count = support.fd_count + fd_count = os_helper.fd_count # initialize variables to make pyflakes quiet rc_before = alloc_before = fd_before = 0 diff --git a/Lib/test/libregrtest/win_utils.py b/Lib/test/libregrtest/win_utils.py index 028c01106dee08..a1cc2201147dbc 100644 --- a/Lib/test/libregrtest/win_utils.py +++ b/Lib/test/libregrtest/win_utils.py @@ -5,7 +5,7 @@ import subprocess import uuid import winreg -from test import support +from test.support import os_helper from test.libregrtest.utils import print_warning @@ -69,7 +69,9 @@ def start(self): # Spawn off the load monitor counter_name = self._get_counter_name() command = ['typeperf', counter_name, '-si', str(SAMPLING_INTERVAL)] - self._popen = subprocess.Popen(' '.join(command), stdout=command_stdout, cwd=support.SAVEDCWD) + self._popen = subprocess.Popen(' '.join(command), + stdout=command_stdout, + cwd=os_helper.SAVEDCWD) # Close our copy of the write end of the pipe os.close(command_stdout) diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py index f79edbc4bd0d9f..4f8d06a3ebcbee 100644 --- a/Lib/test/test_audit.py +++ b/Lib/test/test_audit.py @@ -5,6 +5,9 @@ import sys import unittest from test import support +from test.support import import_helper +from test.support import os_helper + if not hasattr(sys, "addaudithook") or not hasattr(sys, "audit"): raise unittest.SkipTest("test only relevant when sys.audit is available") @@ -52,7 +55,7 @@ def test_block_add_hook_baseexception(self): self.do_test("test_block_add_hook_baseexception") def test_pickle(self): - support.import_module("pickle") + import_helper.import_module("pickle") self.do_test("test_pickle") @@ -60,7 +63,7 @@ def test_monkeypatch(self): self.do_test("test_monkeypatch") def test_open(self): - self.do_test("test_open", support.TESTFN) + self.do_test("test_open", os_helper.TESTFN) def test_cantrace(self): self.do_test("test_cantrace") @@ -89,7 +92,7 @@ def test_unraisablehook(self): ) def test_winreg(self): - support.import_module("winreg") + import_helper.import_module("winreg") returncode, events, stderr = self.run_python("test_winreg") if returncode: self.fail(stderr) @@ -103,7 +106,7 @@ def test_winreg(self): self.assertSequenceEqual(["winreg.PyHKEY.Detach", " ", expected], events[4]) def test_socket(self): - support.import_module("socket") + import_helper.import_module("socket") returncode, events, stderr = self.run_python("test_socket") if returncode: self.fail(stderr) diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 61b4b9162ccc54..e61228d1a266f9 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -17,6 +17,7 @@ import test.support from test.support import import_helper +from test.support import warnings_helper import test.string_tests import test.list_tests from test.support import bigaddrspacetest, MAX_Py_ssize_t @@ -27,7 +28,7 @@ def check_bytes_warnings(func): @functools.wraps(func) def wrapper(*args, **kw): - with test.support.check_warnings(('', BytesWarning)): + with warnings_helper.check_warnings(('', BytesWarning)): return func(*args, **kw) return wrapper else: @@ -1769,7 +1770,7 @@ def test_return_self(self): "BytesWarning is needed for this test: use -bb option") def test_compare(self): def bytes_warning(): - return test.support.check_warnings(('', BytesWarning)) + return warnings_helper.check_warnings(('', BytesWarning)) with bytes_warning(): b'' == '' with bytes_warning(): diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py index 278fca2cf23152..e17a1d9eca9316 100644 --- a/Lib/test/test_dbm_ndbm.py +++ b/Lib/test/test_dbm_ndbm.py @@ -1,5 +1,6 @@ from test import support from test.support import import_helper +from test.support import os_helper import_helper.import_module("dbm.ndbm") #skip if not supported import os import unittest @@ -9,7 +10,7 @@ class DbmTestCase(unittest.TestCase): def setUp(self): - self.filename = support.TESTFN + self.filename = os_helper.TESTFN self.d = dbm.ndbm.open(self.filename, 'c') self.d.close() @@ -102,10 +103,10 @@ def test_write_readonly_file(self): with self.assertRaises(error): db[b'not exist key'] = b'not exist value' - @unittest.skipUnless(support.TESTFN_NONASCII, + @unittest.skipUnless(os_helper.TESTFN_NONASCII, 'requires OS support of non-ASCII encodings') def test_nonascii_filename(self): - filename = support.TESTFN_NONASCII + filename = os_helper.TESTFN_NONASCII for suffix in ['', '.pag', '.dir', '.db']: self.addCleanup(support.unlink, filename + suffix) with dbm.ndbm.open(filename, 'c') as db: diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index 9738fb52a04bf2..307416c3300ae3 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -2975,12 +2975,12 @@ class sublist(list): ## self.ateof = 1 ## return s ## - ## f = file(name=support.TESTFN, mode='w') + ## f = file(name=os_helper.TESTFN, mode='w') ## lines = ['a\n', 'b\n', 'c\n'] ## try: ## f.writelines(lines) ## f.close() - ## f = CountedInput(support.TESTFN) + ## f = CountedInput(os_helper.TESTFN) ## for (i, expected) in zip(range(1, 5) + [4], lines + 2 * [""]): ## got = f.readline() ## self.assertEqual(expected, got) @@ -2992,7 +2992,7 @@ class sublist(list): ## f.close() ## except: ## pass - ## support.unlink(support.TESTFN) + ## os_helper.unlink(os_helper.TESTFN) def test_keywords(self): # Testing keyword args to basic type constructors ... diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 63f9b92a83de24..c7d446185cfe4e 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -111,7 +111,7 @@ def checkwarnings(*filters, quiet=False): def decorator(test): def newtest(*args, **kwargs): - with support.check_warnings(*filters, quiet=quiet): + with warnings_helper.check_warnings(*filters, quiet=quiet): test(*args, **kwargs) functools.update_wrapper(newtest, test) return newtest From 45991c0a1ceea514ee038435771f18f8fd6e20f2 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 7 Aug 2020 23:22:02 +0100 Subject: [PATCH 138/197] Update Azure Pipelines build to use Ubuntu 18.04 and move triggers into YAML files (GH-21776) --- .azure-pipelines/ci.yml | 45 +++++------------------------------------ .azure-pipelines/pr.yml | 45 +++++------------------------------------ 2 files changed, 10 insertions(+), 80 deletions(-) diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 50dc50a6549340..531ed060fd3866 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -1,18 +1,14 @@ variables: - manylinux: false coverage: false -resources: - containers: - - container: manylinux1 - image: pyca/cryptography-manylinux1:x86_64 +trigger: ['master', '3.9', '3.8', '3.7'] jobs: - job: Prebuild displayName: Pre-build checks pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 steps: - template: ./prebuild-checks.yml @@ -24,7 +20,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true')) pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 steps: - template: ./docs-steps.yml @@ -56,7 +52,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 variables: testRunTitle: '$(build.sourceBranchName)-linux' @@ -69,37 +65,6 @@ jobs: dependencies: apt -- job: ManyLinux1_CI_Tests - displayName: ManyLinux1 CI Tests - dependsOn: Prebuild - condition: | - and( - and( - succeeded(), - eq(variables['manylinux'], 'true') - ), - eq(dependencies.Prebuild.outputs['tests.run'], 'true') - ) - - pool: - vmImage: ubuntu-16.04 - - container: manylinux1 - - variables: - testRunTitle: '$(build.sourceBranchName)-manylinux1' - testRunPlatform: manylinux1 - openssl_version: '' - - steps: - - template: ./posix-steps.yml - parameters: - dependencies: yum - sudo_dependencies: '' - xvfb: false - patchcheck: false - - - job: Ubuntu_Coverage_CI_Tests displayName: Ubuntu CI Tests (coverage) dependsOn: Prebuild @@ -113,7 +78,7 @@ jobs: ) pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 228f9db4f8ef23..1ffe0a97a2465f 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -1,18 +1,14 @@ variables: - manylinux: false coverage: false -resources: - containers: - - container: manylinux1 - image: pyca/cryptography-manylinux1:x86_64 +pr: ['master', '3.9', '3.8', '3.7'] jobs: - job: Prebuild displayName: Pre-build checks pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 steps: - template: ./prebuild-checks.yml @@ -24,7 +20,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true')) pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 steps: - template: ./docs-steps.yml @@ -56,7 +52,7 @@ jobs: condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true')) pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' @@ -69,37 +65,6 @@ jobs: dependencies: apt -- job: ManyLinux1_PR_Tests - displayName: ManyLinux1 PR Tests - dependsOn: Prebuild - condition: | - and( - and( - succeeded(), - eq(variables['manylinux'], 'true') - ), - eq(dependencies.Prebuild.outputs['tests.run'], 'true') - ) - - pool: - vmImage: ubuntu-16.04 - - container: manylinux1 - - variables: - testRunTitle: '$(system.pullRequest.TargetBranch)-manylinux1' - testRunPlatform: manylinux1 - openssl_version: '' - - steps: - - template: ./posix-steps.yml - parameters: - dependencies: yum - sudo_dependencies: '' - xvfb: false - patchcheck: false - - - job: Ubuntu_Coverage_PR_Tests displayName: Ubuntu PR Tests (coverage) dependsOn: Prebuild @@ -113,7 +78,7 @@ jobs: ) pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' From 3af3e244db3875412f22fb4460b3ad191b51ff2c Mon Sep 17 00:00:00 2001 From: Benjamin Kane Date: Fri, 7 Aug 2020 19:57:03 -0700 Subject: [PATCH 139/197] Doc: Add a link to tutorial page from `open()` doc (GH-21737) Adds a link to the "Reading and Writing Files" page so users can more easily discover how file handles are handled with the `with` context manager vs without it. --- Doc/library/functions.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 3c36b59befab91..43c47c1da9434c 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1055,7 +1055,8 @@ are always available. They are listed here in alphabetical order. .. function:: open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open *file* and return a corresponding :term:`file object`. If the file - cannot be opened, an :exc:`OSError` is raised. + cannot be opened, an :exc:`OSError` is raised. See + :ref:`tut-files` for more examples of how to use this function. *file* is a :term:`path-like object` giving the pathname (absolute or relative to the current working directory) of the file to be opened or an From 8812b08472909317b5307da26b6beeb2ee05daf7 Mon Sep 17 00:00:00 2001 From: Konge Date: Sat, 8 Aug 2020 11:03:09 +0800 Subject: [PATCH 140/197] bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757) --- Lib/dis.py | 2 +- .../next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst diff --git a/Lib/dis.py b/Lib/dis.py index 10e5f7fb08ab21..e289e176c78ffd 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -542,7 +542,7 @@ def _test(): import argparse parser = argparse.ArgumentParser() - parser.add_argument('infile', type=argparse.FileType(), nargs='?', default='-') + parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-') args = parser.parse_args() with args.infile as infile: source = infile.read() diff --git a/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst b/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst new file mode 100644 index 00000000000000..2c863ed7ffa3fa --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-07-06-06-29.bpo-41497.aBtsWz.rst @@ -0,0 +1 @@ +Fix potential UnicodeDecodeError in dis module. \ No newline at end of file From 21d083d575a6cafda5409f83de3d09b90a59bbd1 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sat, 8 Aug 2020 17:32:41 +0800 Subject: [PATCH 141/197] bpo-40275: Remove test helpers aliases in test.support (GH-21771) --- Lib/ctypes/test/test_loading.py | 3 ++- Lib/test/support/__init__.py | 23 ++++------------------- Lib/test/test_os.py | 5 +++-- Lib/test/test_posixpath.py | 2 +- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index 38b45f95fefae8..7b930f92c70cfb 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -6,6 +6,7 @@ import unittest import test.support from test.support import import_helper +from test.support import os_helper from ctypes.util import find_library libc_name = None @@ -125,7 +126,7 @@ def test_load_dll_with_flags(self): else: ext = ".dll" - with test.support.temp_dir() as tmp: + with os_helper.temp_dir() as tmp: # We copy two files and load _sqlite3.dll (formerly .pyd), # which has a dependency on sqlite3.dll. Then we test # loading it in subprocesses to avoid it starting in memory diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index b517df7b53b6ea..e9573d13352102 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -14,25 +14,6 @@ import types import unittest -from .import_helper import ( - CleanImport, DirsOnSysPath, _ignore_deprecated_imports, - _save_and_block_module, _save_and_remove_module, - forget, import_fresh_module, import_module, make_legacy_pyc, - modules_cleanup, modules_setup, unload) -from .os_helper import ( - FS_NONASCII, SAVEDCWD, TESTFN, TESTFN_ASCII, TESTFN_NONASCII, - TESTFN_UNENCODABLE, TESTFN_UNDECODABLE, - TESTFN_UNICODE, can_symlink, can_xattr, - change_cwd, create_empty_file, fd_count, - fs_is_case_insensitive, make_bad_fd, rmdir, - rmtree, skip_unless_symlink, skip_unless_xattr, - temp_cwd, temp_dir, temp_umask, unlink, - EnvironmentVarGuard, FakePath, _longpath) -from .warnings_helper import ( - WarningsRecorder, _filterwarnings, - check_no_resource_warning, check_no_warnings, - check_syntax_warning, check_warnings, ignore_warnings) - from .testresult import get_test_runner @@ -506,6 +487,7 @@ def check_syntax_error(testcase, statement, errtext='', *, lineno=None, offset=N def open_urlresource(url, *args, **kw): import urllib.request, urllib.parse + from .os_helper import unlink try: import gzip except ImportError: @@ -1326,6 +1308,8 @@ def skip_if_buggy_ucrt_strfptime(test): class PythonSymlink: """Creates a symlink for the current Python executable""" def __init__(self, link=None): + from .os_helper import TESTFN + self.link = link or os.path.abspath(TESTFN) self._linked = [] self.real = os.path.realpath(sys.executable) @@ -1980,6 +1964,7 @@ def skip_if_broken_multiprocessing_synchronize(): is no available semaphore implementation, or if creating a lock raises an OSError (on Linux only). """ + from .import_helper import import_module # Skip tests if the _multiprocessing extension is missing. import_module('_multiprocessing') diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 03152072c1bf53..5126c84cf30c68 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -30,6 +30,7 @@ import uuid import warnings from test import support +from test.support import import_helper from test.support import os_helper from test.support import socket_helper from test.support import threading_helper @@ -2674,8 +2675,8 @@ def test_unlink_removes_junction(self): @unittest.skipUnless(sys.platform == "win32", "Win32 specific tests") class Win32NtTests(unittest.TestCase): def test_getfinalpathname_handles(self): - nt = support.import_module('nt') - ctypes = support.import_module('ctypes') + nt = import_helper.import_module('nt') + ctypes = import_helper.import_module('ctypes') import ctypes.wintypes kernel = ctypes.WinDLL('Kernel32.dll', use_last_error=True) diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py index f37e82505796db..42fd8ef8b17465 100644 --- a/Lib/test/test_posixpath.py +++ b/Lib/test/test_posixpath.py @@ -5,7 +5,7 @@ from test import test_genericpath from test.support import import_helper from test.support import os_helper -from test.support import FakePath +from test.support.os_helper import FakePath from unittest import mock try: From 6f30946344de3438b05c463fcbe058a7a88bb56d Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sat, 8 Aug 2020 19:05:24 +0800 Subject: [PATCH 142/197] bpo-40275: Use new test.support helper submodules in tests (GH-21785) --- Lib/test/libregrtest/save_env.py | 6 +++--- Lib/test/test__osx_support.py | 17 +++++++++-------- Lib/test/test_dbm_ndbm.py | 5 ++--- Lib/test/test_zipfile64.py | 5 +++-- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index 50ed35364961c8..4c9c692400b920 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -77,7 +77,7 @@ def get_urllib_requests__url_tempfiles(self): return list(urllib.request._url_tempfiles) def restore_urllib_requests__url_tempfiles(self, tempfiles): for filename in tempfiles: - support.unlink(filename) + os_helper.unlink(filename) def get_urllib_requests__opener(self): return urllib.request._opener @@ -245,9 +245,9 @@ def restore_files(self, saved_value): fn = os_helper.TESTFN if fn not in saved_value and (fn + '/') not in saved_value: if os.path.isfile(fn): - support.unlink(fn) + os_helper.unlink(fn) elif os.path.isdir(fn): - support.rmtree(fn) + os_helper.rmtree(fn) _lc = [getattr(locale, lc) for lc in dir(locale) if lc.startswith('LC_')] diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py index 1a5d649b40f531..a3f41d2c5bd075 100644 --- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -9,6 +9,7 @@ import unittest import test.support +from test.support import os_helper import _osx_support @@ -39,9 +40,9 @@ def test__find_executable(self): if self.env['PATH']: self.env['PATH'] = self.env['PATH'] + ':' self.env['PATH'] = self.env['PATH'] + os.path.abspath(self.temp_path_dir) - test.support.unlink(self.prog_name) + os_helper.unlink(self.prog_name) self.assertIsNone(_osx_support._find_executable(self.prog_name)) - self.addCleanup(test.support.unlink, self.prog_name) + self.addCleanup(os_helper.unlink, self.prog_name) with open(self.prog_name, 'w') as f: f.write("#!/bin/sh\n/bin/echo OK\n") os.chmod(self.prog_name, stat.S_IRWXU) @@ -52,8 +53,8 @@ def test__read_output(self): if self.env['PATH']: self.env['PATH'] = self.env['PATH'] + ':' self.env['PATH'] = self.env['PATH'] + os.path.abspath(self.temp_path_dir) - test.support.unlink(self.prog_name) - self.addCleanup(test.support.unlink, self.prog_name) + os_helper.unlink(self.prog_name) + self.addCleanup(os_helper.unlink, self.prog_name) with open(self.prog_name, 'w') as f: f.write("#!/bin/sh\n/bin/echo ExpectedOutput\n") os.chmod(self.prog_name, stat.S_IRWXU) @@ -143,8 +144,8 @@ def test__find_appropriate_compiler(self): suffix = (':' + self.env['PATH']) if self.env['PATH'] else '' self.env['PATH'] = os.path.abspath(self.temp_path_dir) + suffix for c_name, c_output in compilers: - test.support.unlink(c_name) - self.addCleanup(test.support.unlink, c_name) + os_helper.unlink(c_name) + self.addCleanup(os_helper.unlink, c_name) with open(c_name, 'w') as f: f.write("#!/bin/sh\n/bin/echo " + c_output) os.chmod(c_name, stat.S_IRWXU) @@ -221,8 +222,8 @@ def test__remove_unsupported_archs(self): suffix = (':' + self.env['PATH']) if self.env['PATH'] else '' self.env['PATH'] = os.path.abspath(self.temp_path_dir) + suffix c_name = 'clang' - test.support.unlink(c_name) - self.addCleanup(test.support.unlink, c_name) + os_helper.unlink(c_name) + self.addCleanup(os_helper.unlink, c_name) # exit status 255 means no PPC support in this compiler chain with open(c_name, 'w') as f: f.write("#!/bin/sh\nexit 255") diff --git a/Lib/test/test_dbm_ndbm.py b/Lib/test/test_dbm_ndbm.py index e17a1d9eca9316..639c8330cd7b9e 100644 --- a/Lib/test/test_dbm_ndbm.py +++ b/Lib/test/test_dbm_ndbm.py @@ -1,4 +1,3 @@ -from test import support from test.support import import_helper from test.support import os_helper import_helper.import_module("dbm.ndbm") #skip if not supported @@ -16,7 +15,7 @@ def setUp(self): def tearDown(self): for suffix in ['', '.pag', '.dir', '.db']: - support.unlink(self.filename + suffix) + os_helper.unlink(self.filename + suffix) def test_keys(self): self.d = dbm.ndbm.open(self.filename, 'c') @@ -108,7 +107,7 @@ def test_write_readonly_file(self): def test_nonascii_filename(self): filename = os_helper.TESTFN_NONASCII for suffix in ['', '.pag', '.dir', '.db']: - self.addCleanup(support.unlink, filename + suffix) + self.addCleanup(os_helper.unlink, filename + suffix) with dbm.ndbm.open(filename, 'c') as db: db[b'key'] = b'value' self.assertTrue(any(os.path.exists(filename + suffix) diff --git a/Lib/test/test_zipfile64.py b/Lib/test/test_zipfile64.py index 3a788de221264d..810fdedef39ddd 100644 --- a/Lib/test/test_zipfile64.py +++ b/Lib/test/test_zipfile64.py @@ -17,6 +17,7 @@ from tempfile import TemporaryFile +from test.support import os_helper from test.support import TESTFN, requires_zlib TESTFN2 = TESTFN + "2" @@ -138,8 +139,8 @@ def testMoreThan64kFilesAppend(self): self.assertEqual(content, "%d" % (i**3 % 57)) def tearDown(self): - support.unlink(TESTFN) - support.unlink(TESTFN2) + os_helper.unlink(TESTFN) + os_helper.unlink(TESTFN2) if __name__ == "__main__": unittest.main() From 2305eb812448bfe2abc69ad66ad0ee3968e1f189 Mon Sep 17 00:00:00 2001 From: Yaroslav Pankovych <31005942+P-Alban@users.noreply.github.com> Date: Sat, 8 Aug 2020 21:48:21 +0300 Subject: [PATCH 143/197] bpo-41455: Provide a link to how the third generation is collected in the GC docs (GH-21703) Co-authored-by: Pablo Galindo --- Doc/library/gc.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/gc.rst b/Doc/library/gc.rst index 0c33c865304591..2d85cd3431711a 100644 --- a/Doc/library/gc.rst +++ b/Doc/library/gc.rst @@ -106,9 +106,9 @@ The :mod:`gc` module provides the following functions: allocations minus the number of deallocations exceeds *threshold0*, collection starts. Initially only generation ``0`` is examined. If generation ``0`` has been examined more than *threshold1* times since generation ``1`` has been - examined, then generation ``1`` is examined as well. Similarly, *threshold2* - controls the number of collections of generation ``1`` before collecting - generation ``2``. + examined, then generation ``1`` is examined as well. + With the third generation, things are a bit more complicated, + see `Collecting the oldest generation `_ for more information. .. function:: get_count() From 3543029679910a9dde1327b2faf9d24ebba4cecf Mon Sep 17 00:00:00 2001 From: Jiajie Zhong Date: Sun, 9 Aug 2020 03:29:03 +0800 Subject: [PATCH 144/197] Doc: Add output to example code in programming FAQ (GH-21346) Add output hint to document, part faq/programming, section [How do I write a function with output parameters (call by reference)?](https://docs.python.org/3/faq/programming.html#how-do-i-write-a-function-with-output-parameters-call-by-reference). This patch make the output hint just like prefix code block. --- Doc/faq/programming.rst | 71 +++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 61ffc5dbdaa773..0731e92f6dbc60 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -518,14 +518,14 @@ desired effect in a number of ways. 1) By returning a tuple of the results:: - def func2(a, b): - a = 'new-value' # a and b are local names - b = b + 1 # assigned to new objects - return a, b # return new values - - x, y = 'old-value', 99 - x, y = func2(x, y) - print(x, y) # output: new-value 100 + >>> def func1(a, b): + ... a = 'new-value' # a and b are local names + ... b = b + 1 # assigned to new objects + ... return a, b # return new values + ... + >>> x, y = 'old-value', 99 + >>> func1(x, y) + ('new-value', 100) This is almost always the clearest solution. @@ -533,38 +533,41 @@ desired effect in a number of ways. 3) By passing a mutable (changeable in-place) object:: - def func1(a): - a[0] = 'new-value' # 'a' references a mutable list - a[1] = a[1] + 1 # changes a shared object - - args = ['old-value', 99] - func1(args) - print(args[0], args[1]) # output: new-value 100 + >>> def func2(a): + ... a[0] = 'new-value' # 'a' references a mutable list + ... a[1] = a[1] + 1 # changes a shared object + ... + >>> args = ['old-value', 99] + >>> func2(args) + >>> args + ['new-value', 100] 4) By passing in a dictionary that gets mutated:: - def func3(args): - args['a'] = 'new-value' # args is a mutable dictionary - args['b'] = args['b'] + 1 # change it in-place - - args = {'a': 'old-value', 'b': 99} - func3(args) - print(args['a'], args['b']) + >>> def func3(args): + ... args['a'] = 'new-value' # args is a mutable dictionary + ... args['b'] = args['b'] + 1 # change it in-place + ... + >>> args = {'a': 'old-value', 'b': 99} + >>> func3(args) + >>> args + {'a': 'new-value', 'b': 100} 5) Or bundle up values in a class instance:: - class callByRef: - def __init__(self, /, **args): - for key, value in args.items(): - setattr(self, key, value) - - def func4(args): - args.a = 'new-value' # args is a mutable callByRef - args.b = args.b + 1 # change object in-place - - args = callByRef(a='old-value', b=99) - func4(args) - print(args.a, args.b) + >>> class Namespace: + ... def __init__(self, /, **args): + ... for key, value in args.items(): + ... setattr(self, key, value) + ... + >>> def func4(args): + ... args.a = 'new-value' # args is a mutable Namespace + ... args.b = args.b + 1 # change object in-place + ... + >>> args = Namespace(a='old-value', b=99) + >>> func4(args) + >>> vars(args) + {'a': 'new-value', 'b': 100} There's almost never a good reason to get this complicated. From 4f87cfcf1252e0b96342cc14f0dc92e11a91228d Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Sun, 9 Aug 2020 04:50:53 -0600 Subject: [PATCH 145/197] bpo-35018: Sax parser should provide user access to lexical handlers (GH-20958) Co-Authored-By: Jonathan Gossage --- Doc/library/xml.sax.handler.rst | 62 ++++++- Doc/whatsnew/3.10.rst | 7 + Lib/test/test_sax.py | 157 +++++++++++++++++- Lib/xml/sax/handler.py | 45 +++++ .../2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst | 2 + 5 files changed, 264 insertions(+), 9 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst diff --git a/Doc/library/xml.sax.handler.rst b/Doc/library/xml.sax.handler.rst index ae0877ca90db07..3746a58c9b9558 100644 --- a/Doc/library/xml.sax.handler.rst +++ b/Doc/library/xml.sax.handler.rst @@ -11,12 +11,12 @@ -------------- -The SAX API defines four kinds of handlers: content handlers, DTD handlers, -error handlers, and entity resolvers. Applications normally only need to -implement those interfaces whose events they are interested in; they can -implement the interfaces in a single object or in multiple objects. Handler -implementations should inherit from the base classes provided in the module -:mod:`xml.sax.handler`, so that all methods get default implementations. +The SAX API defines five kinds of handlers: content handlers, DTD handlers, +error handlers, entity resolvers and lexical handlers. Applications normally +only need to implement those interfaces whose events they are interested in; +they can implement the interfaces in a single object or in multiple objects. +Handler implementations should inherit from the base classes provided in the +module :mod:`xml.sax.handler`, so that all methods get default implementations. .. class:: ContentHandler @@ -47,6 +47,12 @@ implementations should inherit from the base classes provided in the module application. The methods of this object control whether errors are immediately converted to exceptions or are handled in some other way. + +.. class:: LexicalHandler + + Interface used by the parser to represent low freqency events which may not + be of interest to many applications. + In addition to these classes, :mod:`xml.sax.handler` provides symbolic constants for the feature and property names. @@ -114,7 +120,7 @@ for the feature and property names. .. data:: property_lexical_handler | value: ``"http://xml.org/sax/properties/lexical-handler"`` - | data type: xml.sax.sax2lib.LexicalHandler (not supported in Python 2) + | data type: xml.sax.handler.LexicalHandler (not supported in Python 2) | description: An optional extension handler for lexical events like comments. | access: read/write @@ -413,3 +419,45 @@ the passed-in exception object. information will continue to be passed to the application. Raising an exception in this method will cause parsing to end. + +.. _lexical-handler-objects: + +LexicalHandler Objects +---------------------- +Optional SAX2 handler for lexical events. + +This handler is used to obtain lexical information about an XML +document. Lexical information includes information describing the +document encoding used and XML comments embedded in the document, as +well as section boundaries for the DTD and for any CDATA sections. +The lexical handlers are used in the same manner as content handlers. + +Set the LexicalHandler of an XMLReader by using the setProperty method +with the property identifier +``'http://xml.org/sax/properties/lexical-handler'``. + + +.. method:: LexicalHandler.comment(content) + + Reports a comment anywhere in the document (including the DTD and + outside the document element). + +.. method:: LexicalHandler.startDTD(name, public_id, system_id) + + Reports the start of the DTD declarations if the document has an + associated DTD. + +.. method:: LexicalHandler.endDTD() + + Reports the end of DTD declaration. + +.. method:: LexicalHandler.startCDATA() + + Reports the start of a CDATA marked section. + + The contents of the CDATA marked section will be reported through + the characters handler. + +.. method:: LexicalHandler.endCDATA() + + Reports the end of a CDATA marked section. diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 62bb1438416e6c..2af0ea3f4dd640 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -139,6 +139,13 @@ Add :data:`sys.orig_argv` attribute: the list of the original command line arguments passed to the Python executable. (Contributed by Victor Stinner in :issue:`23427`.) +xml +--- + +Add a :class:`~xml.sax.handler.LexicalHandler` class to the +:mod:`xml.sax.handler` module. +(Contributed by Jonathan Gossage and Zackery Spytz in :issue:`35018`.) + Optimizations ============= diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py index cfc674be5d141d..801143f9b5f810 100644 --- a/Lib/test/test_sax.py +++ b/Lib/test/test_sax.py @@ -13,7 +13,8 @@ from xml.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \ XMLFilterBase, prepare_input_source from xml.sax.expatreader import create_parser -from xml.sax.handler import feature_namespaces, feature_external_ges +from xml.sax.handler import (feature_namespaces, feature_external_ges, + LexicalHandler) from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl from io import BytesIO, StringIO import codecs @@ -1356,6 +1357,155 @@ def test_nsattrs_wattr(self): self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr") +class LexicalHandlerTest(unittest.TestCase): + def setUp(self): + self.parser = None + + self.specified_version = '1.0' + self.specified_encoding = 'UTF-8' + self.specified_doctype = 'wish' + self.specified_entity_names = ('nbsp', 'source', 'target') + self.specified_comment = ('Comment in a DTD', + 'Really! You think so?') + self.test_data = StringIO() + self.test_data.write('\n'. + format(self.specified_version, + self.specified_encoding)) + self.test_data.write('\n'. + format(self.specified_comment[0])) + self.test_data.write('\n'. + format(self.specified_doctype)) + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.write('\n'. + format(self.specified_entity_names[0])) + self.test_data.write('\n'. + format(self.specified_entity_names[1])) + self.test_data.write('\n'. + format(self.specified_entity_names[2])) + self.test_data.write(']>\n') + self.test_data.write('<{}>'.format(self.specified_doctype)) + self.test_data.write('Aristotle\n') + self.test_data.write('Alexander\n') + self.test_data.write('Supplication\n') + self.test_data.write('Teach me patience!\n') + self.test_data.write('
    &{};&{};&{};
    \n'. + format(self.specified_entity_names[1], + self.specified_entity_names[0], + self.specified_entity_names[2])) + self.test_data.write('\n'.format(self.specified_comment[1])) + self.test_data.write('\n'.format(self.specified_doctype)) + self.test_data.seek(0) + + # Data received from handlers - to be validated + self.version = None + self.encoding = None + self.standalone = None + self.doctype = None + self.publicID = None + self.systemID = None + self.end_of_dtd = False + self.comments = [] + + def test_handlers(self): + class TestLexicalHandler(LexicalHandler): + def __init__(self, test_harness, *args, **kwargs): + super().__init__(*args, **kwargs) + self.test_harness = test_harness + + def startDTD(self, doctype, publicID, systemID): + self.test_harness.doctype = doctype + self.test_harness.publicID = publicID + self.test_harness.systemID = systemID + + def endDTD(self): + self.test_harness.end_of_dtd = True + + def comment(self, text): + self.test_harness.comments.append(text) + + self.parser = create_parser() + self.parser.setContentHandler(ContentHandler()) + self.parser.setProperty( + 'http://xml.org/sax/properties/lexical-handler', + TestLexicalHandler(self)) + source = InputSource() + source.setCharacterStream(self.test_data) + self.parser.parse(source) + self.assertEqual(self.doctype, self.specified_doctype) + self.assertIsNone(self.publicID) + self.assertIsNone(self.systemID) + self.assertTrue(self.end_of_dtd) + self.assertEqual(len(self.comments), + len(self.specified_comment)) + self.assertEqual(f' {self.specified_comment[0]} ', self.comments[0]) + + +class CDATAHandlerTest(unittest.TestCase): + def setUp(self): + self.parser = None + self.specified_chars = [] + self.specified_chars.append(('Parseable character data', False)) + self.specified_chars.append(('<> &% - assorted other XML junk.', True)) + self.char_index = 0 # Used to index specified results within handlers + self.test_data = StringIO() + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.write(f'{self.specified_chars[0][0]}\n') + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.write(f'\n') + self.test_data.write('\n') + self.test_data.write('\n') + self.test_data.seek(0) + + # Data received from handlers - to be validated + self.chardata = [] + self.in_cdata = False + + def test_handlers(self): + class TestLexicalHandler(LexicalHandler): + def __init__(self, test_harness, *args, **kwargs): + super().__init__(*args, **kwargs) + self.test_harness = test_harness + + def startCDATA(self): + self.test_harness.in_cdata = True + + def endCDATA(self): + self.test_harness.in_cdata = False + + class TestCharHandler(ContentHandler): + def __init__(self, test_harness, *args, **kwargs): + super().__init__(*args, **kwargs) + self.test_harness = test_harness + + def characters(self, content): + if content != '\n': + h = self.test_harness + t = h.specified_chars[h.char_index] + h.assertEqual(t[0], content) + h.assertEqual(t[1], h.in_cdata) + h.char_index += 1 + + self.parser = create_parser() + self.parser.setContentHandler(TestCharHandler(self)) + self.parser.setProperty( + 'http://xml.org/sax/properties/lexical-handler', + TestLexicalHandler(self)) + source = InputSource() + source.setCharacterStream(self.test_data) + self.parser.parse(source) + + self.assertFalse(self.in_cdata) + self.assertEqual(self.char_index, 2) + + def test_main(): run_unittest(MakeParserTest, ParseTest, @@ -1368,7 +1518,10 @@ def test_main(): StreamReaderWriterXmlgenTest, ExpatReaderTest, ErrorReportingTest, - XmlReaderTest) + XmlReaderTest, + LexicalHandlerTest, + CDATAHandlerTest) + if __name__ == "__main__": test_main() diff --git a/Lib/xml/sax/handler.py b/Lib/xml/sax/handler.py index 481733d2cbe6e5..e8d417e5194232 100644 --- a/Lib/xml/sax/handler.py +++ b/Lib/xml/sax/handler.py @@ -340,3 +340,48 @@ def resolveEntity(self, publicId, systemId): property_xml_string, property_encoding, property_interning_dict] + + +class LexicalHandler: + """Optional SAX2 handler for lexical events. + + This handler is used to obtain lexical information about an XML + document, that is, information about how the document was encoded + (as opposed to what it contains, which is reported to the + ContentHandler), such as comments and CDATA marked section + boundaries. + + To set the LexicalHandler of an XMLReader, use the setProperty + method with the property identifier + 'http://xml.org/sax/properties/lexical-handler'.""" + + def comment(self, content): + """Reports a comment anywhere in the document (including the + DTD and outside the document element). + + content is a string that holds the contents of the comment.""" + + def startDTD(self, name, public_id, system_id): + """Report the start of the DTD declarations, if the document + has an associated DTD. + + A startEntity event will be reported before declaration events + from the external DTD subset are reported, and this can be + used to infer from which subset DTD declarations derive. + + name is the name of the document element type, public_id the + public identifier of the DTD (or None if none were supplied) + and system_id the system identfier of the external subset (or + None if none were supplied).""" + + def endDTD(self): + """Signals the end of DTD declarations.""" + + def startCDATA(self): + """Reports the beginning of a CDATA marked section. + + The contents of the CDATA marked section will be reported + through the characters event.""" + + def endCDATA(self): + """Reports the end of a CDATA marked section.""" diff --git a/Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst b/Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst new file mode 100644 index 00000000000000..f764323ae631cf --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-17-23-49-45.bpo-35018.NP5_Qk.rst @@ -0,0 +1,2 @@ +Add the :class:`xml.sax.handler.LexicalHandler` class that is present in +other SAX XML implementations. From 67ac0eb95790d3f3c7f1382c10622056639e4284 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 9 Aug 2020 13:08:19 -0400 Subject: [PATCH 146/197] Improve renamed test_run.RecursionLimitTest (GH-21794) PEP 8 style and new comments. --- Lib/idlelib/idle_test/test_run.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py index 9995dbe2eca502..e2bdf1cfee3521 100644 --- a/Lib/idlelib/idle_test/test_run.py +++ b/Lib/idlelib/idle_test/test_run.py @@ -282,7 +282,8 @@ def test_close(self): self.assertRaises(TypeError, f.close, 1) -class TestSysRecursionLimitWrappers(unittest.TestCase): +class RecursionLimitTest(unittest.TestCase): + # Test (un)install_recursionlimit_wrappers and fixdoc. def test_bad_setrecursionlimit_calls(self): run.install_recursionlimit_wrappers() @@ -296,12 +297,12 @@ def test_roundtrip(self): run.install_recursionlimit_wrappers() self.addCleanup(run.uninstall_recursionlimit_wrappers) - # check that setting the recursion limit works + # Check that setting the recursion limit works. orig_reclimit = sys.getrecursionlimit() self.addCleanup(sys.setrecursionlimit, orig_reclimit) sys.setrecursionlimit(orig_reclimit + 3) - # check that the new limit is returned by sys.getrecursionlimit() + # Check that the new limit is returned by sys.getrecursionlimit(). new_reclimit = sys.getrecursionlimit() self.assertEqual(new_reclimit, orig_reclimit + 3) @@ -313,6 +314,7 @@ def test_default_recursion_limit_preserved(self): self.assertEqual(new_reclimit, orig_reclimit) def test_fixdoc(self): + # Put here until better place for miscellaneous test. def func(): "docstring" run.fixdoc(func, "more") self.assertEqual(func.__doc__, "docstring\n\nmore") From b3b7e7b3552b16f75563695b31291ac180d5a294 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 9 Aug 2020 16:08:30 -0400 Subject: [PATCH 147/197] bpo-41468: Improve and test IDLE run error exit (GH-21798) A message box pops up when an unexpected error stops the run process. Tell users it is likely a random glitch, but report it if not. --- Lib/idlelib/NEWS.txt | 3 ++ Lib/idlelib/idle_test/test_run.py | 32 +++++++++++++++++-- Lib/idlelib/run.py | 23 ++++++++----- .../2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst | 1 + 4 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index e0a671983c746d..fd762077b1b3cf 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-41468: Improve IDLE run crash error message (which users should +never see). + bpo-41373: Save files loaded with no line ending, as when blank, or different line endings, by setting its line ending to the system default. Fix regression in 3.8.4 and 3.9.0b4. diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py index e2bdf1cfee3521..469c13d756d5e8 100644 --- a/Lib/idlelib/idle_test/test_run.py +++ b/Lib/idlelib/idle_test/test_run.py @@ -1,9 +1,10 @@ -"Test run, coverage 42%." +"Test run, coverage 49%." from idlelib import run import unittest from unittest import mock -from test.support import captured_stderr +from idlelib.idle_test.mock_idle import Func +from test.support import captured_output, captured_stderr import io import sys @@ -323,5 +324,32 @@ def func(): "docstring" self.assertEqual(func.__doc__, "more") +class HandleErrorTest(unittest.TestCase): + # Method of MyRPCServer + func = Func() + @mock.patch('idlelib.run.thread.interrupt_main', new=func) + def test_error(self): + eq = self.assertEqual + with captured_output('__stderr__') as err: + try: + raise EOFError + except EOFError: + run.MyRPCServer.handle_error(None, 'abc', '123') + eq(run.exit_now, True) + run.exit_now = False + eq(err.getvalue(), '') + + try: + raise IndexError + except IndexError: + run.MyRPCServer.handle_error(None, 'abc', '123') + eq(run.quitting, True) + run.quitting = False + msg = err.getvalue() + self.assertIn('abc', msg) + self.assertIn('123', msg) + self.assertIn('IndexError', msg) + eq(self.func.called, 2) + if __name__ == '__main__': unittest.main(verbosity=2) diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 5bd84aadcd8011..1e84ecc6584ef1 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -387,14 +387,21 @@ def handle_error(self, request, client_address): thread.interrupt_main() except: erf = sys.__stderr__ - print('\n' + '-'*40, file=erf) - print('Unhandled server exception!', file=erf) - print('Thread: %s' % threading.current_thread().name, file=erf) - print('Client Address: ', client_address, file=erf) - print('Request: ', repr(request), file=erf) - traceback.print_exc(file=erf) - print('\n*** Unrecoverable, server exiting!', file=erf) - print('-'*40, file=erf) + print(textwrap.dedent(f""" + {'-'*40} + Unhandled exception in user code execution server!' + Thread: {threading.current_thread().name} + IDLE Client Address: {client_address} + Request: {request!r} + """), file=erf) + traceback.print_exc(limit=-20, file=erf) + print(textwrap.dedent(f""" + *** Unrecoverable, server exiting! + + Users should never see this message; it is likely transient. + If this recurs, report this with a copy of the message + and an explanation of how to make it repeat. + {'-'*40}"""), file=erf) quitting = True thread.interrupt_main() diff --git a/Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst b/Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst new file mode 100644 index 00000000000000..e41c7d574905cd --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2020-08-09-13-42-55.bpo-41468.zkP0_Y.rst @@ -0,0 +1 @@ +Improve IDLE run crash error message (which users should never see). From 5637492fccf1de10ff5920e2f849ced090e3f74d Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 10 Aug 2020 09:43:56 -0400 Subject: [PATCH 148/197] bpo-41514: Fix buggy IDLE test (GH-21808) test_run method test_fatal_error failed when run twice, as with python -m test -m test_fatal_error test_idle test_idle because func.called was not reinitialized to 0. This bug caused a failure on a refleak buildbot. --- Lib/idlelib/idle_test/test_run.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py index 469c13d756d5e8..37c0d4525e56cd 100644 --- a/Lib/idlelib/idle_test/test_run.py +++ b/Lib/idlelib/idle_test/test_run.py @@ -326,11 +326,11 @@ def func(): "docstring" class HandleErrorTest(unittest.TestCase): # Method of MyRPCServer - func = Func() - @mock.patch('idlelib.run.thread.interrupt_main', new=func) - def test_error(self): + def test_fatal_error(self): eq = self.assertEqual - with captured_output('__stderr__') as err: + with captured_output('__stderr__') as err,\ + mock.patch('idlelib.run.thread.interrupt_main', + new_callable=Func) as func: try: raise EOFError except EOFError: @@ -349,7 +349,7 @@ def test_error(self): self.assertIn('abc', msg) self.assertIn('123', msg) self.assertIn('IndexError', msg) - eq(self.func.called, 2) + eq(func.called, 2) if __name__ == '__main__': unittest.main(verbosity=2) From d3aa84a19f44970895eaed4e05136a2c757f2056 Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Mon, 10 Aug 2020 16:32:21 +0200 Subject: [PATCH 149/197] bpo-41324 Add a minimal decimal capsule API (#21519) --- Doc/c-api/concrete.rst | 1 + Doc/c-api/decimal.rst | 231 ++++++++++++++++ Include/pydecimal.h | 180 +++++++++++++ Lib/test/test_decimal.py | 176 ++++++++++++ .../2020-08-10-16-05-08.bpo-41324.waZD35.rst | 3 + Modules/_decimal/_decimal.c | 185 ++++++++++++- Modules/_decimal/tests/deccheck.py | 74 +++++ Modules/_testcapimodule.c | 253 ++++++++++++++++++ 8 files changed, 1096 insertions(+), 7 deletions(-) create mode 100644 Doc/c-api/decimal.rst create mode 100644 Include/pydecimal.h create mode 100644 Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst index c1d9fa1b41a3fe..bf263d6e4c2641 100644 --- a/Doc/c-api/concrete.rst +++ b/Doc/c-api/concrete.rst @@ -115,3 +115,4 @@ Other Objects coro.rst contextvars.rst datetime.rst + decimal.rst diff --git a/Doc/c-api/decimal.rst b/Doc/c-api/decimal.rst new file mode 100644 index 00000000000000..f530571ebae577 --- /dev/null +++ b/Doc/c-api/decimal.rst @@ -0,0 +1,231 @@ +.. sectionauthor:: Stefan Krah + +.. highlight:: c + + +Decimal capsule API +=================== + +Capsule API functions can be used in the same manner as regular library +functions, provided that the API has been initialized. + + +Initialize +---------- + +Typically, a C extension module that uses the decimal API will do these +steps in its init function: + +.. code-block:: + + #include "pydecimal.h" + + static int decimal_initialized = 0; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + +Type checking, predicates, accessors +------------------------------------ + +.. c:function:: int PyDec_TypeCheck(const PyObject *dec) + + Return 1 if ``dec`` is a Decimal, 0 otherwise. This function does not set + any exceptions. + + +.. c:function:: int PyDec_IsSpecial(const PyObject *dec) + + Return 1 if ``dec`` is ``NaN``, ``sNaN`` or ``Infinity``, 0 otherwise. + + Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that + this is the only failure mode, so if ``dec`` has already been type-checked, no + errors can occur and the function can be treated as a simple predicate. + + +.. c:function:: int PyDec_IsNaN(const PyObject *dec) + + Return 1 if ``dec`` is ``NaN`` or ``sNaN``, 0 otherwise. + + Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that + this is the only failure mode, so if ``dec`` has already been type-checked, no + errors can occur and the function can be treated as a simple predicate. + + +.. c:function:: int PyDec_IsInfinite(const PyObject *dec) + + Return 1 if ``dec`` is ``Infinity``, 0 otherwise. + + Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that + this is the only failure mode, so if ``dec`` has already been type-checked, no + errors can occur and the function can be treated as a simple predicate. + + +.. c:function:: int64_t PyDec_GetDigits(const PyObject *dec) + + Return the number of digits in the coefficient. For ``Infinity``, the + number of digits is always zero. Typically, the same applies to ``NaN`` + and ``sNaN``, but both of these can have a payload that is equivalent to + a coefficient. Therefore, ``NaNs`` can have a nonzero return value. + + Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that + this is the only failure mode, so if ``dec`` has already been type-checked, no + errors can occur and the function can be treated as a simple accessor. + + +Exact conversions between decimals and primitive C types +-------------------------------------------------------- + +This API supports conversions for decimals with a coefficient up to 38 digits. + +Data structures +~~~~~~~~~~~~~~~ + +The conversion functions use the following status codes and data structures: + +.. code-block:: + + /* status cases for getting a triple */ + enum mpd_triple_class { + MPD_TRIPLE_NORMAL, + MPD_TRIPLE_INF, + MPD_TRIPLE_QNAN, + MPD_TRIPLE_SNAN, + MPD_TRIPLE_ERROR, + }; + + typedef struct { + enum mpd_triple_class tag; + uint8_t sign; + uint64_t hi; + uint64_t lo; + int64_t exp; + } mpd_uint128_triple_t; + +The status cases are explained below. ``sign`` is 0 for positive and 1 for negative. +``((uint128_t)hi << 64) + lo`` is the coefficient, ``exp`` is the exponent. + +The data structure is called "triple" because the decimal triple (sign, coeff, exp) +is an established term and (``hi``, ``lo``) represents a single ``uint128_t`` coefficient. + + +Functions +~~~~~~~~~ + +.. c:function:: mpd_uint128_triple_t PyDec_AsUint128Triple(const PyObject *dec) + + Convert a decimal to a triple. As above, it is guaranteed that the only + Python failure mode is a TypeError, checks can be omitted if the type is + known. + + For simplicity, the usage of the function and all special cases are + explained in code form and comments: + +.. code-block:: + + triple = PyDec_AsUint128Triple(dec); + switch (triple.tag) { + case MPD_TRIPLE_QNAN: + /* + * Success: handle a quiet NaN. + * 1) triple.sign is 0 or 1. + * 2) triple.exp is always 0. + * 3) If triple.hi or triple.lo are nonzero, the NaN has a payload. + */ + break; + + case MPD_TRIPLE_SNAN: + /* + * Success: handle a signaling NaN. + * 1) triple.sign is 0 or 1. + * 2) triple.exp is always 0. + * 3) If triple.hi or triple.lo are nonzero, the sNaN has a payload. + */ + break; + + case MPD_TRIPLE_INF: + /* + * Success: handle Infinity. + * 1) triple.sign is 0 or 1. + * 2) triple.exp is always 0. + * 3) triple.hi and triple.lo are always zero. + */ + break; + + case MPD_TRIPLE_NORMAL: + /* Success: handle a finite value. */ + break; + + case MPD_TRIPLE_ERROR: + /* TypeError check: can be omitted if the type of dec is known. */ + if (PyErr_Occurred()) { + return NULL; + } + + /* Too large for conversion. PyDec_AsUint128Triple() does not set an + exception so applications can choose themselves. Typically this + would be a ValueError. */ + PyErr_SetString(PyExc_ValueError, + "value out of bounds for a uint128 triple"); + return NULL; + } + +.. c:function:: PyObject *PyDec_FromUint128Triple(const mpd_uint128_triple_t *triple) + + Create a decimal from a triple. The following rules must be observed for + initializing the triple: + + 1) ``triple.sign`` must always be 0 (for positive) or 1 (for negative). + + 2) ``MPD_TRIPLE_QNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple.lo`` + are nonzero, create a ``NaN`` with a payload. + + 3) ``MPD_TRIPLE_SNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple.lo`` + are nonzero, create an ``sNaN`` with a payload. + + 4) ``MPD_TRIPLE_INF``: ``triple.exp``, ``triple.hi`` and ``triple.lo`` must be zero. + + 5) ``MPD_TRIPLE_NORMAL``: ``MPD_MIN_ETINY + 38 < triple.exp < MPD_MAX_EMAX - 38``. + ``triple.hi`` and ``triple.lo`` can be chosen freely. + + 6) ``MPD_TRIPLE_ERROR``: It is always an error to set this tag. + + + If one of the above conditions is not met, the function returns ``NaN`` if + the ``InvalidOperation`` trap is not set in the thread local context. Otherwise, + it sets the ``InvalidOperation`` exception and returns NULL. + + Additionally, though extremely unlikely give the small allocation sizes, + the function can set ``MemoryError`` and return ``NULL``. + + +Advanced API +------------ + +This API enables the use of ``libmpdec`` functions. Since Python is compiled with +hidden symbols, the API requires an external libmpdec and the ``mpdecimal.h`` +header. + + +Functions +~~~~~~~~~ + +.. c:function:: PyObject *PyDec_Alloc(void) + + Return a new decimal that can be used in the ``result`` position of ``libmpdec`` + functions. + +.. c:function:: mpd_t *PyDec_Get(PyObject *v) + + Get a pointer to the internal ``mpd_t`` of the decimal. Decimals are immutable, + so this function must only be used on a new Decimal that has been created by + PyDec_Alloc(). + +.. c:function:: const mpd_t *PyDec_GetConst(const PyObject *v) + + Get a pointer to the constant internal ``mpd_t`` of the decimal. diff --git a/Include/pydecimal.h b/Include/pydecimal.h new file mode 100644 index 00000000000000..9b6440e1c2ab1c --- /dev/null +++ b/Include/pydecimal.h @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2020 Stefan Krah. 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. + * + * 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. + */ + + +#ifndef CPYTHON_DECIMAL_H_ +#define CPYTHON_DECIMAL_H_ + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/****************************************************************************/ +/* Libmpdec API */ +/****************************************************************************/ + +#ifndef LIBMPDEC_MPDECIMAL_H_ +struct mpd_t; /* ABI-stable in the libmpdec-2.x series */ + +/* status cases for getting a triple */ +enum mpd_triple_class { + MPD_TRIPLE_NORMAL, + MPD_TRIPLE_INF, + MPD_TRIPLE_QNAN, + MPD_TRIPLE_SNAN, + MPD_TRIPLE_ERROR, +}; + +typedef struct { + enum mpd_triple_class tag; + uint8_t sign; + uint64_t hi; + uint64_t lo; + int64_t exp; +} mpd_uint128_triple_t; +#endif + + +/****************************************************************************/ +/* Capsule API */ +/****************************************************************************/ + +/* Simple API */ +#define PyDec_TypeCheck_INDEX 0 +#define PyDec_TypeCheck_RETURN int +#define PyDec_TypeCheck_ARGS (const PyObject *) + +#define PyDec_IsSpecial_INDEX 1 +#define PyDec_IsSpecial_RETURN int +#define PyDec_IsSpecial_ARGS (const PyObject *) + +#define PyDec_IsNaN_INDEX 2 +#define PyDec_IsNaN_RETURN int +#define PyDec_IsNaN_ARGS (const PyObject *) + +#define PyDec_IsInfinite_INDEX 3 +#define PyDec_IsInfinite_RETURN int +#define PyDec_IsInfinite_ARGS (const PyObject *) + +#define PyDec_GetDigits_INDEX 4 +#define PyDec_GetDigits_RETURN int64_t +#define PyDec_GetDigits_ARGS (const PyObject *) + +#define PyDec_AsUint128Triple_INDEX 5 +#define PyDec_AsUint128Triple_RETURN mpd_uint128_triple_t +#define PyDec_AsUint128Triple_ARGS (const PyObject *) + +#define PyDec_FromUint128Triple_INDEX 6 +#define PyDec_FromUint128Triple_RETURN PyObject * +#define PyDec_FromUint128Triple_ARGS (const mpd_uint128_triple_t *triple) + +/* Advanced API */ +#define PyDec_Alloc_INDEX 7 +#define PyDec_Alloc_RETURN PyObject * +#define PyDec_Alloc_ARGS (void) + +#define PyDec_Get_INDEX 8 +#define PyDec_Get_RETURN mpd_t * +#define PyDec_Get_ARGS (PyObject *) + +#define PyDec_GetConst_INDEX 9 +#define PyDec_GetConst_RETURN const mpd_t * +#define PyDec_GetConst_ARGS (const PyObject *) + +#define CPYTHON_DECIMAL_MAX_API 10 + + +#ifdef CPYTHON_DECIMAL_MODULE +/* Simple API */ +static PyDec_TypeCheck_RETURN PyDec_TypeCheck PyDec_TypeCheck_ARGS; +static PyDec_IsSpecial_RETURN PyDec_IsSpecial PyDec_IsSpecial_ARGS; +static PyDec_IsNaN_RETURN PyDec_IsNaN PyDec_IsNaN_ARGS; +static PyDec_IsInfinite_RETURN PyDec_IsInfinite PyDec_IsInfinite_ARGS; +static PyDec_GetDigits_RETURN PyDec_GetDigits PyDec_GetDigits_ARGS; +static PyDec_AsUint128Triple_RETURN PyDec_AsUint128Triple PyDec_AsUint128Triple_ARGS; +static PyDec_FromUint128Triple_RETURN PyDec_FromUint128Triple PyDec_FromUint128Triple_ARGS; + +/* Advanced API */ +static PyDec_Alloc_RETURN PyDec_Alloc PyDec_Alloc_ARGS; +static PyDec_Get_RETURN PyDec_Get PyDec_Get_ARGS; +static PyDec_GetConst_RETURN PyDec_GetConst PyDec_GetConst_ARGS; +#else +static void **_decimal_api; + +/* Simple API */ +#define PyDec_TypeCheck \ + (*(PyDec_TypeCheck_RETURN (*)PyDec_TypeCheck_ARGS) _decimal_api[PyDec_TypeCheck_INDEX]) + +#define PyDec_IsSpecial \ + (*(PyDec_IsSpecial_RETURN (*)PyDec_IsSpecial_ARGS) _decimal_api[PyDec_IsSpecial_INDEX]) + +#define PyDec_IsNaN \ + (*(PyDec_IsNaN_RETURN (*)PyDec_IsNaN_ARGS) _decimal_api[PyDec_IsNaN_INDEX]) + +#define PyDec_IsInfinite \ + (*(PyDec_IsInfinite_RETURN (*)PyDec_IsInfinite_ARGS) _decimal_api[PyDec_IsInfinite_INDEX]) + +#define PyDec_GetDigits \ + (*(PyDec_GetDigits_RETURN (*)PyDec_GetDigits_ARGS) _decimal_api[PyDec_GetDigits_INDEX]) + +#define PyDec_AsUint128Triple \ + (*(PyDec_AsUint128Triple_RETURN (*)PyDec_AsUint128Triple_ARGS) _decimal_api[PyDec_AsUint128Triple_INDEX]) + +#define PyDec_FromUint128Triple \ + (*(PyDec_FromUint128Triple_RETURN (*)PyDec_FromUint128Triple_ARGS) _decimal_api[PyDec_FromUint128Triple_INDEX]) + +/* Advanced API */ +#define PyDec_Alloc \ + (*(PyDec_Alloc_RETURN (*)PyDec_Alloc_ARGS) _decimal_api[PyDec_Alloc_INDEX]) + +#define PyDec_Get \ + (*(PyDec_Get_RETURN (*)PyDec_Get_ARGS) _decimal_api[PyDec_Get_INDEX]) + +#define PyDec_GetConst \ + (*(PyDec_GetConst_RETURN (*)PyDec_GetConst_ARGS) _decimal_api[PyDec_GetConst_INDEX]) + + +static int +import_decimal(void) +{ + _decimal_api = (void **)PyCapsule_Import("_decimal._API", 0); + if (_decimal_api == NULL) { + return -1; + } + + return 0; +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* CPYTHON_DECIMAL_H_ */ diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 5d0992a66e6cea..113b37ddaa9cd6 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -43,6 +43,13 @@ import inspect import threading +from _testcapi import decimal_is_special +from _testcapi import decimal_is_nan +from _testcapi import decimal_is_infinite +from _testcapi import decimal_get_digits +from _testcapi import decimal_as_triple +from _testcapi import decimal_from_triple + C = import_fresh_module('decimal', fresh=['_decimal']) P = import_fresh_module('decimal', blocked=['_decimal']) @@ -4751,6 +4758,175 @@ def test_constants(self): self.assertEqual(C.DecTraps, C.DecErrors|C.DecOverflow|C.DecUnderflow) + def test_decimal_api_predicates(self): + # Capsule API + + d = C.Decimal("0") + self.assertFalse(decimal_is_special(d)) + self.assertFalse(decimal_is_nan(d)) + self.assertFalse(decimal_is_infinite(d)) + + d = C.Decimal("NaN") + self.assertTrue(decimal_is_special(d)) + self.assertTrue(decimal_is_nan(d)) + self.assertFalse(decimal_is_infinite(d)) + + d = C.Decimal("sNaN") + self.assertTrue(decimal_is_special(d)) + self.assertTrue(decimal_is_nan(d)) + self.assertFalse(decimal_is_infinite(d)) + + d = C.Decimal("inf") + self.assertTrue(decimal_is_special(d)) + self.assertFalse(decimal_is_nan(d)) + self.assertTrue(decimal_is_infinite(d)) + + def test_decimal_api_get_digits(self): + # Capsule API + + d = C.Decimal("0") + self.assertEqual(decimal_get_digits(d), 1) + + d = C.Decimal("1234567890") + self.assertEqual(decimal_get_digits(d), 10) + + d = C.Decimal("inf") + self.assertEqual(decimal_get_digits(d), 0) + + d = C.Decimal("NaN") + self.assertEqual(decimal_get_digits(d), 0) + + d = C.Decimal("sNaN") + self.assertEqual(decimal_get_digits(d), 0) + + d = C.Decimal("NaN1234567890") + self.assertEqual(decimal_get_digits(d), 10) + + d = C.Decimal("sNaN1234567890") + self.assertEqual(decimal_get_digits(d), 10) + + def test_decimal_api_triple(self): + # Capsule API + + def as_triple(d): + """Convert a decimal to a decimal triple with a split uint128_t + coefficient: + + (sign, hi, lo, exp) + + It is called 'triple' because (hi, lo) are regarded as a single + uint128_t that is split because not all compilers support uint128_t. + """ + sign, digits, exp = d.as_tuple() + + s = "".join(str(d) for d in digits) + coeff = int(s) if s else 0 + + if coeff < 0 or coeff >= 2**128: + raise ValueError("value out of bounds for a uint128 triple"); + + hi, lo = divmod(coeff, 2**64) + return (sign, hi, lo, exp) + + def from_triple(triple): + """Convert a decimal triple with a split uint128_t coefficient to a string. + """ + sign, hi, lo, exp = triple + coeff = hi * 2**64 + lo + + if coeff < 0 or coeff >= 2**128: + raise ValueError("value out of bounds for a uint128 triple"); + + digits = tuple(int(c) for c in str(coeff)) + + return P.Decimal((sign, digits, exp)) + + signs = ["", "-"] + + coefficients = [ + "000000000000000000000000000000000000000", + + "299999999999999999999999999999999999999", + "299999999999999999990000000000000000000", + "200000000000000000009999999999999999999", + "000000000000000000009999999999999999999", + + "299999999999999999999999999999000000000", + "299999999999999999999000000000999999999", + "299999999999000000000999999999999999999", + "299000000000999999999999999999999999999", + "000999999999999999999999999999999999999", + + "300000000000000000000000000000000000000", + "310000000000000000001000000000000000000", + "310000000000000000000000000000000000000", + "300000000000000000001000000000000000000", + + "340100000000100000000100000000100000000", + "340100000000100000000100000000000000000", + "340100000000100000000000000000100000000", + "340100000000000000000100000000100000000", + "340000000000100000000100000000100000000", + + "340282366920938463463374607431768211455", + ] + + exponents = [ + "E+0", "E+1", "E-1", + "E+%s" % str(C.MAX_EMAX-38), + "E-%s" % str(C.MIN_ETINY+38), + ] + + for sign in signs: + for coeff in coefficients: + for exp in exponents: + s = sign + coeff + exp + + ctriple = decimal_as_triple(C.Decimal(s)) + ptriple = as_triple(P.Decimal(s)) + self.assertEqual(ctriple, ptriple) + + c = decimal_from_triple(ctriple) + p = decimal_from_triple(ptriple) + self.assertEqual(str(c), str(p)) + + for s in ["NaN", "-NaN", "sNaN", "-sNaN", "NaN123", "sNaN123", "inf", "-inf"]: + ctriple = decimal_as_triple(C.Decimal(s)) + ptriple = as_triple(P.Decimal(s)) + self.assertEqual(ctriple, ptriple) + + c = decimal_from_triple(ctriple) + p = decimal_from_triple(ptriple) + self.assertEqual(str(c), str(p)) + + def test_decimal_api_errors(self): + # Capsule API + + self.assertRaises(TypeError, decimal_as_triple, "X") + self.assertRaises(ValueError, decimal_as_triple, C.Decimal(2**128)) + self.assertRaises(ValueError, decimal_as_triple, C.Decimal(-2**128)) + + self.assertRaises(TypeError, decimal_from_triple, "X") + self.assertRaises(ValueError, decimal_from_triple, ()) + self.assertRaises(ValueError, decimal_from_triple, (1, 2, 3, 4, 5)) + self.assertRaises(ValueError, decimal_from_triple, (2**8, 0, 0, 0)) + self.assertRaises(OverflowError, decimal_from_triple, (0, 2**64, 0, 0)) + self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 2**64, 0)) + self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 0, 2**63)) + self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 0, -2**63-1)) + self.assertRaises(ValueError, decimal_from_triple, (0, 0, 0, "X")) + self.assertRaises(TypeError, decimal_from_triple, (0, 0, 0, ())) + + with C.localcontext(C.Context()): + self.assertRaises(C.InvalidOperation, decimal_from_triple, (2, 0, 0, 0)) + self.assertRaises(C.InvalidOperation, decimal_from_triple, (0, 0, 0, 2**63-1)) + self.assertRaises(C.InvalidOperation, decimal_from_triple, (0, 0, 0, -2**63)) + + self.assertRaises(TypeError, decimal_is_special, "X") + self.assertRaises(TypeError, decimal_is_nan, "X") + self.assertRaises(TypeError, decimal_is_infinite, "X") + self.assertRaises(TypeError, decimal_get_digits, "X") + class CWhitebox(unittest.TestCase): """Whitebox testing for _decimal""" diff --git a/Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst b/Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst new file mode 100644 index 00000000000000..e09332ab11e1d7 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-08-10-16-05-08.bpo-41324.waZD35.rst @@ -0,0 +1,3 @@ +Add a minimal decimal capsule API. The API supports fast conversions +between Decimals up to 38 digits and their triple representation as a C +struct. diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index fb4e020f1260e6..e7c44acba02fc2 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,6 +33,8 @@ #include +#define CPYTHON_DECIMAL_MODULE +#include "pydecimal.h" #include "docstrings.h" @@ -5555,6 +5557,160 @@ static PyTypeObject PyDecContext_Type = }; +/****************************************************************************/ +/* C-API */ +/****************************************************************************/ + +static void *_decimal_api[CPYTHON_DECIMAL_MAX_API]; + +/* Simple API */ +static int +PyDec_TypeCheck(const PyObject *v) +{ + return PyDec_Check(v); +} + +static int +PyDec_IsSpecial(const PyObject *v) +{ + if (!PyDec_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "PyDec_IsSpecial: argument must be a Decimal"); + return -1; + } + + return mpd_isspecial(MPD(v)); +} + +static int +PyDec_IsNaN(const PyObject *v) +{ + if (!PyDec_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "PyDec_IsNaN: argument must be a Decimal"); + return -1; + } + + return mpd_isnan(MPD(v)); +} + +static int +PyDec_IsInfinite(const PyObject *v) +{ + if (!PyDec_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "PyDec_IsInfinite: argument must be a Decimal"); + return -1; + } + + return mpd_isinfinite(MPD(v)); +} + +static int64_t +PyDec_GetDigits(const PyObject *v) +{ + if (!PyDec_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "PyDec_GetDigits: argument must be a Decimal"); + return -1; + } + + return MPD(v)->digits; +} + +static mpd_uint128_triple_t +PyDec_AsUint128Triple(const PyObject *v) +{ + if (!PyDec_Check(v)) { + mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 }; + PyErr_SetString(PyExc_TypeError, + "PyDec_AsUint128Triple: argument must be a Decimal"); + return triple; + } + + return mpd_as_uint128_triple(MPD(v)); +} + +static PyObject * +PyDec_FromUint128Triple(const mpd_uint128_triple_t *triple) +{ + PyObject *context; + PyObject *result; + uint32_t status = 0; + + CURRENT_CONTEXT(context); + + result = dec_alloc(); + if (result == NULL) { + return NULL; + } + + if (mpd_from_uint128_triple(MPD(result), triple, &status) < 0) { + if (dec_addstatus(context, status)) { + Py_DECREF(result); + return NULL; + } + } + + return result; +} + +/* Advanced API */ +static PyObject * +PyDec_Alloc(void) +{ + return dec_alloc(); +} + +static mpd_t * +PyDec_Get(PyObject *v) +{ + if (!PyDec_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "PyDec_Get: argument must be a Decimal"); + return NULL; + } + + return MPD(v); +} + +static const mpd_t * +PyDec_GetConst(const PyObject *v) +{ + if (!PyDec_Check(v)) { + PyErr_SetString(PyExc_TypeError, + "PyDec_GetConst: argument must be a Decimal"); + return NULL; + } + + return MPD(v); +} + +static PyObject * +init_api(void) +{ + /* Simple API */ + _decimal_api[PyDec_TypeCheck_INDEX] = (void *)PyDec_TypeCheck; + _decimal_api[PyDec_IsSpecial_INDEX] = (void *)PyDec_IsSpecial; + _decimal_api[PyDec_IsNaN_INDEX] = (void *)PyDec_IsNaN; + _decimal_api[PyDec_IsInfinite_INDEX] = (void *)PyDec_IsInfinite; + _decimal_api[PyDec_GetDigits_INDEX] = (void *)PyDec_GetDigits; + _decimal_api[PyDec_AsUint128Triple_INDEX] = (void *)PyDec_AsUint128Triple; + _decimal_api[PyDec_FromUint128Triple_INDEX] = (void *)PyDec_FromUint128Triple; + + /* Advanced API */ + _decimal_api[PyDec_Alloc_INDEX] = (void *)PyDec_Alloc; + _decimal_api[PyDec_Get_INDEX] = (void *)PyDec_Get; + _decimal_api[PyDec_GetConst_INDEX] = (void *)PyDec_GetConst; + + return PyCapsule_New(_decimal_api, "_decimal._API", NULL); +} + + +/****************************************************************************/ +/* Module */ +/****************************************************************************/ + static PyMethodDef _decimal_methods [] = { { "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext}, @@ -5665,17 +5821,27 @@ PyInit__decimal(void) DecCondMap *cm; struct ssize_constmap *ssize_cm; struct int_constmap *int_cm; + static PyObject *capsule = NULL; + static int initialized = 0; int i; /* Init libmpdec */ - mpd_traphandler = dec_traphandler; - mpd_mallocfunc = PyMem_Malloc; - mpd_reallocfunc = PyMem_Realloc; - mpd_callocfunc = mpd_callocfunc_em; - mpd_free = PyMem_Free; - mpd_setminalloc(_Py_DEC_MINALLOC); + if (!initialized) { + mpd_traphandler = dec_traphandler; + mpd_mallocfunc = PyMem_Malloc; + mpd_reallocfunc = PyMem_Realloc; + mpd_callocfunc = mpd_callocfunc_em; + mpd_free = PyMem_Free; + mpd_setminalloc(_Py_DEC_MINALLOC); + + capsule = init_api(); + if (capsule == NULL) { + return NULL; + } + initialized = 1; + } /* Init external C-API functions */ _py_long_multiply = PyLong_Type.tp_as_number->nb_multiply; @@ -5900,6 +6066,11 @@ PyInit__decimal(void) CHECK_INT(PyModule_AddStringConstant(m, "__version__", "1.70")); CHECK_INT(PyModule_AddStringConstant(m, "__libmpdec_version__", mpd_version())); + /* Add capsule API */ + Py_INCREF(capsule); + if (PyModule_AddObject(m, "_API", capsule) < 0) { + goto error; + } return m; diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index 5d9179e61689d0..15f104dc463cb8 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -49,6 +49,9 @@ from formathelper import rand_format, rand_locale from _pydecimal import _dec_from_triple +from _testcapi import decimal_as_triple +from _testcapi import decimal_from_triple + C = import_fresh_module('decimal', fresh=['_decimal']) P = import_fresh_module('decimal', blocked=['_decimal']) EXIT_STATUS = 0 @@ -153,6 +156,45 @@ TernaryRestricted = ['__pow__', 'context.power'] +# ====================================================================== +# Triple tests +# ====================================================================== + +def c_as_triple(dec): + sign, hi, lo, exp = decimal_as_triple(dec) + + coeff = hi * 2**64 + lo + return (sign, coeff, exp) + +def c_from_triple(triple): + sign, coeff, exp = triple + + hi = coeff // 2**64 + lo = coeff % 2**64 + return decimal_from_triple((sign, hi, lo, exp)) + +def p_as_triple(dec): + sign, digits, exp = dec.as_tuple() + + s = "".join(str(d) for d in digits) + coeff = int(s) if s else 0 + + if coeff < 0 or coeff >= 2**128: + raise ValueError("value out of bounds for a uint128 triple"); + + return (sign, coeff, exp) + +def p_from_triple(triple): + sign, coeff, exp = triple + + if coeff < 0 or coeff >= 2**128: + raise ValueError("value out of bounds for a uint128 triple"); + + digits = tuple(int(c) for c in str(coeff)) + + return P.Decimal((sign, digits, exp)) + + # ====================================================================== # Unified Context # ====================================================================== @@ -846,12 +888,44 @@ def verify(t, stat): t.presults.append(str(t.rp.imag)) t.presults.append(str(t.rp.real)) + ctriple = None + if t.funcname not in ['__radd__', '__rmul__']: # see skip handler + try: + ctriple = c_as_triple(t.rc) + except ValueError: + try: + ptriple = p_as_triple(t.rp) + except ValueError: + pass + else: + raise RuntimeError("ValueError not raised") + else: + cres = c_from_triple(ctriple) + t.cresults.append(ctriple) + t.cresults.append(str(cres)) + + ptriple = p_as_triple(t.rp) + pres = p_from_triple(ptriple) + t.presults.append(ptriple) + t.presults.append(str(pres)) + if t.with_maxcontext and isinstance(t.rmax, C.Decimal): t.maxresults.append(t.rmax.to_eng_string()) t.maxresults.append(t.rmax.as_tuple()) t.maxresults.append(str(t.rmax.imag)) t.maxresults.append(str(t.rmax.real)) + if ctriple is not None: + # NaN payloads etc. depend on precision and clamp. + if all_nan(t.rc) and all_nan(t.rmax): + t.maxresults.append(ctriple) + t.maxresults.append(str(cres)) + else: + maxtriple = c_as_triple(t.rmax) + maxres = c_from_triple(maxtriple) + t.maxresults.append(maxtriple) + t.maxresults.append(str(maxres)) + nc = t.rc.number_class().lstrip('+-s') stat[nc] += 1 else: diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index fca94a83a5d04e..593034ef65e2ca 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -19,6 +19,7 @@ #include "Python.h" #include "datetime.h" +#include "pydecimal.h" #include "marshal.h" #include "structmember.h" // PyMemberDef #include @@ -2705,6 +2706,252 @@ test_PyDateTime_DELTA_GET(PyObject *self, PyObject *obj) return Py_BuildValue("(lll)", days, seconds, microseconds); } +/* Test decimal API */ +static int decimal_initialized = 0; +static PyObject * +decimal_is_special(PyObject *module, PyObject *dec) +{ + int is_special; + + (void)module; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + is_special = PyDec_IsSpecial(dec); + if (is_special < 0) { + return NULL; + } + + return PyBool_FromLong(is_special); +} + +static PyObject * +decimal_is_nan(PyObject *module, PyObject *dec) +{ + int is_nan; + + (void)module; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + is_nan = PyDec_IsNaN(dec); + if (is_nan < 0) { + return NULL; + } + + return PyBool_FromLong(is_nan); +} + +static PyObject * +decimal_is_infinite(PyObject *module, PyObject *dec) +{ + int is_infinite; + + (void)module; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + is_infinite = PyDec_IsInfinite(dec); + if (is_infinite < 0) { + return NULL; + } + + return PyBool_FromLong(is_infinite); +} + +static PyObject * +decimal_get_digits(PyObject *module, PyObject *dec) +{ + int64_t digits; + + (void)module; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + digits = PyDec_GetDigits(dec); + if (digits < 0) { + return NULL; + } + + return PyLong_FromLongLong(digits); +} + +static PyObject * +decimal_as_triple(PyObject *module, PyObject *dec) +{ + PyObject *tuple = NULL; + PyObject *sign, *hi, *lo; + mpd_uint128_triple_t triple; + + (void)module; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + triple = PyDec_AsUint128Triple(dec); + if (triple.tag == MPD_TRIPLE_ERROR && PyErr_Occurred()) { + return NULL; + } + + sign = PyLong_FromUnsignedLong(triple.sign); + if (sign == NULL) { + return NULL; + } + + hi = PyLong_FromUnsignedLongLong(triple.hi); + if (hi == NULL) { + Py_DECREF(sign); + return NULL; + } + + lo = PyLong_FromUnsignedLongLong(triple.lo); + if (lo == NULL) { + Py_DECREF(hi); + Py_DECREF(sign); + return NULL; + } + + switch (triple.tag) { + case MPD_TRIPLE_QNAN: + assert(triple.exp == 0); + tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "n"); + break; + + case MPD_TRIPLE_SNAN: + assert(triple.exp == 0); + tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "N"); + break; + + case MPD_TRIPLE_INF: + assert(triple.hi == 0); + assert(triple.lo == 0); + assert(triple.exp == 0); + tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "F"); + break; + + case MPD_TRIPLE_NORMAL: + tuple = Py_BuildValue("(OOOL)", sign, hi, lo, triple.exp); + break; + + case MPD_TRIPLE_ERROR: + PyErr_SetString(PyExc_ValueError, + "value out of bounds for a uint128 triple"); + break; + + default: + PyErr_SetString(PyExc_RuntimeError, + "decimal_as_triple: internal error: unexpected tag"); + break; + } + + Py_DECREF(lo); + Py_DECREF(hi); + Py_DECREF(sign); + + return tuple; +} + +static PyObject * +decimal_from_triple(PyObject *module, PyObject *tuple) +{ + mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 }; + PyObject *exp; + unsigned long sign; + + (void)module; + if (!decimal_initialized) { + if (import_decimal() < 0) { + return NULL; + } + + decimal_initialized = 1; + } + + if (!PyTuple_Check(tuple)) { + PyErr_SetString(PyExc_TypeError, "argument must be a tuple"); + return NULL; + } + + if (PyTuple_GET_SIZE(tuple) != 4) { + PyErr_SetString(PyExc_ValueError, "tuple size must be 4"); + return NULL; + } + + sign = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(tuple, 0)); + if (sign == (unsigned long)-1 && PyErr_Occurred()) { + return NULL; + } + if (sign > UINT8_MAX) { + PyErr_SetString(PyExc_ValueError, "sign must be 0 or 1"); + return NULL; + } + triple.sign = (uint8_t)sign; + + triple.hi = PyLong_AsUnsignedLongLong(PyTuple_GET_ITEM(tuple, 1)); + if (triple.hi == (unsigned long long)-1 && PyErr_Occurred()) { + return NULL; + } + + triple.lo = PyLong_AsUnsignedLongLong(PyTuple_GET_ITEM(tuple, 2)); + if (triple.lo == (unsigned long long)-1 && PyErr_Occurred()) { + return NULL; + } + + exp = PyTuple_GET_ITEM(tuple, 3); + if (PyLong_Check(exp)) { + triple.tag = MPD_TRIPLE_NORMAL; + triple.exp = PyLong_AsLongLong(exp); + if (triple.exp == -1 && PyErr_Occurred()) { + return NULL; + } + } + else if (PyUnicode_Check(exp)) { + if (PyUnicode_CompareWithASCIIString(exp, "F") == 0) { + triple.tag = MPD_TRIPLE_INF; + } + else if (PyUnicode_CompareWithASCIIString(exp, "n") == 0) { + triple.tag = MPD_TRIPLE_QNAN; + } + else if (PyUnicode_CompareWithASCIIString(exp, "N") == 0) { + triple.tag = MPD_TRIPLE_SNAN; + } + else { + PyErr_SetString(PyExc_ValueError, "not a valid exponent"); + return NULL; + } + } + else { + PyErr_SetString(PyExc_TypeError, "exponent must be int or string"); + return NULL; + } + + return PyDec_FromUint128Triple(&triple); +} + /* test_thread_state spawns a thread of its own, and that thread releases * `thread_done` when it's finished. The driver code has to know when the * thread finishes, because the thread uses a PyObject (the callable) that @@ -5314,6 +5561,12 @@ static PyMethodDef TestMethods[] = { {"PyDateTime_DATE_GET", test_PyDateTime_DATE_GET, METH_O}, {"PyDateTime_TIME_GET", test_PyDateTime_TIME_GET, METH_O}, {"PyDateTime_DELTA_GET", test_PyDateTime_DELTA_GET, METH_O}, + {"decimal_is_special", decimal_is_special, METH_O}, + {"decimal_is_nan", decimal_is_nan, METH_O}, + {"decimal_is_infinite", decimal_is_infinite, METH_O}, + {"decimal_get_digits", decimal_get_digits, METH_O}, + {"decimal_as_triple", decimal_as_triple, METH_O}, + {"decimal_from_triple", decimal_from_triple, METH_O}, {"test_list_api", test_list_api, METH_NOARGS}, {"test_dict_iteration", test_dict_iteration, METH_NOARGS}, {"dict_getitem_knownhash", dict_getitem_knownhash, METH_VARARGS}, From 3705f269cdcdad896d8f411df408e45000ba1efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Mon, 10 Aug 2020 15:48:20 +0100 Subject: [PATCH 150/197] bpo-16995: add support for base32 extended hex (base32hex) (GH-20441) cc @pganssle Automerge-Triggered-By: @pganssle --- Doc/library/base64.rst | 23 ++++- Doc/whatsnew/3.10.rst | 6 ++ Lib/base64.py | 86 ++++++++++++------- Lib/test/test_base64.py | 70 +++++++++++++++ .../2020-05-27-00-09-52.bpo-16995.4niOT7.rst | 2 + 5 files changed, 155 insertions(+), 32 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst index 1ff22a00d6199d..2f24bb63912fb6 100644 --- a/Doc/library/base64.rst +++ b/Doc/library/base64.rst @@ -124,7 +124,7 @@ The modern interface provides: whether a lowercase alphabet is acceptable as input. For security purposes, the default is ``False``. - :rfc:`3548` allows for optional mapping of the digit 0 (zero) to the letter O + :rfc:`4648` allows for optional mapping of the digit 0 (zero) to the letter O (oh), and for optional mapping of the digit 1 (one) to either the letter I (eye) or letter L (el). The optional argument *map01* when not ``None``, specifies which letter the digit 1 should be mapped to (when *map01* is not ``None``, the @@ -136,6 +136,27 @@ The modern interface provides: input. +.. function:: b32hexencode(s) + + Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined in + :rfc:`4648`. + + .. versionadded:: 3.10 + + +.. function:: b32hexdecode(s, casefold=False) + + Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined in + :rfc:`4648`. + + This version does not allow the digit 0 (zero) to the letter O (oh) and digit + 1 (one) to either the letter I (eye) or letter L (el) mappings, all these + characters are included in the Extended Hex Alphabet and are not + interchangable. + + .. versionadded:: 3.10 + + .. function:: b16encode(s) Encode the :term:`bytes-like object` *s* using Base16 and return the diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index 2af0ea3f4dd640..eb5ae01a7c04d4 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -103,6 +103,12 @@ New Modules Improved Modules ================ +base64 +------ + +Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support the +Base32 Encoding with Extended Hex Alphabet. + curses ------ diff --git a/Lib/base64.py b/Lib/base64.py index a28109f8a7f9c3..539ad16f0e86d6 100755 --- a/Lib/base64.py +++ b/Lib/base64.py @@ -16,7 +16,7 @@ 'encode', 'decode', 'encodebytes', 'decodebytes', # Generalized interface for other encodings 'b64encode', 'b64decode', 'b32encode', 'b32decode', - 'b16encode', 'b16decode', + 'b32hexencode', 'b32hexdecode', 'b16encode', 'b16decode', # Base85 and Ascii85 encodings 'b85encode', 'b85decode', 'a85encode', 'a85decode', # Standard Base64 encoding @@ -135,19 +135,40 @@ def urlsafe_b64decode(s): # Base32 encoding/decoding must be done in Python +_B32_ENCODE_DOCSTRING = ''' +Encode the bytes-like objects using {encoding} and return a bytes object. +''' +_B32_DECODE_DOCSTRING = ''' +Decode the {encoding} encoded bytes-like object or ASCII string s. + +Optional casefold is a flag specifying whether a lowercase alphabet is +acceptable as input. For security purposes, the default is False. +{extra_args} +The result is returned as a bytes object. A binascii.Error is raised if +the input is incorrectly padded or if there are non-alphabet +characters present in the input. +''' +_B32_DECODE_MAP01_DOCSTRING = ''' +RFC 3548 allows for optional mapping of the digit 0 (zero) to the +letter O (oh), and for optional mapping of the digit 1 (one) to +either the letter I (eye) or letter L (el). The optional argument +map01 when not None, specifies which letter the digit 1 should be +mapped to (when map01 is not None, the digit 0 is always mapped to +the letter O). For security purposes the default is None, so that +0 and 1 are not allowed in the input. +''' _b32alphabet = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' -_b32tab2 = None -_b32rev = None +_b32hexalphabet = b'0123456789ABCDEFGHIJKLMNOPQRSTUV' +_b32tab2 = {} +_b32rev = {} -def b32encode(s): - """Encode the bytes-like object s using Base32 and return a bytes object. - """ +def _b32encode(alphabet, s): global _b32tab2 # Delay the initialization of the table to not waste memory # if the function is never called - if _b32tab2 is None: - b32tab = [bytes((i,)) for i in _b32alphabet] - _b32tab2 = [a + b for a in b32tab for b in b32tab] + if alphabet not in _b32tab2: + b32tab = [bytes((i,)) for i in alphabet] + _b32tab2[alphabet] = [a + b for a in b32tab for b in b32tab] b32tab = None if not isinstance(s, bytes_types): @@ -158,7 +179,7 @@ def b32encode(s): s = s + b'\0' * (5 - leftover) # Don't use += ! encoded = bytearray() from_bytes = int.from_bytes - b32tab2 = _b32tab2 + b32tab2 = _b32tab2[alphabet] for i in range(0, len(s), 5): c = from_bytes(s[i: i + 5], 'big') encoded += (b32tab2[c >> 30] + # bits 1 - 10 @@ -177,29 +198,12 @@ def b32encode(s): encoded[-1:] = b'=' return bytes(encoded) -def b32decode(s, casefold=False, map01=None): - """Decode the Base32 encoded bytes-like object or ASCII string s. - - Optional casefold is a flag specifying whether a lowercase alphabet is - acceptable as input. For security purposes, the default is False. - - RFC 3548 allows for optional mapping of the digit 0 (zero) to the - letter O (oh), and for optional mapping of the digit 1 (one) to - either the letter I (eye) or letter L (el). The optional argument - map01 when not None, specifies which letter the digit 1 should be - mapped to (when map01 is not None, the digit 0 is always mapped to - the letter O). For security purposes the default is None, so that - 0 and 1 are not allowed in the input. - - The result is returned as a bytes object. A binascii.Error is raised if - the input is incorrectly padded or if there are non-alphabet - characters present in the input. - """ +def _b32decode(alphabet, s, casefold=False, map01=None): global _b32rev # Delay the initialization of the table to not waste memory # if the function is never called - if _b32rev is None: - _b32rev = {v: k for k, v in enumerate(_b32alphabet)} + if alphabet not in _b32rev: + _b32rev[alphabet] = {v: k for k, v in enumerate(alphabet)} s = _bytes_from_decode_data(s) if len(s) % 8: raise binascii.Error('Incorrect padding') @@ -220,7 +224,7 @@ def b32decode(s, casefold=False, map01=None): padchars = l - len(s) # Now decode the full quanta decoded = bytearray() - b32rev = _b32rev + b32rev = _b32rev[alphabet] for i in range(0, len(s), 8): quanta = s[i: i + 8] acc = 0 @@ -241,6 +245,26 @@ def b32decode(s, casefold=False, map01=None): return bytes(decoded) +def b32encode(s): + return _b32encode(_b32alphabet, s) +b32encode.__doc__ = _B32_ENCODE_DOCSTRING.format(encoding='base32') + +def b32decode(s, casefold=False, map01=None): + return _b32decode(_b32alphabet, s, casefold, map01) +b32decode.__doc__ = _B32_DECODE_DOCSTRING.format(encoding='base32', + extra_args=_B32_DECODE_MAP01_DOCSTRING) + +def b32hexencode(s): + return _b32encode(_b32hexalphabet, s) +b32hexencode.__doc__ = _B32_ENCODE_DOCSTRING.format(encoding='base32hex') + +def b32hexdecode(s, casefold=False): + # base32hex does not have the 01 mapping + return _b32decode(_b32hexalphabet, s, casefold) +b32hexdecode.__doc__ = _B32_DECODE_DOCSTRING.format(encoding='base32hex', + extra_args='') + + # RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns # lowercase. The RFC also recommends against accepting input case # insensitively. diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py index 1f67e46cd22677..4f62c4115f60aa 100644 --- a/Lib/test/test_base64.py +++ b/Lib/test/test_base64.py @@ -351,6 +351,76 @@ def test_b32decode_error(self): with self.assertRaises(binascii.Error): base64.b32decode(data.decode('ascii')) + def test_b32hexencode(self): + test_cases = [ + # to_encode, expected + (b'', b''), + (b'\x00', b'00======'), + (b'a', b'C4======'), + (b'ab', b'C5H0===='), + (b'abc', b'C5H66==='), + (b'abcd', b'C5H66P0='), + (b'abcde', b'C5H66P35'), + ] + for to_encode, expected in test_cases: + with self.subTest(to_decode=to_encode): + self.assertEqual(base64.b32hexencode(to_encode), expected) + + def test_b32hexencode_other_types(self): + self.check_other_types(base64.b32hexencode, b'abcd', b'C5H66P0=') + self.check_encode_type_errors(base64.b32hexencode) + + def test_b32hexdecode(self): + test_cases = [ + # to_decode, expected, casefold + (b'', b'', False), + (b'00======', b'\x00', False), + (b'C4======', b'a', False), + (b'C5H0====', b'ab', False), + (b'C5H66===', b'abc', False), + (b'C5H66P0=', b'abcd', False), + (b'C5H66P35', b'abcde', False), + (b'', b'', True), + (b'00======', b'\x00', True), + (b'C4======', b'a', True), + (b'C5H0====', b'ab', True), + (b'C5H66===', b'abc', True), + (b'C5H66P0=', b'abcd', True), + (b'C5H66P35', b'abcde', True), + (b'c4======', b'a', True), + (b'c5h0====', b'ab', True), + (b'c5h66===', b'abc', True), + (b'c5h66p0=', b'abcd', True), + (b'c5h66p35', b'abcde', True), + ] + for to_decode, expected, casefold in test_cases: + with self.subTest(to_decode=to_decode, casefold=casefold): + self.assertEqual(base64.b32hexdecode(to_decode, casefold), + expected) + self.assertEqual(base64.b32hexdecode(to_decode.decode('ascii'), + casefold), expected) + + def test_b32hexdecode_other_types(self): + self.check_other_types(base64.b32hexdecode, b'C5H66===', b'abc') + self.check_decode_type_errors(base64.b32hexdecode) + + def test_b32hexdecode_error(self): + tests = [b'abc', b'ABCDEF==', b'==ABCDEF', b'c4======'] + prefixes = [b'M', b'ME', b'MFRA', b'MFRGG', b'MFRGGZA', b'MFRGGZDF'] + for i in range(0, 17): + if i: + tests.append(b'='*i) + for prefix in prefixes: + if len(prefix) + i != 8: + tests.append(prefix + b'='*i) + for data in tests: + with self.subTest(to_decode=data): + with self.assertRaises(binascii.Error): + base64.b32hexdecode(data) + with self.assertRaises(binascii.Error): + base64.b32hexdecode(data.decode('ascii')) + + def test_b16encode(self): eq = self.assertEqual eq(base64.b16encode(b'\x01\x02\xab\xcd\xef'), b'0102ABCDEF') diff --git a/Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst b/Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst new file mode 100644 index 00000000000000..88b95998d085f6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-05-27-00-09-52.bpo-16995.4niOT7.rst @@ -0,0 +1,2 @@ +Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support the +Base32 Encoding with Extended Hex Alphabet. From 450f4ea6b04c0d742077d7104a702809c423a593 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 10 Aug 2020 18:36:59 +0200 Subject: [PATCH 151/197] bpo-40548: Fix "Check for source changes (pull_request)" GH Action job (GH-21806) On Git 2.28, "git diff master..." (3 dots) no longer works when "fetch --depth=1" is used, whereas it works on Git 2.26. Replace "..." (3 dots) with ".." (2 dots) in the "git diff" command computing the list of modified files between the base branch and the PR branch. --- .github/workflows/build.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5649a6670e75f5..df68fe271de7a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,20 @@ jobs: echo '::set-output name=run_tests::true' else git fetch origin $GITHUB_BASE_REF --depth=1 - git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true + # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more + # reliable than git diff "origin/$GITHUB_BASE_REF.." (2 dots), + # but it requires to download more commits (this job uses + # "git fetch --depth=1"). + # + # git diff "origin/$GITHUB_BASE_REF..." (3 dots) works with Git + # 2.26, but Git 2.28 is stricter and fails with "no merge base". + # + # git diff "origin/$GITHUB_BASE_REF.." (2 dots) should be enough on + # GitHub, since GitHub starts by merging origin/$GITHUB_BASE_REF + # into the PR branch anyway. + # + # https://github.com/python/core-workflow/issues/373 + git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true fi build_win32: name: 'Windows (x86)' From 6309e420f0e392bfd648c78e441241132e54a0cb Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Mon, 10 Aug 2020 21:54:50 +0200 Subject: [PATCH 152/197] Replace import_fresh_module in decimal test files (GH-21815) --- Modules/_decimal/tests/bench.py | 9 +++------ Modules/_decimal/tests/deccheck.py | 7 ++++--- Modules/_decimal/tests/formathelper.py | 5 ++--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Modules/_decimal/tests/bench.py b/Modules/_decimal/tests/bench.py index 3726db194e032f..88fd7b5ae0be38 100644 --- a/Modules/_decimal/tests/bench.py +++ b/Modules/_decimal/tests/bench.py @@ -7,13 +7,10 @@ import time -try: - from test.support import import_fresh_module -except ImportError: - from test.test_support import import_fresh_module -C = import_fresh_module('decimal', fresh=['_decimal']) -P = import_fresh_module('decimal', blocked=['_decimal']) +import _decimal as C +import _pydecimal as P + # # NOTE: This is the pi function from the decimal documentation, modified diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index 15f104dc463cb8..0b2a1c49336ef0 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -43,7 +43,6 @@ from queue import Queue, Empty from threading import Thread, Event, Lock -from test.support import import_fresh_module from randdec import randfloat, all_unary, all_binary, all_ternary from randdec import unary_optarg, binary_optarg, ternary_optarg from formathelper import rand_format, rand_locale @@ -52,8 +51,10 @@ from _testcapi import decimal_as_triple from _testcapi import decimal_from_triple -C = import_fresh_module('decimal', fresh=['_decimal']) -P = import_fresh_module('decimal', blocked=['_decimal']) +import _decimal as C +import _pydecimal as P + + EXIT_STATUS = 0 diff --git a/Modules/_decimal/tests/formathelper.py b/Modules/_decimal/tests/formathelper.py index 19b2aad4a503b1..482e02a25c2a8c 100644 --- a/Modules/_decimal/tests/formathelper.py +++ b/Modules/_decimal/tests/formathelper.py @@ -31,11 +31,10 @@ import os, sys, locale, random import platform, subprocess -from test.support import import_fresh_module from distutils.spawn import find_executable -C = import_fresh_module('decimal', fresh=['_decimal']) -P = import_fresh_module('decimal', blocked=['_decimal']) +import _decimal as C +import _pydecimal as P windows_lang_strings = [ From c7c91dfcbb931239563368f50b87d471cf8d6118 Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Mon, 10 Aug 2020 22:39:46 +0200 Subject: [PATCH 153/197] MSVC: The ARM command line should not define MASM. (#21817) --- PCbuild/_decimal.vcxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PCbuild/_decimal.vcxproj b/PCbuild/_decimal.vcxproj index 4c71cdb6d1d77d..0916f1a2d37887 100644 --- a/PCbuild/_decimal.vcxproj +++ b/PCbuild/_decimal.vcxproj @@ -93,11 +93,11 @@ - _CRT_SECURE_NO_WARNINGS;MASM;%(PreprocessorDefinitions) - CONFIG_32;PPRO;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + CONFIG_32;PPRO;MASM;%(PreprocessorDefinitions) CONFIG_32;ANSI;%(PreprocessorDefinitions) CONFIG_64;ANSI;%(PreprocessorDefinitions) - CONFIG_64;%(PreprocessorDefinitions) + CONFIG_64;MASM;%(PreprocessorDefinitions) ..\Modules\_decimal;..\Modules\_decimal\libmpdec;%(AdditionalIncludeDirectories) From 77345ae944dad31d4c8b920bfee02a83aa653dc6 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 11 Aug 2020 05:24:02 +0800 Subject: [PATCH 154/197] bpo-40275: Fix failed test cases by using test helpers (GH-21811) --- Lib/test/test__osx_support.py | 3 +-- Lib/test/test_importlib/extension/test_case_sensitivity.py | 6 +++--- Lib/test/test_importlib/source/test_case_sensitivity.py | 6 +++--- Lib/test/test_selectors.py | 3 ++- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py index a3f41d2c5bd075..907ae27d529b50 100644 --- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -8,7 +8,6 @@ import sys import unittest -import test.support from test.support import os_helper import _osx_support @@ -20,7 +19,7 @@ def setUp(self): self.maxDiff = None self.prog_name = 'bogus_program_xxxx' self.temp_path_dir = os.path.abspath(os.getcwd()) - self.env = test.support.EnvironmentVarGuard() + self.env = os_helper.EnvironmentVarGuard() self.addCleanup(self.env.__exit__) for cv in ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'CC', diff --git a/Lib/test/test_importlib/extension/test_case_sensitivity.py b/Lib/test/test_importlib/extension/test_case_sensitivity.py index 3a857847381a9a..4d76fa014cd73b 100644 --- a/Lib/test/test_importlib/extension/test_case_sensitivity.py +++ b/Lib/test/test_importlib/extension/test_case_sensitivity.py @@ -1,5 +1,5 @@ from importlib import _bootstrap_external -from test import support +from test.support import os_helper import unittest import sys from .. import util @@ -23,7 +23,7 @@ def find_module(self): @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_case_sensitive(self): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') self.caseok_env_changed(should_exist=False) loader = self.find_module() @@ -31,7 +31,7 @@ def test_case_sensitive(self): @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_case_insensitivity(self): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') self.caseok_env_changed(should_exist=True) loader = self.find_module() diff --git a/Lib/test/test_importlib/source/test_case_sensitivity.py b/Lib/test/test_importlib/source/test_case_sensitivity.py index ad1cfdb7e5cc1a..77c06a75fc77be 100644 --- a/Lib/test/test_importlib/source/test_case_sensitivity.py +++ b/Lib/test/test_importlib/source/test_case_sensitivity.py @@ -7,7 +7,7 @@ machinery = util.import_importlib('importlib.machinery') import os -from test import support as test_support +from test.support import os_helper import unittest @@ -42,7 +42,7 @@ def sensitivity_test(self): @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_sensitive(self): - with test_support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') self.caseok_env_changed(should_exist=False) sensitive, insensitive = self.sensitivity_test() @@ -52,7 +52,7 @@ def test_sensitive(self): @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_insensitive(self): - with test_support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') self.caseok_env_changed(should_exist=True) sensitive, insensitive = self.sensitivity_test() diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index 2274c39a79a532..851b1fc1b9e0c4 100644 --- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -6,6 +6,7 @@ import socket import sys from test import support +from test.support import os_helper from test.support import socket_helper from time import sleep import unittest @@ -536,7 +537,7 @@ def test_register_bad_fd(self): # a file descriptor that's been closed should raise an OSError # with EBADF s = self.SELECTOR() - bad_f = support.make_bad_fd() + bad_f = os_helper.make_bad_fd() with self.assertRaises(OSError) as cm: s.register(bad_f, selectors.EVENT_READ) self.assertEqual(cm.exception.errno, errno.EBADF) From 46455cb9f497496ba88e11917d469ab6cfb587b9 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Tue, 11 Aug 2020 05:32:35 -0500 Subject: [PATCH 155/197] bpo-1635741: Port multiprocessing ext to multiphase init (GH-21378) Port the _multiprocessing extension module to multiphase initialization (PEP 489). --- ...2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst | 1 + Modules/_multiprocessing/multiprocessing.c | 102 ++++++++++-------- 2 files changed, 61 insertions(+), 42 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst new file mode 100644 index 00000000000000..52e184dc317074 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-07-16-10-52.bpo-1635741.zU-H_n.rst @@ -0,0 +1 @@ +Port :mod:`multiprocessing` to multi-phase initialization diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index 77e6c854068c0f..25b8dc3967a4fb 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -183,35 +183,17 @@ static PyMethodDef module_methods[] = { * Initialize */ -static struct PyModuleDef multiprocessing_module = { - PyModuleDef_HEAD_INIT, - "_multiprocessing", - NULL, - -1, - module_methods, - NULL, - NULL, - NULL, - NULL -}; - - -PyMODINIT_FUNC -PyInit__multiprocessing(void) +static int +multiprocessing_exec(PyObject *module) { - PyObject *module, *temp, *value = NULL; - - /* Initialize module */ - module = PyModule_Create(&multiprocessing_module); - if (!module) - return NULL; - #if defined(MS_WINDOWS) || \ (defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)) + /* Add _PyMp_SemLock type to module */ - if (PyType_Ready(&_PyMp_SemLockType) < 0) - return NULL; - Py_INCREF(&_PyMp_SemLockType); + if (PyModule_AddType(module, &_PyMp_SemLockType) < 0) { + return -1; + } + { PyObject *py_sem_value_max; /* Some systems define SEM_VALUE_MAX as an unsigned value that @@ -223,25 +205,41 @@ PyInit__multiprocessing(void) py_sem_value_max = PyLong_FromLong(INT_MAX); else py_sem_value_max = PyLong_FromLong(SEM_VALUE_MAX); - if (py_sem_value_max == NULL) - return NULL; - PyDict_SetItemString(_PyMp_SemLockType.tp_dict, "SEM_VALUE_MAX", - py_sem_value_max); + + if (py_sem_value_max == NULL) { + Py_DECREF(py_sem_value_max); + return -1; + } + if (PyDict_SetItemString(_PyMp_SemLockType.tp_dict, "SEM_VALUE_MAX", + py_sem_value_max) < 0) { + Py_DECREF(py_sem_value_max); + return -1; + } + Py_DECREF(py_sem_value_max); } - PyModule_AddObject(module, "SemLock", (PyObject*)&_PyMp_SemLockType); + #endif /* Add configuration macros */ - temp = PyDict_New(); - if (!temp) - return NULL; + PyObject *flags = PyDict_New(); + if (!flags) { + return -1; + } -#define ADD_FLAG(name) \ - value = Py_BuildValue("i", name); \ - if (value == NULL) { Py_DECREF(temp); return NULL; } \ - if (PyDict_SetItemString(temp, #name, value) < 0) { \ - Py_DECREF(temp); Py_DECREF(value); return NULL; } \ - Py_DECREF(value) +#define ADD_FLAG(name) \ + do { \ + PyObject *value = PyLong_FromLong(name); \ + if (value == NULL) { \ + Py_DECREF(flags); \ + return -1; \ + } \ + if (PyDict_SetItemString(flags, #name, value) < 0) { \ + Py_DECREF(flags); \ + Py_DECREF(value); \ + return -1; \ + } \ + Py_DECREF(value); \ + } while (0) #if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) ADD_FLAG(HAVE_SEM_OPEN); @@ -256,8 +254,28 @@ PyInit__multiprocessing(void) ADD_FLAG(HAVE_BROKEN_SEM_UNLINK); #endif - if (PyModule_AddObject(module, "flags", temp) < 0) - return NULL; + if (PyModule_AddObject(module, "flags", flags) < 0) { + Py_DECREF(flags); + return -1; + } + + return 0; +} + +static PyModuleDef_Slot multiprocessing_slots[] = { + {Py_mod_exec, multiprocessing_exec}, + {0, NULL} +}; - return module; +static struct PyModuleDef multiprocessing_module = { + PyModuleDef_HEAD_INIT, + .m_name = "_multiprocessing", + .m_methods = module_methods, + .m_slots = multiprocessing_slots, +}; + +PyMODINIT_FUNC +PyInit__multiprocessing(void) +{ + return PyModuleDef_Init(&multiprocessing_module); } From 10c05a69a8285ba4d60cc0e6079be93981245a37 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 11 Aug 2020 15:26:59 +0200 Subject: [PATCH 156/197] bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822) Automerge-Triggered-By: @tiran --- Doc/library/http.cookiejar.rst | 12 ++++++------ Doc/library/urllib.parse.rst | 2 +- Lib/codecs.py | 2 +- Lib/ipaddress.py | 4 ++-- Lib/test/test___all__.py | 12 ++++++------ Lib/test/test_httplib.py | 4 ++-- Lib/test/test_httpservers.py | 4 ++-- Lib/test/test_nntplib.py | 6 +++--- Lib/test/test_tools/test_sundry.py | 10 +++++----- Lib/test/test_traceback.py | 4 ++-- Objects/typeobject.c | 4 ++-- Tools/clinic/clinic.py | 8 ++++---- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst index 9ac5d52a2ab09c..0a9ee7eb516f41 100644 --- a/Doc/library/http.cookiejar.rst +++ b/Doc/library/http.cookiejar.rst @@ -462,16 +462,16 @@ receiving cookies. There are also some strictness switches that allow you to tighten up the rather loose Netscape protocol rules a little bit (at the cost of blocking some benign cookies). -A domain blacklist and whitelist is provided (both off by default). Only domains -not in the blacklist and present in the whitelist (if the whitelist is active) +A domain denylist and allowlist is provided (both off by default). Only domains +not in the denylist and present in the allowlist (if the allowlist is active) participate in cookie setting and returning. Use the *blocked_domains* constructor argument, and :meth:`blocked_domains` and :meth:`set_blocked_domains` methods (and the corresponding argument and methods -for *allowed_domains*). If you set a whitelist, you can turn it off again by +for *allowed_domains*). If you set an allowlist, you can turn it off again by setting it to :const:`None`. Domains in block or allow lists that do not start with a dot must equal the -cookie domain to be matched. For example, ``"example.com"`` matches a blacklist +cookie domain to be matched. For example, ``"example.com"`` matches a denylist entry of ``"example.com"``, but ``"www.example.com"`` does not. Domains that do start with a dot are matched by more specific domains too. For example, both ``"www.example.com"`` and ``"www.coyote.example.com"`` match ``".example.com"`` @@ -494,7 +494,7 @@ and ``".168.1.2"``, 192.168.1.2 is blocked, but 193.168.1.2 is not. .. method:: DefaultCookiePolicy.is_blocked(domain) - Return whether *domain* is on the blacklist for setting or receiving cookies. + Return whether *domain* is on the denylist for setting or receiving cookies. .. method:: DefaultCookiePolicy.allowed_domains() @@ -509,7 +509,7 @@ and ``".168.1.2"``, 192.168.1.2 is blocked, but 193.168.1.2 is not. .. method:: DefaultCookiePolicy.is_not_allowed(domain) - Return whether *domain* is not on the whitelist for setting or receiving + Return whether *domain* is not on the allowlist for setting or receiving cookies. :class:`DefaultCookiePolicy` instances have the following attributes, which are diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index 536cf952bda434..f9c8ba7398f66f 100644 --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -153,7 +153,7 @@ or on combining URL components into a URL string. .. versionchanged:: 3.3 The fragment is now parsed for all URL schemes (unless *allow_fragment* is - false), in accordance with :rfc:`3986`. Previously, a whitelist of + false), in accordance with :rfc:`3986`. Previously, an allowlist of schemes that support fragments existed. .. versionchanged:: 3.6 diff --git a/Lib/codecs.py b/Lib/codecs.py index 7f23e9775df804..3935490d88c8d3 100644 --- a/Lib/codecs.py +++ b/Lib/codecs.py @@ -83,7 +83,7 @@ class CodecInfo(tuple): """Codec details when looking up the codec registry""" - # Private API to allow Python 3.4 to blacklist the known non-Unicode + # Private API to allow Python 3.4 to denylist the known non-Unicode # codecs in the standard library. A more general mechanism to # reliably distinguish test encodings from other codecs will hopefully # be defined for Python 3.5 diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index bc662c415b2a49..160b16dbc162fc 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -1214,7 +1214,7 @@ def _parse_octet(cls, octet_str): """ if not octet_str: raise ValueError("Empty octet not permitted") - # Whitelist the characters, since int() allows a lot of bizarre stuff. + # Reject non-ASCII digits. if not (octet_str.isascii() and octet_str.isdigit()): msg = "Only decimal digits permitted in %r" raise ValueError(msg % octet_str) @@ -1719,7 +1719,7 @@ def _parse_hextet(cls, hextet_str): [0..FFFF]. """ - # Whitelist the characters, since int() allows a lot of bizarre stuff. + # Reject non-ASCII digits. if not cls._HEX_DIGITS.issuperset(hextet_str): raise ValueError("Only hex digits permitted in %r" % hextet_str) # We do the length check second, since the invalid character error diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 0a03dd20065feb..c6ce64864c0db6 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -69,8 +69,8 @@ def walk_modules(self, basedir, modpath): yield path, modpath + fn[:-3] def test_all(self): - # Blacklisted modules and packages - blacklist = set([ + # List of denied modules and packages + denylist = set([ # Will raise a SyntaxError when compiling the exec statement '__future__', ]) @@ -85,13 +85,13 @@ def test_all(self): lib_dir = os.path.dirname(os.path.dirname(__file__)) for path, modname in self.walk_modules(lib_dir, ""): m = modname - blacklisted = False + denylisted = False while m: - if m in blacklist: - blacklisted = True + if m in denylist: + denylisted = True break m = m.rpartition('.')[0] - if blacklisted: + if denylisted: continue if support.verbose: print(modname) diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 3431bb80ea6de4..a3f268be97921c 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -1434,9 +1434,9 @@ def test_all(self): expected = {"responses"} # White-list documented dict() object # HTTPMessage, parse_headers(), and the HTTP status code constants are # intentionally omitted for simplicity - blacklist = {"HTTPMessage", "parse_headers"} + denylist = {"HTTPMessage", "parse_headers"} for name in dir(client): - if name.startswith("_") or name in blacklist: + if name.startswith("_") or name in denylist: continue module_object = getattr(client, name) if getattr(module_object, "__module__", None) == "http.client": diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index a7e1719ab60ee7..2859abb21fc9f5 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -1189,9 +1189,9 @@ def test_windows_colon(self): class MiscTestCase(unittest.TestCase): def test_all(self): expected = [] - blacklist = {'executable', 'nobody_uid', 'test'} + denylist = {'executable', 'nobody_uid', 'test'} for name in dir(server): - if name.startswith('_') or name in blacklist: + if name.startswith('_') or name in denylist: continue module_object = getattr(server, name) if getattr(module_object, '__module__', None) == 'http.server': diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 1df64fa7c6b00b..b11c19c84d3fb1 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -197,11 +197,11 @@ def test_article_head_body(self): self.assertTrue(resp.startswith("220 "), resp) self.check_article_resp(resp, article, art_num) # Tolerate running the tests from behind a NNTP virus checker - blacklist = lambda line: line.startswith(b'X-Antivirus') + denylist = lambda line: line.startswith(b'X-Antivirus') filtered_head_lines = [line for line in head.lines - if not blacklist(line)] + if not denylist(line)] filtered_lines = [line for line in article.lines - if not blacklist(line)] + if not denylist(line)] self.assertEqual(filtered_lines, filtered_head_lines + [b''] + body.lines) def test_capabilities(self): diff --git a/Lib/test/test_tools/test_sundry.py b/Lib/test/test_tools/test_sundry.py index 8b5a963e25bd15..52369ec09a77fb 100644 --- a/Lib/test/test_tools/test_sundry.py +++ b/Lib/test/test_tools/test_sundry.py @@ -16,18 +16,18 @@ class TestSundryScripts(unittest.TestCase): # At least make sure the rest don't have syntax errors. When tests are - # added for a script it should be added to the whitelist below. + # added for a script it should be added to the allowlist below. # scripts that have independent tests. - whitelist = ['reindent', 'pdeps', 'gprof2html', 'md5sum'] + allowlist = ['reindent', 'pdeps', 'gprof2html', 'md5sum'] # scripts that can't be imported without running - blacklist = ['make_ctype'] + denylist = ['make_ctype'] # scripts that use windows-only modules windows_only = ['win_add2path'] - # blacklisted for other reasons + # denylisted for other reasons other = ['analyze_dxp', '2to3'] - skiplist = blacklist + whitelist + windows_only + other + skiplist = denylist + allowlist + windows_only + other def test_sundry(self): old_modules = import_helper.modules_setup() diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index c5fbd8700ae9b1..730596efd8bcec 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -1191,9 +1191,9 @@ class MiscTest(unittest.TestCase): def test_all(self): expected = set() - blacklist = {'print_list'} + denylist = {'print_list'} for name in dir(traceback): - if name.startswith('_') or name in blacklist: + if name.startswith('_') or name in denylist: continue module_object = getattr(traceback, name) if getattr(module_object, '__module__', None) == 'traceback': diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 39e303950a2104..dee8451eb54768 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4171,10 +4171,10 @@ object_set_class(PyObject *self, PyObject *value, void *closure) In theory the proper fix would be to identify which classes rely on this invariant and somehow disallow __class__ assignment only for them, perhaps via some mechanism like a new Py_TPFLAGS_IMMUTABLE flag (a - "blacklisting" approach). But in practice, since this problem wasn't + "denylisting" approach). But in practice, since this problem wasn't noticed late in the 3.5 RC cycle, we're taking the conservative approach and reinstating the same HEAPTYPE->HEAPTYPE check that we used - to have, plus a "whitelist". For now, the whitelist consists only of + to have, plus an "allowlist". For now, the allowlist consists only of ModuleType subtypes, since those are the cases that motivated the patch in the first place -- see https://bugs.python.org/issue22986 -- and since module objects are mutable we can be sure that they are diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 92334d9195fcce..1bbbd4f9fb1933 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -4433,7 +4433,7 @@ def state_parameter(self, line): if 'c_default' not in kwargs: # we can only represent very simple data values in C. - # detect whether default is okay, via a blacklist + # detect whether default is okay, via a denylist # of disallowed ast nodes. class DetectBadNodes(ast.NodeVisitor): bad = False @@ -4456,9 +4456,9 @@ def bad_node(self, node): # "starred": "a = [1, 2, 3]; *a" visit_Starred = bad_node - blacklist = DetectBadNodes() - blacklist.visit(module) - bad = blacklist.bad + denylist = DetectBadNodes() + denylist.visit(module) + bad = denylist.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. From b29ec438e2801b602b8b440eb62319107b9b6336 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 11 Aug 2020 15:28:43 +0200 Subject: [PATCH 157/197] bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21823) Rename 5 test method names in test_codecs and test_typing. --- Lib/test/test_codecs.py | 8 ++++---- Lib/test/test_typing.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index f0da35c039e11e..3dd56820cd1078 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -2644,7 +2644,7 @@ def test_buffer_api_usage(self): view_decoded = codecs.decode(view, encoding) self.assertEqual(view_decoded, data) - def test_text_to_binary_blacklists_binary_transforms(self): + def test_text_to_binary_denylists_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: @@ -2656,14 +2656,14 @@ def test_text_to_binary_blacklists_binary_transforms(self): bad_input.encode(encoding) self.assertIsNone(failure.exception.__cause__) - def test_text_to_binary_blacklists_text_transforms(self): + def test_text_to_binary_denylists_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") with self.assertRaisesRegex(LookupError, msg): "just an example message".encode("rot_13") - def test_binary_to_text_blacklists_binary_transforms(self): + def test_binary_to_text_denylists_binary_transforms(self): # Check bytes.decode and bytearray.decode give a good error # message for binary -> binary codecs data = b"encode first to ensure we meet any format restrictions" @@ -2678,7 +2678,7 @@ def test_binary_to_text_blacklists_binary_transforms(self): with self.assertRaisesRegex(LookupError, msg): bytearray(encoded_data).decode(encoding) - def test_binary_to_text_blacklists_text_transforms(self): + def test_binary_to_text_denylists_text_transforms(self): # Check str -> str codec gives a good error for binary input for bad_input in (b"immutable", bytearray(b"mutable")): with self.subTest(bad_input=bad_input): diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 7f96aff7104551..b3be99141afca9 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1387,7 +1387,7 @@ def close(self): self.assertIsSubclass(B, Custom) self.assertNotIsSubclass(A, Custom) - def test_builtin_protocol_whitelist(self): + def test_builtin_protocol_allowlist(self): with self.assertRaises(TypeError): class CustomProtocol(TestCase, Protocol): pass From 10625900844504bf0569a187cc340864241b9b7e Mon Sep 17 00:00:00 2001 From: "Edward K. Ream" Date: Tue, 11 Aug 2020 09:07:49 -0500 Subject: [PATCH 158/197] Add links to asttokens, leoAst, LibCST and parso to ast docs (GH-21773) --- Doc/library/ast.rst | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 25cb17811e7183..755c60fba64115 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -1800,5 +1800,24 @@ to stdout. Otherwise, the content is read from stdin. .. seealso:: - `Green Tree Snakes `_, an external documentation resource, has good - details on working with Python ASTs. + `Green Tree Snakes `_, an external + documentation resource, has good details on working with Python ASTs. + + `ASTTokens `_ + annotates Python ASTs with the positions of tokens and text in the source + code that generated them. This is helpful for tools that make source code + transformations. + + `leoAst.py `_ unifies the + token-based and parse-tree-based views of python programs by inserting + two-way links between tokens and ast nodes. + + `LibCST `_ parses code as a Concrete Syntax + Tree that looks like an ast tree and keeps all formatting details. It's + useful for building automated refactoring (codemod) applications and + linters. + + `Parso `_ is a Python parser that supports + error recovery and round-trip parsing for different Python versions (in + multiple Python versions). Parso is also able to list multiple syntax errors + in your python file. \ No newline at end of file From 6f2e7f037e62ad0d1579529f4e4e9c383f5b4553 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Tue, 11 Aug 2020 18:15:57 +0200 Subject: [PATCH 159/197] Add PEP 573 additions to What's New (GH-21374) --- Doc/whatsnew/3.9.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index db380bc1cdfa4e..be7406e13c2cd4 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -1024,6 +1024,13 @@ C API Changes New Features ------------ +* :pep:`573`: Add :c:func:`PyType_FromModuleAndSpec` to associate + a module with a class; :c:func:`PyType_GetModule` and + :c:func:`PyType_GetModuleState` to retrieve the module and its state; and + :c:data:`PyCMethod` and :c:data:`METH_METHOD` to allow a method to + access the class it was defined in. + (Contributed by Marcel Plch and Petr Viktorin in :issue:`38787`.) + * Add :c:func:`PyFrame_GetCode` function: get a frame code. Add :c:func:`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by Victor Stinner in :issue:`40421`.) From 4f80f7bc1fc137e5955503e075014c53bad72639 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Tue, 11 Aug 2020 19:33:25 +0300 Subject: [PATCH 160/197] bpo-41475: Fix note in "What's new in 3.7" (#21733) --- Doc/whatsnew/3.7.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 59b96621bdd4b5..279bbc697b5c63 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -171,7 +171,7 @@ on a per-module basis in Python 3.7 using a :mod:`__future__` import:: from __future__ import annotations -It will become the default in Python 4.0. +It will become the default in Python 3.10. .. seealso:: From cbb80febfbd10023f43d8d1c926b212f26b51866 Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Tue, 11 Aug 2020 21:14:51 +0200 Subject: [PATCH 161/197] Call randseed() before other imports in deccheck.py (GH-21834) --- Modules/_decimal/tests/deccheck.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index 0b2a1c49336ef0..ca869f4dbf5d8c 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -30,10 +30,14 @@ # +import random +import time + +RANDSEED = int(time.time()) +random.seed(RANDSEED) + import sys import os -import time -import random from copy import copy from collections import defaultdict @@ -1235,10 +1239,6 @@ def check_untested(funcdict, c_cls, p_cls): args.single = args.single[0] - randseed = int(time.time()) - random.seed(randseed) - - # Set up the testspecs list. A testspec is simply a dictionary # that determines the amount of different contexts that 'test_method' # will generate. @@ -1306,9 +1306,9 @@ def check_untested(funcdict, c_cls, p_cls): if args.multicore: q = Queue() elif args.single: - log("Random seed: %d", randseed) + log("Random seed: %d", RANDSEED) else: - log("\n\nRandom seed: %d\n\n", randseed) + log("\n\nRandom seed: %d\n\n", RANDSEED) FOUND_METHOD = False From 4b0401edaa7df7edb33f47fba423402c27494317 Mon Sep 17 00:00:00 2001 From: Christopher Yeh Date: Tue, 11 Aug 2020 15:27:08 -0700 Subject: [PATCH 162/197] Fix typo (GH-21820) --- Doc/library/stdtypes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 7028d240c59ebb..5a10faa7bbd293 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4205,7 +4205,7 @@ The constructors for both classes work the same: Note, the non-operator versions of :meth:`union`, :meth:`intersection`, - :meth:`difference`, and :meth:`symmetric_difference`, :meth:`issubset`, and + :meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:`issuperset` methods will accept any iterable as an argument. In contrast, their operator based counterparts require their arguments to be sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` From f5b028992904615d4141c00915a6d30dfcaff0d7 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 12 Aug 2020 10:53:12 +0200 Subject: [PATCH 163/197] bpo-41521, typing: Rename _PROTO_WHITELIST to _PROTO_ALLOWLIST (#21825) --- Lib/typing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/typing.py b/Lib/typing.py index 5da032bbee8f1e..fce8da4fe3cf05 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1021,7 +1021,7 @@ def _allow_reckless_class_cheks(): return True -_PROTO_WHITELIST = { +_PROTO_ALLOWLIST = { 'collections.abc': [ 'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable', 'Hashable', 'Sized', 'Container', 'Collection', 'Reversible', @@ -1140,8 +1140,8 @@ def _proto_hook(other): # ... otherwise check consistency of bases, and prohibit instantiation. for base in cls.__bases__: if not (base in (object, Generic) or - base.__module__ in _PROTO_WHITELIST and - base.__name__ in _PROTO_WHITELIST[base.__module__] or + base.__module__ in _PROTO_ALLOWLIST and + base.__name__ in _PROTO_ALLOWLIST[base.__module__] or issubclass(base, Generic) and base._is_protocol): raise TypeError('Protocols can only inherit from other' ' protocols, got %r' % base) From 97c14a72dfbbcd6622cdf67256b766c78c29a49a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 12 Aug 2020 14:53:28 +0200 Subject: [PATCH 164/197] bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838) --- Lib/codeop.py | 6 ++++-- Lib/test/test_codeop.py | 7 +++++++ .../next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst diff --git a/Lib/codeop.py b/Lib/codeop.py index 7e192ea6a10a03..547629262d0689 100644 --- a/Lib/codeop.py +++ b/Lib/codeop.py @@ -84,9 +84,11 @@ def _maybe_compile(compiler, source, filename, symbol): except SyntaxError: pass - # Suppress warnings after the first compile to avoid duplication. + # Catch syntax warnings after the first compile + # to emit SyntaxWarning at most once. with warnings.catch_warnings(): - warnings.simplefilter("ignore") + warnings.simplefilter("error", SyntaxWarning) + try: code1 = compiler(source + "\n", filename, symbol) except SyntaxError as e: diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index 6e821df6b0e707..7984e5f1e5a69a 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -4,6 +4,7 @@ """ import sys import unittest +import warnings from test import support from test.support import warnings_helper @@ -310,5 +311,11 @@ def test_warning(self): compile_command("0 is 0") self.assertEqual(len(w.warnings), 1) + # bpo-41520: check SyntaxWarning treated as an SyntaxError + with self.assertRaises(SyntaxError): + warnings.simplefilter('error', SyntaxWarning) + compile_command('1 is 1\n', symbol='exec') + + if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst b/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst new file mode 100644 index 00000000000000..ca5501c2aeec0d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst @@ -0,0 +1 @@ +Fix :mod:`codeop` regression: it no longer ignores :exc:`SyntaxWarning`. From 23924bbe1768bf641321038009a95964c89d4d2d Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Wed, 12 Aug 2020 16:00:05 +0200 Subject: [PATCH 165/197] Catch all skip_handler cases (GH-21842) --- Modules/_decimal/tests/deccheck.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index ca869f4dbf5d8c..5de57d1f875a2d 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -185,7 +185,7 @@ def p_as_triple(dec): coeff = int(s) if s else 0 if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple"); + raise ValueError("value out of bounds for a uint128 triple") return (sign, coeff, exp) @@ -193,7 +193,7 @@ def p_from_triple(triple): sign, coeff, exp = triple if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple"); + raise ValueError("value out of bounds for a uint128 triple") digits = tuple(int(c) for c in str(coeff)) @@ -894,7 +894,7 @@ def verify(t, stat): t.presults.append(str(t.rp.real)) ctriple = None - if t.funcname not in ['__radd__', '__rmul__']: # see skip handler + if str(t.rc) == str(t.rp): # see skip handler try: ctriple = c_as_triple(t.rc) except ValueError: From 8c5a7037556841a4d0e791e9c5b2eddaf0580569 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 12 Aug 2020 21:49:22 +0200 Subject: [PATCH 166/197] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the c_warn_on_allowed_pre_v3 option to make the documentation compatible with Sphinx 2 and Sphinx 3. --- Doc/conf.py | 10 ++++++++++ .../2020-08-12-18-35-40.bpo-40204.C8A_pe.rst | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst diff --git a/Doc/conf.py b/Doc/conf.py index bfb2a98fc63a2f..079d17717f381c 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -228,3 +228,13 @@ # Relative filename of the reference count data file. refcount_file = 'data/refcounts.dat' + +# Sphinx 2 and Sphinx 3 compatibility +# ----------------------------------- + +# bpo-40204: Allow Sphinx 2 syntax in the C domain +c_allow_pre_v3 = True + +# bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the +# documentation is built with -W (warnings treated as errors). +c_warn_on_allowed_pre_v3 = False diff --git a/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst b/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst new file mode 100644 index 00000000000000..152f6c98b90048 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-08-12-18-35-40.bpo-40204.C8A_pe.rst @@ -0,0 +1,3 @@ +Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable +``c_warn_on_allowed_pre_v3`` option to make the documentation compatible +with Sphinx 2 and Sphinx 3. From 0b9ebc2d6a843b69b194fe13f466047aa4af4eff Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Thu, 13 Aug 2020 05:23:30 +0800 Subject: [PATCH 167/197] bpo-1635741: Clean sysdict and builtins of interpreter at exit (GH-21605) --- Python/pystate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Python/pystate.c b/Python/pystate.c index d0cbf5cb8364bf..f6d1956e9dce9a 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -294,8 +294,6 @@ PyInterpreterState_Clear(PyInterpreterState *interp) Py_CLEAR(interp->codec_error_registry); Py_CLEAR(interp->modules); Py_CLEAR(interp->modules_by_index); - Py_CLEAR(interp->sysdict); - Py_CLEAR(interp->builtins); Py_CLEAR(interp->builtins_copy); Py_CLEAR(interp->importlib); Py_CLEAR(interp->import_func); @@ -308,6 +306,14 @@ PyInterpreterState_Clear(PyInterpreterState *interp) if (_PyRuntimeState_GetFinalizing(runtime) == NULL) { _PyWarnings_Fini(interp); } + /* We don't clear sysdict and builtins until the end of this function. + Because clearing other attributes can execute arbitrary Python code + which requires sysdict and builtins. */ + PyDict_Clear(interp->sysdict); + PyDict_Clear(interp->builtins); + Py_CLEAR(interp->sysdict); + Py_CLEAR(interp->builtins); + // XXX Once we have one allocator per interpreter (i.e. // per-interpreter GC) we must ensure that all of the interpreter's // objects have been cleaned up at the point. From f0863412b53b40871d8185638a6ac4eb67b5862f Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Thu, 13 Aug 2020 09:48:41 +0100 Subject: [PATCH 168/197] bpo-41531: Fix compilation of dict literals with more than 0xFFFF elements (GH-21850) --- Lib/test/test_compile.py | 10 ++++++++++ .../2020-08-12-19-32-15.bpo-41531.WgPzjT.rst | 2 ++ Python/compile.c | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 3dd8c8d1db8103..6055192bf70503 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -752,6 +752,16 @@ def continue_in_while(): self.assertEqual(None, opcodes[0].argval) self.assertEqual('RETURN_VALUE', opcodes[1].opname) + def test_big_dict_literal(self): + # The compiler has a flushing point in "compiler_dict" that calls compiles + # a portion of the dictionary literal when the loop that iterates over the items + # reaches 0xFFFF elements but the code was not including the boundary element, + # dropping the key at position 0xFFFF. See bpo-41531 for more information + + dict_size = 0xFFFF + 1 + the_dict = "{" + ",".join(f"{x}:{x}" for x in range(dict_size)) + "}" + self.assertEqual(len(eval(the_dict)), dict_size) + class TestExpressionStackSize(unittest.TestCase): # These tests check that the computed stack size for a code object # stays within reasonable bounds (see issue #21523 for an example diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst new file mode 100644 index 00000000000000..8544664f39335d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-08-12-19-32-15.bpo-41531.WgPzjT.rst @@ -0,0 +1,2 @@ +Fix a bug that was dropping keys when compiling dict literals with more than +0xFFFF elements. Patch by Pablo Galindo. diff --git a/Python/compile.c b/Python/compile.c index 5dbd9f221fdf14..2c5326686f8663 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -3894,7 +3894,7 @@ compiler_dict(struct compiler *c, expr_ty e) } else { if (elements == 0xFFFF) { - if (!compiler_subdict(c, e, i - elements, i)) { + if (!compiler_subdict(c, e, i - elements, i + 1)) { return 0; } if (have_dict) { From 1626edd6ffed1104c69a6c33f52462dd35abd206 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Thu, 13 Aug 2020 09:22:48 -0500 Subject: [PATCH 169/197] bpo-1635741: Port _winapi ext to multi-stage init (GH-21371) --- ...2020-07-06-20-43-19.bpo-1635741.LYhsni.rst | 1 + Modules/_winapi.c | 151 +++++++++--------- 2 files changed, 79 insertions(+), 73 deletions(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst new file mode 100644 index 00000000000000..956fcd5d1ee29e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-20-43-19.bpo-1635741.LYhsni.rst @@ -0,0 +1 @@ +Port :mod:`winapi` to multiphase initialization diff --git a/Modules/_winapi.c b/Modules/_winapi.c index ddb11aa5a82042..7ba14095c96e19 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -35,8 +35,10 @@ /* See http://www.python.org/2.4/license for licensing details. */ #include "Python.h" +#include "moduleobject.h" // PyModuleDef_Slot #include "structmember.h" // PyMemberDef + #define WINDOWS_LEAN_AND_MEAN #include "windows.h" #include @@ -78,6 +80,17 @@ check_CancelIoEx() return has_CancelIoEx; } +typedef struct { + PyTypeObject *overlapped_type; +} WinApiState; + +static inline WinApiState* +winapi_get_state(PyObject *module) +{ + void *state = PyModule_GetState(module); + assert(state != NULL); + return (WinApiState *)state; +} /* * A Python object wrapping an OVERLAPPED structure and other useful data @@ -140,7 +153,9 @@ overlapped_dealloc(OverlappedObject *self) if (self->write_buffer.obj) PyBuffer_Release(&self->write_buffer); Py_CLEAR(self->read_buffer); - PyObject_Del(self); + PyTypeObject *tp = Py_TYPE(self); + tp->tp_free(self); + Py_DECREF(tp); } /*[clinic input] @@ -305,55 +320,29 @@ static PyMemberDef overlapped_members[] = { {NULL} }; -PyTypeObject OverlappedType = { - PyVarObject_HEAD_INIT(NULL, 0) - /* tp_name */ "_winapi.Overlapped", - /* tp_basicsize */ sizeof(OverlappedObject), - /* tp_itemsize */ 0, - /* tp_dealloc */ (destructor) overlapped_dealloc, - /* tp_vectorcall_offset */ 0, - /* tp_getattr */ 0, - /* tp_setattr */ 0, - /* tp_as_async */ 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 */ 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, +static PyType_Slot winapi_overlapped_type_slots[] = { + {Py_tp_dealloc, overlapped_dealloc}, + {Py_tp_doc, "OVERLAPPED structure wrapper"}, + {Py_tp_methods, overlapped_methods}, + {Py_tp_members, overlapped_members}, + {0,0} +}; + +static PyType_Spec winapi_overlapped_type_spec = { + .name = "_winapi.Overlapped", + .basicsize = sizeof(OverlappedObject), + .flags = Py_TPFLAGS_DEFAULT, + .slots = winapi_overlapped_type_slots, }; static OverlappedObject * -new_overlapped(HANDLE handle) +new_overlapped(PyObject *module, HANDLE handle) { - OverlappedObject *self; - - self = PyObject_New(OverlappedObject, &OverlappedType); + WinApiState *st = winapi_get_state(module); + OverlappedObject *self = PyObject_New(OverlappedObject, st->overlapped_type); if (!self) return NULL; + self->handle = handle; self->read_buffer = NULL; self->pending = 0; @@ -409,7 +398,7 @@ _winapi_ConnectNamedPipe_impl(PyObject *module, HANDLE handle, OverlappedObject *overlapped = NULL; if (use_overlapped) { - overlapped = new_overlapped(handle); + overlapped = new_overlapped(module, handle); if (!overlapped) return NULL; } @@ -1527,7 +1516,7 @@ _winapi_ReadFile_impl(PyObject *module, HANDLE handle, DWORD size, if (!buf) return NULL; if (use_overlapped) { - overlapped = new_overlapped(handle); + overlapped = new_overlapped(module, handle); if (!overlapped) { Py_DECREF(buf); return NULL; @@ -1810,7 +1799,7 @@ _winapi_WriteFile_impl(PyObject *module, HANDLE handle, PyObject *buffer, OverlappedObject *overlapped = NULL; if (use_overlapped) { - overlapped = new_overlapped(handle); + overlapped = new_overlapped(module, handle); if (!overlapped) return NULL; buf = &overlapped->write_buffer; @@ -1921,36 +1910,33 @@ static PyMethodDef winapi_functions[] = { {NULL, NULL} }; -static struct PyModuleDef winapi_module = { - PyModuleDef_HEAD_INIT, - "_winapi", - NULL, - -1, - winapi_functions, - NULL, - NULL, - NULL, - NULL -}; - #define WINAPI_CONSTANT(fmt, con) \ - PyDict_SetItemString(d, #con, Py_BuildValue(fmt, con)) - -PyMODINIT_FUNC -PyInit__winapi(void) + do { \ + PyObject *value = Py_BuildValue(fmt, con); \ + if (value == NULL) { \ + return -1; \ + } \ + if (PyDict_SetItemString(d, #con, value) < 0) { \ + Py_DECREF(value); \ + return -1; \ + } \ + Py_DECREF(value); \ + } while (0) + +static int winapi_exec(PyObject *m) { - PyObject *d; - PyObject *m; + WinApiState *st = winapi_get_state(m); - if (PyType_Ready(&OverlappedType) < 0) - return NULL; + st->overlapped_type = (PyTypeObject *)PyType_FromModuleAndSpec(m, &winapi_overlapped_type_spec, NULL); + if (st->overlapped_type == NULL) { + return -1; + } - m = PyModule_Create(&winapi_module); - if (m == NULL) - return NULL; - d = PyModule_GetDict(m); + if (PyModule_AddType(m, st->overlapped_type) < 0) { + return -1; + } - PyDict_SetItemString(d, "Overlapped", (PyObject *) &OverlappedType); + PyObject *d = PyModule_GetDict(m); /* constants */ WINAPI_CONSTANT(F_DWORD, CREATE_NEW_CONSOLE); @@ -2049,5 +2035,24 @@ PyInit__winapi(void) WINAPI_CONSTANT("i", NULL); - return m; + return 0; +} + +static PyModuleDef_Slot winapi_slots[] = { + {Py_mod_exec, winapi_exec}, + {0, NULL} +}; + +static struct PyModuleDef winapi_module = { + PyModuleDef_HEAD_INIT, + .m_name = "_winapi", + .m_size = sizeof(WinApiState), + .m_methods = winapi_functions, + .m_slots = winapi_slots, +}; + +PyMODINIT_FUNC +PyInit__winapi(void) +{ + return PyModuleDef_Init(&winapi_module); } From 5d8ea23c7f0209b8f330863b989ae4e08c3f49d1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 13 Aug 2020 19:15:38 +0200 Subject: [PATCH 170/197] bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858) Use generic '.. object::' to declare markers, rather than abusing '.. c:function::' which fails on Sphinx 3. --- Doc/howto/instrumentation.rst | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Doc/howto/instrumentation.rst b/Doc/howto/instrumentation.rst index 909deb5fed33ff..f0081e4ec28905 100644 --- a/Doc/howto/instrumentation.rst +++ b/Doc/howto/instrumentation.rst @@ -272,9 +272,7 @@ should instead read: Available static markers ------------------------ -.. I'm reusing the "c:function" type for markers - -.. c:function:: function__entry(str filename, str funcname, int lineno) +.. object:: function__entry(str filename, str funcname, int lineno) This marker indicates that execution of a Python function has begun. It is only triggered for pure-Python (bytecode) functions. @@ -290,7 +288,7 @@ Available static markers * ``$arg3`` : ``int`` line number -.. c:function:: function__return(str filename, str funcname, int lineno) +.. object:: function__return(str filename, str funcname, int lineno) This marker is the converse of :c:func:`function__entry`, and indicates that execution of a Python function has ended (either via ``return``, or via an @@ -298,7 +296,7 @@ Available static markers The arguments are the same as for :c:func:`function__entry` -.. c:function:: line(str filename, str funcname, int lineno) +.. object:: line(str filename, str funcname, int lineno) This marker indicates a Python line is about to be executed. It is the equivalent of line-by-line tracing with a Python profiler. It is @@ -306,24 +304,24 @@ Available static markers The arguments are the same as for :c:func:`function__entry`. -.. c:function:: gc__start(int generation) +.. object:: gc__start(int generation) Fires when the Python interpreter starts a garbage collection cycle. ``arg0`` is the generation to scan, like :func:`gc.collect()`. -.. c:function:: gc__done(long collected) +.. object:: gc__done(long collected) Fires when the Python interpreter finishes a garbage collection cycle. ``arg0`` is the number of collected objects. -.. c:function:: import__find__load__start(str modulename) +.. object:: import__find__load__start(str modulename) Fires before :mod:`importlib` attempts to find and load the module. ``arg0`` is the module name. .. versionadded:: 3.7 -.. c:function:: import__find__load__done(str modulename, int found) +.. object:: import__find__load__done(str modulename, int found) Fires after :mod:`importlib`'s find_and_load function is called. ``arg0`` is the module name, ``arg1`` indicates if module was @@ -332,7 +330,7 @@ Available static markers .. versionadded:: 3.7 -.. c:function:: audit(str event, void *tuple) +.. object:: audit(str event, void *tuple) Fires when :func:`sys.audit` or :c:func:`PySys_Audit` is called. ``arg0`` is the event name as C string, ``arg1`` is a :c:type:`PyObject` @@ -375,14 +373,14 @@ If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/systemtap/tapset``), then these additional probepoints become available: -.. c:function:: python.function.entry(str filename, str funcname, int lineno, frameptr) +.. object:: python.function.entry(str filename, str funcname, int lineno, frameptr) This probe point indicates that execution of a Python function has begun. It is only triggered for pure-Python (bytecode) functions. -.. c:function:: python.function.return(str filename, str funcname, int lineno, frameptr) +.. object:: python.function.return(str filename, str funcname, int lineno, frameptr) - This probe point is the converse of :c:func:`python.function.return`, and + This probe point is the converse of ``python.function.return``, and indicates that execution of a Python function has ended (either via ``return``, or via an exception). It is only triggered for pure-Python (bytecode) functions. From 3d814c104f05a738a99ed1b3095363fca91193e2 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 13 Aug 2020 19:16:02 +0200 Subject: [PATCH 171/197] bpo-40204: Fix duplicates in the documentation (GH-21857) Fix two Sphinx 3 issues: Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'. Declaration is 'PyBUF_ND'. Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'. Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'. --- Doc/c-api/buffer.rst | 2 +- Doc/c-api/unicode.rst | 37 ++++++++++++------------------------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index fc1430efa8a4bb..ddb28af88980c1 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -301,7 +301,7 @@ must be C-contiguous. +-----------------------------------+-------+---------+------------+--------+ | .. c:macro:: PyBUF_ANY_CONTIGUOUS | yes | yes | NULL | C or F | +-----------------------------------+-------+---------+------------+--------+ -| .. c:macro:: PyBUF_ND | yes | NULL | NULL | C | +| :c:macro:`PyBUF_ND` | yes | NULL | NULL | C | +-----------------------------------+-------+---------+------------+--------+ diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index f3f0c4c6c2b9b8..577cdf25114665 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1487,17 +1487,21 @@ These are the mapping codec APIs: The following codec API is special in that maps Unicode to Unicode. -.. c:function:: PyObject* PyUnicode_Translate(PyObject *unicode, \ - PyObject *mapping, const char *errors) +.. c:function:: PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors) - Translate a Unicode object using the given *mapping* object and return the - resulting Unicode object. Return ``NULL`` if an exception was raised by the + Translate a string by applying a character mapping table to it and return the + resulting Unicode object. Return ``NULL`` if an exception was raised by the codec. - The *mapping* object must map Unicode ordinal integers to Unicode strings, - integers (which are then interpreted as Unicode ordinals) or ``None`` - (causing deletion of the character). Unmapped character ordinals (ones - which cause a :exc:`LookupError`) are left untouched and are copied as-is. + The mapping table must map Unicode ordinal integers to Unicode ordinal integers + or ``None`` (causing deletion of the character). + + Mapping tables need only provide the :meth:`__getitem__` interface; dictionaries + and sequences work well. Unmapped character ordinals (ones which cause a + :exc:`LookupError`) are left untouched and are copied as-is. + + *errors* has the usual meaning for codecs. It may be ``NULL`` which indicates to + use the default error handling. .. c:function:: PyObject* PyUnicode_TranslateCharmap(const Py_UNICODE *s, Py_ssize_t size, \ @@ -1600,23 +1604,6 @@ They all return ``NULL`` or ``-1`` if an exception occurs. characters are not included in the resulting strings. -.. c:function:: PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, \ - const char *errors) - - Translate a string by applying a character mapping table to it and return the - resulting Unicode object. - - The mapping table must map Unicode ordinal integers to Unicode ordinal integers - or ``None`` (causing deletion of the character). - - Mapping tables need only provide the :meth:`__getitem__` interface; dictionaries - and sequences work well. Unmapped character ordinals (ones which cause a - :exc:`LookupError`) are left untouched and are copied as-is. - - *errors* has the usual meaning for codecs. It may be ``NULL`` which indicates to - use the default error handling. - - .. c:function:: PyObject* PyUnicode_Join(PyObject *separator, PyObject *seq) Join a sequence of strings using the given *separator* and return the resulting From 67cb1c9314fc7caf9304757ba3cb4ae3d9a3b878 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Thu, 13 Aug 2020 13:18:49 -0400 Subject: [PATCH 172/197] bpo-41520: Fix second codeop regression (GH-21848) * bpo-41520: Fix second codeop repression Fix the repression introduced by the initial regression fix. --- Lib/codeop.py | 4 ++-- Lib/test/test_codeop.py | 13 ++++++++----- .../2020-08-12-13-25-16.bpo-41520.BEUWa4.rst | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Lib/codeop.py b/Lib/codeop.py index 547629262d0689..4c10470aee7b7c 100644 --- a/Lib/codeop.py +++ b/Lib/codeop.py @@ -85,9 +85,9 @@ def _maybe_compile(compiler, source, filename, symbol): pass # Catch syntax warnings after the first compile - # to emit SyntaxWarning at most once. + # to emit warnings (SyntaxWarning, DeprecationWarning) at most once. with warnings.catch_warnings(): - warnings.simplefilter("error", SyntaxWarning) + warnings.simplefilter("error") try: code1 = compiler(source + "\n", filename, symbol) diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index 7984e5f1e5a69a..45d0a7de9d9253 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -307,14 +307,17 @@ def test_filename(self): def test_warning(self): # Test that the warning is only returned once. - with warnings_helper.check_warnings((".*literal", SyntaxWarning)) as w: - compile_command("0 is 0") - self.assertEqual(len(w.warnings), 1) + with warnings_helper.check_warnings( + (".*literal", SyntaxWarning), + (".*invalid", DeprecationWarning), + ) as w: + compile_command(r"'\e' is 0") + self.assertEqual(len(w.warnings), 2) # bpo-41520: check SyntaxWarning treated as an SyntaxError - with self.assertRaises(SyntaxError): + with warnings.catch_warnings(), self.assertRaises(SyntaxError): warnings.simplefilter('error', SyntaxWarning) - compile_command('1 is 1\n', symbol='exec') + compile_command('1 is 1', symbol='exec') if __name__ == "__main__": diff --git a/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst b/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst index ca5501c2aeec0d..0e140d91bb4b61 100644 --- a/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst +++ b/Misc/NEWS.d/next/Library/2020-08-12-13-25-16.bpo-41520.BEUWa4.rst @@ -1 +1 @@ -Fix :mod:`codeop` regression: it no longer ignores :exc:`SyntaxWarning`. +Fix :mod:`codeop` regression that prevented turning compile warnings into errors. From ad08c65d645c86af83a0737725581efb63ddb532 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 13 Aug 2020 19:20:28 +0200 Subject: [PATCH 173/197] bpo-41521: Replace denylist with blocklist is http.cookiejar doc (GH-21826) The http.cookiejar module has is_blocked() and blocked_domains() methods, so "blocklist" term sounds better than "denylist" in this module. Replace also denylisted with denied in test___all__. --- Doc/library/http.cookiejar.rst | 8 ++++---- Lib/test/test___all__.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst index 0a9ee7eb516f41..7b1aa80a01797c 100644 --- a/Doc/library/http.cookiejar.rst +++ b/Doc/library/http.cookiejar.rst @@ -462,8 +462,8 @@ receiving cookies. There are also some strictness switches that allow you to tighten up the rather loose Netscape protocol rules a little bit (at the cost of blocking some benign cookies). -A domain denylist and allowlist is provided (both off by default). Only domains -not in the denylist and present in the allowlist (if the allowlist is active) +A domain blocklist and allowlist is provided (both off by default). Only domains +not in the blocklist and present in the allowlist (if the allowlist is active) participate in cookie setting and returning. Use the *blocked_domains* constructor argument, and :meth:`blocked_domains` and :meth:`set_blocked_domains` methods (and the corresponding argument and methods @@ -471,7 +471,7 @@ for *allowed_domains*). If you set an allowlist, you can turn it off again by setting it to :const:`None`. Domains in block or allow lists that do not start with a dot must equal the -cookie domain to be matched. For example, ``"example.com"`` matches a denylist +cookie domain to be matched. For example, ``"example.com"`` matches a blocklist entry of ``"example.com"``, but ``"www.example.com"`` does not. Domains that do start with a dot are matched by more specific domains too. For example, both ``"www.example.com"`` and ``"www.coyote.example.com"`` match ``".example.com"`` @@ -494,7 +494,7 @@ and ``".168.1.2"``, 192.168.1.2 is blocked, but 193.168.1.2 is not. .. method:: DefaultCookiePolicy.is_blocked(domain) - Return whether *domain* is on the denylist for setting or receiving cookies. + Return whether *domain* is on the blocklist for setting or receiving cookies. .. method:: DefaultCookiePolicy.allowed_domains() diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index c6ce64864c0db6..15f42d2d114a68 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -85,13 +85,13 @@ def test_all(self): lib_dir = os.path.dirname(os.path.dirname(__file__)) for path, modname in self.walk_modules(lib_dir, ""): m = modname - denylisted = False + denied = False while m: if m in denylist: - denylisted = True + denied = True break m = m.rpartition('.')[0] - if denylisted: + if denied: continue if support.verbose: print(modname) From 6cecf33c77ad86b61cdfa26a8439ddd1cadaa9c9 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 13 Aug 2020 21:41:54 +0200 Subject: [PATCH 174/197] bpo-40204: Add :noindex: in the documentation (GH-21859) Add :noindex: to duplicated documentation to fix "duplicate object description" errors. For example, fix this Sphinx 3 issue: Doc/library/configparser.rst:1146: WARNING: duplicate object description of configparser.ConfigParser.optionxform, other instance in library/configparser, use :noindex: for one of them --- Doc/library/aifc.rst | 2 + Doc/library/configparser.rst | 161 +++++++++++++++++---------------- Doc/library/difflib.rst | 2 + Doc/library/enum.rst | 1 + Doc/library/socket.rst | 2 + Doc/library/tarfile.rst | 1 + Doc/library/token.rst | 1 + Doc/library/turtle.rst | 3 + Doc/library/urllib.request.rst | 2 +- 9 files changed, 94 insertions(+), 81 deletions(-) diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst index 7328907730fb10..2e917cf7321b85 100644 --- a/Doc/library/aifc.rst +++ b/Doc/library/aifc.rst @@ -208,6 +208,7 @@ number of frames must be filled in. .. method:: aifc.tell() + :noindex: Return the current write position in the output file. Useful in combination with :meth:`setmark`. @@ -232,6 +233,7 @@ number of frames must be filled in. .. method:: aifc.close() + :noindex: Close the AIFF file. The header of the file is updated to reflect the actual size of the audio data. After calling this method, the object can no longer be diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst index 739477f55fddda..2e22a549ee2813 100644 --- a/Doc/library/configparser.rst +++ b/Doc/library/configparser.rst @@ -674,97 +674,98 @@ be overridden by subclasses or by attribute assignment. .. attribute:: ConfigParser.BOOLEAN_STATES - By default when using :meth:`~ConfigParser.getboolean`, config parsers - consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, - ``'on'`` and the following values ``False``: ``'0'``, ``'no'``, ``'false'``, - ``'off'``. You can override this by specifying a custom dictionary of strings - and their Boolean outcomes. For example: - - .. doctest:: - - >>> custom = configparser.ConfigParser() - >>> custom['section1'] = {'funky': 'nope'} - >>> custom['section1'].getboolean('funky') - Traceback (most recent call last): - ... - ValueError: Not a boolean: nope - >>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False} - >>> custom['section1'].getboolean('funky') - False - - Other typical Boolean pairs include ``accept``/``reject`` or - ``enabled``/``disabled``. + By default when using :meth:`~ConfigParser.getboolean`, config parsers + consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, + ``'on'`` and the following values ``False``: ``'0'``, ``'no'``, ``'false'``, + ``'off'``. You can override this by specifying a custom dictionary of strings + and their Boolean outcomes. For example: + + .. doctest:: + + >>> custom = configparser.ConfigParser() + >>> custom['section1'] = {'funky': 'nope'} + >>> custom['section1'].getboolean('funky') + Traceback (most recent call last): + ... + ValueError: Not a boolean: nope + >>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False} + >>> custom['section1'].getboolean('funky') + False + + Other typical Boolean pairs include ``accept``/``reject`` or + ``enabled``/``disabled``. .. method:: ConfigParser.optionxform(option) + :noindex: - This method transforms option names on every read, get, or set - operation. The default converts the name to lowercase. This also - means that when a configuration file gets written, all keys will be - lowercase. Override this method if that's unsuitable. - For example: + This method transforms option names on every read, get, or set + operation. The default converts the name to lowercase. This also + means that when a configuration file gets written, all keys will be + lowercase. Override this method if that's unsuitable. + For example: - .. doctest:: + .. doctest:: + + >>> config = """ + ... [Section1] + ... Key = Value + ... + ... [Section2] + ... AnotherKey = Value + ... """ + >>> typical = configparser.ConfigParser() + >>> typical.read_string(config) + >>> list(typical['Section1'].keys()) + ['key'] + >>> list(typical['Section2'].keys()) + ['anotherkey'] + >>> custom = configparser.RawConfigParser() + >>> custom.optionxform = lambda option: option + >>> custom.read_string(config) + >>> list(custom['Section1'].keys()) + ['Key'] + >>> list(custom['Section2'].keys()) + ['AnotherKey'] - >>> config = """ - ... [Section1] - ... Key = Value - ... - ... [Section2] - ... AnotherKey = Value - ... """ - >>> typical = configparser.ConfigParser() - >>> typical.read_string(config) - >>> list(typical['Section1'].keys()) - ['key'] - >>> list(typical['Section2'].keys()) - ['anotherkey'] - >>> custom = configparser.RawConfigParser() - >>> custom.optionxform = lambda option: option - >>> custom.read_string(config) - >>> list(custom['Section1'].keys()) - ['Key'] - >>> list(custom['Section2'].keys()) - ['AnotherKey'] - - .. note:: - The optionxform function transforms option names to a canonical form. - This should be an idempotent function: if the name is already in - canonical form, it should be returned unchanged. + .. note:: + The optionxform function transforms option names to a canonical form. + This should be an idempotent function: if the name is already in + canonical form, it should be returned unchanged. .. attribute:: ConfigParser.SECTCRE - A compiled regular expression used to parse section headers. The default - matches ``[section]`` to the name ``"section"``. Whitespace is considered - part of the section name, thus ``[ larch ]`` will be read as a section of - name ``" larch "``. Override this attribute if that's unsuitable. For - example: + A compiled regular expression used to parse section headers. The default + matches ``[section]`` to the name ``"section"``. Whitespace is considered + part of the section name, thus ``[ larch ]`` will be read as a section of + name ``" larch "``. Override this attribute if that's unsuitable. For + example: + + .. doctest:: + + >>> import re + >>> config = """ + ... [Section 1] + ... option = value + ... + ... [ Section 2 ] + ... another = val + ... """ + >>> typical = configparser.ConfigParser() + >>> typical.read_string(config) + >>> typical.sections() + ['Section 1', ' Section 2 '] + >>> custom = configparser.ConfigParser() + >>> custom.SECTCRE = re.compile(r"\[ *(?P
    [^]]+?) *\]") + >>> custom.read_string(config) + >>> custom.sections() + ['Section 1', 'Section 2'] - .. doctest:: + .. note:: - >>> import re - >>> config = """ - ... [Section 1] - ... option = value - ... - ... [ Section 2 ] - ... another = val - ... """ - >>> typical = configparser.ConfigParser() - >>> typical.read_string(config) - >>> typical.sections() - ['Section 1', ' Section 2 '] - >>> custom = configparser.ConfigParser() - >>> custom.SECTCRE = re.compile(r"\[ *(?P
    [^]]+?) *\]") - >>> custom.read_string(config) - >>> custom.sections() - ['Section 1', 'Section 2'] - - .. note:: - - While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing - option lines, it's not recommended to override it because that would - interfere with constructor options *allow_no_value* and *delimiters*. + While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing + option lines, it's not recommended to override it because that would + interfere with constructor options *allow_no_value* and *delimiters*. Legacy API Examples diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index 7a898c21b52e03..25e3511d017858 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -24,6 +24,7 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module. .. class:: SequenceMatcher + :noindex: This is a flexible class for comparing pairs of sequences of any type, so long as the sequence elements are :term:`hashable`. The basic algorithm predates, and is a @@ -651,6 +652,7 @@ The :class:`Differ` class has this constructor: .. class:: Differ(linejunk=None, charjunk=None) + :noindex: Optional keyword parameters *linejunk* and *charjunk* are for filter functions (or ``None``): diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index b327a0ad15f96c..00bfb260c02047 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -50,6 +50,7 @@ helper, :class:`auto`. the bitwise operations without losing their :class:`Flag` membership. .. function:: unique + :noindex: Enum class decorator that ensures only one name is bound to any one value. diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index d798c1a9d10a05..5bcac20a4c6048 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1695,7 +1695,9 @@ to sockets. .. method:: socket.setsockopt(level, optname, value: int) .. method:: socket.setsockopt(level, optname, value: buffer) + :noindex: .. method:: socket.setsockopt(level, optname, None, optlen: int) + :noindex: .. index:: module: struct diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst index c204263d3a094c..cca466b5697948 100644 --- a/Doc/library/tarfile.rst +++ b/Doc/library/tarfile.rst @@ -151,6 +151,7 @@ Some facts and figures: .. class:: TarFile + :noindex: Class for reading and writing tar archives. Do not use this class directly: use :func:`tarfile.open` instead. See :ref:`tarfile-objects`. diff --git a/Doc/library/token.rst b/Doc/library/token.rst index f8ebb275ebbc44..a1aceba96ce030 100644 --- a/Doc/library/token.rst +++ b/Doc/library/token.rst @@ -70,6 +70,7 @@ the :mod:`tokenize` module. .. data:: TYPE_COMMENT + :noindex: Token value indicating that a type comment was recognized. Such tokens are only produced when :func:`ast.parse()` is invoked with diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index fed85045435b1b..d3487537df99a9 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -1069,6 +1069,7 @@ More drawing control ~~~~~~~~~~~~~~~~~~~~ .. function:: reset() + :noindex: Delete the turtle's drawings from the screen, re-center the turtle and set variables to the default values. @@ -1090,6 +1091,7 @@ More drawing control .. function:: clear() + :noindex: Delete the turtle's drawings from the screen. Do not move turtle. State and position of the turtle as well as drawings of other turtles are not affected. @@ -1362,6 +1364,7 @@ Using events ------------ .. function:: onclick(fun, btn=1, add=None) + :noindex: :param fun: a function with two arguments which will be called with the coordinates of the clicked point on the canvas diff --git a/Doc/library/urllib.request.rst b/Doc/library/urllib.request.rst index 288ce14d36f016..b37f230feb6015 100644 --- a/Doc/library/urllib.request.rst +++ b/Doc/library/urllib.request.rst @@ -946,7 +946,7 @@ tracking URIs for which authentication credentials should always be sent. If *is_authenticated* is specified as ``True``, *realm* is ignored. -.. method:: HTTPPasswordMgr.find_user_password(realm, authuri) +.. method:: HTTPPasswordMgrWithPriorAuth.find_user_password(realm, authuri) Same as for :class:`HTTPPasswordMgrWithDefaultRealm` objects From 3ae5814917da509c90d82f35ead5fe53ebe8e7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Srinivas=20Reddy=20Thatiparthy=20=28=E0=B0=B6=E0=B1=8D?= =?UTF-8?q?=E0=B0=B0=E0=B1=80=E0=B0=A8=E0=B0=BF=E0=B0=B5=E0=B0=BE=E0=B0=B8?= =?UTF-8?q?=E0=B1=8D=20=20=E0=B0=B0=E0=B1=86=E0=B0=A1=E0=B1=8D=E0=B0=A1?= =?UTF-8?q?=E0=B0=BF=20=E0=B0=A4=E0=B0=BE=E0=B0=9F=E0=B0=BF=E0=B0=AA?= =?UTF-8?q?=E0=B0=B0=E0=B1=8D=E0=B0=A4=E0=B0=BF=29?= Date: Fri, 14 Aug 2020 01:22:04 +0530 Subject: [PATCH 175/197] bpo-41066: Update the comparison section for os vs pathlib (GH-21261) --- Doc/library/pathlib.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index bf6fee44df2c88..f705d15b8d4f1a 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1196,9 +1196,12 @@ os and os.path pathlib :func:`os.path.exists` :meth:`Path.exists` :func:`os.path.expanduser` :meth:`Path.expanduser` and :meth:`Path.home` +:func:`os.listdir` :meth:`Path.iterdir` :func:`os.path.isdir` :meth:`Path.is_dir` :func:`os.path.isfile` :meth:`Path.is_file` :func:`os.path.islink` :meth:`Path.is_symlink` +:func:`os.link` :meth:`Path.link_to` +:func:`os.symlink` :meth:`Path.symlink_to` :func:`os.readlink` :meth:`Path.readlink` :func:`os.stat` :meth:`Path.stat`, :meth:`Path.owner`, From 6b1f82c70a0deec98581ba0e9268e65718fec742 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 13 Aug 2020 22:11:50 +0200 Subject: [PATCH 176/197] bpo-40204, doc: Fix syntax of C variables (GH-21846) For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3. --- Doc/c-api/arg.rst | 26 +++++++++++----------- Doc/c-api/buffer.rst | 26 +++++++++++----------- Doc/c-api/call.rst | 14 ++++++------ Doc/c-api/capsule.rst | 2 +- Doc/c-api/dict.rst | 6 ++--- Doc/c-api/exceptions.rst | 4 ++-- Doc/c-api/file.rst | 4 ++-- Doc/c-api/init.rst | 48 ++++++++++++++++++++-------------------- Doc/c-api/intro.rst | 6 ++--- Doc/c-api/marshal.rst | 8 +++---- Doc/c-api/memory.rst | 26 +++++++++++----------- Doc/c-api/module.rst | 4 ++-- Doc/c-api/object.rst | 2 +- Doc/c-api/structures.rst | 18 +++++++-------- Doc/c-api/tuple.rst | 2 +- Doc/c-api/typeobj.rst | 4 ++-- Doc/c-api/unicode.rst | 2 +- Doc/c-api/veryhigh.rst | 4 ++-- Doc/whatsnew/3.3.rst | 4 ++-- 19 files changed, 105 insertions(+), 105 deletions(-) diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst index 26e872c5a348e3..bdaae44e240a02 100644 --- a/Doc/c-api/arg.rst +++ b/Doc/c-api/arg.rst @@ -129,12 +129,12 @@ which disallows mutable objects such as :class:`bytearray`. ``S`` (:class:`bytes`) [PyBytesObject \*] Requires that the Python object is a :class:`bytes` object, without attempting any conversion. Raises :exc:`TypeError` if the object is not - a bytes object. The C variable may also be declared as :c:type:`PyObject\*`. + a bytes object. The C variable may also be declared as :c:type:`PyObject*`. ``Y`` (:class:`bytearray`) [PyByteArrayObject \*] Requires that the Python object is a :class:`bytearray` object, without attempting any conversion. Raises :exc:`TypeError` if the object is not - a :class:`bytearray` object. The C variable may also be declared as :c:type:`PyObject\*`. + a :class:`bytearray` object. The C variable may also be declared as :c:type:`PyObject*`. ``u`` (:class:`str`) [const Py_UNICODE \*] Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of @@ -181,7 +181,7 @@ which disallows mutable objects such as :class:`bytearray`. ``U`` (:class:`str`) [PyObject \*] Requires that the Python object is a Unicode object, without attempting any conversion. Raises :exc:`TypeError` if the object is not a Unicode - object. The C variable may also be declared as :c:type:`PyObject\*`. + object. The C variable may also be declared as :c:type:`PyObject*`. ``w*`` (read-write :term:`bytes-like object`) [Py_buffer] This format accepts any object which implements the read-write buffer @@ -194,10 +194,10 @@ which disallows mutable objects such as :class:`bytearray`. It only works for encoded data without embedded NUL bytes. This format requires two arguments. The first is only used as input, and - must be a :c:type:`const char\*` which points to the name of an encoding as a + must be a :c:type:`const char*` which points to the name of an encoding as a NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. An exception is raised if the named encoding is not known to Python. The - second argument must be a :c:type:`char\*\*`; the value of the pointer it + second argument must be a :c:type:`char**`; the value of the pointer it references will be set to a buffer with the contents of the argument text. The text will be encoded in the encoding specified by the first argument. @@ -217,10 +217,10 @@ which disallows mutable objects such as :class:`bytearray`. characters. It requires three arguments. The first is only used as input, and must be a - :c:type:`const char\*` which points to the name of an encoding as a + :c:type:`const char*` which points to the name of an encoding as a NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. An exception is raised if the named encoding is not known to Python. The - second argument must be a :c:type:`char\*\*`; the value of the pointer it + second argument must be a :c:type:`char**`; the value of the pointer it references will be set to a buffer with the contents of the argument text. The text will be encoded in the encoding specified by the first argument. The third argument must be a pointer to an integer; the referenced integer @@ -320,7 +320,7 @@ Other objects ``O!`` (object) [*typeobject*, PyObject \*] Store a Python object in a C object pointer. This is similar to ``O``, but takes two C arguments: the first is the address of a Python type object, the - second is the address of the C variable (of type :c:type:`PyObject\*`) into which + second is the address of the C variable (of type :c:type:`PyObject*`) into which the object pointer is stored. If the Python object does not have the required type, :exc:`TypeError` is raised. @@ -329,13 +329,13 @@ Other objects ``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 - variable (of arbitrary type), converted to :c:type:`void \*`. The *converter* + variable (of arbitrary type), converted to :c:type:`void *`. The *converter* function in turn is called as follows:: status = converter(object, address); where *object* is the Python object to be converted and *address* is the - :c:type:`void\*` argument that was passed to the :c:func:`PyArg_Parse\*` function. + :c:type:`void*` argument that was passed to the :c:func:`PyArg_Parse\*` function. The returned *status* should be ``1`` for a successful conversion and ``0`` if the conversion has failed. When the conversion fails, the *converter* function should raise an exception and leave the content of *address* unmodified. @@ -481,7 +481,7 @@ API Functions *args*; it must actually be a tuple. The length of the tuple must be at least *min* and no more than *max*; *min* and *max* may be equal. Additional arguments must be passed to the function, each of which should be a pointer to a - :c:type:`PyObject\*` variable; these will be filled in with the values from + :c:type:`PyObject*` variable; these will be filled in with the values from *args*; they will contain borrowed references. The variables which correspond to optional parameters not given by *args* will not be filled in; these should be initialized by the caller. This function returns true on success and false if @@ -650,8 +650,8 @@ Building values ``O&`` (object) [*converter*, *anything*] Convert *anything* to a Python object through a *converter* function. The - function is called with *anything* (which should be compatible with :c:type:`void - \*`) as its argument and should return a "new" Python object, or ``NULL`` if an + function is called with *anything* (which should be compatible with :c:type:`void*`) + as its argument and should return a "new" Python object, or ``NULL`` if an error occurred. ``(items)`` (:class:`tuple`) [*matching-items*] diff --git a/Doc/c-api/buffer.rst b/Doc/c-api/buffer.rst index ddb28af88980c1..e32719373cc716 100644 --- a/Doc/c-api/buffer.rst +++ b/Doc/c-api/buffer.rst @@ -89,7 +89,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. .. c:type:: Py_buffer - .. c:member:: void \*buf + .. c:member:: void *buf A pointer to the start of the logical structure described by the buffer fields. This can be any location within the underlying physical memory @@ -99,7 +99,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. For :term:`contiguous` arrays, the value points to the beginning of the memory block. - .. c:member:: void \*obj + .. c:member:: void *obj A new reference to the exporting object. The reference is owned by the consumer and automatically decremented and set to ``NULL`` by @@ -145,7 +145,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. or a :c:macro:`PyBUF_WRITABLE` request, the consumer must disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``. - .. c:member:: const char \*format + .. c:member:: const char *format A *NUL* terminated string in :mod:`struct` module style syntax describing the contents of a single item. If this is ``NULL``, ``"B"`` (unsigned bytes) @@ -164,7 +164,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. to 64. Exporters MUST respect this limit, consumers of multi-dimensional buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions. - .. c:member:: Py_ssize_t \*shape + .. c:member:: Py_ssize_t *shape An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` indicating the shape of the memory as an n-dimensional array. Note that @@ -177,7 +177,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. The shape array is read-only for the consumer. - .. c:member:: Py_ssize_t \*strides + .. c:member:: Py_ssize_t *strides An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` giving the number of bytes to skip to get to a new element in each @@ -189,7 +189,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. The strides array is read-only for the consumer. - .. c:member:: Py_ssize_t \*suboffsets + .. c:member:: Py_ssize_t *suboffsets An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If ``suboffsets[n] >= 0``, the values stored along the nth dimension are @@ -207,7 +207,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`. The suboffsets array is read-only for the consumer. - .. c:member:: void \*internal + .. c:member:: void *internal This is for use internally by the exporting object. For example, this might be re-cast as an integer by the exporter and used to store flags @@ -438,12 +438,12 @@ Buffer-related functions Send a request to *exporter* to fill in *view* as specified by *flags*. If the exporter cannot provide a buffer of the exact type, it MUST raise - :c:data:`PyExc_BufferError`, set :c:member:`view->obj` to ``NULL`` and + :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``. - On success, fill in *view*, set :c:member:`view->obj` to a new reference + On success, fill in *view*, set ``view->obj`` to a new reference to *exporter* and return 0. In the case of chained buffer providers - that redirect requests to a single object, :c:member:`view->obj` MAY + that redirect requests to a single object, ``view->obj`` MAY refer to this object instead of *exporter* (See :ref:`Buffer Object Structures `). Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls @@ -455,7 +455,7 @@ Buffer-related functions .. c:function:: void PyBuffer_Release(Py_buffer *view) Release the buffer *view* and decrement the reference count for - :c:member:`view->obj`. This function MUST be called when the buffer + ``view->obj``. This function MUST be called when the buffer is no longer being used, otherwise reference leaks may occur. It is an error to call this function on a buffer that was not obtained via @@ -516,9 +516,9 @@ Buffer-related functions *view* as specified by flags, unless *buf* has been designated as read-only and :c:macro:`PyBUF_WRITABLE` is set in *flags*. - On success, set :c:member:`view->obj` to a new reference to *exporter* and + On success, set ``view->obj`` to a new reference to *exporter* and return 0. Otherwise, raise :c:data:`PyExc_BufferError`, set - :c:member:`view->obj` to ``NULL`` and return ``-1``; + ``view->obj`` to ``NULL`` and return ``-1``; If this function is used as part of a :ref:`getbufferproc `, *exporter* MUST be set to the exporting object and *flags* must be passed diff --git a/Doc/c-api/call.rst b/Doc/c-api/call.rst index 0832e7e2193600..31dc9c8031fdb6 100644 --- a/Doc/c-api/call.rst +++ b/Doc/c-api/call.rst @@ -84,7 +84,7 @@ This is a pointer to a function with the following signature: and they must be unique. If there are no keyword arguments, then *kwnames* can instead be *NULL*. -.. c:var:: PY_VECTORCALL_ARGUMENTS_OFFSET +.. c:macro:: PY_VECTORCALL_ARGUMENTS_OFFSET If this flag is set in a vectorcall *nargsf* argument, the callee is allowed to temporarily change ``args[-1]``. In other words, *args* points to @@ -283,7 +283,7 @@ please see individual documentation for details. This is the equivalent of the Python expression: ``callable(*args)``. - Note that if you only pass :c:type:`PyObject \*` args, + Note that if you only pass :c:type:`PyObject *` args, :c:func:`PyObject_CallFunctionObjArgs` is a faster alternative. .. versionchanged:: 3.4 @@ -304,17 +304,17 @@ please see individual documentation for details. This is the equivalent of the Python expression: ``obj.name(arg1, arg2, ...)``. - Note that if you only pass :c:type:`PyObject \*` args, + Note that if you only pass :c:type:`PyObject *` args, :c:func:`PyObject_CallMethodObjArgs` is a faster alternative. .. versionchanged:: 3.4 The types of *name* and *format* were changed from ``char *``. -.. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL) +.. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ...) Call a callable Python object *callable*, with a variable number of - :c:type:`PyObject \*` arguments. The arguments are provided as a variable number + :c:type:`PyObject *` arguments. The arguments are provided as a variable number of parameters followed by *NULL*. Return the result of the call on success, or raise an exception and return @@ -324,11 +324,11 @@ please see individual documentation for details. ``callable(arg1, arg2, ...)``. -.. c:function:: PyObject* PyObject_CallMethodObjArgs(PyObject *obj, PyObject *name, ..., NULL) +.. c:function:: PyObject* PyObject_CallMethodObjArgs(PyObject *obj, PyObject *name, ...) Call a method of the Python object *obj*, where the name of the method is given as a Python string object in *name*. It is called with a variable number of - :c:type:`PyObject \*` arguments. The arguments are provided as a variable number + :c:type:`PyObject *` arguments. The arguments are provided as a variable number of parameters followed by *NULL*. Return the result of the call on success, or raise an exception and return diff --git a/Doc/c-api/capsule.rst b/Doc/c-api/capsule.rst index 78e21140b2f80c..5eb313c89bfd59 100644 --- a/Doc/c-api/capsule.rst +++ b/Doc/c-api/capsule.rst @@ -15,7 +15,7 @@ Refer to :ref:`using-capsules` for more information on using these objects. .. c:type:: PyCapsule This subtype of :c:type:`PyObject` represents an opaque value, useful for C - extension modules who need to pass an opaque value (as a :c:type:`void\*` + extension modules who need to pass an opaque value (as a :c:type:`void*` pointer) through Python code to other C code. It is often used to make a C function pointer defined in one module available to other modules, so the regular import mechanism can be used to access C APIs defined in dynamically diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst index 7493837ac622f6..769484134ed515 100644 --- a/Doc/c-api/dict.rst +++ b/Doc/c-api/dict.rst @@ -73,7 +73,7 @@ Dictionary Objects .. index:: single: PyUnicode_FromString() Insert *val* into the dictionary *p* using *key* as a key. *key* should - be a :c:type:`const char\*`. The key object is created using + be a :c:type:`const char*`. The key object is created using ``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on failure. This function *does not* steal a reference to *val*. @@ -116,7 +116,7 @@ Dictionary Objects .. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key) This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a - :c:type:`const char\*`, rather than a :c:type:`PyObject\*`. + :c:type:`const char*`, rather than a :c:type:`PyObject*`. Note that exceptions which occur while calling :meth:`__hash__` and :meth:`__eq__` methods and creating a temporary string object @@ -165,7 +165,7 @@ Dictionary Objects prior to the first call to this function to start the iteration; the function returns true for each pair in the dictionary, and false once all pairs have been reported. The parameters *pkey* and *pvalue* should either - point to :c:type:`PyObject\*` variables that will be filled in with each key + point to :c:type:`PyObject*` variables that will be filled in with each key and value, respectively, or may be ``NULL``. Any references returned through them are borrowed. *ppos* should not be altered during iteration. Its value represents offsets within the internal dictionary structure, and diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index b4722ff81979f4..247b6d68eceae9 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -783,7 +783,7 @@ Standard Exceptions All standard Python exceptions are available as global variables whose names are ``PyExc_`` followed by the Python exception name. These have the type -:c:type:`PyObject\*`; they are all class objects. For completeness, here are all +:c:type:`PyObject*`; they are all class objects. For completeness, here are all the variables: .. index:: @@ -1003,7 +1003,7 @@ Standard Warning Categories All standard Python warning categories are available as global variables whose names are ``PyExc_`` followed by the Python exception name. These have the type -:c:type:`PyObject\*`; they are all class objects. For completeness, here are all +:c:type:`PyObject*`; they are all class objects. For completeness, here are all the variables: .. index:: diff --git a/Doc/c-api/file.rst b/Doc/c-api/file.rst index 5370c4e350a0b5..ea027ee975c651 100644 --- a/Doc/c-api/file.rst +++ b/Doc/c-api/file.rst @@ -8,7 +8,7 @@ File Objects .. index:: object: file These APIs are a minimal emulation of the Python 2 C API for built-in file -objects, which used to rely on the buffered I/O (:c:type:`FILE\*`) support +objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support from the C standard library. In Python 3, files and streams use the new :mod:`io` module, which defines several layers over the low-level unbuffered I/O of the operating system. The functions described below are @@ -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, const char *name, const char *mode, int buffering, const char *encoding, const char *errors, const char *newline, int closefd) +.. c:function:: PyObject* 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/init.rst b/Doc/c-api/init.rst index 68fed2acc447ee..7f06648bcb4572 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -81,7 +81,7 @@ When a flag is set by an option, the value of the flag is the number of times that the option was set. For example, ``-b`` sets :c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. -.. c:var:: Py_BytesWarningFlag +.. c:var:: int Py_BytesWarningFlag Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater @@ -89,7 +89,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. Set by the :option:`-b` option. -.. c:var:: Py_DebugFlag +.. c:var:: int Py_DebugFlag Turn on parser debugging output (for expert only, depending on compilation options). @@ -97,7 +97,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment variable. -.. c:var:: Py_DontWriteBytecodeFlag +.. c:var:: int Py_DontWriteBytecodeFlag If set to non-zero, Python won't try to write ``.pyc`` files on the import of source modules. @@ -105,14 +105,14 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable. -.. c:var:: Py_FrozenFlag +.. c:var:: int Py_FrozenFlag Suppress error messages when calculating the module search path in :c:func:`Py_GetPath`. Private flag used by ``_freeze_importlib`` and ``frozenmain`` programs. -.. c:var:: Py_HashRandomizationFlag +.. c:var:: int Py_HashRandomizationFlag Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to a non-empty string. @@ -120,14 +120,14 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment variable to initialize the secret hash seed. -.. c:var:: Py_IgnoreEnvironmentFlag +.. c:var:: int Py_IgnoreEnvironmentFlag Ignore all :envvar:`PYTHON*` environment variables, e.g. :envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set. Set by the :option:`-E` and :option:`-I` options. -.. c:var:: Py_InspectFlag +.. c:var:: int Py_InspectFlag When a script is passed as first argument or the :option:`-c` option is used, enter interactive mode after executing the script or the command, even when @@ -136,11 +136,11 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment variable. -.. c:var:: Py_InteractiveFlag +.. c:var:: int Py_InteractiveFlag Set by the :option:`-i` option. -.. c:var:: Py_IsolatedFlag +.. c:var:: int Py_IsolatedFlag Run Python in isolated mode. In isolated mode :data:`sys.path` contains neither the script's directory nor the user's site-packages directory. @@ -149,7 +149,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. .. versionadded:: 3.4 -.. c:var:: Py_LegacyWindowsFSEncodingFlag +.. c:var:: int Py_LegacyWindowsFSEncodingFlag If the flag is non-zero, use the ``mbcs`` encoding instead of the UTF-8 encoding for the filesystem encoding. @@ -161,7 +161,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. .. availability:: Windows. -.. c:var:: Py_LegacyWindowsStdioFlag +.. c:var:: int Py_LegacyWindowsStdioFlag If the flag is non-zero, use :class:`io.FileIO` instead of :class:`WindowsConsoleIO` for :mod:`sys` standard streams. @@ -173,7 +173,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. .. availability:: Windows. -.. c:var:: Py_NoSiteFlag +.. c:var:: int Py_NoSiteFlag Disable the import of the module :mod:`site` and the site-dependent manipulations of :data:`sys.path` that it entails. Also disable these @@ -182,7 +182,7 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. Set by the :option:`-S` option. -.. c:var:: Py_NoUserSiteDirectory +.. c:var:: int Py_NoUserSiteDirectory Don't add the :data:`user site-packages directory ` to :data:`sys.path`. @@ -190,12 +190,12 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. Set by the :option:`-s` and :option:`-I` options, and the :envvar:`PYTHONNOUSERSITE` environment variable. -.. c:var:: Py_OptimizeFlag +.. c:var:: int Py_OptimizeFlag Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment variable. -.. c:var:: Py_QuietFlag +.. c:var:: int Py_QuietFlag Don't display the copyright and version messages even in interactive mode. @@ -203,14 +203,14 @@ to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to 2. .. versionadded:: 3.2 -.. c:var:: Py_UnbufferedStdioFlag +.. c:var:: int Py_UnbufferedStdioFlag Force the stdout and stderr streams to be unbuffered. Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` environment variable. -.. c:var:: Py_VerboseFlag +.. c:var:: int Py_VerboseFlag Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. If greater or equal @@ -830,7 +830,7 @@ code, or when embedding the Python interpreter: .. c:type:: PyThreadState This data structure represents the state of a single thread. The only public - data member is :c:type:`PyInterpreterState \*`:attr:`interp`, which points to + data member is :attr:`interp` (:c:type:`PyInterpreterState *`), which points to this thread's interpreter state. @@ -1619,7 +1619,7 @@ The Python interpreter provides low-level support for thread-local storage (TLS) which wraps the underlying native TLS implementation to support the Python-level thread local storage API (:class:`threading.local`). The CPython C level APIs are similar to those offered by pthreads and Windows: -use a thread key and functions to associate a :c:type:`void\*` value per +use a thread key and functions to associate a :c:type:`void*` value per thread. The GIL does *not* need to be held when calling these functions; they supply @@ -1630,8 +1630,8 @@ you need to include :file:`pythread.h` to use thread-local storage. .. note:: None of these API functions handle memory management on behalf of the - :c:type:`void\*` values. You need to allocate and deallocate them yourself. - If the :c:type:`void\*` values happen to be :c:type:`PyObject\*`, these + :c:type:`void*` values. You need to allocate and deallocate them yourself. + If the :c:type:`void*` values happen to be :c:type:`PyObject*`, these functions don't do refcount operations on them either. .. _thread-specific-storage-api: @@ -1727,14 +1727,14 @@ undefined if the given :c:type:`Py_tss_t` has not been initialized by .. c:function:: int PyThread_tss_set(Py_tss_t *key, void *value) - Return a zero value to indicate successfully associating a :c:type:`void\*` + Return a zero value to indicate successfully associating a :c:type:`void*` value with a TSS key in the current thread. Each thread has a distinct - mapping of the key to a :c:type:`void\*` value. + mapping of the key to a :c:type:`void*` value. .. c:function:: void* PyThread_tss_get(Py_tss_t *key) - Return the :c:type:`void\*` value associated with a TSS key in the current + Return the :c:type:`void*` value associated with a TSS key in the current thread. This returns ``NULL`` if no value is associated with the key in the current thread. diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index e89a788de0d503..7ca8693afab79c 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -229,13 +229,13 @@ Objects, Types and Reference Counts .. index:: object: type Most Python/C API functions have one or more arguments as well as a return value -of type :c:type:`PyObject\*`. This type is a pointer to an opaque data type +of type :c:type:`PyObject*`. This type is a pointer to an opaque data type representing an arbitrary Python object. Since all Python object types are treated the same way by the Python language in most situations (e.g., assignments, scope rules, and argument passing), it is only fitting that they should be represented by a single C type. Almost all Python objects live on the heap: you never declare an automatic or static variable of type -:c:type:`PyObject`, only pointer variables of type :c:type:`PyObject\*` can be +:c:type:`PyObject`, only pointer variables of type :c:type:`PyObject*` can be declared. The sole exception are the type objects; since these must never be deallocated, they are typically static :c:type:`PyTypeObject` objects. @@ -496,7 +496,7 @@ Types There are few other data types that play a significant role in the Python/C API; most are simple C types such as :c:type:`int`, :c:type:`long`, -:c:type:`double` and :c:type:`char\*`. A few structure types are used to +:c:type:`double` and :c:type:`char*`. A few structure types are used to describe static tables used to list the functions exported by a module or the data attributes of a new object type, and another is used to describe the value of a complex number. These will be discussed together with the functions that diff --git a/Doc/c-api/marshal.rst b/Doc/c-api/marshal.rst index 7b179e22e290e1..7bb0dad2b6b6d5 100644 --- a/Doc/c-api/marshal.rst +++ b/Doc/c-api/marshal.rst @@ -43,7 +43,7 @@ The following functions allow marshalled values to be read back in. .. c:function:: long PyMarshal_ReadLongFromFile(FILE *file) - Return a C :c:type:`long` from the data stream in a :c:type:`FILE\*` opened + Return a C :c:type:`long` from the data stream in a :c:type:`FILE*` opened for reading. Only a 32-bit value can be read in using this function, regardless of the native size of :c:type:`long`. @@ -53,7 +53,7 @@ The following functions allow marshalled values to be read back in. .. c:function:: int PyMarshal_ReadShortFromFile(FILE *file) - Return a C :c:type:`short` from the data stream in a :c:type:`FILE\*` opened + Return a C :c:type:`short` from the data stream in a :c:type:`FILE*` opened for reading. Only a 16-bit value can be read in using this function, regardless of the native size of :c:type:`short`. @@ -63,7 +63,7 @@ The following functions allow marshalled values to be read back in. .. c:function:: PyObject* PyMarshal_ReadObjectFromFile(FILE *file) - Return a Python object from the data stream in a :c:type:`FILE\*` opened for + Return a Python object from the data stream in a :c:type:`FILE*` opened for reading. On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` @@ -72,7 +72,7 @@ The following functions allow marshalled values to be read back in. .. c:function:: PyObject* PyMarshal_ReadLastObjectFromFile(FILE *file) - Return a Python object from the data stream in a :c:type:`FILE\*` opened for + Return a Python object from the data stream in a :c:type:`FILE*` opened for reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function assumes that no further objects will be read from the file, allowing it to aggressively load file data into memory so that the de-serialization can diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index 8a8542f0479ec5..87425bcf1e71f2 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -109,7 +109,7 @@ zero bytes. .. c:function:: void* PyMem_RawMalloc(size_t n) - Allocates *n* bytes and returns a pointer of type :c:type:`void\*` to the + 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 @@ -120,7 +120,7 @@ zero bytes. .. c:function:: void* PyMem_RawCalloc(size_t nelem, size_t elsize) Allocates *nelem* elements each whose size in bytes is *elsize* and returns - a pointer of type :c:type:`void\*` to the allocated memory, or ``NULL`` if the + a pointer of type :c:type:`void*` to the allocated memory, or ``NULL`` if the request fails. The memory is initialized to zeros. Requesting zero elements or elements of size zero bytes returns a distinct @@ -180,7 +180,7 @@ The :ref:`default memory allocator ` uses the .. c:function:: void* PyMem_Malloc(size_t n) - Allocates *n* bytes and returns a pointer of type :c:type:`void\*` to the + 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 @@ -191,7 +191,7 @@ The :ref:`default memory allocator ` uses the .. c:function:: void* PyMem_Calloc(size_t nelem, size_t elsize) Allocates *nelem* elements each whose size in bytes is *elsize* and returns - a pointer of type :c:type:`void\*` to the allocated memory, or ``NULL`` if the + a pointer of type :c:type:`void*` to the allocated memory, or ``NULL`` if the request fails. The memory is initialized to zeros. Requesting zero elements or elements of size zero bytes returns a distinct @@ -233,14 +233,14 @@ The following type-oriented macros are provided for convenience. Note that .. c:function:: TYPE* PyMem_New(TYPE, size_t n) Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes of - memory. Returns a pointer cast to :c:type:`TYPE\*`. The memory will not have + memory. Returns a pointer cast to :c:type:`TYPE*`. The memory will not have been initialized in any way. .. c:function:: TYPE* PyMem_Resize(void *p, TYPE, size_t n) Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * - sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE\*`. On return, + sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE*`. On return, *p* will be a pointer to the new memory area, or ``NULL`` in the event of failure. @@ -282,7 +282,7 @@ The :ref:`default object allocator ` uses the .. c:function:: void* PyObject_Malloc(size_t n) - Allocates *n* bytes and returns a pointer of type :c:type:`void\*` to the + 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 @@ -293,7 +293,7 @@ The :ref:`default object allocator ` uses the .. c:function:: void* PyObject_Calloc(size_t nelem, size_t elsize) Allocates *nelem* elements each whose size in bytes is *elsize* and returns - a pointer of type :c:type:`void\*` to the allocated memory, or ``NULL`` if the + a pointer of type :c:type:`void*` to the allocated memory, or ``NULL`` if the request fails. The memory is initialized to zeros. Requesting zero elements or elements of size zero bytes returns a distinct @@ -388,7 +388,7 @@ Customize Memory Allocators Enum used to identify an allocator domain. Domains: - .. c:var:: PYMEM_DOMAIN_RAW + .. c:macro:: PYMEM_DOMAIN_RAW Functions: @@ -397,7 +397,7 @@ Customize Memory Allocators * :c:func:`PyMem_RawCalloc` * :c:func:`PyMem_RawFree` - .. c:var:: PYMEM_DOMAIN_MEM + .. c:macro:: PYMEM_DOMAIN_MEM Functions: @@ -406,7 +406,7 @@ Customize Memory Allocators * :c:func:`PyMem_Calloc` * :c:func:`PyMem_Free` - .. c:var:: PYMEM_DOMAIN_OBJ + .. c:macro:: PYMEM_DOMAIN_OBJ Functions: @@ -519,11 +519,11 @@ Customize pymalloc Arena Allocator | ``void free(void *ctx, size_t size, void *ptr)`` | free an arena | +--------------------------------------------------+---------------------------------------+ -.. c:function:: PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator) +.. c:function:: void PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator) Get the arena allocator. -.. c:function:: PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator) +.. c:function:: void PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator) Set the arena allocator. diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index 8a415dfa30a35e..6e9474bfa40eba 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -325,7 +325,7 @@ The *m_slots* array must be terminated by a slot with id 0. The available slot types are: -.. c:var:: Py_mod_create +.. c:macro:: Py_mod_create Specifies a function that is called to create the module object itself. The *value* pointer of this slot must point to a function of the signature: @@ -357,7 +357,7 @@ The available slot types are: ``PyModuleDef`` has non-``NULL`` ``m_traverse``, ``m_clear``, ``m_free``; non-zero ``m_size``; or slots other than ``Py_mod_create``. -.. c:var:: Py_mod_exec +.. c:macro:: Py_mod_exec Specifies a function that is called to *execute* the module. This is equivalent to executing the code of a Python module: typically, diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index b9c137ea352e78..a387b4a2df1342 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -291,7 +291,7 @@ Object Protocol is equivalent to the Python expression ``type(o)``. This function increments the reference count of the return value. There's really no reason to use this function instead of the common expression ``o->ob_type``, which returns a - pointer of type :c:type:`PyTypeObject\*`, except when the incremented reference + pointer of type :c:type:`PyTypeObject*`, except when the incremented reference count is needed. diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index b2392fa5e19c5a..a9e1c6fbcc3f94 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -145,7 +145,7 @@ Implementing functions and methods .. c:type:: PyCFunction Type of the functions used to implement most Python callables in C. - Functions of this type take two :c:type:`PyObject\*` parameters and return + Functions of this type take two :c:type:`PyObject*` parameters and return one such value. If the return value is ``NULL``, an exception shall have been set. If not ``NULL``, the return value is interpreted as the return value of the function as exposed in Python. The function must return a new @@ -224,10 +224,10 @@ Implementing functions and methods +------------------+---------------+-------------------------------+ The :attr:`ml_meth` is a C function pointer. The functions may be of different -types, but they always return :c:type:`PyObject\*`. If the function is not of +types, but they always return :c:type:`PyObject*`. If the function is not of the :c:type:`PyCFunction`, the compiler will require a cast in the method table. Even though :c:type:`PyCFunction` defines the first parameter as -:c:type:`PyObject\*`, it is common that the method implementation uses the +:c:type:`PyObject*`, it is common that the method implementation uses the specific C type of the *self* object. The :attr:`ml_flags` field is a bitfield which can include the following flags. @@ -239,7 +239,7 @@ There are these calling conventions: .. data:: METH_VARARGS This is the typical calling convention, where the methods have the type - :c:type:`PyCFunction`. The function expects two :c:type:`PyObject\*` values. + :c:type:`PyCFunction`. The function expects two :c:type:`PyObject*` values. The first one is the *self* object for methods; for module functions, it is the module object. The second parameter (often called *args*) is a tuple object representing all arguments. This parameter is typically processed @@ -260,7 +260,7 @@ There are these calling conventions: Fast calling convention supporting only positional arguments. The methods have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the second parameter is a C array - of :c:type:`PyObject\*` values indicating the arguments and the third + of :c:type:`PyObject*` values indicating the arguments and the third parameter is the number of arguments (the length of the array). This is not part of the :ref:`limited API `. @@ -274,7 +274,7 @@ There are these calling conventions: with methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments are passed the same way as in the :ref:`vectorcall protocol `: - there is an additional fourth :c:type:`PyObject\*` parameter + there is an additional fourth :c:type:`PyObject*` parameter which is a tuple representing the names of the keyword arguments (which are guaranteed to be strings) or possibly ``NULL`` if there are no keywords. The values of the keyword @@ -312,7 +312,7 @@ There are these calling conventions: Methods with a single object argument can be listed with the :const:`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``"O"`` argument. They have the type :c:type:`PyCFunction`, with the *self* parameter, and a - :c:type:`PyObject\*` parameter representing the single argument. + :c:type:`PyObject*` parameter representing the single argument. These two constants are not used to indicate the calling convention but the @@ -463,7 +463,7 @@ Accessing attributes of extension types | | | getter and setter | +-------------+------------------+-----------------------------------+ - The ``get`` function takes one :c:type:`PyObject\*` parameter (the + The ``get`` function takes one :c:type:`PyObject*` parameter (the instance) and a function pointer (the associated ``closure``):: typedef PyObject *(*getter)(PyObject *, void *); @@ -471,7 +471,7 @@ Accessing attributes of extension types It should return a new reference on success or ``NULL`` with a set exception on failure. - ``set`` functions take two :c:type:`PyObject\*` parameters (the instance and + ``set`` functions take two :c:type:`PyObject*` parameters (the instance and the value to be set) and a function pointer (the associated ``closure``):: typedef int (*setter)(PyObject *, PyObject *, void *); diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst index c14cb2d38fd54a..bf751e44acde09 100644 --- a/Doc/c-api/tuple.rst +++ b/Doc/c-api/tuple.rst @@ -161,7 +161,7 @@ type. .. c:type:: PyStructSequence_Field Describes a field of a struct sequence. As a struct sequence is modeled as a - tuple, all fields are typed as :c:type:`PyObject\*`. The index in the + tuple, all fields are typed as :c:type:`PyObject*`. The index in the :attr:`fields` array of the :c:type:`PyStructSequence_Desc` determines which field of the struct sequence is described. diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst index 385c7f94c672f2..ddcb8ae3d0950c 100644 --- a/Doc/c-api/typeobj.rst +++ b/Doc/c-api/typeobj.rst @@ -1348,7 +1348,7 @@ and :c:type:`PyType_Type` effectively act as defaults.) The following macro is defined to ease writing rich comparison functions: - .. c:function:: PyObject \*Py_RETURN_RICHCOMPARE(VAL_A, VAL_B, int op) + .. c:macro:: Py_RETURN_RICHCOMPARE(VAL_A, VAL_B, op) Return ``Py_True`` or ``Py_False`` from the function, depending on the result of a comparison. @@ -1386,7 +1386,7 @@ and :c:type:`PyType_Type` effectively act as defaults.) than zero and contains the offset in the instance structure of the weak reference list head (ignoring the GC header, if present); this offset is used by :c:func:`PyObject_ClearWeakRefs` and the :c:func:`PyWeakref_\*` functions. The - instance structure needs to include a field of type :c:type:`PyObject\*` which is + instance structure needs to include a field of type :c:type:`PyObject*` which is initialized to ``NULL``. Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that is the list head for diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 577cdf25114665..5518214a793e0c 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -199,7 +199,7 @@ access internal read-only data of Unicode objects: .. versionadded:: 3.3 -.. c:function:: PyUnicode_MAX_CHAR_VALUE(PyObject *o) +.. c:macro:: PyUnicode_MAX_CHAR_VALUE(o) Return the maximum code point that is suitable for creating another string based on *o*, which must be in the "canonical" representation. This is diff --git a/Doc/c-api/veryhigh.rst b/Doc/c-api/veryhigh.rst index d6aecc394c9e70..b908cb8354f73f 100644 --- a/Doc/c-api/veryhigh.rst +++ b/Doc/c-api/veryhigh.rst @@ -16,11 +16,11 @@ parameter. The available start symbols are :const:`Py_eval_input`, :const:`Py_file_input`, and :const:`Py_single_input`. These are described following the functions which accept them as parameters. -Note also that several of these functions take :c:type:`FILE\*` parameters. One +Note also that several of these functions take :c:type:`FILE*` parameters. One particular issue which needs to be handled carefully is that the :c:type:`FILE` structure for different C libraries can be different and incompatible. Under Windows (at least), it is possible for dynamically linked extensions to actually -use different libraries, so care should be taken that :c:type:`FILE\*` parameters +use different libraries, so care should be taken that :c:type:`FILE*` parameters are only passed to these functions if it is certain that they were created by the same library that the Python runtime is using. diff --git a/Doc/whatsnew/3.3.rst b/Doc/whatsnew/3.3.rst index f1a033c6dae61f..361e6db07c3cdb 100644 --- a/Doc/whatsnew/3.3.rst +++ b/Doc/whatsnew/3.3.rst @@ -2309,9 +2309,9 @@ Encoders: :c:func:`PyUnicode_AsUTF8String` * :c:func:`PyUnicode_EncodeUTF32` * :c:func:`PyUnicode_EncodeUTF16` -* :c:func:`PyUnicode_EncodeUnicodeEscape:` use +* :c:func:`PyUnicode_EncodeUnicodeEscape` use :c:func:`PyUnicode_AsUnicodeEscapeString` -* :c:func:`PyUnicode_EncodeRawUnicodeEscape:` use +* :c:func:`PyUnicode_EncodeRawUnicodeEscape` use :c:func:`PyUnicode_AsRawUnicodeEscapeString` * :c:func:`PyUnicode_EncodeLatin1`: use :c:func:`PyUnicode_AsLatin1String` * :c:func:`PyUnicode_EncodeASCII`: use :c:func:`PyUnicode_AsASCIIString` From 465d841457ab06cbe6bd89dc0f5f79f8d1ebd598 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Thu, 13 Aug 2020 17:33:56 -0300 Subject: [PATCH 177/197] Fixed comment about pathlib.link_to: it was added in 3.8, not changed. (#21851) --- Doc/library/pathlib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index f705d15b8d4f1a..04810f5204397b 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -1134,7 +1134,7 @@ call fails (for example because the path doesn't exist). Create a hard link pointing to a path named *target*. - .. versionchanged:: 3.8 + .. versionadded:: 3.8 .. method:: Path.write_bytes(data) From 4e982270bf406bee82c2feadf73d58228c582cc7 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Fri, 14 Aug 2020 00:35:52 +0100 Subject: [PATCH 178/197] bpo-41526: Fixed layout of final page of the installer (GH-21871) --- .../next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst | 2 ++ Tools/msi/bundle/Default.thm | 4 ++-- Tools/msi/bundle/Default.wxl | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst diff --git a/Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst b/Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst new file mode 100644 index 00000000000000..756c8270599f27 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-08-13-22-40-58.bpo-41526.-i2bwb.rst @@ -0,0 +1,2 @@ +Fixed layout of final page of the installer by removing the special thanks +to Mark Hammond (with his permission). diff --git a/Tools/msi/bundle/Default.thm b/Tools/msi/bundle/Default.thm index 7c37d2cafb399b..f5ba43d838fcf7 100644 --- a/Tools/msi/bundle/Default.thm +++ b/Tools/msi/bundle/Default.thm @@ -116,9 +116,9 @@ #(loc.SuccessHeader) - + - + #(loc.SuccessRestartText) diff --git a/Tools/msi/bundle/Default.wxl b/Tools/msi/bundle/Default.wxl index f0088d4e13e6bf..791ce6eab74745 100644 --- a/Tools/msi/bundle/Default.wxl +++ b/Tools/msi/bundle/Default.wxl @@ -107,9 +107,7 @@ Select Customize to review current options. &Restart New to Python? Start with the <a href="https://docs.python.org/[ShortVersion]/tutorial/index.html">online tutorial</a> and <a href="https://docs.python.org/[ShortVersion]/index.html">documentation</a>. At your terminal, type "py" to launch Python, or search for Python in your Start menu. -See <a href="https://docs.python.org/[ShortVersion]/whatsnew/[ShortVersion].html">what's new</a> in this release, or find more info about <a href="https://docs.python.org/[ShortVersion]/using/windows.html">using Python on Windows</a>. - -Special thanks to Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS. +See <a href="https://docs.python.org/[ShortVersion]/whatsnew/[ShortVersion].html">what's new</a> in this release, or find more info about <a href="https://docs.python.org/[ShortVersion]/using/windows.html">using Python on Windows</a>. Thank you for using [WixBundleName]. Thank you for using [WixBundleName]. From dec55486bb1f48f814c435e09b000535681089e7 Mon Sep 17 00:00:00 2001 From: Rishav Kundu Date: Fri, 14 Aug 2020 07:03:14 +0530 Subject: [PATCH 179/197] bpo-41410: Fix outdated info in mkstemp docs (GH-21701) Automerge-Triggered-By: @ericvsmith --- Doc/library/tempfile.rst | 5 ++--- Lib/tempfile.py | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index a59817c1039210..3a2b88c0cb6a20 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -175,9 +175,8 @@ The module defines the following user-callable items: If you want to force a bytes return value with otherwise default behavior, pass ``suffix=b''``. - If *text* is specified, it indicates whether to open the file in binary - mode (the default) or text mode. On some platforms, this makes no - difference. + If *text* is specified and true, the file is opened in text mode. + Otherwise, (the default) the file is opened in binary mode. :func:`mkstemp` returns a tuple containing an OS-level handle to an open file (as would be returned by :func:`os.open`) and the absolute pathname diff --git a/Lib/tempfile.py b/Lib/tempfile.py index ba04be8f9058e1..770f72c25295cb 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -308,8 +308,7 @@ def mkstemp(suffix=None, prefix=None, dir=None, text=False): otherwise a default directory is used. If 'text' is specified and true, the file is opened in text - mode. Else (the default) the file is opened in binary mode. On - some operating systems, this makes no difference. + mode. Else (the default) the file is opened in binary mode. If any of 'suffix', 'prefix' and 'dir' are not None, they must be the same type. If they are bytes, the returned name will be bytes; str From 6a2ed7f1c85cfb6e1269e1007673e840f39d24a9 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Thu, 13 Aug 2020 22:38:30 -0400 Subject: [PATCH 180/197] bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) Prior to this change, attempting to subclass the C implementation of zoneinfo.ZoneInfo gave the following error: TypeError: unbound method ZoneInfo.__init_subclass__() needs an argument https://bugs.python.org/issue41025 --- Lib/test/test_zoneinfo/test_zoneinfo.py | 4 ++-- .../next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst | 2 ++ Modules/_zoneinfo.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst diff --git a/Lib/test/test_zoneinfo/test_zoneinfo.py b/Lib/test/test_zoneinfo/test_zoneinfo.py index d16e0d2c331068..a9375fd55857bc 100644 --- a/Lib/test/test_zoneinfo/test_zoneinfo.py +++ b/Lib/test/test_zoneinfo/test_zoneinfo.py @@ -463,7 +463,7 @@ class CZoneInfoDatetimeSubclassTest(DatetimeSubclassMixin, CZoneInfoTest): pass -class ZoneInfoTestSubclass(ZoneInfoTest): +class ZoneInfoSubclassTest(ZoneInfoTest): @classmethod def setUpClass(cls): super().setUpClass() @@ -484,7 +484,7 @@ def test_subclass_own_cache(self): self.assertIsInstance(sub_obj, self.klass) -class CZoneInfoTestSubclass(ZoneInfoTest): +class CZoneInfoSubclassTest(ZoneInfoSubclassTest): module = c_zoneinfo diff --git a/Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst b/Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst new file mode 100644 index 00000000000000..21e184d0a40631 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-18-10-34-59.bpo-41025.elf_nz.rst @@ -0,0 +1,2 @@ +Fixed an issue preventing the C implementation of :class:`zoneinfo.ZoneInfo` +from being subclassed. diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index bee84cbf8f9f42..12b3969959bacf 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -2557,7 +2557,7 @@ static PyMethodDef zoneinfo_methods[] = { {"_unpickle", (PyCFunction)zoneinfo__unpickle, METH_VARARGS | METH_CLASS, PyDoc_STR("Private method used in unpickling.")}, {"__init_subclass__", (PyCFunction)(void (*)(void))zoneinfo_init_subclass, - METH_VARARGS | METH_KEYWORDS, + METH_VARARGS | METH_KEYWORDS | METH_CLASS, PyDoc_STR("Function to initialize subclasses.")}, {NULL} /* Sentinel */ }; From e5ff50ce1ccc3e10c9b90ea107b4622073101ccb Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 14 Aug 2020 12:20:05 +0200 Subject: [PATCH 181/197] bpo-40204: Fix reference to terms in the doc (GH-21865) Sphinx 3 requires to refer to terms with the exact case. For example, fix the Sphinx 3 warning: Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case sensitive match.made a reference to loader instead. --- Doc/extending/newtypes_tutorial.rst | 2 +- Doc/glossary.rst | 2 +- Doc/library/collections.abc.rst | 2 +- Doc/library/concurrent.futures.rst | 3 ++- Doc/library/importlib.rst | 4 ++-- Doc/library/multiprocessing.rst | 3 ++- Doc/library/pkgutil.rst | 2 +- Doc/library/threading.rst | 3 ++- Doc/reference/datamodel.rst | 4 ++-- Doc/tutorial/classes.rst | 2 +- Doc/whatsnew/3.2.rst | 2 +- Doc/whatsnew/3.5.rst | 8 ++++---- Doc/whatsnew/3.6.rst | 2 +- Doc/whatsnew/3.7.rst | 2 +- 14 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Doc/extending/newtypes_tutorial.rst b/Doc/extending/newtypes_tutorial.rst index 0eb6ffd026f495..4da77e797d222c 100644 --- a/Doc/extending/newtypes_tutorial.rst +++ b/Doc/extending/newtypes_tutorial.rst @@ -416,7 +416,7 @@ But this would be risky. Our type doesn't restrict the type of the ``first`` member, so it could be any kind of object. It could have a destructor that causes code to be executed that tries to access the ``first`` member; or that destructor could release the -:term:`Global interpreter Lock` and let arbitrary code run in other +:term:`Global interpreter Lock ` and let arbitrary code run in other threads that accesses and modifies our object. To be paranoid and protect ourselves against this possibility, we almost diff --git a/Doc/glossary.rst b/Doc/glossary.rst index e997d366777b38..7be755e4113108 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -587,7 +587,7 @@ Glossary and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:`file objects `, and objects of any classes you define with an :meth:`__iter__` method or with a :meth:`__getitem__` method - that implements :term:`Sequence` semantics. + that implements :term:`Sequence ` semantics. Iterables can be used in a :keyword:`for` loop and in many other places where a sequence is diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst index 2a3fb142f7297e..dc7ae30b6d2fa2 100644 --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -185,7 +185,7 @@ ABC Inherits from Abstract Methods Mixin expressions. Custom implementations must provide the :meth:`__await__` method. - :term:`Coroutine` objects and instances of the + :term:`Coroutine ` objects and instances of the :class:`~collections.abc.Coroutine` ABC are all instances of this ABC. .. note:: diff --git a/Doc/library/concurrent.futures.rst b/Doc/library/concurrent.futures.rst index b21d5594c84fa0..675a9ffdd0711a 100644 --- a/Doc/library/concurrent.futures.rst +++ b/Doc/library/concurrent.futures.rst @@ -221,7 +221,8 @@ ProcessPoolExecutor The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that uses a pool of processes to execute calls asynchronously. :class:`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which -allows it to side-step the :term:`Global Interpreter Lock` but also means that +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 diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index f7286d2ade8bd1..5fb0a4a120b98d 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -1073,7 +1073,7 @@ find and load modules. .. class:: WindowsRegistryFinder - :term:`Finder` for modules declared in the Windows registry. This class + :term:`Finder ` for modules declared in the Windows registry. This class implements the :class:`importlib.abc.MetaPathFinder` ABC. Only class methods are defined by this class to alleviate the need for @@ -1088,7 +1088,7 @@ find and load modules. .. class:: PathFinder - A :term:`Finder` for :data:`sys.path` and package ``__path__`` attributes. + A :term:`Finder ` for :data:`sys.path` and package ``__path__`` attributes. This class implements the :class:`importlib.abc.MetaPathFinder` ABC. Only class methods are defined by this class to alleviate the need for diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 69d65236503864..28510acd52bd46 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -14,7 +14,8 @@ Introduction :mod:`multiprocessing` is a package that supports spawning processes using an API similar to the :mod:`threading` module. The :mod:`multiprocessing` package offers both local and remote concurrency, effectively side-stepping the -:term:`Global Interpreter Lock` by using subprocesses instead of threads. Due +:term:`Global Interpreter Lock ` by using +subprocesses instead of threads. Due to this, the :mod:`multiprocessing` module allows the programmer to fully leverage multiple processors on a given machine. It runs on both Unix and Windows. diff --git a/Doc/library/pkgutil.rst b/Doc/library/pkgutil.rst index 2066cbb9fc57ce..3b17b9a6219870 100644 --- a/Doc/library/pkgutil.rst +++ b/Doc/library/pkgutil.rst @@ -68,7 +68,7 @@ support. .. class:: ImpLoader(fullname, file, filename, etc) - :term:`Loader` that wraps Python's "classic" import algorithm. + :term:`Loader ` that wraps Python's "classic" import algorithm. .. deprecated:: 3.3 This emulation is no longer needed, as the standard import mechanism diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 458e39bf721c68..7fcf93d74610eb 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -394,7 +394,8 @@ since it is impossible to detect the termination of alien threads. .. impl-detail:: - In CPython, due to the :term:`Global Interpreter Lock`, only one thread + In CPython, due to the :term:`Global Interpreter Lock + `, only one thread can execute Python code at once (even though certain performance-oriented libraries might overcome this limitation). If you want your application to make better use of the computational diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index c5a7f046992dd1..a817408c3b1ef5 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -2601,7 +2601,7 @@ Awaitable Objects ----------------- An :term:`awaitable` object generally implements an :meth:`__await__` method. -:term:`Coroutine` objects returned from :keyword:`async def` functions +:term:`Coroutine objects ` returned from :keyword:`async def` functions are awaitable. .. note:: @@ -2626,7 +2626,7 @@ are awaitable. Coroutine Objects ----------------- -:term:`Coroutine` objects are :term:`awaitable` objects. +:term:`Coroutine objects ` are :term:`awaitable` objects. A coroutine's execution can be controlled by calling :meth:`__await__` and iterating over the result. When the coroutine has finished executing and returns, the iterator raises :exc:`StopIteration`, and the exception's diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 685552f99f440e..0d780e3ba89643 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -849,7 +849,7 @@ defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``:: Generators ========== -:term:`Generator`\s are a simple and powerful tool for creating iterators. They +:term:`Generators ` are a simple and powerful tool for creating iterators. They are written like regular functions but use the :keyword:`yield` statement whenever they want to return data. Each time :func:`next` is called on it, the generator resumes where it left off (it remembers all the data values and which diff --git a/Doc/whatsnew/3.2.rst b/Doc/whatsnew/3.2.rst index ca3eda05c515af..06bee9966c0be2 100644 --- a/Doc/whatsnew/3.2.rst +++ b/Doc/whatsnew/3.2.rst @@ -2311,7 +2311,7 @@ Multi-threading =============== * The mechanism for serializing execution of concurrently running Python threads - (generally known as the :term:`GIL` or :term:`Global Interpreter Lock`) has + (generally known as the :term:`GIL` or Global Interpreter Lock) has been rewritten. Among the objectives were more predictable switching intervals and reduced overhead due to lock contention and the number of ensuing system calls. The notion of a "check interval" to allow thread diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index b4540ac1dd9028..1defee4090f288 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -412,7 +412,7 @@ uses were to provide type hints to function parameters and return values. It became evident that it would be beneficial for Python users, if the standard library included the base definitions and tools for type annotations. -:pep:`484` introduces a :term:`provisional module ` to +:pep:`484` introduces a :term:`provisional module ` to provide these standard definitions and tools, along with some conventions for situations where annotations are not available. @@ -726,7 +726,7 @@ New Modules typing ------ -The new :mod:`typing` :term:`provisional ` module +The new :mod:`typing` :term:`provisional ` module provides standard definitions and tools for function type annotations. See :ref:`Type Hints ` for more information. @@ -772,7 +772,7 @@ Steven Bethard, paul j3 and Daniel Eriksson in :issue:`14910`.) asyncio ------- -Since the :mod:`asyncio` module is :term:`provisional `, +Since the :mod:`asyncio` module is :term:`provisional `, all changes introduced in Python 3.5 have also been backported to Python 3.4.x. Notable changes in the :mod:`asyncio` module since Python 3.4.0: @@ -1867,7 +1867,7 @@ A new :func:`~sys.set_coroutine_wrapper` function allows setting a global hook that will be called whenever a :term:`coroutine object ` is created by an :keyword:`async def` function. A corresponding :func:`~sys.get_coroutine_wrapper` can be used to obtain a currently set -wrapper. Both functions are :term:`provisional `, +wrapper. Both functions are :term:`provisional `, and are intended for debugging purposes only. (Contributed by Yury Selivanov in :issue:`24017`.) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index 04c1f7e71db321..85a6657fdfbdac 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -1597,7 +1597,7 @@ to filter block traces by their address space (domain). typing ------ -Since the :mod:`typing` module is :term:`provisional `, +Since the :mod:`typing` module is :term:`provisional `, all changes introduced in Python 3.6 have also been backported to Python 3.5.x. diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index 279bbc697b5c63..25b1e1e33e325c 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -636,7 +636,7 @@ The :mod:`asyncio` module has received many new features, usability and :ref:`performance improvements `. Notable changes include: -* The new :term:`provisional ` :func:`asyncio.run` function can +* The new :term:`provisional ` :func:`asyncio.run` function can be used to run a coroutine from synchronous code by automatically creating and destroying the event loop. (Contributed by Yury Selivanov in :issue:`32314`.) From 9e1e5288562753aa1434133c481d85a55c2507ff Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Sat, 15 Aug 2020 00:01:36 +0100 Subject: [PATCH 182/197] Fix typo in typing doc (GH-21879) Automerge-Triggered-By: @gvanrossum --- Doc/library/typing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 44b537f1669e1a..8208680669de6e 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -325,7 +325,7 @@ every type as being compatible with :data:`Any` and :data:`Any` as being compatible with every type. This means that it is possible to perform any operation or method call on a -value of type on :data:`Any` and assign it to any variable:: +value of type :data:`Any` and assign it to any variable:: from typing import Any From 9c8f970899173f33afa37309553ffca97be9007a Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Sat, 15 Aug 2020 16:06:21 +0200 Subject: [PATCH 183/197] bpo-40878: xlc cannot handle C99 extern inline. (GH-21887) This applies to the default "extc99" mode. Python does not compile with "stdc99". --- Modules/_decimal/libmpdec/mpdecimal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index b3ec13a509bb4c..f0e4d7f343a438 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -64,7 +64,7 @@ #if defined(_MSC_VER) #define ALWAYS_INLINE __forceinline -#elif defined(LEGACY_COMPILER) +#elif defined(__IBMC__) || defined(LEGACY_COMPILER) #define ALWAYS_INLINE #undef inline #define inline From 360a2c8d68c362bfbf1a47e80f1e147bb1783df9 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 16 Aug 2020 02:01:19 +0900 Subject: [PATCH 184/197] bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation (GH-18772) [bpo-31122](): ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation Reproducer: http://tiny.cc/f4ztnz (tiny url because some bot keeps renaming b.p.o.-nnn as bpo links) --- .../Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst | 1 + Modules/_ssl.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst diff --git a/Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst b/Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst new file mode 100644 index 00000000000000..2e70f7aee65c83 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-11-07-44-06.bpo-31122.zIQ80l.rst @@ -0,0 +1 @@ +ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation \ No newline at end of file diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 55a95ddf774e6d..cb8f04a900a06e 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -805,10 +805,11 @@ PySSL_SetError(PySSLSocket *sslsock, int ret, const char *filename, int lineno) errno = err.c; return PyErr_SetFromErrno(PyExc_OSError); } - Py_INCREF(s); - s->errorhandler(); - Py_DECREF(s); - return NULL; + else { + p = PY_SSL_ERROR_EOF; + type = PySSLEOFErrorObject; + errstr = "EOF occurred in violation of protocol"; + } } else { /* possible? */ p = PY_SSL_ERROR_SYSCALL; type = PySSLSyscallErrorObject; From 79b180911f89a59bda2a6da58aafa2e8efa4f6ab Mon Sep 17 00:00:00 2001 From: Stefan Krah Date: Sat, 15 Aug 2020 20:19:07 +0200 Subject: [PATCH 185/197] bpo-41540: AIX: skip test that is flaky with a default ulimit. (#21890) - AIX has extreme over-allocation that is in no relation to the physical RAM and swap. --- Lib/test/test_decimal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 113b37ddaa9cd6..dbd58e8a6519b1 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -5661,6 +5661,9 @@ def __abs__(self): self.assertEqual(Decimal.from_float(cls(101.1)), Decimal.from_float(101.1)) + # Issue 41540: + @unittest.skipIf(sys.platform.startswith("aix"), + "AIX: default ulimit: test is flaky because of extreme over-allocation") def test_maxcontext_exact_arith(self): # Make sure that exact operations do not raise MemoryError due From 9346853173f221fecaaacf100ae105aabb088fdc Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 15 Aug 2020 19:38:19 -0700 Subject: [PATCH 186/197] bpo-41513: Improve speed and accuracy of math.hypot() (GH-21803) --- Lib/test/test_math.py | 7 ++-- .../2020-08-09-18-16-05.bpo-41513.e6K6EK.rst | 2 + Modules/mathmodule.c | 41 +++++++++++++++++-- 3 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index e06b1e6a5b9b7c..4d62eb1b119930 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -795,7 +795,8 @@ def testHypot(self): # Verify scaling for extremely large values fourthmax = FLOAT_MAX / 4.0 for n in range(32): - self.assertEqual(hypot(*([fourthmax]*n)), fourthmax * math.sqrt(n)) + self.assertTrue(math.isclose(hypot(*([fourthmax]*n)), + fourthmax * math.sqrt(n))) # Verify scaling for extremely small values for exp in range(32): @@ -904,8 +905,8 @@ class T(tuple): for n in range(32): p = (fourthmax,) * n q = (0.0,) * n - self.assertEqual(dist(p, q), fourthmax * math.sqrt(n)) - self.assertEqual(dist(q, p), fourthmax * math.sqrt(n)) + self.assertTrue(math.isclose(dist(p, q), fourthmax * math.sqrt(n))) + self.assertTrue(math.isclose(dist(q, p), fourthmax * math.sqrt(n))) # Verify scaling for extremely small values for exp in range(32): diff --git a/Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst b/Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst new file mode 100644 index 00000000000000..cfb9f98c376a02 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-09-18-16-05.bpo-41513.e6K6EK.rst @@ -0,0 +1,2 @@ +Minor algorithmic improvement to math.hypot() and math.dist() giving small +gains in speed and accuracy. diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index 411c6eb1935fab..489802cc367450 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -2406,6 +2406,13 @@ math_fmod_impl(PyObject *module, double x, double y) /* Given an *n* length *vec* of values and a value *max*, compute: + sqrt(sum((x * scale) ** 2 for x in vec)) / scale + + where scale is the first power of two + greater than max. + +or compute: + max * sqrt(sum((x / max) ** 2 for x in vec)) The value of the *max* variable must be non-negative and @@ -2425,19 +2432,25 @@ The *csum* variable tracks the cumulative sum and *frac* tracks the cumulative fractional errors at each step. Since this variant assumes that |csum| >= |x| at each step, we establish the precondition by starting the accumulation from 1.0 which -represents the largest possible value of (x/max)**2. +represents the largest possible value of (x*scale)**2 or (x/max)**2. After the loop is finished, the initial 1.0 is subtracted out for a net zero effect on the final sum. Since *csum* will be greater than 1.0, the subtraction of 1.0 will not cause fractional digits to be dropped from *csum*. +To get the full benefit from compensated summation, the +largest addend should be in the range: 0.5 <= x <= 1.0. +Accordingly, scaling or division by *max* should not be skipped +even if not otherwise needed to prevent overflow or loss of precision. + */ static inline double vector_norm(Py_ssize_t n, double *vec, double max, int found_nan) { - double x, csum = 1.0, oldcsum, frac = 0.0; + double x, csum = 1.0, oldcsum, frac = 0.0, scale; + int max_e; Py_ssize_t i; if (Py_IS_INFINITY(max)) { @@ -2449,14 +2462,36 @@ vector_norm(Py_ssize_t n, double *vec, double max, int found_nan) if (max == 0.0 || n <= 1) { return max; } + frexp(max, &max_e); + if (max_e >= -1023) { + scale = ldexp(1.0, -max_e); + assert(max * scale >= 0.5); + assert(max * scale < 1.0); + for (i=0 ; i < n ; i++) { + x = vec[i]; + assert(Py_IS_FINITE(x) && fabs(x) <= max); + x *= scale; + x = x*x; + assert(x <= 1.0); + assert(csum >= x); + oldcsum = csum; + csum += x; + frac += (oldcsum - csum) + x; + } + return sqrt(csum - 1.0 + frac) / scale; + } + /* When max_e < -1023, ldexp(1.0, -max_e) overflows. + So instead of multiplying by a scale, we just divide by *max*. + */ for (i=0 ; i < n ; i++) { x = vec[i]; assert(Py_IS_FINITE(x) && fabs(x) <= max); x /= max; x = x*x; + assert(x <= 1.0); + assert(csum >= x); oldcsum = csum; csum += x; - assert(csum >= x); frac += (oldcsum - csum) + x; } return max * sqrt(csum - 1.0 + frac); From 3f36a40bfeb5dd6dea76c6109ef97d946f1a103a Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Sun, 16 Aug 2020 16:10:13 +0100 Subject: [PATCH 187/197] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) --- Lib/logging/handlers.py | 6 +++++- Lib/test/test_logging.py | 21 +++++++++++++++++++ .../2020-08-07-15-18-16.bpo-41503.IYftcu.rst | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 4a120e9f1ec48f..867ef4ebc7600a 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1324,7 +1324,11 @@ def setTarget(self, target): """ Set the target handler for this handler. """ - self.target = target + self.acquire() + try: + self.target = target + finally: + self.release() def flush(self): """ diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index eb5b926908a192..d8b3727eb11851 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -1160,6 +1160,27 @@ def test_flush_on_close(self): # assert that no new lines have been added self.assert_log_lines(lines) # no change + def test_race_between_set_target_and_flush(self): + class MockRaceConditionHandler: + def __init__(self, mem_hdlr): + self.mem_hdlr = mem_hdlr + + def removeTarget(self): + self.mem_hdlr.setTarget(None) + + def handle(self, msg): + t = threading.Thread(target=self.removeTarget) + t.daemon = True + t.start() + + target = MockRaceConditionHandler(self.mem_hdlr) + self.mem_hdlr.setTarget(target) + + for _ in range(10): + time.sleep(0.005) + self.mem_logger.info("not flushed") + self.mem_logger.warning("flushed") + class ExceptionFormatter(logging.Formatter): """A special exception formatter.""" diff --git a/Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst b/Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst new file mode 100644 index 00000000000000..c34996d881937b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-07-15-18-16.bpo-41503.IYftcu.rst @@ -0,0 +1 @@ +Fixed a race between setTarget and flush in logging.handlers.MemoryHandler. \ No newline at end of file From 17002a0768266b87656f680c3b3e7d03e27cd091 Mon Sep 17 00:00:00 2001 From: Soumendra Ganguly <67527439+8vasu@users.noreply.github.com> Date: Sun, 16 Aug 2020 10:51:00 -0500 Subject: [PATCH 188/197] Update the comment of termios.c (#21886) --- Modules/termios.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/termios.c b/Modules/termios.c index 75e5e523206f41..178ae4ee6e41dd 100644 --- a/Modules/termios.c +++ b/Modules/termios.c @@ -1,4 +1,4 @@ -/* termiosmodule.c -- POSIX terminal I/O module implementation. */ +/* termios.c -- POSIX terminal I/O module implementation. */ #include "Python.h" From 3a6cc995a759a0ca66e130349f951f4f23285ccd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 17 Aug 2020 07:20:40 +0200 Subject: [PATCH 189/197] bpo-41521: Rename blacklist parameter to not_exported (GH-21824) Rename "blacklist" parameter of test.support.check__all__() to "not_exported". --- Doc/library/test.rst | 10 ++-- Lib/test/_test_multiprocessing.py | 6 +- Lib/test/support/__init__.py | 10 ++-- Lib/test/test_calendar.py | 12 ++-- Lib/test/test_cgi.py | 7 ++- Lib/test/test_configparser.py | 3 +- Lib/test/test_ftplib.py | 9 +-- Lib/test/test_gettext.py | 4 +- Lib/test/test_logging.py | 12 ++-- Lib/test/test_mailbox.py | 4 +- Lib/test/test_optparse.py | 4 +- Lib/test/test_pickletools.py | 57 ++++++++++--------- Lib/test/test_plistlib.py | 4 +- Lib/test/test_smtpd.py | 5 +- Lib/test/test_support.py | 8 +-- Lib/test/test_tarfile.py | 29 +++++----- Lib/test/test_threading.py | 4 +- Lib/test/test_wave.py | 3 +- Lib/test/test_xml_etree.py | 2 +- .../2020-08-11-14-59-13.bpo-41521.w2UYK7.rst | 2 + 20 files changed, 98 insertions(+), 97 deletions(-) create mode 100644 Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst diff --git a/Doc/library/test.rst b/Doc/library/test.rst index cd05ef07b4a212..6495b4844449e5 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -878,7 +878,7 @@ The :mod:`test.support` module defines the following functions: missing. -.. function:: check__all__(test_case, module, name_of_module=None, extra=(), blacklist=()) +.. function:: check__all__(test_case, module, name_of_module=None, extra=(), not_exported=()) Assert that the ``__all__`` variable of *module* contains all public names. @@ -895,8 +895,8 @@ The :mod:`test.support` module defines the following functions: detected as "public", like objects without a proper ``__module__`` attribute. If provided, it will be added to the automatically detected ones. - The *blacklist* argument can be a set of names that must not be treated as part of - the public API even though their names indicate otherwise. + The *not_exported* argument can be a set of names that must not be treated + as part of the public API even though their names indicate otherwise. Example use:: @@ -912,10 +912,10 @@ The :mod:`test.support` module defines the following functions: class OtherTestCase(unittest.TestCase): def test__all__(self): extra = {'BAR_CONST', 'FOO_CONST'} - blacklist = {'baz'} # Undocumented name. + not_exported = {'baz'} # Undocumented name. # bar imports part of its API from _bar. support.check__all__(self, bar, ('bar', '_bar'), - extra=extra, blacklist=blacklist) + extra=extra, not_exported=not_exported) .. versionadded:: 3.6 diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 58663c02002e94..6a0e1016aff8d0 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5581,9 +5581,11 @@ def test_namespace(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - # Just make sure names in blacklist are excluded + # Just make sure names in not_exported are excluded support.check__all__(self, multiprocessing, extra=multiprocessing.__all__, - blacklist=['SUBDEBUG', 'SUBWARNING']) + not_exported=['SUBDEBUG', 'SUBWARNING']) + + # # Mixins # diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index e9573d13352102..4ba749454c1873 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1410,7 +1410,7 @@ def detect_api_mismatch(ref_api, other_api, *, ignore=()): def check__all__(test_case, module, name_of_module=None, extra=(), - blacklist=()): + not_exported=()): """Assert that the __all__ variable of 'module' contains all public names. The module's public names (its API) are detected automatically based on @@ -1427,7 +1427,7 @@ def check__all__(test_case, module, name_of_module=None, extra=(), '__module__' attribute. If provided, it will be added to the automatically detected ones. - The 'blacklist' argument can be a set of names that must not be treated + The 'not_exported' argument can be a set of names that must not be treated as part of the public API even though their names indicate otherwise. Usage: @@ -1443,10 +1443,10 @@ def test__all__(self): class OtherTestCase(unittest.TestCase): def test__all__(self): extra = {'BAR_CONST', 'FOO_CONST'} - blacklist = {'baz'} # Undocumented name. + not_exported = {'baz'} # Undocumented name. # bar imports part of its API from _bar. support.check__all__(self, bar, ('bar', '_bar'), - extra=extra, blacklist=blacklist) + extra=extra, not_exported=not_exported) """ @@ -1458,7 +1458,7 @@ def test__all__(self): expected = set(extra) for name in dir(module): - if name.startswith('_') or name in blacklist: + if name.startswith('_') or name in not_exported: continue obj = getattr(module, name) if (getattr(obj, '__module__', None) in name_of_module or diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index 7c7ec1c931aa48..c641e8c418318d 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -934,12 +934,12 @@ def test_html_output_year_css(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {'mdays', 'January', 'February', 'EPOCH', - 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', - 'SATURDAY', 'SUNDAY', 'different_locale', 'c', - 'prweek', 'week', 'format', 'formatstring', 'main', - 'monthlen', 'prevmonth', 'nextmonth'} - support.check__all__(self, calendar, blacklist=blacklist) + not_exported = { + 'mdays', 'January', 'February', 'EPOCH', 'MONDAY', 'TUESDAY', + 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY', + 'different_locale', 'c', 'prweek', 'week', 'format', + 'formatstring', 'main', 'monthlen', 'prevmonth', 'nextmonth'} + support.check__all__(self, calendar, not_exported=not_exported) class TestSubClassingCase(unittest.TestCase): diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index 101942de947fb4..6b29759da44d01 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -553,9 +553,10 @@ def test_parse_header(self): ("form-data", {"name": "files", "filename": 'fo"o;bar'})) def test_all(self): - blacklist = {"logfile", "logfp", "initlog", "dolog", "nolog", - "closelog", "log", "maxlen", "valid_boundary"} - support.check__all__(self, cgi, blacklist=blacklist) + not_exported = { + "logfile", "logfp", "initlog", "dolog", "nolog", "closelog", "log", + "maxlen", "valid_boundary"} + support.check__all__(self, cgi, not_exported=not_exported) BOUNDARY = "---------------------------721837373350705526688164684" diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index 230ffc1ccf81a7..80a9f179ee2bbc 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -2128,8 +2128,7 @@ def test_instance_assignment(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {"Error"} - support.check__all__(self, configparser, blacklist=blacklist) + support.check__all__(self, configparser, not_exported={"Error"}) if __name__ == '__main__': diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index 65feb3aadedd67..39658f22aa18c3 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -1107,10 +1107,11 @@ def testTimeoutDirectAccess(self): class MiscTestCase(TestCase): def test__all__(self): - blacklist = {'MSG_OOB', 'FTP_PORT', 'MAXLINE', 'CRLF', 'B_CRLF', - 'Error', 'parse150', 'parse227', 'parse229', 'parse257', - 'print_line', 'ftpcp', 'test'} - support.check__all__(self, ftplib, blacklist=blacklist) + not_exported = { + 'MSG_OOB', 'FTP_PORT', 'MAXLINE', 'CRLF', 'B_CRLF', 'Error', + 'parse150', 'parse227', 'parse229', 'parse257', 'print_line', + 'ftpcp', 'test'} + support.check__all__(self, ftplib, not_exported=not_exported) def test_main(): diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py index df9eae39eac3e3..575914d62a0bce 100644 --- a/Lib/test/test_gettext.py +++ b/Lib/test/test_gettext.py @@ -820,8 +820,8 @@ def test_cache(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {'c2py', 'ENOENT'} - support.check__all__(self, gettext, blacklist=blacklist) + support.check__all__(self, gettext, + not_exported={'c2py', 'ENOENT'}) if __name__ == '__main__': diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index d8b3727eb11851..00a4825d6da88d 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -5363,12 +5363,12 @@ def test_basic(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {'logThreads', 'logMultiprocessing', - 'logProcesses', 'currentframe', - 'PercentStyle', 'StrFormatStyle', 'StringTemplateStyle', - 'Filterer', 'PlaceHolder', 'Manager', 'RootLogger', - 'root', 'threading'} - support.check__all__(self, logging, blacklist=blacklist) + not_exported = { + 'logThreads', 'logMultiprocessing', 'logProcesses', 'currentframe', + 'PercentStyle', 'StrFormatStyle', 'StringTemplateStyle', + 'Filterer', 'PlaceHolder', 'Manager', 'RootLogger', 'root', + 'threading'} + support.check__all__(self, logging, not_exported=not_exported) # Set the locale to the platform-dependent default. I have no idea diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 346c9f1c559cd5..5924f244f39f8b 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -2296,8 +2296,8 @@ def test_nonempty_maildir_both(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {"linesep", "fcntl"} - support.check__all__(self, mailbox, blacklist=blacklist) + support.check__all__(self, mailbox, + not_exported={"linesep", "fcntl"}) def test_main(): diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index ed65b7798e3d2a..1ed6bf9f919a2c 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -1652,8 +1652,8 @@ def test_numeric_options(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {'check_builtin', 'AmbiguousOptionError', 'NO_DEFAULT'} - support.check__all__(self, optparse, blacklist=blacklist) + not_exported = {'check_builtin', 'AmbiguousOptionError', 'NO_DEFAULT'} + support.check__all__(self, optparse, not_exported=not_exported) def test_main(): diff --git a/Lib/test/test_pickletools.py b/Lib/test/test_pickletools.py index 8cc6ca58cd04b4..f5e9ae41c3c1a4 100644 --- a/Lib/test/test_pickletools.py +++ b/Lib/test/test_pickletools.py @@ -63,34 +63,35 @@ def test_optimize_binput_and_memoize(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {'bytes_types', - 'UP_TO_NEWLINE', 'TAKEN_FROM_ARGUMENT1', - 'TAKEN_FROM_ARGUMENT4', 'TAKEN_FROM_ARGUMENT4U', - 'TAKEN_FROM_ARGUMENT8U', 'ArgumentDescriptor', - 'read_uint1', 'read_uint2', 'read_int4', 'read_uint4', - 'read_uint8', 'read_stringnl', 'read_stringnl_noescape', - 'read_stringnl_noescape_pair', 'read_string1', - 'read_string4', 'read_bytes1', 'read_bytes4', - 'read_bytes8', 'read_bytearray8', 'read_unicodestringnl', - 'read_unicodestring1', 'read_unicodestring4', - 'read_unicodestring8', 'read_decimalnl_short', - 'read_decimalnl_long', 'read_floatnl', 'read_float8', - 'read_long1', 'read_long4', - 'uint1', 'uint2', 'int4', 'uint4', 'uint8', 'stringnl', - 'stringnl_noescape', 'stringnl_noescape_pair', 'string1', - 'string4', 'bytes1', 'bytes4', 'bytes8', 'bytearray8', - 'unicodestringnl', 'unicodestring1', 'unicodestring4', - 'unicodestring8', 'decimalnl_short', 'decimalnl_long', - 'floatnl', 'float8', 'long1', 'long4', - 'StackObject', - 'pyint', 'pylong', 'pyinteger_or_bool', 'pybool', 'pyfloat', - 'pybytes_or_str', 'pystring', 'pybytes', 'pybytearray', - 'pyunicode', 'pynone', 'pytuple', 'pylist', 'pydict', - 'pyset', 'pyfrozenset', 'pybuffer', 'anyobject', - 'markobject', 'stackslice', 'OpcodeInfo', 'opcodes', - 'code2op', - } - support.check__all__(self, pickletools, blacklist=blacklist) + not_exported = { + 'bytes_types', + 'UP_TO_NEWLINE', 'TAKEN_FROM_ARGUMENT1', + 'TAKEN_FROM_ARGUMENT4', 'TAKEN_FROM_ARGUMENT4U', + 'TAKEN_FROM_ARGUMENT8U', 'ArgumentDescriptor', + 'read_uint1', 'read_uint2', 'read_int4', 'read_uint4', + 'read_uint8', 'read_stringnl', 'read_stringnl_noescape', + 'read_stringnl_noescape_pair', 'read_string1', + 'read_string4', 'read_bytes1', 'read_bytes4', + 'read_bytes8', 'read_bytearray8', 'read_unicodestringnl', + 'read_unicodestring1', 'read_unicodestring4', + 'read_unicodestring8', 'read_decimalnl_short', + 'read_decimalnl_long', 'read_floatnl', 'read_float8', + 'read_long1', 'read_long4', + 'uint1', 'uint2', 'int4', 'uint4', 'uint8', 'stringnl', + 'stringnl_noescape', 'stringnl_noescape_pair', 'string1', + 'string4', 'bytes1', 'bytes4', 'bytes8', 'bytearray8', + 'unicodestringnl', 'unicodestring1', 'unicodestring4', + 'unicodestring8', 'decimalnl_short', 'decimalnl_long', + 'floatnl', 'float8', 'long1', 'long4', + 'StackObject', + 'pyint', 'pylong', 'pyinteger_or_bool', 'pybool', 'pyfloat', + 'pybytes_or_str', 'pystring', 'pybytes', 'pybytearray', + 'pyunicode', 'pynone', 'pytuple', 'pylist', 'pydict', + 'pyset', 'pyfrozenset', 'pybuffer', 'anyobject', + 'markobject', 'stackslice', 'OpcodeInfo', 'opcodes', + 'code2op', + } + support.check__all__(self, pickletools, not_exported=not_exported) def test_main(): diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py index e5038d2e7f10a2..e5c9b5b6b2cfea 100644 --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -672,8 +672,8 @@ def test_keyed_archive_data(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {"PlistFormat", "PLISTHEADER"} - support.check__all__(self, plistlib, blacklist=blacklist) + not_exported = {"PlistFormat", "PLISTHEADER"} + support.check__all__(self, plistlib, not_exported=not_exported) if __name__ == '__main__': diff --git a/Lib/test/test_smtpd.py b/Lib/test/test_smtpd.py index d5d5abfcf370a8..6303192d1b26cc 100644 --- a/Lib/test/test_smtpd.py +++ b/Lib/test/test_smtpd.py @@ -1003,12 +1003,11 @@ def test_multiple_emails_with_extended_command_length(self): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = { + not_exported = { "program", "Devnull", "DEBUGSTREAM", "NEWLINE", "COMMASPACE", "DATA_SIZE_DEFAULT", "usage", "Options", "parseargs", - } - support.check__all__(self, smtpd, blacklist=blacklist) + support.check__all__(self, smtpd, not_exported=not_exported) if __name__ == "__main__": diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index b268511844b828..71a66c27aa21df 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -391,14 +391,14 @@ def test_detect_api_mismatch__ignore(self): def test_check__all__(self): extra = {'tempdir'} - blacklist = {'template'} + not_exported = {'template'} support.check__all__(self, tempfile, extra=extra, - blacklist=blacklist) + not_exported=not_exported) extra = {'TextTestResult', 'installHandler'} - blacklist = {'load_tests', "TestProgram", "BaseTestSuite"} + not_exported = {'load_tests', "TestProgram", "BaseTestSuite"} support.check__all__(self, unittest, @@ -407,7 +407,7 @@ def test_check__all__(self): "unittest.main", "unittest.runner", "unittest.signals", "unittest.async_case"), extra=extra, - blacklist=blacklist) + not_exported=not_exported) self.assertRaises(AssertionError, support.check__all__, self, unittest) diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 4bf7248767c4b9..4ef20db0971636 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -2257,22 +2257,19 @@ def test_number_field_limits(self): tarfile.itn(0x10000000000, 6, tarfile.GNU_FORMAT) def test__all__(self): - blacklist = {'version', 'grp', 'pwd', 'symlink_exception', - 'NUL', 'BLOCKSIZE', 'RECORDSIZE', 'GNU_MAGIC', - 'POSIX_MAGIC', 'LENGTH_NAME', 'LENGTH_LINK', - 'LENGTH_PREFIX', 'REGTYPE', 'AREGTYPE', 'LNKTYPE', - 'SYMTYPE', 'CHRTYPE', 'BLKTYPE', 'DIRTYPE', 'FIFOTYPE', - 'CONTTYPE', 'GNUTYPE_LONGNAME', 'GNUTYPE_LONGLINK', - 'GNUTYPE_SPARSE', 'XHDTYPE', 'XGLTYPE', 'SOLARIS_XHDTYPE', - 'SUPPORTED_TYPES', 'REGULAR_TYPES', 'GNU_TYPES', - 'PAX_FIELDS', 'PAX_NAME_FIELDS', 'PAX_NUMBER_FIELDS', - 'stn', 'nts', 'nti', 'itn', 'calc_chksums', 'copyfileobj', - 'filemode', - 'EmptyHeaderError', 'TruncatedHeaderError', - 'EOFHeaderError', 'InvalidHeaderError', - 'SubsequentHeaderError', 'ExFileObject', - 'main'} - support.check__all__(self, tarfile, blacklist=blacklist) + not_exported = { + 'version', 'grp', 'pwd', 'symlink_exception', 'NUL', 'BLOCKSIZE', + 'RECORDSIZE', 'GNU_MAGIC', 'POSIX_MAGIC', 'LENGTH_NAME', + 'LENGTH_LINK', 'LENGTH_PREFIX', 'REGTYPE', 'AREGTYPE', 'LNKTYPE', + 'SYMTYPE', 'CHRTYPE', 'BLKTYPE', 'DIRTYPE', 'FIFOTYPE', 'CONTTYPE', + 'GNUTYPE_LONGNAME', 'GNUTYPE_LONGLINK', 'GNUTYPE_SPARSE', + 'XHDTYPE', 'XGLTYPE', 'SOLARIS_XHDTYPE', 'SUPPORTED_TYPES', + 'REGULAR_TYPES', 'GNU_TYPES', 'PAX_FIELDS', 'PAX_NAME_FIELDS', + 'PAX_NUMBER_FIELDS', 'stn', 'nts', 'nti', 'itn', 'calc_chksums', + 'copyfileobj', 'filemode', 'EmptyHeaderError', + 'TruncatedHeaderError', 'EOFHeaderError', 'InvalidHeaderError', + 'SubsequentHeaderError', 'ExFileObject', 'main'} + support.check__all__(self, tarfile, not_exported=not_exported) class CommandLineTest(unittest.TestCase): diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 47e131ae27a148..d02d3b346f9cc8 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1365,9 +1365,9 @@ class BarrierTests(lock_tests.BarrierTests): class MiscTestCase(unittest.TestCase): def test__all__(self): extra = {"ThreadError"} - blacklist = {'currentThread', 'activeCount'} + not_exported = {'currentThread', 'activeCount'} support.check__all__(self, threading, ('threading', '_thread'), - extra=extra, blacklist=blacklist) + extra=extra, not_exported=not_exported) class InterruptMainTests(unittest.TestCase): diff --git a/Lib/test/test_wave.py b/Lib/test/test_wave.py index eb231cb19c6d0a..f85e40b31d0100 100644 --- a/Lib/test/test_wave.py +++ b/Lib/test/test_wave.py @@ -107,8 +107,7 @@ class WavePCM32Test(WaveTest, unittest.TestCase): class MiscTestCase(unittest.TestCase): def test__all__(self): - blacklist = {'WAVE_FORMAT_PCM'} - support.check__all__(self, wave, blacklist=blacklist) + support.check__all__(self, wave, not_exported={'WAVE_FORMAT_PCM'}) class WaveLowLevelTest(unittest.TestCase): diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index c7d446185cfe4e..d22c35d92c4e33 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -128,7 +128,7 @@ def test_sanity(self): def test_all(self): names = ("xml.etree.ElementTree", "_elementtree") - support.check__all__(self, ET, names, blacklist=("HTML_EMPTY",)) + support.check__all__(self, ET, names, not_exported=("HTML_EMPTY",)) def serialize(elem, to_string=True, encoding='unicode', **options): diff --git a/Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst b/Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst new file mode 100644 index 00000000000000..658372b1a7f223 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-08-11-14-59-13.bpo-41521.w2UYK7.rst @@ -0,0 +1,2 @@ +:mod:`test.support`: Rename ``blacklist`` parameter of +:func:`~test.support.check__all__` to ``not_exported``. From 387df56b8883f9fef3207488a6a44baa347f7554 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 17 Aug 2020 08:41:42 +0200 Subject: [PATCH 190/197] bpo-40204: Fix duplicated productionlist names in the doc (GH-21900) Sphinx 3 disallows having more than one productionlist markup with the same name. Simply remove names in this case, since names are not shown anyway. For example, fix the Sphinx 3 warning: Doc/reference/introduction.rst:96: duplicate token description of *:name, other instance in reference/expressions --- Doc/library/string.rst | 2 +- Doc/reference/introduction.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index fa906f799c1082..62e86d6dd97066 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -308,7 +308,7 @@ non-empty format specification typically modifies the result. The general form of a *standard format specifier* is: -.. productionlist:: sf +.. productionlist:: format_spec: [[`fill`]`align`][`sign`][#][0][`width`][`grouping_option`][.`precision`][`type`] fill: align: "<" | ">" | "=" | "^" diff --git a/Doc/reference/introduction.rst b/Doc/reference/introduction.rst index bb7e3906dba607..62480bd7dd9a61 100644 --- a/Doc/reference/introduction.rst +++ b/Doc/reference/introduction.rst @@ -93,7 +93,7 @@ Notation The descriptions of lexical analysis and syntax use a modified BNF grammar notation. This uses the following style of definition: -.. productionlist:: * +.. productionlist:: name: `lc_letter` (`lc_letter` | "_")* lc_letter: "a"..."z" From 973136b35de635ebe7f4847c35428abd5598035e Mon Sep 17 00:00:00 2001 From: Allen <64019758+aboddie@users.noreply.github.com> Date: Mon, 17 Aug 2020 09:38:55 -0400 Subject: [PATCH 191/197] Fix typo in message from assert statement (GH-21283) The error message was missing space between the action "acquire" and "_wait_semaphore" which is an attribute for instances of Condition. --- Lib/multiprocessing/synchronize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/multiprocessing/synchronize.py b/Lib/multiprocessing/synchronize.py index 4fcbefc8bbefd3..d0be48f1fd7a8f 100644 --- a/Lib/multiprocessing/synchronize.py +++ b/Lib/multiprocessing/synchronize.py @@ -270,7 +270,7 @@ def wait(self, timeout=None): def notify(self, n=1): assert self._lock._semlock._is_mine(), 'lock is not owned' assert not self._wait_semaphore.acquire( - False), ('notify: Should not have been able to acquire' + False), ('notify: Should not have been able to acquire ' + '_wait_semaphore') # to take account of timeouts since last notify*() we subtract From f2a131906594e6388155ab9dcb1f9114c3fa38f9 Mon Sep 17 00:00:00 2001 From: James Weaver Date: Mon, 17 Aug 2020 15:19:46 +0100 Subject: [PATCH 192/197] bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852) asyncio.AbstractEventLoop.run_in_executor should be a method that returns an asyncio Future, not an async method. This matches the concrete implementations, and the documentation better. --- Lib/asyncio/events.py | 2 +- .../next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 70017cb86a0596..0dce87b8ecc586 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -283,7 +283,7 @@ def create_task(self, coro, *, name=None): def call_soon_threadsafe(self, callback, *args): raise NotImplementedError - async def run_in_executor(self, executor, func, *args): + def run_in_executor(self, executor, func, *args): raise NotImplementedError def set_default_executor(self, executor): diff --git a/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst new file mode 100644 index 00000000000000..d4c7e0e2419df4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-08-13-08-07-25.bpo-40782.aGZqmB.rst @@ -0,0 +1 @@ +Change the method asyncio.AbstractEventLoop.run_in_executor to not be a coroutine. \ No newline at end of file From 2ee8174c7fed3b0436cd1ecd86c503b86341ecab Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 18 Aug 2020 04:36:19 +0800 Subject: [PATCH 193/197] bpo-1635741: Explict GC collect after PyInterpreterState_Clear() (GH-21902) Fix a reference cycle by triggering an explicit GC collection after calling PyInterpreterState_Clear(). --- Python/pylifecycle.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 2d219a4a3a8b0d..ab5a6767864dc5 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1286,10 +1286,8 @@ finalize_interp_clear(PyThreadState *tstate) /* Clear interpreter state and all thread states */ PyInterpreterState_Clear(tstate->interp); - /* Trigger a GC collection on subinterpreters*/ - if (!is_main_interp) { - _PyGC_CollectNoFail(); - } + /* Last explicit GC collection */ + _PyGC_CollectNoFail(); /* Clear all loghooks */ /* Both _PySys_Audit function and users still need PyObject, such as tuple. From 65f9968f07c5b05065da9d397ac6011536b62bb2 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Mon, 17 Aug 2020 18:40:07 -0400 Subject: [PATCH 194/197] bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907) * Fix refleak in C module __init_subclass__ This was leaking a reference to the weak cache dictionary for every ZoneInfo subclass created. * Fix refleak in ZoneInfo subclass's clear_cache The previous version of the code accidentally cleared the global ZONEINFO_STRONG_CACHE variable (and inducing `ZoneInfo` to create a new strong cache) on calls to a subclass's `clear_cache()`. This would not affect guaranteed behavior, but it's still not the right thing to do (and it caused reference leaks). --- Modules/_zoneinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index 12b3969959bacf..2cee65fac6dd04 100644 --- a/Modules/_zoneinfo.c +++ b/Modules/_zoneinfo.c @@ -412,7 +412,6 @@ zoneinfo_clear_cache(PyObject *cls, PyObject *args, PyObject *kwargs) } clear_strong_cache(type); - ZONEINFO_STRONG_CACHE = NULL; } else { PyObject *item = NULL; @@ -2471,6 +2470,7 @@ clear_strong_cache(const PyTypeObject *const type) } strong_cache_free(ZONEINFO_STRONG_CACHE); + ZONEINFO_STRONG_CACHE = NULL; } static PyObject * @@ -2525,6 +2525,7 @@ zoneinfo_init_subclass(PyTypeObject *cls, PyObject *args, PyObject **kwargs) } PyObject_SetAttrString((PyObject *)cls, "_weak_cache", weak_cache); + Py_DECREF(weak_cache); Py_RETURN_NONE; } @@ -2616,8 +2617,7 @@ module_free() Py_CLEAR(ZONEINFO_WEAK_CACHE); } - strong_cache_free(ZONEINFO_STRONG_CACHE); - ZONEINFO_STRONG_CACHE = NULL; + clear_strong_cache(&PyZoneInfo_ZoneInfoType); } static int From 9af746f6ce152a7fc1f1cff39f42763c4b857e1e Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Fri, 10 Jul 2020 02:13:52 +0800 Subject: [PATCH 195/197] use typeslots not in limit apis --- Include/typeslots.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Include/typeslots.h b/Include/typeslots.h index e50c66c7c5dcc3..ffb0f64b62c240 100644 --- a/Include/typeslots.h +++ b/Include/typeslots.h @@ -88,7 +88,6 @@ /* New in 3.5 */ #define Py_tp_finalize 80 #endif -#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x031000a1 /* New in 3.10 */ #define Py_tp_as_async 81 #define Py_tp_as_buffer 82 @@ -108,4 +107,3 @@ #define Py_tp_version_tag 96 #define Py_tp_weaklist 97 #define Py_tp_weaklistoffset 98 -#endif From 526c3cf95f057e0dc6ab7c72f51e69ca5f7dfd94 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Fri, 21 Aug 2020 00:55:04 +0800 Subject: [PATCH 196/197] add test cases to against PyType_GetSlot() --- Modules/_testcapimodule.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 593034ef65e2ca..07338b101e18ca 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -1018,6 +1018,35 @@ test_buildvalue_N(PyObject *self, PyObject *Py_UNUSED(ignored)) } +static PyObject * +test_get_statictype_slots(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + char *tp_name = PyType_GetSlot(&PyLong_Type, Py_tp_name); + assert(strcmp(tp_name, "int") == 0); + + newfunc tp_new = PyType_GetSlot(&PyLong_Type, Py_tp_new); + PyObject *args = PyTuple_New(0); + PyObject *object = tp_new(&PyLong_Type, args, NULL); + assert(object); + + reprfunc tp_repr = PyType_GetSlot(&PyLong_Type, Py_tp_repr); + PyObject *decimal_str = tp_repr(object); + assert(decimal_str); + + PyNumberMethods *tp_as_number = PyType_GetSlot(&PyLong_Type, + Py_tp_as_number); + PyObject *object2 = tp_new(&PyLong_Type, args, NULL); + PyObject *res = tp_as_number->nb_add(object, object2); + assert(res); + + Py_DECREF(res); + Py_DECREF(decimal_str); + Py_DECREF(args); + Py_DECREF(object); + Py_RETURN_NONE; +} + + static PyObject * get_args(PyObject *self, PyObject *args) { @@ -5606,6 +5635,7 @@ static PyMethodDef TestMethods[] = { {"test_buildvalue_N", test_buildvalue_N, METH_NOARGS}, {"test_buildvalue_issue38913", test_buildvalue_issue38913, METH_NOARGS}, {"get_args", get_args, METH_VARARGS}, + {"test_get_statictype_slots", test_get_statictype_slots, METH_NOARGS}, {"get_kwargs", (PyCFunction)(void(*)(void))get_kwargs, METH_VARARGS|METH_KEYWORDS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, {"getargs_keywords", (PyCFunction)(void(*)(void))getargs_keywords, From e2ae111dc8f33587796e25fe0d5820e3bb7c5713 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Fri, 21 Aug 2020 01:04:15 +0800 Subject: [PATCH 197/197] update typeslots.h --- Include/typeslots.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Include/typeslots.h b/Include/typeslots.h index ffb0f64b62c240..8b571d37864819 100644 --- a/Include/typeslots.h +++ b/Include/typeslots.h @@ -89,6 +89,26 @@ #define Py_tp_finalize 80 #endif /* New in 3.10 */ +#if defined(Py_LIMITED_API) +#undef Py_tp_as_async +#undef Py_tp_as_buffer +#undef Py_tp_as_mapping +#undef Py_tp_as_number +#undef Py_tp_as_sequence +#undef Py_tp_basicsize +#undef Py_tp_cache +#undef Py_tp_dict +#undef Py_tp_dictoffset +#undef Py_tp_flags +#undef Py_tp_itemsize +#undef Py_tp_mro +#undef Py_tp_name +#undef Py_tp_subclasses +#undef Py_tp_vectorcall_offset +#undef Py_tp_version_tag +#undef Py_tp_weaklist +#undef Py_tp_weaklistoffset +#else #define Py_tp_as_async 81 #define Py_tp_as_buffer 82 #define Py_tp_as_mapping 83 @@ -107,3 +127,4 @@ #define Py_tp_version_tag 96 #define Py_tp_weaklist 97 #define Py_tp_weaklistoffset 98 +#endif