From webhook-mailer at python.org Wed Jul 1 05:33:00 2020 From: webhook-mailer at python.org (tomerv) Date: Wed, 01 Jul 2020 09:33:00 -0000 Subject: [Python-checkins] Doc: Minor fix to init config C API documentation (GH-21198) Message-ID: https://github.com/python/cpython/commit/741008a57bdc95090b8be6ded5a9fd3f17f7bf21 commit: 741008a57bdc95090b8be6ded5a9fd3f17f7bf21 branch: master author: tomerv committer: GitHub date: 2020-07-01T11:32:54+02:00 summary: Doc: Minor fix to init config C API documentation (GH-21198) Co-authored-by: Tomer Vromen files: M Doc/c-api/init_config.rst diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index 84064d93ea3b1..37f5b9f880bf1 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -197,12 +197,12 @@ PyPreConfig Function to initialize a preconfiguration: - .. c:function:: void PyPreConfig_InitIsolatedConfig(PyPreConfig *preconfig) + .. c:function:: void PyPreConfig_InitPythonConfig(PyPreConfig *preconfig) Initialize the preconfiguration with :ref:`Python Configuration `. - .. c:function:: void PyPreConfig_InitPythonConfig(PyPreConfig *preconfig) + .. c:function:: void PyPreConfig_InitIsolatedConfig(PyPreConfig *preconfig) Initialize the preconfiguration with :ref:`Isolated Configuration `. From webhook-mailer at python.org Wed Jul 1 05:41:03 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 01 Jul 2020 09:41:03 -0000 Subject: [Python-checkins] Doc: Minor fix to init config C API documentation (GH-21198) Message-ID: https://github.com/python/cpython/commit/42f05e62927d00b7255e7cced808148388652fcd commit: 42f05e62927d00b7255e7cced808148388652fcd branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-01T02:40:55-07:00 summary: Doc: Minor fix to init config C API documentation (GH-21198) Co-authored-by: Tomer Vromen (cherry picked from commit 741008a57bdc95090b8be6ded5a9fd3f17f7bf21) Co-authored-by: tomerv files: M Doc/c-api/init_config.rst diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index 79a8815ed4199..ff4ccb8dbbb5f 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -196,12 +196,12 @@ PyPreConfig Function to initialize a preconfiguration: - .. c:function:: void PyPreConfig_InitIsolatedConfig(PyPreConfig *preconfig) + .. c:function:: void PyPreConfig_InitPythonConfig(PyPreConfig *preconfig) Initialize the preconfiguration with :ref:`Python Configuration `. - .. c:function:: void PyPreConfig_InitPythonConfig(PyPreConfig *preconfig) + .. c:function:: void PyPreConfig_InitIsolatedConfig(PyPreConfig *preconfig) Initialize the preconfiguration with :ref:`Isolated Configuration `. From webhook-mailer at python.org Wed Jul 1 14:22:54 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 01 Jul 2020 18:22:54 -0000 Subject: [Python-checkins] bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215) Message-ID: https://github.com/python/cpython/commit/c3fa7534c7173d338880a1727f17795670518610 commit: c3fa7534c7173d338880a1727f17795670518610 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-01T11:22:45-07:00 summary: bpo-41158: IDLE: rewrite the code for handling file encoding (GH-21215) (cherry picked from commit 694d31e714074176f0c324f95948b75dc768c091) Co-authored-by: Serhiy Storchaka files: M Lib/idlelib/iomenu.py diff --git a/Lib/idlelib/iomenu.py b/Lib/idlelib/iomenu.py index 7f3f656ee2874..7641d866858a1 100644 --- a/Lib/idlelib/iomenu.py +++ b/Lib/idlelib/iomenu.py @@ -1,10 +1,8 @@ -import codecs -from codecs import BOM_UTF8 import os -import re import shlex import sys import tempfile +import tokenize import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox @@ -20,49 +18,6 @@ errors = 'surrogateescape' -coding_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII) -blank_re = re.compile(r'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII) - -def coding_spec(data): - """Return the encoding declaration according to PEP 263. - - When checking encoded data, only the first two lines should be passed - in to avoid a UnicodeDecodeError if the rest of the data is not unicode. - The first two lines would contain the encoding specification. - - Raise a LookupError if the encoding is declared but unknown. - """ - if isinstance(data, bytes): - # This encoding might be wrong. However, the coding - # spec must be ASCII-only, so any non-ASCII characters - # around here will be ignored. Decoding to Latin-1 should - # never fail (except for memory outage) - lines = data.decode('iso-8859-1') - else: - lines = data - # consider only the first two lines - if '\n' in lines: - lst = lines.split('\n', 2)[:2] - elif '\r' in lines: - lst = lines.split('\r', 2)[:2] - else: - lst = [lines] - for line in lst: - match = coding_re.match(line) - if match is not None: - break - if not blank_re.match(line): - return None - else: - return None - name = match.group(1) - try: - codecs.lookup(name) - except LookupError: - # The standard encoding error does not indicate the encoding - raise LookupError("Unknown encoding: "+name) - return name - class IOBinding: # One instance per editor Window so methods know which to save, close. @@ -78,7 +33,7 @@ def __init__(self, editwin): self.save_as) self.__id_savecopy = self.text.bind("<>", self.save_a_copy) - self.fileencoding = None + self.fileencoding = 'utf-8' self.__id_print = self.text.bind("<>", self.print_window) def close(self): @@ -165,34 +120,44 @@ def open(self, event=None, editFile=None): self.text.focus_set() return "break" - eol = r"(\r\n)|\n|\r" # \r\n (Windows), \n (UNIX), or \r (Mac) - eol_re = re.compile(eol) eol_convention = os.linesep # default def loadfile(self, filename): try: - # open the file in binary mode so that we can handle - # end-of-line convention ourselves. - with open(filename, 'rb') as f: - two_lines = f.readline() + f.readline() - f.seek(0) - bytes = f.read() - except OSError as msg: - tkMessageBox.showerror("I/O Error", str(msg), parent=self.text) + try: + with tokenize.open(filename) as f: + chars = f.read() + fileencoding = f.encoding + eol_convention = f.newlines + converted = False + except (UnicodeDecodeError, SyntaxError): + # Wait for the editor window to appear + self.editwin.text.update() + enc = askstring( + "Specify file encoding", + "The file's encoding is invalid for Python 3.x.\n" + "IDLE will convert it to UTF-8.\n" + "What is the current encoding of the file?", + initialvalue='utf-8', + parent=self.editwin.text) + with open(filename, encoding=enc) as f: + chars = f.read() + fileencoding = f.encoding + eol_convention = f.newlines + converted = True + except OSError as err: + tkMessageBox.showerror("I/O Error", str(err), parent=self.text) return False - chars, converted = self._decode(two_lines, bytes) - if chars is None: + except UnicodeDecodeError: tkMessageBox.showerror("Decoding Error", "File %s\nFailed to Decode" % filename, parent=self.text) return False - # We now convert all end-of-lines to '\n's - firsteol = self.eol_re.search(chars) - if firsteol: - self.eol_convention = firsteol.group(0) - chars = self.eol_re.sub(r"\n", chars) + self.text.delete("1.0", "end") self.set_filename(None) + self.fileencoding = fileencoding + self.eol_convention = eol_convention self.text.insert("1.0", chars) self.reset_undo() self.set_filename(filename) @@ -205,74 +170,6 @@ def loadfile(self, filename): self.updaterecentfileslist(filename) return True - def _decode(self, two_lines, bytes): - "Create a Unicode string." - chars = None - # Check presence of a UTF-8 signature first - if bytes.startswith(BOM_UTF8): - try: - chars = bytes[3:].decode("utf-8") - except UnicodeDecodeError: - # has UTF-8 signature, but fails to decode... - return None, False - else: - # Indicates that this file originally had a BOM - self.fileencoding = 'BOM' - return chars, False - # Next look for coding specification - try: - enc = coding_spec(two_lines) - except LookupError as name: - tkMessageBox.showerror( - title="Error loading the file", - message="The encoding '%s' is not known to this Python "\ - "installation. The file may not display correctly" % name, - parent = self.text) - enc = None - except UnicodeDecodeError: - return None, False - if enc: - try: - chars = str(bytes, enc) - self.fileencoding = enc - return chars, False - except UnicodeDecodeError: - pass - # Try ascii: - try: - chars = str(bytes, 'ascii') - self.fileencoding = None - return chars, False - except UnicodeDecodeError: - pass - # Try utf-8: - try: - chars = str(bytes, 'utf-8') - self.fileencoding = 'utf-8' - return chars, False - except UnicodeDecodeError: - pass - # Finally, try the locale's encoding. This is deprecated; - # the user should declare a non-ASCII encoding - try: - # Wait for the editor window to appear - self.editwin.text.update() - enc = askstring( - "Specify file encoding", - "The file's encoding is invalid for Python 3.x.\n" - "IDLE will convert it to UTF-8.\n" - "What is the current encoding of the file?", - initialvalue = encoding, - parent = self.editwin.text) - - if enc: - chars = str(bytes, enc) - self.fileencoding = None - return chars, True - except (UnicodeDecodeError, LookupError): - pass - return None, False # None on failure - def maybesave(self): if self.get_saved(): return "yes" @@ -360,38 +257,30 @@ def encode(self, chars): # text to us. Don't try to guess further. return chars # Preserve a BOM that might have been present on opening - if self.fileencoding == 'BOM': - return BOM_UTF8 + chars.encode("utf-8") + if self.fileencoding == 'utf-8-sig': + return chars.encode('utf-8-sig') # See whether there is anything non-ASCII in it. # If not, no need to figure out the encoding. try: return chars.encode('ascii') - except UnicodeError: + except UnicodeEncodeError: pass # Check if there is an encoding declared try: - # a string, let coding_spec slice it to the first two lines - enc = coding_spec(chars) - failed = None - except LookupError as msg: - failed = msg - enc = None - else: - if not enc: - # PEP 3120: default source encoding is UTF-8 - enc = 'utf-8' - if enc: - try: - return chars.encode(enc) - except UnicodeError: - failed = "Invalid encoding '%s'" % enc + encoded = chars.encode('ascii', 'replace') + enc, _ = tokenize.detect_encoding(io.BytesIO(encoded).readline) + return chars.encode(enc) + except SyntaxError as err: + failed = str(err) + except UnicodeEncodeError: + failed = "Invalid encoding '%s'" % enc tkMessageBox.showerror( "I/O Error", "%s.\nSaving as UTF-8" % failed, - parent = self.text) + parent=self.text) # Fallback: save as UTF-8, with BOM - ignoring the incorrect # declared encoding - return BOM_UTF8 + chars.encode("utf-8") + return chars.encode('utf-8-sig') def print_window(self, event): confirm = tkMessageBox.askokcancel( From webhook-mailer at python.org Wed Jul 1 14:53:16 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 01 Jul 2020 18:53:16 -0000 Subject: [Python-checkins] bpo-41187: Convert the _msi module to Argument Clinic (GH-21264) Message-ID: https://github.com/python/cpython/commit/5d5c84ef78b19211671c2bfa68fe073485135eed commit: 5d5c84ef78b19211671c2bfa68fe073485135eed branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-01T21:53:07+03:00 summary: bpo-41187: Convert the _msi module to Argument Clinic (GH-21264) files: A PC/clinic/_msi.c.h M PC/_msi.c diff --git a/PC/_msi.c b/PC/_msi.c index 60a0c3aebb1e7..9f1015845acff 100644 --- a/PC/_msi.c +++ b/PC/_msi.c @@ -12,10 +12,26 @@ #include #include +/*[clinic input] +module _msi +class _msi.Record "msiobj *" "&record_Type" +class _msi.SummaryInformation "msiobj *" "&summary_Type" +class _msi.View "msiobj *" "&msiview_Type" +class _msi.Database "msiobj *" "&msidb_Type" +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=89a3605762cf4bdc]*/ + static PyObject *MSIError; -static PyObject* -uuidcreate(PyObject* obj, PyObject*args) +/*[clinic input] +_msi.UuidCreate + +Return the string representation of a new unique identifier. +[clinic start generated code]*/ + +static PyObject * +_msi_UuidCreate_impl(PyObject *module) +/*[clinic end generated code: output=534ecf36f10af98e input=168024ab4b3e832b]*/ { UUID result; wchar_t *cresult; @@ -225,19 +241,28 @@ static FNFCIGETOPENINFO(cb_getopeninfo) return result; } -static PyObject* fcicreate(PyObject* obj, PyObject* args) +/*[clinic input] +_msi.FCICreate + cabname: str + the name of the CAB file + files: object + a list of tuples, each containing the name of the file on disk, + and the name of the file inside the CAB file + / + +Create a new CAB file. +[clinic start generated code]*/ + +static PyObject * +_msi_FCICreate_impl(PyObject *module, const char *cabname, PyObject *files) +/*[clinic end generated code: output=55dc05728361b799 input=1d2d75fdc8b44b71]*/ { - char *cabname, *p; - PyObject *files; + const char *p; CCAB ccab; HFCI hfci; ERF erf; Py_ssize_t i; - - if (!PyArg_ParseTuple(args, "sO:FCICreate", &cabname, &files)) - return NULL; - if (!PyList_Check(files)) { PyErr_SetString(PyExc_TypeError, "FCICreate expects a list"); return NULL; @@ -387,34 +412,56 @@ msierror(int status) return NULL; } -static PyObject* -msidb_close(msiobj* msidb, PyObject *args) +#include "clinic/_msi.c.h" + +/*[clinic input] +_msi.Database.Close + +Close the database object. +[clinic start generated code]*/ + +static PyObject * +_msi_Database_Close_impl(msiobj *self) +/*[clinic end generated code: output=ddf2d7712ea804f1 input=104330ce4a486187]*/ { int status; - if ((status = MsiCloseHandle(msidb->h)) != ERROR_SUCCESS) { + if ((status = MsiCloseHandle(self->h)) != ERROR_SUCCESS) { return msierror(status); } - msidb->h = 0; + self->h = 0; Py_RETURN_NONE; } /*************************** Record objects **********************/ -static PyObject* -record_getfieldcount(msiobj* record, PyObject* args) +/*[clinic input] +_msi.Record.GetFieldCount + +Return the number of fields of the record. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_GetFieldCount_impl(msiobj *self) +/*[clinic end generated code: output=112795079c904398 input=5fb9d4071b28897b]*/ { - return PyLong_FromLong(MsiRecordGetFieldCount(record->h)); + return PyLong_FromLong(MsiRecordGetFieldCount(self->h)); } -static PyObject* -record_getinteger(msiobj* record, PyObject* args) +/*[clinic input] +_msi.Record.GetInteger + field: unsigned_int(bitwise=True) + / + +Return the value of field as an integer where possible. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_GetInteger_impl(msiobj *self, unsigned int field) +/*[clinic end generated code: output=7174ebb6e8ed1c79 input=d19209947e2bfe61]*/ { - unsigned int field; int status; - if (!PyArg_ParseTuple(args, "I:GetInteger", &field)) - return NULL; - status = MsiRecordGetInteger(record->h, field); + status = MsiRecordGetInteger(self->h, field); if (status == MSI_NULL_INTEGER){ PyErr_SetString(MSIError, "could not convert record field to integer"); return NULL; @@ -422,24 +469,30 @@ record_getinteger(msiobj* record, PyObject* args) return PyLong_FromLong((long) status); } -static PyObject* -record_getstring(msiobj* record, PyObject* args) +/*[clinic input] +_msi.Record.GetString + field: unsigned_int(bitwise=True) + / + +Return the value of field as a string where possible. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_GetString_impl(msiobj *self, unsigned int field) +/*[clinic end generated code: output=f670d1b484cfa47c input=ffa11f21450b77d8]*/ { - unsigned int field; unsigned int status; WCHAR buf[2000]; WCHAR *res = buf; DWORD size = sizeof(buf); PyObject* string; - if (!PyArg_ParseTuple(args, "I:GetString", &field)) - return NULL; - status = MsiRecordGetStringW(record->h, field, res, &size); + status = MsiRecordGetStringW(self->h, field, res, &size); if (status == ERROR_MORE_DATA) { res = (WCHAR*) malloc((size + 1)*sizeof(WCHAR)); if (res == NULL) return PyErr_NoMemory(); - status = MsiRecordGetStringW(record->h, field, res, &size); + status = MsiRecordGetStringW(self->h, field, res, &size); } if (status != ERROR_SUCCESS) return msierror((int) status); @@ -449,59 +502,81 @@ record_getstring(msiobj* record, PyObject* args) return string; } -static PyObject* -record_cleardata(msiobj* record, PyObject *args) +/*[clinic input] +_msi.Record.ClearData + +Set all fields of the record to 0. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_ClearData_impl(msiobj *self) +/*[clinic end generated code: output=1891467214b977f4 input=2a911c95aaded102]*/ { - int status = MsiRecordClearData(record->h); + int status = MsiRecordClearData(self->h); if (status != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } -static PyObject* -record_setstring(msiobj* record, PyObject *args) +/*[clinic input] +_msi.Record.SetString + field: int + value: Py_UNICODE + / + +Set field to a string value. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_SetString_impl(msiobj *self, int field, const Py_UNICODE *value) +/*[clinic end generated code: output=2e37505b0f11f985 input=fb8ec70a2a6148e0]*/ { int status; - int field; - wchar_t *data; - - if (!PyArg_ParseTuple(args, "iu:SetString", &field, &data)) - return NULL; - if ((status = MsiRecordSetStringW(record->h, field, data)) != ERROR_SUCCESS) + if ((status = MsiRecordSetStringW(self->h, field, value)) != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } -static PyObject* -record_setstream(msiobj* record, PyObject *args) +/*[clinic input] +_msi.Record.SetStream + field: int + value: Py_UNICODE + / + +Set field to the contents of the file named value. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_SetStream_impl(msiobj *self, int field, const Py_UNICODE *value) +/*[clinic end generated code: output=442facac16913b48 input=a07aa19b865e8292]*/ { int status; - int field; - wchar_t *data; - if (!PyArg_ParseTuple(args, "iu:SetStream", &field, &data)) - return NULL; - - if ((status = MsiRecordSetStreamW(record->h, field, data)) != ERROR_SUCCESS) + if ((status = MsiRecordSetStreamW(self->h, field, value)) != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } -static PyObject* -record_setinteger(msiobj* record, PyObject *args) +/*[clinic input] +_msi.Record.SetInteger + field: int + value: int + / + +Set field to an integer value. +[clinic start generated code]*/ + +static PyObject * +_msi_Record_SetInteger_impl(msiobj *self, int field, int value) +/*[clinic end generated code: output=669e8647775d0ce7 input=c571aa775e7e451b]*/ { int status; - int field; - int data; - - if (!PyArg_ParseTuple(args, "ii:SetInteger", &field, &data)) - return NULL; - if ((status = MsiRecordSetInteger(record->h, field, data)) != ERROR_SUCCESS) + if ((status = MsiRecordSetInteger(self->h, field, value)) != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; @@ -510,20 +585,13 @@ record_setinteger(msiobj* record, PyObject *args) static PyMethodDef record_methods[] = { - { "GetFieldCount", (PyCFunction)record_getfieldcount, METH_NOARGS, - PyDoc_STR("GetFieldCount() -> int\nWraps MsiRecordGetFieldCount")}, - { "GetInteger", (PyCFunction)record_getinteger, METH_VARARGS, - PyDoc_STR("GetInteger(field) -> int\nWraps MsiRecordGetInteger")}, - { "GetString", (PyCFunction)record_getstring, METH_VARARGS, - PyDoc_STR("GetString(field) -> string\nWraps MsiRecordGetString")}, - { "SetString", (PyCFunction)record_setstring, METH_VARARGS, - PyDoc_STR("SetString(field,str) -> None\nWraps MsiRecordSetString")}, - { "SetStream", (PyCFunction)record_setstream, METH_VARARGS, - PyDoc_STR("SetStream(field,filename) -> None\nWraps MsiRecordSetInteger")}, - { "SetInteger", (PyCFunction)record_setinteger, METH_VARARGS, - PyDoc_STR("SetInteger(field,int) -> None\nWraps MsiRecordSetInteger")}, - { "ClearData", (PyCFunction)record_cleardata, METH_NOARGS, - PyDoc_STR("ClearData() -> int\nWraps MsiRecordGClearData")}, + _MSI_RECORD_GETFIELDCOUNT_METHODDEF + _MSI_RECORD_GETINTEGER_METHODDEF + _MSI_RECORD_GETSTRING_METHODDEF + _MSI_RECORD_SETSTRING_METHODDEF + _MSI_RECORD_SETSTREAM_METHODDEF + _MSI_RECORD_SETINTEGER_METHODDEF + _MSI_RECORD_CLEARDATA_METHODDEF { NULL, NULL } }; @@ -587,11 +655,20 @@ record_new(MSIHANDLE h) /*************************** SummaryInformation objects **************/ -static PyObject* -summary_getproperty(msiobj* si, PyObject *args) +/*[clinic input] +_msi.SummaryInformation.GetProperty + field: int + the name of the property, one of the PID_* constants + / + +Return a property of the summary. +[clinic start generated code]*/ + +static PyObject * +_msi_SummaryInformation_GetProperty_impl(msiobj *self, int field) +/*[clinic end generated code: output=f8946a33ee14f6ef input=f8dfe2c890d6cb8b]*/ { int status; - int field; PyObject *result; UINT type; INT ival; @@ -600,10 +677,7 @@ summary_getproperty(msiobj* si, PyObject *args) char *sval = sbuf; DWORD ssize = sizeof(sbuf); - if (!PyArg_ParseTuple(args, "i:GetProperty", &field)) - return NULL; - - status = MsiSummaryInfoGetProperty(si->h, field, &type, &ival, + status = MsiSummaryInfoGetProperty(self->h, field, &type, &ival, &fval, sval, &ssize); if (status == ERROR_MORE_DATA) { ssize++; @@ -611,7 +685,7 @@ summary_getproperty(msiobj* si, PyObject *args) if (sval == NULL) { return PyErr_NoMemory(); } - status = MsiSummaryInfoGetProperty(si->h, field, &type, &ival, + status = MsiSummaryInfoGetProperty(self->h, field, &type, &ival, &fval, sval, &ssize); } if (status != ERROR_SUCCESS) { @@ -644,42 +718,67 @@ summary_getproperty(msiobj* si, PyObject *args) return result; } -static PyObject* -summary_getpropertycount(msiobj* si, PyObject *args) +/*[clinic input] +_msi.SummaryInformation.GetPropertyCount + +Return the number of summary properties. +[clinic start generated code]*/ + +static PyObject * +_msi_SummaryInformation_GetPropertyCount_impl(msiobj *self) +/*[clinic end generated code: output=68e94b2aeee92b3d input=2e71e985586d82dc]*/ { int status; UINT result; - status = MsiSummaryInfoGetPropertyCount(si->h, &result); + status = MsiSummaryInfoGetPropertyCount(self->h, &result); if (status != ERROR_SUCCESS) return msierror(status); return PyLong_FromLong(result); } -static PyObject* -summary_setproperty(msiobj* si, PyObject *args) +/*[clinic input] +_msi.SummaryInformation.SetProperty + field: int + the name of the property, one of the PID_* constants + value as data: object + the new value of the property (integer or string) + / + +Set a property. +[clinic start generated code]*/ + +static PyObject * +_msi_SummaryInformation_SetProperty_impl(msiobj *self, int field, + PyObject *data) +/*[clinic end generated code: output=3d4692c8984bb675 input=f2a7811b905abbed]*/ { int status; - int field; - PyObject* data; - - if (!PyArg_ParseTuple(args, "iO:SetProperty", &field, &data)) - return NULL; if (PyUnicode_Check(data)) { +#if USE_UNICODE_WCHAR_CACHE +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS const WCHAR *value = _PyUnicode_AsUnicode(data); +_Py_COMP_DIAG_POP +#else /* USE_UNICODE_WCHAR_CACHE */ + WCHAR *value = PyUnicode_AsWideCharString(data, NULL); +#endif /* USE_UNICODE_WCHAR_CACHE */ if (value == NULL) { return NULL; } - status = MsiSummaryInfoSetPropertyW(si->h, field, VT_LPSTR, + status = MsiSummaryInfoSetPropertyW(self->h, field, VT_LPSTR, 0, NULL, value); +#if !USE_UNICODE_WCHAR_CACHE + PyMem_Free(value); +#endif /* USE_UNICODE_WCHAR_CACHE */ } else if (PyLong_CheckExact(data)) { long value = PyLong_AsLong(data); if (value == -1 && PyErr_Occurred()) { return NULL; } - status = MsiSummaryInfoSetProperty(si->h, field, VT_I4, + status = MsiSummaryInfoSetProperty(self->h, field, VT_I4, value, NULL, NULL); } else { PyErr_SetString(PyExc_TypeError, "unsupported type"); @@ -693,26 +792,29 @@ summary_setproperty(msiobj* si, PyObject *args) } -static PyObject* -summary_persist(msiobj* si, PyObject *args) +/*[clinic input] +_msi.SummaryInformation.Persist + +Write the modified properties to the summary information stream. +[clinic start generated code]*/ + +static PyObject * +_msi_SummaryInformation_Persist_impl(msiobj *self) +/*[clinic end generated code: output=c564bd17f5e122c9 input=e3dda9d530095ef7]*/ { int status; - status = MsiSummaryInfoPersist(si->h); + status = MsiSummaryInfoPersist(self->h); if (status != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } static PyMethodDef summary_methods[] = { - { "GetProperty", (PyCFunction)summary_getproperty, METH_VARARGS, - PyDoc_STR("GetProperty(propid) -> value\nWraps MsiSummaryInfoGetProperty")}, - { "GetPropertyCount", (PyCFunction)summary_getpropertycount, METH_NOARGS, - PyDoc_STR("GetProperty() -> int\nWraps MsiSummaryInfoGetPropertyCount")}, - { "SetProperty", (PyCFunction)summary_setproperty, METH_VARARGS, - PyDoc_STR("SetProperty(value) -> None\nWraps MsiSummaryInfoProperty")}, - { "Persist", (PyCFunction)summary_persist, METH_NOARGS, - PyDoc_STR("Persist() -> None\nWraps MsiSummaryInfoPersist")}, + _MSI_SUMMARYINFORMATION_GETPROPERTY_METHODDEF + _MSI_SUMMARYINFORMATION_GETPROPERTYCOUNT_METHODDEF + _MSI_SUMMARYINFORMATION_SETPROPERTY_METHODDEF + _MSI_SUMMARYINFORMATION_PERSIST_METHODDEF { NULL, NULL } }; @@ -762,15 +864,22 @@ static PyTypeObject summary_Type = { /*************************** View objects **************/ -static PyObject* -view_execute(msiobj *view, PyObject*args) +/*[clinic input] +_msi.View.Execute + params as oparams: object + a record describing actual values of the parameter tokens + in the query or None + / + +Execute the SQL query of the view. +[clinic start generated code]*/ + +static PyObject * +_msi_View_Execute(msiobj *self, PyObject *oparams) +/*[clinic end generated code: output=f0f65fd2900bcb4e input=cb163a15d453348e]*/ { int status; MSIHANDLE params = 0; - PyObject *oparams = Py_None; - - if (!PyArg_ParseTuple(args, "O:Execute", &oparams)) - return NULL; if (oparams != Py_None) { if (oparams->ob_type != &record_Type) { @@ -780,20 +889,27 @@ view_execute(msiobj *view, PyObject*args) params = ((msiobj*)oparams)->h; } - status = MsiViewExecute(view->h, params); + status = MsiViewExecute(self->h, params); if (status != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } -static PyObject* -view_fetch(msiobj *view, PyObject*args) +/*[clinic input] +_msi.View.Fetch + +Return a result record of the query. +[clinic start generated code]*/ + +static PyObject * +_msi_View_Fetch_impl(msiobj *self) +/*[clinic end generated code: output=ba154a3794537d4e input=7f3e3d06c449001c]*/ { int status; MSIHANDLE result; - status = MsiViewFetch(view->h, &result); + status = MsiViewFetch(self->h, &result); if (status == ERROR_NO_MORE_ITEMS) { Py_RETURN_NONE; } else if (status != ERROR_SUCCESS) { @@ -803,65 +919,80 @@ view_fetch(msiobj *view, PyObject*args) return record_new(result); } -static PyObject* -view_getcolumninfo(msiobj *view, PyObject *args) +/*[clinic input] +_msi.View.GetColumnInfo + kind: int + MSICOLINFO_NAMES or MSICOLINFO_TYPES + / + +Return a record describing the columns of the view. +[clinic start generated code]*/ + +static PyObject * +_msi_View_GetColumnInfo_impl(msiobj *self, int kind) +/*[clinic end generated code: output=e7c1697db9403660 input=afedb892bf564a3b]*/ { int status; - int kind; MSIHANDLE result; - if (!PyArg_ParseTuple(args, "i:GetColumnInfo", &kind)) - return NULL; - - if ((status = MsiViewGetColumnInfo(view->h, kind, &result)) != ERROR_SUCCESS) + if ((status = MsiViewGetColumnInfo(self->h, kind, &result)) != ERROR_SUCCESS) return msierror(status); return record_new(result); } -static PyObject* -view_modify(msiobj *view, PyObject *args) +/*[clinic input] +_msi.View.Modify + kind: int + one of the MSIMODIFY_* constants + data: object + a record describing the new data + / + +Modify the view. +[clinic start generated code]*/ + +static PyObject * +_msi_View_Modify_impl(msiobj *self, int kind, PyObject *data) +/*[clinic end generated code: output=69aaf3ce8ddac0ba input=2828de22de0d47b4]*/ { - int kind; - PyObject *data; int status; - if (!PyArg_ParseTuple(args, "iO:Modify", &kind, &data)) - return NULL; - if (data->ob_type != &record_Type) { PyErr_SetString(PyExc_TypeError, "Modify expects a record object"); return NULL; } - if ((status = MsiViewModify(view->h, kind, ((msiobj*)data)->h)) != ERROR_SUCCESS) + if ((status = MsiViewModify(self->h, kind, ((msiobj*)data)->h)) != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } -static PyObject* -view_close(msiobj *view, PyObject*args) +/*[clinic input] +_msi.View.Close + +Close the view. +[clinic start generated code]*/ + +static PyObject * +_msi_View_Close_impl(msiobj *self) +/*[clinic end generated code: output=488f7b8645ca104a input=de6927d1308c401c]*/ { int status; - if ((status = MsiViewClose(view->h)) != ERROR_SUCCESS) + if ((status = MsiViewClose(self->h)) != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } static PyMethodDef view_methods[] = { - { "Execute", (PyCFunction)view_execute, METH_VARARGS, - PyDoc_STR("Execute(params=None) -> None\nWraps MsiViewExecute")}, - { "GetColumnInfo", (PyCFunction)view_getcolumninfo, METH_VARARGS, - PyDoc_STR("GetColumnInfo() -> result\nWraps MsiGetColumnInfo")}, - { "Fetch", (PyCFunction)view_fetch, METH_NOARGS, - PyDoc_STR("Fetch() -> result\nWraps MsiViewFetch")}, - { "Modify", (PyCFunction)view_modify, METH_VARARGS, - PyDoc_STR("Modify(mode,record) -> None\nWraps MsiViewModify")}, - { "Close", (PyCFunction)view_close, METH_NOARGS, - PyDoc_STR("Close() -> result\nWraps MsiViewClose")}, + _MSI_VIEW_EXECUTE_METHODDEF + _MSI_VIEW_GETCOLUMNINFO_METHODDEF + _MSI_VIEW_FETCH_METHODDEF + _MSI_VIEW_MODIFY_METHODDEF + _MSI_VIEW_CLOSE_METHODDEF { NULL, NULL } }; @@ -911,18 +1042,24 @@ static PyTypeObject msiview_Type = { /*************************** Database objects **************/ -static PyObject* -msidb_openview(msiobj *msidb, PyObject *args) +/*[clinic input] +_msi.Database.OpenView + sql: Py_UNICODE + the SQL statement to execute + / + +Return a view object. +[clinic start generated code]*/ + +static PyObject * +_msi_Database_OpenView_impl(msiobj *self, const Py_UNICODE *sql) +/*[clinic end generated code: output=e712e6a11229abfd input=50f1771f37e500df]*/ { int status; - const wchar_t *sql; MSIHANDLE hView; msiobj *result; - if (!PyArg_ParseTuple(args, "u:OpenView", &sql)) - return NULL; - - if ((status = MsiDatabaseOpenViewW(msidb->h, sql, &hView)) != ERROR_SUCCESS) + if ((status = MsiDatabaseOpenViewW(self->h, sql, &hView)) != ERROR_SUCCESS) return msierror(status); result = PyObject_New(struct msiobj, &msiview_Type); @@ -935,29 +1072,42 @@ msidb_openview(msiobj *msidb, PyObject *args) return (PyObject*)result; } -static PyObject* -msidb_commit(msiobj *msidb, PyObject *args) +/*[clinic input] +_msi.Database.Commit + +Commit the changes pending in the current transaction. +[clinic start generated code]*/ + +static PyObject * +_msi_Database_Commit_impl(msiobj *self) +/*[clinic end generated code: output=f33021feb8b0cdd8 input=375bb120d402266d]*/ { int status; - if ((status = MsiDatabaseCommit(msidb->h)) != ERROR_SUCCESS) + if ((status = MsiDatabaseCommit(self->h)) != ERROR_SUCCESS) return msierror(status); Py_RETURN_NONE; } -static PyObject* -msidb_getsummaryinformation(msiobj *db, PyObject *args) +/*[clinic input] +_msi.Database.GetSummaryInformation + count: int + the maximum number of updated values + / + +Return a new summary information object. +[clinic start generated code]*/ + +static PyObject * +_msi_Database_GetSummaryInformation_impl(msiobj *self, int count) +/*[clinic end generated code: output=781e51a4ea4da847 input=18a899ead6521735]*/ { int status; - int count; MSIHANDLE result; msiobj *oresult; - if (!PyArg_ParseTuple(args, "i:GetSummaryInformation", &count)) - return NULL; - - status = MsiGetSummaryInformation(db->h, NULL, count, &result); + status = MsiGetSummaryInformation(self->h, NULL, count, &result); if (status != ERROR_SUCCESS) return msierror(status); @@ -972,14 +1122,10 @@ msidb_getsummaryinformation(msiobj *db, PyObject *args) } static PyMethodDef db_methods[] = { - { "OpenView", (PyCFunction)msidb_openview, METH_VARARGS, - PyDoc_STR("OpenView(sql) -> viewobj\nWraps MsiDatabaseOpenView")}, - { "Commit", (PyCFunction)msidb_commit, METH_NOARGS, - PyDoc_STR("Commit() -> None\nWraps MsiDatabaseCommit")}, - { "GetSummaryInformation", (PyCFunction)msidb_getsummaryinformation, METH_VARARGS, - PyDoc_STR("GetSummaryInformation(updateCount) -> viewobj\nWraps MsiGetSummaryInformation")}, - { "Close", (PyCFunction)msidb_close, METH_NOARGS, - PyDoc_STR("Close() -> None\nWraps MsiCloseHandle")}, + _MSI_DATABASE_OPENVIEW_METHODDEF + _MSI_DATABASE_COMMIT_METHODDEF + _MSI_DATABASE_GETSUMMARYINFORMATION_METHODDEF + _MSI_DATABASE_CLOSE_METHODDEF { NULL, NULL } }; @@ -1038,15 +1184,25 @@ static PyTypeObject msidb_Type = { Py_NOT_PERSIST(x, MSIDBOPEN_CREATE) && \ Py_NOT_PERSIST(x, MSIDBOPEN_CREATEDIRECT)) -static PyObject* msiopendb(PyObject *obj, PyObject *args) +/*[clinic input] +_msi.OpenDatabase + path: Py_UNICODE + the file name of the MSI file + persist: int + the persistence mode + / + +Return a new database object. +[clinic start generated code]*/ + +static PyObject * +_msi_OpenDatabase_impl(PyObject *module, const Py_UNICODE *path, int persist) +/*[clinic end generated code: output=d34b7202b745de05 input=1300f3b97659559b]*/ { int status; - const wchar_t *path; - int persist; MSIHANDLE h; msiobj *result; - if (!PyArg_ParseTuple(args, "ui:MSIOpenDatabase", &path, &persist)) - return NULL; + /* We need to validate that persist is a valid MSIDBOPEN_* value. Otherwise, MsiOpenDatabase may treat the value as a pointer, leading to unexpected behavior. */ @@ -1065,15 +1221,21 @@ static PyObject* msiopendb(PyObject *obj, PyObject *args) return (PyObject*)result; } -static PyObject* -createrecord(PyObject *o, PyObject *args) +/*[clinic input] +_msi.CreateRecord + count: int + the number of fields of the record + / + +Return a new record object. +[clinic start generated code]*/ + +static PyObject * +_msi_CreateRecord_impl(PyObject *module, int count) +/*[clinic end generated code: output=0ba0a00beea3e99e input=53f17d5b5d9b077d]*/ { - int count; MSIHANDLE h; - if (!PyArg_ParseTuple(args, "i:CreateRecord", &count)) - return NULL; - h = MsiCreateRecord(count); if (h == 0) return msierror(0); @@ -1083,14 +1245,10 @@ createrecord(PyObject *o, PyObject *args) static PyMethodDef msi_methods[] = { - {"UuidCreate", (PyCFunction)uuidcreate, METH_NOARGS, - PyDoc_STR("UuidCreate() -> string")}, - {"FCICreate", (PyCFunction)fcicreate, METH_VARARGS, - PyDoc_STR("fcicreate(cabname,files) -> None")}, - {"OpenDatabase", (PyCFunction)msiopendb, METH_VARARGS, - PyDoc_STR("OpenDatabase(name, flags) -> dbobj\nWraps MsiOpenDatabase")}, - {"CreateRecord", (PyCFunction)createrecord, METH_VARARGS, - PyDoc_STR("OpenDatabase(name, flags) -> dbobj\nWraps MsiCreateRecord")}, + _MSI_UUIDCREATE_METHODDEF + _MSI_FCICREATE_METHODDEF + _MSI_OPENDATABASE_METHODDEF + _MSI_CREATERECORD_METHODDEF {NULL, NULL} /* sentinel */ }; diff --git a/PC/clinic/_msi.c.h b/PC/clinic/_msi.c.h new file mode 100644 index 0000000000000..895bf39a779f4 --- /dev/null +++ b/PC/clinic/_msi.c.h @@ -0,0 +1,728 @@ +/*[clinic input] +preserve +[clinic start generated code]*/ + +PyDoc_STRVAR(_msi_UuidCreate__doc__, +"UuidCreate($module, /)\n" +"--\n" +"\n" +"Return the string representation of a new unique identifier."); + +#define _MSI_UUIDCREATE_METHODDEF \ + {"UuidCreate", (PyCFunction)_msi_UuidCreate, METH_NOARGS, _msi_UuidCreate__doc__}, + +static PyObject * +_msi_UuidCreate_impl(PyObject *module); + +static PyObject * +_msi_UuidCreate(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return _msi_UuidCreate_impl(module); +} + +PyDoc_STRVAR(_msi_FCICreate__doc__, +"FCICreate($module, cabname, files, /)\n" +"--\n" +"\n" +"Create a new CAB file.\n" +"\n" +" cabname\n" +" the name of the CAB file\n" +" files\n" +" a list of tuples, each containing the name of the file on disk,\n" +" and the name of the file inside the CAB file"); + +#define _MSI_FCICREATE_METHODDEF \ + {"FCICreate", (PyCFunction)(void(*)(void))_msi_FCICreate, METH_FASTCALL, _msi_FCICreate__doc__}, + +static PyObject * +_msi_FCICreate_impl(PyObject *module, const char *cabname, PyObject *files); + +static PyObject * +_msi_FCICreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *cabname; + PyObject *files; + + if (!_PyArg_CheckPositional("FCICreate", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("FCICreate", "argument 1", "str", args[0]); + goto exit; + } + Py_ssize_t cabname_length; + cabname = PyUnicode_AsUTF8AndSize(args[0], &cabname_length); + if (cabname == NULL) { + goto exit; + } + if (strlen(cabname) != (size_t)cabname_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + files = args[1]; + return_value = _msi_FCICreate_impl(module, cabname, files); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_Database_Close__doc__, +"Close($self, /)\n" +"--\n" +"\n" +"Close the database object."); + +#define _MSI_DATABASE_CLOSE_METHODDEF \ + {"Close", (PyCFunction)_msi_Database_Close, METH_NOARGS, _msi_Database_Close__doc__}, + +static PyObject * +_msi_Database_Close_impl(msiobj *self); + +static PyObject * +_msi_Database_Close(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_Database_Close_impl(self); +} + +PyDoc_STRVAR(_msi_Record_GetFieldCount__doc__, +"GetFieldCount($self, /)\n" +"--\n" +"\n" +"Return the number of fields of the record."); + +#define _MSI_RECORD_GETFIELDCOUNT_METHODDEF \ + {"GetFieldCount", (PyCFunction)_msi_Record_GetFieldCount, METH_NOARGS, _msi_Record_GetFieldCount__doc__}, + +static PyObject * +_msi_Record_GetFieldCount_impl(msiobj *self); + +static PyObject * +_msi_Record_GetFieldCount(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_Record_GetFieldCount_impl(self); +} + +PyDoc_STRVAR(_msi_Record_GetInteger__doc__, +"GetInteger($self, field, /)\n" +"--\n" +"\n" +"Return the value of field as an integer where possible."); + +#define _MSI_RECORD_GETINTEGER_METHODDEF \ + {"GetInteger", (PyCFunction)_msi_Record_GetInteger, METH_O, _msi_Record_GetInteger__doc__}, + +static PyObject * +_msi_Record_GetInteger_impl(msiobj *self, unsigned int field); + +static PyObject * +_msi_Record_GetInteger(msiobj *self, PyObject *arg) +{ + PyObject *return_value = NULL; + unsigned int field; + + field = (unsigned int)PyLong_AsUnsignedLongMask(arg); + if (field == (unsigned int)-1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_Record_GetInteger_impl(self, field); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_Record_GetString__doc__, +"GetString($self, field, /)\n" +"--\n" +"\n" +"Return the value of field as a string where possible."); + +#define _MSI_RECORD_GETSTRING_METHODDEF \ + {"GetString", (PyCFunction)_msi_Record_GetString, METH_O, _msi_Record_GetString__doc__}, + +static PyObject * +_msi_Record_GetString_impl(msiobj *self, unsigned int field); + +static PyObject * +_msi_Record_GetString(msiobj *self, PyObject *arg) +{ + PyObject *return_value = NULL; + unsigned int field; + + field = (unsigned int)PyLong_AsUnsignedLongMask(arg); + if (field == (unsigned int)-1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_Record_GetString_impl(self, field); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_Record_ClearData__doc__, +"ClearData($self, /)\n" +"--\n" +"\n" +"Set all fields of the record to 0."); + +#define _MSI_RECORD_CLEARDATA_METHODDEF \ + {"ClearData", (PyCFunction)_msi_Record_ClearData, METH_NOARGS, _msi_Record_ClearData__doc__}, + +static PyObject * +_msi_Record_ClearData_impl(msiobj *self); + +static PyObject * +_msi_Record_ClearData(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_Record_ClearData_impl(self); +} + +PyDoc_STRVAR(_msi_Record_SetString__doc__, +"SetString($self, field, value, /)\n" +"--\n" +"\n" +"Set field to a string value."); + +#define _MSI_RECORD_SETSTRING_METHODDEF \ + {"SetString", (PyCFunction)(void(*)(void))_msi_Record_SetString, METH_FASTCALL, _msi_Record_SetString__doc__}, + +static PyObject * +_msi_Record_SetString_impl(msiobj *self, int field, const Py_UNICODE *value); + +static PyObject * +_msi_Record_SetString(msiobj *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int field; + const Py_UNICODE *value; + + if (!_PyArg_CheckPositional("SetString", nargs, 2, 2)) { + goto exit; + } + field = _PyLong_AsInt(args[0]); + if (field == -1 && PyErr_Occurred()) { + goto exit; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("SetString", "argument 2", "str", args[1]); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + value = _PyUnicode_AsUnicode(args[1]); + _Py_COMP_DIAG_POP + #else /* USE_UNICODE_WCHAR_CACHE */ + value = PyUnicode_AsWideCharString(args[1], NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (value == NULL) { + goto exit; + } + return_value = _msi_Record_SetString_impl(self, field, value); + +exit: + /* Cleanup for value */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)value); + #endif /* USE_UNICODE_WCHAR_CACHE */ + + return return_value; +} + +PyDoc_STRVAR(_msi_Record_SetStream__doc__, +"SetStream($self, field, value, /)\n" +"--\n" +"\n" +"Set field to the contents of the file named value."); + +#define _MSI_RECORD_SETSTREAM_METHODDEF \ + {"SetStream", (PyCFunction)(void(*)(void))_msi_Record_SetStream, METH_FASTCALL, _msi_Record_SetStream__doc__}, + +static PyObject * +_msi_Record_SetStream_impl(msiobj *self, int field, const Py_UNICODE *value); + +static PyObject * +_msi_Record_SetStream(msiobj *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int field; + const Py_UNICODE *value; + + if (!_PyArg_CheckPositional("SetStream", nargs, 2, 2)) { + goto exit; + } + field = _PyLong_AsInt(args[0]); + if (field == -1 && PyErr_Occurred()) { + goto exit; + } + if (!PyUnicode_Check(args[1])) { + _PyArg_BadArgument("SetStream", "argument 2", "str", args[1]); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + value = _PyUnicode_AsUnicode(args[1]); + _Py_COMP_DIAG_POP + #else /* USE_UNICODE_WCHAR_CACHE */ + value = PyUnicode_AsWideCharString(args[1], NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (value == NULL) { + goto exit; + } + return_value = _msi_Record_SetStream_impl(self, field, value); + +exit: + /* Cleanup for value */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)value); + #endif /* USE_UNICODE_WCHAR_CACHE */ + + return return_value; +} + +PyDoc_STRVAR(_msi_Record_SetInteger__doc__, +"SetInteger($self, field, value, /)\n" +"--\n" +"\n" +"Set field to an integer value."); + +#define _MSI_RECORD_SETINTEGER_METHODDEF \ + {"SetInteger", (PyCFunction)(void(*)(void))_msi_Record_SetInteger, METH_FASTCALL, _msi_Record_SetInteger__doc__}, + +static PyObject * +_msi_Record_SetInteger_impl(msiobj *self, int field, int value); + +static PyObject * +_msi_Record_SetInteger(msiobj *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int field; + int value; + + if (!_PyArg_CheckPositional("SetInteger", nargs, 2, 2)) { + goto exit; + } + field = _PyLong_AsInt(args[0]); + if (field == -1 && PyErr_Occurred()) { + goto exit; + } + value = _PyLong_AsInt(args[1]); + if (value == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_Record_SetInteger_impl(self, field, value); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_SummaryInformation_GetProperty__doc__, +"GetProperty($self, field, /)\n" +"--\n" +"\n" +"Return a property of the summary.\n" +"\n" +" field\n" +" the name of the property, one of the PID_* constants"); + +#define _MSI_SUMMARYINFORMATION_GETPROPERTY_METHODDEF \ + {"GetProperty", (PyCFunction)_msi_SummaryInformation_GetProperty, METH_O, _msi_SummaryInformation_GetProperty__doc__}, + +static PyObject * +_msi_SummaryInformation_GetProperty_impl(msiobj *self, int field); + +static PyObject * +_msi_SummaryInformation_GetProperty(msiobj *self, PyObject *arg) +{ + PyObject *return_value = NULL; + int field; + + field = _PyLong_AsInt(arg); + if (field == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_SummaryInformation_GetProperty_impl(self, field); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_SummaryInformation_GetPropertyCount__doc__, +"GetPropertyCount($self, /)\n" +"--\n" +"\n" +"Return the number of summary properties."); + +#define _MSI_SUMMARYINFORMATION_GETPROPERTYCOUNT_METHODDEF \ + {"GetPropertyCount", (PyCFunction)_msi_SummaryInformation_GetPropertyCount, METH_NOARGS, _msi_SummaryInformation_GetPropertyCount__doc__}, + +static PyObject * +_msi_SummaryInformation_GetPropertyCount_impl(msiobj *self); + +static PyObject * +_msi_SummaryInformation_GetPropertyCount(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_SummaryInformation_GetPropertyCount_impl(self); +} + +PyDoc_STRVAR(_msi_SummaryInformation_SetProperty__doc__, +"SetProperty($self, field, value, /)\n" +"--\n" +"\n" +"Set a property.\n" +"\n" +" field\n" +" the name of the property, one of the PID_* constants\n" +" value\n" +" the new value of the property (integer or string)"); + +#define _MSI_SUMMARYINFORMATION_SETPROPERTY_METHODDEF \ + {"SetProperty", (PyCFunction)(void(*)(void))_msi_SummaryInformation_SetProperty, METH_FASTCALL, _msi_SummaryInformation_SetProperty__doc__}, + +static PyObject * +_msi_SummaryInformation_SetProperty_impl(msiobj *self, int field, + PyObject *data); + +static PyObject * +_msi_SummaryInformation_SetProperty(msiobj *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int field; + PyObject *data; + + if (!_PyArg_CheckPositional("SetProperty", nargs, 2, 2)) { + goto exit; + } + field = _PyLong_AsInt(args[0]); + if (field == -1 && PyErr_Occurred()) { + goto exit; + } + data = args[1]; + return_value = _msi_SummaryInformation_SetProperty_impl(self, field, data); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_SummaryInformation_Persist__doc__, +"Persist($self, /)\n" +"--\n" +"\n" +"Write the modified properties to the summary information stream."); + +#define _MSI_SUMMARYINFORMATION_PERSIST_METHODDEF \ + {"Persist", (PyCFunction)_msi_SummaryInformation_Persist, METH_NOARGS, _msi_SummaryInformation_Persist__doc__}, + +static PyObject * +_msi_SummaryInformation_Persist_impl(msiobj *self); + +static PyObject * +_msi_SummaryInformation_Persist(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_SummaryInformation_Persist_impl(self); +} + +PyDoc_STRVAR(_msi_View_Execute__doc__, +"Execute($self, params, /)\n" +"--\n" +"\n" +"Execute the SQL query of the view.\n" +"\n" +" params\n" +" a record describing actual values of the parameter tokens\n" +" in the query or None"); + +#define _MSI_VIEW_EXECUTE_METHODDEF \ + {"Execute", (PyCFunction)_msi_View_Execute, METH_O, _msi_View_Execute__doc__}, + +PyDoc_STRVAR(_msi_View_Fetch__doc__, +"Fetch($self, /)\n" +"--\n" +"\n" +"Return a result record of the query."); + +#define _MSI_VIEW_FETCH_METHODDEF \ + {"Fetch", (PyCFunction)_msi_View_Fetch, METH_NOARGS, _msi_View_Fetch__doc__}, + +static PyObject * +_msi_View_Fetch_impl(msiobj *self); + +static PyObject * +_msi_View_Fetch(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_View_Fetch_impl(self); +} + +PyDoc_STRVAR(_msi_View_GetColumnInfo__doc__, +"GetColumnInfo($self, kind, /)\n" +"--\n" +"\n" +"Return a record describing the columns of the view.\n" +"\n" +" kind\n" +" MSICOLINFO_NAMES or MSICOLINFO_TYPES"); + +#define _MSI_VIEW_GETCOLUMNINFO_METHODDEF \ + {"GetColumnInfo", (PyCFunction)_msi_View_GetColumnInfo, METH_O, _msi_View_GetColumnInfo__doc__}, + +static PyObject * +_msi_View_GetColumnInfo_impl(msiobj *self, int kind); + +static PyObject * +_msi_View_GetColumnInfo(msiobj *self, PyObject *arg) +{ + PyObject *return_value = NULL; + int kind; + + kind = _PyLong_AsInt(arg); + if (kind == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_View_GetColumnInfo_impl(self, kind); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_View_Modify__doc__, +"Modify($self, kind, data, /)\n" +"--\n" +"\n" +"Modify the view.\n" +"\n" +" kind\n" +" one of the MSIMODIFY_* constants\n" +" data\n" +" a record describing the new data"); + +#define _MSI_VIEW_MODIFY_METHODDEF \ + {"Modify", (PyCFunction)(void(*)(void))_msi_View_Modify, METH_FASTCALL, _msi_View_Modify__doc__}, + +static PyObject * +_msi_View_Modify_impl(msiobj *self, int kind, PyObject *data); + +static PyObject * +_msi_View_Modify(msiobj *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int kind; + PyObject *data; + + if (!_PyArg_CheckPositional("Modify", nargs, 2, 2)) { + goto exit; + } + kind = _PyLong_AsInt(args[0]); + if (kind == -1 && PyErr_Occurred()) { + goto exit; + } + data = args[1]; + return_value = _msi_View_Modify_impl(self, kind, data); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_View_Close__doc__, +"Close($self, /)\n" +"--\n" +"\n" +"Close the view."); + +#define _MSI_VIEW_CLOSE_METHODDEF \ + {"Close", (PyCFunction)_msi_View_Close, METH_NOARGS, _msi_View_Close__doc__}, + +static PyObject * +_msi_View_Close_impl(msiobj *self); + +static PyObject * +_msi_View_Close(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_View_Close_impl(self); +} + +PyDoc_STRVAR(_msi_Database_OpenView__doc__, +"OpenView($self, sql, /)\n" +"--\n" +"\n" +"Return a view object.\n" +"\n" +" sql\n" +" the SQL statement to execute"); + +#define _MSI_DATABASE_OPENVIEW_METHODDEF \ + {"OpenView", (PyCFunction)_msi_Database_OpenView, METH_O, _msi_Database_OpenView__doc__}, + +static PyObject * +_msi_Database_OpenView_impl(msiobj *self, const Py_UNICODE *sql); + +static PyObject * +_msi_Database_OpenView(msiobj *self, PyObject *arg) +{ + PyObject *return_value = NULL; + const Py_UNICODE *sql; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("OpenView", "argument", "str", arg); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + sql = _PyUnicode_AsUnicode(arg); + _Py_COMP_DIAG_POP + #else /* USE_UNICODE_WCHAR_CACHE */ + sql = PyUnicode_AsWideCharString(arg, NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (sql == NULL) { + goto exit; + } + return_value = _msi_Database_OpenView_impl(self, sql); + +exit: + /* Cleanup for sql */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)sql); + #endif /* USE_UNICODE_WCHAR_CACHE */ + + return return_value; +} + +PyDoc_STRVAR(_msi_Database_Commit__doc__, +"Commit($self, /)\n" +"--\n" +"\n" +"Commit the changes pending in the current transaction."); + +#define _MSI_DATABASE_COMMIT_METHODDEF \ + {"Commit", (PyCFunction)_msi_Database_Commit, METH_NOARGS, _msi_Database_Commit__doc__}, + +static PyObject * +_msi_Database_Commit_impl(msiobj *self); + +static PyObject * +_msi_Database_Commit(msiobj *self, PyObject *Py_UNUSED(ignored)) +{ + return _msi_Database_Commit_impl(self); +} + +PyDoc_STRVAR(_msi_Database_GetSummaryInformation__doc__, +"GetSummaryInformation($self, count, /)\n" +"--\n" +"\n" +"Return a new summary information object.\n" +"\n" +" count\n" +" the maximum number of updated values"); + +#define _MSI_DATABASE_GETSUMMARYINFORMATION_METHODDEF \ + {"GetSummaryInformation", (PyCFunction)_msi_Database_GetSummaryInformation, METH_O, _msi_Database_GetSummaryInformation__doc__}, + +static PyObject * +_msi_Database_GetSummaryInformation_impl(msiobj *self, int count); + +static PyObject * +_msi_Database_GetSummaryInformation(msiobj *self, PyObject *arg) +{ + PyObject *return_value = NULL; + int count; + + count = _PyLong_AsInt(arg); + if (count == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_Database_GetSummaryInformation_impl(self, count); + +exit: + return return_value; +} + +PyDoc_STRVAR(_msi_OpenDatabase__doc__, +"OpenDatabase($module, path, persist, /)\n" +"--\n" +"\n" +"Return a new database object.\n" +"\n" +" path\n" +" the file name of the MSI file\n" +" persist\n" +" the persistence mode"); + +#define _MSI_OPENDATABASE_METHODDEF \ + {"OpenDatabase", (PyCFunction)(void(*)(void))_msi_OpenDatabase, METH_FASTCALL, _msi_OpenDatabase__doc__}, + +static PyObject * +_msi_OpenDatabase_impl(PyObject *module, const Py_UNICODE *path, int persist); + +static PyObject * +_msi_OpenDatabase(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const Py_UNICODE *path; + int persist; + + if (!_PyArg_CheckPositional("OpenDatabase", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("OpenDatabase", "argument 1", "str", args[0]); + goto exit; + } + #if USE_UNICODE_WCHAR_CACHE + _Py_COMP_DIAG_PUSH + _Py_COMP_DIAG_IGNORE_DEPR_DECLS + path = _PyUnicode_AsUnicode(args[0]); + _Py_COMP_DIAG_POP + #else /* USE_UNICODE_WCHAR_CACHE */ + path = PyUnicode_AsWideCharString(args[0], NULL); + #endif /* USE_UNICODE_WCHAR_CACHE */ + if (path == NULL) { + goto exit; + } + persist = _PyLong_AsInt(args[1]); + if (persist == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_OpenDatabase_impl(module, path, persist); + +exit: + /* Cleanup for path */ + #if !USE_UNICODE_WCHAR_CACHE + PyMem_Free((void *)path); + #endif /* USE_UNICODE_WCHAR_CACHE */ + + return return_value; +} + +PyDoc_STRVAR(_msi_CreateRecord__doc__, +"CreateRecord($module, count, /)\n" +"--\n" +"\n" +"Return a new record object.\n" +"\n" +" count\n" +" the number of fields of the record"); + +#define _MSI_CREATERECORD_METHODDEF \ + {"CreateRecord", (PyCFunction)_msi_CreateRecord, METH_O, _msi_CreateRecord__doc__}, + +static PyObject * +_msi_CreateRecord_impl(PyObject *module, int count); + +static PyObject * +_msi_CreateRecord(PyObject *module, PyObject *arg) +{ + PyObject *return_value = NULL; + int count; + + count = _PyLong_AsInt(arg); + if (count == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = _msi_CreateRecord_impl(module, count); + +exit: + return return_value; +} +/*[clinic end generated code: output=39807788326ad0e9 input=a9049054013a1b77]*/ From webhook-mailer at python.org Wed Jul 1 17:08:43 2020 From: webhook-mailer at python.org (Kit Choi) Date: Wed, 01 Jul 2020 21:08:43 -0000 Subject: [Python-checkins] bpo-39385: Add an assertNoLogs context manager to unittest.TestCase (GH-18067) Message-ID: https://github.com/python/cpython/commit/6b34d7b51e33fcb21b8827d927474ce9ed1f605c commit: 6b34d7b51e33fcb21b8827d927474ce9ed1f605c branch: master author: Kit Choi committer: GitHub date: 2020-07-01T22:08:38+01:00 summary: bpo-39385: Add an assertNoLogs context manager to unittest.TestCase (GH-18067) Co-authored-by: R?mi Lapeyre files: A Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst M Doc/library/unittest.rst M Lib/unittest/_log.py M Lib/unittest/case.py M Lib/unittest/test/test_case.py diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index b2e16cf331e03..0dddbd25d991b 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -950,6 +950,9 @@ Test cases | :meth:`assertLogs(logger, level) | The ``with`` block logs on *logger* | 3.4 | | ` | with minimum *level* | | +---------------------------------------------------------+--------------------------------------+------------+ + | :meth:`assertNoLogs(logger, level) | The ``with`` block does not log on | 3.10 | + | ` | *logger* with minimum *level* | | + +---------------------------------------------------------+--------------------------------------+------------+ .. method:: assertRaises(exception, callable, *args, **kwds) assertRaises(exception, *, msg=None) @@ -1121,6 +1124,24 @@ Test cases .. versionadded:: 3.4 + .. method:: assertNoLogs(logger=None, level=None) + + A context manager to test that no messages are logged on + the *logger* or one of its children, with at least the given + *level*. + + If given, *logger* should be a :class:`logging.Logger` object or a + :class:`str` giving the name of a logger. The default is the root + logger, which will catch all messages. + + If given, *level* should be either a numeric logging level or + its string equivalent (for example either ``"ERROR"`` or + :attr:`logging.ERROR`). The default is :attr:`logging.INFO`. + + Unlike :meth:`assertLogs`, nothing will be returned by the context + manager. + + .. versionadded:: 3.10 There are also other methods used to perform more specific checks, such as: diff --git a/Lib/unittest/_log.py b/Lib/unittest/_log.py index 94e7e758bd9a0..961c448a7fb35 100644 --- a/Lib/unittest/_log.py +++ b/Lib/unittest/_log.py @@ -26,11 +26,11 @@ def emit(self, record): class _AssertLogsContext(_BaseTestCaseContext): - """A context manager used to implement TestCase.assertLogs().""" + """A context manager for assertLogs() and assertNoLogs() """ LOGGING_FORMAT = "%(levelname)s:%(name)s:%(message)s" - def __init__(self, test_case, logger_name, level): + def __init__(self, test_case, logger_name, level, no_logs): _BaseTestCaseContext.__init__(self, test_case) self.logger_name = logger_name if level: @@ -38,6 +38,7 @@ def __init__(self, test_case, logger_name, level): else: self.level = logging.INFO self.msg = None + self.no_logs = no_logs def __enter__(self): if isinstance(self.logger_name, logging.Logger): @@ -54,16 +55,31 @@ def __enter__(self): logger.handlers = [handler] logger.setLevel(self.level) logger.propagate = False + if self.no_logs: + return return handler.watcher def __exit__(self, exc_type, exc_value, tb): self.logger.handlers = self.old_handlers self.logger.propagate = self.old_propagate self.logger.setLevel(self.old_level) + if exc_type is not None: # let unexpected exceptions pass through return False - if len(self.watcher.records) == 0: - self._raiseFailure( - "no logs of level {} or higher triggered on {}" - .format(logging.getLevelName(self.level), self.logger.name)) + + if self.no_logs: + # assertNoLogs + if len(self.watcher.records) > 0: + self._raiseFailure( + "Unexpected logs found: {!r}".format( + self.watcher.output + ) + ) + + else: + # assertLogs + if len(self.watcher.records) == 0: + self._raiseFailure( + "no logs of level {} or higher triggered on {}" + .format(logging.getLevelName(self.level), self.logger.name)) diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 52eb7d05ed143..872f12112755e 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -295,7 +295,6 @@ def __exit__(self, exc_type, exc_value, tb): self._raiseFailure("{} not triggered".format(exc_name)) - class _OrderedChainMap(collections.ChainMap): def __iter__(self): seen = set() @@ -788,7 +787,16 @@ def assertLogs(self, logger=None, level=None): """ # Lazy import to avoid importing logging if it is not needed. from ._log import _AssertLogsContext - return _AssertLogsContext(self, logger, level) + return _AssertLogsContext(self, logger, level, no_logs=False) + + def assertNoLogs(self, logger=None, level=None): + """ Fail unless no log messages of level *level* or higher are emitted + on *logger_name* or its children. + + This method must be used as a context manager. + """ + from ._log import _AssertLogsContext + return _AssertLogsContext(self, logger, level, no_logs=True) def _getAssertEqualityFunc(self, first, second): """Get a detailed comparison function for the types of the two args. diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index 3dedcbe6aad5f..0e416967a3086 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -1681,6 +1681,81 @@ def testAssertLogsFailureMismatchingLogger(self): with self.assertLogs('foo'): log_quux.error("1") + def testAssertLogsUnexpectedException(self): + # Check unexpected exception will go through. + with self.assertRaises(ZeroDivisionError): + with self.assertLogs(): + raise ZeroDivisionError("Unexpected") + + def testAssertNoLogsDefault(self): + with self.assertRaises(self.failureException) as cm: + with self.assertNoLogs(): + log_foo.info("1") + log_foobar.debug("2") + self.assertEqual( + str(cm.exception), + "Unexpected logs found: ['INFO:foo:1']", + ) + + def testAssertNoLogsFailureFoundLogs(self): + with self.assertRaises(self.failureException) as cm: + with self.assertNoLogs(): + log_quux.error("1") + log_foo.error("foo") + + self.assertEqual( + str(cm.exception), + "Unexpected logs found: ['ERROR:quux:1', 'ERROR:foo:foo']", + ) + + def testAssertNoLogsPerLogger(self): + with self.assertNoStderr(): + with self.assertLogs(log_quux): + with self.assertNoLogs(logger=log_foo): + log_quux.error("1") + + def testAssertNoLogsFailurePerLogger(self): + # Failure due to unexpected logs for the given logger or its + # children. + with self.assertRaises(self.failureException) as cm: + with self.assertLogs(log_quux): + with self.assertNoLogs(logger=log_foo): + log_quux.error("1") + log_foobar.info("2") + self.assertEqual( + str(cm.exception), + "Unexpected logs found: ['INFO:foo.bar:2']", + ) + + def testAssertNoLogsPerLevel(self): + # Check per-level filtering + with self.assertNoStderr(): + with self.assertNoLogs(level="ERROR"): + log_foo.info("foo") + log_quux.debug("1") + + def testAssertNoLogsFailurePerLevel(self): + # Failure due to unexpected logs at the specified level. + with self.assertRaises(self.failureException) as cm: + with self.assertNoLogs(level="DEBUG"): + log_foo.debug("foo") + log_quux.debug("1") + self.assertEqual( + str(cm.exception), + "Unexpected logs found: ['DEBUG:foo:foo', 'DEBUG:quux:1']", + ) + + def testAssertNoLogsUnexpectedException(self): + # Check unexpected exception will go through. + with self.assertRaises(ZeroDivisionError): + with self.assertNoLogs(): + raise ZeroDivisionError("Unexpected") + + def testAssertNoLogsYieldsNone(self): + with self.assertNoLogs() as value: + pass + self.assertIsNone(value) + def testDeprecatedMethodNames(self): """ Test that the deprecated methods raise a DeprecationWarning. See #9424. diff --git a/Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst b/Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst new file mode 100644 index 0000000000000..e6c5c0dd4380b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-23-18-21-19.bpo-39385.MIAyS7.rst @@ -0,0 +1,3 @@ +A new test assertion context-manager, :func:`unittest.assertNoLogs` will +ensure a given block of code emits no log messages using the logging module. +Contributed by Kit Yan Choi. From webhook-mailer at python.org Wed Jul 1 17:21:44 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 01 Jul 2020 21:21:44 -0000 Subject: [Python-checkins] bpo-40521: Cleanup finalize_interp_types() (GH-21265) Message-ID: https://github.com/python/cpython/commit/90db4653ae37ef90754cfd2cd6ec6857b87a88e6 commit: 90db4653ae37ef90754cfd2cd6ec6857b87a88e6 branch: master author: Victor Stinner committer: GitHub date: 2020-07-01T23:21:36+02:00 summary: bpo-40521: Cleanup finalize_interp_types() (GH-21265) Remove the now unused is_main_interp parameter of finalize_interp_types(). files: M Python/pylifecycle.c diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index cd993ea13418f..cfbaf21960b91 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1257,7 +1257,7 @@ flush_std_files(void) static void -finalize_interp_types(PyThreadState *tstate, int is_main_interp) +finalize_interp_types(PyThreadState *tstate) { _PyExc_Fini(tstate); _PyFrame_Fini(tstate); @@ -1300,7 +1300,7 @@ finalize_interp_clear(PyThreadState *tstate) _PyWarnings_Fini(tstate->interp); - finalize_interp_types(tstate, is_main_interp); + finalize_interp_types(tstate); } From webhook-mailer at python.org Wed Jul 1 19:20:04 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 01 Jul 2020 23:20:04 -0000 Subject: [Python-checkins] bpo-1635741: Release Unicode interned strings at exit (GH-21269) Message-ID: https://github.com/python/cpython/commit/666ecfb0957a2fa0df5e2bd03804195de74bdfbf commit: 666ecfb0957a2fa0df5e2bd03804195de74bdfbf branch: master author: Victor Stinner committer: GitHub date: 2020-07-02T01:19:57+02:00 summary: bpo-1635741: Release Unicode interned strings at exit (GH-21269) * PyUnicode_InternInPlace() now ensures that interned strings are ready. * Add _PyUnicode_ClearInterned(). * Py_Finalize() now releases Unicode interned strings: call _PyUnicode_ClearInterned(). files: M Include/internal/pycore_pylifecycle.h M Objects/unicodeobject.c M Python/pylifecycle.c diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h index bffc95b27e946..22def3dbc8b66 100644 --- a/Include/internal/pycore_pylifecycle.h +++ b/Include/internal/pycore_pylifecycle.h @@ -78,6 +78,7 @@ extern void _PyGC_Fini(PyThreadState *tstate); extern void _PyType_Fini(void); extern void _Py_HashRandomization_Fini(void); extern void _PyUnicode_Fini(PyThreadState *tstate); +extern void _PyUnicode_ClearInterned(PyThreadState *tstate); extern void _PyLong_Fini(PyThreadState *tstate); extern void _PyFaulthandler_Fini(void); extern void _PyHash_Fini(void); diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index fe46de2ae4743..37e7fe5c0eff2 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -55,8 +55,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #endif -/* Uncomment to display statistics on interned strings at exit when - using Valgrind or Insecure++. */ +/* Uncomment to display statistics on interned strings at exit + in _PyUnicode_ClearInterned(). */ /* #define INTERNED_STATS 1 */ @@ -15681,6 +15681,11 @@ PyUnicode_InternInPlace(PyObject **p) } #ifdef INTERNED_STRINGS + if (PyUnicode_READY(s) == -1) { + PyErr_Clear(); + return; + } + if (interned == NULL) { interned = PyDict_New(); if (interned == NULL) { @@ -15733,23 +15738,29 @@ PyUnicode_InternFromString(const char *cp) } -#if defined(WITH_VALGRIND) || defined(__INSURE__) -static void -unicode_release_interned(void) +void +_PyUnicode_ClearInterned(PyThreadState *tstate) { - if (interned == NULL || !PyDict_Check(interned)) { + if (!_Py_IsMainInterpreter(tstate)) { + // interned dict is shared by all interpreters + return; + } + + if (interned == NULL) { return; } + assert(PyDict_CheckExact(interned)); + PyObject *keys = PyDict_Keys(interned); - if (keys == NULL || !PyList_Check(keys)) { + if (keys == NULL) { PyErr_Clear(); return; } + assert(PyList_CheckExact(keys)); - /* Since unicode_release_interned() is intended to help a leak - detector, interned unicode strings are not forcibly deallocated; - rather, we give them their stolen references back, and then clear - and DECREF the interned dict. */ + /* Interned unicode strings are not forcibly deallocated; rather, we give + them their stolen references back, and then clear and DECREF the + interned dict. */ Py_ssize_t n = PyList_GET_SIZE(keys); #ifdef INTERNED_STATS @@ -15759,9 +15770,8 @@ unicode_release_interned(void) #endif for (Py_ssize_t i = 0; i < n; i++) { PyObject *s = PyList_GET_ITEM(keys, i); - if (PyUnicode_READY(s) == -1) { - Py_UNREACHABLE(); - } + assert(PyUnicode_IS_READY(s)); + switch (PyUnicode_CHECK_INTERNED(s)) { case SSTATE_INTERNED_IMMORTAL: Py_SET_REFCNT(s, Py_REFCNT(s) + 1); @@ -15788,10 +15798,10 @@ unicode_release_interned(void) mortal_size, immortal_size); #endif Py_DECREF(keys); + PyDict_Clear(interned); Py_CLEAR(interned); } -#endif /********************* Unicode Iterator **************************/ @@ -16160,23 +16170,9 @@ _PyUnicode_EnableLegacyWindowsFSEncoding(void) void _PyUnicode_Fini(PyThreadState *tstate) { - struct _Py_unicode_state *state = &tstate->interp->unicode; + // _PyUnicode_ClearInterned() must be called before - int is_main_interp = _Py_IsMainInterpreter(tstate); - if (is_main_interp) { -#if defined(WITH_VALGRIND) || defined(__INSURE__) - /* Insure++ is a memory analysis tool that aids in discovering - * memory leaks and other memory problems. On Python exit, the - * interned string dictionaries are flagged as being in use at exit - * (which it is). Under normal circumstances, this is fine because - * the memory will be automatically reclaimed by the system. Under - * memory debugging, it's a huge source of useless noise, so we - * trade off slower shutdown for less distraction in the memory - * reports. -baw - */ - unicode_release_interned(); -#endif /* __INSURE__ */ - } + struct _Py_unicode_state *state = &tstate->interp->unicode; Py_CLEAR(state->empty_string); @@ -16184,7 +16180,7 @@ _PyUnicode_Fini(PyThreadState *tstate) Py_CLEAR(state->latin1[i]); } - if (is_main_interp) { + if (_Py_IsMainInterpreter(tstate)) { unicode_clear_static_strings(); } diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index cfbaf21960b91..3ce2c41ef1ff6 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1263,6 +1263,7 @@ finalize_interp_types(PyThreadState *tstate) _PyFrame_Fini(tstate); _PyAsyncGen_Fini(tstate); _PyContext_Fini(tstate); + _PyUnicode_ClearInterned(tstate); _PyDict_Fini(tstate); _PyList_Fini(tstate); From webhook-mailer at python.org Thu Jul 2 01:58:39 2020 From: webhook-mailer at python.org (Ned Deily) Date: Thu, 02 Jul 2020 05:58:39 -0000 Subject: [Python-checkins] 3.8.3 -> 3.8.4 in macOS installer ReadMe (GH-21274) Message-ID: https://github.com/python/cpython/commit/cbdacb94c1a096387e1fb37d4e44bb3847d0c4f8 commit: cbdacb94c1a096387e1fb37d4e44bb3847d0c4f8 branch: 3.8 author: Ned Deily committer: GitHub date: 2020-07-02T01:58:31-04:00 summary: 3.8.3 -> 3.8.4 in macOS installer ReadMe (GH-21274) files: M Mac/BuildScript/resources/ReadMe.rtf diff --git a/Mac/BuildScript/resources/ReadMe.rtf b/Mac/BuildScript/resources/ReadMe.rtf index e09c5e97709d9..b1e972eec2d6e 100644 --- a/Mac/BuildScript/resources/ReadMe.rtf +++ b/Mac/BuildScript/resources/ReadMe.rtf @@ -56,11 +56,10 @@ macOS 10.15 (Catalina) Gatekeeper Requirements [changed in 3.8.2]\ As of 2020-02-03, Apple has changed how third-party installer packages, like those provided by python.org, are notarized for verification by Gatekeeper and begun enforcing additional requirements such as code signing and use of the hardened runtime. As of 3.8.2, python.org installer packages now meet those additional notarization requirements. The necessary changes in packaging should be transparent to your use of Python but, in the unlikely event that you encounter changes in behavior between 3.8.1 and newer 3.8.x releases in areas like ctypes, importlib, or mmap, please check bugs.python.org for existing reports and, if necessary, open a new issue.\ \f1\b \ul \ -Python 2.7 end-of-life [changed in 3.8.3]\ +Python 2.7 end-of-life [changed in 3.8.4]\ \ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 -\f0\b0 \cf0 \ulnone Python 2.7 has now reached end-of-life. As of Python 3.8.3, the +\f0\b0 \ulnone Python 2.7 has now reached end-of-life. As of Python 3.8.4, the \f3 Python Launcher \f0 app now has \f3 python3 @@ -73,9 +72,8 @@ Python 2.7 end-of-life [changed in 3.8.3]\ \f0 . This change might affect developers using the framework to embed Python in their applications. If another version is desired for embedding, the \f3 Current \f0 symlink can be changed manually without affecting 3.8.x behavior.\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 -\f1\b \cf0 \ul \ulc0 \ +\f1\b \ul \ Other changes\ \f0\b0 \ulnone \ From webhook-mailer at python.org Thu Jul 2 03:05:39 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 02 Jul 2020 07:05:39 -0000 Subject: [Python-checkins] [3.8] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21277) Message-ID: https://github.com/python/cpython/commit/e73896241e55f452656fd8070eb79f344091bca0 commit: e73896241e55f452656fd8070eb79f344091bca0 branch: 3.8 author: Serhiy Storchaka committer: GitHub date: 2020-07-02T10:05:35+03:00 summary: [3.8] bpo-41043: Escape literal part of the path for glob(). (GH-20994). (GH-21277) (cherry picked from commit 935586845815f5b4c7814794413f6a812d4bd45f) files: A Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst M Lib/distutils/command/build_py.py M Lib/idlelib/tree.py M Lib/imghdr.py M Lib/pdb.py M Lib/sndhdr.py M Lib/test/_test_multiprocessing.py M Lib/test/libregrtest/main.py M Lib/test/support/__init__.py M Lib/test/test_bz2.py M Lib/test/test_crashers.py M Lib/test/test_dbm.py M Lib/test/test_import/__init__.py M Lib/test/test_mailbox.py M Lib/test/test_regrtest.py M Lib/test/test_site.py M Lib/test/test_tokenize.py M Lib/test/test_unicode_file.py M Lib/webbrowser.py M Tools/c-globals/check-c-globals.py M Tools/ssl/make_ssl_data.py M setup.py diff --git a/Lib/distutils/command/build_py.py b/Lib/distutils/command/build_py.py index cf0ca57c32047..edc2171cd122d 100644 --- a/Lib/distutils/command/build_py.py +++ b/Lib/distutils/command/build_py.py @@ -5,7 +5,7 @@ import os import importlib.util import sys -from glob import glob +import glob from distutils.core import Command from distutils.errors import * @@ -125,7 +125,7 @@ def find_data_files(self, package, src_dir): files = [] for pattern in globs: # Each pattern has to be converted to a platform-specific path - filelist = glob(os.path.join(src_dir, convert_path(pattern))) + filelist = glob.glob(os.path.join(glob.escape(src_dir), convert_path(pattern))) # Files that match more than one pattern are only added once files.extend([fn for fn in filelist if fn not in files and os.path.isfile(fn)]) @@ -216,7 +216,7 @@ def check_module(self, module, module_file): def find_package_modules(self, package, package_dir): self.check_package(package, package_dir) - module_files = glob(os.path.join(package_dir, "*.py")) + module_files = glob.glob(os.path.join(glob.escape(package_dir), "*.py")) modules = [] setup_script = os.path.abspath(self.distribution.script_name) diff --git a/Lib/idlelib/tree.py b/Lib/idlelib/tree.py index 6229be4e5a8ad..5947268f5c35a 100644 --- a/Lib/idlelib/tree.py +++ b/Lib/idlelib/tree.py @@ -38,7 +38,7 @@ def listicons(icondir=ICONDIR): """Utility to display the available icons.""" root = Tk() import glob - list = glob.glob(os.path.join(icondir, "*.gif")) + list = glob.glob(os.path.join(glob.escape(icondir), "*.gif")) list.sort() images = [] row = column = 0 diff --git a/Lib/imghdr.py b/Lib/imghdr.py index 76e8abb2d5833..6e01fd857469a 100644 --- a/Lib/imghdr.py +++ b/Lib/imghdr.py @@ -152,7 +152,7 @@ def testall(list, recursive, toplevel): if recursive or toplevel: print('recursing down:') import glob - names = glob.glob(os.path.join(filename, '*')) + names = glob.glob(os.path.join(glob.escape(filename), '*')) testall(names, recursive, 0) else: print('*** directory (use -r) ***') diff --git a/Lib/pdb.py b/Lib/pdb.py index 931a039446187..081023526c0ea 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -474,7 +474,7 @@ def _complete_location(self, text, line, begidx, endidx): except Exception: ret = [] # Then, try to complete file names as well. - globs = glob.glob(text + '*') + globs = glob.glob(glob.escape(text) + '*') for fn in globs: if os.path.isdir(fn): ret.append(fn + '/') diff --git a/Lib/sndhdr.py b/Lib/sndhdr.py index 594353136f5c3..96595c6974468 100644 --- a/Lib/sndhdr.py +++ b/Lib/sndhdr.py @@ -241,7 +241,7 @@ def testall(list, recursive, toplevel): if recursive or toplevel: print('recursing down:') import glob - names = glob.glob(os.path.join(filename, '*')) + names = glob.glob(os.path.join(glob.escape(filename), '*')) testall(names, recursive, 0) else: print('*** directory (use -r) ***') diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 87f5044148fbe..8626aa37c186e 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -4222,7 +4222,7 @@ class _TestImportStar(unittest.TestCase): def get_module_names(self): import glob folder = os.path.dirname(multiprocessing.__file__) - pattern = os.path.join(folder, '*.py') + pattern = os.path.join(glob.escape(folder), '*.py') files = glob.glob(pattern) modules = [os.path.splitext(os.path.split(f)[1])[0] for f in files] modules = ['multiprocessing.' + m for m in modules] diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 95b4856c8bed7..adf31cc94940d 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -602,7 +602,7 @@ def create_temp_dir(self): def cleanup(self): import glob - path = os.path.join(self.tmp_dir, 'test_python_*') + path = os.path.join(glob.escape(self.tmp_dir), 'test_python_*') print("Cleanup %s directory" % self.tmp_dir) for name in glob.glob(path): if os.path.isdir(name): diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 937766b8ce725..fb09e0623e590 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2625,7 +2625,7 @@ def _platform_specific(self): dll, os.path.join(dest_dir, os.path.basename(dll)) )) - for runtime in glob.glob(os.path.join(src_dir, "vcruntime*.dll")): + for runtime in glob.glob(os.path.join(glob.escape(src_dir), "vcruntime*.dll")): self._also_link.append(( runtime, os.path.join(dest_dir, os.path.basename(runtime)) diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index eb2f72ee4a5d3..2591f0a6ac40e 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -69,7 +69,7 @@ class BaseTest(unittest.TestCase): # simply use the bigger test data for all tests. test_size = 0 BIG_TEXT = bytearray(128*1024) - for fname in glob.glob(os.path.join(os.path.dirname(__file__), '*.py')): + for fname in glob.glob(os.path.join(glob.escape(os.path.dirname(__file__)), '*.py')): with open(fname, 'rb') as fh: test_size += fh.readinto(memoryview(BIG_TEXT)[test_size:]) if test_size > 128*1024: diff --git a/Lib/test/test_crashers.py b/Lib/test/test_crashers.py index 58dfd001da362..31b712028f8a1 100644 --- a/Lib/test/test_crashers.py +++ b/Lib/test/test_crashers.py @@ -11,7 +11,7 @@ from test.support.script_helper import assert_python_failure CRASHER_DIR = os.path.join(os.path.dirname(__file__), "crashers") -CRASHER_FILES = os.path.join(CRASHER_DIR, "*.py") +CRASHER_FILES = os.path.join(glob.escape(CRASHER_DIR), "*.py") infinite_loops = ["infinite_loop_re.py", "nasty_eq_vs_dict.py"] diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py index 1db3bef6f4136..571da973aab0e 100644 --- a/Lib/test/test_dbm.py +++ b/Lib/test/test_dbm.py @@ -33,7 +33,7 @@ def dbm_iterator(): def delete_files(): # we don't know the precise name the underlying database uses # so we use glob to locate all names - for f in glob.glob(_fname + "*"): + for f in glob.glob(glob.escape(_fname) + "*"): test.support.unlink(f) diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index f037821dda2ce..52f0491679f35 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -478,7 +478,7 @@ def test_dll_dependency_import(self): pyexe = os.path.join(tmp, os.path.basename(sys.executable)) shutil.copy(sys.executable, pyexe) shutil.copy(dllname, tmp) - for f in glob.glob(os.path.join(sys.prefix, "vcruntime*.dll")): + for f in glob.glob(os.path.join(glob.escape(sys.prefix), "vcruntime*.dll")): shutil.copy(f, tmp) shutil.copy(pydname, tmp2) diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 0995b1e386d00..effac97d8f9a9 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -979,7 +979,7 @@ def tearDown(self): super().tearDown() self._box.close() self._delete_recursively(self._path) - for lock_remnant in glob.glob(self._path + '.*'): + for lock_remnant in glob.glob(glob.escape(self._path) + '.*'): support.unlink(lock_remnant) def assertMailboxEmpty(self): @@ -1311,7 +1311,7 @@ def tearDown(self): super().tearDown() self._box.close() self._delete_recursively(self._path) - for lock_remnant in glob.glob(self._path + '.*'): + for lock_remnant in glob.glob(glob.escape(self._path) + '.*'): support.unlink(lock_remnant) def test_labels(self): diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index e2fa1977ba6c7..f89b1af7743fb 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -559,7 +559,7 @@ def test_finds_expected_number_of_tests(self): args = ['-Wd', '-E', '-bb', '-m', 'test.regrtest', '--list-tests'] output = self.run_python(args) rough_number_of_tests_found = len(output.splitlines()) - actual_testsuite_glob = os.path.join(os.path.dirname(__file__), + actual_testsuite_glob = os.path.join(glob.escape(os.path.dirname(__file__)), 'test*.py') rough_counted_test_py_files = len(glob.glob(actual_testsuite_glob)) # We're not trying to duplicate test finding logic in here, diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 1bbc6979368db..9a047fd4669d1 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -526,7 +526,7 @@ def test_startup_imports(self): # found in sys.path (see site.addpackage()). Skip the test if at least # one .pth file is found. for path in isolated_paths: - pth_files = glob.glob(os.path.join(path, "*.pth")) + pth_files = glob.glob(os.path.join(glob.escape(path), "*.pth")) if pth_files: self.skipTest(f"found {len(pth_files)} .pth files in: {path}") diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 4c90092893a22..6de7aa87bb2f9 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -1605,7 +1605,7 @@ def test_random_files(self): import glob, random fn = support.findfile("tokenize_tests.txt") tempdir = os.path.dirname(fn) or os.curdir - testfiles = glob.glob(os.path.join(tempdir, "test*.py")) + testfiles = glob.glob(os.path.join(glob.escape(tempdir), "test*.py")) # Tokenize is broken on test_pep3131.py because regular expressions are # broken on the obscure unicode identifiers in it. *sigh* diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py index b16e4c5b3bd61..e8feb42c6b0c2 100644 --- a/Lib/test/test_unicode_file.py +++ b/Lib/test/test_unicode_file.py @@ -40,7 +40,7 @@ def _do_single(self, filename): self._do_copyish(filename, filename) # Filename should appear in glob output self.assertTrue( - os.path.abspath(filename)==os.path.abspath(glob.glob(filename)[0])) + os.path.abspath(filename)==os.path.abspath(glob.glob(glob.escape(filename))[0])) # basename should appear in listdir. path, base = os.path.split(os.path.abspath(filename)) file_list = os.listdir(path) diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py index 53e0efc967a0e..cea91308ce1b3 100755 --- a/Lib/webbrowser.py +++ b/Lib/webbrowser.py @@ -413,7 +413,7 @@ def _find_grail_rc(self): tempdir = os.path.join(tempfile.gettempdir(), ".grail-unix") user = pwd.getpwuid(os.getuid())[0] - filename = os.path.join(tempdir, user + "-*") + filename = os.path.join(glob.escape(tempdir), glob.escape(user) + "-*") maybes = glob.glob(filename) if not maybes: return None diff --git a/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst b/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst new file mode 100644 index 0000000000000..9c6020eb8d738 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst @@ -0,0 +1,2 @@ +Fixed the use of :func:`~glob.glob` in the stdlib: literal part of the path +is now always correctly escaped. diff --git a/Tools/c-globals/check-c-globals.py b/Tools/c-globals/check-c-globals.py index e68ed9271fe48..1371f92742327 100644 --- a/Tools/c-globals/check-c-globals.py +++ b/Tools/c-globals/check-c-globals.py @@ -37,7 +37,9 @@ def find_capi_vars(root): capi_vars = {} for dirname in SOURCE_DIRS: - for filename in glob.glob(os.path.join(ROOT_DIR, dirname, '**/*.[hc]'), + for filename in glob.glob(os.path.join( + glob.escape(os.path.join(ROOT_DIR, dirname)), + '**/*.[hc]'), recursive=True): with open(filename) as file: for name in _find_capi_vars(file): diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index d60f352882e30..c39e38c5069d5 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -39,7 +39,7 @@ def parse_error_codes(h_file, prefix, libcode): f = sys.stdout if use_stdout else open(outfile, "w") # mnemonic -> (library code, error prefix, header file) error_libraries = {} - for error_header in glob.glob(os.path.join(openssl_inc, 'include/openssl/*err.h')): + for error_header in glob.glob(os.path.join(glob.escape(openssl_inc), 'include/openssl/*err.h')): base = os.path.basename(error_header) if base in ('buffererr.h', 'objectserr.h', 'storeerr.h'): # Deprecated in 3.0. diff --git a/setup.py b/setup.py index b168ed4082fd3..6340669fffdff 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ import re import sys import sysconfig -from glob import glob +from glob import glob, escape from distutils import log from distutils.command.build_ext import build_ext @@ -339,7 +339,7 @@ def build_extensions(self): # Python header files headers = [sysconfig.get_config_h_filename()] - headers += glob(os.path.join(sysconfig.get_path('include'), "*.h")) + headers += glob(os.path.join(escape(sysconfig.get_path('include')), "*.h")) # The sysconfig variables built by makesetup that list the already # built modules and the disabled modules as configured by the Setup @@ -2256,7 +2256,7 @@ def detect_hash_builtins(self): self.add(Extension('_sha1', ['sha1module.c'], depends=['hashlib.h'])) - blake2_deps = glob(os.path.join(self.srcdir, + blake2_deps = glob(os.path.join(escape(self.srcdir), 'Modules/_blake2/impl/*')) blake2_deps.append('hashlib.h') @@ -2266,7 +2266,7 @@ def detect_hash_builtins(self): '_blake2/blake2s_impl.c'], depends=blake2_deps)) - sha3_deps = glob(os.path.join(self.srcdir, + sha3_deps = glob(os.path.join(escape(self.srcdir), 'Modules/_sha3/kcp/*')) sha3_deps.append('hashlib.h') self.add(Extension('_sha3', From webhook-mailer at python.org Thu Jul 2 03:07:20 2020 From: webhook-mailer at python.org (Christian Heimes) Date: Thu, 02 Jul 2020 07:07:20 -0000 Subject: [Python-checkins] bpo-41183: Update test certs and keys (#21258) Message-ID: https://github.com/python/cpython/commit/d565be84993a3d618add139cf21038e12c60a13e commit: d565be84993a3d618add139cf21038e12c60a13e branch: 3.5 author: Christian Heimes committer: GitHub date: 2020-07-02T00:07:15-07:00 summary: bpo-41183: Update test certs and keys (#21258) Manual backport of bpo-34542, GH-8997 and commit 1da2b23504a68ed0432aa74a17ec2533933f5af8 to Python 3.5. Signed-off-by: Christian Heimes files: A Misc/NEWS.d/next/Library/2020-07-01-16-59-46.bpo-41183.9stVAW.rst M Lib/test/allsans.pem M Lib/test/keycert.passwd.pem M Lib/test/keycert.pem M Lib/test/keycert2.pem M Lib/test/keycert3.pem M Lib/test/keycert4.pem M Lib/test/make_ssl_certs.py M Lib/test/pycacert.pem M Lib/test/pycakey.pem M Lib/test/revocation.crl M Lib/test/ssl_cert.pem M Lib/test/ssl_key.passwd.pem M Lib/test/ssl_key.pem M Lib/test/test_asyncio/test_events.py M Lib/test/test_ssl.py diff --git a/Lib/test/allsans.pem b/Lib/test/allsans.pem index 3ee4f59513abf..6eebde7a57f15 100644 --- a/Lib/test/allsans.pem +++ b/Lib/test/allsans.pem @@ -1,37 +1,81 @@ -----BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOoy7/QOtTjQ0niE -6uDcTwtkC0R2Tvy1AjVnXohCntZfdzbTGDoYTgXSOLsP8A697jUiJ8VCePGH50xG -Z4DKnAF3a9O3a9nr2pLXb0iY3XOMv+YEBii7CfI+3oxFYgCl0sMgHzDD2ZTVYAsm -DWgLUVsE2gHEccRwrM2tPf2EgR+FAgMBAAECgYEA3qyfyYVSeTrTYxO93x6ZaVMu -A2IZp9zSxMQL9bKiI2GRj+cV2ebSCGbg2btFnD6qBor7FWsmYz+8g6FNN/9sY4az -61rMqMtQvLBe+7L8w70FeTze4qQ4Y1oQri0qD6tBWhDVlpnbI5Py9bkZKD67yVUk -elcEA/5x4PrYXkuqsAECQQD80NjT0mDvaY0JOOaQFSEpMv6QiUA8GGX8Xli7IoKb -tAolPG8rQBa+qSpcWfDMTrWw/aWHuMEEQoP/bVDH9W4FAkEA7SYQbBAKnojZ5A3G -kOHdV7aeivRQxQk/JN8Fb8oKB9Csvpv/BsuGxPKXHdhFa6CBTTsNRtHQw/szPo4l -xMIjgQJAPoMxqibR+0EBM6+TKzteSL6oPXsCnBl4Vk/J5vPgkbmR7KUl4+7j8N8J -b2554TrxKEN/w7CGYZRE6UrRd7ATNQJAWD7Yz41sli+wfPdPU2xo1BHljyl4wMk/ -EPZYbI/PCbdyAH/F935WyQTIjNeEhZc1Zkq6FwdOWw8ns3hrv3rKgQJAHXv1BqUa -czGPIFxX2TNoqtcl6/En4vrxVB1wzsfzkkDAg98kBl7qsF+S3qujSzKikjeaVbI2 -/CyWR2P3yLtOmA== +MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCg/pM6dP7BTFNc +qe6wIJIBB7HjwL42bp0vjcCVl4Z3MRWFswYpfxy+o+8+PguMp4K6zndA5fwNkK/H +3HmtanncUfPqnV0usN0NHQGh/f9xRoNmB1q2L7kTuO99o0KLQgvonRT2snf8rq9n +tPRzhHUGYhog7zzNxetYV309PHpPr19BcKepDtM5RMk2aBnoN5vtItorjXiDosFm +6o5wQHrcupcVydszba6P75BEbc1XIWvq2Fv8muaw4pCe81QYINyLqgcPNO/nF3Os +5EI4HKjCNRSCOhOcWqYctXLXN9lBdMBBvQc3zDmYzh1eIZewzZXPVEQT33xPkhxz +HNmhcIctpWX4LTRF6FulkcbeuZDga3gkZYJf/M6IpU1WYXr6q8sNxbgmRRX/NuHo +V9oDwBzLG07rKUiqRHfjGqoCRmmVeVYpryvXUNjHGH0nlVzz/8lTUxAnJorO3Fdc +I+6zKLUPICdAlvz51AH6yopgPFhrdgA0pVzPO6L5G8SRQCxKhAUCAwEAAQKCAYAa +2jtOTcNMFGH3G7TfFZ+kolbuaPCQ/aQkEV2k1dAswzgWw8RsWXI+7fLyi8C7Zhks +9VD4tyNyU8at7D0zSoYm1Fh9sl+fcQp9rG/gSBA6IYu7EdD0gEM7YeY4K2nm9k4s +Lz8W4q+WqsBA6PK47cfjF6vKAH1AyRk28+jEtPiln9egf5zHWtyqOanh9D0V+Wh9 +hgmjqAYI1rWxZ7/4Qxj7Bfg7Px7blhi+kzOZ5kKQnNd2JT46hM+jgzah/G3zVE+R +FFW6ksmJgZ+dCuSbE7HEJmKms1CWq/1Cll0A3uy4JTDZOrK4KcZQ9UjjWJWvlXQm +uNXSSAp1k287DLVUm9c22SDeXpb9PyKmzyvJvVmMqqBx6QzHZ/L7WPzpUWAoLcU+ +ZHT7vggDymkIO+fcRbUzv8s5R7RnLbcBga51/5OCUvAWDoJXNw0qwYZOIbfTnQgs +8xbCmbMzllyYM/dK3GxQAwfn8Hzk+DbS/NObMjHLCWLfYeUvutXJSNly6Ny+ZcEC +gcEAzo5Y1UFOfBX4MZLIZ69LfgaXj9URobMwqlEwKil8pWQMa951ga3moLt91nOe +SAQz3meFTBX/VAb2ZHLeIf3FoNkiIx48PkxsR/hhLHpvl26zEg3yXs3tv0IFBx2R +EEnLNpQaAQFR9S1yDOaG2rsb17ZDKyp9isDpAENHAmEnT/XJn+Dc0SOH1EVDjUeM +JqToAF/fjIx/RF4oUJCAgOPBMlRy5ywLQk8uDi6ft0NCzzCi0eCuk1Ty3KzWFGwx +7cYRAoHBAMeIPCzHG3No4JGUFunslVwo5TuC7maO6qYKbq0OyvwWfL4b7gjrMBR9 +d5WyZlp/Vf40O463dg8x8qPNOFWp49f3hxTvvfnt2/m3+CQuDOLfqBbHufZApP1J +U9MubUNnDFHHeJ9l0tg2nhiLw24GHeMARZhA/BimMQPY0OpZPpLVxAUArM2EB7hI +glQpYCtdXhqwl1pl0u3TZ08y3BXYNg9BycdpGRMWSsAwsApJRgNuI/dfDKu0uMYF +/pUhXVPatQKBwGgLpAun3dT7bA3sli5ESo6s22OEPGFrVbQ1OUHDrBnTj742TJKJ ++oY0a2q+ypgUJdx94NM2sWquJybqBaKxpf8j4OI3tLjc3h5SqwAwnE13YZRSmifP +K1cP9mBjMFM4GLjhWUfwVkxeG/kLlhpP7fJ2yNbRjHN8QOH1AavdLGRGts1mA1UF +xMHUMfbUd3Bv2L13ja/KhcD2fPA4GcLS9tpXV5nCwdkg8V4LdkBmDR04rotx1f44 +6Czokt2usmfHQQKBwFkufxbUd2SB/72Rnxw27hse/DY5My0Lu70y9HzNG9TIiEDA +YwgBdp/x5D04W58fQuQ3nFcRkOcBwB2OYBuJr5ibvfiRnyvSMHvQykwBeSj+Jjbo +VinGgvfiimDdY2C48jyrFzLHZBHXd5oo/dRzT3Bicri2cvbhcQ7zHY1hDiK7AL3r +q1DALmMjpXzQcXdwZ9suCrgQwtIhpw8zAEOTO7ZeBT3nr5lkYUy9djFixrRJyjGK +fjNQtzVrAHrPStNr8QKBwQDCC0zhsCnTv4sAJmW7LL6Ayd5rbWhUZ6px1xY0yHMA +hehj+xbaiC6cfVr5Rg0ncvaa8AExu4kXpVsupTyNwvC4NgzLHtfBw6WUdOnd1awE +kSrDtDReBt2wByAcQwttQsrJ1/Pt6zcNJJI4Z9s8G4NTcQWJwUhU20N55JQKR//l +OQJqhq9NVhte/ctDjVwOHs/OhDNvxsAWxdjnf/O2up0os+M2bFkmHuaVW0vQbqTQ +mw7Vbzk2Ff5oT6E3kbC8Ur4= -----END PRIVATE KEY----- -----BEGIN CERTIFICATE----- -MIIDcjCCAtugAwIBAgIJAN5dc9TOWjB7MA0GCSqGSIb3DQEBCwUAMF0xCzAJBgNV +MIIHMDCCBZigAwIBAgIJALVVA6v9zJS5MA0GCSqGSIb3DQEBCwUAMF0xCzAJBgNV BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEDAOBgNVBAMMB2FsbHNhbnMwHhcNMTYwODA1 -MTAyMTExWhcNMjYwODAzMTAyMTExWjBdMQswCQYDVQQGEwJYWTEXMBUGA1UEBwwO +IFNvZnR3YXJlIEZvdW5kYXRpb24xEDAOBgNVBAMMB2FsbHNhbnMwHhcNMTgwODI5 +MTQyMzE3WhcNMjgwODI2MTQyMzE3WjBdMQswCQYDVQQGEwJYWTEXMBUGA1UEBwwO Q2FzdGxlIEFudGhyYXgxIzAhBgNVBAoMGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0 -aW9uMRAwDgYDVQQDDAdhbGxzYW5zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB -gQDqMu/0DrU40NJ4hOrg3E8LZAtEdk78tQI1Z16IQp7WX3c20xg6GE4F0ji7D/AO -ve41IifFQnjxh+dMRmeAypwBd2vTt2vZ69qS129ImN1zjL/mBAYouwnyPt6MRWIA -pdLDIB8ww9mU1WALJg1oC1FbBNoBxHHEcKzNrT39hIEfhQIDAQABo4IBODCCATQw -ggEwBgNVHREEggEnMIIBI4IHYWxsc2Fuc6AeBgMqAwSgFwwVc29tZSBvdGhlciBp -ZGVudGlmaWVyoDUGBisGAQUCAqArMCmgEBsOS0VSQkVST1MuUkVBTE2hFTAToAMC -AQGhDDAKGwh1c2VybmFtZYEQdXNlckBleGFtcGxlLm9yZ4IPd3d3LmV4YW1wbGUu -b3JnpGcwZTELMAkGA1UEBhMCWFkxFzAVBgNVBAcMDkNhc3RsZSBBbnRocmF4MSMw -IQYDVQQKDBpQeXRob24gU29mdHdhcmUgRm91bmRhdGlvbjEYMBYGA1UEAwwPZGly -bmFtZSBleGFtcGxlhhdodHRwczovL3d3dy5weXRob24ub3JnL4cEfwAAAYcQAAAA -AAAAAAAAAAAAAAAAAYgEKgMEBTANBgkqhkiG9w0BAQsFAAOBgQAy16h+F+nOmeiT -VWR0fc8F/j6FcadbLseAUaogcC15OGxCl4UYpLV88HBkABOoGCpP155qwWTwOrdG -iYPGJSusf1OnJEbvzFejZf6u078bPd9/ZL4VWLjv+FPGkjd+N+/OaqMvgj8Lu99f -3Y/C4S7YbHxxwff6C6l2Xli+q6gnuQ== +aW9uMRAwDgYDVQQDDAdhbGxzYW5zMIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB +igKCAYEAoP6TOnT+wUxTXKnusCCSAQex48C+Nm6dL43AlZeGdzEVhbMGKX8cvqPv +Pj4LjKeCus53QOX8DZCvx9x5rWp53FHz6p1dLrDdDR0Bof3/cUaDZgdati+5E7jv +faNCi0IL6J0U9rJ3/K6vZ7T0c4R1BmIaIO88zcXrWFd9PTx6T69fQXCnqQ7TOUTJ +NmgZ6Deb7SLaK414g6LBZuqOcEB63LqXFcnbM22uj++QRG3NVyFr6thb/JrmsOKQ +nvNUGCDci6oHDzTv5xdzrORCOByowjUUgjoTnFqmHLVy1zfZQXTAQb0HN8w5mM4d +XiGXsM2Vz1REE998T5IccxzZoXCHLaVl+C00RehbpZHG3rmQ4Gt4JGWCX/zOiKVN +VmF6+qvLDcW4JkUV/zbh6FfaA8AcyxtO6ylIqkR34xqqAkZplXlWKa8r11DYxxh9 +J5Vc8//JU1MQJyaKztxXXCPusyi1DyAnQJb8+dQB+sqKYDxYa3YANKVczzui+RvE +kUAsSoQFAgMBAAGjggLxMIIC7TCCATAGA1UdEQSCAScwggEjggdhbGxzYW5zoB4G +AyoDBKAXDBVzb21lIG90aGVyIGlkZW50aWZpZXKgNQYGKwYBBQICoCswKaAQGw5L +RVJCRVJPUy5SRUFMTaEVMBOgAwIBAaEMMAobCHVzZXJuYW1lgRB1c2VyQGV4YW1w +bGUub3Jngg93d3cuZXhhbXBsZS5vcmekZzBlMQswCQYDVQQGEwJYWTEXMBUGA1UE +BwwOQ2FzdGxlIEFudGhyYXgxIzAhBgNVBAoMGlB5dGhvbiBTb2Z0d2FyZSBGb3Vu +ZGF0aW9uMRgwFgYDVQQDDA9kaXJuYW1lIGV4YW1wbGWGF2h0dHBzOi8vd3d3LnB5 +dGhvbi5vcmcvhwR/AAABhxAAAAAAAAAAAAAAAAAAAAABiAQqAwQFMA4GA1UdDwEB +/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/ +BAIwADAdBgNVHQ4EFgQUoLHAHNTWrHkSCUYkhn5NH0S40CAwgY8GA1UdIwSBhzCB +hIAUoLHAHNTWrHkSCUYkhn5NH0S40CChYaRfMF0xCzAJBgNVBAYTAlhZMRcwFQYD +VQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZv +dW5kYXRpb24xEDAOBgNVBAMMB2FsbHNhbnOCCQC1VQOr/cyUuTCBgwYIKwYBBQUH +AQEEdzB1MDwGCCsGAQUFBzAChjBodHRwOi8vdGVzdGNhLnB5dGhvbnRlc3QubmV0 +L3Rlc3RjYS9weWNhY2VydC5jZXIwNQYIKwYBBQUHMAGGKWh0dHA6Ly90ZXN0Y2Eu +cHl0aG9udGVzdC5uZXQvdGVzdGNhL29jc3AvMEMGA1UdHwQ8MDowOKA2oDSGMmh0 +dHA6Ly90ZXN0Y2EucHl0aG9udGVzdC5uZXQvdGVzdGNhL3Jldm9jYXRpb24uY3Js +MA0GCSqGSIb3DQEBCwUAA4IBgQAeKJKycO2DES98gyR2e/GzPYEw87cCS0cEpiiP +3CEUgzfEbF0X89GDKEey4H3Irvosbvt2hEcf2RNpahLUL/fUv53bDmHNmL8qJg5E +UJVMOHvOpSOjqoqeRuSyG0GnnAuUwcxdrZY6UzLdslhuq9F8UjgHr6KSMx56G9uK +LmTy5njMab0in2xL/YRX/0nogK3BHqpUHrfCdEYZkciRxtAa+OPpWn4dcZi+Fpf7 +ZYSgPLNt+djtFDMIAk5Bo+XDaQdW3dhF0w44enrGAOV0xPE+/jOuenNhKBafjuNb +lkeSr45+QZsi1rd18ny8z3uuaGqIAziFgmllZOH2D8giTn6+5jZcCNZCoGKUkPI9 +l/GMWwxg4HQYYlZcsZzTCem9Rb2XcrasAbmhFapMtR+QAwSed5vKE7ZdtQhj74kB +7Q0E7Lkgpp6BaObb2As8/f0K/UlSVSvrYk+i3JT9wK/qqkRGxsTFEF7N9t0rKu8y +4JdQDtZCI552MsFvYW6m+IOYgxg= -----END CERTIFICATE----- diff --git a/Lib/test/keycert.passwd.pem b/Lib/test/keycert.passwd.pem index e90574881db54..c330c36d8f9fd 100644 --- a/Lib/test/keycert.passwd.pem +++ b/Lib/test/keycert.passwd.pem @@ -1,33 +1,69 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,1A8D9D2A02EC698A - -kJYbfZ8L0sfe9Oty3gw0aloNnY5E8fegRfQLZlNoxTl6jNt0nIwI8kDJ36CZgR9c -u3FDJm/KqrfUoz8vW+qEnWhSG7QPX2wWGPHd4K94Yz/FgrRzZ0DoK7XxXq9gOtVA -AVGQhnz32p+6WhfGsCr9ArXEwRZrTk/FvzEPaU5fHcoSkrNVAGX8IpSVkSDwEDQr -Gv17+cfk99UV1OCza6yKHoFkTtrC+PZU71LomBabivS2Oc4B9hYuSR2hF01wTHP+ -YlWNagZOOVtNz4oKK9x9eNQpmfQXQvPPTfusexKIbKfZrMvJoxcm1gfcZ0H/wK6P -6wmXSG35qMOOztCZNtperjs1wzEBXznyK8QmLcAJBjkfarABJX9vBEzZV0OUKhy+ -noORFwHTllphbmydLhu6ehLUZMHPhzAS5UN7srtpSN81eerDMy0RMUAwA7/PofX1 -94Me85Q8jP0PC9ETdsJcPqLzAPETEYu0ELewKRcrdyWi+tlLFrpE5KT/s5ecbl9l -7B61U4Kfd1PIXc/siINhU3A3bYK+845YyUArUOnKf1kEox7p1RpD7yFqVT04lRTo -cibNKATBusXSuBrp2G6GNuhWEOSafWCKJQAzgCYIp6ZTV2khhMUGppc/2H3CF6cO -zX0KtlPVZC7hLkB6HT8SxYUwF1zqWY7+/XPPdc37MeEZ87Q3UuZwqORLY+Z0hpgt -L5JXBCoklZhCAaN2GqwFLXtGiRSRFGY7xXIhbDTlE65Wv1WGGgDLMKGE1gOz3yAo -2jjG1+yAHJUdE69XTFHSqSkvaloA1W03LdMXZ9VuQJ/ySXCie6ABAQ== ------END RSA PRIVATE KEY----- +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIHbTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIhD+rJdxqb6ECAggA +MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBDTdyjCP3riOSUfxix4aXEvBIIH +ECGkbsFabrcFMZcplw5jHMaOlG7rYjUzwDJ80JM8uzbv2Jb8SvNlns2+xmnEvH/M +mNvRmnXmplbVjH3XBMK8o2Psnr2V/a0j7/pgqpRxHykG+koOY4gzdt3MAg8JPbS2 +hymSl+Y5EpciO3xLfz4aFL1ZNqspQbO/TD13Ij7DUIy7xIRBMp4taoZCrP0cEBAZ ++wgu9m23I4dh3E8RUBzWyFFNic2MVVHrui6JbHc4dIHfyKLtXJDhUcS0vIC9PvcV +jhorh3UZC4lM+/jjXV5AhzQ0VrJ2tXAUX2dA144XHzkSH2QmwfnajPsci7BL2CGC +rjyTy4NfB/lDwU+55dqJZQSKXMxAapJMrtgw7LD5CKQcN6zmfhXGssJ7HQUXKkaX +I1YOFzuUD7oo56BVCnVswv0jX9RxrE5QYNreMlOP9cS+kIYH65N+PAhlURuQC14K +PgDkHn5knSa2UQA5tc5f7zdHOZhGRUfcjLP+KAWA3nh+/2OKw/X3zuPx75YT/FKe +tACPw5hjEpl62m9Xa0eWepZXwqkIOkzHMmCyNCsbC0mmRoEjmvfnslfsmnh4Dg/c +4YsTYMOLLIeCa+WIc38aA5W2lNO9lW0LwLhX1rP+GRVPv+TVHXlfoyaI+jp0iXrJ +t3xxT0gaiIR/VznyS7Py68QV/zB7VdqbsNzS7LdquHK1k8+7OYiWjY3gqyU40Iu2 +d1eSnIoDvQJwyYp7XYXbOlXNLY+s1Qb7yxcW3vXm0Bg3gKT8r1XHWJ9rj+CxAn5r +ysfkPs1JsesxzzQjwTiDNvHnBnZnwxuxfBr26ektEHmuAXSl8V6dzLN/aaPjpTj4 +CkE7KyqX3U9bLkp+ztl4xWKEmW44nskzm0+iqrtrxMyTfvvID4QrABjZL4zmWIqc +e3ZfA3AYk9VDIegk/YKGC5VZ8YS7ZXQ0ASK652XqJ7QlMKTxxV7zda6Fp4uW6/qN +ezt5wgbGGhZQXj2wDQmWNQYyG/juIgYTpCUA54U5XBIjuR6pg+Ytm0UrvNjsUoAC +wGelyqaLDq8U8jdIFYVTJy9aJjQOYXjsUJ0dZN2aGHSlju0ZGIZc49cTIVQ9BTC5 +Yc0Vlwzpl+LuA25DzKZNSb/ci0lO/cQGJ2uXQQgaNgdsHlu8nukENGJhnIzx4fzK +wEh3yHxhTRCzPPwDfXmx0IHXrPqJhSpAgaXBVIm8OjvmMxO+W75W4uLfNY/B7e2H +3cjklGuvkofOf7sEOrGUYf4cb6Obg8FpvHgpKo5Twwmoh/qvEKckBFqNhZXDDl88 +GbGlSEgyaAV1Ig8s1NJKBolWFa0juyPAwJ8vT1T4iwW7kQ7KXKt2UNn96K/HxkLu +pikvukz8oRHMlfVHa0R48UB1fFHwZLzPmwkpu6ancIxk3uO3yfhf6iDk3bmnyMlz +g3k/b6MrLYaOVByRxay85jH3Vvgqfgn6wa6BJ7xQ81eZ8B45gFuTH0J5JtLL7SH8 +darRPLCYfA+Ums9/H6pU5EXfd3yfjMIbvhCXHkJrrljkZ+th3p8dyto6wmYqIY6I +qR9sU+o6DhRaiP8tCICuhHxQpXylUM6WeJkJwduTJ8KWIvzsj4mReIKOl/oC2jSd +gIdKhb9Q3zj9ce4N5m6v66tyvjxGZ+xf3BvUPDD+LwZeXgf7OBsNVbXzQbzto594 +nbCzPocFi3gERE50ru4K70eQCy08TPG5NpOz+DDdO5vpAuMLYEuI7O3L+3GjW40Q +G5bu7H5/i7o/RWR67qhG/7p9kPw3nkUtYgnvnWaPMIuTfb4c2d069kjlfgWjIbbI +tpSKmm5DHlqTE4/ECAbIEDtSaw9dXHCdL3nh5+n428xDdGbjN4lT86tfu17EYKzl +ydH1RJ1LX3o3TEj9UkmDPt7LnftvwybMFEcP7hM2xD4lC++wKQs7Alg6dTkBnJV4 +5xU78WRntJkJTU7kFkpPKA0QfyCuSF1fAMoukDBkqUdOj6jE0BlJQlHk5iwgnJlt +uEdkTjHZEjIUxWC6llPcAzaPNlmnD45AgfEW+Jn21IvutmJiQAz5lm9Z9PXaR0C8 +hXB6owRY67C0YKQwXhoNf6xQun2xGBGYy5rPEEezX1S1tUH5GR/KW1Lh+FzFqHXI +ZEb5avfDqHKehGAjPON+Br7akuQ125M9LLjKuSyPaQzeeCAy356Xd7XzVwbPddbm +9S9WSPqzaPgh10chIHoNoC8HMd33dB5j9/Q6jrbU/oPlptu/GlorWblvJdcTuBGI +IVn45RFnkG8hCz0GJSNzW7+70YdESQbfJW79vssWMaiSjFE0pMyFXrFR5lBywBTx +PiGEUWtvrKG94X1TMlGUzDzDJOQNZ9dT94bonNe9pVmP5BP4/DzwwiWh6qrzWk6p +j8OE4cfCSh2WvHnhJbH7/N0v+JKjtxeIeJ16jx/K2oK5 +-----END ENCRYPTED PRIVATE KEY----- -----BEGIN CERTIFICATE----- -MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw -MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH -Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k -YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 -6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt -pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw -FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd -BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G -lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 -CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX +MIIEWTCCAsGgAwIBAgIJAJinz4jHSjLtMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV +BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u +IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODA4 +MjkxNDIzMTVaFw0yODA4MjYxNDIzMTVaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH +DA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5k +YXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDCCAaIwDQYJKoZIhvcNAQEBBQADggGP +ADCCAYoCggGBALKUqUtopT6E68kN+uJNEt34i2EbmG/bwjcD8IaMsgJPSsMO2Bpd +3S6qWgkCeOyCfmAwBxK2kNbxGb63ouysEv7l8GCTJTWv3hG/HQcejJpnAEGi6K1U +fDbyE/db6yZ12SoHVTGkadN4vYGCPd1Wj9ZO1F877SHQ8rDWX3xgTWkxN2ojBw44 +T8RHSDiG8D/CvG4uEy+VUszL+Uvny5y2poNSqvI3J56sptWSrh8nIIbkPZPBdUne +LYMOHTFK3ZjXSmhlXgziTxK71nnzM3Y9K9gxPnRqoXbvu/wFo55hQCkETiRkYgmm +jXcBMZ0TClQVnQWuLjMthRnWFZs4Lfmwqjs7FZD/61581R2BYehvpWbLvvuOJhwv +DFzexL2sXcAl7SsxbzeQKRHqGbIDfbnQTXfs3/VC6Ye5P82P2ucj+XC32N9piRmO +gCBP8L3ub+YzzdxikZN2gZXXE2jsb3QyE/R2LkWdWyshpKe+RsZP1SBRbHShUyOh +yJ90baoiEwj2mwIDAQABoxgwFjAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZI +hvcNAQELBQADggGBAHRUO/UIHl3jXQENewYayHxkIx8t7nu40iO2DXbicSijz5bo +5//xAB6RxhBAlsDBehgQP1uoZg+WJW+nHu3CIVOU3qZNZRaozxiCl2UFKcNqLOmx +R3NKpo1jYf4REQIeG8Yw9+hSWLRbshNteP6bKUUf+vanhg9+axyOEOH/iOQvgk/m +b8wA8wNa4ujWljPbTQnj7ry8RqhTM0GcAN5LSdSvcKcpzLcs3aYwh+Z8e30sQWna +F40sa5u7izgBTOrwpcDm/w5kC46vpRQ5fnbshVw6pne2by0mdMECASid/p25N103 +jMqTFlmO7kpf/jpCSmamp3/JSEE1BJKHwQ6Ql4nzRA2N1mnvWH7Zxcv043gkHeAu +0x8evpvwuhdIyproejNFlBpKmW8OX7yKTCPPMC/VkX8Q1rVkxU0DQ6hmvwZlhoKa +9Wc2uXpw9xF8itV4Uvcdr3dwqByvIqn7iI/gB+4l41e0u8OmH2MKOx4Nxlly5TNW +HcVKQHyOeyvnINuBAQ== -----END CERTIFICATE----- + diff --git a/Lib/test/keycert.pem b/Lib/test/keycert.pem index 64318aa2e03a6..0d398633739a5 100644 --- a/Lib/test/keycert.pem +++ b/Lib/test/keycert.pem @@ -1,31 +1,66 @@ -----BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm -LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 -ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP -USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt -CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq -SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK -UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y -BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ -ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 -oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik -eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F -0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS -x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ -SPIXQuT8RMPDVNQ= +MIIG/wIBADANBgkqhkiG9w0BAQEFAASCBukwggblAgEAAoIBgQCylKlLaKU+hOvJ +DfriTRLd+IthG5hv28I3A/CGjLICT0rDDtgaXd0uqloJAnjsgn5gMAcStpDW8Rm+ +t6LsrBL+5fBgkyU1r94Rvx0HHoyaZwBBouitVHw28hP3W+smddkqB1UxpGnTeL2B +gj3dVo/WTtRfO+0h0PKw1l98YE1pMTdqIwcOOE/ER0g4hvA/wrxuLhMvlVLMy/lL +58uctqaDUqryNyeerKbVkq4fJyCG5D2TwXVJ3i2DDh0xSt2Y10poZV4M4k8Su9Z5 +8zN2PSvYMT50aqF277v8BaOeYUApBE4kZGIJpo13ATGdEwpUFZ0Fri4zLYUZ1hWb +OC35sKo7OxWQ/+tefNUdgWHob6Vmy777jiYcLwxc3sS9rF3AJe0rMW83kCkR6hmy +A3250E137N/1QumHuT/Nj9rnI/lwt9jfaYkZjoAgT/C97m/mM83cYpGTdoGV1xNo +7G90MhP0di5FnVsrIaSnvkbGT9UgUWx0oVMjocifdG2qIhMI9psCAwEAAQKCAYBT +sHmaPmNaZj59jZCqp0YVQlpHWwBYQ5vD3pPE6oCttm0p9nXt/VkfenQRTthOtmT1 +POzDp00/feP7zeGLmqSYUjgRekPw4gdnN7Ip2PY5kdW77NWwDSzdLxuOS8Rq1MW9 +/Yu+ZPe3RBlDbT8C0IM+Atlh/BqIQ3zIxN4g0pzUlF0M33d6AYfYSzOcUhibOO7H +j84r+YXBNkIRgYKZYbutRXuZYaGuqejRpBj3voVu0d3Ntdb6lCWuClpB9HzfGN0c +RTv8g6UYO4sK3qyFn90ibIR/1GB9watvtoWVZqggiWeBzSWVWRsGEf9O+Cx4oJw1 +IphglhmhbgNksbj7bD24on/icldSOiVkoUemUOFmHWhCm4PnB1GmbD8YMfEdSbks +qDr1Ps1zg4mGOinVD/4cY7vuPFO/HCH07wfeaUGzRt4g0/yLr+XjVofOA3oowyxv +JAzr+niHA3lg5ecj4r7M68efwzN1OCyjMrVJw2RAzwvGxE+rm5NiT08SWlKQZnkC +gcEA4wvyLpIur/UB84nV3XVJ89UMNBLm++aTFzld047BLJtMaOhvNqx6Cl5c8VuW +l261KHjiVzpfNM3/A2LBQJcYkhX7avkqEXlj57cl+dCWAVwUzKmLJTPjfaTTZnYJ +xeN3dMYjJz2z2WtgvfvDoJLukVwIMmhTY8wtqqYyQBJ/l06pBsfw5TNvmVIOQHds +8ASOiFt+WRLk2bl9xrGGayqt3VV93KVRzF27cpjOgEcG74F3c0ZW9snERN7vIYwB +JfrlAoHBAMlahPwMP2TYylG8OzHe7EiehTekSO26LGh0Cq3wTGXYsK/q8hQCzL14 +kWW638vpwXL6L9ntvrd7hjzWRO3vX/VxnYEA6f0bpqHq1tZi6lzix5CTUN5McpDg +QnjenSJNrNjS1zEF8WeY9iLEuDI/M/iUW4y9R6s3WpgQhPDXpSvd2g3gMGRUYhxQ +Xna8auiJeYFq0oNaOxvJj+VeOfJ3ZMJttd+Y7gTOYZcbg3SdRb/kdxYki0RMD2hF +4ZvjJ6CTfwKBwQDiMqiZFTJGQwYqp4vWEmAW+I4r4xkUpWatoI2Fk5eI5T9+1PLX +uYXsho56NxEU1UrOg4Cb/p+TcBc8PErkGqR0BkpxDMOInTOXSrQe6lxIBoECVXc3 +HTbrmiay0a5y5GfCgxPKqIJhfcToAceoVjovv0y7S4yoxGZKuUEe7E8JY2iqRNAO +yOvKCCICv/hcN235E44RF+2/rDlOltagNej5tY6rIFkaDdgOF4bD7f9O5eEni1Bg +litfoesDtQP/3rECgcEAkQfvQ7D6tIPmbqsbJBfCr6fmoqZllT4FIJN84b50+OL0 +mTGsfjdqC4tdhx3sdu7/VPbaIqm5NmX10bowWgWSY7MbVME4yQPyqSwC5NbIonEC +d6N0mzoLR0kQ+Ai4u+2g82gicgAq2oj1uSNi3WZi48jQjHYFulCbo246o1NgeFFK +77WshYe2R1ioQfQDOU1URKCR0uTaMHClgfu112yiGd12JAD+aF3TM0kxDXz+sXI5 +SKy311DFxECZeXRLpcC3AoHBAJkNMJWTyPYbeVu+CTQkec8Uun233EkXa2kUNZc/ +5DuXDaK+A3DMgYRufTKSPpDHGaCZ1SYPInX1Uoe2dgVjWssRL2uitR4ENabDoAOA +ICVYXYYNagqQu5wwirF0QeaMXo1fjhuuHQh8GsMdXZvYEaAITZ9/NG5x/oY08+8H +kr78SMBOPy3XQn964uKG+e3JwpOG14GKABdAlrHKFXNWchu/6dgcYXB87mrC/GhO +zNwzC+QhFTZoOomFoqMgFWujng== -----END PRIVATE KEY----- -----BEGIN CERTIFICATE----- -MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw -MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH -Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k -YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 -6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt -pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw -FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd -BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G -lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 -CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX +MIIEWTCCAsGgAwIBAgIJAJinz4jHSjLtMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV +BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u +IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODA4 +MjkxNDIzMTVaFw0yODA4MjYxNDIzMTVaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH +DA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5k +YXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDCCAaIwDQYJKoZIhvcNAQEBBQADggGP +ADCCAYoCggGBALKUqUtopT6E68kN+uJNEt34i2EbmG/bwjcD8IaMsgJPSsMO2Bpd +3S6qWgkCeOyCfmAwBxK2kNbxGb63ouysEv7l8GCTJTWv3hG/HQcejJpnAEGi6K1U +fDbyE/db6yZ12SoHVTGkadN4vYGCPd1Wj9ZO1F877SHQ8rDWX3xgTWkxN2ojBw44 +T8RHSDiG8D/CvG4uEy+VUszL+Uvny5y2poNSqvI3J56sptWSrh8nIIbkPZPBdUne +LYMOHTFK3ZjXSmhlXgziTxK71nnzM3Y9K9gxPnRqoXbvu/wFo55hQCkETiRkYgmm +jXcBMZ0TClQVnQWuLjMthRnWFZs4Lfmwqjs7FZD/61581R2BYehvpWbLvvuOJhwv +DFzexL2sXcAl7SsxbzeQKRHqGbIDfbnQTXfs3/VC6Ye5P82P2ucj+XC32N9piRmO +gCBP8L3ub+YzzdxikZN2gZXXE2jsb3QyE/R2LkWdWyshpKe+RsZP1SBRbHShUyOh +yJ90baoiEwj2mwIDAQABoxgwFjAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZI +hvcNAQELBQADggGBAHRUO/UIHl3jXQENewYayHxkIx8t7nu40iO2DXbicSijz5bo +5//xAB6RxhBAlsDBehgQP1uoZg+WJW+nHu3CIVOU3qZNZRaozxiCl2UFKcNqLOmx +R3NKpo1jYf4REQIeG8Yw9+hSWLRbshNteP6bKUUf+vanhg9+axyOEOH/iOQvgk/m +b8wA8wNa4ujWljPbTQnj7ry8RqhTM0GcAN5LSdSvcKcpzLcs3aYwh+Z8e30sQWna +F40sa5u7izgBTOrwpcDm/w5kC46vpRQ5fnbshVw6pne2by0mdMECASid/p25N103 +jMqTFlmO7kpf/jpCSmamp3/JSEE1BJKHwQ6Ql4nzRA2N1mnvWH7Zxcv043gkHeAu +0x8evpvwuhdIyproejNFlBpKmW8OX7yKTCPPMC/VkX8Q1rVkxU0DQ6hmvwZlhoKa +9Wc2uXpw9xF8itV4Uvcdr3dwqByvIqn7iI/gB+4l41e0u8OmH2MKOx4Nxlly5TNW +HcVKQHyOeyvnINuBAQ== -----END CERTIFICATE----- diff --git a/Lib/test/keycert2.pem b/Lib/test/keycert2.pem index e8a9e082b313a..ed6ae85a4649d 100644 --- a/Lib/test/keycert2.pem +++ b/Lib/test/keycert2.pem @@ -1,31 +1,66 @@ -----BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJnsJZVrppL+W5I9 -zGQrrawWwE5QJpBK9nWw17mXrZ03R1cD9BamLGivVISbPlRlAVnZBEyh1ATpsB7d -CUQ+WHEvALquvx4+Yw5l+fXeiYRjrLRBYZuVy8yNtXzU3iWcGObcYRkUdiXdOyP7 -sLF2YZHRvQZpzgDBKkrraeQ81w21AgMBAAECgYBEm7n07FMHWlE+0kT0sXNsLYfy -YE+QKZnJw9WkaDN+zFEEPELkhZVt5BjsMraJr6v2fIEqF0gGGJPkbenffVq2B5dC -lWUOxvJHufMK4sM3Cp6s/gOp3LP+QkzVnvJSfAyZU6l+4PGX5pLdUsXYjPxgzjzL -S36tF7/2Uv1WePyLUQJBAMsPhYzUXOPRgmbhcJiqi9A9c3GO8kvSDYTCKt3VMnqz -HBn6MQ4VQasCD1F+7jWTI0FU/3vdw8non/Fj8hhYqZcCQQDCDRdvmZqDiZnpMqDq -L6ZSrLTVtMvZXZbgwForaAD9uHj51TME7+eYT7EG2YCgJTXJ4YvRJEnPNyskwdKt -vTSTAkEAtaaN/vyemEJ82BIGStwONNw0ILsSr5cZ9tBHzqiA/tipY+e36HRFiXhP -QcU9zXlxyWkDH8iz9DSAmE2jbfoqwwJANlMJ65E543cjIlitGcKLMnvtCCLcKpb7 -xSG0XJB6Lo11OKPJ66jp0gcFTSCY1Lx2CXVd+gfJrfwI1Pp562+bhwJBAJ9IfDPU -R8OpO9v1SGd8x33Owm7uXOpB9d63/T70AD1QOXjKUC4eXYbt0WWfWuny/RNPRuyh -w7DXSfUF+kPKolU= +MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQDKjrjWZlfOs1Ch +qt1RoyLfqyXbHVXIAW0fTzAxfJnxvFOiWqAAKgC2qVQM8Y080kRUuRaXP/w9ywXT ++MzX6tByy5VbTYJYyTjHOH46EWLNdcqEJs4+FCVqOIYrQPQ6pGAhCXmgBy4Vb42J +ABLwb+Kt+y2Dk15tggVcAHP2Khri+lRXWvda+kZAe2F1IojmuWyCTy3FEYHic5qN +BsXcf6u1oyFV8MybOuz1zGj3vd2C+dEKO4Ohw9rRwnvHSatjM+CfwiXf8kTXzDBF +Z/8W3+6yA49pHxRbG7FE3K1TAPhkrp+BVTIUOcdI74wEA6UEkWFF5sQcmmAth59M +EQrl2CXorftEPhsKZE59dUP1+nYAPvR/mTySNCSw7/rvdf+csRSZ5ollMu/lxsht +ulJYJI03+IiDTn47FI5D+IF25REK7d4LzGIo6T73ktsT+qpSXHuTWC+IABm8AMF9 +7ljxHSwMRU/z+O5uiONRItDAgKH/OItFG54PtY2vAhaO0YiZrZcCAwEAAQKCAYB2 +hTo8IVghlySH5B1p5kXCkDcvVaPaypLaLhCp9Blzq9lX9yUF043lU4Ddrf0RaIsY +88/3IjZqxb+cP0lE0Z20fdDfwqORZfQ2BaU+PuwMAm9EEhy9kDYwR/ChoHkHUyT4 +T7392BWr70Dmt8ddLmp5mK4R/gnTk6+lHJK9p/dhdk4haxWvAyBWHJty2Yk3T6nh +OYkzdUIFidUVza+6jG2hc1lPGv3tmnYKgNeulkblm10oWphz79C6ycx5WG7TNgef +CQ3z7//Nn89YTiaUBjLvoLvxRTMwO96r7E/FaslSl/fWnF3HP3lut26Z/mNfhiwj +qn7AhUwpSNPV0qcxFWXr/rXUjdk745wv8wOODK8atjjE/vt/MRBK0rAOIPSm3ecx +37PKNtR4i+sNeDEcY1IyTHE6wFvJSy5y8AFpn5y8tbqYfhlEVWZ4pcnlrKxhWm7j +oBkB/4GBjKQgbQ7ttym9eNG1wIbZ8v9N06+yeLs/NCc4bFZEgcWjFqBH1bLtAYEC +gcEA8tt8iYNqbsDH2ognjEmbbBxrDBmyYcEKRpg1i1SUopcZl8i93IHpG7EgJIaj +l7aWSbASAxjnK02t0VZ3nNS60acibzRwY/+e8OrSqlQdMXlAB2ggBA86drDJpfBl +WGJG8TJVY9bc1TU2uuwtZR1LAMSsRHVp+3IvKLpHrne5exPd3x6KGYcuaM+Uk/rE +u6tLsFNwaCdh+iBFFDT2bnYIw7jAsokJUkwxMVxSC0/21s2blhO/q5LsN1gFC1kN +TbpXAoHBANWE7TmG2szPvujPwrK18v6iJlHCA2n50AgAQXrsetj2JcF3HYHYdHnq +z36MQ6FpBKOiQumozWvb32WTjEwdG2kix7GEfam4DAUBdqYuCHzPcR12K5Tc8hsX +NG7JXUAeS8ZJEiOdu95X59JHyBxUQtNfte5rcbaV17SVw6K6bsWVJnj60YjtJrpa +xHvv1ZRnT2WEzJGpA+ii1h3I52N7ipGBiw172qcW+bKJukMi8eHxx5CC9e5tBpnu +C+Ou/eYewQKBwHxNa0jXQrq9YY2w8s0TP8HuKbxfyrXOIHxRm9ZczFcMD8VosgUT +WUUbO+B2KXWVtwawYAfFz0ySzcy//SkAmT6F1VIl/QCx7aBSENGti+Ous98WpIxv +XvUxN4T/rl+2raj2ok4fw5g9TG4QRIvkmmciQyonDr/sicbG0bmy/fTJDl8NOpIm +ZtKurNWxHNERtAPkMTyeK7/ilHjrQtb3AzVqcvbuvR6qcONa5YN0wlrfkisWoJwo +707EdpCAXBbUsQKBwQCnpzcpu2Sj+t9ZKIElF87T93gFLETH+ppJHgJMRdDz+NqO +fTwTD2XtsNz57aLQ44f8AFVv6NZbQYq41FEOFrDGLcQE9BZDpDrz10FVnMGXVr7n +tjjkK1SCxwapkr0AsoknCYsPojO4kud46loLPHI4TGeq7HyeNCvqJMo3RRHjXIiX +58GNNUD6hHjRI/FdFH14Jf0GxmJGUU20l2Jwb7nPJJuNm9mE53pqoNA7FP4+Pj1H +kD0Q2FSdmxeE0IuWHEECgcBgw6ogJ/FRRGLcym+aApqP9BChK+W8FDfDc9Mi4p/J +g+XmetWNFGCGTlOefGqUDIkwSG+QVOEN3hxziXbsjnvfpGApqoaulAI5oRvrwIcj +QIvD2mt0PB52k5ZL9QL2K9sgBa43BJDyCKooMAlTy2XMM+NyXVxQKmzf3r3jQ5sl +Rptk7ro38a9G8Rs99RFDyOmP1haOM0KXZvPksN4nsXuTlE01cnwnI29XKAlEZaoA +pQPLXD8W/KK4mwDbmokYXmo= -----END PRIVATE KEY----- -----BEGIN CERTIFICATE----- -MIICXTCCAcagAwIBAgIJAIO3upAG445fMA0GCSqGSIb3DQEBBQUAMGIxCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xFTATBgNVBAMTDGZha2Vob3N0bmFtZTAeFw0x -MDEwMDkxNTAxMDBaFw0yMDEwMDYxNTAxMDBaMGIxCzAJBgNVBAYTAlhZMRcwFQYD -VQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZv -dW5kYXRpb24xFTATBgNVBAMTDGZha2Vob3N0bmFtZTCBnzANBgkqhkiG9w0BAQEF -AAOBjQAwgYkCgYEAmewllWumkv5bkj3MZCutrBbATlAmkEr2dbDXuZetnTdHVwP0 -FqYsaK9UhJs+VGUBWdkETKHUBOmwHt0JRD5YcS8Auq6/Hj5jDmX59d6JhGOstEFh -m5XLzI21fNTeJZwY5txhGRR2Jd07I/uwsXZhkdG9BmnOAMEqSutp5DzXDbUCAwEA -AaMbMBkwFwYDVR0RBBAwDoIMZmFrZWhvc3RuYW1lMA0GCSqGSIb3DQEBBQUAA4GB -AH+iMClLLGSaKWgwXsmdVo4FhTZZHo8Uprrtg3N9FxEeE50btpDVQysgRt5ias3K -m+bME9zbKwvbVWD5zZdjus4pDgzwF/iHyccL8JyYhxOvS/9zmvAtFXj/APIIbZFp -IT75d9f88ScIGEtknZQejnrdhB64tYki/EqluiuKBqKD +MIIEYjCCAsqgAwIBAgIJAJm2YulYpr+6MA0GCSqGSIb3DQEBCwUAMGIxCzAJBgNV +BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u +IFNvZnR3YXJlIEZvdW5kYXRpb24xFTATBgNVBAMMDGZha2Vob3N0bmFtZTAeFw0x +ODA4MjkxNDIzMTZaFw0yODA4MjYxNDIzMTZaMGIxCzAJBgNVBAYTAlhZMRcwFQYD +VQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZv +dW5kYXRpb24xFTATBgNVBAMMDGZha2Vob3N0bmFtZTCCAaIwDQYJKoZIhvcNAQEB +BQADggGPADCCAYoCggGBAMqOuNZmV86zUKGq3VGjIt+rJdsdVcgBbR9PMDF8mfG8 +U6JaoAAqALapVAzxjTzSRFS5Fpc//D3LBdP4zNfq0HLLlVtNgljJOMc4fjoRYs11 +yoQmzj4UJWo4hitA9DqkYCEJeaAHLhVvjYkAEvBv4q37LYOTXm2CBVwAc/YqGuL6 +VFda91r6RkB7YXUiiOa5bIJPLcURgeJzmo0Gxdx/q7WjIVXwzJs67PXMaPe93YL5 +0Qo7g6HD2tHCe8dJq2Mz4J/CJd/yRNfMMEVn/xbf7rIDj2kfFFsbsUTcrVMA+GSu +n4FVMhQ5x0jvjAQDpQSRYUXmxByaYC2Hn0wRCuXYJeit+0Q+GwpkTn11Q/X6dgA+ +9H+ZPJI0JLDv+u91/5yxFJnmiWUy7+XGyG26UlgkjTf4iINOfjsUjkP4gXblEQrt +3gvMYijpPveS2xP6qlJce5NYL4gAGbwAwX3uWPEdLAxFT/P47m6I41Ei0MCAof84 +i0Ubng+1ja8CFo7RiJmtlwIDAQABoxswGTAXBgNVHREEEDAOggxmYWtlaG9zdG5h +bWUwDQYJKoZIhvcNAQELBQADggGBAMIVLp6e6saH2NQSg8iFg8Ewg/K/etI++jHo +gCJ697AY02wtfrBox1XtljlmI2xpJtVAYZWHhrNqwrEG43aB7YEV6RqTcG6QUVqa +NbD8iNCnMKm7fP89hZizmqA1l4aHnieI3ucOqpgooM7FQwLX6qk+rSue6lD5N/5f +avsublnj8rNKyDfHpQ3AWduLoj8QqctpzI3CqoDZNLNzaDnzVWpxT1SKDQ88q7VI +W5zb+lndpdQlCu3v5HM4w5UpwL/k1htl/z6PnPseS2UdlXv6A8KITnCLg5PLP4tz +2oTAg9gjOtRP/0uwkhvicwoFzFJNVT813lzTLE1jlobMPiZhsS1mjaJGPD9GQZDK +ny3j8ogrIRGjnI4xpOMNNDVphcvwtV8fRbvURSHCj9Y4kCLpD5ODuoyEyLYicJIv +GZP456GP0iSCK5GKO0ij/YzGCkPWD5zA+mYFpMMGZPTwajenMw7TVaPXcc9CZBtr +oOjwwiLEqdkpxUj13mJYTlt5wsS/Kw== -----END CERTIFICATE----- diff --git a/Lib/test/keycert3.pem b/Lib/test/keycert3.pem index 5bfa62c4ca30b..e0a8205a660e8 100644 --- a/Lib/test/keycert3.pem +++ b/Lib/test/keycert3.pem @@ -1,73 +1,164 @@ -----BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP -jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM -9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ -aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe -yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j -y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+ -AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW -5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL -9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9 -1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT -DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh -1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m -JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3 -RnJdHOMXWem7/w== +MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCfKC83Qe9/ZGMW +YhbpARRiKco6mJI9CNNeaf7A89TE+w5Y3GSwS8uzqp5C6QebZzPNueg8HYoTwN85 +Z3xM036/Qw9KhQVth+XDAqM+19e5KHkYcxg3d3ZI1HgY170eakaLBvMDN5ULoFOw +Is2PtwM2o9cjd5mfSuWttI6+fCqop8/l8cerG9iX2GH39p3iWwWoTZuYndAA9qYv +07YWajuQ1ESWKPjHYGTnMvu4xIzibC1mXd2M6u/IjNO6g426SKFaRDWQkx01gIV/ +CyKs9DgZoeMHkKZuPqZVOxOK+A/NrmrqHFsPIsrs5wk7QAVju5/X1skpn/UGQlmM +RwBaQULOs1FagA+54RXU6qUPW0YmhJ4xOB4gHHD1vjAKEsRZ7/6zcxMyOm+M1DbK +RTH4NWjVWpnY8XaVGdRhtTpH9MjycpKhF+D2Zdy2tQXtqu2GdcMnUedt13fn9xDu +P4PophE0ip/IMgn+kb4m9e+S+K9lldQl0B+4BcGWAqHelh2KuU0CAwEAAQKCAYEA +lKiWIYjmyRjdLKUGPTES9vWNvNmRjozV0RQ0LcoSbMMLDZkeO0UwyWqOVHUQ8+ib +jIcfEjeNJxI57oZopeHOO5vJhpNlFH+g7ltiW2qERqA1K88lSXm99Bzw6FNqhCRE +K8ub5N9fyfJA+P4o/xm0WK8EXk5yIUV17p/9zJJxzgKgv2jsVTi3QG2OZGvn4Oug +ByomMZEGHkBDzdxz8c/cP1Tlk1RFuwSgews178k2xq7AYSM/s0YmHi7b/RSvptX6 +1v8P8kXNUe4AwTaNyrlvF2lwIadZ8h1hA7tCE2n44b7a7KfhAkwcbr1T59ioYh6P +zxsyPT678uD51dbtD/DXJCcoeeFOb8uzkR2KNcrnQzZpCJnRq4Gp5ybxwsxxuzpr +gz0gbNlhuWtE7EoSzmIK9t+WTS7IM2CvZymd6/OAh1Fuw6AQhSp64XRp3OfMMAAC +Ie2EPtKj4islWGT8VoUjuRYGmdRh4duAH1dkiAXOWA3R7y5a1/y/iE8KE8BtxocB +AoHBAM8aiURgpu1Fs0Oqz6izec7KSLL3l8hmW+MKUOfk/Ybng6FrTFsL5YtzR+Ap +wW4wwWnnIKEc1JLiZ7g8agRETK8hr5PwFXUn/GSWC0SMsazLJToySQS5LOV0tLzK +kJ3jtNU7tnlDGNkCHTHSoVL2T/8t+IkZI/h5Z6wjlYPvU2Iu0nVIXtiG+alv4A6M +Hrh9l5or4mjB6rGnVXeYohLkCm6s/W97ahVxLMcEdbsBo1prm2JqGnSoiR/tEFC/ +QHQnbQKBwQDEu7kW0Yg9sZ89QtYtVQ1YpixFZORaUeRIRLnpEs1w7L1mCbOZ2Lj9 +JHxsH05cYAc7HJfPwwxv3+3aGAIC/dfu4VSwEFtatAzUpzlhzKS5+HQCWB4JUNNU +MQ3+FwK2xQX4Ph8t+OzrFiYcK2g0An5UxWMa2HWIAWUOhnTOydAVsoH6yP31cVm4 +0hxoABCwflaNLNGjRUyfBpLTAcNu/YtcE+KREy7YAAgXXrhRSO4XpLsSXwLnLT7/ +YOkoBWDcTWECgcBPWnSUDZCIQ3efithMZJBciqd2Y2X19Dpq8O31HImD4jtOY0V7 +cUB/wSkeHAGwjd/eCyA2e0x8B2IEdqmMfvr+86JJxekC3dJYXCFvH5WIhsH53YCa +3bT1KlWCLP9ib/g+58VQC0R/Cc9T4sfLePNH7D5ZkZd1wlbV30CPr+i8KwKay6MD +xhvtLx+jk07GE+E9wmjbCMo7TclyrLoVEOlqZMAqshgApT+p9eyCPetwXuDHwa3n +WxhHclcZCV7R4rUCgcAkdGSnxcvpIrDPOUNWwxvmAWTStw9ZbTNP8OxCNCm9cyDl +d4bAS1h8D/a+Uk7C70hnu7Sl2w7C7Eu2zhwRUdhhe3+l4GINPK/j99i6NqGPlGpq +xMlMEJ4YS768BqeKFpg0l85PRoEgTsphDeoROSUPsEPdBZ9BxIBlYKTkbKESZDGR +twzYHljx1n1NCDYPflmrb1KpXn4EOcObNghw2KqqNUUWfOeBPwBA1FxzM4BrAStp +DBINpGS4Dc0mjViVegECgcA3hTtm82XdxQXj9LQmb/E3lKx/7H87XIOeNMmvjYuZ +iS9wKrkF+u42vyoDxcKMCnxP5056wpdST4p56r+SBwVTHcc3lGBSGcMTIfwRXrj3 +thOA2our2n4ouNIsYyTlcsQSzifwmpRmVMRPxl9fYVdEWUgB83FgHT0D9avvZnF9 +t9OccnGJXShAIZIBADhVj/JwG4FbaX42NijD5PNpVLk1Y17OV0I576T9SfaQoBjJ +aH1M/zC4aVaS0DYB/Gxq7v8= -----END PRIVATE KEY----- Certificate: Data: - Version: 1 (0x0) - Serial Number: 12723342612721443281 (0xb09264b1f2da21d1) - Signature Algorithm: sha1WithRSAEncryption + Version: 3 (0x2) + Serial Number: + cb:2d:80:99:5a:69:52:5c + Signature Algorithm: sha256WithRSAEncryption Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Nov 13 19:47:07 2022 GMT + Not Before: Aug 29 14:23:16 2018 GMT + Not After : Jul 7 14:23:16 2028 GMT Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) + Public-Key: (3072 bit) Modulus: - 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d: - 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb: - c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99: - 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c: - f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93: - 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23: - f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5: - af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6: - 21:82:a5:3c:88:e5:be:1b:b1 + 00:9f:28:2f:37:41:ef:7f:64:63:16:62:16:e9:01: + 14:62:29:ca:3a:98:92:3d:08:d3:5e:69:fe:c0:f3: + d4:c4:fb:0e:58:dc:64:b0:4b:cb:b3:aa:9e:42:e9: + 07:9b:67:33:cd:b9:e8:3c:1d:8a:13:c0:df:39:67: + 7c:4c:d3:7e:bf:43:0f:4a:85:05:6d:87:e5:c3:02: + a3:3e:d7:d7:b9:28:79:18:73:18:37:77:76:48:d4: + 78:18:d7:bd:1e:6a:46:8b:06:f3:03:37:95:0b:a0: + 53:b0:22:cd:8f:b7:03:36:a3:d7:23:77:99:9f:4a: + e5:ad:b4:8e:be:7c:2a:a8:a7:cf:e5:f1:c7:ab:1b: + d8:97:d8:61:f7:f6:9d:e2:5b:05:a8:4d:9b:98:9d: + d0:00:f6:a6:2f:d3:b6:16:6a:3b:90:d4:44:96:28: + f8:c7:60:64:e7:32:fb:b8:c4:8c:e2:6c:2d:66:5d: + dd:8c:ea:ef:c8:8c:d3:ba:83:8d:ba:48:a1:5a:44: + 35:90:93:1d:35:80:85:7f:0b:22:ac:f4:38:19:a1: + e3:07:90:a6:6e:3e:a6:55:3b:13:8a:f8:0f:cd:ae: + 6a:ea:1c:5b:0f:22:ca:ec:e7:09:3b:40:05:63:bb: + 9f:d7:d6:c9:29:9f:f5:06:42:59:8c:47:00:5a:41: + 42:ce:b3:51:5a:80:0f:b9:e1:15:d4:ea:a5:0f:5b: + 46:26:84:9e:31:38:1e:20:1c:70:f5:be:30:0a:12: + c4:59:ef:fe:b3:73:13:32:3a:6f:8c:d4:36:ca:45: + 31:f8:35:68:d5:5a:99:d8:f1:76:95:19:d4:61:b5: + 3a:47:f4:c8:f2:72:92:a1:17:e0:f6:65:dc:b6:b5: + 05:ed:aa:ed:86:75:c3:27:51:e7:6d:d7:77:e7:f7: + 10:ee:3f:83:e8:a6:11:34:8a:9f:c8:32:09:fe:91: + be:26:f5:ef:92:f8:af:65:95:d4:25:d0:1f:b8:05: + c1:96:02:a1:de:96:1d:8a:b9:4d Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a: - e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93: - f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13: - e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92: - d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59: - 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8: - ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1: - 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75: - 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96: - 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48: - 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a: - f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6: - 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41: - a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb: - fc:a9:94:71 + X509v3 extensions: + X509v3 Subject Alternative Name: + DNS:localhost + X509v3 Key Usage: critical + Digital Signature, Key Encipherment + X509v3 Extended Key Usage: + TLS Web Server Authentication, TLS Web Client Authentication + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Subject Key Identifier: + 8F:EA:1D:E3:33:5C:00:16:B3:8B:6F:6B:6F:D3:4C:CB:B5:CB:7C:55 + X509v3 Authority Key Identifier: + keyid:DD:BF:CA:DA:E6:D1:34:BA:37:75:21:CA:6F:9A:08:28:F2:35:B6:48 + DirName:/C=XY/O=Python Software Foundation CA/CN=our-ca-server + serial:CB:2D:80:99:5A:69:52:5B + + Authority Information Access: + CA Issuers - URI:http://testca.pythontest.net/testca/pycacert.cer + OCSP - URI:http://testca.pythontest.net/testca/ocsp/ + + X509v3 CRL Distribution Points: + + Full Name: + URI:http://testca.pythontest.net/testca/revocation.crl + + Signature Algorithm: sha256WithRSAEncryption + 27:f5:8c:59:10:f4:c6:e7:28:00:bf:ba:8d:7b:13:03:f1:1c: + a6:5f:b3:06:55:a4:22:b9:db:b2:d5:46:bd:f7:0c:dd:43:6e: + b4:79:65:67:21:0c:2a:55:ee:40:8e:85:9f:9f:47:bb:0a:2a: + 4d:b6:64:74:98:a0:7f:ae:dc:f1:2e:db:42:77:18:e0:75:8b: + 26:35:68:c3:41:ed:6b:c8:77:72:6f:6a:9a:5d:55:69:02:fd: + 5a:54:c8:57:cb:b0:65:03:16:e2:0f:00:39:99:66:a0:9b:88: + 93:17:e2:5a:2d:79:35:5f:97:57:78:c4:af:f5:99:5e:86:ab: + d3:11:ad:1a:a2:0d:fa:52:10:b9:fe:bf:9d:ce:33:d9:86:b2: + 9c:16:f8:d6:75:08:8a:db:0a:e5:b4:2b:16:7f:b4:f9:2a:9f: + c3:d2:77:d7:cd:65:1e:f4:6c:1e:eb:59:b9:f0:ae:5f:a4:1f: + cc:4a:c4:b9:7a:a9:d9:6b:32:68:3b:e1:65:b0:84:b7:90:c4: + ae:fe:f4:37:4f:21:a0:de:9f:3a:b1:e5:cc:16:04:66:3f:0b: + 41:dc:42:3d:20:3e:ec:b7:95:2b:35:57:fa:be:7f:b6:3a:ba: + ca:4f:58:fe:75:3e:08:89:2c:8c:b0:5d:2e:f9:89:10:2b:f9: + 41:46:4f:3c:00:b7:27:d3:65:24:28:17:23:26:31:42:ea:7e: + 4e:93:e4:7b:68:54:ca:9f:46:f3:ef:2b:e9:85:0c:b5:84:b2: + d5:35:34:80:75:2b:f0:91:23:b8:08:01:8e:b9:0a:54:d4:fb: + 34:52:fe:d9:45:f0:80:3b:b6:c1:6f:82:d1:1f:f2:3b:08:f6: + 46:a6:96:27:61:4b:58:32:7a:0e:1d:59:c5:44:ad:5e:1a:79: + 33:c1:d4:05:2f:4a:d3:d8:42:42:8d:33:e3:63:ca:d5:87:97: + 9b:4d:b8:1a:03:34:bb:1c:d2:02:3f:59:23:e2:23:80:88:63: + c2:f0:a2:63:a8:8b -----BEGIN CERTIFICATE----- -MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY -WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV -BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3 -WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV -BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv -c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C -tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola -N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1 -TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR -iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG -xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo -5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv -mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF -YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh -2EJ36/yplHE= +MIIF8TCCBFmgAwIBAgIJAMstgJlaaVJcMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV +BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW +MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0yODA3MDcx +NDIzMTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEj +MCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxv +Y2FsaG9zdDCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAJ8oLzdB739k +YxZiFukBFGIpyjqYkj0I015p/sDz1MT7DljcZLBLy7OqnkLpB5tnM8256DwdihPA +3zlnfEzTfr9DD0qFBW2H5cMCoz7X17koeRhzGDd3dkjUeBjXvR5qRosG8wM3lQug +U7AizY+3Azaj1yN3mZ9K5a20jr58Kqinz+Xxx6sb2JfYYff2neJbBahNm5id0AD2 +pi/TthZqO5DURJYo+MdgZOcy+7jEjOJsLWZd3Yzq78iM07qDjbpIoVpENZCTHTWA +hX8LIqz0OBmh4weQpm4+plU7E4r4D82uauocWw8iyuznCTtABWO7n9fWySmf9QZC +WYxHAFpBQs6zUVqAD7nhFdTqpQ9bRiaEnjE4HiAccPW+MAoSxFnv/rNzEzI6b4zU +NspFMfg1aNVamdjxdpUZ1GG1Okf0yPJykqEX4PZl3La1Be2q7YZ1wydR523Xd+f3 +EO4/g+imETSKn8gyCf6Rvib175L4r2WV1CXQH7gFwZYCod6WHYq5TQIDAQABo4IB +wDCCAbwwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA4GA1UdDwEB/wQEAwIFoDAdBgNV +HSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAdBgNVHQ4E +FgQUj+od4zNcABazi29rb9NMy7XLfFUwfQYDVR0jBHYwdIAU3b/K2ubRNLo3dSHK +b5oIKPI1tkihUaRPME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29m +dHdhcmUgRm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcoIJAMst +gJlaaVJbMIGDBggrBgEFBQcBAQR3MHUwPAYIKwYBBQUHMAKGMGh0dHA6Ly90ZXN0 +Y2EucHl0aG9udGVzdC5uZXQvdGVzdGNhL3B5Y2FjZXJ0LmNlcjA1BggrBgEFBQcw +AYYpaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0Y2Evb2NzcC8wQwYD +VR0fBDwwOjA4oDagNIYyaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0 +Y2EvcmV2b2NhdGlvbi5jcmwwDQYJKoZIhvcNAQELBQADggGBACf1jFkQ9MbnKAC/ +uo17EwPxHKZfswZVpCK527LVRr33DN1DbrR5ZWchDCpV7kCOhZ+fR7sKKk22ZHSY +oH+u3PEu20J3GOB1iyY1aMNB7WvId3JvappdVWkC/VpUyFfLsGUDFuIPADmZZqCb +iJMX4loteTVfl1d4xK/1mV6Gq9MRrRqiDfpSELn+v53OM9mGspwW+NZ1CIrbCuW0 +KxZ/tPkqn8PSd9fNZR70bB7rWbnwrl+kH8xKxLl6qdlrMmg74WWwhLeQxK7+9DdP +IaDenzqx5cwWBGY/C0HcQj0gPuy3lSs1V/q+f7Y6uspPWP51PgiJLIywXS75iRAr ++UFGTzwAtyfTZSQoFyMmMULqfk6T5HtoVMqfRvPvK+mFDLWEstU1NIB1K/CRI7gI +AY65ClTU+zRS/tlF8IA7tsFvgtEf8jsI9kamlidhS1gyeg4dWcVErV4aeTPB1AUv +StPYQkKNM+NjytWHl5tNuBoDNLsc0gI/WSPiI4CIY8LwomOoiw== -----END CERTIFICATE----- diff --git a/Lib/test/keycert4.pem b/Lib/test/keycert4.pem index 53355c8a50cba..d1ebb82486de2 100644 --- a/Lib/test/keycert4.pem +++ b/Lib/test/keycert4.pem @@ -1,73 +1,164 @@ -----BEGIN PRIVATE KEY----- -MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAK5UQiMI5VkNs2Qv -L7gUaiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2 -NkX0ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1 -L2OQhEx1GM6RydHdgX69G64LXcY5AgMBAAECgYAhsRMfJkb9ERLMl/oG/5sLQu9L -pWDKt6+ZwdxzlZbggQ85CMYshjLKIod2DLL/sLf2x1PRXyRG131M1E3k8zkkz6de -R1uDrIN/x91iuYzfLQZGh8bMY7Yjd2eoroa6R/7DjpElGejLxOAaDWO0ST2IFQy9 -myTGS2jSM97wcXfsSQJBANP3jelJoS5X6BRjTSneY21wcocxVuQh8pXpErALVNsT -drrFTeaBuZp7KvbtnIM5g2WRNvaxLZlAY/hXPJvi6ncCQQDSix1cebml6EmPlEZS -Mm8gwI2F9ufUunwJmBJcz826Do0ZNGByWDAM/JQZH4FX4GfAFNuj8PUb+GQfadkx -i1DPAkEA0lVsNHojvuDsIo8HGuzarNZQT2beWjJ1jdxh9t7HrTx7LIps6rb/fhOK -Zs0R6gVAJaEbcWAPZ2tFyECInAdnsQJAUjaeXXjuxFkjOFym5PvqpvhpivEx78Bu -JPTr3rAKXmfGMxxfuOa0xK1wSyshP6ZR/RBn/+lcXPKubhHQDOegwwJAJF1DBQnN -+/tLmOPULtDwfP4Zixn+/8GmGOahFoRcu6VIGHmRilJTn6MOButw7Glv2YdeC6l/ -e83Gq6ffLVfKNQ== +MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQDGjpiHzq7ghxhM +ZzrnRsGBC/cmw8EREIdbqlrz/l8BFaWeipvO5Hb/MyU8xs2zLUrqIr2JNf+Eii8Y +m4bYmZclFra4jomaiSlxTZOe3dMV8m4vAq4eT2mSfZZC1+XAutqdz7WhHxhMVEm3 +AyTWvTC3qCbnlbX5VIoQUwFrsSWqDiHyaGdK3rrOTKFUKM8YPiq/BZkm6A4eiFci +5wd/SPD+w0pIscZbQW1MUr5bs54uylWaUmtfI8KJt6BDZQ/uA06c6i863sSCEI6L +gq+wyikeJGNMxZMfgu3dzfv4BiZBQX0ZhiRvqseDSdPcuVa2Ifb6CFlg298neweY +4EAIE1O+uqo5h8FF1aUOMZpQEZuzsp9R/TAMBHX1YmVjG/kRdBeaHe3whzB1Pfue +PIX2ZTMmLNYbYbfnmxhk1nn8aAvoT98pNw8y3/2k2KNsu24n9uSkkxAoqJ19WKwm +mL8MpJKAzLv45tRvhN+QLtnRdu+LJ9m29npQHFmYLbdqRfmidnMCAwEAAQKCAYBd +w1C8MRnb5W/QBJ+IP515NxFLOP2e9VM2MkgpGGH8vSAssf/Jv5GCCcD35lmU1zqd +PjKK7PjwueBrmmYfOshpN0Sp+oV4eHUdkCi5yL65inYFtRpMLewIxU2D2zgfvx0l +kMSQhYKP6O22gsGOtmCfGcTlb4kzaHyaINh25nyGxY26TxsX+/3zFbTJbUv+grzk +39vmx4aDXJbpYHfl36gOZmJZ2bl1tnvKovhJjZSRO/MYoPsbPmPLbO89ZCgVmXFc +GVkb5Cram6i3iyutSDjxWN7Fb8uy8pFLPGAXZgF7pQoXPSEHZe8GEWBnWSC9KaDa +uM9Ir847/Muy1ceCmxKcI2WrSjoH2AhPcmHgvbPE9Mynr6+uzReSP3q7Wh9PHm23 +oFx3DwdCfmjysnpAMBawNmJdWyxVDbZ6eyrhp17ADpsMaDTynZ+fJjgMr+MmWtbU +YSRD0wWtl/DrzsaePZsOjCpKYJyulC+rh9/Zz1aiwrGWPbgEAzDrD6Q1Zp0mUCEC +gcEA+XskmGIB9rRPy+YQmRgzQ555PsjLWsnQsNktP6KBhlQjFKJZXRZ0DxDTS7h8 +NrJrUDBmwfsgzggVbeO55VP5FGwD6DNeO/Bz++Fdevh8uKQFHDfk4sbIUPS91qw4 +s7OW7PR7C7Jf7Dnjmsn42o2lO4FsbcEn2F+PHOvoLl/OrSx73lS/RkdOEItW8d8/ +ExRohylnba/I2vCE9bNZd4DGjMW87j/THKPadDZWEqWggcrjY8x6ibSQGm2n2Tka +8B+vAoHBAMu+zl8kqFlYDG24dGfVpMaOYj5Osj0cV5f7O2pZ15sCevjiqoKGHH7G +O8EiI5pRBZ893+Fsx6YWmcKue88lfGvaoQjV0LUbfMfX/FoD39w/ZLx31yKEiFuc +KvMiRV5mO3kQiHBVX9vamzr5NeaErccXY9LnhaKOMX9blgiDQZH7fc3RhodcFWrC +9yfX6ryfidpPnRvK7Ops7hVnFKyyS4FaAarnzH1B2WcVcD4lYYxhMc8VXeU3eKOh +j1fI/F5ifQKBwQDpCjB670HqUzAexL9IYqSwSz3yedoK6m24ZIWx5XicI8fJJIXZ +QHoVAKB/IMtWxH8dnri+Bnj0O/TYe1pQb4pBm0xjAGjMEKYm6LNLhQXr67qiS0vQ +0eKYTKVv+9vTcLRQj2bI3Exh+wkys+tzK9DmrtS8CSvRICIs3+g4OWJzvRPP8NXj +LgQrzBzhPqpKhkvFxdVJTmSOrxFj+a5exLmzEZqT6qanIB+VYpQwQuqVkxGpTX5B +V5ssNLYPYRpapx0CgcByCtQixzcAA1u5knR9pkT76ris3YnA0Ptqk3I3XiBjoGjK +pL0CICUVBMpvmTdKai12a8DDwgqiOaZJJTchxH63NAHNGzkeFkuq5IdYrzB/bHBr +WbzukjZs6KXVv4oKg7ioVAu6rN7iBaO7x8BWzk8i0EHMzFCto1+rRM1e6HEsUBOj +v7LIU0+dmZGUGLRIbhhQPR3Yb6ZatSwyiKc23vmKZqHmUqbQOaqBm6te7beDRugF +XJVY9sqs9IJyhYpVHlUCgcAPoslwYKeAXagsxdQrH3D9VJDXVOHWKMBqQZDio5dB +Q80uWpuxtt6nhZkQO1JIWnYb6v+zbDbcgjByBIDuxCdBW9d+QQnanKmVyrXguK91 +C3OcHHOmSduFdWC3/zYW1mW97Tz1sXyam2hly1u3L5kW+GnE1hr9VVPjQNrO9+Ge +qW0coaJqKY78q3Rm2dtyZeJSFFI1o/DQ3blyItsFpg/QrR+a5XrS6Nw2ZLIL4Azo +J1CTgMwjhwlMNCI4t4dkHd0= -----END PRIVATE KEY----- Certificate: Data: - Version: 1 (0x0) - Serial Number: 12723342612721443282 (0xb09264b1f2da21d2) - Signature Algorithm: sha1WithRSAEncryption + Version: 3 (0x2) + Serial Number: + cb:2d:80:99:5a:69:52:5d + Signature Algorithm: sha256WithRSAEncryption Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Nov 13 19:47:07 2022 GMT + Not Before: Aug 29 14:23:16 2018 GMT + Not After : Jul 7 14:23:16 2028 GMT Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=fakehostname Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (1024 bit) + Public-Key: (3072 bit) Modulus: - 00:ae:54:42:23:08:e5:59:0d:b3:64:2f:2f:b8:14: - 6a:20:dd:15:eb:cd:51:74:63:53:80:c7:01:ed:d9: - cf:36:0b:64:d1:3a:f6:1f:60:3b:d5:42:49:2d:7a: - b4:9e:5f:4f:95:44:bb:41:19:c8:6a:f4:7b:75:76: - 36:45:f4:66:85:34:1d:cf:d4:69:8e:2a:c7:b2:c7: - 9a:7e:52:61:9a:48:c6:12:67:91:fe:d2:c8:72:4a: - d7:35:1a:1a:55:34:fc:bc:58:a8:8b:86:0a:d1:79: - 76:ac:75:2f:63:90:84:4c:75:18:ce:91:c9:d1:dd: - 81:7e:bd:1b:ae:0b:5d:c6:39 + 00:c6:8e:98:87:ce:ae:e0:87:18:4c:67:3a:e7:46: + c1:81:0b:f7:26:c3:c1:11:10:87:5b:aa:5a:f3:fe: + 5f:01:15:a5:9e:8a:9b:ce:e4:76:ff:33:25:3c:c6: + cd:b3:2d:4a:ea:22:bd:89:35:ff:84:8a:2f:18:9b: + 86:d8:99:97:25:16:b6:b8:8e:89:9a:89:29:71:4d: + 93:9e:dd:d3:15:f2:6e:2f:02:ae:1e:4f:69:92:7d: + 96:42:d7:e5:c0:ba:da:9d:cf:b5:a1:1f:18:4c:54: + 49:b7:03:24:d6:bd:30:b7:a8:26:e7:95:b5:f9:54: + 8a:10:53:01:6b:b1:25:aa:0e:21:f2:68:67:4a:de: + ba:ce:4c:a1:54:28:cf:18:3e:2a:bf:05:99:26:e8: + 0e:1e:88:57:22:e7:07:7f:48:f0:fe:c3:4a:48:b1: + c6:5b:41:6d:4c:52:be:5b:b3:9e:2e:ca:55:9a:52: + 6b:5f:23:c2:89:b7:a0:43:65:0f:ee:03:4e:9c:ea: + 2f:3a:de:c4:82:10:8e:8b:82:af:b0:ca:29:1e:24: + 63:4c:c5:93:1f:82:ed:dd:cd:fb:f8:06:26:41:41: + 7d:19:86:24:6f:aa:c7:83:49:d3:dc:b9:56:b6:21: + f6:fa:08:59:60:db:df:27:7b:07:98:e0:40:08:13: + 53:be:ba:aa:39:87:c1:45:d5:a5:0e:31:9a:50:11: + 9b:b3:b2:9f:51:fd:30:0c:04:75:f5:62:65:63:1b: + f9:11:74:17:9a:1d:ed:f0:87:30:75:3d:fb:9e:3c: + 85:f6:65:33:26:2c:d6:1b:61:b7:e7:9b:18:64:d6: + 79:fc:68:0b:e8:4f:df:29:37:0f:32:df:fd:a4:d8: + a3:6c:bb:6e:27:f6:e4:a4:93:10:28:a8:9d:7d:58: + ac:26:98:bf:0c:a4:92:80:cc:bb:f8:e6:d4:6f:84: + df:90:2e:d9:d1:76:ef:8b:27:d9:b6:f6:7a:50:1c: + 59:98:2d:b7:6a:45:f9:a2:76:73 Exponent: 65537 (0x10001) - Signature Algorithm: sha1WithRSAEncryption - ad:45:8a:8e:ef:c6:ef:04:41:5c:2c:4a:84:dc:02:76:0c:d0: - 66:0f:f0:16:04:58:4d:fd:68:b7:b8:d3:a8:41:a5:5c:3c:6f: - 65:3c:d1:f8:ce:43:35:e7:41:5f:53:3d:c9:2c:c3:7d:fc:56: - 4a:fa:47:77:38:9d:bb:97:28:0a:3b:91:19:7f:bc:74:ae:15: - 6b:bd:20:36:67:45:a5:1e:79:d7:75:e6:89:5c:6d:54:84:d1: - 95:d7:a7:b4:33:3c:af:37:c4:79:8f:5e:75:dc:75:c2:18:fb: - 61:6f:2d:dc:38:65:5b:ba:67:28:d0:88:d7:8d:b9:23:5a:8e: - e8:c6:bb:db:ce:d5:b8:41:2a:ce:93:08:b6:95:ad:34:20:18: - d5:3b:37:52:74:50:0b:07:2c:b0:6d:a4:4c:7b:f4:e0:fd:d1: - af:17:aa:20:cd:62:e3:f0:9d:37:69:db:41:bd:d4:1c:fb:53: - 20:da:88:9d:76:26:67:ce:01:90:a7:80:1d:a9:5b:39:73:68: - 54:0a:d1:2a:03:1b:8f:3c:43:5d:5d:c4:51:f1:a7:e7:11:da: - 31:2c:49:06:af:04:f4:b8:3c:99:c4:20:b9:06:36:a2:00:92: - 61:1d:0c:6d:24:05:e2:82:e1:47:db:a0:5f:ba:b9:fb:ba:fa: - 49:12:1e:ce + X509v3 extensions: + X509v3 Subject Alternative Name: + DNS:fakehostname + X509v3 Key Usage: critical + Digital Signature, Key Encipherment + X509v3 Extended Key Usage: + TLS Web Server Authentication, TLS Web Client Authentication + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Subject Key Identifier: + 52:E0:93:AA:52:55:B7:BB:E7:A8:E0:8C:DE:41:2E:F4:07:F0:36:FB + X509v3 Authority Key Identifier: + keyid:DD:BF:CA:DA:E6:D1:34:BA:37:75:21:CA:6F:9A:08:28:F2:35:B6:48 + DirName:/C=XY/O=Python Software Foundation CA/CN=our-ca-server + serial:CB:2D:80:99:5A:69:52:5B + + Authority Information Access: + CA Issuers - URI:http://testca.pythontest.net/testca/pycacert.cer + OCSP - URI:http://testca.pythontest.net/testca/ocsp/ + + X509v3 CRL Distribution Points: + + Full Name: + URI:http://testca.pythontest.net/testca/revocation.crl + + Signature Algorithm: sha256WithRSAEncryption + 29:d2:3f:82:3f:c1:38:35:a6:bd:81:10:fe:64:ec:ff:7e:e1: + c6:6f:7f:86:65:f9:31:6f:fb:ef:32:4e:2f:87:c8:42:de:6c: + 8d:b8:06:08:8f:37:70:95:7d:e1:40:d4:82:2b:8d:b3:4a:fd: + 34:c5:9e:df:ff:01:53:4a:4f:08:f4:58:e1:74:fc:78:e3:3e: + 71:a7:5e:66:07:ea:d2:04:31:e2:75:a8:4c:80:17:86:92:20: + d2:32:a7:9a:65:8b:1a:5f:f1:4c:c8:50:6d:00:fc:99:bf:69: + b3:48:f3:45:5a:ee:35:50:14:b8:f3:92:92:c6:9f:0e:5d:eb: + 0d:e8:ec:f2:a4:09:6b:dc:66:2b:fc:df:4c:fc:65:a1:ae:d3: + b5:88:6a:a4:e7:08:1c:94:49:e0:b8:c1:04:8c:21:09:6c:55: + 4b:2c:97:10:f1:8c:6c:d0:bb:ba:8d:93:e8:47:8b:4d:8e:7d: + 7d:85:53:18:c8:f8:f4:8f:67:3a:b1:aa:3e:18:34:6c:3a:e6: + a6:c7:2f:be:83:38:f5:d5:e5:d2:17:28:61:6c:b6:49:99:21: + 69:a4:a8:b6:94:76:fd:18:ad:35:52:45:64:fb:f1:5d:8e:bb: + c0:21:2e:59:55:24:af:bb:8f:b2:0a:7b:17:f0:34:97:8e:68: + a9:f2:d0:3e:f6:73:82:f8:7c:4e:9a:70:7d:d6:b3:8c:cc:85: + 04:5c:02:8f:74:da:88:3a:20:a8:7e:c2:9e:b0:dd:56:1f:ce: + cd:42:16:c6:14:91:ad:30:e0:dc:76:f2:2c:56:ea:38:45:d8: + c0:3e:b8:90:fa:f3:38:99:ec:44:07:35:8f:69:62:0c:f9:ef: + b7:9d:e5:15:42:6e:fb:fe:4c:ff:e8:94:5a:1a:b0:80:b2:0e: + 17:3d:e1:87:a8:08:84:93:74:68:8d:29:df:ca:0b:6a:44:32: + 8a:51:3b:d6:38:db:bd:e3:2a:1b:5e:20:48:81:82:19:91:c6: + 87:8c:0f:cd:51:ea -----BEGIN CERTIFICATE----- -MIICpzCCAY8CCQCwkmSx8toh0jANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY -WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV -BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3 -WjBiMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV -BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRUwEwYDVQQDEwxmYWtlaG9z -dG5hbWUwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK5UQiMI5VkNs2QvL7gU -aiDdFevNUXRjU4DHAe3ZzzYLZNE69h9gO9VCSS16tJ5fT5VEu0EZyGr0e3V2NkX0 -ZoU0Hc/UaY4qx7LHmn5SYZpIxhJnkf7SyHJK1zUaGlU0/LxYqIuGCtF5dqx1L2OQ -hEx1GM6RydHdgX69G64LXcY5AgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAK1Fio7v -xu8EQVwsSoTcAnYM0GYP8BYEWE39aLe406hBpVw8b2U80fjOQzXnQV9TPcksw338 -Vkr6R3c4nbuXKAo7kRl/vHSuFWu9IDZnRaUeedd15olcbVSE0ZXXp7QzPK83xHmP -XnXcdcIY+2FvLdw4ZVu6ZyjQiNeNuSNajujGu9vO1bhBKs6TCLaVrTQgGNU7N1J0 -UAsHLLBtpEx79OD90a8XqiDNYuPwnTdp20G91Bz7UyDaiJ12JmfOAZCngB2pWzlz -aFQK0SoDG488Q11dxFHxp+cR2jEsSQavBPS4PJnEILkGNqIAkmEdDG0kBeKC4Ufb -oF+6ufu6+kkSHs4= +MIIF9zCCBF+gAwIBAgIJAMstgJlaaVJdMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV +BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW +MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0yODA3MDcx +NDIzMTZaMGIxCzAJBgNVBAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEj +MCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24xFTATBgNVBAMMDGZh +a2Vob3N0bmFtZTCCAaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAMaOmIfO +ruCHGExnOudGwYEL9ybDwREQh1uqWvP+XwEVpZ6Km87kdv8zJTzGzbMtSuoivYk1 +/4SKLxibhtiZlyUWtriOiZqJKXFNk57d0xXybi8Crh5PaZJ9lkLX5cC62p3PtaEf +GExUSbcDJNa9MLeoJueVtflUihBTAWuxJaoOIfJoZ0reus5MoVQozxg+Kr8FmSbo +Dh6IVyLnB39I8P7DSkixxltBbUxSvluzni7KVZpSa18jwom3oENlD+4DTpzqLzre +xIIQjouCr7DKKR4kY0zFkx+C7d3N+/gGJkFBfRmGJG+qx4NJ09y5VrYh9voIWWDb +3yd7B5jgQAgTU766qjmHwUXVpQ4xmlARm7Oyn1H9MAwEdfViZWMb+RF0F5od7fCH +MHU9+548hfZlMyYs1htht+ebGGTWefxoC+hP3yk3DzLf/aTYo2y7bif25KSTECio +nX1YrCaYvwykkoDMu/jm1G+E35Au2dF274sn2bb2elAcWZgtt2pF+aJ2cwIDAQAB +o4IBwzCCAb8wFwYDVR0RBBAwDoIMZmFrZWhvc3RuYW1lMA4GA1UdDwEB/wQEAwIF +oDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADAd +BgNVHQ4EFgQUUuCTqlJVt7vnqOCM3kEu9AfwNvswfQYDVR0jBHYwdIAU3b/K2ubR +NLo3dSHKb5oIKPI1tkihUaRPME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRo +b24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZl +coIJAMstgJlaaVJbMIGDBggrBgEFBQcBAQR3MHUwPAYIKwYBBQUHMAKGMGh0dHA6 +Ly90ZXN0Y2EucHl0aG9udGVzdC5uZXQvdGVzdGNhL3B5Y2FjZXJ0LmNlcjA1Bggr +BgEFBQcwAYYpaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5ldC90ZXN0Y2Evb2Nz +cC8wQwYDVR0fBDwwOjA4oDagNIYyaHR0cDovL3Rlc3RjYS5weXRob250ZXN0Lm5l +dC90ZXN0Y2EvcmV2b2NhdGlvbi5jcmwwDQYJKoZIhvcNAQELBQADggGBACnSP4I/ +wTg1pr2BEP5k7P9+4cZvf4Zl+TFv++8yTi+HyELebI24BgiPN3CVfeFA1IIrjbNK +/TTFnt//AVNKTwj0WOF0/HjjPnGnXmYH6tIEMeJ1qEyAF4aSINIyp5plixpf8UzI +UG0A/Jm/abNI80Va7jVQFLjzkpLGnw5d6w3o7PKkCWvcZiv830z8ZaGu07WIaqTn +CByUSeC4wQSMIQlsVUsslxDxjGzQu7qNk+hHi02OfX2FUxjI+PSPZzqxqj4YNGw6 +5qbHL76DOPXV5dIXKGFstkmZIWmkqLaUdv0YrTVSRWT78V2Ou8AhLllVJK+7j7IK +exfwNJeOaKny0D72c4L4fE6acH3Ws4zMhQRcAo902og6IKh+wp6w3VYfzs1CFsYU +ka0w4Nx28ixW6jhF2MA+uJD68ziZ7EQHNY9pYgz577ed5RVCbvv+TP/olFoasICy +Dhc94YeoCISTdGiNKd/KC2pEMopRO9Y4273jKhteIEiBghmRxoeMD81R6g== -----END CERTIFICATE----- diff --git a/Lib/test/make_ssl_certs.py b/Lib/test/make_ssl_certs.py index a1f298de34975..41b5f46c882ca 100644 --- a/Lib/test/make_ssl_certs.py +++ b/Lib/test/make_ssl_certs.py @@ -2,15 +2,17 @@ and friends.""" import os +import pprint import shutil -import sys import tempfile from subprocess import * req_template = """ + [ default ] + base_url = http://testca.pythontest.net/testca + [req] distinguished_name = req_distinguished_name - x509_extensions = req_x509_extensions prompt = no [req_distinguished_name] @@ -19,8 +21,25 @@ O = Python Software Foundation CN = {hostname} - [req_x509_extensions] + [req_x509_extensions_simple] + subjectAltName = @san + + [req_x509_extensions_full] subjectAltName = @san + keyUsage = critical,keyEncipherment,digitalSignature + extendedKeyUsage = serverAuth,clientAuth + basicConstraints = critical,CA:false + subjectKeyIdentifier = hash + authorityKeyIdentifier = keyid:always,issuer:always + authorityInfoAccess = @issuer_ocsp_info + crlDistributionPoints = @crl_info + + [ issuer_ocsp_info ] + caIssuers;URI.0 = $base_url/pycacert.cer + OCSP;URI.0 = $base_url/ocsp/ + + [ crl_info ] + URI.0 = $base_url/revocation.crl [san] DNS.1 = {hostname} @@ -50,14 +69,13 @@ dir = cadir database = $dir/index.txt crlnumber = $dir/crl.txt - default_md = sha1 + default_md = sha256 default_days = 3600 default_crl_days = 3600 certificate = pycacert.pem private_key = pycakey.pem serial = $dir/serial RANDFILE = $dir/.rand - policy = policy_match [ policy_match ] @@ -88,7 +106,9 @@ here = os.path.abspath(os.path.dirname(__file__)) -def make_cert_key(hostname, sign=False, extra_san=''): + +def make_cert_key(hostname, sign=False, extra_san='', + ext='req_x509_extensions_full', key='rsa:3072'): print("creating cert for " + hostname) tempnames = [] for i in range(3): @@ -100,7 +120,8 @@ def make_cert_key(hostname, sign=False, extra_san=''): with open(req_file, 'w') as f: f.write(req) args = ['req', '-new', '-days', '3650', '-nodes', - '-newkey', 'rsa:1024', '-keyout', key_file, + '-newkey', key, '-keyout', key_file, + '-extensions', ext, '-config', req_file] if sign: with tempfile.NamedTemporaryFile(delete=False) as f: @@ -113,8 +134,15 @@ def make_cert_key(hostname, sign=False, extra_san=''): check_call(['openssl'] + args) if sign: - args = ['ca', '-config', req_file, '-out', cert_file, '-outdir', 'cadir', - '-policy', 'policy_anything', '-batch', '-infiles', reqfile ] + args = [ + 'ca', + '-config', req_file, + '-extensions', ext, + '-out', cert_file, + '-outdir', 'cadir', + '-policy', 'policy_anything', + '-batch', '-infiles', reqfile + ] check_call(['openssl'] + args) @@ -146,7 +174,7 @@ def make_ca(): t.flush() with tempfile.NamedTemporaryFile() as f: args = ['req', '-new', '-days', '3650', '-extensions', 'v3_ca', '-nodes', - '-newkey', 'rsa:2048', '-keyout', 'pycakey.pem', + '-newkey', 'rsa:3072', '-keyout', 'pycakey.pem', '-out', f.name, '-subj', '/C=XY/L=Castle Anthrax/O=Python Software Foundation CA/CN=our-ca-server'] check_call(['openssl'] + args) @@ -158,16 +186,28 @@ def make_ca(): args = ['ca', '-config', t.name, '-gencrl', '-out', 'revocation.crl'] check_call(['openssl'] + args) + # capath hashes depend on subject! + check_call([ + 'openssl', 'x509', '-in', 'pycacert.pem', '-out', 'capath/ceff1710.0' + ]) + shutil.copy('capath/ceff1710.0', 'capath/b1930218.0') + + +def print_cert(path): + import _ssl + pprint.pprint(_ssl._test_decode_cert(path)) + + if __name__ == '__main__': os.chdir(here) - cert, key = make_cert_key('localhost') + cert, key = make_cert_key('localhost', ext='req_x509_extensions_simple') with open('ssl_cert.pem', 'w') as f: f.write(cert) with open('ssl_key.pem', 'w') as f: f.write(key) print("password protecting ssl_key.pem in ssl_key.passwd.pem") - check_call(['openssl','rsa','-in','ssl_key.pem','-out','ssl_key.passwd.pem','-des3','-passout','pass:somepass']) - check_call(['openssl','rsa','-in','ssl_key.pem','-out','keycert.passwd.pem','-des3','-passout','pass:somepass']) + check_call(['openssl','pkey','-in','ssl_key.pem','-out','ssl_key.passwd.pem','-aes256','-passout','pass:somepass']) + check_call(['openssl','pkey','-in','ssl_key.pem','-out','keycert.passwd.pem','-aes256','-passout','pass:somepass']) with open('keycert.pem', 'w') as f: f.write(key) @@ -178,7 +218,7 @@ def make_ca(): # For certificate matching tests make_ca() - cert, key = make_cert_key('fakehostname') + cert, key = make_cert_key('fakehostname', ext='req_x509_extensions_simple') with open('keycert2.pem', 'w') as f: f.write(key) f.write(cert) @@ -193,6 +233,13 @@ def make_ca(): f.write(key) f.write(cert) + cert, key = make_cert_key( + 'localhost-ecc', True, key='param:secp384r1.pem' + ) + with open('keycertecc.pem', 'w') as f: + f.write(key) + f.write(cert) + extra_san = [ 'otherName.1 = 1.2.3.4;UTF8:some other identifier', 'otherName.2 = 1.3.6.1.5.2.2;SEQUENCE:princ_name', @@ -212,6 +259,24 @@ def make_ca(): f.write(key) f.write(cert) + extra_san = [ + # k?nig (king) + 'DNS.2 = xn--knig-5qa.idn.pythontest.net', + # k?nigsg??chen (king's alleyway) + 'DNS.3 = xn--knigsgsschen-lcb0w.idna2003.pythontest.net', + 'DNS.4 = xn--knigsgchen-b4a3dun.idna2008.pythontest.net', + # ????? (marble) + 'DNS.5 = xn--nxasmq6b.idna2003.pythontest.net', + 'DNS.6 = xn--nxasmm1c.idna2008.pythontest.net', + ] + + # IDN SANS, signed + cert, key = make_cert_key('idnsans', True, extra_san='\n'.join(extra_san)) + with open('idnsans.pem', 'w') as f: + f.write(key) + f.write(cert) + unmake_ca() - print("\n\nPlease change the values in test_ssl.py, test_parse_cert function related to notAfter,notBefore and serialNumber") - check_call(['openssl','x509','-in','keycert.pem','-dates','-serial','-noout']) + print("update Lib/test/test_ssl.py and Lib/test/test_asyncio/util.py") + print_cert('keycert.pem') + print_cert('keycert3.pem') diff --git a/Lib/test/pycacert.pem b/Lib/test/pycacert.pem index 09b1f3e08aee6..73150c960f358 100644 --- a/Lib/test/pycacert.pem +++ b/Lib/test/pycacert.pem @@ -1,78 +1,99 @@ Certificate: Data: Version: 3 (0x2) - Serial Number: 12723342612721443280 (0xb09264b1f2da21d0) - Signature Algorithm: sha1WithRSAEncryption + Serial Number: + cb:2d:80:99:5a:69:52:5b + Signature Algorithm: sha256WithRSAEncryption Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server Validity - Not Before: Jan 4 19:47:07 2013 GMT - Not After : Jan 2 19:47:07 2023 GMT + Not Before: Aug 29 14:23:16 2018 GMT + Not After : Aug 26 14:23:16 2028 GMT Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server Subject Public Key Info: Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) + Public-Key: (3072 bit) Modulus: - 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2: - 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4: - e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f: - e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f: - 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf: - 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d: - a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3: - e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4: - 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf: - 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c: - e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6: - c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a: - cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01: - 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87: - 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f: - 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14: - e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4: - c5:4d + 00:97:ed:55:41:ba:36:17:95:db:71:1c:d3:e1:61: + ac:58:73:e3:c6:96:cf:2b:1f:b8:08:f5:9d:4b:4b: + c7:30:f6:b8:0b:b3:52:72:a0:bb:c9:4d:3b:8e:df: + 22:8e:01:57:81:c9:92:73:cc:00:c6:ec:70:b0:3a: + 17:40:c1:df:f2:8c:36:4c:c4:a7:81:e7:b6:24:68: + e2:a0:7e:35:07:2f:a0:5b:f9:45:46:f7:1e:f0:46: + 11:fe:ca:1a:3c:50:f1:26:a9:5f:9c:22:9c:f8:41: + e1:df:4f:12:95:19:2f:5c:90:01:17:6e:7e:3e:7d: + cf:e9:09:af:25:f8:f8:42:77:2d:6d:5f:36:f2:78: + 1e:7d:4a:87:68:63:6c:06:71:1b:8d:fa:25:fe:d4: + d3:f5:a5:17:b1:ef:ea:17:cb:54:c8:27:99:80:cb: + 3c:45:f1:2c:52:1c:dd:1f:51:45:20:50:1e:5e:ab: + 57:73:1b:41:78:96:de:84:a4:7a:dd:8f:30:85:36: + 58:79:76:a0:d2:61:c8:1b:a9:94:99:63:c6:ee:f8: + 14:bf:b4:52:56:31:97:fa:eb:ac:53:9e:95:ce:4c: + c4:5a:4a:b7:ca:03:27:5b:35:57:ce:02:dc:ec:ca: + 69:f8:8a:5a:39:cb:16:20:15:03:24:61:6c:f4:7a: + fc:b6:48:e5:59:10:5c:49:d0:23:9f:fb:71:5e:3a: + e9:68:9f:34:72:80:27:b6:3f:4c:b1:d9:db:63:7f: + 67:68:4a:6e:11:f8:e8:c0:f4:5a:16:39:53:0b:68: + de:77:fa:45:e7:f8:91:cd:78:cd:28:94:97:71:54: + fb:cf:f0:37:de:c9:26:c5:dc:1b:9e:89:6d:09:ac: + c8:44:71:cb:6d:f1:97:31:d5:4c:20:33:bf:75:4a: + a0:e0:dc:69:11:ed:2a:b4:64:10:11:30:8b:0e:b0: + a7:10:d8:8a:c5:aa:1b:c8:26:8a:25:e7:66:9f:a5: + 6a:1a:2f:7c:5f:83:c6:78:4f:1f Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: - BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B + DD:BF:CA:DA:E6:D1:34:BA:37:75:21:CA:6F:9A:08:28:F2:35:B6:48 X509v3 Authority Key Identifier: - keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B + keyid:DD:BF:CA:DA:E6:D1:34:BA:37:75:21:CA:6F:9A:08:28:F2:35:B6:48 X509v3 Basic Constraints: CA:TRUE - Signature Algorithm: sha1WithRSAEncryption - 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6: - 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d: - a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95: - 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17: - 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c: - 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4: - fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7: - 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24: - 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33: - 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61: - ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f: - 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64: - b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb: - 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3: - 5e:58:c8:9e + Signature Algorithm: sha256WithRSAEncryption + 33:6a:54:d3:6b:c0:d7:01:5f:9d:f4:05:c1:93:66:90:50:d0: + b7:18:e9:b0:1e:4a:a0:b6:da:76:93:af:84:db:ad:15:54:31: + 15:13:e4:de:7e:4e:0c:d5:09:1c:34:35:b6:e5:4c:d6:6f:65: + 7d:32:5f:eb:fc:a9:6b:07:f7:49:82:e5:81:7e:07:80:9a:63: + f8:2c:c3:40:bc:8f:d4:2a:da:3e:d1:ee:08:b7:4d:a7:84:ca: + f4:3f:a1:98:45:be:b1:05:69:e7:df:d7:99:ab:1b:ee:8b:30: + cc:f7:fc:e7:d4:0b:17:ae:97:bf:e4:7b:fd:0f:a7:b4:85:79: + e3:59:e2:16:87:bf:1f:29:45:2c:23:93:76:be:c0:87:1d:de: + ec:2b:42:6a:e5:bb:c8:f4:0a:4a:08:0a:8c:5c:d8:7d:4d:d1: + b8:bf:d5:f7:29:ed:92:d1:94:04:e8:35:06:57:7f:2c:23:97: + 87:a5:35:8d:26:d3:1a:47:f2:16:d7:d9:c6:d4:1f:23:43:d3: + 26:99:39:ca:20:f4:71:23:6f:0c:4a:76:76:f7:76:1f:b3:fe: + bf:47:b0:fc:2a:56:81:e1:d2:dd:ee:08:d8:f4:ff:5a:dc:25: + 61:8a:91:02:b9:86:1c:f2:50:73:76:25:35:fc:b6:25:26:15: + cb:eb:c4:2b:61:0c:1c:e7:ee:2f:17:9b:ec:f0:d4:a1:84:e7: + d2:af:de:e4:1b:24:14:a7:01:87:e3:ab:29:58:46:a0:d9:c0: + 0a:e0:8d:d7:59:d3:1b:f8:54:20:3e:78:a5:a5:c8:4f:8b:03: + c4:96:9f:ec:fb:47:cf:76:2d:8d:65:34:27:bf:fa:ae:01:05: + 8a:f3:92:0a:dd:89:6c:97:a1:c7:e7:60:51:e7:ac:eb:4b:7d: + 2c:b8:65:c9:fe:5d:6a:48:55:8e:e4:c7:f9:6a:40:e1:b8:64: + 45:e9:b5:59:29:a5:5f:cf:7d:58:7d:64:79:e5:a4:09:ac:1e: + 76:65:3d:94:c4:68 -----BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV +MIIEbTCCAtWgAwIBAgIJAMstgJlaaVJbMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNV BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW -MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx -OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg -Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV -q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/ -AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA -Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni -0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx -6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w -HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2 -2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB -AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4 -QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1 -Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O -JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR -f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf -9mmvtk57HVjsO6lTo15YyJ4= +MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xODA4MjkxNDIzMTZaFw0yODA4MjYx +NDIzMTZaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg +Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCAaIwDQYJKoZI +hvcNAQEBBQADggGPADCCAYoCggGBAJftVUG6NheV23Ec0+FhrFhz48aWzysfuAj1 +nUtLxzD2uAuzUnKgu8lNO47fIo4BV4HJknPMAMbscLA6F0DB3/KMNkzEp4HntiRo +4qB+NQcvoFv5RUb3HvBGEf7KGjxQ8SapX5winPhB4d9PEpUZL1yQARdufj59z+kJ +ryX4+EJ3LW1fNvJ4Hn1Kh2hjbAZxG436Jf7U0/WlF7Hv6hfLVMgnmYDLPEXxLFIc +3R9RRSBQHl6rV3MbQXiW3oSket2PMIU2WHl2oNJhyBuplJljxu74FL+0UlYxl/rr +rFOelc5MxFpKt8oDJ1s1V84C3OzKafiKWjnLFiAVAyRhbPR6/LZI5VkQXEnQI5/7 +cV466WifNHKAJ7Y/TLHZ22N/Z2hKbhH46MD0WhY5Uwto3nf6Ref4kc14zSiUl3FU ++8/wN97JJsXcG56JbQmsyERxy23xlzHVTCAzv3VKoODcaRHtKrRkEBEwiw6wpxDY +isWqG8gmiiXnZp+lahovfF+DxnhPHwIDAQABo1AwTjAdBgNVHQ4EFgQU3b/K2ubR +NLo3dSHKb5oIKPI1tkgwHwYDVR0jBBgwFoAU3b/K2ubRNLo3dSHKb5oIKPI1tkgw +DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAYEAM2pU02vA1wFfnfQFwZNm +kFDQtxjpsB5KoLbadpOvhNutFVQxFRPk3n5ODNUJHDQ1tuVM1m9lfTJf6/ypawf3 +SYLlgX4HgJpj+CzDQLyP1CraPtHuCLdNp4TK9D+hmEW+sQVp59/Xmasb7oswzPf8 +59QLF66Xv+R7/Q+ntIV541niFoe/HylFLCOTdr7Ahx3e7CtCauW7yPQKSggKjFzY +fU3RuL/V9yntktGUBOg1Bld/LCOXh6U1jSbTGkfyFtfZxtQfI0PTJpk5yiD0cSNv +DEp2dvd2H7P+v0ew/CpWgeHS3e4I2PT/WtwlYYqRArmGHPJQc3YlNfy2JSYVy+vE +K2EMHOfuLxeb7PDUoYTn0q/e5BskFKcBh+OrKVhGoNnACuCN11nTG/hUID54paXI +T4sDxJaf7PtHz3YtjWU0J7/6rgEFivOSCt2JbJehx+dgUees60t9LLhlyf5dakhV +juTH+WpA4bhkRem1WSmlX899WH1keeWkCawedmU9lMRo -----END CERTIFICATE----- diff --git a/Lib/test/pycakey.pem b/Lib/test/pycakey.pem index fc6effefb2104..c283f89098684 100644 --- a/Lib/test/pycakey.pem +++ b/Lib/test/pycakey.pem @@ -1,28 +1,40 @@ -----BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDn3unjDJ8AtqH9 -K1uW0m/M4L6GuSBe7AN6VavqpOn5SYXSZtXtx3rqVo4tj+dC4mIoqZ/WG47rtbSc -nxSr3+aUi3YdPm0kYe0MvwCKYQzfXMg2cxYAzUe6baSkdIiDIwoZ/AmnPEpL0+cd -LeTqTFQh8ybbiTcY1AK7QDJfpP8tHPfUu+yOz1yCrOZ8CGxIhWEHfyXgXOC8NF/g -uQRHdchHC4281shoXzODYtIgRDWxrYEais28NbBci0fWGOmcGJfMATwpzOge5OTB -uN7nwhEYh1qTNNimJfcUcevkIaLSDy4u1GIANdPW71xgS0ypFOLdFVhGNzMmt+cu -Xe1C5MVNAgMBAAECggEBAJPM7QuUrPn4cLN/Ysd15lwTWn9oHDFFgkYFvCs66gXE -ju/6Kx2BjWE4wTJby09AHM/MqB0DvguT7Mf1Q2j3tPQ1HZowg8OwRDleuwp6KIls -jBbhL0Jdl/5HC67ktWvZ9wNvO/wFG1rQfT6FVajf9LUbWEaSZbOG2SLhHfsHorzu -xjTJaI3bQ/0+79B1exwk5ruwhzFRd/XpY8hls7D/RfPIuHDlBghkW3N59KFWrf5h -6bNEh2THm0+IyGcGqs0FD+QCOXyvsjwSUswqrr2ctLREOeDcd5ReUjSxYgjcJRrm -J7ceIY/+uwDJxw/OlnmBvF6pQMkKwYW2gFztu+g2t4UCgYEA/9yo01Exz4crxXsy -tAlnDJM++nZcm07rtFjTKHUfKY/cCgNTa8udM0svnfwlid/dpgLsI38gx04HHC1i -EZ4acz+ToIWedLxM0nq73//xeRWEazOvCz1mMTZaMldahTWAyzN8qVK2B/625Yy4 -wNYWyweBBwEB8MzaCs73spksXOsCgYEA5/7wvhiofYGFAfMuANeJIwDL2OtBnoOv -mVNfCmi3GC38fzwyi5ZpskWDiS2woJ+LQfs9Qu4EcZbUFLd7gbeOvb5gmFUtYope -LitUUKunIR18MkQ+mQDBpQPQPhk4QJP5reCbWkrfTu7b5o/iS41s6fBTFmuzhLcT -C71vFdCyeKcCgYAiCCqYeOtELDmBOeLDmaCQRqGQ1N96dOPbCBmF/xYXBCCDYG/f -HaUaJnz96YTgstsbcrYP/p/Qgqtlbw/lQf9IpwMuzbcG1ejt8g89OyDWNyt2ytgU -iaUnFJCos3/Byh0Iah/BsdOueo2/OJl2ZMOBW80orlSgv86cs2y037TL4wKBgQDm -OOyW+MlbowhnIvfoBfwlLEkefnej4nKD6WRLZBcue5Qyf355X06Mhsc9foXlH+6G -D9h/bswiHNdhp6N82rdgPGiHQx/CxiUoE/+b/nvgNO5mw6qLE2EXbG1e8pAMJcyE -bHw+YkawggDfELI036fRj5gki8SeUz8nS1nNgElbyQKBgCRDX9Jh+MwSLu4QBWdt -/fi+lv3K6kun/fI7EOV1vCV/j871tICu7pu5BrOLxAHqoVfU9AUX299/2KjCb5pv -kjogiUK6qWCWBlfuqDNWGCoUGt1rhznUva0nNjSMy5rinBhhjpROZC2pw48lOluP -UuvXsaPph7GTqPuy4Kab12YC +MIIG/AIBADANBgkqhkiG9w0BAQEFAASCBuYwggbiAgEAAoIBgQCX7VVBujYXldtx +HNPhYaxYc+PGls8rH7gI9Z1LS8cw9rgLs1JyoLvJTTuO3yKOAVeByZJzzADG7HCw +OhdAwd/yjDZMxKeB57YkaOKgfjUHL6Bb+UVG9x7wRhH+yho8UPEmqV+cIpz4QeHf +TxKVGS9ckAEXbn4+fc/pCa8l+PhCdy1tXzbyeB59SodoY2wGcRuN+iX+1NP1pRex +7+oXy1TIJ5mAyzxF8SxSHN0fUUUgUB5eq1dzG0F4lt6EpHrdjzCFNlh5dqDSYcgb +qZSZY8bu+BS/tFJWMZf666xTnpXOTMRaSrfKAydbNVfOAtzsymn4ilo5yxYgFQMk +YWz0evy2SOVZEFxJ0COf+3FeOulonzRygCe2P0yx2dtjf2doSm4R+OjA9FoWOVML +aN53+kXn+JHNeM0olJdxVPvP8DfeySbF3BueiW0JrMhEcctt8Zcx1UwgM791SqDg +3GkR7Sq0ZBARMIsOsKcQ2IrFqhvIJool52afpWoaL3xfg8Z4Tx8CAwEAAQKCAYB6 +1g1kwyYRE70FS4WUaOBr8+dqHW0LNO4bcFrpEi/PSuurqiUzQPoT3DoXXhoWLseN +zGh476yBKZJDKfS7CwYCmZMdprK4uZvu/E6f7Or7EGrbckOtCQkew8iw9L8ZnWgd +FjyThPjdUIdLgidIHcDJWjVHuLKh3B9KD+ZpEU/IjYtRLvbCPJSKQMQShrBE1Rau +SF6IF5P4vK7X0162NlQqMLpQBAKLml93VJcERzVY1u53JJnkG1loIrNvE32zvZ0C +ZnGVpWwamixVrO9K66F+Ml3Y3bkguF8aPUitc+l+yPmUSXmcDcKmhw9DZA0k5t39 +FxVYGn1uJlvHll8QvV9aZtzuTSkAN8VWNufGwivLLsoRlRb1LtGWqHY583FlUWtz +99ABCBehZ2EpAP+MrRj+pyKuMrkQH61bbOhjqifBM8MhHdn9uNmMpvnKyGPMIdRY +cLH4i2S5aQVvmsQbOa98DLOFGXdf+z5HuwdxHtG1S3J7jkT+FkIyYDehJA3X8UEC +gcEAyCpD8rMFfR5qLwrajhy8vbV7TIkNfFHEkm9tCWDBHwuOJqA0DFuMDAKl7cMv +Uo7Z6R2Fqe2OyWvxYkOi/CSjvtT+PTiA0ux1tXUZcxcRSIsLqQZV+elsKcv+QJPy +vf02vNvHjaMaRwl+NYtqpfr1s/3EdJnWCNC3nV1dD+mWVJoO3kGAK5grLAPM1/uP +stARN5Tnh3Doh8e1Yl4V4UKcVqyVqDykX1OLSmPqNH86T4Um0B4h+jf4UBBdDBz1 +rD3JAoHBAMJOZ3M7LqX+F2haSrF/hnG1y9qAqDWGsvy+8YgjFwPFWu7LvqLuXLuz +S3+5GGhplMuM0itqA9PyPotlgtG5O9hAU8SyMitrx1uTW+Q2U3iYPZQ9O327l1cO +F2jKljq0aJrXp+5iWUq8t/FG6DAqYYUCY/X1SheqEXCgCh4ldRhXig3TBYbVZNs9 +7azN0lk408AO/Hx7WYreFQVS7A/EJhk/M1yyIqnJESuxkDefjV4hTVkRXhh+MrCe +vF/jHqh5pwKBwHxXPQRbzvINXbrBTEjxcxGJ1gESNg1fIfQxQZOMxgrJ+9DkvdBb +YiDn2DldgV0Qni8ghrKrfoKDClyXVXy6KfnWh+Rx4BymhOxmxJto3fSpY2HpLKll +JirErLli7my1CjbBdDH4+s7cB8mtRF+9CLp5znr8QSgSt60KnU/QM/F0Df5kxADQ +syjRZ4NXoslaVQeo+TZ6nggSuAtWFNNstH9nEESE/zq0RBe+/3MDAa76MMUhosuz +zw21TIfEyZvoeQKBwDpszNpvPzWWU3+DNtZsXAaw/Vz0Np/xorwwxfuDYZY2r4MC +LI5dUfD2losPIvGyXZVfAIshU4lVW80adt2M7xu1K/sHAeLgg49bndPfKfYnAM0k +JFFIKNd6WzudPtLkEFgO5GXfmK3KVRztjz98XtpZv6jjWqYG8zuEQ8aQyMbK+63w +d8b1P2BVHLRLJybA2Zr0ZqMfi+sfn/570pNjDXml8VG8FoQq+0jCGXVAOofFR7ay +bDK9L4zADjBe4IcUHQKBwFwj8TEVlWxtG+IWO5d+vyuP0OPjSYOmYq4dCMyZ2+Xy +Y+XDYEhlgGTVxafRMTwt57VV3hJTtRxUZziDA++atr8+gPio+QHBYg1JgCKsqKYL +TGoSVrM1jTfdl1orwkpgQmq2q5j7ExpNA3Spsm5kyCaJ1S/8Ivusqaod8S4t7UhW +BRec3gQ+UYv/V3Pc9hS1Zdzf5+G+PDOYoNmveY16hcu0DKc/PlqGtJuBoQjjH7ir +1YVK9GAgLk0VqJvePnF57A== -----END PRIVATE KEY----- diff --git a/Lib/test/revocation.crl b/Lib/test/revocation.crl index 6d89b08ebea20..c05461ca7f938 100644 --- a/Lib/test/revocation.crl +++ b/Lib/test/revocation.crl @@ -1,11 +1,14 @@ -----BEGIN X509 CRL----- -MIIBpjCBjwIBATANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJYWTEmMCQGA1UE +MIICJjCBjwIBATANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQGEwJYWTEmMCQGA1UE CgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNVBAMMDW91ci1j -YS1zZXJ2ZXIXDTEzMTEyMTE3MDg0N1oXDTIzMDkzMDE3MDg0N1qgDjAMMAoGA1Ud -FAQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQCNJXC2mVKauEeN3LlQ3ZtM5gkH3ExH -+i4bmJjtJn497WwvvoIeUdrmVXgJQR93RtV37hZwN0SXMLlNmUZPH4rHhihayw4m -unCzVj/OhCCY7/TPjKuJ1O/0XhaLBpBVjQN7R/1ujoRKbSia/CD3vcn7Fqxzw7LK -fSRCKRGTj1CZiuxrphtFchwALXSiFDy9mr2ZKhImcyq1PydfgEzU78APpOkMQsIC -UNJ/cf3c9emzf+dUtcMEcejQ3mynBo4eIGg1EW42bz4q4hSjzQlKcBV0muw5qXhc -HOxH2iTFhQ7SrvVuK/dM14rYM4B5mSX3nRC1kNmXpS9j3wJDhuwmjHed +YS1zZXJ2ZXIXDTE4MDgyOTE0MjMxNloXDTI4MDcwNzE0MjMxNlqgDjAMMAoGA1Ud +FAQDAgEAMA0GCSqGSIb3DQEBCwUAA4IBgQCPhrtGSbuvxPAI3YWQFDB4iOWdBnVk +ugW1lsifmCsE86FfID0EwUut1SRHlksltMtcoULMEIdu8yMLWci++4ve22EEuMKT +HUc3T/wBIuQUhA7U4deFG8CZPAxRpNoK470y7dkD4OVf0Gxa6WYDl9z8mXKmWCB9 +hvzqVfLWNSLTAVPsHtkD5PXdi5yRkQr6wYD7poWaIvkpsn7EKCY6Tw5V3rsbRuZq +AGVCq5TH3mctcmwLloCJ4Xr/1q0DsRrYxeeLYxE+UpvvCbVBKgtjBK7zINS7AbcJ +CYCYKUwGWv1fYKJ+KQQHf75mT3jQ9lWuzOj/YWK4k1EBnYmVGuKKt73lLFxC6h3y +MUnaBZc1KZSyJj0IxfHg/o6qx8NgKOl9XRIQ5g5B30cwpPOskGhEhodbTTY3bPtm +RQ36JvQZngzmkhyhr+MDEV5yUTOShfUiclzQOx26CmLmLHWxOZgXtFZob/oKrvbm +Gen/+7K7YTw6hfY52U7J2FuQRGOyzBXfBYQ= -----END X509 CRL----- diff --git a/Lib/test/ssl_cert.pem b/Lib/test/ssl_cert.pem index 47a7d7e37e809..de596717bd855 100644 --- a/Lib/test/ssl_cert.pem +++ b/Lib/test/ssl_cert.pem @@ -1,15 +1,26 @@ -----BEGIN CERTIFICATE----- -MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV -BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u -IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw -MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH -Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k -YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw -gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 -6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt -pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw -FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd -BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G -lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 -CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX +MIIEWTCCAsGgAwIBAgIJAJinz4jHSjLtMA0GCSqGSIb3DQEBCwUAMF8xCzAJBgNV +BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u +IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODA4 +MjkxNDIzMTVaFw0yODA4MjYxNDIzMTVaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH +DA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9uIFNvZnR3YXJlIEZvdW5k +YXRpb24xEjAQBgNVBAMMCWxvY2FsaG9zdDCCAaIwDQYJKoZIhvcNAQEBBQADggGP +ADCCAYoCggGBALKUqUtopT6E68kN+uJNEt34i2EbmG/bwjcD8IaMsgJPSsMO2Bpd +3S6qWgkCeOyCfmAwBxK2kNbxGb63ouysEv7l8GCTJTWv3hG/HQcejJpnAEGi6K1U +fDbyE/db6yZ12SoHVTGkadN4vYGCPd1Wj9ZO1F877SHQ8rDWX3xgTWkxN2ojBw44 +T8RHSDiG8D/CvG4uEy+VUszL+Uvny5y2poNSqvI3J56sptWSrh8nIIbkPZPBdUne +LYMOHTFK3ZjXSmhlXgziTxK71nnzM3Y9K9gxPnRqoXbvu/wFo55hQCkETiRkYgmm +jXcBMZ0TClQVnQWuLjMthRnWFZs4Lfmwqjs7FZD/61581R2BYehvpWbLvvuOJhwv +DFzexL2sXcAl7SsxbzeQKRHqGbIDfbnQTXfs3/VC6Ye5P82P2ucj+XC32N9piRmO +gCBP8L3ub+YzzdxikZN2gZXXE2jsb3QyE/R2LkWdWyshpKe+RsZP1SBRbHShUyOh +yJ90baoiEwj2mwIDAQABoxgwFjAUBgNVHREEDTALgglsb2NhbGhvc3QwDQYJKoZI +hvcNAQELBQADggGBAHRUO/UIHl3jXQENewYayHxkIx8t7nu40iO2DXbicSijz5bo +5//xAB6RxhBAlsDBehgQP1uoZg+WJW+nHu3CIVOU3qZNZRaozxiCl2UFKcNqLOmx +R3NKpo1jYf4REQIeG8Yw9+hSWLRbshNteP6bKUUf+vanhg9+axyOEOH/iOQvgk/m +b8wA8wNa4ujWljPbTQnj7ry8RqhTM0GcAN5LSdSvcKcpzLcs3aYwh+Z8e30sQWna +F40sa5u7izgBTOrwpcDm/w5kC46vpRQ5fnbshVw6pne2by0mdMECASid/p25N103 +jMqTFlmO7kpf/jpCSmamp3/JSEE1BJKHwQ6Ql4nzRA2N1mnvWH7Zxcv043gkHeAu +0x8evpvwuhdIyproejNFlBpKmW8OX7yKTCPPMC/VkX8Q1rVkxU0DQ6hmvwZlhoKa +9Wc2uXpw9xF8itV4Uvcdr3dwqByvIqn7iI/gB+4l41e0u8OmH2MKOx4Nxlly5TNW +HcVKQHyOeyvnINuBAQ== -----END CERTIFICATE----- diff --git a/Lib/test/ssl_key.passwd.pem b/Lib/test/ssl_key.passwd.pem index 2524672e70d19..46de61ab85b13 100644 --- a/Lib/test/ssl_key.passwd.pem +++ b/Lib/test/ssl_key.passwd.pem @@ -1,18 +1,42 @@ ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,1A8D9D2A02EC698A - -kJYbfZ8L0sfe9Oty3gw0aloNnY5E8fegRfQLZlNoxTl6jNt0nIwI8kDJ36CZgR9c -u3FDJm/KqrfUoz8vW+qEnWhSG7QPX2wWGPHd4K94Yz/FgrRzZ0DoK7XxXq9gOtVA -AVGQhnz32p+6WhfGsCr9ArXEwRZrTk/FvzEPaU5fHcoSkrNVAGX8IpSVkSDwEDQr -Gv17+cfk99UV1OCza6yKHoFkTtrC+PZU71LomBabivS2Oc4B9hYuSR2hF01wTHP+ -YlWNagZOOVtNz4oKK9x9eNQpmfQXQvPPTfusexKIbKfZrMvJoxcm1gfcZ0H/wK6P -6wmXSG35qMOOztCZNtperjs1wzEBXznyK8QmLcAJBjkfarABJX9vBEzZV0OUKhy+ -noORFwHTllphbmydLhu6ehLUZMHPhzAS5UN7srtpSN81eerDMy0RMUAwA7/PofX1 -94Me85Q8jP0PC9ETdsJcPqLzAPETEYu0ELewKRcrdyWi+tlLFrpE5KT/s5ecbl9l -7B61U4Kfd1PIXc/siINhU3A3bYK+845YyUArUOnKf1kEox7p1RpD7yFqVT04lRTo -cibNKATBusXSuBrp2G6GNuhWEOSafWCKJQAzgCYIp6ZTV2khhMUGppc/2H3CF6cO -zX0KtlPVZC7hLkB6HT8SxYUwF1zqWY7+/XPPdc37MeEZ87Q3UuZwqORLY+Z0hpgt -L5JXBCoklZhCAaN2GqwFLXtGiRSRFGY7xXIhbDTlE65Wv1WGGgDLMKGE1gOz3yAo -2jjG1+yAHJUdE69XTFHSqSkvaloA1W03LdMXZ9VuQJ/ySXCie6ABAQ== ------END RSA PRIVATE KEY----- +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIHbTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQI072N7W+PDDMCAggA +MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBA/AuaRNi4vE4KGqI4In+70BIIH +ENGS5Vex5NID873frmd1UZEHZ+O/Bd0wDb+NUpIqesHkRYf7kKi6Gnr+nKQ/oVVn +Lm3JjE7c8ECP0OkOOXmiXuWL1SkzBBWqCI4stSGUPvBiHsGwNnvJAaGjUffgMlcC +aJOA2+dnejLkzblq4CB2LQdm06N3Xoe9tyqtQaUHxfzJAf5Ydd8uj7vpKN2MMhY7 +icIPJwSyh0N7S6XWVtHEokr9Kp4y2hS5a+BgCWV1/1z0aF7agnSVndmT1VR+nWmc +lM14k+lethmHMB+fsNSjnqeJ7XOPlOTHqhiZ9bBSTgF/xr5Bck/NiKRzHjdovBox +TKg+xchaBhpRh7wBPBIlNJeHmIjv+8obOKjKU98Ig/7R9+IryZaNcKAH0PuOT+Sw +QHXiCGQbOiYHB9UyhDTWiB7YVjd8KHefOFxfHzOQb/iBhbv1x3bTl3DgepvRN6VO +dIsPLoIZe42sdf9GeMsk8mGJyZUQ6AzsfhWk3grb/XscizPSvrNsJ2VL1R7YTyT3 +3WA4ZXR1EqvXnWL7N/raemQjy62iOG6t7fcF5IdP9CMbWP+Plpsz4cQW7FtesCTq +a5ZXraochQz361ODFNIeBEGU+0qqXUtZDlmos/EySkZykSeU/L0bImS62VGE3afo +YXBmznTTT9kkFkqv7H0MerfJsrE/wF8puP3GM01DW2JRgXRpSWlvbPV/2LnMtRuD +II7iH4rWDtTjCN6BWKAgDOnPkc9sZ4XulqT32lcUeV6LTdMBfq8kMEc8eDij1vUT +maVCRpuwaq8EIT3lVgNLufHiG96ojlyYtj3orzw22IjkgC/9ee8UDik9CqbMVmFf +fVHhsw8LNSg8Q4bmwm5Eg2w2it2gtI68+mwr75oCxuJ/8OMjW21Prj8XDh5reie2 +c0lDKQOFZ9UnLU1bXR/6qUM+JFKR4DMq+fOCuoQSVoyVUEOsJpvBOYnYZN9cxsZm +vh9dKafMEcKZ8flsbr+gOmOw7+Py2ifSlf25E/Frb1W4gtbTb0LQVHb6+drutrZj +8HEu4CnHYFCD4ZnOJb26XlZCb8GFBddW86yJYyUqMMV6Q1aJfAOAglsTo1LjIMOZ +byo0BTAmwUevU/iuOXQ4qRBXXcoidDcTCrxfUSPG9wdt9l+m5SdQpWqfQ+fx5O7m +SLlrHyZCiPSFMtC9DxqjIklHjf5W3wslGLgaD30YXa4VDYkRihf3CNsxGQ+tVvef +l0ZjoAitF7Gaua06IESmKnpHe23dkr1cjYq+u2IV+xGH8LeExdwsQ9kpuTeXPnQs +JOA99SsFx1ct32RrwjxnDDsiNkaViTKo9GDkV3jQTfoFgAVqfSgg9wGXpqUqhNG7 +TiSIHCowllLny2zn4XrXCy2niD3VDt0skb3l/PaegHE2z7S5YY85nQtYwpLiwB9M +SQ08DYKxPBZYKtS2iZ/fsA1gjSRQDPg/SIxMhUC3M3qH8iWny1Lzl25F2Uq7VVEX +LdTUtaby49jRTT3CQGr5n6z7bMbUegiY7h8WmOekuThGDH+4xZp6+rDP4GFk4FeK +JcF70vMQYIjQZhadic6olv+9VtUP42ltGG/yP9a3eWRkzfAf2eCh6B1rYdgEWwE8 +rlcZzwM+y6eUmeNF2FVWB8iWtTMQHy+dYNPM+Jtus1KQKxiiq/yCRs7nWvzWRFWA +HRyqV0J6/lqgm4FvfktFt1T0W+mDoLJOR2/zIwMy2lgL5zeHuR3SaMJnCikJbqKS +HB3UvrhAWUcZqdH29+FhVWeM7ybyF1Wccmf+IIC/ePLa6gjtqPV8lG/5kbpcpnB6 +UQY8WWaKMxyr3jJ9bAX5QKshchp04cDecOLZrpFGNNQngR8RxSEkiIgAqNxWunIu +KrdBDrupv/XAgEOclmgToY3iywLJSV5gHAyHWDUhRH4cFCLiGPl4XIcnXOuTze3H +3j+EYSiS3v3DhHjp33YU2pXlJDjiYsKzAXejEh66++Y8qaQdCAad3ruWRCzW3kgk +Md0A1VGzntTnQsewvExQEMZH2LtYIsPv3KCYGeSAuLabX4tbGk79PswjnjLLEOr0 +Ghf6RF6qf5/iFyJoG4vrbKT8kx6ywh0InILCdjUunuDskIBxX6tEcr9XwajoIvb2 +kcmGdjam5kKLS7QOWQTl8/r/cuFes0dj34cX5Qpq+Gd7tRq/D+b0207926Cxvftv +qQ1cVn8HiLxKkZzd3tpf2xnoV1zkTL0oHrNg+qzxoxXUTUcwtIf1d/HRbYEAhi/d +bBBoFeftEHWNq+sJgS9bH+XNzo/yK4u04B5miOq8v4CSkJdzu+ZdF22d4cjiGmtQ +8BTmcn0Unzm+u5H0+QSZe54QBHJGNXXOIKMTkgnOdW27g4DbI1y7fCqJiSMbRW6L +oHmMfbdB3GWqGbsUkhY8i6h9op0MU6WOX7ea2Rxyt4t6 +-----END ENCRYPTED PRIVATE KEY----- diff --git a/Lib/test/ssl_key.pem b/Lib/test/ssl_key.pem index 3fd3bbd54a345..1ea4578d81ecc 100644 --- a/Lib/test/ssl_key.pem +++ b/Lib/test/ssl_key.pem @@ -1,16 +1,40 @@ -----BEGIN PRIVATE KEY----- -MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm -LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 -ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP -USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt -CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq -SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK -UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y -BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ -ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 -oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik -eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F -0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS -x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ -SPIXQuT8RMPDVNQ= +MIIG/wIBADANBgkqhkiG9w0BAQEFAASCBukwggblAgEAAoIBgQCylKlLaKU+hOvJ +DfriTRLd+IthG5hv28I3A/CGjLICT0rDDtgaXd0uqloJAnjsgn5gMAcStpDW8Rm+ +t6LsrBL+5fBgkyU1r94Rvx0HHoyaZwBBouitVHw28hP3W+smddkqB1UxpGnTeL2B +gj3dVo/WTtRfO+0h0PKw1l98YE1pMTdqIwcOOE/ER0g4hvA/wrxuLhMvlVLMy/lL +58uctqaDUqryNyeerKbVkq4fJyCG5D2TwXVJ3i2DDh0xSt2Y10poZV4M4k8Su9Z5 +8zN2PSvYMT50aqF277v8BaOeYUApBE4kZGIJpo13ATGdEwpUFZ0Fri4zLYUZ1hWb +OC35sKo7OxWQ/+tefNUdgWHob6Vmy777jiYcLwxc3sS9rF3AJe0rMW83kCkR6hmy +A3250E137N/1QumHuT/Nj9rnI/lwt9jfaYkZjoAgT/C97m/mM83cYpGTdoGV1xNo +7G90MhP0di5FnVsrIaSnvkbGT9UgUWx0oVMjocifdG2qIhMI9psCAwEAAQKCAYBT +sHmaPmNaZj59jZCqp0YVQlpHWwBYQ5vD3pPE6oCttm0p9nXt/VkfenQRTthOtmT1 +POzDp00/feP7zeGLmqSYUjgRekPw4gdnN7Ip2PY5kdW77NWwDSzdLxuOS8Rq1MW9 +/Yu+ZPe3RBlDbT8C0IM+Atlh/BqIQ3zIxN4g0pzUlF0M33d6AYfYSzOcUhibOO7H +j84r+YXBNkIRgYKZYbutRXuZYaGuqejRpBj3voVu0d3Ntdb6lCWuClpB9HzfGN0c +RTv8g6UYO4sK3qyFn90ibIR/1GB9watvtoWVZqggiWeBzSWVWRsGEf9O+Cx4oJw1 +IphglhmhbgNksbj7bD24on/icldSOiVkoUemUOFmHWhCm4PnB1GmbD8YMfEdSbks +qDr1Ps1zg4mGOinVD/4cY7vuPFO/HCH07wfeaUGzRt4g0/yLr+XjVofOA3oowyxv +JAzr+niHA3lg5ecj4r7M68efwzN1OCyjMrVJw2RAzwvGxE+rm5NiT08SWlKQZnkC +gcEA4wvyLpIur/UB84nV3XVJ89UMNBLm++aTFzld047BLJtMaOhvNqx6Cl5c8VuW +l261KHjiVzpfNM3/A2LBQJcYkhX7avkqEXlj57cl+dCWAVwUzKmLJTPjfaTTZnYJ +xeN3dMYjJz2z2WtgvfvDoJLukVwIMmhTY8wtqqYyQBJ/l06pBsfw5TNvmVIOQHds +8ASOiFt+WRLk2bl9xrGGayqt3VV93KVRzF27cpjOgEcG74F3c0ZW9snERN7vIYwB +JfrlAoHBAMlahPwMP2TYylG8OzHe7EiehTekSO26LGh0Cq3wTGXYsK/q8hQCzL14 +kWW638vpwXL6L9ntvrd7hjzWRO3vX/VxnYEA6f0bpqHq1tZi6lzix5CTUN5McpDg +QnjenSJNrNjS1zEF8WeY9iLEuDI/M/iUW4y9R6s3WpgQhPDXpSvd2g3gMGRUYhxQ +Xna8auiJeYFq0oNaOxvJj+VeOfJ3ZMJttd+Y7gTOYZcbg3SdRb/kdxYki0RMD2hF +4ZvjJ6CTfwKBwQDiMqiZFTJGQwYqp4vWEmAW+I4r4xkUpWatoI2Fk5eI5T9+1PLX +uYXsho56NxEU1UrOg4Cb/p+TcBc8PErkGqR0BkpxDMOInTOXSrQe6lxIBoECVXc3 +HTbrmiay0a5y5GfCgxPKqIJhfcToAceoVjovv0y7S4yoxGZKuUEe7E8JY2iqRNAO +yOvKCCICv/hcN235E44RF+2/rDlOltagNej5tY6rIFkaDdgOF4bD7f9O5eEni1Bg +litfoesDtQP/3rECgcEAkQfvQ7D6tIPmbqsbJBfCr6fmoqZllT4FIJN84b50+OL0 +mTGsfjdqC4tdhx3sdu7/VPbaIqm5NmX10bowWgWSY7MbVME4yQPyqSwC5NbIonEC +d6N0mzoLR0kQ+Ai4u+2g82gicgAq2oj1uSNi3WZi48jQjHYFulCbo246o1NgeFFK +77WshYe2R1ioQfQDOU1URKCR0uTaMHClgfu112yiGd12JAD+aF3TM0kxDXz+sXI5 +SKy311DFxECZeXRLpcC3AoHBAJkNMJWTyPYbeVu+CTQkec8Uun233EkXa2kUNZc/ +5DuXDaK+A3DMgYRufTKSPpDHGaCZ1SYPInX1Uoe2dgVjWssRL2uitR4ENabDoAOA +ICVYXYYNagqQu5wwirF0QeaMXo1fjhuuHQh8GsMdXZvYEaAITZ9/NG5x/oY08+8H +kr78SMBOPy3XQn964uKG+e3JwpOG14GKABdAlrHKFXNWchu/6dgcYXB87mrC/GhO +zNwzC+QhFTZoOomFoqMgFWujng== -----END PRIVATE KEY----- diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index b23889b20dea7..66a3413b6970c 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -77,8 +77,8 @@ async def doit(): ONLYKEY = data_file('ssl_key.pem') SIGNED_CERTFILE = data_file('keycert3.pem') SIGNING_CA = data_file('pycacert.pem') -PEERCERT = {'serialNumber': 'B09264B1F2DA21D1', - 'version': 1, +PEERCERT = {'serialNumber': 'CB2D80995A69525C', + 'version': 3, 'subject': ((('countryName', 'XY'),), (('localityName', 'Castle Anthrax'),), (('organizationName', 'Python Software Foundation'),), @@ -86,8 +86,16 @@ async def doit(): 'issuer': ((('countryName', 'XY'),), (('organizationName', 'Python Software Foundation CA'),), (('commonName', 'our-ca-server'),)), - 'notAfter': 'Nov 13 19:47:07 2022 GMT', - 'notBefore': 'Jan 4 19:47:07 2013 GMT'} + 'notAfter': 'Jul 7 14:23:16 2028 GMT', + 'notBefore': 'Aug 29 14:23:16 2018 GMT', + 'subjectAltName': (('DNS', 'localhost'),), + 'OCSP': ('http://testca.pythontest.net/testca/ocsp/',), + 'caIssuers': ( + 'http://testca.pythontest.net/testca/pycacert.cer', + ), + 'crlDistributionPoints': ( + 'http://testca.pythontest.net/testca/revocation.crl', + )} class MyBaseProto(asyncio.Protocol): @@ -1242,6 +1250,8 @@ def test_create_server_ssl_verified(self): server.close() self.loop.run_until_complete(proto.done) + maxDiff = None + def test_legacy_create_server_ssl_verified(self): with test_utils.force_legacy_ssl_support(): self.test_create_server_ssl_verified() diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 30a64ee0a4c7e..44c2725d2c2f7 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -228,9 +228,9 @@ def test_parse_cert(self): (('commonName', 'localhost'),)) ) # Note the next three asserts will fail if the keys are regenerated - self.assertEqual(p['notAfter'], asn1time('Oct 5 23:01:56 2020 GMT')) - self.assertEqual(p['notBefore'], asn1time('Oct 8 23:01:56 2010 GMT')) - self.assertEqual(p['serialNumber'], 'D7C7381919AFC24E') + self.assertEqual(p['notAfter'], asn1time('Aug 26 14:23:15 2028 GMT')) + self.assertEqual(p['notBefore'], asn1time('Aug 29 14:23:15 2018 GMT')) + self.assertEqual(p['serialNumber'], '98A7CF88C74A32ED') self.assertEqual(p['subject'], ((('countryName', 'XY'),), (('localityName', 'Castle Anthrax'),), diff --git a/Misc/NEWS.d/next/Library/2020-07-01-16-59-46.bpo-41183.9stVAW.rst b/Misc/NEWS.d/next/Library/2020-07-01-16-59-46.bpo-41183.9stVAW.rst new file mode 100644 index 0000000000000..1ca3c7d7996c1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-01-16-59-46.bpo-41183.9stVAW.rst @@ -0,0 +1 @@ +Use 3072 RSA keys and SHA-256 signature for test certs and keys. From webhook-mailer at python.org Thu Jul 2 06:43:33 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Jul 2020 10:43:33 -0000 Subject: [Python-checkins] bpo-41193: Ignore OSError in readline write_history() (GH-21279) Message-ID: https://github.com/python/cpython/commit/0ab917e07ed64c6bfde6f6e791f9b28acc97b510 commit: 0ab917e07ed64c6bfde6f6e791f9b28acc97b510 branch: master author: Victor Stinner committer: GitHub date: 2020-07-02T12:43:25+02:00 summary: bpo-41193: Ignore OSError in readline write_history() (GH-21279) The write_history() atexit function of the readline completer now ignores any OSError to ignore error if the filesystem is read-only, instead of only ignoring FileNotFoundError and PermissionError. files: A Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst M Lib/site.py diff --git a/Lib/site.py b/Lib/site.py index 544306cd40e32..8979365cafc37 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -462,9 +462,9 @@ def register_readline(): def write_history(): try: readline.write_history_file(history) - except (FileNotFoundError, PermissionError): - # home directory does not exist or is not writable - # https://bugs.python.org/issue19891 + except OSError: + # bpo-19891, bpo-41193: Home directory does not exist + # or is not writable, or the filesystem is read-only. pass atexit.register(write_history) diff --git a/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst b/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst new file mode 100644 index 0000000000000..8807d9c21febd --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst @@ -0,0 +1,4 @@ +The ``write_history()`` atexit function of the readline completer now +ignores any :exc:`OSError` to ignore error if the filesystem is read-only, +instead of only ignoring :exc:`FileNotFoundError` and +:exc:`PermissionError`. From webhook-mailer at python.org Thu Jul 2 07:02:31 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Jul 2020 11:02:31 -0000 Subject: [Python-checkins] bpo-41193: Ignore OSError in readline write_history() (GH-21279) Message-ID: https://github.com/python/cpython/commit/53d2b715d10e5c81cb9c86fd25e88ace4e41bc25 commit: 53d2b715d10e5c81cb9c86fd25e88ace4e41bc25 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-02T04:02:08-07:00 summary: bpo-41193: Ignore OSError in readline write_history() (GH-21279) The write_history() atexit function of the readline completer now ignores any OSError to ignore error if the filesystem is read-only, instead of only ignoring FileNotFoundError and PermissionError. (cherry picked from commit 0ab917e07ed64c6bfde6f6e791f9b28acc97b510) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst M Lib/site.py diff --git a/Lib/site.py b/Lib/site.py index a065ab0b5db58..9fa21cca38667 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -444,9 +444,9 @@ def register_readline(): def write_history(): try: readline.write_history_file(history) - except (FileNotFoundError, PermissionError): - # home directory does not exist or is not writable - # https://bugs.python.org/issue19891 + except OSError: + # bpo-19891, bpo-41193: Home directory does not exist + # or is not writable, or the filesystem is read-only. pass atexit.register(write_history) diff --git a/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst b/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst new file mode 100644 index 0000000000000..8807d9c21febd --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst @@ -0,0 +1,4 @@ +The ``write_history()`` atexit function of the readline completer now +ignores any :exc:`OSError` to ignore error if the filesystem is read-only, +instead of only ignoring :exc:`FileNotFoundError` and +:exc:`PermissionError`. From webhook-mailer at python.org Thu Jul 2 08:32:23 2020 From: webhook-mailer at python.org (Christian Heimes) Date: Thu, 02 Jul 2020 12:32:23 -0000 Subject: [Python-checkins] bpo-41183: Update finite DH params to 3072 bits (#21278) Message-ID: https://github.com/python/cpython/commit/f52bf62fe12d46267e958f80dbe1f4425b55cd0f commit: f52bf62fe12d46267e958f80dbe1f4425b55cd0f branch: 3.5 author: Christian Heimes committer: GitHub date: 2020-07-02T05:32:05-07:00 summary: bpo-41183: Update finite DH params to 3072 bits (#21278) Signed-off-by: Christian Heimes files: A Lib/test/ffdh3072.pem D Lib/test/dh1024.pem M Lib/test/test_ssl.py diff --git a/Lib/test/dh1024.pem b/Lib/test/dh1024.pem deleted file mode 100644 index a391176b5fea3..0000000000000 --- a/Lib/test/dh1024.pem +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN DH PARAMETERS----- -MIGHAoGBAIbzw1s9CT8SV5yv6L7esdAdZYZjPi3qWFs61CYTFFQnf2s/d09NYaJt -rrvJhIzWavqnue71qXCf83/J3nz3FEwUU/L0mGyheVbsSHiI64wUo3u50wK5Igo0 -RNs/LD0irs7m0icZ//hijafTU+JOBiuA8zMI+oZfU7BGuc9XrUprAgEC ------END DH PARAMETERS----- - -Generated with: openssl dhparam -out dh1024.pem 1024 diff --git a/Lib/test/ffdh3072.pem b/Lib/test/ffdh3072.pem new file mode 100644 index 0000000000000..ad69bac8d00c7 --- /dev/null +++ b/Lib/test/ffdh3072.pem @@ -0,0 +1,41 @@ + DH Parameters: (3072 bit) + prime: + 00:ff:ff:ff:ff:ff:ff:ff:ff:ad:f8:54:58:a2:bb: + 4a:9a:af:dc:56:20:27:3d:3c:f1:d8:b9:c5:83:ce: + 2d:36:95:a9:e1:36:41:14:64:33:fb:cc:93:9d:ce: + 24:9b:3e:f9:7d:2f:e3:63:63:0c:75:d8:f6:81:b2: + 02:ae:c4:61:7a:d3:df:1e:d5:d5:fd:65:61:24:33: + f5:1f:5f:06:6e:d0:85:63:65:55:3d:ed:1a:f3:b5: + 57:13:5e:7f:57:c9:35:98:4f:0c:70:e0:e6:8b:77: + e2:a6:89:da:f3:ef:e8:72:1d:f1:58:a1:36:ad:e7: + 35:30:ac:ca:4f:48:3a:79:7a:bc:0a:b1:82:b3:24: + fb:61:d1:08:a9:4b:b2:c8:e3:fb:b9:6a:da:b7:60: + d7:f4:68:1d:4f:42:a3:de:39:4d:f4:ae:56:ed:e7: + 63:72:bb:19:0b:07:a7:c8:ee:0a:6d:70:9e:02:fc: + e1:cd:f7:e2:ec:c0:34:04:cd:28:34:2f:61:91:72: + fe:9c:e9:85:83:ff:8e:4f:12:32:ee:f2:81:83:c3: + fe:3b:1b:4c:6f:ad:73:3b:b5:fc:bc:2e:c2:20:05: + c5:8e:f1:83:7d:16:83:b2:c6:f3:4a:26:c1:b2:ef: + fa:88:6b:42:38:61:1f:cf:dc:de:35:5b:3b:65:19: + 03:5b:bc:34:f4:de:f9:9c:02:38:61:b4:6f:c9:d6: + e6:c9:07:7a:d9:1d:26:91:f7:f7:ee:59:8c:b0:fa: + c1:86:d9:1c:ae:fe:13:09:85:13:92:70:b4:13:0c: + 93:bc:43:79:44:f4:fd:44:52:e2:d7:4d:d3:64:f2: + e2:1e:71:f5:4b:ff:5c:ae:82:ab:9c:9d:f6:9e:e8: + 6d:2b:c5:22:36:3a:0d:ab:c5:21:97:9b:0d:ea:da: + 1d:bf:9a:42:d5:c4:48:4e:0a:bc:d0:6b:fa:53:dd: + ef:3c:1b:20:ee:3f:d5:9d:7c:25:e4:1d:2b:66:c6: + 2e:37:ff:ff:ff:ff:ff:ff:ff:ff + generator: 2 (0x2) + recommended-private-length: 276 bits +-----BEGIN DH PARAMETERS----- +MIIBjAKCAYEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz ++8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a +87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 +YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi +7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD +ssbzSibBsu/6iGtCOGEfz9zeNVs7ZRkDW7w09N75nAI4YbRvydbmyQd62R0mkff3 +7lmMsPrBhtkcrv4TCYUTknC0EwyTvEN5RPT9RFLi103TZPLiHnH1S/9croKrnJ32 +nuhtK8UiNjoNq8Uhl5sN6todv5pC1cRITgq80Gv6U93vPBsg7j/VnXwl5B0rZsYu +N///////////AgECAgIBFA== +-----END DH PARAMETERS----- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 44c2725d2c2f7..ad85b3e8ea92e 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -72,7 +72,7 @@ def data_file(*name): NULLBYTECERT = data_file("nullbytecert.pem") TALOS_INVALID_CRLDP = data_file("talos-2019-0758.pem") -DHFILE = data_file("dh1024.pem") +DHFILE = data_file("ffdh3072.pem") BYTES_DHFILE = os.fsencode(DHFILE) From webhook-mailer at python.org Thu Jul 2 18:08:44 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 02 Jul 2020 22:08:44 -0000 Subject: [Python-checkins] Remove extraneous file from the Docs folder (GH-21286) Message-ID: https://github.com/python/cpython/commit/67673b08ea302174ca9c6559c04311550ae9f189 commit: 67673b08ea302174ca9c6559c04311550ae9f189 branch: master author: Pablo Galindo committer: GitHub date: 2020-07-02T23:08:36+01:00 summary: Remove extraneous file from the Docs folder (GH-21286) files: D Doc/myfile.bz2 diff --git a/Doc/myfile.bz2 b/Doc/myfile.bz2 deleted file mode 100644 index 7ada20f60926b..0000000000000 Binary files a/Doc/myfile.bz2 and /dev/null differ From webhook-mailer at python.org Thu Jul 2 20:09:33 2020 From: webhook-mailer at python.org (scoder) Date: Fri, 03 Jul 2020 00:09:33 -0000 Subject: [Python-checkins] bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092) Message-ID: https://github.com/python/cpython/commit/148f32913573c29250dfb3f0d079eb8847633621 commit: 148f32913573c29250dfb3f0d079eb8847633621 branch: master author: scoder committer: GitHub date: 2020-07-02T17:09:28-07:00 summary: bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092) Automerge-Triggered-By: @gvanrossum files: A Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst M Lib/test/test_capi.py M Modules/_testcapimodule.c M Objects/typeobject.c diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index fa5ca1c97f458..3e7afd5a2a1e4 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -516,6 +516,14 @@ def test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_o # Test that subtype_dealloc decref the newly assigned __class__ only once self.assertEqual(new_type_refcnt, sys.getrefcount(_testcapi.HeapCTypeSubclass)) + def test_heaptype_with_setattro(self): + obj = _testcapi.HeapCTypeSetattr() + self.assertEqual(obj.pvalue, 10) + obj.value = 12 + self.assertEqual(obj.pvalue, 12) + del obj.value + self.assertEqual(obj.pvalue, 0) + def test_pynumber_tobase(self): from _testcapi import pynumber_tobase self.assertEqual(pynumber_tobase(123, 2), '0b1111011') diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst new file mode 100644 index 0000000000000..f69fccfa4db69 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst @@ -0,0 +1,2 @@ +The "hackcheck" that prevents sneaking around a type's __setattr__() by calling the +superclass method was rewritten to allow C implemented heap types. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index aafbc392a4846..629102b12a9fe 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -6528,6 +6528,80 @@ static PyType_Spec HeapCTypeWithWeakref_spec = { HeapCTypeWithWeakref_slots }; +PyDoc_STRVAR(heapctypesetattr__doc__, +"A heap type without GC, but with overridden __setattr__.\n\n" +"The 'value' attribute is set to 10 in __init__ and updated via attribute setting."); + +typedef struct { + PyObject_HEAD + long value; +} HeapCTypeSetattrObject; + +static struct PyMemberDef heapctypesetattr_members[] = { + {"pvalue", T_LONG, offsetof(HeapCTypeSetattrObject, value)}, + {NULL} /* Sentinel */ +}; + +static int +heapctypesetattr_init(PyObject *self, PyObject *args, PyObject *kwargs) +{ + ((HeapCTypeSetattrObject *)self)->value = 10; + return 0; +} + +static void +heapctypesetattr_dealloc(HeapCTypeSetattrObject *self) +{ + PyTypeObject *tp = Py_TYPE(self); + PyObject_Del(self); + Py_DECREF(tp); +} + +static int +heapctypesetattr_setattro(HeapCTypeSetattrObject *self, PyObject *attr, PyObject *value) +{ + PyObject *svalue = PyUnicode_FromString("value"); + if (svalue == NULL) + return -1; + int eq = PyObject_RichCompareBool(svalue, attr, Py_EQ); + Py_DECREF(svalue); + if (eq < 0) + return -1; + if (!eq) { + return PyObject_GenericSetAttr((PyObject*) self, attr, value); + } + if (value == NULL) { + self->value = 0; + return 0; + } + PyObject *ivalue = PyNumber_Long(value); + if (ivalue == NULL) + return -1; + long v = PyLong_AsLong(ivalue); + Py_DECREF(ivalue); + if (v == -1 && PyErr_Occurred()) + return -1; + self->value = v; + return 0; +} + +static PyType_Slot HeapCTypeSetattr_slots[] = { + {Py_tp_init, heapctypesetattr_init}, + {Py_tp_members, heapctypesetattr_members}, + {Py_tp_setattro, heapctypesetattr_setattro}, + {Py_tp_dealloc, heapctypesetattr_dealloc}, + {Py_tp_doc, (char*)heapctypesetattr__doc__}, + {0, 0}, +}; + +static PyType_Spec HeapCTypeSetattr_spec = { + "_testcapi.HeapCTypeSetattr", + sizeof(HeapCTypeSetattrObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + HeapCTypeSetattr_slots +}; + static PyMethodDef meth_instance_methods[] = { {"meth_varargs", meth_varargs, METH_VARARGS}, {"meth_varargs_keywords", (PyCFunction)(void(*)(void))meth_varargs_keywords, METH_VARARGS|METH_KEYWORDS}, @@ -6834,6 +6908,12 @@ PyInit__testcapi(void) } PyModule_AddObject(m, "HeapCTypeWithBuffer", HeapCTypeWithBuffer); + PyObject *HeapCTypeSetattr = PyType_FromSpec(&HeapCTypeSetattr_spec); + if (HeapCTypeSetattr == NULL) { + return NULL; + } + PyModule_AddObject(m, "HeapCTypeSetattr", HeapCTypeSetattr); + PyObject *subclass_with_finalizer_bases = PyTuple_Pack(1, HeapCTypeSubclass); if (subclass_with_finalizer_bases == NULL) { return NULL; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index f0e349ecd2bb9..16f95f0e1bf7f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -97,6 +97,9 @@ clear_slotdefs(void); static PyObject * lookup_maybe_method(PyObject *self, _Py_Identifier *attrid, int *unbound); +static int +slot_tp_setattro(PyObject *self, PyObject *name, PyObject *value); + /* * finds the beginning of the docstring's introspection signature. * if present, returns a pointer pointing to the first '('. @@ -5945,22 +5948,38 @@ wrap_delitem(PyObject *self, PyObject *args, void *wrapped) } /* Helper to check for object.__setattr__ or __delattr__ applied to a type. - This is called the Carlo Verre hack after its discoverer. */ + This is called the Carlo Verre hack after its discoverer. See + https://mail.python.org/pipermail/python-dev/2003-April/034535.html + */ static int hackcheck(PyObject *self, setattrofunc func, const char *what) { PyTypeObject *type = Py_TYPE(self); - while (type && type->tp_flags & Py_TPFLAGS_HEAPTYPE) - type = type->tp_base; - /* If type is NULL now, this is a really weird type. - In the spirit of backwards compatibility (?), just shut up. */ - if (type && type->tp_setattro != func) { - PyErr_Format(PyExc_TypeError, - "can't apply this %s to %s object", - what, - type->tp_name); - return 0; + PyObject *mro = type->tp_mro; + if (!mro) { + /* Probably ok not to check the call in this case. */ + return 1; + } + assert(PyTuple_Check(mro)); + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyTypeObject *base = (PyTypeObject*) PyTuple_GET_ITEM(mro, i); + if (base->tp_setattro == func) { + /* 'func' is the earliest non-Python implementation in the MRO. */ + break; + } else if (base->tp_setattro != slot_tp_setattro) { + /* 'base' is not a Python class and overrides 'func'. + Its tp_setattro should be called instead. */ + PyErr_Format(PyExc_TypeError, + "can't apply this %s to %s object", + what, + type->tp_name); + return 0; + } } + /* Either 'func' is not in the mro (which should fail when checking 'self'), + or it's the right slot function to call. */ return 1; } From webhook-mailer at python.org Fri Jul 3 05:00:15 2020 From: webhook-mailer at python.org (Mohamed Koubaa) Date: Fri, 03 Jul 2020 09:00:15 -0000 Subject: [Python-checkins] bpo-1635741: Port sha256 module to multiphase init (PEP 489) (GH-21189) Message-ID: https://github.com/python/cpython/commit/9d006977d7ff5a45d6e7d696c1713fdf2dd308b7 commit: 9d006977d7ff5a45d6e7d696c1713fdf2dd308b7 branch: master author: Mohamed Koubaa committer: GitHub date: 2020-07-03T17:59:47+09:00 summary: bpo-1635741: Port sha256 module to multiphase init (PEP 489) (GH-21189) files: A Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst M Modules/sha256module.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst new file mode 100644 index 0000000000000..c529923779fa8 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-01-20-17-38.bpo-1635741.-AtPYu.rst @@ -0,0 +1 @@ +Port :mod:`sha256` to multiphase initialization diff --git a/Modules/sha256module.c b/Modules/sha256module.c index 261f9daee2807..06e4430bd7c33 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -681,43 +681,45 @@ static struct PyMethodDef SHA_functions[] = { {NULL, NULL} /* Sentinel */ }; - -/* Initialize this module. */ - -static struct PyModuleDef _sha256module = { - PyModuleDef_HEAD_INIT, - "_sha256", - NULL, - -1, - SHA_functions, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit__sha256(void) +static int sha256_exec(PyObject *module) { - PyObject *m; - Py_SET_TYPE(&SHA224type, &PyType_Type); if (PyType_Ready(&SHA224type) < 0) { - return NULL; + return -1; } Py_SET_TYPE(&SHA256type, &PyType_Type); if (PyType_Ready(&SHA256type) < 0) { - return NULL; + return -1; } - m = PyModule_Create(&_sha256module); - if (m == NULL) - return NULL; - Py_INCREF((PyObject *)&SHA224type); - PyModule_AddObject(m, "SHA224Type", (PyObject *)&SHA224type); + if (PyModule_AddObject(module, "SHA224Type", (PyObject *)&SHA224type) < 0) { + Py_DECREF((PyObject *)&SHA224type); + return -1; + } Py_INCREF((PyObject *)&SHA256type); - PyModule_AddObject(m, "SHA256Type", (PyObject *)&SHA256type); - return m; + if (PyModule_AddObject(module, "SHA256Type", (PyObject *)&SHA256type) < 0) { + Py_DECREF((PyObject *)&SHA256type); + return -1; + } + return 0; +} + +static PyModuleDef_Slot _sha256_slots[] = { + {Py_mod_exec, sha256_exec}, + {0, NULL} +}; + +static struct PyModuleDef _sha256module = { + PyModuleDef_HEAD_INIT, + .m_name = "_sha256", + .m_methods = SHA_functions, + .m_slots = _sha256_slots, +}; +/* Initialize this module. */ +PyMODINIT_FUNC +PyInit__sha256(void) +{ + return PyModuleDef_Init(&_sha256module); } From webhook-mailer at python.org Fri Jul 3 05:35:49 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Jul 2020 09:35:49 -0000 Subject: [Python-checkins] bpo-41194: Pass module state in Python-ast.c (GH-21284) Message-ID: https://github.com/python/cpython/commit/74419f0c64959bb8392fcf3659058410423038e1 commit: 74419f0c64959bb8392fcf3659058410423038e1 branch: master author: Victor Stinner committer: GitHub date: 2020-07-03T11:35:37+02:00 summary: bpo-41194: Pass module state in Python-ast.c (GH-21284) Rework asdl_c.py to pass the module state to functions in Python-ast.c, instead of using astmodulestate_global. Handle also PyState_AddModule() failure in init_types(). files: M Parser/asdl_c.py M Python/Python-ast.c diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index ce9724aee3ed8..39e216b8192b1 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -387,7 +387,7 @@ def visitField(self, sum): class Obj2ModPrototypeVisitor(PickleVisitor): def visitProduct(self, prod, name): - code = "static int obj2ast_%s(PyObject* obj, %s* out, PyArena* arena);" + code = "static int obj2ast_%s(astmodulestate *state, PyObject* obj, %s* out, PyArena* arena);" self.emit(code % (name, get_c_type(name)), 0) visitSum = visitProduct @@ -397,7 +397,7 @@ class Obj2ModVisitor(PickleVisitor): def funcHeader(self, name): ctype = get_c_type(name) self.emit("int", 0) - self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0) + self.emit("obj2ast_%s(astmodulestate *state, PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0) self.emit("{", 0) self.emit("int isinstance;", 1) self.emit("", 0) @@ -419,7 +419,7 @@ def simpleSum(self, sum, name): self.funcHeader(name) for t in sum.types: line = ("isinstance = PyObject_IsInstance(obj, " - "astmodulestate_global->%s_type);") + "state->%s_type);") self.emit(line % (t.name,), 1) self.emit("if (isinstance == -1) {", 1) self.emit("return 1;", 2) @@ -448,7 +448,7 @@ def complexSum(self, sum, name): for a in sum.attributes: self.visitField(a, name, sum=sum, depth=1) for t in sum.types: - self.emit("tp = astmodulestate_global->%s_type;" % (t.name,), 1) + self.emit("tp = state->%s_type;" % (t.name,), 1) self.emit("isinstance = PyObject_IsInstance(obj, tp);", 1) self.emit("if (isinstance == -1) {", 1) self.emit("return 1;", 2) @@ -479,7 +479,7 @@ def visitSum(self, sum, name): def visitProduct(self, prod, name): ctype = get_c_type(name) self.emit("int", 0) - self.emit("obj2ast_%s(PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0) + self.emit("obj2ast_%s(astmodulestate *state, PyObject* obj, %s* out, PyArena* arena)" % (name, ctype), 0) self.emit("{", 0) self.emit("PyObject* tmp = NULL;", 1) for f in prod.fields: @@ -525,7 +525,7 @@ def isSimpleType(self, field): def visitField(self, field, name, sum=None, prod=None, depth=0): ctype = get_c_type(field.type) - line = "if (_PyObject_LookupAttr(obj, astmodulestate_global->%s, &tmp) < 0) {" + line = "if (_PyObject_LookupAttr(obj, state->%s, &tmp) < 0) {" self.emit(line % field.name, depth) self.emit("return 1;", depth+1) self.emit("}", depth) @@ -568,7 +568,7 @@ def visitField(self, field, name, sum=None, prod=None, depth=0): self.emit("%s val;" % ctype, depth+2) self.emit("PyObject *tmp2 = PyList_GET_ITEM(tmp, i);", depth+2) self.emit("Py_INCREF(tmp2);", depth+2) - self.emit("res = obj2ast_%s(tmp2, &val, arena);" % + self.emit("res = obj2ast_%s(state, tmp2, &val, arena);" % field.type, depth+2, reflow=False) self.emit("Py_DECREF(tmp2);", depth+2) self.emit("if (res != 0) goto failed;", depth+2) @@ -582,7 +582,7 @@ def visitField(self, field, name, sum=None, prod=None, depth=0): self.emit("asdl_seq_SET(%s, i, val);" % field.name, depth+2) self.emit("}", depth+1) else: - self.emit("res = obj2ast_%s(tmp, &%s, arena);" % + self.emit("res = obj2ast_%s(state, tmp, &%s, arena);" % (field.type, field.name), depth+1) self.emit("if (res != 0) goto failed;", depth+1) @@ -604,7 +604,7 @@ class PyTypesDeclareVisitor(PickleVisitor): def visitProduct(self, prod, name): self.emit_type("%s_type" % name) - self.emit("static PyObject* ast2obj_%s(void*);" % name, 0) + self.emit("static PyObject* ast2obj_%s(astmodulestate *state, void*);" % name, 0) if prod.attributes: for a in prod.attributes: self.emit_identifier(a.name) @@ -634,7 +634,7 @@ def visitSum(self, sum, name): ptype = get_c_type(name) for t in sum.types: self.emit_singleton("%s_singleton" % t.name) - self.emit("static PyObject* ast2obj_%s(%s);" % (name, ptype), 0) + self.emit("static PyObject* ast2obj_%s(astmodulestate *state, %s);" % (name, ptype), 0) for t in sum.types: self.visitConstructor(t, name) @@ -691,7 +691,8 @@ def visitModule(self, mod): Py_ssize_t i, numfields = 0; int res = -1; PyObject *key, *value, *fields; - if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), astmodulestate_global->_fields, &fields) < 0) { + astmodulestate *state = astmodulestate_global; + if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } if (fields) { @@ -759,8 +760,9 @@ def visitModule(self, mod): static PyObject * ast_type_reduce(PyObject *self, PyObject *unused) { + astmodulestate *state = astmodulestate_global; PyObject *dict; - if (_PyObject_LookupAttr(self, astmodulestate_global->__dict__, &dict) < 0) { + if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; } if (dict) { @@ -809,7 +811,8 @@ def visitModule(self, mod): }; static PyObject * -make_type(const char *type, PyObject* base, const char* const* fields, int num_fields, const char *doc) +make_type(astmodulestate *state, const char *type, PyObject* base, + const char* const* fields, int num_fields, const char *doc) { PyObject *fnames, *result; int i; @@ -825,16 +828,16 @@ def visitModule(self, mod): } result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){OOOOOs}", type, base, - astmodulestate_global->_fields, fnames, - astmodulestate_global->__module__, - astmodulestate_global->ast, - astmodulestate_global->__doc__, doc); + state->_fields, fnames, + state->__module__, + state->ast, + state->__doc__, doc); Py_DECREF(fnames); return result; } static int -add_attributes(PyObject *type, const char * const *attrs, int num_fields) +add_attributes(astmodulestate *state, PyObject *type, const char * const *attrs, int num_fields) { int i, result; PyObject *s, *l = PyTuple_New(num_fields); @@ -848,14 +851,14 @@ def visitModule(self, mod): } PyTuple_SET_ITEM(l, i, s); } - result = PyObject_SetAttr(type, astmodulestate_global->_attributes, l) >= 0; + result = PyObject_SetAttr(type, state->_attributes, l) >= 0; Py_DECREF(l); return result; } /* Conversion AST -> Python */ -static PyObject* ast2obj_list(asdl_seq *seq, PyObject* (*func)(void*)) +static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (*func)(astmodulestate *state, void*)) { Py_ssize_t i, n = asdl_seq_LEN(seq); PyObject *result = PyList_New(n); @@ -863,7 +866,7 @@ def visitModule(self, mod): if (!result) return NULL; for (i = 0; i < n; i++) { - value = func(asdl_seq_GET(seq, i)); + value = func(state, asdl_seq_GET(seq, i)); if (!value) { Py_DECREF(result); return NULL; @@ -873,7 +876,7 @@ def visitModule(self, mod): return result; } -static PyObject* ast2obj_object(void *o) +static PyObject* ast2obj_object(astmodulestate *Py_UNUSED(state), void *o) { if (!o) o = Py_None; @@ -884,14 +887,14 @@ def visitModule(self, mod): #define ast2obj_identifier ast2obj_object #define ast2obj_string ast2obj_object -static PyObject* ast2obj_int(long b) +static PyObject* ast2obj_int(astmodulestate *Py_UNUSED(state), long b) { return PyLong_FromLong(b); } /* Conversion Python -> AST */ -static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_object(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { if (obj == Py_None) obj = NULL; @@ -906,7 +909,7 @@ def visitModule(self, mod): return 0; } -static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_constant(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { if (PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; @@ -917,25 +920,25 @@ def visitModule(self, mod): return 0; } -static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_identifier(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) { if (!PyUnicode_CheckExact(obj) && obj != Py_None) { PyErr_SetString(PyExc_TypeError, "AST identifier must be of type str"); return 1; } - return obj2ast_object(obj, out, arena); + return obj2ast_object(state, obj, out, arena); } -static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_string(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) { if (!PyUnicode_CheckExact(obj) && !PyBytes_CheckExact(obj)) { PyErr_SetString(PyExc_TypeError, "AST string must be of type str"); return 1; } - return obj2ast_object(obj, out, arena); + return obj2ast_object(state, obj, out, arena); } -static int obj2ast_int(PyObject* obj, int* out, PyArena* arena) +static int obj2ast_int(astmodulestate* Py_UNUSED(state), PyObject* obj, int* out, PyArena* arena) { int i; if (!PyLong_Check(obj)) { @@ -950,13 +953,13 @@ def visitModule(self, mod): return 0; } -static int add_ast_fields(void) +static int add_ast_fields(astmodulestate *state) { PyObject *empty_tuple; empty_tuple = PyTuple_New(0); if (!empty_tuple || - PyObject_SetAttrString(astmodulestate_global->AST_type, "_fields", empty_tuple) < 0 || - PyObject_SetAttrString(astmodulestate_global->AST_type, "_attributes", empty_tuple) < 0) { + PyObject_SetAttrString(state->AST_type, "_fields", empty_tuple) < 0 || + PyObject_SetAttrString(state->AST_type, "_attributes", empty_tuple) < 0) { Py_XDECREF(empty_tuple); return -1; } @@ -968,18 +971,24 @@ def visitModule(self, mod): self.emit("static int init_types(void)",0) self.emit("{", 0) - self.emit("PyObject *m;", 1) - self.emit("if (PyState_FindModule(&_astmodule) == NULL) {", 1) - self.emit("m = PyModule_Create(&_astmodule);", 2) - self.emit("if (!m) return 0;", 2) - self.emit("PyState_AddModule(m, &_astmodule);", 2) + self.emit("PyObject *module = PyState_FindModule(&_astmodule);", 1) + self.emit("if (module == NULL) {", 1) + self.emit("module = PyModule_Create(&_astmodule);", 2) + self.emit("if (!module) {", 2) + self.emit("return 0;", 3) + self.emit("}", 2) + self.emit("if (PyState_AddModule(module, &_astmodule) < 0) {", 2) + self.emit("return 0;", 3) + self.emit("}", 2) self.emit("}", 1) - self.emit("astmodulestate *state = astmodulestate_global;", 1) + self.emit("", 0) + + self.emit("astmodulestate *state = get_ast_state(module);", 1) self.emit("if (state->initialized) return 1;", 1) - self.emit("if (init_identifiers() < 0) return 0;", 1) + self.emit("if (init_identifiers(state) < 0) return 0;", 1) self.emit("state->AST_type = PyType_FromSpec(&AST_type_spec);", 1) self.emit("if (!state->AST_type) return 0;", 1) - self.emit("if (add_ast_fields() < 0) return 0;", 1) + self.emit("if (add_ast_fields(state) < 0) return 0;", 1) for dfn in mod.dfns: self.visit(dfn) self.emit("state->initialized = 1;", 1) @@ -991,31 +1000,31 @@ def visitProduct(self, prod, name): fields = name+"_fields" else: fields = "NULL" - self.emit('state->%s_type = make_type("%s", state->AST_type, %s, %d,' % + self.emit('state->%s_type = make_type(state, "%s", state->AST_type, %s, %d,' % (name, name, fields, len(prod.fields)), 1) self.emit('%s);' % reflow_c_string(asdl_of(name, prod), 2), 2, reflow=False) self.emit("if (!state->%s_type) return 0;" % name, 1) self.emit_type("AST_type") self.emit_type("%s_type" % name) if prod.attributes: - self.emit("if (!add_attributes(state->%s_type, %s_attributes, %d)) return 0;" % + self.emit("if (!add_attributes(state, state->%s_type, %s_attributes, %d)) return 0;" % (name, name, len(prod.attributes)), 1) else: - self.emit("if (!add_attributes(state->%s_type, NULL, 0)) return 0;" % name, 1) + self.emit("if (!add_attributes(state, state->%s_type, NULL, 0)) return 0;" % name, 1) self.emit_defaults(name, prod.fields, 1) self.emit_defaults(name, prod.attributes, 1) def visitSum(self, sum, name): - self.emit('state->%s_type = make_type("%s", state->AST_type, NULL, 0,' % + self.emit('state->%s_type = make_type(state, "%s", state->AST_type, NULL, 0,' % (name, name), 1) self.emit('%s);' % reflow_c_string(asdl_of(name, sum), 2), 2, reflow=False) self.emit_type("%s_type" % name) self.emit("if (!state->%s_type) return 0;" % name, 1) if sum.attributes: - self.emit("if (!add_attributes(state->%s_type, %s_attributes, %d)) return 0;" % + self.emit("if (!add_attributes(state, state->%s_type, %s_attributes, %d)) return 0;" % (name, name, len(sum.attributes)), 1) else: - self.emit("if (!add_attributes(state->%s_type, NULL, 0)) return 0;" % name, 1) + self.emit("if (!add_attributes(state, state->%s_type, NULL, 0)) return 0;" % name, 1) self.emit_defaults(name, sum.attributes, 1) simple = is_simple(sum) for t in sum.types: @@ -1026,7 +1035,7 @@ def visitConstructor(self, cons, name, simple): fields = cons.name+"_fields" else: fields = "NULL" - self.emit('state->%s_type = make_type("%s", state->%s_type, %s, %d,' % + self.emit('state->%s_type = make_type(state, "%s", state->%s_type, %s, %d,' % (cons.name, cons.name, name, fields, len(cons.fields)), 1) self.emit('%s);' % reflow_c_string(asdl_of(cons.name, cons), 2), 2, reflow=False) self.emit("if (!state->%s_type) return 0;" % cons.name, 1) @@ -1056,10 +1065,13 @@ def visitModule(self, mod): self.emit("if (!init_types()) return NULL;", 1) self.emit('m = PyState_FindModule(&_astmodule);', 1) self.emit("if (!m) return NULL;", 1) - self.emit('if (PyModule_AddObject(m, "AST", astmodulestate_global->AST_type) < 0) {', 1) + self.emit('astmodulestate *state = get_ast_state(m);', 1) + self.emit('', 1) + + self.emit('if (PyModule_AddObject(m, "AST", state->AST_type) < 0) {', 1) self.emit('goto error;', 2) self.emit('}', 1) - self.emit('Py_INCREF(astmodulestate(m)->AST_type);', 1) + self.emit('Py_INCREF(state->AST_type);', 1) self.emit('if (PyModule_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0) {', 1) self.emit("goto error;", 2) self.emit('}', 1) @@ -1090,10 +1102,10 @@ def visitConstructor(self, cons, name): def addObj(self, name): self.emit("if (PyModule_AddObject(m, \"%s\", " - "astmodulestate_global->%s_type) < 0) {" % (name, name), 1) + "state->%s_type) < 0) {" % (name, name), 1) self.emit("goto error;", 2) self.emit('}', 1) - self.emit("Py_INCREF(astmodulestate(m)->%s_type);" % name, 1) + self.emit("Py_INCREF(state->%s_type);" % name, 1) _SPECIALIZED_SEQUENCES = ('stmt', 'expr') @@ -1127,7 +1139,7 @@ class ObjVisitor(PickleVisitor): def func_begin(self, name): ctype = get_c_type(name) self.emit("PyObject*", 0) - self.emit("ast2obj_%s(void* _o)" % (name), 0) + self.emit("ast2obj_%s(astmodulestate *state, void* _o)" % (name), 0) self.emit("{", 0) self.emit("%s o = (%s)_o;" % (ctype, ctype), 1) self.emit("PyObject *result = NULL, *value = NULL;", 1) @@ -1135,7 +1147,6 @@ def func_begin(self, name): self.emit('if (!o) {', 1) self.emit("Py_RETURN_NONE;", 2) self.emit("}", 1) - self.emit('', 0) def func_end(self): self.emit("return result;", 1) @@ -1157,43 +1168,43 @@ def visitSum(self, sum, name): self.visitConstructor(t, i + 1, name) self.emit("}", 1) for a in sum.attributes: - self.emit("value = ast2obj_%s(o->%s);" % (a.type, a.name), 1) + self.emit("value = ast2obj_%s(state, o->%s);" % (a.type, a.name), 1) self.emit("if (!value) goto failed;", 1) - self.emit('if (PyObject_SetAttr(result, astmodulestate_global->%s, value) < 0)' % a.name, 1) + self.emit('if (PyObject_SetAttr(result, state->%s, value) < 0)' % a.name, 1) self.emit('goto failed;', 2) self.emit('Py_DECREF(value);', 1) self.func_end() def simpleSum(self, sum, name): - self.emit("PyObject* ast2obj_%s(%s_ty o)" % (name, name), 0) + self.emit("PyObject* ast2obj_%s(astmodulestate *state, %s_ty o)" % (name, name), 0) self.emit("{", 0) self.emit("switch(o) {", 1) for t in sum.types: self.emit("case %s:" % t.name, 2) - self.emit("Py_INCREF(astmodulestate_global->%s_singleton);" % t.name, 3) - self.emit("return astmodulestate_global->%s_singleton;" % t.name, 3) + self.emit("Py_INCREF(state->%s_singleton);" % t.name, 3) + self.emit("return state->%s_singleton;" % t.name, 3) self.emit("}", 1) self.emit("Py_UNREACHABLE();", 1); self.emit("}", 0) def visitProduct(self, prod, name): self.func_begin(name) - self.emit("tp = (PyTypeObject *)astmodulestate_global->%s_type;" % name, 1) + self.emit("tp = (PyTypeObject *)state->%s_type;" % name, 1) self.emit("result = PyType_GenericNew(tp, NULL, NULL);", 1); self.emit("if (!result) return NULL;", 1) for field in prod.fields: self.visitField(field, name, 1, True) for a in prod.attributes: - self.emit("value = ast2obj_%s(o->%s);" % (a.type, a.name), 1) + self.emit("value = ast2obj_%s(state, o->%s);" % (a.type, a.name), 1) self.emit("if (!value) goto failed;", 1) - self.emit("if (PyObject_SetAttr(result, astmodulestate_global->%s, value) < 0)" % a.name, 1) + self.emit("if (PyObject_SetAttr(result, state->%s, value) < 0)" % a.name, 1) self.emit('goto failed;', 2) self.emit('Py_DECREF(value);', 1) self.func_end() def visitConstructor(self, cons, enum, name): self.emit("case %s_kind:" % cons.name, 1) - self.emit("tp = (PyTypeObject *)astmodulestate_global->%s_type;" % cons.name, 2) + self.emit("tp = (PyTypeObject *)state->%s_type;" % cons.name, 2) self.emit("result = PyType_GenericNew(tp, NULL, NULL);", 2); self.emit("if (!result) goto failed;", 2) for f in cons.fields: @@ -1209,7 +1220,7 @@ def emit(s, d): value = "o->v.%s.%s" % (name, field.name) self.set(field, value, depth) emit("if (!value) goto failed;", 0) - emit("if (PyObject_SetAttr(result, astmodulestate_global->%s, value) == -1)" % field.name, 0) + emit("if (PyObject_SetAttr(result, state->%s, value) == -1)" % field.name, 0) emit("goto failed;", 1) emit("Py_DECREF(value);", 0) @@ -1237,14 +1248,14 @@ def set(self, field, value, depth): self.emit("if (!value) goto failed;", depth+1) self.emit("for(i = 0; i < n; i++)", depth+1) # This cannot fail, so no need for error handling - self.emit("PyList_SET_ITEM(value, i, ast2obj_cmpop((cmpop_ty)asdl_seq_GET(%s, i)));" % value, + self.emit("PyList_SET_ITEM(value, i, ast2obj_cmpop(state, (cmpop_ty)asdl_seq_GET(%s, i)));" % value, depth+2, reflow=False) self.emit("}", depth) else: - self.emit("value = ast2obj_list(%s, ast2obj_%s);" % (value, field.type), depth) + self.emit("value = ast2obj_list(state, %s, ast2obj_%s);" % (value, field.type), depth) else: ctype = get_c_type(field.type) - self.emit("value = ast2obj_%s(%s);" % (field.type, value), depth, reflow=False) + self.emit("value = ast2obj_%s(state, %s);" % (field.type, value), depth, reflow=False) class PartingShots(StaticVisitor): @@ -1254,13 +1265,13 @@ class PartingShots(StaticVisitor): { if (!init_types()) return NULL; - return ast2obj_mod(t); + astmodulestate *state = astmodulestate_global; + return ast2obj_mod(state, t); } /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) { - PyObject *req_type[3]; const char * const req_name[] = {"Module", "Expression", "Interactive"}; int isinstance; @@ -1268,9 +1279,11 @@ class PartingShots(StaticVisitor): return NULL; } - req_type[0] = astmodulestate_global->Module_type; - req_type[1] = astmodulestate_global->Expression_type; - req_type[2] = astmodulestate_global->Interactive_type; + astmodulestate *state = astmodulestate_global; + PyObject *req_type[3]; + req_type[0] = state->Module_type; + req_type[1] = state->Expression_type; + req_type[2] = state->Interactive_type; assert(0 <= mode && mode <= 2); @@ -1287,7 +1300,7 @@ class PartingShots(StaticVisitor): } mod_ty res = NULL; - if (obj2ast_mod(ast, &res, arena) != 0) + if (obj2ast_mod(state, ast, &res, arena) != 0) return NULL; else return res; @@ -1297,7 +1310,8 @@ class PartingShots(StaticVisitor): { if (!init_types()) return -1; - return PyObject_IsInstance(obj, astmodulestate_global->AST_type); + astmodulestate *state = astmodulestate_global; + return PyObject_IsInstance(obj, state->AST_type); } """ @@ -1347,22 +1361,31 @@ def generate_module_def(f, mod): f.write(' PyObject *' + s + ';\n') f.write('} astmodulestate;\n\n') f.write(""" -#define astmodulestate(o) ((astmodulestate *)PyModule_GetState(o)) +static astmodulestate * +get_ast_state(PyObject *module) +{ + assert(module != NULL); + void *state = PyModule_GetState(module); + assert(state != NULL); + return (astmodulestate *)state; +} static int astmodule_clear(PyObject *module) { + astmodulestate *state = get_ast_state(module); """) for s in module_state: - f.write(" Py_CLEAR(astmodulestate(module)->" + s + ');\n') + f.write(" Py_CLEAR(state->" + s + ');\n') f.write(""" return 0; } static int astmodule_traverse(PyObject *module, visitproc visit, void* arg) { + astmodulestate *state = get_ast_state(module); """) for s in module_state: - f.write(" Py_VISIT(astmodulestate(module)->" + s + ');\n') + f.write(" Py_VISIT(state->" + s + ');\n') f.write(""" return 0; } @@ -1383,12 +1406,11 @@ def generate_module_def(f, mod): astmodule_free, }; -#define astmodulestate_global ((astmodulestate *)PyModule_GetState(PyState_FindModule(&_astmodule))) +#define astmodulestate_global get_ast_state(PyState_FindModule(&_astmodule)) """) - f.write('static int init_identifiers(void)\n') + f.write('static int init_identifiers(astmodulestate *state)\n') f.write('{\n') - f.write(' astmodulestate *state = astmodulestate_global;\n') for identifier in state_strings: f.write(' if ((state->' + identifier) f.write(' = PyUnicode_InternFromString("') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 694987dd07788..3296b067584d0 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -224,442 +224,451 @@ typedef struct { } astmodulestate; -#define astmodulestate(o) ((astmodulestate *)PyModule_GetState(o)) +static astmodulestate * +get_ast_state(PyObject *module) +{ + assert(module != NULL); + void *state = PyModule_GetState(module); + assert(state != NULL); + return (astmodulestate *)state; +} static int astmodule_clear(PyObject *module) { - Py_CLEAR(astmodulestate(module)->AST_type); - Py_CLEAR(astmodulestate(module)->Add_singleton); - Py_CLEAR(astmodulestate(module)->Add_type); - Py_CLEAR(astmodulestate(module)->And_singleton); - Py_CLEAR(astmodulestate(module)->And_type); - Py_CLEAR(astmodulestate(module)->AnnAssign_type); - Py_CLEAR(astmodulestate(module)->Assert_type); - Py_CLEAR(astmodulestate(module)->Assign_type); - Py_CLEAR(astmodulestate(module)->AsyncFor_type); - Py_CLEAR(astmodulestate(module)->AsyncFunctionDef_type); - Py_CLEAR(astmodulestate(module)->AsyncWith_type); - Py_CLEAR(astmodulestate(module)->Attribute_type); - Py_CLEAR(astmodulestate(module)->AugAssign_type); - Py_CLEAR(astmodulestate(module)->Await_type); - Py_CLEAR(astmodulestate(module)->BinOp_type); - Py_CLEAR(astmodulestate(module)->BitAnd_singleton); - Py_CLEAR(astmodulestate(module)->BitAnd_type); - Py_CLEAR(astmodulestate(module)->BitOr_singleton); - Py_CLEAR(astmodulestate(module)->BitOr_type); - Py_CLEAR(astmodulestate(module)->BitXor_singleton); - Py_CLEAR(astmodulestate(module)->BitXor_type); - Py_CLEAR(astmodulestate(module)->BoolOp_type); - Py_CLEAR(astmodulestate(module)->Break_type); - Py_CLEAR(astmodulestate(module)->Call_type); - Py_CLEAR(astmodulestate(module)->ClassDef_type); - Py_CLEAR(astmodulestate(module)->Compare_type); - Py_CLEAR(astmodulestate(module)->Constant_type); - Py_CLEAR(astmodulestate(module)->Continue_type); - Py_CLEAR(astmodulestate(module)->Del_singleton); - Py_CLEAR(astmodulestate(module)->Del_type); - Py_CLEAR(astmodulestate(module)->Delete_type); - Py_CLEAR(astmodulestate(module)->DictComp_type); - Py_CLEAR(astmodulestate(module)->Dict_type); - Py_CLEAR(astmodulestate(module)->Div_singleton); - Py_CLEAR(astmodulestate(module)->Div_type); - Py_CLEAR(astmodulestate(module)->Eq_singleton); - Py_CLEAR(astmodulestate(module)->Eq_type); - Py_CLEAR(astmodulestate(module)->ExceptHandler_type); - Py_CLEAR(astmodulestate(module)->Expr_type); - Py_CLEAR(astmodulestate(module)->Expression_type); - Py_CLEAR(astmodulestate(module)->FloorDiv_singleton); - Py_CLEAR(astmodulestate(module)->FloorDiv_type); - Py_CLEAR(astmodulestate(module)->For_type); - Py_CLEAR(astmodulestate(module)->FormattedValue_type); - Py_CLEAR(astmodulestate(module)->FunctionDef_type); - Py_CLEAR(astmodulestate(module)->FunctionType_type); - Py_CLEAR(astmodulestate(module)->GeneratorExp_type); - Py_CLEAR(astmodulestate(module)->Global_type); - Py_CLEAR(astmodulestate(module)->GtE_singleton); - Py_CLEAR(astmodulestate(module)->GtE_type); - Py_CLEAR(astmodulestate(module)->Gt_singleton); - Py_CLEAR(astmodulestate(module)->Gt_type); - Py_CLEAR(astmodulestate(module)->IfExp_type); - Py_CLEAR(astmodulestate(module)->If_type); - Py_CLEAR(astmodulestate(module)->ImportFrom_type); - Py_CLEAR(astmodulestate(module)->Import_type); - Py_CLEAR(astmodulestate(module)->In_singleton); - Py_CLEAR(astmodulestate(module)->In_type); - Py_CLEAR(astmodulestate(module)->Interactive_type); - Py_CLEAR(astmodulestate(module)->Invert_singleton); - Py_CLEAR(astmodulestate(module)->Invert_type); - Py_CLEAR(astmodulestate(module)->IsNot_singleton); - Py_CLEAR(astmodulestate(module)->IsNot_type); - Py_CLEAR(astmodulestate(module)->Is_singleton); - Py_CLEAR(astmodulestate(module)->Is_type); - Py_CLEAR(astmodulestate(module)->JoinedStr_type); - Py_CLEAR(astmodulestate(module)->LShift_singleton); - Py_CLEAR(astmodulestate(module)->LShift_type); - Py_CLEAR(astmodulestate(module)->Lambda_type); - Py_CLEAR(astmodulestate(module)->ListComp_type); - Py_CLEAR(astmodulestate(module)->List_type); - Py_CLEAR(astmodulestate(module)->Load_singleton); - Py_CLEAR(astmodulestate(module)->Load_type); - Py_CLEAR(astmodulestate(module)->LtE_singleton); - Py_CLEAR(astmodulestate(module)->LtE_type); - Py_CLEAR(astmodulestate(module)->Lt_singleton); - Py_CLEAR(astmodulestate(module)->Lt_type); - Py_CLEAR(astmodulestate(module)->MatMult_singleton); - Py_CLEAR(astmodulestate(module)->MatMult_type); - Py_CLEAR(astmodulestate(module)->Mod_singleton); - Py_CLEAR(astmodulestate(module)->Mod_type); - Py_CLEAR(astmodulestate(module)->Module_type); - Py_CLEAR(astmodulestate(module)->Mult_singleton); - Py_CLEAR(astmodulestate(module)->Mult_type); - Py_CLEAR(astmodulestate(module)->Name_type); - Py_CLEAR(astmodulestate(module)->NamedExpr_type); - Py_CLEAR(astmodulestate(module)->Nonlocal_type); - Py_CLEAR(astmodulestate(module)->NotEq_singleton); - Py_CLEAR(astmodulestate(module)->NotEq_type); - Py_CLEAR(astmodulestate(module)->NotIn_singleton); - Py_CLEAR(astmodulestate(module)->NotIn_type); - Py_CLEAR(astmodulestate(module)->Not_singleton); - Py_CLEAR(astmodulestate(module)->Not_type); - Py_CLEAR(astmodulestate(module)->Or_singleton); - Py_CLEAR(astmodulestate(module)->Or_type); - Py_CLEAR(astmodulestate(module)->Pass_type); - Py_CLEAR(astmodulestate(module)->Pow_singleton); - Py_CLEAR(astmodulestate(module)->Pow_type); - Py_CLEAR(astmodulestate(module)->RShift_singleton); - Py_CLEAR(astmodulestate(module)->RShift_type); - Py_CLEAR(astmodulestate(module)->Raise_type); - Py_CLEAR(astmodulestate(module)->Return_type); - Py_CLEAR(astmodulestate(module)->SetComp_type); - Py_CLEAR(astmodulestate(module)->Set_type); - Py_CLEAR(astmodulestate(module)->Slice_type); - Py_CLEAR(astmodulestate(module)->Starred_type); - Py_CLEAR(astmodulestate(module)->Store_singleton); - Py_CLEAR(astmodulestate(module)->Store_type); - Py_CLEAR(astmodulestate(module)->Sub_singleton); - Py_CLEAR(astmodulestate(module)->Sub_type); - Py_CLEAR(astmodulestate(module)->Subscript_type); - Py_CLEAR(astmodulestate(module)->Try_type); - Py_CLEAR(astmodulestate(module)->Tuple_type); - Py_CLEAR(astmodulestate(module)->TypeIgnore_type); - Py_CLEAR(astmodulestate(module)->UAdd_singleton); - Py_CLEAR(astmodulestate(module)->UAdd_type); - Py_CLEAR(astmodulestate(module)->USub_singleton); - Py_CLEAR(astmodulestate(module)->USub_type); - Py_CLEAR(astmodulestate(module)->UnaryOp_type); - Py_CLEAR(astmodulestate(module)->While_type); - Py_CLEAR(astmodulestate(module)->With_type); - Py_CLEAR(astmodulestate(module)->YieldFrom_type); - Py_CLEAR(astmodulestate(module)->Yield_type); - Py_CLEAR(astmodulestate(module)->__dict__); - Py_CLEAR(astmodulestate(module)->__doc__); - Py_CLEAR(astmodulestate(module)->__module__); - Py_CLEAR(astmodulestate(module)->_attributes); - Py_CLEAR(astmodulestate(module)->_fields); - Py_CLEAR(astmodulestate(module)->alias_type); - Py_CLEAR(astmodulestate(module)->annotation); - Py_CLEAR(astmodulestate(module)->arg); - Py_CLEAR(astmodulestate(module)->arg_type); - Py_CLEAR(astmodulestate(module)->args); - Py_CLEAR(astmodulestate(module)->argtypes); - Py_CLEAR(astmodulestate(module)->arguments_type); - Py_CLEAR(astmodulestate(module)->asname); - Py_CLEAR(astmodulestate(module)->ast); - Py_CLEAR(astmodulestate(module)->attr); - Py_CLEAR(astmodulestate(module)->bases); - Py_CLEAR(astmodulestate(module)->body); - Py_CLEAR(astmodulestate(module)->boolop_type); - Py_CLEAR(astmodulestate(module)->cause); - Py_CLEAR(astmodulestate(module)->cmpop_type); - Py_CLEAR(astmodulestate(module)->col_offset); - Py_CLEAR(astmodulestate(module)->comparators); - Py_CLEAR(astmodulestate(module)->comprehension_type); - Py_CLEAR(astmodulestate(module)->context_expr); - Py_CLEAR(astmodulestate(module)->conversion); - Py_CLEAR(astmodulestate(module)->ctx); - Py_CLEAR(astmodulestate(module)->decorator_list); - Py_CLEAR(astmodulestate(module)->defaults); - Py_CLEAR(astmodulestate(module)->elt); - Py_CLEAR(astmodulestate(module)->elts); - Py_CLEAR(astmodulestate(module)->end_col_offset); - Py_CLEAR(astmodulestate(module)->end_lineno); - Py_CLEAR(astmodulestate(module)->exc); - Py_CLEAR(astmodulestate(module)->excepthandler_type); - Py_CLEAR(astmodulestate(module)->expr_context_type); - Py_CLEAR(astmodulestate(module)->expr_type); - Py_CLEAR(astmodulestate(module)->finalbody); - Py_CLEAR(astmodulestate(module)->format_spec); - Py_CLEAR(astmodulestate(module)->func); - Py_CLEAR(astmodulestate(module)->generators); - Py_CLEAR(astmodulestate(module)->handlers); - Py_CLEAR(astmodulestate(module)->id); - Py_CLEAR(astmodulestate(module)->ifs); - Py_CLEAR(astmodulestate(module)->is_async); - Py_CLEAR(astmodulestate(module)->items); - Py_CLEAR(astmodulestate(module)->iter); - Py_CLEAR(astmodulestate(module)->key); - Py_CLEAR(astmodulestate(module)->keys); - Py_CLEAR(astmodulestate(module)->keyword_type); - Py_CLEAR(astmodulestate(module)->keywords); - Py_CLEAR(astmodulestate(module)->kind); - Py_CLEAR(astmodulestate(module)->kw_defaults); - Py_CLEAR(astmodulestate(module)->kwarg); - Py_CLEAR(astmodulestate(module)->kwonlyargs); - Py_CLEAR(astmodulestate(module)->left); - Py_CLEAR(astmodulestate(module)->level); - Py_CLEAR(astmodulestate(module)->lineno); - Py_CLEAR(astmodulestate(module)->lower); - Py_CLEAR(astmodulestate(module)->mod_type); - Py_CLEAR(astmodulestate(module)->module); - Py_CLEAR(astmodulestate(module)->msg); - Py_CLEAR(astmodulestate(module)->name); - Py_CLEAR(astmodulestate(module)->names); - Py_CLEAR(astmodulestate(module)->op); - Py_CLEAR(astmodulestate(module)->operand); - Py_CLEAR(astmodulestate(module)->operator_type); - Py_CLEAR(astmodulestate(module)->ops); - Py_CLEAR(astmodulestate(module)->optional_vars); - Py_CLEAR(astmodulestate(module)->orelse); - Py_CLEAR(astmodulestate(module)->posonlyargs); - Py_CLEAR(astmodulestate(module)->returns); - Py_CLEAR(astmodulestate(module)->right); - Py_CLEAR(astmodulestate(module)->simple); - Py_CLEAR(astmodulestate(module)->slice); - Py_CLEAR(astmodulestate(module)->step); - Py_CLEAR(astmodulestate(module)->stmt_type); - Py_CLEAR(astmodulestate(module)->tag); - Py_CLEAR(astmodulestate(module)->target); - Py_CLEAR(astmodulestate(module)->targets); - Py_CLEAR(astmodulestate(module)->test); - Py_CLEAR(astmodulestate(module)->type); - Py_CLEAR(astmodulestate(module)->type_comment); - Py_CLEAR(astmodulestate(module)->type_ignore_type); - Py_CLEAR(astmodulestate(module)->type_ignores); - Py_CLEAR(astmodulestate(module)->unaryop_type); - Py_CLEAR(astmodulestate(module)->upper); - Py_CLEAR(astmodulestate(module)->value); - Py_CLEAR(astmodulestate(module)->values); - Py_CLEAR(astmodulestate(module)->vararg); - Py_CLEAR(astmodulestate(module)->withitem_type); + astmodulestate *state = get_ast_state(module); + Py_CLEAR(state->AST_type); + Py_CLEAR(state->Add_singleton); + Py_CLEAR(state->Add_type); + Py_CLEAR(state->And_singleton); + Py_CLEAR(state->And_type); + Py_CLEAR(state->AnnAssign_type); + Py_CLEAR(state->Assert_type); + Py_CLEAR(state->Assign_type); + Py_CLEAR(state->AsyncFor_type); + Py_CLEAR(state->AsyncFunctionDef_type); + Py_CLEAR(state->AsyncWith_type); + Py_CLEAR(state->Attribute_type); + Py_CLEAR(state->AugAssign_type); + Py_CLEAR(state->Await_type); + Py_CLEAR(state->BinOp_type); + Py_CLEAR(state->BitAnd_singleton); + Py_CLEAR(state->BitAnd_type); + Py_CLEAR(state->BitOr_singleton); + Py_CLEAR(state->BitOr_type); + Py_CLEAR(state->BitXor_singleton); + Py_CLEAR(state->BitXor_type); + Py_CLEAR(state->BoolOp_type); + Py_CLEAR(state->Break_type); + Py_CLEAR(state->Call_type); + Py_CLEAR(state->ClassDef_type); + Py_CLEAR(state->Compare_type); + Py_CLEAR(state->Constant_type); + Py_CLEAR(state->Continue_type); + Py_CLEAR(state->Del_singleton); + Py_CLEAR(state->Del_type); + Py_CLEAR(state->Delete_type); + Py_CLEAR(state->DictComp_type); + Py_CLEAR(state->Dict_type); + Py_CLEAR(state->Div_singleton); + Py_CLEAR(state->Div_type); + Py_CLEAR(state->Eq_singleton); + Py_CLEAR(state->Eq_type); + Py_CLEAR(state->ExceptHandler_type); + Py_CLEAR(state->Expr_type); + Py_CLEAR(state->Expression_type); + Py_CLEAR(state->FloorDiv_singleton); + Py_CLEAR(state->FloorDiv_type); + Py_CLEAR(state->For_type); + Py_CLEAR(state->FormattedValue_type); + Py_CLEAR(state->FunctionDef_type); + Py_CLEAR(state->FunctionType_type); + Py_CLEAR(state->GeneratorExp_type); + Py_CLEAR(state->Global_type); + Py_CLEAR(state->GtE_singleton); + Py_CLEAR(state->GtE_type); + Py_CLEAR(state->Gt_singleton); + Py_CLEAR(state->Gt_type); + Py_CLEAR(state->IfExp_type); + Py_CLEAR(state->If_type); + Py_CLEAR(state->ImportFrom_type); + Py_CLEAR(state->Import_type); + Py_CLEAR(state->In_singleton); + Py_CLEAR(state->In_type); + Py_CLEAR(state->Interactive_type); + Py_CLEAR(state->Invert_singleton); + Py_CLEAR(state->Invert_type); + Py_CLEAR(state->IsNot_singleton); + Py_CLEAR(state->IsNot_type); + Py_CLEAR(state->Is_singleton); + Py_CLEAR(state->Is_type); + Py_CLEAR(state->JoinedStr_type); + Py_CLEAR(state->LShift_singleton); + Py_CLEAR(state->LShift_type); + Py_CLEAR(state->Lambda_type); + Py_CLEAR(state->ListComp_type); + Py_CLEAR(state->List_type); + Py_CLEAR(state->Load_singleton); + Py_CLEAR(state->Load_type); + Py_CLEAR(state->LtE_singleton); + Py_CLEAR(state->LtE_type); + Py_CLEAR(state->Lt_singleton); + Py_CLEAR(state->Lt_type); + Py_CLEAR(state->MatMult_singleton); + Py_CLEAR(state->MatMult_type); + Py_CLEAR(state->Mod_singleton); + Py_CLEAR(state->Mod_type); + Py_CLEAR(state->Module_type); + Py_CLEAR(state->Mult_singleton); + Py_CLEAR(state->Mult_type); + Py_CLEAR(state->Name_type); + Py_CLEAR(state->NamedExpr_type); + Py_CLEAR(state->Nonlocal_type); + Py_CLEAR(state->NotEq_singleton); + Py_CLEAR(state->NotEq_type); + Py_CLEAR(state->NotIn_singleton); + Py_CLEAR(state->NotIn_type); + Py_CLEAR(state->Not_singleton); + Py_CLEAR(state->Not_type); + Py_CLEAR(state->Or_singleton); + Py_CLEAR(state->Or_type); + Py_CLEAR(state->Pass_type); + Py_CLEAR(state->Pow_singleton); + Py_CLEAR(state->Pow_type); + Py_CLEAR(state->RShift_singleton); + Py_CLEAR(state->RShift_type); + Py_CLEAR(state->Raise_type); + Py_CLEAR(state->Return_type); + Py_CLEAR(state->SetComp_type); + Py_CLEAR(state->Set_type); + Py_CLEAR(state->Slice_type); + Py_CLEAR(state->Starred_type); + Py_CLEAR(state->Store_singleton); + Py_CLEAR(state->Store_type); + Py_CLEAR(state->Sub_singleton); + Py_CLEAR(state->Sub_type); + Py_CLEAR(state->Subscript_type); + Py_CLEAR(state->Try_type); + Py_CLEAR(state->Tuple_type); + Py_CLEAR(state->TypeIgnore_type); + Py_CLEAR(state->UAdd_singleton); + Py_CLEAR(state->UAdd_type); + Py_CLEAR(state->USub_singleton); + Py_CLEAR(state->USub_type); + Py_CLEAR(state->UnaryOp_type); + Py_CLEAR(state->While_type); + Py_CLEAR(state->With_type); + Py_CLEAR(state->YieldFrom_type); + Py_CLEAR(state->Yield_type); + Py_CLEAR(state->__dict__); + Py_CLEAR(state->__doc__); + Py_CLEAR(state->__module__); + Py_CLEAR(state->_attributes); + Py_CLEAR(state->_fields); + Py_CLEAR(state->alias_type); + Py_CLEAR(state->annotation); + Py_CLEAR(state->arg); + Py_CLEAR(state->arg_type); + Py_CLEAR(state->args); + Py_CLEAR(state->argtypes); + Py_CLEAR(state->arguments_type); + Py_CLEAR(state->asname); + Py_CLEAR(state->ast); + Py_CLEAR(state->attr); + Py_CLEAR(state->bases); + Py_CLEAR(state->body); + Py_CLEAR(state->boolop_type); + Py_CLEAR(state->cause); + Py_CLEAR(state->cmpop_type); + Py_CLEAR(state->col_offset); + Py_CLEAR(state->comparators); + Py_CLEAR(state->comprehension_type); + Py_CLEAR(state->context_expr); + Py_CLEAR(state->conversion); + Py_CLEAR(state->ctx); + Py_CLEAR(state->decorator_list); + Py_CLEAR(state->defaults); + Py_CLEAR(state->elt); + Py_CLEAR(state->elts); + Py_CLEAR(state->end_col_offset); + Py_CLEAR(state->end_lineno); + Py_CLEAR(state->exc); + Py_CLEAR(state->excepthandler_type); + Py_CLEAR(state->expr_context_type); + Py_CLEAR(state->expr_type); + Py_CLEAR(state->finalbody); + Py_CLEAR(state->format_spec); + Py_CLEAR(state->func); + Py_CLEAR(state->generators); + Py_CLEAR(state->handlers); + Py_CLEAR(state->id); + Py_CLEAR(state->ifs); + Py_CLEAR(state->is_async); + Py_CLEAR(state->items); + Py_CLEAR(state->iter); + Py_CLEAR(state->key); + Py_CLEAR(state->keys); + Py_CLEAR(state->keyword_type); + Py_CLEAR(state->keywords); + Py_CLEAR(state->kind); + Py_CLEAR(state->kw_defaults); + Py_CLEAR(state->kwarg); + Py_CLEAR(state->kwonlyargs); + Py_CLEAR(state->left); + Py_CLEAR(state->level); + Py_CLEAR(state->lineno); + Py_CLEAR(state->lower); + Py_CLEAR(state->mod_type); + Py_CLEAR(state->module); + Py_CLEAR(state->msg); + Py_CLEAR(state->name); + Py_CLEAR(state->names); + Py_CLEAR(state->op); + Py_CLEAR(state->operand); + Py_CLEAR(state->operator_type); + Py_CLEAR(state->ops); + Py_CLEAR(state->optional_vars); + Py_CLEAR(state->orelse); + Py_CLEAR(state->posonlyargs); + Py_CLEAR(state->returns); + Py_CLEAR(state->right); + Py_CLEAR(state->simple); + Py_CLEAR(state->slice); + Py_CLEAR(state->step); + Py_CLEAR(state->stmt_type); + Py_CLEAR(state->tag); + Py_CLEAR(state->target); + Py_CLEAR(state->targets); + Py_CLEAR(state->test); + Py_CLEAR(state->type); + Py_CLEAR(state->type_comment); + Py_CLEAR(state->type_ignore_type); + Py_CLEAR(state->type_ignores); + Py_CLEAR(state->unaryop_type); + Py_CLEAR(state->upper); + Py_CLEAR(state->value); + Py_CLEAR(state->values); + Py_CLEAR(state->vararg); + Py_CLEAR(state->withitem_type); return 0; } static int astmodule_traverse(PyObject *module, visitproc visit, void* arg) { - Py_VISIT(astmodulestate(module)->AST_type); - Py_VISIT(astmodulestate(module)->Add_singleton); - Py_VISIT(astmodulestate(module)->Add_type); - Py_VISIT(astmodulestate(module)->And_singleton); - Py_VISIT(astmodulestate(module)->And_type); - Py_VISIT(astmodulestate(module)->AnnAssign_type); - Py_VISIT(astmodulestate(module)->Assert_type); - Py_VISIT(astmodulestate(module)->Assign_type); - Py_VISIT(astmodulestate(module)->AsyncFor_type); - Py_VISIT(astmodulestate(module)->AsyncFunctionDef_type); - Py_VISIT(astmodulestate(module)->AsyncWith_type); - Py_VISIT(astmodulestate(module)->Attribute_type); - Py_VISIT(astmodulestate(module)->AugAssign_type); - Py_VISIT(astmodulestate(module)->Await_type); - Py_VISIT(astmodulestate(module)->BinOp_type); - Py_VISIT(astmodulestate(module)->BitAnd_singleton); - Py_VISIT(astmodulestate(module)->BitAnd_type); - Py_VISIT(astmodulestate(module)->BitOr_singleton); - Py_VISIT(astmodulestate(module)->BitOr_type); - Py_VISIT(astmodulestate(module)->BitXor_singleton); - Py_VISIT(astmodulestate(module)->BitXor_type); - Py_VISIT(astmodulestate(module)->BoolOp_type); - Py_VISIT(astmodulestate(module)->Break_type); - Py_VISIT(astmodulestate(module)->Call_type); - Py_VISIT(astmodulestate(module)->ClassDef_type); - Py_VISIT(astmodulestate(module)->Compare_type); - Py_VISIT(astmodulestate(module)->Constant_type); - Py_VISIT(astmodulestate(module)->Continue_type); - Py_VISIT(astmodulestate(module)->Del_singleton); - Py_VISIT(astmodulestate(module)->Del_type); - Py_VISIT(astmodulestate(module)->Delete_type); - Py_VISIT(astmodulestate(module)->DictComp_type); - Py_VISIT(astmodulestate(module)->Dict_type); - Py_VISIT(astmodulestate(module)->Div_singleton); - Py_VISIT(astmodulestate(module)->Div_type); - Py_VISIT(astmodulestate(module)->Eq_singleton); - Py_VISIT(astmodulestate(module)->Eq_type); - Py_VISIT(astmodulestate(module)->ExceptHandler_type); - Py_VISIT(astmodulestate(module)->Expr_type); - Py_VISIT(astmodulestate(module)->Expression_type); - Py_VISIT(astmodulestate(module)->FloorDiv_singleton); - Py_VISIT(astmodulestate(module)->FloorDiv_type); - Py_VISIT(astmodulestate(module)->For_type); - Py_VISIT(astmodulestate(module)->FormattedValue_type); - Py_VISIT(astmodulestate(module)->FunctionDef_type); - Py_VISIT(astmodulestate(module)->FunctionType_type); - Py_VISIT(astmodulestate(module)->GeneratorExp_type); - Py_VISIT(astmodulestate(module)->Global_type); - Py_VISIT(astmodulestate(module)->GtE_singleton); - Py_VISIT(astmodulestate(module)->GtE_type); - Py_VISIT(astmodulestate(module)->Gt_singleton); - Py_VISIT(astmodulestate(module)->Gt_type); - Py_VISIT(astmodulestate(module)->IfExp_type); - Py_VISIT(astmodulestate(module)->If_type); - Py_VISIT(astmodulestate(module)->ImportFrom_type); - Py_VISIT(astmodulestate(module)->Import_type); - Py_VISIT(astmodulestate(module)->In_singleton); - Py_VISIT(astmodulestate(module)->In_type); - Py_VISIT(astmodulestate(module)->Interactive_type); - Py_VISIT(astmodulestate(module)->Invert_singleton); - Py_VISIT(astmodulestate(module)->Invert_type); - Py_VISIT(astmodulestate(module)->IsNot_singleton); - Py_VISIT(astmodulestate(module)->IsNot_type); - Py_VISIT(astmodulestate(module)->Is_singleton); - Py_VISIT(astmodulestate(module)->Is_type); - Py_VISIT(astmodulestate(module)->JoinedStr_type); - Py_VISIT(astmodulestate(module)->LShift_singleton); - Py_VISIT(astmodulestate(module)->LShift_type); - Py_VISIT(astmodulestate(module)->Lambda_type); - Py_VISIT(astmodulestate(module)->ListComp_type); - Py_VISIT(astmodulestate(module)->List_type); - Py_VISIT(astmodulestate(module)->Load_singleton); - Py_VISIT(astmodulestate(module)->Load_type); - Py_VISIT(astmodulestate(module)->LtE_singleton); - Py_VISIT(astmodulestate(module)->LtE_type); - Py_VISIT(astmodulestate(module)->Lt_singleton); - Py_VISIT(astmodulestate(module)->Lt_type); - Py_VISIT(astmodulestate(module)->MatMult_singleton); - Py_VISIT(astmodulestate(module)->MatMult_type); - Py_VISIT(astmodulestate(module)->Mod_singleton); - Py_VISIT(astmodulestate(module)->Mod_type); - Py_VISIT(astmodulestate(module)->Module_type); - Py_VISIT(astmodulestate(module)->Mult_singleton); - Py_VISIT(astmodulestate(module)->Mult_type); - Py_VISIT(astmodulestate(module)->Name_type); - Py_VISIT(astmodulestate(module)->NamedExpr_type); - Py_VISIT(astmodulestate(module)->Nonlocal_type); - Py_VISIT(astmodulestate(module)->NotEq_singleton); - Py_VISIT(astmodulestate(module)->NotEq_type); - Py_VISIT(astmodulestate(module)->NotIn_singleton); - Py_VISIT(astmodulestate(module)->NotIn_type); - Py_VISIT(astmodulestate(module)->Not_singleton); - Py_VISIT(astmodulestate(module)->Not_type); - Py_VISIT(astmodulestate(module)->Or_singleton); - Py_VISIT(astmodulestate(module)->Or_type); - Py_VISIT(astmodulestate(module)->Pass_type); - Py_VISIT(astmodulestate(module)->Pow_singleton); - Py_VISIT(astmodulestate(module)->Pow_type); - Py_VISIT(astmodulestate(module)->RShift_singleton); - Py_VISIT(astmodulestate(module)->RShift_type); - Py_VISIT(astmodulestate(module)->Raise_type); - Py_VISIT(astmodulestate(module)->Return_type); - Py_VISIT(astmodulestate(module)->SetComp_type); - Py_VISIT(astmodulestate(module)->Set_type); - Py_VISIT(astmodulestate(module)->Slice_type); - Py_VISIT(astmodulestate(module)->Starred_type); - Py_VISIT(astmodulestate(module)->Store_singleton); - Py_VISIT(astmodulestate(module)->Store_type); - Py_VISIT(astmodulestate(module)->Sub_singleton); - Py_VISIT(astmodulestate(module)->Sub_type); - Py_VISIT(astmodulestate(module)->Subscript_type); - Py_VISIT(astmodulestate(module)->Try_type); - Py_VISIT(astmodulestate(module)->Tuple_type); - Py_VISIT(astmodulestate(module)->TypeIgnore_type); - Py_VISIT(astmodulestate(module)->UAdd_singleton); - Py_VISIT(astmodulestate(module)->UAdd_type); - Py_VISIT(astmodulestate(module)->USub_singleton); - Py_VISIT(astmodulestate(module)->USub_type); - Py_VISIT(astmodulestate(module)->UnaryOp_type); - Py_VISIT(astmodulestate(module)->While_type); - Py_VISIT(astmodulestate(module)->With_type); - Py_VISIT(astmodulestate(module)->YieldFrom_type); - Py_VISIT(astmodulestate(module)->Yield_type); - Py_VISIT(astmodulestate(module)->__dict__); - Py_VISIT(astmodulestate(module)->__doc__); - Py_VISIT(astmodulestate(module)->__module__); - Py_VISIT(astmodulestate(module)->_attributes); - Py_VISIT(astmodulestate(module)->_fields); - Py_VISIT(astmodulestate(module)->alias_type); - Py_VISIT(astmodulestate(module)->annotation); - Py_VISIT(astmodulestate(module)->arg); - Py_VISIT(astmodulestate(module)->arg_type); - Py_VISIT(astmodulestate(module)->args); - Py_VISIT(astmodulestate(module)->argtypes); - Py_VISIT(astmodulestate(module)->arguments_type); - Py_VISIT(astmodulestate(module)->asname); - Py_VISIT(astmodulestate(module)->ast); - Py_VISIT(astmodulestate(module)->attr); - Py_VISIT(astmodulestate(module)->bases); - Py_VISIT(astmodulestate(module)->body); - Py_VISIT(astmodulestate(module)->boolop_type); - Py_VISIT(astmodulestate(module)->cause); - Py_VISIT(astmodulestate(module)->cmpop_type); - Py_VISIT(astmodulestate(module)->col_offset); - Py_VISIT(astmodulestate(module)->comparators); - Py_VISIT(astmodulestate(module)->comprehension_type); - Py_VISIT(astmodulestate(module)->context_expr); - Py_VISIT(astmodulestate(module)->conversion); - Py_VISIT(astmodulestate(module)->ctx); - Py_VISIT(astmodulestate(module)->decorator_list); - Py_VISIT(astmodulestate(module)->defaults); - Py_VISIT(astmodulestate(module)->elt); - Py_VISIT(astmodulestate(module)->elts); - Py_VISIT(astmodulestate(module)->end_col_offset); - Py_VISIT(astmodulestate(module)->end_lineno); - Py_VISIT(astmodulestate(module)->exc); - Py_VISIT(astmodulestate(module)->excepthandler_type); - Py_VISIT(astmodulestate(module)->expr_context_type); - Py_VISIT(astmodulestate(module)->expr_type); - Py_VISIT(astmodulestate(module)->finalbody); - Py_VISIT(astmodulestate(module)->format_spec); - Py_VISIT(astmodulestate(module)->func); - Py_VISIT(astmodulestate(module)->generators); - Py_VISIT(astmodulestate(module)->handlers); - Py_VISIT(astmodulestate(module)->id); - Py_VISIT(astmodulestate(module)->ifs); - Py_VISIT(astmodulestate(module)->is_async); - Py_VISIT(astmodulestate(module)->items); - Py_VISIT(astmodulestate(module)->iter); - Py_VISIT(astmodulestate(module)->key); - Py_VISIT(astmodulestate(module)->keys); - Py_VISIT(astmodulestate(module)->keyword_type); - Py_VISIT(astmodulestate(module)->keywords); - Py_VISIT(astmodulestate(module)->kind); - Py_VISIT(astmodulestate(module)->kw_defaults); - Py_VISIT(astmodulestate(module)->kwarg); - Py_VISIT(astmodulestate(module)->kwonlyargs); - Py_VISIT(astmodulestate(module)->left); - Py_VISIT(astmodulestate(module)->level); - Py_VISIT(astmodulestate(module)->lineno); - Py_VISIT(astmodulestate(module)->lower); - Py_VISIT(astmodulestate(module)->mod_type); - Py_VISIT(astmodulestate(module)->module); - Py_VISIT(astmodulestate(module)->msg); - Py_VISIT(astmodulestate(module)->name); - Py_VISIT(astmodulestate(module)->names); - Py_VISIT(astmodulestate(module)->op); - Py_VISIT(astmodulestate(module)->operand); - Py_VISIT(astmodulestate(module)->operator_type); - Py_VISIT(astmodulestate(module)->ops); - Py_VISIT(astmodulestate(module)->optional_vars); - Py_VISIT(astmodulestate(module)->orelse); - Py_VISIT(astmodulestate(module)->posonlyargs); - Py_VISIT(astmodulestate(module)->returns); - Py_VISIT(astmodulestate(module)->right); - Py_VISIT(astmodulestate(module)->simple); - Py_VISIT(astmodulestate(module)->slice); - Py_VISIT(astmodulestate(module)->step); - Py_VISIT(astmodulestate(module)->stmt_type); - Py_VISIT(astmodulestate(module)->tag); - Py_VISIT(astmodulestate(module)->target); - Py_VISIT(astmodulestate(module)->targets); - Py_VISIT(astmodulestate(module)->test); - Py_VISIT(astmodulestate(module)->type); - Py_VISIT(astmodulestate(module)->type_comment); - Py_VISIT(astmodulestate(module)->type_ignore_type); - Py_VISIT(astmodulestate(module)->type_ignores); - Py_VISIT(astmodulestate(module)->unaryop_type); - Py_VISIT(astmodulestate(module)->upper); - Py_VISIT(astmodulestate(module)->value); - Py_VISIT(astmodulestate(module)->values); - Py_VISIT(astmodulestate(module)->vararg); - Py_VISIT(astmodulestate(module)->withitem_type); + astmodulestate *state = get_ast_state(module); + Py_VISIT(state->AST_type); + Py_VISIT(state->Add_singleton); + Py_VISIT(state->Add_type); + Py_VISIT(state->And_singleton); + Py_VISIT(state->And_type); + Py_VISIT(state->AnnAssign_type); + Py_VISIT(state->Assert_type); + Py_VISIT(state->Assign_type); + Py_VISIT(state->AsyncFor_type); + Py_VISIT(state->AsyncFunctionDef_type); + Py_VISIT(state->AsyncWith_type); + Py_VISIT(state->Attribute_type); + Py_VISIT(state->AugAssign_type); + Py_VISIT(state->Await_type); + Py_VISIT(state->BinOp_type); + Py_VISIT(state->BitAnd_singleton); + Py_VISIT(state->BitAnd_type); + Py_VISIT(state->BitOr_singleton); + Py_VISIT(state->BitOr_type); + Py_VISIT(state->BitXor_singleton); + Py_VISIT(state->BitXor_type); + Py_VISIT(state->BoolOp_type); + Py_VISIT(state->Break_type); + Py_VISIT(state->Call_type); + Py_VISIT(state->ClassDef_type); + Py_VISIT(state->Compare_type); + Py_VISIT(state->Constant_type); + Py_VISIT(state->Continue_type); + Py_VISIT(state->Del_singleton); + Py_VISIT(state->Del_type); + Py_VISIT(state->Delete_type); + Py_VISIT(state->DictComp_type); + Py_VISIT(state->Dict_type); + Py_VISIT(state->Div_singleton); + Py_VISIT(state->Div_type); + Py_VISIT(state->Eq_singleton); + Py_VISIT(state->Eq_type); + Py_VISIT(state->ExceptHandler_type); + Py_VISIT(state->Expr_type); + Py_VISIT(state->Expression_type); + Py_VISIT(state->FloorDiv_singleton); + Py_VISIT(state->FloorDiv_type); + Py_VISIT(state->For_type); + Py_VISIT(state->FormattedValue_type); + Py_VISIT(state->FunctionDef_type); + Py_VISIT(state->FunctionType_type); + Py_VISIT(state->GeneratorExp_type); + Py_VISIT(state->Global_type); + Py_VISIT(state->GtE_singleton); + Py_VISIT(state->GtE_type); + Py_VISIT(state->Gt_singleton); + Py_VISIT(state->Gt_type); + Py_VISIT(state->IfExp_type); + Py_VISIT(state->If_type); + Py_VISIT(state->ImportFrom_type); + Py_VISIT(state->Import_type); + Py_VISIT(state->In_singleton); + Py_VISIT(state->In_type); + Py_VISIT(state->Interactive_type); + Py_VISIT(state->Invert_singleton); + Py_VISIT(state->Invert_type); + Py_VISIT(state->IsNot_singleton); + Py_VISIT(state->IsNot_type); + Py_VISIT(state->Is_singleton); + Py_VISIT(state->Is_type); + Py_VISIT(state->JoinedStr_type); + Py_VISIT(state->LShift_singleton); + Py_VISIT(state->LShift_type); + Py_VISIT(state->Lambda_type); + Py_VISIT(state->ListComp_type); + Py_VISIT(state->List_type); + Py_VISIT(state->Load_singleton); + Py_VISIT(state->Load_type); + Py_VISIT(state->LtE_singleton); + Py_VISIT(state->LtE_type); + Py_VISIT(state->Lt_singleton); + Py_VISIT(state->Lt_type); + Py_VISIT(state->MatMult_singleton); + Py_VISIT(state->MatMult_type); + Py_VISIT(state->Mod_singleton); + Py_VISIT(state->Mod_type); + Py_VISIT(state->Module_type); + Py_VISIT(state->Mult_singleton); + Py_VISIT(state->Mult_type); + Py_VISIT(state->Name_type); + Py_VISIT(state->NamedExpr_type); + Py_VISIT(state->Nonlocal_type); + Py_VISIT(state->NotEq_singleton); + Py_VISIT(state->NotEq_type); + Py_VISIT(state->NotIn_singleton); + Py_VISIT(state->NotIn_type); + Py_VISIT(state->Not_singleton); + Py_VISIT(state->Not_type); + Py_VISIT(state->Or_singleton); + Py_VISIT(state->Or_type); + Py_VISIT(state->Pass_type); + Py_VISIT(state->Pow_singleton); + Py_VISIT(state->Pow_type); + Py_VISIT(state->RShift_singleton); + Py_VISIT(state->RShift_type); + Py_VISIT(state->Raise_type); + Py_VISIT(state->Return_type); + Py_VISIT(state->SetComp_type); + Py_VISIT(state->Set_type); + Py_VISIT(state->Slice_type); + Py_VISIT(state->Starred_type); + Py_VISIT(state->Store_singleton); + Py_VISIT(state->Store_type); + Py_VISIT(state->Sub_singleton); + Py_VISIT(state->Sub_type); + Py_VISIT(state->Subscript_type); + Py_VISIT(state->Try_type); + Py_VISIT(state->Tuple_type); + Py_VISIT(state->TypeIgnore_type); + Py_VISIT(state->UAdd_singleton); + Py_VISIT(state->UAdd_type); + Py_VISIT(state->USub_singleton); + Py_VISIT(state->USub_type); + Py_VISIT(state->UnaryOp_type); + Py_VISIT(state->While_type); + Py_VISIT(state->With_type); + Py_VISIT(state->YieldFrom_type); + Py_VISIT(state->Yield_type); + Py_VISIT(state->__dict__); + Py_VISIT(state->__doc__); + Py_VISIT(state->__module__); + Py_VISIT(state->_attributes); + Py_VISIT(state->_fields); + Py_VISIT(state->alias_type); + Py_VISIT(state->annotation); + Py_VISIT(state->arg); + Py_VISIT(state->arg_type); + Py_VISIT(state->args); + Py_VISIT(state->argtypes); + Py_VISIT(state->arguments_type); + Py_VISIT(state->asname); + Py_VISIT(state->ast); + Py_VISIT(state->attr); + Py_VISIT(state->bases); + Py_VISIT(state->body); + Py_VISIT(state->boolop_type); + Py_VISIT(state->cause); + Py_VISIT(state->cmpop_type); + Py_VISIT(state->col_offset); + Py_VISIT(state->comparators); + Py_VISIT(state->comprehension_type); + Py_VISIT(state->context_expr); + Py_VISIT(state->conversion); + Py_VISIT(state->ctx); + Py_VISIT(state->decorator_list); + Py_VISIT(state->defaults); + Py_VISIT(state->elt); + Py_VISIT(state->elts); + Py_VISIT(state->end_col_offset); + Py_VISIT(state->end_lineno); + Py_VISIT(state->exc); + Py_VISIT(state->excepthandler_type); + Py_VISIT(state->expr_context_type); + Py_VISIT(state->expr_type); + Py_VISIT(state->finalbody); + Py_VISIT(state->format_spec); + Py_VISIT(state->func); + Py_VISIT(state->generators); + Py_VISIT(state->handlers); + Py_VISIT(state->id); + Py_VISIT(state->ifs); + Py_VISIT(state->is_async); + Py_VISIT(state->items); + Py_VISIT(state->iter); + Py_VISIT(state->key); + Py_VISIT(state->keys); + Py_VISIT(state->keyword_type); + Py_VISIT(state->keywords); + Py_VISIT(state->kind); + Py_VISIT(state->kw_defaults); + Py_VISIT(state->kwarg); + Py_VISIT(state->kwonlyargs); + Py_VISIT(state->left); + Py_VISIT(state->level); + Py_VISIT(state->lineno); + Py_VISIT(state->lower); + Py_VISIT(state->mod_type); + Py_VISIT(state->module); + Py_VISIT(state->msg); + Py_VISIT(state->name); + Py_VISIT(state->names); + Py_VISIT(state->op); + Py_VISIT(state->operand); + Py_VISIT(state->operator_type); + Py_VISIT(state->ops); + Py_VISIT(state->optional_vars); + Py_VISIT(state->orelse); + Py_VISIT(state->posonlyargs); + Py_VISIT(state->returns); + Py_VISIT(state->right); + Py_VISIT(state->simple); + Py_VISIT(state->slice); + Py_VISIT(state->step); + Py_VISIT(state->stmt_type); + Py_VISIT(state->tag); + Py_VISIT(state->target); + Py_VISIT(state->targets); + Py_VISIT(state->test); + Py_VISIT(state->type); + Py_VISIT(state->type_comment); + Py_VISIT(state->type_ignore_type); + Py_VISIT(state->type_ignores); + Py_VISIT(state->unaryop_type); + Py_VISIT(state->upper); + Py_VISIT(state->value); + Py_VISIT(state->values); + Py_VISIT(state->vararg); + Py_VISIT(state->withitem_type); return 0; } @@ -680,11 +689,10 @@ static struct PyModuleDef _astmodule = { astmodule_free, }; -#define astmodulestate_global ((astmodulestate *)PyModule_GetState(PyState_FindModule(&_astmodule))) +#define astmodulestate_global get_ast_state(PyState_FindModule(&_astmodule)) -static int init_identifiers(void) +static int init_identifiers(astmodulestate *state) { - astmodulestate *state = astmodulestate_global; if ((state->__dict__ = PyUnicode_InternFromString("__dict__")) == NULL) return 0; if ((state->__doc__ = PyUnicode_InternFromString("__doc__")) == NULL) return 0; if ((state->__module__ = PyUnicode_InternFromString("__module__")) == NULL) return 0; @@ -762,7 +770,7 @@ static int init_identifiers(void) return 1; }; -static PyObject* ast2obj_mod(void*); +static PyObject* ast2obj_mod(astmodulestate *state, void*); static const char * const Module_fields[]={ "body", "type_ignores", @@ -783,7 +791,7 @@ static const char * const stmt_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_stmt(void*); +static PyObject* ast2obj_stmt(astmodulestate *state, void*); static const char * const FunctionDef_fields[]={ "name", "args", @@ -900,7 +908,7 @@ static const char * const expr_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_expr(void*); +static PyObject* ast2obj_expr(astmodulestate *state, void*); static const char * const BoolOp_fields[]={ "op", "values", @@ -1013,12 +1021,12 @@ static const char * const Slice_fields[]={ "upper", "step", }; -static PyObject* ast2obj_expr_context(expr_context_ty); -static PyObject* ast2obj_boolop(boolop_ty); -static PyObject* ast2obj_operator(operator_ty); -static PyObject* ast2obj_unaryop(unaryop_ty); -static PyObject* ast2obj_cmpop(cmpop_ty); -static PyObject* ast2obj_comprehension(void*); +static PyObject* ast2obj_expr_context(astmodulestate *state, expr_context_ty); +static PyObject* ast2obj_boolop(astmodulestate *state, boolop_ty); +static PyObject* ast2obj_operator(astmodulestate *state, operator_ty); +static PyObject* ast2obj_unaryop(astmodulestate *state, unaryop_ty); +static PyObject* ast2obj_cmpop(astmodulestate *state, cmpop_ty); +static PyObject* ast2obj_comprehension(astmodulestate *state, void*); static const char * const comprehension_fields[]={ "target", "iter", @@ -1031,13 +1039,13 @@ static const char * const excepthandler_attributes[] = { "end_lineno", "end_col_offset", }; -static PyObject* ast2obj_excepthandler(void*); +static PyObject* ast2obj_excepthandler(astmodulestate *state, void*); static const char * const ExceptHandler_fields[]={ "type", "name", "body", }; -static PyObject* ast2obj_arguments(void*); +static PyObject* ast2obj_arguments(astmodulestate *state, void*); static const char * const arguments_fields[]={ "posonlyargs", "args", @@ -1047,7 +1055,7 @@ static const char * const arguments_fields[]={ "kwarg", "defaults", }; -static PyObject* ast2obj_arg(void*); +static PyObject* ast2obj_arg(astmodulestate *state, void*); static const char * const arg_attributes[] = { "lineno", "col_offset", @@ -1059,7 +1067,7 @@ static const char * const arg_fields[]={ "annotation", "type_comment", }; -static PyObject* ast2obj_keyword(void*); +static PyObject* ast2obj_keyword(astmodulestate *state, void*); static const char * const keyword_attributes[] = { "lineno", "col_offset", @@ -1070,17 +1078,17 @@ static const char * const keyword_fields[]={ "arg", "value", }; -static PyObject* ast2obj_alias(void*); +static PyObject* ast2obj_alias(astmodulestate *state, void*); static const char * const alias_fields[]={ "name", "asname", }; -static PyObject* ast2obj_withitem(void*); +static PyObject* ast2obj_withitem(astmodulestate *state, void*); static const char * const withitem_fields[]={ "context_expr", "optional_vars", }; -static PyObject* ast2obj_type_ignore(void*); +static PyObject* ast2obj_type_ignore(astmodulestate *state, void*); static const char * const TypeIgnore_fields[]={ "lineno", "tag", @@ -1127,7 +1135,8 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) Py_ssize_t i, numfields = 0; int res = -1; PyObject *key, *value, *fields; - if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), astmodulestate_global->_fields, &fields) < 0) { + astmodulestate *state = astmodulestate_global; + if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } if (fields) { @@ -1195,8 +1204,9 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) static PyObject * ast_type_reduce(PyObject *self, PyObject *unused) { + astmodulestate *state = astmodulestate_global; PyObject *dict; - if (_PyObject_LookupAttr(self, astmodulestate_global->__dict__, &dict) < 0) { + if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; } if (dict) { @@ -1245,7 +1255,8 @@ static PyType_Spec AST_type_spec = { }; static PyObject * -make_type(const char *type, PyObject* base, const char* const* fields, int num_fields, const char *doc) +make_type(astmodulestate *state, const char *type, PyObject* base, + const char* const* fields, int num_fields, const char *doc) { PyObject *fnames, *result; int i; @@ -1261,16 +1272,16 @@ make_type(const char *type, PyObject* base, const char* const* fields, int num_f } result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){OOOOOs}", type, base, - astmodulestate_global->_fields, fnames, - astmodulestate_global->__module__, - astmodulestate_global->ast, - astmodulestate_global->__doc__, doc); + state->_fields, fnames, + state->__module__, + state->ast, + state->__doc__, doc); Py_DECREF(fnames); return result; } static int -add_attributes(PyObject *type, const char * const *attrs, int num_fields) +add_attributes(astmodulestate *state, PyObject *type, const char * const *attrs, int num_fields) { int i, result; PyObject *s, *l = PyTuple_New(num_fields); @@ -1284,14 +1295,14 @@ add_attributes(PyObject *type, const char * const *attrs, int num_fields) } PyTuple_SET_ITEM(l, i, s); } - result = PyObject_SetAttr(type, astmodulestate_global->_attributes, l) >= 0; + result = PyObject_SetAttr(type, state->_attributes, l) >= 0; Py_DECREF(l); return result; } /* Conversion AST -> Python */ -static PyObject* ast2obj_list(asdl_seq *seq, PyObject* (*func)(void*)) +static PyObject* ast2obj_list(astmodulestate *state, asdl_seq *seq, PyObject* (*func)(astmodulestate *state, void*)) { Py_ssize_t i, n = asdl_seq_LEN(seq); PyObject *result = PyList_New(n); @@ -1299,7 +1310,7 @@ static PyObject* ast2obj_list(asdl_seq *seq, PyObject* (*func)(void*)) if (!result) return NULL; for (i = 0; i < n; i++) { - value = func(asdl_seq_GET(seq, i)); + value = func(state, asdl_seq_GET(seq, i)); if (!value) { Py_DECREF(result); return NULL; @@ -1309,7 +1320,7 @@ static PyObject* ast2obj_list(asdl_seq *seq, PyObject* (*func)(void*)) return result; } -static PyObject* ast2obj_object(void *o) +static PyObject* ast2obj_object(astmodulestate *Py_UNUSED(state), void *o) { if (!o) o = Py_None; @@ -1320,14 +1331,14 @@ static PyObject* ast2obj_object(void *o) #define ast2obj_identifier ast2obj_object #define ast2obj_string ast2obj_object -static PyObject* ast2obj_int(long b) +static PyObject* ast2obj_int(astmodulestate *Py_UNUSED(state), long b) { return PyLong_FromLong(b); } /* Conversion Python -> AST */ -static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_object(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { if (obj == Py_None) obj = NULL; @@ -1342,7 +1353,7 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) return 0; } -static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_constant(astmodulestate *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { if (PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; @@ -1353,25 +1364,25 @@ static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena) return 0; } -static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_identifier(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) { if (!PyUnicode_CheckExact(obj) && obj != Py_None) { PyErr_SetString(PyExc_TypeError, "AST identifier must be of type str"); return 1; } - return obj2ast_object(obj, out, arena); + return obj2ast_object(state, obj, out, arena); } -static int obj2ast_string(PyObject* obj, PyObject** out, PyArena* arena) +static int obj2ast_string(astmodulestate *state, PyObject* obj, PyObject** out, PyArena* arena) { if (!PyUnicode_CheckExact(obj) && !PyBytes_CheckExact(obj)) { PyErr_SetString(PyExc_TypeError, "AST string must be of type str"); return 1; } - return obj2ast_object(obj, out, arena); + return obj2ast_object(state, obj, out, arena); } -static int obj2ast_int(PyObject* obj, int* out, PyArena* arena) +static int obj2ast_int(astmodulestate* Py_UNUSED(state), PyObject* obj, int* out, PyArena* arena) { int i; if (!PyLong_Check(obj)) { @@ -1386,13 +1397,13 @@ static int obj2ast_int(PyObject* obj, int* out, PyArena* arena) return 0; } -static int add_ast_fields(void) +static int add_ast_fields(astmodulestate *state) { PyObject *empty_tuple; empty_tuple = PyTuple_New(0); if (!empty_tuple || - PyObject_SetAttrString(astmodulestate_global->AST_type, "_fields", empty_tuple) < 0 || - PyObject_SetAttrString(astmodulestate_global->AST_type, "_attributes", empty_tuple) < 0) { + PyObject_SetAttrString(state->AST_type, "_fields", empty_tuple) < 0 || + PyObject_SetAttrString(state->AST_type, "_attributes", empty_tuple) < 0) { Py_XDECREF(empty_tuple); return -1; } @@ -1403,41 +1414,48 @@ static int add_ast_fields(void) static int init_types(void) { - PyObject *m; - if (PyState_FindModule(&_astmodule) == NULL) { - m = PyModule_Create(&_astmodule); - if (!m) return 0; - PyState_AddModule(m, &_astmodule); + PyObject *module = PyState_FindModule(&_astmodule); + if (module == NULL) { + module = PyModule_Create(&_astmodule); + if (!module) { + return 0; + } + if (PyState_AddModule(module, &_astmodule) < 0) { + return 0; + } } - astmodulestate *state = astmodulestate_global; + + astmodulestate *state = get_ast_state(module); if (state->initialized) return 1; - if (init_identifiers() < 0) return 0; + if (init_identifiers(state) < 0) return 0; state->AST_type = PyType_FromSpec(&AST_type_spec); if (!state->AST_type) return 0; - if (add_ast_fields() < 0) return 0; - state->mod_type = make_type("mod", state->AST_type, NULL, 0, + if (add_ast_fields(state) < 0) return 0; + state->mod_type = make_type(state, "mod", state->AST_type, NULL, 0, "mod = Module(stmt* body, type_ignore* type_ignores)\n" " | Interactive(stmt* body)\n" " | Expression(expr body)\n" " | FunctionType(expr* argtypes, expr returns)"); if (!state->mod_type) return 0; - if (!add_attributes(state->mod_type, NULL, 0)) return 0; - state->Module_type = make_type("Module", state->mod_type, Module_fields, 2, + if (!add_attributes(state, state->mod_type, NULL, 0)) return 0; + state->Module_type = make_type(state, "Module", state->mod_type, + Module_fields, 2, "Module(stmt* body, type_ignore* type_ignores)"); if (!state->Module_type) return 0; - state->Interactive_type = make_type("Interactive", state->mod_type, + state->Interactive_type = make_type(state, "Interactive", state->mod_type, Interactive_fields, 1, "Interactive(stmt* body)"); if (!state->Interactive_type) return 0; - state->Expression_type = make_type("Expression", state->mod_type, + state->Expression_type = make_type(state, "Expression", state->mod_type, Expression_fields, 1, "Expression(expr body)"); if (!state->Expression_type) return 0; - state->FunctionType_type = make_type("FunctionType", state->mod_type, - FunctionType_fields, 2, + state->FunctionType_type = make_type(state, "FunctionType", + state->mod_type, FunctionType_fields, + 2, "FunctionType(expr* argtypes, expr returns)"); if (!state->FunctionType_type) return 0; - state->stmt_type = make_type("stmt", state->AST_type, NULL, 0, + state->stmt_type = make_type(state, "stmt", state->AST_type, NULL, 0, "stmt = FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n" " | AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)\n" " | ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)\n" @@ -1464,13 +1482,13 @@ static int init_types(void) " | Break\n" " | Continue"); if (!state->stmt_type) return 0; - if (!add_attributes(state->stmt_type, stmt_attributes, 4)) return 0; + if (!add_attributes(state, state->stmt_type, stmt_attributes, 4)) return 0; if (PyObject_SetAttr(state->stmt_type, state->end_lineno, Py_None) == -1) return 0; if (PyObject_SetAttr(state->stmt_type, state->end_col_offset, Py_None) == -1) return 0; - state->FunctionDef_type = make_type("FunctionDef", state->stmt_type, + state->FunctionDef_type = make_type(state, "FunctionDef", state->stmt_type, FunctionDef_fields, 6, "FunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"); if (!state->FunctionDef_type) return 0; @@ -1480,7 +1498,7 @@ static int init_types(void) if (PyObject_SetAttr(state->FunctionDef_type, state->type_comment, Py_None) == -1) return 0; - state->AsyncFunctionDef_type = make_type("AsyncFunctionDef", + state->AsyncFunctionDef_type = make_type(state, "AsyncFunctionDef", state->stmt_type, AsyncFunctionDef_fields, 6, "AsyncFunctionDef(identifier name, arguments args, stmt* body, expr* decorator_list, expr? returns, string? type_comment)"); @@ -1491,83 +1509,91 @@ static int init_types(void) if (PyObject_SetAttr(state->AsyncFunctionDef_type, state->type_comment, Py_None) == -1) return 0; - state->ClassDef_type = make_type("ClassDef", state->stmt_type, + state->ClassDef_type = make_type(state, "ClassDef", state->stmt_type, ClassDef_fields, 5, "ClassDef(identifier name, expr* bases, keyword* keywords, stmt* body, expr* decorator_list)"); if (!state->ClassDef_type) return 0; - state->Return_type = make_type("Return", state->stmt_type, Return_fields, 1, + state->Return_type = make_type(state, "Return", state->stmt_type, + Return_fields, 1, "Return(expr? value)"); if (!state->Return_type) return 0; if (PyObject_SetAttr(state->Return_type, state->value, Py_None) == -1) return 0; - state->Delete_type = make_type("Delete", state->stmt_type, Delete_fields, 1, + state->Delete_type = make_type(state, "Delete", state->stmt_type, + Delete_fields, 1, "Delete(expr* targets)"); if (!state->Delete_type) return 0; - state->Assign_type = make_type("Assign", state->stmt_type, Assign_fields, 3, + state->Assign_type = make_type(state, "Assign", state->stmt_type, + Assign_fields, 3, "Assign(expr* targets, expr value, string? type_comment)"); if (!state->Assign_type) return 0; if (PyObject_SetAttr(state->Assign_type, state->type_comment, Py_None) == -1) return 0; - state->AugAssign_type = make_type("AugAssign", state->stmt_type, + state->AugAssign_type = make_type(state, "AugAssign", state->stmt_type, AugAssign_fields, 3, "AugAssign(expr target, operator op, expr value)"); if (!state->AugAssign_type) return 0; - state->AnnAssign_type = make_type("AnnAssign", state->stmt_type, + state->AnnAssign_type = make_type(state, "AnnAssign", state->stmt_type, AnnAssign_fields, 4, "AnnAssign(expr target, expr annotation, expr? value, int simple)"); if (!state->AnnAssign_type) return 0; if (PyObject_SetAttr(state->AnnAssign_type, state->value, Py_None) == -1) return 0; - state->For_type = make_type("For", state->stmt_type, For_fields, 5, + state->For_type = make_type(state, "For", state->stmt_type, For_fields, 5, "For(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"); if (!state->For_type) return 0; if (PyObject_SetAttr(state->For_type, state->type_comment, Py_None) == -1) return 0; - state->AsyncFor_type = make_type("AsyncFor", state->stmt_type, + state->AsyncFor_type = make_type(state, "AsyncFor", state->stmt_type, AsyncFor_fields, 5, "AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, string? type_comment)"); if (!state->AsyncFor_type) return 0; if (PyObject_SetAttr(state->AsyncFor_type, state->type_comment, Py_None) == -1) return 0; - state->While_type = make_type("While", state->stmt_type, While_fields, 3, + state->While_type = make_type(state, "While", state->stmt_type, + While_fields, 3, "While(expr test, stmt* body, stmt* orelse)"); if (!state->While_type) return 0; - state->If_type = make_type("If", state->stmt_type, If_fields, 3, + state->If_type = make_type(state, "If", state->stmt_type, If_fields, 3, "If(expr test, stmt* body, stmt* orelse)"); if (!state->If_type) return 0; - state->With_type = make_type("With", state->stmt_type, With_fields, 3, + state->With_type = make_type(state, "With", state->stmt_type, With_fields, + 3, "With(withitem* items, stmt* body, string? type_comment)"); if (!state->With_type) return 0; if (PyObject_SetAttr(state->With_type, state->type_comment, Py_None) == -1) return 0; - state->AsyncWith_type = make_type("AsyncWith", state->stmt_type, + state->AsyncWith_type = make_type(state, "AsyncWith", state->stmt_type, AsyncWith_fields, 3, "AsyncWith(withitem* items, stmt* body, string? type_comment)"); if (!state->AsyncWith_type) return 0; if (PyObject_SetAttr(state->AsyncWith_type, state->type_comment, Py_None) == -1) return 0; - state->Raise_type = make_type("Raise", state->stmt_type, Raise_fields, 2, + state->Raise_type = make_type(state, "Raise", state->stmt_type, + Raise_fields, 2, "Raise(expr? exc, expr? cause)"); if (!state->Raise_type) return 0; if (PyObject_SetAttr(state->Raise_type, state->exc, Py_None) == -1) return 0; if (PyObject_SetAttr(state->Raise_type, state->cause, Py_None) == -1) return 0; - state->Try_type = make_type("Try", state->stmt_type, Try_fields, 4, + state->Try_type = make_type(state, "Try", state->stmt_type, Try_fields, 4, "Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody)"); if (!state->Try_type) return 0; - state->Assert_type = make_type("Assert", state->stmt_type, Assert_fields, 2, + state->Assert_type = make_type(state, "Assert", state->stmt_type, + Assert_fields, 2, "Assert(expr test, expr? msg)"); if (!state->Assert_type) return 0; if (PyObject_SetAttr(state->Assert_type, state->msg, Py_None) == -1) return 0; - state->Import_type = make_type("Import", state->stmt_type, Import_fields, 1, + state->Import_type = make_type(state, "Import", state->stmt_type, + Import_fields, 1, "Import(alias* names)"); if (!state->Import_type) return 0; - state->ImportFrom_type = make_type("ImportFrom", state->stmt_type, + state->ImportFrom_type = make_type(state, "ImportFrom", state->stmt_type, ImportFrom_fields, 3, "ImportFrom(identifier? module, alias* names, int? level)"); if (!state->ImportFrom_type) return 0; @@ -1575,26 +1601,29 @@ static int init_types(void) return 0; if (PyObject_SetAttr(state->ImportFrom_type, state->level, Py_None) == -1) return 0; - state->Global_type = make_type("Global", state->stmt_type, Global_fields, 1, + state->Global_type = make_type(state, "Global", state->stmt_type, + Global_fields, 1, "Global(identifier* names)"); if (!state->Global_type) return 0; - state->Nonlocal_type = make_type("Nonlocal", state->stmt_type, + state->Nonlocal_type = make_type(state, "Nonlocal", state->stmt_type, Nonlocal_fields, 1, "Nonlocal(identifier* names)"); if (!state->Nonlocal_type) return 0; - state->Expr_type = make_type("Expr", state->stmt_type, Expr_fields, 1, + state->Expr_type = make_type(state, "Expr", state->stmt_type, Expr_fields, + 1, "Expr(expr value)"); if (!state->Expr_type) return 0; - state->Pass_type = make_type("Pass", state->stmt_type, NULL, 0, + state->Pass_type = make_type(state, "Pass", state->stmt_type, NULL, 0, "Pass"); if (!state->Pass_type) return 0; - state->Break_type = make_type("Break", state->stmt_type, NULL, 0, + state->Break_type = make_type(state, "Break", state->stmt_type, NULL, 0, "Break"); if (!state->Break_type) return 0; - state->Continue_type = make_type("Continue", state->stmt_type, NULL, 0, + state->Continue_type = make_type(state, "Continue", state->stmt_type, NULL, + 0, "Continue"); if (!state->Continue_type) return 0; - state->expr_type = make_type("expr", state->AST_type, NULL, 0, + state->expr_type = make_type(state, "expr", state->AST_type, NULL, 0, "expr = BoolOp(boolop op, expr* values)\n" " | NamedExpr(expr target, expr value)\n" " | BinOp(expr left, operator op, expr right)\n" @@ -1623,74 +1652,84 @@ static int init_types(void) " | Tuple(expr* elts, expr_context ctx)\n" " | Slice(expr? lower, expr? upper, expr? step)"); if (!state->expr_type) return 0; - if (!add_attributes(state->expr_type, expr_attributes, 4)) return 0; + if (!add_attributes(state, state->expr_type, expr_attributes, 4)) return 0; if (PyObject_SetAttr(state->expr_type, state->end_lineno, Py_None) == -1) return 0; if (PyObject_SetAttr(state->expr_type, state->end_col_offset, Py_None) == -1) return 0; - state->BoolOp_type = make_type("BoolOp", state->expr_type, BoolOp_fields, 2, + state->BoolOp_type = make_type(state, "BoolOp", state->expr_type, + BoolOp_fields, 2, "BoolOp(boolop op, expr* values)"); if (!state->BoolOp_type) return 0; - state->NamedExpr_type = make_type("NamedExpr", state->expr_type, + state->NamedExpr_type = make_type(state, "NamedExpr", state->expr_type, NamedExpr_fields, 2, "NamedExpr(expr target, expr value)"); if (!state->NamedExpr_type) return 0; - state->BinOp_type = make_type("BinOp", state->expr_type, BinOp_fields, 3, + state->BinOp_type = make_type(state, "BinOp", state->expr_type, + BinOp_fields, 3, "BinOp(expr left, operator op, expr right)"); if (!state->BinOp_type) return 0; - state->UnaryOp_type = make_type("UnaryOp", state->expr_type, + state->UnaryOp_type = make_type(state, "UnaryOp", state->expr_type, UnaryOp_fields, 2, "UnaryOp(unaryop op, expr operand)"); if (!state->UnaryOp_type) return 0; - state->Lambda_type = make_type("Lambda", state->expr_type, Lambda_fields, 2, + state->Lambda_type = make_type(state, "Lambda", state->expr_type, + Lambda_fields, 2, "Lambda(arguments args, expr body)"); if (!state->Lambda_type) return 0; - state->IfExp_type = make_type("IfExp", state->expr_type, IfExp_fields, 3, + state->IfExp_type = make_type(state, "IfExp", state->expr_type, + IfExp_fields, 3, "IfExp(expr test, expr body, expr orelse)"); if (!state->IfExp_type) return 0; - state->Dict_type = make_type("Dict", state->expr_type, Dict_fields, 2, + state->Dict_type = make_type(state, "Dict", state->expr_type, Dict_fields, + 2, "Dict(expr* keys, expr* values)"); if (!state->Dict_type) return 0; - state->Set_type = make_type("Set", state->expr_type, Set_fields, 1, + state->Set_type = make_type(state, "Set", state->expr_type, Set_fields, 1, "Set(expr* elts)"); if (!state->Set_type) return 0; - state->ListComp_type = make_type("ListComp", state->expr_type, + state->ListComp_type = make_type(state, "ListComp", state->expr_type, ListComp_fields, 2, "ListComp(expr elt, comprehension* generators)"); if (!state->ListComp_type) return 0; - state->SetComp_type = make_type("SetComp", state->expr_type, + state->SetComp_type = make_type(state, "SetComp", state->expr_type, SetComp_fields, 2, "SetComp(expr elt, comprehension* generators)"); if (!state->SetComp_type) return 0; - state->DictComp_type = make_type("DictComp", state->expr_type, + state->DictComp_type = make_type(state, "DictComp", state->expr_type, DictComp_fields, 3, "DictComp(expr key, expr value, comprehension* generators)"); if (!state->DictComp_type) return 0; - state->GeneratorExp_type = make_type("GeneratorExp", state->expr_type, - GeneratorExp_fields, 2, + state->GeneratorExp_type = make_type(state, "GeneratorExp", + state->expr_type, GeneratorExp_fields, + 2, "GeneratorExp(expr elt, comprehension* generators)"); if (!state->GeneratorExp_type) return 0; - state->Await_type = make_type("Await", state->expr_type, Await_fields, 1, + state->Await_type = make_type(state, "Await", state->expr_type, + Await_fields, 1, "Await(expr value)"); if (!state->Await_type) return 0; - state->Yield_type = make_type("Yield", state->expr_type, Yield_fields, 1, + state->Yield_type = make_type(state, "Yield", state->expr_type, + Yield_fields, 1, "Yield(expr? value)"); if (!state->Yield_type) return 0; if (PyObject_SetAttr(state->Yield_type, state->value, Py_None) == -1) return 0; - state->YieldFrom_type = make_type("YieldFrom", state->expr_type, + state->YieldFrom_type = make_type(state, "YieldFrom", state->expr_type, YieldFrom_fields, 1, "YieldFrom(expr value)"); if (!state->YieldFrom_type) return 0; - state->Compare_type = make_type("Compare", state->expr_type, + state->Compare_type = make_type(state, "Compare", state->expr_type, Compare_fields, 3, "Compare(expr left, cmpop* ops, expr* comparators)"); if (!state->Compare_type) return 0; - state->Call_type = make_type("Call", state->expr_type, Call_fields, 3, + state->Call_type = make_type(state, "Call", state->expr_type, Call_fields, + 3, "Call(expr func, expr* args, keyword* keywords)"); if (!state->Call_type) return 0; - state->FormattedValue_type = make_type("FormattedValue", state->expr_type, + state->FormattedValue_type = make_type(state, "FormattedValue", + state->expr_type, FormattedValue_fields, 3, "FormattedValue(expr value, int? conversion, expr? format_spec)"); if (!state->FormattedValue_type) return 0; @@ -1700,38 +1739,42 @@ static int init_types(void) if (PyObject_SetAttr(state->FormattedValue_type, state->format_spec, Py_None) == -1) return 0; - state->JoinedStr_type = make_type("JoinedStr", state->expr_type, + state->JoinedStr_type = make_type(state, "JoinedStr", state->expr_type, JoinedStr_fields, 1, "JoinedStr(expr* values)"); if (!state->JoinedStr_type) return 0; - state->Constant_type = make_type("Constant", state->expr_type, + state->Constant_type = make_type(state, "Constant", state->expr_type, Constant_fields, 2, "Constant(constant value, string? kind)"); if (!state->Constant_type) return 0; if (PyObject_SetAttr(state->Constant_type, state->kind, Py_None) == -1) return 0; - state->Attribute_type = make_type("Attribute", state->expr_type, + state->Attribute_type = make_type(state, "Attribute", state->expr_type, Attribute_fields, 3, "Attribute(expr value, identifier attr, expr_context ctx)"); if (!state->Attribute_type) return 0; - state->Subscript_type = make_type("Subscript", state->expr_type, + state->Subscript_type = make_type(state, "Subscript", state->expr_type, Subscript_fields, 3, "Subscript(expr value, expr slice, expr_context ctx)"); if (!state->Subscript_type) return 0; - state->Starred_type = make_type("Starred", state->expr_type, + state->Starred_type = make_type(state, "Starred", state->expr_type, Starred_fields, 2, "Starred(expr value, expr_context ctx)"); if (!state->Starred_type) return 0; - state->Name_type = make_type("Name", state->expr_type, Name_fields, 2, + state->Name_type = make_type(state, "Name", state->expr_type, Name_fields, + 2, "Name(identifier id, expr_context ctx)"); if (!state->Name_type) return 0; - state->List_type = make_type("List", state->expr_type, List_fields, 2, + state->List_type = make_type(state, "List", state->expr_type, List_fields, + 2, "List(expr* elts, expr_context ctx)"); if (!state->List_type) return 0; - state->Tuple_type = make_type("Tuple", state->expr_type, Tuple_fields, 2, + state->Tuple_type = make_type(state, "Tuple", state->expr_type, + Tuple_fields, 2, "Tuple(expr* elts, expr_context ctx)"); if (!state->Tuple_type) return 0; - state->Slice_type = make_type("Slice", state->expr_type, Slice_fields, 3, + state->Slice_type = make_type(state, "Slice", state->expr_type, + Slice_fields, 3, "Slice(expr? lower, expr? upper, expr? step)"); if (!state->Slice_type) return 0; if (PyObject_SetAttr(state->Slice_type, state->lower, Py_None) == -1) @@ -1740,244 +1783,255 @@ static int init_types(void) return 0; if (PyObject_SetAttr(state->Slice_type, state->step, Py_None) == -1) return 0; - state->expr_context_type = make_type("expr_context", state->AST_type, NULL, - 0, + state->expr_context_type = make_type(state, "expr_context", + state->AST_type, NULL, 0, "expr_context = Load | Store | Del"); if (!state->expr_context_type) return 0; - if (!add_attributes(state->expr_context_type, NULL, 0)) return 0; - state->Load_type = make_type("Load", state->expr_context_type, NULL, 0, + if (!add_attributes(state, state->expr_context_type, NULL, 0)) return 0; + state->Load_type = make_type(state, "Load", state->expr_context_type, NULL, + 0, "Load"); if (!state->Load_type) return 0; state->Load_singleton = PyType_GenericNew((PyTypeObject *)state->Load_type, NULL, NULL); if (!state->Load_singleton) return 0; - state->Store_type = make_type("Store", state->expr_context_type, NULL, 0, + state->Store_type = make_type(state, "Store", state->expr_context_type, + NULL, 0, "Store"); if (!state->Store_type) return 0; state->Store_singleton = PyType_GenericNew((PyTypeObject *)state->Store_type, NULL, NULL); if (!state->Store_singleton) return 0; - state->Del_type = make_type("Del", state->expr_context_type, NULL, 0, + state->Del_type = make_type(state, "Del", state->expr_context_type, NULL, 0, "Del"); if (!state->Del_type) return 0; state->Del_singleton = PyType_GenericNew((PyTypeObject *)state->Del_type, NULL, NULL); if (!state->Del_singleton) return 0; - state->boolop_type = make_type("boolop", state->AST_type, NULL, 0, + state->boolop_type = make_type(state, "boolop", state->AST_type, NULL, 0, "boolop = And | Or"); if (!state->boolop_type) return 0; - if (!add_attributes(state->boolop_type, NULL, 0)) return 0; - state->And_type = make_type("And", state->boolop_type, NULL, 0, + if (!add_attributes(state, state->boolop_type, NULL, 0)) return 0; + state->And_type = make_type(state, "And", state->boolop_type, NULL, 0, "And"); if (!state->And_type) return 0; state->And_singleton = PyType_GenericNew((PyTypeObject *)state->And_type, NULL, NULL); if (!state->And_singleton) return 0; - state->Or_type = make_type("Or", state->boolop_type, NULL, 0, + state->Or_type = make_type(state, "Or", state->boolop_type, NULL, 0, "Or"); if (!state->Or_type) return 0; state->Or_singleton = PyType_GenericNew((PyTypeObject *)state->Or_type, NULL, NULL); if (!state->Or_singleton) return 0; - state->operator_type = make_type("operator", state->AST_type, NULL, 0, + state->operator_type = make_type(state, "operator", state->AST_type, NULL, + 0, "operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift | RShift | BitOr | BitXor | BitAnd | FloorDiv"); if (!state->operator_type) return 0; - if (!add_attributes(state->operator_type, NULL, 0)) return 0; - state->Add_type = make_type("Add", state->operator_type, NULL, 0, + if (!add_attributes(state, state->operator_type, NULL, 0)) return 0; + state->Add_type = make_type(state, "Add", state->operator_type, NULL, 0, "Add"); if (!state->Add_type) return 0; state->Add_singleton = PyType_GenericNew((PyTypeObject *)state->Add_type, NULL, NULL); if (!state->Add_singleton) return 0; - state->Sub_type = make_type("Sub", state->operator_type, NULL, 0, + state->Sub_type = make_type(state, "Sub", state->operator_type, NULL, 0, "Sub"); if (!state->Sub_type) return 0; state->Sub_singleton = PyType_GenericNew((PyTypeObject *)state->Sub_type, NULL, NULL); if (!state->Sub_singleton) return 0; - state->Mult_type = make_type("Mult", state->operator_type, NULL, 0, + state->Mult_type = make_type(state, "Mult", state->operator_type, NULL, 0, "Mult"); if (!state->Mult_type) return 0; state->Mult_singleton = PyType_GenericNew((PyTypeObject *)state->Mult_type, NULL, NULL); if (!state->Mult_singleton) return 0; - state->MatMult_type = make_type("MatMult", state->operator_type, NULL, 0, + state->MatMult_type = make_type(state, "MatMult", state->operator_type, + NULL, 0, "MatMult"); if (!state->MatMult_type) return 0; state->MatMult_singleton = PyType_GenericNew((PyTypeObject *)state->MatMult_type, NULL, NULL); if (!state->MatMult_singleton) return 0; - state->Div_type = make_type("Div", state->operator_type, NULL, 0, + state->Div_type = make_type(state, "Div", state->operator_type, NULL, 0, "Div"); if (!state->Div_type) return 0; state->Div_singleton = PyType_GenericNew((PyTypeObject *)state->Div_type, NULL, NULL); if (!state->Div_singleton) return 0; - state->Mod_type = make_type("Mod", state->operator_type, NULL, 0, + state->Mod_type = make_type(state, "Mod", state->operator_type, NULL, 0, "Mod"); if (!state->Mod_type) return 0; state->Mod_singleton = PyType_GenericNew((PyTypeObject *)state->Mod_type, NULL, NULL); if (!state->Mod_singleton) return 0; - state->Pow_type = make_type("Pow", state->operator_type, NULL, 0, + state->Pow_type = make_type(state, "Pow", state->operator_type, NULL, 0, "Pow"); if (!state->Pow_type) return 0; state->Pow_singleton = PyType_GenericNew((PyTypeObject *)state->Pow_type, NULL, NULL); if (!state->Pow_singleton) return 0; - state->LShift_type = make_type("LShift", state->operator_type, NULL, 0, + state->LShift_type = make_type(state, "LShift", state->operator_type, NULL, + 0, "LShift"); if (!state->LShift_type) return 0; state->LShift_singleton = PyType_GenericNew((PyTypeObject *)state->LShift_type, NULL, NULL); if (!state->LShift_singleton) return 0; - state->RShift_type = make_type("RShift", state->operator_type, NULL, 0, + state->RShift_type = make_type(state, "RShift", state->operator_type, NULL, + 0, "RShift"); if (!state->RShift_type) return 0; state->RShift_singleton = PyType_GenericNew((PyTypeObject *)state->RShift_type, NULL, NULL); if (!state->RShift_singleton) return 0; - state->BitOr_type = make_type("BitOr", state->operator_type, NULL, 0, + state->BitOr_type = make_type(state, "BitOr", state->operator_type, NULL, 0, "BitOr"); if (!state->BitOr_type) return 0; state->BitOr_singleton = PyType_GenericNew((PyTypeObject *)state->BitOr_type, NULL, NULL); if (!state->BitOr_singleton) return 0; - state->BitXor_type = make_type("BitXor", state->operator_type, NULL, 0, + state->BitXor_type = make_type(state, "BitXor", state->operator_type, NULL, + 0, "BitXor"); if (!state->BitXor_type) return 0; state->BitXor_singleton = PyType_GenericNew((PyTypeObject *)state->BitXor_type, NULL, NULL); if (!state->BitXor_singleton) return 0; - state->BitAnd_type = make_type("BitAnd", state->operator_type, NULL, 0, + state->BitAnd_type = make_type(state, "BitAnd", state->operator_type, NULL, + 0, "BitAnd"); if (!state->BitAnd_type) return 0; state->BitAnd_singleton = PyType_GenericNew((PyTypeObject *)state->BitAnd_type, NULL, NULL); if (!state->BitAnd_singleton) return 0; - state->FloorDiv_type = make_type("FloorDiv", state->operator_type, NULL, 0, + state->FloorDiv_type = make_type(state, "FloorDiv", state->operator_type, + NULL, 0, "FloorDiv"); if (!state->FloorDiv_type) return 0; state->FloorDiv_singleton = PyType_GenericNew((PyTypeObject *)state->FloorDiv_type, NULL, NULL); if (!state->FloorDiv_singleton) return 0; - state->unaryop_type = make_type("unaryop", state->AST_type, NULL, 0, + state->unaryop_type = make_type(state, "unaryop", state->AST_type, NULL, 0, "unaryop = Invert | Not | UAdd | USub"); if (!state->unaryop_type) return 0; - if (!add_attributes(state->unaryop_type, NULL, 0)) return 0; - state->Invert_type = make_type("Invert", state->unaryop_type, NULL, 0, + if (!add_attributes(state, state->unaryop_type, NULL, 0)) return 0; + state->Invert_type = make_type(state, "Invert", state->unaryop_type, NULL, + 0, "Invert"); if (!state->Invert_type) return 0; state->Invert_singleton = PyType_GenericNew((PyTypeObject *)state->Invert_type, NULL, NULL); if (!state->Invert_singleton) return 0; - state->Not_type = make_type("Not", state->unaryop_type, NULL, 0, + state->Not_type = make_type(state, "Not", state->unaryop_type, NULL, 0, "Not"); if (!state->Not_type) return 0; state->Not_singleton = PyType_GenericNew((PyTypeObject *)state->Not_type, NULL, NULL); if (!state->Not_singleton) return 0; - state->UAdd_type = make_type("UAdd", state->unaryop_type, NULL, 0, + state->UAdd_type = make_type(state, "UAdd", state->unaryop_type, NULL, 0, "UAdd"); if (!state->UAdd_type) return 0; state->UAdd_singleton = PyType_GenericNew((PyTypeObject *)state->UAdd_type, NULL, NULL); if (!state->UAdd_singleton) return 0; - state->USub_type = make_type("USub", state->unaryop_type, NULL, 0, + state->USub_type = make_type(state, "USub", state->unaryop_type, NULL, 0, "USub"); if (!state->USub_type) return 0; state->USub_singleton = PyType_GenericNew((PyTypeObject *)state->USub_type, NULL, NULL); if (!state->USub_singleton) return 0; - state->cmpop_type = make_type("cmpop", state->AST_type, NULL, 0, + state->cmpop_type = make_type(state, "cmpop", state->AST_type, NULL, 0, "cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn"); if (!state->cmpop_type) return 0; - if (!add_attributes(state->cmpop_type, NULL, 0)) return 0; - state->Eq_type = make_type("Eq", state->cmpop_type, NULL, 0, + if (!add_attributes(state, state->cmpop_type, NULL, 0)) return 0; + state->Eq_type = make_type(state, "Eq", state->cmpop_type, NULL, 0, "Eq"); if (!state->Eq_type) return 0; state->Eq_singleton = PyType_GenericNew((PyTypeObject *)state->Eq_type, NULL, NULL); if (!state->Eq_singleton) return 0; - state->NotEq_type = make_type("NotEq", state->cmpop_type, NULL, 0, + state->NotEq_type = make_type(state, "NotEq", state->cmpop_type, NULL, 0, "NotEq"); if (!state->NotEq_type) return 0; state->NotEq_singleton = PyType_GenericNew((PyTypeObject *)state->NotEq_type, NULL, NULL); if (!state->NotEq_singleton) return 0; - state->Lt_type = make_type("Lt", state->cmpop_type, NULL, 0, + state->Lt_type = make_type(state, "Lt", state->cmpop_type, NULL, 0, "Lt"); if (!state->Lt_type) return 0; state->Lt_singleton = PyType_GenericNew((PyTypeObject *)state->Lt_type, NULL, NULL); if (!state->Lt_singleton) return 0; - state->LtE_type = make_type("LtE", state->cmpop_type, NULL, 0, + state->LtE_type = make_type(state, "LtE", state->cmpop_type, NULL, 0, "LtE"); if (!state->LtE_type) return 0; state->LtE_singleton = PyType_GenericNew((PyTypeObject *)state->LtE_type, NULL, NULL); if (!state->LtE_singleton) return 0; - state->Gt_type = make_type("Gt", state->cmpop_type, NULL, 0, + state->Gt_type = make_type(state, "Gt", state->cmpop_type, NULL, 0, "Gt"); if (!state->Gt_type) return 0; state->Gt_singleton = PyType_GenericNew((PyTypeObject *)state->Gt_type, NULL, NULL); if (!state->Gt_singleton) return 0; - state->GtE_type = make_type("GtE", state->cmpop_type, NULL, 0, + state->GtE_type = make_type(state, "GtE", state->cmpop_type, NULL, 0, "GtE"); if (!state->GtE_type) return 0; state->GtE_singleton = PyType_GenericNew((PyTypeObject *)state->GtE_type, NULL, NULL); if (!state->GtE_singleton) return 0; - state->Is_type = make_type("Is", state->cmpop_type, NULL, 0, + state->Is_type = make_type(state, "Is", state->cmpop_type, NULL, 0, "Is"); if (!state->Is_type) return 0; state->Is_singleton = PyType_GenericNew((PyTypeObject *)state->Is_type, NULL, NULL); if (!state->Is_singleton) return 0; - state->IsNot_type = make_type("IsNot", state->cmpop_type, NULL, 0, + state->IsNot_type = make_type(state, "IsNot", state->cmpop_type, NULL, 0, "IsNot"); if (!state->IsNot_type) return 0; state->IsNot_singleton = PyType_GenericNew((PyTypeObject *)state->IsNot_type, NULL, NULL); if (!state->IsNot_singleton) return 0; - state->In_type = make_type("In", state->cmpop_type, NULL, 0, + state->In_type = make_type(state, "In", state->cmpop_type, NULL, 0, "In"); if (!state->In_type) return 0; state->In_singleton = PyType_GenericNew((PyTypeObject *)state->In_type, NULL, NULL); if (!state->In_singleton) return 0; - state->NotIn_type = make_type("NotIn", state->cmpop_type, NULL, 0, + state->NotIn_type = make_type(state, "NotIn", state->cmpop_type, NULL, 0, "NotIn"); if (!state->NotIn_type) return 0; state->NotIn_singleton = PyType_GenericNew((PyTypeObject *)state->NotIn_type, NULL, NULL); if (!state->NotIn_singleton) return 0; - state->comprehension_type = make_type("comprehension", state->AST_type, + state->comprehension_type = make_type(state, "comprehension", + state->AST_type, comprehension_fields, 4, "comprehension(expr target, expr iter, expr* ifs, int is_async)"); if (!state->comprehension_type) return 0; - if (!add_attributes(state->comprehension_type, NULL, 0)) return 0; - state->excepthandler_type = make_type("excepthandler", state->AST_type, - NULL, 0, + if (!add_attributes(state, state->comprehension_type, NULL, 0)) return 0; + state->excepthandler_type = make_type(state, "excepthandler", + state->AST_type, NULL, 0, "excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)"); if (!state->excepthandler_type) return 0; - if (!add_attributes(state->excepthandler_type, excepthandler_attributes, - 4)) return 0; + if (!add_attributes(state, state->excepthandler_type, + excepthandler_attributes, 4)) return 0; if (PyObject_SetAttr(state->excepthandler_type, state->end_lineno, Py_None) == -1) return 0; if (PyObject_SetAttr(state->excepthandler_type, state->end_col_offset, Py_None) == -1) return 0; - state->ExceptHandler_type = make_type("ExceptHandler", + state->ExceptHandler_type = make_type(state, "ExceptHandler", state->excepthandler_type, ExceptHandler_fields, 3, "ExceptHandler(expr? type, identifier? name, stmt* body)"); @@ -1986,19 +2040,19 @@ static int init_types(void) return 0; if (PyObject_SetAttr(state->ExceptHandler_type, state->name, Py_None) == -1) return 0; - state->arguments_type = make_type("arguments", state->AST_type, + state->arguments_type = make_type(state, "arguments", state->AST_type, arguments_fields, 7, "arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)"); if (!state->arguments_type) return 0; - if (!add_attributes(state->arguments_type, NULL, 0)) return 0; + if (!add_attributes(state, state->arguments_type, NULL, 0)) return 0; if (PyObject_SetAttr(state->arguments_type, state->vararg, Py_None) == -1) return 0; if (PyObject_SetAttr(state->arguments_type, state->kwarg, Py_None) == -1) return 0; - state->arg_type = make_type("arg", state->AST_type, arg_fields, 3, + state->arg_type = make_type(state, "arg", state->AST_type, arg_fields, 3, "arg(identifier arg, expr? annotation, string? type_comment)"); if (!state->arg_type) return 0; - if (!add_attributes(state->arg_type, arg_attributes, 4)) return 0; + if (!add_attributes(state, state->arg_type, arg_attributes, 4)) return 0; if (PyObject_SetAttr(state->arg_type, state->annotation, Py_None) == -1) return 0; if (PyObject_SetAttr(state->arg_type, state->type_comment, Py_None) == -1) @@ -2007,11 +2061,12 @@ static int init_types(void) return 0; if (PyObject_SetAttr(state->arg_type, state->end_col_offset, Py_None) == -1) return 0; - state->keyword_type = make_type("keyword", state->AST_type, keyword_fields, - 2, + state->keyword_type = make_type(state, "keyword", state->AST_type, + keyword_fields, 2, "keyword(identifier? arg, expr value)"); if (!state->keyword_type) return 0; - if (!add_attributes(state->keyword_type, keyword_attributes, 4)) return 0; + if (!add_attributes(state, state->keyword_type, keyword_attributes, 4)) + return 0; if (PyObject_SetAttr(state->keyword_type, state->arg, Py_None) == -1) return 0; if (PyObject_SetAttr(state->keyword_type, state->end_lineno, Py_None) == -1) @@ -2019,25 +2074,28 @@ static int init_types(void) if (PyObject_SetAttr(state->keyword_type, state->end_col_offset, Py_None) == -1) return 0; - state->alias_type = make_type("alias", state->AST_type, alias_fields, 2, + state->alias_type = make_type(state, "alias", state->AST_type, + alias_fields, 2, "alias(identifier name, identifier? asname)"); if (!state->alias_type) return 0; - if (!add_attributes(state->alias_type, NULL, 0)) return 0; + if (!add_attributes(state, state->alias_type, NULL, 0)) return 0; if (PyObject_SetAttr(state->alias_type, state->asname, Py_None) == -1) return 0; - state->withitem_type = make_type("withitem", state->AST_type, + state->withitem_type = make_type(state, "withitem", state->AST_type, withitem_fields, 2, "withitem(expr context_expr, expr? optional_vars)"); if (!state->withitem_type) return 0; - if (!add_attributes(state->withitem_type, NULL, 0)) return 0; + if (!add_attributes(state, state->withitem_type, NULL, 0)) return 0; if (PyObject_SetAttr(state->withitem_type, state->optional_vars, Py_None) == -1) return 0; - state->type_ignore_type = make_type("type_ignore", state->AST_type, NULL, 0, + state->type_ignore_type = make_type(state, "type_ignore", state->AST_type, + NULL, 0, "type_ignore = TypeIgnore(int lineno, string tag)"); if (!state->type_ignore_type) return 0; - if (!add_attributes(state->type_ignore_type, NULL, 0)) return 0; - state->TypeIgnore_type = make_type("TypeIgnore", state->type_ignore_type, + if (!add_attributes(state, state->type_ignore_type, NULL, 0)) return 0; + state->TypeIgnore_type = make_type(state, "TypeIgnore", + state->type_ignore_type, TypeIgnore_fields, 2, "TypeIgnore(int lineno, string tag)"); if (!state->TypeIgnore_type) return 0; @@ -2045,26 +2103,38 @@ static int init_types(void) return 1; } -static int obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena); -static int obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena); -static int obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena); -static int obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* - arena); -static int obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena); -static int obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena); -static int obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena); -static int obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena); -static int obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* - arena); -static int obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* - arena); -static int obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena); -static int obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena); -static int obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena); -static int obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena); -static int obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena); -static int obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* - arena); +static int obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, + PyArena* arena); +static int obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, + PyArena* arena); +static int obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, + PyArena* arena); +static int obj2ast_expr_context(astmodulestate *state, PyObject* obj, + expr_context_ty* out, PyArena* arena); +static int obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, + PyArena* arena); +static int obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* + out, PyArena* arena); +static int obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* + out, PyArena* arena); +static int obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, + PyArena* arena); +static int obj2ast_comprehension(astmodulestate *state, PyObject* obj, + comprehension_ty* out, PyArena* arena); +static int obj2ast_excepthandler(astmodulestate *state, PyObject* obj, + excepthandler_ty* out, PyArena* arena); +static int obj2ast_arguments(astmodulestate *state, PyObject* obj, + arguments_ty* out, PyArena* arena); +static int obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, + PyArena* arena); +static int obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* + out, PyArena* arena); +static int obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, + PyArena* arena); +static int obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* + out, PyArena* arena); +static int obj2ast_type_ignore(astmodulestate *state, PyObject* obj, + type_ignore_ty* out, PyArena* arena); mod_ty Module(asdl_seq * body, asdl_seq * type_ignores, PyArena *arena) @@ -3528,7 +3598,7 @@ TypeIgnore(int lineno, string tag, PyArena *arena) PyObject* -ast2obj_mod(void* _o) +ast2obj_mod(astmodulestate *state, void* _o) { mod_ty o = (mod_ty)_o; PyObject *result = NULL, *value = NULL; @@ -3536,58 +3606,55 @@ ast2obj_mod(void* _o) if (!o) { Py_RETURN_NONE; } - switch (o->kind) { case Module_kind: - tp = (PyTypeObject *)astmodulestate_global->Module_type; + tp = (PyTypeObject *)state->Module_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Module.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.Module.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Module.type_ignores, ast2obj_type_ignore); + value = ast2obj_list(state, o->v.Module.type_ignores, + ast2obj_type_ignore); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_ignores, - value) == -1) + if (PyObject_SetAttr(result, state->type_ignores, value) == -1) goto failed; Py_DECREF(value); break; case Interactive_kind: - tp = (PyTypeObject *)astmodulestate_global->Interactive_type; + tp = (PyTypeObject *)state->Interactive_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Interactive.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.Interactive.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; case Expression_kind: - tp = (PyTypeObject *)astmodulestate_global->Expression_type; + tp = (PyTypeObject *)state->Expression_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Expression.body); + value = ast2obj_expr(state, o->v.Expression.body); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; case FunctionType_kind: - tp = (PyTypeObject *)astmodulestate_global->FunctionType_type; + tp = (PyTypeObject *)state->FunctionType_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.FunctionType.argtypes, ast2obj_expr); + value = ast2obj_list(state, o->v.FunctionType.argtypes, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->argtypes, value) == - -1) + if (PyObject_SetAttr(result, state->argtypes, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.FunctionType.returns); + value = ast2obj_expr(state, o->v.FunctionType.returns); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->returns, value) == - -1) + if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); break; @@ -3600,7 +3667,7 @@ ast2obj_mod(void* _o) } PyObject* -ast2obj_stmt(void* _o) +ast2obj_stmt(astmodulestate *state, void* _o) { stmt_ty o = (stmt_ty)_o; PyObject *result = NULL, *value = NULL; @@ -3608,513 +3675,483 @@ ast2obj_stmt(void* _o) if (!o) { Py_RETURN_NONE; } - switch (o->kind) { case FunctionDef_kind: - tp = (PyTypeObject *)astmodulestate_global->FunctionDef_type; + tp = (PyTypeObject *)state->FunctionDef_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(o->v.FunctionDef.name); + value = ast2obj_identifier(state, o->v.FunctionDef.name); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arguments(o->v.FunctionDef.args); + value = ast2obj_arguments(state, o->v.FunctionDef.args); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.FunctionDef.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.FunctionDef.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.FunctionDef.decorator_list, ast2obj_expr); + value = ast2obj_list(state, o->v.FunctionDef.decorator_list, + ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->decorator_list, - value) == -1) + if (PyObject_SetAttr(result, state->decorator_list, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.FunctionDef.returns); + value = ast2obj_expr(state, o->v.FunctionDef.returns); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->returns, value) == - -1) + if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.FunctionDef.type_comment); + value = ast2obj_string(state, o->v.FunctionDef.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case AsyncFunctionDef_kind: - tp = (PyTypeObject *)astmodulestate_global->AsyncFunctionDef_type; + tp = (PyTypeObject *)state->AsyncFunctionDef_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(o->v.AsyncFunctionDef.name); + value = ast2obj_identifier(state, o->v.AsyncFunctionDef.name); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arguments(o->v.AsyncFunctionDef.args); + value = ast2obj_arguments(state, o->v.AsyncFunctionDef.args); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.AsyncFunctionDef.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncFunctionDef.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.AsyncFunctionDef.decorator_list, + value = ast2obj_list(state, o->v.AsyncFunctionDef.decorator_list, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->decorator_list, - value) == -1) + if (PyObject_SetAttr(result, state->decorator_list, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.AsyncFunctionDef.returns); + value = ast2obj_expr(state, o->v.AsyncFunctionDef.returns); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->returns, value) == - -1) + if (PyObject_SetAttr(result, state->returns, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.AsyncFunctionDef.type_comment); + value = ast2obj_string(state, o->v.AsyncFunctionDef.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case ClassDef_kind: - tp = (PyTypeObject *)astmodulestate_global->ClassDef_type; + tp = (PyTypeObject *)state->ClassDef_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(o->v.ClassDef.name); + value = ast2obj_identifier(state, o->v.ClassDef.name); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ClassDef.bases, ast2obj_expr); + value = ast2obj_list(state, o->v.ClassDef.bases, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->bases, value) == -1) + if (PyObject_SetAttr(result, state->bases, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ClassDef.keywords, ast2obj_keyword); + value = ast2obj_list(state, o->v.ClassDef.keywords, ast2obj_keyword); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->keywords, value) == - -1) + if (PyObject_SetAttr(result, state->keywords, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ClassDef.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.ClassDef.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ClassDef.decorator_list, ast2obj_expr); + value = ast2obj_list(state, o->v.ClassDef.decorator_list, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->decorator_list, - value) == -1) + if (PyObject_SetAttr(result, state->decorator_list, value) == -1) goto failed; Py_DECREF(value); break; case Return_kind: - tp = (PyTypeObject *)astmodulestate_global->Return_type; + tp = (PyTypeObject *)state->Return_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Return.value); + value = ast2obj_expr(state, o->v.Return.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Delete_kind: - tp = (PyTypeObject *)astmodulestate_global->Delete_type; + tp = (PyTypeObject *)state->Delete_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Delete.targets, ast2obj_expr); + value = ast2obj_list(state, o->v.Delete.targets, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->targets, value) == - -1) + if (PyObject_SetAttr(result, state->targets, value) == -1) goto failed; Py_DECREF(value); break; case Assign_kind: - tp = (PyTypeObject *)astmodulestate_global->Assign_type; + tp = (PyTypeObject *)state->Assign_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Assign.targets, ast2obj_expr); + value = ast2obj_list(state, o->v.Assign.targets, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->targets, value) == - -1) + if (PyObject_SetAttr(result, state->targets, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Assign.value); + value = ast2obj_expr(state, o->v.Assign.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.Assign.type_comment); + value = ast2obj_string(state, o->v.Assign.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case AugAssign_kind: - tp = (PyTypeObject *)astmodulestate_global->AugAssign_type; + tp = (PyTypeObject *)state->AugAssign_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.AugAssign.target); + value = ast2obj_expr(state, o->v.AugAssign.target); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->target, value) == - -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_operator(o->v.AugAssign.op); + value = ast2obj_operator(state, o->v.AugAssign.op); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->op, value) == -1) + if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.AugAssign.value); + value = ast2obj_expr(state, o->v.AugAssign.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case AnnAssign_kind: - tp = (PyTypeObject *)astmodulestate_global->AnnAssign_type; + tp = (PyTypeObject *)state->AnnAssign_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.AnnAssign.target); + value = ast2obj_expr(state, o->v.AnnAssign.target); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->target, value) == - -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.AnnAssign.annotation); + value = ast2obj_expr(state, o->v.AnnAssign.annotation); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->annotation, value) - == -1) + if (PyObject_SetAttr(result, state->annotation, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.AnnAssign.value); + value = ast2obj_expr(state, o->v.AnnAssign.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(o->v.AnnAssign.simple); + value = ast2obj_int(state, o->v.AnnAssign.simple); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->simple, value) == - -1) + if (PyObject_SetAttr(result, state->simple, value) == -1) goto failed; Py_DECREF(value); break; case For_kind: - tp = (PyTypeObject *)astmodulestate_global->For_type; + tp = (PyTypeObject *)state->For_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.For.target); + value = ast2obj_expr(state, o->v.For.target); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->target, value) == - -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.For.iter); + value = ast2obj_expr(state, o->v.For.iter); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->iter, value) == -1) + if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.For.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.For.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.For.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.For.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->orelse, value) == - -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.For.type_comment); + value = ast2obj_string(state, o->v.For.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case AsyncFor_kind: - tp = (PyTypeObject *)astmodulestate_global->AsyncFor_type; + tp = (PyTypeObject *)state->AsyncFor_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.AsyncFor.target); + value = ast2obj_expr(state, o->v.AsyncFor.target); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->target, value) == - -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.AsyncFor.iter); + value = ast2obj_expr(state, o->v.AsyncFor.iter); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->iter, value) == -1) + if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.AsyncFor.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncFor.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.AsyncFor.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncFor.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->orelse, value) == - -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.AsyncFor.type_comment); + value = ast2obj_string(state, o->v.AsyncFor.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case While_kind: - tp = (PyTypeObject *)astmodulestate_global->While_type; + tp = (PyTypeObject *)state->While_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.While.test); + value = ast2obj_expr(state, o->v.While.test); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->test, value) == -1) + if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.While.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.While.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.While.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.While.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->orelse, value) == - -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); break; case If_kind: - tp = (PyTypeObject *)astmodulestate_global->If_type; + tp = (PyTypeObject *)state->If_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.If.test); + value = ast2obj_expr(state, o->v.If.test); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->test, value) == -1) + if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.If.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.If.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.If.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.If.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->orelse, value) == - -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); break; case With_kind: - tp = (PyTypeObject *)astmodulestate_global->With_type; + tp = (PyTypeObject *)state->With_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.With.items, ast2obj_withitem); + value = ast2obj_list(state, o->v.With.items, ast2obj_withitem); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->items, value) == -1) + if (PyObject_SetAttr(result, state->items, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.With.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.With.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.With.type_comment); + value = ast2obj_string(state, o->v.With.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case AsyncWith_kind: - tp = (PyTypeObject *)astmodulestate_global->AsyncWith_type; + tp = (PyTypeObject *)state->AsyncWith_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.AsyncWith.items, ast2obj_withitem); + value = ast2obj_list(state, o->v.AsyncWith.items, ast2obj_withitem); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->items, value) == -1) + if (PyObject_SetAttr(result, state->items, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.AsyncWith.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.AsyncWith.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.AsyncWith.type_comment); + value = ast2obj_string(state, o->v.AsyncWith.type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, - value) == -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); break; case Raise_kind: - tp = (PyTypeObject *)astmodulestate_global->Raise_type; + tp = (PyTypeObject *)state->Raise_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Raise.exc); + value = ast2obj_expr(state, o->v.Raise.exc); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->exc, value) == -1) + if (PyObject_SetAttr(result, state->exc, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Raise.cause); + value = ast2obj_expr(state, o->v.Raise.cause); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->cause, value) == -1) + if (PyObject_SetAttr(result, state->cause, value) == -1) goto failed; Py_DECREF(value); break; case Try_kind: - tp = (PyTypeObject *)astmodulestate_global->Try_type; + tp = (PyTypeObject *)state->Try_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Try.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.Try.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Try.handlers, ast2obj_excepthandler); + value = ast2obj_list(state, o->v.Try.handlers, ast2obj_excepthandler); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->handlers, value) == - -1) + if (PyObject_SetAttr(result, state->handlers, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Try.orelse, ast2obj_stmt); + value = ast2obj_list(state, o->v.Try.orelse, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->orelse, value) == - -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Try.finalbody, ast2obj_stmt); + value = ast2obj_list(state, o->v.Try.finalbody, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->finalbody, value) - == -1) + if (PyObject_SetAttr(result, state->finalbody, value) == -1) goto failed; Py_DECREF(value); break; case Assert_kind: - tp = (PyTypeObject *)astmodulestate_global->Assert_type; + tp = (PyTypeObject *)state->Assert_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Assert.test); + value = ast2obj_expr(state, o->v.Assert.test); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->test, value) == -1) + if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Assert.msg); + value = ast2obj_expr(state, o->v.Assert.msg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->msg, value) == -1) + if (PyObject_SetAttr(result, state->msg, value) == -1) goto failed; Py_DECREF(value); break; case Import_kind: - tp = (PyTypeObject *)astmodulestate_global->Import_type; + tp = (PyTypeObject *)state->Import_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Import.names, ast2obj_alias); + value = ast2obj_list(state, o->v.Import.names, ast2obj_alias); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); break; case ImportFrom_kind: - tp = (PyTypeObject *)astmodulestate_global->ImportFrom_type; + tp = (PyTypeObject *)state->ImportFrom_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(o->v.ImportFrom.module); + value = ast2obj_identifier(state, o->v.ImportFrom.module); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->module, value) == - -1) + if (PyObject_SetAttr(result, state->module, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ImportFrom.names, ast2obj_alias); + value = ast2obj_list(state, o->v.ImportFrom.names, ast2obj_alias); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(o->v.ImportFrom.level); + value = ast2obj_int(state, o->v.ImportFrom.level); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->level, value) == -1) + if (PyObject_SetAttr(result, state->level, value) == -1) goto failed; Py_DECREF(value); break; case Global_kind: - tp = (PyTypeObject *)astmodulestate_global->Global_type; + tp = (PyTypeObject *)state->Global_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Global.names, ast2obj_identifier); + value = ast2obj_list(state, o->v.Global.names, ast2obj_identifier); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); break; case Nonlocal_kind: - tp = (PyTypeObject *)astmodulestate_global->Nonlocal_type; + tp = (PyTypeObject *)state->Nonlocal_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Nonlocal.names, ast2obj_identifier); + value = ast2obj_list(state, o->v.Nonlocal.names, ast2obj_identifier); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->names, value) == -1) + if (PyObject_SetAttr(result, state->names, value) == -1) goto failed; Py_DECREF(value); break; case Expr_kind: - tp = (PyTypeObject *)astmodulestate_global->Expr_type; + tp = (PyTypeObject *)state->Expr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Expr.value); + value = ast2obj_expr(state, o->v.Expr.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Pass_kind: - tp = (PyTypeObject *)astmodulestate_global->Pass_type; + tp = (PyTypeObject *)state->Pass_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; break; case Break_kind: - tp = (PyTypeObject *)astmodulestate_global->Break_type; + tp = (PyTypeObject *)state->Break_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; break; case Continue_kind: - tp = (PyTypeObject *)astmodulestate_global->Continue_type; + tp = (PyTypeObject *)state->Continue_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; break; } - value = ast2obj_int(o->lineno); + value = ast2obj_int(state, o->lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) < 0) + if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->col_offset); + value = ast2obj_int(state, o->col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_lineno); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_col_offset, value) - < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); return result; @@ -4125,7 +4162,7 @@ ast2obj_stmt(void* _o) } PyObject* -ast2obj_expr(void* _o) +ast2obj_expr(astmodulestate *state, void* _o) { expr_ty o = (expr_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4133,245 +4170,238 @@ ast2obj_expr(void* _o) if (!o) { Py_RETURN_NONE; } - switch (o->kind) { case BoolOp_kind: - tp = (PyTypeObject *)astmodulestate_global->BoolOp_type; + tp = (PyTypeObject *)state->BoolOp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_boolop(o->v.BoolOp.op); + value = ast2obj_boolop(state, o->v.BoolOp.op); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->op, value) == -1) + if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.BoolOp.values, ast2obj_expr); + value = ast2obj_list(state, o->v.BoolOp.values, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->values, value) == - -1) + if (PyObject_SetAttr(result, state->values, value) == -1) goto failed; Py_DECREF(value); break; case NamedExpr_kind: - tp = (PyTypeObject *)astmodulestate_global->NamedExpr_type; + tp = (PyTypeObject *)state->NamedExpr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.NamedExpr.target); + value = ast2obj_expr(state, o->v.NamedExpr.target); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->target, value) == - -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.NamedExpr.value); + value = ast2obj_expr(state, o->v.NamedExpr.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case BinOp_kind: - tp = (PyTypeObject *)astmodulestate_global->BinOp_type; + tp = (PyTypeObject *)state->BinOp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.BinOp.left); + value = ast2obj_expr(state, o->v.BinOp.left); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->left, value) == -1) + if (PyObject_SetAttr(result, state->left, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_operator(o->v.BinOp.op); + value = ast2obj_operator(state, o->v.BinOp.op); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->op, value) == -1) + if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.BinOp.right); + value = ast2obj_expr(state, o->v.BinOp.right); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->right, value) == -1) + if (PyObject_SetAttr(result, state->right, value) == -1) goto failed; Py_DECREF(value); break; case UnaryOp_kind: - tp = (PyTypeObject *)astmodulestate_global->UnaryOp_type; + tp = (PyTypeObject *)state->UnaryOp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_unaryop(o->v.UnaryOp.op); + value = ast2obj_unaryop(state, o->v.UnaryOp.op); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->op, value) == -1) + if (PyObject_SetAttr(result, state->op, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.UnaryOp.operand); + value = ast2obj_expr(state, o->v.UnaryOp.operand); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->operand, value) == - -1) + if (PyObject_SetAttr(result, state->operand, value) == -1) goto failed; Py_DECREF(value); break; case Lambda_kind: - tp = (PyTypeObject *)astmodulestate_global->Lambda_type; + tp = (PyTypeObject *)state->Lambda_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_arguments(o->v.Lambda.args); + value = ast2obj_arguments(state, o->v.Lambda.args); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Lambda.body); + value = ast2obj_expr(state, o->v.Lambda.body); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; case IfExp_kind: - tp = (PyTypeObject *)astmodulestate_global->IfExp_type; + tp = (PyTypeObject *)state->IfExp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.IfExp.test); + value = ast2obj_expr(state, o->v.IfExp.test); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->test, value) == -1) + if (PyObject_SetAttr(result, state->test, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.IfExp.body); + value = ast2obj_expr(state, o->v.IfExp.body); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.IfExp.orelse); + value = ast2obj_expr(state, o->v.IfExp.orelse); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->orelse, value) == - -1) + if (PyObject_SetAttr(result, state->orelse, value) == -1) goto failed; Py_DECREF(value); break; case Dict_kind: - tp = (PyTypeObject *)astmodulestate_global->Dict_type; + tp = (PyTypeObject *)state->Dict_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Dict.keys, ast2obj_expr); + value = ast2obj_list(state, o->v.Dict.keys, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->keys, value) == -1) + if (PyObject_SetAttr(result, state->keys, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Dict.values, ast2obj_expr); + value = ast2obj_list(state, o->v.Dict.values, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->values, value) == - -1) + if (PyObject_SetAttr(result, state->values, value) == -1) goto failed; Py_DECREF(value); break; case Set_kind: - tp = (PyTypeObject *)astmodulestate_global->Set_type; + tp = (PyTypeObject *)state->Set_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Set.elts, ast2obj_expr); + value = ast2obj_list(state, o->v.Set.elts, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->elts, value) == -1) + if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; Py_DECREF(value); break; case ListComp_kind: - tp = (PyTypeObject *)astmodulestate_global->ListComp_type; + tp = (PyTypeObject *)state->ListComp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.ListComp.elt); + value = ast2obj_expr(state, o->v.ListComp.elt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->elt, value) == -1) + if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ListComp.generators, ast2obj_comprehension); + value = ast2obj_list(state, o->v.ListComp.generators, + ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->generators, value) - == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case SetComp_kind: - tp = (PyTypeObject *)astmodulestate_global->SetComp_type; + tp = (PyTypeObject *)state->SetComp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.SetComp.elt); + value = ast2obj_expr(state, o->v.SetComp.elt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->elt, value) == -1) + if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.SetComp.generators, ast2obj_comprehension); + value = ast2obj_list(state, o->v.SetComp.generators, + ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->generators, value) - == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case DictComp_kind: - tp = (PyTypeObject *)astmodulestate_global->DictComp_type; + tp = (PyTypeObject *)state->DictComp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.DictComp.key); + value = ast2obj_expr(state, o->v.DictComp.key); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->key, value) == -1) + if (PyObject_SetAttr(result, state->key, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.DictComp.value); + value = ast2obj_expr(state, o->v.DictComp.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.DictComp.generators, ast2obj_comprehension); + value = ast2obj_list(state, o->v.DictComp.generators, + ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->generators, value) - == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case GeneratorExp_kind: - tp = (PyTypeObject *)astmodulestate_global->GeneratorExp_type; + tp = (PyTypeObject *)state->GeneratorExp_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.GeneratorExp.elt); + value = ast2obj_expr(state, o->v.GeneratorExp.elt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->elt, value) == -1) + if (PyObject_SetAttr(result, state->elt, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.GeneratorExp.generators, + value = ast2obj_list(state, o->v.GeneratorExp.generators, ast2obj_comprehension); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->generators, value) - == -1) + if (PyObject_SetAttr(result, state->generators, value) == -1) goto failed; Py_DECREF(value); break; case Await_kind: - tp = (PyTypeObject *)astmodulestate_global->Await_type; + tp = (PyTypeObject *)state->Await_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Await.value); + value = ast2obj_expr(state, o->v.Await.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Yield_kind: - tp = (PyTypeObject *)astmodulestate_global->Yield_type; + tp = (PyTypeObject *)state->Yield_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Yield.value); + value = ast2obj_expr(state, o->v.Yield.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case YieldFrom_kind: - tp = (PyTypeObject *)astmodulestate_global->YieldFrom_type; + tp = (PyTypeObject *)state->YieldFrom_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.YieldFrom.value); + value = ast2obj_expr(state, o->v.YieldFrom.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); break; case Compare_kind: - tp = (PyTypeObject *)astmodulestate_global->Compare_type; + tp = (PyTypeObject *)state->Compare_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Compare.left); + value = ast2obj_expr(state, o->v.Compare.left); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->left, value) == -1) + if (PyObject_SetAttr(result, state->left, value) == -1) goto failed; Py_DECREF(value); { @@ -4379,228 +4409,222 @@ ast2obj_expr(void* _o) value = PyList_New(n); if (!value) goto failed; for(i = 0; i < n; i++) - PyList_SET_ITEM(value, i, ast2obj_cmpop((cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i))); + PyList_SET_ITEM(value, i, ast2obj_cmpop(state, (cmpop_ty)asdl_seq_GET(o->v.Compare.ops, i))); } if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ops, value) == -1) + if (PyObject_SetAttr(result, state->ops, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Compare.comparators, ast2obj_expr); + value = ast2obj_list(state, o->v.Compare.comparators, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->comparators, value) - == -1) + if (PyObject_SetAttr(result, state->comparators, value) == -1) goto failed; Py_DECREF(value); break; case Call_kind: - tp = (PyTypeObject *)astmodulestate_global->Call_type; + tp = (PyTypeObject *)state->Call_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Call.func); + value = ast2obj_expr(state, o->v.Call.func); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->func, value) == -1) + if (PyObject_SetAttr(result, state->func, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Call.args, ast2obj_expr); + value = ast2obj_list(state, o->v.Call.args, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.Call.keywords, ast2obj_keyword); + value = ast2obj_list(state, o->v.Call.keywords, ast2obj_keyword); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->keywords, value) == - -1) + if (PyObject_SetAttr(result, state->keywords, value) == -1) goto failed; Py_DECREF(value); break; case FormattedValue_kind: - tp = (PyTypeObject *)astmodulestate_global->FormattedValue_type; + tp = (PyTypeObject *)state->FormattedValue_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.FormattedValue.value); + value = ast2obj_expr(state, o->v.FormattedValue.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(o->v.FormattedValue.conversion); + value = ast2obj_int(state, o->v.FormattedValue.conversion); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->conversion, value) - == -1) + if (PyObject_SetAttr(result, state->conversion, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.FormattedValue.format_spec); + value = ast2obj_expr(state, o->v.FormattedValue.format_spec); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->format_spec, value) - == -1) + if (PyObject_SetAttr(result, state->format_spec, value) == -1) goto failed; Py_DECREF(value); break; case JoinedStr_kind: - tp = (PyTypeObject *)astmodulestate_global->JoinedStr_type; + tp = (PyTypeObject *)state->JoinedStr_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.JoinedStr.values, ast2obj_expr); + value = ast2obj_list(state, o->v.JoinedStr.values, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->values, value) == - -1) + if (PyObject_SetAttr(result, state->values, value) == -1) goto failed; Py_DECREF(value); break; case Constant_kind: - tp = (PyTypeObject *)astmodulestate_global->Constant_type; + tp = (PyTypeObject *)state->Constant_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_constant(o->v.Constant.value); + value = ast2obj_constant(state, o->v.Constant.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.Constant.kind); + value = ast2obj_string(state, o->v.Constant.kind); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->kind, value) == -1) + if (PyObject_SetAttr(result, state->kind, value) == -1) goto failed; Py_DECREF(value); break; case Attribute_kind: - tp = (PyTypeObject *)astmodulestate_global->Attribute_type; + tp = (PyTypeObject *)state->Attribute_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Attribute.value); + value = ast2obj_expr(state, o->v.Attribute.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(o->v.Attribute.attr); + value = ast2obj_identifier(state, o->v.Attribute.attr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->attr, value) == -1) + if (PyObject_SetAttr(result, state->attr, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(o->v.Attribute.ctx); + value = ast2obj_expr_context(state, o->v.Attribute.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Subscript_kind: - tp = (PyTypeObject *)astmodulestate_global->Subscript_type; + tp = (PyTypeObject *)state->Subscript_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Subscript.value); + value = ast2obj_expr(state, o->v.Subscript.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Subscript.slice); + value = ast2obj_expr(state, o->v.Subscript.slice); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->slice, value) == -1) + if (PyObject_SetAttr(result, state->slice, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(o->v.Subscript.ctx); + value = ast2obj_expr_context(state, o->v.Subscript.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Starred_kind: - tp = (PyTypeObject *)astmodulestate_global->Starred_type; + tp = (PyTypeObject *)state->Starred_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Starred.value); + value = ast2obj_expr(state, o->v.Starred.value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(o->v.Starred.ctx); + value = ast2obj_expr_context(state, o->v.Starred.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Name_kind: - tp = (PyTypeObject *)astmodulestate_global->Name_type; + tp = (PyTypeObject *)state->Name_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_identifier(o->v.Name.id); + value = ast2obj_identifier(state, o->v.Name.id); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->id, value) == -1) + if (PyObject_SetAttr(result, state->id, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(o->v.Name.ctx); + value = ast2obj_expr_context(state, o->v.Name.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case List_kind: - tp = (PyTypeObject *)astmodulestate_global->List_type; + tp = (PyTypeObject *)state->List_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.List.elts, ast2obj_expr); + value = ast2obj_list(state, o->v.List.elts, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->elts, value) == -1) + if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(o->v.List.ctx); + value = ast2obj_expr_context(state, o->v.List.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Tuple_kind: - tp = (PyTypeObject *)astmodulestate_global->Tuple_type; + tp = (PyTypeObject *)state->Tuple_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_list(o->v.Tuple.elts, ast2obj_expr); + value = ast2obj_list(state, o->v.Tuple.elts, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->elts, value) == -1) + if (PyObject_SetAttr(result, state->elts, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr_context(o->v.Tuple.ctx); + value = ast2obj_expr_context(state, o->v.Tuple.ctx); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ctx, value) == -1) + if (PyObject_SetAttr(result, state->ctx, value) == -1) goto failed; Py_DECREF(value); break; case Slice_kind: - tp = (PyTypeObject *)astmodulestate_global->Slice_type; + tp = (PyTypeObject *)state->Slice_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.Slice.lower); + value = ast2obj_expr(state, o->v.Slice.lower); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lower, value) == -1) + if (PyObject_SetAttr(result, state->lower, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Slice.upper); + value = ast2obj_expr(state, o->v.Slice.upper); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->upper, value) == -1) + if (PyObject_SetAttr(result, state->upper, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->v.Slice.step); + value = ast2obj_expr(state, o->v.Slice.step); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->step, value) == -1) + if (PyObject_SetAttr(result, state->step, value) == -1) goto failed; Py_DECREF(value); break; } - value = ast2obj_int(o->lineno); + value = ast2obj_int(state, o->lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) < 0) + if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->col_offset); + value = ast2obj_int(state, o->col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_lineno); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_col_offset, value) - < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); return result; @@ -4610,134 +4634,134 @@ ast2obj_expr(void* _o) return NULL; } -PyObject* ast2obj_expr_context(expr_context_ty o) +PyObject* ast2obj_expr_context(astmodulestate *state, expr_context_ty o) { switch(o) { case Load: - Py_INCREF(astmodulestate_global->Load_singleton); - return astmodulestate_global->Load_singleton; + Py_INCREF(state->Load_singleton); + return state->Load_singleton; case Store: - Py_INCREF(astmodulestate_global->Store_singleton); - return astmodulestate_global->Store_singleton; + Py_INCREF(state->Store_singleton); + return state->Store_singleton; case Del: - Py_INCREF(astmodulestate_global->Del_singleton); - return astmodulestate_global->Del_singleton; + Py_INCREF(state->Del_singleton); + return state->Del_singleton; } Py_UNREACHABLE(); } -PyObject* ast2obj_boolop(boolop_ty o) +PyObject* ast2obj_boolop(astmodulestate *state, boolop_ty o) { switch(o) { case And: - Py_INCREF(astmodulestate_global->And_singleton); - return astmodulestate_global->And_singleton; + Py_INCREF(state->And_singleton); + return state->And_singleton; case Or: - Py_INCREF(astmodulestate_global->Or_singleton); - return astmodulestate_global->Or_singleton; + Py_INCREF(state->Or_singleton); + return state->Or_singleton; } Py_UNREACHABLE(); } -PyObject* ast2obj_operator(operator_ty o) +PyObject* ast2obj_operator(astmodulestate *state, operator_ty o) { switch(o) { case Add: - Py_INCREF(astmodulestate_global->Add_singleton); - return astmodulestate_global->Add_singleton; + Py_INCREF(state->Add_singleton); + return state->Add_singleton; case Sub: - Py_INCREF(astmodulestate_global->Sub_singleton); - return astmodulestate_global->Sub_singleton; + Py_INCREF(state->Sub_singleton); + return state->Sub_singleton; case Mult: - Py_INCREF(astmodulestate_global->Mult_singleton); - return astmodulestate_global->Mult_singleton; + Py_INCREF(state->Mult_singleton); + return state->Mult_singleton; case MatMult: - Py_INCREF(astmodulestate_global->MatMult_singleton); - return astmodulestate_global->MatMult_singleton; + Py_INCREF(state->MatMult_singleton); + return state->MatMult_singleton; case Div: - Py_INCREF(astmodulestate_global->Div_singleton); - return astmodulestate_global->Div_singleton; + Py_INCREF(state->Div_singleton); + return state->Div_singleton; case Mod: - Py_INCREF(astmodulestate_global->Mod_singleton); - return astmodulestate_global->Mod_singleton; + Py_INCREF(state->Mod_singleton); + return state->Mod_singleton; case Pow: - Py_INCREF(astmodulestate_global->Pow_singleton); - return astmodulestate_global->Pow_singleton; + Py_INCREF(state->Pow_singleton); + return state->Pow_singleton; case LShift: - Py_INCREF(astmodulestate_global->LShift_singleton); - return astmodulestate_global->LShift_singleton; + Py_INCREF(state->LShift_singleton); + return state->LShift_singleton; case RShift: - Py_INCREF(astmodulestate_global->RShift_singleton); - return astmodulestate_global->RShift_singleton; + Py_INCREF(state->RShift_singleton); + return state->RShift_singleton; case BitOr: - Py_INCREF(astmodulestate_global->BitOr_singleton); - return astmodulestate_global->BitOr_singleton; + Py_INCREF(state->BitOr_singleton); + return state->BitOr_singleton; case BitXor: - Py_INCREF(astmodulestate_global->BitXor_singleton); - return astmodulestate_global->BitXor_singleton; + Py_INCREF(state->BitXor_singleton); + return state->BitXor_singleton; case BitAnd: - Py_INCREF(astmodulestate_global->BitAnd_singleton); - return astmodulestate_global->BitAnd_singleton; + Py_INCREF(state->BitAnd_singleton); + return state->BitAnd_singleton; case FloorDiv: - Py_INCREF(astmodulestate_global->FloorDiv_singleton); - return astmodulestate_global->FloorDiv_singleton; + Py_INCREF(state->FloorDiv_singleton); + return state->FloorDiv_singleton; } Py_UNREACHABLE(); } -PyObject* ast2obj_unaryop(unaryop_ty o) +PyObject* ast2obj_unaryop(astmodulestate *state, unaryop_ty o) { switch(o) { case Invert: - Py_INCREF(astmodulestate_global->Invert_singleton); - return astmodulestate_global->Invert_singleton; + Py_INCREF(state->Invert_singleton); + return state->Invert_singleton; case Not: - Py_INCREF(astmodulestate_global->Not_singleton); - return astmodulestate_global->Not_singleton; + Py_INCREF(state->Not_singleton); + return state->Not_singleton; case UAdd: - Py_INCREF(astmodulestate_global->UAdd_singleton); - return astmodulestate_global->UAdd_singleton; + Py_INCREF(state->UAdd_singleton); + return state->UAdd_singleton; case USub: - Py_INCREF(astmodulestate_global->USub_singleton); - return astmodulestate_global->USub_singleton; + Py_INCREF(state->USub_singleton); + return state->USub_singleton; } Py_UNREACHABLE(); } -PyObject* ast2obj_cmpop(cmpop_ty o) +PyObject* ast2obj_cmpop(astmodulestate *state, cmpop_ty o) { switch(o) { case Eq: - Py_INCREF(astmodulestate_global->Eq_singleton); - return astmodulestate_global->Eq_singleton; + Py_INCREF(state->Eq_singleton); + return state->Eq_singleton; case NotEq: - Py_INCREF(astmodulestate_global->NotEq_singleton); - return astmodulestate_global->NotEq_singleton; + Py_INCREF(state->NotEq_singleton); + return state->NotEq_singleton; case Lt: - Py_INCREF(astmodulestate_global->Lt_singleton); - return astmodulestate_global->Lt_singleton; + Py_INCREF(state->Lt_singleton); + return state->Lt_singleton; case LtE: - Py_INCREF(astmodulestate_global->LtE_singleton); - return astmodulestate_global->LtE_singleton; + Py_INCREF(state->LtE_singleton); + return state->LtE_singleton; case Gt: - Py_INCREF(astmodulestate_global->Gt_singleton); - return astmodulestate_global->Gt_singleton; + Py_INCREF(state->Gt_singleton); + return state->Gt_singleton; case GtE: - Py_INCREF(astmodulestate_global->GtE_singleton); - return astmodulestate_global->GtE_singleton; + Py_INCREF(state->GtE_singleton); + return state->GtE_singleton; case Is: - Py_INCREF(astmodulestate_global->Is_singleton); - return astmodulestate_global->Is_singleton; + Py_INCREF(state->Is_singleton); + return state->Is_singleton; case IsNot: - Py_INCREF(astmodulestate_global->IsNot_singleton); - return astmodulestate_global->IsNot_singleton; + Py_INCREF(state->IsNot_singleton); + return state->IsNot_singleton; case In: - Py_INCREF(astmodulestate_global->In_singleton); - return astmodulestate_global->In_singleton; + Py_INCREF(state->In_singleton); + return state->In_singleton; case NotIn: - Py_INCREF(astmodulestate_global->NotIn_singleton); - return astmodulestate_global->NotIn_singleton; + Py_INCREF(state->NotIn_singleton); + return state->NotIn_singleton; } Py_UNREACHABLE(); } PyObject* -ast2obj_comprehension(void* _o) +ast2obj_comprehension(astmodulestate *state, void* _o) { comprehension_ty o = (comprehension_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4745,28 +4769,27 @@ ast2obj_comprehension(void* _o) if (!o) { Py_RETURN_NONE; } - - tp = (PyTypeObject *)astmodulestate_global->comprehension_type; + tp = (PyTypeObject *)state->comprehension_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_expr(o->target); + value = ast2obj_expr(state, o->target); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->target, value) == -1) + if (PyObject_SetAttr(result, state->target, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->iter); + value = ast2obj_expr(state, o->iter); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->iter, value) == -1) + if (PyObject_SetAttr(result, state->iter, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->ifs, ast2obj_expr); + value = ast2obj_list(state, o->ifs, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->ifs, value) == -1) + if (PyObject_SetAttr(result, state->ifs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(o->is_async); + value = ast2obj_int(state, o->is_async); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->is_async, value) == -1) + if (PyObject_SetAttr(result, state->is_async, value) == -1) goto failed; Py_DECREF(value); return result; @@ -4777,7 +4800,7 @@ ast2obj_comprehension(void* _o) } PyObject* -ast2obj_excepthandler(void* _o) +ast2obj_excepthandler(astmodulestate *state, void* _o) { excepthandler_ty o = (excepthandler_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4785,48 +4808,46 @@ ast2obj_excepthandler(void* _o) if (!o) { Py_RETURN_NONE; } - switch (o->kind) { case ExceptHandler_kind: - tp = (PyTypeObject *)astmodulestate_global->ExceptHandler_type; + tp = (PyTypeObject *)state->ExceptHandler_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_expr(o->v.ExceptHandler.type); + value = ast2obj_expr(state, o->v.ExceptHandler.type); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type, value) == -1) + if (PyObject_SetAttr(result, state->type, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(o->v.ExceptHandler.name); + value = ast2obj_identifier(state, o->v.ExceptHandler.name); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->v.ExceptHandler.body, ast2obj_stmt); + value = ast2obj_list(state, o->v.ExceptHandler.body, ast2obj_stmt); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->body, value) == -1) + if (PyObject_SetAttr(result, state->body, value) == -1) goto failed; Py_DECREF(value); break; } - value = ast2obj_int(o->lineno); + value = ast2obj_int(state, o->lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) < 0) + if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->col_offset); + value = ast2obj_int(state, o->col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_lineno); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_col_offset, value) - < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); return result; @@ -4837,7 +4858,7 @@ ast2obj_excepthandler(void* _o) } PyObject* -ast2obj_arguments(void* _o) +ast2obj_arguments(astmodulestate *state, void* _o) { arguments_ty o = (arguments_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4845,46 +4866,42 @@ ast2obj_arguments(void* _o) if (!o) { Py_RETURN_NONE; } - - tp = (PyTypeObject *)astmodulestate_global->arguments_type; + tp = (PyTypeObject *)state->arguments_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_list(o->posonlyargs, ast2obj_arg); + value = ast2obj_list(state, o->posonlyargs, ast2obj_arg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->posonlyargs, value) == - -1) + if (PyObject_SetAttr(result, state->posonlyargs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->args, ast2obj_arg); + value = ast2obj_list(state, o->args, ast2obj_arg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->args, value) == -1) + if (PyObject_SetAttr(result, state->args, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arg(o->vararg); + value = ast2obj_arg(state, o->vararg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->vararg, value) == -1) + if (PyObject_SetAttr(result, state->vararg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->kwonlyargs, ast2obj_arg); + value = ast2obj_list(state, o->kwonlyargs, ast2obj_arg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->kwonlyargs, value) == - -1) + if (PyObject_SetAttr(result, state->kwonlyargs, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->kw_defaults, ast2obj_expr); + value = ast2obj_list(state, o->kw_defaults, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->kw_defaults, value) == - -1) + if (PyObject_SetAttr(result, state->kw_defaults, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_arg(o->kwarg); + value = ast2obj_arg(state, o->kwarg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->kwarg, value) == -1) + if (PyObject_SetAttr(result, state->kwarg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_list(o->defaults, ast2obj_expr); + value = ast2obj_list(state, o->defaults, ast2obj_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->defaults, value) == -1) + if (PyObject_SetAttr(result, state->defaults, value) == -1) goto failed; Py_DECREF(value); return result; @@ -4895,7 +4912,7 @@ ast2obj_arguments(void* _o) } PyObject* -ast2obj_arg(void* _o) +ast2obj_arg(astmodulestate *state, void* _o) { arg_ty o = (arg_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4903,46 +4920,42 @@ ast2obj_arg(void* _o) if (!o) { Py_RETURN_NONE; } - - tp = (PyTypeObject *)astmodulestate_global->arg_type; + tp = (PyTypeObject *)state->arg_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_identifier(o->arg); + value = ast2obj_identifier(state, o->arg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->arg, value) == -1) + if (PyObject_SetAttr(result, state->arg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->annotation); + value = ast2obj_expr(state, o->annotation); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->annotation, value) == - -1) + if (PyObject_SetAttr(result, state->annotation, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->type_comment); + value = ast2obj_string(state, o->type_comment); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->type_comment, value) == - -1) + if (PyObject_SetAttr(result, state->type_comment, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(o->lineno); + value = ast2obj_int(state, o->lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) < 0) + if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->col_offset); + value = ast2obj_int(state, o->col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_lineno); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_col_offset, value) - < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); return result; @@ -4953,7 +4966,7 @@ ast2obj_arg(void* _o) } PyObject* -ast2obj_keyword(void* _o) +ast2obj_keyword(astmodulestate *state, void* _o) { keyword_ty o = (keyword_ty)_o; PyObject *result = NULL, *value = NULL; @@ -4961,39 +4974,37 @@ ast2obj_keyword(void* _o) if (!o) { Py_RETURN_NONE; } - - tp = (PyTypeObject *)astmodulestate_global->keyword_type; + tp = (PyTypeObject *)state->keyword_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_identifier(o->arg); + value = ast2obj_identifier(state, o->arg); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->arg, value) == -1) + if (PyObject_SetAttr(result, state->arg, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->value); + value = ast2obj_expr(state, o->value); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) + if (PyObject_SetAttr(result, state->value, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_int(o->lineno); + value = ast2obj_int(state, o->lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) < 0) + if (PyObject_SetAttr(result, state->lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->col_offset); + value = ast2obj_int(state, o->col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->col_offset, value) < 0) + if (PyObject_SetAttr(result, state->col_offset, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_lineno); + value = ast2obj_int(state, o->end_lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_lineno, value) < 0) + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) goto failed; Py_DECREF(value); - value = ast2obj_int(o->end_col_offset); + value = ast2obj_int(state, o->end_col_offset); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->end_col_offset, value) - < 0) + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) goto failed; Py_DECREF(value); return result; @@ -5004,7 +5015,7 @@ ast2obj_keyword(void* _o) } PyObject* -ast2obj_alias(void* _o) +ast2obj_alias(astmodulestate *state, void* _o) { alias_ty o = (alias_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5012,18 +5023,17 @@ ast2obj_alias(void* _o) if (!o) { Py_RETURN_NONE; } - - tp = (PyTypeObject *)astmodulestate_global->alias_type; + tp = (PyTypeObject *)state->alias_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_identifier(o->name); + value = ast2obj_identifier(state, o->name); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->name, value) == -1) + if (PyObject_SetAttr(result, state->name, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_identifier(o->asname); + value = ast2obj_identifier(state, o->asname); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->asname, value) == -1) + if (PyObject_SetAttr(result, state->asname, value) == -1) goto failed; Py_DECREF(value); return result; @@ -5034,7 +5044,7 @@ ast2obj_alias(void* _o) } PyObject* -ast2obj_withitem(void* _o) +ast2obj_withitem(astmodulestate *state, void* _o) { withitem_ty o = (withitem_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5042,20 +5052,17 @@ ast2obj_withitem(void* _o) if (!o) { Py_RETURN_NONE; } - - tp = (PyTypeObject *)astmodulestate_global->withitem_type; + tp = (PyTypeObject *)state->withitem_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) return NULL; - value = ast2obj_expr(o->context_expr); + value = ast2obj_expr(state, o->context_expr); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->context_expr, value) == - -1) + if (PyObject_SetAttr(result, state->context_expr, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_expr(o->optional_vars); + value = ast2obj_expr(state, o->optional_vars); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->optional_vars, value) - == -1) + if (PyObject_SetAttr(result, state->optional_vars, value) == -1) goto failed; Py_DECREF(value); return result; @@ -5066,7 +5073,7 @@ ast2obj_withitem(void* _o) } PyObject* -ast2obj_type_ignore(void* _o) +ast2obj_type_ignore(astmodulestate *state, void* _o) { type_ignore_ty o = (type_ignore_ty)_o; PyObject *result = NULL, *value = NULL; @@ -5074,21 +5081,19 @@ ast2obj_type_ignore(void* _o) if (!o) { Py_RETURN_NONE; } - switch (o->kind) { case TypeIgnore_kind: - tp = (PyTypeObject *)astmodulestate_global->TypeIgnore_type; + tp = (PyTypeObject *)state->TypeIgnore_type; result = PyType_GenericNew(tp, NULL, NULL); if (!result) goto failed; - value = ast2obj_int(o->v.TypeIgnore.lineno); + value = ast2obj_int(state, o->v.TypeIgnore.lineno); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) == - -1) + if (PyObject_SetAttr(result, state->lineno, value) == -1) goto failed; Py_DECREF(value); - value = ast2obj_string(o->v.TypeIgnore.tag); + value = ast2obj_string(state, o->v.TypeIgnore.tag); if (!value) goto failed; - if (PyObject_SetAttr(result, astmodulestate_global->tag, value) == -1) + if (PyObject_SetAttr(result, state->tag, value) == -1) goto failed; Py_DECREF(value); break; @@ -5102,7 +5107,7 @@ ast2obj_type_ignore(void* _o) int -obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) +obj2ast_mod(astmodulestate *state, PyObject* obj, mod_ty* out, PyArena* arena) { int isinstance; @@ -5113,7 +5118,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) *out = NULL; return 0; } - tp = astmodulestate_global->Module_type; + tp = state->Module_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5122,7 +5127,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* type_ignores; - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5144,7 +5149,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5155,8 +5160,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_ignores, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_ignores, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5178,7 +5182,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) type_ignore_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_type_ignore(tmp2, &val, arena); + res = obj2ast_type_ignore(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5193,7 +5197,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Interactive_type; + tp = state->Interactive_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5201,7 +5205,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) if (isinstance) { asdl_seq* body; - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5223,7 +5227,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5238,7 +5242,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Expression_type; + tp = state->Expression_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5246,7 +5250,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) if (isinstance) { expr_ty body; - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5255,7 +5259,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &body, arena); + res = obj2ast_expr(state, tmp, &body, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5263,7 +5267,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->FunctionType_type; + tp = state->FunctionType_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5272,8 +5276,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) asdl_seq* argtypes; expr_ty returns; - if (_PyObject_LookupAttr(obj, astmodulestate_global->argtypes, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->argtypes, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5295,7 +5298,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5306,8 +5309,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->returns, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5316,7 +5318,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &returns, arena); + res = obj2ast_expr(state, tmp, &returns, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5332,7 +5334,7 @@ obj2ast_mod(PyObject* obj, mod_ty* out, PyArena* arena) } int -obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) +obj2ast_stmt(astmodulestate *state, PyObject* obj, stmt_ty* out, PyArena* arena) { int isinstance; @@ -5347,7 +5349,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) *out = NULL; return 0; } - if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5356,12 +5358,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &lineno, arena); + res = obj2ast_int(state, tmp, &lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->col_offset, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5370,12 +5371,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &col_offset, arena); + res = obj2ast_int(state, tmp, &col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_lineno, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5384,12 +5384,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_lineno, arena); + res = obj2ast_int(state, tmp, &end_lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_col_offset, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5398,11 +5397,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_col_offset, arena); + res = obj2ast_int(state, tmp, &end_col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - tp = astmodulestate_global->FunctionDef_type; + tp = state->FunctionDef_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5415,7 +5414,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty returns; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5424,11 +5423,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &name, arena); + res = obj2ast_identifier(state, tmp, &name, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5437,11 +5436,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_arguments(tmp, &args, arena); + res = obj2ast_arguments(state, tmp, &args, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5463,7 +5462,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5474,8 +5473,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->decorator_list, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5497,7 +5495,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5508,8 +5506,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->returns, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5518,12 +5515,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &returns, arena); + res = obj2ast_expr(state, tmp, &returns, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5532,7 +5528,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5542,7 +5538,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->AsyncFunctionDef_type; + tp = state->AsyncFunctionDef_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5555,7 +5551,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty returns; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5564,11 +5560,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &name, arena); + res = obj2ast_identifier(state, tmp, &name, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5577,11 +5573,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_arguments(tmp, &args, arena); + res = obj2ast_arguments(state, tmp, &args, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5603,7 +5599,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5614,8 +5610,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->decorator_list, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5637,7 +5632,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5648,8 +5643,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->returns, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->returns, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5658,12 +5652,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &returns, arena); + res = obj2ast_expr(state, tmp, &returns, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5672,7 +5665,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5682,7 +5675,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->ClassDef_type; + tp = state->ClassDef_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5694,7 +5687,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* decorator_list; - if (_PyObject_LookupAttr(obj, astmodulestate_global->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5703,11 +5696,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &name, arena); + res = obj2ast_identifier(state, tmp, &name, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->bases, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->bases, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5729,7 +5722,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5740,8 +5733,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->keywords, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->keywords, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5763,7 +5755,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) keyword_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_keyword(tmp2, &val, arena); + res = obj2ast_keyword(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5774,7 +5766,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5796,7 +5788,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5807,8 +5799,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->decorator_list, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->decorator_list, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5830,7 +5821,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5846,7 +5837,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Return_type; + tp = state->Return_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5854,7 +5845,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5863,7 +5854,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5872,7 +5863,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Delete_type; + tp = state->Delete_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5880,8 +5871,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (isinstance) { asdl_seq* targets; - if (_PyObject_LookupAttr(obj, astmodulestate_global->targets, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->targets, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5903,7 +5893,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5919,7 +5909,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Assign_type; + tp = state->Assign_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -5929,8 +5919,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty value; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->targets, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->targets, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5952,7 +5941,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -5963,7 +5952,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -5972,12 +5961,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -5986,7 +5974,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -5995,7 +5983,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->AugAssign_type; + tp = state->AugAssign_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6005,8 +5993,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) operator_ty op; expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->target, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6015,11 +6002,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &target, arena); + res = obj2ast_expr(state, tmp, &target, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6028,11 +6015,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_operator(tmp, &op, arena); + res = obj2ast_operator(state, tmp, &op, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6041,7 +6028,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6050,7 +6037,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->AnnAssign_type; + tp = state->AnnAssign_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6061,8 +6048,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty value; int simple; - if (_PyObject_LookupAttr(obj, astmodulestate_global->target, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6071,12 +6057,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &target, arena); + res = obj2ast_expr(state, tmp, &target, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->annotation, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->annotation, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6085,11 +6070,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &annotation, arena); + res = obj2ast_expr(state, tmp, &annotation, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6098,12 +6083,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->simple, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->simple, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6112,7 +6096,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &simple, arena); + res = obj2ast_int(state, tmp, &simple, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6121,7 +6105,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->For_type; + tp = state->For_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6133,8 +6117,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* orelse; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->target, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6143,11 +6126,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &target, arena); + res = obj2ast_expr(state, tmp, &target, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->iter, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6156,11 +6139,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &iter, arena); + res = obj2ast_expr(state, tmp, &iter, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6182,7 +6165,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6193,8 +6176,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->orelse, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6216,7 +6198,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6227,8 +6209,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6237,7 +6218,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6246,7 +6227,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->AsyncFor_type; + tp = state->AsyncFor_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6258,8 +6239,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* orelse; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->target, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6268,11 +6248,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &target, arena); + res = obj2ast_expr(state, tmp, &target, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->iter, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6281,11 +6261,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &iter, arena); + res = obj2ast_expr(state, tmp, &iter, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6307,7 +6287,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6318,8 +6298,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->orelse, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6341,7 +6320,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6352,8 +6331,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6362,7 +6340,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6371,7 +6349,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->While_type; + tp = state->While_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6381,7 +6359,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* orelse; - if (_PyObject_LookupAttr(obj, astmodulestate_global->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6390,11 +6368,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &test, arena); + res = obj2ast_expr(state, tmp, &test, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6416,7 +6394,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6427,8 +6405,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->orelse, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6450,7 +6427,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6466,7 +6443,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->If_type; + tp = state->If_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6476,7 +6453,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; asdl_seq* orelse; - if (_PyObject_LookupAttr(obj, astmodulestate_global->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6485,11 +6462,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &test, arena); + res = obj2ast_expr(state, tmp, &test, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6511,7 +6488,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6522,8 +6499,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->orelse, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6545,7 +6521,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6561,7 +6537,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->With_type; + tp = state->With_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6571,7 +6547,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->items, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->items, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6593,7 +6569,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) withitem_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_withitem(tmp2, &val, arena); + res = obj2ast_withitem(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6604,7 +6580,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6626,7 +6602,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6637,8 +6613,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6647,7 +6622,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6656,7 +6631,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->AsyncWith_type; + tp = state->AsyncWith_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6666,7 +6641,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* body; string type_comment; - if (_PyObject_LookupAttr(obj, astmodulestate_global->items, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->items, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6688,7 +6663,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) withitem_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_withitem(tmp2, &val, arena); + res = obj2ast_withitem(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6699,7 +6674,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6721,7 +6696,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6732,8 +6707,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, - &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6742,7 +6716,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6751,7 +6725,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Raise_type; + tp = state->Raise_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6760,7 +6734,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty exc; expr_ty cause; - if (_PyObject_LookupAttr(obj, astmodulestate_global->exc, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->exc, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6769,11 +6743,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &exc, arena); + res = obj2ast_expr(state, tmp, &exc, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->cause, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->cause, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6782,7 +6756,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &cause, arena); + res = obj2ast_expr(state, tmp, &cause, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6791,7 +6765,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Try_type; + tp = state->Try_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6802,7 +6776,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* orelse; asdl_seq* finalbody; - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6824,7 +6798,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6835,8 +6809,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->handlers, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->handlers, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6858,7 +6831,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) excepthandler_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_excepthandler(tmp2, &val, arena); + res = obj2ast_excepthandler(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6869,8 +6842,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->orelse, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6892,7 +6864,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6903,8 +6875,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->finalbody, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->finalbody, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6926,7 +6897,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -6942,7 +6913,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Assert_type; + tp = state->Assert_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6951,7 +6922,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) expr_ty test; expr_ty msg; - if (_PyObject_LookupAttr(obj, astmodulestate_global->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -6960,11 +6931,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &test, arena); + res = obj2ast_expr(state, tmp, &test, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->msg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->msg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -6973,7 +6944,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &msg, arena); + res = obj2ast_expr(state, tmp, &msg, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -6982,7 +6953,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Import_type; + tp = state->Import_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -6990,7 +6961,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (isinstance) { asdl_seq* names; - if (_PyObject_LookupAttr(obj, astmodulestate_global->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7012,7 +6983,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) alias_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_alias(tmp2, &val, arena); + res = obj2ast_alias(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7028,7 +6999,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->ImportFrom_type; + tp = state->ImportFrom_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7038,8 +7009,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) asdl_seq* names; int level; - if (_PyObject_LookupAttr(obj, astmodulestate_global->module, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->module, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -7048,11 +7018,11 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &module, arena); + res = obj2ast_identifier(state, tmp, &module, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7074,7 +7044,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) alias_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_alias(tmp2, &val, arena); + res = obj2ast_alias(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7085,7 +7055,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->level, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->level, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -7094,7 +7064,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &level, arena); + res = obj2ast_int(state, tmp, &level, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7103,7 +7073,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Global_type; + tp = state->Global_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7111,7 +7081,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (isinstance) { asdl_seq* names; - if (_PyObject_LookupAttr(obj, astmodulestate_global->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7133,7 +7103,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) identifier val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_identifier(tmp2, &val, arena); + res = obj2ast_identifier(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7149,7 +7119,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Nonlocal_type; + tp = state->Nonlocal_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7157,7 +7127,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (isinstance) { asdl_seq* names; - if (_PyObject_LookupAttr(obj, astmodulestate_global->names, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->names, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7179,7 +7149,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) identifier val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_identifier(tmp2, &val, arena); + res = obj2ast_identifier(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7195,7 +7165,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Expr_type; + tp = state->Expr_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7203,7 +7173,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7212,7 +7182,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7221,7 +7191,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Pass_type; + tp = state->Pass_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7232,7 +7202,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Break_type; + tp = state->Break_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7243,7 +7213,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Continue_type; + tp = state->Continue_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7262,7 +7232,7 @@ obj2ast_stmt(PyObject* obj, stmt_ty* out, PyArena* arena) } int -obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) +obj2ast_expr(astmodulestate *state, PyObject* obj, expr_ty* out, PyArena* arena) { int isinstance; @@ -7277,7 +7247,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) *out = NULL; return 0; } - if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7286,12 +7256,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &lineno, arena); + res = obj2ast_int(state, tmp, &lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->col_offset, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7300,12 +7269,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &col_offset, arena); + res = obj2ast_int(state, tmp, &col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_lineno, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -7314,12 +7282,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_lineno, arena); + res = obj2ast_int(state, tmp, &end_lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_col_offset, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -7328,11 +7295,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_col_offset, arena); + res = obj2ast_int(state, tmp, &end_col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - tp = astmodulestate_global->BoolOp_type; + tp = state->BoolOp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7341,7 +7308,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) boolop_ty op; asdl_seq* values; - if (_PyObject_LookupAttr(obj, astmodulestate_global->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7350,12 +7317,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_boolop(tmp, &op, arena); + res = obj2ast_boolop(state, tmp, &op, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->values, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7377,7 +7343,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7393,7 +7359,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->NamedExpr_type; + tp = state->NamedExpr_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7402,8 +7368,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty target; expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->target, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7412,11 +7377,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &target, arena); + res = obj2ast_expr(state, tmp, &target, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7425,7 +7390,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7434,7 +7399,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->BinOp_type; + tp = state->BinOp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7444,7 +7409,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) operator_ty op; expr_ty right; - if (_PyObject_LookupAttr(obj, astmodulestate_global->left, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->left, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7453,11 +7418,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &left, arena); + res = obj2ast_expr(state, tmp, &left, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7466,11 +7431,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_operator(tmp, &op, arena); + res = obj2ast_operator(state, tmp, &op, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->right, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->right, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7479,7 +7444,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &right, arena); + res = obj2ast_expr(state, tmp, &right, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7488,7 +7453,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->UnaryOp_type; + tp = state->UnaryOp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7497,7 +7462,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) unaryop_ty op; expr_ty operand; - if (_PyObject_LookupAttr(obj, astmodulestate_global->op, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->op, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7506,12 +7471,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_unaryop(tmp, &op, arena); + res = obj2ast_unaryop(state, tmp, &op, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->operand, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->operand, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7520,7 +7484,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &operand, arena); + res = obj2ast_expr(state, tmp, &operand, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7529,7 +7493,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Lambda_type; + tp = state->Lambda_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7538,7 +7502,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) arguments_ty args; expr_ty body; - if (_PyObject_LookupAttr(obj, astmodulestate_global->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7547,11 +7511,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_arguments(tmp, &args, arena); + res = obj2ast_arguments(state, tmp, &args, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7560,7 +7524,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &body, arena); + res = obj2ast_expr(state, tmp, &body, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7569,7 +7533,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->IfExp_type; + tp = state->IfExp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7579,7 +7543,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty body; expr_ty orelse; - if (_PyObject_LookupAttr(obj, astmodulestate_global->test, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->test, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7588,11 +7552,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &test, arena); + res = obj2ast_expr(state, tmp, &test, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7601,12 +7565,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &body, arena); + res = obj2ast_expr(state, tmp, &body, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->orelse, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->orelse, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7615,7 +7578,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &orelse, arena); + res = obj2ast_expr(state, tmp, &orelse, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -7624,7 +7587,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Dict_type; + tp = state->Dict_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7633,7 +7596,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* keys; asdl_seq* values; - if (_PyObject_LookupAttr(obj, astmodulestate_global->keys, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->keys, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7655,7 +7618,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7666,8 +7629,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->values, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7689,7 +7651,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7705,7 +7667,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Set_type; + tp = state->Set_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7713,7 +7675,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (isinstance) { asdl_seq* elts; - if (_PyObject_LookupAttr(obj, astmodulestate_global->elts, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7735,7 +7697,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7750,7 +7712,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->ListComp_type; + tp = state->ListComp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7759,7 +7721,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty elt; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, astmodulestate_global->elt, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7768,12 +7730,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &elt, arena); + res = obj2ast_expr(state, tmp, &elt, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->generators, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7795,7 +7756,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) comprehension_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_comprehension(tmp2, &val, arena); + res = obj2ast_comprehension(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7811,7 +7772,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->SetComp_type; + tp = state->SetComp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7820,7 +7781,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty elt; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, astmodulestate_global->elt, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7829,12 +7790,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &elt, arena); + res = obj2ast_expr(state, tmp, &elt, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->generators, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7856,7 +7816,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) comprehension_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_comprehension(tmp2, &val, arena); + res = obj2ast_comprehension(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7872,7 +7832,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->DictComp_type; + tp = state->DictComp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7882,7 +7842,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty value; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, astmodulestate_global->key, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->key, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7891,11 +7851,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &key, arena); + res = obj2ast_expr(state, tmp, &key, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7904,12 +7864,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->generators, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7931,7 +7890,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) comprehension_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_comprehension(tmp2, &val, arena); + res = obj2ast_comprehension(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -7947,7 +7906,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->GeneratorExp_type; + tp = state->GeneratorExp_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -7956,7 +7915,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty elt; asdl_seq* generators; - if (_PyObject_LookupAttr(obj, astmodulestate_global->elt, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elt, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7965,12 +7924,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &elt, arena); + res = obj2ast_expr(state, tmp, &elt, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->generators, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->generators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -7992,7 +7950,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) comprehension_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_comprehension(tmp2, &val, arena); + res = obj2ast_comprehension(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8008,7 +7966,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Await_type; + tp = state->Await_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8016,7 +7974,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8025,7 +7983,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8034,7 +7992,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Yield_type; + tp = state->Yield_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8042,7 +8000,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8051,7 +8009,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8060,7 +8018,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->YieldFrom_type; + tp = state->YieldFrom_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8068,7 +8026,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (isinstance) { expr_ty value; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8077,7 +8035,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8086,7 +8044,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Compare_type; + tp = state->Compare_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8096,7 +8054,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) asdl_int_seq* ops; asdl_seq* comparators; - if (_PyObject_LookupAttr(obj, astmodulestate_global->left, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->left, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8105,11 +8063,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &left, arena); + res = obj2ast_expr(state, tmp, &left, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ops, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ops, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8131,7 +8089,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) cmpop_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_cmpop(tmp2, &val, arena); + res = obj2ast_cmpop(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8142,8 +8100,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->comparators, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->comparators, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8165,7 +8122,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8181,7 +8138,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Call_type; + tp = state->Call_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8191,7 +8148,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* args; asdl_seq* keywords; - if (_PyObject_LookupAttr(obj, astmodulestate_global->func, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->func, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8200,11 +8157,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &func, arena); + res = obj2ast_expr(state, tmp, &func, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8226,7 +8183,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8237,8 +8194,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->keywords, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->keywords, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8260,7 +8216,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) keyword_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_keyword(tmp2, &val, arena); + res = obj2ast_keyword(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8276,7 +8232,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->FormattedValue_type; + tp = state->FormattedValue_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8286,7 +8242,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) int conversion; expr_ty format_spec; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8295,12 +8251,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->conversion, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->conversion, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8309,12 +8264,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &conversion, arena); + res = obj2ast_int(state, tmp, &conversion, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->format_spec, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->format_spec, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8323,7 +8277,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &format_spec, arena); + res = obj2ast_expr(state, tmp, &format_spec, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8332,7 +8286,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->JoinedStr_type; + tp = state->JoinedStr_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8340,8 +8294,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (isinstance) { asdl_seq* values; - if (_PyObject_LookupAttr(obj, astmodulestate_global->values, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->values, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8363,7 +8316,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8379,7 +8332,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Constant_type; + tp = state->Constant_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8388,7 +8341,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) constant value; string kind; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8397,11 +8350,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_constant(tmp, &value, arena); + res = obj2ast_constant(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->kind, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->kind, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8410,7 +8363,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &kind, arena); + res = obj2ast_string(state, tmp, &kind, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8419,7 +8372,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Attribute_type; + tp = state->Attribute_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8429,7 +8382,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) identifier attr; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8438,11 +8391,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->attr, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->attr, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8451,11 +8404,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &attr, arena); + res = obj2ast_identifier(state, tmp, &attr, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8464,7 +8417,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr_context(tmp, &ctx, arena); + res = obj2ast_expr_context(state, tmp, &ctx, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8473,7 +8426,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Subscript_type; + tp = state->Subscript_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8483,7 +8436,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty slice; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8492,11 +8445,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->slice, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->slice, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8505,11 +8458,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &slice, arena); + res = obj2ast_expr(state, tmp, &slice, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8518,7 +8471,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr_context(tmp, &ctx, arena); + res = obj2ast_expr_context(state, tmp, &ctx, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8527,7 +8480,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Starred_type; + tp = state->Starred_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8536,7 +8489,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty value; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8545,11 +8498,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8558,7 +8511,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr_context(tmp, &ctx, arena); + res = obj2ast_expr_context(state, tmp, &ctx, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8567,7 +8520,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Name_type; + tp = state->Name_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8576,7 +8529,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) identifier id; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, astmodulestate_global->id, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->id, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8585,11 +8538,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &id, arena); + res = obj2ast_identifier(state, tmp, &id, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8598,7 +8551,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr_context(tmp, &ctx, arena); + res = obj2ast_expr_context(state, tmp, &ctx, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8607,7 +8560,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->List_type; + tp = state->List_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8616,7 +8569,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* elts; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, astmodulestate_global->elts, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8638,7 +8591,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8649,7 +8602,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8658,7 +8611,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr_context(tmp, &ctx, arena); + res = obj2ast_expr_context(state, tmp, &ctx, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8667,7 +8620,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Tuple_type; + tp = state->Tuple_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8676,7 +8629,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) asdl_seq* elts; expr_context_ty ctx; - if (_PyObject_LookupAttr(obj, astmodulestate_global->elts, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->elts, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8698,7 +8651,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -8709,7 +8662,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ctx, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ctx, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -8718,7 +8671,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr_context(tmp, &ctx, arena); + res = obj2ast_expr_context(state, tmp, &ctx, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8727,7 +8680,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) if (*out == NULL) goto failed; return 0; } - tp = astmodulestate_global->Slice_type; + tp = state->Slice_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -8737,7 +8690,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) expr_ty upper; expr_ty step; - if (_PyObject_LookupAttr(obj, astmodulestate_global->lower, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lower, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8746,11 +8699,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &lower, arena); + res = obj2ast_expr(state, tmp, &lower, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->upper, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->upper, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8759,11 +8712,11 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &upper, arena); + res = obj2ast_expr(state, tmp, &upper, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->step, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->step, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -8772,7 +8725,7 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &step, arena); + res = obj2ast_expr(state, tmp, &step, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -8789,11 +8742,12 @@ obj2ast_expr(PyObject* obj, expr_ty* out, PyArena* arena) } int -obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena) +obj2ast_expr_context(astmodulestate *state, PyObject* obj, expr_context_ty* + out, PyArena* arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Load_type); + isinstance = PyObject_IsInstance(obj, state->Load_type); if (isinstance == -1) { return 1; } @@ -8801,7 +8755,7 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena) *out = Load; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Store_type); + isinstance = PyObject_IsInstance(obj, state->Store_type); if (isinstance == -1) { return 1; } @@ -8809,7 +8763,7 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena) *out = Store; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Del_type); + isinstance = PyObject_IsInstance(obj, state->Del_type); if (isinstance == -1) { return 1; } @@ -8823,11 +8777,12 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena) } int -obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena) +obj2ast_boolop(astmodulestate *state, PyObject* obj, boolop_ty* out, PyArena* + arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, astmodulestate_global->And_type); + isinstance = PyObject_IsInstance(obj, state->And_type); if (isinstance == -1) { return 1; } @@ -8835,7 +8790,7 @@ obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena) *out = And; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Or_type); + isinstance = PyObject_IsInstance(obj, state->Or_type); if (isinstance == -1) { return 1; } @@ -8849,11 +8804,12 @@ obj2ast_boolop(PyObject* obj, boolop_ty* out, PyArena* arena) } int -obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) +obj2ast_operator(astmodulestate *state, PyObject* obj, operator_ty* out, + PyArena* arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Add_type); + isinstance = PyObject_IsInstance(obj, state->Add_type); if (isinstance == -1) { return 1; } @@ -8861,7 +8817,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = Add; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Sub_type); + isinstance = PyObject_IsInstance(obj, state->Sub_type); if (isinstance == -1) { return 1; } @@ -8869,7 +8825,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = Sub; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Mult_type); + isinstance = PyObject_IsInstance(obj, state->Mult_type); if (isinstance == -1) { return 1; } @@ -8877,7 +8833,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = Mult; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->MatMult_type); + isinstance = PyObject_IsInstance(obj, state->MatMult_type); if (isinstance == -1) { return 1; } @@ -8885,7 +8841,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = MatMult; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Div_type); + isinstance = PyObject_IsInstance(obj, state->Div_type); if (isinstance == -1) { return 1; } @@ -8893,7 +8849,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = Div; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Mod_type); + isinstance = PyObject_IsInstance(obj, state->Mod_type); if (isinstance == -1) { return 1; } @@ -8901,7 +8857,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = Mod; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Pow_type); + isinstance = PyObject_IsInstance(obj, state->Pow_type); if (isinstance == -1) { return 1; } @@ -8909,7 +8865,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = Pow; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->LShift_type); + isinstance = PyObject_IsInstance(obj, state->LShift_type); if (isinstance == -1) { return 1; } @@ -8917,7 +8873,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = LShift; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->RShift_type); + isinstance = PyObject_IsInstance(obj, state->RShift_type); if (isinstance == -1) { return 1; } @@ -8925,7 +8881,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = RShift; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->BitOr_type); + isinstance = PyObject_IsInstance(obj, state->BitOr_type); if (isinstance == -1) { return 1; } @@ -8933,7 +8889,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = BitOr; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->BitXor_type); + isinstance = PyObject_IsInstance(obj, state->BitXor_type); if (isinstance == -1) { return 1; } @@ -8941,7 +8897,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = BitXor; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->BitAnd_type); + isinstance = PyObject_IsInstance(obj, state->BitAnd_type); if (isinstance == -1) { return 1; } @@ -8949,7 +8905,7 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) *out = BitAnd; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->FloorDiv_type); + isinstance = PyObject_IsInstance(obj, state->FloorDiv_type); if (isinstance == -1) { return 1; } @@ -8963,11 +8919,12 @@ obj2ast_operator(PyObject* obj, operator_ty* out, PyArena* arena) } int -obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) +obj2ast_unaryop(astmodulestate *state, PyObject* obj, unaryop_ty* out, PyArena* + arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Invert_type); + isinstance = PyObject_IsInstance(obj, state->Invert_type); if (isinstance == -1) { return 1; } @@ -8975,7 +8932,7 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) *out = Invert; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Not_type); + isinstance = PyObject_IsInstance(obj, state->Not_type); if (isinstance == -1) { return 1; } @@ -8983,7 +8940,7 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) *out = Not; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->UAdd_type); + isinstance = PyObject_IsInstance(obj, state->UAdd_type); if (isinstance == -1) { return 1; } @@ -8991,7 +8948,7 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) *out = UAdd; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->USub_type); + isinstance = PyObject_IsInstance(obj, state->USub_type); if (isinstance == -1) { return 1; } @@ -9005,11 +8962,12 @@ obj2ast_unaryop(PyObject* obj, unaryop_ty* out, PyArena* arena) } int -obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) +obj2ast_cmpop(astmodulestate *state, PyObject* obj, cmpop_ty* out, PyArena* + arena) { int isinstance; - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Eq_type); + isinstance = PyObject_IsInstance(obj, state->Eq_type); if (isinstance == -1) { return 1; } @@ -9017,7 +8975,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = Eq; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->NotEq_type); + isinstance = PyObject_IsInstance(obj, state->NotEq_type); if (isinstance == -1) { return 1; } @@ -9025,7 +8983,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = NotEq; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Lt_type); + isinstance = PyObject_IsInstance(obj, state->Lt_type); if (isinstance == -1) { return 1; } @@ -9033,7 +8991,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = Lt; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->LtE_type); + isinstance = PyObject_IsInstance(obj, state->LtE_type); if (isinstance == -1) { return 1; } @@ -9041,7 +8999,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = LtE; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Gt_type); + isinstance = PyObject_IsInstance(obj, state->Gt_type); if (isinstance == -1) { return 1; } @@ -9049,7 +9007,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = Gt; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->GtE_type); + isinstance = PyObject_IsInstance(obj, state->GtE_type); if (isinstance == -1) { return 1; } @@ -9057,7 +9015,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = GtE; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->Is_type); + isinstance = PyObject_IsInstance(obj, state->Is_type); if (isinstance == -1) { return 1; } @@ -9065,7 +9023,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = Is; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->IsNot_type); + isinstance = PyObject_IsInstance(obj, state->IsNot_type); if (isinstance == -1) { return 1; } @@ -9073,7 +9031,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = IsNot; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->In_type); + isinstance = PyObject_IsInstance(obj, state->In_type); if (isinstance == -1) { return 1; } @@ -9081,7 +9039,7 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) *out = In; return 0; } - isinstance = PyObject_IsInstance(obj, astmodulestate_global->NotIn_type); + isinstance = PyObject_IsInstance(obj, state->NotIn_type); if (isinstance == -1) { return 1; } @@ -9095,7 +9053,8 @@ obj2ast_cmpop(PyObject* obj, cmpop_ty* out, PyArena* arena) } int -obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) +obj2ast_comprehension(astmodulestate *state, PyObject* obj, comprehension_ty* + out, PyArena* arena) { PyObject* tmp = NULL; expr_ty target; @@ -9103,7 +9062,7 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) asdl_seq* ifs; int is_async; - if (_PyObject_LookupAttr(obj, astmodulestate_global->target, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->target, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9112,11 +9071,11 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &target, arena); + res = obj2ast_expr(state, tmp, &target, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->iter, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->iter, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9125,11 +9084,11 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &iter, arena); + res = obj2ast_expr(state, tmp, &iter, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->ifs, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->ifs, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9151,7 +9110,7 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9162,7 +9121,7 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->is_async, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->is_async, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9171,7 +9130,7 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &is_async, arena); + res = obj2ast_int(state, tmp, &is_async, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9183,7 +9142,8 @@ obj2ast_comprehension(PyObject* obj, comprehension_ty* out, PyArena* arena) } int -obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) +obj2ast_excepthandler(astmodulestate *state, PyObject* obj, excepthandler_ty* + out, PyArena* arena) { int isinstance; @@ -9198,7 +9158,7 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) *out = NULL; return 0; } - if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9207,12 +9167,11 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &lineno, arena); + res = obj2ast_int(state, tmp, &lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->col_offset, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9221,12 +9180,11 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &col_offset, arena); + res = obj2ast_int(state, tmp, &col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_lineno, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9235,12 +9193,11 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_lineno, arena); + res = obj2ast_int(state, tmp, &end_lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_col_offset, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9249,11 +9206,11 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_col_offset, arena); + res = obj2ast_int(state, tmp, &end_col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - tp = astmodulestate_global->ExceptHandler_type; + tp = state->ExceptHandler_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -9263,7 +9220,7 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) identifier name; asdl_seq* body; - if (_PyObject_LookupAttr(obj, astmodulestate_global->type, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->type, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9272,11 +9229,11 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &type, arena); + res = obj2ast_expr(state, tmp, &type, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9285,11 +9242,11 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &name, arena); + res = obj2ast_identifier(state, tmp, &name, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->body, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->body, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9311,7 +9268,7 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) stmt_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_stmt(tmp2, &val, arena); + res = obj2ast_stmt(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9335,7 +9292,8 @@ obj2ast_excepthandler(PyObject* obj, excepthandler_ty* out, PyArena* arena) } int -obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) +obj2ast_arguments(astmodulestate *state, PyObject* obj, arguments_ty* out, + PyArena* arena) { PyObject* tmp = NULL; asdl_seq* posonlyargs; @@ -9346,8 +9304,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) arg_ty kwarg; asdl_seq* defaults; - if (_PyObject_LookupAttr(obj, astmodulestate_global->posonlyargs, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->posonlyargs, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9369,7 +9326,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) arg_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_arg(tmp2, &val, arena); + res = obj2ast_arg(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9380,7 +9337,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->args, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->args, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9402,7 +9359,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) arg_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_arg(tmp2, &val, arena); + res = obj2ast_arg(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9413,7 +9370,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->vararg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->vararg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9422,12 +9379,11 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } else { int res; - res = obj2ast_arg(tmp, &vararg, arena); + res = obj2ast_arg(state, tmp, &vararg, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->kwonlyargs, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->kwonlyargs, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9449,7 +9405,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) arg_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_arg(tmp2, &val, arena); + res = obj2ast_arg(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9460,8 +9416,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->kw_defaults, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->kw_defaults, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9483,7 +9438,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9494,7 +9449,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->kwarg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->kwarg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9503,11 +9458,11 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } else { int res; - res = obj2ast_arg(tmp, &kwarg, arena); + res = obj2ast_arg(state, tmp, &kwarg, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->defaults, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->defaults, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9529,7 +9484,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) expr_ty val; PyObject *tmp2 = PyList_GET_ITEM(tmp, i); Py_INCREF(tmp2); - res = obj2ast_expr(tmp2, &val, arena); + res = obj2ast_expr(state, tmp2, &val, arena); Py_DECREF(tmp2); if (res != 0) goto failed; if (len != PyList_GET_SIZE(tmp)) { @@ -9549,7 +9504,7 @@ obj2ast_arguments(PyObject* obj, arguments_ty* out, PyArena* arena) } int -obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) +obj2ast_arg(astmodulestate *state, PyObject* obj, arg_ty* out, PyArena* arena) { PyObject* tmp = NULL; identifier arg; @@ -9560,7 +9515,7 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) int end_lineno; int end_col_offset; - if (_PyObject_LookupAttr(obj, astmodulestate_global->arg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->arg, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9569,12 +9524,11 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &arg, arena); + res = obj2ast_identifier(state, tmp, &arg, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->annotation, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->annotation, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9583,12 +9537,11 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &annotation, arena); + res = obj2ast_expr(state, tmp, &annotation, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->type_comment, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->type_comment, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9597,11 +9550,11 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &type_comment, arena); + res = obj2ast_string(state, tmp, &type_comment, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9610,12 +9563,11 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &lineno, arena); + res = obj2ast_int(state, tmp, &lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->col_offset, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9624,12 +9576,11 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &col_offset, arena); + res = obj2ast_int(state, tmp, &col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_lineno, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9638,12 +9589,11 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_lineno, arena); + res = obj2ast_int(state, tmp, &end_lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_col_offset, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9652,7 +9602,7 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_col_offset, arena); + res = obj2ast_int(state, tmp, &end_col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9665,7 +9615,8 @@ obj2ast_arg(PyObject* obj, arg_ty* out, PyArena* arena) } int -obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) +obj2ast_keyword(astmodulestate *state, PyObject* obj, keyword_ty* out, PyArena* + arena) { PyObject* tmp = NULL; identifier arg; @@ -9675,7 +9626,7 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) int end_lineno; int end_col_offset; - if (_PyObject_LookupAttr(obj, astmodulestate_global->arg, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->arg, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9684,11 +9635,11 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &arg, arena); + res = obj2ast_identifier(state, tmp, &arg, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->value, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->value, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9697,11 +9648,11 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &value, arena); + res = obj2ast_expr(state, tmp, &value, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9710,12 +9661,11 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &lineno, arena); + res = obj2ast_int(state, tmp, &lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->col_offset, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9724,12 +9674,11 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &col_offset, arena); + res = obj2ast_int(state, tmp, &col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_lineno, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9738,12 +9687,11 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_lineno, arena); + res = obj2ast_int(state, tmp, &end_lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->end_col_offset, &tmp) - < 0) { + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9752,7 +9700,7 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &end_col_offset, arena); + res = obj2ast_int(state, tmp, &end_col_offset, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9765,13 +9713,14 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) } int -obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena) +obj2ast_alias(astmodulestate *state, PyObject* obj, alias_ty* out, PyArena* + arena) { PyObject* tmp = NULL; identifier name; identifier asname; - if (_PyObject_LookupAttr(obj, astmodulestate_global->name, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9780,11 +9729,11 @@ obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &name, arena); + res = obj2ast_identifier(state, tmp, &name, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->asname, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->asname, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9793,7 +9742,7 @@ obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena) } else { int res; - res = obj2ast_identifier(tmp, &asname, arena); + res = obj2ast_identifier(state, tmp, &asname, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9805,14 +9754,14 @@ obj2ast_alias(PyObject* obj, alias_ty* out, PyArena* arena) } int -obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena) +obj2ast_withitem(astmodulestate *state, PyObject* obj, withitem_ty* out, + PyArena* arena) { PyObject* tmp = NULL; expr_ty context_expr; expr_ty optional_vars; - if (_PyObject_LookupAttr(obj, astmodulestate_global->context_expr, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->context_expr, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9821,12 +9770,11 @@ obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &context_expr, arena); + res = obj2ast_expr(state, tmp, &context_expr, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->optional_vars, &tmp) < - 0) { + if (_PyObject_LookupAttr(obj, state->optional_vars, &tmp) < 0) { return 1; } if (tmp == NULL || tmp == Py_None) { @@ -9835,7 +9783,7 @@ obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena) } else { int res; - res = obj2ast_expr(tmp, &optional_vars, arena); + res = obj2ast_expr(state, tmp, &optional_vars, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9847,7 +9795,8 @@ obj2ast_withitem(PyObject* obj, withitem_ty* out, PyArena* arena) } int -obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena) +obj2ast_type_ignore(astmodulestate *state, PyObject* obj, type_ignore_ty* out, + PyArena* arena) { int isinstance; @@ -9858,7 +9807,7 @@ obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena) *out = NULL; return 0; } - tp = astmodulestate_global->TypeIgnore_type; + tp = state->TypeIgnore_type; isinstance = PyObject_IsInstance(obj, tp); if (isinstance == -1) { return 1; @@ -9867,8 +9816,7 @@ obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena) int lineno; string tag; - if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) - { + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9877,11 +9825,11 @@ obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena) } else { int res; - res = obj2ast_int(tmp, &lineno, arena); + res = obj2ast_int(state, tmp, &lineno, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } - if (_PyObject_LookupAttr(obj, astmodulestate_global->tag, &tmp) < 0) { + if (_PyObject_LookupAttr(obj, state->tag, &tmp) < 0) { return 1; } if (tmp == NULL) { @@ -9890,7 +9838,7 @@ obj2ast_type_ignore(PyObject* obj, type_ignore_ty* out, PyArena* arena) } else { int res; - res = obj2ast_string(tmp, &tag, arena); + res = obj2ast_string(state, tmp, &tag, arena); if (res != 0) goto failed; Py_CLEAR(tmp); } @@ -9913,10 +9861,12 @@ PyInit__ast(void) if (!init_types()) return NULL; m = PyState_FindModule(&_astmodule); if (!m) return NULL; - if (PyModule_AddObject(m, "AST", astmodulestate_global->AST_type) < 0) { + astmodulestate *state = get_ast_state(m); + + if (PyModule_AddObject(m, "AST", state->AST_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->AST_type); + Py_INCREF(state->AST_type); if (PyModule_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0) { goto error; } @@ -9926,485 +9876,432 @@ PyInit__ast(void) if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0) { goto error; } - if (PyModule_AddObject(m, "mod", astmodulestate_global->mod_type) < 0) { + if (PyModule_AddObject(m, "mod", state->mod_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->mod_type); - if (PyModule_AddObject(m, "Module", astmodulestate_global->Module_type) < - 0) { + Py_INCREF(state->mod_type); + if (PyModule_AddObject(m, "Module", state->Module_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Module_type); - if (PyModule_AddObject(m, "Interactive", - astmodulestate_global->Interactive_type) < 0) { + Py_INCREF(state->Module_type); + if (PyModule_AddObject(m, "Interactive", state->Interactive_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Interactive_type); - if (PyModule_AddObject(m, "Expression", - astmodulestate_global->Expression_type) < 0) { + Py_INCREF(state->Interactive_type); + if (PyModule_AddObject(m, "Expression", state->Expression_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Expression_type); - if (PyModule_AddObject(m, "FunctionType", - astmodulestate_global->FunctionType_type) < 0) { + Py_INCREF(state->Expression_type); + if (PyModule_AddObject(m, "FunctionType", state->FunctionType_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->FunctionType_type); - if (PyModule_AddObject(m, "stmt", astmodulestate_global->stmt_type) < 0) { + Py_INCREF(state->FunctionType_type); + if (PyModule_AddObject(m, "stmt", state->stmt_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->stmt_type); - if (PyModule_AddObject(m, "FunctionDef", - astmodulestate_global->FunctionDef_type) < 0) { + Py_INCREF(state->stmt_type); + if (PyModule_AddObject(m, "FunctionDef", state->FunctionDef_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->FunctionDef_type); - if (PyModule_AddObject(m, "AsyncFunctionDef", - astmodulestate_global->AsyncFunctionDef_type) < 0) { + Py_INCREF(state->FunctionDef_type); + if (PyModule_AddObject(m, "AsyncFunctionDef", state->AsyncFunctionDef_type) + < 0) { goto error; } - Py_INCREF(astmodulestate(m)->AsyncFunctionDef_type); - if (PyModule_AddObject(m, "ClassDef", astmodulestate_global->ClassDef_type) - < 0) { + Py_INCREF(state->AsyncFunctionDef_type); + if (PyModule_AddObject(m, "ClassDef", state->ClassDef_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->ClassDef_type); - if (PyModule_AddObject(m, "Return", astmodulestate_global->Return_type) < - 0) { + Py_INCREF(state->ClassDef_type); + if (PyModule_AddObject(m, "Return", state->Return_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Return_type); - if (PyModule_AddObject(m, "Delete", astmodulestate_global->Delete_type) < - 0) { + Py_INCREF(state->Return_type); + if (PyModule_AddObject(m, "Delete", state->Delete_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Delete_type); - if (PyModule_AddObject(m, "Assign", astmodulestate_global->Assign_type) < - 0) { + Py_INCREF(state->Delete_type); + if (PyModule_AddObject(m, "Assign", state->Assign_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Assign_type); - if (PyModule_AddObject(m, "AugAssign", - astmodulestate_global->AugAssign_type) < 0) { + Py_INCREF(state->Assign_type); + if (PyModule_AddObject(m, "AugAssign", state->AugAssign_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->AugAssign_type); - if (PyModule_AddObject(m, "AnnAssign", - astmodulestate_global->AnnAssign_type) < 0) { + Py_INCREF(state->AugAssign_type); + if (PyModule_AddObject(m, "AnnAssign", state->AnnAssign_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->AnnAssign_type); - if (PyModule_AddObject(m, "For", astmodulestate_global->For_type) < 0) { + Py_INCREF(state->AnnAssign_type); + if (PyModule_AddObject(m, "For", state->For_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->For_type); - if (PyModule_AddObject(m, "AsyncFor", astmodulestate_global->AsyncFor_type) - < 0) { + Py_INCREF(state->For_type); + if (PyModule_AddObject(m, "AsyncFor", state->AsyncFor_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->AsyncFor_type); - if (PyModule_AddObject(m, "While", astmodulestate_global->While_type) < 0) { + Py_INCREF(state->AsyncFor_type); + if (PyModule_AddObject(m, "While", state->While_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->While_type); - if (PyModule_AddObject(m, "If", astmodulestate_global->If_type) < 0) { + Py_INCREF(state->While_type); + if (PyModule_AddObject(m, "If", state->If_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->If_type); - if (PyModule_AddObject(m, "With", astmodulestate_global->With_type) < 0) { + Py_INCREF(state->If_type); + if (PyModule_AddObject(m, "With", state->With_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->With_type); - if (PyModule_AddObject(m, "AsyncWith", - astmodulestate_global->AsyncWith_type) < 0) { + Py_INCREF(state->With_type); + if (PyModule_AddObject(m, "AsyncWith", state->AsyncWith_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->AsyncWith_type); - if (PyModule_AddObject(m, "Raise", astmodulestate_global->Raise_type) < 0) { + Py_INCREF(state->AsyncWith_type); + if (PyModule_AddObject(m, "Raise", state->Raise_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Raise_type); - if (PyModule_AddObject(m, "Try", astmodulestate_global->Try_type) < 0) { + Py_INCREF(state->Raise_type); + if (PyModule_AddObject(m, "Try", state->Try_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Try_type); - if (PyModule_AddObject(m, "Assert", astmodulestate_global->Assert_type) < - 0) { + Py_INCREF(state->Try_type); + if (PyModule_AddObject(m, "Assert", state->Assert_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Assert_type); - if (PyModule_AddObject(m, "Import", astmodulestate_global->Import_type) < - 0) { + Py_INCREF(state->Assert_type); + if (PyModule_AddObject(m, "Import", state->Import_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Import_type); - if (PyModule_AddObject(m, "ImportFrom", - astmodulestate_global->ImportFrom_type) < 0) { + Py_INCREF(state->Import_type); + if (PyModule_AddObject(m, "ImportFrom", state->ImportFrom_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->ImportFrom_type); - if (PyModule_AddObject(m, "Global", astmodulestate_global->Global_type) < - 0) { + Py_INCREF(state->ImportFrom_type); + if (PyModule_AddObject(m, "Global", state->Global_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Global_type); - if (PyModule_AddObject(m, "Nonlocal", astmodulestate_global->Nonlocal_type) - < 0) { + Py_INCREF(state->Global_type); + if (PyModule_AddObject(m, "Nonlocal", state->Nonlocal_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Nonlocal_type); - if (PyModule_AddObject(m, "Expr", astmodulestate_global->Expr_type) < 0) { + Py_INCREF(state->Nonlocal_type); + if (PyModule_AddObject(m, "Expr", state->Expr_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Expr_type); - if (PyModule_AddObject(m, "Pass", astmodulestate_global->Pass_type) < 0) { + Py_INCREF(state->Expr_type); + if (PyModule_AddObject(m, "Pass", state->Pass_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Pass_type); - if (PyModule_AddObject(m, "Break", astmodulestate_global->Break_type) < 0) { + Py_INCREF(state->Pass_type); + if (PyModule_AddObject(m, "Break", state->Break_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Break_type); - if (PyModule_AddObject(m, "Continue", astmodulestate_global->Continue_type) - < 0) { + Py_INCREF(state->Break_type); + if (PyModule_AddObject(m, "Continue", state->Continue_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Continue_type); - if (PyModule_AddObject(m, "expr", astmodulestate_global->expr_type) < 0) { + Py_INCREF(state->Continue_type); + if (PyModule_AddObject(m, "expr", state->expr_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->expr_type); - if (PyModule_AddObject(m, "BoolOp", astmodulestate_global->BoolOp_type) < - 0) { + Py_INCREF(state->expr_type); + if (PyModule_AddObject(m, "BoolOp", state->BoolOp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->BoolOp_type); - if (PyModule_AddObject(m, "NamedExpr", - astmodulestate_global->NamedExpr_type) < 0) { + Py_INCREF(state->BoolOp_type); + if (PyModule_AddObject(m, "NamedExpr", state->NamedExpr_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->NamedExpr_type); - if (PyModule_AddObject(m, "BinOp", astmodulestate_global->BinOp_type) < 0) { + Py_INCREF(state->NamedExpr_type); + if (PyModule_AddObject(m, "BinOp", state->BinOp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->BinOp_type); - if (PyModule_AddObject(m, "UnaryOp", astmodulestate_global->UnaryOp_type) < - 0) { + Py_INCREF(state->BinOp_type); + if (PyModule_AddObject(m, "UnaryOp", state->UnaryOp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->UnaryOp_type); - if (PyModule_AddObject(m, "Lambda", astmodulestate_global->Lambda_type) < - 0) { + Py_INCREF(state->UnaryOp_type); + if (PyModule_AddObject(m, "Lambda", state->Lambda_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Lambda_type); - if (PyModule_AddObject(m, "IfExp", astmodulestate_global->IfExp_type) < 0) { + Py_INCREF(state->Lambda_type); + if (PyModule_AddObject(m, "IfExp", state->IfExp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->IfExp_type); - if (PyModule_AddObject(m, "Dict", astmodulestate_global->Dict_type) < 0) { + Py_INCREF(state->IfExp_type); + if (PyModule_AddObject(m, "Dict", state->Dict_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Dict_type); - if (PyModule_AddObject(m, "Set", astmodulestate_global->Set_type) < 0) { + Py_INCREF(state->Dict_type); + if (PyModule_AddObject(m, "Set", state->Set_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Set_type); - if (PyModule_AddObject(m, "ListComp", astmodulestate_global->ListComp_type) - < 0) { + Py_INCREF(state->Set_type); + if (PyModule_AddObject(m, "ListComp", state->ListComp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->ListComp_type); - if (PyModule_AddObject(m, "SetComp", astmodulestate_global->SetComp_type) < - 0) { + Py_INCREF(state->ListComp_type); + if (PyModule_AddObject(m, "SetComp", state->SetComp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->SetComp_type); - if (PyModule_AddObject(m, "DictComp", astmodulestate_global->DictComp_type) - < 0) { + Py_INCREF(state->SetComp_type); + if (PyModule_AddObject(m, "DictComp", state->DictComp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->DictComp_type); - if (PyModule_AddObject(m, "GeneratorExp", - astmodulestate_global->GeneratorExp_type) < 0) { + Py_INCREF(state->DictComp_type); + if (PyModule_AddObject(m, "GeneratorExp", state->GeneratorExp_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->GeneratorExp_type); - if (PyModule_AddObject(m, "Await", astmodulestate_global->Await_type) < 0) { + Py_INCREF(state->GeneratorExp_type); + if (PyModule_AddObject(m, "Await", state->Await_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Await_type); - if (PyModule_AddObject(m, "Yield", astmodulestate_global->Yield_type) < 0) { + Py_INCREF(state->Await_type); + if (PyModule_AddObject(m, "Yield", state->Yield_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Yield_type); - if (PyModule_AddObject(m, "YieldFrom", - astmodulestate_global->YieldFrom_type) < 0) { + Py_INCREF(state->Yield_type); + if (PyModule_AddObject(m, "YieldFrom", state->YieldFrom_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->YieldFrom_type); - if (PyModule_AddObject(m, "Compare", astmodulestate_global->Compare_type) < - 0) { + Py_INCREF(state->YieldFrom_type); + if (PyModule_AddObject(m, "Compare", state->Compare_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Compare_type); - if (PyModule_AddObject(m, "Call", astmodulestate_global->Call_type) < 0) { + Py_INCREF(state->Compare_type); + if (PyModule_AddObject(m, "Call", state->Call_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Call_type); - if (PyModule_AddObject(m, "FormattedValue", - astmodulestate_global->FormattedValue_type) < 0) { + Py_INCREF(state->Call_type); + if (PyModule_AddObject(m, "FormattedValue", state->FormattedValue_type) < + 0) { goto error; } - Py_INCREF(astmodulestate(m)->FormattedValue_type); - if (PyModule_AddObject(m, "JoinedStr", - astmodulestate_global->JoinedStr_type) < 0) { + Py_INCREF(state->FormattedValue_type); + if (PyModule_AddObject(m, "JoinedStr", state->JoinedStr_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->JoinedStr_type); - if (PyModule_AddObject(m, "Constant", astmodulestate_global->Constant_type) - < 0) { + Py_INCREF(state->JoinedStr_type); + if (PyModule_AddObject(m, "Constant", state->Constant_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Constant_type); - if (PyModule_AddObject(m, "Attribute", - astmodulestate_global->Attribute_type) < 0) { + Py_INCREF(state->Constant_type); + if (PyModule_AddObject(m, "Attribute", state->Attribute_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Attribute_type); - if (PyModule_AddObject(m, "Subscript", - astmodulestate_global->Subscript_type) < 0) { + Py_INCREF(state->Attribute_type); + if (PyModule_AddObject(m, "Subscript", state->Subscript_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Subscript_type); - if (PyModule_AddObject(m, "Starred", astmodulestate_global->Starred_type) < - 0) { + Py_INCREF(state->Subscript_type); + if (PyModule_AddObject(m, "Starred", state->Starred_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Starred_type); - if (PyModule_AddObject(m, "Name", astmodulestate_global->Name_type) < 0) { + Py_INCREF(state->Starred_type); + if (PyModule_AddObject(m, "Name", state->Name_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Name_type); - if (PyModule_AddObject(m, "List", astmodulestate_global->List_type) < 0) { + Py_INCREF(state->Name_type); + if (PyModule_AddObject(m, "List", state->List_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->List_type); - if (PyModule_AddObject(m, "Tuple", astmodulestate_global->Tuple_type) < 0) { + Py_INCREF(state->List_type); + if (PyModule_AddObject(m, "Tuple", state->Tuple_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Tuple_type); - if (PyModule_AddObject(m, "Slice", astmodulestate_global->Slice_type) < 0) { + Py_INCREF(state->Tuple_type); + if (PyModule_AddObject(m, "Slice", state->Slice_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Slice_type); - if (PyModule_AddObject(m, "expr_context", - astmodulestate_global->expr_context_type) < 0) { + Py_INCREF(state->Slice_type); + if (PyModule_AddObject(m, "expr_context", state->expr_context_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->expr_context_type); - if (PyModule_AddObject(m, "Load", astmodulestate_global->Load_type) < 0) { + Py_INCREF(state->expr_context_type); + if (PyModule_AddObject(m, "Load", state->Load_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Load_type); - if (PyModule_AddObject(m, "Store", astmodulestate_global->Store_type) < 0) { + Py_INCREF(state->Load_type); + if (PyModule_AddObject(m, "Store", state->Store_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Store_type); - if (PyModule_AddObject(m, "Del", astmodulestate_global->Del_type) < 0) { + Py_INCREF(state->Store_type); + if (PyModule_AddObject(m, "Del", state->Del_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Del_type); - if (PyModule_AddObject(m, "boolop", astmodulestate_global->boolop_type) < - 0) { + Py_INCREF(state->Del_type); + if (PyModule_AddObject(m, "boolop", state->boolop_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->boolop_type); - if (PyModule_AddObject(m, "And", astmodulestate_global->And_type) < 0) { + Py_INCREF(state->boolop_type); + if (PyModule_AddObject(m, "And", state->And_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->And_type); - if (PyModule_AddObject(m, "Or", astmodulestate_global->Or_type) < 0) { + Py_INCREF(state->And_type); + if (PyModule_AddObject(m, "Or", state->Or_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Or_type); - if (PyModule_AddObject(m, "operator", astmodulestate_global->operator_type) - < 0) { + Py_INCREF(state->Or_type); + if (PyModule_AddObject(m, "operator", state->operator_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->operator_type); - if (PyModule_AddObject(m, "Add", astmodulestate_global->Add_type) < 0) { + Py_INCREF(state->operator_type); + if (PyModule_AddObject(m, "Add", state->Add_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Add_type); - if (PyModule_AddObject(m, "Sub", astmodulestate_global->Sub_type) < 0) { + Py_INCREF(state->Add_type); + if (PyModule_AddObject(m, "Sub", state->Sub_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Sub_type); - if (PyModule_AddObject(m, "Mult", astmodulestate_global->Mult_type) < 0) { + Py_INCREF(state->Sub_type); + if (PyModule_AddObject(m, "Mult", state->Mult_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Mult_type); - if (PyModule_AddObject(m, "MatMult", astmodulestate_global->MatMult_type) < - 0) { + Py_INCREF(state->Mult_type); + if (PyModule_AddObject(m, "MatMult", state->MatMult_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->MatMult_type); - if (PyModule_AddObject(m, "Div", astmodulestate_global->Div_type) < 0) { + Py_INCREF(state->MatMult_type); + if (PyModule_AddObject(m, "Div", state->Div_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Div_type); - if (PyModule_AddObject(m, "Mod", astmodulestate_global->Mod_type) < 0) { + Py_INCREF(state->Div_type); + if (PyModule_AddObject(m, "Mod", state->Mod_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Mod_type); - if (PyModule_AddObject(m, "Pow", astmodulestate_global->Pow_type) < 0) { + Py_INCREF(state->Mod_type); + if (PyModule_AddObject(m, "Pow", state->Pow_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Pow_type); - if (PyModule_AddObject(m, "LShift", astmodulestate_global->LShift_type) < - 0) { + Py_INCREF(state->Pow_type); + if (PyModule_AddObject(m, "LShift", state->LShift_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->LShift_type); - if (PyModule_AddObject(m, "RShift", astmodulestate_global->RShift_type) < - 0) { + Py_INCREF(state->LShift_type); + if (PyModule_AddObject(m, "RShift", state->RShift_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->RShift_type); - if (PyModule_AddObject(m, "BitOr", astmodulestate_global->BitOr_type) < 0) { + Py_INCREF(state->RShift_type); + if (PyModule_AddObject(m, "BitOr", state->BitOr_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->BitOr_type); - if (PyModule_AddObject(m, "BitXor", astmodulestate_global->BitXor_type) < - 0) { + Py_INCREF(state->BitOr_type); + if (PyModule_AddObject(m, "BitXor", state->BitXor_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->BitXor_type); - if (PyModule_AddObject(m, "BitAnd", astmodulestate_global->BitAnd_type) < - 0) { + Py_INCREF(state->BitXor_type); + if (PyModule_AddObject(m, "BitAnd", state->BitAnd_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->BitAnd_type); - if (PyModule_AddObject(m, "FloorDiv", astmodulestate_global->FloorDiv_type) - < 0) { + Py_INCREF(state->BitAnd_type); + if (PyModule_AddObject(m, "FloorDiv", state->FloorDiv_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->FloorDiv_type); - if (PyModule_AddObject(m, "unaryop", astmodulestate_global->unaryop_type) < - 0) { + Py_INCREF(state->FloorDiv_type); + if (PyModule_AddObject(m, "unaryop", state->unaryop_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->unaryop_type); - if (PyModule_AddObject(m, "Invert", astmodulestate_global->Invert_type) < - 0) { + Py_INCREF(state->unaryop_type); + if (PyModule_AddObject(m, "Invert", state->Invert_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Invert_type); - if (PyModule_AddObject(m, "Not", astmodulestate_global->Not_type) < 0) { + Py_INCREF(state->Invert_type); + if (PyModule_AddObject(m, "Not", state->Not_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Not_type); - if (PyModule_AddObject(m, "UAdd", astmodulestate_global->UAdd_type) < 0) { + Py_INCREF(state->Not_type); + if (PyModule_AddObject(m, "UAdd", state->UAdd_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->UAdd_type); - if (PyModule_AddObject(m, "USub", astmodulestate_global->USub_type) < 0) { + Py_INCREF(state->UAdd_type); + if (PyModule_AddObject(m, "USub", state->USub_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->USub_type); - if (PyModule_AddObject(m, "cmpop", astmodulestate_global->cmpop_type) < 0) { + Py_INCREF(state->USub_type); + if (PyModule_AddObject(m, "cmpop", state->cmpop_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->cmpop_type); - if (PyModule_AddObject(m, "Eq", astmodulestate_global->Eq_type) < 0) { + Py_INCREF(state->cmpop_type); + if (PyModule_AddObject(m, "Eq", state->Eq_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Eq_type); - if (PyModule_AddObject(m, "NotEq", astmodulestate_global->NotEq_type) < 0) { + Py_INCREF(state->Eq_type); + if (PyModule_AddObject(m, "NotEq", state->NotEq_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->NotEq_type); - if (PyModule_AddObject(m, "Lt", astmodulestate_global->Lt_type) < 0) { + Py_INCREF(state->NotEq_type); + if (PyModule_AddObject(m, "Lt", state->Lt_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Lt_type); - if (PyModule_AddObject(m, "LtE", astmodulestate_global->LtE_type) < 0) { + Py_INCREF(state->Lt_type); + if (PyModule_AddObject(m, "LtE", state->LtE_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->LtE_type); - if (PyModule_AddObject(m, "Gt", astmodulestate_global->Gt_type) < 0) { + Py_INCREF(state->LtE_type); + if (PyModule_AddObject(m, "Gt", state->Gt_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Gt_type); - if (PyModule_AddObject(m, "GtE", astmodulestate_global->GtE_type) < 0) { + Py_INCREF(state->Gt_type); + if (PyModule_AddObject(m, "GtE", state->GtE_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->GtE_type); - if (PyModule_AddObject(m, "Is", astmodulestate_global->Is_type) < 0) { + Py_INCREF(state->GtE_type); + if (PyModule_AddObject(m, "Is", state->Is_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->Is_type); - if (PyModule_AddObject(m, "IsNot", astmodulestate_global->IsNot_type) < 0) { + Py_INCREF(state->Is_type); + if (PyModule_AddObject(m, "IsNot", state->IsNot_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->IsNot_type); - if (PyModule_AddObject(m, "In", astmodulestate_global->In_type) < 0) { + Py_INCREF(state->IsNot_type); + if (PyModule_AddObject(m, "In", state->In_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->In_type); - if (PyModule_AddObject(m, "NotIn", astmodulestate_global->NotIn_type) < 0) { + Py_INCREF(state->In_type); + if (PyModule_AddObject(m, "NotIn", state->NotIn_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->NotIn_type); - if (PyModule_AddObject(m, "comprehension", - astmodulestate_global->comprehension_type) < 0) { + Py_INCREF(state->NotIn_type); + if (PyModule_AddObject(m, "comprehension", state->comprehension_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->comprehension_type); - if (PyModule_AddObject(m, "excepthandler", - astmodulestate_global->excepthandler_type) < 0) { + Py_INCREF(state->comprehension_type); + if (PyModule_AddObject(m, "excepthandler", state->excepthandler_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->excepthandler_type); - if (PyModule_AddObject(m, "ExceptHandler", - astmodulestate_global->ExceptHandler_type) < 0) { + Py_INCREF(state->excepthandler_type); + if (PyModule_AddObject(m, "ExceptHandler", state->ExceptHandler_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->ExceptHandler_type); - if (PyModule_AddObject(m, "arguments", - astmodulestate_global->arguments_type) < 0) { + Py_INCREF(state->ExceptHandler_type); + if (PyModule_AddObject(m, "arguments", state->arguments_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->arguments_type); - if (PyModule_AddObject(m, "arg", astmodulestate_global->arg_type) < 0) { + Py_INCREF(state->arguments_type); + if (PyModule_AddObject(m, "arg", state->arg_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->arg_type); - if (PyModule_AddObject(m, "keyword", astmodulestate_global->keyword_type) < - 0) { + Py_INCREF(state->arg_type); + if (PyModule_AddObject(m, "keyword", state->keyword_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->keyword_type); - if (PyModule_AddObject(m, "alias", astmodulestate_global->alias_type) < 0) { + Py_INCREF(state->keyword_type); + if (PyModule_AddObject(m, "alias", state->alias_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->alias_type); - if (PyModule_AddObject(m, "withitem", astmodulestate_global->withitem_type) - < 0) { + Py_INCREF(state->alias_type); + if (PyModule_AddObject(m, "withitem", state->withitem_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->withitem_type); - if (PyModule_AddObject(m, "type_ignore", - astmodulestate_global->type_ignore_type) < 0) { + Py_INCREF(state->withitem_type); + if (PyModule_AddObject(m, "type_ignore", state->type_ignore_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->type_ignore_type); - if (PyModule_AddObject(m, "TypeIgnore", - astmodulestate_global->TypeIgnore_type) < 0) { + Py_INCREF(state->type_ignore_type); + if (PyModule_AddObject(m, "TypeIgnore", state->TypeIgnore_type) < 0) { goto error; } - Py_INCREF(astmodulestate(m)->TypeIgnore_type); + Py_INCREF(state->TypeIgnore_type); return m; error: Py_DECREF(m); @@ -10416,13 +10313,13 @@ PyObject* PyAST_mod2obj(mod_ty t) { if (!init_types()) return NULL; - return ast2obj_mod(t); + astmodulestate *state = astmodulestate_global; + return ast2obj_mod(state, t); } /* mode is 0 for "exec", 1 for "eval" and 2 for "single" input */ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) { - PyObject *req_type[3]; const char * const req_name[] = {"Module", "Expression", "Interactive"}; int isinstance; @@ -10430,9 +10327,11 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) return NULL; } - req_type[0] = astmodulestate_global->Module_type; - req_type[1] = astmodulestate_global->Expression_type; - req_type[2] = astmodulestate_global->Interactive_type; + astmodulestate *state = astmodulestate_global; + PyObject *req_type[3]; + req_type[0] = state->Module_type; + req_type[1] = state->Expression_type; + req_type[2] = state->Interactive_type; assert(0 <= mode && mode <= 2); @@ -10449,7 +10348,7 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) } mod_ty res = NULL; - if (obj2ast_mod(ast, &res, arena) != 0) + if (obj2ast_mod(state, ast, &res, arena) != 0) return NULL; else return res; @@ -10459,7 +10358,8 @@ int PyAST_Check(PyObject* obj) { if (!init_types()) return -1; - return PyObject_IsInstance(obj, astmodulestate_global->AST_type); + astmodulestate *state = astmodulestate_global; + return PyObject_IsInstance(obj, state->AST_type); } From webhook-mailer at python.org Fri Jul 3 08:16:04 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Jul 2020 12:16:04 -0000 Subject: [Python-checkins] bpo-41194: The _ast module cannot be loaded more than once (GH-21290) Message-ID: https://github.com/python/cpython/commit/91e1bc18bd467a13bceb62e16fbc435b33381c82 commit: 91e1bc18bd467a13bceb62e16fbc435b33381c82 branch: master author: Victor Stinner committer: GitHub date: 2020-07-03T14:15:53+02:00 summary: bpo-41194: The _ast module cannot be loaded more than once (GH-21290) Fix a crash in the _ast module: it can no longer be loaded more than once. It now uses a global state rather than a module state. * Move _ast module state: use a global state instead. * Set _astmodule.m_size to -1, so the extension cannot be loaded more than once. files: A Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst M Parser/asdl_c.py M Python/Python-ast.c diff --git a/Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst b/Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst new file mode 100644 index 0000000000000..d63a0e5222ba9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-03-13-15-08.bpo-41194.djrKjs.rst @@ -0,0 +1,2 @@ +Fix a crash in the ``_ast`` module: it can no longer be loaded more than once. +It now uses a global state rather than a module state. diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 39e216b8192b1..f029ca6618f93 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -691,7 +691,7 @@ def visitModule(self, mod): Py_ssize_t i, numfields = 0; int res = -1; PyObject *key, *value, *fields; - astmodulestate *state = astmodulestate_global; + astmodulestate *state = get_global_ast_state(); if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } @@ -760,7 +760,7 @@ def visitModule(self, mod): static PyObject * ast_type_reduce(PyObject *self, PyObject *unused) { - astmodulestate *state = astmodulestate_global; + astmodulestate *state = get_global_ast_state(); PyObject *dict; if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; @@ -971,19 +971,7 @@ def visitModule(self, mod): self.emit("static int init_types(void)",0) self.emit("{", 0) - self.emit("PyObject *module = PyState_FindModule(&_astmodule);", 1) - self.emit("if (module == NULL) {", 1) - self.emit("module = PyModule_Create(&_astmodule);", 2) - self.emit("if (!module) {", 2) - self.emit("return 0;", 3) - self.emit("}", 2) - self.emit("if (PyState_AddModule(module, &_astmodule) < 0) {", 2) - self.emit("return 0;", 3) - self.emit("}", 2) - self.emit("}", 1) - self.emit("", 0) - - self.emit("astmodulestate *state = get_ast_state(module);", 1) + self.emit("astmodulestate *state = get_global_ast_state();", 1) self.emit("if (state->initialized) return 1;", 1) self.emit("if (init_identifiers(state) < 0) return 0;", 1) self.emit("state->AST_type = PyType_FromSpec(&AST_type_spec);", 1) @@ -1061,13 +1049,16 @@ def visitModule(self, mod): self.emit("PyMODINIT_FUNC", 0) self.emit("PyInit__ast(void)", 0) self.emit("{", 0) - self.emit("PyObject *m;", 1) - self.emit("if (!init_types()) return NULL;", 1) - self.emit('m = PyState_FindModule(&_astmodule);', 1) - self.emit("if (!m) return NULL;", 1) + self.emit("PyObject *m = PyModule_Create(&_astmodule);", 1) + self.emit("if (!m) {", 1) + self.emit("return NULL;", 2) + self.emit("}", 1) self.emit('astmodulestate *state = get_ast_state(m);', 1) self.emit('', 1) + self.emit("if (!init_types()) {", 1) + self.emit("goto error;", 2) + self.emit("}", 1) self.emit('if (PyModule_AddObject(m, "AST", state->AST_type) < 0) {', 1) self.emit('goto error;', 2) self.emit('}', 1) @@ -1084,6 +1075,7 @@ def visitModule(self, mod): for dfn in mod.dfns: self.visit(dfn) self.emit("return m;", 1) + self.emit("", 0) self.emit("error:", 0) self.emit("Py_DECREF(m);", 1) self.emit("return NULL;", 1) @@ -1263,9 +1255,11 @@ class PartingShots(StaticVisitor): CODE = """ PyObject* PyAST_mod2obj(mod_ty t) { - if (!init_types()) + if (!init_types()) { return NULL; - astmodulestate *state = astmodulestate_global; + } + + astmodulestate *state = get_global_ast_state(); return ast2obj_mod(state, t); } @@ -1279,7 +1273,7 @@ class PartingShots(StaticVisitor): return NULL; } - astmodulestate *state = astmodulestate_global; + astmodulestate *state = get_global_ast_state(); PyObject *req_type[3]; req_type[0] = state->Module_type; req_type[1] = state->Expression_type; @@ -1287,8 +1281,9 @@ class PartingShots(StaticVisitor): assert(0 <= mode && mode <= 2); - if (!init_types()) + if (!init_types()) { return NULL; + } isinstance = PyObject_IsInstance(ast, req_type[mode]); if (isinstance == -1) @@ -1308,9 +1303,11 @@ class PartingShots(StaticVisitor): int PyAST_Check(PyObject* obj) { - if (!init_types()) + if (!init_types()) { return -1; - astmodulestate *state = astmodulestate_global; + } + + astmodulestate *state = get_global_ast_state(); return PyObject_IsInstance(obj, state->AST_type); } """ @@ -1361,13 +1358,12 @@ def generate_module_def(f, mod): f.write(' PyObject *' + s + ';\n') f.write('} astmodulestate;\n\n') f.write(""" +static astmodulestate global_ast_state; + static astmodulestate * -get_ast_state(PyObject *module) +get_ast_state(PyObject *Py_UNUSED(module)) { - assert(module != NULL); - void *state = PyModule_GetState(module); - assert(state != NULL); - return (astmodulestate *)state; + return &global_ast_state; } static int astmodule_clear(PyObject *module) @@ -1396,17 +1392,14 @@ def generate_module_def(f, mod): static struct PyModuleDef _astmodule = { PyModuleDef_HEAD_INIT, - "_ast", - NULL, - sizeof(astmodulestate), - NULL, - NULL, - astmodule_traverse, - astmodule_clear, - astmodule_free, + .m_name = "_ast", + .m_size = -1, + .m_traverse = astmodule_traverse, + .m_clear = astmodule_clear, + .m_free = astmodule_free, }; -#define astmodulestate_global get_ast_state(PyState_FindModule(&_astmodule)) +#define get_global_ast_state() (&global_ast_state) """) f.write('static int init_identifiers(astmodulestate *state)\n') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 3296b067584d0..844033ee37e28 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -224,13 +224,12 @@ typedef struct { } astmodulestate; +static astmodulestate global_ast_state; + static astmodulestate * -get_ast_state(PyObject *module) +get_ast_state(PyObject *Py_UNUSED(module)) { - assert(module != NULL); - void *state = PyModule_GetState(module); - assert(state != NULL); - return (astmodulestate *)state; + return &global_ast_state; } static int astmodule_clear(PyObject *module) @@ -679,17 +678,14 @@ static void astmodule_free(void* module) { static struct PyModuleDef _astmodule = { PyModuleDef_HEAD_INIT, - "_ast", - NULL, - sizeof(astmodulestate), - NULL, - NULL, - astmodule_traverse, - astmodule_clear, - astmodule_free, + .m_name = "_ast", + .m_size = -1, + .m_traverse = astmodule_traverse, + .m_clear = astmodule_clear, + .m_free = astmodule_free, }; -#define astmodulestate_global get_ast_state(PyState_FindModule(&_astmodule)) +#define get_global_ast_state() (&global_ast_state) static int init_identifiers(astmodulestate *state) { @@ -1135,7 +1131,7 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) Py_ssize_t i, numfields = 0; int res = -1; PyObject *key, *value, *fields; - astmodulestate *state = astmodulestate_global; + astmodulestate *state = get_global_ast_state(); if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } @@ -1204,7 +1200,7 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) static PyObject * ast_type_reduce(PyObject *self, PyObject *unused) { - astmodulestate *state = astmodulestate_global; + astmodulestate *state = get_global_ast_state(); PyObject *dict; if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; @@ -1414,18 +1410,7 @@ static int add_ast_fields(astmodulestate *state) static int init_types(void) { - PyObject *module = PyState_FindModule(&_astmodule); - if (module == NULL) { - module = PyModule_Create(&_astmodule); - if (!module) { - return 0; - } - if (PyState_AddModule(module, &_astmodule) < 0) { - return 0; - } - } - - astmodulestate *state = get_ast_state(module); + astmodulestate *state = get_global_ast_state(); if (state->initialized) return 1; if (init_identifiers(state) < 0) return 0; state->AST_type = PyType_FromSpec(&AST_type_spec); @@ -9857,12 +9842,15 @@ obj2ast_type_ignore(astmodulestate *state, PyObject* obj, type_ignore_ty* out, PyMODINIT_FUNC PyInit__ast(void) { - PyObject *m; - if (!init_types()) return NULL; - m = PyState_FindModule(&_astmodule); - if (!m) return NULL; + PyObject *m = PyModule_Create(&_astmodule); + if (!m) { + return NULL; + } astmodulestate *state = get_ast_state(m); + if (!init_types()) { + goto error; + } if (PyModule_AddObject(m, "AST", state->AST_type) < 0) { goto error; } @@ -10303,6 +10291,7 @@ PyInit__ast(void) } Py_INCREF(state->TypeIgnore_type); return m; + error: Py_DECREF(m); return NULL; @@ -10311,9 +10300,11 @@ PyInit__ast(void) PyObject* PyAST_mod2obj(mod_ty t) { - if (!init_types()) + if (!init_types()) { return NULL; - astmodulestate *state = astmodulestate_global; + } + + astmodulestate *state = get_global_ast_state(); return ast2obj_mod(state, t); } @@ -10327,7 +10318,7 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) return NULL; } - astmodulestate *state = astmodulestate_global; + astmodulestate *state = get_global_ast_state(); PyObject *req_type[3]; req_type[0] = state->Module_type; req_type[1] = state->Expression_type; @@ -10335,8 +10326,9 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) assert(0 <= mode && mode <= 2); - if (!init_types()) + if (!init_types()) { return NULL; + } isinstance = PyObject_IsInstance(ast, req_type[mode]); if (isinstance == -1) @@ -10356,9 +10348,11 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) int PyAST_Check(PyObject* obj) { - if (!init_types()) + if (!init_types()) { return -1; - astmodulestate *state = astmodulestate_global; + } + + astmodulestate *state = get_global_ast_state(); return PyObject_IsInstance(obj, state->AST_type); } From webhook-mailer at python.org Fri Jul 3 10:59:22 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Jul 2020 14:59:22 -0000 Subject: [Python-checkins] bpo-1635741: Fix unicode_dealloc() for mortal interned string (GH-21270) Message-ID: https://github.com/python/cpython/commit/3549ca313a6103a3adb281ef3a849298b7d7f72c commit: 3549ca313a6103a3adb281ef3a849298b7d7f72c branch: master author: Victor Stinner committer: GitHub date: 2020-07-03T16:59:12+02:00 summary: bpo-1635741: Fix unicode_dealloc() for mortal interned string (GH-21270) When unicode_dealloc() is called on a mortal interned string, the string reference counter is now reset at zero. files: M Objects/unicodeobject.c diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 37e7fe5c0eff2..ca68c57534b22 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1943,13 +1943,20 @@ unicode_dealloc(PyObject *unicode) break; case SSTATE_INTERNED_MORTAL: - /* revive dead object temporarily for DelItem */ - Py_SET_REFCNT(unicode, 3); #ifdef INTERNED_STRINGS + /* Revive the dead object temporarily. PyDict_DelItem() removes two + references (key and value) which were ignored by + PyUnicode_InternInPlace(). Use refcnt=3 rather than refcnt=2 + to prevent calling unicode_dealloc() again. Adjust refcnt after + PyDict_DelItem(). */ + assert(Py_REFCNT(unicode) == 0); + Py_SET_REFCNT(unicode, 3); if (PyDict_DelItem(interned, unicode) != 0) { _PyErr_WriteUnraisableMsg("deletion of interned string failed", NULL); } + assert(Py_REFCNT(unicode) == 1); + Py_SET_REFCNT(unicode, 0); #endif break; @@ -15710,8 +15717,9 @@ PyUnicode_InternInPlace(PyObject **p) return; } - /* The two references in interned are not counted by refcnt. - The deallocator will take care of this */ + /* The two references in interned dict (key and value) are not counted by + refcnt. unicode_dealloc() and _PyUnicode_ClearInterned() take care of + this. */ Py_SET_REFCNT(s, Py_REFCNT(s) - 2); _PyUnicode_STATE(s).interned = SSTATE_INTERNED_MORTAL; #endif @@ -15780,6 +15788,8 @@ _PyUnicode_ClearInterned(PyThreadState *tstate) #endif break; case SSTATE_INTERNED_MORTAL: + // Restore the two references (key and value) ignored + // by PyUnicode_InternInPlace(). Py_SET_REFCNT(s, Py_REFCNT(s) + 2); #ifdef INTERNED_STATS mortal_size += PyUnicode_GET_LENGTH(s); From webhook-mailer at python.org Fri Jul 3 12:36:56 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Fri, 03 Jul 2020 16:36:56 -0000 Subject: [Python-checkins] bpo-1635741: Port faulthandler module to multiphase initialization (GH-21294) Message-ID: https://github.com/python/cpython/commit/c0b214bc08f0da89e5b2e4b8cc9f07783833d6b8 commit: c0b214bc08f0da89e5b2e4b8cc9f07783833d6b8 branch: master author: Dong-hee Na committer: GitHub date: 2020-07-04T01:36:47+09:00 summary: bpo-1635741: Port faulthandler module to multiphase initialization (GH-21294) files: A Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst M Modules/faulthandler.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst new file mode 100644 index 0000000000000..927c8e5b7083f --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-03-23-10-02.bpo-1635741.F5coWe.rst @@ -0,0 +1 @@ +Port :mod:`faulthandler` to multiphase initialization. diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index e7a285033051d..67fe1ca9ffffd 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -1291,59 +1291,55 @@ static PyMethodDef module_methods[] = { {NULL, NULL} /* sentinel */ }; -static struct PyModuleDef module_def = { - PyModuleDef_HEAD_INIT, - "faulthandler", - module_doc, - 0, /* non-negative size to be able to unload the module */ - module_methods, - NULL, - faulthandler_traverse, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit_faulthandler(void) -{ - PyObject *m = PyModule_Create(&module_def); - if (m == NULL) - return NULL; - +static int +PyExec_faulthandler(PyObject *module) { /* Add constants for unit tests */ #ifdef MS_WINDOWS /* RaiseException() codes (prefixed by an underscore) */ - if (PyModule_AddIntConstant(m, "_EXCEPTION_ACCESS_VIOLATION", + if (PyModule_AddIntConstant(module, "_EXCEPTION_ACCESS_VIOLATION", EXCEPTION_ACCESS_VIOLATION)) { - goto error; + return -1; } - if (PyModule_AddIntConstant(m, "_EXCEPTION_INT_DIVIDE_BY_ZERO", + if (PyModule_AddIntConstant(module, "_EXCEPTION_INT_DIVIDE_BY_ZERO", EXCEPTION_INT_DIVIDE_BY_ZERO)) { - goto error; + return -1; } - if (PyModule_AddIntConstant(m, "_EXCEPTION_STACK_OVERFLOW", + if (PyModule_AddIntConstant(module, "_EXCEPTION_STACK_OVERFLOW", EXCEPTION_STACK_OVERFLOW)) { - goto error; + return -1; } /* RaiseException() flags (prefixed by an underscore) */ - if (PyModule_AddIntConstant(m, "_EXCEPTION_NONCONTINUABLE", + if (PyModule_AddIntConstant(module, "_EXCEPTION_NONCONTINUABLE", EXCEPTION_NONCONTINUABLE)) { - goto error; + return -1; } - if (PyModule_AddIntConstant(m, "_EXCEPTION_NONCONTINUABLE_EXCEPTION", + if (PyModule_AddIntConstant(module, "_EXCEPTION_NONCONTINUABLE_EXCEPTION", EXCEPTION_NONCONTINUABLE_EXCEPTION)) { - goto error; + return -1; } #endif + return 0; +} - return m; +static PyModuleDef_Slot faulthandler_slots[] = { + {Py_mod_exec, PyExec_faulthandler}, + {0, NULL} +}; -#ifdef MS_WINDOWS -error: - Py_DECREF(m); - return NULL; -#endif +static struct PyModuleDef module_def = { + PyModuleDef_HEAD_INIT, + .m_name = "faulthandler", + .m_doc = module_doc, + .m_methods = module_methods, + .m_traverse = faulthandler_traverse, + .m_slots = faulthandler_slots +}; + +PyMODINIT_FUNC +PyInit_faulthandler(void) +{ + return PyModuleDef_Init(&module_def); } static int From webhook-mailer at python.org Fri Jul 3 14:01:54 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Jul 2020 18:01:54 -0000 Subject: [Python-checkins] bpo-41194: Convert _ast extension to PEP 489 (GH-21293) Message-ID: https://github.com/python/cpython/commit/b1cc6ba73a51d5cc3aeb113b5e7378fb50a0e20a commit: b1cc6ba73a51d5cc3aeb113b5e7378fb50a0e20a branch: master author: Victor Stinner committer: GitHub date: 2020-07-03T20:01:46+02:00 summary: bpo-41194: Convert _ast extension to PEP 489 (GH-21293) Convert the _ast extension module to PEP 489 "Multiphase initialization". Replace the global _ast state with a module state. files: M Parser/asdl_c.py M Python/Python-ast.c diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index f029ca6618f93..b93906ba8d45d 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -692,6 +692,9 @@ def visitModule(self, mod): int res = -1; PyObject *key, *value, *fields; astmodulestate *state = get_global_ast_state(); + if (state == NULL) { + goto cleanup; + } if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } @@ -761,6 +764,10 @@ def visitModule(self, mod): ast_type_reduce(PyObject *self, PyObject *unused) { astmodulestate *state = get_global_ast_state(); + if (state == NULL) { + return NULL; + } + PyObject *dict; if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; @@ -969,9 +976,8 @@ def visitModule(self, mod): """, 0, reflow=False) - self.emit("static int init_types(void)",0) + self.emit("static int init_types(astmodulestate *state)",0) self.emit("{", 0) - self.emit("astmodulestate *state = get_global_ast_state();", 1) self.emit("if (state->initialized) return 1;", 1) self.emit("if (init_identifiers(state) < 0) return 0;", 1) self.emit("state->AST_type = PyType_FromSpec(&AST_type_spec);", 1) @@ -1046,40 +1052,55 @@ def emit_defaults(self, name, fields, depth): class ASTModuleVisitor(PickleVisitor): def visitModule(self, mod): - self.emit("PyMODINIT_FUNC", 0) - self.emit("PyInit__ast(void)", 0) + self.emit("static int", 0) + self.emit("astmodule_exec(PyObject *m)", 0) self.emit("{", 0) - self.emit("PyObject *m = PyModule_Create(&_astmodule);", 1) - self.emit("if (!m) {", 1) - self.emit("return NULL;", 2) - self.emit("}", 1) self.emit('astmodulestate *state = get_ast_state(m);', 1) - self.emit('', 1) + self.emit("", 0) - self.emit("if (!init_types()) {", 1) - self.emit("goto error;", 2) + self.emit("if (!init_types(state)) {", 1) + self.emit("return -1;", 2) self.emit("}", 1) self.emit('if (PyModule_AddObject(m, "AST", state->AST_type) < 0) {', 1) - self.emit('goto error;', 2) + self.emit('return -1;', 2) self.emit('}', 1) self.emit('Py_INCREF(state->AST_type);', 1) self.emit('if (PyModule_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0) {', 1) - self.emit("goto error;", 2) + self.emit("return -1;", 2) self.emit('}', 1) self.emit('if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0) {', 1) - self.emit("goto error;", 2) + self.emit("return -1;", 2) self.emit('}', 1) self.emit('if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0) {', 1) - self.emit("goto error;", 2) + self.emit("return -1;", 2) self.emit('}', 1) for dfn in mod.dfns: self.visit(dfn) - self.emit("return m;", 1) - self.emit("", 0) - self.emit("error:", 0) - self.emit("Py_DECREF(m);", 1) - self.emit("return NULL;", 1) + self.emit("return 0;", 1) self.emit("}", 0) + self.emit("", 0) + self.emit(""" +static PyModuleDef_Slot astmodule_slots[] = { + {Py_mod_exec, astmodule_exec}, + {0, NULL} +}; + +static struct PyModuleDef _astmodule = { + PyModuleDef_HEAD_INIT, + .m_name = "_ast", + .m_size = sizeof(astmodulestate), + .m_slots = astmodule_slots, + .m_traverse = astmodule_traverse, + .m_clear = astmodule_clear, + .m_free = astmodule_free, +}; + +PyMODINIT_FUNC +PyInit__ast(void) +{ + return PyModuleDef_Init(&_astmodule); +} +""".strip(), 0, reflow=False) def visitProduct(self, prod, name): self.addObj(name) @@ -1095,7 +1116,7 @@ def visitConstructor(self, cons, name): def addObj(self, name): self.emit("if (PyModule_AddObject(m, \"%s\", " "state->%s_type) < 0) {" % (name, name), 1) - self.emit("goto error;", 2) + self.emit("return -1;", 2) self.emit('}', 1) self.emit("Py_INCREF(state->%s_type);" % name, 1) @@ -1255,11 +1276,10 @@ class PartingShots(StaticVisitor): CODE = """ PyObject* PyAST_mod2obj(mod_ty t) { - if (!init_types()) { + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { return NULL; } - - astmodulestate *state = get_global_ast_state(); return ast2obj_mod(state, t); } @@ -1281,10 +1301,6 @@ class PartingShots(StaticVisitor): assert(0 <= mode && mode <= 2); - if (!init_types()) { - return NULL; - } - isinstance = PyObject_IsInstance(ast, req_type[mode]); if (isinstance == -1) return NULL; @@ -1303,11 +1319,10 @@ class PartingShots(StaticVisitor): int PyAST_Check(PyObject* obj) { - if (!init_types()) { + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { return -1; } - - astmodulestate *state = get_global_ast_state(); return PyObject_IsInstance(obj, state->AST_type); } """ @@ -1358,12 +1373,35 @@ def generate_module_def(f, mod): f.write(' PyObject *' + s + ';\n') f.write('} astmodulestate;\n\n') f.write(""" -static astmodulestate global_ast_state; +static astmodulestate* +get_ast_state(PyObject *module) +{ + void *state = PyModule_GetState(module); + assert(state != NULL); + return (astmodulestate*)state; +} -static astmodulestate * -get_ast_state(PyObject *Py_UNUSED(module)) +static astmodulestate* +get_global_ast_state(void) { - return &global_ast_state; + _Py_IDENTIFIER(_ast); + PyObject *name = _PyUnicode_FromId(&PyId__ast); // borrowed reference + if (name == NULL) { + return NULL; + } + PyObject *module = PyImport_GetModule(name); + if (module == NULL) { + if (PyErr_Occurred()) { + return NULL; + } + module = PyImport_Import(name); + if (module == NULL) { + return NULL; + } + } + astmodulestate *state = get_ast_state(module); + Py_DECREF(module); + return state; } static int astmodule_clear(PyObject *module) @@ -1390,17 +1428,6 @@ def generate_module_def(f, mod): astmodule_clear((PyObject*)module); } -static struct PyModuleDef _astmodule = { - PyModuleDef_HEAD_INIT, - .m_name = "_ast", - .m_size = -1, - .m_traverse = astmodule_traverse, - .m_clear = astmodule_clear, - .m_free = astmodule_free, -}; - -#define get_global_ast_state() (&global_ast_state) - """) f.write('static int init_identifiers(astmodulestate *state)\n') f.write('{\n') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 844033ee37e28..b81b282a03965 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -224,12 +224,35 @@ typedef struct { } astmodulestate; -static astmodulestate global_ast_state; +static astmodulestate* +get_ast_state(PyObject *module) +{ + void *state = PyModule_GetState(module); + assert(state != NULL); + return (astmodulestate*)state; +} -static astmodulestate * -get_ast_state(PyObject *Py_UNUSED(module)) +static astmodulestate* +get_global_ast_state(void) { - return &global_ast_state; + _Py_IDENTIFIER(_ast); + PyObject *name = _PyUnicode_FromId(&PyId__ast); // borrowed reference + if (name == NULL) { + return NULL; + } + PyObject *module = PyImport_GetModule(name); + if (module == NULL) { + if (PyErr_Occurred()) { + return NULL; + } + module = PyImport_Import(name); + if (module == NULL) { + return NULL; + } + } + astmodulestate *state = get_ast_state(module); + Py_DECREF(module); + return state; } static int astmodule_clear(PyObject *module) @@ -676,17 +699,6 @@ static void astmodule_free(void* module) { astmodule_clear((PyObject*)module); } -static struct PyModuleDef _astmodule = { - PyModuleDef_HEAD_INIT, - .m_name = "_ast", - .m_size = -1, - .m_traverse = astmodule_traverse, - .m_clear = astmodule_clear, - .m_free = astmodule_free, -}; - -#define get_global_ast_state() (&global_ast_state) - static int init_identifiers(astmodulestate *state) { if ((state->__dict__ = PyUnicode_InternFromString("__dict__")) == NULL) return 0; @@ -1132,6 +1144,9 @@ ast_type_init(PyObject *self, PyObject *args, PyObject *kw) int res = -1; PyObject *key, *value, *fields; astmodulestate *state = get_global_ast_state(); + if (state == NULL) { + goto cleanup; + } if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } @@ -1201,6 +1216,10 @@ static PyObject * ast_type_reduce(PyObject *self, PyObject *unused) { astmodulestate *state = get_global_ast_state(); + if (state == NULL) { + return NULL; + } + PyObject *dict; if (_PyObject_LookupAttr(self, state->__dict__, &dict) < 0) { return NULL; @@ -1408,9 +1427,8 @@ static int add_ast_fields(astmodulestate *state) } -static int init_types(void) +static int init_types(astmodulestate *state) { - astmodulestate *state = get_global_ast_state(); if (state->initialized) return 1; if (init_identifiers(state) < 0) return 0; state->AST_type = PyType_FromSpec(&AST_type_spec); @@ -9839,472 +9857,484 @@ obj2ast_type_ignore(astmodulestate *state, PyObject* obj, type_ignore_ty* out, } -PyMODINIT_FUNC -PyInit__ast(void) +static int +astmodule_exec(PyObject *m) { - PyObject *m = PyModule_Create(&_astmodule); - if (!m) { - return NULL; - } astmodulestate *state = get_ast_state(m); - if (!init_types()) { - goto error; + if (!init_types(state)) { + return -1; } if (PyModule_AddObject(m, "AST", state->AST_type) < 0) { - goto error; + return -1; } Py_INCREF(state->AST_type); if (PyModule_AddIntMacro(m, PyCF_ALLOW_TOP_LEVEL_AWAIT) < 0) { - goto error; + return -1; } if (PyModule_AddIntMacro(m, PyCF_ONLY_AST) < 0) { - goto error; + return -1; } if (PyModule_AddIntMacro(m, PyCF_TYPE_COMMENTS) < 0) { - goto error; + return -1; } if (PyModule_AddObject(m, "mod", state->mod_type) < 0) { - goto error; + return -1; } Py_INCREF(state->mod_type); if (PyModule_AddObject(m, "Module", state->Module_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Module_type); if (PyModule_AddObject(m, "Interactive", state->Interactive_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Interactive_type); if (PyModule_AddObject(m, "Expression", state->Expression_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Expression_type); if (PyModule_AddObject(m, "FunctionType", state->FunctionType_type) < 0) { - goto error; + return -1; } Py_INCREF(state->FunctionType_type); if (PyModule_AddObject(m, "stmt", state->stmt_type) < 0) { - goto error; + return -1; } Py_INCREF(state->stmt_type); if (PyModule_AddObject(m, "FunctionDef", state->FunctionDef_type) < 0) { - goto error; + return -1; } Py_INCREF(state->FunctionDef_type); if (PyModule_AddObject(m, "AsyncFunctionDef", state->AsyncFunctionDef_type) < 0) { - goto error; + return -1; } Py_INCREF(state->AsyncFunctionDef_type); if (PyModule_AddObject(m, "ClassDef", state->ClassDef_type) < 0) { - goto error; + return -1; } Py_INCREF(state->ClassDef_type); if (PyModule_AddObject(m, "Return", state->Return_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Return_type); if (PyModule_AddObject(m, "Delete", state->Delete_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Delete_type); if (PyModule_AddObject(m, "Assign", state->Assign_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Assign_type); if (PyModule_AddObject(m, "AugAssign", state->AugAssign_type) < 0) { - goto error; + return -1; } Py_INCREF(state->AugAssign_type); if (PyModule_AddObject(m, "AnnAssign", state->AnnAssign_type) < 0) { - goto error; + return -1; } Py_INCREF(state->AnnAssign_type); if (PyModule_AddObject(m, "For", state->For_type) < 0) { - goto error; + return -1; } Py_INCREF(state->For_type); if (PyModule_AddObject(m, "AsyncFor", state->AsyncFor_type) < 0) { - goto error; + return -1; } Py_INCREF(state->AsyncFor_type); if (PyModule_AddObject(m, "While", state->While_type) < 0) { - goto error; + return -1; } Py_INCREF(state->While_type); if (PyModule_AddObject(m, "If", state->If_type) < 0) { - goto error; + return -1; } Py_INCREF(state->If_type); if (PyModule_AddObject(m, "With", state->With_type) < 0) { - goto error; + return -1; } Py_INCREF(state->With_type); if (PyModule_AddObject(m, "AsyncWith", state->AsyncWith_type) < 0) { - goto error; + return -1; } Py_INCREF(state->AsyncWith_type); if (PyModule_AddObject(m, "Raise", state->Raise_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Raise_type); if (PyModule_AddObject(m, "Try", state->Try_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Try_type); if (PyModule_AddObject(m, "Assert", state->Assert_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Assert_type); if (PyModule_AddObject(m, "Import", state->Import_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Import_type); if (PyModule_AddObject(m, "ImportFrom", state->ImportFrom_type) < 0) { - goto error; + return -1; } Py_INCREF(state->ImportFrom_type); if (PyModule_AddObject(m, "Global", state->Global_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Global_type); if (PyModule_AddObject(m, "Nonlocal", state->Nonlocal_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Nonlocal_type); if (PyModule_AddObject(m, "Expr", state->Expr_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Expr_type); if (PyModule_AddObject(m, "Pass", state->Pass_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Pass_type); if (PyModule_AddObject(m, "Break", state->Break_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Break_type); if (PyModule_AddObject(m, "Continue", state->Continue_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Continue_type); if (PyModule_AddObject(m, "expr", state->expr_type) < 0) { - goto error; + return -1; } Py_INCREF(state->expr_type); if (PyModule_AddObject(m, "BoolOp", state->BoolOp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->BoolOp_type); if (PyModule_AddObject(m, "NamedExpr", state->NamedExpr_type) < 0) { - goto error; + return -1; } Py_INCREF(state->NamedExpr_type); if (PyModule_AddObject(m, "BinOp", state->BinOp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->BinOp_type); if (PyModule_AddObject(m, "UnaryOp", state->UnaryOp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->UnaryOp_type); if (PyModule_AddObject(m, "Lambda", state->Lambda_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Lambda_type); if (PyModule_AddObject(m, "IfExp", state->IfExp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->IfExp_type); if (PyModule_AddObject(m, "Dict", state->Dict_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Dict_type); if (PyModule_AddObject(m, "Set", state->Set_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Set_type); if (PyModule_AddObject(m, "ListComp", state->ListComp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->ListComp_type); if (PyModule_AddObject(m, "SetComp", state->SetComp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->SetComp_type); if (PyModule_AddObject(m, "DictComp", state->DictComp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->DictComp_type); if (PyModule_AddObject(m, "GeneratorExp", state->GeneratorExp_type) < 0) { - goto error; + return -1; } Py_INCREF(state->GeneratorExp_type); if (PyModule_AddObject(m, "Await", state->Await_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Await_type); if (PyModule_AddObject(m, "Yield", state->Yield_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Yield_type); if (PyModule_AddObject(m, "YieldFrom", state->YieldFrom_type) < 0) { - goto error; + return -1; } Py_INCREF(state->YieldFrom_type); if (PyModule_AddObject(m, "Compare", state->Compare_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Compare_type); if (PyModule_AddObject(m, "Call", state->Call_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Call_type); if (PyModule_AddObject(m, "FormattedValue", state->FormattedValue_type) < 0) { - goto error; + return -1; } Py_INCREF(state->FormattedValue_type); if (PyModule_AddObject(m, "JoinedStr", state->JoinedStr_type) < 0) { - goto error; + return -1; } Py_INCREF(state->JoinedStr_type); if (PyModule_AddObject(m, "Constant", state->Constant_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Constant_type); if (PyModule_AddObject(m, "Attribute", state->Attribute_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Attribute_type); if (PyModule_AddObject(m, "Subscript", state->Subscript_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Subscript_type); if (PyModule_AddObject(m, "Starred", state->Starred_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Starred_type); if (PyModule_AddObject(m, "Name", state->Name_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Name_type); if (PyModule_AddObject(m, "List", state->List_type) < 0) { - goto error; + return -1; } Py_INCREF(state->List_type); if (PyModule_AddObject(m, "Tuple", state->Tuple_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Tuple_type); if (PyModule_AddObject(m, "Slice", state->Slice_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Slice_type); if (PyModule_AddObject(m, "expr_context", state->expr_context_type) < 0) { - goto error; + return -1; } Py_INCREF(state->expr_context_type); if (PyModule_AddObject(m, "Load", state->Load_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Load_type); if (PyModule_AddObject(m, "Store", state->Store_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Store_type); if (PyModule_AddObject(m, "Del", state->Del_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Del_type); if (PyModule_AddObject(m, "boolop", state->boolop_type) < 0) { - goto error; + return -1; } Py_INCREF(state->boolop_type); if (PyModule_AddObject(m, "And", state->And_type) < 0) { - goto error; + return -1; } Py_INCREF(state->And_type); if (PyModule_AddObject(m, "Or", state->Or_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Or_type); if (PyModule_AddObject(m, "operator", state->operator_type) < 0) { - goto error; + return -1; } Py_INCREF(state->operator_type); if (PyModule_AddObject(m, "Add", state->Add_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Add_type); if (PyModule_AddObject(m, "Sub", state->Sub_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Sub_type); if (PyModule_AddObject(m, "Mult", state->Mult_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Mult_type); if (PyModule_AddObject(m, "MatMult", state->MatMult_type) < 0) { - goto error; + return -1; } Py_INCREF(state->MatMult_type); if (PyModule_AddObject(m, "Div", state->Div_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Div_type); if (PyModule_AddObject(m, "Mod", state->Mod_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Mod_type); if (PyModule_AddObject(m, "Pow", state->Pow_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Pow_type); if (PyModule_AddObject(m, "LShift", state->LShift_type) < 0) { - goto error; + return -1; } Py_INCREF(state->LShift_type); if (PyModule_AddObject(m, "RShift", state->RShift_type) < 0) { - goto error; + return -1; } Py_INCREF(state->RShift_type); if (PyModule_AddObject(m, "BitOr", state->BitOr_type) < 0) { - goto error; + return -1; } Py_INCREF(state->BitOr_type); if (PyModule_AddObject(m, "BitXor", state->BitXor_type) < 0) { - goto error; + return -1; } Py_INCREF(state->BitXor_type); if (PyModule_AddObject(m, "BitAnd", state->BitAnd_type) < 0) { - goto error; + return -1; } Py_INCREF(state->BitAnd_type); if (PyModule_AddObject(m, "FloorDiv", state->FloorDiv_type) < 0) { - goto error; + return -1; } Py_INCREF(state->FloorDiv_type); if (PyModule_AddObject(m, "unaryop", state->unaryop_type) < 0) { - goto error; + return -1; } Py_INCREF(state->unaryop_type); if (PyModule_AddObject(m, "Invert", state->Invert_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Invert_type); if (PyModule_AddObject(m, "Not", state->Not_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Not_type); if (PyModule_AddObject(m, "UAdd", state->UAdd_type) < 0) { - goto error; + return -1; } Py_INCREF(state->UAdd_type); if (PyModule_AddObject(m, "USub", state->USub_type) < 0) { - goto error; + return -1; } Py_INCREF(state->USub_type); if (PyModule_AddObject(m, "cmpop", state->cmpop_type) < 0) { - goto error; + return -1; } Py_INCREF(state->cmpop_type); if (PyModule_AddObject(m, "Eq", state->Eq_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Eq_type); if (PyModule_AddObject(m, "NotEq", state->NotEq_type) < 0) { - goto error; + return -1; } Py_INCREF(state->NotEq_type); if (PyModule_AddObject(m, "Lt", state->Lt_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Lt_type); if (PyModule_AddObject(m, "LtE", state->LtE_type) < 0) { - goto error; + return -1; } Py_INCREF(state->LtE_type); if (PyModule_AddObject(m, "Gt", state->Gt_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Gt_type); if (PyModule_AddObject(m, "GtE", state->GtE_type) < 0) { - goto error; + return -1; } Py_INCREF(state->GtE_type); if (PyModule_AddObject(m, "Is", state->Is_type) < 0) { - goto error; + return -1; } Py_INCREF(state->Is_type); if (PyModule_AddObject(m, "IsNot", state->IsNot_type) < 0) { - goto error; + return -1; } Py_INCREF(state->IsNot_type); if (PyModule_AddObject(m, "In", state->In_type) < 0) { - goto error; + return -1; } Py_INCREF(state->In_type); if (PyModule_AddObject(m, "NotIn", state->NotIn_type) < 0) { - goto error; + return -1; } Py_INCREF(state->NotIn_type); if (PyModule_AddObject(m, "comprehension", state->comprehension_type) < 0) { - goto error; + return -1; } Py_INCREF(state->comprehension_type); if (PyModule_AddObject(m, "excepthandler", state->excepthandler_type) < 0) { - goto error; + return -1; } Py_INCREF(state->excepthandler_type); if (PyModule_AddObject(m, "ExceptHandler", state->ExceptHandler_type) < 0) { - goto error; + return -1; } Py_INCREF(state->ExceptHandler_type); if (PyModule_AddObject(m, "arguments", state->arguments_type) < 0) { - goto error; + return -1; } Py_INCREF(state->arguments_type); if (PyModule_AddObject(m, "arg", state->arg_type) < 0) { - goto error; + return -1; } Py_INCREF(state->arg_type); if (PyModule_AddObject(m, "keyword", state->keyword_type) < 0) { - goto error; + return -1; } Py_INCREF(state->keyword_type); if (PyModule_AddObject(m, "alias", state->alias_type) < 0) { - goto error; + return -1; } Py_INCREF(state->alias_type); if (PyModule_AddObject(m, "withitem", state->withitem_type) < 0) { - goto error; + return -1; } Py_INCREF(state->withitem_type); if (PyModule_AddObject(m, "type_ignore", state->type_ignore_type) < 0) { - goto error; + return -1; } Py_INCREF(state->type_ignore_type); if (PyModule_AddObject(m, "TypeIgnore", state->TypeIgnore_type) < 0) { - goto error; + return -1; } Py_INCREF(state->TypeIgnore_type); - return m; + return 0; +} -error: - Py_DECREF(m); - return NULL; +static PyModuleDef_Slot astmodule_slots[] = { + {Py_mod_exec, astmodule_exec}, + {0, NULL} +}; + +static struct PyModuleDef _astmodule = { + PyModuleDef_HEAD_INIT, + .m_name = "_ast", + .m_size = sizeof(astmodulestate), + .m_slots = astmodule_slots, + .m_traverse = astmodule_traverse, + .m_clear = astmodule_clear, + .m_free = astmodule_free, +}; + +PyMODINIT_FUNC +PyInit__ast(void) +{ + return PyModuleDef_Init(&_astmodule); } PyObject* PyAST_mod2obj(mod_ty t) { - if (!init_types()) { + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { return NULL; } - - astmodulestate *state = get_global_ast_state(); return ast2obj_mod(state, t); } @@ -10326,10 +10356,6 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) assert(0 <= mode && mode <= 2); - if (!init_types()) { - return NULL; - } - isinstance = PyObject_IsInstance(ast, req_type[mode]); if (isinstance == -1) return NULL; @@ -10348,11 +10374,10 @@ mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode) int PyAST_Check(PyObject* obj) { - if (!init_types()) { + astmodulestate *state = get_global_ast_state(); + if (state == NULL) { return -1; } - - astmodulestate *state = get_global_ast_state(); return PyObject_IsInstance(obj, state->AST_type); } From webhook-mailer at python.org Fri Jul 3 16:56:38 2020 From: webhook-mailer at python.org (tkmikan) Date: Fri, 03 Jul 2020 20:56:38 -0000 Subject: [Python-checkins] bpo-41180: Audit code.__new__ when unmarshalling (GH-21271) Message-ID: https://github.com/python/cpython/commit/d160e0f8e283d0a8737644588b38e8c6a07c134f commit: d160e0f8e283d0a8737644588b38e8c6a07c134f branch: master author: tkmikan <36260601+tkmikan at users.noreply.github.com> committer: GitHub date: 2020-07-03T21:56:30+01:00 summary: bpo-41180: Audit code.__new__ when unmarshalling (GH-21271) files: M Python/marshal.c diff --git a/Python/marshal.c b/Python/marshal.c index a0f6b9812601b..c4538bd373a82 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1371,6 +1371,12 @@ r_object(RFILE *p) if (lnotab == NULL) goto code_error; + if (PySys_Audit("code.__new__", "OOOiiiiii", + code, filename, name, argcount, posonlyargcount, + kwonlyargcount, nlocals, stacksize, flags) < 0) { + goto code_error; + } + v = (PyObject *) PyCode_NewWithPosOnlyArgs( argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, From webhook-mailer at python.org Fri Jul 3 17:06:53 2020 From: webhook-mailer at python.org (Konge) Date: Fri, 03 Jul 2020 21:06:53 -0000 Subject: [Python-checkins] bpo-41162: Clear audit hooks later during finalization (GH-21222) Message-ID: https://github.com/python/cpython/commit/daa0fe03a517d335d48e65ace8e5da636e265a8f commit: daa0fe03a517d335d48e65ace8e5da636e265a8f branch: master author: Konge committer: GitHub date: 2020-07-03T22:06:46+01:00 summary: bpo-41162: Clear audit hooks later during finalization (GH-21222) files: A Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst M Lib/test/audit-tests.py M Lib/test/test_audit.py M Programs/_testembed.c M Python/pylifecycle.c diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index a58395b068b39..ee6fc93351b75 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -44,28 +44,6 @@ def __call__(self, event, args): raise self.exc_type("saw event " + event) -class TestFinalizeHook: - """Used in the test_finalize_hooks function to ensure that hooks - are correctly cleaned up, that they are notified about the cleanup, - and are unable to prevent it. - """ - - def __init__(self): - print("Created", id(self), file=sys.stdout, flush=True) - - def __call__(self, event, args): - # Avoid recursion when we call id() below - if event == "builtins.id": - return - - print(event, id(self), file=sys.stdout, flush=True) - - if event == "cpython._PySys_ClearAuditHooks": - raise RuntimeError("Should be ignored") - elif event == "cpython.PyInterpreterState_Clear": - raise RuntimeError("Should be ignored") - - # Simple helpers, since we are not in unittest here def assertEqual(x, y): if x != y: @@ -128,10 +106,6 @@ def test_block_add_hook_baseexception(): pass -def test_finalize_hooks(): - sys.addaudithook(TestFinalizeHook()) - - def test_pickle(): import pickle diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py index f405c6923979c..f79edbc4bd0d9 100644 --- a/Lib/test/test_audit.py +++ b/Lib/test/test_audit.py @@ -51,22 +51,6 @@ def test_block_add_hook(self): def test_block_add_hook_baseexception(self): self.do_test("test_block_add_hook_baseexception") - def test_finalize_hooks(self): - returncode, events, stderr = self.run_python("test_finalize_hooks") - if stderr: - print(stderr, file=sys.stderr) - if returncode: - self.fail(stderr) - - firstId = events[0][2] - self.assertSequenceEqual( - [ - ("Created", " ", firstId), - ("cpython._PySys_ClearAuditHooks", " ", firstId), - ], - events, - ) - def test_pickle(self): support.import_module("pickle") diff --git a/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst b/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst new file mode 100644 index 0000000000000..f0333ac4a7bb3 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst @@ -0,0 +1 @@ +Audit hooks are now cleared later during finalization to avoid missing events. \ No newline at end of file diff --git a/Programs/_testembed.c b/Programs/_testembed.c index b60d70be5f71e..5aad16a6f7c47 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1112,8 +1112,11 @@ static int test_open_code_hook(void) return result; } +static int _audit_hook_clear_count = 0; + static int _audit_hook(const char *event, PyObject *args, void *userdata) { + assert(args && PyTuple_CheckExact(args)); if (strcmp(event, "_testembed.raise") == 0) { PyErr_SetString(PyExc_RuntimeError, "Intentional error"); return -1; @@ -1122,6 +1125,8 @@ static int _audit_hook(const char *event, PyObject *args, void *userdata) return -1; } return 0; + } else if (strcmp(event, "cpython._PySys_ClearAuditHooks") == 0) { + _audit_hook_clear_count += 1; } return 0; } @@ -1167,6 +1172,9 @@ static int test_audit(void) { int result = _test_audit(42); Py_Finalize(); + if (_audit_hook_clear_count != 1) { + return 0x1000 | _audit_hook_clear_count; + } return result; } diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 3ce2c41ef1ff6..2d219a4a3a8b0 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1291,6 +1291,13 @@ finalize_interp_clear(PyThreadState *tstate) _PyGC_CollectNoFail(); } + /* Clear all loghooks */ + /* Both _PySys_Audit function and users still need PyObject, such as tuple. + Call _PySys_ClearAuditHooks when PyObject available. */ + if (is_main_interp) { + _PySys_ClearAuditHooks(tstate); + } + _PyGC_Fini(tstate); if (is_main_interp) { @@ -1405,9 +1412,6 @@ Py_FinalizeEx(void) */ _PyGC_CollectIfEnabled(); - /* Clear all loghooks */ - _PySys_ClearAuditHooks(tstate); - /* Destroy all modules */ _PyImport_Cleanup(tstate); From webhook-mailer at python.org Fri Jul 3 17:13:37 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Jul 2020 21:13:37 -0000 Subject: [Python-checkins] bpo-41180: Audit code.__new__ when unmarshalling (GH-21271) Message-ID: https://github.com/python/cpython/commit/c1d916595eb6979d4d87cc3e5216e26b3c6fac25 commit: c1d916595eb6979d4d87cc3e5216e26b3c6fac25 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-03T14:13:29-07:00 summary: bpo-41180: Audit code.__new__ when unmarshalling (GH-21271) (cherry picked from commit d160e0f8e283d0a8737644588b38e8c6a07c134f) Co-authored-by: tkmikan <36260601+tkmikan at users.noreply.github.com> files: M Python/marshal.c diff --git a/Python/marshal.c b/Python/marshal.c index d3fee32380b58..a9ba7a436fd19 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1396,6 +1396,12 @@ r_object(RFILE *p) if (lnotab == NULL) goto code_error; + if (PySys_Audit("code.__new__", "OOOiiiiii", + code, filename, name, argcount, posonlyargcount, + kwonlyargcount, nlocals, stacksize, flags) < 0) { + goto code_error; + } + v = (PyObject *) PyCode_NewWithPosOnlyArgs( argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize, flags, From webhook-mailer at python.org Fri Jul 3 19:04:37 2020 From: webhook-mailer at python.org (Steve Dower) Date: Fri, 03 Jul 2020 23:04:37 -0000 Subject: [Python-checkins] bpo-41162: Clear audit hooks later during finalization (GH-21222) Message-ID: https://github.com/python/cpython/commit/b9e288cc1bfd583e887f784e38d9c511b43c0c3a commit: b9e288cc1bfd583e887f784e38d9c511b43c0c3a branch: 3.8 author: Steve Dower committer: GitHub date: 2020-07-04T00:04:22+01:00 summary: bpo-41162: Clear audit hooks later during finalization (GH-21222) Co-authored-by: Konge files: A Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst M Lib/test/audit-tests.py M Lib/test/test_audit.py M Programs/_testembed.c M Python/pylifecycle.c diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index a58395b068b39..ee6fc93351b75 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -44,28 +44,6 @@ def __call__(self, event, args): raise self.exc_type("saw event " + event) -class TestFinalizeHook: - """Used in the test_finalize_hooks function to ensure that hooks - are correctly cleaned up, that they are notified about the cleanup, - and are unable to prevent it. - """ - - def __init__(self): - print("Created", id(self), file=sys.stdout, flush=True) - - def __call__(self, event, args): - # Avoid recursion when we call id() below - if event == "builtins.id": - return - - print(event, id(self), file=sys.stdout, flush=True) - - if event == "cpython._PySys_ClearAuditHooks": - raise RuntimeError("Should be ignored") - elif event == "cpython.PyInterpreterState_Clear": - raise RuntimeError("Should be ignored") - - # Simple helpers, since we are not in unittest here def assertEqual(x, y): if x != y: @@ -128,10 +106,6 @@ def test_block_add_hook_baseexception(): pass -def test_finalize_hooks(): - sys.addaudithook(TestFinalizeHook()) - - def test_pickle(): import pickle diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py index f405c6923979c..f79edbc4bd0d9 100644 --- a/Lib/test/test_audit.py +++ b/Lib/test/test_audit.py @@ -51,22 +51,6 @@ def test_block_add_hook(self): def test_block_add_hook_baseexception(self): self.do_test("test_block_add_hook_baseexception") - def test_finalize_hooks(self): - returncode, events, stderr = self.run_python("test_finalize_hooks") - if stderr: - print(stderr, file=sys.stderr) - if returncode: - self.fail(stderr) - - firstId = events[0][2] - self.assertSequenceEqual( - [ - ("Created", " ", firstId), - ("cpython._PySys_ClearAuditHooks", " ", firstId), - ], - events, - ) - def test_pickle(self): support.import_module("pickle") diff --git a/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst b/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst new file mode 100644 index 0000000000000..f0333ac4a7bb3 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst @@ -0,0 +1 @@ +Audit hooks are now cleared later during finalization to avoid missing events. \ No newline at end of file diff --git a/Programs/_testembed.c b/Programs/_testembed.c index b98a38a1ba678..460d70ccadefd 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -1106,8 +1106,11 @@ static int test_open_code_hook(void) return result; } +static int _audit_hook_clear_count = 0; + static int _audit_hook(const char *event, PyObject *args, void *userdata) { + assert(args && PyTuple_CheckExact(args)); if (strcmp(event, "_testembed.raise") == 0) { PyErr_SetString(PyExc_RuntimeError, "Intentional error"); return -1; @@ -1116,6 +1119,8 @@ static int _audit_hook(const char *event, PyObject *args, void *userdata) return -1; } return 0; + } else if (strcmp(event, "cpython._PySys_ClearAuditHooks") == 0) { + _audit_hook_clear_count += 1; } return 0; } @@ -1161,6 +1166,9 @@ static int test_audit(void) { int result = _test_audit(42); Py_Finalize(); + if (_audit_hook_clear_count != 1) { + return 0x1000 | _audit_hook_clear_count; + } return result; } diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 27cebf33da544..dc2d13db419e5 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1229,13 +1229,6 @@ Py_FinalizeEx(void) /* nothing */; #endif - /* Clear all loghooks */ - /* We want minimal exposure of this function, so define the extern - * here. The linker should discover the correct function without - * exporting a symbol. */ - extern void _PySys_ClearAuditHooks(void); - _PySys_ClearAuditHooks(); - /* Destroy all modules */ PyImport_Cleanup(); @@ -1306,6 +1299,13 @@ Py_FinalizeEx(void) /* Clear interpreter state and all thread states. */ PyInterpreterState_Clear(interp); + /* Clear all loghooks */ + /* We want minimal exposure of this function, so define the extern + * here. The linker should discover the correct function without + * exporting a symbol. */ + extern void _PySys_ClearAuditHooks(void); + _PySys_ClearAuditHooks(); + /* Now we decref the exception classes. After this point nothing can raise an exception. That's okay, because each Fini() method below has been checked to make sure no exceptions are ever From webhook-mailer at python.org Fri Jul 3 23:58:29 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Sat, 04 Jul 2020 03:58:29 -0000 Subject: [Python-checkins] bpo-33864: Clarify the docs for typing.ByteString (GH-21311) Message-ID: https://github.com/python/cpython/commit/b40e434386cd94a367d4a256e3364771140160e7 commit: b40e434386cd94a367d4a256e3364771140160e7 branch: master author: Zackery Spytz committer: GitHub date: 2020-07-03T20:58:21-07:00 summary: bpo-33864: Clarify the docs for typing.ByteString (GH-21311) files: M Doc/library/typing.rst diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index e85b6d697f79d..e5143c5f8d9e4 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -672,7 +672,7 @@ The module defines the following classes, functions and decorators: A generic version of :class:`collections.abc.ByteString`. This type represents the types :class:`bytes`, :class:`bytearray`, - and :class:`memoryview`. + and :class:`memoryview` of byte sequences. As a shorthand for this type, :class:`bytes` can be used to annotate arguments of any of the types mentioned above. From webhook-mailer at python.org Sat Jul 4 00:06:11 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 04 Jul 2020 04:06:11 -0000 Subject: [Python-checkins] bpo-33864: Clarify the docs for typing.ByteString (GH-21311) Message-ID: https://github.com/python/cpython/commit/6857ebefc048e316f948091946d337b5ada807a4 commit: 6857ebefc048e316f948091946d337b5ada807a4 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-03T21:06:07-07:00 summary: bpo-33864: Clarify the docs for typing.ByteString (GH-21311) (cherry picked from commit b40e434386cd94a367d4a256e3364771140160e7) Co-authored-by: Zackery Spytz files: M Doc/library/typing.rst diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 5fa89423d20bf..1467276d0141d 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -672,7 +672,7 @@ The module defines the following classes, functions and decorators: A generic version of :class:`collections.abc.ByteString`. This type represents the types :class:`bytes`, :class:`bytearray`, - and :class:`memoryview`. + and :class:`memoryview` of byte sequences. As a shorthand for this type, :class:`bytes` can be used to annotate arguments of any of the types mentioned above. From webhook-mailer at python.org Sat Jul 4 17:18:23 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Sat, 04 Jul 2020 21:18:23 -0000 Subject: [Python-checkins] bpo-41204: Fix compiler warning in ast_type_init() (GH-21307) Message-ID: https://github.com/python/cpython/commit/1f76453173267887ed05bb3783e862cb22365ae8 commit: 1f76453173267887ed05bb3783e862cb22365ae8 branch: master author: Victor Stinner committer: GitHub date: 2020-07-04T23:18:15+02:00 summary: bpo-41204: Fix compiler warning in ast_type_init() (GH-21307) files: M Parser/asdl_c.py M Python/Python-ast.c diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index b93906ba8d45d..6fe44b99f793b 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -688,13 +688,14 @@ def visitModule(self, mod): static int ast_type_init(PyObject *self, PyObject *args, PyObject *kw) { - Py_ssize_t i, numfields = 0; - int res = -1; - PyObject *key, *value, *fields; astmodulestate *state = get_global_ast_state(); if (state == NULL) { - goto cleanup; + return -1; } + + Py_ssize_t i, numfields = 0; + int res = -1; + PyObject *key, *value, *fields; if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } diff --git a/Python/Python-ast.c b/Python/Python-ast.c index b81b282a03965..396a6832702b3 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -1140,13 +1140,14 @@ ast_clear(AST_object *self) static int ast_type_init(PyObject *self, PyObject *args, PyObject *kw) { - Py_ssize_t i, numfields = 0; - int res = -1; - PyObject *key, *value, *fields; astmodulestate *state = get_global_ast_state(); if (state == NULL) { - goto cleanup; + return -1; } + + Py_ssize_t i, numfields = 0; + int res = -1; + PyObject *key, *value, *fields; if (_PyObject_LookupAttr((PyObject*)Py_TYPE(self), state->_fields, &fields) < 0) { goto cleanup; } From webhook-mailer at python.org Sat Jul 4 22:02:07 2020 From: webhook-mailer at python.org (Inada Naoki) Date: Sun, 05 Jul 2020 02:02:07 -0000 Subject: [Python-checkins] Uncomment Py_DEPRECATED for Py_UNICODE APIs (GH-21318) Message-ID: https://github.com/python/cpython/commit/13c90e82b6a1c3baff7f48f1bdc38058f6072f04 commit: 13c90e82b6a1c3baff7f48f1bdc38058f6072f04 branch: master author: Inada Naoki committer: GitHub date: 2020-07-05T11:01:54+09:00 summary: Uncomment Py_DEPRECATED for Py_UNICODE APIs (GH-21318) PyUnicode_EncodeDecimal and PyUnicode_TransformDecimalToASCII are deprecated since Python 3.3. But Py_DEPRECATED(3.3) was commented out. files: M Include/cpython/unicodeobject.h M Modules/_testcapimodule.c diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index 0f19b2a14bcd0..a82eee45e0ed2 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -974,7 +974,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( */ -/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(int) PyUnicode_EncodeDecimal( +Py_DEPRECATED(3.3) PyAPI_FUNC(int) PyUnicode_EncodeDecimal( Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ char *output, /* Output buffer; must have size >= length */ @@ -987,7 +987,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( Returns a new Unicode string on success, NULL on failure. */ -/* Py_DEPRECATED(3.3) */ +Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII( Py_UNICODE *s, /* Unicode buffer */ Py_ssize_t length /* Number of Py_UNICODE chars to transform */ diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 629102b12a9fe..1e4c31fefb206 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -2024,6 +2024,10 @@ unicode_copycharacters(PyObject *self, PyObject *args) return Py_BuildValue("(Nn)", to_copy, copied); } +/* Ignore use of deprecated APIs */ +_Py_COMP_DIAG_PUSH +_Py_COMP_DIAG_IGNORE_DEPR_DECLS + static PyObject * unicode_encodedecimal(PyObject *self, PyObject *args) { @@ -2069,10 +2073,6 @@ unicode_transformdecimaltoascii(PyObject *self, PyObject *args) return PyUnicode_TransformDecimalToASCII(unicode, length); } -/* Ignore use of deprecated APIs */ -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS - static PyObject * unicode_legacy_string(PyObject *self, PyObject *args) { From webhook-mailer at python.org Sun Jul 5 00:01:52 2020 From: webhook-mailer at python.org (Inada Naoki) Date: Sun, 05 Jul 2020 04:01:52 -0000 Subject: [Python-checkins] bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325) Message-ID: https://github.com/python/cpython/commit/9c8441712230660fedac818ed50e7cdd89e4c51d commit: 9c8441712230660fedac818ed50e7cdd89e4c51d branch: master author: Inada Naoki committer: GitHub date: 2020-07-05T13:01:48+09:00 summary: bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325) It doesn't use PyUnicode_EncodeDecimal. It uses a private API instead. files: M Doc/c-api/long.rst diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 3921a93843e42..4d859fb641df3 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -97,9 +97,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. .. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base) Convert a sequence of Unicode digits in the string *u* to a Python integer - value. The Unicode string is first encoded to a byte string using - :c:func:`PyUnicode_EncodeDecimal` and then converted using - :c:func:`PyLong_FromString`. + value. .. versionadded:: 3.3 From webhook-mailer at python.org Sun Jul 5 00:09:22 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 05 Jul 2020 04:09:22 -0000 Subject: [Python-checkins] bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325) Message-ID: https://github.com/python/cpython/commit/4874e5908c38da4c7dcaecf6397832dda1e6dd08 commit: 4874e5908c38da4c7dcaecf6397832dda1e6dd08 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-04T21:09:18-07:00 summary: bpo-41211: Doc: Fix PyLong_FromUnicodeObject (GH-21325) It doesn't use PyUnicode_EncodeDecimal. It uses a private API instead. (cherry picked from commit 9c8441712230660fedac818ed50e7cdd89e4c51d) Co-authored-by: Inada Naoki files: M Doc/c-api/long.rst diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index a8a91e2678413..0f5e667a45c27 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -110,9 +110,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. .. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base) Convert a sequence of Unicode digits in the string *u* to a Python integer - value. The Unicode string is first encoded to a byte string using - :c:func:`PyUnicode_EncodeDecimal` and then converted using - :c:func:`PyLong_FromString`. + value. .. versionadded:: 3.3 From webhook-mailer at python.org Sun Jul 5 01:07:49 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Sun, 05 Jul 2020 05:07:49 -0000 Subject: [Python-checkins] bpo-39168: Remove the __new__ method of typing.Generic (GH-21327) Message-ID: https://github.com/python/cpython/commit/7fed75597fac11f9a6c769e2b6c6548fe0e4049d commit: 7fed75597fac11f9a6c769e2b6c6548fe0e4049d branch: master author: Zackery Spytz committer: GitHub date: 2020-07-04T22:07:43-07:00 summary: bpo-39168: Remove the __new__ method of typing.Generic (GH-21327) Automerge-Triggered-By: @gvanrossum files: A Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst M Lib/test/test_typing.py M Lib/typing.py diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index f429e883b5953..398add05a12b9 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1417,8 +1417,6 @@ def test_basics(self): def test_generic_errors(self): T = TypeVar('T') S = TypeVar('S') - with self.assertRaises(TypeError): - Generic[T]() with self.assertRaises(TypeError): Generic[T][T] with self.assertRaises(TypeError): diff --git a/Lib/typing.py b/Lib/typing.py index f94996daebd6e..fd657caafee87 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -894,16 +894,6 @@ def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT: __slots__ = () _is_protocol = False - def __new__(cls, *args, **kwds): - if cls in (Generic, Protocol): - raise TypeError(f"Type {cls.__name__} cannot be instantiated; " - "it can be used only as a base class") - if super().__new__ is object.__new__ and cls.__init__ is not object.__init__: - obj = super().__new__(cls) - else: - obj = super().__new__(cls, *args, **kwds) - return obj - @_tp_cache def __class_getitem__(cls, params): if not isinstance(params, tuple): diff --git a/Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst b/Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst new file mode 100644 index 0000000000000..667885eccd9c7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-04-21-56-46.bpo-39168.DQWsXj.rst @@ -0,0 +1 @@ +Remove the ``__new__`` method of :class:`typing.Generic`. From webhook-mailer at python.org Sun Jul 5 01:36:02 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 05 Jul 2020 05:36:02 -0000 Subject: [Python-checkins] bpo-41211: Doc: Fix PyLong_FromUnicode (GH-21331) Message-ID: https://github.com/python/cpython/commit/01c0925271a9e8c6a4b316efeb8fdcbed9eb17f4 commit: 01c0925271a9e8c6a4b316efeb8fdcbed9eb17f4 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-04T22:35:58-07:00 summary: bpo-41211: Doc: Fix PyLong_FromUnicode (GH-21331) PyUnicode_EncodeDecimal is not used actually. (cherry picked from commit 16f451744b7f4653ca9db4b4bedbb6fc5c0de154) Co-authored-by: Inada Naoki files: M Doc/c-api/long.rst diff --git a/Doc/c-api/long.rst b/Doc/c-api/long.rst index 0f5e667a45c27..3bada415aa37e 100644 --- a/Doc/c-api/long.rst +++ b/Doc/c-api/long.rst @@ -98,9 +98,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate. .. c:function:: PyObject* PyLong_FromUnicode(Py_UNICODE *u, Py_ssize_t length, int base) - Convert a sequence of Unicode digits to a Python integer value. The Unicode - string is first encoded to a byte string using :c:func:`PyUnicode_EncodeDecimal` - and then converted using :c:func:`PyLong_FromString`. + Convert a sequence of Unicode digits to a Python integer value. .. deprecated-removed:: 3.3 3.10 Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using From webhook-mailer at python.org Sun Jul 5 11:53:56 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 05 Jul 2020 15:53:56 -0000 Subject: [Python-checkins] bpo-36346: Undeprecate private function _PyUnicode_AsUnicode(). (GH-21336) Message-ID: https://github.com/python/cpython/commit/b3dd5cd4a36877c473417fd7b3358843dcf8e647 commit: b3dd5cd4a36877c473417fd7b3358843dcf8e647 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-05T18:53:45+03:00 summary: bpo-36346: Undeprecate private function _PyUnicode_AsUnicode(). (GH-21336) files: M Include/cpython/unicodeobject.h M Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst M Modules/clinic/posixmodule.c.h M Objects/unicodeobject.c M PC/_msi.c M PC/clinic/_msi.c.h M PC/clinic/winreg.c.h M Tools/clinic/clinic.py diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index a82eee45e0ed2..49ad32d5d199e 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -581,7 +581,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( /* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string contains null characters. */ -Py_DEPRECATED(3.3) PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode( +PyAPI_FUNC(const Py_UNICODE *) _PyUnicode_AsUnicode( PyObject *unicode /* Unicode object */ ); diff --git a/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst b/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst index 902a0e60727e6..1e448303a853c 100644 --- a/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst +++ b/Misc/NEWS.d/next/C API/2020-06-17-11-24-00.bpo-36346.fTMr3S.rst @@ -1,4 +1,4 @@ Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``, ``PyUnicode_WSTR_LENGTH``, -``PyUnicode_FromUnicode``, ``PyUnicode_AsUnicode``, ``_PyUnicode_AsUnicode``, +``PyUnicode_FromUnicode``, ``PyUnicode_AsUnicode``, and ``PyUnicode_AsUnicodeAndSize`` as deprecated in C. Remove ``Py_UNICODE_MATCH`` which was deprecated and broken since Python 3.3. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 6533edfdb47d2..c15def0a0f2b8 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -1688,10 +1688,7 @@ os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS command = _PyUnicode_AsUnicode(args[0]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ command = PyUnicode_AsWideCharString(args[0], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -7040,10 +7037,7 @@ os_startfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS operation = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ operation = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -8925,4 +8919,4 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=ba3d4b35fda2c208 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a0fbdea47249ee0c input=a9049054013a1b77]*/ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index ca68c57534b22..809ed85895f86 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3310,14 +3310,11 @@ _PyUnicode_WideCharString_Converter(PyObject *obj, void *ptr) } if (PyUnicode_Check(obj)) { #if USE_UNICODE_WCHAR_CACHE -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS *p = (wchar_t *)_PyUnicode_AsUnicode(obj); if (*p == NULL) { return 0; } return 1; -_Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ *p = PyUnicode_AsWideCharString(obj, NULL); if (*p == NULL) { @@ -3349,14 +3346,11 @@ _PyUnicode_WideCharString_Opt_Converter(PyObject *obj, void *ptr) } if (PyUnicode_Check(obj)) { #if USE_UNICODE_WCHAR_CACHE -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS *p = (wchar_t *)_PyUnicode_AsUnicode(obj); if (*p == NULL) { return 0; } return 1; -_Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ *p = PyUnicode_AsWideCharString(obj, NULL); if (*p == NULL) { diff --git a/PC/_msi.c b/PC/_msi.c index 9f1015845acff..f725c816206e7 100644 --- a/PC/_msi.c +++ b/PC/_msi.c @@ -758,10 +758,7 @@ _msi_SummaryInformation_SetProperty_impl(msiobj *self, int field, if (PyUnicode_Check(data)) { #if USE_UNICODE_WCHAR_CACHE -_Py_COMP_DIAG_PUSH -_Py_COMP_DIAG_IGNORE_DEPR_DECLS const WCHAR *value = _PyUnicode_AsUnicode(data); -_Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ WCHAR *value = PyUnicode_AsWideCharString(data, NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ diff --git a/PC/clinic/_msi.c.h b/PC/clinic/_msi.c.h index 895bf39a779f4..85c4d226ee408 100644 --- a/PC/clinic/_msi.c.h +++ b/PC/clinic/_msi.c.h @@ -209,10 +209,7 @@ _msi_Record_SetString(msiobj *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS value = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ value = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -261,10 +258,7 @@ _msi_Record_SetStream(msiobj *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS value = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ value = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -568,10 +562,7 @@ _msi_Database_OpenView(msiobj *self, PyObject *arg) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS sql = _PyUnicode_AsUnicode(arg); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ sql = PyUnicode_AsWideCharString(arg, NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -670,10 +661,7 @@ _msi_OpenDatabase(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS path = _PyUnicode_AsUnicode(args[0]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ path = PyUnicode_AsWideCharString(args[0], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -725,4 +713,4 @@ _msi_CreateRecord(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=39807788326ad0e9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=49debf733ee5cab2 input=a9049054013a1b77]*/ diff --git a/PC/clinic/winreg.c.h b/PC/clinic/winreg.c.h index 5c97eaeee9e27..3301bed9713aa 100644 --- a/PC/clinic/winreg.c.h +++ b/PC/clinic/winreg.c.h @@ -160,10 +160,7 @@ winreg_ConnectRegistry(PyObject *module, PyObject *const *args, Py_ssize_t nargs } else if (PyUnicode_Check(args[0])) { #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS computer_name = _PyUnicode_AsUnicode(args[0]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ computer_name = PyUnicode_AsWideCharString(args[0], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -237,10 +234,7 @@ winreg_CreateKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } else if (PyUnicode_Check(args[1])) { #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS sub_key = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ sub_key = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -373,10 +367,7 @@ winreg_DeleteKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS sub_key = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ sub_key = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -488,10 +479,7 @@ winreg_DeleteValue(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } else if (PyUnicode_Check(args[1])) { #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS value = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ value = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -635,10 +623,7 @@ winreg_ExpandEnvironmentStrings(PyObject *module, PyObject *arg) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS string = _PyUnicode_AsUnicode(arg); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ string = PyUnicode_AsWideCharString(arg, NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -750,10 +735,7 @@ winreg_LoadKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS sub_key = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ sub_key = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -765,10 +747,7 @@ winreg_LoadKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS file_name = _PyUnicode_AsUnicode(args[2]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ file_name = PyUnicode_AsWideCharString(args[2], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -984,10 +963,7 @@ winreg_QueryValue(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } else if (PyUnicode_Check(args[1])) { #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS sub_key = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ sub_key = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -1050,10 +1026,7 @@ winreg_QueryValueEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } else if (PyUnicode_Check(args[1])) { #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS name = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ name = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -1121,10 +1094,7 @@ winreg_SaveKey(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS file_name = _PyUnicode_AsUnicode(args[1]); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ file_name = PyUnicode_AsWideCharString(args[1], NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -1378,4 +1348,4 @@ winreg_QueryReflectionKey(PyObject *module, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=fa5f21ea6a75d0e9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=30b1311886c13907 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 3a9f4c228c22b..92334d9195fcc 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -3414,10 +3414,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS {paramname} = _PyUnicode_AsUnicode({argname}); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ {paramname} = PyUnicode_AsWideCharString({argname}, NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -3432,10 +3429,7 @@ def parse_arg(self, argname, argnum): }}}} else if (PyUnicode_Check({argname})) {{{{ #if USE_UNICODE_WCHAR_CACHE - _Py_COMP_DIAG_PUSH - _Py_COMP_DIAG_IGNORE_DEPR_DECLS {paramname} = _PyUnicode_AsUnicode({argname}); - _Py_COMP_DIAG_POP #else /* USE_UNICODE_WCHAR_CACHE */ {paramname} = PyUnicode_AsWideCharString({argname}, NULL); #endif /* USE_UNICODE_WCHAR_CACHE */ From webhook-mailer at python.org Sun Jul 5 16:12:13 2020 From: webhook-mailer at python.org (scoder) Date: Sun, 05 Jul 2020 20:12:13 -0000 Subject: [Python-checkins] bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092) (GH-21339) Message-ID: https://github.com/python/cpython/commit/8912c182455de83e27d5c120639ec91b18247913 commit: 8912c182455de83e27d5c120639ec91b18247913 branch: 3.8 author: scoder committer: GitHub date: 2020-07-05T22:12:04+02:00 summary: bpo-39960: Allow heap types in the "Carlo Verre" hack check that override "tp_setattro()" (GH-21092) (GH-21339) Backport to Py3.8. files: A Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst M Lib/test/test_capi.py M Modules/_testcapimodule.c M Objects/typeobject.c diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index d1506bc17732f..754712701874d 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -473,6 +473,14 @@ def test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_o # Test that subtype_dealloc decref the newly assigned __class__ only once self.assertEqual(new_type_refcnt, sys.getrefcount(_testcapi.HeapCTypeSubclass)) + def test_heaptype_with_setattro(self): + obj = _testcapi.HeapCTypeSetattr() + self.assertEqual(obj.pvalue, 10) + obj.value = 12 + self.assertEqual(obj.pvalue, 12) + del obj.value + self.assertEqual(obj.pvalue, 0) + def test_pynumber_tobase(self): from _testcapi import pynumber_tobase self.assertEqual(pynumber_tobase(123, 2), '0b1111011') diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst new file mode 100644 index 0000000000000..f69fccfa4db69 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst @@ -0,0 +1,2 @@ +The "hackcheck" that prevents sneaking around a type's __setattr__() by calling the +superclass method was rewritten to allow C implemented heap types. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index f74756163f863..af28af50c0650 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -6177,6 +6177,79 @@ static PyType_Spec HeapCTypeSubclassWithFinalizer_spec = { HeapCTypeSubclassWithFinalizer_slots }; +PyDoc_STRVAR(heapctypesetattr__doc__, +"A heap type without GC, but with overridden __setattr__.\n\n" +"The 'value' attribute is set to 10 in __init__ and updated via attribute setting."); + +typedef struct { + PyObject_HEAD + long value; +} HeapCTypeSetattrObject; + +static struct PyMemberDef heapctypesetattr_members[] = { + {"pvalue", T_LONG, offsetof(HeapCTypeSetattrObject, value)}, + {NULL} /* Sentinel */ +}; + +static int +heapctypesetattr_init(PyObject *self, PyObject *args, PyObject *kwargs) +{ + ((HeapCTypeSetattrObject *)self)->value = 10; + return 0; +} + +static void +heapctypesetattr_dealloc(HeapCTypeSetattrObject *self) +{ + PyTypeObject *tp = Py_TYPE(self); + PyObject_Del(self); + Py_DECREF(tp); +} + +static int +heapctypesetattr_setattro(HeapCTypeSetattrObject *self, PyObject *attr, PyObject *value) +{ + PyObject *svalue = PyUnicode_FromString("value"); + if (svalue == NULL) + return -1; + int eq = PyObject_RichCompareBool(svalue, attr, Py_EQ); + Py_DECREF(svalue); + if (eq < 0) + return -1; + if (!eq) { + return PyObject_GenericSetAttr((PyObject*) self, attr, value); + } + if (value == NULL) { + self->value = 0; + return 0; + } + PyObject *ivalue = PyNumber_Long(value); + if (ivalue == NULL) + return -1; + long v = PyLong_AsLong(ivalue); + Py_DECREF(ivalue); + if (v == -1 && PyErr_Occurred()) + return -1; + self->value = v; + return 0; +} + +static PyType_Slot HeapCTypeSetattr_slots[] = { + {Py_tp_init, heapctypesetattr_init}, + {Py_tp_members, heapctypesetattr_members}, + {Py_tp_setattro, heapctypesetattr_setattro}, + {Py_tp_dealloc, heapctypesetattr_dealloc}, + {Py_tp_doc, (char*)heapctypesetattr__doc__}, + {0, 0}, +}; + +static PyType_Spec HeapCTypeSetattr_spec = { + "_testcapi.HeapCTypeSetattr", + sizeof(HeapCTypeSetattrObject), + 0, + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, + HeapCTypeSetattr_slots +}; static struct PyModuleDef _testcapimodule = { PyModuleDef_HEAD_INIT, @@ -6336,6 +6409,12 @@ PyInit__testcapi(void) Py_DECREF(subclass_bases); PyModule_AddObject(m, "HeapCTypeSubclass", HeapCTypeSubclass); + PyObject *HeapCTypeSetattr = PyType_FromSpec(&HeapCTypeSetattr_spec); + if (HeapCTypeSetattr == NULL) { + return NULL; + } + PyModule_AddObject(m, "HeapCTypeSetattr", HeapCTypeSetattr); + PyObject *subclass_with_finalizer_bases = PyTuple_Pack(1, HeapCTypeSubclass); if (subclass_with_finalizer_bases == NULL) { return NULL; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 5df121775af00..00128698cd018 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -81,6 +81,9 @@ clear_slotdefs(void); static PyObject * lookup_maybe_method(PyObject *self, _Py_Identifier *attrid, int *unbound); +static int +slot_tp_setattro(PyObject *self, PyObject *name, PyObject *value); + /* * finds the beginning of the docstring's introspection signature. * if present, returns a pointer pointing to the first '('. @@ -5806,22 +5809,38 @@ wrap_delitem(PyObject *self, PyObject *args, void *wrapped) } /* Helper to check for object.__setattr__ or __delattr__ applied to a type. - This is called the Carlo Verre hack after its discoverer. */ + This is called the Carlo Verre hack after its discoverer. See + https://mail.python.org/pipermail/python-dev/2003-April/034535.html + */ static int hackcheck(PyObject *self, setattrofunc func, const char *what) { PyTypeObject *type = Py_TYPE(self); - while (type && type->tp_flags & Py_TPFLAGS_HEAPTYPE) - type = type->tp_base; - /* If type is NULL now, this is a really weird type. - In the spirit of backwards compatibility (?), just shut up. */ - if (type && type->tp_setattro != func) { - PyErr_Format(PyExc_TypeError, - "can't apply this %s to %s object", - what, - type->tp_name); - return 0; + PyObject *mro = type->tp_mro; + if (!mro) { + /* Probably ok not to check the call in this case. */ + return 1; + } + assert(PyTuple_Check(mro)); + Py_ssize_t i, n; + n = PyTuple_GET_SIZE(mro); + for (i = 0; i < n; i++) { + PyTypeObject *base = (PyTypeObject*) PyTuple_GET_ITEM(mro, i); + if (base->tp_setattro == func) { + /* 'func' is the earliest non-Python implementation in the MRO. */ + break; + } else if (base->tp_setattro != slot_tp_setattro) { + /* 'base' is not a Python class and overrides 'func'. + Its tp_setattro should be called instead. */ + PyErr_Format(PyExc_TypeError, + "can't apply this %s to %s object", + what, + type->tp_name); + return 0; + } } + /* Either 'func' is not in the mro (which should fail when checking 'self'), + or it's the right slot function to call. */ return 1; } From webhook-mailer at python.org Sun Jul 5 17:43:18 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Sun, 05 Jul 2020 21:43:18 -0000 Subject: [Python-checkins] bpo-29727: Register array.array as a MutableSequence (GH-21338) Message-ID: https://github.com/python/cpython/commit/e51dd9dad6590bf3a940723fbbaaf4f64a3c9228 commit: e51dd9dad6590bf3a940723fbbaaf4f64a3c9228 branch: master author: Pablo Galindo committer: GitHub date: 2020-07-05T22:43:14+01:00 summary: bpo-29727: Register array.array as a MutableSequence (GH-21338) files: A Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst M Lib/test/test_array.py M Modules/arraymodule.c diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 6af90dfb871d7..c423f545488f8 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -2,6 +2,7 @@ Roger E. Masse """ +import collections.abc import unittest from test import support from test.support import os_helper @@ -29,6 +30,10 @@ def __init__(self, typecode, newarg=None): class MiscTest(unittest.TestCase): + def test_array_is_sequence(self): + self.assertIsInstance(array.array("B"), collections.abc.MutableSequence) + self.assertIsInstance(array.array("B"), collections.abc.Reversible) + def test_bad_constructor(self): self.assertRaises(TypeError, array.array) self.assertRaises(TypeError, array.array, spam=42) @@ -331,6 +336,67 @@ def test_exhausted_iterator(self): self.assertEqual(list(empit), [self.outside]) self.assertEqual(list(a), list(self.example) + [self.outside]) + def test_reverse_iterator(self): + a = array.array(self.typecode, self.example) + self.assertEqual(list(a), list(self.example)) + self.assertEqual(list(reversed(a)), list(iter(a))[::-1]) + + def test_reverse_iterator_picking(self): + orig = array.array(self.typecode, self.example) + data = list(orig) + data2 = [self.outside] + data + rev_data = data[len(data)-2::-1] + [self.outside] + for proto in range(pickle.HIGHEST_PROTOCOL + 1): + # initial iterator + itorig = reversed(orig) + d = pickle.dumps((itorig, orig), proto) + it, a = pickle.loads(d) + a.insert(0, self.outside) + self.assertEqual(type(it), type(itorig)) + self.assertEqual(list(it), rev_data) + self.assertEqual(list(a), data2) + + # running iterator + next(itorig) + d = pickle.dumps((itorig, orig), proto) + it, a = pickle.loads(d) + a.insert(0, self.outside) + self.assertEqual(type(it), type(itorig)) + self.assertEqual(list(it), rev_data[1:]) + self.assertEqual(list(a), data2) + + # empty iterator + for i in range(1, len(data)): + next(itorig) + d = pickle.dumps((itorig, orig), proto) + it, a = pickle.loads(d) + a.insert(0, self.outside) + self.assertEqual(type(it), type(itorig)) + self.assertEqual(list(it), []) + self.assertEqual(list(a), data2) + + # exhausted iterator + self.assertRaises(StopIteration, next, itorig) + d = pickle.dumps((itorig, orig), proto) + it, a = pickle.loads(d) + a.insert(0, self.outside) + self.assertEqual(list(it), []) + self.assertEqual(list(a), data2) + + def test_exhausted_reverse_iterator(self): + a = array.array(self.typecode, self.example) + self.assertEqual(list(a), list(self.example)) + exhit = reversed(a) + empit = reversed(a) + for x in exhit: # exhaust the iterator + next(empit) # Pointing past the 0th position. + a.insert(0, self.outside) + self.assertEqual(list(exhit), []) + # The iterator index points past the 0th position so inserting + # an element in the beggining does not make it appear. + self.assertEqual(list(empit), []) + self.assertEqual(list(a), [self.outside] + list(self.example)) + def test_insert(self): a = array.array(self.typecode, self.example) a.insert(0, self.example[0]) diff --git a/Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst b/Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst new file mode 100644 index 0000000000000..85cfa4f893811 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-05-19-16-02.bpo-29727.Q6Z2rg.rst @@ -0,0 +1,2 @@ +Register :class:`array.array` as a +:class:`~collections.abc.MutableSequence`. Patch by Pablo Galindo. diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 2d498c7e82941..2ba2ff43aa8b8 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2989,6 +2989,26 @@ array_modexec(PyObject *m) Py_DECREF((PyObject *)&Arraytype); return -1; } + + PyObject *abc_mod = PyImport_ImportModule("collections.abc"); + if (!abc_mod) { + Py_DECREF((PyObject *)&Arraytype); + return -1; + } + PyObject *mutablesequence = PyObject_GetAttrString(abc_mod, "MutableSequence"); + Py_DECREF(abc_mod); + if (!mutablesequence) { + Py_DECREF((PyObject *)&Arraytype); + return -1; + } + PyObject *res = PyObject_CallMethod(mutablesequence, "register", "O", (PyObject *)&Arraytype); + Py_DECREF(mutablesequence); + if (!res) { + Py_DECREF((PyObject *)&Arraytype); + return -1; + } + Py_DECREF(res); + Py_INCREF((PyObject *)&Arraytype); if (PyModule_AddObject(m, "array", (PyObject *)&Arraytype) < 0) { Py_DECREF((PyObject *)&Arraytype); From webhook-mailer at python.org Sun Jul 5 21:42:31 2020 From: webhook-mailer at python.org (Joannah Nanjekye) Date: Mon, 06 Jul 2020 01:42:31 -0000 Subject: [Python-checkins] bpo-26205: Specify the number of nested scopes (GH-21324) Message-ID: https://github.com/python/cpython/commit/9ed3cd8ba052b395ab50692bb65988b065d68e27 commit: 9ed3cd8ba052b395ab50692bb65988b065d68e27 branch: master author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> committer: GitHub date: 2020-07-05T22:42:24-03:00 summary: bpo-26205: Specify the number of nested scopes (GH-21324) * Clarify number of scopes * Indicate 3 or 4 Co-authored-by: Terry Jan Reedy Co-authored-by: Terry Jan Reedy files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 06bdd0d93515e..250d2a9ddb416 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, there are at least three nested scopes whose namespaces -are directly accessible: +time during execution, At any 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 webhook-mailer at python.org Sun Jul 5 21:47:19 2020 From: webhook-mailer at python.org (Joannah Nanjekye) Date: Mon, 06 Jul 2020 01:47:19 -0000 Subject: [Python-checkins] bpo-28681: Clarify multiple function names in the tutorial (GH-21340) Message-ID: https://github.com/python/cpython/commit/d12af71047f0eae86440654d3ea74c032c7c3558 commit: d12af71047f0eae86440654d3ea74c032c7c3558 branch: master author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> committer: GitHub date: 2020-07-05T22:47:15-03:00 summary: bpo-28681: Clarify multiple function names in the tutorial (GH-21340) * improve control flow docs * Add also Co-authored-by: Terry Jan Reedy Co-authored-by: Terry Jan Reedy files: M Doc/tutorial/controlflow.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 26de866aab90c..5d5b01d813277 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -300,11 +300,10 @@ passed using *call by value* (where the *value* is always an object *reference*, not the value of the object). [#]_ When a function calls another function, a new local symbol table is created for that call. -A function definition introduces the function name in the current symbol table. -The value of the function name has a type that is recognized by the interpreter -as a user-defined function. This value can be assigned to another name which -can then also be used as a function. This serves as a general renaming -mechanism:: +A function definition associates the function name with the function object in +the current symbol table. The interpreter recognizes the object pointed to by +that name as a user-defined function. Other names can also point to that same +function object and can also be used to access the function:: >>> fib From webhook-mailer at python.org Sun Jul 5 21:53:44 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Jul 2020 01:53:44 -0000 Subject: [Python-checkins] bpo-26205: Specify the number of nested scopes (GH-21324) (GH-21342) Message-ID: https://github.com/python/cpython/commit/7ceb3e3ffc8ee00551df2245544eb60f7debf3af commit: 7ceb3e3ffc8ee00551df2245544eb60f7debf3af branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-05T22:53:40-03:00 summary: bpo-26205: Specify the number of nested scopes (GH-21324) (GH-21342) * Clarify number of scopes * Indicate 3 or 4 Co-authored-by: Terry Jan Reedy Co-authored-by: Terry Jan Reedy (cherry picked from commit 9ed3cd8ba052b395ab50692bb65988b065d68e27) Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 06bdd0d93515e..250d2a9ddb416 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, there are at least three nested scopes whose namespaces -are directly accessible: +time during execution, At any 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 webhook-mailer at python.org Sun Jul 5 22:08:04 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Jul 2020 02:08:04 -0000 Subject: [Python-checkins] bpo-28681: Clarify multiple function names in the tutorial (GH-21340) (GH-21344) Message-ID: https://github.com/python/cpython/commit/6790f9badda47c7aa0fe4b0b5f090d6ca0c477d5 commit: 6790f9badda47c7aa0fe4b0b5f090d6ca0c477d5 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-05T23:07:59-03:00 summary: bpo-28681: Clarify multiple function names in the tutorial (GH-21340) (GH-21344) * improve control flow docs * Add also Co-authored-by: Terry Jan Reedy Co-authored-by: Terry Jan Reedy (cherry picked from commit d12af71047f0eae86440654d3ea74c032c7c3558) Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> files: M Doc/tutorial/controlflow.rst diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index f05f5edd5ccc4..de2c73a398eda 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -297,11 +297,10 @@ passed using *call by value* (where the *value* is always an object *reference*, not the value of the object). [#]_ When a function calls another function, a new local symbol table is created for that call. -A function definition introduces the function name in the current symbol table. -The value of the function name has a type that is recognized by the interpreter -as a user-defined function. This value can be assigned to another name which -can then also be used as a function. This serves as a general renaming -mechanism:: +A function definition associates the function name with the function object in +the current symbol table. The interpreter recognizes the object pointed to by +that name as a user-defined function. Other names can also point to that same +function object and can also be used to access the function:: >>> fib From webhook-mailer at python.org Sun Jul 5 22:48:39 2020 From: webhook-mailer at python.org (Inada Naoki) Date: Mon, 06 Jul 2020 02:48:39 -0000 Subject: [Python-checkins] bpo-41165: Deprecate PyEval_ReleaseLock() (GH-21309) Message-ID: https://github.com/python/cpython/commit/9ce8132e1f2339cfe116dfd4795574182c2245b4 commit: 9ce8132e1f2339cfe116dfd4795574182c2245b4 branch: master author: Inada Naoki committer: GitHub date: 2020-07-06T11:48:30+09:00 summary: bpo-41165: Deprecate PyEval_ReleaseLock() (GH-21309) files: M Include/ceval.h diff --git a/Include/ceval.h b/Include/ceval.h index df5253900eea7..0f372e2044a1c 100644 --- a/Include/ceval.h +++ b/Include/ceval.h @@ -128,8 +128,12 @@ PyAPI_FUNC(void) PyEval_RestoreThread(PyThreadState *); Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); +/* PyEval_AcquireLock() and PyEval_ReleaseLock() are part of stable ABI. + * They will be removed from this header file in the future version. + * But they will be remained in ABI until Python 4.0. + */ Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_AcquireLock(void); -/* Py_DEPRECATED(3.2) */ PyAPI_FUNC(void) PyEval_ReleaseLock(void); +Py_DEPRECATED(3.2) PyAPI_FUNC(void) PyEval_ReleaseLock(void); PyAPI_FUNC(void) PyEval_AcquireThread(PyThreadState *tstate); PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate); From webhook-mailer at python.org Mon Jul 6 05:12:55 2020 From: webhook-mailer at python.org (Hai Shi) Date: Mon, 06 Jul 2020 09:12:55 -0000 Subject: [Python-checkins] bpo-40275: Use new test.support helper submodules in tests (GH-21314) Message-ID: https://github.com/python/cpython/commit/883bc638335a57a6e6a6344c2fc132c4f9a0ec42 commit: 883bc638335a57a6e6a6344c2fc132c4f9a0ec42 branch: master author: Hai Shi committer: GitHub date: 2020-07-06T11:12:49+02:00 summary: bpo-40275: Use new test.support helper submodules in tests (GH-21314) files: M Lib/test/pickletester.py M Lib/test/test_binhex.py M Lib/test/test_bufio.py M Lib/test/test_capi.py M Lib/test/test_compileall.py M Lib/test/test_fileio.py M Lib/test/test_heapq.py M Lib/test/test_httplib.py M Lib/test/test_importlib/util.py M Lib/test/test_io.py M Lib/test/test_json/__init__.py M Lib/test/test_json/test_tool.py M Lib/test/test_netrc.py M Lib/test/test_nis.py M Lib/test/test_pickle.py M Lib/test/test_py_compile.py M Lib/test/test_sqlite.py M Lib/test/test_univnewlines.py M Lib/test/test_uuid.py diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index a34505aab51c1..afbc2b3bf0a79 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -22,10 +22,13 @@ _testbuffer = None from test import support +from test.support import os_helper from test.support import ( - TestFailed, TESTFN, run_with_locale, no_tracing, - _2G, _4G, bigmemtest, forget, + TestFailed, run_with_locale, no_tracing, + _2G, _4G, bigmemtest ) +from test.support.import_helper import forget +from test.support.os_helper import TESTFN from test.support import threading_helper from test.support.warnings_helper import save_restore_warnings_filters @@ -3100,7 +3103,7 @@ def test_dump_closed_file(self): f.close() self.assertRaises(ValueError, self.dump, 123, f) finally: - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def test_load_closed_file(self): f = open(TESTFN, "wb") @@ -3108,7 +3111,7 @@ def test_load_closed_file(self): f.close() self.assertRaises(ValueError, self.dump, 123, f) finally: - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def test_load_from_and_dump_to_file(self): stream = io.BytesIO() @@ -3139,7 +3142,7 @@ def test_dump_text_file(self): self.assertRaises(TypeError, self.dump, 123, f, proto) finally: f.close() - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def test_incomplete_input(self): s = io.BytesIO(b"X''.") diff --git a/Lib/test/test_binhex.py b/Lib/test/test_binhex.py index 591f32a4f0f7f..5e59f5761514c 100644 --- a/Lib/test/test_binhex.py +++ b/Lib/test/test_binhex.py @@ -5,23 +5,27 @@ """ import unittest from test import support +from test.support import import_helper +from test.support import os_helper +from test.support import warnings_helper -with support.check_warnings(('', DeprecationWarning)): - binhex = support.import_fresh_module('binhex') + +with warnings_helper.check_warnings(('', DeprecationWarning)): + binhex = import_helper.import_fresh_module('binhex') class BinHexTestCase(unittest.TestCase): def setUp(self): # binhex supports only file names encodable to Latin1 - self.fname1 = support.TESTFN_ASCII + "1" - self.fname2 = support.TESTFN_ASCII + "2" - self.fname3 = support.TESTFN_ASCII + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__" + self.fname1 = os_helper.TESTFN_ASCII + "1" + self.fname2 = os_helper.TESTFN_ASCII + "2" + self.fname3 = os_helper.TESTFN_ASCII + "very_long_filename__very_long_filename__very_long_filename__very_long_filename__" def tearDown(self): - support.unlink(self.fname1) - support.unlink(self.fname2) - support.unlink(self.fname3) + os_helper.unlink(self.fname1) + os_helper.unlink(self.fname2) + os_helper.unlink(self.fname3) DATA = b'Jack is my hero' diff --git a/Lib/test/test_bufio.py b/Lib/test/test_bufio.py index fea6da491e491..17151b13615e9 100644 --- a/Lib/test/test_bufio.py +++ b/Lib/test/test_bufio.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import os_helper import io # C implementation. import _pyio as pyio # Python implementation. @@ -17,18 +18,18 @@ def try_one(self, s): # .readline()s deliver what we wrote. # Ensure we can open TESTFN for writing. - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) # Since C doesn't guarantee we can write/read arbitrary bytes in text # files, use binary mode. - f = self.open(support.TESTFN, "wb") + f = self.open(os_helper.TESTFN, "wb") try: # write once with \n and once without f.write(s) f.write(b"\n") f.write(s) f.close() - f = open(support.TESTFN, "rb") + f = open(os_helper.TESTFN, "rb") line = f.readline() self.assertEqual(line, s + b"\n") line = f.readline() @@ -37,7 +38,7 @@ def try_one(self, s): self.assertFalse(line) # Must be at EOF f.close() finally: - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def drive_one(self, pattern): for length in lengths: diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 3e7afd5a2a1e4..55027c9cbcd43 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -17,6 +17,7 @@ import importlib.util from test import support from test.support import MISSING_C_DOCSTRINGS +from test.support import import_helper from test.support import threading_helper from test.support.script_helper import assert_python_failure, assert_python_ok try: @@ -25,7 +26,7 @@ _posixsubprocess = None # Skip this test if the _testcapi module isn't available. -_testcapi = support.import_module('_testcapi') +_testcapi = import_helper.import_module('_testcapi') import _testinternalcapi diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index 3bbc6817f8d56..be1149a87faef 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -23,6 +23,7 @@ _have_multiprocessing = False from test import support +from test.support import os_helper from test.support import script_helper from .test_py_compile import without_source_date_epoch @@ -356,7 +357,7 @@ def test_multiple_optimization_levels(self): except Exception: pass - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_ignore_symlink_destination(self): # Create folders for allowed files, symlinks and prohibited area allowed_path = os.path.join(self.directory, "test", "dir", "allowed") @@ -438,7 +439,7 @@ def setUpClass(cls): sys_path_writable = False break finally: - support.unlink(str(path)) + os_helper.unlink(str(path)) if directory_created: directory.rmdir() else: @@ -477,7 +478,7 @@ def assertNotCompiled(self, fn): def setUp(self): self.directory = tempfile.mkdtemp() - self.addCleanup(support.rmtree, self.directory) + self.addCleanup(os_helper.rmtree, self.directory) self.pkgdir = os.path.join(self.directory, 'foo') os.mkdir(self.pkgdir) self.pkgdir_cachedir = os.path.join(self.pkgdir, '__pycache__') @@ -625,7 +626,7 @@ def test_recursion_limit(self): self.assertCompiled(spamfn) self.assertCompiled(eggfn) - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_symlink_loop(self): # Currently, compileall ignores symlinks to directories. # If that limitation is ever lifted, it should protect against @@ -823,7 +824,7 @@ def test_multiple_optimization_levels(self): except Exception: pass - @support.skip_unless_symlink + @os_helper.skip_unless_symlink def test_ignore_symlink_destination(self): # Create folders for allowed files, symlinks and prohibited area allowed_path = os.path.join(self.directory, "test", "dir", "allowed") diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 26e4500ae8cfc..ff611a90eede3 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -9,8 +9,9 @@ from weakref import proxy from functools import wraps -from test.support import (TESTFN, TESTFN_UNICODE, check_warnings, run_unittest, - make_bad_fd, cpython_only, swap_attr) +from test.support import (run_unittest, cpython_only, swap_attr) +from test.support.os_helper import (TESTFN, TESTFN_UNICODE, make_bad_fd) +from test.support.warnings_helper import check_warnings from collections import UserList import _io # C implementation of io diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py index 6902573e8fa85..ebbc62745707c 100644 --- a/Lib/test/test_heapq.py +++ b/Lib/test/test_heapq.py @@ -5,11 +5,12 @@ import doctest from test import support +from test.support import import_helper from unittest import TestCase, skipUnless from operator import itemgetter -py_heapq = support.import_fresh_module('heapq', blocked=['_heapq']) -c_heapq = support.import_fresh_module('heapq', fresh=['_heapq']) +py_heapq = import_helper.import_fresh_module('heapq', blocked=['_heapq']) +c_heapq = import_helper.import_fresh_module('heapq', fresh=['_heapq']) # _heapq.nlargest/nsmallest are saved in heapq._nlargest/_smallest when # _heapq is imported, so check them there diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index e909980d23aac..1ac31bf2a8e7f 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -13,7 +13,10 @@ TestCase = unittest.TestCase from test import support +from test.support import os_helper from test.support import socket_helper +from test.support import warnings_helper + here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' @@ -1766,14 +1769,14 @@ def test_local_bad_hostname(self): with self.assertRaises(ssl.CertificateError): h.request('GET', '/') # Same with explicit check_hostname=True - with support.check_warnings(('', DeprecationWarning)): + with warnings_helper.check_warnings(('', DeprecationWarning)): h = client.HTTPSConnection('localhost', server.port, context=context, check_hostname=True) with self.assertRaises(ssl.CertificateError): h.request('GET', '/') # With check_hostname=False, the mismatching is ignored context.check_hostname = False - with support.check_warnings(('', DeprecationWarning)): + with warnings_helper.check_warnings(('', DeprecationWarning)): h = client.HTTPSConnection('localhost', server.port, context=context, check_hostname=False) h.request('GET', '/nonexistent') @@ -1792,7 +1795,7 @@ def test_local_bad_hostname(self): h.close() # Passing check_hostname to HTTPSConnection should override the # context's setting. - with support.check_warnings(('', DeprecationWarning)): + with warnings_helper.check_warnings(('', DeprecationWarning)): h = client.HTTPSConnection('localhost', server.port, context=context, check_hostname=True) with self.assertRaises(ssl.CertificateError): @@ -1908,10 +1911,10 @@ def test_bytes_body(self): self.assertEqual(b'body\xc1', f.read()) def test_text_file_body(self): - 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("body") - with open(support.TESTFN) as f: + with open(os_helper.TESTFN) as f: self.conn.request("PUT", "/url", f) message, f = self.get_headers_and_fp() self.assertEqual("text/plain", message.get_content_type()) @@ -1923,10 +1926,10 @@ def test_text_file_body(self): self.assertEqual(b'4\r\nbody\r\n0\r\n\r\n', f.read()) def test_binary_file_body(self): - self.addCleanup(support.unlink, support.TESTFN) - with open(support.TESTFN, "wb") as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, "wb") as f: f.write(b"body\xc1") - with open(support.TESTFN, "rb") as f: + with open(os_helper.TESTFN, "rb") as f: self.conn.request("PUT", "/url", f) message, f = self.get_headers_and_fp() self.assertEqual("text/plain", message.get_content_type()) diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py index de6e0b0256018..2745c9b7e3c3b 100644 --- a/Lib/test/test_importlib/util.py +++ b/Lib/test/test_importlib/util.py @@ -12,6 +12,7 @@ import os.path from pathlib import Path, PurePath from test import support +from test.support import import_helper import unittest import sys import tempfile @@ -55,8 +56,8 @@ def _extension_details(): def import_importlib(module_name): """Import a module from importlib both w/ and w/o _frozen_importlib.""" fresh = ('importlib',) if '.' in module_name else () - frozen = support.import_fresh_module(module_name) - source = support.import_fresh_module(module_name, fresh=fresh, + frozen = import_helper.import_fresh_module(module_name) + source = import_helper.import_fresh_module(module_name, fresh=fresh, blocked=('_frozen_importlib', '_frozen_importlib_external')) return {'Frozen': frozen, 'Source': source} diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index c0d67a17d8c6f..18b8a7941668f 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -40,8 +40,11 @@ from test import support from test.support.script_helper import ( assert_python_ok, assert_python_failure, run_python_until_end) +from test.support import import_helper +from test.support import os_helper from test.support import threading_helper -from test.support import FakePath +from test.support import warnings_helper +from test.support.os_helper import FakePath import codecs import io # C implementation of io @@ -317,10 +320,10 @@ class PyMockNonBlockWriterIO(MockNonBlockWriterIO, pyio.RawIOBase): class IOTest(unittest.TestCase): def setUp(self): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def tearDown(self): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def write_ops(self, f): self.assertEqual(f.write(b"blah."), 5) @@ -405,19 +408,19 @@ def test_invalid_operations(self): # Try writing on a file opened in read mode and vice-versa. exc = self.UnsupportedOperation for mode in ("w", "wb"): - with self.open(support.TESTFN, mode) as fp: + with self.open(os_helper.TESTFN, mode) as fp: self.assertRaises(exc, fp.read) self.assertRaises(exc, fp.readline) - with self.open(support.TESTFN, "wb", buffering=0) as fp: + with self.open(os_helper.TESTFN, "wb", buffering=0) as fp: self.assertRaises(exc, fp.read) self.assertRaises(exc, fp.readline) - with self.open(support.TESTFN, "rb", buffering=0) as fp: + with self.open(os_helper.TESTFN, "rb", buffering=0) as fp: self.assertRaises(exc, fp.write, b"blah") self.assertRaises(exc, fp.writelines, [b"blah\n"]) - with self.open(support.TESTFN, "rb") as fp: + with self.open(os_helper.TESTFN, "rb") as fp: self.assertRaises(exc, fp.write, b"blah") self.assertRaises(exc, fp.writelines, [b"blah\n"]) - with self.open(support.TESTFN, "r") as fp: + with self.open(os_helper.TESTFN, "r") as fp: self.assertRaises(exc, fp.write, "blah") self.assertRaises(exc, fp.writelines, ["blah\n"]) # Non-zero seeking from current or end pos @@ -538,33 +541,33 @@ def test_open_handles_NUL_chars(self): self.assertRaises(ValueError, self.open, bytes_fn, 'w') def test_raw_file_io(self): - with self.open(support.TESTFN, "wb", buffering=0) as f: + with self.open(os_helper.TESTFN, "wb", buffering=0) as f: self.assertEqual(f.readable(), False) self.assertEqual(f.writable(), True) self.assertEqual(f.seekable(), True) self.write_ops(f) - with self.open(support.TESTFN, "rb", buffering=0) as f: + with self.open(os_helper.TESTFN, "rb", buffering=0) as f: self.assertEqual(f.readable(), True) self.assertEqual(f.writable(), False) self.assertEqual(f.seekable(), True) self.read_ops(f) def test_buffered_file_io(self): - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: self.assertEqual(f.readable(), False) self.assertEqual(f.writable(), True) self.assertEqual(f.seekable(), True) self.write_ops(f) - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.readable(), True) self.assertEqual(f.writable(), False) self.assertEqual(f.seekable(), True) self.read_ops(f, True) def test_readline(self): - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line") - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.readline(), b"abc\n") self.assertEqual(f.readline(10), b"def\n") self.assertEqual(f.readline(2), b"xy") @@ -572,7 +575,7 @@ def test_readline(self): self.assertEqual(f.readline(), b"foo\x00bar\n") self.assertEqual(f.readline(None), b"another line") self.assertRaises(TypeError, f.readline, 5.3) - with self.open(support.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r") as f: self.assertRaises(TypeError, f.readline, 5.3) def test_readline_nonsizeable(self): @@ -607,20 +610,20 @@ def test_large_file_ops(self): support.requires( 'largefile', 'test requires %s bytes and a long time to run' % self.LARGE) - with self.open(support.TESTFN, "w+b", 0) as f: + with self.open(os_helper.TESTFN, "w+b", 0) as f: self.large_file_ops(f) - with self.open(support.TESTFN, "w+b") as f: + with self.open(os_helper.TESTFN, "w+b") as f: self.large_file_ops(f) def test_with_open(self): for bufsize in (0, 100): f = None - with self.open(support.TESTFN, "wb", bufsize) as f: + with self.open(os_helper.TESTFN, "wb", bufsize) as f: f.write(b"xxx") self.assertEqual(f.closed, True) f = None try: - with self.open(support.TESTFN, "wb", bufsize) as f: + with self.open(os_helper.TESTFN, "wb", bufsize) as f: 1/0 except ZeroDivisionError: self.assertEqual(f.closed, True) @@ -629,13 +632,13 @@ def test_with_open(self): # issue 5008 def test_append_mode_tell(self): - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(b"xxx") - with self.open(support.TESTFN, "ab", buffering=0) as f: + with self.open(os_helper.TESTFN, "ab", buffering=0) as f: self.assertEqual(f.tell(), 3) - with self.open(support.TESTFN, "ab") as f: + with self.open(os_helper.TESTFN, "ab") as f: self.assertEqual(f.tell(), 3) - with self.open(support.TESTFN, "a") as f: + with self.open(os_helper.TESTFN, "a") as f: self.assertGreater(f.tell(), 0) def test_destructor(self): @@ -655,13 +658,13 @@ def close(self): def flush(self): record.append(3) super().flush() - with support.check_warnings(('', ResourceWarning)): - f = MyFileIO(support.TESTFN, "wb") + with warnings_helper.check_warnings(('', ResourceWarning)): + f = MyFileIO(os_helper.TESTFN, "wb") f.write(b"xxx") del f support.gc_collect() self.assertEqual(record, [1, 2, 3]) - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"xxx") def _check_base_destructor(self, base): @@ -707,9 +710,9 @@ def test_TextIOBase_destructor(self): self._check_base_destructor(self.TextIOBase) def test_close_flushes(self): - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(b"xxx") - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"xxx") def test_array_writes(self): @@ -720,25 +723,25 @@ def check(f): self.assertEqual(f.write(a), n) f.writelines((a,)) check(self.BytesIO()) - check(self.FileIO(support.TESTFN, "w")) + check(self.FileIO(os_helper.TESTFN, "w")) check(self.BufferedWriter(self.MockRawIO())) check(self.BufferedRandom(self.MockRawIO())) check(self.BufferedRWPair(self.MockRawIO(), self.MockRawIO())) def test_closefd(self): - self.assertRaises(ValueError, self.open, support.TESTFN, 'w', + self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'w', closefd=False) def test_read_closed(self): - with self.open(support.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w") as f: f.write("egg\n") - with self.open(support.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r") as f: file = self.open(f.fileno(), "r", closefd=False) self.assertEqual(file.read(), "egg\n") file.seek(0) file.close() self.assertRaises(ValueError, file.read) - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: file = self.open(f.fileno(), "rb", closefd=False) self.assertEqual(file.read()[:3], b"egg") file.close() @@ -746,12 +749,12 @@ def test_read_closed(self): def test_no_closefd_with_filename(self): # can't use closefd in combination with a file name - self.assertRaises(ValueError, self.open, support.TESTFN, "r", closefd=False) + self.assertRaises(ValueError, self.open, os_helper.TESTFN, "r", closefd=False) def test_closefd_attr(self): - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(b"egg\n") - with self.open(support.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r") as f: self.assertEqual(f.buffer.raw.closefd, True) file = self.open(f.fileno(), "r", closefd=False) self.assertEqual(file.buffer.raw.closefd, False) @@ -759,15 +762,15 @@ def test_closefd_attr(self): def test_garbage_collection(self): # FileIO objects are collected, and collecting them flushes # all data to disk. - with support.check_warnings(('', ResourceWarning)): - f = self.FileIO(support.TESTFN, "wb") + with warnings_helper.check_warnings(('', ResourceWarning)): + f = self.FileIO(os_helper.TESTFN, "wb") f.write(b"abcxxx") f.f = f wr = weakref.ref(f) del f support.gc_collect() self.assertIsNone(wr(), wr) - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"abcxxx") def test_unbounded_file(self): @@ -804,29 +807,29 @@ def bad_flush(): def test_flush_error_on_close(self): # raw file # Issue #5700: io.FileIO calls flush() after file closed - self.check_flush_error_on_close(support.TESTFN, 'wb', buffering=0) - fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT) + self.check_flush_error_on_close(os_helper.TESTFN, 'wb', buffering=0) + fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) self.check_flush_error_on_close(fd, 'wb', buffering=0) - fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT) + fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) self.check_flush_error_on_close(fd, 'wb', buffering=0, closefd=False) os.close(fd) # buffered io - self.check_flush_error_on_close(support.TESTFN, 'wb') - fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT) + self.check_flush_error_on_close(os_helper.TESTFN, 'wb') + fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) self.check_flush_error_on_close(fd, 'wb') - fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT) + fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) self.check_flush_error_on_close(fd, 'wb', closefd=False) os.close(fd) # text io - self.check_flush_error_on_close(support.TESTFN, 'w') - fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT) + self.check_flush_error_on_close(os_helper.TESTFN, 'w') + fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) self.check_flush_error_on_close(fd, 'w') - fd = os.open(support.TESTFN, os.O_WRONLY|os.O_CREAT) + fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) self.check_flush_error_on_close(fd, 'w', closefd=False) os.close(fd) def test_multi_close(self): - f = self.open(support.TESTFN, "wb", buffering=0) + f = self.open(os_helper.TESTFN, "wb", buffering=0) f.close() f.close() f.close() @@ -857,9 +860,9 @@ def test_types_have_dict(self): self.assertTrue(hasattr(obj, "__dict__")) def test_opener(self): - with self.open(support.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w") as f: f.write("egg\n") - fd = os.open(support.TESTFN, os.O_RDONLY) + fd = os.open(os_helper.TESTFN, os.O_RDONLY) def opener(path, flags): return fd with self.open("non-existent", "r", opener=opener) as f: @@ -894,14 +897,14 @@ def test_fileio_closefd(self): f2.readline() def test_nonbuffered_textio(self): - with support.check_no_resource_warning(self): + with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): - self.open(support.TESTFN, 'w', buffering=0) + self.open(os_helper.TESTFN, 'w', buffering=0) def test_invalid_newline(self): - with support.check_no_resource_warning(self): + with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): - self.open(support.TESTFN, 'w', newline='invalid') + self.open(os_helper.TESTFN, 'w', newline='invalid') def test_buffered_readinto_mixin(self): # Test the implementation provided by BufferedIOBase @@ -924,10 +927,10 @@ def check_path_succeeds(path): with self.open(path, "r") as f: self.assertEqual(f.read(), "egg\n") - check_path_succeeds(FakePath(support.TESTFN)) - check_path_succeeds(FakePath(support.TESTFN.encode('utf-8'))) + check_path_succeeds(FakePath(os_helper.TESTFN)) + check_path_succeeds(FakePath(os_helper.TESTFN.encode('utf-8'))) - with self.open(support.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w") as f: bad_path = FakePath(f.fileno()) with self.assertRaises(TypeError): self.open(bad_path, 'w') @@ -942,7 +945,7 @@ def check_path_succeeds(path): # ensure that refcounting is correct with some error conditions with self.assertRaisesRegex(ValueError, 'read/write/append mode'): - self.open(FakePath(support.TESTFN), 'rwxa') + self.open(FakePath(os_helper.TESTFN), 'rwxa') def test_RawIOBase_readall(self): # Exercise the default unlimited RawIOBase.read() and readall() @@ -1454,9 +1457,9 @@ def test_threads(self): l = list(range(256)) * N random.shuffle(l) s = bytes(bytearray(l)) - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(s) - with self.open(support.TESTFN, self.read_mode, buffering=0) as raw: + with self.open(os_helper.TESTFN, self.read_mode, buffering=0) as raw: bufio = self.tp(raw, 8) errors = [] results = [] @@ -1482,7 +1485,7 @@ def f(): c = bytes(bytearray([i])) self.assertEqual(s.count(c), N) finally: - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_unseekable(self): bufio = self.tp(self.MockUnseekableIO(b"A" * 10)) @@ -1572,9 +1575,9 @@ def test_misbehaved_io_read(self): def test_garbage_collection(self): # C BufferedReader objects are collected. # The Python version has __del__, so it ends into gc.garbage instead - self.addCleanup(support.unlink, support.TESTFN) - with support.check_warnings(('', ResourceWarning)): - rawio = self.FileIO(support.TESTFN, "w+b") + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with warnings_helper.check_warnings(('', ResourceWarning)): + rawio = self.FileIO(os_helper.TESTFN, "w+b") f = self.tp(rawio) f.f = f wr = weakref.ref(f) @@ -1791,26 +1794,26 @@ def test_destructor(self): def test_truncate(self): # Truncate implicitly flushes the buffer. - self.addCleanup(support.unlink, support.TESTFN) - with self.open(support.TESTFN, self.write_mode, buffering=0) as raw: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with self.open(os_helper.TESTFN, self.write_mode, buffering=0) as raw: bufio = self.tp(raw, 8) bufio.write(b"abcdef") self.assertEqual(bufio.truncate(3), 3) self.assertEqual(bufio.tell(), 6) - with self.open(support.TESTFN, "rb", buffering=0) as f: + with self.open(os_helper.TESTFN, "rb", buffering=0) as f: self.assertEqual(f.read(), b"abc") def test_truncate_after_write(self): # Ensure that truncate preserves the file position after # writes longer than the buffer size. # Issue: https://bugs.python.org/issue32228 - self.addCleanup(support.unlink, support.TESTFN) - with self.open(support.TESTFN, "wb") as f: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with self.open(os_helper.TESTFN, "wb") as f: # Fill with some buffer f.write(b'\x00' * 10000) buffer_sizes = [8192, 4096, 200] for buffer_size in buffer_sizes: - with self.open(support.TESTFN, "r+b", buffering=buffer_size) as f: + with self.open(os_helper.TESTFN, "r+b", buffering=buffer_size) as f: f.write(b'\x00' * (buffer_size + 1)) # After write write_pos and write_end are set to 0 f.read(1) @@ -1838,7 +1841,7 @@ def test_threads(self): # writing the buffer to the raw streams. This is in addition # to concurrency issues due to switching threads in the middle # of Python code. - with self.open(support.TESTFN, self.write_mode, buffering=0) as raw: + with self.open(os_helper.TESTFN, self.write_mode, buffering=0) as raw: bufio = self.tp(raw, 8) errors = [] def f(): @@ -1858,12 +1861,12 @@ def f(): self.assertFalse(errors, "the following exceptions were caught: %r" % errors) bufio.close() - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: s = f.read() for i in range(256): self.assertEqual(s.count(bytes([i])), N) finally: - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_misbehaved_io(self): rawio = self.MisbehavedRawIO() @@ -1931,9 +1934,9 @@ def test_garbage_collection(self): # C BufferedWriter objects are collected, and collecting them flushes # all data to disk. # The Python version has __del__, so it ends into gc.garbage instead - self.addCleanup(support.unlink, support.TESTFN) - with support.check_warnings(('', ResourceWarning)): - rawio = self.FileIO(support.TESTFN, "w+b") + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with warnings_helper.check_warnings(('', ResourceWarning)): + rawio = self.FileIO(os_helper.TESTFN, "w+b") f = self.tp(rawio) f.write(b"123xxx") f.x = f @@ -1941,7 +1944,7 @@ def test_garbage_collection(self): del f support.gc_collect() self.assertIsNone(wr(), wr) - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"123xxx") def test_args_error(self): @@ -2579,10 +2582,10 @@ class TextIOWrapperTest(unittest.TestCase): def setUp(self): self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n" self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii") - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def tearDown(self): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_constructor(self): r = self.BytesIO(b"\xc3\xa9\n\n") @@ -2918,11 +2921,11 @@ def test_error_through_destructor(self): def test_basic_io(self): for chunksize in (1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65): for enc in "ascii", "latin-1", "utf-8" :# , "utf-16-be", "utf-16-le": - f = self.open(support.TESTFN, "w+", encoding=enc) + f = self.open(os_helper.TESTFN, "w+", encoding=enc) f._CHUNK_SIZE = chunksize self.assertEqual(f.write("abc"), 3) f.close() - f = self.open(support.TESTFN, "r+", encoding=enc) + f = self.open(os_helper.TESTFN, "r+", encoding=enc) f._CHUNK_SIZE = chunksize self.assertEqual(f.tell(), 0) self.assertEqual(f.read(), "abc") @@ -2967,7 +2970,7 @@ def multi_line_test(self, f, enc): self.assertEqual(rlines, wlines) def test_telling(self): - f = self.open(support.TESTFN, "w+", encoding="utf-8") + f = self.open(os_helper.TESTFN, "w+", encoding="utf-8") p0 = f.tell() f.write("\xff\n") p1 = f.tell() @@ -2995,9 +2998,9 @@ def test_seeking(self): u_suffix = "\u8888\n" suffix = bytes(u_suffix.encode("utf-8")) line = prefix + suffix - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(line*2) - with self.open(support.TESTFN, "r", encoding="utf-8") as f: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: s = f.read(prefix_size) self.assertEqual(s, str(prefix, "ascii")) self.assertEqual(f.tell(), prefix_size) @@ -3006,9 +3009,9 @@ def test_seeking(self): def test_seeking_too(self): # Regression test for a specific bug data = b'\xe0\xbf\xbf\n' - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: f.write(data) - with self.open(support.TESTFN, "r", encoding="utf-8") as f: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: f._CHUNK_SIZE # Just test that it exists f._CHUNK_SIZE = 2 f.readline() @@ -3022,17 +3025,17 @@ def test_seek_and_tell(self): def test_seek_and_tell_with_data(data, min_pos=0): """Tell/seek to various points within a data stream and ensure that the decoded data returned by read() is consistent.""" - f = self.open(support.TESTFN, 'wb') + f = self.open(os_helper.TESTFN, 'wb') f.write(data) f.close() - f = self.open(support.TESTFN, encoding='test_decoder') + f = self.open(os_helper.TESTFN, encoding='test_decoder') f._CHUNK_SIZE = CHUNK_SIZE decoded = f.read() f.close() for i in range(min_pos, len(decoded) + 1): # seek positions for j in [1, 5, len(decoded) - i]: # read lengths - f = self.open(support.TESTFN, encoding='test_decoder') + f = self.open(os_helper.TESTFN, encoding='test_decoder') self.assertEqual(f.read(i), decoded[:i]) cookie = f.tell() self.assertEqual(f.read(j), decoded[i:i + j]) @@ -3062,11 +3065,11 @@ def test_seek_and_tell_with_data(data, min_pos=0): StatefulIncrementalDecoder.codecEnabled = 0 def test_multibyte_seek_and_tell(self): - f = self.open(support.TESTFN, "w", encoding="euc_jp") + f = self.open(os_helper.TESTFN, "w", encoding="euc_jp") f.write("AB\n\u3046\u3048\n") f.close() - f = self.open(support.TESTFN, "r", encoding="euc_jp") + f = self.open(os_helper.TESTFN, "r", encoding="euc_jp") self.assertEqual(f.readline(), "AB\n") p0 = f.tell() self.assertEqual(f.readline(), "\u3046\u3048\n") @@ -3077,7 +3080,7 @@ def test_multibyte_seek_and_tell(self): f.close() def test_seek_with_encoder_state(self): - f = self.open(support.TESTFN, "w", encoding="euc_jis_2004") + f = self.open(os_helper.TESTFN, "w", encoding="euc_jis_2004") f.write("\u00e6\u0300") p0 = f.tell() f.write("\u00e6") @@ -3085,7 +3088,7 @@ def test_seek_with_encoder_state(self): f.write("\u0300") f.close() - f = self.open(support.TESTFN, "r", encoding="euc_jis_2004") + f = self.open(os_helper.TESTFN, "r", encoding="euc_jis_2004") self.assertEqual(f.readline(), "\u00e6\u0300\u0300") f.close() @@ -3229,7 +3232,7 @@ def test_issue2282(self): def test_append_bom(self): # The BOM is not written again when appending to a non-empty file - filename = support.TESTFN + filename = os_helper.TESTFN for charset in ('utf-8-sig', 'utf-16', 'utf-32'): with self.open(filename, 'w', encoding=charset) as f: f.write('aaa') @@ -3244,7 +3247,7 @@ def test_append_bom(self): def test_seek_bom(self): # Same test, but when seeking manually - filename = support.TESTFN + filename = os_helper.TESTFN for charset in ('utf-8-sig', 'utf-16', 'utf-32'): with self.open(filename, 'w', encoding=charset) as f: f.write('aaa') @@ -3259,7 +3262,7 @@ def test_seek_bom(self): def test_seek_append_bom(self): # Same test, but first seek to the start and then to the end - filename = support.TESTFN + filename = os_helper.TESTFN for charset in ('utf-8-sig', 'utf-16', 'utf-32'): with self.open(filename, 'w', encoding=charset) as f: f.write('aaa') @@ -3271,16 +3274,16 @@ def test_seek_append_bom(self): self.assertEqual(f.read(), 'aaaxxx'.encode(charset)) def test_errors_property(self): - with self.open(support.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w") as f: self.assertEqual(f.errors, "strict") - with self.open(support.TESTFN, "w", errors="replace") as f: + with self.open(os_helper.TESTFN, "w", errors="replace") as f: self.assertEqual(f.errors, "replace") @support.no_tracing def test_threads_write(self): # Issue6750: concurrent writes could duplicate data event = threading.Event() - with self.open(support.TESTFN, "w", buffering=1) as f: + with self.open(os_helper.TESTFN, "w", buffering=1) as f: def run(n): text = "Thread%03d\n" % n event.wait() @@ -3289,7 +3292,7 @@ def run(n): for x in range(20)] with threading_helper.start_threads(threads, event.set): time.sleep(0.02) - with self.open(support.TESTFN) as f: + with self.open(os_helper.TESTFN) as f: content = f.read() for n in range(20): self.assertEqual(content.count("Thread%03d\n" % n), 1) @@ -3732,8 +3735,8 @@ def test_garbage_collection(self): # C TextIOWrapper objects are collected, and collecting them flushes # all data to disk. # The Python version has __del__, so it ends in gc.garbage instead. - with support.check_warnings(('', ResourceWarning)): - rawio = io.FileIO(support.TESTFN, "wb") + with warnings_helper.check_warnings(('', ResourceWarning)): + rawio = io.FileIO(os_helper.TESTFN, "wb") b = self.BufferedWriter(rawio) t = self.TextIOWrapper(b, encoding="ascii") t.write("456def") @@ -3742,7 +3745,7 @@ def test_garbage_collection(self): del t support.gc_collect() self.assertIsNone(wr(), wr) - with self.open(support.TESTFN, "rb") as f: + with self.open(os_helper.TESTFN, "rb") as f: self.assertEqual(f.read(), b"456def") def test_rwpair_cleared_before_textio(self): @@ -3899,7 +3902,7 @@ class PyIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest): class MiscIOTest(unittest.TestCase): def tearDown(self): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test___all__(self): for name in self.io.__all__: @@ -3913,21 +3916,21 @@ def test___all__(self): self.assertTrue(issubclass(obj, self.IOBase)) def test_attributes(self): - f = self.open(support.TESTFN, "wb", buffering=0) + f = self.open(os_helper.TESTFN, "wb", buffering=0) self.assertEqual(f.mode, "wb") f.close() - with support.check_warnings(('', DeprecationWarning)): - f = self.open(support.TESTFN, "U") - self.assertEqual(f.name, support.TESTFN) - self.assertEqual(f.buffer.name, support.TESTFN) - self.assertEqual(f.buffer.raw.name, support.TESTFN) + with warnings_helper.check_warnings(('', DeprecationWarning)): + f = self.open(os_helper.TESTFN, "U") + self.assertEqual(f.name, os_helper.TESTFN) + self.assertEqual(f.buffer.name, os_helper.TESTFN) + self.assertEqual(f.buffer.raw.name, os_helper.TESTFN) self.assertEqual(f.mode, "U") self.assertEqual(f.buffer.mode, "rb") self.assertEqual(f.buffer.raw.mode, "rb") f.close() - f = self.open(support.TESTFN, "w+") + f = self.open(os_helper.TESTFN, "w+") self.assertEqual(f.mode, "w+") self.assertEqual(f.buffer.mode, "rb+") # Does it really matter? self.assertEqual(f.buffer.raw.mode, "rb+") @@ -3969,7 +3972,7 @@ def test_io_after_close(self): {"mode": "w+", "buffering": 2}, {"mode": "w+b", "buffering": 0}, ]: - f = self.open(support.TESTFN, **kwargs) + f = self.open(os_helper.TESTFN, **kwargs) f.close() self.assertRaises(ValueError, f.flush) self.assertRaises(ValueError, f.fileno) @@ -4019,17 +4022,17 @@ def test_abcs(self): self.assertIsInstance(self.TextIOBase, abc.ABCMeta) def _check_abc_inheritance(self, abcmodule): - with self.open(support.TESTFN, "wb", buffering=0) as f: + with self.open(os_helper.TESTFN, "wb", buffering=0) as f: self.assertIsInstance(f, abcmodule.IOBase) self.assertIsInstance(f, abcmodule.RawIOBase) self.assertNotIsInstance(f, abcmodule.BufferedIOBase) self.assertNotIsInstance(f, abcmodule.TextIOBase) - with self.open(support.TESTFN, "wb") as f: + with self.open(os_helper.TESTFN, "wb") as f: self.assertIsInstance(f, abcmodule.IOBase) self.assertNotIsInstance(f, abcmodule.RawIOBase) self.assertIsInstance(f, abcmodule.BufferedIOBase) self.assertNotIsInstance(f, abcmodule.TextIOBase) - with self.open(support.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w") as f: self.assertIsInstance(f, abcmodule.IOBase) self.assertNotIsInstance(f, abcmodule.RawIOBase) self.assertNotIsInstance(f, abcmodule.BufferedIOBase) @@ -4053,9 +4056,9 @@ def _check_warn_on_dealloc(self, *args, **kwargs): self.assertIn(r, str(cm.warning.args[0])) def test_warn_on_dealloc(self): - self._check_warn_on_dealloc(support.TESTFN, "wb", buffering=0) - self._check_warn_on_dealloc(support.TESTFN, "wb") - self._check_warn_on_dealloc(support.TESTFN, "w") + self._check_warn_on_dealloc(os_helper.TESTFN, "wb", buffering=0) + self._check_warn_on_dealloc(os_helper.TESTFN, "wb") + self._check_warn_on_dealloc(os_helper.TESTFN, "w") def _check_warn_on_dealloc_fd(self, *args, **kwargs): fds = [] @@ -4073,7 +4076,7 @@ def cleanup_fds(): # When using closefd=False, there's no warning r, w = os.pipe() fds += r, w - with support.check_no_resource_warning(self): + with warnings_helper.check_no_resource_warning(self): open(r, *args, closefd=False, **kwargs) def test_warn_on_dealloc_fd(self): @@ -4096,7 +4099,7 @@ def test_pickling(self): {"mode": "w+b", "buffering": 0}, ]: for protocol in range(pickle.HIGHEST_PROTOCOL + 1): - with self.open(support.TESTFN, **kwargs) as f: + with self.open(os_helper.TESTFN, **kwargs) as f: self.assertRaises(TypeError, pickle.dumps, f, protocol) def test_nonblock_pipe_write_bigbuf(self): @@ -4159,20 +4162,20 @@ def _test_nonblock_pipe_write(self, bufsize): def test_create_fail(self): # 'x' mode fails if file is existing - with self.open(support.TESTFN, 'w'): + with self.open(os_helper.TESTFN, 'w'): pass - self.assertRaises(FileExistsError, self.open, support.TESTFN, 'x') + self.assertRaises(FileExistsError, self.open, os_helper.TESTFN, 'x') def test_create_writes(self): # 'x' mode opens for writing - with self.open(support.TESTFN, 'xb') as f: + with self.open(os_helper.TESTFN, 'xb') as f: f.write(b"spam") - with self.open(support.TESTFN, 'rb') as f: + with self.open(os_helper.TESTFN, 'rb') as f: self.assertEqual(b"spam", f.read()) def test_open_allargs(self): # there used to be a buffer overflow in the parser for rawmode - self.assertRaises(ValueError, self.open, support.TESTFN, 'rwax+') + self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'rwax+') def test_check_encoding_errors(self): # bpo-37388: open() and TextIOWrapper must check encoding and errors @@ -4427,7 +4430,7 @@ def check_interrupted_write_retry(self, item, **fdopen_kwargs): """Check that a buffered write, when it gets interrupted (either returning a partial result or EINTR), properly invokes the signal handler and retries if the latter returned successfully.""" - select = support.import_module("select") + select = import_helper.import_module("select") # A quantity that exceeds the buffer size of an anonymous pipe's # write end. diff --git a/Lib/test/test_json/__init__.py b/Lib/test/test_json/__init__.py index bac370dadfc83..74b64ed86a318 100644 --- a/Lib/test/test_json/__init__.py +++ b/Lib/test/test_json/__init__.py @@ -4,10 +4,12 @@ import unittest from test import support +from test.support import import_helper + # import json with and without accelerations -cjson = support.import_fresh_module('json', fresh=['_json']) -pyjson = support.import_fresh_module('json', blocked=['_json']) +cjson = import_helper.import_fresh_module('json', fresh=['_json']) +pyjson = import_helper.import_fresh_module('json', blocked=['_json']) # JSONDecodeError is cached inside the _json module cjson.JSONDecodeError = cjson.decoder.JSONDecodeError = json.JSONDecodeError diff --git a/Lib/test/test_json/test_tool.py b/Lib/test/test_json/test_tool.py index fc2a7a4fca3c5..5411188acb6a2 100644 --- a/Lib/test/test_json/test_tool.py +++ b/Lib/test/test_json/test_tool.py @@ -6,6 +6,7 @@ import subprocess from test import support +from test.support import os_helper from test.support.script_helper import assert_python_ok @@ -91,7 +92,7 @@ def test_stdin_stdout(self): self.assertEqual(process.stderr, '') def _create_infile(self, data=None): - infile = support.TESTFN + infile = os_helper.TESTFN with open(infile, "w", encoding="utf-8") as fp: self.addCleanup(os.remove, infile) fp.write(data or self.data) @@ -121,7 +122,7 @@ def test_non_ascii_infile(self): def test_infile_outfile(self): infile = self._create_infile() - outfile = support.TESTFN + '.out' + outfile = os_helper.TESTFN + '.out' rc, out, err = assert_python_ok('-m', 'json.tool', infile, outfile) self.addCleanup(os.remove, outfile) with open(outfile, "r") as fp: @@ -189,7 +190,7 @@ def test_compact(self): def test_no_ensure_ascii_flag(self): infile = self._create_infile('{"key":"?"}') - outfile = support.TESTFN + '.out' + outfile = os_helper.TESTFN + '.out' self.addCleanup(os.remove, outfile) assert_python_ok('-m', 'json.tool', '--no-ensure-ascii', infile, outfile) with open(outfile, "rb") as f: @@ -200,7 +201,7 @@ def test_no_ensure_ascii_flag(self): def test_ensure_ascii_default(self): infile = self._create_infile('{"key":"?"}') - outfile = support.TESTFN + '.out' + outfile = os_helper.TESTFN + '.out' self.addCleanup(os.remove, outfile) assert_python_ok('-m', 'json.tool', infile, outfile) with open(outfile, "rb") as f: diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py index 7ce7e565704f7..2bd46aa745ff2 100644 --- a/Lib/test/test_netrc.py +++ b/Lib/test/test_netrc.py @@ -1,5 +1,6 @@ import netrc, os, unittest, sys, tempfile, textwrap from test import support +from test.support import os_helper class NetrcTestCase(unittest.TestCase): @@ -108,16 +109,16 @@ def test_comment_at_end_of_machine_line_pass_has_hash(self): def test_security(self): # This test is incomplete since we are normally not run as root and # therefore can't test the file ownership being wrong. - d = support.TESTFN + d = os_helper.TESTFN os.mkdir(d) - self.addCleanup(support.rmtree, d) + self.addCleanup(os_helper.rmtree, d) fn = os.path.join(d, '.netrc') with open(fn, 'wt') as f: f.write("""\ machine foo.domain.com login bar password pass default login foo password pass """) - with support.EnvironmentVarGuard() as environ: + with os_helper.EnvironmentVarGuard() as environ: environ.set('HOME', d) os.chmod(fn, 0o600) nrc = netrc.netrc() @@ -127,10 +128,10 @@ def test_security(self): self.assertRaises(netrc.NetrcParseError, netrc.netrc) def test_file_not_found_in_home(self): - d = support.TESTFN + d = os_helper.TESTFN os.mkdir(d) - self.addCleanup(support.rmtree, d) - with support.EnvironmentVarGuard() as environ: + self.addCleanup(os_helper.rmtree, d) + with os_helper.EnvironmentVarGuard() as environ: environ.set('HOME', d) self.assertRaises(FileNotFoundError, netrc.netrc) @@ -139,9 +140,9 @@ def test_file_not_found_explicit(self): file='unlikely_netrc') def test_home_not_set(self): - fake_home = support.TESTFN + fake_home = os_helper.TESTFN os.mkdir(fake_home) - self.addCleanup(support.rmtree, fake_home) + self.addCleanup(os_helper.rmtree, fake_home) fake_netrc_path = os.path.join(fake_home, '.netrc') with open(fake_netrc_path, 'w') as f: f.write('machine foo.domain.com login bar password pass') @@ -152,7 +153,7 @@ def test_home_not_set(self): def fake_expanduser(s): called.append(s) - with support.EnvironmentVarGuard() as environ: + with os_helper.EnvironmentVarGuard() as environ: environ.set('HOME', fake_home) environ.set('USERPROFILE', fake_home) result = orig_expanduser(s) diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py index 21074c68106a3..a22142f4069ba 100644 --- a/Lib/test/test_nis.py +++ b/Lib/test/test_nis.py @@ -1,8 +1,10 @@ from test import support +from test.support import import_helper import unittest + # Skip test if nis module does not exist. -nis = support.import_module('nis') +nis = import_helper.import_module('nis') class NisTests(unittest.TestCase): diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index 2307b133dbd0d..1f5cb103933e0 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -10,6 +10,7 @@ import unittest from test import support +from test.support import import_helper from test.pickletester import AbstractHookTests from test.pickletester import AbstractUnpickleTests @@ -499,7 +500,7 @@ def test_exceptions(self): ('builtins', name)) def test_multiprocessing_exceptions(self): - module = support.import_module('multiprocessing.context') + module = import_helper.import_module('multiprocessing.context') for name, exc in get_exceptions(module): with self.subTest(name): self.assertEqual(reverse_mapping('multiprocessing.context', name), diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index d4a68c9320d04..11b579c26e711 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -9,13 +9,14 @@ import unittest from test import support +from test.support import os_helper def without_source_date_epoch(fxn): """Runs function with SOURCE_DATE_EPOCH unset.""" @functools.wraps(fxn) def wrapper(*args, **kwargs): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.unset('SOURCE_DATE_EPOCH') return fxn(*args, **kwargs) return wrapper @@ -25,7 +26,7 @@ def with_source_date_epoch(fxn): """Runs function with SOURCE_DATE_EPOCH set.""" @functools.wraps(fxn) def wrapper(*args, **kwargs): - with support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env['SOURCE_DATE_EPOCH'] = '123456789' return fxn(*args, **kwargs) return wrapper diff --git a/Lib/test/test_sqlite.py b/Lib/test/test_sqlite.py index 9564da35193f1..73002f228fa70 100644 --- a/Lib/test/test_sqlite.py +++ b/Lib/test/test_sqlite.py @@ -1,7 +1,8 @@ import test.support +from test.support import import_helper # Skip test if _sqlite3 module not installed -test.support.import_module('_sqlite3') +import_helper.import_module('_sqlite3') import unittest import sqlite3 diff --git a/Lib/test/test_univnewlines.py b/Lib/test/test_univnewlines.py index fd07539fb60fd..b905491878001 100644 --- a/Lib/test/test_univnewlines.py +++ b/Lib/test/test_univnewlines.py @@ -5,6 +5,8 @@ import os import sys from test import support +from test.support import os_helper + if not hasattr(sys.stdin, 'newlines'): raise unittest.SkipTest( @@ -46,29 +48,29 @@ def setUp(self): data = self.DATA if "b" in self.WRITEMODE: data = data.encode("ascii") - with self.open(support.TESTFN, self.WRITEMODE) as fp: + with self.open(os_helper.TESTFN, self.WRITEMODE) as fp: fp.write(data) def tearDown(self): try: - os.unlink(support.TESTFN) + os.unlink(os_helper.TESTFN) except: pass def test_read(self): - with self.open(support.TESTFN, self.READMODE) as fp: + with self.open(os_helper.TESTFN, self.READMODE) as fp: data = fp.read() self.assertEqual(data, DATA_LF) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readlines(self): - with self.open(support.TESTFN, self.READMODE) as fp: + with self.open(os_helper.TESTFN, self.READMODE) as fp: data = fp.readlines() self.assertEqual(data, DATA_SPLIT) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readline(self): - with self.open(support.TESTFN, self.READMODE) as fp: + with self.open(os_helper.TESTFN, self.READMODE) as fp: data = [] d = fp.readline() while d: @@ -78,7 +80,7 @@ def test_readline(self): self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_seek(self): - with self.open(support.TESTFN, self.READMODE) as fp: + with self.open(os_helper.TESTFN, self.READMODE) as fp: fp.readline() pos = fp.tell() data = fp.readlines() @@ -105,7 +107,7 @@ class TestCRLFNewlines(TestGenericUnivNewlines): DATA = DATA_CRLF def test_tell(self): - with self.open(support.TESTFN, self.READMODE) as fp: + with self.open(os_helper.TESTFN, self.READMODE) as fp: self.assertEqual(repr(fp.newlines), repr(None)) data = fp.readline() pos = fp.tell() diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index b1c92427dd270..718113d6e1bb2 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import import_helper import builtins import contextlib import copy @@ -10,8 +11,8 @@ import weakref from unittest import mock -py_uuid = support.import_fresh_module('uuid', blocked=['_uuid']) -c_uuid = support.import_fresh_module('uuid', fresh=['_uuid']) +py_uuid = import_helper.import_fresh_module('uuid', blocked=['_uuid']) +c_uuid = import_helper.import_fresh_module('uuid', fresh=['_uuid']) def importable(name): try: From webhook-mailer at python.org Mon Jul 6 05:15:12 2020 From: webhook-mailer at python.org (Hai Shi) Date: Mon, 06 Jul 2020 09:15:12 -0000 Subject: [Python-checkins] bpo-40275: Use new test.support helper submodules in tests (GH-21315) Message-ID: https://github.com/python/cpython/commit/a089d21df1ea502b995d8e8a3bcc937cce030802 commit: a089d21df1ea502b995d8e8a3bcc937cce030802 branch: master author: Hai Shi committer: GitHub date: 2020-07-06T11:15:08+02:00 summary: bpo-40275: Use new test.support helper submodules in tests (GH-21315) files: M Lib/ctypes/test/__init__.py M Lib/ctypes/test/test_find.py M Lib/test/test_bytes.py M Lib/test/test_cgitb.py M Lib/test/test_ctypes.py M Lib/test/test_dbm.py M Lib/test/test_fcntl.py M Lib/test/test_file.py M Lib/test/test_fstring.py M Lib/test/test_httpservers.py M Lib/test/test_linecache.py M Lib/test/test_msilib.py M Lib/test/test_picklebuffer.py M Lib/test/test_profile.py M Lib/test/test_pty.py M Lib/test/test_reprlib.py M Lib/test/test_shelve.py M Lib/test/test_tk.py M Lib/test/test_wsgiref.py M Lib/test/test_zlib.py diff --git a/Lib/ctypes/test/__init__.py b/Lib/ctypes/test/__init__.py index 26a70b7696349..6e496fa5a5201 100644 --- a/Lib/ctypes/test/__init__.py +++ b/Lib/ctypes/test/__init__.py @@ -1,9 +1,11 @@ import os import unittest from test import support +from test.support import import_helper + # skip tests if _ctypes was not built -ctypes = support.import_module('ctypes') +ctypes = import_helper.import_module('ctypes') ctypes_symbols = dir(ctypes) def need_symbol(name): diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py index b99fdcba7b28f..bfb6b42cbb227 100644 --- a/Lib/ctypes/test/test_find.py +++ b/Lib/ctypes/test/test_find.py @@ -2,6 +2,7 @@ import os.path import sys import test.support +from test.support import os_helper from ctypes import * from ctypes.util import find_library @@ -65,8 +66,8 @@ def test_gle(self): self.gle.gleGetJoinStyle def test_shell_injection(self): - result = find_library('; echo Hello shell > ' + test.support.TESTFN) - self.assertFalse(os.path.lexists(test.support.TESTFN)) + result = find_library('; echo Hello shell > ' + os_helper.TESTFN) + self.assertFalse(os.path.lexists(os_helper.TESTFN)) self.assertIsNone(result) @@ -100,7 +101,7 @@ def test_find_on_libpath(self): # LD_LIBRARY_PATH) self.assertIsNone(find_library(libname)) # now add the location to LD_LIBRARY_PATH - with test.support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: KEY = 'LD_LIBRARY_PATH' if KEY not in env: v = d diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 770e2c5592cc6..61b4b9162ccc5 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -16,6 +16,7 @@ import unittest import test.support +from test.support import import_helper import test.string_tests import test.list_tests from test.support import bigaddrspacetest, MAX_Py_ssize_t @@ -967,7 +968,7 @@ def test_translate(self): self.assertEqual(c, b'hllo') def test_sq_item(self): - _testcapi = test.support.import_module('_testcapi') + _testcapi = import_helper.import_module('_testcapi') obj = self.type2test((42,)) with self.assertRaises(IndexError): _testcapi.sequence_getitem(obj, -2) @@ -1024,8 +1025,8 @@ def __bytes__(self): # Test PyBytes_FromFormat() def test_from_format(self): - ctypes = test.support.import_module('ctypes') - _testcapi = test.support.import_module('_testcapi') + ctypes = import_helper.import_module('ctypes') + _testcapi = import_helper.import_module('_testcapi') from ctypes import pythonapi, py_object from ctypes import ( c_int, c_uint, diff --git a/Lib/test/test_cgitb.py b/Lib/test/test_cgitb.py index bab152d855456..590ffdea1122a 100644 --- a/Lib/test/test_cgitb.py +++ b/Lib/test/test_cgitb.py @@ -1,4 +1,4 @@ -from test.support import temp_dir +from test.support.os_helper import temp_dir from test.support.script_helper import assert_python_failure import unittest import sys diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py index 68268992e9f98..b0a12c9734749 100644 --- a/Lib/test/test_ctypes.py +++ b/Lib/test/test_ctypes.py @@ -1,5 +1,6 @@ import unittest -from test.support import import_module +from test.support.import_helper import import_module + ctypes_test = import_module('ctypes.test') diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py index 571da973aab0e..e02d1e16ae3da 100644 --- a/Lib/test/test_dbm.py +++ b/Lib/test/test_dbm.py @@ -2,17 +2,18 @@ import unittest import glob -import test.support +from test.support import import_helper +from test.support import os_helper # Skip tests if dbm module doesn't exist. -dbm = test.support.import_module('dbm') +dbm = import_helper.import_module('dbm') try: from dbm import ndbm except ImportError: ndbm = None -_fname = test.support.TESTFN +_fname = os_helper.TESTFN # # Iterates over every database module supported by dbm currently available, @@ -34,7 +35,7 @@ def delete_files(): # we don't know the precise name the underlying database uses # so we use glob to locate all names for f in glob.glob(glob.escape(_fname) + "*"): - test.support.unlink(f) + os_helper.unlink(f) class AnyDBMTestCase: @@ -74,7 +75,7 @@ def test_anydbm_creation(self): def test_anydbm_creation_n_file_exists_with_invalid_contents(self): # create an empty file - test.support.create_empty_file(_fname) + os_helper.create_empty_file(_fname) with dbm.open(_fname, 'n') as f: self.assertEqual(len(f), 0) @@ -169,7 +170,7 @@ def test_whichdb_ndbm(self): # Issue 17198: check that ndbm which is referenced in whichdb is defined db_file = '{}_ndbm.db'.format(_fname) with open(db_file, 'w'): - self.addCleanup(test.support.unlink, db_file) + self.addCleanup(os_helper.unlink, db_file) self.assertIsNone(self.dbm.whichdb(db_file[:-3])) def tearDown(self): @@ -177,10 +178,10 @@ def tearDown(self): def setUp(self): delete_files() - self.filename = test.support.TESTFN + self.filename = os_helper.TESTFN self.d = dbm.open(self.filename, 'c') self.d.close() - self.dbm = test.support.import_fresh_module('dbm') + self.dbm = import_helper.import_fresh_module('dbm') def test_keys(self): self.d = dbm.open(self.filename, 'c') diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py index 9ab68c67241f4..7e1092083269e 100644 --- a/Lib/test/test_fcntl.py +++ b/Lib/test/test_fcntl.py @@ -6,8 +6,10 @@ import sys import unittest from multiprocessing import Process -from test.support import (verbose, TESTFN, unlink, run_unittest, import_module, - cpython_only) +from test.support import (verbose, run_unittest, cpython_only) +from test.support.import_helper import import_module +from test.support.os_helper import TESTFN, unlink + # Skip test if no fcntl module. fcntl = import_module('fcntl') diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index cd642e7aaf8bb..149767591d9eb 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -7,8 +7,9 @@ import io import _pyio as pyio -from test.support import TESTFN -from test import support +from test.support.os_helper import TESTFN +from test.support import os_helper +from test.support import warnings_helper from collections import UserList class AutoFileTests: @@ -20,7 +21,7 @@ def setUp(self): def tearDown(self): if self.f: self.f.close() - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def testWeakRefs(self): # verify weak references @@ -139,7 +140,7 @@ class PyAutoFileTests(AutoFileTests, unittest.TestCase): class OtherFileTests: def tearDown(self): - support.unlink(TESTFN) + os_helper.unlink(TESTFN) def testModeStrings(self): # check invalid mode strings @@ -187,7 +188,7 @@ def testSetBufferSize(self): # make sure that explicitly setting the buffer size doesn't cause # misbehaviour especially with repeated close() calls for s in (-1, 0, 512): - with support.check_no_warnings(self, + with warnings_helper.check_no_warnings(self, message='line buffering', category=RuntimeWarning): self._checkBufferSize(s) diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 0dc7dd8e254c3..35a62a0632e2e 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -12,7 +12,7 @@ import types import decimal import unittest -from test.support import temp_cwd +from test.support.os_helper import temp_cwd from test.support.script_helper import assert_python_failure a_global = 'global variable' diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 71a0511e53a72..0c871afca37bd 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -30,6 +30,7 @@ import unittest from test import support +from test.support import os_helper from test.support import threading_helper @@ -391,13 +392,13 @@ def close_conn(): 'undecodable name cannot always be decoded on macOS') @unittest.skipIf(sys.platform == 'win32', 'undecodable name cannot be decoded on win32') - @unittest.skipUnless(support.TESTFN_UNDECODABLE, - 'need support.TESTFN_UNDECODABLE') + @unittest.skipUnless(os_helper.TESTFN_UNDECODABLE, + 'need os_helper.TESTFN_UNDECODABLE') def test_undecodable_filename(self): enc = sys.getfilesystemencoding() - filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt' + filename = os.fsdecode(os_helper.TESTFN_UNDECODABLE) + '.txt' with open(os.path.join(self.tempdir, filename), 'wb') as f: - f.write(support.TESTFN_UNDECODABLE) + f.write(os_helper.TESTFN_UNDECODABLE) response = self.request(self.base_url + '/') if sys.platform == 'darwin': # On Mac OS the HFS+ filesystem replaces bytes that aren't valid @@ -414,7 +415,7 @@ def test_undecodable_filename(self): .encode(enc, 'surrogateescape'), body) response = self.request(self.base_url + '/' + quotedname) self.check_status_and_reason(response, HTTPStatus.OK, - data=support.TESTFN_UNDECODABLE) + data=os_helper.TESTFN_UNDECODABLE) def test_get(self): #constructs the path relative to the root directory of the HTTPServer diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py index 375d9c42137ba..cfc6ba89e774c 100644 --- a/Lib/test/test_linecache.py +++ b/Lib/test/test_linecache.py @@ -6,6 +6,7 @@ import tempfile import tokenize from test import support +from test.support import os_helper FILENAME = linecache.__file__ @@ -44,7 +45,7 @@ def setUp(self): with tempfile.NamedTemporaryFile(delete=False) as fp: self.file_name = fp.name fp.write(self.file_byte_string) - self.addCleanup(support.unlink, self.file_name) + self.addCleanup(os_helper.unlink, self.file_name) class GetLineTestsGoodData(TempFile): @@ -124,10 +125,10 @@ def test_getline(self): self.assertEqual(empty, []) def test_no_ending_newline(self): - self.addCleanup(support.unlink, support.TESTFN) - with open(support.TESTFN, "w") as fp: + self.addCleanup(os_helper.unlink, os_helper.TESTFN) + with open(os_helper.TESTFN, "w") as fp: fp.write(SOURCE_3) - lines = linecache.getlines(support.TESTFN) + lines = linecache.getlines(os_helper.TESTFN) self.assertEqual(lines, ["\n", "def f():\n", " return 3\n"]) def test_clearcache(self): @@ -150,8 +151,8 @@ def test_clearcache(self): def test_checkcache(self): getline = linecache.getline # Create a source file and cache its contents - source_name = support.TESTFN + '.py' - self.addCleanup(support.unlink, source_name) + source_name = os_helper.TESTFN + '.py' + self.addCleanup(os_helper.unlink, source_name) with open(source_name, 'w') as source: source.write(SOURCE_1) getline(source_name, 1) diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py index 743bea7c14d0e..e29cd4a84c546 100644 --- a/Lib/test/test_msilib.py +++ b/Lib/test/test_msilib.py @@ -1,7 +1,8 @@ """ Test suite for the code in msilib """ import os import unittest -from test.support import TESTFN, import_module, unlink +from test.support.import_helper import import_module +from test.support.os_helper import TESTFN, unlink msilib = import_module('msilib') import msilib.schema diff --git a/Lib/test/test_picklebuffer.py b/Lib/test/test_picklebuffer.py index 97981c882e825..435b3e038aa39 100644 --- a/Lib/test/test_picklebuffer.py +++ b/Lib/test/test_picklebuffer.py @@ -8,7 +8,7 @@ import weakref import unittest -from test import support +from test.support import import_helper class B(bytes): @@ -75,7 +75,7 @@ def test_cycle(self): def test_ndarray_2d(self): # C-contiguous - ndarray = support.import_module("_testbuffer").ndarray + ndarray = import_helper.import_module("_testbuffer").ndarray arr = ndarray(list(range(12)), shape=(4, 3), format=' https://github.com/python/cpython/commit/b4a9263708cc67c98c4d53b16933f6e5dd07990f commit: b4a9263708cc67c98c4d53b16933f6e5dd07990f branch: master author: Dong-hee Na committer: GitHub date: 2020-07-06T13:22:04+02:00 summary: bpo-37207: Update whatsnews for 3.9 (GH-21337) files: M Doc/whatsnew/3.9.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 165ce69e59e1d..c2db9bc74ccdd 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -685,6 +685,10 @@ in nanoseconds. The benchmarks were measured on an running the macOS 64-bit builds found at `python.org `_. +* A number of Python builtins (:class:`range`, :class:`tuple`, :class:`set`, :class:`frozenset`, :class:`list`, :class:`dict`) + are now sped up by using :pep:`590` vectorcall protocol. + (Contributed by Dong-hee Na, Mark Shannon, Jeroen Demeyer and Petr Viktorin in :issue:`37207`.) + Deprecated ========== From webhook-mailer at python.org Mon Jul 6 08:30:05 2020 From: webhook-mailer at python.org (Hai Shi) Date: Mon, 06 Jul 2020 12:30:05 -0000 Subject: [Python-checkins] bpo-40275: Use new test.support helper submodules in tests (GH-21317) Message-ID: https://github.com/python/cpython/commit/deb016224cc506503fb05e821a60158c83918ed4 commit: deb016224cc506503fb05e821a60158c83918ed4 branch: master author: Hai Shi committer: GitHub date: 2020-07-06T14:29:49+02:00 summary: bpo-40275: Use new test.support helper submodules in tests (GH-21317) files: M Lib/distutils/tests/support.py M Lib/distutils/tests/test_build_ext.py M Lib/distutils/tests/test_filelist.py M Lib/distutils/tests/test_spawn.py M Lib/test/test_dbm_gnu.py M Lib/test/test_eof.py M Lib/test/test_hashlib.py M Lib/test/test_idle.py M Lib/test/test_imaplib.py M Lib/test/test_marshal.py M Lib/test/test_py_compile.py M Lib/test/test_set.py M Lib/test/test_socket.py M Lib/test/test_sysconfig.py M Lib/test/test_traceback.py M Lib/test/test_unicode.py M Lib/test/test_xml_etree.py M Lib/test/test_zipfile.py diff --git a/Lib/distutils/tests/support.py b/Lib/distutils/tests/support.py index 259af882ec0e9..23b907b607efa 100644 --- a/Lib/distutils/tests/support.py +++ b/Lib/distutils/tests/support.py @@ -6,7 +6,7 @@ import unittest import sysconfig from copy import deepcopy -import test.support +from test.support import os_helper from distutils import log from distutils.log import DEBUG, INFO, WARN, ERROR, FATAL @@ -64,7 +64,7 @@ def tearDown(self): super().tearDown() while self.tempdirs: tmpdir = self.tempdirs.pop() - test.support.rmtree(tmpdir) + os_helper.rmtree(tmpdir) def mkdtemp(self): """Create a temporary directory that will be cleaned up. diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py index 5e47e0773a964..f9e0d766d870e 100644 --- a/Lib/distutils/tests/test_build_ext.py +++ b/Lib/distutils/tests/test_build_ext.py @@ -15,6 +15,7 @@ import unittest from test import support +from test.support import os_helper from test.support.script_helper import assert_python_ok # http://bugs.python.org/issue4373 @@ -38,7 +39,7 @@ def setUp(self): # bpo-30132: On Windows, a .pdb file may be created in the current # working directory. Create a temporary working directory to cleanup # everything at the end of the test. - change_cwd = support.change_cwd(self.tmp_dir) + change_cwd = os_helper.change_cwd(self.tmp_dir) change_cwd.__enter__() self.addCleanup(change_cwd.__exit__, None, None, None) diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py index 2c26c22617ed4..cee97d439e6df 100644 --- a/Lib/distutils/tests/test_filelist.py +++ b/Lib/distutils/tests/test_filelist.py @@ -8,7 +8,6 @@ from distutils.filelist import glob_to_re, translate_pattern, FileList from distutils import filelist -import test.support from test.support import os_helper from test.support import captured_stdout, run_unittest from distutils.tests import support @@ -298,7 +297,7 @@ def test_process_template(self): class FindAllTestCase(unittest.TestCase): @os_helper.skip_unless_symlink def test_missing_symlink(self): - with test.support.temp_cwd(): + with os_helper.temp_cwd(): os.symlink('foo', 'bar') self.assertEqual(filelist.findall(), []) @@ -308,13 +307,13 @@ def test_basic_discovery(self): '.' as the parameter, the dot should be omitted from the results. """ - with test.support.temp_cwd(): + with os_helper.temp_cwd(): os.mkdir('foo') file1 = os.path.join('foo', 'file1.txt') - test.support.create_empty_file(file1) + os_helper.create_empty_file(file1) os.mkdir('bar') file2 = os.path.join('bar', 'file2.txt') - test.support.create_empty_file(file2) + os_helper.create_empty_file(file2) expected = [file2, file1] self.assertEqual(sorted(filelist.findall()), expected) @@ -323,9 +322,9 @@ def test_non_local_discovery(self): When findall is called with another path, the full path name should be returned. """ - with test.support.temp_dir() as temp_dir: + with os_helper.temp_dir() as temp_dir: file1 = os.path.join(temp_dir, 'file1.txt') - test.support.create_empty_file(file1) + os_helper.create_empty_file(file1) expected = [file1] self.assertEqual(filelist.findall(temp_dir), expected) diff --git a/Lib/distutils/tests/test_spawn.py b/Lib/distutils/tests/test_spawn.py index cf1faad5f4dd5..3647bab7b1cbc 100644 --- a/Lib/distutils/tests/test_spawn.py +++ b/Lib/distutils/tests/test_spawn.py @@ -4,7 +4,7 @@ import sys import unittest.mock from test.support import run_unittest, unix_shell -from test import support as test_support +from test.support import os_helper from distutils.spawn import find_executable from distutils.spawn import spawn @@ -44,9 +44,9 @@ def test_spawn(self): spawn([exe]) # should work without any error def test_find_executable(self): - with test_support.temp_dir() as tmp_dir: + with os_helper.temp_dir() as tmp_dir: # use TESTFN to get a pseudo-unique filename - program_noeext = test_support.TESTFN + program_noeext = os_helper.TESTFN # Give the temporary program an ".exe" suffix for all. # It's needed on Windows and not harmful on other platforms. program = program_noeext + ".exe" @@ -66,7 +66,7 @@ def test_find_executable(self): self.assertEqual(rv, filename) # test find in the current directory - with test_support.change_cwd(tmp_dir): + with os_helper.change_cwd(tmp_dir): rv = find_executable(program) self.assertEqual(rv, program) @@ -76,7 +76,7 @@ def test_find_executable(self): self.assertIsNone(rv) # PATH='': no match, except in the current directory - with test_support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env['PATH'] = '' with unittest.mock.patch('distutils.spawn.os.confstr', return_value=tmp_dir, create=True), \ @@ -86,12 +86,12 @@ def test_find_executable(self): self.assertIsNone(rv) # look in current directory - with test_support.change_cwd(tmp_dir): + with os_helper.change_cwd(tmp_dir): rv = find_executable(program) self.assertEqual(rv, program) # PATH=':': explicitly looks in the current directory - with test_support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env['PATH'] = os.pathsep with unittest.mock.patch('distutils.spawn.os.confstr', return_value='', create=True), \ @@ -100,12 +100,12 @@ def test_find_executable(self): self.assertIsNone(rv) # look in current directory - with test_support.change_cwd(tmp_dir): + with os_helper.change_cwd(tmp_dir): rv = find_executable(program) self.assertEqual(rv, program) # missing PATH: test os.confstr("CS_PATH") and os.defpath - with test_support.EnvironmentVarGuard() as env: + with os_helper.EnvironmentVarGuard() as env: env.pop('PATH', None) # without confstr diff --git a/Lib/test/test_dbm_gnu.py b/Lib/test/test_dbm_gnu.py index f1c7d34085c5e..078bf0e9b9270 100644 --- a/Lib/test/test_dbm_gnu.py +++ b/Lib/test/test_dbm_gnu.py @@ -1,5 +1,6 @@ from test import support -gdbm = support.import_module("dbm.gnu") #skip if not supported +from test.support import import_helper +gdbm = import_helper.import_module("dbm.gnu") #skip if not supported import unittest import os from test.support import TESTFN, TESTFN_NONASCII, unlink diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index 51cbbd8eed664..2cf263d27463c 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -2,6 +2,7 @@ import sys from test import support +from test.support import os_helper from test.support import script_helper import unittest @@ -48,7 +49,7 @@ def test_line_continuation_EOF(self): @unittest.skipIf(not sys.executable, "sys.executable required") def test_line_continuation_EOF_from_file_bpo2180(self): """Ensure tok_nextc() does not add too many ending newlines.""" - with support.temp_dir() as temp_dir: + with os_helper.temp_dir() as temp_dir: file_name = script_helper.make_script(temp_dir, 'foo', '\\') rc, out, err = script_helper.assert_python_failure(file_name) self.assertIn(b'unexpected EOF while parsing', err) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index ba902986adb81..4551011f5ca9e 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -18,7 +18,8 @@ import unittest import warnings from test import support -from test.support import _4G, bigmemtest, import_fresh_module +from test.support import _4G, bigmemtest +from test.support.import_helper import import_fresh_module from test.support import threading_helper from http.client import HTTPException diff --git a/Lib/test/test_idle.py b/Lib/test/test_idle.py index 8bc01deaa3384..b205d35649860 100644 --- a/Lib/test/test_idle.py +++ b/Lib/test/test_idle.py @@ -1,5 +1,5 @@ import unittest -from test.support import import_module +from test.support.import_helper import import_module # Skip test_idle if _tkinter wasn't built, if tkinter is missing, # if tcl/tk is not the 8.5+ needed for ttk widgets, diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index b8ab677e6f6a9..96bcb09261e9e 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -14,6 +14,7 @@ run_with_tz, run_with_locale, cpython_only) from test.support import hashlib_helper from test.support import threading_helper +from test.support import warnings_helper import unittest from unittest import mock from datetime import datetime, timezone, timedelta @@ -575,7 +576,7 @@ def test_ssl_verified(self): # to CPython stdlib @cpython_only def test_certfile_arg_warn(self): - with support.check_warnings(('', DeprecationWarning)): + with warnings_helper.check_warnings(('', DeprecationWarning)): with mock.patch.object(self.imap_class, 'open'): with mock.patch.object(self.imap_class, '_connect'): self.imap_class('localhost', 143, certfile=CERTFILE) diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index b7f4dbb98e36d..7bcf8e8399a81 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -1,4 +1,5 @@ from test import support +from test.support import os_helper import array import io import marshal @@ -17,13 +18,13 @@ def helper(self, sample, *extra): new = marshal.loads(marshal.dumps(sample, *extra)) self.assertEqual(sample, new) try: - with open(support.TESTFN, "wb") as f: + with open(os_helper.TESTFN, "wb") as f: marshal.dump(sample, f, *extra) - with open(support.TESTFN, "rb") as f: + with open(os_helper.TESTFN, "rb") as f: new = marshal.load(f) self.assertEqual(sample, new) finally: - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) class IntTestCase(unittest.TestCase, HelperMixin): def test_ints(self): @@ -281,20 +282,20 @@ def test_multiple_dumps_and_loads(self): ilen = len(interleaved) positions = [] try: - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: for d in data: marshal.dump(d, f) if ilen: f.write(interleaved) positions.append(f.tell()) - with open(support.TESTFN, 'rb') as f: + with open(os_helper.TESTFN, 'rb') as f: for i, d in enumerate(data): self.assertEqual(d, marshal.load(f)) if ilen: f.read(ilen) self.assertEqual(positions[i], f.tell()) finally: - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_loads_reject_unicode_strings(self): # Issue #14177: marshal.loads() should not accept unicode strings @@ -516,81 +517,81 @@ class CAPI_TestCase(unittest.TestCase, HelperMixin): def test_write_long_to_file(self): for v in range(marshal.version + 1): - _testcapi.pymarshal_write_long_to_file(0x12345678, support.TESTFN, v) - with open(support.TESTFN, 'rb') as f: + _testcapi.pymarshal_write_long_to_file(0x12345678, os_helper.TESTFN, v) + with open(os_helper.TESTFN, 'rb') as f: data = f.read() - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) self.assertEqual(data, b'\x78\x56\x34\x12') def test_write_object_to_file(self): obj = ('\u20ac', b'abc', 123, 45.6, 7+8j, 'long line '*1000) for v in range(marshal.version + 1): - _testcapi.pymarshal_write_object_to_file(obj, support.TESTFN, v) - with open(support.TESTFN, 'rb') as f: + _testcapi.pymarshal_write_object_to_file(obj, os_helper.TESTFN, v) + with open(os_helper.TESTFN, 'rb') as f: data = f.read() - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) self.assertEqual(marshal.loads(data), obj) def test_read_short_from_file(self): - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(b'\x34\x12xxxx') - r, p = _testcapi.pymarshal_read_short_from_file(support.TESTFN) - support.unlink(support.TESTFN) + r, p = _testcapi.pymarshal_read_short_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) self.assertEqual(r, 0x1234) self.assertEqual(p, 2) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(b'\x12') with self.assertRaises(EOFError): - _testcapi.pymarshal_read_short_from_file(support.TESTFN) - support.unlink(support.TESTFN) + _testcapi.pymarshal_read_short_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_read_long_from_file(self): - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(b'\x78\x56\x34\x12xxxx') - r, p = _testcapi.pymarshal_read_long_from_file(support.TESTFN) - support.unlink(support.TESTFN) + r, p = _testcapi.pymarshal_read_long_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) self.assertEqual(r, 0x12345678) self.assertEqual(p, 4) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(b'\x56\x34\x12') with self.assertRaises(EOFError): - _testcapi.pymarshal_read_long_from_file(support.TESTFN) - support.unlink(support.TESTFN) + _testcapi.pymarshal_read_long_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_read_last_object_from_file(self): obj = ('\u20ac', b'abc', 123, 45.6, 7+8j) for v in range(marshal.version + 1): data = marshal.dumps(obj, v) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(data + b'xxxx') - r, p = _testcapi.pymarshal_read_last_object_from_file(support.TESTFN) - support.unlink(support.TESTFN) + r, p = _testcapi.pymarshal_read_last_object_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) self.assertEqual(r, obj) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(data[:1]) with self.assertRaises(EOFError): - _testcapi.pymarshal_read_last_object_from_file(support.TESTFN) - support.unlink(support.TESTFN) + _testcapi.pymarshal_read_last_object_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) def test_read_object_from_file(self): obj = ('\u20ac', b'abc', 123, 45.6, 7+8j) for v in range(marshal.version + 1): data = marshal.dumps(obj, v) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(data + b'xxxx') - r, p = _testcapi.pymarshal_read_object_from_file(support.TESTFN) - support.unlink(support.TESTFN) + r, p = _testcapi.pymarshal_read_object_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) self.assertEqual(r, obj) self.assertEqual(p, len(data)) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: f.write(data[:1]) with self.assertRaises(EOFError): - _testcapi.pymarshal_read_object_from_file(support.TESTFN) - support.unlink(support.TESTFN) + _testcapi.pymarshal_read_object_from_file(os_helper.TESTFN) + os_helper.unlink(os_helper.TESTFN) if __name__ == "__main__": diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 11b579c26e711..d8ba009ea8482 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -102,7 +102,7 @@ def test_cache_path(self): self.assertTrue(os.path.exists(self.cache_path)) def test_cwd(self): - with support.change_cwd(self.directory): + with os_helper.change_cwd(self.directory): py_compile.compile(os.path.basename(self.source_path), os.path.basename(self.pyc_path)) self.assertTrue(os.path.exists(self.pyc_path)) diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 68d494213e587..e45f018d2da71 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import warnings_helper import gc import weakref import operator @@ -953,7 +954,7 @@ def test_repr(self): class TestBasicOpsMixedStringBytes(TestBasicOps, unittest.TestCase): def setUp(self): - self._warning_filters = support.check_warnings() + self._warning_filters = warnings_helper.check_warnings() self._warning_filters.__enter__() warnings.simplefilter('ignore', BytesWarning) self.case = "string and bytes set" diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index cff07b46c7a2a..67ac045330f3e 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import os_helper from test.support import socket_helper from test.support import threading_helper @@ -697,7 +698,7 @@ def setUp(self): def bindSock(self, sock): path = tempfile.mktemp(dir=self.dir_path) socket_helper.bind_unix_socket(sock, path) - self.addCleanup(support.unlink, path) + self.addCleanup(os_helper.unlink, path) class UnixStreamBase(UnixSocketTestBase): """Base class for Unix-domain SOCK_STREAM tests.""" @@ -1917,14 +1918,14 @@ def test_socket_fileno_rejects_negative(self): def test_socket_fileno_requires_valid_fd(self): WSAENOTSOCK = 10038 with self.assertRaises(OSError) as cm: - socket.socket(fileno=support.make_bad_fd()) + socket.socket(fileno=os_helper.make_bad_fd()) self.assertIn(cm.exception.errno, (errno.EBADF, WSAENOTSOCK)) with self.assertRaises(OSError) as cm: socket.socket( socket.AF_INET, socket.SOCK_STREAM, - fileno=support.make_bad_fd()) + fileno=os_helper.make_bad_fd()) self.assertIn(cm.exception.errno, (errno.EBADF, WSAENOTSOCK)) def test_socket_fileno_requires_socket_fd(self): @@ -5458,35 +5459,35 @@ def testUnbound(self): def testStrAddr(self): # Test binding to and retrieving a normal string pathname. - path = os.path.abspath(support.TESTFN) + path = os.path.abspath(os_helper.TESTFN) self.bind(self.sock, path) - self.addCleanup(support.unlink, path) + self.addCleanup(os_helper.unlink, path) self.assertEqual(self.sock.getsockname(), path) def testBytesAddr(self): # Test binding to a bytes pathname. - path = os.path.abspath(support.TESTFN) + path = os.path.abspath(os_helper.TESTFN) self.bind(self.sock, self.encoded(path)) - self.addCleanup(support.unlink, path) + self.addCleanup(os_helper.unlink, path) self.assertEqual(self.sock.getsockname(), path) def testSurrogateescapeBind(self): # Test binding to a valid non-ASCII pathname, with the # non-ASCII bytes supplied using surrogateescape encoding. - path = os.path.abspath(support.TESTFN_UNICODE) + path = os.path.abspath(os_helper.TESTFN_UNICODE) b = self.encoded(path) self.bind(self.sock, b.decode("ascii", "surrogateescape")) - self.addCleanup(support.unlink, path) + self.addCleanup(os_helper.unlink, path) self.assertEqual(self.sock.getsockname(), path) def testUnencodableAddr(self): # Test binding to a pathname that cannot be encoded in the # file system encoding. - if support.TESTFN_UNENCODABLE is None: + if os_helper.TESTFN_UNENCODABLE is None: self.skipTest("No unencodable filename available") - path = os.path.abspath(support.TESTFN_UNENCODABLE) + path = os.path.abspath(os_helper.TESTFN_UNENCODABLE) self.bind(self.sock, path) - self.addCleanup(support.unlink, path) + self.addCleanup(os_helper.unlink, path) self.assertEqual(self.sock.getsockname(), path) @@ -5960,16 +5961,16 @@ def chunks(total, step): chunk = b"".join([random.choice(string.ascii_letters).encode() for i in range(cls.BUFSIZE)]) - with open(support.TESTFN, 'wb') as f: + with open(os_helper.TESTFN, 'wb') as f: for csize in chunks(cls.FILESIZE, cls.BUFSIZE): f.write(chunk) - with open(support.TESTFN, 'rb') as f: + with open(os_helper.TESTFN, 'rb') as f: cls.FILEDATA = f.read() assert len(cls.FILEDATA) == cls.FILESIZE @classmethod def tearDownClass(cls): - support.unlink(support.TESTFN) + os_helper.unlink(os_helper.TESTFN) def accept_conn(self): self.serv.settimeout(support.LONG_TIMEOUT) @@ -5996,7 +5997,7 @@ def meth_from_sock(self, sock): def _testRegularFile(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') with socket.create_connection(address) as sock, file as file: meth = self.meth_from_sock(sock) sent = meth(file) @@ -6031,9 +6032,9 @@ def testNonRegularFile(self): def _testEmptyFileSend(self): address = self.serv.getsockname() - filename = support.TESTFN + "2" + filename = os_helper.TESTFN + "2" with open(filename, 'wb'): - self.addCleanup(support.unlink, filename) + self.addCleanup(os_helper.unlink, filename) file = open(filename, 'rb') with socket.create_connection(address) as sock, file as file: meth = self.meth_from_sock(sock) @@ -6050,7 +6051,7 @@ def testEmptyFileSend(self): def _testOffset(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') with socket.create_connection(address) as sock, file as file: meth = self.meth_from_sock(sock) sent = meth(file, offset=5000) @@ -6067,7 +6068,7 @@ def testOffset(self): def _testCount(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') sock = socket.create_connection(address, timeout=support.LOOPBACK_TIMEOUT) with sock, file: @@ -6088,7 +6089,7 @@ def testCount(self): def _testCountSmall(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') sock = socket.create_connection(address, timeout=support.LOOPBACK_TIMEOUT) with sock, file: @@ -6109,7 +6110,7 @@ def testCountSmall(self): def _testCountWithOffset(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') with socket.create_connection(address, timeout=2) as sock, file as file: count = 100007 meth = self.meth_from_sock(sock) @@ -6128,7 +6129,7 @@ def testCountWithOffset(self): def _testNonBlocking(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') with socket.create_connection(address) as sock, file as file: sock.setblocking(False) meth = self.meth_from_sock(sock) @@ -6144,7 +6145,7 @@ def testNonBlocking(self): def _testWithTimeout(self): address = self.serv.getsockname() - file = open(support.TESTFN, 'rb') + file = open(os_helper.TESTFN, 'rb') sock = socket.create_connection(address, timeout=support.LOOPBACK_TIMEOUT) with sock, file: @@ -6162,7 +6163,7 @@ def testWithTimeout(self): def _testWithTimeoutTriggeredSend(self): address = self.serv.getsockname() - with open(support.TESTFN, 'rb') as file: + with open(os_helper.TESTFN, 'rb') as file: with socket.create_connection(address) as sock: sock.settimeout(0.01) meth = self.meth_from_sock(sock) @@ -6178,17 +6179,17 @@ def _test_errors(self): pass def test_errors(self): - with open(support.TESTFN, 'rb') as file: + with open(os_helper.TESTFN, 'rb') as file: with socket.socket(type=socket.SOCK_DGRAM) as s: meth = self.meth_from_sock(s) self.assertRaisesRegex( ValueError, "SOCK_STREAM", meth, file) - with open(support.TESTFN, 'rt') as file: + with open(os_helper.TESTFN, 'rt') as file: with socket.socket() as s: meth = self.meth_from_sock(s) self.assertRaisesRegex( ValueError, "binary mode", meth, file) - with open(support.TESTFN, 'rb') as file: + with open(os_helper.TESTFN, 'rb') as file: with socket.socket() as s: meth = self.meth_from_sock(s) self.assertRaisesRegex(TypeError, "positive integer", diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 44e44bf5ea995..d07d28df607ce 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -5,9 +5,11 @@ import shutil from copy import copy -from test.support import (import_module, TESTFN, unlink, check_warnings, - captured_stdout, skip_unless_symlink, change_cwd, - PythonSymlink) +from test.support import (captured_stdout, PythonSymlink) +from test.support.import_helper import import_module +from test.support.os_helper import (TESTFN, unlink, skip_unless_symlink, + change_cwd) +from test.support.warnings_helper import check_warnings import sysconfig from sysconfig import (get_paths, get_platform, get_config_vars, diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 925a6bc32e8ea..c5fbd8700ae9b 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -7,7 +7,8 @@ import unittest import re from test import support -from test.support import TESTFN, Error, captured_output, unlink, cpython_only, ALWAYS_EQ +from test.support import Error, captured_output, cpython_only, ALWAYS_EQ +from test.support.os_helper import TESTFN, unlink from test.support.script_helper import assert_python_ok import textwrap diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 59697935fe5cd..afc95555db026 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -15,6 +15,8 @@ import unicodedata import unittest import warnings +from test.support import import_helper +from test.support import warnings_helper from test import support, string_tests from test.support.script_helper import assert_python_failure @@ -504,7 +506,7 @@ def test_replace_id(self): self.assertIs(text.replace(pattern, pattern), text) def test_bytes_comparison(self): - with support.check_warnings(): + with warnings_helper.check_warnings(): warnings.simplefilter('ignore', BytesWarning) self.assertEqual('abc' == b'abc', False) self.assertEqual('abc' != b'abc', True) @@ -725,7 +727,7 @@ def test_isidentifier_legacy(self): import _testcapi u = '???????' self.assertTrue(u.isidentifier()) - with support.check_warnings(): + with warnings_helper.check_warnings(): warnings.simplefilter('ignore', DeprecationWarning) self.assertTrue(_testcapi.unicode_legacy_string(u).isidentifier()) @@ -2507,7 +2509,7 @@ class CAPITest(unittest.TestCase): # Test PyUnicode_FromFormat() def test_from_format(self): - support.import_module('ctypes') + import_helper.import_module('ctypes') from ctypes import ( pythonapi, py_object, sizeof, c_int, c_long, c_longlong, c_ssize_t, @@ -2748,7 +2750,7 @@ def check_format(expected, format, *args): @support.cpython_only def test_aswidechar(self): from _testcapi import unicode_aswidechar - support.import_module('ctypes') + import_helper.import_module('ctypes') from ctypes import c_wchar, sizeof wchar, size = unicode_aswidechar('abcdef', 2) @@ -2786,7 +2788,7 @@ def test_aswidechar(self): @support.cpython_only def test_aswidecharstring(self): from _testcapi import unicode_aswidecharstring - support.import_module('ctypes') + import_helper.import_module('ctypes') from ctypes import c_wchar, sizeof wchar, size = unicode_aswidecharstring('abc') diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index d01649d1c31b2..63f9b92a83de2 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -24,7 +24,12 @@ from functools import partial from itertools import product, islice from test import support -from test.support import TESTFN, findfile, import_fresh_module, gc_collect, swap_attr +from test.support import os_helper +from test.support import warnings_helper +from test.support import findfile, gc_collect, swap_attr +from test.support.import_helper import import_fresh_module +from test.support.os_helper import TESTFN + # pyET is the pure-Python implementation. # @@ -601,7 +606,7 @@ def test_iterparse(self): self.assertFalse(f.closed) self.assertEqual(str(cm.exception), "unknown event 'bogus'") - with support.check_no_resource_warning(self): + with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError) as cm: iterparse(SIMPLE_XMLFILE, events) self.assertEqual(str(cm.exception), "unknown event 'bogus'") @@ -627,13 +632,13 @@ def test_iterparse(self): self.assertEqual(str(cm.exception), 'junk after document element: line 1, column 12') - self.addCleanup(support.unlink, TESTFN) + self.addCleanup(os_helper.unlink, TESTFN) with open(TESTFN, "wb") as f: f.write(b"junk") it = iterparse(TESTFN) action, elem = next(it) self.assertEqual((action, elem.tag), ('end', 'document')) - with support.check_no_resource_warning(self): + with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ET.ParseError) as cm: next(it) self.assertEqual(str(cm.exception), @@ -3641,14 +3646,14 @@ def test_encoding(self): "" % enc).encode(enc)) def test_write_to_filename(self): - self.addCleanup(support.unlink, TESTFN) + self.addCleanup(os_helper.unlink, TESTFN) tree = ET.ElementTree(ET.XML('''''')) tree.write(TESTFN) with open(TESTFN, 'rb') as f: self.assertEqual(f.read(), b'''''') def test_write_to_text_file(self): - self.addCleanup(support.unlink, TESTFN) + self.addCleanup(os_helper.unlink, TESTFN) tree = ET.ElementTree(ET.XML('''''')) with open(TESTFN, 'w', encoding='utf-8') as f: tree.write(f, encoding='unicode') @@ -3657,7 +3662,7 @@ def test_write_to_text_file(self): self.assertEqual(f.read(), b'''''') def test_write_to_binary_file(self): - self.addCleanup(support.unlink, TESTFN) + self.addCleanup(os_helper.unlink, TESTFN) tree = ET.ElementTree(ET.XML('''''')) with open(TESTFN, 'wb') as f: tree.write(f) @@ -3666,7 +3671,7 @@ def test_write_to_binary_file(self): self.assertEqual(f.read(), b'''''') def test_write_to_binary_file_with_bom(self): - self.addCleanup(support.unlink, TESTFN) + self.addCleanup(os_helper.unlink, TESTFN) tree = ET.ElementTree(ET.XML('''''')) # test BOM writing to buffered file with open(TESTFN, 'wb') as f: diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index b7bc218d17a3d..2851051425bf1 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -19,9 +19,10 @@ from random import randint, random, randbytes from test.support import script_helper -from test.support import (TESTFN, findfile, unlink, rmtree, temp_dir, temp_cwd, - requires_zlib, requires_bz2, requires_lzma, - captured_stdout) +from test.support import (findfile, requires_zlib, requires_bz2, + requires_lzma, captured_stdout) +from test.support.os_helper import TESTFN, unlink, rmtree, temp_dir, temp_cwd + TESTFN2 = TESTFN + "2" TESTFNDIR = TESTFN + "d" From webhook-mailer at python.org Mon Jul 6 12:32:04 2020 From: webhook-mailer at python.org (Steve Dower) Date: Mon, 06 Jul 2020 16:32:04 -0000 Subject: [Python-checkins] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) Message-ID: https://github.com/python/cpython/commit/dcbaa1b49cd9062fb9ba2b9d49555ac6cd8c60b5 commit: dcbaa1b49cd9062fb9ba2b9d49555ac6cd8c60b5 branch: master author: Steve Dower committer: GitHub date: 2020-07-06T17:32:00+01:00 summary: bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) Also enables using debug build of `python3_d.dll` Reference: CVE-2020-15523 files: A Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst M Lib/test/test_embed.py M Modules/_testinternalcapi.c M PC/getpathp.c M PCbuild/pyproject.props M PCbuild/python.props M Python/dynload_win.c M Python/pathconfig.c diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 174892a22b48b..44d2596d9eb30 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -32,7 +32,7 @@ def debug_build(program): program = os.path.basename(program) name = os.path.splitext(program)[0] - return name.endswith("_d") + return name.casefold().endswith("_d".casefold()) def remove_python_envvars(): @@ -568,7 +568,7 @@ def get_expected_config(self, expected_preconfig, expected, env, api, if expected['stdio_errors'] is self.GET_DEFAULT_CONFIG: expected['stdio_errors'] = 'surrogateescape' - if sys.platform == 'win32': + if MS_WINDOWS: default_executable = self.test_exe elif expected['program_name'] is not self.GET_DEFAULT_CONFIG: default_executable = os.path.abspath(expected['program_name']) @@ -603,7 +603,7 @@ def check_pre_config(self, configs, expected): pre_config = dict(configs['pre_config']) for key, value in list(expected.items()): if value is self.IGNORE_CONFIG: - del pre_config[key] + pre_config.pop(key, None) del expected[key] self.assertEqual(pre_config, expected) @@ -611,7 +611,7 @@ def check_config(self, configs, expected): config = dict(configs['config']) for key, value in list(expected.items()): if value is self.IGNORE_CONFIG: - del config[key] + config.pop(key, None) del expected[key] self.assertEqual(config, expected) @@ -686,6 +686,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) + return configs def test_init_default_config(self): self.check_all_configs("test_init_initialize_config", api=API_COMPAT) @@ -1064,6 +1065,7 @@ def test_init_setpath(self): } self.default_program_name(config) env = {'TESTPATH': os.path.pathsep.join(paths)} + self.check_all_configs("test_init_setpath", config, api=API_COMPAT, env=env, ignore_stderr=True) @@ -1121,12 +1123,18 @@ def tmpdir_with_python(self): # Copy pythonXY.dll (or pythonXY_d.dll) ver = sys.version_info dll = f'python{ver.major}{ver.minor}' + dll3 = f'python{ver.major}' if debug_build(sys.executable): dll += '_d' + dll3 += '_d' dll += '.dll' + dll3 += '.dll' dll = os.path.join(os.path.dirname(self.test_exe), dll) + dll3 = os.path.join(os.path.dirname(self.test_exe), dll3) dll_copy = os.path.join(tmpdir, os.path.basename(dll)) + dll3_copy = os.path.join(tmpdir, os.path.basename(dll3)) shutil.copyfile(dll, dll_copy) + shutil.copyfile(dll3, dll3_copy) # Copy Python program exec_copy = os.path.join(tmpdir, os.path.basename(self.test_exe)) @@ -1254,9 +1262,18 @@ def test_init_pyvenv_cfg(self): config['base_prefix'] = pyvenv_home config['prefix'] = pyvenv_home env = self.copy_paths_by_env(config) - self.check_all_configs("test_init_compat_config", config, - api=API_COMPAT, env=env, - ignore_stderr=True, cwd=tmpdir) + 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']) + ) + ) + def test_global_pathconfig(self): # Test C API functions getting the path configuration: diff --git a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst new file mode 100644 index 0000000000000..998ffb1ee6667 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst @@ -0,0 +1,2 @@ +Ensure :file:`python3.dll` is loaded from correct locations when Python is +embedded (CVE-2020-15523). diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index ad74af8363ef4..f08bf8d83d474 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -18,10 +18,53 @@ #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)) { - return _Py_GetConfigsAsDict(); + PyObject *dict = _Py_GetConfigsAsDict(); +#ifdef MS_WINDOWS + if (dict) { + if (_add_windows_config(dict) < 0) { + Py_CLEAR(dict); + } + } +#endif + return dict; } diff --git a/PC/getpathp.c b/PC/getpathp.c index fd5cfa7e1a8a3..0939c5fa9842c 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -131,8 +131,6 @@ typedef struct { wchar_t *machine_path; /* from HKEY_LOCAL_MACHINE */ wchar_t *user_path; /* from HKEY_CURRENT_USER */ - wchar_t *dll_path; - const wchar_t *pythonpath_env; } PyCalculatePath; @@ -168,27 +166,37 @@ reduce(wchar_t *dir) static int change_ext(wchar_t *dest, const wchar_t *src, const wchar_t *ext) { - size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); - size_t i = src_len; - if (i >= MAXPATHLEN+1) { - Py_FatalError("buffer overflow in getpathp.c's reduce()"); - } + if (src && src != dest) { + size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); + size_t i = src_len; + if (i >= MAXPATHLEN+1) { + Py_FatalError("buffer overflow in getpathp.c's reduce()"); + } - while (i > 0 && src[i] != '.' && !is_sep(src[i])) - --i; + while (i > 0 && src[i] != '.' && !is_sep(src[i])) + --i; - if (i == 0) { - dest[0] = '\0'; - return -1; - } + if (i == 0) { + dest[0] = '\0'; + return -1; + } + + if (is_sep(src[i])) { + i = src_len; + } - if (is_sep(src[i])) { - i = src_len; + if (wcsncpy_s(dest, MAXPATHLEN+1, src, i)) { + dest[0] = '\0'; + return -1; + } + } else { + wchar_t *s = wcsrchr(dest, L'.'); + if (s) { + s[0] = '\0'; + } } - if (wcsncpy_s(dest, MAXPATHLEN+1, src, i) || - wcscat_s(dest, MAXPATHLEN+1, ext)) - { + if (wcscat_s(dest, MAXPATHLEN+1, ext)) { dest[0] = '\0'; return -1; } @@ -297,6 +305,19 @@ search_for_prefix(wchar_t *prefix, const wchar_t *argv0_path, const wchar_t *lan } +static int +get_dllpath(wchar_t *dllpath) +{ +#ifdef Py_ENABLE_SHARED + extern HANDLE PyWin_DLLhModule; + if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) { + return 0; + } +#endif + return -1; +} + + #ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ @@ -468,27 +489,6 @@ getpythonregpath(HKEY keyBase, int skipcore) #endif /* Py_ENABLE_SHARED */ -wchar_t* -_Py_GetDLLPath(void) -{ - wchar_t dll_path[MAXPATHLEN+1]; - memset(dll_path, 0, sizeof(dll_path)); - -#ifdef Py_ENABLE_SHARED - extern HANDLE PyWin_DLLhModule; - if (PyWin_DLLhModule) { - if (!GetModuleFileNameW(PyWin_DLLhModule, dll_path, MAXPATHLEN)) { - dll_path[0] = 0; - } - } -#else - dll_path[0] = 0; -#endif - - return _PyMem_RawWcsdup(dll_path); -} - - static PyStatus get_program_full_path(_PyPathConfig *pathconfig) { @@ -669,19 +669,17 @@ static int get_pth_filename(PyCalculatePath *calculate, wchar_t *filename, const _PyPathConfig *pathconfig) { - if (calculate->dll_path[0]) { - if (!change_ext(filename, calculate->dll_path, L"._pth") && - exists(filename)) - { - return 1; - } + if (get_dllpath(filename) && + !change_ext(filename, filename, L"._pth") && + exists(filename)) + { + return 1; } - if (pathconfig->program_full_path[0]) { - if (!change_ext(filename, pathconfig->program_full_path, L"._pth") && - exists(filename)) - { - return 1; - } + if (pathconfig->program_full_path[0] && + !change_ext(filename, pathconfig->program_full_path, L"._pth") && + exists(filename)) + { + return 1; } return 0; } @@ -994,9 +992,12 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) wchar_t zip_path[MAXPATHLEN+1]; memset(zip_path, 0, sizeof(zip_path)); - change_ext(zip_path, - calculate->dll_path[0] ? calculate->dll_path : pathconfig->program_full_path, - L".zip"); + if (get_dllpath(zip_path) || change_ext(zip_path, zip_path, L".zip")) + { + if (change_ext(zip_path, pathconfig->program_full_path, L".zip")) { + zip_path[0] = L'\0'; + } + } calculate_home_prefix(calculate, argv0_path, zip_path, prefix); @@ -1033,11 +1034,6 @@ calculate_init(PyCalculatePath *calculate, _PyPathConfig *pathconfig, calculate->home = pathconfig->home; calculate->path_env = _wgetenv(L"PATH"); - calculate->dll_path = _Py_GetDLLPath(); - if (calculate->dll_path == NULL) { - return _PyStatus_NO_MEMORY(); - } - calculate->pythonpath_env = config->pythonpath_env; return _PyStatus_OK(); @@ -1049,7 +1045,6 @@ calculate_free(PyCalculatePath *calculate) { PyMem_RawFree(calculate->machine_path); PyMem_RawFree(calculate->user_path); - PyMem_RawFree(calculate->dll_path); } @@ -1059,7 +1054,6 @@ calculate_free(PyCalculatePath *calculate) - PyConfig.pythonpath_env: PYTHONPATH environment variable - _PyPathConfig.home: Py_SetPythonHome() or PYTHONHOME environment variable - - DLL path: _Py_GetDLLPath() - PATH environment variable - __PYVENV_LAUNCHER__ environment variable - GetModuleFileNameW(NULL): fully qualified path of the executable file of @@ -1113,33 +1107,35 @@ int _Py_CheckPython3(void) { wchar_t py3path[MAXPATHLEN+1]; - wchar_t *s; if (python3_checked) { return hPython3 != NULL; } python3_checked = 1; /* If there is a python3.dll next to the python3y.dll, - assume this is a build tree; use that DLL */ - if (_Py_dll_path != NULL) { - wcscpy(py3path, _Py_dll_path); - } - else { - wcscpy(py3path, L""); - } - s = wcsrchr(py3path, L'\\'); - if (!s) { - s = py3path; + use that DLL */ + if (!get_dllpath(py3path)) { + reduce(py3path); + join(py3path, PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + if (hPython3 != NULL) { + return 1; + } } - wcscpy(s, L"\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + + /* If we can locate python3.dll in our application dir, + use that DLL */ + hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); if (hPython3 != NULL) { return 1; } - /* Check sys.prefix\DLLs\python3.dll */ + /* For back-compat, also search {sys.prefix}\DLLs, though + that has not been a normal install layout for a while */ wcscpy(py3path, Py_GetPrefix()); - wcscat(py3path, L"\\DLLs\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (py3path[0]) { + join(py3path, L"DLLs\\" PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + } return hPython3 != NULL; } diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 94a01ff5ca8a0..c659d14ff8dc9 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -26,11 +26,12 @@ <_PlatformPreprocessorDefinition>_WIN32; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64; <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE; + <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)"; $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) - WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) + WIN32;$(_Py3NamePreprocessorDefinition);$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true diff --git a/PCbuild/python.props b/PCbuild/python.props index 6388d1b642675..bf6f3716ba51b 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -203,6 +203,8 @@ python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + python3$(PyDebugExt) .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 2bf3384b9eb5e..8431c5b3b2f30 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -168,9 +168,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, char funcname[258], *import_python; const wchar_t *wpathname; -#ifndef _DEBUG _Py_CheckPython3(); -#endif wpathname = _PyUnicode_AsUnicode(pathname); if (wpathname == NULL) diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 5c38041d7667b..9a302213e77b6 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -17,9 +17,6 @@ extern "C" { _PyPathConfig _Py_path_config = _PyPathConfig_INIT; -#ifdef MS_WINDOWS -wchar_t *_Py_dll_path = NULL; -#endif static int @@ -107,10 +104,6 @@ _PyPathConfig_ClearGlobal(void) _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); pathconfig_clear(&_Py_path_config); -#ifdef MS_WINDOWS - PyMem_RawFree(_Py_dll_path); - _Py_dll_path = NULL; -#endif PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } @@ -147,31 +140,6 @@ _PyWideStringList_Join(const PyWideStringList *list, wchar_t sep) } -#ifdef MS_WINDOWS -/* Initialize _Py_dll_path on Windows. Do nothing on other platforms. */ -static PyStatus -_PyPathConfig_InitDLLPath(void) -{ - if (_Py_dll_path != NULL) { - /* Already set: nothing to do */ - return _PyStatus_OK(); - } - - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - _Py_dll_path = _Py_GetDLLPath(); - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - if (_Py_dll_path == NULL) { - return _PyStatus_NO_MEMORY(); - } - return _PyStatus_OK(); -} -#endif - - static PyStatus pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) { @@ -222,13 +190,6 @@ pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) PyStatus _PyConfig_WritePathConfig(const PyConfig *config) { -#ifdef MS_WINDOWS - PyStatus status = _PyPathConfig_InitDLLPath(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -#endif - return pathconfig_set_from_config(&_Py_path_config, config); } @@ -455,13 +416,6 @@ pathconfig_global_init(void) { PyStatus status; -#ifdef MS_WINDOWS - status = _PyPathConfig_InitDLLPath(); - if (_PyStatus_EXCEPTION(status)) { - Py_ExitStatusException(status); - } -#endif - if (_Py_path_config.module_search_path == NULL) { status = pathconfig_global_read(&_Py_path_config); if (_PyStatus_EXCEPTION(status)) { From webhook-mailer at python.org Mon Jul 6 13:12:24 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Jul 2020 17:12:24 -0000 Subject: [Python-checkins] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (GH-21352) Message-ID: https://github.com/python/cpython/commit/aa7f7756149a10c64d01f583b71e91814db886ab commit: aa7f7756149a10c64d01f583b71e91814db886ab branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-06T19:12:16+02:00 summary: bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (GH-21352) Also enables using debug build of `python3_d.dll` Reference: CVE-2020-15523 (cherry picked from commit dcbaa1b49cd9062fb9ba2b9d49555ac6cd8c60b5) Co-authored-by: Steve Dower files: A Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst M Lib/test/test_embed.py M Modules/_testinternalcapi.c M PC/getpathp.c M PCbuild/pyproject.props M PCbuild/python.props M Python/dynload_win.c M Python/pathconfig.c diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index ec2b416da368d..64a26b9ffff07 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -32,7 +32,7 @@ def debug_build(program): program = os.path.basename(program) name = os.path.splitext(program)[0] - return name.endswith("_d") + return name.casefold().endswith("_d".casefold()) def remove_python_envvars(): @@ -567,7 +567,7 @@ def get_expected_config(self, expected_preconfig, expected, env, api, if expected['stdio_errors'] is self.GET_DEFAULT_CONFIG: expected['stdio_errors'] = 'surrogateescape' - if sys.platform == 'win32': + if MS_WINDOWS: default_executable = self.test_exe elif expected['program_name'] is not self.GET_DEFAULT_CONFIG: default_executable = os.path.abspath(expected['program_name']) @@ -601,7 +601,7 @@ def check_pre_config(self, configs, expected): pre_config = dict(configs['pre_config']) for key, value in list(expected.items()): if value is self.IGNORE_CONFIG: - del pre_config[key] + pre_config.pop(key, None) del expected[key] self.assertEqual(pre_config, expected) @@ -609,7 +609,7 @@ def check_config(self, configs, expected): config = dict(configs['config']) for key, value in list(expected.items()): if value is self.IGNORE_CONFIG: - del config[key] + config.pop(key, None) del expected[key] self.assertEqual(config, expected) @@ -684,6 +684,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) + return configs def test_init_default_config(self): self.check_all_configs("test_init_initialize_config", api=API_COMPAT) @@ -1035,6 +1036,7 @@ def test_init_setpath(self): } self.default_program_name(config) env = {'TESTPATH': os.path.pathsep.join(paths)} + self.check_all_configs("test_init_setpath", config, api=API_COMPAT, env=env, ignore_stderr=True) @@ -1092,12 +1094,18 @@ def tmpdir_with_python(self): # Copy pythonXY.dll (or pythonXY_d.dll) ver = sys.version_info dll = f'python{ver.major}{ver.minor}' + dll3 = f'python{ver.major}' if debug_build(sys.executable): dll += '_d' + dll3 += '_d' dll += '.dll' + dll3 += '.dll' dll = os.path.join(os.path.dirname(self.test_exe), dll) + dll3 = os.path.join(os.path.dirname(self.test_exe), dll3) dll_copy = os.path.join(tmpdir, os.path.basename(dll)) + dll3_copy = os.path.join(tmpdir, os.path.basename(dll3)) shutil.copyfile(dll, dll_copy) + shutil.copyfile(dll3, dll3_copy) # Copy Python program exec_copy = os.path.join(tmpdir, os.path.basename(self.test_exe)) @@ -1225,9 +1233,18 @@ def test_init_pyvenv_cfg(self): config['base_prefix'] = pyvenv_home config['prefix'] = pyvenv_home env = self.copy_paths_by_env(config) - self.check_all_configs("test_init_compat_config", config, - api=API_COMPAT, env=env, - ignore_stderr=True, cwd=tmpdir) + 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']) + ) + ) + def test_global_pathconfig(self): # Test C API functions getting the path configuration: diff --git a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst new file mode 100644 index 0000000000000..998ffb1ee6667 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst @@ -0,0 +1,2 @@ +Ensure :file:`python3.dll` is loaded from correct locations when Python is +embedded (CVE-2020-15523). diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 3ea77e6934db1..3a931cae1fc2e 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -12,10 +12,53 @@ #include "pycore_initconfig.h" +#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)) { - return _Py_GetConfigsAsDict(); + PyObject *dict = _Py_GetConfigsAsDict(); +#ifdef MS_WINDOWS + if (dict) { + if (_add_windows_config(dict) < 0) { + Py_CLEAR(dict); + } + } +#endif + return dict; } diff --git a/PC/getpathp.c b/PC/getpathp.c index 53653c81fb45f..cf20b9f613c87 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -130,8 +130,6 @@ typedef struct { wchar_t *machine_path; /* from HKEY_LOCAL_MACHINE */ wchar_t *user_path; /* from HKEY_CURRENT_USER */ - wchar_t *dll_path; - const wchar_t *pythonpath_env; } PyCalculatePath; @@ -167,27 +165,37 @@ reduce(wchar_t *dir) static int change_ext(wchar_t *dest, const wchar_t *src, const wchar_t *ext) { - size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); - size_t i = src_len; - if (i >= MAXPATHLEN+1) { - Py_FatalError("buffer overflow in getpathp.c's reduce()"); - } + if (src && src != dest) { + size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); + size_t i = src_len; + if (i >= MAXPATHLEN+1) { + Py_FatalError("buffer overflow in getpathp.c's reduce()"); + } - while (i > 0 && src[i] != '.' && !is_sep(src[i])) - --i; + while (i > 0 && src[i] != '.' && !is_sep(src[i])) + --i; - if (i == 0) { - dest[0] = '\0'; - return -1; - } + if (i == 0) { + dest[0] = '\0'; + return -1; + } + + if (is_sep(src[i])) { + i = src_len; + } - if (is_sep(src[i])) { - i = src_len; + if (wcsncpy_s(dest, MAXPATHLEN+1, src, i)) { + dest[0] = '\0'; + return -1; + } + } else { + wchar_t *s = wcsrchr(dest, L'.'); + if (s) { + s[0] = '\0'; + } } - if (wcsncpy_s(dest, MAXPATHLEN+1, src, i) || - wcscat_s(dest, MAXPATHLEN+1, ext)) - { + if (wcscat_s(dest, MAXPATHLEN+1, ext)) { dest[0] = '\0'; return -1; } @@ -344,6 +352,19 @@ search_for_prefix(wchar_t *prefix, const wchar_t *argv0_path, const wchar_t *lan } +static int +get_dllpath(wchar_t *dllpath) +{ +#ifdef Py_ENABLE_SHARED + extern HANDLE PyWin_DLLhModule; + if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) { + return 0; + } +#endif + return -1; +} + + #ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ @@ -516,27 +537,6 @@ getpythonregpath(HKEY keyBase, int skipcore) #endif /* Py_ENABLE_SHARED */ -wchar_t* -_Py_GetDLLPath(void) -{ - wchar_t dll_path[MAXPATHLEN+1]; - memset(dll_path, 0, sizeof(dll_path)); - -#ifdef Py_ENABLE_SHARED - extern HANDLE PyWin_DLLhModule; - if (PyWin_DLLhModule) { - if (!GetModuleFileNameW(PyWin_DLLhModule, dll_path, MAXPATHLEN)) { - dll_path[0] = 0; - } - } -#else - dll_path[0] = 0; -#endif - - return _PyMem_RawWcsdup(dll_path); -} - - static PyStatus get_program_full_path(_PyPathConfig *pathconfig) { @@ -717,19 +717,17 @@ static int get_pth_filename(PyCalculatePath *calculate, wchar_t *filename, const _PyPathConfig *pathconfig) { - if (calculate->dll_path[0]) { - if (!change_ext(filename, calculate->dll_path, L"._pth") && - exists(filename)) - { - return 1; - } + if (get_dllpath(filename) && + !change_ext(filename, filename, L"._pth") && + exists(filename)) + { + return 1; } - if (pathconfig->program_full_path[0]) { - if (!change_ext(filename, pathconfig->program_full_path, L"._pth") && - exists(filename)) - { - return 1; - } + if (pathconfig->program_full_path[0] && + !change_ext(filename, pathconfig->program_full_path, L"._pth") && + exists(filename)) + { + return 1; } return 0; } @@ -1029,9 +1027,12 @@ calculate_path(PyCalculatePath *calculate, _PyPathConfig *pathconfig) wchar_t zip_path[MAXPATHLEN+1]; memset(zip_path, 0, sizeof(zip_path)); - change_ext(zip_path, - calculate->dll_path[0] ? calculate->dll_path : pathconfig->program_full_path, - L".zip"); + if (get_dllpath(zip_path) || change_ext(zip_path, zip_path, L".zip")) + { + if (change_ext(zip_path, pathconfig->program_full_path, L".zip")) { + zip_path[0] = L'\0'; + } + } calculate_home_prefix(calculate, argv0_path, zip_path, prefix); @@ -1068,11 +1069,6 @@ calculate_init(PyCalculatePath *calculate, _PyPathConfig *pathconfig, calculate->home = pathconfig->home; calculate->path_env = _wgetenv(L"PATH"); - calculate->dll_path = _Py_GetDLLPath(); - if (calculate->dll_path == NULL) { - return _PyStatus_NO_MEMORY(); - } - calculate->pythonpath_env = config->pythonpath_env; return _PyStatus_OK(); @@ -1084,7 +1080,6 @@ calculate_free(PyCalculatePath *calculate) { PyMem_RawFree(calculate->machine_path); PyMem_RawFree(calculate->user_path); - PyMem_RawFree(calculate->dll_path); } @@ -1094,7 +1089,6 @@ calculate_free(PyCalculatePath *calculate) - PyConfig.pythonpath_env: PYTHONPATH environment variable - _PyPathConfig.home: Py_SetPythonHome() or PYTHONHOME environment variable - - DLL path: _Py_GetDLLPath() - PATH environment variable - __PYVENV_LAUNCHER__ environment variable - GetModuleFileNameW(NULL): fully qualified path of the executable file of @@ -1148,33 +1142,35 @@ int _Py_CheckPython3(void) { wchar_t py3path[MAXPATHLEN+1]; - wchar_t *s; if (python3_checked) { return hPython3 != NULL; } python3_checked = 1; /* If there is a python3.dll next to the python3y.dll, - assume this is a build tree; use that DLL */ - if (_Py_dll_path != NULL) { - wcscpy(py3path, _Py_dll_path); - } - else { - wcscpy(py3path, L""); - } - s = wcsrchr(py3path, L'\\'); - if (!s) { - s = py3path; + use that DLL */ + if (!get_dllpath(py3path)) { + reduce(py3path); + join(py3path, PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + if (hPython3 != NULL) { + return 1; + } } - wcscpy(s, L"\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + + /* If we can locate python3.dll in our application dir, + use that DLL */ + hPython3 = LoadLibraryExW(PY3_DLLNAME, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR); if (hPython3 != NULL) { return 1; } - /* Check sys.prefix\DLLs\python3.dll */ + /* For back-compat, also search {sys.prefix}\DLLs, though + that has not been a normal install layout for a while */ wcscpy(py3path, Py_GetPrefix()); - wcscat(py3path, L"\\DLLs\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (py3path[0]) { + join(py3path, L"DLLs\\" PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); + } return hPython3 != NULL; } diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 59f2df4e0867b..360b4eda230dd 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -26,11 +26,12 @@ <_PlatformPreprocessorDefinition>_WIN32; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64; <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE; + <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)"; $(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) - WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) + WIN32;$(_Py3NamePreprocessorDefinition);$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true diff --git a/PCbuild/python.props b/PCbuild/python.props index 6388d1b642675..bf6f3716ba51b 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -203,6 +203,8 @@ python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + python3$(PyDebugExt) .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 6deba1134e2a4..4896c6dc8c25d 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -174,9 +174,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, char funcname[258], *import_python; const wchar_t *wpathname; -#ifndef _DEBUG _Py_CheckPython3(); -#endif wpathname = _PyUnicode_AsUnicode(pathname); if (wpathname == NULL) diff --git a/Python/pathconfig.c b/Python/pathconfig.c index bf180976b55ab..60c104492d646 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -15,9 +15,6 @@ extern "C" { _PyPathConfig _Py_path_config = _PyPathConfig_INIT; -#ifdef MS_WINDOWS -wchar_t *_Py_dll_path = NULL; -#endif static int @@ -105,10 +102,6 @@ _PyPathConfig_ClearGlobal(void) _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); pathconfig_clear(&_Py_path_config); -#ifdef MS_WINDOWS - PyMem_RawFree(_Py_dll_path); - _Py_dll_path = NULL; -#endif PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } @@ -145,31 +138,6 @@ _PyWideStringList_Join(const PyWideStringList *list, wchar_t sep) } -#ifdef MS_WINDOWS -/* Initialize _Py_dll_path on Windows. Do nothing on other platforms. */ -static PyStatus -_PyPathConfig_InitDLLPath(void) -{ - if (_Py_dll_path != NULL) { - /* Already set: nothing to do */ - return _PyStatus_OK(); - } - - PyMemAllocatorEx old_alloc; - _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - _Py_dll_path = _Py_GetDLLPath(); - - PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - - if (_Py_dll_path == NULL) { - return _PyStatus_NO_MEMORY(); - } - return _PyStatus_OK(); -} -#endif - - static PyStatus pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) { @@ -220,13 +188,6 @@ pathconfig_set_from_config(_PyPathConfig *pathconfig, const PyConfig *config) PyStatus _PyConfig_WritePathConfig(const PyConfig *config) { -#ifdef MS_WINDOWS - PyStatus status = _PyPathConfig_InitDLLPath(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } -#endif - return pathconfig_set_from_config(&_Py_path_config, config); } @@ -454,13 +415,6 @@ pathconfig_global_init(void) { PyStatus status; -#ifdef MS_WINDOWS - status = _PyPathConfig_InitDLLPath(); - if (_PyStatus_EXCEPTION(status)) { - Py_ExitStatusException(status); - } -#endif - if (_Py_path_config.module_search_path == NULL) { status = pathconfig_global_read(&_Py_path_config); if (_PyStatus_EXCEPTION(status)) { From webhook-mailer at python.org Mon Jul 6 13:25:04 2020 From: webhook-mailer at python.org (Steve Dower) Date: Mon, 06 Jul 2020 17:25:04 -0000 Subject: [Python-checkins] [3.7] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (#21298) Message-ID: https://github.com/python/cpython/commit/110dd153662a13b8ae1bb06348e5b1f118ab26d7 commit: 110dd153662a13b8ae1bb06348e5b1f118ab26d7 branch: 3.7 author: Steve Dower committer: GitHub date: 2020-07-06T13:24:59-04:00 summary: [3.7] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21297) (#21298) * bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded. * Add CVE number files: A Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst M PC/getpathp.c M PCbuild/pyproject.props M PCbuild/python.props M Python/dynload_win.c diff --git a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst new file mode 100644 index 0000000000000..998ffb1ee6667 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst @@ -0,0 +1,2 @@ +Ensure :file:`python3.dll` is loaded from correct locations when Python is +embedded (CVE-2020-15523). diff --git a/PC/getpathp.c b/PC/getpathp.c index dc4e43fe7d3b6..f7022aea1f557 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -161,27 +161,37 @@ reduce(wchar_t *dir) static int change_ext(wchar_t *dest, const wchar_t *src, const wchar_t *ext) { - size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); - size_t i = src_len; - if (i >= MAXPATHLEN+1) { - Py_FatalError("buffer overflow in getpathp.c's reduce()"); - } + if (src && src != dest) { + size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); + size_t i = src_len; + if (i >= MAXPATHLEN+1) { + Py_FatalError("buffer overflow in getpathp.c's reduce()"); + } - while (i > 0 && src[i] != '.' && !is_sep(src[i])) - --i; + while (i > 0 && src[i] != '.' && !is_sep(src[i])) + --i; - if (i == 0) { - dest[0] = '\0'; - return -1; - } + if (i == 0) { + dest[0] = '\0'; + return -1; + } + + if (is_sep(src[i])) { + i = src_len; + } - if (is_sep(src[i])) { - i = src_len; + if (wcsncpy_s(dest, MAXPATHLEN+1, src, i)) { + dest[0] = '\0'; + return -1; + } + } else { + wchar_t *s = wcsrchr(dest, L'.'); + if (s) { + s[0] = '\0'; + } } - if (wcsncpy_s(dest, MAXPATHLEN+1, src, i) || - wcscat_s(dest, MAXPATHLEN+1, ext)) - { + if (wcscat_s(dest, MAXPATHLEN+1, ext)) { dest[0] = '\0'; return -1; } @@ -337,6 +347,19 @@ search_for_prefix(wchar_t *prefix, const wchar_t *argv0_path, const wchar_t *lan } +static int +get_dllpath(wchar_t *dllpath) +{ +#ifdef Py_ENABLE_SHARED + extern HANDLE PyWin_DLLhModule; + if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) { + return 0; + } +#endif + return -1; +} + + #ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ @@ -509,31 +532,6 @@ getpythonregpath(HKEY keyBase, int skipcore) #endif /* Py_ENABLE_SHARED */ -static _PyInitError -get_dll_path(PyCalculatePath *calculate, _PyPathConfig *config) -{ - wchar_t dll_path[MAXPATHLEN+1]; - memset(dll_path, 0, sizeof(dll_path)); - -#ifdef Py_ENABLE_SHARED - extern HANDLE PyWin_DLLhModule; - if (PyWin_DLLhModule) { - if (!GetModuleFileNameW(PyWin_DLLhModule, dll_path, MAXPATHLEN)) { - dll_path[0] = 0; - } - } -#else - dll_path[0] = 0; -#endif - - config->dll_path = _PyMem_RawWcsdup(dll_path); - if (config->dll_path == NULL) { - return _Py_INIT_NO_MEMORY(); - } - return _Py_INIT_OK(); -} - - static _PyInitError get_program_full_path(const _PyCoreConfig *core_config, PyCalculatePath *calculate, _PyPathConfig *config) @@ -675,12 +673,11 @@ calculate_init(PyCalculatePath *calculate, static int get_pth_filename(wchar_t *spbuffer, _PyPathConfig *config) { - if (config->dll_path[0]) { - if (!change_ext(spbuffer, config->dll_path, L"._pth") && - exists(spbuffer)) - { - return 1; - } + if (get_dllpath(spbuffer) && + !change_ext(spbuffer, spbuffer, L"._pth") && + exists(spbuffer)) + { + return 1; } if (config->program_full_path[0]) { if (!change_ext(spbuffer, config->program_full_path, L"._pth") && @@ -967,11 +964,6 @@ calculate_path_impl(const _PyCoreConfig *core_config, { _PyInitError err; - err = get_dll_path(calculate, config); - if (_Py_INIT_FAILED(err)) { - return err; - } - err = get_program_full_path(core_config, calculate, config); if (_Py_INIT_FAILED(err)) { return err; @@ -992,9 +984,13 @@ calculate_path_impl(const _PyCoreConfig *core_config, calculate_pyvenv_file(calculate); /* Calculate zip archive path from DLL or exe path */ - change_ext(calculate->zip_path, - config->dll_path[0] ? config->dll_path : config->program_full_path, - L".zip"); + if (get_dllpath(calculate->zip_path) || + change_ext(calculate->zip_path, calculate->zip_path, L".zip")) + { + if (change_ext(calculate->zip_path, config->program_full_path, L".zip")) { + calculate->zip_path[0] = L'\0'; + } + } calculate_home_prefix(calculate, prefix); @@ -1054,28 +1050,39 @@ int _Py_CheckPython3(void) { wchar_t py3path[MAXPATHLEN+1]; - wchar_t *s; if (python3_checked) { return hPython3 != NULL; } python3_checked = 1; /* If there is a python3.dll next to the python3y.dll, - assume this is a build tree; use that DLL */ - wcscpy(py3path, _Py_path_config.dll_path); - s = wcsrchr(py3path, L'\\'); - if (!s) { - s = py3path; + use that DLL */ + if (!get_dllpath(py3path)) { + reduce(py3path); + join(py3path, PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (hPython3 != NULL) { + return 1; + } } - wcscpy(s, L"\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - if (hPython3 != NULL) { - return 1; + + /* If we can locate python3.dll in our application dir, + use that DLL */ + wcscpy(py3path, Py_GetPrefix()); + if (py3path[0]) { + join(py3path, PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (hPython3 != NULL) { + return 1; + } } - /* Check sys.prefix\DLLs\python3.dll */ + /* For back-compat, also search {sys.prefix}\DLLs, though + that has not been a normal install layout for a while */ wcscpy(py3path, Py_GetPrefix()); - wcscat(py3path, L"\\DLLs\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (py3path[0]) { + join(py3path, L"DLLs\\" PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + } return hPython3 != NULL; } diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index c07bac3c24211..0f7561744249f 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -24,12 +24,12 @@ <_PlatformPreprocessorDefinition>_WIN32; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64; <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE; + <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)"; $(PySourcePath)Include;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) - WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) - + WIN32;$(_Py3NamePreprocessorDefinition)$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true true diff --git a/PCbuild/python.props b/PCbuild/python.props index 8be1daa696323..1034e7f3da3fe 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -177,6 +177,8 @@ python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + python3$(PyDebugExt) .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 51325be658af8..8d67d2e7bad6c 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -192,9 +192,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, char funcname[258], *import_python; const wchar_t *wpathname; -#ifndef _DEBUG _Py_CheckPython3(); -#endif wpathname = _PyUnicode_AsUnicode(pathname); if (wpathname == NULL) From webhook-mailer at python.org Mon Jul 6 14:55:48 2020 From: webhook-mailer at python.org (Steve Dower) Date: Mon, 06 Jul 2020 18:55:48 -0000 Subject: [Python-checkins] [3.6] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21298) (#21354) Message-ID: https://github.com/python/cpython/commit/46cbf6148a46883110883488d3e9febbe46ba861 commit: 46cbf6148a46883110883488d3e9febbe46ba861 branch: 3.6 author: Steve Dower committer: GitHub date: 2020-07-06T14:55:43-04:00 summary: [3.6] bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21298) (#21354) * bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded (GH-21298) * bpo-29778: Ensure python3.dll is loaded from correct locations when Python is embedded. * Add CVE number * Updates for 3.6 files: A Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst M PC/getpathp.c M PCbuild/pyproject.props M PCbuild/python.props M Python/dynload_win.c diff --git a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst new file mode 100644 index 0000000000000..998ffb1ee6667 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst @@ -0,0 +1,2 @@ +Ensure :file:`python3.dll` is loaded from correct locations when Python is +embedded (CVE-2020-15523). diff --git a/PC/getpathp.c b/PC/getpathp.c index e86c376fb4d34..f6f362c7f9c1d 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -118,7 +118,6 @@ static wchar_t prefix[MAXPATHLEN+1]; static wchar_t progpath[MAXPATHLEN+1]; -static wchar_t dllpath[MAXPATHLEN+1]; static wchar_t *module_search_path = NULL; @@ -150,24 +149,37 @@ reduce(wchar_t *dir) static int change_ext(wchar_t *dest, const wchar_t *src, const wchar_t *ext) { - size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); - size_t i = src_len; - if (i >= MAXPATHLEN+1) - Py_FatalError("buffer overflow in getpathp.c's reduce()"); + if (src && src != dest) { + size_t src_len = wcsnlen_s(src, MAXPATHLEN+1); + size_t i = src_len; + if (i >= MAXPATHLEN+1) { + Py_FatalError("buffer overflow in getpathp.c's reduce()"); + } - while (i > 0 && src[i] != '.' && !is_sep(src[i])) - --i; + while (i > 0 && src[i] != '.' && !is_sep(src[i])) + --i; - if (i == 0) { - dest[0] = '\0'; - return -1; - } + if (i == 0) { + dest[0] = '\0'; + return -1; + } - if (is_sep(src[i])) - i = src_len; + if (is_sep(src[i])) { + i = src_len; + } + + if (wcsncpy_s(dest, MAXPATHLEN+1, src, i)) { + dest[0] = '\0'; + return -1; + } + } else { + wchar_t *s = wcsrchr(dest, L'.'); + if (s) { + s[0] = '\0'; + } + } - if (wcsncpy_s(dest, MAXPATHLEN+1, src, i) || - wcscat_s(dest, MAXPATHLEN+1, ext)) { + if (wcscat_s(dest, MAXPATHLEN+1, ext)) { dest[0] = '\0'; return -1; } @@ -304,6 +316,20 @@ search_for_prefix(wchar_t *argv0_path, const wchar_t *landmark) return 0; } + +static int +get_dllpath(wchar_t *dllpath) +{ +#ifdef Py_ENABLE_SHARED + extern HANDLE PyWin_DLLhModule; + if (PyWin_DLLhModule && GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) { + return 0; + } +#endif + return -1; +} + + #ifdef Py_ENABLE_SHARED /* a string loaded from the DLL at startup.*/ @@ -467,15 +493,6 @@ get_progpath(void) wchar_t *path = _wgetenv(L"PATH"); wchar_t *prog = Py_GetProgramName(); -#ifdef Py_ENABLE_SHARED - extern HANDLE PyWin_DLLhModule; - /* static init of progpath ensures final char remains \0 */ - if (PyWin_DLLhModule) - if (!GetModuleFileNameW(PyWin_DLLhModule, dllpath, MAXPATHLEN)) - dllpath[0] = 0; -#else - dllpath[0] = 0; -#endif if (GetModuleFileNameW(NULL, modulepath, MAXPATHLEN)) { canonicalize(progpath, modulepath); return; @@ -693,7 +710,7 @@ calculate_path(void) { wchar_t spbuffer[MAXPATHLEN+1]; - if ((dllpath[0] && !change_ext(spbuffer, dllpath, L"._pth") && exists(spbuffer)) || + if ((!get_dllpath(spbuffer) && !change_ext(spbuffer, spbuffer, L"._pth") && exists(spbuffer)) || (progpath[0] && !change_ext(spbuffer, progpath, L"._pth") && exists(spbuffer))) { if (!read_pth_file(spbuffer, prefix, &Py_IsolatedFlag, &Py_NoSiteFlag)) { @@ -737,7 +754,11 @@ calculate_path(void) } /* Calculate zip archive path from DLL or exe path */ - change_ext(zip_path, dllpath[0] ? dllpath : progpath, L".zip"); + if (!get_dllpath(zip_path)) { + change_ext(zip_path, zip_path, L".zip"); + } else { + change_ext(zip_path, progpath, L".zip"); + } if (pythonhome == NULL || *pythonhome == '\0') { if (zip_path[0] && exists(zip_path)) { @@ -919,8 +940,6 @@ calculate_path(void) } -/* External interface */ - void Py_SetPath(const wchar_t *path) { @@ -981,25 +1000,39 @@ int _Py_CheckPython3() { wchar_t py3path[MAXPATHLEN+1]; - wchar_t *s; - if (python3_checked) + if (python3_checked) { return hPython3 != NULL; + } python3_checked = 1; /* If there is a python3.dll next to the python3y.dll, - assume this is a build tree; use that DLL */ - wcscpy(py3path, dllpath); - s = wcsrchr(py3path, L'\\'); - if (!s) - s = py3path; - wcscpy(s, L"\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); - if (hPython3 != NULL) - return 1; + use that DLL */ + if (!get_dllpath(py3path)) { + reduce(py3path); + join(py3path, PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (hPython3 != NULL) { + return 1; + } + } + + /* If we can locate python3.dll in our application dir, + use that DLL */ + wcscpy(py3path, Py_GetPrefix()); + if (py3path[0]) { + join(py3path, PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (hPython3 != NULL) { + return 1; + } + } - /* Check sys.prefix\DLLs\python3.dll */ + /* For back-compat, also search {sys.prefix}\DLLs, though + that has not been a normal install layout for a while */ wcscpy(py3path, Py_GetPrefix()); - wcscat(py3path, L"\\DLLs\\python3.dll"); - hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + if (py3path[0]) { + join(py3path, L"DLLs\\" PY3_DLLNAME); + hPython3 = LoadLibraryExW(py3path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + } return hPython3 != NULL; } diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 1602ebf5ec973..104a9d8e623a7 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -24,12 +24,12 @@ <_PlatformPreprocessorDefinition>_WIN32; <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64; <_PydPreprocessorDefinition Condition="$(TargetExt) == '.pyd'">Py_BUILD_CORE_MODULE; + <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)"; $(PySourcePath)Include;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories) - WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) - + WIN32;$(_Py3NamePreprocessorDefinition)$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions) MaxSpeed true true diff --git a/PCbuild/python.props b/PCbuild/python.props index 3022ca50c247a..b82425ea9710d 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -175,6 +175,8 @@ python$(MajorVersionNumber)$(MinorVersionNumber)$(PyDebugExt) + + python3$(PyDebugExt) .cp$(MajorVersionNumber)$(MinorVersionNumber)-win32 diff --git a/Python/dynload_win.c b/Python/dynload_win.c index 0fdf77f55280c..a307188823cfe 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -192,9 +192,7 @@ dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, char funcname[258], *import_python; const wchar_t *wpathname; -#ifndef _DEBUG _Py_CheckPython3(); -#endif wpathname = _PyUnicode_AsUnicode(pathname); if (wpathname == NULL) From webhook-mailer at python.org Mon Jul 6 15:31:20 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 06 Jul 2020 19:31:20 -0000 Subject: [Python-checkins] bpo-41215: Don't use NULL by default in the PEG parser keyword list (GH-21355) Message-ID: https://github.com/python/cpython/commit/1ac0cbca369f16f9191833dd54536482fb141a98 commit: 1ac0cbca369f16f9191833dd54536482fb141a98 branch: master author: Pablo Galindo committer: GitHub date: 2020-07-06T12:31:16-07:00 summary: bpo-41215: Don't use NULL by default in the PEG parser keyword list (GH-21355) Automerge-Triggered-By: @lysnikolaou files: A Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst M Parser/parser.c M Parser/pegen.c M Tools/peg_generator/pegen/c_generator.py diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst new file mode 100644 index 0000000000000..7343da31e94f7 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-18-36-33.bpo-41215.vFGFIz.rst @@ -0,0 +1,2 @@ +Use non-NULL default values in the PEG parser keyword list to overcome a bug that was preventing +Python from being properly compiled when using the XLC compiler. Patch by Pablo Galindo. diff --git a/Parser/parser.c b/Parser/parser.c index bfd5c47caf07e..75dc7176a5e75 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -9,8 +9,8 @@ extern int Py_DebugFlag; #endif static const int n_keyword_lists = 9; static KeywordToken *reserved_keywords[] = { - NULL, - NULL, + (KeywordToken[]) {{NULL, -1}}, + (KeywordToken[]) {{NULL, -1}}, (KeywordToken[]) { {"if", 510}, {"in", 518}, diff --git a/Parser/pegen.c b/Parser/pegen.c index 53e3d49138306..42f9e0c41bf49 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -525,10 +525,13 @@ _PyPegen_dummy_name(Parser *p, ...) static int _get_keyword_or_name_type(Parser *p, const char *name, int name_len) { - if (name_len >= p->n_keyword_lists || p->keywords[name_len] == NULL) { + assert(name_len != 0); + if (name_len >= p->n_keyword_lists || + p->keywords[name_len] == NULL || + p->keywords[name_len]->type == -1) { return NAME; } - for (KeywordToken *k = p->keywords[name_len]; k->type != -1; k++) { + for (KeywordToken *k = p->keywords[name_len]; k != NULL && k->type != -1; k++) { if (strncmp(k->str, name, name_len) == 0) { return k->type; } diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index 58a44fbe67e8b..aee668c3f329a 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -440,7 +440,7 @@ def _setup_keywords(self) -> None: num_groups = max(groups) + 1 if groups else 1 for keywords_length in range(num_groups): if keywords_length not in groups.keys(): - self.print("NULL,") + self.print("(KeywordToken[]) {{NULL, -1}},") else: self.print("(KeywordToken[]) {") with self.indent(): From webhook-mailer at python.org Mon Jul 6 16:28:23 2020 From: webhook-mailer at python.org (Julien Palard) Date: Mon, 06 Jul 2020 20:28:23 -0000 Subject: [Python-checkins] bpo-40742: Doc: fix parallel build. (GH-21237) Message-ID: https://github.com/python/cpython/commit/a103e73ce8d34e3af5f556ee9090ce89249d565e commit: a103e73ce8d34e3af5f556ee9090ce89249d565e branch: master author: Julien Palard committer: GitHub date: 2020-07-06T22:28:15+02:00 summary: bpo-40742: Doc: fix parallel build. (GH-21237) files: M Doc/tools/extensions/pyspecific.py diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py index 46064fa3b6b00..008dd8a6f7c8c 100644 --- a/Doc/tools/extensions/pyspecific.py +++ b/Doc/tools/extensions/pyspecific.py @@ -125,6 +125,39 @@ def run(self): # Support for documenting audit event +def audit_events_purge(app, env, docname): + """This is to remove from env.all_audit_events old traces of removed + documents. + """ + if not hasattr(env, 'all_audit_events'): + return + fresh_all_audit_events = {} + for name, event in env.all_audit_events.items(): + event["source"] = [(d, t) for d, t in event["source"] if d != docname] + if event["source"]: + # Only keep audit_events that have at least one source. + fresh_all_audit_events[name] = event + env.all_audit_events = fresh_all_audit_events + + +def audit_events_merge(app, env, docnames, other): + """In Sphinx parallel builds, this merges env.all_audit_events from + subprocesses. + + all_audit_events is a dict of names, with values like: + {'source': [(docname, target), ...], 'args': args} + """ + if not hasattr(other, 'all_audit_events'): + return + if not hasattr(env, 'all_audit_events'): + env.all_audit_events = {} + for name, value in other.all_audit_events.items(): + if name in env.all_audit_events: + env.all_audit_events[name]["source"].extend(value["source"]) + else: + env.all_audit_events[name] = value + + class AuditEvent(Directive): has_content = True @@ -589,4 +622,6 @@ def setup(app): app.add_directive_to_domain('py', 'abstractmethod', PyAbstractMethod) app.add_directive('miscnews', MiscNews) app.connect('doctree-resolved', process_audit_events) + app.connect('env-merge-info', audit_events_merge) + app.connect('env-purge-doc', audit_events_purge) return {'version': '1.0', 'parallel_read_safe': True} From webhook-mailer at python.org Mon Jul 6 17:27:02 2020 From: webhook-mailer at python.org (Matthias Bussonnier) Date: Mon, 06 Jul 2020 21:27:02 -0000 Subject: [Python-checkins] bpo-41218: Only mark async code with CO_COROUTINE. (#21357) Message-ID: https://github.com/python/cpython/commit/bd46174a5a09a54e5ae1077909f923f56a7cf710 commit: bd46174a5a09a54e5ae1077909f923f56a7cf710 branch: master author: Matthias Bussonnier committer: GitHub date: 2020-07-06T23:26:52+02:00 summary: bpo-41218: Only mark async code with CO_COROUTINE. (#21357) 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT woudl agressively mark things are coroutine even if there were not. files: A Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst M Lib/test/test_builtin.py M Python/compile.c diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 40df7b606ae5e..3dcdf8d903059 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -371,6 +371,25 @@ def f(): """doc""" rv = ns['f']() self.assertEqual(rv, tuple(expected)) + def test_compile_top_level_await_no_coro(self): + """Make sure top level non-await codes get the correct coroutine flags. + """ + modes = ('single', 'exec') + code_samples = [ + '''def f():pass\n''', + '''[x for x in l]''' + ] + for mode, code_sample in product(modes, code_samples): + source = dedent(code_sample) + co = compile(source, + '?', + mode, + flags=ast.PyCF_ALLOW_TOP_LEVEL_AWAIT) + + self.assertNotEqual(co.co_flags & CO_COROUTINE, CO_COROUTINE, + msg=f"source={source} mode={mode}") + + def test_compile_top_level_await(self): """Test whether code some top level await can be compiled. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst new file mode 100644 index 0000000000000..d98b3433ef05f --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst @@ -0,0 +1,4 @@ +Python 3.8.3 had a regression where compiling with +ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension +with CO_COROUTINE. Now only list comprehension making use of async/await +will tagged as so. diff --git a/Python/compile.c b/Python/compile.c index 4a9b511961e5e..1b94f0656d2d4 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4588,10 +4588,9 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, comprehension_ty outermost; PyObject *qualname = NULL; int is_async_generator = 0; + int top_level_await = IS_TOP_LEVEL_AWAIT(c); + - if (IS_TOP_LEVEL_AWAIT(c)) { - c->u->u_ste->ste_coroutine = 1; - } int is_async_function = c->u->u_ste->ste_coroutine; outermost = (comprehension_ty) asdl_seq_GET(generators, 0); @@ -4603,7 +4602,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, is_async_generator = c->u->u_ste->ste_coroutine; - if (is_async_generator && !is_async_function && type != COMP_GENEXP) { + if (is_async_generator && !is_async_function && type != COMP_GENEXP && !top_level_await) { compiler_error(c, "asynchronous comprehension outside of " "an asynchronous function"); goto error_in_scope; @@ -4642,6 +4641,9 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, qualname = c->u->u_qualname; Py_INCREF(qualname); compiler_exit_scope(c); + if (top_level_await && is_async_generator){ + c->u->u_ste->ste_coroutine = 1; + } if (co == NULL) goto error; From webhook-mailer at python.org Mon Jul 6 17:44:25 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Jul 2020 21:44:25 -0000 Subject: [Python-checkins] bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357) Message-ID: https://github.com/python/cpython/commit/41db8ffc59566b8552f9cce4452ee8afad00aa63 commit: 41db8ffc59566b8552f9cce4452ee8afad00aa63 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-06T14:44:16-07:00 summary: bpo-41218: Only mark async code with CO_COROUTINE. (GH-21357) 3.8.3 had a regression where compiling with ast.PyCF_ALLOW_TOP_LEVEL_AWAIT woudl agressively mark things are coroutine even if there were not. (cherry picked from commit bd46174a5a09a54e5ae1077909f923f56a7cf710) Co-authored-by: Matthias Bussonnier files: A Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst M Lib/test/test_builtin.py M Python/compile.c diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 48b0e33af59ed..f47689dfdea41 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -370,6 +370,25 @@ def f(): """doc""" rv = ns['f']() self.assertEqual(rv, tuple(expected)) + def test_compile_top_level_await_no_coro(self): + """Make sure top level non-await codes get the correct coroutine flags. + """ + modes = ('single', 'exec') + code_samples = [ + '''def f():pass\n''', + '''[x for x in l]''' + ] + for mode, code_sample in product(modes, code_samples): + source = dedent(code_sample) + co = compile(source, + '?', + mode, + flags=ast.PyCF_ALLOW_TOP_LEVEL_AWAIT) + + self.assertNotEqual(co.co_flags & CO_COROUTINE, CO_COROUTINE, + msg=f"source={source} mode={mode}") + + def test_compile_top_level_await(self): """Test whether code some top level await can be compiled. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst new file mode 100644 index 0000000000000..d98b3433ef05f --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst @@ -0,0 +1,4 @@ +Python 3.8.3 had a regression where compiling with +ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension +with CO_COROUTINE. Now only list comprehension making use of async/await +will tagged as so. diff --git a/Python/compile.c b/Python/compile.c index 913ec992395a0..3259e8a47f2d8 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4470,10 +4470,9 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, comprehension_ty outermost; PyObject *qualname = NULL; int is_async_generator = 0; + int top_level_await = IS_TOP_LEVEL_AWAIT(c); + - if (IS_TOP_LEVEL_AWAIT(c)) { - c->u->u_ste->ste_coroutine = 1; - } int is_async_function = c->u->u_ste->ste_coroutine; outermost = (comprehension_ty) asdl_seq_GET(generators, 0); @@ -4485,7 +4484,7 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, is_async_generator = c->u->u_ste->ste_coroutine; - if (is_async_generator && !is_async_function && type != COMP_GENEXP) { + if (is_async_generator && !is_async_function && type != COMP_GENEXP && !top_level_await) { compiler_error(c, "asynchronous comprehension outside of " "an asynchronous function"); goto error_in_scope; @@ -4524,6 +4523,9 @@ compiler_comprehension(struct compiler *c, expr_ty e, int type, qualname = c->u->u_qualname; Py_INCREF(qualname); compiler_exit_scope(c); + if (top_level_await && is_async_generator){ + c->u->u_ste->ste_coroutine = 1; + } if (co == NULL) goto error; From webhook-mailer at python.org Mon Jul 6 18:30:18 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 06 Jul 2020 22:30:18 -0000 Subject: [Python-checkins] bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) Message-ID: https://github.com/python/cpython/commit/c2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8 commit: c2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8 branch: master author: Pablo Galindo committer: GitHub date: 2020-07-06T23:30:14+01:00 summary: bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) files: M Lib/test/test_builtin.py diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 3dcdf8d903059..3bc1a3e246fdf 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -372,12 +372,14 @@ def f(): """doc""" self.assertEqual(rv, tuple(expected)) def test_compile_top_level_await_no_coro(self): - """Make sure top level non-await codes get the correct coroutine flags. - """ + """Make sure top level non-await codes get the correct coroutine flags""" modes = ('single', 'exec') code_samples = [ '''def f():pass\n''', - '''[x for x in l]''' + '''[x for x in l]''', + '''{x for x in l}''', + '''(x for x in l)''', + '''{x:x for x in l}''', ] for mode, code_sample in product(modes, code_samples): source = dedent(code_sample) From webhook-mailer at python.org Mon Jul 6 18:42:31 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Mon, 06 Jul 2020 22:42:31 -0000 Subject: [Python-checkins] bpo-41215: Make assertion in the new parser more strict (GH-21364) Message-ID: https://github.com/python/cpython/commit/782f44b8fb07ec33cee148b2b6b4cf53024fe0cd commit: 782f44b8fb07ec33cee148b2b6b4cf53024fe0cd branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-07-07T01:42:21+03:00 summary: bpo-41215: Make assertion in the new parser more strict (GH-21364) files: M Parser/pegen.c diff --git a/Parser/pegen.c b/Parser/pegen.c index 42f9e0c41bf49..e2cbf8ba2461c 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -525,7 +525,7 @@ _PyPegen_dummy_name(Parser *p, ...) static int _get_keyword_or_name_type(Parser *p, const char *name, int name_len) { - assert(name_len != 0); + assert(name_len > 0); if (name_len >= p->n_keyword_lists || p->keywords[name_len] == NULL || p->keywords[name_len]->type == -1) { From webhook-mailer at python.org Mon Jul 6 19:30:54 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Jul 2020 23:30:54 -0000 Subject: [Python-checkins] bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) Message-ID: https://github.com/python/cpython/commit/b71ff9a5b6e60ee1209a04d2e0e58d9a2e341db3 commit: b71ff9a5b6e60ee1209a04d2e0e58d9a2e341db3 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-06T16:30:46-07:00 summary: bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) (cherry picked from commit c2c1f1f906cdeb40576880d4b6a4f8fcbc016eb8) Co-authored-by: Pablo Galindo files: M Lib/test/test_builtin.py diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index f47689dfdea41..4a498262ba637 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -371,12 +371,14 @@ def f(): """doc""" self.assertEqual(rv, tuple(expected)) def test_compile_top_level_await_no_coro(self): - """Make sure top level non-await codes get the correct coroutine flags. - """ + """Make sure top level non-await codes get the correct coroutine flags""" modes = ('single', 'exec') code_samples = [ '''def f():pass\n''', - '''[x for x in l]''' + '''[x for x in l]''', + '''{x for x in l}''', + '''(x for x in l)''', + '''{x:x for x in l}''', ] for mode, code_sample in product(modes, code_samples): source = dedent(code_sample) From webhook-mailer at python.org Tue Jul 7 07:11:45 2020 From: webhook-mailer at python.org (Jason R. Coombs) Date: Tue, 07 Jul 2020 11:11:45 -0000 Subject: [Python-checkins] bpo-41207 In distutils.spawn, rewrite FileNotFound (GH-21359) Message-ID: https://github.com/python/cpython/commit/6ae2780be0667a8dc52c4fb583171ec86067d700 commit: 6ae2780be0667a8dc52c4fb583171ec86067d700 branch: master author: Jason R. Coombs committer: GitHub date: 2020-07-07T04:11:28-07:00 summary: bpo-41207 In distutils.spawn, rewrite FileNotFound (GH-21359) Automerge-Triggered-By: @jaraco files: A Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst M Lib/distutils/spawn.py M Lib/distutils/tests/test_spawn.py diff --git a/Lib/distutils/spawn.py b/Lib/distutils/spawn.py index aad277b0ca776..0d1bd0391e6f1 100644 --- a/Lib/distutils/spawn.py +++ b/Lib/distutils/spawn.py @@ -71,9 +71,15 @@ def spawn(cmd, search_path=1, verbose=0, dry_run=0): env = dict(os.environ, MACOSX_DEPLOYMENT_TARGET=cur_target) - proc = subprocess.Popen(cmd, env=env) - proc.wait() - exitcode = proc.returncode + try: + proc = subprocess.Popen(cmd, env=env) + proc.wait() + exitcode = proc.returncode + except OSError as exc: + if not DEBUG: + cmd = cmd[0] + raise DistutilsExecError( + "command %r failed: %s" % (cmd, exc.args[-1])) from exc if exitcode: if not DEBUG: diff --git a/Lib/distutils/tests/test_spawn.py b/Lib/distutils/tests/test_spawn.py index 3647bab7b1cbc..4ec767b120e71 100644 --- a/Lib/distutils/tests/test_spawn.py +++ b/Lib/distutils/tests/test_spawn.py @@ -124,6 +124,11 @@ def test_find_executable(self): rv = find_executable(program) self.assertEqual(rv, filename) + def test_spawn_missing_exe(self): + with self.assertRaises(DistutilsExecError) as ctx: + spawn(['does-not-exist']) + self.assertIn("command 'does-not-exist' failed", str(ctx.exception)) + def test_suite(): return unittest.makeSuite(SpawnTestCase) diff --git a/Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst b/Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst new file mode 100644 index 0000000000000..db99c63f94883 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-06-16-58-53.bpo-41207.Emw7Nk.rst @@ -0,0 +1 @@ +In distutils.spawn, restore expectation that DistutilsExecError is raised when the command is not found. From webhook-mailer at python.org Tue Jul 7 18:20:45 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Jul 2020 22:20:45 -0000 Subject: [Python-checkins] bpo-29778: test_embed tests the path configuration (GH-21306) Message-ID: https://github.com/python/cpython/commit/8f42748ded5e978fe8a924115179d45a74a6363b commit: 8f42748ded5e978fe8a924115179d45a74a6363b branch: master author: Victor Stinner committer: GitHub date: 2020-07-08T00:20:37+02:00 summary: bpo-29778: test_embed tests the path configuration (GH-21306) files: M Include/internal/pycore_pathconfig.h M Lib/test/test_embed.py M Modules/_testinternalcapi.c M Python/initconfig.c M Python/pathconfig.c diff --git a/Include/internal/pycore_pathconfig.h b/Include/internal/pycore_pathconfig.h index 42d61b1ca26bd..15447f54490fb 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 44d2596d9eb30..2b740521e723c 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 f08bf8d83d474..ad74af8363ef4 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 86285c77e2307..64286763b621e 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 9a302213e77b6..12a684a66b718 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 webhook-mailer at python.org Tue Jul 7 19:10:01 2020 From: webhook-mailer at python.org (Joannah Nanjekye) Date: Tue, 07 Jul 2020 23:10:01 -0000 Subject: [Python-checkins] bpo-41224: Document is_annotated() in symtable module and update doc strings (GH-21369) Message-ID: https://github.com/python/cpython/commit/a95ac779e6bca0d87819969e361627182b83292c commit: a95ac779e6bca0d87819969e361627182b83292c branch: master author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> committer: GitHub date: 2020-07-07T20:09:56-03:00 summary: 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 files: M Doc/library/symtable.rst M Lib/symtable.py diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index 3efdecb5af710..c9521d649b893 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 a711676582f64..9ff27ef74ffe8 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 webhook-mailer at python.org Tue Jul 7 19:24:47 2020 From: webhook-mailer at python.org (Steve Dower) Date: Tue, 07 Jul 2020 23:24:47 -0000 Subject: [Python-checkins] bpo-41173: Copy test results file from ARM worker before uploading (GH-21305) Message-ID: https://github.com/python/cpython/commit/10772ec1505a4583d662c051e577eb2d4fb6e755 commit: 10772ec1505a4583d662c051e577eb2d4fb6e755 branch: master author: Steve Dower committer: GitHub date: 2020-07-08T00:24:39+01:00 summary: bpo-41173: Copy test results file from ARM worker before uploading (GH-21305) files: M Tools/buildbot/test.bat diff --git a/Tools/buildbot/test.bat b/Tools/buildbot/test.bat index a0fc6b9a9458b..25c796a60e173 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 webhook-mailer at python.org Tue Jul 7 19:47:13 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 07 Jul 2020 23:47:13 -0000 Subject: [Python-checkins] bpo-39417: Fix broken link to guide to building venvs (GH-18432) Message-ID: https://github.com/python/cpython/commit/730bce3a80819e0b7fa6bfa1e1afcd4c837b62c1 commit: 730bce3a80819e0b7fa6bfa1e1afcd4c837b62c1 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-07T16:47:09-07:00 summary: bpo-39417: Fix broken link to guide to building venvs (GH-18432) (cherry picked from commit c4a65ed7fe342bd18b5a5b0eea3470dc4fc31160) Co-authored-by: Ogi Moore files: M Doc/library/venv.rst diff --git a/Doc/library/venv.rst b/Doc/library/venv.rst index 31a3f41e4724c..59b251837a489 100644 --- a/Doc/library/venv.rst +++ b/Doc/library/venv.rst @@ -27,7 +27,7 @@ See :pep:`405` for more information about Python virtual environments. .. seealso:: `Python Packaging User Guide: Creating and using virtual environments - `__ + `__ Creating virtual environments From webhook-mailer at python.org Tue Jul 7 20:45:54 2020 From: webhook-mailer at python.org (Joannah Nanjekye) Date: Wed, 08 Jul 2020 00:45:54 -0000 Subject: [Python-checkins] Add a test for get_id() (GH-21370) Message-ID: https://github.com/python/cpython/commit/6f13adf59e6feb736d05ebe174bd793f4437a3d8 commit: 6f13adf59e6feb736d05ebe174bd793f4437a3d8 branch: master author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> committer: GitHub date: 2020-07-07T21:45:45-03:00 summary: Add a test for get_id() (GH-21370) files: M Lib/test/test_symtable.py diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index d19355888e4b3..fa514917a1f02 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 webhook-mailer at python.org Wed Jul 8 00:22:02 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Wed, 08 Jul 2020 04:22:02 -0000 Subject: [Python-checkins] closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385) Message-ID: https://github.com/python/cpython/commit/aebc0495572c5bb85d2bd97d27cf93ab038b5a6a commit: aebc0495572c5bb85d2bd97d27cf93ab038b5a6a branch: master author: Zackery Spytz committer: GitHub date: 2020-07-07T23:21:58-05:00 summary: closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385) files: A Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst M Modules/_ssl.c 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 0000000000000..c55275bb1c622 --- /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 5e82fe41a76ec..58064178a1a34 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 webhook-mailer at python.org Wed Jul 8 00:37:58 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 08 Jul 2020 04:37:58 -0000 Subject: [Python-checkins] closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385) Message-ID: https://github.com/python/cpython/commit/c8b599ff0a4e4782e97e353a20146d3570845dbc commit: c8b599ff0a4e4782e97e353a20146d3570845dbc branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-07T21:37:50-07:00 summary: closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21385) (cherry picked from commit aebc0495572c5bb85d2bd97d27cf93ab038b5a6a) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst M Modules/_ssl.c 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 0000000000000..c55275bb1c622 --- /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 9fbaecb80739f..8ee2c170368fd 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4312,8 +4312,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 webhook-mailer at python.org Wed Jul 8 00:55:44 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 08 Jul 2020 04:55:44 -0000 Subject: [Python-checkins] closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21389) Message-ID: https://github.com/python/cpython/commit/c8c818b0d73680516d5841597b705a1feeb42113 commit: c8c818b0d73680516d5841597b705a1feeb42113 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-07T23:55:36-05:00 summary: closes bpo-41235: Fix the error handling in SSLContext.load_dh_params() (GH-21389) (cherry picked from commit aebc0495572c5bb85d2bd97d27cf93ab038b5a6a) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst M Modules/_ssl.c 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 0000000000000..c55275bb1c622 --- /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 93cc529e796a0..719f8e8ca308d 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4189,8 +4189,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 webhook-mailer at python.org Wed Jul 8 05:02:38 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Jul 2020 09:02:38 -0000 Subject: [Python-checkins] Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390) Message-ID: https://github.com/python/cpython/commit/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68 commit: b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68 branch: master author: Victor Stinner committer: GitHub date: 2020-07-08T11:02:23+02:00 summary: Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390) This partially reverts commit 45ec5b99aefa54552947049086e87ec01bc2fc9a. files: A Misc/NEWS.d/next/C API/2020-07-08-10-14-52.bpo-40170.N6Qx1i.rst M Include/object.h diff --git a/Include/object.h b/Include/object.h index 537567040f987..10f1d6a3dff2d 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 0000000000000..760a3ff4d17b4 --- /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 webhook-mailer at python.org Wed Jul 8 15:27:40 2020 From: webhook-mailer at python.org (Tony Solomonik) Date: Wed, 08 Jul 2020 19:27:40 -0000 Subject: [Python-checkins] bpo-41247: asyncio.set_running_loop() cache running loop holder (GH-21401) Message-ID: https://github.com/python/cpython/commit/529f42645d38b6b0075f256814dfb3d220ac7d92 commit: 529f42645d38b6b0075f256814dfb3d220ac7d92 branch: master author: Tony Solomonik committer: GitHub date: 2020-07-08T12:27:31-07:00 summary: 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 files: A Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst M Modules/_asynciomodule.c 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 0000000000000..08699b6e4a1f0 --- /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 b378742648b2a..4a1c91e9eddd6 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 webhook-mailer at python.org Wed Jul 8 16:39:49 2020 From: webhook-mailer at python.org (stratakis) Date: Wed, 08 Jul 2020 20:39:49 -0000 Subject: [Python-checkins] bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240) Message-ID: https://github.com/python/cpython/commit/61fc23ca106bc82955b0e59d1ab42285b94899e2 commit: 61fc23ca106bc82955b0e59d1ab42285b94899e2 branch: master author: stratakis committer: GitHub date: 2020-07-08T22:39:41+02:00 summary: 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. files: A Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst M Objects/bytearrayobject.c 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 0000000000000..844fb804c0c8d --- /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 83c79b200a0a1..7035061933098 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 webhook-mailer at python.org Wed Jul 8 17:00:44 2020 From: webhook-mailer at python.org (Mark Sapiro) Date: Wed, 08 Jul 2020 21:00:44 -0000 Subject: [Python-checkins] bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542) Message-ID: https://github.com/python/cpython/commit/4fa61a7732923f92de0f7830c12da48c4cec937f commit: 4fa61a7732923f92de0f7830c12da48c4cec937f branch: master author: Mark Sapiro committer: GitHub date: 2020-07-08T14:00:35-07:00 summary: bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542) files: A Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst M Lib/email/contentmanager.py M Lib/test/test_email/test_contentmanager.py diff --git a/Lib/email/contentmanager.py b/Lib/email/contentmanager.py index 2b4b8757f46f6..b91fb0e5bca7a 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 64dca2d017e62..f4f6bb715acdc 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 0000000000000..482ae624da079 --- /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 webhook-mailer at python.org Wed Jul 8 17:18:46 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 08 Jul 2020 21:18:46 -0000 Subject: [Python-checkins] bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542) Message-ID: https://github.com/python/cpython/commit/c1c50345933efca42169f03d79ff4fe3d9c06bdc commit: c1c50345933efca42169f03d79ff4fe3d9c06bdc branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-08T14:18:38-07:00 summary: bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542) (cherry picked from commit 4fa61a7732923f92de0f7830c12da48c4cec937f) Co-authored-by: Mark Sapiro files: A Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst M Lib/email/contentmanager.py M Lib/test/test_email/test_contentmanager.py diff --git a/Lib/email/contentmanager.py b/Lib/email/contentmanager.py index 2b4b8757f46f6..b91fb0e5bca7a 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 64dca2d017e62..f4f6bb715acdc 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 0000000000000..482ae624da079 --- /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 webhook-mailer at python.org Thu Jul 9 05:38:50 2020 From: webhook-mailer at python.org (Julien Palard) Date: Thu, 09 Jul 2020 09:38:50 -0000 Subject: [Python-checkins] Doc: Builtins functions: faster jump table (GH-21376) Message-ID: https://github.com/python/cpython/commit/a908bc4dd81f5881280f54b17aae1e7bc450efc9 commit: a908bc4dd81f5881280f54b17aae1e7bc450efc9 branch: master author: Julien Palard committer: GitHub date: 2020-07-09T11:38:41+02:00 summary: Doc: Builtins functions: faster jump table (GH-21376) files: M Doc/library/functions.rst diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index f4110c3585a0b..3c36b59befab9 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 webhook-mailer at python.org Thu Jul 9 06:00:30 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Thu, 09 Jul 2020 10:00:30 -0000 Subject: [Python-checkins] bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407) Message-ID: https://github.com/python/cpython/commit/ee96f32ca24779656d3c8736d26671fc3689f0a3 commit: ee96f32ca24779656d3c8736d26671fc3689f0a3 branch: master author: Zackery Spytz committer: GitHub date: 2020-07-09T03:00:21-07:00 summary: bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407) files: A Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst M Modules/_ssl.c 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 0000000000000..65f3189c83ec6 --- /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 58064178a1a34..a8c339d9f3334 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 webhook-mailer at python.org Thu Jul 9 06:15:41 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 09 Jul 2020 10:15:41 -0000 Subject: [Python-checkins] bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407) Message-ID: https://github.com/python/cpython/commit/54babbe976531d4d1c21ea415f71e7c6846e15bc commit: 54babbe976531d4d1c21ea415f71e7c6846e15bc branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-09T03:15:36-07:00 summary: bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407) (cherry picked from commit ee96f32ca24779656d3c8736d26671fc3689f0a3) Co-authored-by: Zackery Spytz files: A Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst M Modules/_ssl.c 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 0000000000000..65f3189c83ec6 --- /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 8ee2c170368fd..1944393e54890 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4548,11 +4548,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 webhook-mailer at python.org Thu Jul 9 08:13:52 2020 From: webhook-mailer at python.org (marload) Date: Thu, 09 Jul 2020 12:13:52 -0000 Subject: [Python-checkins] bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413) Message-ID: https://github.com/python/cpython/commit/61bb24a270d15106decb1c7983bf4c2831671a75 commit: 61bb24a270d15106decb1c7983bf4c2831671a75 branch: master author: marload committer: GitHub date: 2020-07-09T05:13:47-07:00 summary: bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413) Automerge-Triggered-By: @ericvsmith files: M Doc/library/dataclasses.rst diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index fe63d20671dd7..6e74af062d9e7 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 webhook-mailer at python.org Thu Jul 9 08:21:16 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 09 Jul 2020 12:21:16 -0000 Subject: [Python-checkins] bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413) Message-ID: https://github.com/python/cpython/commit/1e66f7e102b64da5a6d69b135cf7d82708aca231 commit: 1e66f7e102b64da5a6d69b135cf7d82708aca231 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-09T05:21:11-07:00 summary: bpo-41199: Docstring convention not followed for dataclasses documentation page (GH-21413) Automerge-Triggered-By: @ericvsmith (cherry picked from commit 61bb24a270d15106decb1c7983bf4c2831671a75) Co-authored-by: marload files: M Doc/library/dataclasses.rst diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 10edcac7e8a9b..a7fbaaa106707 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 webhook-mailer at python.org Thu Jul 9 09:25:18 2020 From: webhook-mailer at python.org (Hai Shi) Date: Thu, 09 Jul 2020 13:25:18 -0000 Subject: [Python-checkins] bpo-40275: Use new test.support helper submodules in tests (GH-21412) Message-ID: https://github.com/python/cpython/commit/96a6a6d42be272a27562d98549bbffc0d1854669 commit: 96a6a6d42be272a27562d98549bbffc0d1854669 branch: master author: Hai Shi committer: GitHub date: 2020-07-09T15:25:10+02:00 summary: bpo-40275: Use new test.support helper submodules in tests (GH-21412) files: M Lib/test/test_cmd_line_script.py M Lib/test/test_codeop.py M Lib/test/test_contextlib.py M Lib/test/test_dbm_ndbm.py M Lib/test/test_getargs2.py M Lib/test/test_gettext.py M Lib/test/test_glob.py M Lib/test/test_import/__init__.py M Lib/test/test_locale.py M Lib/test/test_mailbox.py M Lib/test/test_multiprocessing_main_handling.py M Lib/test/test_osx_env.py M Lib/test/test_pkgutil.py M Lib/test/test_plistlib.py M Lib/test/test_ttk_guionly.py M Lib/test/test_turtle.py M Lib/test/test_xxtestfuzz.py M Lib/test/test_zipimport.py diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 15fca7b8a5191..6c8c28f40b564 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 45cb1a7b74e90..6e821df6b0e70 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 024f912647295..50943c1a17e9c 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 7ac75c5fea1b5..278fca2cf2315 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 0dec5b1874e6d..d39ea56ae9e9c 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 baf300b057249..df9eae39eac3e 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 f8158523a0469..96db31b26814b 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 a04cf65945e93..f4a83d2e7a13a 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 2863d200e25c2..bd08c4f3007fc 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 6f891d413cd8f..346c9f1c559cd 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 be1ff10e03a55..510d8d3a7597e 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 8a3bc5a46e547..80198edcb80b7 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 b162f9949ff69..bf9722a229611 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 e82a53c533df0..e5038d2e7f10a 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 462665db5f3e7..abb26433652f1 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 38448c791be66..39b3d96fb43bb 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 15924aaeff385..3304c6e703a17 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 560286071c690..8df7489f754d3 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 webhook-mailer at python.org Thu Jul 9 09:27:32 2020 From: webhook-mailer at python.org (Chris Jerdonek) Date: Thu, 09 Jul 2020 13:27:32 -0000 Subject: [Python-checkins] bpo-29590: fix stack trace for gen.throw() with yield from (#19896) Message-ID: https://github.com/python/cpython/commit/8b33961e4bc4020d8b2d5b949ad9d5c669300e89 commit: 8b33961e4bc4020d8b2d5b949ad9d5c669300e89 branch: master author: Chris Jerdonek committer: GitHub date: 2020-07-09T14:27:23+01:00 summary: 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. files: A Misc/NEWS.d/next/Core and Builtins/2020-05-03-22-26-00.bpo-29590.aRz3l7.rst M Lib/test/test_generators.py M Objects/genobject.c diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index bf482213c178a..3bf152280868e 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 0000000000000..2570c4f2c7c0f --- /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 6a68c9484a6ae..a379fa6088e16 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 webhook-mailer at python.org Thu Jul 9 13:39:06 2020 From: webhook-mailer at python.org (Tony Solomonik) Date: Thu, 09 Jul 2020 17:39:06 -0000 Subject: [Python-checkins] bpo-41247: asyncio.set_running_loop() cache running loop holder (#21406) Message-ID: https://github.com/python/cpython/commit/0b6169e391ce6468aad711f08ffb829362293ad5 commit: 0b6169e391ce6468aad711f08ffb829362293ad5 branch: 3.8 author: Tony Solomonik committer: GitHub date: 2020-07-09T10:38:46-07:00 summary: bpo-41247: asyncio.set_running_loop() cache running loop holder (#21406) 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. files: A Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst M Modules/_asynciomodule.c 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 0000000000000..08699b6e4a1f0 --- /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 8e1cd4f52a540..4ed2af5598029 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -289,9 +289,6 @@ get_running_loop(PyObject **loop) static int set_running_loop(PyObject *loop) { - cached_running_holder = NULL; - cached_running_holder_tsid = 0; - PyObject *ts_dict = PyThreadState_GetDict(); // borrowed if (ts_dict == NULL) { PyErr_SetString( @@ -312,6 +309,12 @@ set_running_loop(PyObject *loop) } Py_DECREF(rl); + cached_running_holder = (PyObject *)rl; + + /* safe to assume state is not NULL as the call to PyThreadState_GetDict() + above already checks if state is NULL */ + cached_running_holder_tsid = PyThreadState_Get()->id; + return 0; } From webhook-mailer at python.org Thu Jul 9 13:52:48 2020 From: webhook-mailer at python.org (Steve Dower) Date: Thu, 09 Jul 2020 17:52:48 -0000 Subject: [Python-checkins] bpo-41172: Fix check for compiler in test suite (GH-21400) Message-ID: https://github.com/python/cpython/commit/af56c4fc76ac39ce76d649d7bebf7f78c1add4fa commit: af56c4fc76ac39ce76d649d7bebf7f78c1add4fa branch: master author: Steve Dower committer: GitHub date: 2020-07-09T18:52:43+01:00 summary: bpo-41172: Fix check for compiler in test suite (GH-21400) files: M Lib/test/support/__init__.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f8f60fb6c27b9..b21978a61cd2f 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 webhook-mailer at python.org Thu Jul 9 15:18:42 2020 From: webhook-mailer at python.org (E-Paine) Date: Thu, 09 Jul 2020 19:18:42 -0000 Subject: [Python-checkins] Remove trailing >>> in enum docs (GH-21358) Message-ID: https://github.com/python/cpython/commit/1ee5dc15868ea0ad36800899e19a6a87170ada76 commit: 1ee5dc15868ea0ad36800899e19a6a87170ada76 branch: master author: E-Paine <63801254+E-Paine at users.noreply.github.com> committer: GitHub date: 2020-07-09T12:18:34-07:00 summary: Remove trailing >>> in enum docs (GH-21358) The >>> as the last line serve no purpose and are not colored correctly by Sphinx. files: M Doc/library/enum.rst M Misc/ACKS diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 4b4f5eb1944cc..b327a0ad15f96 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 641ef0cace00e..b585769608f4e 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 webhook-mailer at python.org Thu Jul 9 18:08:42 2020 From: webhook-mailer at python.org (Terry Jan Reedy) Date: Thu, 09 Jul 2020 22:08:42 -0000 Subject: [Python-checkins] bpo-37765: Add keywords to IDLE tab completions (GH-15138) Message-ID: https://github.com/python/cpython/commit/bce2eb4646021910aa4074d86f44a09b32d0b2b2 commit: bce2eb4646021910aa4074d86f44a09b32d0b2b2 branch: master author: Terry Jan Reedy committer: GitHub date: 2020-07-09T18:08:33-04:00 summary: 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 files: A Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst M Doc/library/idle.rst M Lib/idlelib/NEWS.txt M Lib/idlelib/autocomplete.py M Lib/idlelib/help.html M Lib/idlelib/idle_test/test_autocomplete.py diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index b1192e7bb4655..75b6fa3861b23 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 7ae29af0b30ce..1c5c03da86efc 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 c623d45a15342..e1e9e17311eda 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 424c6b50f339e..81ce5100bb8ad 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 1841495fcf1a0..9c113bd893f13 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 0000000000000..f8b53ca482a21 --- /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 webhook-mailer at python.org Thu Jul 9 18:54:49 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 09 Jul 2020 22:54:49 -0000 Subject: [Python-checkins] bpo-37765: Add keywords to IDLE tab completions (GH-15138) Message-ID: https://github.com/python/cpython/commit/3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8 commit: 3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-09T15:54:44-07:00 summary: 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 (cherry picked from commit bce2eb4646021910aa4074d86f44a09b32d0b2b2) Co-authored-by: Terry Jan Reedy files: A Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst M Doc/library/idle.rst M Lib/idlelib/NEWS.txt M Lib/idlelib/autocomplete.py M Lib/idlelib/help.html M Lib/idlelib/idle_test/test_autocomplete.py diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index b1192e7bb4655..75b6fa3861b23 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 59b34b1519fdf..b43c6d3a64cfd 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-07-03? ====================================== +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 c623d45a15342..e1e9e17311eda 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 424c6b50f339e..81ce5100bb8ad 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 1841495fcf1a0..9c113bd893f13 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 0000000000000..f8b53ca482a21 --- /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 webhook-mailer at python.org Thu Jul 9 20:36:43 2020 From: webhook-mailer at python.org (Joannah Nanjekye) Date: Fri, 10 Jul 2020 00:36:43 -0000 Subject: [Python-checkins] bpo-23802: patch: __deepcopy__ memo dict argument usage (GH-21326) Message-ID: https://github.com/python/cpython/commit/3cbade7d309ab1ea97ec286d19d506df30bd1ab7 commit: 3cbade7d309ab1ea97ec286d19d506df30bd1ab7 branch: master author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> committer: GitHub date: 2020-07-09T21:36:35-03:00 summary: bpo-23802: patch: __deepcopy__ memo dict argument usage (GH-21326) * Clarify __deepcopy__ memo dict argument usage * Add full stop files: M Doc/library/copy.rst diff --git a/Doc/library/copy.rst b/Doc/library/copy.rst index a8e8bfb1e832b..176e01db6f9fa 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 webhook-mailer at python.org Fri Jul 10 03:12:12 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 10 Jul 2020 07:12:12 -0000 Subject: [Python-checkins] bpo-41263: Convert code.__new__ to Argument Clinic (GH-21426) Message-ID: https://github.com/python/cpython/commit/0f9aa47babbfbecc5ef500fb0feae755230ec3c0 commit: 0f9aa47babbfbecc5ef500fb0feae755230ec3c0 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-10T10:12:04+03:00 summary: bpo-41263: Convert code.__new__ to Argument Clinic (GH-21426) files: M Objects/clinic/codeobject.c.h M Objects/codeobject.c diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index aef505ffc3f61..c7395375e6469 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 49011db1014e7..4ca22fc5029b8 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] + at 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 webhook-mailer at python.org Fri Jul 10 04:17:29 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 10 Jul 2020 08:17:29 -0000 Subject: [Python-checkins] bpo-36346: Do not use legacy Unicode C API in ctypes. (#21429) Message-ID: https://github.com/python/cpython/commit/d878349bac6c154fbfeffe7d4b38e2ddb833f135 commit: d878349bac6c154fbfeffe7d4b38e2ddb833f135 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-10T11:17:21+03:00 summary: bpo-36346: Do not use legacy Unicode C API in ctypes. (#21429) files: M Modules/_ctypes/_ctypes.c M Modules/_ctypes/callproc.c M Modules/_ctypes/cfield.c diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index ceae67ebb1612..0ac48b92bff8b 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 6030cc3d43670..261ae5ceb9e48 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 3a9b7119201cf..3bd9ae438db44 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 webhook-mailer at python.org Fri Jul 10 06:16:18 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 10 Jul 2020 10:16:18 -0000 Subject: [Python-checkins] bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240) Message-ID: https://github.com/python/cpython/commit/33672c019179be279ae979f709c974593fbbbe84 commit: 33672c019179be279ae979f709c974593fbbbe84 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-10T03:15:59-07:00 summary: 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. (cherry picked from commit 61fc23ca106bc82955b0e59d1ab42285b94899e2) Co-authored-by: stratakis files: A Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst M Objects/bytearrayobject.c 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 0000000000000..844fb804c0c8d --- /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 590b806056186..d4d02336b6cf0 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -276,7 +276,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 webhook-mailer at python.org Fri Jul 10 06:40:55 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 10 Jul 2020 10:40:55 -0000 Subject: [Python-checkins] bpo-39573: Use the Py_TYPE() macro (GH-21433) Message-ID: https://github.com/python/cpython/commit/8182cc2e68a3c6ea5d5342fed3f1c76b0521fbc1 commit: 8182cc2e68a3c6ea5d5342fed3f1c76b0521fbc1 branch: master author: Victor Stinner committer: GitHub date: 2020-07-10T12:40:38+02:00 summary: bpo-39573: Use the Py_TYPE() macro (GH-21433) Replace obj->ob_type with Py_TYPE(obj). files: M Modules/_elementtree.c M Objects/abstract.c M Objects/genericaliasobject.c M Objects/unicodeobject.c M PC/_msi.c M PC/winreg.c M Tools/scripts/combinerefs.py diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 2c92a8aedb5a8..85fdfa7e5ed42 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 3494f33ce380c..7bd72c9b5dcc2 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 4d511a239063c..87bd1ae5c1430 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 809ed85895f86..648dd15ca09f5 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 f725c816206e7..504899d0757b7 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 7c3b2f4be85c9..b2725b857d0c2 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 49ccca73909fc..848bae5658ca3 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 webhook-mailer at python.org Fri Jul 10 11:43:36 2020 From: webhook-mailer at python.org (marload) Date: Fri, 10 Jul 2020 15:43:36 -0000 Subject: [Python-checkins] Fix typo in docs: 'created by th' -> 'created by the' (GH-21384) Message-ID: https://github.com/python/cpython/commit/6fc732a2116e2c42b0431bb7e2a21719351af755 commit: 6fc732a2116e2c42b0431bb7e2a21719351af755 branch: master author: marload committer: GitHub date: 2020-07-10T21:13:31+05:30 summary: Fix typo in docs: 'created by th' -> 'created by the' (GH-21384) files: M Doc/library/asyncio-protocol.rst diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst index 3079716f03ecc..9dbd3ab46a3f6 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 webhook-mailer at python.org Fri Jul 10 11:51:36 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 10 Jul 2020 15:51:36 -0000 Subject: [Python-checkins] Fix typo in docs: 'created by th' -> 'created by the' (GH-21384) Message-ID: https://github.com/python/cpython/commit/a1d208435c4a1da5c8df829c35751855a87ef6be commit: a1d208435c4a1da5c8df829c35751855a87ef6be branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-10T08:51:31-07:00 summary: Fix typo in docs: 'created by th' -> 'created by the' (GH-21384) (cherry picked from commit 6fc732a2116e2c42b0431bb7e2a21719351af755) Co-authored-by: marload files: M Doc/library/asyncio-protocol.rst diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst index ffac9018127c6..816ddcd03b008 100644 --- a/Doc/library/asyncio-protocol.rst +++ b/Doc/library/asyncio-protocol.rst @@ -996,7 +996,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 webhook-mailer at python.org Fri Jul 10 13:43:46 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Fri, 10 Jul 2020 17:43:46 -0000 Subject: [Python-checkins] bpo-20179: Convert the _overlapped module to the Argument Clinic (GH-14275) Message-ID: https://github.com/python/cpython/commit/9650fe0197779b4dfded94be111e39c5810f098f commit: 9650fe0197779b4dfded94be111e39c5810f098f branch: master author: Zackery Spytz committer: GitHub date: 2020-07-10T20:43:37+03:00 summary: bpo-20179: Convert the _overlapped module to the Argument Clinic (GH-14275) files: A Modules/clinic/overlapped.c.h M Modules/overlapped.c diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h new file mode 100644 index 0000000000000..efecd9028b776 --- /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 eed8fbf039300..9c4e2da9dfbd3 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] + at 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 webhook-mailer at python.org Fri Jul 10 16:26:14 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 10 Jul 2020 20:26:14 -0000 Subject: [Python-checkins] bpo-36346: Make using the legacy Unicode C API optional (GH-21437) Message-ID: https://github.com/python/cpython/commit/4c8f09d7cef8c7aa07d5b5232b5b64f63819a743 commit: 4c8f09d7cef8c7aa07d5b5232b5b64f63819a743 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-10T23:26:06+03:00 summary: 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. files: M Include/cpython/unicodeobject.h M Lib/test/support/__init__.py M Lib/test/test_csv.py M Lib/test/test_decimal.py M Lib/test/test_getargs2.py M Lib/test/test_unicode.py M Modules/_io/fileio.c M Modules/_testcapimodule.c M Modules/_winapi.c M Modules/clinic/_winapi.c.h M Modules/overlapped.c M Modules/posixmodule.c M Objects/unicodeobject.c M PC/clinic/winreg.c.h M PC/winreg.c M Python/dynload_win.c M Python/fileutils.c diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index 49ad32d5d199e..615b4a971d5f4 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 b21978a61cd2f..1ce3a78fdbbe5 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 d421be075ca27..a92870c24a1b4 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 716e6eb7fb127..9dbae449fb61d 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 d39ea56ae9e9c..0956019791305 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 afc95555db026..d485bc7ede2b9 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 7c8ba37c4fe94..b9856b3b63165 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 1e4c31fefb206..fca94a83a5d04 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 e1672c478522e..ddb11aa5a8204 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 6022dfe0db4b2..a9630d55998d3 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 9c4e2da9dfbd3..4f0ba85d7983e 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 a411f28987ee7..efd99544f5a99 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 648dd15ca09f5..2e1045ad3a7b6 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 3301bed9713aa..183301f061866 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 b2725b857d0c2..a24d784c773c0 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 8431c5b3b2f30..5702ab2cd71ba 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 2c86828ba989a..50ef3c174acc8 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 webhook-mailer at python.org Fri Jul 10 21:55:01 2020 From: webhook-mailer at python.org (Nima Dini) Date: Sat, 11 Jul 2020 01:55:01 -0000 Subject: [Python-checkins] bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372) Message-ID: https://github.com/python/cpython/commit/344dce312a0cf86d5a5772d54843cc179acaf6e3 commit: 344dce312a0cf86d5a5772d54843cc179acaf6e3 branch: master author: Nima Dini committer: GitHub date: 2020-07-10T21:54:53-04:00 summary: bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372) files: M Doc/library/calendar.rst diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 56b75ef0f850a..c3c04db853ed2 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 webhook-mailer at python.org Fri Jul 10 22:09:11 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 11 Jul 2020 02:09:11 -0000 Subject: [Python-checkins] bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372) Message-ID: https://github.com/python/cpython/commit/c77f71f9819022fa3adeb2f710e564a392ff24c6 commit: c77f71f9819022fa3adeb2f710e564a392ff24c6 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-10T19:09:07-07:00 summary: bpo-41228: Fix /a/are/ in monthcalendar() descripton (GH-21372) (cherry picked from commit 344dce312a0cf86d5a5772d54843cc179acaf6e3) Co-authored-by: Nima Dini files: M Doc/library/calendar.rst diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 56b75ef0f850a..c3c04db853ed2 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 webhook-mailer at python.org Sat Jul 11 19:18:57 2020 From: webhook-mailer at python.org (Sergey Golitsynskiy) Date: Sat, 11 Jul 2020 23:18:57 -0000 Subject: [Python-checkins] Fix error in docstrings in bisect module (GH-21422) Message-ID: https://github.com/python/cpython/commit/6a1e9c26736259413b060b01d1cb52fcf82c0385 commit: 6a1e9c26736259413b060b01d1cb52fcf82c0385 branch: master author: Sergey Golitsynskiy committer: GitHub date: 2020-07-11T20:18:31-03:00 summary: 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)`. files: M Lib/bisect.py diff --git a/Lib/bisect.py b/Lib/bisect.py index 8f3f6a3fe35ff..8336a4ed9ca0f 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 webhook-mailer at python.org Sun Jul 12 12:01:12 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Sun, 12 Jul 2020 16:01:12 -0000 Subject: [Python-checkins] bpo-20181: Convert the readline module to the Argument Clinic (#14326) Message-ID: https://github.com/python/cpython/commit/b7047e59a40649d81061acf0044e74cfd426f064 commit: b7047e59a40649d81061acf0044e74cfd426f064 branch: master author: Zackery Spytz committer: GitHub date: 2020-07-12T19:01:03+03:00 summary: bpo-20181: Convert the readline module to the Argument Clinic (#14326) files: A Modules/clinic/readline.c.h M Modules/readline.c diff --git a/Modules/clinic/readline.c.h b/Modules/clinic/readline.c.h new file mode 100644 index 0000000000000..80207caf07110 --- /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 12d6cc78e38a7..bbab0f882e3f1 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 webhook-mailer at python.org Sun Jul 12 12:11:19 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Sun, 12 Jul 2020 16:11:19 -0000 Subject: [Python-checkins] bpo-20175: Convert Modules/_multiprocessing to the Argument Clinic (GH-14245) Message-ID: https://github.com/python/cpython/commit/545b54d2abbc7970aa66b179a18ff2ac4440a8f9 commit: 545b54d2abbc7970aa66b179a18ff2ac4440a8f9 branch: master author: Zackery Spytz committer: GitHub date: 2020-07-12T19:11:11+03:00 summary: bpo-20175: Convert Modules/_multiprocessing to the Argument Clinic (GH-14245) files: A Modules/_multiprocessing/clinic/multiprocessing.c.h A Modules/_multiprocessing/clinic/semaphore.c.h M Modules/_multiprocessing/multiprocessing.c M Modules/_multiprocessing/multiprocessing.h M Modules/_multiprocessing/semaphore.c diff --git a/Modules/_multiprocessing/clinic/multiprocessing.c.h b/Modules/_multiprocessing/clinic/multiprocessing.c.h new file mode 100644 index 0000000000000..7096442bd0b52 --- /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 0000000000000..e1b9309e9f280 --- /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 806e638340f7a..77e6c854068c0 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 fe78135d4669e..277963bc1575b 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 ee490256d2a27..8732750e11be8 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] + at 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] + at 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 webhook-mailer at python.org Sun Jul 12 12:15:24 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 12 Jul 2020 16:15:24 -0000 Subject: [Python-checkins] bpo-41146: Convert signal.default_int_handler() to Argument Clinic (GH-21197) Message-ID: https://github.com/python/cpython/commit/b0689ae7f9d904bc2126994aedbc552f03479e40 commit: b0689ae7f9d904bc2126994aedbc552f03479e40 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-12T19:15:20+03:00 summary: bpo-41146: Convert signal.default_int_handler() to Argument Clinic (GH-21197) files: M Modules/clinic/signalmodule.c.h M Modules/signalmodule.c diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 33a278e488f94..4713bab7486ac 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 ef3536a210b04..7bc1b535e6e2c 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 webhook-mailer at python.org Mon Jul 13 08:49:54 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 13 Jul 2020 12:49:54 -0000 Subject: [Python-checkins] bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) Message-ID: https://github.com/python/cpython/commit/4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8 commit: 4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-07-13T05:49:26-07:00 summary: bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) Automerge-Triggered-By: @tiran files: A Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst M Lib/test/pickletester.py M Modules/_pickle.c diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index afbc2b3bf0a79..fb972a3ba5e9b 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 0000000000000..3c3adbabf16ff --- /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 25e888db19c23..611da7afdf80e 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 webhook-mailer at python.org Mon Jul 13 09:05:52 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 13 Jul 2020 13:05:52 -0000 Subject: [Python-checkins] bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) Message-ID: https://github.com/python/cpython/commit/f56c75ed53dcad4d59dff4377ae463d6b96acd3e commit: f56c75ed53dcad4d59dff4377ae463d6b96acd3e branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-13T06:05:44-07:00 summary: bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) Automerge-Triggered-By: @tiran (cherry picked from commit 4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst M Lib/test/pickletester.py M Modules/_pickle.c diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 9401043d78d18..ff7bbb0c8a9bf 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -1170,6 +1170,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 0000000000000..3c3adbabf16ff --- /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 55affb2c7c479..42ce62fc7cdf4 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 webhook-mailer at python.org Mon Jul 13 14:17:10 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 13 Jul 2020 18:17:10 -0000 Subject: [Python-checkins] bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) (GH-21461) Message-ID: https://github.com/python/cpython/commit/620e276a8c1d53332fbf08d369be87f862b6949d commit: 620e276a8c1d53332fbf08d369be87f862b6949d branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-13T14:17:01-04:00 summary: bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) (GH-21461) Automerge-Triggered-By: @tiran (cherry picked from commit 4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst M Lib/test/pickletester.py M Modules/_pickle.c diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 1d88fcb859af8..c576d73349af8 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -998,6 +998,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 0000000000000..3c3adbabf16ff --- /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 ef83da02e2e41..329631d7e3b98 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -5515,23 +5515,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); @@ -5541,6 +5548,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 webhook-mailer at python.org Mon Jul 13 14:18:11 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 13 Jul 2020 18:18:11 -0000 Subject: [Python-checkins] bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) (GH-21462) Message-ID: https://github.com/python/cpython/commit/6463cf07fef7a923a743fcaf312150c45fd81b64 commit: 6463cf07fef7a923a743fcaf312150c45fd81b64 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-13T14:18:04-04:00 summary: bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458) (GH-21462) Automerge-Triggered-By: @tiran (cherry picked from commit 4f309abf55f0e6f8950ac13d6ec83c22b8d47bf8) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst M Lib/test/pickletester.py M Modules/_pickle.c diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 764057a866411..c2648a3c44115 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -994,6 +994,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 0000000000000..3c3adbabf16ff --- /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 41b8fa7b3c290..bcf98e2f52648 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -5423,23 +5423,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); @@ -5449,6 +5456,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 webhook-mailer at python.org Mon Jul 13 17:31:11 2020 From: webhook-mailer at python.org (Joannah Nanjekye) Date: Mon, 13 Jul 2020 21:31:11 -0000 Subject: [Python-checkins] bpo-32192: A basic lazy importer example (GH-21330) Message-ID: https://github.com/python/cpython/commit/8dd32fe645c9503cf8e6be4b1580c3a59b450168 commit: 8dd32fe645c9503cf8e6be4b1580c3a59b450168 branch: master author: Joannah Nanjekye <33177550+nanjekyejoannah at users.noreply.github.com> committer: GitHub date: 2020-07-13T18:31:02-03:00 summary: bpo-32192: A basic lazy importer example (GH-21330) * Add example on lazy imports * Use four spaces for indentation * change to console files: M Doc/library/importlib.rst diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 99bfeacbbc740..f7286d2ade8bd 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 webhook-mailer at python.org Mon Jul 13 21:26:28 2020 From: webhook-mailer at python.org (Paul McMillan) Date: Tue, 14 Jul 2020 01:26:28 -0000 Subject: [Python-checkins] Fix repeated words in Classes tutorial (GH-21455) Message-ID: https://github.com/python/cpython/commit/4f28f75deefc6e8f65694f96f1a40b0a26fc385d commit: 4f28f75deefc6e8f65694f96f1a40b0a26fc385d branch: master author: Paul McMillan committer: GitHub date: 2020-07-13T18:26:23-07:00 summary: Fix repeated words in Classes tutorial (GH-21455) The phrase "At any time during execution," was repeated twice. Automerge-Triggered-By: @Mariatta files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 250d2a9ddb416..685552f99f440 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 webhook-mailer at python.org Mon Jul 13 21:49:48 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 14 Jul 2020 01:49:48 -0000 Subject: [Python-checkins] Fix repeated words in Classes tutorial (GH-21455) Message-ID: https://github.com/python/cpython/commit/b4cd77de05e5bbaa6a4be90f710b787e0790c36f commit: b4cd77de05e5bbaa6a4be90f710b787e0790c36f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-13T18:49:44-07:00 summary: Fix repeated words in Classes tutorial (GH-21455) The phrase "At any time during execution," was repeated twice. Automerge-Triggered-By: @Mariatta (cherry picked from commit 4f28f75deefc6e8f65694f96f1a40b0a26fc385d) Co-authored-by: Paul McMillan files: M Doc/tutorial/classes.rst diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 250d2a9ddb416..685552f99f440 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 webhook-mailer at python.org Tue Jul 14 13:22:52 2020 From: webhook-mailer at python.org (JustAnotherArchivist) Date: Tue, 14 Jul 2020 17:22:52 -0000 Subject: [Python-checkins] bpo-32528: Document the change in inheritance of asyncio.CancelledError (GH-21474) Message-ID: https://github.com/python/cpython/commit/2a5181829af394b82e8e8c917183c709ee72a2b7 commit: 2a5181829af394b82e8e8c917183c709ee72a2b7 branch: master author: JustAnotherArchivist committer: GitHub date: 2020-07-14T10:22:43-07:00 summary: 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 files: M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index b6ed2da36889a..a2fa17811b3fc 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 webhook-mailer at python.org Tue Jul 14 15:41:40 2020 From: webhook-mailer at python.org (Tony Solomonik) Date: Tue, 14 Jul 2020 19:41:40 -0000 Subject: [Python-checkins] bpo-41273: asyncio's proactor read transport's better performance by using recv_into instead of recv (#21442) Message-ID: https://github.com/python/cpython/commit/568fb0ff4aa641329261cdde20795b0aa9278175 commit: 568fb0ff4aa641329261cdde20795b0aa9278175 branch: master author: Tony Solomonik committer: GitHub date: 2020-07-14T12:41:24-07:00 summary: 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. files: A Misc/NEWS.d/next/Library/2020-07-11-00-15-01.bpo-41273.SVrsJh.rst M Lib/asyncio/proactor_events.py M Lib/test/test_asyncio/test_proactor_events.py diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index 8338449aaa0a3..d0b7100f5e056 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 b5d1df93efd65..50ba4c19d425c 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 0000000000000..c08204b9908c6 --- /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 webhook-mailer at python.org Wed Jul 15 05:07:55 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Wed, 15 Jul 2020 09:07:55 -0000 Subject: [Python-checkins] bpo-20183: Convert _locale to the Argument Clinic (GH-14201) Message-ID: https://github.com/python/cpython/commit/bbceef6851895135c80e588a55854c1afab46499 commit: bbceef6851895135c80e588a55854c1afab46499 branch: master author: Zackery Spytz committer: GitHub date: 2020-07-15T12:07:34+03:00 summary: bpo-20183: Convert _locale to the Argument Clinic (GH-14201) files: A Modules/clinic/_localemodule.c.h M Modules/_localemodule.c diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 0819d0e192408..0fe2e08b41f9f 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 0000000000000..5d1db3ece796d --- /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 webhook-mailer at python.org Wed Jul 15 07:51:09 2020 From: webhook-mailer at python.org (Rishi) Date: Wed, 15 Jul 2020 11:51:09 -0000 Subject: [Python-checkins] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) Message-ID: https://github.com/python/cpython/commit/5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4 commit: 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4 branch: master author: Rishi committer: GitHub date: 2020-07-15T13:51:00+02:00 summary: 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). files: A Lib/test/recursion.tar A Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst M Lib/tarfile.py M Lib/test/test_tarfile.py diff --git a/Lib/tarfile.py b/Lib/tarfile.py index e2b60532f693d..6769066cabd6f 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 0000000000000..b823725196498 Binary files /dev/null and b/Lib/test/recursion.tar differ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index d60d35b5be04a..3ddeb97f5268f 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 0000000000000..ad26676f8b856 --- /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 webhook-mailer at python.org Wed Jul 15 08:14:16 2020 From: webhook-mailer at python.org (Felix Yan) Date: Wed, 15 Jul 2020 12:14:16 -0000 Subject: [Python-checkins] bpo-41302: Fix build with system libmpdec (GH-21481) Message-ID: https://github.com/python/cpython/commit/015efdbef7454a522e88cd79ba2b4cd77a5fb2a2 commit: 015efdbef7454a522e88cd79ba2b4cd77a5fb2a2 branch: master author: Felix Yan committer: GitHub date: 2020-07-15T14:14:11+02:00 summary: 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. files: M Modules/_decimal/_decimal.c M Modules/_decimal/libmpdec/mpdecimal.h diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index ff7c647c2220c..fb4e020f1260e 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 35ce429f60124..5a2439690c350 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 webhook-mailer at python.org Wed Jul 15 08:30:58 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Jul 2020 12:30:58 -0000 Subject: [Python-checkins] [3.8] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21483) Message-ID: https://github.com/python/cpython/commit/c55479556db015f48fc8bbca17f64d3e65598559 commit: c55479556db015f48fc8bbca17f64d3e65598559 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-15T05:30:53-07:00 summary: [3.8] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21483) Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907). (cherry picked from commit 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4) Co-authored-by: Rishi Automerge-Triggered-By: @encukou files: A Lib/test/recursion.tar A Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst M Lib/tarfile.py M Lib/test/test_tarfile.py diff --git a/Lib/tarfile.py b/Lib/tarfile.py index d31b9cbb51d65..7a69e1b1aa544 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1241,6 +1241,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 0000000000000..b823725196498 Binary files /dev/null and b/Lib/test/recursion.tar differ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 15324a4e48819..b512168d6ea87 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -397,6 +397,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 0000000000000..ad26676f8b856 --- /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 webhook-mailer at python.org Wed Jul 15 08:35:13 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Jul 2020 12:35:13 -0000 Subject: [Python-checkins] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21484) Message-ID: https://github.com/python/cpython/commit/79c6b602efc9a906c8496f3d5f4d54c54b48fa06 commit: 79c6b602efc9a906c8496f3d5f4d54c54b48fa06 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-15T08:35:08-04:00 summary: bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21484) Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907). (cherry picked from commit 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4) Co-authored-by: Rishi files: A Lib/test/recursion.tar A Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst M Lib/tarfile.py M Lib/test/test_tarfile.py diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 3b596cbf49d27..3be5188c8b0a2 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1233,6 +1233,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 0000000000000..b823725196498 Binary files /dev/null and b/Lib/test/recursion.tar differ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 5e4d75ecfce1a..9133d60e49be1 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -395,6 +395,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 0000000000000..ad26676f8b856 --- /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 webhook-mailer at python.org Wed Jul 15 08:36:40 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Jul 2020 12:36:40 -0000 Subject: [Python-checkins] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (#21485) Message-ID: https://github.com/python/cpython/commit/47a2955589bdb1a114d271496ff803ad73f954b8 commit: 47a2955589bdb1a114d271496ff803ad73f954b8 branch: 3.6 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-15T08:36:36-04:00 summary: bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (#21485) Avoid infinite loop when reading specially crafted TAR files using the tarfile module (CVE-2019-20907). (cherry picked from commit 5a8d121a1f3ef5ad7c105ee378cc79a3eac0c7d4) Co-authored-by: Rishi files: A Lib/test/recursion.tar A Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst M Lib/tarfile.py M Lib/test/test_tarfile.py diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 62d22150f50da..2ea47978ff6f1 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -1231,6 +1231,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 0000000000000..b823725196498 Binary files /dev/null and b/Lib/test/recursion.tar differ diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 4cd7d5370f58d..573be812eaa17 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -395,6 +395,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 0000000000000..ad26676f8b856 --- /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 webhook-mailer at python.org Wed Jul 15 09:12:15 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Wed, 15 Jul 2020 13:12:15 -0000 Subject: [Python-checkins] Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477) Message-ID: https://github.com/python/cpython/commit/ea62a4bd54421693ed6b24a1bbd18ebed3bdb8f8 commit: ea62a4bd54421693ed6b24a1bbd18ebed3bdb8f8 branch: master author: Benjamin Peterson committer: GitHub date: 2020-07-15T08:12:05-05:00 summary: Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477) files: M Python/thread_pthread.h diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index cf4e854d829cb..e6910b3083a89 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 webhook-mailer at python.org Wed Jul 15 13:07:38 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Wed, 15 Jul 2020 17:07:38 -0000 Subject: [Python-checkins] Fix -Wstring-prototypes warnings in _zoneinfo.c. (GH-21478) Message-ID: https://github.com/python/cpython/commit/0108b2a2401d0ffffe7c07e5ab69a3b0c7593070 commit: 0108b2a2401d0ffffe7c07e5ab69a3b0c7593070 branch: master author: Benjamin Peterson committer: GitHub date: 2020-07-15T12:02:14-05:00 summary: Fix -Wstring-prototypes warnings in _zoneinfo.c. (GH-21478) files: M Modules/_zoneinfo.c diff --git a/Modules/_zoneinfo.c b/Modules/_zoneinfo.c index a2883495fe7fd..319d6c7b7760e 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 webhook-mailer at python.org Wed Jul 15 14:43:09 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Wed, 15 Jul 2020 18:43:09 -0000 Subject: [Python-checkins] bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() call (GH-19686) Message-ID: https://github.com/python/cpython/commit/af4eda46d1538b1da700a86588bdb94b0a4d1ff2 commit: af4eda46d1538b1da700a86588bdb94b0a4d1ff2 branch: master author: Zackery Spytz committer: GitHub date: 2020-07-15T21:43:00+03:00 summary: bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() call (GH-19686) files: M Modules/overlapped.c diff --git a/Modules/overlapped.c b/Modules/overlapped.c index 4f0ba85d7983e..5e7a1bbba7678 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 webhook-mailer at python.org Wed Jul 15 15:05:16 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Jul 2020 19:05:16 -0000 Subject: [Python-checkins] Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477) Message-ID: https://github.com/python/cpython/commit/05abf2a61c4b9b1fd1cc7a152ca17bee1f5c8166 commit: 05abf2a61c4b9b1fd1cc7a152ca17bee1f5c8166 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-15T12:04:59-07:00 summary: Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477) (cherry picked from commit ea62a4bd54421693ed6b24a1bbd18ebed3bdb8f8) Co-authored-by: Benjamin Peterson files: M Python/thread_pthread.h diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 5678b05ced369..78b99a77206c9 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -130,7 +130,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 webhook-mailer at python.org Wed Jul 15 15:25:59 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Jul 2020 19:25:59 -0000 Subject: [Python-checkins] bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() call (GH-19686) Message-ID: https://github.com/python/cpython/commit/f8055fb0f1054fce6a21047da39b92ae32416b80 commit: f8055fb0f1054fce6a21047da39b92ae32416b80 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-15T12:25:49-07:00 summary: bpo-40150: Fix mismatched argument in RegisterWaitForSingleObject() call (GH-19686) (cherry picked from commit af4eda46d1538b1da700a86588bdb94b0a4d1ff2) Co-authored-by: Zackery Spytz files: M Modules/overlapped.c diff --git a/Modules/overlapped.c b/Modules/overlapped.c index b35f708f95bc2..27aac70f06ff0 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -254,7 +254,7 @@ struct PostCallbackData { }; static VOID CALLBACK -PostToQueueCallback(PVOID lpParameter, BOOL TimerOrWaitFired) +PostToQueueCallback(PVOID lpParameter, BOOLEAN TimerOrWaitFired) { struct PostCallbackData *p = (struct PostCallbackData*) lpParameter; @@ -295,8 +295,7 @@ overlapped_RegisterWaitWithQueue(PyObject *self, PyObject *args) *pdata = data; if (!RegisterWaitForSingleObject( - &NewWaitObject, Object, (WAITORTIMERCALLBACK)PostToQueueCallback, - pdata, Milliseconds, + &NewWaitObject, Object, PostToQueueCallback, pdata, Milliseconds, WT_EXECUTEINWAITTHREAD | WT_EXECUTEONLYONCE)) { PyMem_RawFree(pdata); From webhook-mailer at python.org Wed Jul 15 16:22:31 2020 From: webhook-mailer at python.org (Felix Yan) Date: Wed, 15 Jul 2020 20:22:31 -0000 Subject: [Python-checkins] [3.8] bpo-41302: Support system libmpdec 2.5 for Python 3.8 (GH-21488) Message-ID: https://github.com/python/cpython/commit/16eea45fbd3b7c3d1b222b7eb7a5d7ee427f70bd commit: 16eea45fbd3b7c3d1b222b7eb7a5d7ee427f70bd branch: 3.8 author: Felix Yan committer: GitHub date: 2020-07-15T22:22:23+02:00 summary: [3.8] bpo-41302: Support system libmpdec 2.5 for Python 3.8 (GH-21488) Define UNUSED only when mpdecimal.h doesn't define it. This would support building with system libmpdec 2.5 while retaining compatibility with system libmpdec 2.4 or the vendored copy. Tested to build fine with either system libmpdec or the vendored one. files: A Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst M Modules/_decimal/_decimal.c diff --git a/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst b/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst new file mode 100644 index 0000000000000..2f1301740e748 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst @@ -0,0 +1 @@ +Enable building Python 3.8 with libmpdec-2.5.0 to ease maintenance for Linux distributions. Patch by Felix Yan. \ No newline at end of file diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index df7c6e254bcf2..eb1f1a01feeca 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -58,6 +58,13 @@ #define BOUNDS_CHECK(x, MIN, MAX) x = (x < MIN || MAX < x) ? MAX : x +#ifndef UNUSED +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) + #define UNUSED __attribute__((unused)) +#else + #define UNUSED +#endif +#endif /* _Py_DEC_MINALLOC >= MPD_MINALLOC */ #define _Py_DEC_MINALLOC 4 From webhook-mailer at python.org Wed Jul 15 17:56:57 2020 From: webhook-mailer at python.org (Steve Dower) Date: Wed, 15 Jul 2020 21:56:57 -0000 Subject: [Python-checkins] bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) Message-ID: https://github.com/python/cpython/commit/936a66094591dc0e67d4a60c170148bb700ec016 commit: 936a66094591dc0e67d4a60c170148bb700ec016 branch: master author: Steve Dower committer: GitHub date: 2020-07-15T22:56:49+01:00 summary: bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) files: A Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst M Lib/test/test_site.py M PC/getpathp.c diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 9751c64c99e74..ec86c645981b3 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 0000000000000..90423e9a665fc --- /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 0939c5fa9842c..53da3a6d05fae 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 webhook-mailer at python.org Wed Jul 15 18:15:46 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Jul 2020 22:15:46 -0000 Subject: [Python-checkins] bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) Message-ID: https://github.com/python/cpython/commit/3b6a8d2455c6897085f4277737b0f9b9a3847c24 commit: 3b6a8d2455c6897085f4277737b0f9b9a3847c24 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-07-15T15:15:37-07:00 summary: bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) (cherry picked from commit 936a66094591dc0e67d4a60c170148bb700ec016) Co-authored-by: Steve Dower files: A Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst M Lib/test/test_site.py M PC/getpathp.c diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 9a047fd4669d1..01008656bdd75 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -581,12 +581,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) @@ -654,5 +661,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 0000000000000..90423e9a665fc --- /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 cf20b9f613c87..8969fb554ab7c 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -717,7 +717,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 webhook-mailer at python.org Wed Jul 15 18:25:00 2020 From: webhook-mailer at python.org (Steve Dower) Date: Wed, 15 Jul 2020 22:25:00 -0000 Subject: [Python-checkins] bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) (#21499) Message-ID: https://github.com/python/cpython/commit/4bfcffe16e9742c154f54ae96b5b36903500abaa commit: 4bfcffe16e9742c154f54ae96b5b36903500abaa branch: 3.7 author: Steve Dower committer: GitHub date: 2020-07-15T18:24:56-04:00 summary: bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495) (#21499) files: A Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst M Lib/test/test_site.py M PC/getpathp.c diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 6def4e59f4e01..8815c839984e9 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -573,12 +573,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) @@ -646,5 +653,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 0000000000000..90423e9a665fc --- /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 f7022aea1f557..387ac60ac9c1a 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -673,7 +673,7 @@ calculate_init(PyCalculatePath *calculate, static int get_pth_filename(wchar_t *spbuffer, _PyPathConfig *config) { - if (get_dllpath(spbuffer) && + if (!get_dllpath(spbuffer) && !change_ext(spbuffer, spbuffer, L"._pth") && exists(spbuffer)) { From webhook-mailer at python.org Thu Jul 16 02:13:13 2020 From: webhook-mailer at python.org (Berker Peksag) Date: Thu, 16 Jul 2020 06:13:13 -0000 Subject: [Python-checkins] bpo-31844: Remove _markupbase.ParserBase.error() (GH-8562) Message-ID: https://github.com/python/cpython/commit/e34bbfd61f405eef89e8aa50672b0b25022de320 commit: e34bbfd61f405eef89e8aa50672b0b25022de320 branch: master author: Berker Peksag committer: GitHub date: 2020-07-16T09:13:05+03:00 summary: bpo-31844: Remove _markupbase.ParserBase.error() (GH-8562) files: A Misc/NEWS.d/next/Library/2018-07-30-12-48-17.bpo-31844.0_GKsD.rst M Doc/whatsnew/3.9.rst M Lib/_markupbase.py diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index c2db9bc74ccdd..18cc5588bf237 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 2af5f1c23b606..3ad7e279960f7 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 1fb877a753419..00d1f3570b322 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 a5a7c383d785e..0ef1b45594fbf 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 be7d24fe1df25..a70d7d2fe7807 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 fe67de42227b5..0000000000000 --- 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 webhook-mailer at python.org Fri Jul 31 06:51:15 2020 From: webhook-mailer at python.org (Karthikeyan Singaravelan) Date: Fri, 31 Jul 2020 10:51:15 -0000 Subject: [Python-checkins] bpo-40360: Handle PendingDeprecationWarning in test_lib2to3. (GH-21694) Message-ID: https://github.com/python/cpython/commit/cadda52d974937069eeebea1cca4229e2bd400df commit: cadda52d974937069eeebea1cca4229e2bd400df branch: master author: Karthikeyan Singaravelan committer: GitHub date: 2020-07-31T16:20:48+05:30 summary: bpo-40360: Handle PendingDeprecationWarning in test_lib2to3. (GH-21694) files: M Lib/test/test_lib2to3.py diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py index 5eaa5164d490a..159a8387e4e97 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 webhook-mailer at python.org Wed Jul 1 23:41:34 2020 From: webhook-mailer at python.org (=?utf-8?q?R=C3=A9mi?= Lapeyre) Date: Thu, 02 Jul 2020 03:41:34 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-40967: Remove deprecated asyncio.Task.current_task() and asyncio.Task.all_tasks() (GH-20874) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/004e64e8059fe68a72890314673282f2e60d= 5ce1 commit: 004e64e8059fe68a72890314673282f2e60d5ce1 branch: master author: R=C3=A9mi Lapeyre committer: GitHub date: 2020-07-01T20:41:21-07:00 summary: bpo-40967: Remove deprecated asyncio.Task.current_task() and asyncio.Task.all= _tasks() (GH-20874) files: A Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst M Doc/library/asyncio-task.rst M Doc/whatsnew/3.9.rst M Lib/asyncio/tasks.py M Lib/test/test_asyncio/test_tasks.py M Modules/_asynciomodule.c M Modules/clinic/_asynciomodule.c.h diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index 21824ca537f77..bac99b7950444 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -962,31 +962,6 @@ Task Object =20 .. versionadded:: 3.8 =20 - .. classmethod:: all_tasks(loop=3DNone) - - Return a set of all tasks for an event loop. - - By default all tasks for the current event loop are returned. - If *loop* is ``None``, the :func:`get_event_loop` function - is used to get the current loop. - - .. deprecated-removed:: 3.7 3.9 - - Do not call this as a task method. Use the :func:`asyncio.all_tasks` - function instead. - - .. classmethod:: current_task(loop=3DNone) - - Return the currently running task or ``None``. - - If *loop* is ``None``, the :func:`get_event_loop` function - is used to get the current loop. - - .. deprecated-removed:: 3.7 3.9 - - Do not call this as a task method. Use the - :func:`asyncio.current_task` function instead. - =20 .. _asyncio_generator_based_coro: =20 diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 15fca8fa9d4c9..165ce69e59e1d 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -878,6 +878,11 @@ Removed deprecated since 2006, and only returning ``False`` when it's called. (Contributed by Batuhan Taskaya in :issue:`40208`) =20 +* The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` h= ave + have been removed. They were deprecated since Python 3.7 and you can use + :func:`asyncio.current_task` and :func:`asyncio.all_tasks` instead. + (Contributed by R=C3=A9mi Lapeyre in :issue:`40967`) + =20 Porting to Python 3.9 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff --git a/Lib/asyncio/tasks.py b/Lib/asyncio/tasks.py index 21b98b6647bd9..5e0692ef7778a 100644 --- a/Lib/asyncio/tasks.py +++ b/Lib/asyncio/tasks.py @@ -113,34 +113,6 @@ class Task(futures._PyFuture): # Inherit Python Task im= plementation # status is still pending _log_destroy_pending =3D True =20 - @classmethod - def current_task(cls, loop=3DNone): - """Return the currently running task in an event loop or None. - - By default the current task for the current event loop is returned. - - None is returned when called not in the context of a Task. - """ - warnings.warn("Task.current_task() is deprecated since Python 3.7, " - "use asyncio.current_task() instead", - DeprecationWarning, - stacklevel=3D2) - if loop is None: - loop =3D events.get_event_loop() - return current_task(loop) - - @classmethod - def all_tasks(cls, loop=3DNone): - """Return a set of all tasks for an event loop. - - By default all tasks for the current event loop are returned. - """ - warnings.warn("Task.all_tasks() is deprecated since Python 3.7, " - "use asyncio.all_tasks() instead", - DeprecationWarning, - stacklevel=3D2) - return _all_tasks_compat(loop) - def __init__(self, coro, *, loop=3DNone, name=3DNone): super().__init__(loop=3Dloop) if self._source_traceback: diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test= _tasks.py index 3734013fad989..f9db066ce8983 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -1943,32 +1943,6 @@ async def coro(): self.assertEqual(res, 'test') self.assertIsNone(t2.result()) =20 - - def test_current_task_deprecated(self): - Task =3D self.__class__.Task - - with self.assertWarns(DeprecationWarning): - self.assertIsNone(Task.current_task(loop=3Dself.loop)) - - async def coro(loop): - with self.assertWarns(DeprecationWarning): - self.assertIs(Task.current_task(loop=3Dloop), task) - - # See http://bugs.python.org/issue29271 for details: - asyncio.set_event_loop(loop) - try: - with self.assertWarns(DeprecationWarning): - self.assertIs(Task.current_task(None), task) - with self.assertWarns(DeprecationWarning): - self.assertIs(Task.current_task(), task) - finally: - asyncio.set_event_loop(None) - - task =3D self.new_task(self.loop, coro(self.loop)) - self.loop.run_until_complete(task) - with self.assertWarns(DeprecationWarning): - self.assertIsNone(Task.current_task(loop=3Dself.loop)) - def test_current_task(self): self.assertIsNone(asyncio.current_task(loop=3Dself.loop)) =20 @@ -2305,16 +2279,6 @@ def foo(): self.assertIsInstance(exception, Exception) self.assertEqual(exception.args, ("foo", )) =20 - def test_all_tasks_deprecated(self): - Task =3D self.__class__.Task - - async def coro(): - with self.assertWarns(DeprecationWarning): - assert Task.all_tasks(self.loop) =3D=3D {t} - - t =3D self.new_task(self.loop, coro()) - self.loop.run_until_complete(t) - def test_log_destroyed_pending_task(self): Task =3D self.__class__.Task =20 @@ -2337,15 +2301,7 @@ def kill_me(loop): =20 self.assertEqual(asyncio.all_tasks(loop=3Dself.loop), {task}) =20 - # See http://bugs.python.org/issue29271 for details: - asyncio.set_event_loop(self.loop) - try: - with self.assertWarns(DeprecationWarning): - self.assertEqual(Task.all_tasks(), {task}) - with self.assertWarns(DeprecationWarning): - self.assertEqual(Task.all_tasks(None), {task}) - finally: - asyncio.set_event_loop(None) + asyncio.set_event_loop(None) =20 # execute the task so it waits for future self.loop._run_once() @@ -3043,8 +2999,6 @@ def done(self): self.assertEqual(asyncio.all_tasks(loop), set()) self._register_task(task) self.assertEqual(asyncio.all_tasks(loop), set()) - with self.assertWarns(DeprecationWarning): - self.assertEqual(asyncio.Task.all_tasks(loop), {task}) self._unregister_task(task) =20 def test__enter_task(self): diff --git a/Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rs= t b/Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst new file mode 100644 index 0000000000000..4694d991babd7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-15-00-13-57.bpo-40967._dx3OO.rst @@ -0,0 +1,2 @@ +Removed :meth:`asyncio.Task.current_task` and +:meth:`asyncio.Task.all_tasks`. Patch contributed by R=C3=A9mi Lapeyre. diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 0454f9c6824bf..b378742648b2a 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -13,10 +13,8 @@ module _asyncio _Py_IDENTIFIER(__asyncio_running_event_loop__); _Py_IDENTIFIER(_asyncio_future_blocking); _Py_IDENTIFIER(add_done_callback); -_Py_IDENTIFIER(_all_tasks_compat); _Py_IDENTIFIER(call_soon); _Py_IDENTIFIER(cancel); -_Py_IDENTIFIER(current_task); _Py_IDENTIFIER(get_event_loop); _Py_IDENTIFIER(send); _Py_IDENTIFIER(throw); @@ -2182,91 +2180,6 @@ TaskObj_get_fut_waiter(TaskObj *task, void *Py_UNUSED(= ignored)) Py_RETURN_NONE; } =20 -/*[clinic input] - at classmethod -_asyncio.Task.current_task - - loop: object =3D None - -Return the currently running task in an event loop or None. - -By default the current task for the current event loop is returned. - -None is returned when called not in the context of a Task. -[clinic start generated code]*/ - -static PyObject * -_asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop) -/*[clinic end generated code: output=3D99fbe7332c516e03 input=3Dcd14770c5b79= c7eb]*/ -{ - PyObject *ret; - PyObject *current_task_func; - - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "Task.current_task() is deprecated, " \ - "use asyncio.current_task() instead", - 1) < 0) { - return NULL; - } - - current_task_func =3D _PyObject_GetAttrId(asyncio_mod, &PyId_current_tas= k); - if (current_task_func =3D=3D NULL) { - return NULL; - } - - if (loop =3D=3D Py_None) { - loop =3D get_event_loop(); - if (loop =3D=3D NULL) { - Py_DECREF(current_task_func); - return NULL; - } - ret =3D PyObject_CallOneArg(current_task_func, loop); - Py_DECREF(current_task_func); - Py_DECREF(loop); - return ret; - } - else { - ret =3D PyObject_CallOneArg(current_task_func, loop); - Py_DECREF(current_task_func); - return ret; - } -} - -/*[clinic input] - at classmethod -_asyncio.Task.all_tasks - - loop: object =3D None - -Return a set of all tasks for an event loop. - -By default all tasks for the current event loop are returned. -[clinic start generated code]*/ - -static PyObject * -_asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop) -/*[clinic end generated code: output=3D11f9b20749ccca5d input=3D497f80bc9ce7= 26b5]*/ -{ - PyObject *res; - PyObject *all_tasks_func; - - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "Task.all_tasks() is deprecated, " \ - "use asyncio.all_tasks() instead", - 1) < 0) { - return NULL; - } - - all_tasks_func =3D _PyObject_GetAttrId(asyncio_mod, &PyId__all_tasks_com= pat); - if (all_tasks_func =3D=3D NULL) { - return NULL; - } - - res =3D PyObject_CallOneArg(all_tasks_func, loop); - Py_DECREF(all_tasks_func); - return res; -} - /*[clinic input] _asyncio.Task._make_cancelled_error =20 @@ -2587,8 +2500,6 @@ static PyMethodDef TaskType_methods[] =3D { _ASYNCIO_FUTURE_DONE_METHODDEF _ASYNCIO_TASK_SET_RESULT_METHODDEF _ASYNCIO_TASK_SET_EXCEPTION_METHODDEF - _ASYNCIO_TASK_CURRENT_TASK_METHODDEF - _ASYNCIO_TASK_ALL_TASKS_METHODDEF _ASYNCIO_TASK_CANCEL_METHODDEF _ASYNCIO_TASK_GET_STACK_METHODDEF _ASYNCIO_TASK_PRINT_STACK_METHODDEF diff --git a/Modules/clinic/_asynciomodule.c.h b/Modules/clinic/_asynciomodul= e.c.h index d3e59a4bc7822..a071efc1e2be3 100644 --- a/Modules/clinic/_asynciomodule.c.h +++ b/Modules/clinic/_asynciomodule.c.h @@ -355,86 +355,6 @@ _asyncio_Task___init__(PyObject *self, PyObject *args, P= yObject *kwargs) return return_value; } =20 -PyDoc_STRVAR(_asyncio_Task_current_task__doc__, -"current_task($type, /, loop=3DNone)\n" -"--\n" -"\n" -"Return the currently running task in an event loop or None.\n" -"\n" -"By default the current task for the current event loop is returned.\n" -"\n" -"None is returned when called not in the context of a Task."); - -#define _ASYNCIO_TASK_CURRENT_TASK_METHODDEF \ - {"current_task", (PyCFunction)(void(*)(void))_asyncio_Task_current_task,= METH_FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_current_task__doc__}, - -static PyObject * -_asyncio_Task_current_task_impl(PyTypeObject *type, PyObject *loop); - -static PyObject * -_asyncio_Task_current_task(PyTypeObject *type, PyObject *const *args, Py_ssi= ze_t nargs, PyObject *kwnames) -{ - PyObject *return_value =3D NULL; - static const char * const _keywords[] =3D {"loop", NULL}; - static _PyArg_Parser _parser =3D {NULL, _keywords, "current_task", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs =3D nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0= ) - 0; - PyObject *loop =3D Py_None; - - args =3D _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, = 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - loop =3D args[0]; -skip_optional_pos: - return_value =3D _asyncio_Task_current_task_impl(type, loop); - -exit: - return return_value; -} - -PyDoc_STRVAR(_asyncio_Task_all_tasks__doc__, -"all_tasks($type, /, loop=3DNone)\n" -"--\n" -"\n" -"Return a set of all tasks for an event loop.\n" -"\n" -"By default all tasks for the current event loop are returned."); - -#define _ASYNCIO_TASK_ALL_TASKS_METHODDEF \ - {"all_tasks", (PyCFunction)(void(*)(void))_asyncio_Task_all_tasks, METH_= FASTCALL|METH_KEYWORDS|METH_CLASS, _asyncio_Task_all_tasks__doc__}, - -static PyObject * -_asyncio_Task_all_tasks_impl(PyTypeObject *type, PyObject *loop); - -static PyObject * -_asyncio_Task_all_tasks(PyTypeObject *type, PyObject *const *args, Py_ssize_= t nargs, PyObject *kwnames) -{ - PyObject *return_value =3D NULL; - static const char * const _keywords[] =3D {"loop", NULL}; - static _PyArg_Parser _parser =3D {NULL, _keywords, "all_tasks", 0}; - PyObject *argsbuf[1]; - Py_ssize_t noptargs =3D nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0= ) - 0; - PyObject *loop =3D Py_None; - - args =3D _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, = 1, 0, argsbuf); - if (!args) { - goto exit; - } - if (!noptargs) { - goto skip_optional_pos; - } - loop =3D args[0]; -skip_optional_pos: - return_value =3D _asyncio_Task_all_tasks_impl(type, loop); - -exit: - return return_value; -} - PyDoc_STRVAR(_asyncio_Task__make_cancelled_error__doc__, "_make_cancelled_error($self, /)\n" "--\n" @@ -912,4 +832,4 @@ _asyncio__leave_task(PyObject *module, PyObject *const *a= rgs, Py_ssize_t nargs, exit: return return_value; } -/*[clinic end generated code: output=3D0e5c1eb8b692977b input=3Da9049054013a= 1b77]*/ +/*[clinic end generated code: output=3Dd0fc522bcbff9d61 input=3Da9049054013a= 1b77]*/ From webhook-mailer at python.org Mon Jul 13 16:51:22 2020 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Mon, 13 Jul 2020 20:51:22 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Python 3.8.4 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/dfa645a65ec0788d98851130a217e029d1cc= 4e9b commit: dfa645a65ec0788d98851130a217e029d1cc4e9b branch: 3.8 author: =C5=81ukasz Langa committer: =C5=81ukasz Langa date: 2020-07-13T14:11:53+02:00 summary: Python 3.8.4 files: A Misc/NEWS.d/3.8.4.rst D Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP.rst D Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB.rst D Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2.rst D Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y.rst D Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk.rst D Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst D Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst D Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst D Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst D Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst D Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst D Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst D Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst M Include/patchlevel.h M Lib/pydoc_data/topics.py M README.rst diff --git a/Include/patchlevel.h b/Include/patchlevel.h index ab739e915e2f8..41901a585f84d 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -19,11 +19,11 @@ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 8 #define PY_MICRO_VERSION 4 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA -#define PY_RELEASE_SERIAL 1 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL +#define PY_RELEASE_SERIAL 0 =20 /* Version as a string */ -#define PY_VERSION "3.8.4rc1+" +#define PY_VERSION "3.8.4" /*--end constants--*/ =20 /* Version as a single 4-byte hex number, e.g. 0x010502B2 =3D=3D 1.5.2b2. diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index 0320964e5cf5f..d4473aaa6e63c 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Autogenerated by Sphinx on Mon Jun 29 22:24:24 2020 +# Autogenerated by Sphinx on Mon Jul 13 13:47:56 2020 topics =3D {'assert': 'The "assert" statement\n' '**********************\n' '\n' diff --git a/Misc/NEWS.d/3.8.4.rst b/Misc/NEWS.d/3.8.4.rst new file mode 100644 index 0000000000000..4e0c3720bad0b --- /dev/null +++ b/Misc/NEWS.d/3.8.4.rst @@ -0,0 +1,130 @@ +.. bpo: 41162 +.. date: 2020-07-03-20-41-29 +.. nonce: tb8pVj +.. release date: 2020-07-13 +.. section: Security + +Audit hooks are now cleared later during finalization to avoid missing +events. + +.. + +.. bpo: 29778 +.. date: 2020-07-03-17-21-37 +.. nonce: cR_fGS +.. section: Security + +Ensure :file:`python3.dll` is loaded from correct locations when Python is +embedded (CVE-2020-15523). + +.. + +.. bpo: 41247 +.. date: 2020-07-08-22-03-54 +.. nonce: PndYIk +.. section: Core and Builtins + +Always cache the running loop holder when running +``asyncio.set_running_loop``. + +.. + +.. bpo: 41252 +.. date: 2020-07-08-21-55-23 +.. nonce: nBWL-Y +.. section: Core and Builtins + +Fix incorrect refcounting in _ssl.c's ``_servername_callback()``. + +.. + +.. bpo: 41218 +.. date: 2020-07-06-13-35-17 +.. nonce: oKnSr2 +.. section: Core and Builtins + +Python 3.8.3 had a regression where compiling with +ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension +with CO_COROUTINE. Now only list comprehension making use of async/await +will tagged as so. + +.. + +.. bpo: 41175 +.. date: 2020-06-30-20-17-31 +.. nonce: acJoXB +.. section: Core and Builtins + +Guard against a NULL pointer dereference within bytearrayobject triggered by +the ``bytearray() + bytearray()`` operation. + +.. + +.. bpo: 39960 +.. date: 2020-06-23-18-32-41 +.. nonce: Kez3fP +.. section: Core and Builtins + +The "hackcheck" that prevents sneaking around a type's __setattr__() by +calling the superclass method was rewritten to allow C implemented heap +types. + +.. + +.. bpo: 41235 +.. date: 2020-07-07-21-56-26 +.. nonce: H2csMU +.. section: Library + +Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`. + +.. + +.. bpo: 41193 +.. date: 2020-07-02-11-53-45 +.. nonce: 8-Tnql +.. section: Library + +The ``write_history()`` atexit function of the readline completer now +ignores any :exc:`OSError` to ignore error if the filesystem is read-only, +instead of only ignoring :exc:`FileNotFoundError` and +:exc:`PermissionError`. + +.. + +.. bpo: 41043 +.. date: 2020-06-20-00-19-30 +.. nonce: p-Pk-H +.. section: Library + +Fixed the use of :func:`~glob.glob` in the stdlib: literal part of the path +is now always correctly escaped. + +.. + +.. bpo: 39384 +.. date: 2020-05-30-12-44-29 +.. nonce: Iqxy3q +.. section: Library + +Fixed email.contentmanager to allow set_content() to set a null string. + +.. + +.. bpo: 37765 +.. date: 2020-07-07-18-44-30 +.. nonce: umc1o8 +.. section: IDLE + +Add keywords to module name completion list. Rewrite Completions section of +IDLE doc. + +.. + +.. bpo: 41152 +.. date: 2020-06-29-14-51-15 +.. nonce: d6mV0C +.. section: IDLE + +The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is now always +UTF-8. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960= .Kez3fP.rst b/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-3996= 0.Kez3fP.rst deleted file mode 100644 index f69fccfa4db69..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-06-23-18-32-41.bpo-39960.Kez3fP= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -The "hackcheck" that prevents sneaking around a type's __setattr__() by call= ing the -superclass method was rewritten to allow C implemented heap types. 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-4117= 5.acJoXB.rst deleted file mode 100644 index 844fb804c0c8d..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-06-30-20-17-31.bpo-41175.acJoXB= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Guard against a NULL pointer dereference within bytearrayobject triggered by -the ``bytearray() + bytearray()`` operation. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218= .oKnSr2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-4121= 8.oKnSr2.rst deleted file mode 100644 index d98b3433ef05f..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-07-06-13-35-17.bpo-41218.oKnSr2= .rst=09 +++ /dev/null @@ -1,4 +0,0 @@ -Python 3.8.3 had a regression where compiling with -ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension -with CO_COROUTINE. Now only list comprehension making use of async/await -will tagged as so. 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-4125= 2.nBWL-Y.rst deleted file mode 100644 index 65f3189c83ec6..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-21-55-23.bpo-41252.nBWL-Y= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Fix incorrect refcounting in _ssl.c's ``_servername_callback()``. 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-4124= 7.PndYIk.rst deleted file mode 100644 index 08699b6e4a1f0..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-07-08-22-03-54.bpo-41247.PndYIk= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Always cache the running loop holder when running -``asyncio.set_running_loop``. diff --git a/Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst b= /Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst deleted file mode 100644 index 434be10b5309c..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-06-29-14-51-15.bpo-41152.d6mV0C.rst +++ /dev/null @@ -1,2 +0,0 @@ -The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is now always -UTF-8. 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 deleted file mode 100644 index f8b53ca482a21..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-07-07-18-44-30.bpo-37765.umc1o8.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add keywords to module name completion list. Rewrite Completions -section of IDLE doc. diff --git a/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rs= t b/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst deleted file mode 100644 index 482ae624da079..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-05-30-12-44-29.bpo-39384.Iqxy3q.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed email.contentmanager to allow set_content() to set a null string. diff --git a/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rs= t b/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst deleted file mode 100644 index 9c6020eb8d738..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-06-20-00-19-30.bpo-41043.p-Pk-H.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed the use of :func:`~glob.glob` in the stdlib: literal part of the path -is now always correctly escaped. diff --git a/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rs= t b/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst deleted file mode 100644 index 8807d9c21febd..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-07-02-11-53-45.bpo-41193.8-Tnql.rst +++ /dev/null @@ -1,4 +0,0 @@ -The ``write_history()`` atexit function of the readline completer now -ignores any :exc:`OSError` to ignore error if the filesystem is read-only, -instead of only ignoring :exc:`FileNotFoundError` and -:exc:`PermissionError`. diff --git a/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rs= t b/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst deleted file mode 100644 index c55275bb1c622..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-07-07-21-56-26.bpo-41235.H2csMU.rst +++ /dev/null @@ -1 +0,0 @@ -Fix the error handling in :meth:`ssl.SSLContext.load_dh_params`. diff --git a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.r= st b/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst deleted file mode 100644 index 998ffb1ee6667..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-07-03-17-21-37.bpo-29778.cR_fGS.rst +++ /dev/null @@ -1,2 +0,0 @@ -Ensure :file:`python3.dll` is loaded from correct locations when Python is -embedded (CVE-2020-15523). diff --git a/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.r= st b/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst deleted file mode 100644 index f0333ac4a7bb3..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-07-03-20-41-29.bpo-41162.tb8pVj.rst +++ /dev/null @@ -1 +0,0 @@ -Audit hooks are now cleared later during finalization to avoid missing event= s. \ No newline at end of file diff --git a/README.rst b/README.rst index a64d80f4c8e3d..51a053025f65f 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -This is Python version 3.8.4rc1 -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D +This is Python version 3.8.4 +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =20 .. image:: https://travis-ci.org/python/cpython.svg?branch=3D3.8 :alt: CPython build status on Travis CI From webhook-mailer at python.org Mon Jul 20 13:24:34 2020 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Mon, 20 Jul 2020 17:24:34 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Python 3.8.5 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/580fbb018fd0844806119614d752b41fc696= 60f9 commit: 580fbb018fd0844806119614d752b41fc69660f9 branch: 3.8 author: =C5=81ukasz Langa committer: =C5=81ukasz Langa date: 2020-07-20T15:01:32+02:00 summary: Python 3.8.5 Contains security fixes for CVE-2019-20907, CVE-2020-15801, and BPO-39603. files: A Misc/NEWS.d/3.8.5.rst D Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst D Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295.pu8Ezo.rst D Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H.rst D Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst D Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst D Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst D Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst D Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst D Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst M Include/patchlevel.h M Lib/pydoc_data/topics.py M README.rst diff --git a/Include/patchlevel.h b/Include/patchlevel.h index 93bedc221ec6f..25fc2d3a7adca 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -18,12 +18,12 @@ /*--start constants--*/ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 8 -#define PY_MICRO_VERSION 4 +#define PY_MICRO_VERSION 5 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL #define PY_RELEASE_SERIAL 0 =20 /* Version as a string */ -#define PY_VERSION "3.8.4+" +#define PY_VERSION "3.8.5" /*--end constants--*/ =20 /* Version as a single 4-byte hex number, e.g. 0x010502B2 =3D=3D 1.5.2b2. diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index d4473aaa6e63c..68346572bc3ee 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Autogenerated by Sphinx on Mon Jul 13 13:47:56 2020 +# Autogenerated by Sphinx on Mon Jul 20 14:14:54 2020 topics =3D {'assert': 'The "assert" statement\n' '**********************\n' '\n' diff --git a/Misc/NEWS.d/3.8.5.rst b/Misc/NEWS.d/3.8.5.rst new file mode 100644 index 0000000000000..e7ca48385acef --- /dev/null +++ b/Misc/NEWS.d/3.8.5.rst @@ -0,0 +1,88 @@ +.. bpo: 41304 +.. date: 2020-07-15-20-15-08 +.. nonce: vNEeYA +.. release date: 2020-07-20 +.. section: Security + +Fixes `python3x._pth` being ignored on Windows, caused by the fix for +:issue:`29778` (CVE-2020-15801). + +.. + +.. bpo: 39603 +.. date: 2020-02-12-14-17-39 +.. nonce: Gt3RSg +.. section: Security + +Prevent http header injection by rejecting control characters in +http.client.putrequest(...). + +.. + +.. bpo: 41295 +.. date: 2020-07-18-08-15-32 +.. nonce: pu8Ezo +.. section: Core and Builtins + +Resolve a regression in CPython 3.8.4 where defining "__setattr__" in a +multi-inheritance setup and calling up the hierarchy chain could fail if +builtins/extension types were involved in the base types. + +.. + +.. bpo: 41288 +.. date: 2020-07-13-15-06-35 +.. nonce: 8mn5P- +.. section: Library + +Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now +UnpicklingError instead of crashing. + +.. + +.. bpo: 39017 +.. date: 2020-07-12-22-16-58 +.. nonce: x3Cg-9 +.. section: Library + +Avoid infinite loop when reading specially crafted TAR files using the +tarfile module (CVE-2019-20907). + +.. + +.. bpo: 37703 +.. date: 2019-08-16-20-25-42 +.. nonce: Qm_l_H +.. section: Documentation + +Updated Documentation to comprehensively elaborate on the behaviour of +gather.cancel() + +.. + +.. bpo: 41302 +.. date: 2020-07-15-17-56-32 +.. nonce: S3o-x9 +.. section: Build + +Enable building Python 3.8 with libmpdec-2.5.0 to ease maintenance for Linux +distributions. Patch by Felix Yan. + +.. + +.. bpo: 40741 +.. date: 2020-06-19-14-19-08 +.. nonce: L7yTbm +.. section: macOS + +Update macOS installer to use SQLite 3.32.3. + +.. + +.. bpo: 41300 +.. date: 2020-07-16-17-39-06 +.. nonce: wRixNb +.. section: IDLE + +Save files with non-ascii chars. Fix regression released in 3.9.0b4 and +3.8.4. diff --git a/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst = b/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst deleted file mode 100644 index 2f1301740e748..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-07-15-17-56-32.bpo-41302.S3o-x9.rst +++ /dev/null @@ -1 +0,0 @@ -Enable building Python 3.8 with libmpdec-2.5.0 to ease maintenance for Linux= distributions. Patch by Felix Yan. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295= .pu8Ezo.rst b/Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-4129= 5.pu8Ezo.rst deleted file mode 100644 index d61fd8f0a2968..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-07-18-08-15-32.bpo-41295.pu8Ezo= .rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Resolve a regression in CPython 3.8.4 where defining "__setattr__" in a -multi-inheritance setup and calling up the hierarchy chain could fail -if builtins/extension types were involved in the base types. diff --git a/Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_= l_H.rst b/Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H= .rst deleted file mode 100644 index a1a1c354b1688..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2019-08-16-20-25-42.bpo-37703.Qm_l_H.rst +++ /dev/null @@ -1,2 +0,0 @@ -Updated Documentation to comprehensively elaborate on the behaviour of -gather.cancel() diff --git a/Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst b= /Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst deleted file mode 100644 index 080775f7d7ab4..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-07-16-17-39-06.bpo-41300.wRixNb.rst +++ /dev/null @@ -1,2 +0,0 @@ -Save files with non-ascii chars. Fix regression released in 3.9.0b4 and -3.8.4. diff --git a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rs= t b/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst deleted file mode 100644 index ad26676f8b856..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-07-12-22-16-58.bpo-39017.x3Cg-9.rst +++ /dev/null @@ -1 +0,0 @@ -Avoid infinite loop when reading specially crafted TAR files using the tarfi= le module (CVE-2019-20907). diff --git a/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rs= t b/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst deleted file mode 100644 index 3c3adbabf16ff..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-07-13-15-06-35.bpo-41288.8mn5P-.rst +++ /dev/null @@ -1,2 +0,0 @@ -Unpickling invalid NEWOBJ_EX opcode with the C implementation raises now -UnpicklingError instead of crashing. diff --git a/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.r= st b/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst deleted file mode 100644 index 990affc3edd9d..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-02-12-14-17-39.bpo-39603.Gt3RSg.rst +++ /dev/null @@ -1,2 +0,0 @@ -Prevent http header injection by rejecting control characters in -http.client.putrequest(...). diff --git a/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.r= st b/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst deleted file mode 100644 index 8cc4bb8d280a7..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-07-15-20-15-08.bpo-41304.vNEeYA.rst +++ /dev/null @@ -1 +0,0 @@ -Fixes `python3x._pth` being ignored on Windows, caused by the fix for :issue= :`29778` (CVE-2020-15801). diff --git a/Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst = b/Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst deleted file mode 100644 index 78a21b76c2fe4..0000000000000 --- a/Misc/NEWS.d/next/macOS/2020-06-19-14-19-08.bpo-40741.L7yTbm.rst +++ /dev/null @@ -1 +0,0 @@ -Update macOS installer to use SQLite 3.32.3. diff --git a/README.rst b/README.rst index 51a053025f65f..862a24d5efc03 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -This is Python version 3.8.4 +This is Python version 3.8.5 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D =20 .. image:: https://travis-ci.org/python/cpython.svg?branch=3D3.8 From webhook-mailer at python.org Mon Jul 20 13:25:51 2020 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Mon, 20 Jul 2020 17:25:51 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Post 3.8.5 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/22d6d88013129494d72cac62fa0c1b6e23e3= 42d3 commit: 22d6d88013129494d72cac62fa0c1b6e23e342d3 branch: 3.8 author: =C5=81ukasz Langa committer: =C5=81ukasz Langa date: 2020-07-20T19:25:23+02:00 summary: Post 3.8.5 files: M Include/patchlevel.h diff --git a/Include/patchlevel.h b/Include/patchlevel.h index 25fc2d3a7adca..278f33fcf9b72 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 0 =20 /* Version as a string */ -#define PY_VERSION "3.8.5" +#define PY_VERSION "3.8.5+" /*--end constants--*/ =20 /* Version as a single 4-byte hex number, e.g. 0x010502B2 =3D=3D 1.5.2b2. From webhook-mailer at python.org Thu Jul 23 15:45:18 2020 From: webhook-mailer at python.org (Alex =?utf-8?q?Gr=C3=B6nholm?=) Date: Thu, 23 Jul 2020 19:45:18 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() (#21595) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/0dd98c2d00a75efbec19c2ed942923981bc0= 6683 commit: 0dd98c2d00a75efbec19c2ed942923981bc06683 branch: master author: Alex Gr=C3=B6nholm committer: GitHub date: 2020-07-23T12:45:08-07:00 summary: bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() (#2159= 5) files: A Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst M Lib/asyncio/selector_events.py M Lib/test/test_asyncio/test_sock_lowlevel.py diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 884a58f2ed650..8495a7901cd34 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -555,20 +555,19 @@ async def sock_accept(self, sock): if self._debug and sock.gettimeout() !=3D 0: raise ValueError("the socket must be non-blocking") fut =3D self.create_future() - self._sock_accept(fut, False, sock) + self._sock_accept(fut, sock) return await fut =20 - def _sock_accept(self, fut, registered, sock): + def _sock_accept(self, fut, sock): fd =3D sock.fileno() - if registered: - self.remove_reader(fd) - if fut.done(): - return try: conn, address =3D sock.accept() conn.setblocking(False) except (BlockingIOError, InterruptedError): - self.add_reader(fd, self._sock_accept, fut, True, sock) + self._ensure_fd_no_transport(fd) + handle =3D self._add_reader(fd, self._sock_accept, fut, sock) + fut.add_done_callback( + functools.partial(self._sock_read_done, fd, handle=3Dhandle)) except (SystemExit, KeyboardInterrupt): raise except BaseException as exc: diff --git a/Lib/test/test_asyncio/test_sock_lowlevel.py b/Lib/test/test_asyn= cio/test_sock_lowlevel.py index e339ee9a4fc49..d8a5df8ede1f8 100644 --- a/Lib/test/test_asyncio/test_sock_lowlevel.py +++ b/Lib/test/test_asyncio/test_sock_lowlevel.py @@ -415,6 +415,25 @@ def test_sock_accept(self): conn.close() listener.close() =20 + def test_cancel_sock_accept(self): + listener =3D socket.socket() + listener.setblocking(False) + listener.bind(('127.0.0.1', 0)) + listener.listen(1) + sockaddr =3D listener.getsockname() + f =3D asyncio.wait_for(self.loop.sock_accept(listener), 0.1) + with self.assertRaises(asyncio.TimeoutError): + self.loop.run_until_complete(f) + + listener.close() + client =3D socket.socket() + client.setblocking(False) + f =3D self.loop.sock_connect(client, sockaddr) + with self.assertRaises(ConnectionRefusedError): + self.loop.run_until_complete(f) + + client.close() + def test_create_connection_sock(self): with test_utils.run_test_server() as httpd: sock =3D None diff --git a/Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rs= t b/Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst new file mode 100644 index 0000000000000..1af985e90e3e9 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-07-23-01-18-34.bpo-41317.O17Z6x.rst @@ -0,0 +1,2 @@ +Use add_done_callback() in asyncio.loop.sock_accept() to unsubscribe reader +early on cancellation.