From webhook-mailer at python.org Wed Apr 1 04:38:50 2020 From: webhook-mailer at python.org (Steve Dower) Date: Wed, 01 Apr 2020 08:38:50 -0000 Subject: [Python-checkins] bpo-40121: Fix exception type in test (GH-19267) Message-ID: https://github.com/python/cpython/commit/3ef4a7e5a7c29e17d5152d1fa6ceeb1fee269699 commit: 3ef4a7e5a7c29e17d5152d1fa6ceeb1fee269699 branch: master author: Steve Dower committer: GitHub date: 2020-04-01T09:38:26+01:00 summary: bpo-40121: Fix exception type in test (GH-19267) files: M Lib/test/audit-tests.py diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index dda52a5a518f6..b90c4b8f75794 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -343,7 +343,7 @@ def hook(event, args): try: # Don't care if this fails, we just want the audit message sock.bind(('127.0.0.1', 8080)) - except error: + except Exception: pass finally: sock.close() From webhook-mailer at python.org Wed Apr 1 08:41:59 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 01 Apr 2020 12:41:59 -0000 Subject: [Python-checkins] bpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265) Message-ID: https://github.com/python/cpython/commit/17b4733f2ff0a4abc06e8c745755c06fc32942dd commit: 17b4733f2ff0a4abc06e8c745755c06fc32942dd branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-01T15:41:49+03:00 summary: bpo-40130: _PyUnicode_AsKind() should not be exported. (GH-19265) Make it a static function, and pass known attributes (kind, data, length) instead of the PyUnicode object. files: M Include/cpython/unicodeobject.h M Objects/unicodeobject.c diff --git a/Include/cpython/unicodeobject.h b/Include/cpython/unicodeobject.h index 0df64790c1c22..81a35cdc801d0 100644 --- a/Include/cpython/unicodeobject.h +++ b/Include/cpython/unicodeobject.h @@ -726,12 +726,6 @@ PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter( Py_ssize_t start, Py_ssize_t end); -/* --- wchar_t support for platforms which support it --------------------- */ - -#ifdef HAVE_WCHAR_H -PyAPI_FUNC(void*) _PyUnicode_AsKind(PyObject *s, unsigned int kind); -#endif - /* --- Manage the default encoding ---------------------------------------- */ /* Returns a pointer to the default encoding (UTF-8) of the diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3d99f11ecff6f..9d51c8a685ebe 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2043,9 +2043,9 @@ unicode_write_cstr(PyObject *unicode, Py_ssize_t index, void *data = PyUnicode_DATA(unicode); const char *end = str + len; + assert(index + len <= PyUnicode_GET_LENGTH(unicode)); switch (kind) { case PyUnicode_1BYTE_KIND: { - assert(index + len <= PyUnicode_GET_LENGTH(unicode)); #ifdef Py_DEBUG if (PyUnicode_IS_ASCII(unicode)) { Py_UCS4 maxchar = ucs1lib_find_max_char( @@ -2060,7 +2060,6 @@ unicode_write_cstr(PyObject *unicode, Py_ssize_t index, case PyUnicode_2BYTE_KIND: { Py_UCS2 *start = (Py_UCS2 *)data + index; Py_UCS2 *ucs2 = start; - assert(index <= PyUnicode_GET_LENGTH(unicode)); for (; str < end; ++ucs2, ++str) *ucs2 = (Py_UCS2)*str; @@ -2068,17 +2067,18 @@ unicode_write_cstr(PyObject *unicode, Py_ssize_t index, assert((ucs2 - start) <= PyUnicode_GET_LENGTH(unicode)); break; } - default: { + case PyUnicode_4BYTE_KIND: { Py_UCS4 *start = (Py_UCS4 *)data + index; Py_UCS4 *ucs4 = start; - assert(kind == PyUnicode_4BYTE_KIND); - assert(index <= PyUnicode_GET_LENGTH(unicode)); for (; str < end; ++ucs4, ++str) *ucs4 = (Py_UCS4)*str; assert((ucs4 - start) <= PyUnicode_GET_LENGTH(unicode)); + break; } + default: + Py_UNREACHABLE(); } } @@ -2458,13 +2458,15 @@ unicode_adjust_maxchar(PyObject **p_unicode) if (max_char >= 256) return; } - else { + else if (kind == PyUnicode_4BYTE_KIND) { const Py_UCS4 *u = PyUnicode_4BYTE_DATA(unicode); - assert(kind == PyUnicode_4BYTE_KIND); max_char = ucs4lib_find_max_char(u, u + len); if (max_char >= 0x10000) return; } + else + Py_UNREACHABLE(); + copy = PyUnicode_New(len, max_char); if (copy != NULL) _PyUnicode_FastCopyCharacters(copy, 0, unicode, 0, len); @@ -2501,22 +2503,12 @@ _PyUnicode_Copy(PyObject *unicode) /* Widen Unicode objects to larger buffers. Don't write terminating null character. Return NULL on error. */ -void* -_PyUnicode_AsKind(PyObject *s, unsigned int kind) +static void* +unicode_askind(unsigned int skind, void const *data, Py_ssize_t len, unsigned int kind) { - Py_ssize_t len; void *result; - unsigned int skind; - if (PyUnicode_READY(s) == -1) - return NULL; - - len = PyUnicode_GET_LENGTH(s); - skind = PyUnicode_KIND(s); - if (skind >= kind) { - PyErr_SetString(PyExc_SystemError, "invalid widening attempt"); - return NULL; - } + assert(skind < kind); switch (kind) { case PyUnicode_2BYTE_KIND: result = PyMem_New(Py_UCS2, len); @@ -2525,8 +2517,8 @@ _PyUnicode_AsKind(PyObject *s, unsigned int kind) assert(skind == PyUnicode_1BYTE_KIND); _PyUnicode_CONVERT_BYTES( Py_UCS1, Py_UCS2, - PyUnicode_1BYTE_DATA(s), - PyUnicode_1BYTE_DATA(s) + len, + (const Py_UCS1 *)data, + ((const Py_UCS1 *)data) + len, result); return result; case PyUnicode_4BYTE_KIND: @@ -2536,24 +2528,23 @@ _PyUnicode_AsKind(PyObject *s, unsigned int kind) if (skind == PyUnicode_2BYTE_KIND) { _PyUnicode_CONVERT_BYTES( Py_UCS2, Py_UCS4, - PyUnicode_2BYTE_DATA(s), - PyUnicode_2BYTE_DATA(s) + len, + (const Py_UCS2 *)data, + ((const Py_UCS2 *)data) + len, result); } else { assert(skind == PyUnicode_1BYTE_KIND); _PyUnicode_CONVERT_BYTES( Py_UCS1, Py_UCS4, - PyUnicode_1BYTE_DATA(s), - PyUnicode_1BYTE_DATA(s) + len, + (const Py_UCS1 *)data, + ((const Py_UCS1 *)data) + len, result); } return result; default: - break; + Py_UNREACHABLE(); + return NULL; } - PyErr_SetString(PyExc_SystemError, "invalid kind"); - return NULL; } static Py_UCS4* @@ -9420,7 +9411,7 @@ any_find_slice(PyObject* s1, PyObject* s2, } if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(s2, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return -2; } @@ -9642,7 +9633,7 @@ PyUnicode_Count(PyObject *str, buf1 = PyUnicode_DATA(str); buf2 = PyUnicode_DATA(substr); if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(substr, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) goto onError; } @@ -10415,7 +10406,7 @@ split(PyObject *self, buf1 = PyUnicode_DATA(self); buf2 = PyUnicode_DATA(substring); if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(substring, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return NULL; } @@ -10506,7 +10497,7 @@ rsplit(PyObject *self, buf1 = PyUnicode_DATA(self); buf2 = PyUnicode_DATA(substring); if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(substring, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return NULL; } @@ -10665,7 +10656,7 @@ replace(PyObject *self, PyObject *str1, if (kind1 < rkind) { /* widen substring */ - buf1 = _PyUnicode_AsKind(str1, rkind); + buf1 = unicode_askind(kind1, buf1, len1, rkind); if (!buf1) goto error; release1 = 1; } @@ -10674,19 +10665,22 @@ replace(PyObject *self, PyObject *str1, goto nothing; if (rkind > kind2) { /* widen replacement */ - buf2 = _PyUnicode_AsKind(str2, rkind); + buf2 = unicode_askind(kind2, buf2, len2, rkind); if (!buf2) goto error; release2 = 1; } else if (rkind < kind2) { /* widen self and buf1 */ rkind = kind2; - if (release1) PyMem_Free(buf1); - release1 = 0; - sbuf = _PyUnicode_AsKind(self, rkind); + if (release1) { + PyMem_Free(buf1); + buf1 = PyUnicode_DATA(str1); + release1 = 0; + } + sbuf = unicode_askind(skind, sbuf, slen, rkind); if (!sbuf) goto error; srelease = 1; - buf1 = _PyUnicode_AsKind(str1, rkind); + buf1 = unicode_askind(kind1, buf1, len1, rkind); if (!buf1) goto error; release1 = 1; } @@ -10724,7 +10718,7 @@ replace(PyObject *self, PyObject *str1, if (kind1 < rkind) { /* widen substring */ - buf1 = _PyUnicode_AsKind(str1, rkind); + buf1 = unicode_askind(kind1, buf1, len1, rkind); if (!buf1) goto error; release1 = 1; } @@ -10733,19 +10727,22 @@ replace(PyObject *self, PyObject *str1, goto nothing; if (kind2 < rkind) { /* widen replacement */ - buf2 = _PyUnicode_AsKind(str2, rkind); + buf2 = unicode_askind(kind2, buf2, len2, rkind); if (!buf2) goto error; release2 = 1; } else if (kind2 > rkind) { /* widen self and buf1 */ rkind = kind2; - sbuf = _PyUnicode_AsKind(self, rkind); + sbuf = unicode_askind(skind, sbuf, slen, rkind); if (!sbuf) goto error; srelease = 1; - if (release1) PyMem_Free(buf1); - release1 = 0; - buf1 = _PyUnicode_AsKind(str1, rkind); + if (release1) { + PyMem_Free(buf1); + buf1 = PyUnicode_DATA(str1); + release1 = 0; + } + buf1 = unicode_askind(kind1, buf1, len1, rkind); if (!buf1) goto error; release1 = 1; } @@ -11361,7 +11358,7 @@ PyUnicode_Contains(PyObject *str, PyObject *substr) return result; } if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(substr, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return -1; } @@ -11578,7 +11575,7 @@ unicode_count(PyObject *self, PyObject *args) buf1 = PyUnicode_DATA(self); buf2 = PyUnicode_DATA(substring); if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(substring, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return NULL; } @@ -13081,7 +13078,7 @@ PyUnicode_Partition(PyObject *str_obj, PyObject *sep_obj) buf1 = PyUnicode_DATA(str_obj); buf2 = PyUnicode_DATA(sep_obj); if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(sep_obj, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return NULL; } @@ -13138,7 +13135,7 @@ PyUnicode_RPartition(PyObject *str_obj, PyObject *sep_obj) buf1 = PyUnicode_DATA(str_obj); buf2 = PyUnicode_DATA(sep_obj); if (kind2 != kind1) { - buf2 = _PyUnicode_AsKind(sep_obj, kind1); + buf2 = unicode_askind(kind2, buf2, len2, kind1); if (!buf2) return NULL; } From webhook-mailer at python.org Wed Apr 1 09:03:04 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 01 Apr 2020 13:03:04 -0000 Subject: [Python-checkins] bpo-40121: Fix exception type in test (GH-19267) Message-ID: https://github.com/python/cpython/commit/f971c8c0a0fbe1959843179e2811b047001125a0 commit: f971c8c0a0fbe1959843179e2811b047001125a0 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-01T06:02:55-07:00 summary: bpo-40121: Fix exception type in test (GH-19267) (cherry picked from commit 3ef4a7e5a7c29e17d5152d1fa6ceeb1fee269699) Co-authored-by: Steve Dower files: M Lib/test/audit-tests.py diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py index dda52a5a518f6..b90c4b8f75794 100644 --- a/Lib/test/audit-tests.py +++ b/Lib/test/audit-tests.py @@ -343,7 +343,7 @@ def hook(event, args): try: # Don't care if this fails, we just want the audit message sock.bind(('127.0.0.1', 8080)) - except error: + except Exception: pass finally: sock.close() From webhook-mailer at python.org Wed Apr 1 09:48:10 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 01 Apr 2020 13:48:10 -0000 Subject: [Python-checkins] bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) Message-ID: https://github.com/python/cpython/commit/7c72383f95b0cdedf390726069428d7b69ed2597 commit: 7c72383f95b0cdedf390726069428d7b69ed2597 branch: master author: Victor Stinner committer: GitHub date: 2020-04-01T15:48:05+02:00 summary: bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) files: M Doc/library/os.rst diff --git a/Doc/library/os.rst b/Doc/library/os.rst index d8bca2f950a9e..4adca057ed2e7 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -4167,28 +4167,36 @@ used to determine the disposition of a process. Return ``True`` if a core dump was generated for the process, otherwise return ``False``. + This function should be employed only if :func:`WIFSIGNALED` is true. + .. availability:: Unix. .. function:: WIFCONTINUED(status) - Return ``True`` if the process has been continued from a job control stop, - otherwise return ``False``. + Return ``True`` if a stopped child has been resumed by delivery of + :data:`~signal.SIGCONT` (if the process has been continued from a job + control stop), otherwise return ``False``. + + See :data:`WCONTINUED` option. .. availability:: Unix. .. function:: WIFSTOPPED(status) - Return ``True`` if the process has been stopped, otherwise return - ``False``. + Return ``True`` if the process was stopped by delivery of a signal, + otherwise return ``False``. - .. availability:: Unix. + :func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was + done using :data:`WUNTRACED` option or when the process is being traced (see + :manpage:`ptrace(2)`). + .. availability:: Unix. .. function:: WIFSIGNALED(status) - Return ``True`` if the process exited due to a signal, otherwise return + Return ``True`` if the process was terminated by a signal, otherwise return ``False``. .. availability:: Unix. @@ -4196,7 +4204,8 @@ used to determine the disposition of a process. .. function:: WIFEXITED(status) - Return ``True`` if the process exited using the :manpage:`exit(2)` system call, + Return ``True`` if the process exited terminated normally, that is, + by calling ``exit()`` or ``_exit()``, or by returning from ``main()``; otherwise return ``False``. .. availability:: Unix. @@ -4204,8 +4213,9 @@ used to determine the disposition of a process. .. function:: WEXITSTATUS(status) - If ``WIFEXITED(status)`` is true, return the integer parameter to the - :manpage:`exit(2)` system call. Otherwise, the return value is meaningless. + Return the process exit status. + + This function should be employed only if :func:`WIFEXITED` is true. .. availability:: Unix. @@ -4214,12 +4224,16 @@ used to determine the disposition of a process. Return the signal which caused the process to stop. + This function should be employed only if :func:`WIFSTOPPED` is true. + .. availability:: Unix. .. function:: WTERMSIG(status) - Return the signal which caused the process to exit. + Return the number of the signal that caused the process to terminate. + + This function should be employed only if :func:`WIFSIGNALED` is true. .. availability:: Unix. From webhook-mailer at python.org Wed Apr 1 09:59:00 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Wed, 01 Apr 2020 13:59:00 -0000 Subject: [Python-checkins] bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514) Message-ID: https://github.com/python/cpython/commit/975ac326ffe265e63a103014fd27e9d098fe7548 commit: 975ac326ffe265e63a103014fd27e9d098fe7548 branch: master author: Zackery Spytz committer: GitHub date: 2020-04-01T09:58:55-04:00 summary: bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514) * bpo-33262: Deprecate passing None for `s` to shlex.split() This reads the string to split from standard input. * Update What's New. * Fix shlex.rst files: A Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst M Doc/library/shlex.rst M Doc/whatsnew/3.9.rst M Lib/shlex.py M Lib/test/test_shlex.py diff --git a/Doc/library/shlex.rst b/Doc/library/shlex.rst index adc23da6d491b..7f7f0c7f124ac 100644 --- a/Doc/library/shlex.rst +++ b/Doc/library/shlex.rst @@ -36,6 +36,9 @@ The :mod:`shlex` module defines the following functions: instance, passing ``None`` for *s* will read the string to split from standard input. + .. deprecated:: 3.9 + Passing ``None`` for *s* will raise an exception in future Python + versions. .. function:: join(split_command) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 59083da3a262b..6ea4ad89f8c0a 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -624,6 +624,9 @@ Deprecated by :c:func:`Py_Initialize()` since Python 3.7. (Contributed by Victor Stinner in :issue:`39877`.) +* Passing ``None`` as the first argument to the :func:`shlex.split` function + has been deprecated. (Contributed by Zackery Spytz in :issue:`33262`.) + Removed ======= diff --git a/Lib/shlex.py b/Lib/shlex.py index c817274583135..4801a6c1d47bd 100644 --- a/Lib/shlex.py +++ b/Lib/shlex.py @@ -304,6 +304,10 @@ def __next__(self): def split(s, comments=False, posix=True): """Split the string *s* using shell-like syntax.""" + if s is None: + import warnings + warnings.warn("Passing None for 's' to shlex.split() is deprecated.", + DeprecationWarning, stacklevel=2) lex = shlex(s, posix=posix) lex.whitespace_split = True if not comments: diff --git a/Lib/test/test_shlex.py b/Lib/test/test_shlex.py index a21ccd2fdf44a..3081a785204ed 100644 --- a/Lib/test/test_shlex.py +++ b/Lib/test/test_shlex.py @@ -3,7 +3,7 @@ import shlex import string import unittest - +from unittest import mock # The original test data set was from shellwords, by Hartmut Goebel. @@ -162,6 +162,11 @@ def oldSplit(self, s): tok = lex.get_token() return ret + @mock.patch('sys.stdin', io.StringIO()) + def testSplitNoneDeprecation(self): + with self.assertWarns(DeprecationWarning): + shlex.split(None) + def testSplitPosix(self): """Test data splitting with posix parser""" self.splitTest(self.posix_data, comments=True) diff --git a/Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst b/Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst new file mode 100644 index 0000000000000..2afe13aeb0fca --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst @@ -0,0 +1,2 @@ +Deprecate passing None as an argument for :func:`shlex.split()`'s ``s`` +parameter. Patch by Zackery Spytz. From webhook-mailer at python.org Wed Apr 1 10:11:01 2020 From: webhook-mailer at python.org (Barney Gale) Date: Wed, 01 Apr 2020 14:11:01 -0000 Subject: [Python-checkins] bpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for "closing" a path by using it as a context manager (GH-18846) Message-ID: https://github.com/python/cpython/commit/00002e6d8b0ccdb6e0d9e98a9a7f9c9edfdf1311 commit: 00002e6d8b0ccdb6e0d9e98a9a7f9c9edfdf1311 branch: master author: Barney Gale committer: GitHub date: 2020-04-01T16:10:51+02:00 summary: bpo-39682: make `pathlib.Path` immutable by removing (undocumented) support for "closing" a path by using it as a context manager (GH-18846) Support for using a path as a context manager remains, and is now a no-op. files: A Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst M Lib/pathlib.py M Lib/test/test_pathlib.py diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 293462000c2a6..96b8b59530c72 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1041,7 +1041,6 @@ class Path(PurePath): """ __slots__ = ( '_accessor', - '_closed', ) def __new__(cls, *args, **kwargs): @@ -1058,7 +1057,6 @@ def _init(self, # Private non-constructor arguments template=None, ): - self._closed = False if template is not None: self._accessor = template._accessor else: @@ -1071,15 +1069,18 @@ def _make_child_relpath(self, part): return self._from_parsed_parts(self._drv, self._root, parts) def __enter__(self): - if self._closed: - self._raise_closed() return self def __exit__(self, t, v, tb): - self._closed = True - - def _raise_closed(self): - raise ValueError("I/O operation on closed path") + # https://bugs.python.org/issue39682 + # In previous versions of pathlib, this method marked this path as + # closed; subsequent attempts to perform I/O would raise an IOError. + # This functionality was never documented, and had the effect of + # making Path objects mutable, contrary to PEP 428. In Python 3.9 the + # _closed attribute was removed, and this method made a no-op. + # This method and __enter__()/__exit__() should be deprecated and + # removed in the future. + pass def _opener(self, name, flags, mode=0o666): # A stub for the opener argument to built-in open() @@ -1090,8 +1091,6 @@ def _raw_open(self, flags, mode=0o777): Open the file pointed by this path and return a file descriptor, as os.open() does. """ - if self._closed: - self._raise_closed() return self._accessor.open(self, flags, mode) # Public API @@ -1125,15 +1124,11 @@ def iterdir(self): """Iterate over the files in this directory. Does not yield any result for the special paths '.' and '..'. """ - if self._closed: - self._raise_closed() for name in self._accessor.listdir(self): if name in {'.', '..'}: # Yielding a path object for these makes little sense continue yield self._make_child_relpath(name) - if self._closed: - self._raise_closed() def glob(self, pattern): """Iterate over this subtree and yield all existing files (of any @@ -1170,8 +1165,6 @@ def absolute(self): Use resolve() to get the canonical path to a file. """ # XXX untested yet! - if self._closed: - self._raise_closed() if self.is_absolute(): return self # FIXME this must defer to the specific flavour (and, under Windows, @@ -1186,8 +1179,6 @@ def resolve(self, strict=False): normalizing it (for example turning slashes into backslashes under Windows). """ - if self._closed: - self._raise_closed() s = self._flavour.resolve(self, strict=strict) if s is None: # No symlink resolution => for consistency, raise an error if @@ -1227,8 +1218,6 @@ def open(self, mode='r', buffering=-1, encoding=None, Open the file pointed by this path and return a file object, as the built-in open() function does. """ - if self._closed: - self._raise_closed() return io.open(self, mode, buffering, encoding, errors, newline, opener=self._opener) @@ -1278,8 +1267,6 @@ def touch(self, mode=0o666, exist_ok=True): """ Create this file with the given access mode, if it doesn't exist. """ - if self._closed: - self._raise_closed() if exist_ok: # First try to bump modification time # Implementation note: GNU touch uses the UTIME_NOW option of @@ -1301,8 +1288,6 @@ def mkdir(self, mode=0o777, parents=False, exist_ok=False): """ Create a new directory at this given path. """ - if self._closed: - self._raise_closed() try: self._accessor.mkdir(self, mode) except FileNotFoundError: @@ -1320,8 +1305,6 @@ def chmod(self, mode): """ Change the permissions of the path, like os.chmod(). """ - if self._closed: - self._raise_closed() self._accessor.chmod(self, mode) def lchmod(self, mode): @@ -1329,8 +1312,6 @@ def lchmod(self, mode): Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. """ - if self._closed: - self._raise_closed() self._accessor.lchmod(self, mode) def unlink(self, missing_ok=False): @@ -1338,8 +1319,6 @@ def unlink(self, missing_ok=False): Remove this file or link. If the path is a directory, use rmdir() instead. """ - if self._closed: - self._raise_closed() try: self._accessor.unlink(self) except FileNotFoundError: @@ -1350,8 +1329,6 @@ def rmdir(self): """ Remove this directory. The directory must be empty. """ - if self._closed: - self._raise_closed() self._accessor.rmdir(self) def lstat(self): @@ -1359,16 +1336,12 @@ def lstat(self): Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. """ - if self._closed: - self._raise_closed() return self._accessor.lstat(self) def link_to(self, target): """ Create a hard link pointing to a path named target. """ - if self._closed: - self._raise_closed() self._accessor.link_to(self, target) def rename(self, target): @@ -1376,8 +1349,6 @@ def rename(self, target): Rename this path to the given path, and return a new Path instance pointing to the given path. """ - if self._closed: - self._raise_closed() self._accessor.rename(self, target) return self.__class__(target) @@ -1387,8 +1358,6 @@ def replace(self, target): destination if it exists, and return a new Path instance pointing to the given path. """ - if self._closed: - self._raise_closed() self._accessor.replace(self, target) return self.__class__(target) @@ -1397,8 +1366,6 @@ def symlink_to(self, target, target_is_directory=False): Make this path a symlink pointing to the given path. Note the order of arguments (self, target) is the reverse of os.symlink's. """ - if self._closed: - self._raise_closed() self._accessor.symlink(target, self, target_is_directory) # Convenience functions for querying the stat results diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 5b362a0ff3d9b..8b19cffba37e9 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1720,13 +1720,15 @@ def test_with(self): next(it2) with p: pass - # I/O operation on closed path. - self.assertRaises(ValueError, next, it) - self.assertRaises(ValueError, next, it2) - self.assertRaises(ValueError, p.open) - self.assertRaises(ValueError, p.resolve) - self.assertRaises(ValueError, p.absolute) - self.assertRaises(ValueError, p.__enter__) + # Using a path as a context manager is a no-op, thus the following + # operations should still succeed after the context manage exits. + next(it) + next(it2) + p.exists() + p.resolve() + p.absolute() + with p: + pass def test_chmod(self): p = self.cls(BASE) / 'fileA' diff --git a/Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst b/Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst new file mode 100644 index 0000000000000..d71a32132af9d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst @@ -0,0 +1,3 @@ +Remove undocumented support for *closing* a `pathlib.Path` object via its +context manager. The context manager magic methods remain, but they are now a +no-op, making `Path` objects immutable. From webhook-mailer at python.org Wed Apr 1 11:06:26 2020 From: webhook-mailer at python.org (Paulo Henrique Silva) Date: Wed, 01 Apr 2020 15:06:26 -0000 Subject: [Python-checkins] bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273) Message-ID: https://github.com/python/cpython/commit/eacc07439591c97f69ab4a3d17391b009cd78ae2 commit: eacc07439591c97f69ab4a3d17391b009cd78ae2 branch: master author: Paulo Henrique Silva committer: GitHub date: 2020-04-01T17:06:21+02:00 summary: bpo-40071: Fix potential crash in _functoolsmodule.c (GH-19273) Changes on 7dd549eb0893 made _functools compatible with PEP-489 and we could have multiple modules instances loaded. But, right now there is no way to make `kwd_mark` global into a per module instance variable. kwd_mark is used on lru_cache_new which does not have a reference to a PyModule*, necessary to use PyModule_GetState. PEP-573 will solve this problem and will allow us to move the global state to per-module data and properly clear the state when unloading a module instance. This change temporarily disable cleaning of kwd_mark to avoid NULL pointer dereference if we clear kwd_mark and other module instances still alive use it. files: M Modules/_functoolsmodule.c diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index dbe022e91d18f..f3d8658044b99 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1413,7 +1413,10 @@ static PyMethodDef _functools_methods[] = { static void _functools_free(void *m) { - Py_CLEAR(kwd_mark); + // FIXME: Do not clear kwd_mark to avoid NULL pointer dereferencing if we have + // other modules instances that could use it. Will fix when PEP-573 land + // and we could move kwd_mark to a per-module state. + // Py_CLEAR(kwd_mark); } static int From webhook-mailer at python.org Wed Apr 1 11:19:18 2020 From: webhook-mailer at python.org (Arnon Yaari) Date: Wed, 01 Apr 2020 15:19:18 -0000 Subject: [Python-checkins] bpo-38527: fix configure script for Solaris (GH-16845) Message-ID: https://github.com/python/cpython/commit/5dd836030e0e399b21ab0865ae0d93934bdb3930 commit: 5dd836030e0e399b21ab0865ae0d93934bdb3930 branch: master author: Arnon Yaari committer: GitHub date: 2020-04-01T08:19:09-07:00 summary: bpo-38527: fix configure script for Solaris (GH-16845) On Solaris, the regular "grep" command may be an old version that fails to search a binary file. We need to use the correct command (ggrep, in our case), which is found by the configure script earlier. Automerge-Triggered-By: @pablogsal files: A Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst M configure M m4/ax_c_float_words_bigendian.m4 diff --git a/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst b/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst new file mode 100644 index 0000000000000..869693095e49a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst @@ -0,0 +1,2 @@ +Fix configure check on Solaris for "float word ordering": sometimes, the correct "grep" command was not being used. +Patch by Arnon Yaari. diff --git a/configure b/configure index 893d0e1414917..a7a3ac254a970 100755 --- a/configure +++ b/configure @@ -14340,10 +14340,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : -if grep noonsees conftest.$ac_objext >/dev/null ; then +if $GREP noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if grep seesnoon conftest.$ac_objext >/dev/null ; then +if $GREP seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4 index 216b90d803187..746228c2c98df 100644 --- a/m4/ax_c_float_words_bigendian.m4 +++ b/m4/ax_c_float_words_bigendian.m4 @@ -49,10 +49,10 @@ double d = 909042349670368103374704789055050114762116927356156320147971208440534 ]])], [ -if grep noonsees conftest.$ac_objext >/dev/null ; then +if $GREP noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if grep seesnoon conftest.$ac_objext >/dev/null ; then +if $GREP seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else From webhook-mailer at python.org Wed Apr 1 11:38:34 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 01 Apr 2020 15:38:34 -0000 Subject: [Python-checkins] bpo-38527: fix configure script for Solaris (GH-16845) Message-ID: https://github.com/python/cpython/commit/fc036409226d2c65dad9503854f09b9a39c84f14 commit: fc036409226d2c65dad9503854f09b9a39c84f14 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-01T08:38:17-07:00 summary: bpo-38527: fix configure script for Solaris (GH-16845) On Solaris, the regular "grep" command may be an old version that fails to search a binary file. We need to use the correct command (ggrep, in our case), which is found by the configure script earlier. Automerge-Triggered-By: @pablogsal (cherry picked from commit 5dd836030e0e399b21ab0865ae0d93934bdb3930) Co-authored-by: Arnon Yaari files: A Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst M configure M m4/ax_c_float_words_bigendian.m4 diff --git a/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst b/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst new file mode 100644 index 0000000000000..869693095e49a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst @@ -0,0 +1,2 @@ +Fix configure check on Solaris for "float word ordering": sometimes, the correct "grep" command was not being used. +Patch by Arnon Yaari. diff --git a/configure b/configure index 3dfd6cce69e4e..8886561645762 100755 --- a/configure +++ b/configure @@ -14303,10 +14303,10 @@ _ACEOF if ac_fn_c_try_compile "$LINENO"; then : -if grep noonsees conftest.$ac_objext >/dev/null ; then +if $GREP noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if grep seesnoon conftest.$ac_objext >/dev/null ; then +if $GREP seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4 index 216b90d803187..746228c2c98df 100644 --- a/m4/ax_c_float_words_bigendian.m4 +++ b/m4/ax_c_float_words_bigendian.m4 @@ -49,10 +49,10 @@ double d = 909042349670368103374704789055050114762116927356156320147971208440534 ]])], [ -if grep noonsees conftest.$ac_objext >/dev/null ; then +if $GREP noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi -if grep seesnoon conftest.$ac_objext >/dev/null ; then +if $GREP seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else From webhook-mailer at python.org Wed Apr 1 12:49:39 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 01 Apr 2020 16:49:39 -0000 Subject: [Python-checkins] bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201) Message-ID: https://github.com/python/cpython/commit/65a796e5272f61b42792d3a8c69686558c1872c5 commit: 65a796e5272f61b42792d3a8c69686558c1872c5 branch: master author: Victor Stinner committer: GitHub date: 2020-04-01T18:49:29+02:00 summary: bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201) Add os.waitstatus_to_exitcode() function to convert a wait status to an exitcode. Suggest waitstatus_to_exitcode() usage in the documentation when appropriate. Use waitstatus_to_exitcode() in: * multiprocessing, os, subprocess and _bootsubprocess modules; * test.support.wait_process(); * setup.py: run_command(); * and many tests. files: A Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst M Doc/library/os.rst M Doc/library/pty.rst M Doc/whatsnew/3.9.rst M Lib/_bootsubprocess.py M Lib/multiprocessing/forkserver.py M Lib/multiprocessing/popen_fork.py M Lib/os.py M Lib/subprocess.py M Lib/test/support/__init__.py M Lib/test/test_os.py M Lib/test/test_popen.py M Lib/test/test_pty.py M Lib/test/test_wait3.py M Lib/test/test_wait4.py M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c M setup.py diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 4adca057ed2e7..f27cf3dbeaf0b 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3665,6 +3665,11 @@ written in Python, such as a mail server's external command delivery program. subprocess was killed.) On Windows systems, the return value contains the signed integer return code from the child process. + On Unix, :func:`waitstatus_to_exitcode` can be used to convert the ``close`` + method result (exit status) into an exit code if it is not ``None``. On + Windows, the ``close`` method result is directly the exit code + (or ``None``). + This is implemented using :class:`subprocess.Popen`; see that class's documentation for more powerful ways to manage and communicate with subprocesses. @@ -3968,6 +3973,10 @@ written in Python, such as a mail server's external command delivery program. to using this function. See the :ref:`subprocess-replacements` section in the :mod:`subprocess` documentation for some helpful recipes. + On Unix, :func:`waitstatus_to_exitcode` can be used to convert the result + (exit status) into an exit code. On Windows, the result is directly the exit + code. + .. audit-event:: os.system command os.system .. availability:: Unix, Windows. @@ -4008,8 +4017,16 @@ written in Python, such as a mail server's external command delivery program. number is zero); the high bit of the low byte is set if a core file was produced. + :func:`waitstatus_to_exitcode` can be used to convert the exit status into an + exit code. + .. availability:: Unix. + .. seealso:: + + :func:`waitpid` can be used to wait for the completion of a specific + child process and has more options. + .. function:: waitid(idtype, id, options) Wait for the completion of one or more child processes. @@ -4105,6 +4122,9 @@ written in Python, such as a mail server's external command delivery program. id is known, not necessarily a child process. The :func:`spawn\* ` functions called with :const:`P_NOWAIT` return suitable process handles. + :func:`waitstatus_to_exitcode` can be used to convert the exit status into an + exit code. + .. versionchanged:: 3.5 If the system call is interrupted and the signal handler does not raise an exception, the function now retries the system call instead of raising an @@ -4120,6 +4140,9 @@ written in Python, such as a mail server's external command delivery program. information. The option argument is the same as that provided to :func:`waitpid` and :func:`wait4`. + :func:`waitstatus_to_exitcode` can be used to convert the exit status into an + exitcode. + .. availability:: Unix. @@ -4131,9 +4154,42 @@ written in Python, such as a mail server's external command delivery program. resource usage information. The arguments to :func:`wait4` are the same as those provided to :func:`waitpid`. + :func:`waitstatus_to_exitcode` can be used to convert the exit status into an + exitcode. + .. availability:: Unix. +.. function:: waitstatus_to_exitcode(status) + + Convert a wait status to an exit code. + + On Unix: + + * If the process exited normally (if ``WIFEXITED(status)`` is true), + return the process exit status (return ``WEXITSTATUS(status)``): + result greater than or equal to 0. + * If the process was terminated by a signal (if ``WIFSIGNALED(status)`` is + true), return ``-signum`` where *signum* is the number of the signal that + caused the process to terminate (return ``-WTERMSIG(status)``): + result less than 0. + * Otherwise, raise a :exc:`ValueError`. + + On Windows, return *status* shifted right by 8 bits. + + On Unix, if the process is being traced or if :func:`waitpid` was called + with :data:`WUNTRACED` option, the caller must first check if + ``WIFSTOPPED(status)`` is true. This function must not be called if + ``WIFSTOPPED(status)`` is true. + + .. seealso:: + + :func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, + :func:`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions. + + .. versionadded:: 3.9 + + .. data:: WNOHANG The option for :func:`waitpid` to return immediately if no child process status diff --git a/Doc/library/pty.rst b/Doc/library/pty.rst index e85d2e239fdbd..73d4f102fd4d8 100644 --- a/Doc/library/pty.rst +++ b/Doc/library/pty.rst @@ -69,6 +69,11 @@ The :mod:`pty` module defines the following functions: *select* throws an error on your platform when passed three empty lists. This is a bug, documented in `issue 26228 `_. + Return the exit status value from :func:`os.waitpid` on the child process. + + :func:`waitstatus_to_exitcode` can be used to convert the exit status into + an exit code. + .. audit-event:: pty.spawn argv pty.spawn .. versionchanged:: 3.4 diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 6ea4ad89f8c0a..fc48cd67edcf6 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -322,6 +322,10 @@ The :func:`os.putenv` and :func:`os.unsetenv` functions are now always available. (Contributed by Victor Stinner in :issue:`39395`.) +Add :func:`os.waitstatus_to_exitcode` function: +convert a wait status to an exit code. +(Contributed by Victor Stinner in :issue:`40094`.) + pathlib ------- diff --git a/Lib/_bootsubprocess.py b/Lib/_bootsubprocess.py index 9c1912f315dc9..014782f616c82 100644 --- a/Lib/_bootsubprocess.py +++ b/Lib/_bootsubprocess.py @@ -6,15 +6,6 @@ import os -def _waitstatus_to_exitcode(status): - if os.WIFEXITED(status): - return os.WEXITSTATUS(status) - elif os.WIFSIGNALED(status): - return -os.WTERMSIG(status) - else: - raise ValueError(f"invalid wait status: {status!r}") - - # distutils.spawn used by distutils.command.build_ext # calls subprocess.Popen().wait() class Popen: @@ -37,7 +28,7 @@ def wait(self): else: # Parent process _, status = os.waitpid(pid, 0) - self.returncode = _waitstatus_to_exitcode(status) + self.returncode = os.waitstatus_to_exitcode(status) return self.returncode @@ -87,7 +78,7 @@ def check_output(cmd, **kwargs): try: # system() spawns a shell status = os.system(cmd) - exitcode = _waitstatus_to_exitcode(status) + exitcode = os.waitstatus_to_exitcode(status) if exitcode: raise ValueError(f"Command {cmd!r} returned non-zero " f"exit status {exitcode!r}") diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py index 215ac39afcaa0..22a911a7a29cd 100644 --- a/Lib/multiprocessing/forkserver.py +++ b/Lib/multiprocessing/forkserver.py @@ -237,14 +237,8 @@ def sigchld_handler(*_unused): break child_w = pid_to_fd.pop(pid, None) if child_w is not None: - if os.WIFSIGNALED(sts): - returncode = -os.WTERMSIG(sts) - else: - if not os.WIFEXITED(sts): - raise AssertionError( - "Child {0:n} status is {1:n}".format( - pid,sts)) - returncode = os.WEXITSTATUS(sts) + returncode = os.waitstatus_to_exitcode(sts) + # Send exit code to client process try: write_signed(child_w, returncode) diff --git a/Lib/multiprocessing/popen_fork.py b/Lib/multiprocessing/popen_fork.py index a65b06f1b2c75..625981cf47627 100644 --- a/Lib/multiprocessing/popen_fork.py +++ b/Lib/multiprocessing/popen_fork.py @@ -30,11 +30,7 @@ def poll(self, flag=os.WNOHANG): # e.errno == errno.ECHILD == 10 return None if pid == self.pid: - if os.WIFSIGNALED(sts): - self.returncode = -os.WTERMSIG(sts) - else: - assert os.WIFEXITED(sts), "Status is {:n}".format(sts) - self.returncode = os.WEXITSTATUS(sts) + self.returncode = os.waitstatus_to_exitcode(sts) return self.returncode def wait(self, timeout=None): diff --git a/Lib/os.py b/Lib/os.py index 8459baa2e4dfd..8acd6f12c3ed0 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -864,12 +864,8 @@ def _spawnvef(mode, file, args, env, func): wpid, sts = waitpid(pid, 0) if WIFSTOPPED(sts): continue - elif WIFSIGNALED(sts): - return -WTERMSIG(sts) - elif WIFEXITED(sts): - return WEXITSTATUS(sts) - else: - raise OSError("Not stopped, signaled or exited???") + + return waitstatus_to_exitcode(sts) def spawnv(mode, file, args): """spawnv(mode, file, args) -> integer diff --git a/Lib/subprocess.py b/Lib/subprocess.py index c8db387091ba3..1eecceaed414a 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1838,23 +1838,17 @@ def _execute_child(self, args, executable, preexec_fn, close_fds, raise child_exception_type(err_msg) - def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED, - _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED, - _WEXITSTATUS=os.WEXITSTATUS, _WIFSTOPPED=os.WIFSTOPPED, - _WSTOPSIG=os.WSTOPSIG): + def _handle_exitstatus(self, sts, + waitstatus_to_exitcode=os.waitstatus_to_exitcode, + _WIFSTOPPED=os.WIFSTOPPED, + _WSTOPSIG=os.WSTOPSIG): """All callers to this function MUST hold self._waitpid_lock.""" # This method is called (indirectly) by __del__, so it cannot # refer to anything outside of its local scope. - if _WIFSIGNALED(sts): - self.returncode = -_WTERMSIG(sts) - elif _WIFEXITED(sts): - self.returncode = _WEXITSTATUS(sts) - elif _WIFSTOPPED(sts): + if _WIFSTOPPED(sts): self.returncode = -_WSTOPSIG(sts) else: - # Should never happen - raise SubprocessError("Unknown child exit status!") - + self.returncode = waitstatus_to_exitcode(sts) def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid, _WNOHANG=os.WNOHANG, _ECHILD=errno.ECHILD): diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 7272d475ceb34..1f792d8514da0 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3442,18 +3442,11 @@ def wait_process(pid, *, exitcode, timeout=None): sleep = min(sleep * 2, max_sleep) time.sleep(sleep) - - if os.WIFEXITED(status): - exitcode2 = os.WEXITSTATUS(status) - elif os.WIFSIGNALED(status): - exitcode2 = -os.WTERMSIG(status) - else: - raise ValueError(f"invalid wait status: {status!r}") else: # Windows implementation pid2, status = os.waitpid(pid, 0) - exitcode2 = (status >> 8) + exitcode2 = os.waitstatus_to_exitcode(status) if exitcode2 != exitcode: raise AssertionError(f"process {pid} exited with code {exitcode2}, " f"but exit code {exitcode} is expected") diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index be85616ff88bf..142cfea364e40 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2794,6 +2794,35 @@ def test_waitpid(self): pid = os.spawnv(os.P_NOWAIT, FakePath(args[0]), args) support.wait_process(pid, exitcode=0) + def test_waitstatus_to_exitcode(self): + exitcode = 23 + filename = support.TESTFN + self.addCleanup(support.unlink, filename) + + with open(filename, "w") as fp: + print(f'import sys; sys.exit({exitcode})', file=fp) + fp.flush() + args = [sys.executable, filename] + pid = os.spawnv(os.P_NOWAIT, args[0], args) + + pid2, status = os.waitpid(pid, 0) + self.assertEqual(os.waitstatus_to_exitcode(status), exitcode) + self.assertEqual(pid2, pid) + + # Skip the test on Windows + @unittest.skipUnless(hasattr(signal, 'SIGKILL'), 'need signal.SIGKILL') + def test_waitstatus_to_exitcode_kill(self): + signum = signal.SIGKILL + args = [sys.executable, '-c', + f'import time; time.sleep({support.LONG_TIMEOUT})'] + pid = os.spawnv(os.P_NOWAIT, args[0], args) + + os.kill(pid, signum) + + pid2, status = os.waitpid(pid, 0) + self.assertEqual(os.waitstatus_to_exitcode(status), -signum) + self.assertEqual(pid2, pid) + class SpawnTests(unittest.TestCase): def create_args(self, *, with_env=False, use_bytes=False): diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py index da01a878fa0a5..ab1bc776552ca 100644 --- a/Lib/test/test_popen.py +++ b/Lib/test/test_popen.py @@ -44,10 +44,11 @@ def test_popen(self): def test_return_code(self): self.assertEqual(os.popen("exit 0").close(), None) + status = os.popen("exit 42").close() if os.name == 'nt': - self.assertEqual(os.popen("exit 42").close(), 42) + self.assertEqual(status, 42) else: - self.assertEqual(os.popen("exit 42").close(), 42 << 8) + self.assertEqual(os.waitstatus_to_exitcode(status), 42) def test_contextmanager(self): with os.popen("echo hello") as f: diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index ce85f575a0830..aa5c68790f7ca 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -200,8 +200,8 @@ def test_fork(self): ## raise TestFailed("Unexpected output from child: %r" % line) (pid, status) = os.waitpid(pid, 0) - res = status >> 8 - debug("Child (%d) exited with status %d (%d)." % (pid, res, status)) + res = os.waitstatus_to_exitcode(status) + debug("Child (%d) exited with code %d (status %d)." % (pid, res, status)) if res == 1: self.fail("Child raised an unexpected exception in os.setsid()") elif res == 2: diff --git a/Lib/test/test_wait3.py b/Lib/test/test_wait3.py index 6e06049fbdd69..aa166baa400bc 100644 --- a/Lib/test/test_wait3.py +++ b/Lib/test/test_wait3.py @@ -30,8 +30,7 @@ def wait_impl(self, cpid, *, exitcode): time.sleep(0.1) self.assertEqual(spid, cpid) - self.assertEqual(status, exitcode << 8, - "cause = %d, exit = %d" % (status&0xff, status>>8)) + self.assertEqual(os.waitstatus_to_exitcode(status), exitcode) self.assertTrue(rusage) def test_wait3_rusage_initialized(self): diff --git a/Lib/test/test_wait4.py b/Lib/test/test_wait4.py index 6c7ebcb3dd29c..f8d5e13014f0c 100644 --- a/Lib/test/test_wait4.py +++ b/Lib/test/test_wait4.py @@ -29,8 +29,7 @@ def wait_impl(self, cpid, *, exitcode): break time.sleep(0.1) self.assertEqual(spid, cpid) - self.assertEqual(status, exitcode << 8, - "cause = %d, exit = %d" % (status&0xff, status>>8)) + self.assertEqual(os.waitstatus_to_exitcode(status), exitcode) self.assertTrue(rusage) def tearDownModule(): diff --git a/Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst b/Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst new file mode 100644 index 0000000000000..b50816f1a9a4b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst @@ -0,0 +1,2 @@ +Add :func:`os.waitstatus_to_exitcode` function: +convert a wait status to an exit code. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 48dd7a74b3bf2..8ff06feb12ec6 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -8274,6 +8274,62 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #endif /* defined(MS_WINDOWS) */ +#if (defined(WIFEXITED) || defined(MS_WINDOWS)) + +PyDoc_STRVAR(os_waitstatus_to_exitcode__doc__, +"waitstatus_to_exitcode($module, /, status)\n" +"--\n" +"\n" +"Convert a wait status to an exit code.\n" +"\n" +"On Unix:\n" +"\n" +"* If WIFEXITED(status) is true, return WEXITSTATUS(status).\n" +"* If WIFSIGNALED(status) is true, return -WTERMSIG(status).\n" +"* Otherwise, raise a ValueError.\n" +"\n" +"On Windows, return status shifted right by 8 bits.\n" +"\n" +"On Unix, if the process is being traced or if waitpid() was called with\n" +"WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true.\n" +"This function must not be called if WIFSTOPPED(status) is true."); + +#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF \ + {"waitstatus_to_exitcode", (PyCFunction)(void(*)(void))os_waitstatus_to_exitcode, METH_FASTCALL|METH_KEYWORDS, os_waitstatus_to_exitcode__doc__}, + +static PyObject * +os_waitstatus_to_exitcode_impl(PyObject *module, int status); + +static PyObject * +os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"status", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "waitstatus_to_exitcode", 0}; + PyObject *argsbuf[1]; + int status; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { + goto exit; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + status = _PyLong_AsInt(args[0]); + if (status == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = os_waitstatus_to_exitcode_impl(module, status); + +exit: + return return_value; +} + +#endif /* (defined(WIFEXITED) || defined(MS_WINDOWS)) */ + #ifndef OS_TTYNAME_METHODDEF #define OS_TTYNAME_METHODDEF #endif /* !defined(OS_TTYNAME_METHODDEF) */ @@ -8809,4 +8865,8 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF #define OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */ -/*[clinic end generated code: output=5d99f90cead7c0e1 input=a9049054013a1b77]*/ + +#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF + #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF +#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ +/*[clinic end generated code: output=4e28994a729eddf9 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 9ab136b25255d..1adca8ec29dcd 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -13771,6 +13771,84 @@ os__remove_dll_directory_impl(PyObject *module, PyObject *cookie) #endif + +/* Only check if WIFEXITED is available: expect that it comes + with WEXITSTATUS, WIFSIGNALED, etc. + + os.waitstatus_to_exitcode() is implemented in C and not in Python, so + subprocess can safely call it during late Python finalization without + risking that used os attributes were set to None by _PyImport_Cleanup(). */ +#if defined(WIFEXITED) || defined(MS_WINDOWS) +/*[clinic input] +os.waitstatus_to_exitcode + + status: int + +Convert a wait status to an exit code. + +On Unix: + +* If WIFEXITED(status) is true, return WEXITSTATUS(status). +* If WIFSIGNALED(status) is true, return -WTERMSIG(status). +* Otherwise, raise a ValueError. + +On Windows, return status shifted right by 8 bits. + +On Unix, if the process is being traced or if waitpid() was called with +WUNTRACED option, the caller must first check if WIFSTOPPED(status) is true. +This function must not be called if WIFSTOPPED(status) is true. +[clinic start generated code]*/ + +static PyObject * +os_waitstatus_to_exitcode_impl(PyObject *module, int status) +/*[clinic end generated code: output=c7c2265731f79b7a input=edfa5ca5006276fb]*/ +{ +#ifndef MS_WINDOWS + WAIT_TYPE wait_status; + WAIT_STATUS_INT(wait_status) = status; + int exitcode; + if (WIFEXITED(wait_status)) { + exitcode = WEXITSTATUS(wait_status); + /* Sanity check to provide warranty on the function behavior. + It should not occur in practice */ + if (exitcode < 0) { + PyErr_Format(PyExc_ValueError, "invalid WEXITSTATUS: %i", exitcode); + return NULL; + } + } + else if (WIFSIGNALED(wait_status)) { + int signum = WTERMSIG(wait_status); + /* Sanity check to provide warranty on the function behavior. + It should not occurs in practice */ + if (signum <= 0) { + PyErr_Format(PyExc_ValueError, "invalid WTERMSIG: %i", signum); + return NULL; + } + exitcode = -signum; + } else if (WIFSTOPPED(wait_status)) { + /* Status only received if the process is being traced + or if waitpid() was called with WUNTRACED option. */ + int signum = WSTOPSIG(wait_status); + PyErr_Format(PyExc_ValueError, + "process stopped by delivery of signal %i", + signum); + return NULL; + } + else { + PyErr_Format(PyExc_ValueError, "invalid wait status: %i", status); + return NULL; + } + return PyLong_FromLong(exitcode); +#else + /* Windows implementation: see os.waitpid() implementation + which uses _cwait(). */ + int exitcode = (status >> 8); + return PyLong_FromLong(exitcode); +#endif +} +#endif + + static PyMethodDef posix_methods[] = { OS_STAT_METHODDEF @@ -13964,6 +14042,7 @@ static PyMethodDef posix_methods[] = { OS__ADD_DLL_DIRECTORY_METHODDEF OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif + OS_WAITSTATUS_TO_EXITCODE_METHODDEF {NULL, NULL} /* Sentinel */ }; diff --git a/setup.py b/setup.py index 3d3e5ac7db03e..0357a0124f8b8 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,6 @@ import sys import sysconfig from glob import glob -from _bootsubprocess import _waitstatus_to_exitcode as waitstatus_to_exitcode try: @@ -98,7 +97,7 @@ def get_platform(): def run_command(cmd): status = os.system(cmd) - return waitstatus_to_exitcode(status) + return os.waitstatus_to_exitcode(status) # Set common compiler and linker flags derived from the Makefile, From webhook-mailer at python.org Wed Apr 1 19:26:55 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 01 Apr 2020 23:26:55 -0000 Subject: [Python-checkins] bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) (GH-19278) Message-ID: https://github.com/python/cpython/commit/c8dd641b6214bdcf794bab469a51da6843feb770 commit: c8dd641b6214bdcf794bab469a51da6843feb770 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T01:26:47+02:00 summary: bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) (GH-19278) (cherry picked from commit 7c72383f95b0cdedf390726069428d7b69ed2597) Co-authored-by: Victor Stinner files: M Doc/library/os.rst diff --git a/Doc/library/os.rst b/Doc/library/os.rst index e23500d43391f..685d5608f7fbf 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3765,28 +3765,36 @@ used to determine the disposition of a process. Return ``True`` if a core dump was generated for the process, otherwise return ``False``. + This function should be employed only if :func:`WIFSIGNALED` is true. + .. availability:: Unix. .. function:: WIFCONTINUED(status) - Return ``True`` if the process has been continued from a job control stop, - otherwise return ``False``. + Return ``True`` if a stopped child has been resumed by delivery of + :data:`~signal.SIGCONT` (if the process has been continued from a job + control stop), otherwise return ``False``. + + See :data:`WCONTINUED` option. .. availability:: Unix. .. function:: WIFSTOPPED(status) - Return ``True`` if the process has been stopped, otherwise return - ``False``. + Return ``True`` if the process was stopped by delivery of a signal, + otherwise return ``False``. - .. availability:: Unix. + :func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was + done using :data:`WUNTRACED` option or when the process is being traced (see + :manpage:`ptrace(2)`). + .. availability:: Unix. .. function:: WIFSIGNALED(status) - Return ``True`` if the process exited due to a signal, otherwise return + Return ``True`` if the process was terminated by a signal, otherwise return ``False``. .. availability:: Unix. @@ -3794,7 +3802,8 @@ used to determine the disposition of a process. .. function:: WIFEXITED(status) - Return ``True`` if the process exited using the :manpage:`exit(2)` system call, + Return ``True`` if the process exited terminated normally, that is, + by calling ``exit()`` or ``_exit()``, or by returning from ``main()``; otherwise return ``False``. .. availability:: Unix. @@ -3802,8 +3811,9 @@ used to determine the disposition of a process. .. function:: WEXITSTATUS(status) - If ``WIFEXITED(status)`` is true, return the integer parameter to the - :manpage:`exit(2)` system call. Otherwise, the return value is meaningless. + Return the process exit status. + + This function should be employed only if :func:`WIFEXITED` is true. .. availability:: Unix. @@ -3812,12 +3822,16 @@ used to determine the disposition of a process. Return the signal which caused the process to stop. + This function should be employed only if :func:`WIFSTOPPED` is true. + .. availability:: Unix. .. function:: WTERMSIG(status) - Return the signal which caused the process to exit. + Return the number of the signal that caused the process to terminate. + + This function should be employed only if :func:`WIFSIGNALED` is true. .. availability:: Unix. From webhook-mailer at python.org Wed Apr 1 19:27:00 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 01 Apr 2020 23:27:00 -0000 Subject: [Python-checkins] bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) (GH-19277) Message-ID: https://github.com/python/cpython/commit/267afc2ab2014e1e3c6b2ff088350a69b691a544 commit: 267afc2ab2014e1e3c6b2ff088350a69b691a544 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T01:26:55+02:00 summary: bpo-40094: Enhance os.WIFEXITED documentation (GH-19244) (GH-19277) (cherry picked from commit 7c72383f95b0cdedf390726069428d7b69ed2597) Co-authored-by: Victor Stinner files: M Doc/library/os.rst diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 3157b887b535c..77bbf99886345 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -4128,28 +4128,36 @@ used to determine the disposition of a process. Return ``True`` if a core dump was generated for the process, otherwise return ``False``. + This function should be employed only if :func:`WIFSIGNALED` is true. + .. availability:: Unix. .. function:: WIFCONTINUED(status) - Return ``True`` if the process has been continued from a job control stop, - otherwise return ``False``. + Return ``True`` if a stopped child has been resumed by delivery of + :data:`~signal.SIGCONT` (if the process has been continued from a job + control stop), otherwise return ``False``. + + See :data:`WCONTINUED` option. .. availability:: Unix. .. function:: WIFSTOPPED(status) - Return ``True`` if the process has been stopped, otherwise return - ``False``. + Return ``True`` if the process was stopped by delivery of a signal, + otherwise return ``False``. - .. availability:: Unix. + :func:`WIFSTOPPED` only returns ``True`` if the :func:`waitpid` call was + done using :data:`WUNTRACED` option or when the process is being traced (see + :manpage:`ptrace(2)`). + .. availability:: Unix. .. function:: WIFSIGNALED(status) - Return ``True`` if the process exited due to a signal, otherwise return + Return ``True`` if the process was terminated by a signal, otherwise return ``False``. .. availability:: Unix. @@ -4157,7 +4165,8 @@ used to determine the disposition of a process. .. function:: WIFEXITED(status) - Return ``True`` if the process exited using the :manpage:`exit(2)` system call, + Return ``True`` if the process exited terminated normally, that is, + by calling ``exit()`` or ``_exit()``, or by returning from ``main()``; otherwise return ``False``. .. availability:: Unix. @@ -4165,8 +4174,9 @@ used to determine the disposition of a process. .. function:: WEXITSTATUS(status) - If ``WIFEXITED(status)`` is true, return the integer parameter to the - :manpage:`exit(2)` system call. Otherwise, the return value is meaningless. + Return the process exit status. + + This function should be employed only if :func:`WIFEXITED` is true. .. availability:: Unix. @@ -4175,12 +4185,16 @@ used to determine the disposition of a process. Return the signal which caused the process to stop. + This function should be employed only if :func:`WIFSTOPPED` is true. + .. availability:: Unix. .. function:: WTERMSIG(status) - Return the signal which caused the process to exit. + Return the number of the signal that caused the process to terminate. + + This function should be employed only if :func:`WIFSIGNALED` is true. .. availability:: Unix. From webhook-mailer at python.org Wed Apr 1 19:47:59 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 01 Apr 2020 23:47:59 -0000 Subject: [Python-checkins] bpo-40141: Add line and column information to ast.keyword nodes (GH-19283) Message-ID: https://github.com/python/cpython/commit/168660b547d5f683c5d3c60447cfa8c6d620efc3 commit: 168660b547d5f683c5d3c60447cfa8c6d620efc3 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-02T00:47:39+01:00 summary: bpo-40141: Add line and column information to ast.keyword nodes (GH-19283) files: A Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141.8fCRVj.rst M Include/Python-ast.h M Lib/test/test_ast.py M Parser/Python.asdl M Python/Python-ast.c M Python/ast.c diff --git a/Include/Python-ast.h b/Include/Python-ast.h index 7db0037bb0dac..e7afa1e6579e8 100644 --- a/Include/Python-ast.h +++ b/Include/Python-ast.h @@ -427,6 +427,10 @@ struct _arg { struct _keyword { identifier arg; expr_ty value; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; }; struct _alias { @@ -670,8 +674,10 @@ arguments_ty _Py_arguments(asdl_seq * posonlyargs, asdl_seq * args, arg_ty arg_ty _Py_arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena); -#define keyword(a0, a1, a2) _Py_keyword(a0, a1, a2) -keyword_ty _Py_keyword(identifier arg, expr_ty value, PyArena *arena); +#define keyword(a0, a1, a2, a3, a4, a5, a6) _Py_keyword(a0, a1, a2, a3, a4, a5, a6) +keyword_ty _Py_keyword(identifier arg, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); #define alias(a0, a1, a2) _Py_alias(a0, a1, a2) alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); #define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2) diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 3fd982c79ea21..6f86eb954ec55 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -2006,7 +2006,7 @@ def main(): ('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ('Expression', ('Compare', (1, 0, 1, 9), ('Constant', (1, 0, 1, 1), 1, None), [('Lt',), ('Lt',)], [('Constant', (1, 4, 1, 5), 2, None), ('Constant', (1, 8, 1, 9), 3, None)])), -('Expression', ('Call', (1, 0, 1, 17), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Constant', (1, 2, 1, 3), 1, None), ('Constant', (1, 4, 1, 5), 2, None), ('Starred', (1, 10, 1, 12), ('Name', (1, 11, 1, 12), 'd', ('Load',)), ('Load',))], [('keyword', 'c', ('Constant', (1, 8, 1, 9), 3, None)), ('keyword', None, ('Name', (1, 15, 1, 16), 'e', ('Load',)))])), +('Expression', ('Call', (1, 0, 1, 17), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Constant', (1, 2, 1, 3), 1, None), ('Constant', (1, 4, 1, 5), 2, None), ('Starred', (1, 10, 1, 12), ('Name', (1, 11, 1, 12), 'd', ('Load',)), ('Load',))], [('keyword', (1, 6, 1, 7), 'c', ('Constant', (1, 8, 1, 9), 3, None)), ('keyword', (1, 13, 1, 16), None, ('Name', (1, 15, 1, 16), 'e', ('Load',)))])), ('Expression', ('Call', (1, 0, 1, 10), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Starred', (1, 2, 1, 9), ('List', (1, 3, 1, 9), [('Constant', (1, 4, 1, 5), 0, None), ('Constant', (1, 7, 1, 8), 1, None)], ('Load',)), ('Load',))], [])), ('Expression', ('Call', (1, 0, 1, 15), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('GeneratorExp', (1, 1, 1, 15), ('Name', (1, 2, 1, 3), 'a', ('Load',)), [('comprehension', ('Name', (1, 8, 1, 9), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Load',)), [], 0)])], [])), ('Expression', ('Constant', (1, 0, 1, 2), 10, None)), diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141.8fCRVj.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141.8fCRVj.rst new file mode 100644 index 0000000000000..c6ea50e2ce8bc --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141.8fCRVj.rst @@ -0,0 +1,2 @@ +Add column and line information to ``ast.keyword`` nodes. Patch by Pablo +Galindo. diff --git a/Parser/Python.asdl b/Parser/Python.asdl index 11d877d6648a2..f789f1da456e9 100644 --- a/Parser/Python.asdl +++ b/Parser/Python.asdl @@ -114,6 +114,7 @@ module Python -- keyword arguments supplied to call (NULL identifier for **kwargs) keyword = (identifier? arg, expr value) + attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) -- import name with optional 'as' alias. alias = (identifier name, identifier? asname) diff --git a/Python/Python-ast.c b/Python/Python-ast.c index c7c7fda45d851..488276a455546 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -1060,6 +1060,12 @@ static const char * const arg_fields[]={ "type_comment", }; static PyObject* ast2obj_keyword(void*); +static const char * const keyword_attributes[] = { + "lineno", + "col_offset", + "end_lineno", + "end_col_offset", +}; static const char * const keyword_fields[]={ "arg", "value", @@ -1985,9 +1991,14 @@ static int init_types(void) 2, "keyword(identifier? arg, expr value)"); if (!state->keyword_type) return 0; - if (!add_attributes(state->keyword_type, NULL, 0)) return 0; + if (!add_attributes(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) + return 0; + 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, "alias(identifier name, identifier? asname)"); if (!state->alias_type) return 0; @@ -3422,7 +3433,8 @@ arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int } keyword_ty -keyword(identifier arg, expr_ty value, PyArena *arena) +keyword(identifier arg, expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { keyword_ty p; if (!value) { @@ -3435,6 +3447,10 @@ keyword(identifier arg, expr_ty value, PyArena *arena) return NULL; p->arg = arg; p->value = value; + p->lineno = lineno; + p->col_offset = col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } @@ -4954,6 +4970,27 @@ ast2obj_keyword(void* _o) if (PyObject_SetAttr(result, astmodulestate_global->value, value) == -1) goto failed; Py_DECREF(value); + value = ast2obj_int(o->lineno); + if (!value) goto failed; + if (PyObject_SetAttr(result, astmodulestate_global->lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(o->col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, astmodulestate_global->col_offset, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(o->end_lineno); + if (!value) goto failed; + if (PyObject_SetAttr(result, astmodulestate_global->end_lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(o->end_col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, astmodulestate_global->end_col_offset, value) + < 0) + goto failed; + Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -9628,6 +9665,10 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) PyObject* tmp = NULL; identifier arg; expr_ty value; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; if (_PyObject_LookupAttr(obj, astmodulestate_global->arg, &tmp) < 0) { return 1; @@ -9655,7 +9696,63 @@ obj2ast_keyword(PyObject* obj, keyword_ty* out, PyArena* arena) if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = keyword(arg, value, arena); + if (_PyObject_LookupAttr(obj, astmodulestate_global->lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from keyword"); + return 1; + } + else { + int res; + res = obj2ast_int(tmp, &lineno, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, astmodulestate_global->col_offset, &tmp) < 0) + { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from keyword"); + return 1; + } + else { + int res; + res = obj2ast_int(tmp, &col_offset, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, astmodulestate_global->end_lineno, &tmp) < 0) + { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + res = obj2ast_int(tmp, &end_lineno, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, astmodulestate_global->end_col_offset, &tmp) + < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + res = obj2ast_int(tmp, &end_col_offset, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = keyword(arg, value, lineno, col_offset, end_lineno, end_col_offset, + arena); return 0; failed: Py_XDECREF(tmp); diff --git a/Python/ast.c b/Python/ast.c index fb23c026e8c00..550ee03b1ac38 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3013,7 +3013,8 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, e = ast_for_expr(c, CHILD(ch, 1)); if (!e) return NULL; - kw = keyword(NULL, e, c->c_arena); + kw = keyword(NULL, e, chch->n_lineno, chch->n_col_offset, + e->end_lineno, e->end_col_offset, c->c_arena); asdl_seq_SET(keywords, nkeywords++, kw); ndoublestars++; } @@ -3103,7 +3104,9 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, e = ast_for_expr(c, CHILD(ch, 2)); if (!e) return NULL; - kw = keyword(key, e, c->c_arena); + kw = keyword(key, e, chch->n_lineno, chch->n_col_offset, + chch->n_end_lineno, chch->n_end_col_offset, c->c_arena); + if (!kw) return NULL; asdl_seq_SET(keywords, nkeywords++, kw); From webhook-mailer at python.org Wed Apr 1 20:00:10 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 00:00:10 -0000 Subject: [Python-checkins] bpo-40094: mailcap.test() uses waitstatus_to_exitcode() (GH-19287) Message-ID: https://github.com/python/cpython/commit/d57cf557366584539f400db523b555296487e8f5 commit: d57cf557366584539f400db523b555296487e8f5 branch: master author: Victor Stinner committer: GitHub date: 2020-04-02T02:00:06+02:00 summary: bpo-40094: mailcap.test() uses waitstatus_to_exitcode() (GH-19287) mailcap.test() now uses os.waitstatus_to_exitcode() to convert os.system() exit status into an exit code. files: M Lib/mailcap.py diff --git a/Lib/mailcap.py b/Lib/mailcap.py index bd0fc0981c8c6..ae416a8e9fb27 100644 --- a/Lib/mailcap.py +++ b/Lib/mailcap.py @@ -251,6 +251,7 @@ def test(): else: print("Executing:", command) sts = os.system(command) + sts = os.waitstatus_to_exitcode(sts) if sts: print("Exit status:", sts) From webhook-mailer at python.org Wed Apr 1 20:52:24 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 00:52:24 -0000 Subject: [Python-checkins] bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) Message-ID: https://github.com/python/cpython/commit/0b297d4ff1c0e4480ad33acae793fbaf4bf015b4 commit: 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4 branch: master author: Victor Stinner committer: GitHub date: 2020-04-02T02:52:20+02:00 summary: bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) The AbstractBasicAuthHandler class of the urllib.request module uses an inefficient regular expression which can be exploited by an attacker to cause a denial of service. Fix the regex to prevent the catastrophic backtracking. Vulnerability reported by Ben Caller and Matt Schwager. AbstractBasicAuthHandler of urllib.request now parses all WWW-Authenticate HTTP headers and accepts multiple challenges per header: use the realm of the first Basic challenge. Co-Authored-By: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst A Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst M Lib/test/test_urllib2.py M Lib/urllib/request.py diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 8abedaac9850a..e69ac3e2136a2 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1446,40 +1446,64 @@ def test_osx_proxy_bypass(self): bypass = {'exclude_simple': True, 'exceptions': []} self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass)) - def test_basic_auth(self, quote_char='"'): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' % - (quote_char, realm, quote_char)) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) - - def test_basic_auth_with_single_quoted_realm(self): - self.test_basic_auth(quote_char="'") - - def test_basic_auth_with_unquoted_realm(self): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - with self.assertWarns(UserWarning): + def check_basic_auth(self, headers, realm): + with self.subTest(realm=realm, headers=headers): + opener = OpenerDirector() + password_manager = MockPasswordManager() + auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) + body = '\r\n'.join(headers) + '\r\n\r\n' + http_handler = MockHTTPHandler(401, body) + opener.add_handler(auth_handler) + opener.add_handler(http_handler) self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) + realm, http_handler, password_manager, + "http://acme.example.com/protected", + "http://acme.example.com/protected") + + def test_basic_auth(self): + realm = "realm2 at example.com" + realm2 = "realm2 at example.com" + basic = f'Basic realm="{realm}"' + basic2 = f'Basic realm="{realm2}"' + other_no_realm = 'Otherscheme xxx' + digest = (f'Digest realm="{realm2}", ' + f'qop="auth, auth-int", ' + f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", ' + f'opaque="5ccc069c403ebaf9f0171e9517f40e41"') + for realm_str in ( + # test "quote" and 'quote' + f'Basic realm="{realm}"', + f"Basic realm='{realm}'", + + # charset is ignored + f'Basic realm="{realm}", charset="UTF-8"', + + # Multiple challenges per header + f'{basic}, {basic2}', + f'{basic}, {other_no_realm}', + f'{other_no_realm}, {basic}', + f'{basic}, {digest}', + f'{digest}, {basic}', + ): + headers = [f'WWW-Authenticate: {realm_str}'] + self.check_basic_auth(headers, realm) + + # no quote: expect a warning + with support.check_warnings(("Basic Auth Realm was unquoted", + UserWarning)): + headers = [f'WWW-Authenticate: Basic realm={realm}'] + self.check_basic_auth(headers, realm) + + # Multiple headers: one challenge per header. + # Use the first Basic realm. + for challenges in ( + [basic, basic2], + [basic, digest], + [digest, basic], + ): + headers = [f'WWW-Authenticate: {challenge}' + for challenge in challenges] + self.check_basic_auth(headers, realm) def test_proxy_basic_auth(self): opener = OpenerDirector() diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 7fe50535da138..2a3d71554f4bf 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -937,8 +937,15 @@ class AbstractBasicAuthHandler: # allow for double- and single-quoted realm values # (single quotes are a violation of the RFC, but appear in the wild) - rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' - 'realm=(["\']?)([^"\']*)\\2', re.I) + rx = re.compile('(?:^|,)' # start of the string or ',' + '[ \t]*' # optional whitespaces + '([^ \t]+)' # scheme like "Basic" + '[ \t]+' # mandatory whitespaces + # realm=xxx + # realm='xxx' + # realm="xxx" + 'realm=(["\']?)([^"\']*)\\2', + re.I) # XXX could pre-emptively send auth info already accepted (RFC 2617, # end of section 2, and section 1.2 immediately after "credentials" @@ -950,27 +957,51 @@ def __init__(self, password_mgr=None): self.passwd = password_mgr self.add_password = self.passwd.add_password + def _parse_realm(self, header): + # parse WWW-Authenticate header: accept multiple challenges per header + found_challenge = False + for mo in AbstractBasicAuthHandler.rx.finditer(header): + scheme, quote, realm = mo.groups() + if quote not in ['"', "'"]: + warnings.warn("Basic Auth Realm was unquoted", + UserWarning, 3) + + yield (scheme, realm) + + found_challenge = True + + if not found_challenge: + if header: + scheme = header.split()[0] + else: + scheme = '' + yield (scheme, None) + def http_error_auth_reqed(self, authreq, host, req, headers): # host may be an authority (without userinfo) or a URL with an # authority - # XXX could be multiple headers - authreq = headers.get(authreq, None) + headers = headers.get_all(authreq) + if not headers: + # no header found + return - if authreq: - scheme = authreq.split()[0] - if scheme.lower() != 'basic': - raise ValueError("AbstractBasicAuthHandler does not" - " support the following scheme: '%s'" % - scheme) - else: - mo = AbstractBasicAuthHandler.rx.search(authreq) - if mo: - scheme, quote, realm = mo.groups() - if quote not in ['"',"'"]: - warnings.warn("Basic Auth Realm was unquoted", - UserWarning, 2) - if scheme.lower() == 'basic': - return self.retry_http_basic_auth(host, req, realm) + unsupported = None + for header in headers: + for scheme, realm in self._parse_realm(header): + if scheme.lower() != 'basic': + unsupported = scheme + continue + + if realm is not None: + # Use the first matching Basic challenge. + # Ignore following challenges even if they use the Basic + # scheme. + return self.retry_http_basic_auth(host, req, realm) + + if unsupported is not None: + raise ValueError("AbstractBasicAuthHandler does not " + "support the following scheme: %r" + % (scheme,)) def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host) diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst new file mode 100644 index 0000000000000..be80ce79d91ed --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst @@ -0,0 +1,3 @@ +:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` +now parses all WWW-Authenticate HTTP headers and accepts multiple challenges +per header: use the realm of the first Basic challenge. diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst new file mode 100644 index 0000000000000..9f2800581ca5e --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst @@ -0,0 +1,5 @@ +CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class of the +:mod:`urllib.request` module uses an inefficient regular expression which can +be exploited by an attacker to cause a denial of service. Fix the regex to +prevent the catastrophic backtracking. Vulnerability reported by Ben Caller +and Matt Schwager. From webhook-mailer at python.org Wed Apr 1 20:53:38 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 00:53:38 -0000 Subject: [Python-checkins] bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288) Message-ID: https://github.com/python/cpython/commit/224e1c34d677ef42fe665ac008a000d4dcec1398 commit: 224e1c34d677ef42fe665ac008a000d4dcec1398 branch: master author: Victor Stinner committer: GitHub date: 2020-04-02T02:53:33+02:00 summary: bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288) files: A Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 6c2c1acc286c0..9b638ddd00460 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -61,7 +61,7 @@ jobs: variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml @@ -118,7 +118,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 0cc764d025f40..65f23eb62ee09 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -61,7 +61,7 @@ jobs: variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml @@ -118,7 +118,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml diff --git a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst new file mode 100644 index 0000000000000..216925f40e106 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst @@ -0,0 +1 @@ +Update OpenSSL to 1.1.1f in Azure Pipelines. From webhook-mailer at python.org Wed Apr 1 20:55:48 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Thu, 02 Apr 2020 00:55:48 -0000 Subject: [Python-checkins] bpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280) Message-ID: https://github.com/python/cpython/commit/e27916b1fc0364e3627438df48550c16f0b80b82 commit: e27916b1fc0364e3627438df48550c16f0b80b82 branch: master author: Dong-hee Na committer: GitHub date: 2020-04-02T02:55:43+02:00 summary: bpo-37207: Use PEP 590 vectorcall to speed up dict() (GH-19280) files: A Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207.ZTPmKJ.rst M Objects/dictobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207.ZTPmKJ.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207.ZTPmKJ.rst new file mode 100644 index 0000000000000..cb5e9ff5b8f8e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207.ZTPmKJ.rst @@ -0,0 +1,2 @@ +Speed up calls to ``dict()`` by using the :pep:`590` ``vectorcall`` calling +convention. diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 2ca32b5a9d2a3..e5f7005d49f23 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -3342,6 +3342,38 @@ dict_init(PyObject *self, PyObject *args, PyObject *kwds) return dict_update_common(self, args, kwds, "dict"); } +static PyObject * +dict_vectorcall(PyObject *type, PyObject * const*args, + size_t nargsf, PyObject *kwnames) +{ + assert(PyType_Check(type)); + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); + if (!_PyArg_CheckPositional("dict", nargs, 0, 1)) { + return NULL; + } + + PyObject *self = dict_new((PyTypeObject *)type, NULL, NULL); + if (self == NULL) { + return NULL; + } + if (nargs == 1) { + if (dict_update_arg(self, args[0]) < 0) { + Py_DECREF(self); + return NULL; + } + args++; + } + if (kwnames != NULL) { + for (Py_ssize_t i = 0; i < PyTuple_GET_SIZE(kwnames); i++) { + if (PyDict_SetItem(self, PyTuple_GET_ITEM(kwnames, i), args[i]) < 0) { + Py_DECREF(self); + return NULL; + } + } + } + return self; +} + static PyObject * dict_iter(PyDictObject *dict) { @@ -3400,6 +3432,7 @@ PyTypeObject PyDict_Type = { PyType_GenericAlloc, /* tp_alloc */ dict_new, /* tp_new */ PyObject_GC_Del, /* tp_free */ + .tp_vectorcall = dict_vectorcall, }; PyObject * From webhook-mailer at python.org Wed Apr 1 21:23:19 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Apr 2020 01:23:19 -0000 Subject: [Python-checkins] bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288) Message-ID: https://github.com/python/cpython/commit/8e069fc2ee19f40ce97e61e880bb409ed415d98c commit: 8e069fc2ee19f40ce97e61e880bb409ed415d98c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-01T18:23:15-07:00 summary: bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288) (cherry picked from commit 224e1c34d677ef42fe665ac008a000d4dcec1398) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 7b3af5dc480b2..0a3e27b133cae 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -61,7 +61,7 @@ jobs: variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml @@ -118,7 +118,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 73f4b96a9bf6e..5cf4dd7de1fc4 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -61,7 +61,7 @@ jobs: variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml @@ -118,7 +118,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml diff --git a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst new file mode 100644 index 0000000000000..216925f40e106 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst @@ -0,0 +1 @@ +Update OpenSSL to 1.1.1f in Azure Pipelines. From webhook-mailer at python.org Wed Apr 1 21:26:17 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Apr 2020 01:26:17 -0000 Subject: [Python-checkins] bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288) Message-ID: https://github.com/python/cpython/commit/40fff1ff04aa5bc2cf1b965d573b87c48e4da8cc commit: 40fff1ff04aa5bc2cf1b965d573b87c48e4da8cc branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-01T18:26:09-07:00 summary: bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288) (cherry picked from commit 224e1c34d677ef42fe665ac008a000d4dcec1398) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst M .azure-pipelines/ci.yml M .azure-pipelines/pr.yml diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index 6c2c1acc286c0..9b638ddd00460 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -61,7 +61,7 @@ jobs: variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml @@ -118,7 +118,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index 0cc764d025f40..65f23eb62ee09 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -61,7 +61,7 @@ jobs: variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml @@ -118,7 +118,7 @@ jobs: variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1d + openssl_version: 1.1.1f steps: - template: ./posix-steps.yml diff --git a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst new file mode 100644 index 0000000000000..216925f40e106 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst @@ -0,0 +1 @@ +Update OpenSSL to 1.1.1f in Azure Pipelines. From webhook-mailer at python.org Wed Apr 1 21:42:10 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 01:42:10 -0000 Subject: [Python-checkins] bpo-40094: CGIHTTPRequestHandler logs exit code (GH-19285) Message-ID: https://github.com/python/cpython/commit/9a679a0e47d58aa73b7747d4e16140048c10baf5 commit: 9a679a0e47d58aa73b7747d4e16140048c10baf5 branch: master author: Victor Stinner committer: GitHub date: 2020-04-02T03:42:05+02:00 summary: bpo-40094: CGIHTTPRequestHandler logs exit code (GH-19285) CGIHTTPRequestHandler of http.server now logs the CGI script exit code, rather than the CGI script exit status of os.waitpid(). For example, if the script is killed by signal 11, it now logs: "CGI script exit code -11." files: A Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst M Lib/http/server.py diff --git a/Lib/http/server.py b/Lib/http/server.py index 2d74b95586cff..fa204fbc15e3d 100644 --- a/Lib/http/server.py +++ b/Lib/http/server.py @@ -1164,8 +1164,9 @@ def run_cgi(self): while select.select([self.rfile], [], [], 0)[0]: if not self.rfile.read(1): break - if sts: - self.log_error("CGI script exit status %#x", sts) + exitcode = os.waitstatus_to_exitcode(sts) + if exitcode: + self.log_error(f"CGI script exit code {exitcode}") return # Child try: diff --git a/Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst b/Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst new file mode 100644 index 0000000000000..ba13d3cdf4a8d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst @@ -0,0 +1,3 @@ +CGIHTTPRequestHandler of http.server now logs the CGI script exit code, +rather than the CGI script exit status of os.waitpid(). For example, if the +script is killed by signal 11, it now logs: "CGI script exit code -11." From webhook-mailer at python.org Wed Apr 1 21:42:51 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 01:42:51 -0000 Subject: [Python-checkins] bpo-40094: Fix which.py script exit code (GH-19286) Message-ID: https://github.com/python/cpython/commit/e7c98f08e228e9f6e139d61e3e5d0a5018a38f0b commit: e7c98f08e228e9f6e139d61e3e5d0a5018a38f0b branch: master author: Victor Stinner committer: GitHub date: 2020-04-02T03:42:47+02:00 summary: bpo-40094: Fix which.py script exit code (GH-19286) It now uses os.waitstatus_to_exitcode() to convert os.system() exit status into an exit code. files: A Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst M Tools/scripts/which.py diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst new file mode 100644 index 0000000000000..042550da8bc7f --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst @@ -0,0 +1,3 @@ +Fix ``which.py`` script exit code: it now uses +:func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status +into an exit code. diff --git a/Tools/scripts/which.py b/Tools/scripts/which.py index df54ce032cbc8..b42e07c74ecac 100755 --- a/Tools/scripts/which.py +++ b/Tools/scripts/which.py @@ -49,6 +49,7 @@ def main(): msg(filename + ': not executable') if longlist: sts = os.system('ls ' + longlist + ' ' + filename) + sts = os.waitstatus_to_exitcode(sts) if sts: msg('"ls -l" exit status: ' + repr(sts)) if not ident: msg(prog + ': not found') From webhook-mailer at python.org Wed Apr 1 22:46:53 2020 From: webhook-mailer at python.org (Kyle Stanley) Date: Thu, 02 Apr 2020 02:46:53 -0000 Subject: [Python-checkins] bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282) Message-ID: https://github.com/python/cpython/commit/8ec7cb53f0705509bac20c96d19fdbd9baec0cb2 commit: 8ec7cb53f0705509bac20c96d19fdbd9baec0cb2 branch: master author: Kyle Stanley committer: GitHub date: 2020-04-02T04:46:44+02:00 summary: bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282) Call explicitly self.loop.shutdown_default_executor(). files: M Lib/test/test_asyncio/test_events.py diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 4bdf82ef175a0..1f71c1f0979e0 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -365,6 +365,8 @@ def run(): f2 = self.loop.run_in_executor(None, run) f2.cancel() + self.loop.run_until_complete( + self.loop.shutdown_default_executor()) self.loop.close() self.loop.call_soon = patched_call_soon self.loop.call_soon_threadsafe = patched_call_soon From webhook-mailer at python.org Thu Apr 2 06:16:00 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Apr 2020 10:16:00 -0000 Subject: [Python-checkins] bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19296) Message-ID: https://github.com/python/cpython/commit/ea9e240aa02372440be8024acb110371f69c9d41 commit: ea9e240aa02372440be8024acb110371f69c9d41 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T12:15:55+02:00 summary: bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19296) The AbstractBasicAuthHandler class of the urllib.request module uses an inefficient regular expression which can be exploited by an attacker to cause a denial of service. Fix the regex to prevent the catastrophic backtracking. Vulnerability reported by Ben Caller and Matt Schwager. AbstractBasicAuthHandler of urllib.request now parses all WWW-Authenticate HTTP headers and accepts multiple challenges per header: use the realm of the first Basic challenge. Co-Authored-By: Serhiy Storchaka Co-authored-by: Victor Stinner (cherry picked from commit 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4) files: A Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst A Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst M Lib/test/test_urllib2.py M Lib/urllib/request.py diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 61e3ecc612d6c..091b3979aa680 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1444,40 +1444,64 @@ def test_osx_proxy_bypass(self): bypass = {'exclude_simple': True, 'exceptions': []} self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass)) - def test_basic_auth(self, quote_char='"'): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' % - (quote_char, realm, quote_char)) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) - - def test_basic_auth_with_single_quoted_realm(self): - self.test_basic_auth(quote_char="'") - - def test_basic_auth_with_unquoted_realm(self): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - with self.assertWarns(UserWarning): + def check_basic_auth(self, headers, realm): + with self.subTest(realm=realm, headers=headers): + opener = OpenerDirector() + password_manager = MockPasswordManager() + auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) + body = '\r\n'.join(headers) + '\r\n\r\n' + http_handler = MockHTTPHandler(401, body) + opener.add_handler(auth_handler) + opener.add_handler(http_handler) self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) + realm, http_handler, password_manager, + "http://acme.example.com/protected", + "http://acme.example.com/protected") + + def test_basic_auth(self): + realm = "realm2 at example.com" + realm2 = "realm2 at example.com" + basic = f'Basic realm="{realm}"' + basic2 = f'Basic realm="{realm2}"' + other_no_realm = 'Otherscheme xxx' + digest = (f'Digest realm="{realm2}", ' + f'qop="auth, auth-int", ' + f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", ' + f'opaque="5ccc069c403ebaf9f0171e9517f40e41"') + for realm_str in ( + # test "quote" and 'quote' + f'Basic realm="{realm}"', + f"Basic realm='{realm}'", + + # charset is ignored + f'Basic realm="{realm}", charset="UTF-8"', + + # Multiple challenges per header + f'{basic}, {basic2}', + f'{basic}, {other_no_realm}', + f'{other_no_realm}, {basic}', + f'{basic}, {digest}', + f'{digest}, {basic}', + ): + headers = [f'WWW-Authenticate: {realm_str}'] + self.check_basic_auth(headers, realm) + + # no quote: expect a warning + with support.check_warnings(("Basic Auth Realm was unquoted", + UserWarning)): + headers = [f'WWW-Authenticate: Basic realm={realm}'] + self.check_basic_auth(headers, realm) + + # Multiple headers: one challenge per header. + # Use the first Basic realm. + for challenges in ( + [basic, basic2], + [basic, digest], + [digest, basic], + ): + headers = [f'WWW-Authenticate: {challenge}' + for challenge in challenges] + self.check_basic_auth(headers, realm) def test_proxy_basic_auth(self): opener = OpenerDirector() diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index fd91b9d1d0beb..e44073886a6cd 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -945,8 +945,15 @@ class AbstractBasicAuthHandler: # allow for double- and single-quoted realm values # (single quotes are a violation of the RFC, but appear in the wild) - rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' - 'realm=(["\']?)([^"\']*)\\2', re.I) + rx = re.compile('(?:^|,)' # start of the string or ',' + '[ \t]*' # optional whitespaces + '([^ \t]+)' # scheme like "Basic" + '[ \t]+' # mandatory whitespaces + # realm=xxx + # realm='xxx' + # realm="xxx" + 'realm=(["\']?)([^"\']*)\\2', + re.I) # XXX could pre-emptively send auth info already accepted (RFC 2617, # end of section 2, and section 1.2 immediately after "credentials" @@ -958,27 +965,51 @@ def __init__(self, password_mgr=None): self.passwd = password_mgr self.add_password = self.passwd.add_password + def _parse_realm(self, header): + # parse WWW-Authenticate header: accept multiple challenges per header + found_challenge = False + for mo in AbstractBasicAuthHandler.rx.finditer(header): + scheme, quote, realm = mo.groups() + if quote not in ['"', "'"]: + warnings.warn("Basic Auth Realm was unquoted", + UserWarning, 3) + + yield (scheme, realm) + + found_challenge = True + + if not found_challenge: + if header: + scheme = header.split()[0] + else: + scheme = '' + yield (scheme, None) + def http_error_auth_reqed(self, authreq, host, req, headers): # host may be an authority (without userinfo) or a URL with an # authority - # XXX could be multiple headers - authreq = headers.get(authreq, None) + headers = headers.get_all(authreq) + if not headers: + # no header found + return - if authreq: - scheme = authreq.split()[0] - if scheme.lower() != 'basic': - raise ValueError("AbstractBasicAuthHandler does not" - " support the following scheme: '%s'" % - scheme) - else: - mo = AbstractBasicAuthHandler.rx.search(authreq) - if mo: - scheme, quote, realm = mo.groups() - if quote not in ['"',"'"]: - warnings.warn("Basic Auth Realm was unquoted", - UserWarning, 2) - if scheme.lower() == 'basic': - return self.retry_http_basic_auth(host, req, realm) + unsupported = None + for header in headers: + for scheme, realm in self._parse_realm(header): + if scheme.lower() != 'basic': + unsupported = scheme + continue + + if realm is not None: + # Use the first matching Basic challenge. + # Ignore following challenges even if they use the Basic + # scheme. + return self.retry_http_basic_auth(host, req, realm) + + if unsupported is not None: + raise ValueError("AbstractBasicAuthHandler does not " + "support the following scheme: %r" + % (scheme,)) def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host) diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst new file mode 100644 index 0000000000000..be80ce79d91ed --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst @@ -0,0 +1,3 @@ +:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` +now parses all WWW-Authenticate HTTP headers and accepts multiple challenges +per header: use the realm of the first Basic challenge. diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst new file mode 100644 index 0000000000000..9f2800581ca5e --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst @@ -0,0 +1,5 @@ +CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class of the +:mod:`urllib.request` module uses an inefficient regular expression which can +be exploited by an attacker to cause a denial of service. Fix the regex to +prevent the catastrophic backtracking. Vulnerability reported by Ben Caller +and Matt Schwager. From webhook-mailer at python.org Thu Apr 2 06:16:21 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Apr 2020 10:16:21 -0000 Subject: [Python-checkins] bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19297) Message-ID: https://github.com/python/cpython/commit/b57a73694e26e8b2391731b5ee0b1be59437388e commit: b57a73694e26e8b2391731b5ee0b1be59437388e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T12:16:17+02:00 summary: bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19297) The AbstractBasicAuthHandler class of the urllib.request module uses an inefficient regular expression which can be exploited by an attacker to cause a denial of service. Fix the regex to prevent the catastrophic backtracking. Vulnerability reported by Ben Caller and Matt Schwager. AbstractBasicAuthHandler of urllib.request now parses all WWW-Authenticate HTTP headers and accepts multiple challenges per header: use the realm of the first Basic challenge. Co-Authored-By: Serhiy Storchaka Co-authored-by: Victor Stinner (cherry picked from commit 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4) files: A Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst A Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst M Lib/test/test_urllib2.py M Lib/urllib/request.py diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 876fcd4199fb9..fe9a32bfdabf0 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1445,40 +1445,64 @@ def test_osx_proxy_bypass(self): bypass = {'exclude_simple': True, 'exceptions': []} self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass)) - def test_basic_auth(self, quote_char='"'): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' % - (quote_char, realm, quote_char)) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) - - def test_basic_auth_with_single_quoted_realm(self): - self.test_basic_auth(quote_char="'") - - def test_basic_auth_with_unquoted_realm(self): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - with self.assertWarns(UserWarning): + def check_basic_auth(self, headers, realm): + with self.subTest(realm=realm, headers=headers): + opener = OpenerDirector() + password_manager = MockPasswordManager() + auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) + body = '\r\n'.join(headers) + '\r\n\r\n' + http_handler = MockHTTPHandler(401, body) + opener.add_handler(auth_handler) + opener.add_handler(http_handler) self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) + realm, http_handler, password_manager, + "http://acme.example.com/protected", + "http://acme.example.com/protected") + + def test_basic_auth(self): + realm = "realm2 at example.com" + realm2 = "realm2 at example.com" + basic = f'Basic realm="{realm}"' + basic2 = f'Basic realm="{realm2}"' + other_no_realm = 'Otherscheme xxx' + digest = (f'Digest realm="{realm2}", ' + f'qop="auth, auth-int", ' + f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", ' + f'opaque="5ccc069c403ebaf9f0171e9517f40e41"') + for realm_str in ( + # test "quote" and 'quote' + f'Basic realm="{realm}"', + f"Basic realm='{realm}'", + + # charset is ignored + f'Basic realm="{realm}", charset="UTF-8"', + + # Multiple challenges per header + f'{basic}, {basic2}', + f'{basic}, {other_no_realm}', + f'{other_no_realm}, {basic}', + f'{basic}, {digest}', + f'{digest}, {basic}', + ): + headers = [f'WWW-Authenticate: {realm_str}'] + self.check_basic_auth(headers, realm) + + # no quote: expect a warning + with support.check_warnings(("Basic Auth Realm was unquoted", + UserWarning)): + headers = [f'WWW-Authenticate: Basic realm={realm}'] + self.check_basic_auth(headers, realm) + + # Multiple headers: one challenge per header. + # Use the first Basic realm. + for challenges in ( + [basic, basic2], + [basic, digest], + [digest, basic], + ): + headers = [f'WWW-Authenticate: {challenge}' + for challenge in challenges] + self.check_basic_auth(headers, realm) def test_proxy_basic_auth(self): opener = OpenerDirector() diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 0d3f9670fef40..4f42919b09eae 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -944,8 +944,15 @@ class AbstractBasicAuthHandler: # allow for double- and single-quoted realm values # (single quotes are a violation of the RFC, but appear in the wild) - rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' - 'realm=(["\']?)([^"\']*)\\2', re.I) + rx = re.compile('(?:^|,)' # start of the string or ',' + '[ \t]*' # optional whitespaces + '([^ \t]+)' # scheme like "Basic" + '[ \t]+' # mandatory whitespaces + # realm=xxx + # realm='xxx' + # realm="xxx" + 'realm=(["\']?)([^"\']*)\\2', + re.I) # XXX could pre-emptively send auth info already accepted (RFC 2617, # end of section 2, and section 1.2 immediately after "credentials" @@ -957,27 +964,51 @@ def __init__(self, password_mgr=None): self.passwd = password_mgr self.add_password = self.passwd.add_password + def _parse_realm(self, header): + # parse WWW-Authenticate header: accept multiple challenges per header + found_challenge = False + for mo in AbstractBasicAuthHandler.rx.finditer(header): + scheme, quote, realm = mo.groups() + if quote not in ['"', "'"]: + warnings.warn("Basic Auth Realm was unquoted", + UserWarning, 3) + + yield (scheme, realm) + + found_challenge = True + + if not found_challenge: + if header: + scheme = header.split()[0] + else: + scheme = '' + yield (scheme, None) + def http_error_auth_reqed(self, authreq, host, req, headers): # host may be an authority (without userinfo) or a URL with an # authority - # XXX could be multiple headers - authreq = headers.get(authreq, None) + headers = headers.get_all(authreq) + if not headers: + # no header found + return - if authreq: - scheme = authreq.split()[0] - if scheme.lower() != 'basic': - raise ValueError("AbstractBasicAuthHandler does not" - " support the following scheme: '%s'" % - scheme) - else: - mo = AbstractBasicAuthHandler.rx.search(authreq) - if mo: - scheme, quote, realm = mo.groups() - if quote not in ['"',"'"]: - warnings.warn("Basic Auth Realm was unquoted", - UserWarning, 2) - if scheme.lower() == 'basic': - return self.retry_http_basic_auth(host, req, realm) + unsupported = None + for header in headers: + for scheme, realm in self._parse_realm(header): + if scheme.lower() != 'basic': + unsupported = scheme + continue + + if realm is not None: + # Use the first matching Basic challenge. + # Ignore following challenges even if they use the Basic + # scheme. + return self.retry_http_basic_auth(host, req, realm) + + if unsupported is not None: + raise ValueError("AbstractBasicAuthHandler does not " + "support the following scheme: %r" + % (scheme,)) def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host) diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst new file mode 100644 index 0000000000000..be80ce79d91ed --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst @@ -0,0 +1,3 @@ +:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` +now parses all WWW-Authenticate HTTP headers and accepts multiple challenges +per header: use the realm of the first Basic challenge. diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst new file mode 100644 index 0000000000000..9f2800581ca5e --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst @@ -0,0 +1,5 @@ +CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class of the +:mod:`urllib.request` module uses an inefficient regular expression which can +be exploited by an attacker to cause a denial of service. Fix the regex to +prevent the catastrophic backtracking. Vulnerability reported by Ben Caller +and Matt Schwager. From webhook-mailer at python.org Thu Apr 2 08:35:27 2020 From: webhook-mailer at python.org (Hai Shi) Date: Thu, 02 Apr 2020 12:35:27 -0000 Subject: [Python-checkins] bpo-1635741: Port resource extension module to multiphase initialization (PEP 489) (GH-19252) Message-ID: https://github.com/python/cpython/commit/45f7008a66a30cdf749ec03e580bd2692be9a8df commit: 45f7008a66a30cdf749ec03e580bd2692be9a8df branch: master author: Hai Shi committer: GitHub date: 2020-04-02T14:35:08+02:00 summary: bpo-1635741: Port resource extension module to multiphase initialization (PEP 489) (GH-19252) Fix also reference leaks on error. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-1635741.bhGWam.rst M Modules/resource.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-1635741.bhGWam.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-1635741.bhGWam.rst new file mode 100644 index 0000000000000..cacfed2f9fdb5 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-1635741.bhGWam.rst @@ -0,0 +1 @@ +Port :mod:`resource` to multiphase initialization (:pep:`489`). diff --git a/Modules/resource.c b/Modules/resource.c index afde03c6c7e55..ddbf80be9c69e 100644 --- a/Modules/resource.c +++ b/Modules/resource.c @@ -340,155 +340,174 @@ resource_methods[] = { /* Module initialization */ -static struct PyModuleDef resourcemodule = { - PyModuleDef_HEAD_INIT, - "resource", - NULL, - -1, - resource_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit_resource(void) +static int +resource_exec(PyObject *module) { - PyObject *m, *v; - - /* Create the module and add the functions */ - m = PyModule_Create(&resourcemodule); - if (m == NULL) - return NULL; +#define ADD_INT(module, value) \ + do { \ + if (PyModule_AddIntConstant(module, #value, value) < 0) { \ + return -1; \ + } \ + } while (0) /* Add some symbolic constants to the module */ Py_INCREF(PyExc_OSError); - PyModule_AddObject(m, "error", PyExc_OSError); + if (PyModule_AddObject(module, "error", PyExc_OSError) < 0) { + Py_DECREF(PyExc_OSError); + return -1; + } if (!initialized) { if (PyStructSequence_InitType2(&StructRUsageType, &struct_rusage_desc) < 0) - return NULL; + return -1; } - Py_INCREF(&StructRUsageType); - PyModule_AddObject(m, "struct_rusage", - (PyObject*) &StructRUsageType); + if(PyModule_AddType(module, &StructRUsageType) < 0) { + return -1; + } /* insert constants */ #ifdef RLIMIT_CPU - PyModule_AddIntMacro(m, RLIMIT_CPU); + ADD_INT(module, RLIMIT_CPU); #endif #ifdef RLIMIT_FSIZE - PyModule_AddIntMacro(m, RLIMIT_FSIZE); + ADD_INT(module, RLIMIT_FSIZE); #endif #ifdef RLIMIT_DATA - PyModule_AddIntMacro(m, RLIMIT_DATA); + ADD_INT(module, RLIMIT_DATA); #endif #ifdef RLIMIT_STACK - PyModule_AddIntMacro(m, RLIMIT_STACK); + ADD_INT(module, RLIMIT_STACK); #endif #ifdef RLIMIT_CORE - PyModule_AddIntMacro(m, RLIMIT_CORE); + ADD_INT(module, RLIMIT_CORE); #endif #ifdef RLIMIT_NOFILE - PyModule_AddIntMacro(m, RLIMIT_NOFILE); + ADD_INT(module, RLIMIT_NOFILE); #endif #ifdef RLIMIT_OFILE - PyModule_AddIntMacro(m, RLIMIT_OFILE); + ADD_INT(module, RLIMIT_OFILE); #endif #ifdef RLIMIT_VMEM - PyModule_AddIntMacro(m, RLIMIT_VMEM); + ADD_INT(module, RLIMIT_VMEM); #endif #ifdef RLIMIT_AS - PyModule_AddIntMacro(m, RLIMIT_AS); + ADD_INT(module, RLIMIT_AS); #endif #ifdef RLIMIT_RSS - PyModule_AddIntMacro(m, RLIMIT_RSS); + ADD_INT(module, RLIMIT_RSS); #endif #ifdef RLIMIT_NPROC - PyModule_AddIntMacro(m, RLIMIT_NPROC); + ADD_INT(module, RLIMIT_NPROC); #endif #ifdef RLIMIT_MEMLOCK - PyModule_AddIntMacro(m, RLIMIT_MEMLOCK); + ADD_INT(module, RLIMIT_MEMLOCK); #endif #ifdef RLIMIT_SBSIZE - PyModule_AddIntMacro(m, RLIMIT_SBSIZE); + ADD_INT(module, RLIMIT_SBSIZE); #endif /* Linux specific */ #ifdef RLIMIT_MSGQUEUE - PyModule_AddIntMacro(m, RLIMIT_MSGQUEUE); + ADD_INT(module, RLIMIT_MSGQUEUE); #endif #ifdef RLIMIT_NICE - PyModule_AddIntMacro(m, RLIMIT_NICE); + ADD_INT(module, RLIMIT_NICE); #endif #ifdef RLIMIT_RTPRIO - PyModule_AddIntMacro(m, RLIMIT_RTPRIO); + ADD_INT(module, RLIMIT_RTPRIO); #endif #ifdef RLIMIT_RTTIME - PyModule_AddIntMacro(m, RLIMIT_RTTIME); + ADD_INT(module, RLIMIT_RTTIME); #endif #ifdef RLIMIT_SIGPENDING - PyModule_AddIntMacro(m, RLIMIT_SIGPENDING); + ADD_INT(module, RLIMIT_SIGPENDING); #endif /* target */ #ifdef RUSAGE_SELF - PyModule_AddIntMacro(m, RUSAGE_SELF); + ADD_INT(module, RUSAGE_SELF); #endif #ifdef RUSAGE_CHILDREN - PyModule_AddIntMacro(m, RUSAGE_CHILDREN); + ADD_INT(module, RUSAGE_CHILDREN); #endif #ifdef RUSAGE_BOTH - PyModule_AddIntMacro(m, RUSAGE_BOTH); + ADD_INT(module, RUSAGE_BOTH); #endif #ifdef RUSAGE_THREAD - PyModule_AddIntMacro(m, RUSAGE_THREAD); + ADD_INT(module, RUSAGE_THREAD); #endif /* FreeBSD specific */ #ifdef RLIMIT_SWAP - PyModule_AddIntMacro(m, RLIMIT_SWAP); + ADD_INT(module, RLIMIT_SWAP); #endif #ifdef RLIMIT_SBSIZE - PyModule_AddIntMacro(m, RLIMIT_SBSIZE); + ADD_INT(module, RLIMIT_SBSIZE); #endif #ifdef RLIMIT_NPTS - PyModule_AddIntMacro(m, RLIMIT_NPTS); + ADD_INT(module, RLIMIT_NPTS); #endif + PyObject *v; if (sizeof(RLIM_INFINITY) > sizeof(long)) { v = PyLong_FromLongLong((long long) RLIM_INFINITY); } else { v = PyLong_FromLong((long) RLIM_INFINITY); } - if (v) { - PyModule_AddObject(m, "RLIM_INFINITY", v); + if (!v) { + return -1; + } + + if (PyModule_AddObject(module, "RLIM_INFINITY", v) < 0) { + Py_DECREF(v); + return -1; } + initialized = 1; - return m; + return 0; + +#undef ADD_INT +} + +static struct PyModuleDef_Slot resource_slots[] = { + {Py_mod_exec, resource_exec}, + {0, NULL} +}; + +static struct PyModuleDef resourcemodule = { + PyModuleDef_HEAD_INIT, + .m_name = "resource", + .m_size = 0, + .m_methods = resource_methods, + .m_slots = resource_slots, +}; + +PyMODINIT_FUNC +PyInit_resource(void) +{ + return PyModuleDef_Init(&resourcemodule); } From webhook-mailer at python.org Thu Apr 2 14:00:57 2020 From: webhook-mailer at python.org (Hai Shi) Date: Thu, 02 Apr 2020 18:00:57 -0000 Subject: [Python-checkins] bpo-1635741: Fix refleak in _locale init error handling (GH-19307) Message-ID: https://github.com/python/cpython/commit/7a6f3bcc43ed729f8038524528c0b326b5610506 commit: 7a6f3bcc43ed729f8038524528c0b326b5610506 branch: master author: Hai Shi committer: GitHub date: 2020-04-02T20:00:47+02:00 summary: bpo-1635741: Fix refleak in _locale init error handling (GH-19307) files: M Modules/_localemodule.c diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 0ce5dc5e7777e..5bf6638ed2a64 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -726,40 +726,49 @@ static struct PyMethodDef PyLocale_Methods[] = { }; static int -_locale_exec(PyObject *m) +_locale_exec(PyObject *module) { #ifdef HAVE_LANGINFO_H int i; #endif +#define ADD_INT(module, value) \ + do { \ + if (PyModule_AddIntConstant(module, #value, value) < 0) { \ + return -1; \ + } \ + } while (0) - PyModule_AddIntMacro(m, LC_CTYPE); - PyModule_AddIntMacro(m, LC_TIME); - PyModule_AddIntMacro(m, LC_COLLATE); - PyModule_AddIntMacro(m, LC_MONETARY); + ADD_INT(module, LC_CTYPE); + ADD_INT(module, LC_TIME); + ADD_INT(module, LC_COLLATE); + ADD_INT(module, LC_MONETARY); #ifdef LC_MESSAGES - PyModule_AddIntMacro(m, LC_MESSAGES); + ADD_INT(module, LC_MESSAGES); #endif /* LC_MESSAGES */ - PyModule_AddIntMacro(m, LC_NUMERIC); - PyModule_AddIntMacro(m, LC_ALL); - PyModule_AddIntMacro(m, CHAR_MAX); + ADD_INT(module, LC_NUMERIC); + ADD_INT(module, LC_ALL); + ADD_INT(module, CHAR_MAX); - _locale_state *state = get_locale_state(m); + _locale_state *state = get_locale_state(module); state->Error = PyErr_NewException("locale.Error", NULL, NULL); if (state->Error == NULL) { return -1; } - Py_INCREF(get_locale_state(m)->Error); - if (PyModule_AddObject(m, "Error", get_locale_state(m)->Error) < 0) { - Py_DECREF(get_locale_state(m)->Error); + Py_INCREF(get_locale_state(module)->Error); + if (PyModule_AddObject(module, "Error", get_locale_state(module)->Error) < 0) { + Py_DECREF(get_locale_state(module)->Error); return -1; } #ifdef HAVE_LANGINFO_H for (i = 0; langinfo_constants[i].name; i++) { - PyModule_AddIntConstant(m, langinfo_constants[i].name, - langinfo_constants[i].value); + if (PyModule_AddIntConstant(module, + langinfo_constants[i].name, + langinfo_constants[i].value) < 0) { + return -1; + } } #endif @@ -767,6 +776,8 @@ _locale_exec(PyObject *m) return -1; } return 0; + +#undef ADD_INT } static struct PyModuleDef_Slot _locale_slots[] = { From webhook-mailer at python.org Thu Apr 2 15:00:28 2020 From: webhook-mailer at python.org (Derek Keeler) Date: Thu, 02 Apr 2020 19:00:28 -0000 Subject: [Python-checkins] bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131) Message-ID: https://github.com/python/cpython/commit/45217af29c7f380089af17beb48a5ea0560bbb9d commit: 45217af29c7f380089af17beb48a5ea0560bbb9d branch: master author: Derek Keeler committer: GitHub date: 2020-04-02T12:00:21-07:00 summary: bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131) files: M Doc/using/venv-create.inc M Lib/venv/scripts/common/Activate.ps1 diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index 6c6617dc158f7..c39048d618812 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -83,6 +83,17 @@ The command, if run with ``-h``, will show the available options:: particular note is that double-clicking ``python.exe`` in File Explorer will resolve the symlink eagerly and ignore the virtual environment. +.. note:: + On Microsoft Windows, it may be required to enable the ``Activate.ps1`` + script by setting the execution policy for the user. You can do this by + issuing the following PowerShell command: + + PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + + See `About Execution Policies + `_ + for more information. + The created ``pyvenv.cfg`` file also includes the ``include-system-site-packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-packages`` option, ``false`` otherwise. diff --git a/Lib/venv/scripts/common/Activate.ps1 b/Lib/venv/scripts/common/Activate.ps1 index 98cb1b85d11c6..b8245b1bbe5c8 100644 --- a/Lib/venv/scripts/common/Activate.ps1 +++ b/Lib/venv/scripts/common/Activate.ps1 @@ -1,6 +1,6 @@ <# .Synopsis -Activate a Python virtual environment for the current Powershell session. +Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the @@ -37,6 +37,15 @@ Activates the Python virtual environment that contains the Activate.ps1 script, and prefixes the current prompt with the specified string (surrounded in parentheses) while the virtual environment is active. +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +ttps:/go.microsoft.com/fwlink/?LinkID=135170 #> Param( @@ -137,7 +146,7 @@ function Get-PyVenvConfig( $val = $keyval[1] # Remove extraneous quotations around a string value. - if ("'""".Contains($val.Substring(0,1))) { + if ("'""".Contains($val.Substring(0, 1))) { $val = $val.Substring(1, $val.Length - 2) } @@ -165,7 +174,8 @@ Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" # VenvExecDir if specified on the command line. if ($VenvDir) { Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" -} else { +} +else { Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") Write-Verbose "VenvDir=$VenvDir" @@ -179,7 +189,8 @@ $pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir # just use the name of the virtual environment folder. if ($Prompt) { Write-Verbose "Prompt specified as argument, using '$Prompt'" -} else { +} +else { Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" if ($pyvenvCfg -and $pyvenvCfg['prompt']) { Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" From webhook-mailer at python.org Thu Apr 2 15:19:47 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Apr 2020 19:19:47 -0000 Subject: [Python-checkins] bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131) Message-ID: https://github.com/python/cpython/commit/b7345c24a4d962e2adbafc86e4af77de9e3ef09e commit: b7345c24a4d962e2adbafc86e4af77de9e3ef09e branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T12:19:41-07:00 summary: bpo-38972: Link to instructions to change PowerShell execution policy (GH-19131) (cherry picked from commit 45217af29c7f380089af17beb48a5ea0560bbb9d) Co-authored-by: Derek Keeler files: M Doc/using/venv-create.inc M Lib/venv/scripts/common/Activate.ps1 diff --git a/Doc/using/venv-create.inc b/Doc/using/venv-create.inc index 1b24721bbcbc3..99b2a19a18d06 100644 --- a/Doc/using/venv-create.inc +++ b/Doc/using/venv-create.inc @@ -78,6 +78,17 @@ The command, if run with ``-h``, will show the available options:: particular note is that double-clicking ``python.exe`` in File Explorer will resolve the symlink eagerly and ignore the virtual environment. +.. note:: + On Microsoft Windows, it may be required to enable the ``Activate.ps1`` + script by setting the execution policy for the user. You can do this by + issuing the following PowerShell command: + + PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + + See `About Execution Policies + `_ + for more information. + The created ``pyvenv.cfg`` file also includes the ``include-system-site-packages`` key, set to ``true`` if ``venv`` is run with the ``--system-site-packages`` option, ``false`` otherwise. diff --git a/Lib/venv/scripts/common/Activate.ps1 b/Lib/venv/scripts/common/Activate.ps1 index 98cb1b85d11c6..b8245b1bbe5c8 100644 --- a/Lib/venv/scripts/common/Activate.ps1 +++ b/Lib/venv/scripts/common/Activate.ps1 @@ -1,6 +1,6 @@ <# .Synopsis -Activate a Python virtual environment for the current Powershell session. +Activate a Python virtual environment for the current PowerShell session. .Description Pushes the python executable for a virtual environment to the front of the @@ -37,6 +37,15 @@ Activates the Python virtual environment that contains the Activate.ps1 script, and prefixes the current prompt with the specified string (surrounded in parentheses) while the virtual environment is active. +.Notes +On Windows, it may be required to enable this Activate.ps1 script by setting the +execution policy for the user. You can do this by issuing the following PowerShell +command: + +PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + +For more information on Execution Policies: +ttps:/go.microsoft.com/fwlink/?LinkID=135170 #> Param( @@ -137,7 +146,7 @@ function Get-PyVenvConfig( $val = $keyval[1] # Remove extraneous quotations around a string value. - if ("'""".Contains($val.Substring(0,1))) { + if ("'""".Contains($val.Substring(0, 1))) { $val = $val.Substring(1, $val.Length - 2) } @@ -165,7 +174,8 @@ Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)" # VenvExecDir if specified on the command line. if ($VenvDir) { Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values" -} else { +} +else { Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir." $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/") Write-Verbose "VenvDir=$VenvDir" @@ -179,7 +189,8 @@ $pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir # just use the name of the virtual environment folder. if ($Prompt) { Write-Verbose "Prompt specified as argument, using '$Prompt'" -} else { +} +else { Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value" if ($pyvenvCfg -and $pyvenvCfg['prompt']) { Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'" From webhook-mailer at python.org Thu Apr 2 18:35:03 2020 From: webhook-mailer at python.org (Tim Hatch) Date: Thu, 02 Apr 2020 22:35:03 -0000 Subject: [Python-checkins] lib2to3: Support named assignment expressions (GH-12702) Message-ID: https://github.com/python/cpython/commit/3c3aa4516c70753de06bb142b6793d01330fcf0f commit: 3c3aa4516c70753de06bb142b6793d01330fcf0f branch: master author: Tim Hatch committer: GitHub date: 2020-04-02T15:34:54-07:00 summary: lib2to3: Support named assignment expressions (GH-12702) There are two copies of the grammar -- the one used by Python itself as Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it to be reasonable stable to avoid requiring fixer rewrites. This brings suport for syntax like `if x:= foo():` to match what the live Python grammar does. This should've been added at the time of the walrus operator itself, but lib2to3 being independent is often overlooked. So we do consider this a bugfix rather than enhancement. files: A Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst M Lib/lib2to3/Grammar.txt M Lib/lib2to3/pgen2/grammar.py M Lib/lib2to3/pgen2/token.py M Lib/lib2to3/pgen2/tokenize.py M Lib/lib2to3/tests/test_parser.py diff --git a/Lib/lib2to3/Grammar.txt b/Lib/lib2to3/Grammar.txt index 51f58209f036f..e007dc188af50 100644 --- a/Lib/lib2to3/Grammar.txt +++ b/Lib/lib2to3/Grammar.txt @@ -67,8 +67,8 @@ assert_stmt: 'assert' test [',' test] compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt async_stmt: ASYNC (funcdef | with_stmt | for_stmt) -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: ('try' ':' suite ((except_clause ':' suite)+ @@ -91,6 +91,7 @@ testlist_safe: old_test [(',' old_test)+ [',']] old_test: or_test | old_lambdef old_lambdef: 'lambda' [varargslist] ':' old_test +namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* @@ -111,8 +112,8 @@ atom: ('(' [yield_expr|testlist_gexp] ')' | '{' [dictsetmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+ | '.' '.' '.') -listmaker: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) -testlist_gexp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +listmaker: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) +testlist_gexp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) lambdef: 'lambda' [varargslist] ':' test trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] @@ -137,6 +138,7 @@ arglist: argument (',' argument)* [','] # multiple (test comp_for) arguments are blocked; keyword unpackings # that precede iterable unpackings are blocked; etc. argument: ( test [comp_for] | + test ':=' test | test '=' test | '**' test | '*' test ) diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py index a1da546eee20e..6a4d575ac2ccf 100644 --- a/Lib/lib2to3/pgen2/grammar.py +++ b/Lib/lib2to3/pgen2/grammar.py @@ -178,6 +178,7 @@ def report(self): // DOUBLESLASH //= DOUBLESLASHEQUAL -> RARROW +:= COLONEQUAL """ opmap = {} diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py index 1a679554d2db4..5f6612f5b3068 100755 --- a/Lib/lib2to3/pgen2/token.py +++ b/Lib/lib2to3/pgen2/token.py @@ -65,7 +65,8 @@ AWAIT = 56 ASYNC = 57 ERRORTOKEN = 58 -N_TOKENS = 59 +COLONEQUAL = 59 +N_TOKENS = 60 NT_OFFSET = 256 #--end constants-- diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py index 7924ff3cd582f..0e2685d40433d 100644 --- a/Lib/lib2to3/pgen2/tokenize.py +++ b/Lib/lib2to3/pgen2/tokenize.py @@ -93,7 +93,7 @@ def _combinations(*l): r"~") Bracket = '[][(){}]' -Special = group(r'\r?\n', r'[:;.,`@]') +Special = group(r'\r?\n', r':=', r'[:;.,`@]') Funny = group(Operator, Bracket, Special) PlainToken = group(Number, Funny, String, Name) diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py index a0c31e8f5300d..ba2bb787332ed 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -629,6 +629,21 @@ def test_multiline_str_literals(self): self.validate(s) +class TestNamedAssignments(GrammarTest): + + def test_named_assignment_if(self): + driver.parse_string("if f := x(): pass\n") + + def test_named_assignment_while(self): + driver.parse_string("while f := x(): pass\n") + + def test_named_assignment_generator(self): + driver.parse_string("any((lastNum := num) == 1 for num in [1, 2, 3])\n") + + def test_named_assignment_listcomp(self): + driver.parse_string("[(lastNum := num) == 1 for num in [1, 2, 3]]\n") + + class TestPickleableException(unittest.TestCase): def test_ParseError(self): err = ParseError('msg', 2, None, (1, 'context')) diff --git a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst new file mode 100644 index 0000000000000..e7b9dd648b407 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst @@ -0,0 +1,2 @@ +lib2to3 now recognizes named assignment expressions (the walrus operator, +``:=``) From webhook-mailer at python.org Thu Apr 2 18:40:33 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 22:40:33 -0000 Subject: [Python-checkins] bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) Message-ID: https://github.com/python/cpython/commit/7a51a7e19f0143f75f8fc9ff68f93ed40937aec6 commit: 7a51a7e19f0143f75f8fc9ff68f93ed40937aec6 branch: master author: Victor Stinner committer: GitHub date: 2020-04-03T00:40:25+02:00 summary: bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) test_builtin.PtyTests now registers an handler for SIGHUP signal. Closing the PTY file descriptor can emit a SIGHUP signal: just ignore it. run_child() now also closes the PTY file descriptor before waiting for the process completition, otherwise the test hangs on AIX. files: M Lib/test/test_builtin.py M Lib/test/test_pty.py diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index eaada1b50439b..290ba2cad8e5e 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1837,7 +1837,21 @@ class PtyTests(unittest.TestCase): """Tests that use a pseudo terminal to guarantee stdin and stdout are terminals in the test environment""" + @staticmethod + def handle_sighup(signum, frame): + # bpo-40140: if the process is the session leader, os.close(fd) + # of "pid, fd = pty.fork()" can raise SIGHUP signal: + # just ignore the signal. + pass + def run_child(self, child, terminal_input): + old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) + try: + return self._run_child(child, terminal_input) + finally: + signal.signal(signal.SIGHUP, old_sighup) + + def _run_child(self, child, terminal_input): r, w = os.pipe() # Pipe test results from child back to parent try: pid, fd = pty.fork() @@ -1893,13 +1907,12 @@ def run_child(self, child, terminal_input): self.fail("got %d lines in pipe but expected 2, child output was:\n%s" % (len(lines), child_output)) - # Wait until the child process completes before closing the PTY to - # prevent sending SIGHUP to the child process. - support.wait_process(pid, exitcode=0) - - # Close the PTY + # bpo-40155: Close the PTY before waiting for the child process + # completion, otherwise the child process hangs on AIX. os.close(fd) + support.wait_process(pid, exitcode=0) + return lines def check_input_tty(self, prompt, terminal_input, stdio_encoding=None): diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index aa5c68790f7ca..9c32467cbbd64 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -70,7 +70,7 @@ def setUp(self): self.addCleanup(signal.signal, signal.SIGALRM, old_alarm) old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) - self.addCleanup(signal.signal, signal.SIGHUP, old_alarm) + self.addCleanup(signal.signal, signal.SIGHUP, old_sighup) # isatty() and close() can hang on some platforms. Set an alarm # before running the test to make sure we don't hang forever. @@ -81,8 +81,8 @@ def handle_sig(self, sig, frame): self.fail("isatty hung") @staticmethod - def handle_sighup(sig, frame): - # if the process is the session leader, os.close(master_fd) + def handle_sighup(signum, frame): + # bpo-38547: if the process is the session leader, os.close(master_fd) # of "master_fd, slave_name = pty.master_open()" raises SIGHUP # signal: just ignore the signal. pass From webhook-mailer at python.org Thu Apr 2 19:03:17 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 02 Apr 2020 23:03:17 -0000 Subject: [Python-checkins] lib2to3: Support named assignment expressions (GH-12702) Message-ID: https://github.com/python/cpython/commit/1098671e4e5ec1513247f05598158eaa3428c5be commit: 1098671e4e5ec1513247f05598158eaa3428c5be branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T16:03:09-07:00 summary: lib2to3: Support named assignment expressions (GH-12702) There are two copies of the grammar -- the one used by Python itself as Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it to be reasonable stable to avoid requiring fixer rewrites. This brings suport for syntax like `if x:= foo():` to match what the live Python grammar does. This should've been added at the time of the walrus operator itself, but lib2to3 being independent is often overlooked. So we do consider this a bugfix rather than enhancement. (cherry picked from commit 3c3aa4516c70753de06bb142b6793d01330fcf0f) Co-authored-by: Tim Hatch files: A Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst M Lib/lib2to3/Grammar.txt M Lib/lib2to3/pgen2/grammar.py M Lib/lib2to3/pgen2/token.py M Lib/lib2to3/pgen2/tokenize.py M Lib/lib2to3/tests/test_parser.py diff --git a/Lib/lib2to3/Grammar.txt b/Lib/lib2to3/Grammar.txt index 68b73868b5828..8ce7fd8a89da6 100644 --- a/Lib/lib2to3/Grammar.txt +++ b/Lib/lib2to3/Grammar.txt @@ -67,8 +67,8 @@ assert_stmt: 'assert' test [',' test] compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt async_stmt: ASYNC (funcdef | with_stmt | for_stmt) -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: ('try' ':' suite ((except_clause ':' suite)+ @@ -91,6 +91,7 @@ testlist_safe: old_test [(',' old_test)+ [',']] old_test: or_test | old_lambdef old_lambdef: 'lambda' [varargslist] ':' old_test +namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* @@ -111,8 +112,8 @@ atom: ('(' [yield_expr|testlist_gexp] ')' | '{' [dictsetmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+ | '.' '.' '.') -listmaker: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) -testlist_gexp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +listmaker: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) +testlist_gexp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) lambdef: 'lambda' [varargslist] ':' test trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] @@ -137,6 +138,7 @@ arglist: argument (',' argument)* [','] # multiple (test comp_for) arguments are blocked; keyword unpackings # that precede iterable unpackings are blocked; etc. argument: ( test [comp_for] | + test ':=' test | test '=' test | '**' test | '*' test ) diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py index a1da546eee20e..6a4d575ac2ccf 100644 --- a/Lib/lib2to3/pgen2/grammar.py +++ b/Lib/lib2to3/pgen2/grammar.py @@ -178,6 +178,7 @@ def report(self): // DOUBLESLASH //= DOUBLESLASHEQUAL -> RARROW +:= COLONEQUAL """ opmap = {} diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py index 1a679554d2db4..5f6612f5b3068 100755 --- a/Lib/lib2to3/pgen2/token.py +++ b/Lib/lib2to3/pgen2/token.py @@ -65,7 +65,8 @@ AWAIT = 56 ASYNC = 57 ERRORTOKEN = 58 -N_TOKENS = 59 +COLONEQUAL = 59 +N_TOKENS = 60 NT_OFFSET = 256 #--end constants-- diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py index 7924ff3cd582f..0e2685d40433d 100644 --- a/Lib/lib2to3/pgen2/tokenize.py +++ b/Lib/lib2to3/pgen2/tokenize.py @@ -93,7 +93,7 @@ def _combinations(*l): r"~") Bracket = '[][(){}]' -Special = group(r'\r?\n', r'[:;.,`@]') +Special = group(r'\r?\n', r':=', r'[:;.,`@]') Funny = group(Operator, Bracket, Special) PlainToken = group(Number, Funny, String, Name) diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py index 868ada71cda87..3a0e7f435e6d7 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -629,6 +629,21 @@ def test_multiline_str_literals(self): self.validate(s) +class TestNamedAssignments(GrammarTest): + + def test_named_assignment_if(self): + driver.parse_string("if f := x(): pass\n") + + def test_named_assignment_while(self): + driver.parse_string("while f := x(): pass\n") + + def test_named_assignment_generator(self): + driver.parse_string("any((lastNum := num) == 1 for num in [1, 2, 3])\n") + + def test_named_assignment_listcomp(self): + driver.parse_string("[(lastNum := num) == 1 for num in [1, 2, 3]]\n") + + class TestPickleableException(unittest.TestCase): def test_ParseError(self): err = ParseError('msg', 2, None, (1, 'context')) diff --git a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst new file mode 100644 index 0000000000000..e7b9dd648b407 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst @@ -0,0 +1,2 @@ +lib2to3 now recognizes named assignment expressions (the walrus operator, +``:=``) From webhook-mailer at python.org Thu Apr 2 19:10:06 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 02 Apr 2020 23:10:06 -0000 Subject: [Python-checkins] bpo-40156: Copy Codecov configuration from master (#19309) Message-ID: https://github.com/python/cpython/commit/ed07522a5faa3101f68be8e4b8369310f60860f8 commit: ed07522a5faa3101f68be8e4b8369310f60860f8 branch: 3.5 author: Victor Stinner committer: GitHub date: 2020-04-02T16:09:58-07:00 summary: bpo-40156: Copy Codecov configuration from master (#19309) Disable "Codevov patch" job on pull requests. files: M .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml index dc21321d0baaf..ea504f48672ea 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -5,7 +5,7 @@ codecov: comment: off ignore: - "Doc/**/*" - - "Misc/*" + - "Misc/**/*" - "Mac/**/*" - "PC/**/*" - "PCbuild/**/*" @@ -13,18 +13,12 @@ ignore: - "Grammar/*" coverage: precision: 2 - range: - - 70.0 - - 100.0 + range: 70...90 round: down status: changes: off project: off - patch: - default: - target: 100% - only_pulls: true - threshold: 0.05 + patch: off parsers: gcov: branch_detection: From webhook-mailer at python.org Thu Apr 2 20:11:58 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 00:11:58 -0000 Subject: [Python-checkins] bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) (GH-19316) Message-ID: https://github.com/python/cpython/commit/745bd91bab8e57c52d63a2d541465551d7551f78 commit: 745bd91bab8e57c52d63a2d541465551d7551f78 branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-03T02:11:54+02:00 summary: bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) (GH-19316) test_builtin.PtyTests now registers an handler for SIGHUP signal. Closing the PTY file descriptor can emit a SIGHUP signal: just ignore it. run_child() now also closes the PTY file descriptor before waiting for the process completition, otherwise the test hangs on AIX. (cherry picked from commit 7a51a7e19f0143f75f8fc9ff68f93ed40937aec6) files: M Lib/test/test_builtin.py M Lib/test/test_pty.py diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index f680e02fdf520..48b0e33af59ed 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1790,7 +1790,21 @@ class PtyTests(unittest.TestCase): """Tests that use a pseudo terminal to guarantee stdin and stdout are terminals in the test environment""" + @staticmethod + def handle_sighup(signum, frame): + # bpo-40140: if the process is the session leader, os.close(fd) + # of "pid, fd = pty.fork()" can raise SIGHUP signal: + # just ignore the signal. + pass + def run_child(self, child, terminal_input): + old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) + try: + return self._run_child(child, terminal_input) + finally: + signal.signal(signal.SIGHUP, old_sighup) + + def _run_child(self, child, terminal_input): r, w = os.pipe() # Pipe test results from child back to parent try: pid, fd = pty.fork() @@ -1841,6 +1855,9 @@ def run_child(self, child, terminal_input): child_output = child_output.decode("ascii", "ignore") self.fail("got %d lines in pipe but expected 2, child output was:\n%s" % (len(lines), child_output)) + + # bpo-40155: Close the PTY before waiting for the child process + # completion, otherwise the child process hangs on AIX. os.close(fd) # Wait until the child process completes diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index ce85f575a0830..dfb3a3fc32644 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -70,7 +70,7 @@ def setUp(self): self.addCleanup(signal.signal, signal.SIGALRM, old_alarm) old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) - self.addCleanup(signal.signal, signal.SIGHUP, old_alarm) + self.addCleanup(signal.signal, signal.SIGHUP, old_sighup) # isatty() and close() can hang on some platforms. Set an alarm # before running the test to make sure we don't hang forever. @@ -81,8 +81,8 @@ def handle_sig(self, sig, frame): self.fail("isatty hung") @staticmethod - def handle_sighup(sig, frame): - # if the process is the session leader, os.close(master_fd) + def handle_sighup(signum, frame): + # bpo-38547: if the process is the session leader, os.close(master_fd) # of "master_fd, slave_name = pty.master_open()" raises SIGHUP # signal: just ignore the signal. pass From webhook-mailer at python.org Thu Apr 2 20:34:12 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 00:34:12 -0000 Subject: [Python-checkins] bpo-40156: Copy Codecov configuration from master (GH-19306) Message-ID: https://github.com/python/cpython/commit/ebeabb5b728f009480ced3ca4738c20fa073b507 commit: ebeabb5b728f009480ced3ca4738c20fa073b507 branch: 3.6 author: Victor Stinner committer: GitHub date: 2020-04-02T20:34:04-04:00 summary: bpo-40156: Copy Codecov configuration from master (GH-19306) Disable "Codevov patch" job on pull requests. files: M .github/codecov.yml diff --git a/.github/codecov.yml b/.github/codecov.yml index dc21321d0baaf..ea504f48672ea 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -5,7 +5,7 @@ codecov: comment: off ignore: - "Doc/**/*" - - "Misc/*" + - "Misc/**/*" - "Mac/**/*" - "PC/**/*" - "PCbuild/**/*" @@ -13,18 +13,12 @@ ignore: - "Grammar/*" coverage: precision: 2 - range: - - 70.0 - - 100.0 + range: 70...90 round: down status: changes: off project: off - patch: - default: - target: 100% - only_pulls: true - threshold: 0.05 + patch: off parsers: gcov: branch_detection: From webhook-mailer at python.org Thu Apr 2 21:04:03 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 01:04:03 -0000 Subject: [Python-checkins] bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319) Message-ID: https://github.com/python/cpython/commit/b1ffb8b72307a556442d09b427c3b29badb9878c commit: b1ffb8b72307a556442d09b427c3b29badb9878c branch: master author: Victor Stinner committer: GitHub date: 2020-04-03T03:03:59+02:00 summary: bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319) files: A Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst M .travis.yml diff --git a/.travis.yml b/.travis.yml index 675e267fe2e82..c7fa9e3a7ca4f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: env: global: - - OPENSSL=1.1.1d + - OPENSSL=1.1.1f - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" - CFLAGS="-I${OPENSSL_DIR}/include" diff --git a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst new file mode 100644 index 0000000000000..8d5d0e0871d42 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst @@ -0,0 +1 @@ +Update Travis CI configuration to OpenSSL 1.1.1f. From webhook-mailer at python.org Thu Apr 2 21:05:15 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 01:05:15 -0000 Subject: [Python-checkins] bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320) Message-ID: https://github.com/python/cpython/commit/1767a0490f80c7b90d81051db24ef2b82cd9434f commit: 1767a0490f80c7b90d81051db24ef2b82cd9434f branch: master author: Victor Stinner committer: GitHub date: 2020-04-03T03:05:10+02:00 summary: bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320) Update also OpenSSL version in Ubuntu and Coverage jobs. files: M .github/workflows/build.yml M .github/workflows/coverage.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6774ae46f7e0f..50d1561518bd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: name: 'Ubuntu' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1d + OPENSSL_VER: 1.1.1f steps: - uses: actions/checkout at v1 - name: Install Dependencies diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index bf166ab8f0867..75bdf83f6c5db 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,7 +23,7 @@ jobs: name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1d + OPENSSL_VER: 1.1.1f steps: - uses: actions/checkout at v1 - name: Install Dependencies From webhook-mailer at python.org Thu Apr 2 21:16:04 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 01:16:04 -0000 Subject: [Python-checkins] bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19304) Message-ID: https://github.com/python/cpython/commit/69cdeeb93e0830004a495ed854022425b93b3f3e commit: 69cdeeb93e0830004a495ed854022425b93b3f3e branch: 3.6 author: Victor Stinner committer: GitHub date: 2020-04-02T21:15:56-04:00 summary: bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19304) The AbstractBasicAuthHandler class of the urllib.request module uses an inefficient regular expression which can be exploited by an attacker to cause a denial of service. Fix the regex to prevent the catastrophic backtracking. Vulnerability reported by Ben Caller and Matt Schwager. AbstractBasicAuthHandler of urllib.request now parses all WWW-Authenticate HTTP headers and accepts multiple challenges per header: use the realm of the first Basic challenge. Co-Authored-By: Serhiy Storchaka (cherry picked from commit 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4) files: A Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst A Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst M Lib/test/test_urllib2.py M Lib/urllib/request.py diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 876fcd4199fb9..fe9a32bfdabf0 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1445,40 +1445,64 @@ def test_osx_proxy_bypass(self): bypass = {'exclude_simple': True, 'exceptions': []} self.assertTrue(_proxy_bypass_macosx_sysconf('test', bypass)) - def test_basic_auth(self, quote_char='"'): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' % - (quote_char, realm, quote_char)) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) - - def test_basic_auth_with_single_quoted_realm(self): - self.test_basic_auth(quote_char="'") - - def test_basic_auth_with_unquoted_realm(self): - opener = OpenerDirector() - password_manager = MockPasswordManager() - auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) - realm = "ACME Widget Store" - http_handler = MockHTTPHandler( - 401, 'WWW-Authenticate: Basic realm=%s\r\n\r\n' % realm) - opener.add_handler(auth_handler) - opener.add_handler(http_handler) - with self.assertWarns(UserWarning): + def check_basic_auth(self, headers, realm): + with self.subTest(realm=realm, headers=headers): + opener = OpenerDirector() + password_manager = MockPasswordManager() + auth_handler = urllib.request.HTTPBasicAuthHandler(password_manager) + body = '\r\n'.join(headers) + '\r\n\r\n' + http_handler = MockHTTPHandler(401, body) + opener.add_handler(auth_handler) + opener.add_handler(http_handler) self._test_basic_auth(opener, auth_handler, "Authorization", - realm, http_handler, password_manager, - "http://acme.example.com/protected", - "http://acme.example.com/protected", - ) + realm, http_handler, password_manager, + "http://acme.example.com/protected", + "http://acme.example.com/protected") + + def test_basic_auth(self): + realm = "realm2 at example.com" + realm2 = "realm2 at example.com" + basic = f'Basic realm="{realm}"' + basic2 = f'Basic realm="{realm2}"' + other_no_realm = 'Otherscheme xxx' + digest = (f'Digest realm="{realm2}", ' + f'qop="auth, auth-int", ' + f'nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093", ' + f'opaque="5ccc069c403ebaf9f0171e9517f40e41"') + for realm_str in ( + # test "quote" and 'quote' + f'Basic realm="{realm}"', + f"Basic realm='{realm}'", + + # charset is ignored + f'Basic realm="{realm}", charset="UTF-8"', + + # Multiple challenges per header + f'{basic}, {basic2}', + f'{basic}, {other_no_realm}', + f'{other_no_realm}, {basic}', + f'{basic}, {digest}', + f'{digest}, {basic}', + ): + headers = [f'WWW-Authenticate: {realm_str}'] + self.check_basic_auth(headers, realm) + + # no quote: expect a warning + with support.check_warnings(("Basic Auth Realm was unquoted", + UserWarning)): + headers = [f'WWW-Authenticate: Basic realm={realm}'] + self.check_basic_auth(headers, realm) + + # Multiple headers: one challenge per header. + # Use the first Basic realm. + for challenges in ( + [basic, basic2], + [basic, digest], + [digest, basic], + ): + headers = [f'WWW-Authenticate: {challenge}' + for challenge in challenges] + self.check_basic_auth(headers, realm) def test_proxy_basic_auth(self): opener = OpenerDirector() diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index c9945d951821e..6624e04317ba2 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -945,8 +945,15 @@ class AbstractBasicAuthHandler: # allow for double- and single-quoted realm values # (single quotes are a violation of the RFC, but appear in the wild) - rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' - 'realm=(["\']?)([^"\']*)\\2', re.I) + rx = re.compile('(?:^|,)' # start of the string or ',' + '[ \t]*' # optional whitespaces + '([^ \t]+)' # scheme like "Basic" + '[ \t]+' # mandatory whitespaces + # realm=xxx + # realm='xxx' + # realm="xxx" + 'realm=(["\']?)([^"\']*)\\2', + re.I) # XXX could pre-emptively send auth info already accepted (RFC 2617, # end of section 2, and section 1.2 immediately after "credentials" @@ -958,27 +965,51 @@ def __init__(self, password_mgr=None): self.passwd = password_mgr self.add_password = self.passwd.add_password + def _parse_realm(self, header): + # parse WWW-Authenticate header: accept multiple challenges per header + found_challenge = False + for mo in AbstractBasicAuthHandler.rx.finditer(header): + scheme, quote, realm = mo.groups() + if quote not in ['"', "'"]: + warnings.warn("Basic Auth Realm was unquoted", + UserWarning, 3) + + yield (scheme, realm) + + found_challenge = True + + if not found_challenge: + if header: + scheme = header.split()[0] + else: + scheme = '' + yield (scheme, None) + def http_error_auth_reqed(self, authreq, host, req, headers): # host may be an authority (without userinfo) or a URL with an # authority - # XXX could be multiple headers - authreq = headers.get(authreq, None) + headers = headers.get_all(authreq) + if not headers: + # no header found + return - if authreq: - scheme = authreq.split()[0] - if scheme.lower() != 'basic': - raise ValueError("AbstractBasicAuthHandler does not" - " support the following scheme: '%s'" % - scheme) - else: - mo = AbstractBasicAuthHandler.rx.search(authreq) - if mo: - scheme, quote, realm = mo.groups() - if quote not in ['"',"'"]: - warnings.warn("Basic Auth Realm was unquoted", - UserWarning, 2) - if scheme.lower() == 'basic': - return self.retry_http_basic_auth(host, req, realm) + unsupported = None + for header in headers: + for scheme, realm in self._parse_realm(header): + if scheme.lower() != 'basic': + unsupported = scheme + continue + + if realm is not None: + # Use the first matching Basic challenge. + # Ignore following challenges even if they use the Basic + # scheme. + return self.retry_http_basic_auth(host, req, realm) + + if unsupported is not None: + raise ValueError("AbstractBasicAuthHandler does not " + "support the following scheme: %r" + % (scheme,)) def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host) diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst new file mode 100644 index 0000000000000..be80ce79d91ed --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst @@ -0,0 +1,3 @@ +:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` +now parses all WWW-Authenticate HTTP headers and accepts multiple challenges +per header: use the realm of the first Basic challenge. diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst new file mode 100644 index 0000000000000..9f2800581ca5e --- /dev/null +++ b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst @@ -0,0 +1,5 @@ +CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class of the +:mod:`urllib.request` module uses an inefficient regular expression which can +be exploited by an attacker to cause a denial of service. Fix the regex to +prevent the catastrophic backtracking. Vulnerability reported by Ben Caller +and Matt Schwager. From webhook-mailer at python.org Thu Apr 2 21:21:41 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 01:21:41 -0000 Subject: [Python-checkins] bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319) Message-ID: https://github.com/python/cpython/commit/1ba6fe43e888668acfbf74038b82c6ee24ab1c41 commit: 1ba6fe43e888668acfbf74038b82c6ee24ab1c41 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T18:21:37-07:00 summary: bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319) (cherry picked from commit b1ffb8b72307a556442d09b427c3b29badb9878c) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst M .travis.yml diff --git a/.travis.yml b/.travis.yml index 11ea3e922d6ae..3615ec03b0465 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: env: global: - - OPENSSL=1.1.1d + - OPENSSL=1.1.1f - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" # Use -O3 because we don't use debugger on Travis-CI diff --git a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst new file mode 100644 index 0000000000000..8d5d0e0871d42 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst @@ -0,0 +1 @@ +Update Travis CI configuration to OpenSSL 1.1.1f. From webhook-mailer at python.org Thu Apr 2 21:21:59 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 01:21:59 -0000 Subject: [Python-checkins] bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319) Message-ID: https://github.com/python/cpython/commit/1c325c4e0bf31a18d06784006eabf4d5a4a1d706 commit: 1c325c4e0bf31a18d06784006eabf4d5a4a1d706 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T18:21:54-07:00 summary: bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319) (cherry picked from commit b1ffb8b72307a556442d09b427c3b29badb9878c) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst M .travis.yml diff --git a/.travis.yml b/.travis.yml index 8954a3a8ca0ad..1d3eb737abffa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ cache: env: global: - - OPENSSL=1.1.1d + - OPENSSL=1.1.1f - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" - CFLAGS="-I${OPENSSL_DIR}/include" diff --git a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst new file mode 100644 index 0000000000000..8d5d0e0871d42 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst @@ -0,0 +1 @@ +Update Travis CI configuration to OpenSSL 1.1.1f. From webhook-mailer at python.org Thu Apr 2 21:25:58 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 01:25:58 -0000 Subject: [Python-checkins] bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320) Message-ID: https://github.com/python/cpython/commit/f2296ef9ce586bf2f51c125b085c2b080768040c commit: f2296ef9ce586bf2f51c125b085c2b080768040c branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-02T18:25:51-07:00 summary: bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320) Update also OpenSSL version in Ubuntu and Coverage jobs. (cherry picked from commit 1767a0490f80c7b90d81051db24ef2b82cd9434f) Co-authored-by: Victor Stinner files: M .github/workflows/build.yml M .github/workflows/coverage.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b4aec6e30975..d3d67475135a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,7 @@ jobs: name: 'Ubuntu' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1d + OPENSSL_VER: 1.1.1f steps: - uses: actions/checkout at v1 - name: Install Dependencies diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8e1b764ca8df4..e58ad4a1dfd48 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,7 +23,7 @@ jobs: name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1d + OPENSSL_VER: 1.1.1f steps: - uses: actions/checkout at v1 - name: Install Dependencies From webhook-mailer at python.org Thu Apr 2 21:37:36 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 01:37:36 -0000 Subject: [Python-checkins] bpo-38804: Fix REDoS in http.cookiejar (GH-17157) (#17344) Message-ID: https://github.com/python/cpython/commit/55a6a16a46239a71b635584e532feb8b17ae7fdf commit: 55a6a16a46239a71b635584e532feb8b17ae7fdf branch: 3.5 author: Victor Stinner committer: GitHub date: 2020-04-02T18:37:32-07:00 summary: bpo-38804: Fix REDoS in http.cookiejar (GH-17157) (#17344) The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular expression denial of service (REDoS). LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar to parse Set-Cookie headers returned by a server. Processing a response from a malicious HTTP server can lead to extreme CPU usage and execution will be blocked for a long time. The regex contained multiple overlapping \s* capture groups. Ignoring the ?-optional capture groups the regex could be simplified to \d+-\w+-\d+(\s*\s*\s*)$ Therefore, a long sequence of spaces can trigger bad performance. Matching a malicious string such as LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!") caused catastrophic backtracking. The fix removes ambiguity about which \s* should match a particular space. You can create a malicious server which responds with Set-Cookie headers to attack all python programs which access it e.g. from http.server import BaseHTTPRequestHandler, HTTPServer def make_set_cookie_value(n_spaces): spaces = " " * n_spaces expiry = f"1-c-1{spaces}!" return f"b;Expires={expiry}" class Handler(BaseHTTPRequestHandler): def do_GET(self): self.log_request(204) self.send_response_only(204) # Don't bother sending Server and Date n_spaces = ( int(self.path[1:]) # Can GET e.g. /100 to test shorter sequences if len(self.path) > 1 else 65506 # Max header line length 65536 ) value = make_set_cookie_value(n_spaces) for i in range(99): # Not necessary, but we can have up to 100 header lines self.send_header("Set-Cookie", value) self.end_headers() if __name__ == "__main__": HTTPServer(("", 44020), Handler).serve_forever() This server returns 99 Set-Cookie headers. Each has 65506 spaces. Extracting the cookies will pretty much never complete. Vulnerable client using the example at the bottom of https://docs.python.org/3/library/http.cookiejar.html : import http.cookiejar, urllib.request cj = http.cookiejar.CookieJar() opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj)) r = opener.open("http://localhost:44020/") The popular requests library was also vulnerable without any additional options (as it uses http.cookiejar by default): import requests requests.get("http://localhost:44020/") * Regression test for http.cookiejar REDoS If we regress, this test will take a very long time. * Improve performance of http.cookiejar.ISO_DATE_RE A string like "444444" + (" " * 2000) + "A" could cause poor performance due to the 2 overlapping \s* groups, although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was. (cherry picked from commit 1b779bfb8593739b11cbb988ef82a883ec9d077e) Co-authored-by: bcaller files: A Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst M Lib/http/cookiejar.py M Lib/test/test_http_cookiejar.py M Misc/ACKS diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py index c6b9d8c011dee..afed5bc93c74d 100644 --- a/Lib/http/cookiejar.py +++ b/Lib/http/cookiejar.py @@ -216,10 +216,14 @@ def _str2time(day, mon, yr, hr, min, sec, tz): (?::(\d\d))? # optional seconds )? # optional clock \s* - ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+)? # timezone + (?: + ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone + \s* + )? + (?: + \(\w+\) # ASCII representation of timezone in parens. \s* - (?:\(\w+\))? # ASCII representation of timezone in parens. - \s*$""", re.X | re.ASCII) + )?$""", re.X | re.ASCII) def http2time(text): """Returns time in seconds since epoch of time represented by a string. @@ -289,9 +293,11 @@ def http2time(text): (?::?(\d\d(?:\.\d*)?))? # optional seconds (and fractional) )? # optional clock \s* - ([-+]?\d\d?:?(:?\d\d)? - |Z|z)? # timezone (Z is "zero meridian", i.e. GMT) - \s*$""", re.X | re. ASCII) + (?: + ([-+]?\d\d?:?(:?\d\d)? + |Z|z) # timezone (Z is "zero meridian", i.e. GMT) + \s* + )?$""", re.X | re. ASCII) def iso2time(text): """ As for http2time, but parses the ISO 8601 formats: diff --git a/Lib/test/test_http_cookiejar.py b/Lib/test/test_http_cookiejar.py index 767b0fd1375f0..218edeb9e82dc 100644 --- a/Lib/test/test_http_cookiejar.py +++ b/Lib/test/test_http_cookiejar.py @@ -122,6 +122,13 @@ def test_http2time_garbage(self): "http2time(%s) is not None\n" "http2time(test) %s" % (test, http2time(test))) + def test_http2time_redos_regression_actually_completes(self): + # LOOSE_HTTP_DATE_RE was vulnerable to malicious input which caused catastrophic backtracking (REDoS). + # If we regress to cubic complexity, this test will take a very long time to succeed. + # If fixed, it should complete within a fraction of a second. + http2time("01 Jan 1970{}00:00:00 GMT!".format(" " * 10 ** 5)) + http2time("01 Jan 1970 00:00:00{}GMT!".format(" " * 10 ** 5)) + def test_iso2time(self): def parse_date(text): return time.gmtime(iso2time(text))[:6] @@ -181,6 +188,12 @@ def test_iso2time_garbage(self): "iso2time(%s) is not None\n" "iso2time(test) %s" % (test, iso2time(test))) + def test_iso2time_performance_regression(self): + # If ISO_DATE_RE regresses to quadratic complexity, this test will take a very long time to succeed. + # If fixed, it should complete within a fraction of a second. + iso2time('1994-02-03{}14:15:29 -0100!'.format(' '*10**6)) + iso2time('1994-02-03 14:15:29{}-0100!'.format(' '*10**6)) + class HeaderTests(unittest.TestCase): diff --git a/Misc/ACKS b/Misc/ACKS index 72c5d740bdd2a..778dce1b0ad61 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -227,6 +227,7 @@ Zach Byrne Vedran ?a?i? Nicolas Cadou Jp Calderone +Ben Caller Arnaud Calmettes Daniel Calvelo Tony Campbell diff --git a/Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst b/Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst new file mode 100644 index 0000000000000..1f45142d9f743 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst @@ -0,0 +1 @@ +Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by Ben Caller. From webhook-mailer at python.org Thu Apr 2 21:45:44 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 01:45:44 -0000 Subject: [Python-checkins] bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320) (GH-19324) Message-ID: https://github.com/python/cpython/commit/7ed2acc6e89cea07f140fc374a77e8b36442df2e commit: 7ed2acc6e89cea07f140fc374a77e8b36442df2e branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T03:45:40+02:00 summary: bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19320) (GH-19324) Update also OpenSSL version in Ubuntu and Coverage jobs. (cherry picked from commit 1767a0490f80c7b90d81051db24ef2b82cd9434f) Co-authored-by: Victor Stinner Co-authored-by: Victor Stinner files: M .github/workflows/build.yml M .github/workflows/coverage.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b4aec6e30975..d3d67475135a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,7 @@ jobs: name: 'Ubuntu' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1d + OPENSSL_VER: 1.1.1f steps: - uses: actions/checkout at v1 - name: Install Dependencies diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8e1b764ca8df4..e58ad4a1dfd48 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,7 +23,7 @@ jobs: name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1d + OPENSSL_VER: 1.1.1f steps: - uses: actions/checkout at v1 - name: Install Dependencies From webhook-mailer at python.org Fri Apr 3 04:00:37 2020 From: webhook-mailer at python.org (laike9m) Date: Fri, 03 Apr 2020 08:00:37 -0000 Subject: [Python-checkins] bpo-40122: Updated documentation for dis.findlabels() (GH-19274) Message-ID: https://github.com/python/cpython/commit/b74468e233a5137ff518e61eff65ca2d8833e38a commit: b74468e233a5137ff518e61eff65ca2d8833e38a branch: master author: laike9m committer: GitHub date: 2020-04-03T11:00:28+03:00 summary: bpo-40122: Updated documentation for dis.findlabels() (GH-19274) files: M Doc/library/dis.rst diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 2e1cdeda953a5..96574a098696c 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -244,7 +244,7 @@ operation is being performed, so the intermediate analysis object isn't useful: .. function:: findlabels(code) - Detect all offsets in the code object *code* which are jump targets, and + Detect all offsets in the raw compiled bytecode string *code* which are jump targets, and return a list of these offsets. From webhook-mailer at python.org Fri Apr 3 04:06:16 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 08:06:16 -0000 Subject: [Python-checkins] bpo-40122: Updated documentation for dis.findlabels() (GH-19274) Message-ID: https://github.com/python/cpython/commit/00c779fd9c0a9e7586681a44e35607c1113b5014 commit: 00c779fd9c0a9e7586681a44e35607c1113b5014 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T01:06:07-07:00 summary: bpo-40122: Updated documentation for dis.findlabels() (GH-19274) (cherry picked from commit b74468e233a5137ff518e61eff65ca2d8833e38a) Co-authored-by: laike9m files: M Doc/library/dis.rst diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 0cfcc69825932..4b604f5921658 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -244,7 +244,7 @@ operation is being performed, so the intermediate analysis object isn't useful: .. function:: findlabels(code) - Detect all offsets in the code object *code* which are jump targets, and + Detect all offsets in the raw compiled bytecode string *code* which are jump targets, and return a list of these offsets. From webhook-mailer at python.org Fri Apr 3 04:07:24 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 08:07:24 -0000 Subject: [Python-checkins] bpo-40122: Updated documentation for dis.findlabels() (GH-19274) Message-ID: https://github.com/python/cpython/commit/77c623ba3d084e99d68c30f368bd7fbd7f175b60 commit: 77c623ba3d084e99d68c30f368bd7fbd7f175b60 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T01:07:16-07:00 summary: bpo-40122: Updated documentation for dis.findlabels() (GH-19274) (cherry picked from commit b74468e233a5137ff518e61eff65ca2d8833e38a) Co-authored-by: laike9m files: M Doc/library/dis.rst diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index f4dfe16c75402..34ae1a3a6d83d 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -244,7 +244,7 @@ operation is being performed, so the intermediate analysis object isn't useful: .. function:: findlabels(code) - Detect all offsets in the code object *code* which are jump targets, and + Detect all offsets in the raw compiled bytecode string *code* which are jump targets, and return a list of these offsets. From webhook-mailer at python.org Fri Apr 3 08:09:15 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 03 Apr 2020 12:09:15 -0000 Subject: [Python-checkins] bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) (GH-19316) (GH-19318) Message-ID: https://github.com/python/cpython/commit/0961dbdea2a449fc5b7d77610d6d10e6036fbdf3 commit: 0961dbdea2a449fc5b7d77610d6d10e6036fbdf3 branch: 3.7 author: Victor Stinner committer: GitHub date: 2020-04-03T14:09:02+02:00 summary: bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) (GH-19316) (GH-19318) test_builtin.PtyTests now registers an handler for SIGHUP signal. Closing the PTY file descriptor can emit a SIGHUP signal: just ignore it. run_child() now also closes the PTY file descriptor before waiting for the process completition, otherwise the test hangs on AIX. (cherry picked from commit 7a51a7e19f0143f75f8fc9ff68f93ed40937aec6) (cherry picked from commit 745bd91bab8e57c52d63a2d541465551d7551f78) files: M Lib/test/test_builtin.py M Lib/test/test_pty.py diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index c60560ea6d3a0..40f83de57d6a5 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1639,7 +1639,21 @@ class PtyTests(unittest.TestCase): """Tests that use a pseudo terminal to guarantee stdin and stdout are terminals in the test environment""" + @staticmethod + def handle_sighup(signum, frame): + # bpo-40140: if the process is the session leader, os.close(fd) + # of "pid, fd = pty.fork()" can raise SIGHUP signal: + # just ignore the signal. + pass + def run_child(self, child, terminal_input): + old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) + try: + return self._run_child(child, terminal_input) + finally: + signal.signal(signal.SIGHUP, old_sighup) + + def _run_child(self, child, terminal_input): r, w = os.pipe() # Pipe test results from child back to parent try: pid, fd = pty.fork() @@ -1690,6 +1704,9 @@ def run_child(self, child, terminal_input): child_output = child_output.decode("ascii", "ignore") self.fail("got %d lines in pipe but expected 2, child output was:\n%s" % (len(lines), child_output)) + + # bpo-40155: Close the PTY before waiting for the child process + # completion, otherwise the child process hangs on AIX. os.close(fd) # Wait until the child process completes diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py index ce85f575a0830..dfb3a3fc32644 100644 --- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -70,7 +70,7 @@ def setUp(self): self.addCleanup(signal.signal, signal.SIGALRM, old_alarm) old_sighup = signal.signal(signal.SIGHUP, self.handle_sighup) - self.addCleanup(signal.signal, signal.SIGHUP, old_alarm) + self.addCleanup(signal.signal, signal.SIGHUP, old_sighup) # isatty() and close() can hang on some platforms. Set an alarm # before running the test to make sure we don't hang forever. @@ -81,8 +81,8 @@ def handle_sig(self, sig, frame): self.fail("isatty hung") @staticmethod - def handle_sighup(sig, frame): - # if the process is the session leader, os.close(master_fd) + def handle_sighup(signum, frame): + # bpo-38547: if the process is the session leader, os.close(master_fd) # of "master_fd, slave_name = pty.master_open()" raises SIGHUP # signal: just ignore the signal. pass From webhook-mailer at python.org Fri Apr 3 10:38:36 2020 From: webhook-mailer at python.org (Michael Felt) Date: Fri, 03 Apr 2020 14:38:36 -0000 Subject: [Python-checkins] bpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-19225) Message-ID: https://github.com/python/cpython/commit/76db37b1d37a9daadd9e5b320f2d5a53cd1352ec commit: 76db37b1d37a9daadd9e5b320f2d5a53cd1352ec branch: master author: Michael Felt committer: GitHub date: 2020-04-03T16:38:28+02:00 summary: bpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-19225) files: M Lib/distutils/tests/test_config_cmd.py diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py index b735fd334d878..8bd2c94237846 100644 --- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/distutils/tests/test_config_cmd.py @@ -47,8 +47,7 @@ def test_search_cpp(self): cmd = config(dist) cmd._check_compiler() compiler = cmd.compiler - is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac") - if is_xlc: + if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower(): self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options') # simple pattern searches From webhook-mailer at python.org Fri Apr 3 12:36:43 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Fri, 03 Apr 2020 16:36:43 -0000 Subject: [Python-checkins] bpo-40131: Fix source and target order in zipapp example (GH-19290) Message-ID: https://github.com/python/cpython/commit/bd6a4c3d72828d3d0e13922e165998539d24f8bc commit: bd6a4c3d72828d3d0e13922e165998539d24f8bc branch: master author: Zackery Spytz committer: GitHub date: 2020-04-03T22:06:29+05:30 summary: bpo-40131: Fix source and target order in zipapp example (GH-19290) files: M Doc/library/zipapp.rst diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst index 728315251e082..fb40a2b3e964e 100644 --- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -198,7 +198,7 @@ Pack up a directory into an archive, and run it. The same can be done using the :func:`create_archive` function:: >>> import zipapp - >>> zipapp.create_archive('myapp.pyz', 'myapp') + >>> zipapp.create_archive('myapp', 'myapp.pyz') To make the application directly executable on POSIX, specify an interpreter to use. From webhook-mailer at python.org Fri Apr 3 13:14:03 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 17:14:03 -0000 Subject: [Python-checkins] bpo-40131: Fix source and target order in zipapp example (GH-19290) (GH-19339) Message-ID: https://github.com/python/cpython/commit/e6783981df6ae5c63f73be67cc41b1350bc0fcc6 commit: e6783981df6ae5c63f73be67cc41b1350bc0fcc6 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T22:43:58+05:30 summary: bpo-40131: Fix source and target order in zipapp example (GH-19290) (GH-19339) (cherry picked from commit bd6a4c3d72828d3d0e13922e165998539d24f8bc) Co-authored-by: Zackery Spytz files: M Doc/library/zipapp.rst diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst index 728315251e082..fb40a2b3e964e 100644 --- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -198,7 +198,7 @@ Pack up a directory into an archive, and run it. The same can be done using the :func:`create_archive` function:: >>> import zipapp - >>> zipapp.create_archive('myapp.pyz', 'myapp') + >>> zipapp.create_archive('myapp', 'myapp.pyz') To make the application directly executable on POSIX, specify an interpreter to use. From webhook-mailer at python.org Fri Apr 3 13:14:21 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 17:14:21 -0000 Subject: [Python-checkins] bpo-40131: Fix source and target order in zipapp example (GH-19290) (GH-19340) Message-ID: https://github.com/python/cpython/commit/d19162fe5b2aba48a94278baa0f569fc42932072 commit: d19162fe5b2aba48a94278baa0f569fc42932072 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T22:44:16+05:30 summary: bpo-40131: Fix source and target order in zipapp example (GH-19290) (GH-19340) (cherry picked from commit bd6a4c3d72828d3d0e13922e165998539d24f8bc) Co-authored-by: Zackery Spytz files: M Doc/library/zipapp.rst diff --git a/Doc/library/zipapp.rst b/Doc/library/zipapp.rst index 728315251e082..fb40a2b3e964e 100644 --- a/Doc/library/zipapp.rst +++ b/Doc/library/zipapp.rst @@ -198,7 +198,7 @@ Pack up a directory into an archive, and run it. The same can be done using the :func:`create_archive` function:: >>> import zipapp - >>> zipapp.create_archive('myapp.pyz', 'myapp') + >>> zipapp.create_archive('myapp', 'myapp.pyz') To make the application directly executable on POSIX, specify an interpreter to use. From webhook-mailer at python.org Fri Apr 3 15:14:20 2020 From: webhook-mailer at python.org (Tim Hatch) Date: Fri, 03 Apr 2020 19:14:20 -0000 Subject: [Python-checkins] [3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) (GH-19317) Message-ID: https://github.com/python/cpython/commit/96c5f5a3a3fabf43e8114d0dbc30bed409da1ba6 commit: 96c5f5a3a3fabf43e8114d0dbc30bed409da1ba6 branch: 3.7 author: Tim Hatch committer: GitHub date: 2020-04-03T12:14:15-07:00 summary: [3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) (GH-19317) lib2to3: Support named assignment expressions (GH-12702) There are two copies of the grammar -- the one used by Python itself as Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it to be reasonable stable to avoid requiring fixer rewrites. This brings suport for syntax like `if x:= foo():` to match what the live Python grammar does. This should've been added at the time of the walrus operator itself, but lib2to3 being independent is often overlooked. So we do consider this a bugfix rather than enhancement. (cherry picked from commit 3c3aa4516c70753de06bb142b6793d01330fcf0f) Co-authored-by: Tim Hatch files: A Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst M Lib/lib2to3/Grammar.txt M Lib/lib2to3/pgen2/grammar.py M Lib/lib2to3/pgen2/token.py M Lib/lib2to3/pgen2/tokenize.py M Lib/lib2to3/tests/test_parser.py diff --git a/Lib/lib2to3/Grammar.txt b/Lib/lib2to3/Grammar.txt index 68b73868b5828..8ce7fd8a89da6 100644 --- a/Lib/lib2to3/Grammar.txt +++ b/Lib/lib2to3/Grammar.txt @@ -67,8 +67,8 @@ assert_stmt: 'assert' test [',' test] compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt async_stmt: ASYNC (funcdef | with_stmt | for_stmt) -if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] -while_stmt: 'while' test ':' suite ['else' ':' suite] +if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite] +while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite] for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite] try_stmt: ('try' ':' suite ((except_clause ':' suite)+ @@ -91,6 +91,7 @@ testlist_safe: old_test [(',' old_test)+ [',']] old_test: or_test | old_lambdef old_lambdef: 'lambda' [varargslist] ':' old_test +namedexpr_test: test [':=' test] test: or_test ['if' or_test 'else' test] | lambdef or_test: and_test ('or' and_test)* and_test: not_test ('and' not_test)* @@ -111,8 +112,8 @@ atom: ('(' [yield_expr|testlist_gexp] ')' | '{' [dictsetmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+ | '.' '.' '.') -listmaker: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) -testlist_gexp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) +listmaker: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) +testlist_gexp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] ) lambdef: 'lambda' [varargslist] ':' test trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME subscriptlist: subscript (',' subscript)* [','] @@ -137,6 +138,7 @@ arglist: argument (',' argument)* [','] # multiple (test comp_for) arguments are blocked; keyword unpackings # that precede iterable unpackings are blocked; etc. argument: ( test [comp_for] | + test ':=' test | test '=' test | '**' test | '*' test ) diff --git a/Lib/lib2to3/pgen2/grammar.py b/Lib/lib2to3/pgen2/grammar.py index 088c58bfa99c1..997fdf530f72b 100644 --- a/Lib/lib2to3/pgen2/grammar.py +++ b/Lib/lib2to3/pgen2/grammar.py @@ -202,6 +202,7 @@ def _make_deterministic(top): // DOUBLESLASH //= DOUBLESLASHEQUAL -> RARROW +:= COLONEQUAL """ opmap = {} diff --git a/Lib/lib2to3/pgen2/token.py b/Lib/lib2to3/pgen2/token.py index 1a679554d2db4..5f6612f5b3068 100755 --- a/Lib/lib2to3/pgen2/token.py +++ b/Lib/lib2to3/pgen2/token.py @@ -65,7 +65,8 @@ AWAIT = 56 ASYNC = 57 ERRORTOKEN = 58 -N_TOKENS = 59 +COLONEQUAL = 59 +N_TOKENS = 60 NT_OFFSET = 256 #--end constants-- diff --git a/Lib/lib2to3/pgen2/tokenize.py b/Lib/lib2to3/pgen2/tokenize.py index 279d322971da9..94dd792805eaa 100644 --- a/Lib/lib2to3/pgen2/tokenize.py +++ b/Lib/lib2to3/pgen2/tokenize.py @@ -93,7 +93,7 @@ def _combinations(*l): r"~") Bracket = '[][(){}]' -Special = group(r'\r?\n', r'[:;.,`@]') +Special = group(r'\r?\n', r':=', r'[:;.,`@]') Funny = group(Operator, Bracket, Special) PlainToken = group(Number, Funny, String, Name) diff --git a/Lib/lib2to3/tests/test_parser.py b/Lib/lib2to3/tests/test_parser.py index 7ec881e01a9f8..753c846b7be7a 100644 --- a/Lib/lib2to3/tests/test_parser.py +++ b/Lib/lib2to3/tests/test_parser.py @@ -629,6 +629,21 @@ def test_multiline_str_literals(self): self.validate(s) +class TestNamedAssignments(GrammarTest): + + def test_named_assignment_if(self): + driver.parse_string("if f := x(): pass\n") + + def test_named_assignment_while(self): + driver.parse_string("while f := x(): pass\n") + + def test_named_assignment_generator(self): + driver.parse_string("any((lastNum := num) == 1 for num in [1, 2, 3])\n") + + def test_named_assignment_listcomp(self): + driver.parse_string("[(lastNum := num) == 1 for num in [1, 2, 3]]\n") + + def diff_texts(a, b, filename): a = a.splitlines() b = b.splitlines() diff --git a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst new file mode 100644 index 0000000000000..e7b9dd648b407 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst @@ -0,0 +1,2 @@ +lib2to3 now recognizes named assignment expressions (the walrus operator, +``:=``) From webhook-mailer at python.org Fri Apr 3 15:37:21 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 03 Apr 2020 19:37:21 -0000 Subject: [Python-checkins] bpo-40147: Move the check for duplicate keywords to the compiler (GH-19289) Message-ID: https://github.com/python/cpython/commit/254ec783411d9d16e51f1116f98918be2ef0e884 commit: 254ec783411d9d16e51f1116f98918be2ef0e884 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-03T20:37:13+01:00 summary: bpo-40147: Move the check for duplicate keywords to the compiler (GH-19289) files: M Lib/test/test_metaclass.py M Lib/test/test_syntax.py M Python/ast.c M Python/compile.c diff --git a/Lib/test/test_metaclass.py b/Lib/test/test_metaclass.py index e6fe20a107c23..6edd899b0d213 100644 --- a/Lib/test/test_metaclass.py +++ b/Lib/test/test_metaclass.py @@ -128,7 +128,7 @@ ... Traceback (most recent call last): [...] - SyntaxError: keyword argument repeated + SyntaxError: keyword argument repeated: metaclass >>> Another way. diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 128c4da143841..a7e7e2c9e6f02 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -588,7 +588,7 @@ >>> f(a=23, a=234) Traceback (most recent call last): ... -SyntaxError: keyword argument repeated +SyntaxError: keyword argument repeated: a >>> {1, 2, 3} = 42 Traceback (most recent call last): diff --git a/Python/ast.c b/Python/ast.c index 550ee03b1ac38..6ba62fb479f99 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3048,8 +3048,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, else { /* a keyword argument */ keyword_ty kw; - identifier key, tmp; - int k; + identifier key; // To remain LL(1), the grammar accepts any test (basically, any // expression) in the keyword slot of a call site. So, we need @@ -3093,14 +3092,6 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, if (forbidden_name(c, key, chch, 1)) { return NULL; } - for (k = 0; k < nkeywords; k++) { - tmp = ((keyword_ty)asdl_seq_GET(keywords, k))->arg; - if (tmp && !PyUnicode_Compare(tmp, key)) { - ast_error(c, chch, - "keyword argument repeated"); - return NULL; - } - } e = ast_for_expr(c, CHILD(ch, 2)); if (!e) return NULL; diff --git a/Python/compile.c b/Python/compile.c index 01700e0e78cc9..b1c1982fd2c4a 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4049,6 +4049,31 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) return 1; } +static int +validate_keywords(struct compiler *c, asdl_seq* keywords) { + int nkeywords = asdl_seq_LEN(keywords); + for (int i = 0; i < nkeywords; i++) { + keyword_ty key = ((keyword_ty)asdl_seq_GET(keywords, i)); + if (key->arg == NULL) { + continue; + } + for (int j = i+1; j < nkeywords; j++) { + keyword_ty other = ((keyword_ty)asdl_seq_GET(keywords, j)); + if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) { + PyObject *msg = PyUnicode_FromFormat("keyword argument repeated: %U", key->arg); + if (msg == NULL) { + return -1; + } + c->u->u_col_offset = other->col_offset; + compiler_error(c, PyUnicode_AsUTF8(msg)); + Py_DECREF(msg); + return -1; + } + } + } + return 0; +} + static int compiler_call(struct compiler *c, expr_ty e) { @@ -4165,6 +4190,10 @@ compiler_call_helper(struct compiler *c, { Py_ssize_t i, nseen, nelts, nkwelts; + if (validate_keywords(c, keywords) == -1) { + return 0; + } + nelts = asdl_seq_LEN(args); nkwelts = asdl_seq_LEN(keywords); From webhook-mailer at python.org Fri Apr 3 16:02:34 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 03 Apr 2020 20:02:34 -0000 Subject: [Python-checkins] bpo-40141: Include the value in the column position for keyword AST nodes (GH-19348) Message-ID: https://github.com/python/cpython/commit/40cf35c5b070b3f33aae58a996fea0e8291a8616 commit: 40cf35c5b070b3f33aae58a996fea0e8291a8616 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-03T21:02:26+01:00 summary: bpo-40141: Include the value in the column position for keyword AST nodes (GH-19348) files: M Lib/test/test_ast.py M Python/ast.c diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 6f86eb954ec55..9063b3d2d7b74 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -2006,7 +2006,7 @@ def main(): ('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ('Expression', ('GeneratorExp', (1, 0, 1, 22), ('Tuple', (1, 1, 1, 6), [('Name', (1, 2, 1, 3), 'a', ('Load',)), ('Name', (1, 4, 1, 5), 'b', ('Load',))], ('Load',)), [('comprehension', ('List', (1, 11, 1, 16), [('Name', (1, 12, 1, 13), 'a', ('Store',)), ('Name', (1, 14, 1, 15), 'b', ('Store',))], ('Store',)), ('Name', (1, 20, 1, 21), 'c', ('Load',)), [], 0)])), ('Expression', ('Compare', (1, 0, 1, 9), ('Constant', (1, 0, 1, 1), 1, None), [('Lt',), ('Lt',)], [('Constant', (1, 4, 1, 5), 2, None), ('Constant', (1, 8, 1, 9), 3, None)])), -('Expression', ('Call', (1, 0, 1, 17), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Constant', (1, 2, 1, 3), 1, None), ('Constant', (1, 4, 1, 5), 2, None), ('Starred', (1, 10, 1, 12), ('Name', (1, 11, 1, 12), 'd', ('Load',)), ('Load',))], [('keyword', (1, 6, 1, 7), 'c', ('Constant', (1, 8, 1, 9), 3, None)), ('keyword', (1, 13, 1, 16), None, ('Name', (1, 15, 1, 16), 'e', ('Load',)))])), +('Expression', ('Call', (1, 0, 1, 17), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Constant', (1, 2, 1, 3), 1, None), ('Constant', (1, 4, 1, 5), 2, None), ('Starred', (1, 10, 1, 12), ('Name', (1, 11, 1, 12), 'd', ('Load',)), ('Load',))], [('keyword', (1, 6, 1, 9), 'c', ('Constant', (1, 8, 1, 9), 3, None)), ('keyword', (1, 13, 1, 16), None, ('Name', (1, 15, 1, 16), 'e', ('Load',)))])), ('Expression', ('Call', (1, 0, 1, 10), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('Starred', (1, 2, 1, 9), ('List', (1, 3, 1, 9), [('Constant', (1, 4, 1, 5), 0, None), ('Constant', (1, 7, 1, 8), 1, None)], ('Load',)), ('Load',))], [])), ('Expression', ('Call', (1, 0, 1, 15), ('Name', (1, 0, 1, 1), 'f', ('Load',)), [('GeneratorExp', (1, 1, 1, 15), ('Name', (1, 2, 1, 3), 'a', ('Load',)), [('comprehension', ('Name', (1, 8, 1, 9), 'a', ('Store',)), ('Name', (1, 13, 1, 14), 'b', ('Load',)), [], 0)])], [])), ('Expression', ('Constant', (1, 0, 1, 2), 10, None)), diff --git a/Python/ast.c b/Python/ast.c index 6ba62fb479f99..0f23f6762d8c1 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3096,7 +3096,7 @@ ast_for_call(struct compiling *c, const node *n, expr_ty func, if (!e) return NULL; kw = keyword(key, e, chch->n_lineno, chch->n_col_offset, - chch->n_end_lineno, chch->n_end_col_offset, c->c_arena); + e->end_lineno, e->end_col_offset, c->c_arena); if (!kw) return NULL; From webhook-mailer at python.org Fri Apr 3 16:03:59 2020 From: webhook-mailer at python.org (Chris Martinez) Date: Fri, 03 Apr 2020 20:03:59 -0000 Subject: [Python-checkins] bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343) Message-ID: https://github.com/python/cpython/commit/6e623ff9d251e0ce86e9b18a01bfd6f067079d7a commit: 6e623ff9d251e0ce86e9b18a01bfd6f067079d7a branch: master author: Chris Martinez committer: GitHub date: 2020-04-03T21:03:54+01:00 summary: bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343) Fix default Python home path relative to the NuGet package files: A Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst M PC/layout/support/props.py diff --git a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst new file mode 100644 index 0000000000000..a81548c3f9cdf --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst @@ -0,0 +1 @@ +Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) \ No newline at end of file diff --git a/PC/layout/support/props.py b/PC/layout/support/props.py index b1560b5244762..1eb9b7c06da51 100644 --- a/PC/layout/support/props.py +++ b/PC/layout/support/props.py @@ -29,8 +29,7 @@ PROPS_TEMPLATE = r""" - $([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python_d.exe") - $([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python.exe") + $([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\..\..\tools")) $(PythonHome)\include $(PythonHome)\libs {PYTHON_TAG} From webhook-mailer at python.org Fri Apr 3 18:18:33 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 22:18:33 -0000 Subject: [Python-checkins] bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343) Message-ID: https://github.com/python/cpython/commit/7f70456b92c9ff0bcc4df2a2cec213ab2a897591 commit: 7f70456b92c9ff0bcc4df2a2cec213ab2a897591 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T23:18:26+01:00 summary: bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343) Fix default Python home path relative to the NuGet package (cherry picked from commit 6e623ff9d251e0ce86e9b18a01bfd6f067079d7a) Co-authored-by: Chris Martinez files: A Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst M PC/layout/support/props.py diff --git a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst new file mode 100644 index 0000000000000..a81548c3f9cdf --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst @@ -0,0 +1 @@ +Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) \ No newline at end of file diff --git a/PC/layout/support/props.py b/PC/layout/support/props.py index 3a047d2150583..4a0d65dea4bc1 100644 --- a/PC/layout/support/props.py +++ b/PC/layout/support/props.py @@ -41,8 +41,7 @@ def public(f): PROPS_TEMPLATE = r""" - $([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python_d.exe") - $([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python.exe") + $([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\..\..\tools")) $(PythonHome)\include $(PythonHome)\libs {PYTHON_TAG} From webhook-mailer at python.org Fri Apr 3 18:20:22 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 03 Apr 2020 22:20:22 -0000 Subject: [Python-checkins] bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343) Message-ID: https://github.com/python/cpython/commit/e6685ad05385f8cb492e8e1c7c07889a94517f55 commit: e6685ad05385f8cb492e8e1c7c07889a94517f55 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T23:20:12+01:00 summary: bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343) Fix default Python home path relative to the NuGet package (cherry picked from commit 6e623ff9d251e0ce86e9b18a01bfd6f067079d7a) Co-authored-by: Chris Martinez files: A Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst M PC/layout/support/props.py diff --git a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst new file mode 100644 index 0000000000000..a81548c3f9cdf --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst @@ -0,0 +1 @@ +Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) \ No newline at end of file diff --git a/PC/layout/support/props.py b/PC/layout/support/props.py index b1560b5244762..1eb9b7c06da51 100644 --- a/PC/layout/support/props.py +++ b/PC/layout/support/props.py @@ -29,8 +29,7 @@ PROPS_TEMPLATE = r""" - $([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python_d.exe") - $([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python.exe") + $([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\..\..\tools")) $(PythonHome)\include $(PythonHome)\libs {PYTHON_TAG} From webhook-mailer at python.org Fri Apr 3 20:34:47 2020 From: webhook-mailer at python.org (Ned Deily) Date: Sat, 04 Apr 2020 00:34:47 -0000 Subject: [Python-checkins] Update macOS installer build for 2.7.18 end-of-life. (GH-19352) Message-ID: https://github.com/python/cpython/commit/8a0a50084fb9721daa9fabcfd4725d027f8414f2 commit: 8a0a50084fb9721daa9fabcfd4725d027f8414f2 branch: 2.7 author: Ned Deily committer: GitHub date: 2020-04-03T20:34:39-04:00 summary: Update macOS installer build for 2.7.18 end-of-life. (GH-19352) files: M Lib/test/test_posix.py M Mac/BuildScript/build-installer.py M Mac/BuildScript/resources/ReadMe.rtf M Mac/BuildScript/resources/Welcome.rtf diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index c4283b604b96a..ae636e591a9ef 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -556,7 +556,11 @@ def _create_and_do_getcwd(dirname, current_path_length = 0): ) if quirky_platform: expected_errno = errno.ERANGE - self.assertEqual(e.errno, expected_errno) + if 'darwin' in sys.platform: + # macOS 10.15 may return errno.ENOENT instead + self.assertIn(e.errno, (errno.ENOENT, errno.ENAMETOOLONG)) + else: + self.assertEqual(e.errno, expected_errno) finally: os.chdir('..') os.rmdir(dirname) diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 3edd947f0df14..4bb942a733b86 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -25,11 +25,11 @@ For 10.6 or greater deployment targets, build-installer builds and links with its own copy of Tcl/Tk 8.6 and the rest of this paragraph does not apply. Otherwise, build-installer requires an installed third-party version -of Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) or Tcl/TK 8.5 -(for 10.6 or later) installed in /Library/Frameworks. When installed, -the Python built by this script will attempt to dynamically link first to -Tcl and Tk frameworks in /Library/Frameworks if available otherwise fall -back to the ones in /System/Library/Framework. For the build, we recommend +of Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) installed in +/Library/Frameworks. For 10.4 or 10.5, the Python built by this script +when installed will attempt to dynamically link first to Tcl and Tk frameworks +in /Library/Frameworks if available otherwise fall back to the ones in +/System/Library/Framework. For 10.4 or 10.5, we recommend installing the most recent ActiveTcl 8.5 or 8.4 version, depending on the deployment target. The actual version linked to depends on the path of /Library/Frameworks/{Tcl,Tk}.framework/Versions/Current. @@ -213,9 +213,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.0.2t", - url="https://www.openssl.org/source/openssl-1.0.2t.tar.gz", - checksum='ef66581b80f06eae42f5268bc0b50c6d', + name="OpenSSL 1.0.2u", + url="https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz", + checksum='cdc2638f789ecc2db2c91488265686c1', buildrecipe=build_universal_openssl, configure=None, install=None, @@ -311,9 +311,9 @@ def library_recipes(): ), ), dict( - name="SQLite 3.28.0", - url="https://www.sqlite.org/2019/sqlite-autoconf-3280000.tar.gz", - checksum='3c68eb400f8354605736cd55400e1572', + name="SQLite 3.31.1", + url="https://sqlite.org/2020/sqlite-autoconf-3310100.tar.gz", + checksum='2d0a553534c521504e3ac3ad3b90f125', extra_cflags=('-Os ' '-DSQLITE_ENABLE_FTS5 ' '-DSQLITE_ENABLE_FTS4 ' diff --git a/Mac/BuildScript/resources/ReadMe.rtf b/Mac/BuildScript/resources/ReadMe.rtf index a4c351a7ff78a..d49bab5c3f1ae 100644 --- a/Mac/BuildScript/resources/ReadMe.rtf +++ b/Mac/BuildScript/resources/ReadMe.rtf @@ -1,5 +1,5 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 -{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;\f2\fswiss\fcharset0 Helvetica-Oblique; +{\rtf1\ansi\ansicpg1252\cocoartf2512 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;\f2\fswiss\fcharset0 Helvetica-Oblique; \f3\fmodern\fcharset0 CourierNewPSMT;} {\colortbl;\red255\green255\blue255;} {\*\expandedcolortbl;;} @@ -9,8 +9,8 @@ \f0\fs24 \cf0 This package will install Python $FULL_VERSION for macOS $MACOSX_DEPLOYMENT_TARGET for the following architecture(s): $ARCHITECTURES.\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\partightenfactor0 -\cf0 NOTE: -\f1\b \ul Python 2 reaches end-of-life in 2020 and will no longer be supported or updated thereafter\ulnone . + +\f1\b \cf0 NOTE: \ul Python 2.7,x has now reached end-of-life. This release, Python 2.7.18, is the FINAL RELEASE of Python 2.7.x. It will no longer be supported or updated\ulnone . \f0\b0 You should \f1\b upgrade to Python 3 \f0\b0 as soon as you can. {\field{\*\fldinst{HYPERLINK "https://www.python.org/doc/sunset-python-2/"}}{\fldrslt Read more here}}.\ @@ -44,18 +44,14 @@ The bundled \f0\b0 \ulnone \ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\partightenfactor0 -\cf0 In almost all cases, you should use the +\cf0 Use the \f1\b macOS 64-bit installer for OS X 10.9 and later -\f0\b0 .\ -\ -The legacy +\f0\b0 . As of 2.7.18, the deprecated \f1\b macOS 64-bit/32-bit installer for Mac OS X 10.6 and later -\f0\b0 variant is now deprecated. macOS 10.6 Snow Leopard was released in 2009 and has not been supported by Apple for many years including lack of security updates. It is becoming increasingly difficult to ensure new Python features and bug fixes are compatible with such old systems. Note that, due to recent Apple installer packaging changes, the 10.6+ installer pkg we provide can no longer be opened by the Apple system installer application on 10.6; 10.7 and 10.8 are not affected. We believe that there is now very little usage of this installer variant and so we would like to focus our resources on supporting newer systems. We do not plan to intentionally break Python support on 10.6 through 10.8 and we will consider bug fixes for problems found when building from source on those systems through the support window of Python 2.7. -\f1\b macOS 10.15 Catalina -\f0\b0 removes support for running 32-bit architecture programs; we do not recommend trying to use the 10.6+ variant on it and it may not install on 10.15 systems without intervention. \ +\f0\b0 variant is no longer provided. \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 -\f1\b \cf0 \ul \ +\f1\b \cf0 \ul \ulc0 \ Using IDLE or other Tk applications \f0\b0 \ulnone \ \ diff --git a/Mac/BuildScript/resources/Welcome.rtf b/Mac/BuildScript/resources/Welcome.rtf index 2786a74985488..fa398acfc9e3b 100644 --- a/Mac/BuildScript/resources/Welcome.rtf +++ b/Mac/BuildScript/resources/Welcome.rtf @@ -1,5 +1,5 @@ -{\rtf1\ansi\ansicpg1252\cocoartf1671\cocoasubrtf600 -\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;\f2\fmodern\fcharset0 CourierNewPSMT; +{\rtf1\ansi\ansicpg1252\cocoartf2512 +\cocoascreenfonts1\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;\f2\fmodern\fcharset0 CourierNewPSMT; } {\colortbl;\red255\green255\blue255;} {\*\expandedcolortbl;;} @@ -26,7 +26,7 @@ At the end of this install, click on \f0 to install a set of current SSL root certificates.\ \ -\f1\b NOTE: \ul Python 2 reaches end-of-life in 2020 and will no longer be supported or updated thereafter\ulnone . +\f1\b NOTE: \ul Python 2.7,x has now reached end-of-life. This release, Python 2.7.18, is the FINAL RELEASE of Python 2.7.x. It will no longer be supported or updated\ulnone . \f0\b0 You should \f1\b upgrade to Python 3 \f0\b0 as soon as you can. {\field{\*\fldinst{HYPERLINK "https://www.python.org/doc/sunset-python-2/"}}{\fldrslt Read more here}}.\ From webhook-mailer at python.org Fri Apr 3 23:06:06 2020 From: webhook-mailer at python.org (Tal Einat) Date: Sat, 04 Apr 2020 03:06:06 -0000 Subject: [Python-checkins] bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152) Message-ID: https://github.com/python/cpython/commit/52013e5b6d5ca32eef5a3d65ecdf7db89cefc2fd commit: 52013e5b6d5ca32eef5a3d65ecdf7db89cefc2fd branch: master author: Tal Einat committer: GitHub date: 2020-04-03T23:05:58-04:00 summary: bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152) Inspect.signature failed on the test case because its isinstance call raised. files: A Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst M Lib/idlelib/NEWS.txt M Lib/idlelib/calltip.py M Lib/idlelib/idle_test/test_calltip.py diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 3a4873b624f1e..46b15234a19c6 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2020-10-05? ====================================== +bpo-38689: IDLE will no longer freeze when inspect.signature fails +when fetching a calltip. + bpo-27115: For 'Go to Line', use a Query entry box subclass with IDLE standard behavior and improved error checking. diff --git a/Lib/idlelib/calltip.py b/Lib/idlelib/calltip.py index 2e0db60d476ae..d4092c7847186 100644 --- a/Lib/idlelib/calltip.py +++ b/Lib/idlelib/calltip.py @@ -129,20 +129,22 @@ def get_argspec(ob): empty line or _MAX_LINES. For builtins, this typically includes the arguments in addition to the return value. ''' - argspec = default = "" + # Determine function object fob to inspect. try: ob_call = ob.__call__ - except BaseException: - return default - + except BaseException: # Buggy user object could raise anything. + return '' # No popup for non-callables. fob = ob_call if isinstance(ob_call, types.MethodType) else ob + # Initialize argspec and wrap it to get lines. try: argspec = str(inspect.signature(fob)) - except ValueError as err: + except Exception as err: msg = str(err) if msg.startswith(_invalid_method): return _invalid_method + else: + argspec = '' if '/' in argspec and len(argspec) < _MAX_COLS - len(_argument_positional): # Add explanation TODO remove after 3.7, before 3.9. @@ -154,6 +156,7 @@ def get_argspec(ob): lines = (textwrap.wrap(argspec, _MAX_COLS, subsequent_indent=_INDENT) if len(argspec) > _MAX_COLS else [argspec] if argspec else []) + # Augment lines from docstring, if any, and join to get argspec. if isinstance(ob_call, types.MethodType): doc = ob_call.__doc__ else: @@ -167,9 +170,8 @@ def get_argspec(ob): line = line[: _MAX_COLS - 3] + '...' lines.append(line) argspec = '\n'.join(lines) - if not argspec: - argspec = _default_callable_argspec - return argspec + + return argspec or _default_callable_argspec if __name__ == '__main__': diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py index 886959b17074f..d386b5cd81321 100644 --- a/Lib/idlelib/idle_test/test_calltip.py +++ b/Lib/idlelib/idle_test/test_calltip.py @@ -219,20 +219,30 @@ def test_no_docstring(self): with self.subTest(meth=meth, mtip=mtip): self.assertEqual(get_spec(meth), mtip) - def test_attribute_exception(self): + def test_buggy_getattr_class(self): class NoCall: - def __getattr__(self, name): - raise BaseException + def __getattr__(self, name): # Not invoked for class attribute. + raise IndexError # Bug. class CallA(NoCall): - def __call__(oui, a, b, c): + def __call__(self, ci): # Bug does not matter. pass class CallB(NoCall): - def __call__(self, ci): + def __call__(oui, a, b, c): # Non-standard 'self'. pass for meth, mtip in ((NoCall, default_tip), (CallA, default_tip), - (NoCall(), ''), (CallA(), '(a, b, c)'), - (CallB(), '(ci)')): + (NoCall(), ''), (CallA(), '(ci)'), + (CallB(), '(a, b, c)')): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_metaclass_class(self): # Failure case for issue 38689. + class Type(type): # Type() requires 3 type args, returns class. + __class__ = property({}.__getitem__, {}.__setitem__) + class Object(metaclass=Type): + __slots__ = '__class__' + for meth, mtip in ((Type, default_tip), (Object, default_tip), + (Object(), '')): with self.subTest(meth=meth, mtip=mtip): self.assertEqual(get_spec(meth), mtip) diff --git a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst b/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst new file mode 100644 index 0000000000000..f4f4a2e9afd85 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst @@ -0,0 +1,2 @@ +IDLE will no longer freeze when inspect.signature fails when fetching +a calltip. From webhook-mailer at python.org Fri Apr 3 23:24:47 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 04 Apr 2020 03:24:47 -0000 Subject: [Python-checkins] bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152) Message-ID: https://github.com/python/cpython/commit/681044a0ab6c93554ff8d003c7f9fe5fdb0c83ba commit: 681044a0ab6c93554ff8d003c7f9fe5fdb0c83ba branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T20:24:39-07:00 summary: bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152) Inspect.signature failed on the test case because its isinstance call raised. (cherry picked from commit 52013e5b6d5ca32eef5a3d65ecdf7db89cefc2fd) Co-authored-by: Tal Einat files: A Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst M Lib/idlelib/NEWS.txt M Lib/idlelib/calltip.py M Lib/idlelib/idle_test/test_calltip.py diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index dc2aeb96ee022..93084bfc2e554 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2019-12-16? ====================================== +bpo-38689: IDLE will no longer freeze when inspect.signature fails +when fetching a calltip. + bpo-27115: For 'Go to Line', use a Query entry box subclass with IDLE standard behavior and improved error checking. diff --git a/Lib/idlelib/calltip.py b/Lib/idlelib/calltip.py index 2e0db60d476ae..d4092c7847186 100644 --- a/Lib/idlelib/calltip.py +++ b/Lib/idlelib/calltip.py @@ -129,20 +129,22 @@ def get_argspec(ob): empty line or _MAX_LINES. For builtins, this typically includes the arguments in addition to the return value. ''' - argspec = default = "" + # Determine function object fob to inspect. try: ob_call = ob.__call__ - except BaseException: - return default - + except BaseException: # Buggy user object could raise anything. + return '' # No popup for non-callables. fob = ob_call if isinstance(ob_call, types.MethodType) else ob + # Initialize argspec and wrap it to get lines. try: argspec = str(inspect.signature(fob)) - except ValueError as err: + except Exception as err: msg = str(err) if msg.startswith(_invalid_method): return _invalid_method + else: + argspec = '' if '/' in argspec and len(argspec) < _MAX_COLS - len(_argument_positional): # Add explanation TODO remove after 3.7, before 3.9. @@ -154,6 +156,7 @@ def get_argspec(ob): lines = (textwrap.wrap(argspec, _MAX_COLS, subsequent_indent=_INDENT) if len(argspec) > _MAX_COLS else [argspec] if argspec else []) + # Augment lines from docstring, if any, and join to get argspec. if isinstance(ob_call, types.MethodType): doc = ob_call.__doc__ else: @@ -167,9 +170,8 @@ def get_argspec(ob): line = line[: _MAX_COLS - 3] + '...' lines.append(line) argspec = '\n'.join(lines) - if not argspec: - argspec = _default_callable_argspec - return argspec + + return argspec or _default_callable_argspec if __name__ == '__main__': diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py index 886959b17074f..d386b5cd81321 100644 --- a/Lib/idlelib/idle_test/test_calltip.py +++ b/Lib/idlelib/idle_test/test_calltip.py @@ -219,20 +219,30 @@ def test_no_docstring(self): with self.subTest(meth=meth, mtip=mtip): self.assertEqual(get_spec(meth), mtip) - def test_attribute_exception(self): + def test_buggy_getattr_class(self): class NoCall: - def __getattr__(self, name): - raise BaseException + def __getattr__(self, name): # Not invoked for class attribute. + raise IndexError # Bug. class CallA(NoCall): - def __call__(oui, a, b, c): + def __call__(self, ci): # Bug does not matter. pass class CallB(NoCall): - def __call__(self, ci): + def __call__(oui, a, b, c): # Non-standard 'self'. pass for meth, mtip in ((NoCall, default_tip), (CallA, default_tip), - (NoCall(), ''), (CallA(), '(a, b, c)'), - (CallB(), '(ci)')): + (NoCall(), ''), (CallA(), '(ci)'), + (CallB(), '(a, b, c)')): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_metaclass_class(self): # Failure case for issue 38689. + class Type(type): # Type() requires 3 type args, returns class. + __class__ = property({}.__getitem__, {}.__setitem__) + class Object(metaclass=Type): + __slots__ = '__class__' + for meth, mtip in ((Type, default_tip), (Object, default_tip), + (Object(), '')): with self.subTest(meth=meth, mtip=mtip): self.assertEqual(get_spec(meth), mtip) diff --git a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst b/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst new file mode 100644 index 0000000000000..f4f4a2e9afd85 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst @@ -0,0 +1,2 @@ +IDLE will no longer freeze when inspect.signature fails when fetching +a calltip. From webhook-mailer at python.org Fri Apr 3 23:25:13 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 04 Apr 2020 03:25:13 -0000 Subject: [Python-checkins] bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152) Message-ID: https://github.com/python/cpython/commit/15337726e5b92976c2815d05c514804e9aa49a8c commit: 15337726e5b92976c2815d05c514804e9aa49a8c branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-03T20:25:06-07:00 summary: bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152) Inspect.signature failed on the test case because its isinstance call raised. (cherry picked from commit 52013e5b6d5ca32eef5a3d65ecdf7db89cefc2fd) Co-authored-by: Tal Einat files: A Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst M Lib/idlelib/NEWS.txt M Lib/idlelib/calltip.py M Lib/idlelib/idle_test/test_calltip.py diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 3951fd8400214..de7543e370198 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ Released on 2019-12-16? ====================================== +bpo-38689: IDLE will no longer freeze when inspect.signature fails +when fetching a calltip. + bpo-27115: For 'Go to Line', use a Query entry box subclass with IDLE standard behavior and improved error checking. diff --git a/Lib/idlelib/calltip.py b/Lib/idlelib/calltip.py index 2e0db60d476ae..d4092c7847186 100644 --- a/Lib/idlelib/calltip.py +++ b/Lib/idlelib/calltip.py @@ -129,20 +129,22 @@ def get_argspec(ob): empty line or _MAX_LINES. For builtins, this typically includes the arguments in addition to the return value. ''' - argspec = default = "" + # Determine function object fob to inspect. try: ob_call = ob.__call__ - except BaseException: - return default - + except BaseException: # Buggy user object could raise anything. + return '' # No popup for non-callables. fob = ob_call if isinstance(ob_call, types.MethodType) else ob + # Initialize argspec and wrap it to get lines. try: argspec = str(inspect.signature(fob)) - except ValueError as err: + except Exception as err: msg = str(err) if msg.startswith(_invalid_method): return _invalid_method + else: + argspec = '' if '/' in argspec and len(argspec) < _MAX_COLS - len(_argument_positional): # Add explanation TODO remove after 3.7, before 3.9. @@ -154,6 +156,7 @@ def get_argspec(ob): lines = (textwrap.wrap(argspec, _MAX_COLS, subsequent_indent=_INDENT) if len(argspec) > _MAX_COLS else [argspec] if argspec else []) + # Augment lines from docstring, if any, and join to get argspec. if isinstance(ob_call, types.MethodType): doc = ob_call.__doc__ else: @@ -167,9 +170,8 @@ def get_argspec(ob): line = line[: _MAX_COLS - 3] + '...' lines.append(line) argspec = '\n'.join(lines) - if not argspec: - argspec = _default_callable_argspec - return argspec + + return argspec or _default_callable_argspec if __name__ == '__main__': diff --git a/Lib/idlelib/idle_test/test_calltip.py b/Lib/idlelib/idle_test/test_calltip.py index 886959b17074f..d386b5cd81321 100644 --- a/Lib/idlelib/idle_test/test_calltip.py +++ b/Lib/idlelib/idle_test/test_calltip.py @@ -219,20 +219,30 @@ def test_no_docstring(self): with self.subTest(meth=meth, mtip=mtip): self.assertEqual(get_spec(meth), mtip) - def test_attribute_exception(self): + def test_buggy_getattr_class(self): class NoCall: - def __getattr__(self, name): - raise BaseException + def __getattr__(self, name): # Not invoked for class attribute. + raise IndexError # Bug. class CallA(NoCall): - def __call__(oui, a, b, c): + def __call__(self, ci): # Bug does not matter. pass class CallB(NoCall): - def __call__(self, ci): + def __call__(oui, a, b, c): # Non-standard 'self'. pass for meth, mtip in ((NoCall, default_tip), (CallA, default_tip), - (NoCall(), ''), (CallA(), '(a, b, c)'), - (CallB(), '(ci)')): + (NoCall(), ''), (CallA(), '(ci)'), + (CallB(), '(a, b, c)')): + with self.subTest(meth=meth, mtip=mtip): + self.assertEqual(get_spec(meth), mtip) + + def test_metaclass_class(self): # Failure case for issue 38689. + class Type(type): # Type() requires 3 type args, returns class. + __class__ = property({}.__getitem__, {}.__setitem__) + class Object(metaclass=Type): + __slots__ = '__class__' + for meth, mtip in ((Type, default_tip), (Object, default_tip), + (Object(), '')): with self.subTest(meth=meth, mtip=mtip): self.assertEqual(get_spec(meth), mtip) diff --git a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst b/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst new file mode 100644 index 0000000000000..f4f4a2e9afd85 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst @@ -0,0 +1,2 @@ +IDLE will no longer freeze when inspect.signature fails when fetching +a calltip. From webhook-mailer at python.org Sat Apr 4 10:19:16 2020 From: webhook-mailer at python.org (Steve Dower) Date: Sat, 04 Apr 2020 14:19:16 -0000 Subject: [Python-checkins] bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) Message-ID: https://github.com/python/cpython/commit/a1d4dbdfc78e3aed4c245e1810ef24eaa4e744c2 commit: a1d4dbdfc78e3aed4c245e1810ef24eaa4e744c2 branch: master author: Steve Dower committer: GitHub date: 2020-04-04T15:19:08+01:00 summary: bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) files: A Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst M PCbuild/get_externals.bat M PCbuild/python.props diff --git a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst new file mode 100644 index 0000000000000..0bb874b138b33 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst @@ -0,0 +1 @@ +Updates Windows to OpenSSL 1.1.1f diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index a079b752ce559..fa27cdf369d9a 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ echo.Fetching external libraries... set libraries= set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1d +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1f set libraries=%libraries% sqlite-3.31.1.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0 @@ -77,7 +77,7 @@ echo.Fetching external binaries... set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1d +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1f if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index 4cba669a427bc..d1d16d61be869 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -62,8 +62,8 @@ $(ExternalsDir)libffi\ $(ExternalsDir)libffi\$(ArchName)\ $(libffiOutDir)include - $(ExternalsDir)openssl-1.1.1d\ - $(ExternalsDir)openssl-bin-1.1.1d\$(ArchName)\ + $(ExternalsDir)openssl-1.1.1f\ + $(ExternalsDir)openssl-bin-1.1.1f\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.2.11\ From webhook-mailer at python.org Sat Apr 4 10:47:47 2020 From: webhook-mailer at python.org (Steve Dower) Date: Sat, 04 Apr 2020 14:47:47 -0000 Subject: [Python-checkins] bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) Message-ID: https://github.com/python/cpython/commit/37126e7bd242bce03f3c4f208d8871edd3febcbe commit: 37126e7bd242bce03f3c4f208d8871edd3febcbe branch: 3.8 author: Steve Dower committer: GitHub date: 2020-04-04T15:47:40+01:00 summary: bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) files: A Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst M PCbuild/get_externals.bat M PCbuild/python.props diff --git a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst new file mode 100644 index 0000000000000..0bb874b138b33 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst @@ -0,0 +1 @@ +Updates Windows to OpenSSL 1.1.1f diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 36ccbd38ad102..dca0b4587793b 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ echo.Fetching external libraries... set libraries= set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.3.0-rc0-r1 -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1d +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1f set libraries=%libraries% sqlite-3.31.1.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0 @@ -77,7 +77,7 @@ echo.Fetching external binaries... set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1d +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1f if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index 4cba669a427bc..d1d16d61be869 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -62,8 +62,8 @@ $(ExternalsDir)libffi\ $(ExternalsDir)libffi\$(ArchName)\ $(libffiOutDir)include - $(ExternalsDir)openssl-1.1.1d\ - $(ExternalsDir)openssl-bin-1.1.1d\$(ArchName)\ + $(ExternalsDir)openssl-1.1.1f\ + $(ExternalsDir)openssl-bin-1.1.1f\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.2.11\ From webhook-mailer at python.org Sat Apr 4 10:47:51 2020 From: webhook-mailer at python.org (Steve Dower) Date: Sat, 04 Apr 2020 14:47:51 -0000 Subject: [Python-checkins] bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) Message-ID: https://github.com/python/cpython/commit/e7a47c23dd25a144ec4afc2db46393818694926f commit: e7a47c23dd25a144ec4afc2db46393818694926f branch: 3.7 author: Steve Dower committer: GitHub date: 2020-04-04T15:47:46+01:00 summary: bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) files: A Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst M PCbuild/get_externals.bat M PCbuild/python.props diff --git a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst new file mode 100644 index 0000000000000..0bb874b138b33 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst @@ -0,0 +1 @@ +Updates Windows to OpenSSL 1.1.1f diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index cbf193b665c52..f0e58e64dda53 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -49,7 +49,7 @@ echo.Fetching external libraries... set libraries= set libraries=%libraries% bzip2-1.0.6 -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1d +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1f set libraries=%libraries% sqlite-3.31.1.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.9.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.9.0 @@ -72,7 +72,7 @@ for %%e in (%libraries%) do ( echo.Fetching external binaries... set binaries= -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1d +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1f if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.9.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index 7ff32a81b6a52..b68191ba754d0 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -49,8 +49,8 @@ $(ExternalsDir)sqlite-3.31.1.0\ $(ExternalsDir)bzip2-1.0.6\ $(ExternalsDir)xz-5.2.2\ - $(ExternalsDir)openssl-1.1.1d\ - $(ExternalsDir)openssl-bin-1.1.1d\$(ArchName)\ + $(ExternalsDir)openssl-1.1.1f\ + $(ExternalsDir)openssl-bin-1.1.1f\$(ArchName)\ $(opensslOutDir)include $(ExternalsDir)\nasm-2.11.06\ $(ExternalsDir)\zlib-1.2.11\ From webhook-mailer at python.org Sat Apr 4 14:03:08 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Sat, 04 Apr 2020 18:03:08 -0000 Subject: [Python-checkins] Convert tuples to sets for faster searches (GH-19365) Message-ID: https://github.com/python/cpython/commit/1ae6445391cc3519733df69a4448059d6eff3c6f commit: 1ae6445391cc3519733df69a4448059d6eff3c6f branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-04T11:03:04-07:00 summary: Convert tuples to sets for faster searches (GH-19365) files: M Lib/typing.py diff --git a/Lib/typing.py b/Lib/typing.py index 0a685d304bd96..53518830002ca 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1716,11 +1716,11 @@ def _make_nmtuple(name, types): # attributes prohibited to set in NamedTuple class syntax -_prohibited = ('__new__', '__init__', '__slots__', '__getnewargs__', +_prohibited = {'__new__', '__init__', '__slots__', '__getnewargs__', '_fields', '_field_defaults', '_field_types', - '_make', '_replace', '_asdict', '_source') + '_make', '_replace', '_asdict', '_source'} -_special = ('__module__', '__name__', '__annotations__') +_special = {'__module__', '__name__', '__annotations__'} class NamedTupleMeta(type): From webhook-mailer at python.org Sat Apr 4 14:31:35 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 04 Apr 2020 18:31:35 -0000 Subject: [Python-checkins] bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363) Message-ID: https://github.com/python/cpython/commit/a94e6272f16381349dbed74cdb738ec8ae23b4fe commit: a94e6272f16381349dbed74cdb738ec8ae23b4fe branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-04T21:31:30+03:00 summary: bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363) files: A Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.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 8d6262b9c1b02..3a0edb9e2d323 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3626,6 +3626,13 @@ def _source(self): return 'no chance for this as well' """) + def test_multiple_inheritance(self): + class A: + pass + with self.assertRaises(TypeError): + class X(NamedTuple, A): + x: int + def test_namedtuple_keyword_usage(self): LocalEmployee = NamedTuple("LocalEmployee", name=str, age=int) nick = LocalEmployee('Nick', 25) diff --git a/Lib/typing.py b/Lib/typing.py index 53518830002ca..99355d0066647 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1728,6 +1728,9 @@ class NamedTupleMeta(type): def __new__(cls, typename, bases, ns): if ns.get('_root', False): return super().__new__(cls, typename, bases, ns) + if len(bases) > 1: + raise TypeError("Multiple inheritance with NamedTuple is not supported") + assert bases[0] is NamedTuple types = ns.get('__annotations__', {}) nm_tpl = _make_nmtuple(typename, types.items()) defaults = [] diff --git a/Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rst b/Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rst new file mode 100644 index 0000000000000..cd5c0d729f1e7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rst @@ -0,0 +1,2 @@ +Multiple inheritance with :class:`typing.NamedTuple` now raises an error +instead of silently ignoring other types. From webhook-mailer at python.org Sat Apr 4 15:24:24 2020 From: webhook-mailer at python.org (Hai Shi) Date: Sat, 04 Apr 2020 19:24:24 -0000 Subject: [Python-checkins] bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344) Message-ID: https://github.com/python/cpython/commit/b709302f3125622986bd458dfb2954fda5e8366d commit: b709302f3125622986bd458dfb2954fda5e8366d branch: master author: Hai Shi committer: GitHub date: 2020-04-04T21:24:16+02:00 summary: bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344) Fix possible refleaks in _json module, memo of PyScannerObject should be traversed. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst M Modules/_json.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst new file mode 100644 index 0000000000000..21ed615917c59 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst @@ -0,0 +1 @@ +Fix possible refleaks in :mod:`_json`, memo of PyScannerObject should be traversed. diff --git a/Modules/_json.c b/Modules/_json.c index 4682cf84621ee..8117d1601bd3f 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -652,6 +652,7 @@ scanner_traverse(PyScannerObject *self, visitproc visit, void *arg) Py_VISIT(self->parse_float); Py_VISIT(self->parse_int); Py_VISIT(self->parse_constant); + Py_VISIT(self->memo); return 0; } From webhook-mailer at python.org Sat Apr 4 17:43:11 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 04 Apr 2020 21:43:11 -0000 Subject: [Python-checkins] bpo-36320: Use the deprecated-removed directive for _field_types (GH-19370) Message-ID: https://github.com/python/cpython/commit/0d1d7c8bae3f9fe9e937d2931dcbbd3555d1a9f1 commit: 0d1d7c8bae3f9fe9e937d2931dcbbd3555d1a9f1 branch: 3.8 author: Serhiy Storchaka committer: GitHub date: 2020-04-05T00:43:07+03:00 summary: bpo-36320: Use the deprecated-removed directive for _field_types (GH-19370) files: M Doc/library/typing.rst diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index beb00fc8b61c2..7269e181c7349 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -959,7 +959,7 @@ The module defines the following classes, functions and decorators: .. versionchanged:: 3.6.1 Added support for default values, methods, and docstrings. - .. versionchanged:: 3.8 + .. deprecated-removed:: 3.8 3.9 Deprecated the ``_field_types`` attribute in favor of the more standard ``__annotations__`` attribute which has the same information. From webhook-mailer at python.org Sat Apr 4 17:43:25 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 04 Apr 2020 21:43:25 -0000 Subject: [Python-checkins] bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368) Message-ID: https://github.com/python/cpython/commit/6fed3c85402c5ca704eb3f3189ca3f5c67a08d19 commit: 6fed3c85402c5ca704eb3f3189ca3f5c67a08d19 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-05T00:43:20+03:00 summary: bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368) files: A Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst M Doc/library/typing.rst M Doc/whatsnew/3.9.rst M Lib/test/test_typing.py M Lib/typing.py diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index 58ae184578616..fa13c07c44ea3 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -959,14 +959,15 @@ The module defines the following classes, functions and decorators: .. versionchanged:: 3.6.1 Added support for default values, methods, and docstrings. - .. versionchanged:: 3.8 - Deprecated the ``_field_types`` attribute in favor of the more - standard ``__annotations__`` attribute which has the same information. - .. versionchanged:: 3.8 The ``_field_types`` and ``__annotations__`` attributes are now regular dictionaries instead of instances of ``OrderedDict``. + .. versionchanged:: 3.9 + Removed the ``_field_types`` attribute in favor of the more + standard ``__annotations__`` attribute which has the same information. + + .. class:: TypedDict(dict) A simple typed namespace. At runtime it is equivalent to diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index fc48cd67edcf6..ef499f504682d 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -734,6 +734,11 @@ Removed defining ``COUNT_ALLOCS`` macro. (Contributed by Victor Stinner in :issue:`39489`.) +* The ``_field_types`` attribute of the :class:`typing.NamedTuple` class + has been removed. It was deprecated deprecated since Python 3.8. Use + the ``__annotations__`` attribute instead. + (Contributed by Serhiy Storchaka in :issue:`40182`.) + Porting to Python 3.9 ===================== diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 3a0edb9e2d323..dea09eb874d19 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3561,7 +3561,6 @@ def test_basics(self): self.assertEqual(Emp._fields, ('name', 'id')) self.assertEqual(Emp.__annotations__, collections.OrderedDict([('name', str), ('id', int)])) - self.assertIs(Emp._field_types, Emp.__annotations__) def test_namedtuple_pyversion(self): if sys.version_info[:2] < (3, 6): @@ -3581,7 +3580,6 @@ def test_annotation_usage(self): self.assertEqual(CoolEmployee._fields, ('name', 'cool')) self.assertEqual(CoolEmployee.__annotations__, collections.OrderedDict(name=str, cool=int)) - self.assertIs(CoolEmployee._field_types, CoolEmployee.__annotations__) def test_annotation_usage_with_default(self): jelle = CoolEmployeeWithDefault('Jelle') @@ -3594,7 +3592,8 @@ def test_annotation_usage_with_default(self): self.assertEqual(CoolEmployeeWithDefault.__name__, 'CoolEmployeeWithDefault') self.assertEqual(CoolEmployeeWithDefault._fields, ('name', 'cool')) - self.assertEqual(CoolEmployeeWithDefault._field_types, dict(name=str, cool=int)) + self.assertEqual(CoolEmployeeWithDefault.__annotations__, + dict(name=str, cool=int)) self.assertEqual(CoolEmployeeWithDefault._field_defaults, dict(cool=0)) with self.assertRaises(TypeError): @@ -3641,7 +3640,6 @@ def test_namedtuple_keyword_usage(self): self.assertEqual(LocalEmployee.__name__, 'LocalEmployee') self.assertEqual(LocalEmployee._fields, ('name', 'age')) self.assertEqual(LocalEmployee.__annotations__, dict(name=str, age=int)) - self.assertIs(LocalEmployee._field_types, LocalEmployee.__annotations__) with self.assertRaises(TypeError): NamedTuple('Name', [('x', int)], y=str) with self.assertRaises(TypeError): diff --git a/Lib/typing.py b/Lib/typing.py index 99355d0066647..a72003a4a96fa 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1705,9 +1705,7 @@ def _make_nmtuple(name, types): msg = "NamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a type" types = [(n, _type_check(t, msg)) for n, t in types] nm_tpl = collections.namedtuple(name, [n for n, t in types]) - # Prior to PEP 526, only _field_types attribute was assigned. - # Now __annotations__ are used and _field_types is deprecated (remove in 3.9) - nm_tpl.__annotations__ = nm_tpl._field_types = dict(types) + nm_tpl.__annotations__ = dict(types) try: nm_tpl.__module__ = sys._getframe(2).f_globals.get('__name__', '__main__') except (AttributeError, ValueError): @@ -1717,7 +1715,7 @@ def _make_nmtuple(name, types): # attributes prohibited to set in NamedTuple class syntax _prohibited = {'__new__', '__init__', '__slots__', '__getnewargs__', - '_fields', '_field_defaults', '_field_types', + '_fields', '_field_defaults', '_make', '_replace', '_asdict', '_source'} _special = {'__module__', '__name__', '__annotations__'} diff --git a/Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst b/Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst new file mode 100644 index 0000000000000..1120584ecc575 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst @@ -0,0 +1,2 @@ +Removed the ``_field_types`` attribute of the :class:`typing.NamedTuple` +class. From webhook-mailer at python.org Sat Apr 4 17:46:58 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sat, 04 Apr 2020 21:46:58 -0000 Subject: [Python-checkins] [3.8] closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (GH-19373) Message-ID: https://github.com/python/cpython/commit/411555075401aa831a2228196c2d8f9a54b6f577 commit: 411555075401aa831a2228196c2d8f9a54b6f577 branch: 3.8 author: Benjamin Peterson committer: GitHub date: 2020-04-04T16:46:54-05:00 summary: [3.8] closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (GH-19373) (cherry picked from commit 1b21573) Co-authored-by: Batuhan Ta?kaya files: M Python/pyhash.c diff --git a/Python/pyhash.c b/Python/pyhash.c index ba224ee373631..c0355ae686afd 100644 --- a/Python/pyhash.c +++ b/Python/pyhash.c @@ -412,13 +412,6 @@ siphash24(uint64_t k0, uint64_t k1, const void *src, Py_ssize_t src_sz) { return t; } -static Py_hash_t -pysiphash(const void *src, Py_ssize_t src_sz) { - return (Py_hash_t)siphash24( - _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash.k1), - src, src_sz); -} - uint64_t _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t src_sz) { @@ -427,6 +420,13 @@ _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t src_sz) #if Py_HASH_ALGORITHM == Py_HASH_SIPHASH24 +static Py_hash_t +pysiphash(const void *src, Py_ssize_t src_sz) { + return (Py_hash_t)siphash24( + _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash.k1), + src, src_sz); +} + static PyHash_FuncDef PyHash_Func = {pysiphash, "siphash24", 64, 128}; #endif From webhook-mailer at python.org Sun Apr 5 05:25:41 2020 From: webhook-mailer at python.org (Mark Dickinson) Date: Sun, 05 Apr 2020 09:25:41 -0000 Subject: [Python-checkins] Fix misinformation about NaN != NaN comparison (GH-19357) Message-ID: https://github.com/python/cpython/commit/810f68f1282c917fc1ad6af540a9f08524dfe310 commit: 810f68f1282c917fc1ad6af540a9f08524dfe310 branch: master author: Mark Dickinson committer: GitHub date: 2020-04-05T10:25:24+01:00 summary: Fix misinformation about NaN != NaN comparison (GH-19357) files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 16542cdcec197..8036a491c29ab 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1422,8 +1422,9 @@ built-in types. The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are special. Any ordered comparison of a number to a not-a-number value is false. A counter-intuitive implication is that not-a-number values are not equal to - themselves. For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3``, ``x - == x``, ``x != x`` are all false. This behavior is compliant with IEEE 754. + themselves. For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3`` and + ``x == x`` are all false, while ``x != x`` is true. This behavior is + compliant with IEEE 754. * ``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that comparisons for singletons should always be done with ``is`` or ``is not``, From webhook-mailer at python.org Sun Apr 5 05:56:42 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 05 Apr 2020 09:56:42 -0000 Subject: [Python-checkins] Fix misinformation about NaN != NaN comparison (GH-19357) (GH-19383) Message-ID: https://github.com/python/cpython/commit/f7b0259d0d243a71d79a3fda9ec7aad4306513eb commit: f7b0259d0d243a71d79a3fda9ec7aad4306513eb branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-05T10:56:37+01:00 summary: Fix misinformation about NaN != NaN comparison (GH-19357) (GH-19383) (cherry picked from commit 810f68f1282c917fc1ad6af540a9f08524dfe310) Co-authored-by: Mark Dickinson files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 16542cdcec197..8036a491c29ab 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1422,8 +1422,9 @@ built-in types. The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are special. Any ordered comparison of a number to a not-a-number value is false. A counter-intuitive implication is that not-a-number values are not equal to - themselves. For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3``, ``x - == x``, ``x != x`` are all false. This behavior is compliant with IEEE 754. + themselves. For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3`` and + ``x == x`` are all false, while ``x != x`` is true. This behavior is + compliant with IEEE 754. * ``None`` and ``NotImplemented`` are singletons. :PEP:`8` advises that comparisons for singletons should always be done with ``is`` or ``is not``, From webhook-mailer at python.org Sun Apr 5 05:57:09 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 05 Apr 2020 09:57:09 -0000 Subject: [Python-checkins] Fix misinformation about NaN != NaN comparison (GH-19357) (GH-19384) Message-ID: https://github.com/python/cpython/commit/44c1cdd53f5f782e7b0d0603a530ba331fa35b94 commit: 44c1cdd53f5f782e7b0d0603a530ba331fa35b94 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-05T10:57:05+01:00 summary: Fix misinformation about NaN != NaN comparison (GH-19357) (GH-19384) (cherry picked from commit 810f68f1282c917fc1ad6af540a9f08524dfe310) Co-authored-by: Mark Dickinson files: M Doc/reference/expressions.rst diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 51e779c053688..3c14fc98d0080 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1420,8 +1420,9 @@ built-in types. The not-a-number values ``float('NaN')`` and ``decimal.Decimal('NaN')`` are special. Any ordered comparison of a number to a not-a-number value is false. A counter-intuitive implication is that not-a-number values are not equal to - themselves. For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3``, ``x - == x``, ``x != x`` are all false. This behavior is compliant with IEEE 754. + themselves. For example, if ``x = float('NaN')``, ``3 < x``, ``x < 3`` and + ``x == x`` are all false, while ``x != x`` is true. This behavior is + compliant with IEEE 754. * Binary sequences (instances of :class:`bytes` or :class:`bytearray`) can be compared within and across their types. They compare lexicographically using From webhook-mailer at python.org Sun Apr 5 21:53:11 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 06 Apr 2020 01:53:11 -0000 Subject: [Python-checkins] bpo-40197: Better describe the benchmark results table (GH-19386) Message-ID: https://github.com/python/cpython/commit/c63629e7c09da80a6b7d0253d04a9b3f57f88eff commit: c63629e7c09da80a6b7d0253d04a9b3f57f88eff branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-05T18:53:06-07:00 summary: bpo-40197: Better describe the benchmark results table (GH-19386) files: M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 18fb2e07ed77a..6d2b0d905ff06 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -2208,7 +2208,13 @@ Here's a summary of performance improvements since Python 3.3: Timing loop: loop_overhead 0.3 0.5 0.6 0.4 0.3 0.3 - (Measured from the macOS 64-bit builds found at python.org) +The benchmarks were measured on an +`Intel? Core? i7-4960HQ processor +`_ +running the macOS 64-bit builds found at +`python.org `_. +The benchmark script displays timings in nanoseconds. + Notable changes in Python 3.8.1 =============================== From webhook-mailer at python.org Mon Apr 6 02:48:04 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Mon, 06 Apr 2020 06:48:04 -0000 Subject: [Python-checkins] bpo-40147: Fix a compiler warning on Windows in Python/compile.c (GH-19389) Message-ID: https://github.com/python/cpython/commit/08050e959e6c40839cd2c9e5f6a4fd1513e3d605 commit: 08050e959e6c40839cd2c9e5f6a4fd1513e3d605 branch: master author: Zackery Spytz committer: GitHub date: 2020-04-06T07:47:47+01:00 summary: bpo-40147: Fix a compiler warning on Windows in Python/compile.c (GH-19389) Change the type of nkeywords to Py_ssize_t. files: M Python/compile.c diff --git a/Python/compile.c b/Python/compile.c index b1c1982fd2c4a..329add9d068ba 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -4050,14 +4050,15 @@ maybe_optimize_method_call(struct compiler *c, expr_ty e) } static int -validate_keywords(struct compiler *c, asdl_seq* keywords) { - int nkeywords = asdl_seq_LEN(keywords); - for (int i = 0; i < nkeywords; i++) { +validate_keywords(struct compiler *c, asdl_seq *keywords) +{ + Py_ssize_t nkeywords = asdl_seq_LEN(keywords); + for (Py_ssize_t i = 0; i < nkeywords; i++) { keyword_ty key = ((keyword_ty)asdl_seq_GET(keywords, i)); if (key->arg == NULL) { continue; } - for (int j = i+1; j < nkeywords; j++) { + for (Py_ssize_t j = i + 1; j < nkeywords; j++) { keyword_ty other = ((keyword_ty)asdl_seq_GET(keywords, j)); if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) { PyObject *msg = PyUnicode_FromFormat("keyword argument repeated: %U", key->arg); From webhook-mailer at python.org Mon Apr 6 08:07:11 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 06 Apr 2020 12:07:11 -0000 Subject: [Python-checkins] bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377) Message-ID: https://github.com/python/cpython/commit/38aefc585f60a77d66f4fbe5a37594a488b53474 commit: 38aefc585f60a77d66f4fbe5a37594a488b53474 branch: master author: Victor Stinner committer: GitHub date: 2020-04-06T14:07:02+02:00 summary: bpo-40170: PyObject_GET_WEAKREFS_LISTPTR() becomes a function (GH-19377) Convert the PyObject_GET_WEAKREFS_LISTPTR() macro to a function to hide implementation details: the macro accessed directly to the PyTypeObject.tp_weaklistoffset member. Add _PyObject_GET_WEAKREFS_LISTPTR() static inline function to the internal C API. files: A Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst M Include/cpython/objimpl.h M Include/internal/pycore_object.h M Modules/_weakref.c M Modules/gcmodule.c M Objects/object.c M Objects/typeobject.c M Objects/weakrefobject.c diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h index 8e3c964cf44e7..2f802e92a6cdf 100644 --- a/Include/cpython/objimpl.h +++ b/Include/cpython/objimpl.h @@ -138,8 +138,7 @@ PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size); /* Test if a type supports weak references */ #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) -#define PyObject_GET_WEAKREFS_LISTPTR(o) \ - ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) +PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op); #ifdef __cplusplus } diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 10a5746997ec7..002b70007b639 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -87,6 +87,13 @@ extern void _Py_PrintReferences(FILE *); extern void _Py_PrintReferenceAddresses(FILE *); #endif +static inline PyObject ** +_PyObject_GET_WEAKREFS_LISTPTR(PyObject *op) +{ + Py_ssize_t offset = Py_TYPE(op)->tp_weaklistoffset; + return (PyObject **)((char *)op + offset); +} + #ifdef __cplusplus } #endif diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst b/Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst new file mode 100644 index 0000000000000..3c4e33b9da134 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst @@ -0,0 +1,3 @@ +Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a function to hide +implementation details: the macro accessed directly to the +:c:member:`PyTypeObject.tp_weaklistoffset` member. diff --git a/Modules/_weakref.c b/Modules/_weakref.c index cd7c4c159ac1b..e33cba2a3dd81 100644 --- a/Modules/_weakref.c +++ b/Modules/_weakref.c @@ -1,8 +1,9 @@ #include "Python.h" +#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR #define GET_WEAKREFS_LISTPTR(o) \ - ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o)) + ((PyWeakReference **) _PyObject_GET_WEAKREFS_LISTPTR(o)) /*[clinic input] module _weakref diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index cf164c17d7bf1..1bc41fb83d8a6 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -788,7 +788,7 @@ handle_weakrefs(PyGC_Head *unreachable, PyGC_Head *old) /* It supports weakrefs. Does it have any? */ wrlist = (PyWeakReference **) - PyObject_GET_WEAKREFS_LISTPTR(op); + _PyObject_GET_WEAKREFS_LISTPTR(op); /* `op` may have some weakrefs. March over the list, clear * all the weakrefs, and move the weakrefs with callbacks diff --git a/Objects/object.c b/Objects/object.c index e6d0da1c775c2..05241e8a740d1 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2206,6 +2206,14 @@ _Py_Dealloc(PyObject *op) (*dealloc)(op); } + +PyObject ** +PyObject_GET_WEAKREFS_LISTPTR(PyObject *op) +{ + return _PyObject_GET_WEAKREFS_LISTPTR(op); +} + + #ifdef __cplusplus } #endif diff --git a/Objects/typeobject.c b/Objects/typeobject.c index bed50d1e7f2d3..bdd16af929079 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1271,7 +1271,7 @@ subtype_dealloc(PyObject *self) if (type->tp_weaklistoffset && !base->tp_weaklistoffset) { /* Modeled after GET_WEAKREFS_LISTPTR() */ PyWeakReference **list = (PyWeakReference **) \ - PyObject_GET_WEAKREFS_LISTPTR(self); + _PyObject_GET_WEAKREFS_LISTPTR(self); while (*list) _PyWeakref_ClearRef(*list); } diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index 7a5d9fb88af14..1e6697b729c9c 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -1,9 +1,10 @@ #include "Python.h" +#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR #include "structmember.h" #define GET_WEAKREFS_LISTPTR(o) \ - ((PyWeakReference **) PyObject_GET_WEAKREFS_LISTPTR(o)) + ((PyWeakReference **) _PyObject_GET_WEAKREFS_LISTPTR(o)) Py_ssize_t From webhook-mailer at python.org Mon Apr 6 10:32:16 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Mon, 06 Apr 2020 14:32:16 -0000 Subject: [Python-checkins] Make 2.7.18rc1 release notes. Message-ID: https://github.com/python/cpython/commit/c6bfd0443e68f396d3935b192535700fc851d4e7 commit: c6bfd0443e68f396d3935b192535700fc851d4e7 branch: 2.7 author: Benjamin Peterson committer: Benjamin Peterson date: 2020-04-04T11:53:42-05:00 summary: Make 2.7.18rc1 release notes. files: A Misc/NEWS.d/2.7.18rc1.rst D Misc/NEWS.d/next/Build/2019-11-06-20-53-54.bpo-38730.UQsW_r.rst D Misc/NEWS.d/next/C API/2019-10-21-09-24-03.bpo-38540.314N_T.rst D Misc/NEWS.d/next/Core and Builtins/2019-10-20-12-43-48.bpo-38535.ESMkVN.rst D Misc/NEWS.d/next/Library/2019-12-30-07-59-34.bpo-27973.mgWXH1.rst D Misc/NEWS.d/next/Library/2020-03-18-01-30-50.bpo-38576.cvI68q.rst D Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst D Misc/NEWS.d/next/Security/2019-12-01-22-44-40.bpo-38945.ztmNXc.rst D Misc/NEWS.d/next/Windows/2019-10-04-03-46-36.bpo-37025.tLheEe.rst D Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst diff --git a/Misc/NEWS.d/2.7.18rc1.rst b/Misc/NEWS.d/2.7.18rc1.rst new file mode 100644 index 0000000000000..5024e2ce655e2 --- /dev/null +++ b/Misc/NEWS.d/2.7.18rc1.rst @@ -0,0 +1,89 @@ +.. bpo: 38945 +.. date: 2019-12-01-22-44-40 +.. nonce: ztmNXc +.. release date: 2020-04-04 +.. section: Security + +Newline characters have been escaped when performing uu encoding to prevent +them from overflowing into to content section of the encoded file. This +prevents malicious or accidental modification of data during the decoding +process. + +.. + +.. bpo: 38804 +.. date: 2019-11-15-00-54-42 +.. nonce: vjbM8V +.. section: Security + +Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by Ben Caller. + +.. + +.. bpo: 38535 +.. date: 2019-10-20-12-43-48 +.. nonce: ESMkVN +.. section: Core and Builtins + +Fixed line numbers and column offsets for AST nodes for calls without +arguments in decorators. + +.. + +.. bpo: 38576 +.. date: 2020-03-18-01-30-50 +.. nonce: cvI68q +.. section: Library + +Disallow control characters in hostnames in http.client, addressing +CVE-2019-18348. Such potentially malicious header injection URLs now cause a +InvalidURL to be raised. + +.. + +.. bpo: 27973 +.. date: 2019-12-30-07-59-34 +.. nonce: mgWXH1 +.. section: Library + +Fix urllib.urlretrieve failing on subsequent ftp transfers from the same +host. + +.. + +.. bpo: 38730 +.. date: 2019-11-06-20-53-54 +.. nonce: UQsW_r +.. section: Build + +Fix problems identified by GCC's ``-Wstringop-truncation`` warning. + +.. + +.. bpo: 37025 +.. date: 2019-10-04-03-46-36 +.. nonce: tLheEe +.. section: Windows + +``AddRefActCtx()`` was needlessly being checked for failure in +``PC/dl_nt.c``. + +.. + +.. bpo: 38295 +.. date: 2019-12-17-03-43-04 +.. nonce: hgDvlB +.. section: macOS + +Prevent failure of test_relative_path in test_py_compile on macOS Catalina. + +.. + +.. bpo: 38540 +.. date: 2019-10-21-09-24-03 +.. nonce: 314N_T +.. section: C API + +Fixed possible leak in :c:func:`PyArg_Parse` and similar functions for +format units ``"es#"`` and ``"et#"`` when the macro +:c:macro:`PY_SSIZE_T_CLEAN` is not defined. diff --git a/Misc/NEWS.d/next/Build/2019-11-06-20-53-54.bpo-38730.UQsW_r.rst b/Misc/NEWS.d/next/Build/2019-11-06-20-53-54.bpo-38730.UQsW_r.rst deleted file mode 100644 index 08e4e0471387a..0000000000000 --- a/Misc/NEWS.d/next/Build/2019-11-06-20-53-54.bpo-38730.UQsW_r.rst +++ /dev/null @@ -1 +0,0 @@ -Fix problems identified by GCC's ``-Wstringop-truncation`` warning. diff --git a/Misc/NEWS.d/next/C API/2019-10-21-09-24-03.bpo-38540.314N_T.rst b/Misc/NEWS.d/next/C API/2019-10-21-09-24-03.bpo-38540.314N_T.rst deleted file mode 100644 index 1d73ad8fe96e6..0000000000000 --- a/Misc/NEWS.d/next/C API/2019-10-21-09-24-03.bpo-38540.314N_T.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed possible leak in :c:func:`PyArg_Parse` and similar functions for -format units ``"es#"`` and ``"et#"`` when the macro -:c:macro:`PY_SSIZE_T_CLEAN` is not defined. diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-10-20-12-43-48.bpo-38535.ESMkVN.rst b/Misc/NEWS.d/next/Core and Builtins/2019-10-20-12-43-48.bpo-38535.ESMkVN.rst deleted file mode 100644 index 7671fd06474ba..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2019-10-20-12-43-48.bpo-38535.ESMkVN.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed line numbers and column offsets for AST nodes for calls without -arguments in decorators. diff --git a/Misc/NEWS.d/next/Library/2019-12-30-07-59-34.bpo-27973.mgWXH1.rst b/Misc/NEWS.d/next/Library/2019-12-30-07-59-34.bpo-27973.mgWXH1.rst deleted file mode 100644 index d50f483889b3d..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-12-30-07-59-34.bpo-27973.mgWXH1.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix urllib.urlretrieve failing on subsequent ftp transfers from the same -host. diff --git a/Misc/NEWS.d/next/Library/2020-03-18-01-30-50.bpo-38576.cvI68q.rst b/Misc/NEWS.d/next/Library/2020-03-18-01-30-50.bpo-38576.cvI68q.rst deleted file mode 100644 index 96af32d34d096..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-18-01-30-50.bpo-38576.cvI68q.rst +++ /dev/null @@ -1,3 +0,0 @@ -Disallow control characters in hostnames in http.client, addressing -CVE-2019-18348. Such potentially malicious header injection URLs now cause a -InvalidURL to be raised. diff --git a/Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst b/Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst deleted file mode 100644 index 1f45142d9f743..0000000000000 --- a/Misc/NEWS.d/next/Security/2019-11-15-00-54-42.bpo-38804.vjbM8V.rst +++ /dev/null @@ -1 +0,0 @@ -Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by Ben Caller. diff --git a/Misc/NEWS.d/next/Security/2019-12-01-22-44-40.bpo-38945.ztmNXc.rst b/Misc/NEWS.d/next/Security/2019-12-01-22-44-40.bpo-38945.ztmNXc.rst deleted file mode 100644 index 1bf6ed567b241..0000000000000 --- a/Misc/NEWS.d/next/Security/2019-12-01-22-44-40.bpo-38945.ztmNXc.rst +++ /dev/null @@ -1 +0,0 @@ -Newline characters have been escaped when performing uu encoding to prevent them from overflowing into to content section of the encoded file. This prevents malicious or accidental modification of data during the decoding process. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Windows/2019-10-04-03-46-36.bpo-37025.tLheEe.rst b/Misc/NEWS.d/next/Windows/2019-10-04-03-46-36.bpo-37025.tLheEe.rst deleted file mode 100644 index 7c0f9dc017705..0000000000000 --- a/Misc/NEWS.d/next/Windows/2019-10-04-03-46-36.bpo-37025.tLheEe.rst +++ /dev/null @@ -1,2 +0,0 @@ -``AddRefActCtx()`` was needlessly being checked for failure in -``PC/dl_nt.c``. diff --git a/Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst b/Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst deleted file mode 100644 index cc9ceb4cc50b3..0000000000000 --- a/Misc/NEWS.d/next/macOS/2019-12-17-03-43-04.bpo-38295.hgDvlB.rst +++ /dev/null @@ -1 +0,0 @@ -Prevent failure of test_relative_path in test_py_compile on macOS Catalina. From webhook-mailer at python.org Mon Apr 6 12:06:05 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 06 Apr 2020 16:06:05 -0000 Subject: [Python-checkins] bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) Message-ID: https://github.com/python/cpython/commit/799d7d61a91eb0ad3256ef9a45a90029cef93b7c commit: 799d7d61a91eb0ad3256ef9a45a90029cef93b7c branch: master author: Pablo Galindo committer: GitHub date: 2020-04-06T17:05:57+01:00 summary: bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) files: A Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst M Lib/symtable.py M Lib/test/test_symtable.py diff --git a/Lib/symtable.py b/Lib/symtable.py index 5bea7cf615548..ac0a64ff58f79 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -197,7 +197,7 @@ def is_declared_global(self): return bool(self.__scope == GLOBAL_EXPLICIT) def is_local(self): - return bool(self.__flags & DEF_BOUND) + return bool(self.__scope in (LOCAL, CELL)) def is_annotated(self): return bool(self.__flags & DEF_ANNOT) diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index bea2ce120ca96..98d718c8ab1b1 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -99,6 +99,7 @@ def test_globals(self): self.assertTrue(self.spam.lookup("bar").is_declared_global()) self.assertFalse(self.internal.lookup("x").is_global()) self.assertFalse(self.Mine.lookup("instance_var").is_global()) + self.assertTrue(self.spam.lookup("bar").is_global()) def test_nonlocal(self): self.assertFalse(self.spam.lookup("some_var").is_nonlocal()) @@ -108,7 +109,10 @@ def test_nonlocal(self): def test_local(self): self.assertTrue(self.spam.lookup("x").is_local()) - self.assertFalse(self.internal.lookup("x").is_local()) + self.assertFalse(self.spam.lookup("bar").is_local()) + + def test_free(self): + self.assertTrue(self.internal.lookup("x").is_free()) def test_referenced(self): self.assertTrue(self.internal.lookup("x").is_referenced()) diff --git a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst new file mode 100644 index 0000000000000..c5fbd6e5ff3fb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst @@ -0,0 +1,2 @@ +Fix a bug in the :mod:`symtable` module that was causing incorrectly report +global variables as local. Patch by Pablo Galindo. From webhook-mailer at python.org Mon Apr 6 12:41:33 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Apr 2020 16:41:33 -0000 Subject: [Python-checkins] bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) Message-ID: https://github.com/python/cpython/commit/717f1668b3455b498424577e194719f9beae13a1 commit: 717f1668b3455b498424577e194719f9beae13a1 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-06T09:41:24-07:00 summary: bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (cherry picked from commit 799d7d61a91eb0ad3256ef9a45a90029cef93b7c) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst M Lib/symtable.py M Lib/test/test_symtable.py diff --git a/Lib/symtable.py b/Lib/symtable.py index c7627a6ef6885..42ab725645363 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -188,7 +188,7 @@ def is_declared_global(self): return bool(self.__scope == GLOBAL_EXPLICIT) def is_local(self): - return bool(self.__flags & DEF_BOUND) + return bool(self.__scope in (LOCAL, CELL)) def is_annotated(self): return bool(self.__flags & DEF_ANNOT) diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index dfaee173ef725..aa99e86e4bce4 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -92,10 +92,14 @@ def test_globals(self): self.assertTrue(self.spam.lookup("bar").is_declared_global()) self.assertFalse(self.internal.lookup("x").is_global()) self.assertFalse(self.Mine.lookup("instance_var").is_global()) + self.assertTrue(self.spam.lookup("bar").is_global()) def test_local(self): self.assertTrue(self.spam.lookup("x").is_local()) - self.assertFalse(self.internal.lookup("x").is_local()) + self.assertFalse(self.spam.lookup("bar").is_local()) + + def test_free(self): + self.assertTrue(self.internal.lookup("x").is_free()) def test_referenced(self): self.assertTrue(self.internal.lookup("x").is_referenced()) diff --git a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst new file mode 100644 index 0000000000000..c5fbd6e5ff3fb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst @@ -0,0 +1,2 @@ +Fix a bug in the :mod:`symtable` module that was causing incorrectly report +global variables as local. Patch by Pablo Galindo. From webhook-mailer at python.org Mon Apr 6 12:42:00 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 06 Apr 2020 16:42:00 -0000 Subject: [Python-checkins] bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (GH-19394) Message-ID: https://github.com/python/cpython/commit/8bd84e7f79a6cc7670a89a92edba3015aa781758 commit: 8bd84e7f79a6cc7670a89a92edba3015aa781758 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-06T17:41:55+01:00 summary: bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (GH-19394) (cherry picked from commit 799d7d61a91eb0ad3256ef9a45a90029cef93b7c) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst M Lib/symtable.py M Lib/test/test_symtable.py diff --git a/Lib/symtable.py b/Lib/symtable.py index 5bea7cf615548..ac0a64ff58f79 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -197,7 +197,7 @@ def is_declared_global(self): return bool(self.__scope == GLOBAL_EXPLICIT) def is_local(self): - return bool(self.__flags & DEF_BOUND) + return bool(self.__scope in (LOCAL, CELL)) def is_annotated(self): return bool(self.__flags & DEF_ANNOT) diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index bea2ce120ca96..98d718c8ab1b1 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -99,6 +99,7 @@ def test_globals(self): self.assertTrue(self.spam.lookup("bar").is_declared_global()) self.assertFalse(self.internal.lookup("x").is_global()) self.assertFalse(self.Mine.lookup("instance_var").is_global()) + self.assertTrue(self.spam.lookup("bar").is_global()) def test_nonlocal(self): self.assertFalse(self.spam.lookup("some_var").is_nonlocal()) @@ -108,7 +109,10 @@ def test_nonlocal(self): def test_local(self): self.assertTrue(self.spam.lookup("x").is_local()) - self.assertFalse(self.internal.lookup("x").is_local()) + self.assertFalse(self.spam.lookup("bar").is_local()) + + def test_free(self): + self.assertTrue(self.internal.lookup("x").is_free()) def test_referenced(self): self.assertTrue(self.internal.lookup("x").is_referenced()) diff --git a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst new file mode 100644 index 0000000000000..c5fbd6e5ff3fb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst @@ -0,0 +1,2 @@ +Fix a bug in the :mod:`symtable` module that was causing incorrectly report +global variables as local. Patch by Pablo Galindo. From webhook-mailer at python.org Tue Apr 7 00:16:09 2020 From: webhook-mailer at python.org (amaajemyfren) Date: Tue, 07 Apr 2020 04:16:09 -0000 Subject: [Python-checkins] closes bpo-40166: Change Unicode Howto so that it does not have a specific number of assigned code points. (GH-19328) Message-ID: https://github.com/python/cpython/commit/8ea10a94463f1ea217bcaef86f2ebd9d43240b4e commit: 8ea10a94463f1ea217bcaef86f2ebd9d43240b4e branch: master author: amaajemyfren <32741226+amaajemyfren at users.noreply.github.com> committer: GitHub date: 2020-04-06T23:16:02-05:00 summary: closes bpo-40166: Change Unicode Howto so that it does not have a specific number of assigned code points. (GH-19328) Change the number of code points from a specific number to a link to the latest standard that has a description of how many code points there are. files: M Doc/howto/unicode.rst diff --git a/Doc/howto/unicode.rst b/Doc/howto/unicode.rst index 4825b39f15063..e948c1e3c662d 100644 --- a/Doc/howto/unicode.rst +++ b/Doc/howto/unicode.rst @@ -41,8 +41,9 @@ but these are two different characters that have different meanings. The Unicode standard describes how characters are represented by **code points**. A code point value is an integer in the range 0 to -0x10FFFF (about 1.1 million values, with some 110 thousand assigned so -far). In the standard and in this document, a code point is written +0x10FFFF (about 1.1 million values, the +`actual number assigned `_ +is less than that). In the standard and in this document, a code point is written using the notation ``U+265E`` to mean the character with value ``0x265e`` (9,822 in decimal). From webhook-mailer at python.org Tue Apr 7 02:40:05 2020 From: webhook-mailer at python.org (Zachary Ware) Date: Tue, 07 Apr 2020 06:40:05 -0000 Subject: [Python-checkins] bpo-40214: Temporarily disable a ctypes test (GH-19404) Message-ID: https://github.com/python/cpython/commit/f407e209c1e35b64835f73e7e7ca23e33817e9fe commit: f407e209c1e35b64835f73e7e7ca23e33817e9fe branch: master author: Zachary Ware committer: GitHub date: 2020-04-07T01:39:58-05:00 summary: bpo-40214: Temporarily disable a ctypes test (GH-19404) Only one particular sub-test of ctypes.test.test_loading.test_load_dll_with_flags is disabled, which caused failures on Azure Pipelines CI. files: M Lib/ctypes/test/test_loading.py diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index 9b97d80086044..a62044e370af6 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -158,8 +158,11 @@ def should_fail(command): # Relative path (but not just filename) should succeed should_pass("WinDLL('./_sqlite3.dll')") - # Insecure load flags should succeed - should_pass("WinDLL('_sqlite3.dll', winmode=0)") + # XXX: This test has started failing on Azure Pipelines CI. See + # bpo-40214 for more information. + if 0: + # Insecure load flags should succeed + should_pass("WinDLL('_sqlite3.dll', winmode=0)") # Full path load without DLL_LOAD_DIR shouldn't find dependency should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " + From webhook-mailer at python.org Tue Apr 7 10:07:51 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Apr 2020 14:07:51 -0000 Subject: [Python-checkins] bpo-37388: Don't check encoding/errors during finalization (GH-19409) Message-ID: https://github.com/python/cpython/commit/d8acf0d9aae71d1897e8f91989bd8bfb4a9ef9c6 commit: d8acf0d9aae71d1897e8f91989bd8bfb4a9ef9c6 branch: master author: Victor Stinner committer: GitHub date: 2020-04-07T16:07:42+02:00 summary: bpo-37388: Don't check encoding/errors during finalization (GH-19409) str.encode() and str.decode() no longer check the encoding and errors in development mode or in debug mode during Python finalization. The codecs machinery can no longer work on very late calls to str.encode() and str.decode(). This change should help to call _PyObject_Dump() to debug during late Python finalization. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388.stlxBq.rst M Objects/unicodeobject.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388.stlxBq.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388.stlxBq.rst new file mode 100644 index 0000000000000..1da58d111912c --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388.stlxBq.rst @@ -0,0 +1,4 @@ +str.encode() and str.decode() no longer check the encoding and errors in +development mode or in debug mode during Python finalization. The codecs +machinery can no longer work on very late calls to str.encode() and +str.decode(). diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9d51c8a685ebe..da17bfe01f310 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -451,6 +451,12 @@ unicode_check_encoding_errors(const char *encoding, const char *errors) return 0; } + /* Disable checks during Python finalization. For example, it allows to + call _PyObject_Dump() during finalization for debugging purpose. */ + if (interp->finalizing) { + return 0; + } + if (encoding != NULL) { PyObject *handler = _PyCodec_Lookup(encoding); if (handler == NULL) { From webhook-mailer at python.org Tue Apr 7 12:36:12 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Apr 2020 16:36:12 -0000 Subject: [Python-checkins] bpo-40149: Implement traverse in _abc._abc_data (GH-19412) Message-ID: https://github.com/python/cpython/commit/9cc3ebd7e04cb645ac7b2f372eaafa7464e16b9c commit: 9cc3ebd7e04cb645ac7b2f372eaafa7464e16b9c branch: master author: Victor Stinner committer: GitHub date: 2020-04-07T18:36:04+02:00 summary: bpo-40149: Implement traverse in _abc._abc_data (GH-19412) Implement traverse and clear slots in _abc._abc_data type. files: A Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst M Modules/_abc.c diff --git a/Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst b/Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst new file mode 100644 index 0000000000000..dd8ac3b406d3e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst @@ -0,0 +1 @@ +Implement traverse and clear slots in _abc._abc_data type. diff --git a/Modules/_abc.c b/Modules/_abc.c index 62709822f9233..1efc98bf72c07 100644 --- a/Modules/_abc.c +++ b/Modules/_abc.c @@ -51,13 +51,29 @@ typedef struct { unsigned long long _abc_negative_cache_version; } _abc_data; +static int +abc_data_traverse(_abc_data *self, visitproc visit, void *arg) +{ + Py_VISIT(self->_abc_registry); + Py_VISIT(self->_abc_cache); + Py_VISIT(self->_abc_negative_cache); + return 0; +} + +static int +abc_data_clear(_abc_data *self) +{ + Py_CLEAR(self->_abc_registry); + Py_CLEAR(self->_abc_cache); + Py_CLEAR(self->_abc_negative_cache); + return 0; +} + static void abc_data_dealloc(_abc_data *self) { PyTypeObject *tp = Py_TYPE(self); - Py_XDECREF(self->_abc_registry); - Py_XDECREF(self->_abc_cache); - Py_XDECREF(self->_abc_negative_cache); + (void)abc_data_clear(self); tp->tp_free(self); Py_DECREF(tp); } @@ -84,13 +100,15 @@ static PyType_Slot _abc_data_type_spec_slots[] = { {Py_tp_doc, (void *)abc_data_doc}, {Py_tp_new, abc_data_new}, {Py_tp_dealloc, abc_data_dealloc}, + {Py_tp_traverse, abc_data_traverse}, + {Py_tp_clear, abc_data_clear}, {0, 0} }; static PyType_Spec _abc_data_type_spec = { .name = "_abc._abc_data", .basicsize = sizeof(_abc_data), - .flags = Py_TPFLAGS_DEFAULT, + .flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, .slots = _abc_data_type_spec_slots, }; From webhook-mailer at python.org Tue Apr 7 12:50:11 2020 From: webhook-mailer at python.org (Guido van Rossum) Date: Tue, 07 Apr 2020 16:50:11 -0000 Subject: [Python-checkins] bpo-39481: Implementation for PEP 585 (#18239) Message-ID: https://github.com/python/cpython/commit/48b069a003ba6c684a9ba78493fbbec5e89f10b8 commit: 48b069a003ba6c684a9ba78493fbbec5e89f10b8 branch: master author: Guido van Rossum committer: GitHub date: 2020-04-07T09:50:06-07:00 summary: bpo-39481: Implementation for PEP 585 (#18239) This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`. files: A Include/genericaliasobject.h A Lib/test/test_genericalias.py A Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481.rqSeGl.rst A Objects/genericaliasobject.c M Include/Python.h M Lib/_collections_abc.py M Lib/contextlib.py M Lib/os.py M Lib/subprocess.py M Lib/tempfile.py M Lib/test/test_descrtut.py M Lib/test/test_doctest.py M Lib/test/test_os.py M Lib/test/test_subprocess.py M Lib/test/test_tempfile.py M Lib/test/test_types.py M Lib/test/test_typing.py M Lib/types.py M Lib/typing.py M Makefile.pre.in M Modules/_collectionsmodule.c M Modules/_sre.c M Objects/abstract.c M Objects/descrobject.c M Objects/dictobject.c M Objects/listobject.c M Objects/setobject.c M Objects/tupleobject.c M PC/python3.def M PCbuild/pythoncore.vcxproj diff --git a/Include/Python.h b/Include/Python.h index 969d8e6bea741..769ec49779c0f 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -120,6 +120,7 @@ #include "iterobject.h" #include "genobject.h" #include "descrobject.h" +#include "genericaliasobject.h" #include "warnings.h" #include "weakrefobject.h" #include "structseq.h" diff --git a/Include/genericaliasobject.h b/Include/genericaliasobject.h new file mode 100644 index 0000000000000..cf002976b27cd --- /dev/null +++ b/Include/genericaliasobject.h @@ -0,0 +1,14 @@ +// Implementation of PEP 585: support list[int] etc. +#ifndef Py_GENERICALIASOBJECT_H +#define Py_GENERICALIASOBJECT_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(PyObject *) Py_GenericAlias(PyObject *, PyObject *); +PyAPI_DATA(PyTypeObject) Py_GenericAliasType; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_GENERICALIASOBJECT_H */ diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py index 2b2ddba170e1b..36cd993000347 100644 --- a/Lib/_collections_abc.py +++ b/Lib/_collections_abc.py @@ -9,6 +9,8 @@ from abc import ABCMeta, abstractmethod import sys +GenericAlias = type(list[int]) + __all__ = ["Awaitable", "Coroutine", "AsyncIterable", "AsyncIterator", "AsyncGenerator", "Hashable", "Iterable", "Iterator", "Generator", "Reversible", @@ -110,6 +112,8 @@ def __subclasshook__(cls, C): return _check_methods(C, "__await__") return NotImplemented + __class_getitem__ = classmethod(GenericAlias) + class Coroutine(Awaitable): @@ -169,6 +173,8 @@ def __subclasshook__(cls, C): return _check_methods(C, "__aiter__") return NotImplemented + __class_getitem__ = classmethod(GenericAlias) + class AsyncIterator(AsyncIterable): @@ -255,6 +261,8 @@ def __subclasshook__(cls, C): return _check_methods(C, "__iter__") return NotImplemented + __class_getitem__ = classmethod(GenericAlias) + class Iterator(Iterable): @@ -274,6 +282,7 @@ def __subclasshook__(cls, C): return _check_methods(C, '__iter__', '__next__') return NotImplemented + Iterator.register(bytes_iterator) Iterator.register(bytearray_iterator) #Iterator.register(callable_iterator) @@ -353,6 +362,7 @@ def __subclasshook__(cls, C): 'send', 'throw', 'close') return NotImplemented + Generator.register(generator) @@ -385,6 +395,9 @@ def __subclasshook__(cls, C): return _check_methods(C, "__contains__") return NotImplemented + __class_getitem__ = classmethod(GenericAlias) + + class Collection(Sized, Iterable, Container): __slots__ = () @@ -395,6 +408,7 @@ def __subclasshook__(cls, C): return _check_methods(C, "__len__", "__iter__", "__contains__") return NotImplemented + class Callable(metaclass=ABCMeta): __slots__ = () @@ -409,6 +423,8 @@ def __subclasshook__(cls, C): return _check_methods(C, "__call__") return NotImplemented + __class_getitem__ = classmethod(GenericAlias) + ### SETS ### @@ -550,6 +566,7 @@ def _hash(self): h = 590923713 return h + Set.register(frozenset) @@ -632,6 +649,7 @@ def __isub__(self, it): self.discard(value) return self + MutableSet.register(set) @@ -688,6 +706,7 @@ def __eq__(self, other): __reversed__ = None + Mapping.register(mappingproxy) @@ -704,6 +723,8 @@ def __len__(self): def __repr__(self): return '{0.__class__.__name__}({0._mapping!r})'.format(self) + __class_getitem__ = classmethod(GenericAlias) + class KeysView(MappingView, Set): @@ -719,6 +740,7 @@ def __contains__(self, key): def __iter__(self): yield from self._mapping + KeysView.register(dict_keys) @@ -743,6 +765,7 @@ def __iter__(self): for key in self._mapping: yield (key, self._mapping[key]) + ItemsView.register(dict_items) @@ -761,6 +784,7 @@ def __iter__(self): for key in self._mapping: yield self._mapping[key] + ValuesView.register(dict_values) @@ -847,6 +871,7 @@ def setdefault(self, key, default=None): self[key] = default return default + MutableMapping.register(dict) @@ -914,6 +939,7 @@ def count(self, value): 'S.count(value) -> integer -- return number of occurrences of value' return sum(1 for v in self if v is value or v == value) + Sequence.register(tuple) Sequence.register(str) Sequence.register(range) @@ -1000,5 +1026,6 @@ def __iadd__(self, values): self.extend(values) return self + MutableSequence.register(list) MutableSequence.register(bytearray) # Multiply inheriting, see ByteString diff --git a/Lib/contextlib.py b/Lib/contextlib.py index 69c272831a55c..ff92d9f913f4c 100644 --- a/Lib/contextlib.py +++ b/Lib/contextlib.py @@ -4,7 +4,7 @@ import _collections_abc from collections import deque from functools import wraps -from types import MethodType +from types import MethodType, GenericAlias __all__ = ["asynccontextmanager", "contextmanager", "closing", "nullcontext", "AbstractContextManager", "AbstractAsyncContextManager", @@ -16,6 +16,8 @@ class AbstractContextManager(abc.ABC): """An abstract base class for context managers.""" + __class_getitem__ = classmethod(GenericAlias) + def __enter__(self): """Return `self` upon entering the runtime context.""" return self @@ -36,6 +38,8 @@ class AbstractAsyncContextManager(abc.ABC): """An abstract base class for asynchronous context managers.""" + __class_getitem__ = classmethod(GenericAlias) + async def __aenter__(self): """Return `self` upon entering the runtime context.""" return self diff --git a/Lib/os.py b/Lib/os.py index 8acd6f12c3ed0..b794159f86c33 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -28,6 +28,8 @@ from _collections_abc import _check_methods +GenericAlias = type(list[int]) + _names = sys.builtin_module_names # Note: more names are added to __all__ later. @@ -1074,8 +1076,7 @@ def __subclasshook__(cls, subclass): return _check_methods(subclass, '__fspath__') return NotImplemented - def __class_getitem__(cls, type): - return cls + __class_getitem__ = classmethod(GenericAlias) if name == 'nt': diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 1eecceaed414a..86fdf27f9b03b 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -52,6 +52,7 @@ import warnings import contextlib from time import monotonic as _time +import types try: import pwd @@ -446,17 +447,7 @@ def __repr__(self): args.append('stderr={!r}'.format(self.stderr)) return "{}({})".format(type(self).__name__, ', '.join(args)) - def __class_getitem__(cls, type): - """Provide minimal support for using this class as generic - (for example in type annotations). - - See PEP 484 and PEP 560 for more details. For example, - `CompletedProcess[bytes]` is a valid expression at runtime - (type argument `bytes` indicates the type used for stdout). - Note, no type checking happens at runtime, but a static type - checker can be used. - """ - return cls + __class_getitem__ = classmethod(types.GenericAlias) def check_returncode(self): @@ -1000,16 +991,7 @@ def __repr__(self): obj_repr = obj_repr[:76] + "...>" return obj_repr - def __class_getitem__(cls, type): - """Provide minimal support for using this class as generic - (for example in type annotations). - - See PEP 484 and PEP 560 for more details. For example, `Popen[bytes]` - is a valid expression at runtime (type argument `bytes` indicates the - type used for stdout). Note, no type checking happens at runtime, but - a static type checker can be used. - """ - return cls + __class_getitem__ = classmethod(types.GenericAlias) @property def universal_newlines(self): diff --git a/Lib/tempfile.py b/Lib/tempfile.py index b27165bb0f203..a398345f108d0 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -44,6 +44,7 @@ import errno as _errno from random import Random as _Random import sys as _sys +import types as _types import weakref as _weakref import _thread _allocate_lock = _thread.allocate_lock @@ -643,17 +644,7 @@ def __init__(self, max_size=0, mode='w+b', buffering=-1, 'encoding': encoding, 'newline': newline, 'dir': dir, 'errors': errors} - def __class_getitem__(cls, type): - """Provide minimal support for using this class as generic - (for example in type annotations). - - See PEP 484 and PEP 560 for more details. For example, - `SpooledTemporaryFile[str]` is a valid expression at runtime (type - argument `str` indicates whether the file is open in bytes or text - mode). Note, no type checking happens at runtime, but a static type - checker can be used. - """ - return cls + __class_getitem__ = classmethod(_types.GenericAlias) def _check(self, file): if self._rolled: return diff --git a/Lib/test/test_descrtut.py b/Lib/test/test_descrtut.py index b84d6447850a0..8e25f58d7aa20 100644 --- a/Lib/test/test_descrtut.py +++ b/Lib/test/test_descrtut.py @@ -167,6 +167,7 @@ def merge(self, other): >>> pprint.pprint(dir(list)) # like list.__dict__.keys(), but sorted ['__add__', '__class__', + '__class_getitem__', '__contains__', '__delattr__', '__delitem__', diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 9e88222e9532f..71426277d2d93 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -665,7 +665,7 @@ def non_Python_modules(): r""" >>> import builtins >>> tests = doctest.DocTestFinder().find(builtins) - >>> 800 < len(tests) < 820 # approximate number of objects with docstrings + >>> 810 < len(tests) < 830 # approximate number of objects with docstrings True >>> real_tests = [t for t in tests if len(t.examples) > 0] >>> len(real_tests) # objects that actually have doctests diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py new file mode 100644 index 0000000000000..9d8dbfe04205f --- /dev/null +++ b/Lib/test/test_genericalias.py @@ -0,0 +1,214 @@ +"""Tests for C-implemented GenericAlias.""" + +import unittest +import pickle +from collections import ( + defaultdict, deque, OrderedDict, Counter, UserDict, UserList +) +from collections.abc import * +from contextlib import AbstractContextManager, AbstractAsyncContextManager +from re import Pattern, Match +from types import GenericAlias, MappingProxyType +import typing + +from typing import TypeVar +T = TypeVar('T') + +class BaseTest(unittest.TestCase): + """Test basics.""" + + def test_subscriptable(self): + for t in (type, tuple, list, dict, set, frozenset, + defaultdict, deque, + OrderedDict, Counter, UserDict, UserList, + Pattern, Match, + AbstractContextManager, AbstractAsyncContextManager, + Awaitable, Coroutine, + AsyncIterable, AsyncIterator, + AsyncGenerator, Generator, + Iterable, Iterator, + Reversible, + Container, Collection, + Callable, + Set, MutableSet, + Mapping, MutableMapping, MappingView, + KeysView, ItemsView, ValuesView, + Sequence, MutableSequence, + MappingProxyType, + ): + tname = t.__name__ + with self.subTest(f"Testing {tname}"): + alias = t[int] + self.assertIs(alias.__origin__, t) + self.assertEqual(alias.__args__, (int,)) + self.assertEqual(alias.__parameters__, ()) + + def test_unsubscriptable(self): + for t in int, str, float, Sized, Hashable: + tname = t.__name__ + with self.subTest(f"Testing {tname}"): + with self.assertRaises(TypeError): + t[int] + + def test_instantiate(self): + for t in tuple, list, dict, set, frozenset, defaultdict, deque: + tname = t.__name__ + with self.subTest(f"Testing {tname}"): + alias = t[int] + self.assertEqual(alias(), t()) + if t is dict: + self.assertEqual(alias(iter([('a', 1), ('b', 2)])), dict(a=1, b=2)) + self.assertEqual(alias(a=1, b=2), dict(a=1, b=2)) + elif t is defaultdict: + def default(): + return 'value' + a = alias(default) + d = defaultdict(default) + self.assertEqual(a['test'], d['test']) + else: + self.assertEqual(alias(iter((1, 2, 3))), t((1, 2, 3))) + + def test_unbound_methods(self): + t = list[int] + a = t() + t.append(a, 'foo') + self.assertEqual(a, ['foo']) + x = t.__getitem__(a, 0) + self.assertEqual(x, 'foo') + self.assertEqual(t.__len__(a), 1) + + def test_subclassing(self): + class C(list[int]): + pass + self.assertEqual(C.__bases__, (list,)) + self.assertEqual(C.__class__, type) + + def test_class_methods(self): + t = dict[int, None] + self.assertEqual(dict.fromkeys(range(2)), {0: None, 1: None}) # This works + self.assertEqual(t.fromkeys(range(2)), {0: None, 1: None}) # Should be equivalent + + def test_no_chaining(self): + t = list[int] + with self.assertRaises(TypeError): + t[int] + + def test_generic_subclass(self): + class MyList(list): + pass + t = MyList[int] + self.assertIs(t.__origin__, MyList) + self.assertEqual(t.__args__, (int,)) + self.assertEqual(t.__parameters__, ()) + + def test_repr(self): + class MyList(list): + pass + self.assertEqual(repr(list[str]), 'list[str]') + self.assertEqual(repr(list[()]), 'list[()]') + self.assertEqual(repr(tuple[int, ...]), 'tuple[int, ...]') + self.assertTrue(repr(MyList[int]).endswith('.BaseTest.test_repr..MyList[int]')) + self.assertEqual(repr(list[str]()), '[]') # instances should keep their normal repr + + def test_exposed_type(self): + import types + a = types.GenericAlias(list, int) + self.assertEqual(str(a), 'list[int]') + self.assertIs(a.__origin__, list) + self.assertEqual(a.__args__, (int,)) + self.assertEqual(a.__parameters__, ()) + + def test_parameters(self): + from typing import TypeVar + T = TypeVar('T') + K = TypeVar('K') + V = TypeVar('V') + D0 = dict[str, int] + self.assertEqual(D0.__args__, (str, int)) + self.assertEqual(D0.__parameters__, ()) + D1a = dict[str, V] + self.assertEqual(D1a.__args__, (str, V)) + self.assertEqual(D1a.__parameters__, (V,)) + D1b = dict[K, int] + self.assertEqual(D1b.__args__, (K, int)) + self.assertEqual(D1b.__parameters__, (K,)) + D2a = dict[K, V] + self.assertEqual(D2a.__args__, (K, V)) + self.assertEqual(D2a.__parameters__, (K, V)) + D2b = dict[T, T] + self.assertEqual(D2b.__args__, (T, T)) + self.assertEqual(D2b.__parameters__, (T,)) + L0 = list[str] + self.assertEqual(L0.__args__, (str,)) + self.assertEqual(L0.__parameters__, ()) + L1 = list[T] + self.assertEqual(L1.__args__, (T,)) + self.assertEqual(L1.__parameters__, (T,)) + + def test_parameter_chaining(self): + from typing import TypeVar + T = TypeVar('T') + self.assertEqual(list[T][int], list[int]) + self.assertEqual(dict[str, T][int], dict[str, int]) + self.assertEqual(dict[T, int][str], dict[str, int]) + self.assertEqual(dict[T, T][int], dict[int, int]) + with self.assertRaises(TypeError): + list[int][int] + dict[T, int][str, int] + dict[str, T][str, int] + dict[T, T][str, int] + + def test_equality(self): + self.assertEqual(list[int], list[int]) + self.assertEqual(dict[str, int], dict[str, int]) + self.assertNotEqual(dict[str, int], dict[str, str]) + self.assertNotEqual(list, list[int]) + self.assertNotEqual(list[int], list) + + def test_isinstance(self): + self.assertTrue(isinstance([], list)) + with self.assertRaises(TypeError): + isinstance([], list[str]) + + def test_issubclass(self): + class L(list): ... + self.assertTrue(issubclass(L, list)) + with self.assertRaises(TypeError): + issubclass(L, list[str]) + + def test_type_generic(self): + t = type[int] + Test = t('Test', (), {}) + self.assertTrue(isinstance(Test, type)) + test = Test() + self.assertEqual(t(test), Test) + self.assertEqual(t(0), int) + + def test_type_subclass_generic(self): + class MyType(type): + pass + with self.assertRaises(TypeError): + MyType[int] + + def test_pickle(self): + alias = GenericAlias(list, T) + s = pickle.dumps(alias) + loaded = pickle.loads(s) + self.assertEqual(alias.__origin__, loaded.__origin__) + self.assertEqual(alias.__args__, loaded.__args__) + self.assertEqual(alias.__parameters__, loaded.__parameters__) + + def test_union(self): + a = typing.Union[list[int], list[str]] + self.assertEqual(a.__args__, (list[int], list[str])) + self.assertEqual(a.__parameters__, ()) + + def test_union_generic(self): + T = typing.TypeVar('T') + a = typing.Union[list[T], tuple[T, ...]] + self.assertEqual(a.__args__, (list[T], tuple[T, ...])) + self.assertEqual(a.__parameters__, (T,)) + + +if __name__ == "__main__": + unittest.main() diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 142cfea364e40..73dc064d5ff75 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -25,6 +25,7 @@ import tempfile import threading import time +import types import unittest import uuid import warnings @@ -4191,7 +4192,7 @@ class A(os.PathLike): self.assertTrue(issubclass(FakePath, os.PathLike)) def test_pathlike_class_getitem(self): - self.assertIs(os.PathLike[bytes], os.PathLike) + self.assertIsInstance(os.PathLike[bytes], types.GenericAlias) class TimesTests(unittest.TestCase): diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 7cf31e1f0921d..aced87694cf7b 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -11,6 +11,7 @@ import tempfile import time import traceback +import types import selectors import sysconfig import select @@ -1435,8 +1436,8 @@ def test_file_not_found_with_bad_cwd(self): self.assertEqual(c.exception.filename, '/some/nonexistent/directory') def test_class_getitems(self): - self.assertIs(subprocess.Popen[bytes], subprocess.Popen) - self.assertIs(subprocess.CompletedProcess[str], subprocess.CompletedProcess) + self.assertIsInstance(subprocess.Popen[bytes], types.GenericAlias) + self.assertIsInstance(subprocess.CompletedProcess[str], types.GenericAlias) class RunFuncTestCase(BaseTestCase): def run_python(self, code, **kwargs): diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 524ab7c6d766f..f4cba0fa8dcf1 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -10,6 +10,7 @@ import warnings import contextlib import stat +import types import weakref from unittest import mock @@ -1222,8 +1223,8 @@ def test_truncate_with_size_parameter(self): self.assertEqual(os.fstat(f.fileno()).st_size, 20) def test_class_getitem(self): - self.assertIs(tempfile.SpooledTemporaryFile[bytes], - tempfile.SpooledTemporaryFile) + self.assertIsInstance(tempfile.SpooledTemporaryFile[bytes], + types.GenericAlias) if tempfile.NamedTemporaryFile is not tempfile.TemporaryFile: diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 544c91bc36a2a..f42238762ddcc 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -622,6 +622,7 @@ def test_methods(self): self.assertEqual(attrs, { '__contains__', '__getitem__', + '__class_getitem__', '__ior__', '__iter__', '__len__', diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index dea09eb874d19..95f865f8c3474 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1775,10 +1775,11 @@ def __call__(self): self.assertEqual(T1[int, T].__origin__, T1) self.assertEqual(T2.__parameters__, (T,)) - with self.assertRaises(TypeError): - T1[int] - with self.assertRaises(TypeError): - T2[int, str] + # These don't work because of tuple.__class_item__ + ## with self.assertRaises(TypeError): + ## T1[int] + ## with self.assertRaises(TypeError): + ## T2[int, str] self.assertEqual(repr(C1[int]).split('.')[-1], 'C1[int]') self.assertEqual(C2.__parameters__, ()) @@ -1817,22 +1818,22 @@ def test_type_erasure_special(self): self.clear_caches() class MyTup(Tuple[T, T]): ... self.assertIs(MyTup[int]().__class__, MyTup) - self.assertIs(MyTup[int]().__orig_class__, MyTup[int]) + self.assertEqual(MyTup[int]().__orig_class__, MyTup[int]) class MyCall(Callable[..., T]): def __call__(self): return None self.assertIs(MyCall[T]().__class__, MyCall) - self.assertIs(MyCall[T]().__orig_class__, MyCall[T]) + self.assertEqual(MyCall[T]().__orig_class__, MyCall[T]) class MyDict(typing.Dict[T, T]): ... self.assertIs(MyDict[int]().__class__, MyDict) - self.assertIs(MyDict[int]().__orig_class__, MyDict[int]) + self.assertEqual(MyDict[int]().__orig_class__, MyDict[int]) class MyDef(typing.DefaultDict[str, T]): ... self.assertIs(MyDef[int]().__class__, MyDef) - self.assertIs(MyDef[int]().__orig_class__, MyDef[int]) + self.assertEqual(MyDef[int]().__orig_class__, MyDef[int]) # ChainMap was added in 3.3 if sys.version_info >= (3, 3): class MyChain(typing.ChainMap[str, T]): ... self.assertIs(MyChain[int]().__class__, MyChain) - self.assertIs(MyChain[int]().__orig_class__, MyChain[int]) + self.assertEqual(MyChain[int]().__orig_class__, MyChain[int]) def test_all_repr_eq_any(self): objs = (getattr(typing, el) for el in typing.__all__) diff --git a/Lib/types.py b/Lib/types.py index ea3c0b29d5d4d..ad2020ec69b63 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -293,4 +293,7 @@ def wrapped(*args, **kwargs): return wrapped +GenericAlias = type(list[int]) + + __all__ = [n for n in globals() if n[:1] != '_'] diff --git a/Lib/typing.py b/Lib/typing.py index a72003a4a96fa..6cc3b0342ec77 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -26,7 +26,7 @@ import re as stdlib_re # Avoid confusion with the re we export. import sys import types -from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType +from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType, GenericAlias # Please keep __all__ alphabetized within each category. __all__ = [ @@ -180,7 +180,8 @@ def _collect_type_vars(types): for t in types: if isinstance(t, TypeVar) and t not in tvars: tvars.append(t) - if isinstance(t, _GenericAlias) and not t._special: + if ((isinstance(t, _GenericAlias) and not t._special) + or isinstance(t, GenericAlias)): tvars.extend([t for t in t.__parameters__ if t not in tvars]) return tuple(tvars) @@ -947,7 +948,7 @@ class _TypingEllipsis: _SPECIAL_NAMES = ['__abstractmethods__', '__annotations__', '__dict__', '__doc__', '__init__', '__module__', '__new__', '__slots__', - '__subclasshook__', '__weakref__'] + '__subclasshook__', '__weakref__', '__class_getitem__'] # These special attributes will be not collected as protocol members. EXCLUDED_ATTRIBUTES = _TYPING_INTERNALS + _SPECIAL_NAMES + ['_MutableMapping__marker'] diff --git a/Makefile.pre.in b/Makefile.pre.in index 0e3998c0ba453..948f9851d0c4a 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -393,6 +393,7 @@ OBJECT_OBJS= \ Objects/descrobject.o \ Objects/enumobject.o \ Objects/exceptions.o \ + Objects/genericaliasobject.o \ Objects/genobject.o \ Objects/fileobject.o \ Objects/floatobject.o \ diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481.rqSeGl.rst b/Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481.rqSeGl.rst new file mode 100644 index 0000000000000..9652a3fccd710 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481.rqSeGl.rst @@ -0,0 +1 @@ +Implement PEP 585. This supports list[int], tuple[str, ...] etc. \ No newline at end of file diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 11342a35179ef..181e3229da4f2 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1609,6 +1609,8 @@ static PyMethodDef deque_methods[] = { METH_FASTCALL, rotate_doc}, {"__sizeof__", (PyCFunction)deque_sizeof, METH_NOARGS, sizeof_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; @@ -2074,6 +2076,8 @@ static PyMethodDef defdict_methods[] = { defdict_copy_doc}, {"__reduce__", (PyCFunction)defdict_reduce, METH_NOARGS, reduce_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, + PyDoc_STR("See PEP 585")}, {NULL} }; diff --git a/Modules/_sre.c b/Modules/_sre.c index 15950c6b60c5c..52ed42099ba86 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -2568,6 +2568,8 @@ static PyMethodDef pattern_methods[] = { _SRE_SRE_PATTERN_SCANNER_METHODDEF _SRE_SRE_PATTERN___COPY___METHODDEF _SRE_SRE_PATTERN___DEEPCOPY___METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, + PyDoc_STR("See PEP 585")}, {NULL, NULL} }; @@ -2638,6 +2640,8 @@ static PyMethodDef match_methods[] = { _SRE_SRE_MATCH_EXPAND_METHODDEF _SRE_SRE_MATCH___COPY___METHODDEF _SRE_SRE_MATCH___DEEPCOPY___METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, + PyDoc_STR("See PEP 585")}, {NULL, NULL} }; diff --git a/Objects/abstract.c b/Objects/abstract.c index 02e4ad70718cd..e975edd7c5bc4 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -176,6 +176,12 @@ PyObject_GetItem(PyObject *o, PyObject *key) if (PyType_Check(o)) { PyObject *meth, *result; _Py_IDENTIFIER(__class_getitem__); + + // Special case type[int], but disallow other types so str[int] fails + if ((PyTypeObject*)o == &PyType_Type) { + return Py_GenericAlias(o, key); + } + if (_PyObject_LookupAttrId(o, &PyId___class_getitem__, &meth) < 0) { return NULL; } diff --git a/Objects/descrobject.c b/Objects/descrobject.c index cb7572b0d5d5e..5fab222b82cae 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1092,6 +1092,8 @@ static PyMethodDef mappingproxy_methods[] = { PyDoc_STR("D.items() -> list of D's (key, value) pairs, as 2-tuples")}, {"copy", (PyCFunction)mappingproxy_copy, METH_NOARGS, PyDoc_STR("D.copy() -> a shallow copy of D")}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, + PyDoc_STR("See PEP 585")}, {0} }; diff --git a/Objects/dictobject.c b/Objects/dictobject.c index e5f7005d49f23..60660adf897c3 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -3252,6 +3252,7 @@ static PyMethodDef mapp_methods[] = { {"copy", (PyCFunction)dict_copy, METH_NOARGS, copy__doc__}, DICT___REVERSED___METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c new file mode 100644 index 0000000000000..49f537ef96845 --- /dev/null +++ b/Objects/genericaliasobject.c @@ -0,0 +1,507 @@ +// types.GenericAlias -- used to represent e.g. list[int]. + +#include "Python.h" +#include "pycore_object.h" +#include "structmember.h" + +typedef struct { + PyObject_HEAD + PyObject *origin; + PyObject *args; + PyObject *parameters; +} gaobject; + +static void +ga_dealloc(PyObject *self) +{ + gaobject *alias = (gaobject *)self; + + _PyObject_GC_UNTRACK(self); + Py_XDECREF(alias->origin); + Py_XDECREF(alias->args); + Py_XDECREF(alias->parameters); + self->ob_type->tp_free(self); +} + +static int +ga_traverse(PyObject *self, visitproc visit, void *arg) +{ + gaobject *alias = (gaobject *)self; + Py_VISIT(alias->origin); + Py_VISIT(alias->args); + Py_VISIT(alias->parameters); + return 0; +} + +static int +ga_repr_item(_PyUnicodeWriter *writer, PyObject *p) +{ + _Py_IDENTIFIER(__module__); + _Py_IDENTIFIER(__qualname__); + _Py_IDENTIFIER(__origin__); + _Py_IDENTIFIER(__args__); + PyObject *qualname = NULL; + PyObject *module = NULL; + PyObject *r = NULL; + PyObject *tmp; + int err; + + if (p == Py_Ellipsis) { + // The Ellipsis object + r = PyUnicode_FromString("..."); + goto done; + } + + if (_PyObject_LookupAttrId(p, &PyId___origin__, &tmp) < 0) { + goto done; + } + if (tmp != NULL) { + Py_DECREF(tmp); + if (_PyObject_LookupAttrId(p, &PyId___args__, &tmp) < 0) { + goto done; + } + if (tmp != NULL) { + Py_DECREF(tmp); + // It looks like a GenericAlias + goto use_repr; + } + } + + if (_PyObject_LookupAttrId(p, &PyId___qualname__, &qualname) < 0) { + goto done; + } + if (qualname == NULL) { + goto use_repr; + } + if (_PyObject_LookupAttrId(p, &PyId___module__, &module) < 0) { + goto done; + } + if (module == NULL || module == Py_None) { + goto use_repr; + } + + // Looks like a class + if (PyUnicode_Check(module) && + _PyUnicode_EqualToASCIIString(module, "builtins")) + { + // builtins don't need a module name + r = PyObject_Str(qualname); + goto done; + } + else { + r = PyUnicode_FromFormat("%S.%S", module, qualname); + goto done; + } + +use_repr: + r = PyObject_Repr(p); + +done: + Py_XDECREF(qualname); + Py_XDECREF(module); + if (r == NULL) { + // error if any of the above PyObject_Repr/PyUnicode_From* fail + err = -1; + } + else { + err = _PyUnicodeWriter_WriteStr(writer, r); + Py_DECREF(r); + } + return err; +} + +static PyObject * +ga_repr(PyObject *self) +{ + gaobject *alias = (gaobject *)self; + Py_ssize_t len = PyTuple_GET_SIZE(alias->args); + + _PyUnicodeWriter writer; + _PyUnicodeWriter_Init(&writer); + + if (ga_repr_item(&writer, alias->origin) < 0) { + goto error; + } + if (_PyUnicodeWriter_WriteASCIIString(&writer, "[", 1) < 0) { + goto error; + } + for (Py_ssize_t i = 0; i < len; i++) { + if (i > 0) { + if (_PyUnicodeWriter_WriteASCIIString(&writer, ", ", 2) < 0) { + goto error; + } + } + PyObject *p = PyTuple_GET_ITEM(alias->args, i); + if (ga_repr_item(&writer, p) < 0) { + goto error; + } + } + if (len == 0) { + // for something like tuple[()] we should print a "()" + if (_PyUnicodeWriter_WriteASCIIString(&writer, "()", 2) < 0) { + goto error; + } + } + if (_PyUnicodeWriter_WriteASCIIString(&writer, "]", 1) < 0) { + goto error; + } + return _PyUnicodeWriter_Finish(&writer); +error: + _PyUnicodeWriter_Dealloc(&writer); + return NULL; +} + +// isinstance(obj, TypeVar) without importing typing.py. +// Returns -1 for errors. +static int +is_typevar(PyObject *obj) +{ + PyTypeObject *type = Py_TYPE(obj); + if (strcmp(type->tp_name, "TypeVar") != 0) { + return 0; + } + PyObject *module = PyObject_GetAttrString((PyObject *)type, "__module__"); + if (module == NULL) { + return -1; + } + int res = PyUnicode_Check(module) + && _PyUnicode_EqualToASCIIString(module, "typing"); + Py_DECREF(module); + return res; +} + +// Index of item in self[:len], or -1 if not found (self is a tuple) +static Py_ssize_t +tuple_index(PyObject *self, Py_ssize_t len, PyObject *item) +{ + for (Py_ssize_t i = 0; i < len; i++) { + if (PyTuple_GET_ITEM(self, i) == item) { + return i; + } + } + return -1; +} + +// tuple(t for t in args if isinstance(t, TypeVar)) +static PyObject * +make_parameters(PyObject *args) +{ + Py_ssize_t len = PyTuple_GET_SIZE(args); + PyObject *parameters = PyTuple_New(len); + if (parameters == NULL) + return NULL; + Py_ssize_t iparam = 0; + for (Py_ssize_t iarg = 0; iarg < len; iarg++) { + PyObject *t = PyTuple_GET_ITEM(args, iarg); + int typevar = is_typevar(t); + if (typevar < 0) { + Py_XDECREF(parameters); + return NULL; + } + if (typevar) { + if (tuple_index(parameters, iparam, t) < 0) { + Py_INCREF(t); + PyTuple_SET_ITEM(parameters, iparam, t); + iparam++; + } + } + } + if (iparam < len) { + if (_PyTuple_Resize(¶meters, iparam) < 0) { + Py_XDECREF(parameters); + return NULL; + } + } + return parameters; +} + +static PyObject * +ga_getitem(PyObject *self, PyObject *item) +{ + gaobject *alias = (gaobject *)self; + // do a lookup for __parameters__ so it gets populated (if not already) + if (alias->parameters == NULL) { + alias->parameters = make_parameters(alias->args); + if (alias->parameters == NULL) { + return NULL; + } + } + Py_ssize_t nparams = PyTuple_GET_SIZE(alias->parameters); + if (nparams == 0) { + return PyErr_Format(PyExc_TypeError, + "There are no type variables left in %R", + self); + } + int is_tuple = PyTuple_Check(item); + Py_ssize_t nitem = is_tuple ? PyTuple_GET_SIZE(item) : 1; + if (nitem != nparams) { + return PyErr_Format(PyExc_TypeError, + "Too %s arguments for %R", + nitem > nparams ? "many" : "few", + self); + } + Py_ssize_t nargs = PyTuple_GET_SIZE(alias->args); + PyObject *newargs = PyTuple_New(nargs); + if (newargs == NULL) + return NULL; + for (Py_ssize_t iarg = 0; iarg < nargs; iarg++) { + PyObject *arg = PyTuple_GET_ITEM(alias->args, iarg); + int typevar = is_typevar(arg); + if (typevar < 0) { + Py_DECREF(newargs); + return NULL; + } + if (typevar) { + Py_ssize_t iparam = tuple_index(alias->parameters, nparams, arg); + assert(iparam >= 0); + if (is_tuple) { + arg = PyTuple_GET_ITEM(item, iparam); + } + else { + assert(iparam == 0); + arg = item; + } + } + Py_INCREF(arg); + PyTuple_SET_ITEM(newargs, iarg, arg); + } + PyObject *res = Py_GenericAlias(alias->origin, newargs); + Py_DECREF(newargs); + return res; +} + +static PyMappingMethods ga_as_mapping = { + .mp_subscript = ga_getitem, +}; + +static Py_hash_t +ga_hash(PyObject *self) +{ + gaobject *alias = (gaobject *)self; + // TODO: Hash in the hash for the origin + Py_hash_t h0 = PyObject_Hash(alias->origin); + if (h0 == -1) { + return -1; + } + Py_hash_t h1 = PyObject_Hash(alias->args); + if (h1 == -1) { + return -1; + } + return h0 ^ h1; +} + +static PyObject * +ga_call(PyObject *self, PyObject *args, PyObject *kwds) +{ + gaobject *alias = (gaobject *)self; + PyObject *obj = PyObject_Call(alias->origin, args, kwds); + if (obj != NULL) { + if (PyObject_SetAttrString(obj, "__orig_class__", self) < 0) { + if (!PyErr_ExceptionMatches(PyExc_AttributeError) && + !PyErr_ExceptionMatches(PyExc_TypeError)) + { + Py_DECREF(obj); + return NULL; + } + PyErr_Clear(); + } + } + return obj; +} + +static const char* const attr_exceptions[] = { + "__origin__", + "__args__", + "__parameters__", + "__mro_entries__", + "__reduce_ex__", // needed so we don't look up object.__reduce_ex__ + "__reduce__", + NULL, +}; + +static PyObject * +ga_getattro(PyObject *self, PyObject *name) +{ + gaobject *alias = (gaobject *)self; + if (PyUnicode_Check(name)) { + for (const char * const *p = attr_exceptions; ; p++) { + if (*p == NULL) { + return PyObject_GetAttr(alias->origin, name); + } + if (_PyUnicode_EqualToASCIIString(name, *p)) { + break; + } + } + } + return PyObject_GenericGetAttr(self, name); +} + +static PyObject * +ga_richcompare(PyObject *a, PyObject *b, int op) +{ + if (Py_TYPE(a) != &Py_GenericAliasType || + Py_TYPE(b) != &Py_GenericAliasType || + (op != Py_EQ && op != Py_NE)) + { + Py_RETURN_NOTIMPLEMENTED; + } + + if (op == Py_NE) { + PyObject *eq = ga_richcompare(a, b, Py_EQ); + if (eq == NULL) + return NULL; + Py_DECREF(eq); + if (eq == Py_True) { + Py_RETURN_FALSE; + } + else { + Py_RETURN_TRUE; + } + } + + gaobject *aa = (gaobject *)a; + gaobject *bb = (gaobject *)b; + int eq = PyObject_RichCompareBool(aa->origin, bb->origin, Py_EQ); + if (eq < 0) { + return NULL; + } + if (!eq) { + Py_RETURN_FALSE; + } + return PyObject_RichCompare(aa->args, bb->args, Py_EQ); +} + +static PyObject * +ga_mro_entries(PyObject *self, PyObject *args) +{ + gaobject *alias = (gaobject *)self; + return PyTuple_Pack(1, alias->origin); +} + +static PyObject * +ga_instancecheck(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + PyErr_SetString(PyExc_TypeError, + "isinstance() argument 2 cannot be a parameterized generic"); + return NULL; +} + +static PyObject * +ga_subclasscheck(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + PyErr_SetString(PyExc_TypeError, + "issubclass() argument 2 cannot be a parameterized generic"); + return NULL; +} + +static PyObject * +ga_reduce(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + gaobject *alias = (gaobject *)self; + return Py_BuildValue("O(OO)", Py_TYPE(alias), + alias->origin, alias->args); +} + +static PyMethodDef ga_methods[] = { + {"__mro_entries__", ga_mro_entries, METH_O}, + {"__instancecheck__", ga_instancecheck, METH_O}, + {"__subclasscheck__", ga_subclasscheck, METH_O}, + {"__reduce__", ga_reduce, METH_NOARGS}, + {0} +}; + +static PyMemberDef ga_members[] = { + {"__origin__", T_OBJECT, offsetof(gaobject, origin), READONLY}, + {"__args__", T_OBJECT, offsetof(gaobject, args), READONLY}, + {0} +}; + +static PyObject * +ga_parameters(PyObject *self, void *unused) +{ + gaobject *alias = (gaobject *)self; + if (alias->parameters == NULL) { + alias->parameters = make_parameters(alias->args); + if (alias->parameters == NULL) { + return NULL; + } + } + Py_INCREF(alias->parameters); + return alias->parameters; +} + +static PyGetSetDef ga_properties[] = { + {"__parameters__", ga_parameters, (setter)NULL, "Type variables in the GenericAlias.", NULL}, + {0} +}; + +static PyObject * +ga_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + if (kwds != NULL && PyDict_GET_SIZE(kwds) != 0) { + PyErr_SetString(PyExc_TypeError, "GenericAlias does not support keyword arguments"); + return NULL; + } + if (PyTuple_GET_SIZE(args) != 2) { + PyErr_SetString(PyExc_TypeError, "GenericAlias expects 2 positional arguments"); + return NULL; + } + PyObject *origin = PyTuple_GET_ITEM(args, 0); + PyObject *arguments = PyTuple_GET_ITEM(args, 1); + return Py_GenericAlias(origin, arguments); +} + +// TODO: +// - argument clinic? +// - __doc__? +// - cache? +PyTypeObject Py_GenericAliasType = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + .tp_name = "types.GenericAlias", + .tp_doc = "Represent a PEP 585 generic type\n" + "\n" + "E.g. for t = list[int], t.origin is list and t.args is (int,).", + .tp_basicsize = sizeof(gaobject), + .tp_dealloc = ga_dealloc, + .tp_repr = ga_repr, + .tp_as_mapping = &ga_as_mapping, + .tp_hash = ga_hash, + .tp_call = ga_call, + .tp_getattro = ga_getattro, + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, + .tp_traverse = ga_traverse, + .tp_richcompare = ga_richcompare, + .tp_methods = ga_methods, + .tp_members = ga_members, + .tp_alloc = PyType_GenericAlloc, + .tp_new = ga_new, + .tp_free = PyObject_GC_Del, + .tp_getset = ga_properties, +}; + +PyObject * +Py_GenericAlias(PyObject *origin, PyObject *args) +{ + if (!PyTuple_Check(args)) { + args = PyTuple_Pack(1, args); + if (args == NULL) { + return NULL; + } + } + else { + Py_INCREF(args); + } + + gaobject *alias = PyObject_GC_New(gaobject, &Py_GenericAliasType); + if (alias == NULL) { + Py_DECREF(args); + return NULL; + } + + Py_INCREF(origin); + alias->origin = origin; + alias->args = args; + alias->parameters = NULL; + _PyObject_GC_TRACK(alias); + return (PyObject *)alias; +} diff --git a/Objects/listobject.c b/Objects/listobject.c index 91687bcd22910..48063b285f60c 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -2780,6 +2780,7 @@ static PyMethodDef list_methods[] = { LIST_COUNT_METHODDEF LIST_REVERSE_METHODDEF LIST_SORT_METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/setobject.c b/Objects/setobject.c index 41b9ecd2f1740..232ba6d97a070 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -2132,6 +2132,7 @@ static PyMethodDef set_methods[] = { union_doc}, {"update", (PyCFunction)set_update, METH_VARARGS, update_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; @@ -2244,6 +2245,7 @@ static PyMethodDef frozenset_methods[] = { symmetric_difference_doc}, {"union", (PyCFunction)set_union, METH_VARARGS, union_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 8a8c6ae74f8a1..68163d8c48c71 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -832,6 +832,7 @@ static PyMethodDef tuple_methods[] = { TUPLE___GETNEWARGS___METHODDEF TUPLE_INDEX_METHODDEF TUPLE_COUNT_METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; diff --git a/PC/python3.def b/PC/python3.def index c7aed8789cfaa..083384e30f648 100644 --- a/PC/python3.def +++ b/PC/python3.def @@ -734,6 +734,8 @@ EXPORTS Py_FileSystemDefaultEncoding=python39.Py_FileSystemDefaultEncoding DATA Py_Finalize=python39.Py_Finalize Py_FinalizeEx=python39.Py_FinalizeEx + Py_GenericAlias=python39.Py_GenericAlias + Py_GenericAliasType=python39.Py_GenericAliasType Py_GetBuildInfo=python39.Py_GetBuildInfo Py_GetCompiler=python39.Py_GetCompiler Py_GetCopyright=python39.Py_GetCopyright diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 32778060e5f88..22f1b95d0a75a 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -383,6 +383,7 @@ + From webhook-mailer at python.org Tue Apr 7 17:11:57 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Apr 2020 21:11:57 -0000 Subject: [Python-checkins] bpo-40089: Add _at_fork_reinit() method to locks (GH-19195) Message-ID: https://github.com/python/cpython/commit/87255be6964979b5abdc4b9dcf81cdcfdad6e753 commit: 87255be6964979b5abdc4b9dcf81cdcfdad6e753 branch: master author: Victor Stinner committer: GitHub date: 2020-04-07T23:11:49+02:00 summary: bpo-40089: Add _at_fork_reinit() method to locks (GH-19195) Add a private _at_fork_reinit() method to _thread.Lock, _thread.RLock, threading.RLock and threading.Condition classes: reinitialize the lock after fork in the child process; reset the lock to the unlocked state. Rename also the private _reset_internal_locks() method of threading.Event to _at_fork_reinit(). * Add _PyThread_at_fork_reinit() private function. It is excluded from the limited C API. * threading.Thread._reset_internal_locks() now calls _at_fork_reinit() on self._tstate_lock rather than creating a new Python lock object. files: A Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst M Include/pythread.h M Lib/test/lock_tests.py M Lib/threading.py M Modules/_threadmodule.c M Modules/posixmodule.c M Python/thread_pthread.h diff --git a/Include/pythread.h b/Include/pythread.h index 1cf83b7a36d14..bb9d86412218a 100644 --- a/Include/pythread.h +++ b/Include/pythread.h @@ -36,6 +36,15 @@ PyAPI_FUNC(int) PyThread_acquire_lock(PyThread_type_lock, int); #define WAIT_LOCK 1 #define NOWAIT_LOCK 0 +#ifndef Py_LIMITED_API +#ifdef HAVE_FORK +/* Private function to reinitialize a lock at fork in the child process. + Reset the lock to the unlocked state. + Return 0 on success, return -1 on error. */ +PyAPI_FUNC(int) _PyThread_at_fork_reinit(PyThread_type_lock *lock); +#endif /* HAVE_FORK */ +#endif /* !Py_LIMITED_API */ + /* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting on a lock (see PyThread_acquire_lock_timed() below). PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py index cd1155d34e996..b3975254c79b5 100644 --- a/Lib/test/lock_tests.py +++ b/Lib/test/lock_tests.py @@ -2,6 +2,7 @@ Various tests for synchronization primitives. """ +import os import sys import time from _thread import start_new_thread, TIMEOUT_MAX @@ -12,6 +13,11 @@ from test import support +requires_fork = unittest.skipUnless(hasattr(os, 'fork'), + "platform doesn't support fork " + "(no _at_fork_reinit method)") + + def _wait(): # A crude wait/yield function not relying on synchronization primitives. time.sleep(0.01) @@ -265,6 +271,25 @@ def test_state_after_timeout(self): self.assertFalse(lock.locked()) self.assertTrue(lock.acquire(blocking=False)) + @requires_fork + def test_at_fork_reinit(self): + def use_lock(lock): + # make sure that the lock still works normally + # after _at_fork_reinit() + lock.acquire() + lock.release() + + # unlocked + lock = self.locktype() + lock._at_fork_reinit() + use_lock(lock) + + # locked: _at_fork_reinit() resets the lock to the unlocked state + lock2 = self.locktype() + lock2.acquire() + lock2._at_fork_reinit() + use_lock(lock2) + class RLockTests(BaseLockTests): """ @@ -417,12 +442,13 @@ def f(): b.wait_for_finished() self.assertEqual(results, [True] * N) - def test_reset_internal_locks(self): + @requires_fork + def test_at_fork_reinit(self): # ensure that condition is still using a Lock after reset evt = self.eventtype() with evt._cond: self.assertFalse(evt._cond.acquire(False)) - evt._reset_internal_locks() + evt._at_fork_reinit() with evt._cond: self.assertFalse(evt._cond.acquire(False)) diff --git a/Lib/threading.py b/Lib/threading.py index 6b25e7a26ed2a..5424db3dabc44 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -123,6 +123,11 @@ def __repr__(self): hex(id(self)) ) + def _at_fork_reinit(self): + self._block._at_fork_reinit() + self._owner = None + self._count = 0 + def acquire(self, blocking=True, timeout=-1): """Acquire a lock, blocking or non-blocking. @@ -245,6 +250,10 @@ def __init__(self, lock=None): pass self._waiters = _deque() + def _at_fork_reinit(self): + self._lock._at_fork_reinit() + self._waiters.clear() + def __enter__(self): return self._lock.__enter__() @@ -514,9 +523,9 @@ def __init__(self): self._cond = Condition(Lock()) self._flag = False - def _reset_internal_locks(self): - # private! called by Thread._reset_internal_locks by _after_fork() - self._cond.__init__(Lock()) + def _at_fork_reinit(self): + # Private method called by Thread._reset_internal_locks() + self._cond._at_fork_reinit() def is_set(self): """Return true if and only if the internal flag is true.""" @@ -816,9 +825,10 @@ class is implemented. def _reset_internal_locks(self, is_alive): # private! Called by _after_fork() to reset our internal locks as # they may be in an invalid state leading to a deadlock or crash. - self._started._reset_internal_locks() + self._started._at_fork_reinit() if is_alive: - self._set_tstate_lock() + self._tstate_lock._at_fork_reinit() + self._tstate_lock.acquire() else: # The thread isn't alive after fork: it doesn't have a tstate # anymore. diff --git a/Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst b/Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst new file mode 100644 index 0000000000000..3948852fbee6b --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst @@ -0,0 +1,6 @@ +Add a private ``_at_fork_reinit()`` method to :class:`_thread.Lock`, +:class:`_thread.RLock`, :class:`threading.RLock` and +:class:`threading.Condition` classes: reinitialize the lock at fork in the +child process, reset the lock to the unlocked state. +Rename also the private ``_reset_internal_locks()`` method of +:class:`threading.Event` to ``_at_fork_reinit()``. diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index bd8a40f0c94b5..addef3ee54e0f 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -213,6 +213,22 @@ lock_repr(lockobject *self) self->locked ? "locked" : "unlocked", Py_TYPE(self)->tp_name, self); } +#ifdef HAVE_FORK +static PyObject * +lock__at_fork_reinit(lockobject *self, PyObject *Py_UNUSED(args)) +{ + if (_PyThread_at_fork_reinit(&self->lock_lock) < 0) { + PyErr_SetString(ThreadError, "failed to reinitialize lock at fork"); + return NULL; + } + + self->locked = 0; + + Py_RETURN_NONE; +} +#endif /* HAVE_FORK */ + + static PyMethodDef lock_methods[] = { {"acquire_lock", (PyCFunction)(void(*)(void))lock_PyThread_acquire_lock, METH_VARARGS | METH_KEYWORDS, acquire_doc}, @@ -230,6 +246,10 @@ static PyMethodDef lock_methods[] = { METH_VARARGS | METH_KEYWORDS, acquire_doc}, {"__exit__", (PyCFunction)lock_PyThread_release_lock, METH_VARARGS, release_doc}, +#ifdef HAVE_FORK + {"_at_fork_reinit", (PyCFunction)lock__at_fork_reinit, + METH_NOARGS, NULL}, +#endif {NULL, NULL} /* sentinel */ }; @@ -446,22 +466,20 @@ For internal use by `threading.Condition`."); static PyObject * rlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - rlockobject *self; - - self = (rlockobject *) type->tp_alloc(type, 0); - if (self != NULL) { - self->in_weakreflist = NULL; - self->rlock_owner = 0; - self->rlock_count = 0; - - self->rlock_lock = PyThread_allocate_lock(); - if (self->rlock_lock == NULL) { - Py_DECREF(self); - PyErr_SetString(ThreadError, "can't allocate lock"); - return NULL; - } + rlockobject *self = (rlockobject *) type->tp_alloc(type, 0); + if (self == NULL) { + return NULL; } + self->in_weakreflist = NULL; + self->rlock_owner = 0; + self->rlock_count = 0; + self->rlock_lock = PyThread_allocate_lock(); + if (self->rlock_lock == NULL) { + Py_DECREF(self); + PyErr_SetString(ThreadError, "can't allocate lock"); + return NULL; + } return (PyObject *) self; } @@ -475,6 +493,23 @@ rlock_repr(rlockobject *self) } +#ifdef HAVE_FORK +static PyObject * +rlock__at_fork_reinit(rlockobject *self, PyObject *Py_UNUSED(args)) +{ + if (_PyThread_at_fork_reinit(&self->rlock_lock) < 0) { + PyErr_SetString(ThreadError, "failed to reinitialize lock at fork"); + return NULL; + } + + self->rlock_owner = 0; + self->rlock_count = 0; + + Py_RETURN_NONE; +} +#endif /* HAVE_FORK */ + + static PyMethodDef rlock_methods[] = { {"acquire", (PyCFunction)(void(*)(void))rlock_acquire, METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc}, @@ -490,6 +525,10 @@ static PyMethodDef rlock_methods[] = { METH_VARARGS | METH_KEYWORDS, rlock_acquire_doc}, {"__exit__", (PyCFunction)rlock_release, METH_VARARGS, rlock_release_doc}, +#ifdef HAVE_FORK + {"_at_fork_reinit", (PyCFunction)rlock__at_fork_reinit, + METH_NOARGS, NULL}, +#endif {NULL, NULL} /* sentinel */ }; diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 345798dc8c10d..4264bf1a36dce 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -491,7 +491,8 @@ register_at_forker(PyObject **lst, PyObject *func) } return PyList_Append(*lst, func); } -#endif +#endif /* HAVE_FORK */ + /* Legacy wrapper */ void diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 40e2e117a2eb2..e3497e7d595b1 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -693,6 +693,26 @@ PyThread_release_lock(PyThread_type_lock lock) #endif /* USE_SEMAPHORES */ +int +_PyThread_at_fork_reinit(PyThread_type_lock *lock) +{ + PyThread_type_lock new_lock = PyThread_allocate_lock(); + if (new_lock == NULL) { + return -1; + } + + /* bpo-6721, bpo-40089: The old lock can be in an inconsistent state. + fork() can be called in the middle of an operation on the lock done by + another thread. So don't call PyThread_free_lock(*lock). + + Leak memory on purpose. Don't release the memory either since the + address of a mutex is relevant. Putting two mutexes at the same address + can lead to problems. */ + + *lock = new_lock; + return 0; +} + int PyThread_acquire_lock(PyThread_type_lock lock, int waitflag) { From webhook-mailer at python.org Tue Apr 7 17:35:56 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 07 Apr 2020 21:35:56 -0000 Subject: [Python-checkins] bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19194) Message-ID: https://github.com/python/cpython/commit/6318e45bda6c37d5497f33a6039cdb65aa494c93 commit: 6318e45bda6c37d5497f33a6039cdb65aa494c93 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-07T23:35:52+02:00 summary: bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19194) If fork was not called by a thread spawned by threading.Thread, threading._after_fork() now creates a _MainThread instance for _main_thread, instead of a _DummyThread instance. (cherry picked from commit d8ff44ce4cd6f3ec0fab5fccda6bf14afcb25c30) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst M Lib/threading.py diff --git a/Lib/threading.py b/Lib/threading.py index 2f6ac7036f5f6..813dae2aa9f8e 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1421,7 +1421,15 @@ def _after_fork(): # fork() only copied the current thread; clear references to others. new_active = {} - current = current_thread() + + try: + current = _active[get_ident()] + except KeyError: + # fork() was called in a thread which was not spawned + # by threading.Thread. For example, a thread spawned + # by thread.start_new_thread(). + current = _MainThread() + _main_thread = current # reset _shutdown() locks: threads re-register their _tstate_lock below diff --git a/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst b/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst new file mode 100644 index 0000000000000..f5335a33c066c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst @@ -0,0 +1,3 @@ +Fix threading._after_fork(): if fork was not called by a thread spawned by +threading.Thread, threading._after_fork() now creates a _MainThread instance +for _main_thread, instead of a _DummyThread instance. From webhook-mailer at python.org Tue Apr 7 17:36:11 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 07 Apr 2020 21:36:11 -0000 Subject: [Python-checkins] bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19193) Message-ID: https://github.com/python/cpython/commit/a514ccb3ea6f01fef850d9465b82a1670d5ace44 commit: a514ccb3ea6f01fef850d9465b82a1670d5ace44 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-07T23:36:07+02:00 summary: bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19193) If fork was not called by a thread spawned by threading.Thread, threading._after_fork() now creates a _MainThread instance for _main_thread, instead of a _DummyThread instance. (cherry picked from commit d8ff44ce4cd6f3ec0fab5fccda6bf14afcb25c30) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst M Lib/threading.py diff --git a/Lib/threading.py b/Lib/threading.py index b597336a15067..b961456fb792a 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -1340,7 +1340,15 @@ def _after_fork(): # fork() only copied the current thread; clear references to others. new_active = {} - current = current_thread() + + try: + current = _active[get_ident()] + except KeyError: + # fork() was called in a thread which was not spawned + # by threading.Thread. For example, a thread spawned + # by thread.start_new_thread(). + current = _MainThread() + _main_thread = current # reset _shutdown() locks: threads re-register their _tstate_lock below diff --git a/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst b/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst new file mode 100644 index 0000000000000..f5335a33c066c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst @@ -0,0 +1,3 @@ +Fix threading._after_fork(): if fork was not called by a thread spawned by +threading.Thread, threading._after_fork() now creates a _MainThread instance +for _main_thread, instead of a _DummyThread instance. From webhook-mailer at python.org Tue Apr 7 18:38:20 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Apr 2020 22:38:20 -0000 Subject: [Python-checkins] bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379) Message-ID: https://github.com/python/cpython/commit/9205520d8c43488696d66cbdd9aefbb21871c508 commit: 9205520d8c43488696d66cbdd9aefbb21871c508 branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T00:38:15+02:00 summary: bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379) The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the PyObject_NewVar() macro, to hide implementation details. They no longer access directly the PyTypeObject.tp_basicsize member. Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from the limited C API. Replace PyObject_NEW() with PyObject_New() and replace PyObject_NEW_VAR() with PyObject_NewVar(). files: A Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst M Include/cpython/objimpl.h M Include/objimpl.h M Modules/_curses_panel.c M Modules/_cursesmodule.c M Modules/_sre.c M Objects/capsule.c M Objects/codeobject.c M Objects/object.c M PC/_msi.c M PC/winreg.c diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h index 2f802e92a6cdf..832622cb61921 100644 --- a/Include/cpython/objimpl.h +++ b/Include/cpython/objimpl.h @@ -6,6 +6,56 @@ extern "C" { #endif +#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) + +/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a + vrbl-size object with nitems items, exclusive of gc overhead (if any). The + value is rounded up to the closest multiple of sizeof(void *), in order to + ensure that pointer fields at the end of the object are correctly aligned + for the platform (this is of special importance for subclasses of, e.g., + str or int, so that pointers can be stored after the embedded data). + + Note that there's no memory wastage in doing this, as malloc has to + return (at worst) pointer-aligned memory anyway. +*/ +#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0 +# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2" +#endif + +#define _PyObject_VAR_SIZE(typeobj, nitems) \ + _Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \ + (nitems)*(typeobj)->tp_itemsize, \ + SIZEOF_VOID_P) + + +/* This example code implements an object constructor with a custom + allocator, where PyObject_New is inlined, and shows the important + distinction between two steps (at least): + 1) the actual allocation of the object storage; + 2) the initialization of the Python specific fields + in this storage with PyObject_{Init, InitVar}. + + PyObject * + YourObject_New(...) + { + PyObject *op; + + op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); + if (op == NULL) + return PyErr_NoMemory(); + + PyObject_Init(op, &YourTypeStruct); + + op->ob_field = value; + ... + return op; + } + + Note that in C++, the use of the new operator usually implies that + the 1st step is performed automatically for you, so in a C++ class + constructor you would start directly with PyObject_Init/InitVar. */ + + /* Inline functions trading binary compatibility for speed: PyObject_INIT() is the fast version of PyObject_Init(), and PyObject_INIT_VAR() is the fast version of PyObject_InitVar(). diff --git a/Include/objimpl.h b/Include/objimpl.h index 45919251f43a5..6e7549c90d210 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -122,12 +122,18 @@ PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *, PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *); PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); -#define PyObject_New(type, typeobj) \ - ( (type *) _PyObject_New(typeobj) ) +#define PyObject_New(type, typeobj) ((type *)_PyObject_New(typeobj)) + +// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly +// PyObject_MALLOC() with _PyObject_SIZE(). +#define PyObject_NEW(type, typeobj) PyObject_New(type, typeobj) + #define PyObject_NewVar(type, typeobj, n) \ ( (type *) _PyObject_NewVar((typeobj), (n)) ) -#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize ) +// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly +// PyObject_MALLOC() with _PyObject_VAR_SIZE(). +#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, typeobj, n) #ifdef Py_LIMITED_API @@ -143,64 +149,6 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t); #endif -/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a - vrbl-size object with nitems items, exclusive of gc overhead (if any). The - value is rounded up to the closest multiple of sizeof(void *), in order to - ensure that pointer fields at the end of the object are correctly aligned - for the platform (this is of special importance for subclasses of, e.g., - str or int, so that pointers can be stored after the embedded data). - - Note that there's no memory wastage in doing this, as malloc has to - return (at worst) pointer-aligned memory anyway. -*/ -#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0 -# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2" -#endif - -#define _PyObject_VAR_SIZE(typeobj, nitems) \ - _Py_SIZE_ROUND_UP((typeobj)->tp_basicsize + \ - (nitems)*(typeobj)->tp_itemsize, \ - SIZEOF_VOID_P) - -#define PyObject_NEW(type, typeobj) \ -( (type *) PyObject_Init( \ - (PyObject *) PyObject_MALLOC( _PyObject_SIZE(typeobj) ), (typeobj)) ) - -#define PyObject_NEW_VAR(type, typeobj, n) \ -( (type *) PyObject_InitVar( \ - (PyVarObject *) PyObject_MALLOC(_PyObject_VAR_SIZE((typeobj),(n)) ),\ - (typeobj), (n)) ) - -/* This example code implements an object constructor with a custom - allocator, where PyObject_New is inlined, and shows the important - distinction between two steps (at least): - 1) the actual allocation of the object storage; - 2) the initialization of the Python specific fields - in this storage with PyObject_{Init, InitVar}. - - PyObject * - YourObject_New(...) - { - PyObject *op; - - op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct)); - if (op == NULL) - return PyErr_NoMemory(); - - PyObject_Init(op, &YourTypeStruct); - - op->ob_field = value; - ... - return op; - } - - Note that in C++, the use of the new operator usually implies that - the 1st step is performed automatically for you, so in a C++ class - constructor you would start directly with PyObject_Init/InitVar -*/ - - - /* * Garbage Collection Support * ========================== diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst b/Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst new file mode 100644 index 0000000000000..2c31cca7f7ecf --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst @@ -0,0 +1,4 @@ +The :c:func:`PyObject_NEW` macro becomes an alias to the :c:func:`PyObject_New` +macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an alias to the +:c:func:`PyObject_NewVar` macro, to hide implementation details. They no longer +access directly the :c:member:`PyTypeObject.tp_basicsize` member. diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index 77a6a14ed20ab..7ca91f641617a 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -239,7 +239,7 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) { PyCursesPanelObject *po; - po = PyObject_NEW(PyCursesPanelObject, + po = PyObject_New(PyCursesPanelObject, (PyTypeObject *)(_curses_panelstate_global)->PyCursesPanel_Type); if (po == NULL) return NULL; po->pan = pan; diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index 3d16af7f0a34f..ca6a89f1dbeb3 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -547,7 +547,7 @@ PyCursesWindow_New(WINDOW *win, const char *encoding) encoding = "utf-8"; } - wo = PyObject_NEW(PyCursesWindowObject, &PyCursesWindow_Type); + wo = PyObject_New(PyCursesWindowObject, &PyCursesWindow_Type); if (wo == NULL) return NULL; wo->win = win; wo->encoding = _PyMem_Strdup(encoding); diff --git a/Modules/_sre.c b/Modules/_sre.c index 52ed42099ba86..bee2e1284d68b 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -1338,7 +1338,7 @@ _sre_compile_impl(PyObject *module, PyObject *pattern, int flags, n = PyList_GET_SIZE(code); /* coverity[ampersand_in_size] */ - self = PyObject_NEW_VAR(PatternObject, &Pattern_Type, n); + self = PyObject_NewVar(PatternObject, &Pattern_Type, n); if (!self) return NULL; self->weakreflist = NULL; @@ -2327,8 +2327,8 @@ pattern_new_match(PatternObject* pattern, SRE_STATE* state, Py_ssize_t status) /* create match object (with room for extra group marks) */ /* coverity[ampersand_in_size] */ - match = PyObject_NEW_VAR(MatchObject, &Match_Type, - 2*(pattern->groups+1)); + match = PyObject_NewVar(MatchObject, &Match_Type, + 2*(pattern->groups+1)); if (!match) return NULL; @@ -2468,7 +2468,7 @@ pattern_scanner(PatternObject *self, PyObject *string, Py_ssize_t pos, Py_ssize_ ScannerObject* scanner; /* create scanner object */ - scanner = PyObject_NEW(ScannerObject, &Scanner_Type); + scanner = PyObject_New(ScannerObject, &Scanner_Type); if (!scanner) return NULL; scanner->pattern = NULL; diff --git a/Objects/capsule.c b/Objects/capsule.c index 599893a320dba..ed24cc1d6a2eb 100644 --- a/Objects/capsule.c +++ b/Objects/capsule.c @@ -50,7 +50,7 @@ PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor) return NULL; } - capsule = PyObject_NEW(PyCapsule, &PyCapsule_Type); + capsule = PyObject_New(PyCapsule, &PyCapsule_Type); if (capsule == NULL) { return NULL; } diff --git a/Objects/codeobject.c b/Objects/codeobject.c index fd64393c235c5..1820d8c8a5688 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -219,7 +219,7 @@ PyCode_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, cell2arg = NULL; } } - co = PyObject_NEW(PyCodeObject, &PyCode_Type); + co = PyObject_New(PyCodeObject, &PyCode_Type); if (co == NULL) { if (cell2arg) PyMem_FREE(cell2arg); diff --git a/Objects/object.c b/Objects/object.c index 05241e8a740d1..069afc0ac9933 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -161,11 +161,12 @@ PyObject_InitVar(PyVarObject *op, PyTypeObject *tp, Py_ssize_t size) PyObject * _PyObject_New(PyTypeObject *tp) { - PyObject *op; - op = (PyObject *) PyObject_MALLOC(_PyObject_SIZE(tp)); - if (op == NULL) + PyObject *op = (PyObject *) PyObject_MALLOC(_PyObject_SIZE(tp)); + if (op == NULL) { return PyErr_NoMemory(); - return PyObject_INIT(op, tp); + } + PyObject_INIT(op, tp); + return op; } PyVarObject * diff --git a/PC/_msi.c b/PC/_msi.c index accbe7a720694..6ed8724f77f95 100644 --- a/PC/_msi.c +++ b/PC/_msi.c @@ -531,7 +531,7 @@ static PyTypeObject record_Type = { static PyObject* record_new(MSIHANDLE h) { - msiobj *result = PyObject_NEW(struct msiobj, &record_Type); + msiobj *result = PyObject_New(struct msiobj, &record_Type); if (!result) { MsiCloseHandle(h); @@ -882,7 +882,7 @@ msidb_openview(msiobj *msidb, PyObject *args) if ((status = MsiDatabaseOpenView(msidb->h, sql, &hView)) != ERROR_SUCCESS) return msierror(status); - result = PyObject_NEW(struct msiobj, &msiview_Type); + result = PyObject_New(struct msiobj, &msiview_Type); if (!result) { MsiCloseHandle(hView); return NULL; @@ -918,7 +918,7 @@ msidb_getsummaryinformation(msiobj *db, PyObject *args) if (status != ERROR_SUCCESS) return msierror(status); - oresult = PyObject_NEW(struct msiobj, &summary_Type); + oresult = PyObject_New(struct msiobj, &summary_Type); if (!oresult) { MsiCloseHandle(result); return NULL; @@ -1013,7 +1013,7 @@ static PyObject* msiopendb(PyObject *obj, PyObject *args) if (status != ERROR_SUCCESS) return msierror(status); - result = PyObject_NEW(struct msiobj, &msidb_Type); + result = PyObject_New(struct msiobj, &msidb_Type); if (!result) { MsiCloseHandle(h); return NULL; diff --git a/PC/winreg.c b/PC/winreg.c index 5dff7deadf767..ec2f607d4a818 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -390,7 +390,7 @@ PyTypeObject PyHKEY_Type = PyObject * PyHKEY_New(HKEY hInit) { - PyHKEYObject *key = PyObject_NEW(PyHKEYObject, &PyHKEY_Type); + PyHKEYObject *key = PyObject_New(PyHKEYObject, &PyHKEY_Type); if (key) key->hkey = hInit; return (PyObject *)key; From webhook-mailer at python.org Tue Apr 7 19:13:57 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Apr 2020 23:13:57 -0000 Subject: [Python-checkins] bpo-40170: Convert PyObject_CheckBuffer() macro to a function (GH-19376) Message-ID: https://github.com/python/cpython/commit/ef5c615f5ae72c4f6979159c94da46afefbfab9a commit: ef5c615f5ae72c4f6979159c94da46afefbfab9a branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T01:13:53+02:00 summary: bpo-40170: Convert PyObject_CheckBuffer() macro to a function (GH-19376) Convert PyObject_CheckBuffer() macro to a function to hide implementation details: the macro accessed directly the PyTypeObject.tp_as_buffer member. files: A Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst M Include/cpython/abstract.h M Objects/abstract.c diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h index 9d23c8c11be57..3f834ff727e1d 100644 --- a/Include/cpython/abstract.h +++ b/Include/cpython/abstract.h @@ -264,9 +264,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t); /* === New Buffer API ============================================ */ /* Return 1 if the getbuffer function is available, otherwise return 0. */ -#define PyObject_CheckBuffer(obj) \ - ((Py_TYPE(obj)->tp_as_buffer != NULL) && \ - (Py_TYPE(obj)->tp_as_buffer->bf_getbuffer != NULL)) +PyAPI_FUNC(int) PyObject_CheckBuffer(PyObject *obj); /* This is a C-API version of the getbuffer function call. It checks to make sure object has the required function pointer and issues the diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst b/Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst new file mode 100644 index 0000000000000..fb378faa90c51 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst @@ -0,0 +1,3 @@ +Convert :c:func:`PyObject_CheckBuffer` macro to a function to hide +implementation details: the macro accessed directly the +:c:member:`PyTypeObject.tp_as_buffer` member. diff --git a/Objects/abstract.c b/Objects/abstract.c index e975edd7c5bc4..49a38d8f6e290 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -277,6 +277,16 @@ PyObject_DelItemString(PyObject *o, const char *key) return ret; } + +/* Return 1 if the getbuffer function is available, otherwise return 0. */ +int +PyObject_CheckBuffer(PyObject *obj) +{ + PyBufferProcs *tp_as_buffer = Py_TYPE(obj)->tp_as_buffer; + return (tp_as_buffer != NULL && tp_as_buffer->bf_getbuffer != NULL); +} + + /* We release the buffer right after use of this function which could cause issues later on. Don't use these functions in new code. */ From webhook-mailer at python.org Tue Apr 7 19:42:31 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 07 Apr 2020 23:42:31 -0000 Subject: [Python-checkins] bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378) Message-ID: https://github.com/python/cpython/commit/45ec5b99aefa54552947049086e87ec01bc2fc9a commit: 45ec5b99aefa54552947049086e87ec01bc2fc9a branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T01:42:27+02:00 summary: bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378) PyType_HasFeature() now always calls PyType_GetFlags() to hide implementation details. Previously, it accessed directly the PyTypeObject.tp_flags member when the limited C API was not used. Add fast inlined version _PyType_HasFeature() and _PyType_IS_GC() for object.c and typeobject.c. files: A Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst M Include/internal/pycore_object.h M Include/object.h M Objects/object.c M Objects/typeobject.c diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 002b70007b639..5c3d3cae235f4 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -8,7 +8,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_pystate.h" /* _PyRuntime.gc */ +#include "pycore_pystate.h" /* PyInterpreterState.gc */ PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type); PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content); @@ -94,6 +94,15 @@ _PyObject_GET_WEAKREFS_LISTPTR(PyObject *op) return (PyObject **)((char *)op + offset); } +// Fast inlined version of PyType_HasFeature() +static inline int +_PyType_HasFeature(PyTypeObject *type, unsigned long feature) { + return ((type->tp_flags & feature) != 0); +} + +// Fast inlined version of PyType_IS_GC() +#define _PyType_IS_GC(t) _PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) + #ifdef __cplusplus } #endif diff --git a/Include/object.h b/Include/object.h index 6b6c66a52a6b0..564ba290328f0 100644 --- a/Include/object.h +++ b/Include/object.h @@ -614,11 +614,7 @@ times. static inline int PyType_HasFeature(PyTypeObject *type, unsigned long feature) { -#ifdef Py_LIMITED_API return ((PyType_GetFlags(type) & feature) != 0); -#else - return ((type->tp_flags & feature) != 0); -#endif } #define PyType_FastSubclass(type, flag) PyType_HasFeature(type, flag) diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst b/Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst new file mode 100644 index 0000000000000..858611df9059a --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst @@ -0,0 +1,4 @@ +:c:func:`PyType_HasFeature` now always calls :c:func:`PyType_GetFlags` to +hide implementation details. Previously, it accessed directly the +:c:member:`PyTypeObject.tp_flags` member when the limited C API was not +used. diff --git a/Objects/object.c b/Objects/object.c index 069afc0ac9933..ef4ba997de427 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -188,11 +188,11 @@ PyObject_CallFinalizer(PyObject *self) if (tp->tp_finalize == NULL) return; /* tp_finalize should only be called once. */ - if (PyType_IS_GC(tp) && _PyGC_FINALIZED(self)) + if (_PyType_IS_GC(tp) && _PyGC_FINALIZED(self)) return; tp->tp_finalize(self); - if (PyType_IS_GC(tp)) { + if (_PyType_IS_GC(tp)) { _PyGC_SET_FINALIZED(self); } } @@ -229,7 +229,7 @@ PyObject_CallFinalizerFromDealloc(PyObject *self) Py_SET_REFCNT(self, refcnt); _PyObject_ASSERT(self, - (!PyType_IS_GC(Py_TYPE(self)) + (!_PyType_IS_GC(Py_TYPE(self)) || _PyObject_GC_IS_TRACKED(self))); /* If Py_REF_DEBUG macro is defined, _Py_NewReference() increased _Py_RefTotal, so we need to undo that. */ @@ -1104,7 +1104,7 @@ _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) descr = _PyType_Lookup(tp, name); if (descr != NULL) { Py_INCREF(descr); - if (PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) { + if (_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR)) { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; @@ -2177,7 +2177,7 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg, to crash than dumping the traceback. */ void *ptr; PyTypeObject *type = Py_TYPE(obj); - if (PyType_IS_GC(type)) { + if (_PyType_IS_GC(type)) { ptr = (void *)((char *)obj - sizeof(PyGC_Head)); } else { diff --git a/Objects/typeobject.c b/Objects/typeobject.c index bdd16af929079..ca26d960643e2 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -269,7 +269,7 @@ PyType_Modified(PyTypeObject *type) PyObject *raw, *ref; Py_ssize_t i; - if (!PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) + if (!_PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) return; raw = type->tp_subclasses; @@ -307,7 +307,7 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) { PyObject *mro_meth = NULL; PyObject *type_mro_meth = NULL; - if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_VERSION_TAG)) + if (!_PyType_HasFeature(type, Py_TPFLAGS_HAVE_VERSION_TAG)) return; if (custom) { @@ -332,7 +332,7 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) { assert(PyType_Check(b)); cls = (PyTypeObject *)b; - if (!PyType_HasFeature(cls, Py_TPFLAGS_HAVE_VERSION_TAG) || + if (!_PyType_HasFeature(cls, Py_TPFLAGS_HAVE_VERSION_TAG) || !PyType_IsSubtype(type, cls)) { goto clear; } @@ -356,11 +356,11 @@ assign_version_tag(PyTypeObject *type) Py_ssize_t i, n; PyObject *bases; - if (PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) + if (_PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) return 1; - if (!PyType_HasFeature(type, Py_TPFLAGS_HAVE_VERSION_TAG)) + if (!_PyType_HasFeature(type, Py_TPFLAGS_HAVE_VERSION_TAG)) return 0; - if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) + if (!_PyType_HasFeature(type, Py_TPFLAGS_READY)) return 0; type->tp_version_tag = next_version_tag++; @@ -1028,23 +1028,29 @@ PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) const size_t size = _PyObject_VAR_SIZE(type, nitems+1); /* note that we need to add one, for the sentinel */ - if (PyType_IS_GC(type)) + if (_PyType_IS_GC(type)) { obj = _PyObject_GC_Malloc(size); - else + } + else { obj = (PyObject *)PyObject_MALLOC(size); + } - if (obj == NULL) + if (obj == NULL) { return PyErr_NoMemory(); + } memset(obj, '\0', size); - if (type->tp_itemsize == 0) + if (type->tp_itemsize == 0) { (void)PyObject_INIT(obj, type); - else + } + else { (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); + } - if (PyType_IS_GC(type)) + if (_PyType_IS_GC(type)) { _PyObject_GC_TRACK(obj); + } return obj; } @@ -1178,7 +1184,7 @@ subtype_dealloc(PyObject *self) /* Test whether the type has GC exactly once */ - if (!PyType_IS_GC(type)) { + if (!_PyType_IS_GC(type)) { /* A non GC dynamic type allows certain simplifications: there's no need to call clear_slots(), or DECREF the dict, or clear weakrefs. */ @@ -1304,8 +1310,9 @@ subtype_dealloc(PyObject *self) /* Call the base tp_dealloc(); first retrack self if * basedealloc knows about gc. */ - if (PyType_IS_GC(base)) + if (_PyType_IS_GC(base)) { _PyObject_GC_TRACK(self); + } assert(basedealloc); basedealloc(self); @@ -1435,7 +1442,7 @@ lookup_maybe_method(PyObject *self, _Py_Identifier *attrid, int *unbound) return NULL; } - if (PyType_HasFeature(Py_TYPE(res), Py_TPFLAGS_METHOD_DESCRIPTOR)) { + if (_PyType_HasFeature(Py_TYPE(res), Py_TPFLAGS_METHOD_DESCRIPTOR)) { /* Avoid temporary PyMethodObject */ *unbound = 1; Py_INCREF(res); @@ -2026,7 +2033,7 @@ best_base(PyObject *bases) if (PyType_Ready(base_i) < 0) return NULL; } - if (!PyType_HasFeature(base_i, Py_TPFLAGS_BASETYPE)) { + if (!_PyType_HasFeature(base_i, Py_TPFLAGS_BASETYPE)) { PyErr_Format(PyExc_TypeError, "type '%.100s' is not an acceptable base type", base_i->tp_name); @@ -2933,7 +2940,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) if (base == NULL) { goto fail; } - if (!PyType_HasFeature(base, Py_TPFLAGS_BASETYPE)) { + if (!_PyType_HasFeature(base, Py_TPFLAGS_BASETYPE)) { PyErr_Format(PyExc_TypeError, "type '%.100s' is not an acceptable base type", base->tp_name); @@ -3051,7 +3058,7 @@ PyType_FromSpec(PyType_Spec *spec) void * PyType_GetSlot(PyTypeObject *type, int slot) { - if (!PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE) || slot < 0) { + if (!_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE) || slot < 0) { PyErr_BadInternalCall(); return NULL; } @@ -3134,7 +3141,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name) unsigned int h; if (MCACHE_CACHEABLE_NAME(name) && - PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) { + _PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) { /* fast path */ h = MCACHE_HASH_METHOD(type, name); if (method_cache[h].version == type->tp_version_tag && @@ -5404,7 +5411,7 @@ PyType_Ready(PyTypeObject *type) } /* Sanity check for tp_free. */ - if (PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) && + if (_PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) && (type->tp_free == NULL || type->tp_free == PyObject_Del)) { /* This base class needs to call tp_free, but doesn't have * one, or its tp_free is for non-gc'ed objects. From webhook-mailer at python.org Tue Apr 7 20:02:04 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Apr 2020 00:02:04 -0000 Subject: [Python-checkins] bpo-40170: Add _PyIndex_Check() internal function (GH-19426) Message-ID: https://github.com/python/cpython/commit/a15e260b708a98edaba86a2aa663c3f6b2abc964 commit: a15e260b708a98edaba86a2aa663c3f6b2abc964 branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T02:01:56+02:00 summary: bpo-40170: Add _PyIndex_Check() internal function (GH-19426) Add _PyIndex_Check() function to the internal C API: fast inlined verson of PyIndex_Check(). Add Include/internal/pycore_abstract.h header file. Replace PyIndex_Check() with _PyIndex_Check() in C files of Objects and Python subdirectories. files: A Include/internal/pycore_abstract.h M Makefile.pre.in M Objects/abstract.c M Objects/bytearrayobject.c M Objects/bytes_methods.c M Objects/bytesobject.c M Objects/interpreteridobject.c M Objects/listobject.c M Objects/memoryobject.c M Objects/rangeobject.c M Objects/sliceobject.c M Objects/tupleobject.c M Objects/unicodeobject.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/ceval.c M Python/modsupport.c diff --git a/Include/internal/pycore_abstract.h b/Include/internal/pycore_abstract.h new file mode 100644 index 0000000000000..b791bf2432199 --- /dev/null +++ b/Include/internal/pycore_abstract.h @@ -0,0 +1,22 @@ +#ifndef Py_INTERNAL_ABSTRACT_H +#define Py_INTERNAL_ABSTRACT_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +// Fast inlined version of PyIndex_Check() +static inline int +_PyIndex_Check(PyObject *obj) +{ + PyNumberMethods *tp_as_number = Py_TYPE(obj)->tp_as_number; + return (tp_as_number != NULL && tp_as_number->nb_index != NULL); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ABSTRACT_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 948f9851d0c4a..ac6c2b1288965 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1080,6 +1080,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/cpython/tupleobject.h \ $(srcdir)/Include/cpython/unicodeobject.h \ \ + $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ $(srcdir)/Include/internal/pycore_atomic.h \ $(srcdir)/Include/internal/pycore_bytes_methods.h \ diff --git a/Objects/abstract.c b/Objects/abstract.c index 49a38d8f6e290..b5d91dbab0c1d 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1,7 +1,8 @@ /* Abstract Object Interface (many thanks to Jim Fulton) */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_pyerrors.h" #include "pycore_pystate.h" #include @@ -160,7 +161,7 @@ PyObject_GetItem(PyObject *o, PyObject *key) ms = Py_TYPE(o)->tp_as_sequence; if (ms && ms->sq_item) { - if (PyIndex_Check(key)) { + if (_PyIndex_Check(key)) { Py_ssize_t key_value; key_value = PyNumber_AsSsize_t(key, PyExc_IndexError); if (key_value == -1 && PyErr_Occurred()) @@ -176,7 +177,7 @@ PyObject_GetItem(PyObject *o, PyObject *key) if (PyType_Check(o)) { PyObject *meth, *result; _Py_IDENTIFIER(__class_getitem__); - + // Special case type[int], but disallow other types so str[int] fails if ((PyTypeObject*)o == &PyType_Type) { return Py_GenericAlias(o, key); @@ -209,7 +210,7 @@ PyObject_SetItem(PyObject *o, PyObject *key, PyObject *value) return m->mp_ass_subscript(o, key, value); if (Py_TYPE(o)->tp_as_sequence) { - if (PyIndex_Check(key)) { + if (_PyIndex_Check(key)) { Py_ssize_t key_value; key_value = PyNumber_AsSsize_t(key, PyExc_IndexError); if (key_value == -1 && PyErr_Occurred()) @@ -241,7 +242,7 @@ PyObject_DelItem(PyObject *o, PyObject *key) return m->mp_ass_subscript(o, key, (PyObject*)NULL); if (Py_TYPE(o)->tp_as_sequence) { - if (PyIndex_Check(key)) { + if (_PyIndex_Check(key)) { Py_ssize_t key_value; key_value = PyNumber_AsSsize_t(key, PyExc_IndexError); if (key_value == -1 && PyErr_Occurred()) @@ -1030,7 +1031,7 @@ static PyObject * sequence_repeat(ssizeargfunc repeatfunc, PyObject *seq, PyObject *n) { Py_ssize_t count; - if (PyIndex_Check(n)) { + if (_PyIndex_Check(n)) { count = PyNumber_AsSsize_t(n, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) return NULL; @@ -1307,15 +1308,16 @@ PyNumber_Absolute(PyObject *o) return type_error("bad operand type for abs(): '%.200s'", o); } + #undef PyIndex_Check int PyIndex_Check(PyObject *obj) { - return Py_TYPE(obj)->tp_as_number != NULL && - Py_TYPE(obj)->tp_as_number->nb_index != NULL; + return _PyIndex_Check(obj); } + /* Return a Python int from the object item. Raise TypeError if the result is not an int or if the object cannot be interpreted as an index. @@ -1332,7 +1334,7 @@ PyNumber_Index(PyObject *item) Py_INCREF(item); return item; } - if (!PyIndex_Check(item)) { + if (!_PyIndex_Check(item)) { PyErr_Format(PyExc_TypeError, "'%.200s' object cannot be interpreted " "as an integer", Py_TYPE(item)->tp_name); diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index d3964358bc59d..7ebfa1f9434cc 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -2,6 +2,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_object.h" #include "pycore_pymem.h" @@ -391,7 +392,7 @@ bytearray_getitem(PyByteArrayObject *self, Py_ssize_t i) static PyObject * bytearray_subscript(PyByteArrayObject *self, PyObject *index) { - if (PyIndex_Check(index)) { + if (_PyIndex_Check(index)) { Py_ssize_t i = PyNumber_AsSsize_t(index, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) @@ -610,7 +611,7 @@ bytearray_ass_subscript(PyByteArrayObject *self, PyObject *index, PyObject *valu char *buf, *bytes; buf = PyByteArray_AS_STRING(self); - if (PyIndex_Check(index)) { + if (_PyIndex_Check(index)) { Py_ssize_t i = PyNumber_AsSsize_t(index, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) @@ -809,7 +810,7 @@ bytearray_init(PyByteArrayObject *self, PyObject *args, PyObject *kwds) } /* Is it an int? */ - if (PyIndex_Check(arg)) { + if (_PyIndex_Check(arg)) { count = PyNumber_AsSsize_t(arg, PyExc_OverflowError); if (count == -1 && PyErr_Occurred()) { if (!PyErr_ExceptionMatches(PyExc_TypeError)) diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index a4b3868e72522..72daa1fdd554e 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -1,5 +1,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" PyDoc_STRVAR_shared(_Py_isspace__doc__, @@ -466,7 +467,7 @@ parse_args_finds_byte(const char *function_name, PyObject *args, return 1; } - if (!PyIndex_Check(tmp_subobj)) { + if (!_PyIndex_Check(tmp_subobj)) { PyErr_Format(PyExc_TypeError, "argument should be integer or bytes-like object, " "not '%.200s'", diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index bd8af72ade5d3..03cd7ddd27901 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3,6 +3,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_object.h" #include "pycore_pymem.h" @@ -1579,7 +1580,7 @@ bytes_hash(PyBytesObject *a) static PyObject* bytes_subscript(PyBytesObject* self, PyObject* item) { - if (PyIndex_Check(item)) { + if (_PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; @@ -2536,7 +2537,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } /* Is it an integer? */ - if (PyIndex_Check(x)) { + if (_PyIndex_Check(x)) { size = PyNumber_AsSsize_t(x, PyExc_OverflowError); if (size == -1 && PyErr_Occurred()) { if (!PyErr_ExceptionMatches(PyExc_TypeError)) diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c index 57748e8139fb8..3f316873ed516 100644 --- a/Objects/interpreteridobject.c +++ b/Objects/interpreteridobject.c @@ -1,7 +1,8 @@ /* InterpreterID object */ #include "Python.h" -#include "internal/pycore_pystate.h" +#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_pystate.h" #include "interpreteridobject.h" @@ -42,7 +43,7 @@ interp_id_converter(PyObject *arg, void *ptr) if (PyObject_TypeCheck(arg, &_PyInterpreterID_Type)) { id = ((interpid *)arg)->id; } - else if (PyIndex_Check(arg)) { + else if (_PyIndex_Check(arg)) { id = PyLong_AsLongLong(arg); if (id == -1 && PyErr_Occurred()) { return 0; diff --git a/Objects/listobject.c b/Objects/listobject.c index 48063b285f60c..7058fe4396eec 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1,6 +1,7 @@ /* List object implementation */ #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pystate.h" #include "pycore_tupleobject.h" @@ -2800,7 +2801,7 @@ static PySequenceMethods list_as_sequence = { static PyObject * list_subscript(PyListObject* self, PyObject* item) { - if (PyIndex_Check(item)) { + if (_PyIndex_Check(item)) { Py_ssize_t i; i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) @@ -2855,7 +2856,7 @@ list_subscript(PyListObject* self, PyObject* item) static int list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value) { - if (PyIndex_Check(item)) { + if (_PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return -1; diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 7f9c90035f574..da06338017cae 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -11,6 +11,7 @@ */ #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" @@ -2421,8 +2422,9 @@ is_multiindex(PyObject *key) size = PyTuple_GET_SIZE(key); for (i = 0; i < size; i++) { PyObject *x = PyTuple_GET_ITEM(key, i); - if (!PyIndex_Check(x)) + if (!_PyIndex_Check(x)) { return 0; + } } return 1; } @@ -2459,7 +2461,7 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key) } } - if (PyIndex_Check(key)) { + if (_PyIndex_Check(key)) { Py_ssize_t index; index = PyNumber_AsSsize_t(key, PyExc_IndexError); if (index == -1 && PyErr_Occurred()) @@ -2530,7 +2532,7 @@ memory_ass_sub(PyMemoryViewObject *self, PyObject *key, PyObject *value) } } - if (PyIndex_Check(key)) { + if (_PyIndex_Check(key)) { Py_ssize_t index; if (1 < view->ndim) { PyErr_SetString(PyExc_NotImplementedError, diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 5bd178b20279e..4bea8d78e12fa 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1,8 +1,9 @@ /* Range object implementation */ #include "Python.h" -#include "structmember.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_tupleobject.h" +#include "structmember.h" /* Support objects whose length is > PY_SSIZE_T_MAX. @@ -631,7 +632,7 @@ range_reduce(rangeobject *r, PyObject *args) static PyObject * range_subscript(rangeobject* self, PyObject* item) { - if (PyIndex_Check(item)) { + if (_PyIndex_Check(item)) { PyObject *i, *result; i = PyNumber_Index(item); if (!i) diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index e884a58943562..4fd216388fdfd 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -14,6 +14,7 @@ this type and there is exactly one in existence. */ #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" #include "pycore_pystate.h" @@ -354,7 +355,7 @@ static PyMemberDef slice_members[] = { static PyObject* evaluate_slice_index(PyObject *v) { - if (PyIndex_Check(v)) { + if (_PyIndex_Check(v)) { return PyNumber_Index(v); } else { diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 68163d8c48c71..110c0925ccd94 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -2,6 +2,7 @@ /* Tuple object implementation */ #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pystate.h" #include "pycore_accu.h" @@ -763,7 +764,7 @@ static PySequenceMethods tuple_as_sequence = { static PyObject* tuplesubscript(PyTupleObject* self, PyObject* item) { - if (PyIndex_Check(item)) { + if (_PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index da17bfe01f310..1e1f257dad0ff 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -40,6 +40,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_fileutils.h" #include "pycore_initconfig.h" @@ -14132,7 +14133,7 @@ unicode_subscript(PyObject* self, PyObject* item) if (PyUnicode_READY(self) == -1) return NULL; - if (PyIndex_Check(item)) { + if (_PyIndex_Check(item)) { Py_ssize_t i = PyNumber_AsSsize_t(item, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) return NULL; diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 22f1b95d0a75a..95f9e9b445fa9 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -161,6 +161,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 00891001ce0b7..32da3659d341f 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -186,6 +186,9 @@ Include + + Include + Include diff --git a/Python/ceval.c b/Python/ceval.c index d79a239704f0a..7747b084f0833 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -10,6 +10,7 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_code.h" @@ -5089,7 +5090,7 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi) PyThreadState *tstate = _PyThreadState_GET(); if (v != Py_None) { Py_ssize_t x; - if (PyIndex_Check(v)) { + if (_PyIndex_Check(v)) { x = PyNumber_AsSsize_t(v, NULL); if (x == -1 && _PyErr_Occurred(tstate)) return 0; @@ -5110,7 +5111,7 @@ _PyEval_SliceIndexNotNone(PyObject *v, Py_ssize_t *pi) { PyThreadState *tstate = _PyThreadState_GET(); Py_ssize_t x; - if (PyIndex_Check(v)) { + if (_PyIndex_Check(v)) { x = PyNumber_AsSsize_t(v, NULL); if (x == -1 && _PyErr_Occurred(tstate)) return 0; diff --git a/Python/modsupport.c b/Python/modsupport.c index a8e78c3cec88b..845bdcb2b6f1b 100644 --- a/Python/modsupport.c +++ b/Python/modsupport.c @@ -2,6 +2,7 @@ /* Module support implementation */ #include "Python.h" +#include "pycore_abstract.h" // _PyIndex_Check() #define FLAG_SIZE_T 1 typedef double va_double; @@ -20,7 +21,7 @@ _Py_convert_optional_to_ssize_t(PyObject *obj, void *result) if (obj == Py_None) { return 1; } - else if (PyIndex_Check(obj)) { + else if (_PyIndex_Check(obj)) { limit = PyNumber_AsSsize_t(obj, PyExc_OverflowError); if (limit == -1 && PyErr_Occurred()) { return 0; From webhook-mailer at python.org Tue Apr 7 20:26:49 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Apr 2020 00:26:49 -0000 Subject: [Python-checkins] bpo-40170: Remove PyIndex_Check() macro (GH-19428) Message-ID: https://github.com/python/cpython/commit/307b9d0144e719b016a47fcc43397c070615e01e commit: 307b9d0144e719b016a47fcc43397c070615e01e branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T02:26:41+02:00 summary: bpo-40170: Remove PyIndex_Check() macro (GH-19428) Always declare PyIndex_Check() as an opaque function to hide implementation details: remove PyIndex_Check() macro. The macro accessed directly the PyTypeObject.tp_as_number member. files: A Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst M Include/cpython/abstract.h M Objects/abstract.c diff --git a/Include/cpython/abstract.h b/Include/cpython/abstract.h index 3f834ff727e1d..7bc80833a746e 100644 --- a/Include/cpython/abstract.h +++ b/Include/cpython/abstract.h @@ -335,12 +335,6 @@ PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view); (Py_TYPE(obj)->tp_iternext != NULL && \ Py_TYPE(obj)->tp_iternext != &_PyObject_NextNotImplemented) -/* === Number Protocol ================================================== */ - -#define PyIndex_Check(obj) \ - (Py_TYPE(obj)->tp_as_number != NULL && \ - Py_TYPE(obj)->tp_as_number->nb_index != NULL) - /* === Sequence protocol ================================================ */ /* Assume tp_as_sequence and sq_item exist and that 'i' does not diff --git a/Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst b/Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst new file mode 100644 index 0000000000000..22bdc74904f41 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst @@ -0,0 +1,3 @@ +Always declare :c:func:`PyIndex_Check` as an opaque function to hide +implementation details: remove ``PyIndex_Check()`` macro. The macro accessed +directly the :c:member:`PyTypeObject.tp_as_number` member. diff --git a/Objects/abstract.c b/Objects/abstract.c index b5d91dbab0c1d..7e1e51b4c87c2 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1309,8 +1309,6 @@ PyNumber_Absolute(PyObject *o) } -#undef PyIndex_Check - int PyIndex_Check(PyObject *obj) { From webhook-mailer at python.org Wed Apr 8 03:59:21 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 08 Apr 2020 07:59:21 -0000 Subject: [Python-checkins] bpo-40185: Refactor typing.NamedTuple (GH-19371) Message-ID: https://github.com/python/cpython/commit/a2ec06938f46683e33692615aca3875d8b8e110c commit: a2ec06938f46683e33692615aca3875d8b8e110c branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-08T10:59:04+03:00 summary: bpo-40185: Refactor typing.NamedTuple (GH-19371) files: 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 95f865f8c3474..489836c459b1c 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3598,11 +3598,9 @@ def test_annotation_usage_with_default(self): self.assertEqual(CoolEmployeeWithDefault._field_defaults, dict(cool=0)) with self.assertRaises(TypeError): - exec(""" -class NonDefaultAfterDefault(NamedTuple): - x: int = 3 - y: int -""") + class NonDefaultAfterDefault(NamedTuple): + x: int = 3 + y: int def test_annotation_usage_with_methods(self): self.assertEqual(XMeth(1).double(), 2) @@ -3611,20 +3609,16 @@ def test_annotation_usage_with_methods(self): self.assertEqual(XRepr(1, 2) + XRepr(3), 0) with self.assertRaises(AttributeError): - exec(""" -class XMethBad(NamedTuple): - x: int - def _fields(self): - return 'no chance for this' -""") + class XMethBad(NamedTuple): + x: int + def _fields(self): + return 'no chance for this' with self.assertRaises(AttributeError): - exec(""" -class XMethBad2(NamedTuple): - x: int - def _source(self): - return 'no chance for this as well' -""") + class XMethBad2(NamedTuple): + x: int + def _source(self): + return 'no chance for this as well' def test_multiple_inheritance(self): class A: diff --git a/Lib/typing.py b/Lib/typing.py index 6cc3b0342ec77..bcb2233ee50cf 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1702,51 +1702,41 @@ def __round__(self, ndigits: int = 0) -> T_co: pass -def _make_nmtuple(name, types): - msg = "NamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a type" - types = [(n, _type_check(t, msg)) for n, t in types] - nm_tpl = collections.namedtuple(name, [n for n, t in types]) - nm_tpl.__annotations__ = dict(types) - try: - nm_tpl.__module__ = sys._getframe(2).f_globals.get('__name__', '__main__') - except (AttributeError, ValueError): - pass +def _make_nmtuple(name, types, module, defaults = ()): + fields = [n for n, t in types] + types = {n: _type_check(t, f"field {n} annotation must be a type") + for n, t in types} + nm_tpl = collections.namedtuple(name, fields, + defaults=defaults, module=module) + nm_tpl.__annotations__ = nm_tpl.__new__.__annotations__ = types return nm_tpl # attributes prohibited to set in NamedTuple class syntax -_prohibited = {'__new__', '__init__', '__slots__', '__getnewargs__', - '_fields', '_field_defaults', - '_make', '_replace', '_asdict', '_source'} +_prohibited = frozenset({'__new__', '__init__', '__slots__', '__getnewargs__', + '_fields', '_field_defaults', + '_make', '_replace', '_asdict', '_source'}) -_special = {'__module__', '__name__', '__annotations__'} +_special = frozenset({'__module__', '__name__', '__annotations__'}) class NamedTupleMeta(type): def __new__(cls, typename, bases, ns): - if ns.get('_root', False): - return super().__new__(cls, typename, bases, ns) - if len(bases) > 1: - raise TypeError("Multiple inheritance with NamedTuple is not supported") - assert bases[0] is NamedTuple + assert bases[0] is _NamedTuple types = ns.get('__annotations__', {}) - nm_tpl = _make_nmtuple(typename, types.items()) - defaults = [] - defaults_dict = {} + default_names = [] for field_name in types: if field_name in ns: - default_value = ns[field_name] - defaults.append(default_value) - defaults_dict[field_name] = default_value - elif defaults: - raise TypeError("Non-default namedtuple field {field_name} cannot " - "follow default field(s) {default_names}" - .format(field_name=field_name, - default_names=', '.join(defaults_dict.keys()))) - nm_tpl.__new__.__annotations__ = dict(types) - nm_tpl.__new__.__defaults__ = tuple(defaults) - nm_tpl._field_defaults = defaults_dict + default_names.append(field_name) + elif default_names: + raise TypeError(f"Non-default namedtuple field {field_name} " + f"cannot follow default field" + f"{'s' if len(default_names) > 1 else ''} " + f"{', '.join(default_names)}") + nm_tpl = _make_nmtuple(typename, types.items(), + defaults=[ns[n] for n in default_names], + module=ns['__module__']) # update from user namespace without overriding special namedtuple attributes for key in ns: if key in _prohibited: @@ -1756,7 +1746,7 @@ def __new__(cls, typename, bases, ns): return nm_tpl -class NamedTuple(metaclass=NamedTupleMeta): +def NamedTuple(typename, fields=None, /, **kwargs): """Typed version of namedtuple. Usage in Python versions >= 3.6:: @@ -1780,15 +1770,26 @@ class Employee(NamedTuple): Employee = NamedTuple('Employee', [('name', str), ('id', int)]) """ - _root = True - - def __new__(cls, typename, fields=None, /, **kwargs): - if fields is None: - fields = kwargs.items() - elif kwargs: - raise TypeError("Either list of fields or keywords" - " can be provided to NamedTuple, not both") - return _make_nmtuple(typename, fields) + if fields is None: + fields = kwargs.items() + elif kwargs: + raise TypeError("Either list of fields or keywords" + " can be provided to NamedTuple, not both") + try: + module = sys._getframe(1).f_globals.get('__name__', '__main__') + except (AttributeError, ValueError): + module = None + return _make_nmtuple(typename, fields, module=module) + +_NamedTuple = type.__new__(NamedTupleMeta, 'NamedTuple', (), {}) + +def _namedtuple_mro_entries(bases): + if len(bases) > 1: + raise TypeError("Multiple inheritance with NamedTuple is not supported") + assert bases[0] is NamedTuple + return (_NamedTuple,) + +NamedTuple.__mro_entries__ = _namedtuple_mro_entries def _dict_new(cls, /, *args, **kwargs): From webhook-mailer at python.org Wed Apr 8 04:03:32 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 08 Apr 2020 08:03:32 -0000 Subject: [Python-checkins] bpo-40187: Refactor typing.TypedDict. (GH-19372) Message-ID: https://github.com/python/cpython/commit/f228bf2300a9d3bf833b1a89336581822e864ae5 commit: f228bf2300a9d3bf833b1a89336581822e864ae5 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-08T11:03:27+03:00 summary: bpo-40187: Refactor typing.TypedDict. (GH-19372) files: M Lib/typing.py diff --git a/Lib/typing.py b/Lib/typing.py index bcb2233ee50cf..9cacaa840ca35 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1792,44 +1792,20 @@ def _namedtuple_mro_entries(bases): NamedTuple.__mro_entries__ = _namedtuple_mro_entries -def _dict_new(cls, /, *args, **kwargs): - return dict(*args, **kwargs) - - -def _typeddict_new(cls, typename, fields=None, /, *, total=True, **kwargs): - if fields is None: - fields = kwargs - elif kwargs: - raise TypeError("TypedDict takes either a dict or keyword arguments," - " but not both") - - ns = {'__annotations__': dict(fields), '__total__': total} - try: - # Setting correct module is necessary to make typed dict classes pickleable. - ns['__module__'] = sys._getframe(1).f_globals.get('__name__', '__main__') - except (AttributeError, ValueError): - pass - - return _TypedDictMeta(typename, (), ns) - - -def _check_fails(cls, other): - # Typed dicts are only for static structural subtyping. - raise TypeError('TypedDict does not support instance and class checks') - - class _TypedDictMeta(type): def __new__(cls, name, bases, ns, total=True): """Create new typed dict class object. - This method is called directly when TypedDict is subclassed, - or via _typeddict_new when TypedDict is instantiated. This way + This method is called when TypedDict is subclassed, + or when TypedDict is instantiated. This way TypedDict supports all three syntax forms described in its docstring. - Subclasses and instances of TypedDict return actual dictionaries - via _dict_new. + Subclasses and instances of TypedDict return actual dictionaries. """ - ns['__new__'] = _typeddict_new if name == 'TypedDict' else _dict_new - tp_dict = super(_TypedDictMeta, cls).__new__(cls, name, (dict,), ns) + for base in bases: + if type(base) is not _TypedDictMeta: + raise TypeError('cannot inherit from both a TypedDict type ' + 'and a non-TypedDict base class') + tp_dict = type.__new__(_TypedDictMeta, name, (dict,), ns) annotations = {} own_annotations = ns.get('__annotations__', {}) @@ -1859,10 +1835,16 @@ def __new__(cls, name, bases, ns, total=True): tp_dict.__total__ = total return tp_dict - __instancecheck__ = __subclasscheck__ = _check_fails + __call__ = dict # static method + + def __subclasscheck__(cls, other): + # Typed dicts are only for static structural subtyping. + raise TypeError('TypedDict does not support instance and class checks') + __instancecheck__ = __subclasscheck__ -class TypedDict(dict, metaclass=_TypedDictMeta): + +def TypedDict(typename, fields=None, /, *, total=True, **kwargs): """A simple typed namespace. At runtime it is equivalent to a plain dict. TypedDict creates a dictionary type that expects all of its @@ -1904,6 +1886,23 @@ class body be required. The class syntax is only supported in Python 3.6+, while two other syntax forms work for Python 2.7 and 3.2+ """ + if fields is None: + fields = kwargs + elif kwargs: + raise TypeError("TypedDict takes either a dict or keyword arguments," + " but not both") + + ns = {'__annotations__': dict(fields), '__total__': total} + try: + # Setting correct module is necessary to make typed dict classes pickleable. + ns['__module__'] = sys._getframe(1).f_globals.get('__name__', '__main__') + except (AttributeError, ValueError): + pass + + return _TypedDictMeta(typename, (), ns) + +_TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {}) +TypedDict.__mro_entries__ = lambda bases: (_TypedDict,) def NewType(name, tp): From webhook-mailer at python.org Wed Apr 8 05:29:09 2020 From: webhook-mailer at python.org (Jimmy Yang) Date: Wed, 08 Apr 2020 09:29:09 -0000 Subject: [Python-checkins] Remove extraneous ')' in abstract.h (GH-19146) Message-ID: https://github.com/python/cpython/commit/ac2cfe6631b77a2005d8f16f034dbb6154f04ab2 commit: ac2cfe6631b77a2005d8f16f034dbb6154f04ab2 branch: master author: Jimmy Yang committer: GitHub date: 2020-04-08T05:28:59-04:00 summary: Remove extraneous ')' in abstract.h (GH-19146) files: M Include/object.h diff --git a/Include/object.h b/Include/object.h index 564ba290328f0..6c30809124dea 100644 --- a/Include/object.h +++ b/Include/object.h @@ -27,7 +27,7 @@ of data it contains. An object's type is fixed when it is created. Types themselves are represented as objects; an object contains a pointer to the corresponding type object. The type itself has a type pointer pointing to the object representing the type 'type', which -contains a pointer to itself!). +contains a pointer to itself!. Objects do not float around in memory; once allocated an object keeps the same size and address. Objects that must hold variable-size data From webhook-mailer at python.org Wed Apr 8 06:01:27 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 08 Apr 2020 10:01:27 -0000 Subject: [Python-checkins] Remove extraneous ')' in abstract.h (GH-19146) Message-ID: https://github.com/python/cpython/commit/f462c097fa2f603532b67281808ca864f4946ae0 commit: f462c097fa2f603532b67281808ca864f4946ae0 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-08T06:01:11-04:00 summary: Remove extraneous ')' in abstract.h (GH-19146) (cherry picked from commit ac2cfe6631b77a2005d8f16f034dbb6154f04ab2) Co-authored-by: Jimmy Yang files: M Include/object.h diff --git a/Include/object.h b/Include/object.h index bcf78afe6bbb1..e212fca12ab41 100644 --- a/Include/object.h +++ b/Include/object.h @@ -26,7 +26,7 @@ of data it contains. An object's type is fixed when it is created. Types themselves are represented as objects; an object contains a pointer to the corresponding type object. The type itself has a type pointer pointing to the object representing the type 'type', which -contains a pointer to itself!). +contains a pointer to itself!. Objects do not float around in memory; once allocated an object keeps the same size and address. Objects that must hold variable-size data From webhook-mailer at python.org Wed Apr 8 11:55:11 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Apr 2020 15:55:11 -0000 Subject: [Python-checkins] bpo-40226: PyInterpreterState_Delete() deletes pending calls (GH-19436) Message-ID: https://github.com/python/cpython/commit/dda5d6e071c6a9d65993d45b90232565cfad2cde commit: dda5d6e071c6a9d65993d45b90232565cfad2cde branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T17:54:59+02:00 summary: bpo-40226: PyInterpreterState_Delete() deletes pending calls (GH-19436) PyInterpreterState_New() is now responsible to create pending calls, PyInterpreterState_Delete() now deletes pending calls. * Rename _PyEval_InitThreads() to _PyEval_InitGIL() and rename _PyEval_InitGIL() to _PyEval_FiniGIL(). * _PyEval_InitState() and PyEval_FiniState() now create and delete pending calls. _PyEval_InitState() now returns -1 on memory allocation failure. * Add init_interp_create_gil() helper function: code shared by Py_NewInterpreter() and Py_InitializeFromConfig(). * init_interp_create_gil() now also calls _PyEval_FiniGIL(), _PyEval_InitGIL() and _PyGILState_Init() in subinterpreters, but these functions now do nothing when called from a subinterpreter. files: M Include/internal/pycore_ceval.h M Python/ceval.c M Python/pylifecycle.c M Python/pystate.c diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index ccfb9abed7244..1f96fc6b18350 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -17,8 +17,8 @@ struct _frame; extern void _Py_FinishPendingCalls(PyThreadState *tstate); extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *); -extern void _PyEval_InitState(struct _ceval_state *); -extern void _PyEval_FiniThreads(PyThreadState *tstate); +extern int _PyEval_InitState(struct _ceval_state *ceval); +extern void _PyEval_FiniState(struct _ceval_state *ceval); PyAPI_FUNC(void) _PyEval_SignalReceived(PyThreadState *tstate); PyAPI_FUNC(int) _PyEval_AddPendingCall( PyThreadState *tstate, @@ -51,7 +51,8 @@ extern PyObject *_PyEval_EvalCode( PyObject *name, PyObject *qualname); extern int _PyEval_ThreadsInitialized(_PyRuntimeState *runtime); -extern PyStatus _PyEval_InitThreads(PyThreadState *tstate); +extern PyStatus _PyEval_InitGIL(PyThreadState *tstate); +extern void _PyEval_FiniGIL(PyThreadState *tstate); extern void _PyEval_ReleaseLock(PyThreadState *tstate); diff --git a/Python/ceval.c b/Python/ceval.c index 7747b084f0833..2e94f32f6c00b 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -275,54 +275,52 @@ PyEval_ThreadsInitialized(void) } PyStatus -_PyEval_InitThreads(PyThreadState *tstate) +_PyEval_InitGIL(PyThreadState *tstate) { - assert(is_tstate_valid(tstate)); + if (!_Py_IsMainInterpreter(tstate)) { + /* Currently, the GIL is shared by all interpreters, + and only the main interpreter is responsible to create + and destroy it. */ + return _PyStatus_OK(); + } - if (_Py_IsMainInterpreter(tstate)) { - struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; - if (gil_created(gil)) { - return _PyStatus_OK(); - } + struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; + assert(!gil_created(gil)); - PyThread_init_thread(); - create_gil(gil); + PyThread_init_thread(); + create_gil(gil); - take_gil(tstate); - } - - struct _pending_calls *pending = &tstate->interp->ceval.pending; - assert(pending->lock == NULL); - pending->lock = PyThread_allocate_lock(); - if (pending->lock == NULL) { - return _PyStatus_NO_MEMORY(); - } + take_gil(tstate); + assert(gil_created(gil)); return _PyStatus_OK(); } void -PyEval_InitThreads(void) +_PyEval_FiniGIL(PyThreadState *tstate) { - /* Do nothing: kept for backward compatibility */ -} + if (!_Py_IsMainInterpreter(tstate)) { + /* Currently, the GIL is shared by all interpreters, + and only the main interpreter is responsible to create + and destroy it. */ + return; + } -void -_PyEval_FiniThreads(PyThreadState *tstate) -{ struct _gil_runtime_state *gil = &tstate->interp->runtime->ceval.gil; if (!gil_created(gil)) { + /* First Py_InitializeFromConfig() call: the GIL doesn't exist + yet: do nothing. */ return; } destroy_gil(gil); assert(!gil_created(gil)); +} - struct _pending_calls *pending = &tstate->interp->ceval.pending; - if (pending->lock != NULL) { - PyThread_free_lock(pending->lock); - pending->lock = NULL; - } +void +PyEval_InitThreads(void) +{ + /* Do nothing: kept for backward compatibility */ } void @@ -544,6 +542,10 @@ _PyEval_AddPendingCall(PyThreadState *tstate, { struct _pending_calls *pending = &tstate->interp->ceval.pending; + /* Ensure that _PyEval_InitPendingCalls() was called + and that _PyEval_FiniPendingCalls() is not called yet. */ + assert(pending->lock != NULL); + PyThread_acquire_lock(pending->lock, WAIT_LOCK); if (pending->finishing) { PyThread_release_lock(pending->lock); @@ -721,10 +723,27 @@ _PyEval_InitRuntimeState(struct _ceval_runtime_state *ceval) _gil_initialize(&ceval->gil); } -void +int _PyEval_InitState(struct _ceval_state *ceval) { - /* PyInterpreterState_New() initializes ceval to zero */ + struct _pending_calls *pending = &ceval->pending; + assert(pending->lock == NULL); + + pending->lock = PyThread_allocate_lock(); + if (pending->lock == NULL) { + return -1; + } + return 0; +} + +void +_PyEval_FiniState(struct _ceval_state *ceval) +{ + struct _pending_calls *pending = &ceval->pending; + if (pending->lock != NULL) { + PyThread_free_lock(pending->lock); + pending->lock = NULL; + } } int diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 2d5cb0ff78f57..9b413c631875a 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -523,6 +523,31 @@ pycore_init_runtime(_PyRuntimeState *runtime, } +static PyStatus +init_interp_create_gil(PyThreadState *tstate) +{ + PyStatus status; + + /* finalize_interp_delete() comment explains why _PyEval_FiniGIL() is + only called here. */ + _PyEval_FiniGIL(tstate); + + /* Auto-thread-state API */ + status = _PyGILState_Init(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + /* Create the GIL and take it */ + status = _PyEval_InitGIL(tstate); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + return _PyStatus_OK(); +} + + static PyStatus pycore_create_interpreter(_PyRuntimeState *runtime, const PyConfig *config, @@ -544,21 +569,7 @@ pycore_create_interpreter(_PyRuntimeState *runtime, } (void) PyThreadState_Swap(tstate); - /* We can't call _PyEval_FiniThreads() in Py_FinalizeEx because - destroying the GIL might fail when it is being referenced from - another running thread (see issue #9901). - Instead we destroy the previously created GIL here, which ensures - that we can call Py_Initialize / Py_FinalizeEx multiple times. */ - _PyEval_FiniThreads(tstate); - - /* Auto-thread-state API */ - status = _PyGILState_Init(tstate); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - /* Create the GIL and the pending calls lock */ - status = _PyEval_InitThreads(tstate); + status = init_interp_create_gil(tstate); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -1323,6 +1334,12 @@ finalize_interp_delete(PyThreadState *tstate) _PyGILState_Fini(tstate); } + /* We can't call _PyEval_FiniGIL() here because destroying the GIL lock can + fail when it is being awaited by another running daemon thread (see + bpo-9901). Instead pycore_create_interpreter() destroys the previously + created GIL, which ensures that Py_Initialize / Py_FinalizeEx can be + called multiple times. */ + PyInterpreterState_Delete(tstate->interp); } @@ -1578,8 +1595,7 @@ new_interpreter(PyThreadState **tstate_p) goto error; } - /* Create the pending calls lock */ - status = _PyEval_InitThreads(tstate); + status = init_interp_create_gil(tstate); if (_PyStatus_EXCEPTION(status)) { return status; } diff --git a/Python/pystate.c b/Python/pystate.c index 2b84c168bf752..0539096bdc55d 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -222,7 +222,10 @@ PyInterpreterState_New(void) _PyRuntimeState *runtime = &_PyRuntime; interp->runtime = runtime; - _PyEval_InitState(&interp->ceval); + if (_PyEval_InitState(&interp->ceval) < 0) { + goto out_of_memory; + } + _PyGC_InitState(&interp->gc); PyConfig_InitPythonConfig(&interp->config); @@ -267,6 +270,14 @@ PyInterpreterState_New(void) interp->audit_hooks = NULL; return interp; + +out_of_memory: + if (tstate != NULL) { + _PyErr_NoMemory(tstate); + } + + PyMem_RawFree(interp); + return NULL; } @@ -335,6 +346,8 @@ PyInterpreterState_Delete(PyInterpreterState *interp) struct pyinterpreters *interpreters = &runtime->interpreters; zapthreads(interp, 0); + _PyEval_FiniState(&interp->ceval); + /* Delete current thread. After this, many C API calls become crashy. */ _PyThreadState_Swap(&runtime->gilstate, NULL); @@ -352,6 +365,7 @@ PyInterpreterState_Delete(PyInterpreterState *interp) Py_FatalError("remaining threads"); } *p = interp->next; + if (interpreters->main == interp) { interpreters->main = NULL; if (interpreters->head != NULL) { @@ -359,6 +373,7 @@ PyInterpreterState_Delete(PyInterpreterState *interp) } } HEAD_UNLOCK(runtime); + if (interp->id_mutex != NULL) { PyThread_free_lock(interp->id_mutex); } @@ -1198,6 +1213,12 @@ PyThreadState_IsCurrent(PyThreadState *tstate) PyStatus _PyGILState_Init(PyThreadState *tstate) { + if (!_Py_IsMainInterpreter(tstate)) { + /* Currently, PyGILState is shared by all interpreters. The main + * interpreter is responsible to initialize it. */ + return _PyStatus_OK(); + } + /* must init with valid states */ assert(tstate != NULL); assert(tstate->interp != NULL); From webhook-mailer at python.org Wed Apr 8 16:11:00 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Apr 2020 20:11:00 -0000 Subject: [Python-checkins] bpo-37127: Remove _pending_calls.finishing (GH-19439) Message-ID: https://github.com/python/cpython/commit/cfc3c2f8b34d3864717ab584c5b6c260014ba55a commit: cfc3c2f8b34d3864717ab584c5b6c260014ba55a branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T22:10:53+02:00 summary: bpo-37127: Remove _pending_calls.finishing (GH-19439) files: M Include/internal/pycore_pystate.h M Python/ceval.c diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 50d906c4c6dde..fba0b6f920817 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -16,7 +16,6 @@ extern "C" { /* ceval state */ struct _pending_calls { - int finishing; PyThread_type_lock lock; /* Request for running pending calls. */ _Py_atomic_int calls_to_do; diff --git a/Python/ceval.c b/Python/ceval.c index 2e94f32f6c00b..e219ef388ccd1 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -547,18 +547,6 @@ _PyEval_AddPendingCall(PyThreadState *tstate, assert(pending->lock != NULL); PyThread_acquire_lock(pending->lock, WAIT_LOCK); - if (pending->finishing) { - PyThread_release_lock(pending->lock); - - PyObject *exc, *val, *tb; - _PyErr_Fetch(tstate, &exc, &val, &tb); - _PyErr_SetString(tstate, PyExc_SystemError, - "Py_AddPendingCall: cannot add pending calls " - "(Python shutting down)"); - _PyErr_Print(tstate); - _PyErr_Restore(tstate, exc, val, tb); - return -1; - } int result = _push_pending_call(pending, func, arg); PyThread_release_lock(pending->lock); @@ -666,10 +654,6 @@ _Py_FinishPendingCalls(PyThreadState *tstate) struct _pending_calls *pending = &tstate->interp->ceval.pending; - PyThread_acquire_lock(pending->lock, WAIT_LOCK); - pending->finishing = 1; - PyThread_release_lock(pending->lock); - if (!_Py_atomic_load_relaxed(&(pending->calls_to_do))) { return; } From webhook-mailer at python.org Wed Apr 8 17:35:12 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Apr 2020 21:35:12 -0000 Subject: [Python-checkins] bpo-40082: trip_signal() uses the main interpreter (GH-19441) Message-ID: https://github.com/python/cpython/commit/b54a99d6432de93de85be2b42a63774f8b4581a0 commit: b54a99d6432de93de85be2b42a63774f8b4581a0 branch: master author: Victor Stinner committer: GitHub date: 2020-04-08T23:35:05+02:00 summary: bpo-40082: trip_signal() uses the main interpreter (GH-19441) Fix the signal handler: it now always uses the main interpreter, rather than trying to get the current Python thread state. The following function now accepts an interpreter, instead of a Python thread state: * _PyEval_SignalReceived() * _Py_ThreadCanHandleSignals() * _PyEval_AddPendingCall() * COMPUTE_EVAL_BREAKER() * SET_GIL_DROP_REQUEST(), RESET_GIL_DROP_REQUEST() * SIGNAL_PENDING_CALLS(), UNSIGNAL_PENDING_CALLS() * SIGNAL_PENDING_SIGNALS(), UNSIGNAL_PENDING_SIGNALS() * SIGNAL_ASYNC_EXC(), UNSIGNAL_ASYNC_EXC() Py_AddPendingCall() now uses the main interpreter if it fails to the current Python thread state. Convert _PyThreadState_GET() and PyInterpreterState_GET_UNSAFE() macros to static inline functions. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082.WI3-lu.rst M Include/internal/pycore_ceval.h M Include/internal/pycore_pystate.h M Modules/signalmodule.c M Python/ceval.c M Python/ceval_gil.h diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 1f96fc6b18350..811aada3dcb18 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -19,9 +19,9 @@ extern void _Py_FinishPendingCalls(PyThreadState *tstate); extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *); extern int _PyEval_InitState(struct _ceval_state *ceval); extern void _PyEval_FiniState(struct _ceval_state *ceval); -PyAPI_FUNC(void) _PyEval_SignalReceived(PyThreadState *tstate); +PyAPI_FUNC(void) _PyEval_SignalReceived(PyInterpreterState *interp); PyAPI_FUNC(int) _PyEval_AddPendingCall( - PyThreadState *tstate, + PyInterpreterState *interp, int (*func)(void *), void *arg); PyAPI_FUNC(void) _PyEval_SignalAsyncExc(PyThreadState *tstate); diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index fba0b6f920817..13a957ab2fb78 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -310,9 +310,9 @@ _Py_IsMainInterpreter(PyThreadState* tstate) /* Only handle signals on the main thread of the main interpreter. */ static inline int -_Py_ThreadCanHandleSignals(PyThreadState *tstate) +_Py_ThreadCanHandleSignals(PyInterpreterState *interp) { - return (_Py_IsMainThread() && _Py_IsMainInterpreter(tstate)); + return (_Py_IsMainThread() && interp == _PyRuntime.interpreters.main); } @@ -340,7 +340,9 @@ static inline PyThreadState* _PyRuntimeState_GetThreadState(_PyRuntimeState *run The caller must hold the GIL. See also PyThreadState_Get() and PyThreadState_GET(). */ -#define _PyThreadState_GET() _PyRuntimeState_GetThreadState(&_PyRuntime) +static inline PyThreadState *_PyThreadState_GET(void) { + return _PyRuntimeState_GetThreadState(&_PyRuntime); +} /* Redefine PyThreadState_GET() as an alias to _PyThreadState_GET() */ #undef PyThreadState_GET @@ -354,7 +356,10 @@ static inline PyThreadState* _PyRuntimeState_GetThreadState(_PyRuntimeState *run See also _PyInterpreterState_Get() and _PyGILState_GetInterpreterStateUnsafe(). */ -#define _PyInterpreterState_GET_UNSAFE() (_PyThreadState_GET()->interp) +static inline PyInterpreterState* _PyInterpreterState_GET_UNSAFE(void) { + PyThreadState *tstate = _PyThreadState_GET(); + return tstate->interp; +} /* Other */ diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082.WI3-lu.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082.WI3-lu.rst new file mode 100644 index 0000000000000..0a25b5eca3aef --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082.WI3-lu.rst @@ -0,0 +1,2 @@ +Fix the signal handler: it now always uses the main interpreter, rather than +trying to get the current Python thread state. diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 0a2c665bc466c..b089a80785b06 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -252,14 +252,11 @@ trip_signal(int sig_num) cleared in PyErr_CheckSignals() before .tripped. */ _Py_atomic_store(&is_tripped, 1); - /* Get the Python thread state using PyGILState API, since - _PyThreadState_GET() returns NULL if the GIL is released. - For example, signal.raise_signal() releases the GIL. */ - PyThreadState *tstate = PyGILState_GetThisThreadState(); - assert(tstate != NULL); + /* Signals are always handled by the main interpreter */ + PyInterpreterState *interp = _PyRuntime.interpreters.main; /* Notify ceval.c */ - _PyEval_SignalReceived(tstate); + _PyEval_SignalReceived(interp); /* And then write to the wakeup fd *after* setting all the globals and doing the _PyEval_SignalReceived. We used to write to the wakeup fd @@ -299,7 +296,7 @@ trip_signal(int sig_num) { /* _PyEval_AddPendingCall() isn't signal-safe, but we still use it for this exceptional case. */ - _PyEval_AddPendingCall(tstate, + _PyEval_AddPendingCall(interp, report_wakeup_send_error, (void *)(intptr_t) last_error); } @@ -318,7 +315,7 @@ trip_signal(int sig_num) { /* _PyEval_AddPendingCall() isn't signal-safe, but we still use it for this exceptional case. */ - _PyEval_AddPendingCall(tstate, + _PyEval_AddPendingCall(interp, report_wakeup_write_error, (void *)(intptr_t)errno); } @@ -476,7 +473,7 @@ signal_signal_impl(PyObject *module, int signalnum, PyObject *handler) #endif PyThreadState *tstate = _PyThreadState_GET(); - if (!_Py_ThreadCanHandleSignals(tstate)) { + if (!_Py_ThreadCanHandleSignals(tstate->interp)) { _PyErr_SetString(tstate, PyExc_ValueError, "signal only works in main thread " "of the main interpreter"); @@ -704,7 +701,7 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args, PyObject *kwds) #endif PyThreadState *tstate = _PyThreadState_GET(); - if (!_Py_ThreadCanHandleSignals(tstate)) { + if (!_Py_ThreadCanHandleSignals(tstate->interp)) { _PyErr_SetString(tstate, PyExc_ValueError, "set_wakeup_fd only works in main thread " "of the main interpreter"); @@ -1681,7 +1678,7 @@ int PyErr_CheckSignals(void) { PyThreadState *tstate = _PyThreadState_GET(); - if (!_Py_ThreadCanHandleSignals(tstate)) { + if (!_Py_ThreadCanHandleSignals(tstate->interp)) { return 0; } @@ -1787,8 +1784,8 @@ PyOS_FiniInterrupts(void) int PyOS_InterruptOccurred(void) { - PyThreadState *tstate = _PyThreadState_GET(); - if (!_Py_ThreadCanHandleSignals(tstate)) { + PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + if (!_Py_ThreadCanHandleSignals(interp)) { return 0; } @@ -1824,8 +1821,8 @@ _PySignal_AfterFork(void) int _PyOS_IsMainThread(void) { - PyThreadState *tstate = _PyThreadState_GET(); - return _Py_ThreadCanHandleSignals(tstate); + PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + return _Py_ThreadCanHandleSignals(interp); } #ifdef MS_WINDOWS diff --git a/Python/ceval.c b/Python/ceval.c index e219ef388ccd1..b7129201593bf 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -142,15 +142,14 @@ is_tstate_valid(PyThreadState *tstate) 1. We believe this is all right because the eval loop will release the GIL eventually anyway. */ static inline void -COMPUTE_EVAL_BREAKER(PyThreadState *tstate, +COMPUTE_EVAL_BREAKER(PyInterpreterState *interp, struct _ceval_runtime_state *ceval, struct _ceval_state *ceval2) { - assert(is_tstate_valid(tstate)); _Py_atomic_store_relaxed(&ceval2->eval_breaker, _Py_atomic_load_relaxed(&ceval->gil_drop_request) | (_Py_atomic_load_relaxed(&ceval->signals_pending) - && _Py_ThreadCanHandleSignals(tstate)) + && _Py_ThreadCanHandleSignals(interp)) | (_Py_atomic_load_relaxed(&ceval2->pending.calls_to_do) && _Py_ThreadCanHandlePendingCalls()) | ceval2->pending.async_exc); @@ -158,90 +157,82 @@ COMPUTE_EVAL_BREAKER(PyThreadState *tstate, static inline void -SET_GIL_DROP_REQUEST(PyThreadState *tstate) +SET_GIL_DROP_REQUEST(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; _Py_atomic_store_relaxed(&ceval->gil_drop_request, 1); _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); } static inline void -RESET_GIL_DROP_REQUEST(PyThreadState *tstate) +RESET_GIL_DROP_REQUEST(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; _Py_atomic_store_relaxed(&ceval->gil_drop_request, 0); - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } static inline void -SIGNAL_PENDING_CALLS(PyThreadState *tstate) +SIGNAL_PENDING_CALLS(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; _Py_atomic_store_relaxed(&ceval2->pending.calls_to_do, 1); - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } static inline void -UNSIGNAL_PENDING_CALLS(PyThreadState *tstate) +UNSIGNAL_PENDING_CALLS(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; _Py_atomic_store_relaxed(&ceval2->pending.calls_to_do, 0); - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } static inline void -SIGNAL_PENDING_SIGNALS(PyThreadState *tstate) +SIGNAL_PENDING_SIGNALS(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; _Py_atomic_store_relaxed(&ceval->signals_pending, 1); /* eval_breaker is not set to 1 if thread_can_handle_signals() is false */ - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } static inline void -UNSIGNAL_PENDING_SIGNALS(PyThreadState *tstate) +UNSIGNAL_PENDING_SIGNALS(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; _Py_atomic_store_relaxed(&ceval->signals_pending, 0); - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } static inline void -SIGNAL_ASYNC_EXC(PyThreadState *tstate) +SIGNAL_ASYNC_EXC(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_state *ceval2 = &interp->ceval; ceval2->pending.async_exc = 1; _Py_atomic_store_relaxed(&ceval2->eval_breaker, 1); } static inline void -UNSIGNAL_ASYNC_EXC(PyThreadState *tstate) +UNSIGNAL_ASYNC_EXC(PyInterpreterState *interp) { - assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; - struct _ceval_state *ceval2 = &tstate->interp->ceval; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; + struct _ceval_state *ceval2 = &interp->ceval; ceval2->pending.async_exc = 0; - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } @@ -440,7 +431,8 @@ _PyEval_ReInitThreads(_PyRuntimeState *runtime) void _PyEval_SignalAsyncExc(PyThreadState *tstate) { - SIGNAL_ASYNC_EXC(tstate); + assert(is_tstate_valid(tstate)); + SIGNAL_ASYNC_EXC(tstate->interp); } PyThreadState * @@ -492,12 +484,12 @@ PyEval_RestoreThread(PyThreadState *tstate) */ void -_PyEval_SignalReceived(PyThreadState *tstate) +_PyEval_SignalReceived(PyInterpreterState *interp) { /* bpo-30703: Function called when the C signal handler of Python gets a signal. We cannot queue a callback using _PyEval_AddPendingCall() since that function is not async-signal-safe. */ - SIGNAL_PENDING_SIGNALS(tstate); + SIGNAL_PENDING_SIGNALS(interp); } /* Push one item onto the queue while holding the lock. */ @@ -537,10 +529,10 @@ _pop_pending_call(struct _pending_calls *pending, */ int -_PyEval_AddPendingCall(PyThreadState *tstate, +_PyEval_AddPendingCall(PyInterpreterState *interp, int (*func)(void *), void *arg) { - struct _pending_calls *pending = &tstate->interp->ceval.pending; + struct _pending_calls *pending = &interp->ceval.pending; /* Ensure that _PyEval_InitPendingCalls() was called and that _PyEval_FiniPendingCalls() is not called yet. */ @@ -551,7 +543,7 @@ _PyEval_AddPendingCall(PyThreadState *tstate, PyThread_release_lock(pending->lock); /* signal main loop */ - SIGNAL_PENDING_CALLS(tstate); + SIGNAL_PENDING_CALLS(interp); return result; } @@ -574,24 +566,30 @@ Py_AddPendingCall(int (*func)(void *), void *arg) if (tstate == NULL) { tstate = PyGILState_GetThisThreadState(); } - /* tstate can be NULL if Py_AddPendingCall() is called in a thread - which is no Python thread state. Fail with a fatal error in this - case. */ - ensure_tstate_not_null(__func__, tstate); - return _PyEval_AddPendingCall(tstate, func, arg); + + PyInterpreterState *interp; + if (tstate != NULL) { + interp = tstate->interp; + } + else { + /* Last resort: use the main interpreter */ + interp = _PyRuntime.interpreters.main; + } + return _PyEval_AddPendingCall(interp, func, arg); } static int handle_signals(PyThreadState *tstate) { - if (!_Py_ThreadCanHandleSignals(tstate)) { + assert(is_tstate_valid(tstate)); + if (!_Py_ThreadCanHandleSignals(tstate->interp)) { return 0; } - UNSIGNAL_PENDING_SIGNALS(tstate); + UNSIGNAL_PENDING_SIGNALS(tstate->interp); if (_PyErr_CheckSignalsTstate(tstate) < 0) { /* On failure, re-schedule a call to handle_signals(). */ - SIGNAL_PENDING_SIGNALS(tstate); + SIGNAL_PENDING_SIGNALS(tstate->interp); return -1; } return 0; @@ -600,6 +598,8 @@ handle_signals(PyThreadState *tstate) static int make_pending_calls(PyThreadState *tstate) { + assert(is_tstate_valid(tstate)); + /* only execute pending calls on main thread */ if (!_Py_ThreadCanHandlePendingCalls()) { return 0; @@ -614,7 +614,7 @@ make_pending_calls(PyThreadState *tstate) /* unsignal before starting to call callbacks, so that any callback added in-between re-signals */ - UNSIGNAL_PENDING_CALLS(tstate); + UNSIGNAL_PENDING_CALLS(tstate->interp); int res = 0; /* perform a bounded number of calls, in case of recursion */ @@ -643,7 +643,7 @@ make_pending_calls(PyThreadState *tstate) error: busy = 0; - SIGNAL_PENDING_CALLS(tstate); + SIGNAL_PENDING_CALLS(tstate->interp); return res; } @@ -828,9 +828,10 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) static int eval_frame_handle_pending(PyThreadState *tstate) { - /* Pending signals */ _PyRuntimeState * const runtime = &_PyRuntime; struct _ceval_runtime_state *ceval = &runtime->ceval; + + /* Pending signals */ if (_Py_atomic_load_relaxed(&ceval->signals_pending)) { if (handle_signals(tstate) != 0) { return -1; @@ -866,7 +867,7 @@ eval_frame_handle_pending(PyThreadState *tstate) if (tstate->async_exc != NULL) { PyObject *exc = tstate->async_exc; tstate->async_exc = NULL; - UNSIGNAL_ASYNC_EXC(tstate); + UNSIGNAL_ASYNC_EXC(tstate->interp); _PyErr_SetNone(tstate, exc); Py_DECREF(exc); return -1; diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h index b9e48a5392c2c..a025a9fad1248 100644 --- a/Python/ceval_gil.h +++ b/Python/ceval_gil.h @@ -168,7 +168,8 @@ drop_gil(struct _ceval_runtime_state *ceval, PyThreadState *tstate) /* Not switched yet => wait */ if (((PyThreadState*)_Py_atomic_load_relaxed(&gil->last_holder)) == tstate) { - RESET_GIL_DROP_REQUEST(tstate); + assert(is_tstate_valid(tstate)); + RESET_GIL_DROP_REQUEST(tstate->interp); /* NOTE: if COND_WAIT does not atomically start waiting when releasing the mutex, another thread can run through, take the GIL and drop it again, and reset the condition @@ -223,7 +224,8 @@ take_gil(PyThreadState *tstate) } assert(is_tstate_valid(tstate)); - struct _ceval_runtime_state *ceval = &tstate->interp->runtime->ceval; + PyInterpreterState *interp = tstate->interp; + struct _ceval_runtime_state *ceval = &interp->runtime->ceval; struct _gil_runtime_state *gil = &ceval->gil; /* Check that _PyEval_InitThreads() was called to create the lock */ @@ -252,8 +254,9 @@ take_gil(PyThreadState *tstate) MUTEX_UNLOCK(gil->mutex); PyThread_exit_thread(); } + assert(is_tstate_valid(tstate)); - SET_GIL_DROP_REQUEST(tstate); + SET_GIL_DROP_REQUEST(interp); } } @@ -289,9 +292,10 @@ take_gil(PyThreadState *tstate) drop_gil(ceval, tstate); PyThread_exit_thread(); } + assert(is_tstate_valid(tstate)); if (_Py_atomic_load_relaxed(&ceval->gil_drop_request)) { - RESET_GIL_DROP_REQUEST(tstate); + RESET_GIL_DROP_REQUEST(interp); } else { /* bpo-40010: eval_breaker should be recomputed to be set to 1 if there @@ -299,8 +303,8 @@ take_gil(PyThreadState *tstate) handle signals. Note: RESET_GIL_DROP_REQUEST() calls COMPUTE_EVAL_BREAKER(). */ - struct _ceval_state *ceval2 = &tstate->interp->ceval; - COMPUTE_EVAL_BREAKER(tstate, ceval, ceval2); + struct _ceval_state *ceval2 = &interp->ceval; + COMPUTE_EVAL_BREAKER(interp, ceval, ceval2); } /* Don't access tstate if the thread must exit */ From webhook-mailer at python.org Wed Apr 8 18:36:21 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 08 Apr 2020 22:36:21 -0000 Subject: [Python-checkins] bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile (GH-19442) Message-ID: https://github.com/python/cpython/commit/37a257c0ae0d4ba746397ae7584db887b175ab24 commit: 37a257c0ae0d4ba746397ae7584db887b175ab24 branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-09T00:36:13+02:00 summary: bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile (GH-19442) files: A Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst M Doc/Makefile diff --git a/Doc/Makefile b/Doc/Makefile index f589b6e75f618..2169f1a369549 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -143,7 +143,7 @@ clean: venv: $(PYTHON) -m venv $(VENVDIR) $(VENVDIR)/bin/python3 -m pip install -U pip setuptools - $(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb python-docs-theme + $(VENVDIR)/bin/python3 -m pip install -U Sphinx==1.8.2 blurb python-docs-theme @echo "The venv has been created in the $(VENVDIR) directory" dist: diff --git a/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst b/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst new file mode 100644 index 0000000000000..e08f36f03cb5a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst @@ -0,0 +1 @@ +Pin Sphinx version to 1.8.2 in ``Doc/Makefile``. From webhook-mailer at python.org Thu Apr 9 08:03:54 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Thu, 09 Apr 2020 12:03:54 -0000 Subject: [Python-checkins] bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190) Message-ID: https://github.com/python/cpython/commit/97e0de04b8cd44474e452a028761e34407192041 commit: 97e0de04b8cd44474e452a028761e34407192041 branch: master author: Zackery Spytz committer: GitHub date: 2020-04-09T13:03:49+01:00 summary: bpo-25780: Expose CAN_RAW_JOIN_FILTERS in the socket module (GH-19190) Co-Authored-By: Stefan Tatschner files: A Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst M Doc/library/socket.rst M Doc/whatsnew/3.9.rst M Misc/ACKS M Modules/socketmodule.c M configure M configure.ac M pyconfig.h.in diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 5426b5abe4f0f..87dee1a801dea 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -408,6 +408,17 @@ Constants .. versionadded:: 3.5 +.. data:: CAN_RAW_JOIN_FILTERS + + Joins the applied CAN filters such that only CAN frames that match all + given CAN filters are passed to user space. + + This constant is documented in the Linux documentation. + + .. availability:: Linux >= 4.1. + + .. versionadded:: 3.9 + .. data:: CAN_ISOTP CAN_ISOTP, in the CAN protocol family, is the ISO-TP (ISO 15765-2) protocol. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index ef499f504682d..e49d4264c6591 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -362,6 +362,13 @@ a non-blocking socket. (Contributed by Dong-hee Na in :issue:`39259`.) :class:`~smtplib.LMTP` constructor now has an optional *timeout* parameter. (Contributed by Dong-hee Na in :issue:`39329`.) +socket +------ + +The :mod:`socket` module now exports the :data:`~socket.CAN_RAW_JOIN_FILTERS` +constant on Linux 4.1 and greater. +(Contributed by Stefan Tatschner and Zackery Spytz in :issue:`25780`.) + threading --------- diff --git a/Misc/ACKS b/Misc/ACKS index ce100b972aa05..8cb95dc0cf863 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1682,6 +1682,7 @@ William Tanksley Christian Tanzer Steven Taschuk Batuhan Taskaya +Stefan Tatschner Amy Taylor Julian Taylor Monty Taylor diff --git a/Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst b/Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst new file mode 100644 index 0000000000000..119e149ae7dc7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst @@ -0,0 +1 @@ +Expose :data:`~socket.CAN_RAW_JOIN_FILTERS` in the :mod:`socket` module. diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index b5c241e643dfc..722c06e372e38 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -7702,6 +7702,9 @@ PyInit__socket(void) #ifdef HAVE_LINUX_CAN_RAW_FD_FRAMES PyModule_AddIntMacro(m, CAN_RAW_FD_FRAMES); #endif +#ifdef HAVE_LINUX_CAN_RAW_JOIN_FILTERS + PyModule_AddIntMacro(m, CAN_RAW_JOIN_FILTERS); +#endif #ifdef HAVE_LINUX_CAN_BCM_H PyModule_AddIntMacro(m, CAN_BCM); diff --git a/configure b/configure index a7a3ac254a970..d3e8149bec08b 100755 --- a/configure +++ b/configure @@ -11307,6 +11307,36 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_JOIN_FILTERS" >&5 +$as_echo_n "checking for CAN_RAW_JOIN_FILTERS... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int +main () +{ +int can_raw_join_filters = CAN_RAW_JOIN_FILTERS; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + +$as_echo "#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1" >>confdefs.h + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # Check for --with-doc-strings { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-doc-strings" >&5 $as_echo_n "checking for --with-doc-strings... " >&6; } diff --git a/configure.ac b/configure.ac index 8eed0151ebb41..6bc8499f7ffe6 100644 --- a/configure.ac +++ b/configure.ac @@ -3447,6 +3447,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ /* CAN_RAW_FD_FRAMES available check */ AC_MSG_RESULT(no) ]) +AC_MSG_CHECKING(for CAN_RAW_JOIN_FILTERS) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include ]], +[[int can_raw_join_filters = CAN_RAW_JOIN_FILTERS;]])],[ + AC_DEFINE(HAVE_LINUX_CAN_RAW_JOIN_FILTERS, 1, [Define if compiling using Linux 4.1 or later.]) + AC_MSG_RESULT(yes) +],[ + AC_MSG_RESULT(no) +]) + # Check for --with-doc-strings AC_MSG_CHECKING(for --with-doc-strings) AC_ARG_WITH(doc-strings, diff --git a/pyconfig.h.in b/pyconfig.h.in index 2a72e9ed7fe9c..76a10474208cf 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -628,6 +628,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CAN_RAW_H +/* Define if compiling using Linux 4.1 or later. */ +#undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_MEMFD_H From webhook-mailer at python.org Thu Apr 9 08:31:57 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 09 Apr 2020 12:31:57 -0000 Subject: [Python-checkins] bpo-40214: Temporarily disable a ctypes test (GH-19404) Message-ID: https://github.com/python/cpython/commit/c83f003ee5398e9c27a0c634329420003d607d46 commit: c83f003ee5398e9c27a0c634329420003d607d46 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-09T05:31:42-07:00 summary: bpo-40214: Temporarily disable a ctypes test (GH-19404) Only one particular sub-test of ctypes.test.test_loading.test_load_dll_with_flags is disabled, which caused failures on Azure Pipelines CI. (cherry picked from commit f407e209c1e35b64835f73e7e7ca23e33817e9fe) Co-authored-by: Zachary Ware files: M Lib/ctypes/test/test_loading.py diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index 9b97d80086044..a62044e370af6 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -158,8 +158,11 @@ def should_fail(command): # Relative path (but not just filename) should succeed should_pass("WinDLL('./_sqlite3.dll')") - # Insecure load flags should succeed - should_pass("WinDLL('_sqlite3.dll', winmode=0)") + # XXX: This test has started failing on Azure Pipelines CI. See + # bpo-40214 for more information. + if 0: + # Insecure load flags should succeed + should_pass("WinDLL('_sqlite3.dll', winmode=0)") # Full path load without DLL_LOAD_DIR shouldn't find dependency should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " + From webhook-mailer at python.org Thu Apr 9 11:10:37 2020 From: webhook-mailer at python.org (Hai Shi) Date: Thu, 09 Apr 2020 15:10:37 -0000 Subject: [Python-checkins] bpo-40077: Remove redundant cast in json module (GH-19438) Message-ID: https://github.com/python/cpython/commit/dcb04d9c6dd6f31449ade6765fa4d26a305e7381 commit: dcb04d9c6dd6f31449ade6765fa4d26a305e7381 branch: master author: Hai Shi committer: GitHub date: 2020-04-10T00:10:29+09:00 summary: bpo-40077: Remove redundant cast in json module (GH-19438) files: M Modules/_json.c diff --git a/Modules/_json.c b/Modules/_json.c index 8117d1601bd3f..3ab1cb3d69018 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -1818,7 +1818,7 @@ _json_exec(PyObject *module) } Py_INCREF(state->PyScannerType); if (PyModule_AddObject(module, "make_scanner", state->PyScannerType) < 0) { - Py_DECREF((PyObject*)state->PyScannerType); + Py_DECREF(state->PyScannerType); return -1; } @@ -1828,7 +1828,7 @@ _json_exec(PyObject *module) } Py_INCREF(state->PyEncoderType); if (PyModule_AddObject(module, "make_encoder", state->PyEncoderType) < 0) { - Py_DECREF((PyObject*)state->PyEncoderType); + Py_DECREF(state->PyEncoderType); return -1; } From webhook-mailer at python.org Thu Apr 9 11:32:30 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 09 Apr 2020 15:32:30 -0000 Subject: [Python-checkins] bpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-19225) (GH-19444) Message-ID: https://github.com/python/cpython/commit/cd8e1da3eaf1b39cc0897def3845da2d793a9e4c commit: cd8e1da3eaf1b39cc0897def3845da2d793a9e4c branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-09T17:32:21+02:00 summary: bpo-40112: distutils test_search_cpp: Fix logic to determine if C compiler is xlc on AIX (GH-19225) (GH-19444) (cherry picked from commit 76db37b1d37a9daadd9e5b320f2d5a53cd1352ec) Co-authored-by: Michael Felt files: M Lib/distutils/tests/test_config_cmd.py diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py index b735fd334d878..8bd2c94237846 100644 --- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/distutils/tests/test_config_cmd.py @@ -47,8 +47,7 @@ def test_search_cpp(self): cmd = config(dist) cmd._check_compiler() compiler = cmd.compiler - is_xlc = shutil.which(compiler.preprocessor[0]).startswith("/usr/vac") - if is_xlc: + if sys.platform[:3] == "aix" and "xlc" in compiler.preprocessor[0].lower(): self.skipTest('xlc: The -E option overrides the -P, -o, and -qsyntaxonly options') # simple pattern searches From webhook-mailer at python.org Thu Apr 9 11:46:31 2020 From: webhook-mailer at python.org (pxinwr) Date: Thu, 09 Apr 2020 15:46:31 -0000 Subject: [Python-checkins] bpo-31904: Fix test_c_locale_coercion encodings for VxWorks RTOS (GH-19448) Message-ID: https://github.com/python/cpython/commit/5cd28030092eaa8eb9223afd733974fd2afc8e2c commit: 5cd28030092eaa8eb9223afd733974fd2afc8e2c branch: master author: pxinwr committer: GitHub date: 2020-04-09T17:46:23+02:00 summary: bpo-31904: Fix test_c_locale_coercion encodings for VxWorks RTOS (GH-19448) files: A Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst M Lib/test/test_c_locale_coercion.py diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py index fb599b0fcb7a5..8340a9eb2ea3a 100644 --- a/Lib/test/test_c_locale_coercion.py +++ b/Lib/test/test_c_locale_coercion.py @@ -49,6 +49,10 @@ # TODO: Work out a robust dynamic test for this that doesn't rely on # CPython's own locale handling machinery EXPECT_COERCION_IN_DEFAULT_LOCALE = False +elif sys.platform == "vxworks": + # VxWorks defaults to using UTF-8 for all system interfaces + EXPECTED_C_LOCALE_STREAM_ENCODING = "utf-8" + EXPECTED_C_LOCALE_FS_ENCODING = "utf-8" # Note that the above expectations are still wrong in some cases, such as: # * Windows when PYTHONLEGACYWINDOWSFSENCODING is set diff --git a/Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst b/Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst new file mode 100644 index 0000000000000..0c08ab5631175 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst @@ -0,0 +1 @@ +Set expected default encoding in test_c_locale_coercion.py for VxWorks RTOS. From webhook-mailer at python.org Thu Apr 9 14:55:08 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 09 Apr 2020 18:55:08 -0000 Subject: [Python-checkins] Remove extraneous ')' in abstract.h (GH-19146) (#19451) Message-ID: https://github.com/python/cpython/commit/10dabbf8d2c1c929f6ac395e19c64b361bd58fdd commit: 10dabbf8d2c1c929f6ac395e19c64b361bd58fdd branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-09T14:55:00-04:00 summary: Remove extraneous ')' in abstract.h (GH-19146) (#19451) (cherry picked from commit ac2cfe6631b77a2005d8f16f034dbb6154f04ab2) Co-authored-by: Jimmy Yang files: M Include/object.h diff --git a/Include/object.h b/Include/object.h index cc98d8a1def7e..5558f65687adc 100644 --- a/Include/object.h +++ b/Include/object.h @@ -29,7 +29,7 @@ of data it contains. An object's type is fixed when it is created. Types themselves are represented as objects; an object contains a pointer to the corresponding type object. The type itself has a type pointer pointing to the object representing the type 'type', which -contains a pointer to itself!). +contains a pointer to itself!. Objects do not float around in memory; once allocated an object keeps the same size and address. Objects that must hold variable-size data From webhook-mailer at python.org Thu Apr 9 19:41:07 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 09 Apr 2020 23:41:07 -0000 Subject: [Python-checkins] bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile (GH-19442) (GH-19443) Message-ID: https://github.com/python/cpython/commit/9e5f159d3279a6b476d588010d529cfdbb8c8803 commit: 9e5f159d3279a6b476d588010d529cfdbb8c8803 branch: 3.7 author: Victor Stinner committer: GitHub date: 2020-04-10T01:40:58+02:00 summary: bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile (GH-19442) (GH-19443) (cherry picked from commit 37a257c0ae0d4ba746397ae7584db887b175ab24) files: A Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst M Doc/Makefile diff --git a/Doc/Makefile b/Doc/Makefile index 08013c0ef48c0..803d1c00aced2 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -127,7 +127,7 @@ clean: venv: $(PYTHON) -m venv $(VENVDIR) - $(VENVDIR)/bin/python3 -m pip install -U Sphinx blurb + $(VENVDIR)/bin/python3 -m pip install -U Sphinx==1.8.2 blurb @echo "The venv has been created in the $(VENVDIR) directory" dist: diff --git a/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst b/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst new file mode 100644 index 0000000000000..e08f36f03cb5a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst @@ -0,0 +1 @@ +Pin Sphinx version to 1.8.2 in ``Doc/Makefile``. From webhook-mailer at python.org Thu Apr 9 21:05:46 2020 From: webhook-mailer at python.org (Andy Lester) Date: Fri, 10 Apr 2020 01:05:46 -0000 Subject: [Python-checkins] bpo-39943: Keep constness of pointer objects. (19405) Message-ID: https://github.com/python/cpython/commit/38ada3bac8205a7690d573d715b0e84e60297c4c commit: 38ada3bac8205a7690d573d715b0e84e60297c4c branch: master author: Andy Lester committer: GitHub date: 2020-04-09T20:05:38-05:00 summary: bpo-39943: Keep constness of pointer objects. (19405) * Keep constness of pointer objects. Also moved an auto variable that got consted into its innermost necessary scope. * move def Co-authored-by: Benjamin Peterson files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index ca26d960643e2..bc42e2db22079 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2857,19 +2857,18 @@ PyObject * PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) { PyHeapTypeObject *res; - PyMemberDef *memb; PyObject *modname; PyTypeObject *type, *base; - PyType_Slot *slot; + const PyType_Slot *slot; Py_ssize_t nmembers, weaklistoffset, dictoffset; - char *s, *res_start; + char *res_start; nmembers = weaklistoffset = dictoffset = 0; for (slot = spec->slots; slot->slot; slot++) { if (slot->slot == Py_tp_members) { nmembers = 0; - for (memb = slot->pfunc; memb->name != NULL; memb++) { + for (const PyMemberDef *memb = slot->pfunc; memb->name != NULL; memb++) { nmembers++; if (strcmp(memb->name, "__weaklistoffset__") == 0) { // The PyMemberDef must be a Py_ssize_t and readonly @@ -2899,9 +2898,9 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) } /* Set the type name and qualname */ - s = strrchr(spec->name, '.'); + const char *s = strrchr(spec->name, '.'); if (s == NULL) - s = (char*)spec->name; + s = spec->name; else s++; From webhook-mailer at python.org Thu Apr 9 23:28:19 2020 From: webhook-mailer at python.org (Ethan Smith) Date: Fri, 10 Apr 2020 03:28:19 -0000 Subject: [Python-checkins] Generic itertools.chain (GH-19417) Message-ID: https://github.com/python/cpython/commit/a8403d057d41a022d819fd8d6fbe2a666f72b6f5 commit: a8403d057d41a022d819fd8d6fbe2a666f72b6f5 branch: master author: Ethan Smith committer: GitHub date: 2020-04-09T20:28:08-07:00 summary: Generic itertools.chain (GH-19417) files: M Lib/test/test_genericalias.py M Modules/itertoolsmodule.c diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 9c5b23e5e5b0f..d8acdee2da3e2 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -7,6 +7,7 @@ ) from collections.abc import * from contextlib import AbstractContextManager, AbstractAsyncContextManager +from itertools import chain from os import DirEntry from re import Pattern, Match from types import GenericAlias, MappingProxyType @@ -35,7 +36,8 @@ def test_subscriptable(self): Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, Sequence, MutableSequence, - MappingProxyType, DirEntry + MappingProxyType, DirEntry, + chain, ): tname = t.__name__ with self.subTest(f"Testing {tname}"): diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index e99c964ac1d79..4ebeb741b6b5c 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -2028,6 +2028,8 @@ static PyMethodDef chain_methods[] = { reduce_doc}, {"__setstate__", (PyCFunction)chain_setstate, METH_O, setstate_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; From webhook-mailer at python.org Fri Apr 10 00:26:01 2020 From: webhook-mailer at python.org (Ethan Smith) Date: Fri, 10 Apr 2020 04:26:01 -0000 Subject: [Python-checkins] bpo-39481: PEP 585 for enumerate, AsyncGeneratorType, mmap (GH-19421) Message-ID: https://github.com/python/cpython/commit/7c4185d62d4aec486d82c3ad02acd878db2d3537 commit: 7c4185d62d4aec486d82c3ad02acd878db2d3537 branch: master author: Ethan Smith committer: GitHub date: 2020-04-09T21:25:53-07:00 summary: bpo-39481: PEP 585 for enumerate, AsyncGeneratorType, mmap (GH-19421) files: M Lib/test/test_genericalias.py M Modules/mmapmodule.c M Objects/enumobject.c M Objects/genobject.c diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 535c2492574b3..196b059dfa0dd 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -7,11 +7,12 @@ ) from collections.abc import * from contextlib import AbstractContextManager, AbstractAsyncContextManager +from mmap import mmap from ipaddress import IPv4Network, IPv4Interface, IPv6Network, IPv6Interface from itertools import chain from os import DirEntry from re import Pattern, Match -from types import GenericAlias, MappingProxyType +from types import GenericAlias, MappingProxyType, AsyncGeneratorType import typing from typing import TypeVar @@ -21,7 +22,8 @@ class BaseTest(unittest.TestCase): """Test basics.""" def test_subscriptable(self): - for t in (type, tuple, list, dict, set, frozenset, + for t in (type, tuple, list, dict, set, frozenset, enumerate, + mmap, defaultdict, deque, OrderedDict, Counter, UserDict, UserList, Pattern, Match, @@ -37,10 +39,9 @@ def test_subscriptable(self): Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, Sequence, MutableSequence, - MappingProxyType, + MappingProxyType, AsyncGeneratorType, DirEntry, IPv4Network, IPv4Interface, IPv6Network, IPv6Interface, - MappingProxyType, DirEntry, chain, ): tname = t.__name__ diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index a5c0ae0eaf065..a1267bdd549c1 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -816,6 +816,8 @@ static struct PyMethodDef mmap_object_methods[] = { #ifdef MS_WINDOWS {"__sizeof__", (PyCFunction) mmap__sizeof__method, METH_NOARGS}, #endif + {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_O|METH_CLASS, + PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/enumobject.c b/Objects/enumobject.c index 75703be5fcfc5..4a83bb45aa667 100644 --- a/Objects/enumobject.c +++ b/Objects/enumobject.c @@ -201,6 +201,8 @@ PyDoc_STRVAR(reduce_doc, "Return state information for pickling."); static PyMethodDef enum_methods[] = { {"__reduce__", (PyCFunction)enum_reduce, METH_NOARGS, reduce_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; diff --git a/Objects/genobject.c b/Objects/genobject.c index 6bb08aeaff76b..d3455f8dcd792 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1346,6 +1346,8 @@ static PyMethodDef async_gen_methods[] = { {"asend", (PyCFunction)async_gen_asend, METH_O, async_asend_doc}, {"athrow",(PyCFunction)async_gen_athrow, METH_VARARGS, async_athrow_doc}, {"aclose", (PyCFunction)async_gen_aclose, METH_NOARGS, async_aclose_doc}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* Sentinel */ }; From webhook-mailer at python.org Fri Apr 10 00:47:39 2020 From: webhook-mailer at python.org (Ethan Smith) Date: Fri, 10 Apr 2020 04:47:39 -0000 Subject: [Python-checkins] bpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422) Message-ID: https://github.com/python/cpython/commit/e3ec44d692d9442e640cf5b2d8708157a65cec3e commit: e3ec44d692d9442e640cf5b2d8708157a65cec3e branch: master author: Ethan Smith committer: GitHub date: 2020-04-09T21:47:31-07:00 summary: bpo-39481: PEP 585 for difflib, filecmp, fileinput (#19422) files: M Lib/difflib.py M Lib/filecmp.py M Lib/fileinput.py M Lib/test/test_genericalias.py diff --git a/Lib/difflib.py b/Lib/difflib.py index 5d756436a67e1..f2215d8d4561c 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -32,6 +32,7 @@ from heapq import nlargest as _nlargest from collections import namedtuple as _namedtuple +from types import GenericAlias Match = _namedtuple('Match', 'a b size') @@ -685,6 +686,9 @@ def real_quick_ratio(self): # shorter sequence return _calculate_ratio(min(la, lb), la + lb) + __class_getitem__ = classmethod(GenericAlias) + + def get_close_matches(word, possibilities, n=3, cutoff=0.6): """Use SequenceMatcher to return list of the best "good enough" matches. diff --git a/Lib/filecmp.py b/Lib/filecmp.py index cfdca1e924f55..7a4da6beb5050 100644 --- a/Lib/filecmp.py +++ b/Lib/filecmp.py @@ -13,6 +13,7 @@ import os import stat from itertools import filterfalse +from types import GenericAlias __all__ = ['clear_cache', 'cmp', 'dircmp', 'cmpfiles', 'DEFAULT_IGNORES'] @@ -247,6 +248,9 @@ def __getattr__(self, attr): self.methodmap[attr](self) return getattr(self, attr) + __class_getitem__ = classmethod(GenericAlias) + + def cmpfiles(a, b, common, shallow=True): """Compare common files in two directories. diff --git a/Lib/fileinput.py b/Lib/fileinput.py index c1b0ec9a8ed08..0c31f93ed8f2e 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -73,6 +73,7 @@ """ import sys, os +from types import GenericAlias __all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno", "fileno", "isfirstline", "isstdin", "FileInput", "hook_compressed", @@ -391,6 +392,8 @@ def isfirstline(self): def isstdin(self): return self._isstdin + __class_getitem__ = classmethod(GenericAlias) + def hook_compressed(filename, mode): ext = os.path.splitext(filename)[1] diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 196b059dfa0dd..4241eabed0845 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -7,6 +7,9 @@ ) from collections.abc import * from contextlib import AbstractContextManager, AbstractAsyncContextManager +from difflib import SequenceMatcher +from filecmp import dircmp +from fileinput import FileInput from mmap import mmap from ipaddress import IPv4Network, IPv4Interface, IPv6Network, IPv6Interface from itertools import chain @@ -25,6 +28,9 @@ def test_subscriptable(self): for t in (type, tuple, list, dict, set, frozenset, enumerate, mmap, defaultdict, deque, + SequenceMatcher, + dircmp, + FileInput, OrderedDict, Counter, UserDict, UserList, Pattern, Match, AbstractContextManager, AbstractAsyncContextManager, From webhook-mailer at python.org Fri Apr 10 16:00:24 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 10 Apr 2020 20:00:24 -0000 Subject: [Python-checkins] bpo-40197: Better describe the benchmark results table (GH-19386) Message-ID: https://github.com/python/cpython/commit/1bf7dee8d35cb19db7ee98229dd2e5726e6c7606 commit: 1bf7dee8d35cb19db7ee98229dd2e5726e6c7606 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-10T13:00:15-07:00 summary: bpo-40197: Better describe the benchmark results table (GH-19386) (cherry picked from commit c63629e7c09da80a6b7d0253d04a9b3f57f88eff) Co-authored-by: Raymond Hettinger files: M Doc/whatsnew/3.8.rst diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a7abdf0252e5b..ad7d5d4c670b3 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -2210,7 +2210,13 @@ Here's a summary of performance improvements since Python 3.3: Timing loop: loop_overhead 0.3 0.5 0.6 0.4 0.3 0.3 - (Measured from the macOS 64-bit builds found at python.org) +The benchmarks were measured on an +`Intel? Core? i7-4960HQ processor +`_ +running the macOS 64-bit builds found at +`python.org `_. +The benchmark script displays timings in nanoseconds. + Notable changes in Python 3.8.1 =============================== From webhook-mailer at python.org Fri Apr 10 20:22:06 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Sat, 11 Apr 2020 00:22:06 -0000 Subject: [Python-checkins] bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API (GH-19461) Message-ID: https://github.com/python/cpython/commit/f13072b8a89a922285737988b086beb4b06c6648 commit: f13072b8a89a922285737988b086beb4b06c6648 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-11T01:21:54+01:00 summary: bpo-40241: Add PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public C-API (GH-19461) Add the functions PyObject_GC_IsTracked and PyObject_GC_IsFinalized to the public API to allow to query if Python objects are being currently tracked or have been already finalized by the garbage collector respectively. files: A Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst M Doc/c-api/gcsupport.rst M Doc/whatsnew/3.9.rst M Include/objimpl.h M Modules/_testcapimodule.c M Modules/gcmodule.c diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst index 924a7fd2fda4d..4cab0f544ed81 100644 --- a/Doc/c-api/gcsupport.rst +++ b/Doc/c-api/gcsupport.rst @@ -60,6 +60,24 @@ Constructors for container types must conform to two rules: followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, usually near the end of the constructor. +.. c:function:: int PyObject_GC_IsTracked(PyObject *op) + + Returns 1 if the object type of *op* implements the GC protocol and *op* is being + currently tracked by the garbage collector and 0 otherwise. + + This is analogous to the Python function :func:`gc.is_tracked`. + + .. versionadded:: 3.9 + + +.. c:function:: int PyObject_GC_IsFinalized(PyObject *op) + + Returns 1 if the object type of *op* implements the GC protocol and *op* has been + already finalized by the garbage collector and 0 otherwise. + + This is analogous to the Python function :func:`gc.is_finalized`. + + .. versionadded:: 3.9 Similarly, the deallocator for the object must conform to a similar pair of rules: diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index e49d4264c6591..3beb721ed318e 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -564,6 +564,13 @@ Build and C API Changes Windows. (Contributed by Zackery Spytz in :issue:`8901`.) +* Add the functions :c:func:`PyObject_GC_IsTracked` and + :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if + Python objects are being currently tracked or have been already finalized by + the garbage collector respectively. (Contributed by Pablo Galindo in + :issue:`40241`.) + + Deprecated ========== diff --git a/Include/objimpl.h b/Include/objimpl.h index 6e7549c90d210..030d7eee29723 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -186,6 +186,8 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *); #define PyObject_GC_NewVar(type, typeobj, n) \ ( (type *) _PyObject_GC_NewVar((typeobj), (n)) ) +PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *); +PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *); /* Utility macro to help write tp_traverse functions. * To use this macro, the tp_traverse function must name its arguments diff --git a/Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst b/Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst new file mode 100644 index 0000000000000..0ade4a5f30e2e --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst @@ -0,0 +1,4 @@ +Add the functions :c:func:`PyObject_GC_IsTracked` and +:c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if +Python objects are being currently tracked or have been already finalized by +the garbage collector respectively. Patch by Pablo Galindo. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 3cc558689b6c1..0a30fea9e8747 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -3588,7 +3588,7 @@ slot_tp_del(PyObject *self) _Py_NewReference(self); Py_SET_REFCNT(self, refcnt); } - assert(!PyType_IS_GC(Py_TYPE(self)) || _PyObject_GC_IS_TRACKED(self)); + assert(!PyType_IS_GC(Py_TYPE(self)) || PyObject_GC_IsTracked(self)); /* If Py_REF_DEBUG macro is defined, _Py_NewReference() increased _Py_RefTotal, so we need to undo that. */ #ifdef Py_REF_DEBUG diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 1bc41fb83d8a6..17541824761a1 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -2312,3 +2312,21 @@ PyObject_GC_Del(void *op) } PyObject_FREE(g); } + +int +PyObject_GC_IsTracked(PyObject* obj) +{ + if (PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) { + return 1; + } + return 0; +} + +int +PyObject_GC_IsFinalized(PyObject *obj) +{ + if (PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) { + return 1; + } + return 0; +} From webhook-mailer at python.org Fri Apr 10 22:05:44 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Sat, 11 Apr 2020 02:05:44 -0000 Subject: [Python-checkins] bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) Message-ID: https://github.com/python/cpython/commit/7ec43a73092d43c6c95e7dd2669f49d54b57966f commit: 7ec43a73092d43c6c95e7dd2669f49d54b57966f branch: master author: Pablo Galindo committer: GitHub date: 2020-04-11T03:05:37+01:00 summary: bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) files: M Doc/library/multiprocessing.rst diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 492f94c30017f..ec9521f1fb4a0 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -439,7 +439,8 @@ process which created it. >>> def f(x): ... return x*x ... - >>> p.map(f, [1,2,3]) + >>> with p: + ... p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: Process PoolWorker-3: @@ -2127,6 +2128,16 @@ with the :class:`Pool` class. Note that the methods of the pool object should only be called by the process which created the pool. + .. warning:: + :class:`multiprocessing.pool` objects have internal resources that need to be + properly managed (like any other resource) by using the pool as a context manager + or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this + can lead to the process hanging on finalization. + + Note that is **not correct** to rely on the garbage colletor to destroy the pool + as CPython does not assure that the finalizer of the pool will be called + (see :meth:`object.__del__` for more information). + .. versionadded:: 3.2 *maxtasksperchild* From webhook-mailer at python.org Fri Apr 10 22:11:20 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 11 Apr 2020 02:11:20 -0000 Subject: [Python-checkins] bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) Message-ID: https://github.com/python/cpython/commit/2e49b5254aa0888dd21a7929be14b6cfe03d56ef commit: 2e49b5254aa0888dd21a7929be14b6cfe03d56ef branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-10T19:11:16-07:00 summary: bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) (cherry picked from commit 7ec43a73092d43c6c95e7dd2669f49d54b57966f) Co-authored-by: Pablo Galindo files: M Doc/library/multiprocessing.rst diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 6fd509a00caf7..1b850ebced5eb 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -429,7 +429,8 @@ process which created it. >>> def f(x): ... return x*x ... - >>> p.map(f, [1,2,3]) + >>> with p: + ... p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: Process PoolWorker-3: @@ -2100,6 +2101,16 @@ with the :class:`Pool` class. Note that the methods of the pool object should only be called by the process which created the pool. + .. warning:: + :class:`multiprocessing.pool` objects have internal resources that need to be + properly managed (like any other resource) by using the pool as a context manager + or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this + can lead to the process hanging on finalization. + + Note that is **not correct** to rely on the garbage colletor to destroy the pool + as CPython does not assure that the finalizer of the pool will be called + (see :meth:`object.__del__` for more information). + .. versionadded:: 3.2 *maxtasksperchild* From webhook-mailer at python.org Fri Apr 10 22:11:21 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 11 Apr 2020 02:11:21 -0000 Subject: [Python-checkins] bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) Message-ID: https://github.com/python/cpython/commit/ceba0648d70524ec4ebb7a46d5d1162d4938c7ba commit: ceba0648d70524ec4ebb7a46d5d1162d4938c7ba branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-10T19:11:17-07:00 summary: bpo-38501: Add a warning section to multiprocessing.Pool docs about resource managing (GH-19466) (cherry picked from commit 7ec43a73092d43c6c95e7dd2669f49d54b57966f) Co-authored-by: Pablo Galindo files: M Doc/library/multiprocessing.rst diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index 492f94c30017f..ec9521f1fb4a0 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -439,7 +439,8 @@ process which created it. >>> def f(x): ... return x*x ... - >>> p.map(f, [1,2,3]) + >>> with p: + ... p.map(f, [1,2,3]) Process PoolWorker-1: Process PoolWorker-2: Process PoolWorker-3: @@ -2127,6 +2128,16 @@ with the :class:`Pool` class. Note that the methods of the pool object should only be called by the process which created the pool. + .. warning:: + :class:`multiprocessing.pool` objects have internal resources that need to be + properly managed (like any other resource) by using the pool as a context manager + or by calling :meth:`close` and :meth:`terminate` manually. Failure to do this + can lead to the process hanging on finalization. + + Note that is **not correct** to rely on the garbage colletor to destroy the pool + as CPython does not assure that the finalizer of the pool will be called + (see :meth:`object.__del__` for more information). + .. versionadded:: 3.2 *maxtasksperchild* From webhook-mailer at python.org Sat Apr 11 03:48:47 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 11 Apr 2020 07:48:47 -0000 Subject: [Python-checkins] bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345) Message-ID: https://github.com/python/cpython/commit/cd8295ff758891f21084a6a5ad3403d35dda38f7 commit: cd8295ff758891f21084a6a5ad3403d35dda38f7 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-11T10:48:40+03:00 summary: bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345) files: M Modules/_csv.c M Modules/_decimal/_decimal.c M Modules/_elementtree.c M Modules/_io/textio.c M Modules/_json.c M Modules/_operator.c M Modules/_pickle.c M Modules/_sqlite/connection.c M Modules/_sre.c M Modules/cjkcodecs/cjkcodecs.h M Modules/cjkcodecs/multibytecodec.c M Modules/cjkcodecs/multibytecodec.h M Modules/pyexpat.c M Modules/sre.h M Modules/sre_lib.h M Modules/unicodedata.c M Objects/bytesobject.c M Objects/exceptions.c M Objects/stringlib/codecs.h M Objects/typeobject.c M Objects/unicodeobject.c M Python/_warnings.c M Python/ast.c M Python/codecs.c M Python/formatter_unicode.c M Python/getargs.c M Python/traceback.c diff --git a/Modules/_csv.c b/Modules/_csv.c index 9c497154ffb5c..950b0d7005522 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -789,7 +789,7 @@ Reader_iternext(ReaderObj *self) Py_UCS4 c; Py_ssize_t pos, linelen; unsigned int kind; - void *data; + const void *data; PyObject *lineobj; if (parse_reset(self) < 0) @@ -996,7 +996,7 @@ join_reset(WriterObj *self) * record length. */ static Py_ssize_t -join_append_data(WriterObj *self, unsigned int field_kind, void *field_data, +join_append_data(WriterObj *self, unsigned int field_kind, const void *field_data, Py_ssize_t field_len, int *quoted, int copy_phase) { @@ -1107,7 +1107,7 @@ static int join_append(WriterObj *self, PyObject *field, int quoted) { unsigned int field_kind = -1; - void *field_data = NULL; + const void *field_data = NULL; Py_ssize_t field_len = 0; Py_ssize_t rec_len; @@ -1139,7 +1139,7 @@ join_append_lineterminator(WriterObj *self) { Py_ssize_t terminator_len, i; unsigned int term_kind; - void *term_data; + const void *term_data; terminator_len = PyUnicode_GET_LENGTH(self->dialect->lineterminator); if (terminator_len == -1) diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index b36e30972172d..cdc942f2158c3 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -1878,7 +1878,7 @@ dec_dealloc(PyObject *dec) /******************************************************************************/ Py_LOCAL_INLINE(int) -is_space(enum PyUnicode_Kind kind, void *data, Py_ssize_t pos) +is_space(enum PyUnicode_Kind kind, const void *data, Py_ssize_t pos) { Py_UCS4 ch = PyUnicode_READ(kind, data, pos); return Py_UNICODE_ISSPACE(ch); @@ -1896,7 +1896,7 @@ static char * numeric_as_ascii(const PyObject *u, int strip_ws, int ignore_underscores) { enum PyUnicode_Kind kind; - void *data; + const void *data; Py_UCS4 ch; char *res, *cp; Py_ssize_t j, len; diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 49c372d86b02b..c0c741e51c712 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -1132,7 +1132,7 @@ checkpath(PyObject* tag) if (PyUnicode_Check(tag)) { const Py_ssize_t len = PyUnicode_GET_LENGTH(tag); - void *data = PyUnicode_DATA(tag); + const void *data = PyUnicode_DATA(tag); unsigned int kind = PyUnicode_KIND(tag); if (len >= 3 && PyUnicode_READ(kind, data, 0) == '{' && ( PyUnicode_READ(kind, data, 1) == '}' || ( diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index dedbefe0079b8..12dba38d73bf0 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -340,7 +340,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *myself, goto error; kind = PyUnicode_KIND(modified); out = PyUnicode_DATA(modified); - PyUnicode_WRITE(kind, PyUnicode_DATA(modified), 0, '\r'); + PyUnicode_WRITE(kind, out, 0, '\r'); memcpy(out + kind, PyUnicode_DATA(output), kind * output_len); Py_DECREF(output); output = modified; /* output remains ready */ @@ -367,7 +367,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *myself, /* Record which newlines are read and do newline translation if desired, all in one pass. */ { - void *in_str; + const void *in_str; Py_ssize_t len; int seennl = self->seennl; int only_lf = 0; @@ -447,7 +447,7 @@ _PyIncrementalNewlineDecoder_decode(PyObject *myself, else { void *translated; int kind = PyUnicode_KIND(output); - void *in_str = PyUnicode_DATA(output); + const void *in_str = PyUnicode_DATA(output); Py_ssize_t in, out; /* XXX: Previous in-place translation here is disabled as resizing is not possible anymore */ @@ -2085,7 +2085,7 @@ _PyIO_find_line_ending( else { /* Non-universal mode. */ Py_ssize_t readnl_len = PyUnicode_GET_LENGTH(readnl); - Py_UCS1 *nl = PyUnicode_1BYTE_DATA(readnl); + const Py_UCS1 *nl = PyUnicode_1BYTE_DATA(readnl); /* Assume that readnl is an ASCII character. */ assert(PyUnicode_KIND(readnl) == PyUnicode_1BYTE_KIND); if (readnl_len == 1) { @@ -2139,7 +2139,7 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit) chunked = 0; while (1) { - char *ptr; + const char *ptr; Py_ssize_t line_len; int kind; Py_ssize_t consumed = 0; diff --git a/Modules/_json.c b/Modules/_json.c index 3ab1cb3d69018..17544165d8241 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -159,8 +159,8 @@ ascii_escape_unicode(PyObject *pystr) Py_ssize_t output_size; Py_ssize_t chars; PyObject *rval; - void *input; - unsigned char *output; + const void *input; + Py_UCS1 *output; int kind; if (PyUnicode_READY(pystr) == -1) @@ -225,7 +225,7 @@ escape_unicode(PyObject *pystr) Py_ssize_t output_size; Py_ssize_t chars; PyObject *rval; - void *input; + const void *input; int kind; Py_UCS4 maxchar; @@ -678,7 +678,7 @@ _parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ss Returns a new PyObject (usually a dict, but object_hook can change that) */ - void *str; + const void *str; int kind; Py_ssize_t end_idx; PyObject *val = NULL; @@ -808,7 +808,7 @@ _parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssi Returns a new PyList */ - void *str; + const void *str; int kind; Py_ssize_t end_idx; PyObject *val = NULL; @@ -911,7 +911,7 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ PyLong, or PyFloat. May return other types if parse_int or parse_float are set */ - void *str; + const void *str; int kind; Py_ssize_t end_idx; Py_ssize_t idx = start; @@ -1028,7 +1028,7 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_ Returns a new PyObject representation of the term. */ PyObject *res; - void *str; + const void *str; int kind; Py_ssize_t length; diff --git a/Modules/_operator.c b/Modules/_operator.c index 007c21b1bda37..19026b6c38e60 100644 --- a/Modules/_operator.c +++ b/Modules/_operator.c @@ -1170,7 +1170,7 @@ attrgetter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) for (idx = 0; idx < nattrs; ++idx) { PyObject *item = PyTuple_GET_ITEM(args, idx); Py_ssize_t item_len; - void *data; + const void *data; unsigned int kind; int dot_count; diff --git a/Modules/_pickle.c b/Modules/_pickle.c index c3385ad3b9ec6..4b46c1fe2af68 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -2581,7 +2581,7 @@ raw_unicode_escape(PyObject *obj) { char *p; Py_ssize_t i, size; - void *data; + const void *data; unsigned int kind; _PyBytesWriter writer; diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 697295da9ce39..92bdfe36e6a43 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -1644,7 +1644,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args) const char *uppercase_name_str; int rc; unsigned int kind; - void *data; + const void *data; if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { goto finally; diff --git a/Modules/_sre.c b/Modules/_sre.c index bee2e1284d68b..836d7961832ea 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -351,7 +351,7 @@ state_reset(SRE_STATE* state) data_stack_dealloc(state); } -static void* +static const void* getstring(PyObject* string, Py_ssize_t* p_length, int* p_isbytes, int* p_charsize, Py_buffer *view) @@ -398,11 +398,11 @@ state_init(SRE_STATE* state, PatternObject* pattern, PyObject* string, Py_ssize_t length; int isbytes, charsize; - void* ptr; + const void* ptr; memset(state, 0, sizeof(SRE_STATE)); - state->mark = PyMem_New(void *, pattern->groups * 2); + state->mark = PyMem_New(const void *, pattern->groups * 2); if (!state->mark) { PyErr_NoMemory(); goto err; @@ -891,7 +891,7 @@ _sre_SRE_Pattern_split_impl(PatternObject *self, PyObject *string, Py_ssize_t status; Py_ssize_t n; Py_ssize_t i; - void* last; + const void* last; assert(self->codesize != 0); @@ -984,7 +984,7 @@ pattern_subx(PatternObject* self, PyObject* ptemplate, PyObject* string, PyObject* item; PyObject* filter; PyObject* match; - void* ptr; + const void* ptr; Py_ssize_t status; Py_ssize_t n; Py_ssize_t i, b, e; @@ -1895,7 +1895,7 @@ match_getslice_by_index(MatchObject* self, Py_ssize_t index, PyObject* def) int isbytes, charsize; Py_buffer view; PyObject *result; - void* ptr; + const void* ptr; Py_ssize_t i, j; assert(0 <= index && index < self->groups); diff --git a/Modules/cjkcodecs/cjkcodecs.h b/Modules/cjkcodecs/cjkcodecs.h index 8f6f880cadf71..e41755b197ffc 100644 --- a/Modules/cjkcodecs/cjkcodecs.h +++ b/Modules/cjkcodecs/cjkcodecs.h @@ -72,7 +72,7 @@ static const struct dbcs_map *mapping_list; #define ENCODER(encoding) \ static Py_ssize_t encoding##_encode( \ MultibyteCodec_State *state, const void *config, \ - int kind, void *data, \ + int kind, const void *data, \ Py_ssize_t *inpos, Py_ssize_t inlen, \ unsigned char **outbuf, Py_ssize_t outleft, int flags) #define ENCODER_RESET(encoding) \ diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index a09c75d4ffac7..9f9fbeb02ab69 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -228,7 +228,7 @@ multibytecodec_encerror(MultibyteCodec *codec, Py_ssize_t r; Py_ssize_t inpos; int kind; - void *data; + const void *data; replchar = PyUnicode_FromOrdinal('?'); if (replchar == NULL) @@ -457,7 +457,7 @@ multibytecodec_encode(MultibyteCodec *codec, Py_ssize_t finalsize, r = 0; Py_ssize_t datalen; int kind; - void *data; + const void *data; if (PyUnicode_READY(text) < 0) return NULL; diff --git a/Modules/cjkcodecs/multibytecodec.h b/Modules/cjkcodecs/multibytecodec.h index 4d2b3558c936c..59468210b970c 100644 --- a/Modules/cjkcodecs/multibytecodec.h +++ b/Modules/cjkcodecs/multibytecodec.h @@ -30,7 +30,7 @@ typedef struct { typedef int (*mbcodec_init)(const void *config); typedef Py_ssize_t (*mbencode_func)(MultibyteCodec_State *state, const void *config, - int kind, void *data, + int kind, const void *data, Py_ssize_t *inpos, Py_ssize_t inlen, unsigned char **outbuf, Py_ssize_t outleft, int flags); diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index a7f8b5086bbfa..d930e3e12bbba 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1060,7 +1060,7 @@ PyUnknownEncodingHandler(void *encodingHandlerData, static unsigned char template_buffer[256] = {0}; PyObject* u; int i; - void *data; + const void *data; unsigned int kind; if (PyErr_Occurred()) diff --git a/Modules/sre.h b/Modules/sre.h index a7284881457c3..9b0d8b190426a 100644 --- a/Modules/sre.h +++ b/Modules/sre.h @@ -54,17 +54,17 @@ typedef struct { typedef struct SRE_REPEAT_T { Py_ssize_t count; - SRE_CODE* pattern; /* points to REPEAT operator arguments */ - void* last_ptr; /* helper to check for infinite loops */ + const SRE_CODE* pattern; /* points to REPEAT operator arguments */ + const void* last_ptr; /* helper to check for infinite loops */ struct SRE_REPEAT_T *prev; /* points to previous repeat context */ } SRE_REPEAT; typedef struct { /* string pointers */ - void* ptr; /* current position (also end of current slice) */ - void* beginning; /* start of original string */ - void* start; /* start of current slice */ - void* end; /* end of original string */ + const void* ptr; /* current position (also end of current slice) */ + const void* beginning; /* start of original string */ + const void* start; /* start of current slice */ + const void* end; /* end of original string */ /* attributes for the match object */ PyObject* string; Py_buffer buffer; @@ -74,7 +74,7 @@ typedef struct { /* registers */ Py_ssize_t lastindex; Py_ssize_t lastmark; - void** mark; + const void** mark; int match_all; int must_advance; /* dynamically allocated stuff */ diff --git a/Modules/sre_lib.h b/Modules/sre_lib.h index 437ab43f434a6..9cc786321c560 100644 --- a/Modules/sre_lib.h +++ b/Modules/sre_lib.h @@ -13,7 +13,7 @@ /* This file is included three times, with different character settings */ LOCAL(int) -SRE(at)(SRE_STATE* state, SRE_CHAR* ptr, SRE_CODE at) +SRE(at)(SRE_STATE* state, const SRE_CHAR* ptr, SRE_CODE at) { /* check if pointer is at given position */ @@ -101,7 +101,7 @@ SRE(at)(SRE_STATE* state, SRE_CHAR* ptr, SRE_CODE at) } LOCAL(int) -SRE(charset)(SRE_STATE* state, SRE_CODE* set, SRE_CODE ch) +SRE(charset)(SRE_STATE* state, const SRE_CODE* set, SRE_CODE ch) { /* check if character is a member of the given set */ @@ -188,7 +188,7 @@ SRE(charset)(SRE_STATE* state, SRE_CODE* set, SRE_CODE ch) } LOCAL(int) -SRE(charset_loc_ignore)(SRE_STATE* state, SRE_CODE* set, SRE_CODE ch) +SRE(charset_loc_ignore)(SRE_STATE* state, const SRE_CODE* set, SRE_CODE ch) { SRE_CODE lo, up; lo = sre_lower_locale(ch); @@ -199,15 +199,15 @@ SRE(charset_loc_ignore)(SRE_STATE* state, SRE_CODE* set, SRE_CODE ch) return up != lo && SRE(charset)(state, set, up); } -LOCAL(Py_ssize_t) SRE(match)(SRE_STATE* state, SRE_CODE* pattern, int toplevel); +LOCAL(Py_ssize_t) SRE(match)(SRE_STATE* state, const SRE_CODE* pattern, int toplevel); LOCAL(Py_ssize_t) -SRE(count)(SRE_STATE* state, SRE_CODE* pattern, Py_ssize_t maxcount) +SRE(count)(SRE_STATE* state, const SRE_CODE* pattern, Py_ssize_t maxcount) { SRE_CODE chr; SRE_CHAR c; - SRE_CHAR* ptr = (SRE_CHAR *)state->ptr; - SRE_CHAR* end = (SRE_CHAR *)state->end; + const SRE_CHAR* ptr = (const SRE_CHAR *)state->ptr; + const SRE_CHAR* end = (const SRE_CHAR *)state->end; Py_ssize_t i; /* adjust end */ @@ -335,14 +335,14 @@ SRE(count)(SRE_STATE* state, SRE_CODE* pattern, Py_ssize_t maxcount) #if 0 /* not used in this release */ LOCAL(int) -SRE(info)(SRE_STATE* state, SRE_CODE* pattern) +SRE(info)(SRE_STATE* state, const SRE_CODE* pattern) { /* check if an SRE_OP_INFO block matches at the current position. returns the number of SRE_CODE objects to skip if successful, 0 if no match */ - SRE_CHAR* end = (SRE_CHAR*) state->end; - SRE_CHAR* ptr = (SRE_CHAR*) state->ptr; + const SRE_CHAR* end = (const SRE_CHAR*) state->end; + const SRE_CHAR* ptr = (const SRE_CHAR*) state->ptr; Py_ssize_t i; /* check minimal length */ @@ -531,8 +531,8 @@ do { \ typedef struct { Py_ssize_t last_ctx_pos; Py_ssize_t jump; - SRE_CHAR* ptr; - SRE_CODE* pattern; + const SRE_CHAR* ptr; + const SRE_CODE* pattern; Py_ssize_t count; Py_ssize_t lastmark; Py_ssize_t lastindex; @@ -546,9 +546,9 @@ typedef struct { /* check if string matches the given pattern. returns <0 for error, 0 for failure, and 1 for success */ LOCAL(Py_ssize_t) -SRE(match)(SRE_STATE* state, SRE_CODE* pattern, int toplevel) +SRE(match)(SRE_STATE* state, const SRE_CODE* pattern, int toplevel) { - SRE_CHAR* end = (SRE_CHAR *)state->end; + const SRE_CHAR* end = (const SRE_CHAR *)state->end; Py_ssize_t alloc_pos, ctx_pos = -1; Py_ssize_t i, ret = 0; Py_ssize_t jump; diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index 1a9e1c0b667d3..569e785b291d3 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -496,7 +496,7 @@ nfd_nfkd(PyObject *self, PyObject *input, int k) Py_UCS4 *output; Py_ssize_t i, o, osize; int kind; - void *data; + const void *data; /* Longest decomposition in Unicode 3.2: U+FDFA */ Py_UCS4 stack[20]; Py_ssize_t space, isize; @@ -643,7 +643,7 @@ nfc_nfkc(PyObject *self, PyObject *input, int k) { PyObject *result; int kind; - void *data; + const void *data; Py_UCS4 *output; Py_ssize_t i, i1, o, len; int f,l,index,index1,comb; @@ -804,7 +804,7 @@ is_normalized_quickcheck(PyObject *self, PyObject *input, Py_ssize_t i, len; int kind; - void *data; + const void *data; unsigned char prev_combining = 0; /* The two quickcheck bits at this shift have type QuickcheckResult. */ diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 03cd7ddd27901..987d98d4ed50f 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -1265,12 +1265,14 @@ PyBytes_Repr(PyObject *obj, int smartquotes) Py_ssize_t i, length = Py_SIZE(op); Py_ssize_t newsize, squotes, dquotes; PyObject *v; - unsigned char quote, *s, *p; + unsigned char quote; + const unsigned char *s; + Py_UCS1 *p; /* Compute size of output string */ squotes = dquotes = 0; newsize = 3; /* b'' */ - s = (unsigned char*)op->ob_sval; + s = (const unsigned char*)op->ob_sval; for (i = 0; i < length; i++) { Py_ssize_t incr = 1; switch(s[i]) { @@ -2271,7 +2273,7 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray) char *buf; Py_ssize_t hexlen, invalid_char; unsigned int top, bot; - Py_UCS1 *str, *end; + const Py_UCS1 *str, *end; _PyBytesWriter writer; _PyBytesWriter_Init(&writer); @@ -2283,7 +2285,7 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray) hexlen = PyUnicode_GET_LENGTH(string); if (!PyUnicode_IS_ASCII(string)) { - void *data = PyUnicode_DATA(string); + const void *data = PyUnicode_DATA(string); unsigned int kind = PyUnicode_KIND(string); Py_ssize_t i; diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 2baec5e3d5839..dad177a1ab606 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -1428,7 +1428,7 @@ my_basename(PyObject *name) { Py_ssize_t i, size, offset; int kind; - void *data; + const void *data; if (PyUnicode_READY(name)) return NULL; @@ -2953,7 +2953,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) static PyObject *exec_prefix = NULL; Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text), match; int kind = PyUnicode_KIND(self->text); - void *data = PyUnicode_DATA(self->text); + const void *data = PyUnicode_DATA(self->text); /* Ignore leading whitespace */ while (start < text_len) { diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index 39c155321e472..cd7aa699b8f0f 100644 --- a/Objects/stringlib/codecs.h +++ b/Objects/stringlib/codecs.h @@ -259,7 +259,7 @@ STRINGLIB(utf8_decode)(const char **inptr, const char *end, Py_LOCAL_INLINE(char *) STRINGLIB(utf8_encoder)(_PyBytesWriter *writer, PyObject *unicode, - STRINGLIB_CHAR *data, + const STRINGLIB_CHAR *data, Py_ssize_t size, _Py_error_handler error_handler, const char *errors) diff --git a/Objects/typeobject.c b/Objects/typeobject.c index bc42e2db22079..209c6a554eedd 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3208,7 +3208,7 @@ is_dunder_name(PyObject *name) int kind = PyUnicode_KIND(name); /* Special names contain at least "__x__" and are always ASCII. */ if (length > 4 && kind == PyUnicode_1BYTE_KIND) { - Py_UCS1 *characters = PyUnicode_1BYTE_DATA(name); + const Py_UCS1 *characters = PyUnicode_1BYTE_DATA(name); return ( ((characters[length-2] == '_') && (characters[length-1] == '_')) && ((characters[0] == '_') && (characters[1] == '_')) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 1e1f257dad0ff..3c79febea7788 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -578,7 +578,7 @@ _PyUnicode_CheckConsistency(PyObject *op, int check_content) if (check_content && kind != PyUnicode_WCHAR_KIND) { Py_ssize_t i; Py_UCS4 maxchar = 0; - void *data; + const void *data; Py_UCS4 ch; data = PyUnicode_DATA(ascii); @@ -662,7 +662,7 @@ unicode_result_ready(PyObject *unicode) } if (length == 1) { - void *data = PyUnicode_DATA(unicode); + const void *data = PyUnicode_DATA(unicode); int kind = PyUnicode_KIND(unicode); Py_UCS4 ch = PyUnicode_READ(kind, data, 0); if (ch < 256) { @@ -720,7 +720,7 @@ backslashreplace(_PyBytesWriter *writer, char *str, Py_ssize_t size, i; Py_UCS4 ch; enum PyUnicode_Kind kind; - void *data; + const void *data; assert(PyUnicode_IS_READY(unicode)); kind = PyUnicode_KIND(unicode); @@ -787,7 +787,7 @@ xmlcharrefreplace(_PyBytesWriter *writer, char *str, Py_ssize_t size, i; Py_UCS4 ch; enum PyUnicode_Kind kind; - void *data; + const void *data; assert(PyUnicode_IS_READY(unicode)); kind = PyUnicode_KIND(unicode); @@ -863,7 +863,7 @@ static BLOOM_MASK bloom_linebreak = ~(BLOOM_MASK)0; (BLOOM(bloom_linebreak, (ch)) && Py_UNICODE_ISLINEBREAK(ch))) static inline BLOOM_MASK -make_bloom_mask(int kind, void* ptr, Py_ssize_t len) +make_bloom_mask(int kind, const void* ptr, Py_ssize_t len) { #define BLOOM_UPDATE(TYPE, MASK, PTR, LEN) \ do { \ @@ -1302,16 +1302,16 @@ unicode_kind_name(PyObject *unicode) #ifdef Py_DEBUG /* Functions wrapping macros for use in debugger */ -char *_PyUnicode_utf8(void *unicode_raw){ +const char *_PyUnicode_utf8(void *unicode_raw){ PyObject *unicode = _PyObject_CAST(unicode_raw); return PyUnicode_UTF8(unicode); } -void *_PyUnicode_compact_data(void *unicode_raw) { +const void *_PyUnicode_compact_data(void *unicode_raw) { PyObject *unicode = _PyObject_CAST(unicode_raw); return _PyUnicode_COMPACT_DATA(unicode); } -void *_PyUnicode_data(void *unicode_raw) { +const void *_PyUnicode_data(void *unicode_raw) { PyObject *unicode = _PyObject_CAST(unicode_raw); printf("obj %p\n", (void*)unicode); printf("compact %d\n", PyUnicode_IS_COMPACT(unicode)); @@ -1328,7 +1328,7 @@ _PyUnicode_Dump(PyObject *op) PyASCIIObject *ascii = (PyASCIIObject *)op; PyCompactUnicodeObject *compact = (PyCompactUnicodeObject *)op; PyUnicodeObject *unicode = (PyUnicodeObject *)op; - void *data; + const void *data; if (ascii->state.compact) { @@ -1528,7 +1528,8 @@ _copy_characters(PyObject *to, Py_ssize_t to_start, Py_ssize_t how_many, int check_maxchar) { unsigned int from_kind, to_kind; - void *from_data, *to_data; + const void *from_data; + void *to_data; assert(0 <= how_many); assert(0 <= from_start); @@ -1553,7 +1554,7 @@ _copy_characters(PyObject *to, Py_ssize_t to_start, if (!check_maxchar && PyUnicode_MAX_CHAR_VALUE(from) > PyUnicode_MAX_CHAR_VALUE(to)) { - const Py_UCS4 to_maxchar = PyUnicode_MAX_CHAR_VALUE(to); + Py_UCS4 to_maxchar = PyUnicode_MAX_CHAR_VALUE(to); Py_UCS4 ch; Py_ssize_t i; for (i=0; i < how_many; i++) { @@ -1571,12 +1572,12 @@ _copy_characters(PyObject *to, Py_ssize_t to_start, check that all written characters are pure ASCII */ Py_UCS4 max_char; max_char = ucs1lib_find_max_char(from_data, - (Py_UCS1*)from_data + how_many); + (const Py_UCS1*)from_data + how_many); if (max_char >= 128) return -1; } memcpy((char*)to_data + to_kind * to_start, - (char*)from_data + from_kind * from_start, + (const char*)from_data + from_kind * from_start, to_kind * how_many); } else if (from_kind == PyUnicode_1BYTE_KIND @@ -2047,7 +2048,7 @@ unicode_write_cstr(PyObject *unicode, Py_ssize_t index, const char *str, Py_ssize_t len) { enum PyUnicode_Kind kind = PyUnicode_KIND(unicode); - void *data = PyUnicode_DATA(unicode); + const void *data = PyUnicode_DATA(unicode); const char *end = str + len; assert(index + len <= PyUnicode_GET_LENGTH(unicode)); @@ -2402,7 +2403,7 @@ Py_UCS4 _PyUnicode_FindMaxChar(PyObject *unicode, Py_ssize_t start, Py_ssize_t end) { enum PyUnicode_Kind kind; - void *startptr, *endptr; + const void *startptr, *endptr; assert(PyUnicode_IS_READY(unicode)); assert(0 <= start); @@ -2559,7 +2560,7 @@ as_ucs4(PyObject *string, Py_UCS4 *target, Py_ssize_t targetsize, int copy_null) { int kind; - void *data; + const void *data; Py_ssize_t len, targetlen; if (PyUnicode_READY(string) == -1) return NULL; @@ -2586,17 +2587,19 @@ as_ucs4(PyObject *string, Py_UCS4 *target, Py_ssize_t targetsize, } } if (kind == PyUnicode_1BYTE_KIND) { - Py_UCS1 *start = (Py_UCS1 *) data; + const Py_UCS1 *start = (const Py_UCS1 *) data; _PyUnicode_CONVERT_BYTES(Py_UCS1, Py_UCS4, start, start + len, target); } else if (kind == PyUnicode_2BYTE_KIND) { - Py_UCS2 *start = (Py_UCS2 *) data; + const Py_UCS2 *start = (const Py_UCS2 *) data; _PyUnicode_CONVERT_BYTES(Py_UCS2, Py_UCS4, start, start + len, target); } - else { - assert(kind == PyUnicode_4BYTE_KIND); + else if (kind == PyUnicode_4BYTE_KIND) { memcpy(target, data, len * sizeof(Py_UCS4)); } + else { + Py_UNREACHABLE(); + } if (copy_null) target[len] = 0; return target; @@ -4105,7 +4108,7 @@ PyUnicode_GetLength(PyObject *unicode) Py_UCS4 PyUnicode_ReadChar(PyObject *unicode, Py_ssize_t index) { - void *data; + const void *data; int kind; if (!PyUnicode_Check(unicode)) { @@ -4707,7 +4710,7 @@ _PyUnicode_EncodeUTF7(PyObject *str, const char *errors) { int kind; - void *data; + const void *data; Py_ssize_t len; PyObject *v; int inShift = 0; @@ -4950,7 +4953,7 @@ unicode_decode_utf8(const char *s, Py_ssize_t size, if (u == NULL) { return NULL; } - s += ascii_decode(s, end, PyUnicode_DATA(u)); + s += ascii_decode(s, end, PyUnicode_1BYTE_DATA(u)); if (s == end) { return u; } @@ -5380,7 +5383,7 @@ unicode_encode_utf8(PyObject *unicode, _Py_error_handler error_handler, PyUnicode_UTF8_LENGTH(unicode)); enum PyUnicode_Kind kind = PyUnicode_KIND(unicode); - void *data = PyUnicode_DATA(unicode); + const void *data = PyUnicode_DATA(unicode); Py_ssize_t size = PyUnicode_GET_LENGTH(unicode); _PyBytesWriter writer; @@ -5416,7 +5419,7 @@ unicode_fill_utf8(PyObject *unicode) assert(!PyUnicode_IS_ASCII(unicode)); enum PyUnicode_Kind kind = PyUnicode_KIND(unicode); - void *data = PyUnicode_DATA(unicode); + const void *data = PyUnicode_DATA(unicode); Py_ssize_t size = PyUnicode_GET_LENGTH(unicode); _PyBytesWriter writer; @@ -6425,7 +6428,7 @@ PyUnicode_AsUnicodeEscapeString(PyObject *unicode) PyObject *repr; char *p; enum PyUnicode_Kind kind; - void *data; + const void *data; Py_ssize_t expandsize; /* Initial allocation is based on the longest-possible character @@ -6679,7 +6682,7 @@ PyUnicode_AsRawUnicodeEscapeString(PyObject *unicode) char *p; Py_ssize_t expandsize, pos; int kind; - void *data; + const void *data; Py_ssize_t len; if (!PyUnicode_Check(unicode)) { @@ -6885,7 +6888,7 @@ unicode_encode_ucs1(PyObject *unicode, /* input state */ Py_ssize_t pos=0, size; int kind; - void *data; + const void *data; /* pointer into the output */ char *str; const char *encoding = (limit == 256) ? "latin-1" : "ascii"; @@ -7113,7 +7116,7 @@ PyUnicode_DecodeASCII(const char *s, if (u == NULL) { return NULL; } - Py_ssize_t outpos = ascii_decode(s, e, PyUnicode_DATA(u)); + Py_ssize_t outpos = ascii_decode(s, e, PyUnicode_1BYTE_DATA(u)); if (outpos == size) { return u; } @@ -7800,7 +7803,7 @@ encode_code_page_errors(UINT code_page, PyObject **outbytes, else { Py_ssize_t i; enum PyUnicode_Kind kind; - void *data; + const void *data; if (PyUnicode_READY(rep) == -1) { Py_DECREF(rep); @@ -7958,7 +7961,7 @@ charmap_decode_string(const char *s, PyObject *errorHandler = NULL, *exc = NULL; Py_ssize_t maplen; enum PyUnicode_Kind mapkind; - void *mapdata; + const void *mapdata; Py_UCS4 x; unsigned char ch; @@ -7975,7 +7978,7 @@ charmap_decode_string(const char *s, /* fast-path for cp037, cp500 and iso8859_1 encodings. iso8859_1 * is disabled in encoding aliases, latin1 is preferred because * its implementation is faster. */ - Py_UCS1 *mapdata_ucs1 = (Py_UCS1 *)mapdata; + const Py_UCS1 *mapdata_ucs1 = (const Py_UCS1 *)mapdata; Py_UCS1 *outdata = (Py_UCS1 *)writer->data; Py_UCS4 maxchar = writer->maxchar; @@ -7999,7 +8002,7 @@ charmap_decode_string(const char *s, while (s < e) { if (mapkind == PyUnicode_2BYTE_KIND && maplen >= 256) { enum PyUnicode_Kind outkind = writer->kind; - Py_UCS2 *mapdata_ucs2 = (Py_UCS2 *)mapdata; + const Py_UCS2 *mapdata_ucs2 = (const Py_UCS2 *)mapdata; if (outkind == PyUnicode_1BYTE_KIND) { Py_UCS1 *outdata = (Py_UCS1 *)writer->data; Py_UCS4 maxchar = writer->maxchar; @@ -8279,7 +8282,7 @@ PyUnicode_BuildEncodingMap(PyObject* string) unsigned char *mlevel1, *mlevel2, *mlevel3; int count2 = 0, count3 = 0; int kind; - void *data; + const void *data; Py_ssize_t length; Py_UCS4 ch; @@ -8543,7 +8546,7 @@ charmap_encoding_error( Py_ssize_t size, repsize; Py_ssize_t newpos; enum PyUnicode_Kind kind; - void *data; + const void *data; Py_ssize_t index; /* startpos for collecting unencodable chars */ Py_ssize_t collstartpos = *inpos; @@ -8693,7 +8696,7 @@ _PyUnicode_EncodeCharmap(PyObject *unicode, PyObject *error_handler_obj = NULL; PyObject *exc = NULL; _Py_error_handler error_handler = _Py_ERROR_UNKNOWN; - void *data; + const void *data; int kind; if (PyUnicode_READY(unicode) == -1) @@ -9025,7 +9028,8 @@ unicode_fast_translate(PyObject *input, PyObject *mapping, { Py_UCS1 ascii_table[128], ch, ch2; Py_ssize_t len; - Py_UCS1 *in, *end, *out; + const Py_UCS1 *in, *end; + Py_UCS1 *out; int res = 0; len = PyUnicode_GET_LENGTH(input); @@ -9074,7 +9078,7 @@ _PyUnicode_TranslateCharmap(PyObject *input, const char *errors) { /* input object */ - char *data; + const void *data; Py_ssize_t size, i; int kind; /* output buffer */ @@ -9093,7 +9097,7 @@ _PyUnicode_TranslateCharmap(PyObject *input, if (PyUnicode_READY(input) == -1) return NULL; - data = (char*)PyUnicode_DATA(input); + data = PyUnicode_DATA(input); kind = PyUnicode_KIND(input); size = PyUnicode_GET_LENGTH(input); @@ -9271,7 +9275,7 @@ PyUnicode_TransformDecimalToASCII(Py_UNICODE *s, Py_ssize_t i; Py_UCS4 maxchar; enum PyUnicode_Kind kind; - void *data; + const void *data; maxchar = 127; for (i = 0; i < length; i++) { @@ -9313,7 +9317,7 @@ PyUnicode_EncodeDecimal(Py_UNICODE *s, PyObject *unicode; Py_ssize_t i; enum PyUnicode_Kind kind; - void *data; + const void *data; if (output == NULL) { PyErr_BadArgument(); @@ -9391,7 +9395,7 @@ any_find_slice(PyObject* s1, PyObject* s2, int direction) { int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2, result; kind1 = PyUnicode_KIND(s1); @@ -9460,8 +9464,9 @@ any_find_slice(PyObject* s1, PyObject* s2, } } + assert((kind2 != kind1) == (buf2 != PyUnicode_DATA(s2))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return result; } @@ -9620,7 +9625,7 @@ PyUnicode_Count(PyObject *str, { Py_ssize_t result; int kind1, kind2; - void *buf1 = NULL, *buf2 = NULL; + const void *buf1 = NULL, *buf2 = NULL; Py_ssize_t len1, len2; if (ensure_unicode(str) < 0 || ensure_unicode(substr) < 0) @@ -9649,24 +9654,24 @@ PyUnicode_Count(PyObject *str, case PyUnicode_1BYTE_KIND: if (PyUnicode_IS_ASCII(str) && PyUnicode_IS_ASCII(substr)) result = asciilib_count( - ((Py_UCS1*)buf1) + start, end - start, + ((const Py_UCS1*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); else result = ucs1lib_count( - ((Py_UCS1*)buf1) + start, end - start, + ((const Py_UCS1*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); break; case PyUnicode_2BYTE_KIND: result = ucs2lib_count( - ((Py_UCS2*)buf1) + start, end - start, + ((const Py_UCS2*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); break; case PyUnicode_4BYTE_KIND: result = ucs4lib_count( - ((Py_UCS4*)buf1) + start, end - start, + ((const Py_UCS4*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); break; @@ -9674,13 +9679,15 @@ PyUnicode_Count(PyObject *str, Py_UNREACHABLE(); } + assert((kind2 != kind1) == (buf2 != PyUnicode_DATA(substr))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return result; onError: - if (kind2 != kind1 && buf2) - PyMem_Free(buf2); + assert((kind2 != kind1) == (buf2 != PyUnicode_DATA(substr))); + if (kind2 != kind1) + PyMem_Free((void *)buf2); return -1; } @@ -9728,8 +9735,8 @@ tailmatch(PyObject *self, { int kind_self; int kind_sub; - void *data_self; - void *data_sub; + const void *data_self; + const void *data_sub; Py_ssize_t offset; Py_ssize_t i; Py_ssize_t end_sub; @@ -9803,7 +9810,8 @@ static PyObject * ascii_upper_or_lower(PyObject *self, int lower) { Py_ssize_t len = PyUnicode_GET_LENGTH(self); - char *resdata, *data = PyUnicode_DATA(self); + const char *data = PyUnicode_DATA(self); + char *resdata; PyObject *res; res = PyUnicode_New(len, 127); @@ -9818,7 +9826,7 @@ ascii_upper_or_lower(PyObject *self, int lower) } static Py_UCS4 -handle_capital_sigma(int kind, void *data, Py_ssize_t length, Py_ssize_t i) +handle_capital_sigma(int kind, const void *data, Py_ssize_t length, Py_ssize_t i) { Py_ssize_t j; int final_sigma; @@ -9847,7 +9855,7 @@ handle_capital_sigma(int kind, void *data, Py_ssize_t length, Py_ssize_t i) } static int -lower_ucs4(int kind, void *data, Py_ssize_t length, Py_ssize_t i, +lower_ucs4(int kind, const void *data, Py_ssize_t length, Py_ssize_t i, Py_UCS4 c, Py_UCS4 *mapped) { /* Obscure special case. */ @@ -9859,7 +9867,7 @@ lower_ucs4(int kind, void *data, Py_ssize_t length, Py_ssize_t i, } static Py_ssize_t -do_capitalize(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) +do_capitalize(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { Py_ssize_t i, k = 0; int n_res, j; @@ -9883,7 +9891,7 @@ do_capitalize(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *ma } static Py_ssize_t -do_swapcase(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { +do_swapcase(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { Py_ssize_t i, k = 0; for (i = 0; i < length; i++) { @@ -9908,7 +9916,7 @@ do_swapcase(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxc } static Py_ssize_t -do_upper_or_lower(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, +do_upper_or_lower(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar, int lower) { Py_ssize_t i, k = 0; @@ -9929,19 +9937,19 @@ do_upper_or_lower(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, } static Py_ssize_t -do_upper(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) +do_upper(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { return do_upper_or_lower(kind, data, length, res, maxchar, 0); } static Py_ssize_t -do_lower(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) +do_lower(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { return do_upper_or_lower(kind, data, length, res, maxchar, 1); } static Py_ssize_t -do_casefold(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) +do_casefold(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { Py_ssize_t i, k = 0; @@ -9958,7 +9966,7 @@ do_casefold(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxc } static Py_ssize_t -do_title(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) +do_title(int kind, const void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar) { Py_ssize_t i, k = 0; int previous_is_cased; @@ -9986,12 +9994,13 @@ do_title(int kind, void *data, Py_ssize_t length, Py_UCS4 *res, Py_UCS4 *maxchar static PyObject * case_operation(PyObject *self, - Py_ssize_t (*perform)(int, void *, Py_ssize_t, Py_UCS4 *, Py_UCS4 *)) + Py_ssize_t (*perform)(int, const void *, Py_ssize_t, Py_UCS4 *, Py_UCS4 *)) { PyObject *res = NULL; Py_ssize_t length, newlength = 0; int kind, outkind; - void *data, *outdata; + const void *data; + void *outdata; Py_UCS4 maxchar = 0, *tmp, *tmpend; assert(PyUnicode_IS_READY(self)); @@ -10358,7 +10367,7 @@ split(PyObject *self, Py_ssize_t maxcount) { int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2; PyObject* out; @@ -10438,8 +10447,9 @@ split(PyObject *self, default: out = NULL; } + assert((kind2 != kind1) == (buf2 != PyUnicode_DATA(substring))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return out; } @@ -10449,7 +10459,7 @@ rsplit(PyObject *self, Py_ssize_t maxcount) { int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2; PyObject* out; @@ -10529,14 +10539,15 @@ rsplit(PyObject *self, default: out = NULL; } + assert((kind2 != kind1) == (buf2 != PyUnicode_DATA(substring))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return out; } static Py_ssize_t -anylib_find(int kind, PyObject *str1, void *buf1, Py_ssize_t len1, - PyObject *str2, void *buf2, Py_ssize_t len2, Py_ssize_t offset) +anylib_find(int kind, PyObject *str1, const void *buf1, Py_ssize_t len1, + PyObject *str2, const void *buf2, Py_ssize_t len2, Py_ssize_t offset) { switch (kind) { case PyUnicode_1BYTE_KIND: @@ -10553,8 +10564,8 @@ anylib_find(int kind, PyObject *str1, void *buf1, Py_ssize_t len1, } static Py_ssize_t -anylib_count(int kind, PyObject *sstr, void* sbuf, Py_ssize_t slen, - PyObject *str1, void *buf1, Py_ssize_t len1, Py_ssize_t maxcount) +anylib_count(int kind, PyObject *sstr, const void* sbuf, Py_ssize_t slen, + PyObject *str1, const void *buf1, Py_ssize_t len1, Py_ssize_t maxcount) { switch (kind) { case PyUnicode_1BYTE_KIND: @@ -10600,9 +10611,9 @@ replace(PyObject *self, PyObject *str1, PyObject *str2, Py_ssize_t maxcount) { PyObject *u; - char *sbuf = PyUnicode_DATA(self); - char *buf1 = PyUnicode_DATA(str1); - char *buf2 = PyUnicode_DATA(str2); + const char *sbuf = PyUnicode_DATA(self); + const void *buf1 = PyUnicode_DATA(str1); + const void *buf2 = PyUnicode_DATA(str2); int srelease = 0, release1 = 0, release2 = 0; int skind = PyUnicode_KIND(self); int kind1 = PyUnicode_KIND(str1); @@ -10680,7 +10691,8 @@ replace(PyObject *self, PyObject *str1, /* widen self and buf1 */ rkind = kind2; if (release1) { - PyMem_Free(buf1); + assert(buf1 != PyUnicode_DATA(str1)); + PyMem_Free((void *)buf1); buf1 = PyUnicode_DATA(str1); release1 = 0; } @@ -10745,7 +10757,8 @@ replace(PyObject *self, PyObject *str1, if (!sbuf) goto error; srelease = 1; if (release1) { - PyMem_Free(buf1); + assert(buf1 != PyUnicode_DATA(str1)); + PyMem_Free((void *)buf1); buf1 = PyUnicode_DATA(str1); release1 = 0; } @@ -10837,32 +10850,41 @@ replace(PyObject *self, PyObject *str1, } done: + assert(srelease == (sbuf != PyUnicode_DATA(self))); + assert(release1 == (buf1 != PyUnicode_DATA(str1))); + assert(release2 == (buf2 != PyUnicode_DATA(str2))); if (srelease) - PyMem_FREE(sbuf); + PyMem_FREE((void *)sbuf); if (release1) - PyMem_FREE(buf1); + PyMem_FREE((void *)buf1); if (release2) - PyMem_FREE(buf2); + PyMem_FREE((void *)buf2); assert(_PyUnicode_CheckConsistency(u, 1)); return u; nothing: /* nothing to replace; return original string (when possible) */ + assert(srelease == (sbuf != PyUnicode_DATA(self))); + assert(release1 == (buf1 != PyUnicode_DATA(str1))); + assert(release2 == (buf2 != PyUnicode_DATA(str2))); if (srelease) - PyMem_FREE(sbuf); + PyMem_FREE((void *)sbuf); if (release1) - PyMem_FREE(buf1); + PyMem_FREE((void *)buf1); if (release2) - PyMem_FREE(buf2); + PyMem_FREE((void *)buf2); return unicode_result_unchanged(self); error: - if (srelease && sbuf) - PyMem_FREE(sbuf); - if (release1 && buf1) - PyMem_FREE(buf1); - if (release2 && buf2) - PyMem_FREE(buf2); + assert(srelease == (sbuf != PyUnicode_DATA(self))); + assert(release1 == (buf1 != PyUnicode_DATA(str1))); + assert(release2 == (buf2 != PyUnicode_DATA(str2))); + if (srelease) + PyMem_FREE((void *)sbuf); + if (release1) + PyMem_FREE((void *)buf1); + if (release2) + PyMem_FREE((void *)buf2); return NULL; } @@ -10999,7 +11021,7 @@ unicode_compare(PyObject *str1, PyObject *str2) while (0) int kind1, kind2; - void *data1, *data2; + const void *data1, *data2; Py_ssize_t len1, len2, len; kind1 = PyUnicode_KIND(str1); @@ -11100,7 +11122,7 @@ static int unicode_compare_eq(PyObject *str1, PyObject *str2) { int kind; - void *data1, *data2; + const void *data1, *data2; Py_ssize_t len; int cmp; @@ -11185,7 +11207,7 @@ PyUnicode_CompareWithASCIIString(PyObject* uni, const char* str) return 0; } else { - void *data = PyUnicode_DATA(uni); + const void *data = PyUnicode_DATA(uni); /* Compare Unicode string and source character set string */ for (i = 0; (chr = PyUnicode_READ(kind, data, i)) && str[i]; i++) if (chr != (unsigned char)str[i]) @@ -11334,7 +11356,7 @@ int PyUnicode_Contains(PyObject *str, PyObject *substr) { int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2; int result; @@ -11384,8 +11406,9 @@ PyUnicode_Contains(PyObject *str, PyObject *substr) Py_UNREACHABLE(); } + assert((kind2 == kind1) == (buf2 == PyUnicode_DATA(substr))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return result; } @@ -11562,7 +11585,7 @@ unicode_count(PyObject *self, PyObject *args) Py_ssize_t end = PY_SSIZE_T_MAX; PyObject *result; int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2, iresult; if (!parse_args_finds_unicode("count", args, &substring, &start, &end)) @@ -11589,19 +11612,19 @@ unicode_count(PyObject *self, PyObject *args) switch (kind1) { case PyUnicode_1BYTE_KIND: iresult = ucs1lib_count( - ((Py_UCS1*)buf1) + start, end - start, + ((const Py_UCS1*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); break; case PyUnicode_2BYTE_KIND: iresult = ucs2lib_count( - ((Py_UCS2*)buf1) + start, end - start, + ((const Py_UCS2*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); break; case PyUnicode_4BYTE_KIND: iresult = ucs4lib_count( - ((Py_UCS4*)buf1) + start, end - start, + ((const Py_UCS4*)buf1) + start, end - start, buf2, len2, PY_SSIZE_T_MAX ); break; @@ -11611,8 +11634,9 @@ unicode_count(PyObject *self, PyObject *args) result = PyLong_FromSsize_t(iresult); + assert((kind2 == kind1) == (buf2 == PyUnicode_DATA(substring))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return result; } @@ -11656,7 +11680,8 @@ unicode_expandtabs_impl(PyObject *self, int tabsize) Py_ssize_t i, j, line_pos, src_len, incr; Py_UCS4 ch; PyObject *u; - void *src_data, *dest_data; + const void *src_data; + void *dest_data; int kind; int found; @@ -11762,7 +11787,7 @@ unicode_find(PyObject *self, PyObject *args) static PyObject * unicode_getitem(PyObject *self, Py_ssize_t index) { - void *data; + const void *data; enum PyUnicode_Kind kind; Py_UCS4 ch; @@ -11875,7 +11900,7 @@ unicode_islower_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; int cased; if (PyUnicode_READY(self) == -1) @@ -11920,7 +11945,7 @@ unicode_isupper_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; int cased; if (PyUnicode_READY(self) == -1) @@ -11965,7 +11990,7 @@ unicode_istitle_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; int cased, previous_is_cased; if (PyUnicode_READY(self) == -1) @@ -12023,7 +12048,7 @@ unicode_isspace_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; if (PyUnicode_READY(self) == -1) return NULL; @@ -12063,7 +12088,7 @@ unicode_isalpha_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; if (PyUnicode_READY(self) == -1) return NULL; @@ -12101,7 +12126,7 @@ unicode_isalnum_impl(PyObject *self) /*[clinic end generated code: output=a5a23490ffc3660c input=5c6579bf2e04758c]*/ { int kind; - void *data; + const void *data; Py_ssize_t len, i; if (PyUnicode_READY(self) == -1) @@ -12144,7 +12169,7 @@ unicode_isdecimal_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; if (PyUnicode_READY(self) == -1) return NULL; @@ -12183,7 +12208,7 @@ unicode_isdigit_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; if (PyUnicode_READY(self) == -1) return NULL; @@ -12223,7 +12248,7 @@ unicode_isnumeric_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; if (PyUnicode_READY(self) == -1) return NULL; @@ -12260,7 +12285,7 @@ PyUnicode_IsIdentifier(PyObject *self) } int kind = 0; - void *data = NULL; + const void *data = NULL; const wchar_t *wstr = NULL; Py_UCS4 ch; if (ready) { @@ -12329,7 +12354,7 @@ unicode_isprintable_impl(PyObject *self) { Py_ssize_t i, length; int kind; - void *data; + const void *data; if (PyUnicode_READY(self) == -1) return NULL; @@ -12434,7 +12459,7 @@ static const char *stripfuncnames[] = {"lstrip", "rstrip", "strip"}; PyObject * _PyUnicode_XStrip(PyObject *self, int striptype, PyObject *sepobj) { - void *data; + const void *data; int kind; Py_ssize_t i, j, len; BLOOM_MASK sepmask; @@ -12484,7 +12509,7 @@ _PyUnicode_XStrip(PyObject *self, int striptype, PyObject *sepobj) PyObject* PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end) { - unsigned char *data; + const unsigned char *data; int kind; Py_ssize_t length; @@ -12507,7 +12532,7 @@ PyUnicode_Substring(PyObject *self, Py_ssize_t start, Py_ssize_t end) length = end - start; if (PyUnicode_IS_ASCII(self)) { data = PyUnicode_1BYTE_DATA(self); - return _PyUnicode_FromASCII((char*)(data + start), length); + return _PyUnicode_FromASCII((const char*)(data + start), length); } else { kind = PyUnicode_KIND(self); @@ -12529,7 +12554,7 @@ do_strip(PyObject *self, int striptype) len = PyUnicode_GET_LENGTH(self); if (PyUnicode_IS_ASCII(self)) { - Py_UCS1 *data = PyUnicode_1BYTE_DATA(self); + const Py_UCS1 *data = PyUnicode_1BYTE_DATA(self); i = 0; if (striptype != RIGHTSTRIP) { @@ -12555,7 +12580,7 @@ do_strip(PyObject *self, int striptype) } else { int kind = PyUnicode_KIND(self); - void *data = PyUnicode_DATA(self); + const void *data = PyUnicode_DATA(self); i = 0; if (striptype != RIGHTSTRIP) { @@ -12688,8 +12713,8 @@ unicode_repeat(PyObject *str, Py_ssize_t len) assert(PyUnicode_KIND(u) == PyUnicode_KIND(str)); if (PyUnicode_GET_LENGTH(str) == 1) { - const int kind = PyUnicode_KIND(str); - const Py_UCS4 fill_char = PyUnicode_READ(kind, PyUnicode_DATA(str), 0); + int kind = PyUnicode_KIND(str); + Py_UCS4 fill_char = PyUnicode_READ(kind, PyUnicode_DATA(str), 0); if (kind == PyUnicode_1BYTE_KIND) { void *to = PyUnicode_DATA(u); memset(to, (unsigned char)fill_char, len); @@ -12708,7 +12733,7 @@ unicode_repeat(PyObject *str, Py_ssize_t len) else { /* number of characters copied this far */ Py_ssize_t done = PyUnicode_GET_LENGTH(str); - const Py_ssize_t char_size = PyUnicode_KIND(str); + Py_ssize_t char_size = PyUnicode_KIND(str); char *to = (char *) PyUnicode_DATA(u); memcpy(to, PyUnicode_DATA(str), PyUnicode_GET_LENGTH(str) * char_size); @@ -12769,7 +12794,8 @@ unicode_repr(PyObject *unicode) Py_ssize_t osize, squote, dquote, i, o; Py_UCS4 max, quote; int ikind, okind, unchanged; - void *idata, *odata; + const void *idata; + void *odata; if (PyUnicode_READY(unicode) == -1) return NULL; @@ -13062,7 +13088,7 @@ PyUnicode_Partition(PyObject *str_obj, PyObject *sep_obj) { PyObject* out; int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2; if (ensure_unicode(str_obj) < 0 || ensure_unicode(sep_obj) < 0) @@ -13107,8 +13133,9 @@ PyUnicode_Partition(PyObject *str_obj, PyObject *sep_obj) Py_UNREACHABLE(); } + assert((kind2 == kind1) == (buf2 == PyUnicode_DATA(sep_obj))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return out; } @@ -13119,7 +13146,7 @@ PyUnicode_RPartition(PyObject *str_obj, PyObject *sep_obj) { PyObject* out; int kind1, kind2; - void *buf1, *buf2; + const void *buf1, *buf2; Py_ssize_t len1, len2; if (ensure_unicode(str_obj) < 0 || ensure_unicode(sep_obj) < 0) @@ -13164,8 +13191,9 @@ PyUnicode_RPartition(PyObject *str_obj, PyObject *sep_obj) Py_UNREACHABLE(); } + assert((kind2 == kind1) == (buf2 == PyUnicode_DATA(sep_obj))); if (kind2 != kind1) - PyMem_Free(buf2); + PyMem_Free((void *)buf2); return out; } @@ -13321,7 +13349,7 @@ unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z) return NULL; if (y != NULL) { int x_kind, y_kind, z_kind; - void *x_data, *y_data, *z_data; + const void *x_data, *y_data, *z_data; /* x must be a string too, of equal length */ if (!PyUnicode_Check(x)) { @@ -13370,7 +13398,7 @@ unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z) } } else { int kind; - void *data; + const void *data; /* x must be a dict */ if (!PyDict_CheckExact(x)) { @@ -13471,7 +13499,7 @@ unicode_zfill_impl(PyObject *self, Py_ssize_t width) Py_ssize_t fill; PyObject *u; int kind; - void *data; + const void *data; Py_UCS4 chr; if (PyUnicode_READY(self) == -1) @@ -14144,7 +14172,8 @@ unicode_subscript(PyObject* self, PyObject* item) Py_ssize_t start, stop, step, slicelength, i; size_t cur; PyObject *result; - void *src_data, *dest_data; + const void *src_data; + void *dest_data; int src_kind, dest_kind; Py_UCS4 ch, max_char, kind_limit; @@ -14215,7 +14244,7 @@ struct unicode_formatter_t { enum PyUnicode_Kind fmtkind; Py_ssize_t fmtcnt, fmtpos; - void *fmtdata; + const void *fmtdata; PyObject *fmtstr; _PyUnicodeWriter writer; @@ -14889,7 +14918,7 @@ unicode_format_arg_output(struct unicode_formatter_t *ctx, { Py_ssize_t len; enum PyUnicode_Kind kind; - void *pbuf; + const void *pbuf; Py_ssize_t pindex; Py_UCS4 signchar; Py_ssize_t buflen; @@ -15556,7 +15585,7 @@ unicodeiter_next(unicodeiterobject *it) if (it->it_index < PyUnicode_GET_LENGTH(seq)) { int kind = PyUnicode_KIND(seq); - void *data = PyUnicode_DATA(seq); + const void *data = PyUnicode_DATA(seq); Py_UCS4 chr = PyUnicode_READ(kind, data, it->it_index); item = PyUnicode_FromOrdinal(chr); if (item != NULL) diff --git a/Python/_warnings.c b/Python/_warnings.c index fd3ca60e5da2f..e4dfb7391eaf1 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -435,7 +435,7 @@ normalize_module(PyObject *filename) { PyObject *module; int kind; - void *data; + const void *data; Py_ssize_t len; len = PyUnicode_GetLength(filename); @@ -519,7 +519,7 @@ show_warning(PyObject *filename, int lineno, PyObject *text, /* Print " source_line\n" */ if (sourceline) { int kind; - void *data; + const void *data; Py_ssize_t i, len; Py_UCS4 ch; PyObject *truncated; diff --git a/Python/ast.c b/Python/ast.c index 0f23f6762d8c1..1a4a3110e6955 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -4588,7 +4588,7 @@ decode_unicode_with_escapes(struct compiling *c, const node *n, const char *s, if (*s & 0x80) { /* XXX inefficient */ PyObject *w; int kind; - void *data; + const void *data; Py_ssize_t len, i; w = decode_utf8(c, &s, end); if (w == NULL) { diff --git a/Python/codecs.c b/Python/codecs.c index bbbf774780abb..7b35ded2edcd5 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -701,8 +701,7 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeEncodeError)) { PyObject *res; - int kind; - void *data; + Py_UCS1 *outp; if (PyUnicodeEncodeError_GetStart(exc, &start)) return NULL; if (PyUnicodeEncodeError_GetEnd(exc, &end)) @@ -711,10 +710,10 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) res = PyUnicode_New(len, '?'); if (res == NULL) return NULL; - kind = PyUnicode_KIND(res); - data = PyUnicode_DATA(res); + assert(PyUnicode_KIND(res) == PyUnicode_1BYTE_KIND); + outp = PyUnicode_1BYTE_DATA(res); for (i = 0; i < len; ++i) - PyUnicode_WRITE(kind, data, i, '?'); + outp[i] = '?'; assert(_PyUnicode_CheckConsistency(res, 1)); return Py_BuildValue("(Nn)", res, end); } @@ -727,8 +726,7 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) } else if (PyObject_TypeCheck(exc, (PyTypeObject *)PyExc_UnicodeTranslateError)) { PyObject *res; - int kind; - void *data; + Py_UCS2 *outp; if (PyUnicodeTranslateError_GetStart(exc, &start)) return NULL; if (PyUnicodeTranslateError_GetEnd(exc, &end)) @@ -737,10 +735,10 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc) res = PyUnicode_New(len, Py_UNICODE_REPLACEMENT_CHARACTER); if (res == NULL) return NULL; - kind = PyUnicode_KIND(res); - data = PyUnicode_DATA(res); - for (i=0; i < len; i++) - PyUnicode_WRITE(kind, data, i, Py_UNICODE_REPLACEMENT_CHARACTER); + assert(PyUnicode_KIND(res) == PyUnicode_2BYTE_KIND); + outp = PyUnicode_2BYTE_DATA(res); + for (i = 0; i < len; i++) + outp[i] = Py_UNICODE_REPLACEMENT_CHARACTER; assert(_PyUnicode_CheckConsistency(res, 1)); return Py_BuildValue("(Nn)", res, end); } @@ -759,7 +757,7 @@ PyObject *PyCodec_XMLCharRefReplaceErrors(PyObject *exc) Py_ssize_t start; Py_ssize_t end; PyObject *res; - unsigned char *outp; + Py_UCS1 *outp; Py_ssize_t ressize; Py_UCS4 ch; if (PyUnicodeEncodeError_GetStart(exc, &start)) @@ -855,7 +853,7 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc) Py_ssize_t start; Py_ssize_t end; PyObject *res; - unsigned char *outp; + Py_UCS1 *outp; int ressize; Py_UCS4 c; @@ -966,7 +964,7 @@ PyObject *PyCodec_NameReplaceErrors(PyObject *exc) Py_ssize_t start; Py_ssize_t end; PyObject *res; - unsigned char *outp; + Py_UCS1 *outp; Py_ssize_t ressize; int replsize; Py_UCS4 c; diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c index 841b25a43fce3..74638ca223772 100644 --- a/Python/formatter_unicode.c +++ b/Python/formatter_unicode.c @@ -62,7 +62,7 @@ get_integer(PyObject *str, Py_ssize_t *ppos, Py_ssize_t end, Py_ssize_t accumulator, digitval, pos = *ppos; int numdigits; int kind = PyUnicode_KIND(str); - void *data = PyUnicode_DATA(str); + const void *data = PyUnicode_DATA(str); accumulator = numdigits = 0; for (; pos < end; pos++, numdigits++) { @@ -170,7 +170,7 @@ parse_internal_render_format_spec(PyObject *format_spec, { Py_ssize_t pos = start; int kind = PyUnicode_KIND(format_spec); - void *data = PyUnicode_DATA(format_spec); + const void *data = PyUnicode_DATA(format_spec); /* end-pos is used throughout this code to specify the length of the input string */ #define READ_spec(index) PyUnicode_READ(kind, data, index) @@ -443,7 +443,7 @@ parse_number(PyObject *s, Py_ssize_t pos, Py_ssize_t end, { Py_ssize_t remainder; int kind = PyUnicode_KIND(s); - void *data = PyUnicode_DATA(s); + const void *data = PyUnicode_DATA(s); while (pos https://github.com/python/cpython/commit/4b222c9491d1700e9bdd98e6889b8d0ea1c7321e commit: 4b222c9491d1700e9bdd98e6889b8d0ea1c7321e branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-11T10:59:24+03:00 summary: bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) Patcher's __exit__() is now never called if its __enter__() is failed. Returning true from __exit__() silences now the exception. files: A Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst M Lib/unittest/mock.py M Lib/unittest/test/testmock/testpatch.py diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 20daf724c1218..c0178f1164707 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1241,11 +1241,6 @@ def _importer(target): return thing -def _is_started(patcher): - # XXXX horrible - return hasattr(patcher, 'is_local') - - class _patch(object): attribute_name = None @@ -1316,14 +1311,9 @@ def decorate_class(self, klass): @contextlib.contextmanager def decoration_helper(self, patched, args, keywargs): extra_args = [] - entered_patchers = [] - patching = None - - exc_info = tuple() - try: + with contextlib.ExitStack() as exit_stack: for patching in patched.patchings: - arg = patching.__enter__() - entered_patchers.append(patching) + arg = exit_stack.enter_context(patching) if patching.attribute_name is not None: keywargs.update(arg) elif patching.new is DEFAULT: @@ -1331,19 +1321,6 @@ def decoration_helper(self, patched, args, keywargs): args += tuple(extra_args) yield (args, keywargs) - except: - if (patching not in entered_patchers and - _is_started(patching)): - # the patcher may have been started, but an exception - # raised whilst entering one of its additional_patchers - entered_patchers.append(patching) - # Pass the exception to __exit__ - exc_info = sys.exc_info() - # re-raise the exception - raise - finally: - for patching in reversed(entered_patchers): - patching.__exit__(*exc_info) def decorate_callable(self, func): @@ -1520,25 +1497,26 @@ def __enter__(self): self.temp_original = original self.is_local = local - setattr(self.target, self.attribute, new_attr) - if self.attribute_name is not None: - extra_args = {} - if self.new is DEFAULT: - extra_args[self.attribute_name] = new - for patching in self.additional_patchers: - arg = patching.__enter__() - if patching.new is DEFAULT: - extra_args.update(arg) - return extra_args - - return new - + self._exit_stack = contextlib.ExitStack() + try: + setattr(self.target, self.attribute, new_attr) + if self.attribute_name is not None: + extra_args = {} + if self.new is DEFAULT: + extra_args[self.attribute_name] = new + for patching in self.additional_patchers: + arg = self._exit_stack.enter_context(patching) + if patching.new is DEFAULT: + extra_args.update(arg) + return extra_args + + return new + except: + if not self.__exit__(*sys.exc_info()): + raise def __exit__(self, *exc_info): """Undo the patch.""" - if not _is_started(self): - return - if self.is_local and self.temp_original is not DEFAULT: setattr(self.target, self.attribute, self.temp_original) else: @@ -1553,9 +1531,9 @@ def __exit__(self, *exc_info): del self.temp_original del self.is_local del self.target - for patcher in reversed(self.additional_patchers): - if _is_started(patcher): - patcher.__exit__(*exc_info) + exit_stack = self._exit_stack + del self._exit_stack + return exit_stack.__exit__(*exc_info) def start(self): @@ -1571,9 +1549,9 @@ def stop(self): self._active_patches.remove(self) except ValueError: # If the patch hasn't been started this will fail - pass + return None - return self.__exit__() + return self.__exit__(None, None, None) @@ -1873,9 +1851,9 @@ def stop(self): _patch._active_patches.remove(self) except ValueError: # If the patch hasn't been started this will fail - pass + return None - return self.__exit__() + return self.__exit__(None, None, None) def _clear_dict(in_dict): diff --git a/Lib/unittest/test/testmock/testpatch.py b/Lib/unittest/test/testmock/testpatch.py index f1bc0e1cd40a2..d8c1515f8346c 100644 --- a/Lib/unittest/test/testmock/testpatch.py +++ b/Lib/unittest/test/testmock/testpatch.py @@ -774,7 +774,7 @@ def test_patch_dict_stop_without_start(self): d = {'foo': 'bar'} original = d.copy() patcher = patch.dict(d, [('spam', 'eggs')], clear=True) - self.assertEqual(patcher.stop(), False) + self.assertFalse(patcher.stop()) self.assertEqual(d, original) diff --git a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst new file mode 100644 index 0000000000000..8f725cfba86e2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst @@ -0,0 +1,3 @@ +Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` +is now never called if its ``__enter__()`` is failed. Returning true from +``__exit__()`` silences now the exception. From webhook-mailer at python.org Sat Apr 11 16:36:20 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sat, 11 Apr 2020 20:36:20 -0000 Subject: [Python-checkins] closes bpo-39953: Update OpenSSL error codes table. (GH-19082) Message-ID: https://github.com/python/cpython/commit/3e0dd3730b5eff7e9ae6fb921aa77cd26efc9e3a commit: 3e0dd3730b5eff7e9ae6fb921aa77cd26efc9e3a branch: master author: Benjamin Peterson committer: GitHub date: 2020-04-11T15:36:12-05:00 summary: closes bpo-39953: Update OpenSSL error codes table. (GH-19082) I updated the error codes using the OpenSSL 1.1.1f source tree. files: A Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst M Modules/_ssl_data.h M Tools/ssl/make_ssl_data.py diff --git a/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst b/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst new file mode 100644 index 0000000000000..3fea7c87ea885 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst @@ -0,0 +1 @@ +Update internal table of OpenSSL error codes in the ``ssl`` module. diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h index 85165b90bc389..f01c019c45b19 100644 --- a/Modules/_ssl_data.h +++ b/Modules/_ssl_data.h @@ -1,1789 +1,6087 @@ /* File generated by Tools/ssl/make_ssl_data.py */ -/* Generated on 2015-01-17T20:33:43.377453 */ +/* Generated on 2020-04-11T14:59:43.709585 */ static struct py_ssl_library_code library_codes[] = { + {"ASN1", ERR_LIB_ASN1}, + {"ASYNC", ERR_LIB_ASYNC}, + {"BIO", ERR_LIB_BIO}, + {"BN", ERR_LIB_BN}, + {"CMS", ERR_LIB_CMS}, + {"COMP", ERR_LIB_COMP}, + {"CONF", ERR_LIB_CONF}, + {"CRYPTO", ERR_LIB_CRYPTO}, + {"CT", ERR_LIB_CT}, + {"DH", ERR_LIB_DH}, + {"DSA", ERR_LIB_DSA}, + {"EC", ERR_LIB_EC}, + {"ENGINE", ERR_LIB_ENGINE}, + {"EVP", ERR_LIB_EVP}, + {"KDF", ERR_LIB_KDF}, + {"OCSP", ERR_LIB_OCSP}, {"PEM", ERR_LIB_PEM}, + {"PKCS12", ERR_LIB_PKCS12}, + {"PKCS7", ERR_LIB_PKCS7}, + {"RAND", ERR_LIB_RAND}, + {"RSA", ERR_LIB_RSA}, {"SSL", ERR_LIB_SSL}, + {"TS", ERR_LIB_TS}, + {"UI", ERR_LIB_UI}, {"X509", ERR_LIB_X509}, + {"X509V3", ERR_LIB_X509V3}, { NULL } }; static struct py_ssl_error_code error_codes[] = { - #ifdef PEM_R_BAD_BASE64_DECODE - {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, + #ifdef ASN1_R_ADDING_OBJECT + {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT}, #else - {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100}, + {"ADDING_OBJECT", ERR_LIB_ASN1, 171}, #endif - #ifdef PEM_R_BAD_DECRYPT - {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, + #ifdef ASN1_R_ASN1_PARSE_ERROR + {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR}, #else - {"BAD_DECRYPT", ERR_LIB_PEM, 101}, + {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, 203}, #endif - #ifdef PEM_R_BAD_END_LINE - {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, + #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR + {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR}, #else - {"BAD_END_LINE", ERR_LIB_PEM, 102}, + {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, 204}, #endif - #ifdef PEM_R_BAD_IV_CHARS - {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, + #ifdef ASN1_R_AUX_ERROR + {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR}, #else - {"BAD_IV_CHARS", ERR_LIB_PEM, 103}, + {"AUX_ERROR", ERR_LIB_ASN1, 100}, #endif - #ifdef PEM_R_BAD_MAGIC_NUMBER - {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, + #ifdef ASN1_R_BAD_OBJECT_HEADER + {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER}, #else - {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116}, + {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, 102}, #endif - #ifdef PEM_R_BAD_PASSWORD_READ - {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, + #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH + {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH}, #else - {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104}, + {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 214}, #endif - #ifdef PEM_R_BAD_VERSION_NUMBER - {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, + #ifdef ASN1_R_BN_LIB + {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB}, #else - {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117}, + {"BN_LIB", ERR_LIB_ASN1, 105}, #endif - #ifdef PEM_R_BIO_WRITE_FAILURE - {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, + #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH + {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH}, #else - {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118}, + {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, 106}, #endif - #ifdef PEM_R_CIPHER_IS_NULL - {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, + #ifdef ASN1_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL}, #else - {"CIPHER_IS_NULL", ERR_LIB_PEM, 127}, + {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, 107}, #endif - #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY - {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, + #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, #else - {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115}, + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, 108}, #endif - #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB - {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, + #ifdef ASN1_R_CONTEXT_NOT_INITIALISED + {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED}, #else - {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119}, + {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, 217}, #endif - #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB - {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, + #ifdef ASN1_R_DATA_IS_WRONG + {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG}, #else - {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120}, + {"DATA_IS_WRONG", ERR_LIB_ASN1, 109}, #endif - #ifdef PEM_R_INCONSISTENT_HEADER - {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, + #ifdef ASN1_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR}, #else - {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121}, + {"DECODE_ERROR", ERR_LIB_ASN1, 110}, #endif - #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR - {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, + #ifdef ASN1_R_DEPTH_EXCEEDED + {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED}, #else - {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122}, + {"DEPTH_EXCEEDED", ERR_LIB_ASN1, 174}, #endif - #ifdef PEM_R_KEYBLOB_TOO_SHORT - {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, + #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED}, #else - {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123}, + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, 198}, #endif - #ifdef PEM_R_NOT_DEK_INFO - {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, + #ifdef ASN1_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR}, #else - {"NOT_DEK_INFO", ERR_LIB_PEM, 105}, + {"ENCODE_ERROR", ERR_LIB_ASN1, 112}, #endif - #ifdef PEM_R_NOT_ENCRYPTED - {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, + #ifdef ASN1_R_ERROR_GETTING_TIME + {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME}, #else - {"NOT_ENCRYPTED", ERR_LIB_PEM, 106}, + {"ERROR_GETTING_TIME", ERR_LIB_ASN1, 173}, #endif - #ifdef PEM_R_NOT_PROC_TYPE - {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, + #ifdef ASN1_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION}, #else - {"NOT_PROC_TYPE", ERR_LIB_PEM, 107}, + {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, 172}, #endif - #ifdef PEM_R_NO_START_LINE - {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, + #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS + {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS}, #else - {"NO_START_LINE", ERR_LIB_PEM, 108}, + {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, 114}, #endif - #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD - {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, + #ifdef ASN1_R_EXPECTING_AN_INTEGER + {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER}, #else - {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109}, + {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, 115}, #endif - #ifdef PEM_R_PUBLIC_KEY_NO_RSA - {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA}, + #ifdef ASN1_R_EXPECTING_AN_OBJECT + {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT}, #else - {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110}, + {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, 116}, #endif - #ifdef PEM_R_PVK_DATA_TOO_SHORT - {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, + #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH + {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH}, #else - {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124}, + {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, 119}, #endif - #ifdef PEM_R_PVK_TOO_SHORT - {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, + #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED + {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED}, #else - {"PVK_TOO_SHORT", ERR_LIB_PEM, 125}, + {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, 120}, #endif - #ifdef PEM_R_READ_KEY - {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, + #ifdef ASN1_R_FIELD_MISSING + {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING}, #else - {"READ_KEY", ERR_LIB_PEM, 111}, + {"FIELD_MISSING", ERR_LIB_ASN1, 121}, #endif - #ifdef PEM_R_SHORT_HEADER - {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, + #ifdef ASN1_R_FIRST_NUM_TOO_LARGE + {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE}, #else - {"SHORT_HEADER", ERR_LIB_PEM, 112}, + {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, 122}, #endif - #ifdef PEM_R_UNSUPPORTED_CIPHER - {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, + #ifdef ASN1_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113}, + {"HEADER_TOO_LONG", ERR_LIB_ASN1, 123}, #endif - #ifdef PEM_R_UNSUPPORTED_ENCRYPTION - {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, + #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT + {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT}, #else - {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114}, + {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, 175}, #endif - #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS - {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, + #ifdef ASN1_R_ILLEGAL_BOOLEAN + {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN}, #else - {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126}, + {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, 176}, #endif - #ifdef SSL_R_APP_DATA_IN_HANDSHAKE - {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, + #ifdef ASN1_R_ILLEGAL_CHARACTERS + {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS}, #else - {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100}, + {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, 124}, #endif - #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT - {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, + #ifdef ASN1_R_ILLEGAL_FORMAT + {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT}, #else - {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272}, + {"ILLEGAL_FORMAT", ERR_LIB_ASN1, 177}, #endif - #ifdef SSL_R_BAD_ALERT_RECORD - {"BAD_ALERT_RECORD", ERR_LIB_SSL, SSL_R_BAD_ALERT_RECORD}, + #ifdef ASN1_R_ILLEGAL_HEX + {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX}, #else - {"BAD_ALERT_RECORD", ERR_LIB_SSL, 101}, + {"ILLEGAL_HEX", ERR_LIB_ASN1, 178}, #endif - #ifdef SSL_R_BAD_AUTHENTICATION_TYPE - {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, SSL_R_BAD_AUTHENTICATION_TYPE}, + #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG + {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG}, #else - {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, 102}, + {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, 179}, #endif - #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC - {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, + #ifdef ASN1_R_ILLEGAL_INTEGER + {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER}, #else - {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103}, + {"ILLEGAL_INTEGER", ERR_LIB_ASN1, 180}, #endif - #ifdef SSL_R_BAD_CHECKSUM - {"BAD_CHECKSUM", ERR_LIB_SSL, SSL_R_BAD_CHECKSUM}, + #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE + {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE}, #else - {"BAD_CHECKSUM", ERR_LIB_SSL, 104}, + {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, 226}, #endif - #ifdef SSL_R_BAD_DATA - {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, + #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING + {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING}, #else - {"BAD_DATA", ERR_LIB_SSL, 390}, + {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, 181}, #endif - #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK - {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, + #ifdef ASN1_R_ILLEGAL_NULL + {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL}, #else - {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106}, + {"ILLEGAL_NULL", ERR_LIB_ASN1, 125}, #endif - #ifdef SSL_R_BAD_DECOMPRESSION - {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, + #ifdef ASN1_R_ILLEGAL_NULL_VALUE + {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE}, #else - {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107}, + {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, 182}, #endif - #ifdef SSL_R_BAD_DH_G_LENGTH - {"BAD_DH_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_G_LENGTH}, + #ifdef ASN1_R_ILLEGAL_OBJECT + {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT}, #else - {"BAD_DH_G_LENGTH", ERR_LIB_SSL, 108}, + {"ILLEGAL_OBJECT", ERR_LIB_ASN1, 183}, #endif - #ifdef SSL_R_BAD_DH_PUB_KEY_LENGTH - {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_PUB_KEY_LENGTH}, + #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY + {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY}, #else - {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, 109}, + {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, 126}, #endif - #ifdef SSL_R_BAD_DH_P_LENGTH - {"BAD_DH_P_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_P_LENGTH}, + #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE}, #else - {"BAD_DH_P_LENGTH", ERR_LIB_SSL, 110}, + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, 170}, #endif - #ifdef SSL_R_BAD_DIGEST_LENGTH - {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, + #ifdef ASN1_R_ILLEGAL_PADDING + {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING}, #else - {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111}, + {"ILLEGAL_PADDING", ERR_LIB_ASN1, 221}, #endif - #ifdef SSL_R_BAD_DSA_SIGNATURE - {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_DSA_SIGNATURE}, + #ifdef ASN1_R_ILLEGAL_TAGGED_ANY + {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY}, #else - {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, 112}, + {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, 127}, #endif - #ifdef SSL_R_BAD_ECC_CERT - {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, + #ifdef ASN1_R_ILLEGAL_TIME_VALUE + {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE}, #else - {"BAD_ECC_CERT", ERR_LIB_SSL, 304}, + {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, 184}, #endif - #ifdef SSL_R_BAD_ECDSA_SIGNATURE - {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE}, + #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT + {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT}, #else - {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305}, + {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, 222}, #endif - #ifdef SSL_R_BAD_ECPOINT - {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, + #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT + {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT}, #else - {"BAD_ECPOINT", ERR_LIB_SSL, 306}, + {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 185}, #endif - #ifdef SSL_R_BAD_HANDSHAKE_LENGTH - {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, + #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG + {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG}, #else - {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332}, + {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, 128}, #endif - #ifdef SSL_R_BAD_HELLO_REQUEST - {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, + #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT + {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT}, #else - {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105}, + {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, 220}, #endif - #ifdef SSL_R_BAD_LENGTH - {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, + #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH + {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH}, #else - {"BAD_LENGTH", ERR_LIB_SSL, 271}, + {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, 129}, #endif - #ifdef SSL_R_BAD_MAC_DECODE - {"BAD_MAC_DECODE", ERR_LIB_SSL, SSL_R_BAD_MAC_DECODE}, + #ifdef ASN1_R_INVALID_DIGIT + {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT}, #else - {"BAD_MAC_DECODE", ERR_LIB_SSL, 113}, + {"INVALID_DIGIT", ERR_LIB_ASN1, 130}, #endif - #ifdef SSL_R_BAD_MAC_LENGTH - {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH}, + #ifdef ASN1_R_INVALID_MIME_TYPE + {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE}, #else - {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333}, + {"INVALID_MIME_TYPE", ERR_LIB_ASN1, 205}, #endif - #ifdef SSL_R_BAD_MESSAGE_TYPE - {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_BAD_MESSAGE_TYPE}, + #ifdef ASN1_R_INVALID_MODIFIER + {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER}, #else - {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, 114}, + {"INVALID_MODIFIER", ERR_LIB_ASN1, 186}, #endif - #ifdef SSL_R_BAD_PACKET_LENGTH - {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, + #ifdef ASN1_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER}, #else - {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115}, + {"INVALID_NUMBER", ERR_LIB_ASN1, 187}, #endif - #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER - {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, + #ifdef ASN1_R_INVALID_OBJECT_ENCODING + {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING}, #else - {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116}, + {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, 216}, #endif - #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH - {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH}, + #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS + {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS}, #else - {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316}, + {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, 227}, #endif - #ifdef SSL_R_BAD_RESPONSE_ARGUMENT - {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, SSL_R_BAD_RESPONSE_ARGUMENT}, + #ifdef ASN1_R_INVALID_SEPARATOR + {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR}, #else - {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, 117}, + {"INVALID_SEPARATOR", ERR_LIB_ASN1, 131}, #endif - #ifdef SSL_R_BAD_RSA_DECRYPT - {"BAD_RSA_DECRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_DECRYPT}, + #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE + {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE}, #else - {"BAD_RSA_DECRYPT", ERR_LIB_SSL, 118}, + {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, 218}, #endif - #ifdef SSL_R_BAD_RSA_ENCRYPT - {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, + #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH + {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH}, #else - {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119}, + {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, 133}, #endif - #ifdef SSL_R_BAD_RSA_E_LENGTH - {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_E_LENGTH}, + #ifdef ASN1_R_INVALID_UTF8STRING + {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING}, #else - {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, 120}, + {"INVALID_UTF8STRING", ERR_LIB_ASN1, 134}, #endif - #ifdef SSL_R_BAD_RSA_MODULUS_LENGTH - {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_MODULUS_LENGTH}, + #ifdef ASN1_R_INVALID_VALUE + {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE}, #else - {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, 121}, + {"INVALID_VALUE", ERR_LIB_ASN1, 219}, #endif - #ifdef SSL_R_BAD_RSA_SIGNATURE - {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_RSA_SIGNATURE}, + #ifdef ASN1_R_LIST_ERROR + {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR}, #else - {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, 122}, + {"LIST_ERROR", ERR_LIB_ASN1, 188}, #endif - #ifdef SSL_R_BAD_SIGNATURE - {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, + #ifdef ASN1_R_MIME_NO_CONTENT_TYPE + {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE}, #else - {"BAD_SIGNATURE", ERR_LIB_SSL, 123}, + {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, 206}, #endif - #ifdef SSL_R_BAD_SRP_A_LENGTH - {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, + #ifdef ASN1_R_MIME_PARSE_ERROR + {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR}, #else - {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347}, + {"MIME_PARSE_ERROR", ERR_LIB_ASN1, 207}, #endif - #ifdef SSL_R_BAD_SRP_B_LENGTH - {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH}, + #ifdef ASN1_R_MIME_SIG_PARSE_ERROR + {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR}, #else - {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348}, + {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, 208}, #endif - #ifdef SSL_R_BAD_SRP_G_LENGTH - {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH}, + #ifdef ASN1_R_MISSING_EOC + {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC}, #else - {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349}, + {"MISSING_EOC", ERR_LIB_ASN1, 137}, #endif - #ifdef SSL_R_BAD_SRP_N_LENGTH - {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH}, + #ifdef ASN1_R_MISSING_SECOND_NUMBER + {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER}, #else - {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350}, + {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, 138}, #endif - #ifdef SSL_R_BAD_SRP_PARAMETERS - {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, + #ifdef ASN1_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE}, #else - {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371}, + {"MISSING_VALUE", ERR_LIB_ASN1, 189}, #endif - #ifdef SSL_R_BAD_SRP_S_LENGTH - {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH}, + #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL + {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL}, #else - {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351}, + {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, 139}, #endif - #ifdef SSL_R_BAD_SRTP_MKI_VALUE - {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, + #ifdef ASN1_R_MSTRING_WRONG_TAG + {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG}, #else - {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352}, + {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, 140}, #endif - #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST - {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, + #ifdef ASN1_R_NESTED_ASN1_STRING + {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING}, #else - {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353}, + {"NESTED_ASN1_STRING", ERR_LIB_ASN1, 197}, #endif - #ifdef SSL_R_BAD_SSL_FILETYPE - {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, + #ifdef ASN1_R_NESTED_TOO_DEEP + {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP}, #else - {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124}, + {"NESTED_TOO_DEEP", ERR_LIB_ASN1, 201}, #endif - #ifdef SSL_R_BAD_SSL_SESSION_ID_LENGTH - {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SSL_SESSION_ID_LENGTH}, + #ifdef ASN1_R_NON_HEX_CHARACTERS + {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS}, #else - {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, 125}, + {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, 141}, #endif - #ifdef SSL_R_BAD_STATE - {"BAD_STATE", ERR_LIB_SSL, SSL_R_BAD_STATE}, + #ifdef ASN1_R_NOT_ASCII_FORMAT + {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT}, #else - {"BAD_STATE", ERR_LIB_SSL, 126}, + {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, 190}, #endif - #ifdef SSL_R_BAD_VALUE - {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, + #ifdef ASN1_R_NOT_ENOUGH_DATA + {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA}, #else - {"BAD_VALUE", ERR_LIB_SSL, 384}, + {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, 142}, #endif - #ifdef SSL_R_BAD_WRITE_RETRY - {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, + #ifdef ASN1_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE}, #else - {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127}, + {"NO_CONTENT_TYPE", ERR_LIB_ASN1, 209}, #endif - #ifdef SSL_R_BIO_NOT_SET - {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, + #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE + {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE}, #else - {"BIO_NOT_SET", ERR_LIB_SSL, 128}, + {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, 143}, #endif - #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG - {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, + #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE + {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE}, #else - {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129}, + {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, 210}, #endif - #ifdef SSL_R_BN_LIB - {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, + #ifdef ASN1_R_NO_MULTIPART_BOUNDARY + {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY}, #else - {"BN_LIB", ERR_LIB_SSL, 130}, + {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, 211}, #endif - #ifdef SSL_R_CA_DN_LENGTH_MISMATCH - {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, + #ifdef ASN1_R_NO_SIG_CONTENT_TYPE + {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE}, #else - {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131}, + {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, 212}, #endif - #ifdef SSL_R_CA_DN_TOO_LONG - {"CA_DN_TOO_LONG", ERR_LIB_SSL, SSL_R_CA_DN_TOO_LONG}, + #ifdef ASN1_R_NULL_IS_WRONG_LENGTH + {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH}, #else - {"CA_DN_TOO_LONG", ERR_LIB_SSL, 132}, + {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, 144}, #endif - #ifdef SSL_R_CA_KEY_TOO_SMALL - {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, + #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT + {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT}, #else - {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397}, + {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 191}, #endif - #ifdef SSL_R_CA_MD_TOO_WEAK - {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, + #ifdef ASN1_R_ODD_NUMBER_OF_CHARS + {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS}, #else - {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398}, + {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, 145}, #endif - #ifdef SSL_R_CCS_RECEIVED_EARLY - {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, + #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE + {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE}, #else - {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133}, + {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, 147}, #endif - #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED - {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, + #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH + {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH}, #else - {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134}, + {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, 148}, #endif - #ifdef SSL_R_CERT_CB_ERROR - {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, + #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED + {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED}, #else - {"CERT_CB_ERROR", ERR_LIB_SSL, 377}, + {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 149}, #endif - #ifdef SSL_R_CERT_LENGTH_MISMATCH - {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, + #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG + {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG}, #else - {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135}, + {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, 192}, #endif - #ifdef SSL_R_CHALLENGE_IS_DIFFERENT - {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CHALLENGE_IS_DIFFERENT}, + #ifdef ASN1_R_SHORT_LINE + {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE}, #else - {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, 136}, + {"SHORT_LINE", ERR_LIB_ASN1, 150}, #endif - #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH - {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, + #ifdef ASN1_R_SIG_INVALID_MIME_TYPE + {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE}, #else - {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137}, + {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, 213}, #endif - #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE - {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, + #ifdef ASN1_R_STREAMING_NOT_SUPPORTED + {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED}, #else - {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138}, + {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, 202}, #endif - #ifdef SSL_R_CIPHER_TABLE_SRC_ERROR - {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, SSL_R_CIPHER_TABLE_SRC_ERROR}, + #ifdef ASN1_R_STRING_TOO_LONG + {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG}, #else - {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, 139}, + {"STRING_TOO_LONG", ERR_LIB_ASN1, 151}, #endif - #ifdef SSL_R_CLIENTHELLO_TLSEXT - {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, + #ifdef ASN1_R_STRING_TOO_SHORT + {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT}, #else - {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226}, + {"STRING_TOO_SHORT", ERR_LIB_ASN1, 152}, #endif - #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG - {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, + #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, #else - {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140}, + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, 154}, #endif - #ifdef SSL_R_COMPRESSION_DISABLED - {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, + #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT + {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT}, #else - {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343}, + {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 193}, #endif - #ifdef SSL_R_COMPRESSION_FAILURE - {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, + #ifdef ASN1_R_TOO_LARGE + {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE}, #else - {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141}, + {"TOO_LARGE", ERR_LIB_ASN1, 223}, #endif - #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE - {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, + #ifdef ASN1_R_TOO_LONG + {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG}, #else - {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307}, + {"TOO_LONG", ERR_LIB_ASN1, 155}, #endif - #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR - {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, + #ifdef ASN1_R_TOO_SMALL + {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL}, #else - {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142}, + {"TOO_SMALL", ERR_LIB_ASN1, 224}, #endif - #ifdef SSL_R_CONNECTION_ID_IS_DIFFERENT - {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CONNECTION_ID_IS_DIFFERENT}, + #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED + {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED}, #else - {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, 143}, + {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 156}, #endif - #ifdef SSL_R_CONNECTION_TYPE_NOT_SET - {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, + #ifdef ASN1_R_TYPE_NOT_PRIMITIVE + {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE}, #else - {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144}, + {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, 195}, #endif - #ifdef SSL_R_COOKIE_MISMATCH - {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, + #ifdef ASN1_R_UNEXPECTED_EOC + {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC}, #else - {"COOKIE_MISMATCH", ERR_LIB_SSL, 308}, + {"UNEXPECTED_EOC", ERR_LIB_ASN1, 159}, #endif - #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED - {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, + #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH + {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH}, #else - {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145}, + {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 215}, #endif - #ifdef SSL_R_DATA_LENGTH_TOO_LONG - {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, + #ifdef ASN1_R_UNKNOWN_FORMAT + {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT}, #else - {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146}, + {"UNKNOWN_FORMAT", ERR_LIB_ASN1, 160}, #endif - #ifdef SSL_R_DECRYPTION_FAILED - {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, + #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM}, #else - {"DECRYPTION_FAILED", ERR_LIB_SSL, 147}, + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, 161}, #endif - #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC - {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, + #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE + {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE}, #else - {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281}, + {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, 162}, #endif - #ifdef SSL_R_DH_KEY_TOO_SMALL - {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, + #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE + {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE}, #else - {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394}, + {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 163}, #endif - #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG - {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, + #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM + {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM}, #else - {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148}, + {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, 199}, #endif - #ifdef SSL_R_DIGEST_CHECK_FAILED - {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, + #ifdef ASN1_R_UNKNOWN_TAG + {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG}, #else - {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149}, + {"UNKNOWN_TAG", ERR_LIB_ASN1, 194}, #endif - #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG - {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, + #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE}, #else - {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334}, + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, 164}, #endif - #ifdef SSL_R_DUPLICATE_COMPRESSION_ID - {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, + #ifdef ASN1_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER}, #else - {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309}, + {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, 228}, #endif - #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT - {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT}, + #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, #else - {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317}, + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 167}, #endif - #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING - {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, + #ifdef ASN1_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE}, #else - {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318}, + {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, 196}, #endif - #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE - {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE}, + #ifdef ASN1_R_WRONG_INTEGER_TYPE + {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE}, #else - {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322}, + {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, 225}, #endif - #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE - {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE}, + #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE + {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE}, #else - {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323}, + {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 200}, #endif - #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE - {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, + #ifdef ASN1_R_WRONG_TAG + {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG}, #else - {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374}, + {"WRONG_TAG", ERR_LIB_ASN1, 168}, #endif - #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER - {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER}, + #ifdef ASYNC_R_FAILED_TO_SET_POOL + {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL}, #else - {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310}, + {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101}, #endif - #ifdef SSL_R_EE_KEY_TOO_SMALL - {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, + #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT + {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT}, #else - {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399}, + {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, 102}, #endif - #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST - {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, + #ifdef ASYNC_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED}, #else - {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354}, + {"INIT_FAILED", ERR_LIB_ASYNC, 105}, #endif - #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG - {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, + #ifdef ASYNC_R_INVALID_POOL_SIZE + {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE}, #else - {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150}, + {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, 103}, #endif - #ifdef SSL_R_ERROR_GENERATING_TMP_RSA_KEY - {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_ERROR_GENERATING_TMP_RSA_KEY}, + #ifdef BIO_R_ACCEPT_ERROR + {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR}, #else - {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, 282}, + {"ACCEPT_ERROR", ERR_LIB_BIO, 100}, #endif - #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST - {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, + #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET + {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET}, #else - {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151}, + {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 141}, #endif - #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE - {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, + #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE + {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE}, #else - {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152}, + {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, 129}, #endif - #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE - {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, + #ifdef BIO_R_BAD_FOPEN_MODE + {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE}, #else - {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153}, + {"BAD_FOPEN_MODE", ERR_LIB_BIO, 101}, #endif - #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS - {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, + #ifdef BIO_R_BROKEN_PIPE + {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE}, #else - {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154}, + {"BROKEN_PIPE", ERR_LIB_BIO, 124}, #endif - #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS - {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS}, + #ifdef BIO_R_CONNECT_ERROR + {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR}, #else - {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355}, + {"CONNECT_ERROR", ERR_LIB_BIO, 103}, #endif - #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION - {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION}, + #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET}, #else - {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356}, + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 107}, #endif - #ifdef SSL_R_HTTPS_PROXY_REQUEST - {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, + #ifdef BIO_R_GETSOCKNAME_ERROR + {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR}, #else - {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155}, + {"GETSOCKNAME_ERROR", ERR_LIB_BIO, 132}, #endif - #ifdef SSL_R_HTTP_REQUEST - {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, + #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS + {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS}, #else - {"HTTP_REQUEST", ERR_LIB_SSL, 156}, + {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, 133}, #endif - #ifdef SSL_R_ILLEGAL_PADDING - {"ILLEGAL_PADDING", ERR_LIB_SSL, SSL_R_ILLEGAL_PADDING}, + #ifdef BIO_R_GETTING_SOCKTYPE + {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE}, #else - {"ILLEGAL_PADDING", ERR_LIB_SSL, 283}, + {"GETTING_SOCKTYPE", ERR_LIB_BIO, 134}, #endif - #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST - {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, + #ifdef BIO_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT}, #else - {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380}, + {"INVALID_ARGUMENT", ERR_LIB_BIO, 125}, #endif - #ifdef SSL_R_INAPPROPRIATE_FALLBACK - {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, + #ifdef BIO_R_INVALID_SOCKET + {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET}, #else - {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373}, + {"INVALID_SOCKET", ERR_LIB_BIO, 135}, #endif - #ifdef SSL_R_INCONSISTENT_COMPRESSION - {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, + #ifdef BIO_R_IN_USE + {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE}, #else - {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340}, + {"IN_USE", ERR_LIB_BIO, 123}, #endif - #ifdef SSL_R_INVALID_CHALLENGE_LENGTH - {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_CHALLENGE_LENGTH}, + #ifdef BIO_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG}, #else - {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, 158}, + {"LENGTH_TOO_LONG", ERR_LIB_BIO, 102}, #endif - #ifdef SSL_R_INVALID_COMMAND - {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, + #ifdef BIO_R_LISTEN_V6_ONLY + {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY}, #else - {"INVALID_COMMAND", ERR_LIB_SSL, 280}, + {"LISTEN_V6_ONLY", ERR_LIB_BIO, 136}, #endif - #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM - {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, + #ifdef BIO_R_LOOKUP_RETURNED_NOTHING + {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING}, #else - {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341}, + {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, 142}, #endif - #ifdef SSL_R_INVALID_NULL_CMD_NAME - {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, + #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE + {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE}, #else - {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385}, + {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, 130}, #endif - #ifdef SSL_R_INVALID_PURPOSE - {"INVALID_PURPOSE", ERR_LIB_SSL, SSL_R_INVALID_PURPOSE}, + #ifdef BIO_R_NBIO_CONNECT_ERROR + {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR}, #else - {"INVALID_PURPOSE", ERR_LIB_SSL, 278}, + {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, 110}, #endif - #ifdef SSL_R_INVALID_SERVERINFO_DATA - {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, + #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED}, #else - {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388}, + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 143}, #endif - #ifdef SSL_R_INVALID_SRP_USERNAME - {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, + #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED}, #else - {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357}, + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 144}, #endif - #ifdef SSL_R_INVALID_STATUS_RESPONSE - {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, + #ifdef BIO_R_NO_PORT_DEFINED + {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED}, #else - {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328}, + {"NO_PORT_DEFINED", ERR_LIB_BIO, 113}, #endif - #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH - {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, + #ifdef BIO_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE}, #else - {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325}, + {"NO_SUCH_FILE", ERR_LIB_BIO, 128}, #endif - #ifdef SSL_R_INVALID_TRUST - {"INVALID_TRUST", ERR_LIB_SSL, SSL_R_INVALID_TRUST}, + #ifdef BIO_R_NULL_PARAMETER + {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER}, #else - {"INVALID_TRUST", ERR_LIB_SSL, 279}, + {"NULL_PARAMETER", ERR_LIB_BIO, 115}, #endif - #ifdef SSL_R_KEY_ARG_TOO_LONG - {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, SSL_R_KEY_ARG_TOO_LONG}, + #ifdef BIO_R_UNABLE_TO_BIND_SOCKET + {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET}, #else - {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, 284}, + {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, 117}, #endif - #ifdef SSL_R_KRB5 - {"KRB5", ERR_LIB_SSL, SSL_R_KRB5}, + #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET + {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET}, #else - {"KRB5", ERR_LIB_SSL, 285}, + {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, 118}, #endif - #ifdef SSL_R_KRB5_C_CC_PRINC - {"KRB5_C_CC_PRINC", ERR_LIB_SSL, SSL_R_KRB5_C_CC_PRINC}, + #ifdef BIO_R_UNABLE_TO_KEEPALIVE + {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE}, #else - {"KRB5_C_CC_PRINC", ERR_LIB_SSL, 286}, + {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, 137}, #endif - #ifdef SSL_R_KRB5_C_GET_CRED - {"KRB5_C_GET_CRED", ERR_LIB_SSL, SSL_R_KRB5_C_GET_CRED}, + #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET + {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET}, #else - {"KRB5_C_GET_CRED", ERR_LIB_SSL, 287}, + {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, 119}, #endif - #ifdef SSL_R_KRB5_C_INIT - {"KRB5_C_INIT", ERR_LIB_SSL, SSL_R_KRB5_C_INIT}, + #ifdef BIO_R_UNABLE_TO_NODELAY + {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY}, #else - {"KRB5_C_INIT", ERR_LIB_SSL, 288}, + {"UNABLE_TO_NODELAY", ERR_LIB_BIO, 138}, #endif - #ifdef SSL_R_KRB5_C_MK_REQ - {"KRB5_C_MK_REQ", ERR_LIB_SSL, SSL_R_KRB5_C_MK_REQ}, + #ifdef BIO_R_UNABLE_TO_REUSEADDR + {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR}, #else - {"KRB5_C_MK_REQ", ERR_LIB_SSL, 289}, + {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, 139}, #endif - #ifdef SSL_R_KRB5_S_BAD_TICKET - {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, SSL_R_KRB5_S_BAD_TICKET}, + #ifdef BIO_R_UNAVAILABLE_IP_FAMILY + {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY}, #else - {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, 290}, + {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, 145}, #endif - #ifdef SSL_R_KRB5_S_INIT - {"KRB5_S_INIT", ERR_LIB_SSL, SSL_R_KRB5_S_INIT}, + #ifdef BIO_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED}, #else - {"KRB5_S_INIT", ERR_LIB_SSL, 291}, + {"UNINITIALIZED", ERR_LIB_BIO, 120}, #endif - #ifdef SSL_R_KRB5_S_RD_REQ - {"KRB5_S_RD_REQ", ERR_LIB_SSL, SSL_R_KRB5_S_RD_REQ}, + #ifdef BIO_R_UNKNOWN_INFO_TYPE + {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE}, #else - {"KRB5_S_RD_REQ", ERR_LIB_SSL, 292}, + {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, 140}, #endif - #ifdef SSL_R_KRB5_S_TKT_EXPIRED - {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_EXPIRED}, + #ifdef BIO_R_UNSUPPORTED_IP_FAMILY + {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY}, #else - {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, 293}, + {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, 146}, #endif - #ifdef SSL_R_KRB5_S_TKT_NYV - {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV}, + #ifdef BIO_R_UNSUPPORTED_METHOD + {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD}, #else - {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294}, + {"UNSUPPORTED_METHOD", ERR_LIB_BIO, 121}, #endif - #ifdef SSL_R_KRB5_S_TKT_SKEW - {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW}, + #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY + {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY}, #else - {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295}, + {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, 131}, #endif - #ifdef SSL_R_LENGTH_MISMATCH - {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, + #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO + {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO}, #else - {"LENGTH_MISMATCH", ERR_LIB_SSL, 159}, + {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, 126}, #endif - #ifdef SSL_R_LENGTH_TOO_SHORT - {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, + #ifdef BIO_R_WSASTARTUP + {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP}, #else - {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160}, + {"WSASTARTUP", ERR_LIB_BIO, 122}, #endif - #ifdef SSL_R_LIBRARY_BUG - {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, + #ifdef BN_R_ARG2_LT_ARG3 + {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3}, #else - {"LIBRARY_BUG", ERR_LIB_SSL, 274}, + {"ARG2_LT_ARG3", ERR_LIB_BN, 100}, #endif - #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS - {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, + #ifdef BN_R_BAD_RECIPROCAL + {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL}, #else - {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161}, + {"BAD_RECIPROCAL", ERR_LIB_BN, 101}, #endif - #ifdef SSL_R_MESSAGE_TOO_LONG - {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG}, + #ifdef BN_R_BIGNUM_TOO_LONG + {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG}, #else - {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296}, + {"BIGNUM_TOO_LONG", ERR_LIB_BN, 114}, #endif - #ifdef SSL_R_MISSING_DH_DSA_CERT - {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_DSA_CERT}, + #ifdef BN_R_BITS_TOO_SMALL + {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL}, #else - {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, 162}, + {"BITS_TOO_SMALL", ERR_LIB_BN, 118}, #endif - #ifdef SSL_R_MISSING_DH_KEY - {"MISSING_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_DH_KEY}, + #ifdef BN_R_CALLED_WITH_EVEN_MODULUS + {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS}, #else - {"MISSING_DH_KEY", ERR_LIB_SSL, 163}, + {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, 102}, #endif - #ifdef SSL_R_MISSING_DH_RSA_CERT - {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_RSA_CERT}, + #ifdef BN_R_DIV_BY_ZERO + {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO}, #else - {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, 164}, + {"DIV_BY_ZERO", ERR_LIB_BN, 103}, #endif - #ifdef SSL_R_MISSING_DSA_SIGNING_CERT - {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, + #ifdef BN_R_ENCODING_ERROR + {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR}, #else - {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165}, + {"ENCODING_ERROR", ERR_LIB_BN, 104}, #endif - #ifdef SSL_R_MISSING_ECDH_CERT - {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT}, + #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA + {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA}, #else - {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382}, + {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, 105}, #endif - #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT - {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, + #ifdef BN_R_INPUT_NOT_REDUCED + {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED}, #else - {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381}, + {"INPUT_NOT_REDUCED", ERR_LIB_BN, 110}, #endif - #ifdef SSL_R_MISSING_EXPORT_TMP_DH_KEY - {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_DH_KEY}, + #ifdef BN_R_INVALID_LENGTH + {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH}, #else - {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, 166}, + {"INVALID_LENGTH", ERR_LIB_BN, 106}, #endif - #ifdef SSL_R_MISSING_EXPORT_TMP_RSA_KEY - {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_RSA_KEY}, + #ifdef BN_R_INVALID_RANGE + {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE}, #else - {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, 167}, + {"INVALID_RANGE", ERR_LIB_BN, 115}, #endif - #ifdef SSL_R_MISSING_RSA_CERTIFICATE - {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, + #ifdef BN_R_INVALID_SHIFT + {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT}, #else - {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168}, + {"INVALID_SHIFT", ERR_LIB_BN, 119}, #endif - #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT - {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, + #ifdef BN_R_NOT_A_SQUARE + {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE}, #else - {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169}, + {"NOT_A_SQUARE", ERR_LIB_BN, 111}, #endif - #ifdef SSL_R_MISSING_RSA_SIGNING_CERT - {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, + #ifdef BN_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED}, #else - {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170}, + {"NOT_INITIALIZED", ERR_LIB_BN, 107}, #endif - #ifdef SSL_R_MISSING_SRP_PARAM - {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, + #ifdef BN_R_NO_INVERSE + {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE}, #else - {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358}, + {"NO_INVERSE", ERR_LIB_BN, 108}, #endif - #ifdef SSL_R_MISSING_TMP_DH_KEY - {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, + #ifdef BN_R_NO_SOLUTION + {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION}, #else - {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171}, + {"NO_SOLUTION", ERR_LIB_BN, 116}, #endif - #ifdef SSL_R_MISSING_TMP_ECDH_KEY - {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, + #ifdef BN_R_PRIVATE_KEY_TOO_LARGE + {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE}, #else - {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311}, + {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, 117}, #endif - #ifdef SSL_R_MISSING_TMP_RSA_KEY - {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_KEY}, + #ifdef BN_R_P_IS_NOT_PRIME + {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME}, #else - {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, 172}, + {"P_IS_NOT_PRIME", ERR_LIB_BN, 112}, #endif - #ifdef SSL_R_MISSING_TMP_RSA_PKEY - {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_PKEY}, + #ifdef BN_R_TOO_MANY_ITERATIONS + {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS}, #else - {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, 173}, + {"TOO_MANY_ITERATIONS", ERR_LIB_BN, 113}, #endif - #ifdef SSL_R_MISSING_VERIFY_MESSAGE - {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, SSL_R_MISSING_VERIFY_MESSAGE}, + #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES + {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES}, #else - {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, 174}, + {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, 109}, #endif - #ifdef SSL_R_MULTIPLE_SGC_RESTARTS - {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS}, + #ifdef CMS_R_ADD_SIGNER_ERROR + {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR}, #else - {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346}, + {"ADD_SIGNER_ERROR", ERR_LIB_CMS, 99}, #endif - #ifdef SSL_R_NON_SSLV2_INITIAL_PACKET - {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, SSL_R_NON_SSLV2_INITIAL_PACKET}, + #ifdef CMS_R_ATTRIBUTE_ERROR + {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR}, #else - {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, 175}, + {"ATTRIBUTE_ERROR", ERR_LIB_CMS, 161}, #endif - #ifdef SSL_R_NO_CERTIFICATES_RETURNED - {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, + #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT + {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT}, #else - {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176}, + {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, 175}, #endif - #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED - {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, + #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID + {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID}, #else - {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177}, + {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, 160}, #endif - #ifdef SSL_R_NO_CERTIFICATE_RETURNED - {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_RETURNED}, + #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR}, #else - {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, 178}, + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, 100}, #endif - #ifdef SSL_R_NO_CERTIFICATE_SET - {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, + #ifdef CMS_R_CIPHER_INITIALISATION_ERROR + {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR}, #else - {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179}, + {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, 101}, #endif - #ifdef SSL_R_NO_CERTIFICATE_SPECIFIED - {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SPECIFIED}, + #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR + {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR}, #else - {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, 180}, + {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, 102}, #endif - #ifdef SSL_R_NO_CIPHERS_AVAILABLE - {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, + #ifdef CMS_R_CMS_DATAFINAL_ERROR + {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR}, #else - {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181}, + {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, 103}, #endif - #ifdef SSL_R_NO_CIPHERS_PASSED - {"NO_CIPHERS_PASSED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_PASSED}, + #ifdef CMS_R_CMS_LIB + {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB}, #else - {"NO_CIPHERS_PASSED", ERR_LIB_SSL, 182}, + {"CMS_LIB", ERR_LIB_CMS, 104}, #endif - #ifdef SSL_R_NO_CIPHERS_SPECIFIED - {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, + #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH + {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH}, #else - {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183}, + {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, 170}, #endif - #ifdef SSL_R_NO_CIPHER_LIST - {"NO_CIPHER_LIST", ERR_LIB_SSL, SSL_R_NO_CIPHER_LIST}, + #ifdef CMS_R_CONTENT_NOT_FOUND + {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND}, #else - {"NO_CIPHER_LIST", ERR_LIB_SSL, 184}, + {"CONTENT_NOT_FOUND", ERR_LIB_CMS, 105}, #endif - #ifdef SSL_R_NO_CIPHER_MATCH - {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, + #ifdef CMS_R_CONTENT_TYPE_MISMATCH + {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH}, #else - {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185}, + {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, 171}, #endif - #ifdef SSL_R_NO_CLIENT_CERT_METHOD - {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, + #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA}, #else - {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331}, + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 106}, #endif - #ifdef SSL_R_NO_CLIENT_CERT_RECEIVED - {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_RECEIVED}, + #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA}, #else - {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, 186}, + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 107}, #endif - #ifdef SSL_R_NO_COMPRESSION_SPECIFIED - {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, + #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA + {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA}, #else - {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187}, + {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, 108}, #endif - #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER - {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, + #ifdef CMS_R_CONTENT_VERIFY_ERROR + {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR}, #else - {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330}, + {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, 109}, #endif - #ifdef SSL_R_NO_METHOD_SPECIFIED - {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, + #ifdef CMS_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR}, #else - {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188}, + {"CTRL_ERROR", ERR_LIB_CMS, 110}, #endif - #ifdef SSL_R_NO_PEM_EXTENSIONS - {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, + #ifdef CMS_R_CTRL_FAILURE + {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE}, #else - {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389}, + {"CTRL_FAILURE", ERR_LIB_CMS, 111}, #endif - #ifdef SSL_R_NO_PRIVATEKEY - {"NO_PRIVATEKEY", ERR_LIB_SSL, SSL_R_NO_PRIVATEKEY}, + #ifdef CMS_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR}, #else - {"NO_PRIVATEKEY", ERR_LIB_SSL, 189}, + {"DECRYPT_ERROR", ERR_LIB_CMS, 112}, #endif - #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED - {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, + #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY + {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY}, #else - {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190}, + {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, 113}, #endif - #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE - {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, + #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE}, #else - {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191}, + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, 114}, #endif - #ifdef SSL_R_NO_PUBLICKEY - {"NO_PUBLICKEY", ERR_LIB_SSL, SSL_R_NO_PUBLICKEY}, + #ifdef CMS_R_ERROR_SETTING_KEY + {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY}, #else - {"NO_PUBLICKEY", ERR_LIB_SSL, 192}, + {"ERROR_SETTING_KEY", ERR_LIB_CMS, 115}, #endif - #ifdef SSL_R_NO_RENEGOTIATION - {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, + #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO + {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO}, #else - {"NO_RENEGOTIATION", ERR_LIB_SSL, 339}, + {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, 116}, #endif - #ifdef SSL_R_NO_REQUIRED_DIGEST - {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, + #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH + {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH}, #else - {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324}, + {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, 117}, #endif - #ifdef SSL_R_NO_SHARED_CIPHER - {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, + #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER + {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER}, #else - {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193}, + {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, 176}, #endif - #ifdef SSL_R_NO_SHARED_SIGATURE_ALGORITHMS - {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGATURE_ALGORITHMS}, + #ifdef CMS_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH}, #else - {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, 376}, + {"INVALID_KEY_LENGTH", ERR_LIB_CMS, 118}, #endif - #ifdef SSL_R_NO_SRTP_PROFILES - {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, + #ifdef CMS_R_MD_BIO_INIT_ERROR + {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR}, #else - {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359}, + {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, 119}, #endif - #ifdef SSL_R_NO_VERIFY_CALLBACK - {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_CALLBACK}, + #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH}, #else - {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, 194}, + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, 120}, #endif - #ifdef SSL_R_NULL_SSL_CTX - {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, + #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH + {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH}, #else - {"NULL_SSL_CTX", ERR_LIB_SSL, 195}, + {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 121}, #endif - #ifdef SSL_R_NULL_SSL_METHOD_PASSED - {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, + #ifdef CMS_R_MSGSIGDIGEST_ERROR + {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR}, #else - {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196}, + {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, 172}, #endif - #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED - {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, + #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE + {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE}, #else - {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197}, + {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, 162}, #endif - #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED - {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, + #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH + {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH}, #else - {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344}, + {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 163}, #endif - #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE - {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #ifdef CMS_R_NEED_ONE_SIGNER + {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER}, #else - {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387}, + {"NEED_ONE_SIGNER", ERR_LIB_CMS, 164}, #endif - #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE - {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #ifdef CMS_R_NOT_A_SIGNED_RECEIPT + {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT}, #else - {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379}, + {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, 165}, #endif - #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE - {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE}, + #ifdef CMS_R_NOT_ENCRYPTED_DATA + {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA}, #else - {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297}, + {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 122}, #endif - #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG - {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG}, + #ifdef CMS_R_NOT_KEK + {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK}, #else - {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327}, + {"NOT_KEK", ERR_LIB_CMS, 123}, #endif - #ifdef SSL_R_PACKET_LENGTH_TOO_LONG - {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, + #ifdef CMS_R_NOT_KEY_AGREEMENT + {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT}, #else - {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198}, + {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, 181}, #endif - #ifdef SSL_R_PARSE_TLSEXT - {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, + #ifdef CMS_R_NOT_KEY_TRANSPORT + {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT}, #else - {"PARSE_TLSEXT", ERR_LIB_SSL, 227}, + {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, 124}, #endif - #ifdef SSL_R_PATH_TOO_LONG - {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, + #ifdef CMS_R_NOT_PWRI + {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI}, #else - {"PATH_TOO_LONG", ERR_LIB_SSL, 270}, + {"NOT_PWRI", ERR_LIB_CMS, 177}, #endif - #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE - {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, + #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199}, + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, 125}, #endif - #ifdef SSL_R_PEER_ERROR - {"PEER_ERROR", ERR_LIB_SSL, SSL_R_PEER_ERROR}, + #ifdef CMS_R_NO_CIPHER + {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER}, #else - {"PEER_ERROR", ERR_LIB_SSL, 200}, + {"NO_CIPHER", ERR_LIB_CMS, 126}, #endif - #ifdef SSL_R_PEER_ERROR_CERTIFICATE - {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_CERTIFICATE}, + #ifdef CMS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT}, #else - {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, 201}, + {"NO_CONTENT", ERR_LIB_CMS, 127}, #endif - #ifdef SSL_R_PEER_ERROR_NO_CERTIFICATE - {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CERTIFICATE}, + #ifdef CMS_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE}, #else - {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, 202}, + {"NO_CONTENT_TYPE", ERR_LIB_CMS, 173}, #endif - #ifdef SSL_R_PEER_ERROR_NO_CIPHER - {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CIPHER}, + #ifdef CMS_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST}, #else - {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, 203}, + {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, 128}, #endif - #ifdef SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE - {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE}, + #ifdef CMS_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET}, #else - {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, 204}, + {"NO_DIGEST_SET", ERR_LIB_CMS, 129}, #endif - #ifdef SSL_R_PEM_NAME_BAD_PREFIX - {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, + #ifdef CMS_R_NO_KEY + {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY}, #else - {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391}, + {"NO_KEY", ERR_LIB_CMS, 130}, #endif - #ifdef SSL_R_PEM_NAME_TOO_SHORT - {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, + #ifdef CMS_R_NO_KEY_OR_CERT + {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT}, #else - {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392}, + {"NO_KEY_OR_CERT", ERR_LIB_CMS, 174}, #endif - #ifdef SSL_R_PRE_MAC_LENGTH_TOO_LONG - {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PRE_MAC_LENGTH_TOO_LONG}, + #ifdef CMS_R_NO_MATCHING_DIGEST + {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST}, #else - {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, 205}, + {"NO_MATCHING_DIGEST", ERR_LIB_CMS, 131}, #endif - #ifdef SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS - {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS}, + #ifdef CMS_R_NO_MATCHING_RECIPIENT + {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT}, #else - {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, 206}, + {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, 132}, #endif - #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN - {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, + #ifdef CMS_R_NO_MATCHING_SIGNATURE + {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE}, #else - {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207}, + {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, 166}, #endif - #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND - {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, + #ifdef CMS_R_NO_MSGSIGDIGEST + {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST}, #else - {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223}, + {"NO_MSGSIGDIGEST", ERR_LIB_CMS, 167}, #endif - #ifdef SSL_R_PSK_NO_CLIENT_CB - {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, + #ifdef CMS_R_NO_PASSWORD + {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD}, #else - {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224}, + {"NO_PASSWORD", ERR_LIB_CMS, 178}, #endif - #ifdef SSL_R_PSK_NO_SERVER_CB - {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, + #ifdef CMS_R_NO_PRIVATE_KEY + {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY}, #else - {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225}, + {"NO_PRIVATE_KEY", ERR_LIB_CMS, 133}, #endif - #ifdef SSL_R_PUBLIC_KEY_ENCRYPT_ERROR - {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_ENCRYPT_ERROR}, + #ifdef CMS_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY}, #else - {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, 208}, + {"NO_PUBLIC_KEY", ERR_LIB_CMS, 134}, #endif - #ifdef SSL_R_PUBLIC_KEY_IS_NOT_RSA - {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_IS_NOT_RSA}, + #ifdef CMS_R_NO_RECEIPT_REQUEST + {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST}, #else - {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, 209}, + {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, 168}, #endif - #ifdef SSL_R_PUBLIC_KEY_NOT_RSA - {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_NOT_RSA}, + #ifdef CMS_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS}, #else - {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, 210}, + {"NO_SIGNERS", ERR_LIB_CMS, 135}, #endif - #ifdef SSL_R_READ_BIO_NOT_SET - {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, + #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, 136}, #endif - #ifdef SSL_R_READ_TIMEOUT_EXPIRED - {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, + #ifdef CMS_R_RECEIPT_DECODE_ERROR + {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR}, #else - {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312}, + {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, 169}, #endif - #ifdef SSL_R_READ_WRONG_PACKET_TYPE - {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, SSL_R_READ_WRONG_PACKET_TYPE}, + #ifdef CMS_R_RECIPIENT_ERROR + {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR}, #else - {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, 212}, + {"RECIPIENT_ERROR", ERR_LIB_CMS, 137}, #endif - #ifdef SSL_R_RECORD_LENGTH_MISMATCH - {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, + #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213}, + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, 138}, #endif - #ifdef SSL_R_RECORD_TOO_LARGE - {"RECORD_TOO_LARGE", ERR_LIB_SSL, SSL_R_RECORD_TOO_LARGE}, + #ifdef CMS_R_SIGNFINAL_ERROR + {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR}, #else - {"RECORD_TOO_LARGE", ERR_LIB_SSL, 214}, + {"SIGNFINAL_ERROR", ERR_LIB_CMS, 139}, #endif - #ifdef SSL_R_RECORD_TOO_SMALL - {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, + #ifdef CMS_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR}, #else - {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298}, + {"SMIME_TEXT_ERROR", ERR_LIB_CMS, 140}, #endif - #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG - {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, + #ifdef CMS_R_STORE_INIT_ERROR + {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR}, + #else + {"STORE_INIT_ERROR", ERR_LIB_CMS, 141}, + #endif + #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA + {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA}, + #else + {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 142}, + #endif + #ifdef CMS_R_TYPE_NOT_DATA + {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA}, + #else + {"TYPE_NOT_DATA", ERR_LIB_CMS, 143}, + #endif + #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA + {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA}, + #else + {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, 144}, + #endif + #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA + {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA}, + #else + {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 145}, + #endif + #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA + {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA}, + #else + {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 146}, + #endif + #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT + {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT}, + #else + {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, 147}, + #endif + #ifdef CMS_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", ERR_LIB_CMS, 148}, + #endif + #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, 149}, + #endif + #ifdef CMS_R_UNKNOWN_ID + {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID}, + #else + {"UNKNOWN_ID", ERR_LIB_CMS, 150}, + #endif + #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, 151}, + #endif + #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, 152}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM + {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM}, + #else + {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, 153}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM}, + #else + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, 179}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE}, + #else + {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, 155}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE + {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE}, + #else + {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, 154}, + #endif + #ifdef CMS_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", ERR_LIB_CMS, 156}, + #endif + #ifdef CMS_R_UNWRAP_ERROR + {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR}, + #else + {"UNWRAP_ERROR", ERR_LIB_CMS, 157}, + #endif + #ifdef CMS_R_UNWRAP_FAILURE + {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE}, + #else + {"UNWRAP_FAILURE", ERR_LIB_CMS, 180}, + #endif + #ifdef CMS_R_VERIFICATION_FAILURE + {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE}, + #else + {"VERIFICATION_FAILURE", ERR_LIB_CMS, 158}, + #endif + #ifdef CMS_R_WRAP_ERROR + {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR}, + #else + {"WRAP_ERROR", ERR_LIB_CMS, 159}, + #endif + #ifdef COMP_R_ZLIB_DEFLATE_ERROR + {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR}, + #else + {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, 99}, + #endif + #ifdef COMP_R_ZLIB_INFLATE_ERROR + {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR}, + #else + {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, 100}, + #endif + #ifdef COMP_R_ZLIB_NOT_SUPPORTED + {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED}, + #else + {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, 101}, + #endif + #ifdef CONF_R_ERROR_LOADING_DSO + {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO}, + #else + {"ERROR_LOADING_DSO", ERR_LIB_CONF, 110}, + #endif + #ifdef CONF_R_LIST_CANNOT_BE_NULL + {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL}, + #else + {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, 115}, + #endif + #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET + {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET}, + #else + {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, 100}, + #endif + #ifdef CONF_R_MISSING_EQUAL_SIGN + {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN}, + #else + {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, 101}, + #endif + #ifdef CONF_R_MISSING_INIT_FUNCTION + {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION}, + #else + {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, 112}, + #endif + #ifdef CONF_R_MODULE_INITIALIZATION_ERROR + {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR}, + #else + {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, 109}, + #endif + #ifdef CONF_R_NO_CLOSE_BRACE + {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE}, + #else + {"NO_CLOSE_BRACE", ERR_LIB_CONF, 102}, + #endif + #ifdef CONF_R_NO_CONF + {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF}, + #else + {"NO_CONF", ERR_LIB_CONF, 105}, + #endif + #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE}, + #else + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, 106}, + #endif + #ifdef CONF_R_NO_SECTION + {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION}, + #else + {"NO_SECTION", ERR_LIB_CONF, 107}, + #endif + #ifdef CONF_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE}, + #else + {"NO_SUCH_FILE", ERR_LIB_CONF, 114}, + #endif + #ifdef CONF_R_NO_VALUE + {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE}, + #else + {"NO_VALUE", ERR_LIB_CONF, 108}, + #endif + #ifdef CONF_R_NUMBER_TOO_LARGE + {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE}, + #else + {"NUMBER_TOO_LARGE", ERR_LIB_CONF, 121}, + #endif + #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE + {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE}, + #else + {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, 111}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, 117}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, 118}, + #endif + #ifdef CONF_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", ERR_LIB_CONF, 119}, + #endif + #ifdef CONF_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, 120}, + #endif + #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION + {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION}, + #else + {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, 103}, + #endif + #ifdef CONF_R_UNKNOWN_MODULE_NAME + {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME}, + #else + {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, 113}, + #endif + #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG + {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG}, + #else + {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, 116}, + #endif + #ifdef CONF_R_VARIABLE_HAS_NO_VALUE + {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE}, + #else + {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, 104}, + #endif + #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, 101}, + #endif + #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT + {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT}, + #else + {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, 102}, + #endif + #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS + {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS}, + #else + {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, 103}, + #endif + #ifdef CT_R_BASE64_DECODE_ERROR + {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR}, + #else + {"BASE64_DECODE_ERROR", ERR_LIB_CT, 108}, + #endif + #ifdef CT_R_INVALID_LOG_ID_LENGTH + {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH}, + #else + {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, 100}, + #endif + #ifdef CT_R_LOG_CONF_INVALID + {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID}, + #else + {"LOG_CONF_INVALID", ERR_LIB_CT, 109}, + #endif + #ifdef CT_R_LOG_CONF_INVALID_KEY + {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY}, + #else + {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, 110}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION + {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION}, + #else + {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, 111}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_KEY + {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY}, + #else + {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, 112}, + #endif + #ifdef CT_R_LOG_KEY_INVALID + {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID}, + #else + {"LOG_KEY_INVALID", ERR_LIB_CT, 113}, + #endif + #ifdef CT_R_SCT_FUTURE_TIMESTAMP + {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP}, + #else + {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, 116}, + #endif + #ifdef CT_R_SCT_INVALID + {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID}, + #else + {"SCT_INVALID", ERR_LIB_CT, 104}, + #endif + #ifdef CT_R_SCT_INVALID_SIGNATURE + {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE}, + #else + {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, 107}, + #endif + #ifdef CT_R_SCT_LIST_INVALID + {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID}, + #else + {"SCT_LIST_INVALID", ERR_LIB_CT, 105}, + #endif + #ifdef CT_R_SCT_LOG_ID_MISMATCH + {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH}, + #else + {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, 114}, + #endif + #ifdef CT_R_SCT_NOT_SET + {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET}, + #else + {"SCT_NOT_SET", ERR_LIB_CT, 106}, + #endif + #ifdef CT_R_SCT_UNSUPPORTED_VERSION + {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION}, + #else + {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, 115}, + #endif + #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID + {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID}, + #else + {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, 101}, + #endif + #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE + {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE}, + #else + {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, 102}, + #endif + #ifdef CT_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION}, + #else + {"UNSUPPORTED_VERSION", ERR_LIB_CT, 103}, + #endif + #ifdef DH_R_BAD_GENERATOR + {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR}, + #else + {"BAD_GENERATOR", ERR_LIB_DH, 101}, + #endif + #ifdef DH_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", ERR_LIB_DH, 109}, + #endif + #ifdef DH_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR}, + #else + {"BN_ERROR", ERR_LIB_DH, 106}, + #endif + #ifdef DH_R_CHECK_INVALID_J_VALUE + {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE}, + #else + {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, 115}, + #endif + #ifdef DH_R_CHECK_INVALID_Q_VALUE + {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE}, + #else + {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, 116}, + #endif + #ifdef DH_R_CHECK_PUBKEY_INVALID + {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID}, + #else + {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, 122}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE + {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE}, + #else + {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, 123}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL + {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL}, + #else + {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, 124}, + #endif + #ifdef DH_R_CHECK_P_NOT_PRIME + {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME}, + #else + {"CHECK_P_NOT_PRIME", ERR_LIB_DH, 117}, + #endif + #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME + {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME}, + #else + {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, 118}, + #endif + #ifdef DH_R_CHECK_Q_NOT_PRIME + {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME}, + #else + {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, 119}, + #endif + #ifdef DH_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_DH, 104}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NAME + {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME}, + #else + {"INVALID_PARAMETER_NAME", ERR_LIB_DH, 110}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NID + {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID}, + #else + {"INVALID_PARAMETER_NID", ERR_LIB_DH, 114}, + #endif + #ifdef DH_R_INVALID_PUBKEY + {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY}, + #else + {"INVALID_PUBKEY", ERR_LIB_DH, 102}, + #endif + #ifdef DH_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", ERR_LIB_DH, 112}, + #endif + #ifdef DH_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", ERR_LIB_DH, 108}, + #endif + #ifdef DH_R_MISSING_PUBKEY + {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY}, + #else + {"MISSING_PUBKEY", ERR_LIB_DH, 125}, + #endif + #ifdef DH_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", ERR_LIB_DH, 103}, + #endif + #ifdef DH_R_NOT_SUITABLE_GENERATOR + {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR}, + #else + {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, 120}, + #endif + #ifdef DH_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", ERR_LIB_DH, 107}, + #endif + #ifdef DH_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", ERR_LIB_DH, 100}, + #endif + #ifdef DH_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, 105}, + #endif + #ifdef DH_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", ERR_LIB_DH, 111}, + #endif + #ifdef DH_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", ERR_LIB_DH, 113}, + #endif + #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR + {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR}, + #else + {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, 121}, + #endif + #ifdef DSA_R_BAD_Q_VALUE + {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE}, + #else + {"BAD_Q_VALUE", ERR_LIB_DSA, 102}, + #endif + #ifdef DSA_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", ERR_LIB_DSA, 108}, + #endif + #ifdef DSA_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR}, + #else + {"BN_ERROR", ERR_LIB_DSA, 109}, + #endif + #ifdef DSA_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_DSA, 104}, + #endif + #ifdef DSA_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, 106}, + #endif + #ifdef DSA_R_INVALID_PARAMETERS + {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS}, + #else + {"INVALID_PARAMETERS", ERR_LIB_DSA, 112}, + #endif + #ifdef DSA_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_DSA, 101}, + #endif + #ifdef DSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, 111}, + #endif + #ifdef DSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", ERR_LIB_DSA, 103}, + #endif + #ifdef DSA_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", ERR_LIB_DSA, 107}, + #endif + #ifdef DSA_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, 105}, + #endif + #ifdef DSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", ERR_LIB_DSA, 113}, + #endif + #ifdef DSA_R_SEED_LEN_SMALL + {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL}, + #else + {"SEED_LEN_SMALL", ERR_LIB_DSA, 110}, + #endif + #ifdef EC_R_ASN1_ERROR + {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR}, + #else + {"ASN1_ERROR", ERR_LIB_EC, 115}, + #endif + #ifdef EC_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", ERR_LIB_EC, 156}, + #endif + #ifdef EC_R_BIGNUM_OUT_OF_RANGE + {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE}, + #else + {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, 144}, + #endif + #ifdef EC_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", ERR_LIB_EC, 100}, + #endif + #ifdef EC_R_CANNOT_INVERT + {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT}, + #else + {"CANNOT_INVERT", ERR_LIB_EC, 165}, + #endif + #ifdef EC_R_COORDINATES_OUT_OF_RANGE + {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE}, + #else + {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, 146}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH + {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH}, + #else + {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, 160}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING + {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING}, + #else + {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, 159}, + #endif + #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE + {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE}, + #else + {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 117}, + #endif + #ifdef EC_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_EC, 142}, + #endif + #ifdef EC_R_DISCRIMINANT_IS_ZERO + {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO}, + #else + {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, 118}, + #endif + #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE + {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE}, + #else + {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, 119}, + #endif + #ifdef EC_R_FIELD_TOO_LARGE + {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE}, + #else + {"FIELD_TOO_LARGE", ERR_LIB_EC, 143}, + #endif + #ifdef EC_R_GF2M_NOT_SUPPORTED + {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED}, + #else + {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, 147}, + #endif + #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE + {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE}, + #else + {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, 120}, + #endif + #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE + {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE}, + #else + {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 121}, + #endif + #ifdef EC_R_INCOMPATIBLE_OBJECTS + {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS}, + #else + {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, 101}, + #endif + #ifdef EC_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", ERR_LIB_EC, 112}, + #endif + #ifdef EC_R_INVALID_COMPRESSED_POINT + {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT}, + #else + {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, 110}, + #endif + #ifdef EC_R_INVALID_COMPRESSION_BIT + {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT}, + #else + {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, 109}, + #endif + #ifdef EC_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", ERR_LIB_EC, 141}, + #endif + #ifdef EC_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_EC, 151}, + #endif + #ifdef EC_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", ERR_LIB_EC, 138}, + #endif + #ifdef EC_R_INVALID_ENCODING + {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING}, + #else + {"INVALID_ENCODING", ERR_LIB_EC, 102}, + #endif + #ifdef EC_R_INVALID_FIELD + {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD}, + #else + {"INVALID_FIELD", ERR_LIB_EC, 103}, + #endif + #ifdef EC_R_INVALID_FORM + {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM}, + #else + {"INVALID_FORM", ERR_LIB_EC, 104}, + #endif + #ifdef EC_R_INVALID_GROUP_ORDER + {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER}, + #else + {"INVALID_GROUP_ORDER", ERR_LIB_EC, 122}, + #endif + #ifdef EC_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY}, + #else + {"INVALID_KEY", ERR_LIB_EC, 116}, + #endif + #ifdef EC_R_INVALID_OUTPUT_LENGTH + {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH}, + #else + {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, 161}, + #endif + #ifdef EC_R_INVALID_PEER_KEY + {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY}, + #else + {"INVALID_PEER_KEY", ERR_LIB_EC, 133}, + #endif + #ifdef EC_R_INVALID_PENTANOMIAL_BASIS + {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS}, + #else + {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, 132}, + #endif + #ifdef EC_R_INVALID_PRIVATE_KEY + {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY}, + #else + {"INVALID_PRIVATE_KEY", ERR_LIB_EC, 123}, + #endif + #ifdef EC_R_INVALID_TRINOMIAL_BASIS + {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS}, + #else + {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, 137}, + #endif + #ifdef EC_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", ERR_LIB_EC, 148}, + #endif + #ifdef EC_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", ERR_LIB_EC, 140}, + #endif + #ifdef EC_R_LADDER_POST_FAILURE + {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE}, + #else + {"LADDER_POST_FAILURE", ERR_LIB_EC, 136}, + #endif + #ifdef EC_R_LADDER_PRE_FAILURE + {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE}, + #else + {"LADDER_PRE_FAILURE", ERR_LIB_EC, 153}, + #endif + #ifdef EC_R_LADDER_STEP_FAILURE + {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE}, + #else + {"LADDER_STEP_FAILURE", ERR_LIB_EC, 162}, + #endif + #ifdef EC_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_EC, 124}, + #endif + #ifdef EC_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", ERR_LIB_EC, 125}, + #endif + #ifdef EC_R_NEED_NEW_SETUP_VALUES + {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES}, + #else + {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, 157}, + #endif + #ifdef EC_R_NOT_A_NIST_PRIME + {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME}, + #else + {"NOT_A_NIST_PRIME", ERR_LIB_EC, 135}, + #endif + #ifdef EC_R_NOT_IMPLEMENTED + {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED}, + #else + {"NOT_IMPLEMENTED", ERR_LIB_EC, 126}, + #endif + #ifdef EC_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED}, + #else + {"NOT_INITIALIZED", ERR_LIB_EC, 111}, + #endif + #ifdef EC_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", ERR_LIB_EC, 139}, + #endif + #ifdef EC_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", ERR_LIB_EC, 154}, + #endif + #ifdef EC_R_OPERATION_NOT_SUPPORTED + {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED}, + #else + {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, 152}, + #endif + #ifdef EC_R_PASSED_NULL_PARAMETER + {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER}, + #else + {"PASSED_NULL_PARAMETER", ERR_LIB_EC, 134}, + #endif + #ifdef EC_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", ERR_LIB_EC, 149}, + #endif + #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE + {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE}, + #else + {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, 127}, + #endif + #ifdef EC_R_POINT_ARITHMETIC_FAILURE + {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE}, + #else + {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, 155}, + #endif + #ifdef EC_R_POINT_AT_INFINITY + {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY}, + #else + {"POINT_AT_INFINITY", ERR_LIB_EC, 106}, + #endif + #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE + {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE}, + #else + {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, 163}, + #endif + #ifdef EC_R_POINT_IS_NOT_ON_CURVE + {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE}, + #else + {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, 107}, + #endif + #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED + {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED}, + #else + {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, 158}, + #endif + #ifdef EC_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", ERR_LIB_EC, 150}, + #endif + #ifdef EC_R_SLOT_FULL + {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL}, + #else + {"SLOT_FULL", ERR_LIB_EC, 108}, + #endif + #ifdef EC_R_UNDEFINED_GENERATOR + {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR}, + #else + {"UNDEFINED_GENERATOR", ERR_LIB_EC, 113}, + #endif + #ifdef EC_R_UNDEFINED_ORDER + {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER}, + #else + {"UNDEFINED_ORDER", ERR_LIB_EC, 128}, + #endif + #ifdef EC_R_UNKNOWN_COFACTOR + {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR}, + #else + {"UNKNOWN_COFACTOR", ERR_LIB_EC, 164}, + #endif + #ifdef EC_R_UNKNOWN_GROUP + {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP}, + #else + {"UNKNOWN_GROUP", ERR_LIB_EC, 129}, + #endif + #ifdef EC_R_UNKNOWN_ORDER + {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER}, + #else + {"UNKNOWN_ORDER", ERR_LIB_EC, 114}, + #endif + #ifdef EC_R_UNSUPPORTED_FIELD + {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD}, + #else + {"UNSUPPORTED_FIELD", ERR_LIB_EC, 131}, + #endif + #ifdef EC_R_WRONG_CURVE_PARAMETERS + {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS}, + #else + {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, 145}, + #endif + #ifdef EC_R_WRONG_ORDER + {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER}, + #else + {"WRONG_ORDER", ERR_LIB_EC, 130}, + #endif + #ifdef ENGINE_R_ALREADY_LOADED + {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED}, + #else + {"ALREADY_LOADED", ERR_LIB_ENGINE, 100}, + #endif + #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER + {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER}, + #else + {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, 133}, + #endif + #ifdef ENGINE_R_CMD_NOT_EXECUTABLE + {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE}, + #else + {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, 134}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_INPUT + {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT}, + #else + {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, 135}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT + {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT}, + #else + {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, 136}, + #endif + #ifdef ENGINE_R_CONFLICTING_ENGINE_ID + {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID}, + #else + {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, 103}, + #endif + #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED + {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED}, + #else + {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, 119}, + #endif + #ifdef ENGINE_R_DSO_FAILURE + {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE}, + #else + {"DSO_FAILURE", ERR_LIB_ENGINE, 104}, + #endif + #ifdef ENGINE_R_DSO_NOT_FOUND + {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND}, + #else + {"DSO_NOT_FOUND", ERR_LIB_ENGINE, 132}, + #endif + #ifdef ENGINE_R_ENGINES_SECTION_ERROR + {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR}, + #else + {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, 148}, + #endif + #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR + {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR}, + #else + {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, 102}, + #endif + #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST + {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST}, + #else + {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, 105}, + #endif + #ifdef ENGINE_R_ENGINE_SECTION_ERROR + {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR}, + #else + {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, 149}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY + {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY}, + #else + {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, 128}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY + {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY}, + #else + {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, 129}, + #endif + #ifdef ENGINE_R_FINISH_FAILED + {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED}, + #else + {"FINISH_FAILED", ERR_LIB_ENGINE, 106}, + #endif + #ifdef ENGINE_R_ID_OR_NAME_MISSING + {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING}, + #else + {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, 108}, + #endif + #ifdef ENGINE_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED}, + #else + {"INIT_FAILED", ERR_LIB_ENGINE, 109}, + #endif + #ifdef ENGINE_R_INTERNAL_LIST_ERROR + {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR}, + #else + {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, 110}, + #endif + #ifdef ENGINE_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", ERR_LIB_ENGINE, 143}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NAME + {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME}, + #else + {"INVALID_CMD_NAME", ERR_LIB_ENGINE, 137}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NUMBER + {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER}, + #else + {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, 138}, + #endif + #ifdef ENGINE_R_INVALID_INIT_VALUE + {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE}, + #else + {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, 151}, + #endif + #ifdef ENGINE_R_INVALID_STRING + {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING}, + #else + {"INVALID_STRING", ERR_LIB_ENGINE, 150}, + #endif + #ifdef ENGINE_R_NOT_INITIALISED + {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED}, + #else + {"NOT_INITIALISED", ERR_LIB_ENGINE, 117}, + #endif + #ifdef ENGINE_R_NOT_LOADED + {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED}, + #else + {"NOT_LOADED", ERR_LIB_ENGINE, 112}, + #endif + #ifdef ENGINE_R_NO_CONTROL_FUNCTION + {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION}, + #else + {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, 120}, + #endif + #ifdef ENGINE_R_NO_INDEX + {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX}, + #else + {"NO_INDEX", ERR_LIB_ENGINE, 144}, + #endif + #ifdef ENGINE_R_NO_LOAD_FUNCTION + {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION}, + #else + {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, 125}, + #endif + #ifdef ENGINE_R_NO_REFERENCE + {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE}, + #else + {"NO_REFERENCE", ERR_LIB_ENGINE, 130}, + #endif + #ifdef ENGINE_R_NO_SUCH_ENGINE + {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE}, + #else + {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, 116}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER + {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER}, + #else + {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, 146}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST + {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST}, + #else + {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, 147}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD}, + #else + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, 101}, + #endif + #ifdef ENGINE_R_VERSION_INCOMPATIBILITY + {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY}, + #else + {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, 145}, + #endif + #ifdef EVP_R_AES_KEY_SETUP_FAILED + {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED}, + #else + {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, 143}, + #endif + #ifdef EVP_R_ARIA_KEY_SETUP_FAILED + {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED}, + #else + {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 176}, + #endif + #ifdef EVP_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", ERR_LIB_EVP, 100}, + #endif + #ifdef EVP_R_BAD_KEY_LENGTH + {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH}, + #else + {"BAD_KEY_LENGTH", ERR_LIB_EVP, 195}, + #endif + #ifdef EVP_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", ERR_LIB_EVP, 155}, + #endif + #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED + {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED}, + #else + {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 157}, + #endif + #ifdef EVP_R_CIPHER_PARAMETER_ERROR + {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR}, + #else + {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, 122}, + #endif + #ifdef EVP_R_COMMAND_NOT_SUPPORTED + {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED}, + #else + {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, 147}, + #endif + #ifdef EVP_R_COPY_ERROR + {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR}, + #else + {"COPY_ERROR", ERR_LIB_EVP, 173}, + #endif + #ifdef EVP_R_CTRL_NOT_IMPLEMENTED + {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED}, + #else + {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, 132}, + #endif + #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED + {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED}, + #else + {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, 133}, + #endif + #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH}, + #else + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, 138}, + #endif + #ifdef EVP_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_EVP, 114}, + #endif + #ifdef EVP_R_DIFFERENT_KEY_TYPES + {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES}, + #else + {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, 101}, + #endif + #ifdef EVP_R_DIFFERENT_PARAMETERS + {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS}, + #else + {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, 153}, + #endif + #ifdef EVP_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION}, + #else + {"ERROR_LOADING_SECTION", ERR_LIB_EVP, 165}, + #endif + #ifdef EVP_R_ERROR_SETTING_FIPS_MODE + {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE}, + #else + {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, 166}, + #endif + #ifdef EVP_R_EXPECTING_AN_HMAC_KEY + {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY}, + #else + {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, 174}, + #endif + #ifdef EVP_R_EXPECTING_AN_RSA_KEY + {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY}, + #else + {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, 127}, + #endif + #ifdef EVP_R_EXPECTING_A_DH_KEY + {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY}, + #else + {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, 128}, + #endif + #ifdef EVP_R_EXPECTING_A_DSA_KEY + {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY}, + #else + {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, 129}, + #endif + #ifdef EVP_R_EXPECTING_A_EC_KEY + {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY}, + #else + {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, 142}, + #endif + #ifdef EVP_R_EXPECTING_A_POLY1305_KEY + {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY}, + #else + {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, 164}, + #endif + #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY + {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY}, + #else + {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, 175}, + #endif + #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, 167}, + #endif + #ifdef EVP_R_GET_RAW_KEY_FAILED + {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED}, + #else + {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, 182}, + #endif + #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS + {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS}, + #else + {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, 171}, + #endif + #ifdef EVP_R_INITIALIZATION_ERROR + {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR}, + #else + {"INITIALIZATION_ERROR", ERR_LIB_EVP, 134}, + #endif + #ifdef EVP_R_INPUT_NOT_INITIALIZED + {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED}, + #else + {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, 111}, + #endif + #ifdef EVP_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_EVP, 152}, + #endif + #ifdef EVP_R_INVALID_FIPS_MODE + {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE}, + #else + {"INVALID_FIPS_MODE", ERR_LIB_EVP, 168}, + #endif + #ifdef EVP_R_INVALID_IV_LENGTH + {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH}, + #else + {"INVALID_IV_LENGTH", ERR_LIB_EVP, 194}, + #endif + #ifdef EVP_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY}, + #else + {"INVALID_KEY", ERR_LIB_EVP, 163}, + #endif + #ifdef EVP_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", ERR_LIB_EVP, 130}, + #endif + #ifdef EVP_R_INVALID_OPERATION + {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION}, + #else + {"INVALID_OPERATION", ERR_LIB_EVP, 148}, + #endif + #ifdef EVP_R_KEYGEN_FAILURE + {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE}, + #else + {"KEYGEN_FAILURE", ERR_LIB_EVP, 120}, + #endif + #ifdef EVP_R_KEY_SETUP_FAILED + {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED}, + #else + {"KEY_SETUP_FAILED", ERR_LIB_EVP, 180}, + #endif + #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED + {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED}, + #else + {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, 172}, + #endif + #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL + {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL}, + #else + {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, 159}, + #endif + #ifdef EVP_R_METHOD_NOT_SUPPORTED + {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED}, + #else + {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, 144}, + #endif + #ifdef EVP_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_EVP, 103}, + #endif + #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH}, + #else + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, 178}, + #endif + #ifdef EVP_R_NO_CIPHER_SET + {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET}, + #else + {"NO_CIPHER_SET", ERR_LIB_EVP, 131}, + #endif + #ifdef EVP_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, 158}, + #endif + #ifdef EVP_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET}, + #else + {"NO_DIGEST_SET", ERR_LIB_EVP, 139}, + #endif + #ifdef EVP_R_NO_KEY_SET + {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET}, + #else + {"NO_KEY_SET", ERR_LIB_EVP, 154}, + #endif + #ifdef EVP_R_NO_OPERATION_SET + {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET}, + #else + {"NO_OPERATION_SET", ERR_LIB_EVP, 149}, + #endif + #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED + {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED}, + #else + {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, 177}, + #endif + #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, 150}, + #endif + #ifdef EVP_R_OPERATON_NOT_INITIALIZED + {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED}, + #else + {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, 151}, + #endif + #ifdef EVP_R_PARTIALLY_OVERLAPPING + {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING}, + #else + {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, 162}, + #endif + #ifdef EVP_R_PBKDF2_ERROR + {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR}, + #else + {"PBKDF2_ERROR", ERR_LIB_EVP, 181}, + #endif + #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED}, + #else + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, 179}, + #endif + #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR + {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR}, + #else + {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, 145}, + #endif + #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR + {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR}, + #else + {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, 146}, + #endif + #ifdef EVP_R_PUBLIC_KEY_NOT_RSA + {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA}, + #else + {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, 106}, + #endif + #ifdef EVP_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", ERR_LIB_EVP, 160}, + #endif + #ifdef EVP_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", ERR_LIB_EVP, 161}, + #endif + #ifdef EVP_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION}, + #else + {"UNKNOWN_OPTION", ERR_LIB_EVP, 169}, + #endif + #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM + {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM}, + #else + {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, 121}, + #endif + #ifdef EVP_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, 156}, + #endif + #ifdef EVP_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, 107}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEYLENGTH + {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH}, + #else + {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, 123}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION}, + #else + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, 124}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_SIZE + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE}, + #else + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, 108}, + #endif + #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, + #else + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, 135}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRF + {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF}, + #else + {"UNSUPPORTED_PRF", ERR_LIB_EVP, 125}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM}, + #else + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, 118}, + #endif + #ifdef EVP_R_UNSUPPORTED_SALT_TYPE + {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE}, + #else + {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, 126}, + #endif + #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED + {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED}, + #else + {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, 170}, + #endif + #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH}, + #else + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, 109}, + #endif + #ifdef EVP_R_XTS_DUPLICATED_KEYS + {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS}, + #else + {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, 183}, + #endif + #ifdef KDF_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_KDF, 100}, + #endif + #ifdef KDF_R_MISSING_ITERATION_COUNT + {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT}, + #else + {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, 109}, + #endif + #ifdef KDF_R_MISSING_KEY + {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY}, + #else + {"MISSING_KEY", ERR_LIB_KDF, 104}, + #endif + #ifdef KDF_R_MISSING_MESSAGE_DIGEST + {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST}, + #else + {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, 105}, + #endif + #ifdef KDF_R_MISSING_PARAMETER + {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER}, + #else + {"MISSING_PARAMETER", ERR_LIB_KDF, 101}, + #endif + #ifdef KDF_R_MISSING_PASS + {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS}, + #else + {"MISSING_PASS", ERR_LIB_KDF, 110}, + #endif + #ifdef KDF_R_MISSING_SALT + {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT}, + #else + {"MISSING_SALT", ERR_LIB_KDF, 111}, + #endif + #ifdef KDF_R_MISSING_SECRET + {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET}, + #else + {"MISSING_SECRET", ERR_LIB_KDF, 107}, + #endif + #ifdef KDF_R_MISSING_SEED + {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED}, + #else + {"MISSING_SEED", ERR_LIB_KDF, 106}, + #endif + #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE + {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE}, + #else + {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, 103}, + #endif + #ifdef KDF_R_VALUE_ERROR + {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR}, + #else + {"VALUE_ERROR", ERR_LIB_KDF, 108}, + #endif + #ifdef KDF_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", ERR_LIB_KDF, 102}, + #endif + #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, 101}, + #endif + #ifdef OCSP_R_DIGEST_ERR + {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR}, + #else + {"DIGEST_ERR", ERR_LIB_OCSP, 102}, + #endif + #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD + {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD}, + #else + {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, 122}, + #endif + #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD + {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD}, + #else + {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, 123}, + #endif + #ifdef OCSP_R_ERROR_PARSING_URL + {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL}, + #else + {"ERROR_PARSING_URL", ERR_LIB_OCSP, 121}, + #endif + #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE + {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE}, + #else + {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, 103}, + #endif + #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE + {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE}, + #else + {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, 124}, + #endif + #ifdef OCSP_R_NOT_BASIC_RESPONSE + {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE}, + #else + {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, 104}, + #endif + #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN + {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN}, + #else + {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, 105}, + #endif + #ifdef OCSP_R_NO_RESPONSE_DATA + {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA}, + #else + {"NO_RESPONSE_DATA", ERR_LIB_OCSP, 108}, + #endif + #ifdef OCSP_R_NO_REVOKED_TIME + {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME}, + #else + {"NO_REVOKED_TIME", ERR_LIB_OCSP, 109}, + #endif + #ifdef OCSP_R_NO_SIGNER_KEY + {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY}, + #else + {"NO_SIGNER_KEY", ERR_LIB_OCSP, 130}, + #endif + #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, 110}, + #endif + #ifdef OCSP_R_REQUEST_NOT_SIGNED + {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED}, + #else + {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, 128}, + #endif + #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA}, + #else + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, 111}, + #endif + #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED + {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED}, + #else + {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, 112}, + #endif + #ifdef OCSP_R_SERVER_RESPONSE_ERROR + {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR}, + #else + {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, 114}, + #endif + #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR + {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR}, + #else + {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, 115}, + #endif + #ifdef OCSP_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", ERR_LIB_OCSP, 117}, + #endif + #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, 118}, + #endif + #ifdef OCSP_R_STATUS_EXPIRED + {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED}, + #else + {"STATUS_EXPIRED", ERR_LIB_OCSP, 125}, + #endif + #ifdef OCSP_R_STATUS_NOT_YET_VALID + {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID}, + #else + {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, 126}, + #endif + #ifdef OCSP_R_STATUS_TOO_OLD + {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD}, + #else + {"STATUS_TOO_OLD", ERR_LIB_OCSP, 127}, + #endif + #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST + {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST}, + #else + {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, 119}, + #endif + #ifdef OCSP_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", ERR_LIB_OCSP, 120}, + #endif + #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE + {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE}, + #else + {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, 129}, + #endif + #ifdef PEM_R_BAD_BASE64_DECODE + {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, + #else + {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100}, + #endif + #ifdef PEM_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", ERR_LIB_PEM, 101}, + #endif + #ifdef PEM_R_BAD_END_LINE + {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, + #else + {"BAD_END_LINE", ERR_LIB_PEM, 102}, + #endif + #ifdef PEM_R_BAD_IV_CHARS + {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, + #else + {"BAD_IV_CHARS", ERR_LIB_PEM, 103}, + #endif + #ifdef PEM_R_BAD_MAGIC_NUMBER + {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, + #else + {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116}, + #endif + #ifdef PEM_R_BAD_PASSWORD_READ + {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, + #else + {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104}, + #endif + #ifdef PEM_R_BAD_VERSION_NUMBER + {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, + #else + {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117}, + #endif + #ifdef PEM_R_BIO_WRITE_FAILURE + {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, + #else + {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118}, + #endif + #ifdef PEM_R_CIPHER_IS_NULL + {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, + #else + {"CIPHER_IS_NULL", ERR_LIB_PEM, 127}, + #endif + #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY + {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, + #else + {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115}, + #endif + #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB + {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, + #else + {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119}, + #endif + #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB + {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, + #else + {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120}, + #endif + #ifdef PEM_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG}, + #else + {"HEADER_TOO_LONG", ERR_LIB_PEM, 128}, + #endif + #ifdef PEM_R_INCONSISTENT_HEADER + {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, + #else + {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121}, + #endif + #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR + {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, + #else + {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122}, + #endif + #ifdef PEM_R_KEYBLOB_TOO_SHORT + {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, + #else + {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123}, + #endif + #ifdef PEM_R_MISSING_DEK_IV + {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV}, + #else + {"MISSING_DEK_IV", ERR_LIB_PEM, 129}, + #endif + #ifdef PEM_R_NOT_DEK_INFO + {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, + #else + {"NOT_DEK_INFO", ERR_LIB_PEM, 105}, + #endif + #ifdef PEM_R_NOT_ENCRYPTED + {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, + #else + {"NOT_ENCRYPTED", ERR_LIB_PEM, 106}, + #endif + #ifdef PEM_R_NOT_PROC_TYPE + {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, + #else + {"NOT_PROC_TYPE", ERR_LIB_PEM, 107}, + #endif + #ifdef PEM_R_NO_START_LINE + {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, + #else + {"NO_START_LINE", ERR_LIB_PEM, 108}, + #endif + #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD + {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, + #else + {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109}, + #endif + #ifdef PEM_R_PUBLIC_KEY_NO_RSA + {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA}, + #else + {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110}, + #endif + #ifdef PEM_R_PVK_DATA_TOO_SHORT + {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, + #else + {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124}, + #endif + #ifdef PEM_R_PVK_TOO_SHORT + {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, + #else + {"PVK_TOO_SHORT", ERR_LIB_PEM, 125}, + #endif + #ifdef PEM_R_READ_KEY + {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, + #else + {"READ_KEY", ERR_LIB_PEM, 111}, + #endif + #ifdef PEM_R_SHORT_HEADER + {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, + #else + {"SHORT_HEADER", ERR_LIB_PEM, 112}, + #endif + #ifdef PEM_R_UNEXPECTED_DEK_IV + {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV}, + #else + {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, 130}, + #endif + #ifdef PEM_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113}, + #endif + #ifdef PEM_R_UNSUPPORTED_ENCRYPTION + {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, + #else + {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114}, + #endif + #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS + {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, + #else + {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126}, + #endif + #ifdef PKCS12_R_CANT_PACK_STRUCTURE + {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE}, + #else + {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, 100}, + #endif + #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA + {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA}, + #else + {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, 121}, + #endif + #ifdef PKCS12_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_PKCS12, 101}, + #endif + #ifdef PKCS12_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR}, + #else + {"ENCODE_ERROR", ERR_LIB_PKCS12, 102}, + #endif + #ifdef PKCS12_R_ENCRYPT_ERROR + {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR}, + #else + {"ENCRYPT_ERROR", ERR_LIB_PKCS12, 103}, + #endif + #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE}, + #else + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, 120}, + #endif + #ifdef PKCS12_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, 104}, + #endif + #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER + {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER}, + #else + {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, 105}, + #endif + #ifdef PKCS12_R_IV_GEN_ERROR + {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR}, + #else + {"IV_GEN_ERROR", ERR_LIB_PKCS12, 106}, + #endif + #ifdef PKCS12_R_KEY_GEN_ERROR + {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR}, + #else + {"KEY_GEN_ERROR", ERR_LIB_PKCS12, 107}, + #endif + #ifdef PKCS12_R_MAC_ABSENT + {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT}, + #else + {"MAC_ABSENT", ERR_LIB_PKCS12, 108}, + #endif + #ifdef PKCS12_R_MAC_GENERATION_ERROR + {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR}, + #else + {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, 109}, + #endif + #ifdef PKCS12_R_MAC_SETUP_ERROR + {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR}, + #else + {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, 110}, + #endif + #ifdef PKCS12_R_MAC_STRING_SET_ERROR + {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR}, + #else + {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, 111}, + #endif + #ifdef PKCS12_R_MAC_VERIFY_FAILURE + {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE}, + #else + {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, 113}, + #endif + #ifdef PKCS12_R_PARSE_ERROR + {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR}, + #else + {"PARSE_ERROR", ERR_LIB_PKCS12, 114}, + #endif + #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR + {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR}, + #else + {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, 115}, + #endif + #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR + {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR}, + #else + {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, 116}, + #endif + #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR + {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR}, + #else + {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, 117}, + #endif + #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, 118}, + #endif + #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE + {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE}, + #else + {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, 119}, + #endif + #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, 117}, + #endif + #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, + #else + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, 144}, + #endif + #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED + {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED}, + #else + {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, 116}, + #endif + #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT + {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT}, + #else + {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, 118}, + #endif + #ifdef PKCS7_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR}, + #else + {"CTRL_ERROR", ERR_LIB_PKCS7, 152}, + #endif + #ifdef PKCS7_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR}, + #else + {"DECRYPT_ERROR", ERR_LIB_PKCS7, 119}, + #endif + #ifdef PKCS7_R_DIGEST_FAILURE + {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE}, + #else + {"DIGEST_FAILURE", ERR_LIB_PKCS7, 101}, + #endif + #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE + {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE}, + #else + {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, 149}, + #endif + #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 150}, + #endif + #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT + {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT}, + #else + {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, 120}, + #endif + #ifdef PKCS7_R_ERROR_SETTING_CIPHER + {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER}, + #else + {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, 121}, + #endif + #ifdef PKCS7_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, 143}, + #endif + #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE + {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE}, + #else + {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, 155}, + #endif + #ifdef PKCS7_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT}, + #else + {"NO_CONTENT", ERR_LIB_PKCS7, 122}, + #endif + #ifdef PKCS7_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, 151}, + #endif + #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND + {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND}, + #else + {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, 154}, + #endif + #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE + {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE}, + #else + {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, 115}, + #endif + #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA + {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA}, + #else + {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, 123}, + #endif + #ifdef PKCS7_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS}, + #else + {"NO_SIGNERS", ERR_LIB_PKCS7, 142}, + #endif + #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE}, + #else + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, 104}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, 124}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR + {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR}, + #else + {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, 153}, + #endif + #ifdef PKCS7_R_PKCS7_DATASIGN + {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN}, + #else + {"PKCS7_DATASIGN", ERR_LIB_PKCS7, 145}, + #endif + #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, 127}, + #endif + #ifdef PKCS7_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, 105}, + #endif + #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, 128}, + #endif + #ifdef PKCS7_R_SIGNING_CTRL_FAILURE + {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE}, + #else + {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, 147}, + #endif + #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 148}, + #endif + #ifdef PKCS7_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR}, + #else + {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, 129}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE + {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE}, + #else + {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, 106}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO + {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO}, + #else + {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, 107}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST + {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST}, + #else + {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, 108}, + #endif + #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE + {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE}, + #else + {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, 109}, + #endif + #ifdef PKCS7_R_UNKNOWN_OPERATION + {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION}, + #else + {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, 110}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE + {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE}, + #else + {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, 111}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, 112}, + #endif + #ifdef PKCS7_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE}, + #else + {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, 113}, + #endif + #ifdef PKCS7_R_WRONG_PKCS7_TYPE + {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE}, + #else + {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, 114}, + #endif + #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG}, + #else + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, 102}, + #endif + #ifdef RAND_R_ALREADY_INSTANTIATED + {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED}, + #else + {"ALREADY_INSTANTIATED", ERR_LIB_RAND, 103}, + #endif + #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE + {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE}, + #else + {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, 105}, + #endif + #ifdef RAND_R_CANNOT_OPEN_FILE + {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE}, + #else + {"CANNOT_OPEN_FILE", ERR_LIB_RAND, 121}, + #endif + #ifdef RAND_R_DRBG_ALREADY_INITIALIZED + {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED}, + #else + {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, 129}, + #endif + #ifdef RAND_R_DRBG_NOT_INITIALISED + {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED}, + #else + {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, 104}, + #endif + #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG + {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG}, + #else + {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, 106}, + #endif + #ifdef RAND_R_ENTROPY_OUT_OF_RANGE + {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE}, + #else + {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, 124}, + #endif + #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED + {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED}, + #else + {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, 127}, + #endif + #ifdef RAND_R_ERROR_INITIALISING_DRBG + {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG}, + #else + {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, 107}, + #endif + #ifdef RAND_R_ERROR_INSTANTIATING_DRBG + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG}, + #else + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, 108}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT}, + #else + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, 109}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY}, + #else + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, 110}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_NONCE + {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE}, + #else + {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, 111}, + #endif + #ifdef RAND_R_FAILED_TO_CREATE_LOCK + {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK}, + #else + {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, 126}, + #endif + #ifdef RAND_R_FUNC_NOT_IMPLEMENTED + {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED}, + #else + {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, 101}, + #endif + #ifdef RAND_R_FWRITE_ERROR + {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR}, + #else + {"FWRITE_ERROR", ERR_LIB_RAND, 123}, + #endif + #ifdef RAND_R_GENERATE_ERROR + {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR}, + #else + {"GENERATE_ERROR", ERR_LIB_RAND, 112}, + #endif + #ifdef RAND_R_INTERNAL_ERROR + {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR}, + #else + {"INTERNAL_ERROR", ERR_LIB_RAND, 113}, + #endif + #ifdef RAND_R_IN_ERROR_STATE + {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE}, + #else + {"IN_ERROR_STATE", ERR_LIB_RAND, 114}, + #endif + #ifdef RAND_R_NOT_A_REGULAR_FILE + {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE}, + #else + {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, 122}, + #endif + #ifdef RAND_R_NOT_INSTANTIATED + {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED}, + #else + {"NOT_INSTANTIATED", ERR_LIB_RAND, 115}, + #endif + #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED + {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED}, + #else + {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, 128}, + #endif + #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED}, + #else + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, 130}, + #endif + #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK}, + #else + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, 131}, + #endif + #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG}, + #else + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, 116}, + #endif + #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED}, + #else + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, 133}, + #endif + #ifdef RAND_R_PRNG_NOT_SEEDED + {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED}, + #else + {"PRNG_NOT_SEEDED", ERR_LIB_RAND, 100}, + #endif + #ifdef RAND_R_RANDOM_POOL_OVERFLOW + {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW}, + #else + {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, 125}, + #endif + #ifdef RAND_R_RANDOM_POOL_UNDERFLOW + {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW}, + #else + {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, 134}, + #endif + #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG}, + #else + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, 117}, + #endif + #ifdef RAND_R_RESEED_ERROR + {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR}, + #else + {"RESEED_ERROR", ERR_LIB_RAND, 118}, + #endif + #ifdef RAND_R_SELFTEST_FAILURE + {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE}, + #else + {"SELFTEST_FAILURE", ERR_LIB_RAND, 119}, + #endif + #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED + {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED}, + #else + {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, 135}, + #endif + #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED + {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED}, + #else + {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, 136}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS + {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS}, + #else + {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, 132}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE + {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE}, + #else + {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, 120}, + #endif + #ifdef RSA_R_ALGORITHM_MISMATCH + {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH}, + #else + {"ALGORITHM_MISMATCH", ERR_LIB_RSA, 100}, + #endif + #ifdef RSA_R_BAD_E_VALUE + {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE}, + #else + {"BAD_E_VALUE", ERR_LIB_RSA, 101}, + #endif + #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT + {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT}, + #else + {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, 102}, + #endif + #ifdef RSA_R_BAD_PAD_BYTE_COUNT + {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT}, + #else + {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, 103}, + #endif + #ifdef RSA_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", ERR_LIB_RSA, 104}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01 + {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01}, + #else + {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, 106}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02 + {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02}, + #else + {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, 107}, + #endif + #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN + {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN}, + #else + {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, 108}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE + {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE}, + #else + {"DATA_TOO_LARGE", ERR_LIB_RSA, 109}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE}, + #else + {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, 110}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS + {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS}, + #else + {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, 132}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL + {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL}, + #else + {"DATA_TOO_SMALL", ERR_LIB_RSA, 111}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE + {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE}, + #else + {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, 122}, + #endif + #ifdef RSA_R_DIGEST_DOES_NOT_MATCH + {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH}, + #else + {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, 158}, + #endif + #ifdef RSA_R_DIGEST_NOT_ALLOWED + {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED}, + #else + {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 145}, + #endif + #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY + {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY}, + #else + {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, 112}, + #endif + #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D + {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D}, + #else + {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 124}, + #endif + #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D + {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D}, + #else + {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 125}, + #endif + #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1 + {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1}, + #else + {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, 123}, + #endif + #ifdef RSA_R_FIRST_OCTET_INVALID + {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID}, + #else + {"FIRST_OCTET_INVALID", ERR_LIB_RSA, 133}, + #endif + #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, + #else + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, 144}, + #endif + #ifdef RSA_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_RSA, 157}, + #endif + #ifdef RSA_R_INVALID_DIGEST_LENGTH + {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH}, + #else + {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, 143}, + #endif + #ifdef RSA_R_INVALID_HEADER + {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER}, + #else + {"INVALID_HEADER", ERR_LIB_RSA, 137}, + #endif + #ifdef RSA_R_INVALID_LABEL + {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL}, + #else + {"INVALID_LABEL", ERR_LIB_RSA, 160}, + #endif + #ifdef RSA_R_INVALID_MESSAGE_LENGTH + {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH}, + #else + {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, 131}, + #endif + #ifdef RSA_R_INVALID_MGF1_MD + {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD}, + #else + {"INVALID_MGF1_MD", ERR_LIB_RSA, 156}, + #endif + #ifdef RSA_R_INVALID_MULTI_PRIME_KEY + {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY}, + #else + {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, 167}, + #endif + #ifdef RSA_R_INVALID_OAEP_PARAMETERS + {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS}, + #else + {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, 161}, + #endif + #ifdef RSA_R_INVALID_PADDING + {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING}, + #else + {"INVALID_PADDING", ERR_LIB_RSA, 138}, + #endif + #ifdef RSA_R_INVALID_PADDING_MODE + {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE}, + #else + {"INVALID_PADDING_MODE", ERR_LIB_RSA, 141}, + #endif + #ifdef RSA_R_INVALID_PSS_PARAMETERS + {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS}, + #else + {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, 149}, + #endif + #ifdef RSA_R_INVALID_PSS_SALTLEN + {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN}, + #else + {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, 146}, + #endif + #ifdef RSA_R_INVALID_SALT_LENGTH + {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH}, + #else + {"INVALID_SALT_LENGTH", ERR_LIB_RSA, 150}, + #endif + #ifdef RSA_R_INVALID_TRAILER + {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER}, + #else + {"INVALID_TRAILER", ERR_LIB_RSA, 139}, + #endif + #ifdef RSA_R_INVALID_X931_DIGEST + {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST}, + #else + {"INVALID_X931_DIGEST", ERR_LIB_RSA, 142}, + #endif + #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q + {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q}, + #else + {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, 126}, + #endif + #ifdef RSA_R_KEY_PRIME_NUM_INVALID + {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID}, + #else + {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, 165}, + #endif + #ifdef RSA_R_KEY_SIZE_TOO_SMALL + {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL}, + #else + {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, 120}, + #endif + #ifdef RSA_R_LAST_OCTET_INVALID + {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID}, + #else + {"LAST_OCTET_INVALID", ERR_LIB_RSA, 134}, + #endif + #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED + {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED}, + #else + {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 152}, + #endif + #ifdef RSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, 179}, + #endif + #ifdef RSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", ERR_LIB_RSA, 105}, + #endif + #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R}, + #else + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, 168}, + #endif + #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D}, + #else + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 169}, + #endif + #ifdef RSA_R_MP_R_NOT_PRIME + {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME}, + #else + {"MP_R_NOT_PRIME", ERR_LIB_RSA, 170}, + #endif + #ifdef RSA_R_NO_PUBLIC_EXPONENT + {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT}, + #else + {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, 140}, + #endif + #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING + {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING}, + #else + {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, 113}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES}, + #else + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, 172}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q + {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q}, + #else + {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, 127}, + #endif + #ifdef RSA_R_OAEP_DECODING_ERROR + {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR}, + #else + {"OAEP_DECODING_ERROR", ERR_LIB_RSA, 121}, + #endif + #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, 148}, + #endif + #ifdef RSA_R_PADDING_CHECK_FAILED + {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED}, + #else + {"PADDING_CHECK_FAILED", ERR_LIB_RSA, 114}, + #endif + #ifdef RSA_R_PKCS_DECODING_ERROR + {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR}, + #else + {"PKCS_DECODING_ERROR", ERR_LIB_RSA, 159}, + #endif + #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL}, + #else + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, 164}, + #endif + #ifdef RSA_R_P_NOT_PRIME + {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME}, + #else + {"P_NOT_PRIME", ERR_LIB_RSA, 128}, + #endif + #ifdef RSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", ERR_LIB_RSA, 129}, + #endif + #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED + {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED}, + #else + {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, 130}, + #endif + #ifdef RSA_R_SLEN_CHECK_FAILED + {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED}, + #else + {"SLEN_CHECK_FAILED", ERR_LIB_RSA, 136}, + #endif + #ifdef RSA_R_SLEN_RECOVERY_FAILED + {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED}, + #else + {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, 135}, + #endif + #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK + {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK}, + #else + {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, 115}, + #endif + #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, + #else + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, 116}, + #endif + #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE + {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE}, + #else + {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, 117}, + #endif + #ifdef RSA_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", ERR_LIB_RSA, 166}, + #endif + #ifdef RSA_R_UNKNOWN_MASK_DIGEST + {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST}, + #else + {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, 151}, + #endif + #ifdef RSA_R_UNKNOWN_PADDING_TYPE + {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE}, + #else + {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, 118}, + #endif + #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE}, + #else + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, 162}, + #endif + #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE}, + #else + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, 163}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM + {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM}, + #else + {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, 153}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER + {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER}, + #else + {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, 154}, + #endif + #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE + {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE}, + #else + {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, 155}, + #endif + #ifdef RSA_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", ERR_LIB_RSA, 147}, + #endif + #ifdef RSA_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, 119}, + #endif + #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY}, + #else + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, 291}, + #endif + #ifdef SSL_R_APP_DATA_IN_HANDSHAKE + {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, + #else + {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100}, + #endif + #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, + #else + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE}, + #else + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, 143}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE}, + #else + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, 158}, + #endif + #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC + {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, + #else + {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103}, + #endif + #ifdef SSL_R_BAD_CIPHER + {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER}, + #else + {"BAD_CIPHER", ERR_LIB_SSL, 186}, + #endif + #ifdef SSL_R_BAD_DATA + {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, + #else + {"BAD_DATA", ERR_LIB_SSL, 390}, + #endif + #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK + {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, + #else + {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106}, + #endif + #ifdef SSL_R_BAD_DECOMPRESSION + {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, + #else + {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107}, + #endif + #ifdef SSL_R_BAD_DH_VALUE + {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE}, + #else + {"BAD_DH_VALUE", ERR_LIB_SSL, 102}, + #endif + #ifdef SSL_R_BAD_DIGEST_LENGTH + {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, + #else + {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111}, + #endif + #ifdef SSL_R_BAD_EARLY_DATA + {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA}, + #else + {"BAD_EARLY_DATA", ERR_LIB_SSL, 233}, + #endif + #ifdef SSL_R_BAD_ECC_CERT + {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, + #else + {"BAD_ECC_CERT", ERR_LIB_SSL, 304}, + #endif + #ifdef SSL_R_BAD_ECDSA_SIGNATURE + {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE}, + #else + {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305}, + #endif + #ifdef SSL_R_BAD_ECPOINT + {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, + #else + {"BAD_ECPOINT", ERR_LIB_SSL, 306}, + #endif + #ifdef SSL_R_BAD_EXTENSION + {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION}, + #else + {"BAD_EXTENSION", ERR_LIB_SSL, 110}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_LENGTH + {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, + #else + {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_STATE + {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE}, + #else + {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, 236}, + #endif + #ifdef SSL_R_BAD_HELLO_REQUEST + {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, + #else + {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105}, + #endif + #ifdef SSL_R_BAD_HRR_VERSION + {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION}, + #else + {"BAD_HRR_VERSION", ERR_LIB_SSL, 263}, + #endif + #ifdef SSL_R_BAD_KEY_SHARE + {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE}, + #else + {"BAD_KEY_SHARE", ERR_LIB_SSL, 108}, + #endif + #ifdef SSL_R_BAD_KEY_UPDATE + {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE}, + #else + {"BAD_KEY_UPDATE", ERR_LIB_SSL, 122}, + #endif + #ifdef SSL_R_BAD_LEGACY_VERSION + {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION}, + #else + {"BAD_LEGACY_VERSION", ERR_LIB_SSL, 292}, + #endif + #ifdef SSL_R_BAD_LENGTH + {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, + #else + {"BAD_LENGTH", ERR_LIB_SSL, 271}, + #endif + #ifdef SSL_R_BAD_MAC_LENGTH + {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH}, + #else + {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333}, + #endif + #ifdef SSL_R_BAD_PACKET + {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET}, + #else + {"BAD_PACKET", ERR_LIB_SSL, 240}, + #endif + #ifdef SSL_R_BAD_PACKET_LENGTH + {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, + #else + {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115}, + #endif + #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER + {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, + #else + {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116}, + #endif + #ifdef SSL_R_BAD_PSK + {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK}, + #else + {"BAD_PSK", ERR_LIB_SSL, 219}, + #endif + #ifdef SSL_R_BAD_PSK_IDENTITY + {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY}, + #else + {"BAD_PSK_IDENTITY", ERR_LIB_SSL, 114}, + #endif + #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH + {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH}, + #else + {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316}, + #endif + #ifdef SSL_R_BAD_RECORD_TYPE + {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE}, + #else + {"BAD_RECORD_TYPE", ERR_LIB_SSL, 443}, + #endif + #ifdef SSL_R_BAD_RSA_ENCRYPT + {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, + #else + {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119}, + #endif + #ifdef SSL_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", ERR_LIB_SSL, 123}, + #endif + #ifdef SSL_R_BAD_SRP_A_LENGTH + {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, + #else + {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347}, + #endif + #ifdef SSL_R_BAD_SRP_B_LENGTH + {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH}, + #else + {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348}, + #endif + #ifdef SSL_R_BAD_SRP_G_LENGTH + {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH}, + #else + {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349}, + #endif + #ifdef SSL_R_BAD_SRP_N_LENGTH + {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH}, + #else + {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350}, + #endif + #ifdef SSL_R_BAD_SRP_PARAMETERS + {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, + #else + {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371}, + #endif + #ifdef SSL_R_BAD_SRP_S_LENGTH + {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH}, + #else + {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351}, + #endif + #ifdef SSL_R_BAD_SRTP_MKI_VALUE + {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, + #else + {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352}, + #endif + #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST + {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353}, + #endif + #ifdef SSL_R_BAD_SSL_FILETYPE + {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, + #else + {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124}, + #endif + #ifdef SSL_R_BAD_VALUE + {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, + #else + {"BAD_VALUE", ERR_LIB_SSL, 384}, + #endif + #ifdef SSL_R_BAD_WRITE_RETRY + {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, + #else + {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127}, + #endif + #ifdef SSL_R_BINDER_DOES_NOT_VERIFY + {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY}, + #else + {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, 253}, + #endif + #ifdef SSL_R_BIO_NOT_SET + {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, + #else + {"BIO_NOT_SET", ERR_LIB_SSL, 128}, + #endif + #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG + {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, + #else + {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129}, + #endif + #ifdef SSL_R_BN_LIB + {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, + #else + {"BN_LIB", ERR_LIB_SSL, 130}, + #endif + #ifdef SSL_R_CALLBACK_FAILED + {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED}, + #else + {"CALLBACK_FAILED", ERR_LIB_SSL, 234}, + #endif + #ifdef SSL_R_CANNOT_CHANGE_CIPHER + {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER}, + #else + {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, 109}, + #endif + #ifdef SSL_R_CA_DN_LENGTH_MISMATCH + {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, + #else + {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131}, + #endif + #ifdef SSL_R_CA_KEY_TOO_SMALL + {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, + #else + {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397}, + #endif + #ifdef SSL_R_CA_MD_TOO_WEAK + {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, + #else + {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398}, + #endif + #ifdef SSL_R_CCS_RECEIVED_EARLY + {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, + #else + {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133}, + #endif + #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED + {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, + #else + {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134}, + #endif + #ifdef SSL_R_CERT_CB_ERROR + {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, + #else + {"CERT_CB_ERROR", ERR_LIB_SSL, 377}, + #endif + #ifdef SSL_R_CERT_LENGTH_MISMATCH + {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, + #else + {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135}, + #endif + #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED + {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED}, + #else + {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, 218}, + #endif + #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH + {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, + #else + {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137}, + #endif + #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE + {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, + #else + {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138}, + #endif + #ifdef SSL_R_CLIENTHELLO_TLSEXT + {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, + #else + {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226}, + #endif + #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG + {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, + #else + {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140}, + #endif + #ifdef SSL_R_COMPRESSION_DISABLED + {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, + #else + {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343}, + #endif + #ifdef SSL_R_COMPRESSION_FAILURE + {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, + #else + {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141}, + #endif + #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, + #else + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307}, + #endif + #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR + {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, + #else + {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142}, + #endif + #ifdef SSL_R_CONNECTION_TYPE_NOT_SET + {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, + #else + {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144}, + #endif + #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED + {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED}, + #else + {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, 167}, + #endif + #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE + {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE}, + #else + {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, 400}, + #endif + #ifdef SSL_R_COOKIE_MISMATCH + {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, + #else + {"COOKIE_MISMATCH", ERR_LIB_SSL, 308}, + #endif + #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED}, + #else + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, 206}, + #endif + #ifdef SSL_R_DANE_ALREADY_ENABLED + {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED}, + #else + {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, 172}, + #endif + #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL}, + #else + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, 173}, + #endif + #ifdef SSL_R_DANE_NOT_ENABLED + {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED}, + #else + {"DANE_NOT_ENABLED", ERR_LIB_SSL, 175}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE + {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, 180}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, 184}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH + {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH}, + #else + {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, 189}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH + {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH}, + #else + {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, 192}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE + {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE}, + #else + {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, 200}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY + {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY}, + #else + {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, 201}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR + {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR}, + #else + {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, 202}, + #endif + #ifdef SSL_R_DANE_TLSA_NULL_DATA + {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA}, + #else + {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, 203}, + #endif + #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED + {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, + #else + {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145}, + #endif + #ifdef SSL_R_DATA_LENGTH_TOO_LONG + {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, + #else + {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED + {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, + #else + {"DECRYPTION_FAILED", ERR_LIB_SSL, 147}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, + #else + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281}, + #endif + #ifdef SSL_R_DH_KEY_TOO_SMALL + {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, + #else + {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394}, + #endif + #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, + #else + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148}, + #endif + #ifdef SSL_R_DIGEST_CHECK_FAILED + {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, + #else + {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149}, + #endif + #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG + {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, + #else + {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334}, + #endif + #ifdef SSL_R_DUPLICATE_COMPRESSION_ID + {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, + #else + {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309}, + #endif + #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT + {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT}, + #else + {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317}, + #endif + #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING + {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, + #else + {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318}, + #endif + #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE + {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE}, + #else + {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322}, + #endif + #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE + {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE}, + #else + {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323}, + #endif + #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE + {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, + #else + {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374}, + #endif + #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER + {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER}, + #else + {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310}, + #endif + #ifdef SSL_R_EE_KEY_TOO_SMALL + {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, + #else + {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399}, + #endif + #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354}, + #endif + #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG + {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, + #else + {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150}, + #endif + #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST + {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, + #else + {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151}, + #endif + #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN + {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN}, + #else + {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, 204}, + #endif + #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE + {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE}, + #else + {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, 194}, + #endif + #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE + {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, + #else + {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152}, + #endif + #ifdef SSL_R_EXTENSION_NOT_RECEIVED + {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED}, + #else + {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, 279}, + #endif + #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE + {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, + #else + {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153}, + #endif + #ifdef SSL_R_EXT_LENGTH_MISMATCH + {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH}, + #else + {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, 163}, + #endif + #ifdef SSL_R_FAILED_TO_INIT_ASYNC + {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC}, + #else + {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, 405}, + #endif + #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO + {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO}, + #else + {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, 401}, + #endif + #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS + {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, + #else + {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154}, + #endif + #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS + {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS}, + #else + {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355}, + #endif + #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION + {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION}, + #else + {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356}, + #endif + #ifdef SSL_R_HTTPS_PROXY_REQUEST + {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, + #else + {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155}, + #endif + #ifdef SSL_R_HTTP_REQUEST + {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, + #else + {"HTTP_REQUEST", ERR_LIB_SSL, 156}, + #endif + #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION + {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION}, + #else + {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, 162}, + #endif + #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST + {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, + #else + {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380}, + #endif + #ifdef SSL_R_INAPPROPRIATE_FALLBACK + {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, + #else + {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373}, + #endif + #ifdef SSL_R_INCONSISTENT_COMPRESSION + {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, + #else + {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN + {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN}, + #else + {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, 222}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI + {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI}, + #else + {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, 231}, + #endif + #ifdef SSL_R_INCONSISTENT_EXTMS + {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS}, + #else + {"INCONSISTENT_EXTMS", ERR_LIB_SSL, 104}, + #endif + #ifdef SSL_R_INSUFFICIENT_SECURITY + {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY}, + #else + {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, 241}, + #endif + #ifdef SSL_R_INVALID_ALERT + {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT}, + #else + {"INVALID_ALERT", ERR_LIB_SSL, 205}, + #endif + #ifdef SSL_R_INVALID_CCS_MESSAGE + {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE}, + #else + {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, 260}, + #endif + #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG + {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG}, + #else + {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, 238}, + #endif + #ifdef SSL_R_INVALID_COMMAND + {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, + #else + {"INVALID_COMMAND", ERR_LIB_SSL, 280}, + #endif + #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM + {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, + #else + {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341}, + #endif + #ifdef SSL_R_INVALID_CONFIG + {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG}, + #else + {"INVALID_CONFIG", ERR_LIB_SSL, 283}, + #endif + #ifdef SSL_R_INVALID_CONFIGURATION_NAME + {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME}, + #else + {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, 113}, + #endif + #ifdef SSL_R_INVALID_CONTEXT + {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT}, + #else + {"INVALID_CONTEXT", ERR_LIB_SSL, 282}, + #endif + #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE + {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE}, + #else + {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, 212}, + #endif + #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE + {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE}, + #else + {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, 120}, + #endif + #ifdef SSL_R_INVALID_MAX_EARLY_DATA + {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA}, + #else + {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, 174}, + #endif + #ifdef SSL_R_INVALID_NULL_CMD_NAME + {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, + #else + {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385}, + #endif + #ifdef SSL_R_INVALID_SEQUENCE_NUMBER + {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER}, + #else + {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, 402}, + #endif + #ifdef SSL_R_INVALID_SERVERINFO_DATA + {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, + #else + {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388}, + #endif + #ifdef SSL_R_INVALID_SESSION_ID + {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID}, + #else + {"INVALID_SESSION_ID", ERR_LIB_SSL, 999}, + #endif + #ifdef SSL_R_INVALID_SRP_USERNAME + {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, + #else + {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357}, + #endif + #ifdef SSL_R_INVALID_STATUS_RESPONSE + {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, + #else + {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328}, + #endif + #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH + {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, + #else + {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325}, + #endif + #ifdef SSL_R_KRB5_S_TKT_NYV + {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV}, + #else + {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294}, + #endif + #ifdef SSL_R_KRB5_S_TKT_SKEW + {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW}, + #else + {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295}, + #endif + #ifdef SSL_R_LENGTH_MISMATCH + {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, + #else + {"LENGTH_MISMATCH", ERR_LIB_SSL, 159}, + #endif + #ifdef SSL_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", ERR_LIB_SSL, 404}, + #endif + #ifdef SSL_R_LENGTH_TOO_SHORT + {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, + #else + {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160}, + #endif + #ifdef SSL_R_LIBRARY_BUG + {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, + #else + {"LIBRARY_BUG", ERR_LIB_SSL, 274}, + #endif + #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS + {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, + #else + {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161}, + #endif + #ifdef SSL_R_MESSAGE_TOO_LONG + {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG}, + #else + {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296}, + #endif + #ifdef SSL_R_MISSING_DSA_SIGNING_CERT + {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, + #else + {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165}, + #endif + #ifdef SSL_R_MISSING_ECDH_CERT + {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT}, + #else + {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382}, + #endif + #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT + {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, + #else + {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381}, + #endif + #ifdef SSL_R_MISSING_FATAL + {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL}, + #else + {"MISSING_FATAL", ERR_LIB_SSL, 256}, + #endif + #ifdef SSL_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_SSL, 290}, + #endif + #ifdef SSL_R_MISSING_RSA_CERTIFICATE + {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, + #else + {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168}, + #endif + #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT + {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, + #else + {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169}, + #endif + #ifdef SSL_R_MISSING_RSA_SIGNING_CERT + {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, + #else + {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170}, + #endif + #ifdef SSL_R_MISSING_SIGALGS_EXTENSION + {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION}, + #else + {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, 112}, + #endif + #ifdef SSL_R_MISSING_SIGNING_CERT + {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT}, + #else + {"MISSING_SIGNING_CERT", ERR_LIB_SSL, 221}, + #endif + #ifdef SSL_R_MISSING_SRP_PARAM + {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, + #else + {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358}, + #endif + #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION + {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION}, + #else + {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, 209}, + #endif + #ifdef SSL_R_MISSING_TMP_DH_KEY + {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, + #else + {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171}, + #endif + #ifdef SSL_R_MISSING_TMP_ECDH_KEY + {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, + #else + {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311}, + #endif + #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA}, + #else + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, 293}, + #endif + #ifdef SSL_R_MULTIPLE_SGC_RESTARTS + {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS}, + #else + {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346}, + #endif + #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY + {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY}, + #else + {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, 182}, + #endif + #ifdef SSL_R_NOT_REPLACING_CERTIFICATE + {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE}, + #else + {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, 289}, + #endif + #ifdef SSL_R_NOT_SERVER + {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER}, + #else + {"NOT_SERVER", ERR_LIB_SSL, 284}, + #endif + #ifdef SSL_R_NO_APPLICATION_PROTOCOL + {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL}, + #else + {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, 235}, + #endif + #ifdef SSL_R_NO_CERTIFICATES_RETURNED + {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, + #else + {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED + {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, + #else + {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_SET + {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, + #else + {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179}, + #endif + #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR + {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR}, + #else + {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, 214}, + #endif + #ifdef SSL_R_NO_CIPHERS_AVAILABLE + {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, + #else + {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181}, + #endif + #ifdef SSL_R_NO_CIPHERS_SPECIFIED + {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, + #else + {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183}, + #endif + #ifdef SSL_R_NO_CIPHER_MATCH + {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, + #else + {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185}, + #endif + #ifdef SSL_R_NO_CLIENT_CERT_METHOD + {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, + #else + {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331}, + #endif + #ifdef SSL_R_NO_COMPRESSION_SPECIFIED + {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, + #else + {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187}, + #endif + #ifdef SSL_R_NO_COOKIE_CALLBACK_SET + {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET}, + #else + {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, 287}, + #endif + #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, + #else + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330}, + #endif + #ifdef SSL_R_NO_METHOD_SPECIFIED + {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, + #else + {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188}, + #endif + #ifdef SSL_R_NO_PEM_EXTENSIONS + {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, + #else + {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389}, + #endif + #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED + {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, + #else + {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190}, + #endif + #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE + {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, + #else + {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191}, + #endif + #ifdef SSL_R_NO_RENEGOTIATION + {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, + #else + {"NO_RENEGOTIATION", ERR_LIB_SSL, 339}, + #endif + #ifdef SSL_R_NO_REQUIRED_DIGEST + {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, + #else + {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324}, + #endif + #ifdef SSL_R_NO_SHARED_CIPHER + {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, + #else + {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193}, + #endif + #ifdef SSL_R_NO_SHARED_GROUPS + {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS}, + #else + {"NO_SHARED_GROUPS", ERR_LIB_SSL, 410}, + #endif + #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS + {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS}, + #else + {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, 376}, + #endif + #ifdef SSL_R_NO_SRTP_PROFILES + {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, + #else + {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359}, + #endif + #ifdef SSL_R_NO_SUITABLE_KEY_SHARE + {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE}, + #else + {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, 101}, + #endif + #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM + {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM}, + #else + {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, 118}, + #endif + #ifdef SSL_R_NO_VALID_SCTS + {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS}, + #else + {"NO_VALID_SCTS", ERR_LIB_SSL, 216}, + #endif + #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK + {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK}, + #else + {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, 403}, + #endif + #ifdef SSL_R_NULL_SSL_CTX + {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, + #else + {"NULL_SSL_CTX", ERR_LIB_SSL, 195}, + #endif + #ifdef SSL_R_NULL_SSL_METHOD_PASSED + {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, + #else + {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196}, + #endif + #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED + {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, + #else + {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197}, + #endif + #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, + #else + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344}, + #endif + #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE + {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #else + {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387}, + #endif + #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE + {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #else + {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379}, + #endif + #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE + {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE}, + #else + {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297}, + #endif + #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG + {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG}, + #else + {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327}, + #endif + #ifdef SSL_R_OVERFLOW_ERROR + {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR}, + #else + {"OVERFLOW_ERROR", ERR_LIB_SSL, 237}, + #endif + #ifdef SSL_R_PACKET_LENGTH_TOO_LONG + {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, + #else + {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198}, + #endif + #ifdef SSL_R_PARSE_TLSEXT + {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, + #else + {"PARSE_TLSEXT", ERR_LIB_SSL, 227}, + #endif + #ifdef SSL_R_PATH_TOO_LONG + {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, + #else + {"PATH_TOO_LONG", ERR_LIB_SSL, 270}, + #endif + #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, + #else + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199}, + #endif + #ifdef SSL_R_PEM_NAME_BAD_PREFIX + {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, + #else + {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391}, + #endif + #ifdef SSL_R_PEM_NAME_TOO_SHORT + {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, + #else + {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392}, + #endif + #ifdef SSL_R_PIPELINE_FAILURE + {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE}, + #else + {"PIPELINE_FAILURE", ERR_LIB_SSL, 406}, + #endif + #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR}, + #else + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, 278}, + #endif + #ifdef SSL_R_PRIVATE_KEY_MISMATCH + {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH}, + #else + {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, 288}, + #endif + #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN + {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, + #else + {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207}, + #endif + #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND + {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, + #else + {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223}, + #endif + #ifdef SSL_R_PSK_NO_CLIENT_CB + {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, + #else + {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224}, + #endif + #ifdef SSL_R_PSK_NO_SERVER_CB + {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, + #else + {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225}, + #endif + #ifdef SSL_R_READ_BIO_NOT_SET + {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, + #else + {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211}, + #endif + #ifdef SSL_R_READ_TIMEOUT_EXPIRED + {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, + #else + {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312}, + #endif + #ifdef SSL_R_RECORD_LENGTH_MISMATCH + {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, + #else + {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213}, + #endif + #ifdef SSL_R_RECORD_TOO_SMALL + {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, + #else + {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298}, + #endif + #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG + {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, #else {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335}, #endif - #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR - {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, + #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR + {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, + #else + {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336}, + #endif + #ifdef SSL_R_RENEGOTIATION_MISMATCH + {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, + #else + {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337}, + #endif + #ifdef SSL_R_REQUEST_PENDING + {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING}, + #else + {"REQUEST_PENDING", ERR_LIB_SSL, 285}, + #endif + #ifdef SSL_R_REQUEST_SENT + {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT}, + #else + {"REQUEST_SENT", ERR_LIB_SSL, 286}, + #endif + #ifdef SSL_R_REQUIRED_CIPHER_MISSING + {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, + #else + {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215}, + #endif + #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING}, + #else + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342}, + #endif + #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, + #else + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345}, + #endif + #ifdef SSL_R_SCT_VERIFICATION_FAILED + {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED}, + #else + {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, 208}, + #endif + #ifdef SSL_R_SERVERHELLO_TLSEXT + {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, + #else + {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275}, + #endif + #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED + {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, + #else + {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277}, + #endif + #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT + {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT}, + #else + {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, 407}, + #endif + #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR + {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, + #else + {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360}, + #endif + #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, + #else + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220}, + #endif + #ifdef SSL_R_SRP_A_CALC + {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, + #else + {"SRP_A_CALC", ERR_LIB_SSL, 361}, + #endif + #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, + #else + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362}, + #endif + #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, + #else + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363}, + #endif + #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE + {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, + #else + {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364}, + #endif + #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG + {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG}, + #else + {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT + {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT}, + #else + {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH}, + #else + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, 232}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME + {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, + #else + {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, + #else + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320}, + #endif + #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG + {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, + #else + {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE + {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, + #else + {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC + {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, + #else + {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, + #else + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED + {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, + #else + {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, + #else + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046}, + #endif + #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, + #else + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030}, + #endif + #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE + {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, + #else + {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040}, + #endif + #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER + {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, + #else + {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047}, + #endif + #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE + {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, + #else + {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, + #else + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, + #else + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, 117}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, 125}, + #endif + #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, + #else + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228}, + #endif + #ifdef SSL_R_SSL_HANDSHAKE_FAILURE + {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, + #else + {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229}, + #endif + #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS + {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, + #else + {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230}, + #endif + #ifdef SSL_R_SSL_NEGATIVE_LENGTH + {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, + #else + {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372}, + #endif + #ifdef SSL_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", ERR_LIB_SSL, 126}, + #endif + #ifdef SSL_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, 136}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED + {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, + #else + {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONFLICT + {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, + #else + {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, + #else + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH + {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, + #else + {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG + {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG}, + #else + {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 408}, + #endif + #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH + {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH}, + #else + {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, 210}, + #endif + #ifdef SSL_R_STILL_IN_INIT + {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT}, + #else + {"STILL_IN_INIT", ERR_LIB_SSL, 121}, + #endif + #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED}, + #else + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, 1116}, + #endif + #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION + {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION}, + #else + {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, 1109}, + #endif + #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED + {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, + #else + {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR + {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, + #else + {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED + {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, + #else + {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR + {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, + #else + {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051}, + #endif + #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION + {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, + #else + {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, + #else + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, + #else + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR + {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, + #else + {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080}, + #endif + #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION + {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, + #else + {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100}, + #endif + #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION + {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, + #else + {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070}, + #endif + #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW + {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, + #else + {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022}, + #endif + #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA + {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, + #else + {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048}, + #endif + #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED + {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, + #else + {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, + #else + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, + #else + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113}, + #endif + #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE + {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, + #else + {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111}, + #endif + #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME + {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, + #else + {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112}, + #endif + #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION + {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, + #else + {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110}, + #endif + #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, + #else + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365}, + #endif + #ifdef SSL_R_TLS_HEARTBEAT_PENDING + {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, + #else + {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366}, + #endif + #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL + {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, + #else + {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367}, + #endif + #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST + {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, #else - {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336}, + {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157}, #endif - #ifdef SSL_R_RENEGOTIATION_MISMATCH - {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, + #ifdef SSL_R_TOO_MANY_KEY_UPDATES + {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES}, #else - {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337}, + {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, 132}, #endif - #ifdef SSL_R_REQUIRED_CIPHER_MISSING - {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, + #ifdef SSL_R_TOO_MANY_WARN_ALERTS + {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS}, #else - {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215}, + {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, 409}, #endif - #ifdef SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING - {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING}, + #ifdef SSL_R_TOO_MUCH_EARLY_DATA + {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA}, #else - {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342}, + {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, 164}, #endif - #ifdef SSL_R_REUSE_CERT_LENGTH_NOT_ZERO - {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CERT_LENGTH_NOT_ZERO}, + #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS + {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS}, #else - {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, 216}, + {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313}, #endif - #ifdef SSL_R_REUSE_CERT_TYPE_NOT_ZERO - {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CERT_TYPE_NOT_ZERO}, + #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS + {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, #else - {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, 217}, + {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314}, #endif - #ifdef SSL_R_REUSE_CIPHER_LIST_NOT_ZERO - {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CIPHER_LIST_NOT_ZERO}, + #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, #else - {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, 218}, + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239}, #endif - #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING - {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, #else - {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345}, + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242}, #endif - #ifdef SSL_R_SERVERHELLO_TLSEXT - {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, #else - {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275}, + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243}, #endif - #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED - {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, + #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE + {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE}, #else - {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277}, + {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, 262}, #endif - #ifdef SSL_R_SHORT_READ - {"SHORT_READ", ERR_LIB_SSL, SSL_R_SHORT_READ}, + #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA + {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA}, #else - {"SHORT_READ", ERR_LIB_SSL, 219}, + {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, 178}, #endif - #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR - {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, + #ifdef SSL_R_UNEXPECTED_MESSAGE + {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, #else - {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360}, + {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244}, #endif - #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE - {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, + #ifdef SSL_R_UNEXPECTED_RECORD + {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, #else - {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220}, + {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245}, #endif - #ifdef SSL_R_SRP_A_CALC - {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, + #ifdef SSL_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, #else - {"SRP_A_CALC", ERR_LIB_SSL, 361}, + {"UNINITIALIZED", ERR_LIB_SSL, 276}, #endif - #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES - {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, + #ifdef SSL_R_UNKNOWN_ALERT_TYPE + {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, #else - {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362}, + {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246}, #endif - #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG - {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, + #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE + {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, #else - {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363}, + {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247}, #endif - #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE - {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, + #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED + {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, #else - {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364}, + {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248}, #endif - #ifdef SSL_R_SSL23_DOING_SESSION_ID_REUSE - {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, SSL_R_SSL23_DOING_SESSION_ID_REUSE}, + #ifdef SSL_R_UNKNOWN_CIPHER_TYPE + {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, #else - {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, 221}, + {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249}, #endif - #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG - {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG}, + #ifdef SSL_R_UNKNOWN_CMD_NAME + {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, #else - {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299}, + {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386}, #endif - #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT - {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT}, + #ifdef SSL_R_UNKNOWN_COMMAND + {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND}, #else - {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321}, + {"UNKNOWN_COMMAND", ERR_LIB_SSL, 139}, #endif - #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME - {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, + #ifdef SSL_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368}, + #endif + #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE + {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, + #else + {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250}, + #endif + #ifdef SSL_R_UNKNOWN_PKEY_TYPE + {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, + #else + {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251}, + #endif + #ifdef SSL_R_UNKNOWN_PROTOCOL + {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, + #else + {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252}, + #endif + #ifdef SSL_R_UNKNOWN_SSL_VERSION + {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, + #else + {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254}, + #endif + #ifdef SSL_R_UNKNOWN_STATE + {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, + #else + {"UNKNOWN_STATE", ERR_LIB_SSL, 255}, + #endif + #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, + #else + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338}, + #endif + #ifdef SSL_R_UNSOLICITED_EXTENSION + {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION}, + #else + {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, 217}, + #endif + #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257}, + #endif + #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE + {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE}, + #else + {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326}, + #endif + #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE + {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, + #else + {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315}, + #endif + #ifdef SSL_R_UNSUPPORTED_PROTOCOL + {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, + #else + {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258}, + #endif + #ifdef SSL_R_UNSUPPORTED_SSL_VERSION + {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, + #else + {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259}, + #endif + #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE + {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, + #else + {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329}, + #endif + #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED + {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, + #else + {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369}, + #endif + #ifdef SSL_R_VERSION_TOO_HIGH + {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH}, + #else + {"VERSION_TOO_HIGH", ERR_LIB_SSL, 166}, + #endif + #ifdef SSL_R_VERSION_TOO_LOW + {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, + #else + {"VERSION_TOO_LOW", ERR_LIB_SSL, 396}, + #endif + #ifdef SSL_R_WRONG_CERTIFICATE_TYPE + {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, + #else + {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383}, + #endif + #ifdef SSL_R_WRONG_CIPHER_RETURNED + {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, + #else + {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261}, + #endif + #ifdef SSL_R_WRONG_CURVE + {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, + #else + {"WRONG_CURVE", ERR_LIB_SSL, 378}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_SIZE + {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, + #else + {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_TYPE + {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, + #else + {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370}, + #endif + #ifdef SSL_R_WRONG_SSL_VERSION + {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, + #else + {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266}, + #endif + #ifdef SSL_R_WRONG_VERSION_NUMBER + {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, + #else + {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267}, + #endif + #ifdef SSL_R_X509_LIB + {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, + #else + {"X509_LIB", ERR_LIB_SSL, 268}, + #endif + #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS + {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, + #else + {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269}, + #endif + #ifdef TS_R_BAD_PKCS7_TYPE + {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE}, + #else + {"BAD_PKCS7_TYPE", ERR_LIB_TS, 132}, + #endif + #ifdef TS_R_BAD_TYPE + {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE}, + #else + {"BAD_TYPE", ERR_LIB_TS, 133}, + #endif + #ifdef TS_R_CANNOT_LOAD_CERT + {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT}, + #else + {"CANNOT_LOAD_CERT", ERR_LIB_TS, 137}, + #endif + #ifdef TS_R_CANNOT_LOAD_KEY + {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY}, + #else + {"CANNOT_LOAD_KEY", ERR_LIB_TS, 138}, + #endif + #ifdef TS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, 100}, + #endif + #ifdef TS_R_COULD_NOT_SET_ENGINE + {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE}, + #else + {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, 127}, + #endif + #ifdef TS_R_COULD_NOT_SET_TIME + {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME}, + #else + {"COULD_NOT_SET_TIME", ERR_LIB_TS, 115}, + #endif + #ifdef TS_R_DETACHED_CONTENT + {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT}, + #else + {"DETACHED_CONTENT", ERR_LIB_TS, 134}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR + {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, 116}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR + {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, 139}, + #endif + #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR}, + #else + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, 101}, + #endif + #ifdef TS_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", ERR_LIB_TS, 102}, + #endif + #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE}, + #else + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, 117}, + #endif + #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH + {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH}, + #else + {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, 103}, + #endif + #ifdef TS_R_NONCE_MISMATCH + {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH}, + #else + {"NONCE_MISMATCH", ERR_LIB_TS, 104}, + #endif + #ifdef TS_R_NONCE_NOT_RETURNED + {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED}, + #else + {"NONCE_NOT_RETURNED", ERR_LIB_TS, 105}, + #endif + #ifdef TS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT}, + #else + {"NO_CONTENT", ERR_LIB_TS, 106}, + #endif + #ifdef TS_R_NO_TIME_STAMP_TOKEN + {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN}, + #else + {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, 107}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, 118}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR + {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR}, #else - {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319}, + {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, 119}, #endif - #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE - {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, + #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED + {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED}, #else - {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320}, + {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, 129}, #endif - #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG - {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, + #ifdef TS_R_POLICY_MISMATCH + {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH}, #else - {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300}, + {"POLICY_MISMATCH", ERR_LIB_TS, 108}, #endif - #ifdef SSL_R_SSL3_SESSION_ID_TOO_SHORT - {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_SHORT}, + #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, 222}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, 120}, #endif - #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE - {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, + #ifdef TS_R_RESPONSE_SETUP_ERROR + {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR}, #else - {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042}, + {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, 121}, #endif - #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC - {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, + #ifdef TS_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE}, #else - {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020}, + {"SIGNATURE_FAILURE", ERR_LIB_TS, 109}, #endif - #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED - {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, + #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER + {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER}, #else - {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045}, + {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, 110}, #endif - #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED - {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, + #ifdef TS_R_TIME_SYSCALL_ERROR + {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR}, #else - {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044}, + {"TIME_SYSCALL_ERROR", ERR_LIB_TS, 122}, #endif - #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN - {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, + #ifdef TS_R_TOKEN_NOT_PRESENT + {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT}, #else - {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046}, + {"TOKEN_NOT_PRESENT", ERR_LIB_TS, 130}, #endif - #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE - {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, + #ifdef TS_R_TOKEN_PRESENT + {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT}, #else - {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030}, + {"TOKEN_PRESENT", ERR_LIB_TS, 131}, #endif - #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE - {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, + #ifdef TS_R_TSA_NAME_MISMATCH + {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH}, #else - {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040}, + {"TSA_NAME_MISMATCH", ERR_LIB_TS, 111}, #endif - #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER - {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, + #ifdef TS_R_TSA_UNTRUSTED + {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED}, #else - {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047}, + {"TSA_UNTRUSTED", ERR_LIB_TS, 112}, #endif - #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE - {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, + #ifdef TS_R_TST_INFO_SETUP_ERROR + {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR}, #else - {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041}, + {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, 123}, #endif - #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE - {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, + #ifdef TS_R_TS_DATASIGN + {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN}, #else - {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010}, + {"TS_DATASIGN", ERR_LIB_TS, 124}, #endif - #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE - {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, + #ifdef TS_R_UNACCEPTABLE_POLICY + {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY}, #else - {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043}, + {"UNACCEPTABLE_POLICY", ERR_LIB_TS, 125}, #endif - #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION - {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, + #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM + {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM}, #else - {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228}, + {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, 126}, #endif - #ifdef SSL_R_SSL_HANDSHAKE_FAILURE - {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, + #ifdef TS_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION}, #else - {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229}, + {"UNSUPPORTED_VERSION", ERR_LIB_TS, 113}, #endif - #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS - {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, + #ifdef TS_R_VAR_BAD_VALUE + {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE}, #else - {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230}, + {"VAR_BAD_VALUE", ERR_LIB_TS, 135}, #endif - #ifdef SSL_R_SSL_NEGATIVE_LENGTH - {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, + #ifdef TS_R_VAR_LOOKUP_FAILURE + {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE}, #else - {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372}, + {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, 136}, #endif - #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED - {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, + #ifdef TS_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE}, #else - {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301}, + {"WRONG_CONTENT_TYPE", ERR_LIB_TS, 114}, #endif - #ifdef SSL_R_SSL_SESSION_ID_CONFLICT - {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, + #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS + {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS}, #else - {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302}, + {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, 104}, #endif - #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG - {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, + #ifdef UI_R_INDEX_TOO_LARGE + {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE}, #else - {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273}, + {"INDEX_TOO_LARGE", ERR_LIB_UI, 102}, #endif - #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH - {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, + #ifdef UI_R_INDEX_TOO_SMALL + {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL}, #else - {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303}, + {"INDEX_TOO_SMALL", ERR_LIB_UI, 103}, #endif - #ifdef SSL_R_SSL_SESSION_ID_IS_DIFFERENT - {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_IS_DIFFERENT}, + #ifdef UI_R_NO_RESULT_BUFFER + {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER}, #else - {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, 231}, + {"NO_RESULT_BUFFER", ERR_LIB_UI, 105}, #endif - #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED - {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, + #ifdef UI_R_PROCESSING_ERROR + {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR}, #else - {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049}, + {"PROCESSING_ERROR", ERR_LIB_UI, 107}, #endif - #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR - {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, + #ifdef UI_R_RESULT_TOO_LARGE + {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE}, #else - {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050}, + {"RESULT_TOO_LARGE", ERR_LIB_UI, 100}, #endif - #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED - {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, + #ifdef UI_R_RESULT_TOO_SMALL + {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL}, #else - {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021}, + {"RESULT_TOO_SMALL", ERR_LIB_UI, 101}, #endif - #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR - {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, + #ifdef UI_R_SYSASSIGN_ERROR + {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR}, #else - {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051}, + {"SYSASSIGN_ERROR", ERR_LIB_UI, 109}, #endif - #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION - {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, + #ifdef UI_R_SYSDASSGN_ERROR + {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR}, #else - {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060}, + {"SYSDASSGN_ERROR", ERR_LIB_UI, 110}, #endif - #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK - {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, + #ifdef UI_R_SYSQIOW_ERROR + {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR}, #else - {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086}, + {"SYSQIOW_ERROR", ERR_LIB_UI, 111}, #endif - #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY - {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, + #ifdef UI_R_UNKNOWN_CONTROL_COMMAND + {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND}, #else - {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071}, + {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, 106}, #endif - #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR - {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, + #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE + {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE}, #else - {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080}, + {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, 108}, #endif - #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION - {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, + #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED + {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED}, #else - {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100}, + {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, 112}, #endif - #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION - {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, + #ifdef X509V3_R_BAD_IP_ADDRESS + {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS}, #else - {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070}, + {"BAD_IP_ADDRESS", ERR_LIB_X509V3, 118}, #endif - #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW - {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, + #ifdef X509V3_R_BAD_OBJECT + {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT}, #else - {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022}, + {"BAD_OBJECT", ERR_LIB_X509V3, 119}, #endif - #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA - {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, + #ifdef X509V3_R_BN_DEC2BN_ERROR + {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR}, #else - {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048}, + {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, 100}, #endif - #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED - {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, + #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR + {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR}, #else - {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090}, + {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, 101}, #endif - #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE - {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, + #ifdef X509V3_R_DIRNAME_ERROR + {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR}, #else - {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114}, + {"DIRNAME_ERROR", ERR_LIB_X509V3, 149}, #endif - #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE - {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, + #ifdef X509V3_R_DISTPOINT_ALREADY_SET + {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET}, #else - {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113}, + {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, 160}, #endif - #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE - {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, + #ifdef X509V3_R_DUPLICATE_ZONE_ID + {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID}, #else - {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111}, + {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, 133}, #endif - #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME - {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, + #ifdef X509V3_R_ERROR_CONVERTING_ZONE + {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE}, #else - {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112}, + {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, 131}, #endif - #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION - {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, + #ifdef X509V3_R_ERROR_CREATING_EXTENSION + {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION}, #else - {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110}, + {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, 144}, #endif - #ifdef SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER - {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER}, + #ifdef X509V3_R_ERROR_IN_EXTENSION + {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION}, #else - {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, 232}, + {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, 128}, #endif - #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT - {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, + #ifdef X509V3_R_EXPECTED_A_SECTION_NAME + {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME}, #else - {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365}, + {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, 137}, #endif - #ifdef SSL_R_TLS_HEARTBEAT_PENDING - {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, + #ifdef X509V3_R_EXTENSION_EXISTS + {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS}, #else - {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366}, + {"EXTENSION_EXISTS", ERR_LIB_X509V3, 145}, #endif - #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL - {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, + #ifdef X509V3_R_EXTENSION_NAME_ERROR + {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR}, #else - {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367}, + {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, 115}, #endif - #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST - {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, + #ifdef X509V3_R_EXTENSION_NOT_FOUND + {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND}, #else - {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157}, + {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, 102}, #endif - #ifdef SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST - {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST}, + #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED + {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED}, #else - {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, 233}, + {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, 103}, #endif - #ifdef SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG - {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG}, + #ifdef X509V3_R_EXTENSION_VALUE_ERROR + {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR}, #else - {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 234}, + {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, 116}, #endif - #ifdef SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER - {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER}, + #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION + {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION}, #else - {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, 235}, + {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, 151}, #endif - #ifdef SSL_R_UNABLE_TO_DECODE_DH_CERTS - {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_DH_CERTS}, + #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG + {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG}, #else - {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, 236}, + {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, 152}, #endif - #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS - {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS}, + #ifdef X509V3_R_INVALID_ASNUMBER + {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER}, #else - {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313}, + {"INVALID_ASNUMBER", ERR_LIB_X509V3, 162}, #endif - #ifdef SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY - {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY}, + #ifdef X509V3_R_INVALID_ASRANGE + {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE}, #else - {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, 237}, + {"INVALID_ASRANGE", ERR_LIB_X509V3, 163}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_DH_PARAMETERS - {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_DH_PARAMETERS}, + #ifdef X509V3_R_INVALID_BOOLEAN_STRING + {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING}, #else - {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, 238}, + {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, 104}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS - {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, + #ifdef X509V3_R_INVALID_EXTENSION_STRING + {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING}, #else - {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314}, + {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, 105}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS - {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, + #ifdef X509V3_R_INVALID_INHERITANCE + {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE}, #else - {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239}, + {"INVALID_INHERITANCE", ERR_LIB_X509V3, 165}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_SSL_METHOD - {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_SSL_METHOD}, + #ifdef X509V3_R_INVALID_IPADDRESS + {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS}, #else - {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, 240}, + {"INVALID_IPADDRESS", ERR_LIB_X509V3, 166}, #endif - #ifdef SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES - {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES}, + #ifdef X509V3_R_INVALID_MULTIPLE_RDNS + {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS}, #else - {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, 241}, + {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, 161}, #endif - #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES - {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, + #ifdef X509V3_R_INVALID_NAME + {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME}, #else - {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242}, + {"INVALID_NAME", ERR_LIB_X509V3, 106}, #endif - #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES - {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, + #ifdef X509V3_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT}, #else - {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243}, + {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, 107}, #endif - #ifdef SSL_R_UNEXPECTED_MESSAGE - {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, + #ifdef X509V3_R_INVALID_NULL_NAME + {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME}, #else - {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244}, + {"INVALID_NULL_NAME", ERR_LIB_X509V3, 108}, #endif - #ifdef SSL_R_UNEXPECTED_RECORD - {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, + #ifdef X509V3_R_INVALID_NULL_VALUE + {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE}, #else - {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245}, + {"INVALID_NULL_VALUE", ERR_LIB_X509V3, 109}, #endif - #ifdef SSL_R_UNINITIALIZED - {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, + #ifdef X509V3_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER}, #else - {"UNINITIALIZED", ERR_LIB_SSL, 276}, + {"INVALID_NUMBER", ERR_LIB_X509V3, 140}, #endif - #ifdef SSL_R_UNKNOWN_ALERT_TYPE - {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, + #ifdef X509V3_R_INVALID_NUMBERS + {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS}, #else - {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246}, + {"INVALID_NUMBERS", ERR_LIB_X509V3, 141}, #endif - #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE - {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, + #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER + {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER}, #else - {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247}, + {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, 110}, #endif - #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED - {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, + #ifdef X509V3_R_INVALID_OPTION + {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION}, #else - {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248}, + {"INVALID_OPTION", ERR_LIB_X509V3, 138}, #endif - #ifdef SSL_R_UNKNOWN_CIPHER_TYPE - {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, + #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER + {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER}, #else - {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249}, + {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, 134}, #endif - #ifdef SSL_R_UNKNOWN_CMD_NAME - {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, + #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING + {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING}, #else - {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386}, + {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, 153}, #endif - #ifdef SSL_R_UNKNOWN_DIGEST - {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, + #ifdef X509V3_R_INVALID_PURPOSE + {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE}, #else - {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368}, + {"INVALID_PURPOSE", ERR_LIB_X509V3, 146}, #endif - #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE - {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, + #ifdef X509V3_R_INVALID_SAFI + {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI}, #else - {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250}, + {"INVALID_SAFI", ERR_LIB_X509V3, 164}, #endif - #ifdef SSL_R_UNKNOWN_PKEY_TYPE - {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, + #ifdef X509V3_R_INVALID_SECTION + {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION}, #else - {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251}, + {"INVALID_SECTION", ERR_LIB_X509V3, 135}, #endif - #ifdef SSL_R_UNKNOWN_PROTOCOL - {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, + #ifdef X509V3_R_INVALID_SYNTAX + {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX}, #else - {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252}, + {"INVALID_SYNTAX", ERR_LIB_X509V3, 143}, #endif - #ifdef SSL_R_UNKNOWN_REMOTE_ERROR_TYPE - {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_REMOTE_ERROR_TYPE}, + #ifdef X509V3_R_ISSUER_DECODE_ERROR + {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR}, #else - {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, 253}, + {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, 126}, #endif - #ifdef SSL_R_UNKNOWN_SSL_VERSION - {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, + #ifdef X509V3_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE}, #else - {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254}, + {"MISSING_VALUE", ERR_LIB_X509V3, 124}, #endif - #ifdef SSL_R_UNKNOWN_STATE - {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, + #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS + {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS}, #else - {"UNKNOWN_STATE", ERR_LIB_SSL, 255}, + {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, 142}, #endif - #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED - {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, + #ifdef X509V3_R_NO_CONFIG_DATABASE + {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE}, #else - {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338}, + {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, 136}, #endif - #ifdef SSL_R_UNSUPPORTED_CIPHER - {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_UNSUPPORTED_CIPHER}, + #ifdef X509V3_R_NO_ISSUER_CERTIFICATE + {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, 256}, + {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, 121}, #endif - #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #ifdef X509V3_R_NO_ISSUER_DETAILS + {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS}, #else - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257}, + {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, 127}, #endif - #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE - {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE}, + #ifdef X509V3_R_NO_POLICY_IDENTIFIER + {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER}, #else - {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326}, + {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, 139}, #endif - #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE - {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, + #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED}, #else - {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315}, + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, 154}, #endif - #ifdef SSL_R_UNSUPPORTED_PROTOCOL - {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, + #ifdef X509V3_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY}, #else - {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258}, + {"NO_PUBLIC_KEY", ERR_LIB_X509V3, 114}, #endif - #ifdef SSL_R_UNSUPPORTED_SSL_VERSION - {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, + #ifdef X509V3_R_NO_SUBJECT_DETAILS + {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS}, #else - {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259}, + {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, 125}, #endif - #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE - {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, + #ifdef X509V3_R_OPERATION_NOT_DEFINED + {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED}, #else - {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329}, + {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, 148}, #endif - #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED - {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, + #ifdef X509V3_R_OTHERNAME_ERROR + {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR}, #else - {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369}, + {"OTHERNAME_ERROR", ERR_LIB_X509V3, 147}, #endif - #ifdef SSL_R_VERSION_TOO_LOW - {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, + #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED + {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED}, #else - {"VERSION_TOO_LOW", ERR_LIB_SSL, 396}, + {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, 155}, #endif - #ifdef SSL_R_WRITE_BIO_NOT_SET - {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_WRITE_BIO_NOT_SET}, + #ifdef X509V3_R_POLICY_PATH_LENGTH + {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH}, #else - {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, 260}, + {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, 156}, #endif - #ifdef SSL_R_WRONG_CERTIFICATE_TYPE - {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, + #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED}, #else - {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383}, + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, 157}, #endif - #ifdef SSL_R_WRONG_CIPHER_RETURNED - {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, + #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY}, #else - {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261}, + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, 159}, #endif - #ifdef SSL_R_WRONG_CURVE - {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, + #ifdef X509V3_R_SECTION_NOT_FOUND + {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND}, #else - {"WRONG_CURVE", ERR_LIB_SSL, 378}, + {"SECTION_NOT_FOUND", ERR_LIB_X509V3, 150}, #endif - #ifdef SSL_R_WRONG_MESSAGE_TYPE - {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_MESSAGE_TYPE}, + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS + {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS}, #else - {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, 262}, + {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, 122}, #endif - #ifdef SSL_R_WRONG_NUMBER_OF_KEY_BITS - {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, SSL_R_WRONG_NUMBER_OF_KEY_BITS}, + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID + {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID}, #else - {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, 263}, + {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, 123}, #endif - #ifdef SSL_R_WRONG_SIGNATURE_LENGTH - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, + #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT + {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT}, #else - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264}, + {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, 111}, #endif - #ifdef SSL_R_WRONG_SIGNATURE_SIZE - {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, + #ifdef X509V3_R_UNKNOWN_EXTENSION + {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION}, #else - {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265}, + {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, 129}, #endif - #ifdef SSL_R_WRONG_SIGNATURE_TYPE - {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, + #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME + {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME}, #else - {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370}, + {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, 130}, #endif - #ifdef SSL_R_WRONG_SSL_VERSION - {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, + #ifdef X509V3_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION}, #else - {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266}, + {"UNKNOWN_OPTION", ERR_LIB_X509V3, 120}, #endif - #ifdef SSL_R_WRONG_VERSION_NUMBER - {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, + #ifdef X509V3_R_UNSUPPORTED_OPTION + {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION}, #else - {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267}, + {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, 117}, #endif - #ifdef SSL_R_X509_LIB - {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, + #ifdef X509V3_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE}, #else - {"X509_LIB", ERR_LIB_SSL, 268}, + {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, 167}, #endif - #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS - {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, + #ifdef X509V3_R_USER_TOO_LONG + {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG}, #else - {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269}, + {"USER_TOO_LONG", ERR_LIB_X509V3, 132}, #endif #ifdef X509_R_AKID_MISMATCH {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH}, #else {"AKID_MISMATCH", ERR_LIB_X509, 110}, #endif + #ifdef X509_R_BAD_SELECTOR + {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR}, + #else + {"BAD_SELECTOR", ERR_LIB_X509, 133}, + #endif #ifdef X509_R_BAD_X509_FILETYPE {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE}, #else @@ -1824,6 +6122,11 @@ static struct py_ssl_error_code error_codes[] = { #else {"IDP_MISMATCH", ERR_LIB_X509, 128}, #endif + #ifdef X509_R_INVALID_ATTRIBUTES + {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES}, + #else + {"INVALID_ATTRIBUTES", ERR_LIB_X509, 138}, + #endif #ifdef X509_R_INVALID_DIRECTORY {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY}, #else @@ -1869,16 +6172,36 @@ static struct py_ssl_error_code error_codes[] = { #else {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124}, #endif + #ifdef X509_R_NAME_TOO_LONG + {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG}, + #else + {"NAME_TOO_LONG", ERR_LIB_X509, 134}, + #endif #ifdef X509_R_NEWER_CRL_NOT_NEWER {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER}, #else {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, 132}, #endif + #ifdef X509_R_NO_CERTIFICATE_FOUND + {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND}, + #else + {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, 135}, + #endif + #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND + {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND}, + #else + {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, 136}, + #endif #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY}, #else {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105}, #endif + #ifdef X509_R_NO_CRL_FOUND + {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND}, + #else + {"NO_CRL_FOUND", ERR_LIB_X509, 137}, + #endif #ifdef X509_R_NO_CRL_NUMBER {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER}, #else diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index fdabd5d732ca1..1c7a5a9fb28e3 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -11,6 +11,7 @@ """ import datetime +import glob import os import re import sys @@ -18,7 +19,7 @@ def parse_error_codes(h_file, prefix, libcode): - pat = re.compile(r"#define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix)) + pat = re.compile(r"#\s*define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix)) codes = [] with open(h_file, "r", encoding="latin1") as f: for line in f: @@ -28,6 +29,7 @@ def parse_error_codes(h_file, prefix, libcode): num = int(num) # e.g. ("SSL_R_BAD_DATA", ("ERR_LIB_SSL", "BAD_DATA", 390)) codes.append((code, (libcode, name, num))) + assert codes, f"no codes found in {h_file}" return codes if __name__ == "__main__": @@ -35,18 +37,23 @@ def parse_error_codes(h_file, prefix, libcode): outfile = sys.argv[2] use_stdout = outfile == '-' f = sys.stdout if use_stdout else open(outfile, "w") - error_libraries = { - # mnemonic -> (library code, error prefix, header file) - 'PEM': ('ERR_LIB_PEM', 'PEM_R_', 'crypto/pem/pem.h'), - 'SSL': ('ERR_LIB_SSL', 'SSL_R_', 'ssl/ssl.h'), - 'X509': ('ERR_LIB_X509', 'X509_R_', 'crypto/x509/x509.h'), - } + # mnemonic -> (library code, error prefix, header file) + error_libraries = {} + for error_header in glob.glob(os.path.join(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. + continue + mnemonic = base[:-5].upper() + if mnemonic == "": + # Skip err.h. + continue + error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) # Read codes from libraries new_codes = [] for libcode, prefix, h_file in sorted(error_libraries.values()): - new_codes += parse_error_codes(os.path.join(openssl_inc, h_file), - prefix, libcode) + new_codes += parse_error_codes(h_file, prefix, libcode) new_code_nums = set((libcode, num) for (code, (libcode, name, num)) in new_codes) From webhook-mailer at python.org Sat Apr 11 16:53:08 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 11 Apr 2020 20:53:08 -0000 Subject: [Python-checkins] closes bpo-39953: Update OpenSSL error codes table. (GH-19082) Message-ID: https://github.com/python/cpython/commit/2714c907df7cfe97911df6ce90364001270d9a43 commit: 2714c907df7cfe97911df6ce90364001270d9a43 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-11T13:53:00-07:00 summary: closes bpo-39953: Update OpenSSL error codes table. (GH-19082) I updated the error codes using the OpenSSL 1.1.1f source tree. (cherry picked from commit 3e0dd3730b5eff7e9ae6fb921aa77cd26efc9e3a) Co-authored-by: Benjamin Peterson files: A Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst M Modules/_ssl_data.h M Tools/ssl/make_ssl_data.py diff --git a/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst b/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst new file mode 100644 index 0000000000000..3fea7c87ea885 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst @@ -0,0 +1 @@ +Update internal table of OpenSSL error codes in the ``ssl`` module. diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h index 85165b90bc389..f01c019c45b19 100644 --- a/Modules/_ssl_data.h +++ b/Modules/_ssl_data.h @@ -1,1789 +1,6087 @@ /* File generated by Tools/ssl/make_ssl_data.py */ -/* Generated on 2015-01-17T20:33:43.377453 */ +/* Generated on 2020-04-11T14:59:43.709585 */ static struct py_ssl_library_code library_codes[] = { + {"ASN1", ERR_LIB_ASN1}, + {"ASYNC", ERR_LIB_ASYNC}, + {"BIO", ERR_LIB_BIO}, + {"BN", ERR_LIB_BN}, + {"CMS", ERR_LIB_CMS}, + {"COMP", ERR_LIB_COMP}, + {"CONF", ERR_LIB_CONF}, + {"CRYPTO", ERR_LIB_CRYPTO}, + {"CT", ERR_LIB_CT}, + {"DH", ERR_LIB_DH}, + {"DSA", ERR_LIB_DSA}, + {"EC", ERR_LIB_EC}, + {"ENGINE", ERR_LIB_ENGINE}, + {"EVP", ERR_LIB_EVP}, + {"KDF", ERR_LIB_KDF}, + {"OCSP", ERR_LIB_OCSP}, {"PEM", ERR_LIB_PEM}, + {"PKCS12", ERR_LIB_PKCS12}, + {"PKCS7", ERR_LIB_PKCS7}, + {"RAND", ERR_LIB_RAND}, + {"RSA", ERR_LIB_RSA}, {"SSL", ERR_LIB_SSL}, + {"TS", ERR_LIB_TS}, + {"UI", ERR_LIB_UI}, {"X509", ERR_LIB_X509}, + {"X509V3", ERR_LIB_X509V3}, { NULL } }; static struct py_ssl_error_code error_codes[] = { - #ifdef PEM_R_BAD_BASE64_DECODE - {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, + #ifdef ASN1_R_ADDING_OBJECT + {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT}, #else - {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100}, + {"ADDING_OBJECT", ERR_LIB_ASN1, 171}, #endif - #ifdef PEM_R_BAD_DECRYPT - {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, + #ifdef ASN1_R_ASN1_PARSE_ERROR + {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR}, #else - {"BAD_DECRYPT", ERR_LIB_PEM, 101}, + {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, 203}, #endif - #ifdef PEM_R_BAD_END_LINE - {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, + #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR + {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR}, #else - {"BAD_END_LINE", ERR_LIB_PEM, 102}, + {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, 204}, #endif - #ifdef PEM_R_BAD_IV_CHARS - {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, + #ifdef ASN1_R_AUX_ERROR + {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR}, #else - {"BAD_IV_CHARS", ERR_LIB_PEM, 103}, + {"AUX_ERROR", ERR_LIB_ASN1, 100}, #endif - #ifdef PEM_R_BAD_MAGIC_NUMBER - {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, + #ifdef ASN1_R_BAD_OBJECT_HEADER + {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER}, #else - {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116}, + {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, 102}, #endif - #ifdef PEM_R_BAD_PASSWORD_READ - {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, + #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH + {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH}, #else - {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104}, + {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 214}, #endif - #ifdef PEM_R_BAD_VERSION_NUMBER - {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, + #ifdef ASN1_R_BN_LIB + {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB}, #else - {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117}, + {"BN_LIB", ERR_LIB_ASN1, 105}, #endif - #ifdef PEM_R_BIO_WRITE_FAILURE - {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, + #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH + {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH}, #else - {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118}, + {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, 106}, #endif - #ifdef PEM_R_CIPHER_IS_NULL - {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, + #ifdef ASN1_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL}, #else - {"CIPHER_IS_NULL", ERR_LIB_PEM, 127}, + {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, 107}, #endif - #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY - {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, + #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, #else - {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115}, + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, 108}, #endif - #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB - {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, + #ifdef ASN1_R_CONTEXT_NOT_INITIALISED + {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED}, #else - {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119}, + {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, 217}, #endif - #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB - {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, + #ifdef ASN1_R_DATA_IS_WRONG + {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG}, #else - {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120}, + {"DATA_IS_WRONG", ERR_LIB_ASN1, 109}, #endif - #ifdef PEM_R_INCONSISTENT_HEADER - {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, + #ifdef ASN1_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR}, #else - {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121}, + {"DECODE_ERROR", ERR_LIB_ASN1, 110}, #endif - #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR - {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, + #ifdef ASN1_R_DEPTH_EXCEEDED + {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED}, #else - {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122}, + {"DEPTH_EXCEEDED", ERR_LIB_ASN1, 174}, #endif - #ifdef PEM_R_KEYBLOB_TOO_SHORT - {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, + #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED}, #else - {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123}, + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, 198}, #endif - #ifdef PEM_R_NOT_DEK_INFO - {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, + #ifdef ASN1_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR}, #else - {"NOT_DEK_INFO", ERR_LIB_PEM, 105}, + {"ENCODE_ERROR", ERR_LIB_ASN1, 112}, #endif - #ifdef PEM_R_NOT_ENCRYPTED - {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, + #ifdef ASN1_R_ERROR_GETTING_TIME + {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME}, #else - {"NOT_ENCRYPTED", ERR_LIB_PEM, 106}, + {"ERROR_GETTING_TIME", ERR_LIB_ASN1, 173}, #endif - #ifdef PEM_R_NOT_PROC_TYPE - {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, + #ifdef ASN1_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION}, #else - {"NOT_PROC_TYPE", ERR_LIB_PEM, 107}, + {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, 172}, #endif - #ifdef PEM_R_NO_START_LINE - {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, + #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS + {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS}, #else - {"NO_START_LINE", ERR_LIB_PEM, 108}, + {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, 114}, #endif - #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD - {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, + #ifdef ASN1_R_EXPECTING_AN_INTEGER + {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER}, #else - {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109}, + {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, 115}, #endif - #ifdef PEM_R_PUBLIC_KEY_NO_RSA - {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA}, + #ifdef ASN1_R_EXPECTING_AN_OBJECT + {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT}, #else - {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110}, + {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, 116}, #endif - #ifdef PEM_R_PVK_DATA_TOO_SHORT - {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, + #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH + {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH}, #else - {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124}, + {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, 119}, #endif - #ifdef PEM_R_PVK_TOO_SHORT - {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, + #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED + {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED}, #else - {"PVK_TOO_SHORT", ERR_LIB_PEM, 125}, + {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, 120}, #endif - #ifdef PEM_R_READ_KEY - {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, + #ifdef ASN1_R_FIELD_MISSING + {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING}, #else - {"READ_KEY", ERR_LIB_PEM, 111}, + {"FIELD_MISSING", ERR_LIB_ASN1, 121}, #endif - #ifdef PEM_R_SHORT_HEADER - {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, + #ifdef ASN1_R_FIRST_NUM_TOO_LARGE + {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE}, #else - {"SHORT_HEADER", ERR_LIB_PEM, 112}, + {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, 122}, #endif - #ifdef PEM_R_UNSUPPORTED_CIPHER - {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, + #ifdef ASN1_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113}, + {"HEADER_TOO_LONG", ERR_LIB_ASN1, 123}, #endif - #ifdef PEM_R_UNSUPPORTED_ENCRYPTION - {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, + #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT + {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT}, #else - {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114}, + {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, 175}, #endif - #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS - {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, + #ifdef ASN1_R_ILLEGAL_BOOLEAN + {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN}, #else - {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126}, + {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, 176}, #endif - #ifdef SSL_R_APP_DATA_IN_HANDSHAKE - {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, + #ifdef ASN1_R_ILLEGAL_CHARACTERS + {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS}, #else - {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100}, + {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, 124}, #endif - #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT - {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, + #ifdef ASN1_R_ILLEGAL_FORMAT + {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT}, #else - {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272}, + {"ILLEGAL_FORMAT", ERR_LIB_ASN1, 177}, #endif - #ifdef SSL_R_BAD_ALERT_RECORD - {"BAD_ALERT_RECORD", ERR_LIB_SSL, SSL_R_BAD_ALERT_RECORD}, + #ifdef ASN1_R_ILLEGAL_HEX + {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX}, #else - {"BAD_ALERT_RECORD", ERR_LIB_SSL, 101}, + {"ILLEGAL_HEX", ERR_LIB_ASN1, 178}, #endif - #ifdef SSL_R_BAD_AUTHENTICATION_TYPE - {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, SSL_R_BAD_AUTHENTICATION_TYPE}, + #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG + {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG}, #else - {"BAD_AUTHENTICATION_TYPE", ERR_LIB_SSL, 102}, + {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, 179}, #endif - #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC - {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, + #ifdef ASN1_R_ILLEGAL_INTEGER + {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER}, #else - {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103}, + {"ILLEGAL_INTEGER", ERR_LIB_ASN1, 180}, #endif - #ifdef SSL_R_BAD_CHECKSUM - {"BAD_CHECKSUM", ERR_LIB_SSL, SSL_R_BAD_CHECKSUM}, + #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE + {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE}, #else - {"BAD_CHECKSUM", ERR_LIB_SSL, 104}, + {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, 226}, #endif - #ifdef SSL_R_BAD_DATA - {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, + #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING + {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING}, #else - {"BAD_DATA", ERR_LIB_SSL, 390}, + {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, 181}, #endif - #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK - {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, + #ifdef ASN1_R_ILLEGAL_NULL + {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL}, #else - {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106}, + {"ILLEGAL_NULL", ERR_LIB_ASN1, 125}, #endif - #ifdef SSL_R_BAD_DECOMPRESSION - {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, + #ifdef ASN1_R_ILLEGAL_NULL_VALUE + {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE}, #else - {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107}, + {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, 182}, #endif - #ifdef SSL_R_BAD_DH_G_LENGTH - {"BAD_DH_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_G_LENGTH}, + #ifdef ASN1_R_ILLEGAL_OBJECT + {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT}, #else - {"BAD_DH_G_LENGTH", ERR_LIB_SSL, 108}, + {"ILLEGAL_OBJECT", ERR_LIB_ASN1, 183}, #endif - #ifdef SSL_R_BAD_DH_PUB_KEY_LENGTH - {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_PUB_KEY_LENGTH}, + #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY + {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY}, #else - {"BAD_DH_PUB_KEY_LENGTH", ERR_LIB_SSL, 109}, + {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, 126}, #endif - #ifdef SSL_R_BAD_DH_P_LENGTH - {"BAD_DH_P_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DH_P_LENGTH}, + #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE}, #else - {"BAD_DH_P_LENGTH", ERR_LIB_SSL, 110}, + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, 170}, #endif - #ifdef SSL_R_BAD_DIGEST_LENGTH - {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, + #ifdef ASN1_R_ILLEGAL_PADDING + {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING}, #else - {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111}, + {"ILLEGAL_PADDING", ERR_LIB_ASN1, 221}, #endif - #ifdef SSL_R_BAD_DSA_SIGNATURE - {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_DSA_SIGNATURE}, + #ifdef ASN1_R_ILLEGAL_TAGGED_ANY + {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY}, #else - {"BAD_DSA_SIGNATURE", ERR_LIB_SSL, 112}, + {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, 127}, #endif - #ifdef SSL_R_BAD_ECC_CERT - {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, + #ifdef ASN1_R_ILLEGAL_TIME_VALUE + {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE}, #else - {"BAD_ECC_CERT", ERR_LIB_SSL, 304}, + {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, 184}, #endif - #ifdef SSL_R_BAD_ECDSA_SIGNATURE - {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE}, + #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT + {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT}, #else - {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305}, + {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, 222}, #endif - #ifdef SSL_R_BAD_ECPOINT - {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, + #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT + {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT}, #else - {"BAD_ECPOINT", ERR_LIB_SSL, 306}, + {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 185}, #endif - #ifdef SSL_R_BAD_HANDSHAKE_LENGTH - {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, + #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG + {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG}, #else - {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332}, + {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, 128}, #endif - #ifdef SSL_R_BAD_HELLO_REQUEST - {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, + #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT + {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT}, #else - {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105}, + {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, 220}, #endif - #ifdef SSL_R_BAD_LENGTH - {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, + #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH + {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH}, #else - {"BAD_LENGTH", ERR_LIB_SSL, 271}, + {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, 129}, #endif - #ifdef SSL_R_BAD_MAC_DECODE - {"BAD_MAC_DECODE", ERR_LIB_SSL, SSL_R_BAD_MAC_DECODE}, + #ifdef ASN1_R_INVALID_DIGIT + {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT}, #else - {"BAD_MAC_DECODE", ERR_LIB_SSL, 113}, + {"INVALID_DIGIT", ERR_LIB_ASN1, 130}, #endif - #ifdef SSL_R_BAD_MAC_LENGTH - {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH}, + #ifdef ASN1_R_INVALID_MIME_TYPE + {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE}, #else - {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333}, + {"INVALID_MIME_TYPE", ERR_LIB_ASN1, 205}, #endif - #ifdef SSL_R_BAD_MESSAGE_TYPE - {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_BAD_MESSAGE_TYPE}, + #ifdef ASN1_R_INVALID_MODIFIER + {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER}, #else - {"BAD_MESSAGE_TYPE", ERR_LIB_SSL, 114}, + {"INVALID_MODIFIER", ERR_LIB_ASN1, 186}, #endif - #ifdef SSL_R_BAD_PACKET_LENGTH - {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, + #ifdef ASN1_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER}, #else - {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115}, + {"INVALID_NUMBER", ERR_LIB_ASN1, 187}, #endif - #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER - {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, + #ifdef ASN1_R_INVALID_OBJECT_ENCODING + {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING}, #else - {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116}, + {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, 216}, #endif - #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH - {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH}, + #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS + {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS}, #else - {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316}, + {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, 227}, #endif - #ifdef SSL_R_BAD_RESPONSE_ARGUMENT - {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, SSL_R_BAD_RESPONSE_ARGUMENT}, + #ifdef ASN1_R_INVALID_SEPARATOR + {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR}, #else - {"BAD_RESPONSE_ARGUMENT", ERR_LIB_SSL, 117}, + {"INVALID_SEPARATOR", ERR_LIB_ASN1, 131}, #endif - #ifdef SSL_R_BAD_RSA_DECRYPT - {"BAD_RSA_DECRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_DECRYPT}, + #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE + {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE}, #else - {"BAD_RSA_DECRYPT", ERR_LIB_SSL, 118}, + {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, 218}, #endif - #ifdef SSL_R_BAD_RSA_ENCRYPT - {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, + #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH + {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH}, #else - {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119}, + {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, 133}, #endif - #ifdef SSL_R_BAD_RSA_E_LENGTH - {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_E_LENGTH}, + #ifdef ASN1_R_INVALID_UTF8STRING + {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING}, #else - {"BAD_RSA_E_LENGTH", ERR_LIB_SSL, 120}, + {"INVALID_UTF8STRING", ERR_LIB_ASN1, 134}, #endif - #ifdef SSL_R_BAD_RSA_MODULUS_LENGTH - {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, SSL_R_BAD_RSA_MODULUS_LENGTH}, + #ifdef ASN1_R_INVALID_VALUE + {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE}, #else - {"BAD_RSA_MODULUS_LENGTH", ERR_LIB_SSL, 121}, + {"INVALID_VALUE", ERR_LIB_ASN1, 219}, #endif - #ifdef SSL_R_BAD_RSA_SIGNATURE - {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_RSA_SIGNATURE}, + #ifdef ASN1_R_LIST_ERROR + {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR}, #else - {"BAD_RSA_SIGNATURE", ERR_LIB_SSL, 122}, + {"LIST_ERROR", ERR_LIB_ASN1, 188}, #endif - #ifdef SSL_R_BAD_SIGNATURE - {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, + #ifdef ASN1_R_MIME_NO_CONTENT_TYPE + {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE}, #else - {"BAD_SIGNATURE", ERR_LIB_SSL, 123}, + {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, 206}, #endif - #ifdef SSL_R_BAD_SRP_A_LENGTH - {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, + #ifdef ASN1_R_MIME_PARSE_ERROR + {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR}, #else - {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347}, + {"MIME_PARSE_ERROR", ERR_LIB_ASN1, 207}, #endif - #ifdef SSL_R_BAD_SRP_B_LENGTH - {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH}, + #ifdef ASN1_R_MIME_SIG_PARSE_ERROR + {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR}, #else - {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348}, + {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, 208}, #endif - #ifdef SSL_R_BAD_SRP_G_LENGTH - {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH}, + #ifdef ASN1_R_MISSING_EOC + {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC}, #else - {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349}, + {"MISSING_EOC", ERR_LIB_ASN1, 137}, #endif - #ifdef SSL_R_BAD_SRP_N_LENGTH - {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH}, + #ifdef ASN1_R_MISSING_SECOND_NUMBER + {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER}, #else - {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350}, + {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, 138}, #endif - #ifdef SSL_R_BAD_SRP_PARAMETERS - {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, + #ifdef ASN1_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE}, #else - {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371}, + {"MISSING_VALUE", ERR_LIB_ASN1, 189}, #endif - #ifdef SSL_R_BAD_SRP_S_LENGTH - {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH}, + #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL + {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL}, #else - {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351}, + {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, 139}, #endif - #ifdef SSL_R_BAD_SRTP_MKI_VALUE - {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, + #ifdef ASN1_R_MSTRING_WRONG_TAG + {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG}, #else - {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352}, + {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, 140}, #endif - #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST - {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, + #ifdef ASN1_R_NESTED_ASN1_STRING + {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING}, #else - {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353}, + {"NESTED_ASN1_STRING", ERR_LIB_ASN1, 197}, #endif - #ifdef SSL_R_BAD_SSL_FILETYPE - {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, + #ifdef ASN1_R_NESTED_TOO_DEEP + {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP}, #else - {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124}, + {"NESTED_TOO_DEEP", ERR_LIB_ASN1, 201}, #endif - #ifdef SSL_R_BAD_SSL_SESSION_ID_LENGTH - {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SSL_SESSION_ID_LENGTH}, + #ifdef ASN1_R_NON_HEX_CHARACTERS + {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS}, #else - {"BAD_SSL_SESSION_ID_LENGTH", ERR_LIB_SSL, 125}, + {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, 141}, #endif - #ifdef SSL_R_BAD_STATE - {"BAD_STATE", ERR_LIB_SSL, SSL_R_BAD_STATE}, + #ifdef ASN1_R_NOT_ASCII_FORMAT + {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT}, #else - {"BAD_STATE", ERR_LIB_SSL, 126}, + {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, 190}, #endif - #ifdef SSL_R_BAD_VALUE - {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, + #ifdef ASN1_R_NOT_ENOUGH_DATA + {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA}, #else - {"BAD_VALUE", ERR_LIB_SSL, 384}, + {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, 142}, #endif - #ifdef SSL_R_BAD_WRITE_RETRY - {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, + #ifdef ASN1_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE}, #else - {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127}, + {"NO_CONTENT_TYPE", ERR_LIB_ASN1, 209}, #endif - #ifdef SSL_R_BIO_NOT_SET - {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, + #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE + {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE}, #else - {"BIO_NOT_SET", ERR_LIB_SSL, 128}, + {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, 143}, #endif - #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG - {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, + #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE + {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE}, #else - {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129}, + {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, 210}, #endif - #ifdef SSL_R_BN_LIB - {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, + #ifdef ASN1_R_NO_MULTIPART_BOUNDARY + {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY}, #else - {"BN_LIB", ERR_LIB_SSL, 130}, + {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, 211}, #endif - #ifdef SSL_R_CA_DN_LENGTH_MISMATCH - {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, + #ifdef ASN1_R_NO_SIG_CONTENT_TYPE + {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE}, #else - {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131}, + {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, 212}, #endif - #ifdef SSL_R_CA_DN_TOO_LONG - {"CA_DN_TOO_LONG", ERR_LIB_SSL, SSL_R_CA_DN_TOO_LONG}, + #ifdef ASN1_R_NULL_IS_WRONG_LENGTH + {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH}, #else - {"CA_DN_TOO_LONG", ERR_LIB_SSL, 132}, + {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, 144}, #endif - #ifdef SSL_R_CA_KEY_TOO_SMALL - {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, + #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT + {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT}, #else - {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397}, + {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 191}, #endif - #ifdef SSL_R_CA_MD_TOO_WEAK - {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, + #ifdef ASN1_R_ODD_NUMBER_OF_CHARS + {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS}, #else - {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398}, + {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, 145}, #endif - #ifdef SSL_R_CCS_RECEIVED_EARLY - {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, + #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE + {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE}, #else - {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133}, + {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, 147}, #endif - #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED - {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, + #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH + {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH}, #else - {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134}, + {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, 148}, #endif - #ifdef SSL_R_CERT_CB_ERROR - {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, + #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED + {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED}, #else - {"CERT_CB_ERROR", ERR_LIB_SSL, 377}, + {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 149}, #endif - #ifdef SSL_R_CERT_LENGTH_MISMATCH - {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, + #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG + {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG}, #else - {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135}, + {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, 192}, #endif - #ifdef SSL_R_CHALLENGE_IS_DIFFERENT - {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CHALLENGE_IS_DIFFERENT}, + #ifdef ASN1_R_SHORT_LINE + {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE}, #else - {"CHALLENGE_IS_DIFFERENT", ERR_LIB_SSL, 136}, + {"SHORT_LINE", ERR_LIB_ASN1, 150}, #endif - #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH - {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, + #ifdef ASN1_R_SIG_INVALID_MIME_TYPE + {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE}, #else - {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137}, + {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, 213}, #endif - #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE - {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, + #ifdef ASN1_R_STREAMING_NOT_SUPPORTED + {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED}, #else - {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138}, + {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, 202}, #endif - #ifdef SSL_R_CIPHER_TABLE_SRC_ERROR - {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, SSL_R_CIPHER_TABLE_SRC_ERROR}, + #ifdef ASN1_R_STRING_TOO_LONG + {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG}, #else - {"CIPHER_TABLE_SRC_ERROR", ERR_LIB_SSL, 139}, + {"STRING_TOO_LONG", ERR_LIB_ASN1, 151}, #endif - #ifdef SSL_R_CLIENTHELLO_TLSEXT - {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, + #ifdef ASN1_R_STRING_TOO_SHORT + {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT}, #else - {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226}, + {"STRING_TOO_SHORT", ERR_LIB_ASN1, 152}, #endif - #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG - {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, + #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, #else - {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140}, + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, 154}, #endif - #ifdef SSL_R_COMPRESSION_DISABLED - {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, + #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT + {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT}, #else - {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343}, + {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 193}, #endif - #ifdef SSL_R_COMPRESSION_FAILURE - {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, + #ifdef ASN1_R_TOO_LARGE + {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE}, #else - {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141}, + {"TOO_LARGE", ERR_LIB_ASN1, 223}, #endif - #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE - {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, + #ifdef ASN1_R_TOO_LONG + {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG}, #else - {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307}, + {"TOO_LONG", ERR_LIB_ASN1, 155}, #endif - #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR - {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, + #ifdef ASN1_R_TOO_SMALL + {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL}, #else - {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142}, + {"TOO_SMALL", ERR_LIB_ASN1, 224}, #endif - #ifdef SSL_R_CONNECTION_ID_IS_DIFFERENT - {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_CONNECTION_ID_IS_DIFFERENT}, + #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED + {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED}, #else - {"CONNECTION_ID_IS_DIFFERENT", ERR_LIB_SSL, 143}, + {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 156}, #endif - #ifdef SSL_R_CONNECTION_TYPE_NOT_SET - {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, + #ifdef ASN1_R_TYPE_NOT_PRIMITIVE + {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE}, #else - {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144}, + {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, 195}, #endif - #ifdef SSL_R_COOKIE_MISMATCH - {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, + #ifdef ASN1_R_UNEXPECTED_EOC + {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC}, #else - {"COOKIE_MISMATCH", ERR_LIB_SSL, 308}, + {"UNEXPECTED_EOC", ERR_LIB_ASN1, 159}, #endif - #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED - {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, + #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH + {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH}, #else - {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145}, + {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 215}, #endif - #ifdef SSL_R_DATA_LENGTH_TOO_LONG - {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, + #ifdef ASN1_R_UNKNOWN_FORMAT + {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT}, #else - {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146}, + {"UNKNOWN_FORMAT", ERR_LIB_ASN1, 160}, #endif - #ifdef SSL_R_DECRYPTION_FAILED - {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, + #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM}, #else - {"DECRYPTION_FAILED", ERR_LIB_SSL, 147}, + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, 161}, #endif - #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC - {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, + #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE + {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE}, #else - {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281}, + {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, 162}, #endif - #ifdef SSL_R_DH_KEY_TOO_SMALL - {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, + #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE + {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE}, #else - {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394}, + {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 163}, #endif - #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG - {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, + #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM + {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM}, #else - {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148}, + {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, 199}, #endif - #ifdef SSL_R_DIGEST_CHECK_FAILED - {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, + #ifdef ASN1_R_UNKNOWN_TAG + {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG}, #else - {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149}, + {"UNKNOWN_TAG", ERR_LIB_ASN1, 194}, #endif - #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG - {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, + #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE}, #else - {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334}, + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, 164}, #endif - #ifdef SSL_R_DUPLICATE_COMPRESSION_ID - {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, + #ifdef ASN1_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER}, #else - {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309}, + {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, 228}, #endif - #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT - {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT}, + #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, #else - {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317}, + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 167}, #endif - #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING - {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, + #ifdef ASN1_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE}, #else - {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318}, + {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, 196}, #endif - #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE - {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE}, + #ifdef ASN1_R_WRONG_INTEGER_TYPE + {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE}, #else - {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322}, + {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, 225}, #endif - #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE - {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE}, + #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE + {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE}, #else - {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323}, + {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 200}, #endif - #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE - {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, + #ifdef ASN1_R_WRONG_TAG + {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG}, #else - {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374}, + {"WRONG_TAG", ERR_LIB_ASN1, 168}, #endif - #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER - {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER}, + #ifdef ASYNC_R_FAILED_TO_SET_POOL + {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL}, #else - {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310}, + {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101}, #endif - #ifdef SSL_R_EE_KEY_TOO_SMALL - {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, + #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT + {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT}, #else - {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399}, + {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, 102}, #endif - #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST - {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, + #ifdef ASYNC_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED}, #else - {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354}, + {"INIT_FAILED", ERR_LIB_ASYNC, 105}, #endif - #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG - {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, + #ifdef ASYNC_R_INVALID_POOL_SIZE + {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE}, #else - {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150}, + {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, 103}, #endif - #ifdef SSL_R_ERROR_GENERATING_TMP_RSA_KEY - {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_ERROR_GENERATING_TMP_RSA_KEY}, + #ifdef BIO_R_ACCEPT_ERROR + {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR}, #else - {"ERROR_GENERATING_TMP_RSA_KEY", ERR_LIB_SSL, 282}, + {"ACCEPT_ERROR", ERR_LIB_BIO, 100}, #endif - #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST - {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, + #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET + {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET}, #else - {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151}, + {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 141}, #endif - #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE - {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, + #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE + {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE}, #else - {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152}, + {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, 129}, #endif - #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE - {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, + #ifdef BIO_R_BAD_FOPEN_MODE + {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE}, #else - {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153}, + {"BAD_FOPEN_MODE", ERR_LIB_BIO, 101}, #endif - #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS - {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, + #ifdef BIO_R_BROKEN_PIPE + {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE}, #else - {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154}, + {"BROKEN_PIPE", ERR_LIB_BIO, 124}, #endif - #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS - {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS}, + #ifdef BIO_R_CONNECT_ERROR + {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR}, #else - {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355}, + {"CONNECT_ERROR", ERR_LIB_BIO, 103}, #endif - #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION - {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION}, + #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET}, #else - {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356}, + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 107}, #endif - #ifdef SSL_R_HTTPS_PROXY_REQUEST - {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, + #ifdef BIO_R_GETSOCKNAME_ERROR + {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR}, #else - {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155}, + {"GETSOCKNAME_ERROR", ERR_LIB_BIO, 132}, #endif - #ifdef SSL_R_HTTP_REQUEST - {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, + #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS + {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS}, #else - {"HTTP_REQUEST", ERR_LIB_SSL, 156}, + {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, 133}, #endif - #ifdef SSL_R_ILLEGAL_PADDING - {"ILLEGAL_PADDING", ERR_LIB_SSL, SSL_R_ILLEGAL_PADDING}, + #ifdef BIO_R_GETTING_SOCKTYPE + {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE}, #else - {"ILLEGAL_PADDING", ERR_LIB_SSL, 283}, + {"GETTING_SOCKTYPE", ERR_LIB_BIO, 134}, #endif - #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST - {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, + #ifdef BIO_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT}, #else - {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380}, + {"INVALID_ARGUMENT", ERR_LIB_BIO, 125}, #endif - #ifdef SSL_R_INAPPROPRIATE_FALLBACK - {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, + #ifdef BIO_R_INVALID_SOCKET + {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET}, #else - {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373}, + {"INVALID_SOCKET", ERR_LIB_BIO, 135}, #endif - #ifdef SSL_R_INCONSISTENT_COMPRESSION - {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, + #ifdef BIO_R_IN_USE + {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE}, #else - {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340}, + {"IN_USE", ERR_LIB_BIO, 123}, #endif - #ifdef SSL_R_INVALID_CHALLENGE_LENGTH - {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_CHALLENGE_LENGTH}, + #ifdef BIO_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG}, #else - {"INVALID_CHALLENGE_LENGTH", ERR_LIB_SSL, 158}, + {"LENGTH_TOO_LONG", ERR_LIB_BIO, 102}, #endif - #ifdef SSL_R_INVALID_COMMAND - {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, + #ifdef BIO_R_LISTEN_V6_ONLY + {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY}, #else - {"INVALID_COMMAND", ERR_LIB_SSL, 280}, + {"LISTEN_V6_ONLY", ERR_LIB_BIO, 136}, #endif - #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM - {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, + #ifdef BIO_R_LOOKUP_RETURNED_NOTHING + {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING}, #else - {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341}, + {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, 142}, #endif - #ifdef SSL_R_INVALID_NULL_CMD_NAME - {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, + #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE + {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE}, #else - {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385}, + {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, 130}, #endif - #ifdef SSL_R_INVALID_PURPOSE - {"INVALID_PURPOSE", ERR_LIB_SSL, SSL_R_INVALID_PURPOSE}, + #ifdef BIO_R_NBIO_CONNECT_ERROR + {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR}, #else - {"INVALID_PURPOSE", ERR_LIB_SSL, 278}, + {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, 110}, #endif - #ifdef SSL_R_INVALID_SERVERINFO_DATA - {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, + #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED}, #else - {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388}, + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 143}, #endif - #ifdef SSL_R_INVALID_SRP_USERNAME - {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, + #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED}, #else - {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357}, + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 144}, #endif - #ifdef SSL_R_INVALID_STATUS_RESPONSE - {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, + #ifdef BIO_R_NO_PORT_DEFINED + {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED}, #else - {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328}, + {"NO_PORT_DEFINED", ERR_LIB_BIO, 113}, #endif - #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH - {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, + #ifdef BIO_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE}, #else - {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325}, + {"NO_SUCH_FILE", ERR_LIB_BIO, 128}, #endif - #ifdef SSL_R_INVALID_TRUST - {"INVALID_TRUST", ERR_LIB_SSL, SSL_R_INVALID_TRUST}, + #ifdef BIO_R_NULL_PARAMETER + {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER}, #else - {"INVALID_TRUST", ERR_LIB_SSL, 279}, + {"NULL_PARAMETER", ERR_LIB_BIO, 115}, #endif - #ifdef SSL_R_KEY_ARG_TOO_LONG - {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, SSL_R_KEY_ARG_TOO_LONG}, + #ifdef BIO_R_UNABLE_TO_BIND_SOCKET + {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET}, #else - {"KEY_ARG_TOO_LONG", ERR_LIB_SSL, 284}, + {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, 117}, #endif - #ifdef SSL_R_KRB5 - {"KRB5", ERR_LIB_SSL, SSL_R_KRB5}, + #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET + {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET}, #else - {"KRB5", ERR_LIB_SSL, 285}, + {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, 118}, #endif - #ifdef SSL_R_KRB5_C_CC_PRINC - {"KRB5_C_CC_PRINC", ERR_LIB_SSL, SSL_R_KRB5_C_CC_PRINC}, + #ifdef BIO_R_UNABLE_TO_KEEPALIVE + {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE}, #else - {"KRB5_C_CC_PRINC", ERR_LIB_SSL, 286}, + {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, 137}, #endif - #ifdef SSL_R_KRB5_C_GET_CRED - {"KRB5_C_GET_CRED", ERR_LIB_SSL, SSL_R_KRB5_C_GET_CRED}, + #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET + {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET}, #else - {"KRB5_C_GET_CRED", ERR_LIB_SSL, 287}, + {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, 119}, #endif - #ifdef SSL_R_KRB5_C_INIT - {"KRB5_C_INIT", ERR_LIB_SSL, SSL_R_KRB5_C_INIT}, + #ifdef BIO_R_UNABLE_TO_NODELAY + {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY}, #else - {"KRB5_C_INIT", ERR_LIB_SSL, 288}, + {"UNABLE_TO_NODELAY", ERR_LIB_BIO, 138}, #endif - #ifdef SSL_R_KRB5_C_MK_REQ - {"KRB5_C_MK_REQ", ERR_LIB_SSL, SSL_R_KRB5_C_MK_REQ}, + #ifdef BIO_R_UNABLE_TO_REUSEADDR + {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR}, #else - {"KRB5_C_MK_REQ", ERR_LIB_SSL, 289}, + {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, 139}, #endif - #ifdef SSL_R_KRB5_S_BAD_TICKET - {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, SSL_R_KRB5_S_BAD_TICKET}, + #ifdef BIO_R_UNAVAILABLE_IP_FAMILY + {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY}, #else - {"KRB5_S_BAD_TICKET", ERR_LIB_SSL, 290}, + {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, 145}, #endif - #ifdef SSL_R_KRB5_S_INIT - {"KRB5_S_INIT", ERR_LIB_SSL, SSL_R_KRB5_S_INIT}, + #ifdef BIO_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED}, #else - {"KRB5_S_INIT", ERR_LIB_SSL, 291}, + {"UNINITIALIZED", ERR_LIB_BIO, 120}, #endif - #ifdef SSL_R_KRB5_S_RD_REQ - {"KRB5_S_RD_REQ", ERR_LIB_SSL, SSL_R_KRB5_S_RD_REQ}, + #ifdef BIO_R_UNKNOWN_INFO_TYPE + {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE}, #else - {"KRB5_S_RD_REQ", ERR_LIB_SSL, 292}, + {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, 140}, #endif - #ifdef SSL_R_KRB5_S_TKT_EXPIRED - {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_EXPIRED}, + #ifdef BIO_R_UNSUPPORTED_IP_FAMILY + {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY}, #else - {"KRB5_S_TKT_EXPIRED", ERR_LIB_SSL, 293}, + {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, 146}, #endif - #ifdef SSL_R_KRB5_S_TKT_NYV - {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV}, + #ifdef BIO_R_UNSUPPORTED_METHOD + {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD}, #else - {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294}, + {"UNSUPPORTED_METHOD", ERR_LIB_BIO, 121}, #endif - #ifdef SSL_R_KRB5_S_TKT_SKEW - {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW}, + #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY + {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY}, #else - {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295}, + {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, 131}, #endif - #ifdef SSL_R_LENGTH_MISMATCH - {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, + #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO + {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO}, #else - {"LENGTH_MISMATCH", ERR_LIB_SSL, 159}, + {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, 126}, #endif - #ifdef SSL_R_LENGTH_TOO_SHORT - {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, + #ifdef BIO_R_WSASTARTUP + {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP}, #else - {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160}, + {"WSASTARTUP", ERR_LIB_BIO, 122}, #endif - #ifdef SSL_R_LIBRARY_BUG - {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, + #ifdef BN_R_ARG2_LT_ARG3 + {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3}, #else - {"LIBRARY_BUG", ERR_LIB_SSL, 274}, + {"ARG2_LT_ARG3", ERR_LIB_BN, 100}, #endif - #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS - {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, + #ifdef BN_R_BAD_RECIPROCAL + {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL}, #else - {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161}, + {"BAD_RECIPROCAL", ERR_LIB_BN, 101}, #endif - #ifdef SSL_R_MESSAGE_TOO_LONG - {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG}, + #ifdef BN_R_BIGNUM_TOO_LONG + {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG}, #else - {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296}, + {"BIGNUM_TOO_LONG", ERR_LIB_BN, 114}, #endif - #ifdef SSL_R_MISSING_DH_DSA_CERT - {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_DSA_CERT}, + #ifdef BN_R_BITS_TOO_SMALL + {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL}, #else - {"MISSING_DH_DSA_CERT", ERR_LIB_SSL, 162}, + {"BITS_TOO_SMALL", ERR_LIB_BN, 118}, #endif - #ifdef SSL_R_MISSING_DH_KEY - {"MISSING_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_DH_KEY}, + #ifdef BN_R_CALLED_WITH_EVEN_MODULUS + {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS}, #else - {"MISSING_DH_KEY", ERR_LIB_SSL, 163}, + {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, 102}, #endif - #ifdef SSL_R_MISSING_DH_RSA_CERT - {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, SSL_R_MISSING_DH_RSA_CERT}, + #ifdef BN_R_DIV_BY_ZERO + {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO}, #else - {"MISSING_DH_RSA_CERT", ERR_LIB_SSL, 164}, + {"DIV_BY_ZERO", ERR_LIB_BN, 103}, #endif - #ifdef SSL_R_MISSING_DSA_SIGNING_CERT - {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, + #ifdef BN_R_ENCODING_ERROR + {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR}, #else - {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165}, + {"ENCODING_ERROR", ERR_LIB_BN, 104}, #endif - #ifdef SSL_R_MISSING_ECDH_CERT - {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT}, + #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA + {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA}, #else - {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382}, + {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, 105}, #endif - #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT - {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, + #ifdef BN_R_INPUT_NOT_REDUCED + {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED}, #else - {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381}, + {"INPUT_NOT_REDUCED", ERR_LIB_BN, 110}, #endif - #ifdef SSL_R_MISSING_EXPORT_TMP_DH_KEY - {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_DH_KEY}, + #ifdef BN_R_INVALID_LENGTH + {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH}, #else - {"MISSING_EXPORT_TMP_DH_KEY", ERR_LIB_SSL, 166}, + {"INVALID_LENGTH", ERR_LIB_BN, 106}, #endif - #ifdef SSL_R_MISSING_EXPORT_TMP_RSA_KEY - {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_EXPORT_TMP_RSA_KEY}, + #ifdef BN_R_INVALID_RANGE + {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE}, #else - {"MISSING_EXPORT_TMP_RSA_KEY", ERR_LIB_SSL, 167}, + {"INVALID_RANGE", ERR_LIB_BN, 115}, #endif - #ifdef SSL_R_MISSING_RSA_CERTIFICATE - {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, + #ifdef BN_R_INVALID_SHIFT + {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT}, #else - {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168}, + {"INVALID_SHIFT", ERR_LIB_BN, 119}, #endif - #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT - {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, + #ifdef BN_R_NOT_A_SQUARE + {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE}, #else - {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169}, + {"NOT_A_SQUARE", ERR_LIB_BN, 111}, #endif - #ifdef SSL_R_MISSING_RSA_SIGNING_CERT - {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, + #ifdef BN_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED}, #else - {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170}, + {"NOT_INITIALIZED", ERR_LIB_BN, 107}, #endif - #ifdef SSL_R_MISSING_SRP_PARAM - {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, + #ifdef BN_R_NO_INVERSE + {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE}, #else - {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358}, + {"NO_INVERSE", ERR_LIB_BN, 108}, #endif - #ifdef SSL_R_MISSING_TMP_DH_KEY - {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, + #ifdef BN_R_NO_SOLUTION + {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION}, #else - {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171}, + {"NO_SOLUTION", ERR_LIB_BN, 116}, #endif - #ifdef SSL_R_MISSING_TMP_ECDH_KEY - {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, + #ifdef BN_R_PRIVATE_KEY_TOO_LARGE + {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE}, #else - {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311}, + {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, 117}, #endif - #ifdef SSL_R_MISSING_TMP_RSA_KEY - {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_KEY}, + #ifdef BN_R_P_IS_NOT_PRIME + {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME}, #else - {"MISSING_TMP_RSA_KEY", ERR_LIB_SSL, 172}, + {"P_IS_NOT_PRIME", ERR_LIB_BN, 112}, #endif - #ifdef SSL_R_MISSING_TMP_RSA_PKEY - {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_RSA_PKEY}, + #ifdef BN_R_TOO_MANY_ITERATIONS + {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS}, #else - {"MISSING_TMP_RSA_PKEY", ERR_LIB_SSL, 173}, + {"TOO_MANY_ITERATIONS", ERR_LIB_BN, 113}, #endif - #ifdef SSL_R_MISSING_VERIFY_MESSAGE - {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, SSL_R_MISSING_VERIFY_MESSAGE}, + #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES + {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES}, #else - {"MISSING_VERIFY_MESSAGE", ERR_LIB_SSL, 174}, + {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, 109}, #endif - #ifdef SSL_R_MULTIPLE_SGC_RESTARTS - {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS}, + #ifdef CMS_R_ADD_SIGNER_ERROR + {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR}, #else - {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346}, + {"ADD_SIGNER_ERROR", ERR_LIB_CMS, 99}, #endif - #ifdef SSL_R_NON_SSLV2_INITIAL_PACKET - {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, SSL_R_NON_SSLV2_INITIAL_PACKET}, + #ifdef CMS_R_ATTRIBUTE_ERROR + {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR}, #else - {"NON_SSLV2_INITIAL_PACKET", ERR_LIB_SSL, 175}, + {"ATTRIBUTE_ERROR", ERR_LIB_CMS, 161}, #endif - #ifdef SSL_R_NO_CERTIFICATES_RETURNED - {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, + #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT + {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT}, #else - {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176}, + {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, 175}, #endif - #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED - {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, + #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID + {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID}, #else - {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177}, + {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, 160}, #endif - #ifdef SSL_R_NO_CERTIFICATE_RETURNED - {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_RETURNED}, + #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR}, #else - {"NO_CERTIFICATE_RETURNED", ERR_LIB_SSL, 178}, + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, 100}, #endif - #ifdef SSL_R_NO_CERTIFICATE_SET - {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, + #ifdef CMS_R_CIPHER_INITIALISATION_ERROR + {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR}, #else - {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179}, + {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, 101}, #endif - #ifdef SSL_R_NO_CERTIFICATE_SPECIFIED - {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SPECIFIED}, + #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR + {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR}, #else - {"NO_CERTIFICATE_SPECIFIED", ERR_LIB_SSL, 180}, + {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, 102}, #endif - #ifdef SSL_R_NO_CIPHERS_AVAILABLE - {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, + #ifdef CMS_R_CMS_DATAFINAL_ERROR + {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR}, #else - {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181}, + {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, 103}, #endif - #ifdef SSL_R_NO_CIPHERS_PASSED - {"NO_CIPHERS_PASSED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_PASSED}, + #ifdef CMS_R_CMS_LIB + {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB}, #else - {"NO_CIPHERS_PASSED", ERR_LIB_SSL, 182}, + {"CMS_LIB", ERR_LIB_CMS, 104}, #endif - #ifdef SSL_R_NO_CIPHERS_SPECIFIED - {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, + #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH + {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH}, #else - {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183}, + {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, 170}, #endif - #ifdef SSL_R_NO_CIPHER_LIST - {"NO_CIPHER_LIST", ERR_LIB_SSL, SSL_R_NO_CIPHER_LIST}, + #ifdef CMS_R_CONTENT_NOT_FOUND + {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND}, #else - {"NO_CIPHER_LIST", ERR_LIB_SSL, 184}, + {"CONTENT_NOT_FOUND", ERR_LIB_CMS, 105}, #endif - #ifdef SSL_R_NO_CIPHER_MATCH - {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, + #ifdef CMS_R_CONTENT_TYPE_MISMATCH + {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH}, #else - {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185}, + {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, 171}, #endif - #ifdef SSL_R_NO_CLIENT_CERT_METHOD - {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, + #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA}, #else - {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331}, + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 106}, #endif - #ifdef SSL_R_NO_CLIENT_CERT_RECEIVED - {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_RECEIVED}, + #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA}, #else - {"NO_CLIENT_CERT_RECEIVED", ERR_LIB_SSL, 186}, + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 107}, #endif - #ifdef SSL_R_NO_COMPRESSION_SPECIFIED - {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, + #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA + {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA}, #else - {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187}, + {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, 108}, #endif - #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER - {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, + #ifdef CMS_R_CONTENT_VERIFY_ERROR + {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR}, #else - {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330}, + {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, 109}, #endif - #ifdef SSL_R_NO_METHOD_SPECIFIED - {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, + #ifdef CMS_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR}, #else - {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188}, + {"CTRL_ERROR", ERR_LIB_CMS, 110}, #endif - #ifdef SSL_R_NO_PEM_EXTENSIONS - {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, + #ifdef CMS_R_CTRL_FAILURE + {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE}, #else - {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389}, + {"CTRL_FAILURE", ERR_LIB_CMS, 111}, #endif - #ifdef SSL_R_NO_PRIVATEKEY - {"NO_PRIVATEKEY", ERR_LIB_SSL, SSL_R_NO_PRIVATEKEY}, + #ifdef CMS_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR}, #else - {"NO_PRIVATEKEY", ERR_LIB_SSL, 189}, + {"DECRYPT_ERROR", ERR_LIB_CMS, 112}, #endif - #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED - {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, + #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY + {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY}, #else - {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190}, + {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, 113}, #endif - #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE - {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, + #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE}, #else - {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191}, + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, 114}, #endif - #ifdef SSL_R_NO_PUBLICKEY - {"NO_PUBLICKEY", ERR_LIB_SSL, SSL_R_NO_PUBLICKEY}, + #ifdef CMS_R_ERROR_SETTING_KEY + {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY}, #else - {"NO_PUBLICKEY", ERR_LIB_SSL, 192}, + {"ERROR_SETTING_KEY", ERR_LIB_CMS, 115}, #endif - #ifdef SSL_R_NO_RENEGOTIATION - {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, + #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO + {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO}, #else - {"NO_RENEGOTIATION", ERR_LIB_SSL, 339}, + {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, 116}, #endif - #ifdef SSL_R_NO_REQUIRED_DIGEST - {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, + #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH + {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH}, #else - {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324}, + {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, 117}, #endif - #ifdef SSL_R_NO_SHARED_CIPHER - {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, + #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER + {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER}, #else - {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193}, + {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, 176}, #endif - #ifdef SSL_R_NO_SHARED_SIGATURE_ALGORITHMS - {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGATURE_ALGORITHMS}, + #ifdef CMS_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH}, #else - {"NO_SHARED_SIGATURE_ALGORITHMS", ERR_LIB_SSL, 376}, + {"INVALID_KEY_LENGTH", ERR_LIB_CMS, 118}, #endif - #ifdef SSL_R_NO_SRTP_PROFILES - {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, + #ifdef CMS_R_MD_BIO_INIT_ERROR + {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR}, #else - {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359}, + {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, 119}, #endif - #ifdef SSL_R_NO_VERIFY_CALLBACK - {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_CALLBACK}, + #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH}, #else - {"NO_VERIFY_CALLBACK", ERR_LIB_SSL, 194}, + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, 120}, #endif - #ifdef SSL_R_NULL_SSL_CTX - {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, + #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH + {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH}, #else - {"NULL_SSL_CTX", ERR_LIB_SSL, 195}, + {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 121}, #endif - #ifdef SSL_R_NULL_SSL_METHOD_PASSED - {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, + #ifdef CMS_R_MSGSIGDIGEST_ERROR + {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR}, #else - {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196}, + {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, 172}, #endif - #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED - {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, + #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE + {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE}, #else - {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197}, + {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, 162}, #endif - #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED - {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, + #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH + {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH}, #else - {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344}, + {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 163}, #endif - #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE - {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #ifdef CMS_R_NEED_ONE_SIGNER + {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER}, #else - {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387}, + {"NEED_ONE_SIGNER", ERR_LIB_CMS, 164}, #endif - #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE - {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #ifdef CMS_R_NOT_A_SIGNED_RECEIPT + {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT}, #else - {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379}, + {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, 165}, #endif - #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE - {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE}, + #ifdef CMS_R_NOT_ENCRYPTED_DATA + {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA}, #else - {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297}, + {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 122}, #endif - #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG - {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG}, + #ifdef CMS_R_NOT_KEK + {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK}, #else - {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327}, + {"NOT_KEK", ERR_LIB_CMS, 123}, #endif - #ifdef SSL_R_PACKET_LENGTH_TOO_LONG - {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, + #ifdef CMS_R_NOT_KEY_AGREEMENT + {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT}, #else - {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198}, + {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, 181}, #endif - #ifdef SSL_R_PARSE_TLSEXT - {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, + #ifdef CMS_R_NOT_KEY_TRANSPORT + {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT}, #else - {"PARSE_TLSEXT", ERR_LIB_SSL, 227}, + {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, 124}, #endif - #ifdef SSL_R_PATH_TOO_LONG - {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, + #ifdef CMS_R_NOT_PWRI + {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI}, #else - {"PATH_TOO_LONG", ERR_LIB_SSL, 270}, + {"NOT_PWRI", ERR_LIB_CMS, 177}, #endif - #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE - {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, + #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199}, + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, 125}, #endif - #ifdef SSL_R_PEER_ERROR - {"PEER_ERROR", ERR_LIB_SSL, SSL_R_PEER_ERROR}, + #ifdef CMS_R_NO_CIPHER + {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER}, #else - {"PEER_ERROR", ERR_LIB_SSL, 200}, + {"NO_CIPHER", ERR_LIB_CMS, 126}, #endif - #ifdef SSL_R_PEER_ERROR_CERTIFICATE - {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_CERTIFICATE}, + #ifdef CMS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT}, #else - {"PEER_ERROR_CERTIFICATE", ERR_LIB_SSL, 201}, + {"NO_CONTENT", ERR_LIB_CMS, 127}, #endif - #ifdef SSL_R_PEER_ERROR_NO_CERTIFICATE - {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CERTIFICATE}, + #ifdef CMS_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE}, #else - {"PEER_ERROR_NO_CERTIFICATE", ERR_LIB_SSL, 202}, + {"NO_CONTENT_TYPE", ERR_LIB_CMS, 173}, #endif - #ifdef SSL_R_PEER_ERROR_NO_CIPHER - {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, SSL_R_PEER_ERROR_NO_CIPHER}, + #ifdef CMS_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST}, #else - {"PEER_ERROR_NO_CIPHER", ERR_LIB_SSL, 203}, + {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, 128}, #endif - #ifdef SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE - {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE}, + #ifdef CMS_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET}, #else - {"PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE", ERR_LIB_SSL, 204}, + {"NO_DIGEST_SET", ERR_LIB_CMS, 129}, #endif - #ifdef SSL_R_PEM_NAME_BAD_PREFIX - {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, + #ifdef CMS_R_NO_KEY + {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY}, #else - {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391}, + {"NO_KEY", ERR_LIB_CMS, 130}, #endif - #ifdef SSL_R_PEM_NAME_TOO_SHORT - {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, + #ifdef CMS_R_NO_KEY_OR_CERT + {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT}, #else - {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392}, + {"NO_KEY_OR_CERT", ERR_LIB_CMS, 174}, #endif - #ifdef SSL_R_PRE_MAC_LENGTH_TOO_LONG - {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PRE_MAC_LENGTH_TOO_LONG}, + #ifdef CMS_R_NO_MATCHING_DIGEST + {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST}, #else - {"PRE_MAC_LENGTH_TOO_LONG", ERR_LIB_SSL, 205}, + {"NO_MATCHING_DIGEST", ERR_LIB_CMS, 131}, #endif - #ifdef SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS - {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS}, + #ifdef CMS_R_NO_MATCHING_RECIPIENT + {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT}, #else - {"PROBLEMS_MAPPING_CIPHER_FUNCTIONS", ERR_LIB_SSL, 206}, + {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, 132}, #endif - #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN - {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, + #ifdef CMS_R_NO_MATCHING_SIGNATURE + {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE}, #else - {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207}, + {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, 166}, #endif - #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND - {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, + #ifdef CMS_R_NO_MSGSIGDIGEST + {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST}, #else - {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223}, + {"NO_MSGSIGDIGEST", ERR_LIB_CMS, 167}, #endif - #ifdef SSL_R_PSK_NO_CLIENT_CB - {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, + #ifdef CMS_R_NO_PASSWORD + {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD}, #else - {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224}, + {"NO_PASSWORD", ERR_LIB_CMS, 178}, #endif - #ifdef SSL_R_PSK_NO_SERVER_CB - {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, + #ifdef CMS_R_NO_PRIVATE_KEY + {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY}, #else - {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225}, + {"NO_PRIVATE_KEY", ERR_LIB_CMS, 133}, #endif - #ifdef SSL_R_PUBLIC_KEY_ENCRYPT_ERROR - {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_ENCRYPT_ERROR}, + #ifdef CMS_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY}, #else - {"PUBLIC_KEY_ENCRYPT_ERROR", ERR_LIB_SSL, 208}, + {"NO_PUBLIC_KEY", ERR_LIB_CMS, 134}, #endif - #ifdef SSL_R_PUBLIC_KEY_IS_NOT_RSA - {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_IS_NOT_RSA}, + #ifdef CMS_R_NO_RECEIPT_REQUEST + {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST}, #else - {"PUBLIC_KEY_IS_NOT_RSA", ERR_LIB_SSL, 209}, + {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, 168}, #endif - #ifdef SSL_R_PUBLIC_KEY_NOT_RSA - {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, SSL_R_PUBLIC_KEY_NOT_RSA}, + #ifdef CMS_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS}, #else - {"PUBLIC_KEY_NOT_RSA", ERR_LIB_SSL, 210}, + {"NO_SIGNERS", ERR_LIB_CMS, 135}, #endif - #ifdef SSL_R_READ_BIO_NOT_SET - {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, + #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, 136}, #endif - #ifdef SSL_R_READ_TIMEOUT_EXPIRED - {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, + #ifdef CMS_R_RECEIPT_DECODE_ERROR + {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR}, #else - {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312}, + {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, 169}, #endif - #ifdef SSL_R_READ_WRONG_PACKET_TYPE - {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, SSL_R_READ_WRONG_PACKET_TYPE}, + #ifdef CMS_R_RECIPIENT_ERROR + {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR}, #else - {"READ_WRONG_PACKET_TYPE", ERR_LIB_SSL, 212}, + {"RECIPIENT_ERROR", ERR_LIB_CMS, 137}, #endif - #ifdef SSL_R_RECORD_LENGTH_MISMATCH - {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, + #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213}, + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, 138}, #endif - #ifdef SSL_R_RECORD_TOO_LARGE - {"RECORD_TOO_LARGE", ERR_LIB_SSL, SSL_R_RECORD_TOO_LARGE}, + #ifdef CMS_R_SIGNFINAL_ERROR + {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR}, #else - {"RECORD_TOO_LARGE", ERR_LIB_SSL, 214}, + {"SIGNFINAL_ERROR", ERR_LIB_CMS, 139}, #endif - #ifdef SSL_R_RECORD_TOO_SMALL - {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, + #ifdef CMS_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR}, #else - {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298}, + {"SMIME_TEXT_ERROR", ERR_LIB_CMS, 140}, #endif - #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG - {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, + #ifdef CMS_R_STORE_INIT_ERROR + {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR}, + #else + {"STORE_INIT_ERROR", ERR_LIB_CMS, 141}, + #endif + #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA + {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA}, + #else + {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 142}, + #endif + #ifdef CMS_R_TYPE_NOT_DATA + {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA}, + #else + {"TYPE_NOT_DATA", ERR_LIB_CMS, 143}, + #endif + #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA + {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA}, + #else + {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, 144}, + #endif + #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA + {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA}, + #else + {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 145}, + #endif + #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA + {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA}, + #else + {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 146}, + #endif + #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT + {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT}, + #else + {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, 147}, + #endif + #ifdef CMS_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", ERR_LIB_CMS, 148}, + #endif + #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, 149}, + #endif + #ifdef CMS_R_UNKNOWN_ID + {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID}, + #else + {"UNKNOWN_ID", ERR_LIB_CMS, 150}, + #endif + #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, 151}, + #endif + #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, 152}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM + {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM}, + #else + {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, 153}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM}, + #else + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, 179}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE}, + #else + {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, 155}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE + {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE}, + #else + {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, 154}, + #endif + #ifdef CMS_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", ERR_LIB_CMS, 156}, + #endif + #ifdef CMS_R_UNWRAP_ERROR + {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR}, + #else + {"UNWRAP_ERROR", ERR_LIB_CMS, 157}, + #endif + #ifdef CMS_R_UNWRAP_FAILURE + {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE}, + #else + {"UNWRAP_FAILURE", ERR_LIB_CMS, 180}, + #endif + #ifdef CMS_R_VERIFICATION_FAILURE + {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE}, + #else + {"VERIFICATION_FAILURE", ERR_LIB_CMS, 158}, + #endif + #ifdef CMS_R_WRAP_ERROR + {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR}, + #else + {"WRAP_ERROR", ERR_LIB_CMS, 159}, + #endif + #ifdef COMP_R_ZLIB_DEFLATE_ERROR + {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR}, + #else + {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, 99}, + #endif + #ifdef COMP_R_ZLIB_INFLATE_ERROR + {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR}, + #else + {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, 100}, + #endif + #ifdef COMP_R_ZLIB_NOT_SUPPORTED + {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED}, + #else + {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, 101}, + #endif + #ifdef CONF_R_ERROR_LOADING_DSO + {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO}, + #else + {"ERROR_LOADING_DSO", ERR_LIB_CONF, 110}, + #endif + #ifdef CONF_R_LIST_CANNOT_BE_NULL + {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL}, + #else + {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, 115}, + #endif + #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET + {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET}, + #else + {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, 100}, + #endif + #ifdef CONF_R_MISSING_EQUAL_SIGN + {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN}, + #else + {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, 101}, + #endif + #ifdef CONF_R_MISSING_INIT_FUNCTION + {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION}, + #else + {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, 112}, + #endif + #ifdef CONF_R_MODULE_INITIALIZATION_ERROR + {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR}, + #else + {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, 109}, + #endif + #ifdef CONF_R_NO_CLOSE_BRACE + {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE}, + #else + {"NO_CLOSE_BRACE", ERR_LIB_CONF, 102}, + #endif + #ifdef CONF_R_NO_CONF + {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF}, + #else + {"NO_CONF", ERR_LIB_CONF, 105}, + #endif + #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE}, + #else + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, 106}, + #endif + #ifdef CONF_R_NO_SECTION + {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION}, + #else + {"NO_SECTION", ERR_LIB_CONF, 107}, + #endif + #ifdef CONF_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE}, + #else + {"NO_SUCH_FILE", ERR_LIB_CONF, 114}, + #endif + #ifdef CONF_R_NO_VALUE + {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE}, + #else + {"NO_VALUE", ERR_LIB_CONF, 108}, + #endif + #ifdef CONF_R_NUMBER_TOO_LARGE + {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE}, + #else + {"NUMBER_TOO_LARGE", ERR_LIB_CONF, 121}, + #endif + #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE + {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE}, + #else + {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, 111}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, 117}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, 118}, + #endif + #ifdef CONF_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", ERR_LIB_CONF, 119}, + #endif + #ifdef CONF_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, 120}, + #endif + #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION + {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION}, + #else + {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, 103}, + #endif + #ifdef CONF_R_UNKNOWN_MODULE_NAME + {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME}, + #else + {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, 113}, + #endif + #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG + {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG}, + #else + {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, 116}, + #endif + #ifdef CONF_R_VARIABLE_HAS_NO_VALUE + {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE}, + #else + {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, 104}, + #endif + #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, 101}, + #endif + #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT + {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT}, + #else + {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, 102}, + #endif + #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS + {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS}, + #else + {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, 103}, + #endif + #ifdef CT_R_BASE64_DECODE_ERROR + {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR}, + #else + {"BASE64_DECODE_ERROR", ERR_LIB_CT, 108}, + #endif + #ifdef CT_R_INVALID_LOG_ID_LENGTH + {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH}, + #else + {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, 100}, + #endif + #ifdef CT_R_LOG_CONF_INVALID + {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID}, + #else + {"LOG_CONF_INVALID", ERR_LIB_CT, 109}, + #endif + #ifdef CT_R_LOG_CONF_INVALID_KEY + {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY}, + #else + {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, 110}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION + {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION}, + #else + {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, 111}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_KEY + {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY}, + #else + {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, 112}, + #endif + #ifdef CT_R_LOG_KEY_INVALID + {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID}, + #else + {"LOG_KEY_INVALID", ERR_LIB_CT, 113}, + #endif + #ifdef CT_R_SCT_FUTURE_TIMESTAMP + {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP}, + #else + {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, 116}, + #endif + #ifdef CT_R_SCT_INVALID + {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID}, + #else + {"SCT_INVALID", ERR_LIB_CT, 104}, + #endif + #ifdef CT_R_SCT_INVALID_SIGNATURE + {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE}, + #else + {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, 107}, + #endif + #ifdef CT_R_SCT_LIST_INVALID + {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID}, + #else + {"SCT_LIST_INVALID", ERR_LIB_CT, 105}, + #endif + #ifdef CT_R_SCT_LOG_ID_MISMATCH + {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH}, + #else + {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, 114}, + #endif + #ifdef CT_R_SCT_NOT_SET + {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET}, + #else + {"SCT_NOT_SET", ERR_LIB_CT, 106}, + #endif + #ifdef CT_R_SCT_UNSUPPORTED_VERSION + {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION}, + #else + {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, 115}, + #endif + #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID + {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID}, + #else + {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, 101}, + #endif + #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE + {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE}, + #else + {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, 102}, + #endif + #ifdef CT_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION}, + #else + {"UNSUPPORTED_VERSION", ERR_LIB_CT, 103}, + #endif + #ifdef DH_R_BAD_GENERATOR + {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR}, + #else + {"BAD_GENERATOR", ERR_LIB_DH, 101}, + #endif + #ifdef DH_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", ERR_LIB_DH, 109}, + #endif + #ifdef DH_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR}, + #else + {"BN_ERROR", ERR_LIB_DH, 106}, + #endif + #ifdef DH_R_CHECK_INVALID_J_VALUE + {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE}, + #else + {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, 115}, + #endif + #ifdef DH_R_CHECK_INVALID_Q_VALUE + {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE}, + #else + {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, 116}, + #endif + #ifdef DH_R_CHECK_PUBKEY_INVALID + {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID}, + #else + {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, 122}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE + {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE}, + #else + {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, 123}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL + {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL}, + #else + {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, 124}, + #endif + #ifdef DH_R_CHECK_P_NOT_PRIME + {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME}, + #else + {"CHECK_P_NOT_PRIME", ERR_LIB_DH, 117}, + #endif + #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME + {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME}, + #else + {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, 118}, + #endif + #ifdef DH_R_CHECK_Q_NOT_PRIME + {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME}, + #else + {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, 119}, + #endif + #ifdef DH_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_DH, 104}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NAME + {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME}, + #else + {"INVALID_PARAMETER_NAME", ERR_LIB_DH, 110}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NID + {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID}, + #else + {"INVALID_PARAMETER_NID", ERR_LIB_DH, 114}, + #endif + #ifdef DH_R_INVALID_PUBKEY + {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY}, + #else + {"INVALID_PUBKEY", ERR_LIB_DH, 102}, + #endif + #ifdef DH_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", ERR_LIB_DH, 112}, + #endif + #ifdef DH_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", ERR_LIB_DH, 108}, + #endif + #ifdef DH_R_MISSING_PUBKEY + {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY}, + #else + {"MISSING_PUBKEY", ERR_LIB_DH, 125}, + #endif + #ifdef DH_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", ERR_LIB_DH, 103}, + #endif + #ifdef DH_R_NOT_SUITABLE_GENERATOR + {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR}, + #else + {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, 120}, + #endif + #ifdef DH_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", ERR_LIB_DH, 107}, + #endif + #ifdef DH_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", ERR_LIB_DH, 100}, + #endif + #ifdef DH_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, 105}, + #endif + #ifdef DH_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", ERR_LIB_DH, 111}, + #endif + #ifdef DH_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", ERR_LIB_DH, 113}, + #endif + #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR + {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR}, + #else + {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, 121}, + #endif + #ifdef DSA_R_BAD_Q_VALUE + {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE}, + #else + {"BAD_Q_VALUE", ERR_LIB_DSA, 102}, + #endif + #ifdef DSA_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", ERR_LIB_DSA, 108}, + #endif + #ifdef DSA_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR}, + #else + {"BN_ERROR", ERR_LIB_DSA, 109}, + #endif + #ifdef DSA_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_DSA, 104}, + #endif + #ifdef DSA_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, 106}, + #endif + #ifdef DSA_R_INVALID_PARAMETERS + {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS}, + #else + {"INVALID_PARAMETERS", ERR_LIB_DSA, 112}, + #endif + #ifdef DSA_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_DSA, 101}, + #endif + #ifdef DSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, 111}, + #endif + #ifdef DSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", ERR_LIB_DSA, 103}, + #endif + #ifdef DSA_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", ERR_LIB_DSA, 107}, + #endif + #ifdef DSA_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, 105}, + #endif + #ifdef DSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", ERR_LIB_DSA, 113}, + #endif + #ifdef DSA_R_SEED_LEN_SMALL + {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL}, + #else + {"SEED_LEN_SMALL", ERR_LIB_DSA, 110}, + #endif + #ifdef EC_R_ASN1_ERROR + {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR}, + #else + {"ASN1_ERROR", ERR_LIB_EC, 115}, + #endif + #ifdef EC_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", ERR_LIB_EC, 156}, + #endif + #ifdef EC_R_BIGNUM_OUT_OF_RANGE + {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE}, + #else + {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, 144}, + #endif + #ifdef EC_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", ERR_LIB_EC, 100}, + #endif + #ifdef EC_R_CANNOT_INVERT + {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT}, + #else + {"CANNOT_INVERT", ERR_LIB_EC, 165}, + #endif + #ifdef EC_R_COORDINATES_OUT_OF_RANGE + {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE}, + #else + {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, 146}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH + {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH}, + #else + {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, 160}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING + {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING}, + #else + {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, 159}, + #endif + #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE + {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE}, + #else + {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 117}, + #endif + #ifdef EC_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_EC, 142}, + #endif + #ifdef EC_R_DISCRIMINANT_IS_ZERO + {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO}, + #else + {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, 118}, + #endif + #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE + {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE}, + #else + {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, 119}, + #endif + #ifdef EC_R_FIELD_TOO_LARGE + {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE}, + #else + {"FIELD_TOO_LARGE", ERR_LIB_EC, 143}, + #endif + #ifdef EC_R_GF2M_NOT_SUPPORTED + {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED}, + #else + {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, 147}, + #endif + #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE + {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE}, + #else + {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, 120}, + #endif + #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE + {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE}, + #else + {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 121}, + #endif + #ifdef EC_R_INCOMPATIBLE_OBJECTS + {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS}, + #else + {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, 101}, + #endif + #ifdef EC_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", ERR_LIB_EC, 112}, + #endif + #ifdef EC_R_INVALID_COMPRESSED_POINT + {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT}, + #else + {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, 110}, + #endif + #ifdef EC_R_INVALID_COMPRESSION_BIT + {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT}, + #else + {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, 109}, + #endif + #ifdef EC_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", ERR_LIB_EC, 141}, + #endif + #ifdef EC_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_EC, 151}, + #endif + #ifdef EC_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", ERR_LIB_EC, 138}, + #endif + #ifdef EC_R_INVALID_ENCODING + {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING}, + #else + {"INVALID_ENCODING", ERR_LIB_EC, 102}, + #endif + #ifdef EC_R_INVALID_FIELD + {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD}, + #else + {"INVALID_FIELD", ERR_LIB_EC, 103}, + #endif + #ifdef EC_R_INVALID_FORM + {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM}, + #else + {"INVALID_FORM", ERR_LIB_EC, 104}, + #endif + #ifdef EC_R_INVALID_GROUP_ORDER + {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER}, + #else + {"INVALID_GROUP_ORDER", ERR_LIB_EC, 122}, + #endif + #ifdef EC_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY}, + #else + {"INVALID_KEY", ERR_LIB_EC, 116}, + #endif + #ifdef EC_R_INVALID_OUTPUT_LENGTH + {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH}, + #else + {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, 161}, + #endif + #ifdef EC_R_INVALID_PEER_KEY + {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY}, + #else + {"INVALID_PEER_KEY", ERR_LIB_EC, 133}, + #endif + #ifdef EC_R_INVALID_PENTANOMIAL_BASIS + {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS}, + #else + {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, 132}, + #endif + #ifdef EC_R_INVALID_PRIVATE_KEY + {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY}, + #else + {"INVALID_PRIVATE_KEY", ERR_LIB_EC, 123}, + #endif + #ifdef EC_R_INVALID_TRINOMIAL_BASIS + {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS}, + #else + {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, 137}, + #endif + #ifdef EC_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", ERR_LIB_EC, 148}, + #endif + #ifdef EC_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", ERR_LIB_EC, 140}, + #endif + #ifdef EC_R_LADDER_POST_FAILURE + {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE}, + #else + {"LADDER_POST_FAILURE", ERR_LIB_EC, 136}, + #endif + #ifdef EC_R_LADDER_PRE_FAILURE + {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE}, + #else + {"LADDER_PRE_FAILURE", ERR_LIB_EC, 153}, + #endif + #ifdef EC_R_LADDER_STEP_FAILURE + {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE}, + #else + {"LADDER_STEP_FAILURE", ERR_LIB_EC, 162}, + #endif + #ifdef EC_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_EC, 124}, + #endif + #ifdef EC_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", ERR_LIB_EC, 125}, + #endif + #ifdef EC_R_NEED_NEW_SETUP_VALUES + {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES}, + #else + {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, 157}, + #endif + #ifdef EC_R_NOT_A_NIST_PRIME + {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME}, + #else + {"NOT_A_NIST_PRIME", ERR_LIB_EC, 135}, + #endif + #ifdef EC_R_NOT_IMPLEMENTED + {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED}, + #else + {"NOT_IMPLEMENTED", ERR_LIB_EC, 126}, + #endif + #ifdef EC_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED}, + #else + {"NOT_INITIALIZED", ERR_LIB_EC, 111}, + #endif + #ifdef EC_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", ERR_LIB_EC, 139}, + #endif + #ifdef EC_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", ERR_LIB_EC, 154}, + #endif + #ifdef EC_R_OPERATION_NOT_SUPPORTED + {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED}, + #else + {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, 152}, + #endif + #ifdef EC_R_PASSED_NULL_PARAMETER + {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER}, + #else + {"PASSED_NULL_PARAMETER", ERR_LIB_EC, 134}, + #endif + #ifdef EC_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", ERR_LIB_EC, 149}, + #endif + #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE + {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE}, + #else + {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, 127}, + #endif + #ifdef EC_R_POINT_ARITHMETIC_FAILURE + {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE}, + #else + {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, 155}, + #endif + #ifdef EC_R_POINT_AT_INFINITY + {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY}, + #else + {"POINT_AT_INFINITY", ERR_LIB_EC, 106}, + #endif + #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE + {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE}, + #else + {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, 163}, + #endif + #ifdef EC_R_POINT_IS_NOT_ON_CURVE + {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE}, + #else + {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, 107}, + #endif + #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED + {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED}, + #else + {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, 158}, + #endif + #ifdef EC_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", ERR_LIB_EC, 150}, + #endif + #ifdef EC_R_SLOT_FULL + {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL}, + #else + {"SLOT_FULL", ERR_LIB_EC, 108}, + #endif + #ifdef EC_R_UNDEFINED_GENERATOR + {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR}, + #else + {"UNDEFINED_GENERATOR", ERR_LIB_EC, 113}, + #endif + #ifdef EC_R_UNDEFINED_ORDER + {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER}, + #else + {"UNDEFINED_ORDER", ERR_LIB_EC, 128}, + #endif + #ifdef EC_R_UNKNOWN_COFACTOR + {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR}, + #else + {"UNKNOWN_COFACTOR", ERR_LIB_EC, 164}, + #endif + #ifdef EC_R_UNKNOWN_GROUP + {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP}, + #else + {"UNKNOWN_GROUP", ERR_LIB_EC, 129}, + #endif + #ifdef EC_R_UNKNOWN_ORDER + {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER}, + #else + {"UNKNOWN_ORDER", ERR_LIB_EC, 114}, + #endif + #ifdef EC_R_UNSUPPORTED_FIELD + {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD}, + #else + {"UNSUPPORTED_FIELD", ERR_LIB_EC, 131}, + #endif + #ifdef EC_R_WRONG_CURVE_PARAMETERS + {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS}, + #else + {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, 145}, + #endif + #ifdef EC_R_WRONG_ORDER + {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER}, + #else + {"WRONG_ORDER", ERR_LIB_EC, 130}, + #endif + #ifdef ENGINE_R_ALREADY_LOADED + {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED}, + #else + {"ALREADY_LOADED", ERR_LIB_ENGINE, 100}, + #endif + #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER + {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER}, + #else + {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, 133}, + #endif + #ifdef ENGINE_R_CMD_NOT_EXECUTABLE + {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE}, + #else + {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, 134}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_INPUT + {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT}, + #else + {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, 135}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT + {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT}, + #else + {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, 136}, + #endif + #ifdef ENGINE_R_CONFLICTING_ENGINE_ID + {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID}, + #else + {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, 103}, + #endif + #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED + {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED}, + #else + {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, 119}, + #endif + #ifdef ENGINE_R_DSO_FAILURE + {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE}, + #else + {"DSO_FAILURE", ERR_LIB_ENGINE, 104}, + #endif + #ifdef ENGINE_R_DSO_NOT_FOUND + {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND}, + #else + {"DSO_NOT_FOUND", ERR_LIB_ENGINE, 132}, + #endif + #ifdef ENGINE_R_ENGINES_SECTION_ERROR + {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR}, + #else + {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, 148}, + #endif + #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR + {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR}, + #else + {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, 102}, + #endif + #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST + {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST}, + #else + {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, 105}, + #endif + #ifdef ENGINE_R_ENGINE_SECTION_ERROR + {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR}, + #else + {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, 149}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY + {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY}, + #else + {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, 128}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY + {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY}, + #else + {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, 129}, + #endif + #ifdef ENGINE_R_FINISH_FAILED + {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED}, + #else + {"FINISH_FAILED", ERR_LIB_ENGINE, 106}, + #endif + #ifdef ENGINE_R_ID_OR_NAME_MISSING + {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING}, + #else + {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, 108}, + #endif + #ifdef ENGINE_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED}, + #else + {"INIT_FAILED", ERR_LIB_ENGINE, 109}, + #endif + #ifdef ENGINE_R_INTERNAL_LIST_ERROR + {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR}, + #else + {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, 110}, + #endif + #ifdef ENGINE_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", ERR_LIB_ENGINE, 143}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NAME + {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME}, + #else + {"INVALID_CMD_NAME", ERR_LIB_ENGINE, 137}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NUMBER + {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER}, + #else + {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, 138}, + #endif + #ifdef ENGINE_R_INVALID_INIT_VALUE + {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE}, + #else + {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, 151}, + #endif + #ifdef ENGINE_R_INVALID_STRING + {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING}, + #else + {"INVALID_STRING", ERR_LIB_ENGINE, 150}, + #endif + #ifdef ENGINE_R_NOT_INITIALISED + {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED}, + #else + {"NOT_INITIALISED", ERR_LIB_ENGINE, 117}, + #endif + #ifdef ENGINE_R_NOT_LOADED + {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED}, + #else + {"NOT_LOADED", ERR_LIB_ENGINE, 112}, + #endif + #ifdef ENGINE_R_NO_CONTROL_FUNCTION + {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION}, + #else + {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, 120}, + #endif + #ifdef ENGINE_R_NO_INDEX + {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX}, + #else + {"NO_INDEX", ERR_LIB_ENGINE, 144}, + #endif + #ifdef ENGINE_R_NO_LOAD_FUNCTION + {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION}, + #else + {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, 125}, + #endif + #ifdef ENGINE_R_NO_REFERENCE + {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE}, + #else + {"NO_REFERENCE", ERR_LIB_ENGINE, 130}, + #endif + #ifdef ENGINE_R_NO_SUCH_ENGINE + {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE}, + #else + {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, 116}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER + {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER}, + #else + {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, 146}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST + {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST}, + #else + {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, 147}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD}, + #else + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, 101}, + #endif + #ifdef ENGINE_R_VERSION_INCOMPATIBILITY + {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY}, + #else + {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, 145}, + #endif + #ifdef EVP_R_AES_KEY_SETUP_FAILED + {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED}, + #else + {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, 143}, + #endif + #ifdef EVP_R_ARIA_KEY_SETUP_FAILED + {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED}, + #else + {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 176}, + #endif + #ifdef EVP_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", ERR_LIB_EVP, 100}, + #endif + #ifdef EVP_R_BAD_KEY_LENGTH + {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH}, + #else + {"BAD_KEY_LENGTH", ERR_LIB_EVP, 195}, + #endif + #ifdef EVP_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", ERR_LIB_EVP, 155}, + #endif + #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED + {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED}, + #else + {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 157}, + #endif + #ifdef EVP_R_CIPHER_PARAMETER_ERROR + {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR}, + #else + {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, 122}, + #endif + #ifdef EVP_R_COMMAND_NOT_SUPPORTED + {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED}, + #else + {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, 147}, + #endif + #ifdef EVP_R_COPY_ERROR + {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR}, + #else + {"COPY_ERROR", ERR_LIB_EVP, 173}, + #endif + #ifdef EVP_R_CTRL_NOT_IMPLEMENTED + {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED}, + #else + {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, 132}, + #endif + #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED + {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED}, + #else + {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, 133}, + #endif + #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH}, + #else + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, 138}, + #endif + #ifdef EVP_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_EVP, 114}, + #endif + #ifdef EVP_R_DIFFERENT_KEY_TYPES + {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES}, + #else + {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, 101}, + #endif + #ifdef EVP_R_DIFFERENT_PARAMETERS + {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS}, + #else + {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, 153}, + #endif + #ifdef EVP_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION}, + #else + {"ERROR_LOADING_SECTION", ERR_LIB_EVP, 165}, + #endif + #ifdef EVP_R_ERROR_SETTING_FIPS_MODE + {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE}, + #else + {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, 166}, + #endif + #ifdef EVP_R_EXPECTING_AN_HMAC_KEY + {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY}, + #else + {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, 174}, + #endif + #ifdef EVP_R_EXPECTING_AN_RSA_KEY + {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY}, + #else + {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, 127}, + #endif + #ifdef EVP_R_EXPECTING_A_DH_KEY + {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY}, + #else + {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, 128}, + #endif + #ifdef EVP_R_EXPECTING_A_DSA_KEY + {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY}, + #else + {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, 129}, + #endif + #ifdef EVP_R_EXPECTING_A_EC_KEY + {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY}, + #else + {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, 142}, + #endif + #ifdef EVP_R_EXPECTING_A_POLY1305_KEY + {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY}, + #else + {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, 164}, + #endif + #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY + {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY}, + #else + {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, 175}, + #endif + #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, 167}, + #endif + #ifdef EVP_R_GET_RAW_KEY_FAILED + {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED}, + #else + {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, 182}, + #endif + #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS + {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS}, + #else + {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, 171}, + #endif + #ifdef EVP_R_INITIALIZATION_ERROR + {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR}, + #else + {"INITIALIZATION_ERROR", ERR_LIB_EVP, 134}, + #endif + #ifdef EVP_R_INPUT_NOT_INITIALIZED + {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED}, + #else + {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, 111}, + #endif + #ifdef EVP_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_EVP, 152}, + #endif + #ifdef EVP_R_INVALID_FIPS_MODE + {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE}, + #else + {"INVALID_FIPS_MODE", ERR_LIB_EVP, 168}, + #endif + #ifdef EVP_R_INVALID_IV_LENGTH + {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH}, + #else + {"INVALID_IV_LENGTH", ERR_LIB_EVP, 194}, + #endif + #ifdef EVP_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY}, + #else + {"INVALID_KEY", ERR_LIB_EVP, 163}, + #endif + #ifdef EVP_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", ERR_LIB_EVP, 130}, + #endif + #ifdef EVP_R_INVALID_OPERATION + {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION}, + #else + {"INVALID_OPERATION", ERR_LIB_EVP, 148}, + #endif + #ifdef EVP_R_KEYGEN_FAILURE + {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE}, + #else + {"KEYGEN_FAILURE", ERR_LIB_EVP, 120}, + #endif + #ifdef EVP_R_KEY_SETUP_FAILED + {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED}, + #else + {"KEY_SETUP_FAILED", ERR_LIB_EVP, 180}, + #endif + #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED + {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED}, + #else + {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, 172}, + #endif + #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL + {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL}, + #else + {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, 159}, + #endif + #ifdef EVP_R_METHOD_NOT_SUPPORTED + {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED}, + #else + {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, 144}, + #endif + #ifdef EVP_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_EVP, 103}, + #endif + #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH}, + #else + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, 178}, + #endif + #ifdef EVP_R_NO_CIPHER_SET + {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET}, + #else + {"NO_CIPHER_SET", ERR_LIB_EVP, 131}, + #endif + #ifdef EVP_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, 158}, + #endif + #ifdef EVP_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET}, + #else + {"NO_DIGEST_SET", ERR_LIB_EVP, 139}, + #endif + #ifdef EVP_R_NO_KEY_SET + {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET}, + #else + {"NO_KEY_SET", ERR_LIB_EVP, 154}, + #endif + #ifdef EVP_R_NO_OPERATION_SET + {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET}, + #else + {"NO_OPERATION_SET", ERR_LIB_EVP, 149}, + #endif + #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED + {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED}, + #else + {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, 177}, + #endif + #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, 150}, + #endif + #ifdef EVP_R_OPERATON_NOT_INITIALIZED + {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED}, + #else + {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, 151}, + #endif + #ifdef EVP_R_PARTIALLY_OVERLAPPING + {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING}, + #else + {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, 162}, + #endif + #ifdef EVP_R_PBKDF2_ERROR + {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR}, + #else + {"PBKDF2_ERROR", ERR_LIB_EVP, 181}, + #endif + #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED}, + #else + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, 179}, + #endif + #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR + {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR}, + #else + {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, 145}, + #endif + #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR + {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR}, + #else + {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, 146}, + #endif + #ifdef EVP_R_PUBLIC_KEY_NOT_RSA + {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA}, + #else + {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, 106}, + #endif + #ifdef EVP_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", ERR_LIB_EVP, 160}, + #endif + #ifdef EVP_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", ERR_LIB_EVP, 161}, + #endif + #ifdef EVP_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION}, + #else + {"UNKNOWN_OPTION", ERR_LIB_EVP, 169}, + #endif + #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM + {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM}, + #else + {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, 121}, + #endif + #ifdef EVP_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, 156}, + #endif + #ifdef EVP_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, 107}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEYLENGTH + {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH}, + #else + {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, 123}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION}, + #else + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, 124}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_SIZE + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE}, + #else + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, 108}, + #endif + #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, + #else + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, 135}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRF + {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF}, + #else + {"UNSUPPORTED_PRF", ERR_LIB_EVP, 125}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM}, + #else + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, 118}, + #endif + #ifdef EVP_R_UNSUPPORTED_SALT_TYPE + {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE}, + #else + {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, 126}, + #endif + #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED + {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED}, + #else + {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, 170}, + #endif + #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH}, + #else + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, 109}, + #endif + #ifdef EVP_R_XTS_DUPLICATED_KEYS + {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS}, + #else + {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, 183}, + #endif + #ifdef KDF_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_KDF, 100}, + #endif + #ifdef KDF_R_MISSING_ITERATION_COUNT + {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT}, + #else + {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, 109}, + #endif + #ifdef KDF_R_MISSING_KEY + {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY}, + #else + {"MISSING_KEY", ERR_LIB_KDF, 104}, + #endif + #ifdef KDF_R_MISSING_MESSAGE_DIGEST + {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST}, + #else + {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, 105}, + #endif + #ifdef KDF_R_MISSING_PARAMETER + {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER}, + #else + {"MISSING_PARAMETER", ERR_LIB_KDF, 101}, + #endif + #ifdef KDF_R_MISSING_PASS + {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS}, + #else + {"MISSING_PASS", ERR_LIB_KDF, 110}, + #endif + #ifdef KDF_R_MISSING_SALT + {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT}, + #else + {"MISSING_SALT", ERR_LIB_KDF, 111}, + #endif + #ifdef KDF_R_MISSING_SECRET + {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET}, + #else + {"MISSING_SECRET", ERR_LIB_KDF, 107}, + #endif + #ifdef KDF_R_MISSING_SEED + {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED}, + #else + {"MISSING_SEED", ERR_LIB_KDF, 106}, + #endif + #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE + {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE}, + #else + {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, 103}, + #endif + #ifdef KDF_R_VALUE_ERROR + {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR}, + #else + {"VALUE_ERROR", ERR_LIB_KDF, 108}, + #endif + #ifdef KDF_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", ERR_LIB_KDF, 102}, + #endif + #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, 101}, + #endif + #ifdef OCSP_R_DIGEST_ERR + {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR}, + #else + {"DIGEST_ERR", ERR_LIB_OCSP, 102}, + #endif + #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD + {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD}, + #else + {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, 122}, + #endif + #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD + {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD}, + #else + {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, 123}, + #endif + #ifdef OCSP_R_ERROR_PARSING_URL + {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL}, + #else + {"ERROR_PARSING_URL", ERR_LIB_OCSP, 121}, + #endif + #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE + {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE}, + #else + {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, 103}, + #endif + #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE + {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE}, + #else + {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, 124}, + #endif + #ifdef OCSP_R_NOT_BASIC_RESPONSE + {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE}, + #else + {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, 104}, + #endif + #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN + {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN}, + #else + {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, 105}, + #endif + #ifdef OCSP_R_NO_RESPONSE_DATA + {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA}, + #else + {"NO_RESPONSE_DATA", ERR_LIB_OCSP, 108}, + #endif + #ifdef OCSP_R_NO_REVOKED_TIME + {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME}, + #else + {"NO_REVOKED_TIME", ERR_LIB_OCSP, 109}, + #endif + #ifdef OCSP_R_NO_SIGNER_KEY + {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY}, + #else + {"NO_SIGNER_KEY", ERR_LIB_OCSP, 130}, + #endif + #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, 110}, + #endif + #ifdef OCSP_R_REQUEST_NOT_SIGNED + {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED}, + #else + {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, 128}, + #endif + #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA}, + #else + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, 111}, + #endif + #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED + {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED}, + #else + {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, 112}, + #endif + #ifdef OCSP_R_SERVER_RESPONSE_ERROR + {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR}, + #else + {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, 114}, + #endif + #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR + {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR}, + #else + {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, 115}, + #endif + #ifdef OCSP_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", ERR_LIB_OCSP, 117}, + #endif + #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, 118}, + #endif + #ifdef OCSP_R_STATUS_EXPIRED + {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED}, + #else + {"STATUS_EXPIRED", ERR_LIB_OCSP, 125}, + #endif + #ifdef OCSP_R_STATUS_NOT_YET_VALID + {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID}, + #else + {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, 126}, + #endif + #ifdef OCSP_R_STATUS_TOO_OLD + {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD}, + #else + {"STATUS_TOO_OLD", ERR_LIB_OCSP, 127}, + #endif + #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST + {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST}, + #else + {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, 119}, + #endif + #ifdef OCSP_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", ERR_LIB_OCSP, 120}, + #endif + #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE + {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE}, + #else + {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, 129}, + #endif + #ifdef PEM_R_BAD_BASE64_DECODE + {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, + #else + {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100}, + #endif + #ifdef PEM_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", ERR_LIB_PEM, 101}, + #endif + #ifdef PEM_R_BAD_END_LINE + {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, + #else + {"BAD_END_LINE", ERR_LIB_PEM, 102}, + #endif + #ifdef PEM_R_BAD_IV_CHARS + {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, + #else + {"BAD_IV_CHARS", ERR_LIB_PEM, 103}, + #endif + #ifdef PEM_R_BAD_MAGIC_NUMBER + {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, + #else + {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116}, + #endif + #ifdef PEM_R_BAD_PASSWORD_READ + {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, + #else + {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104}, + #endif + #ifdef PEM_R_BAD_VERSION_NUMBER + {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, + #else + {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117}, + #endif + #ifdef PEM_R_BIO_WRITE_FAILURE + {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, + #else + {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118}, + #endif + #ifdef PEM_R_CIPHER_IS_NULL + {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, + #else + {"CIPHER_IS_NULL", ERR_LIB_PEM, 127}, + #endif + #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY + {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, + #else + {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115}, + #endif + #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB + {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, + #else + {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119}, + #endif + #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB + {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, + #else + {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120}, + #endif + #ifdef PEM_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG}, + #else + {"HEADER_TOO_LONG", ERR_LIB_PEM, 128}, + #endif + #ifdef PEM_R_INCONSISTENT_HEADER + {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, + #else + {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121}, + #endif + #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR + {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, + #else + {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122}, + #endif + #ifdef PEM_R_KEYBLOB_TOO_SHORT + {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, + #else + {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123}, + #endif + #ifdef PEM_R_MISSING_DEK_IV + {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV}, + #else + {"MISSING_DEK_IV", ERR_LIB_PEM, 129}, + #endif + #ifdef PEM_R_NOT_DEK_INFO + {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, + #else + {"NOT_DEK_INFO", ERR_LIB_PEM, 105}, + #endif + #ifdef PEM_R_NOT_ENCRYPTED + {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, + #else + {"NOT_ENCRYPTED", ERR_LIB_PEM, 106}, + #endif + #ifdef PEM_R_NOT_PROC_TYPE + {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, + #else + {"NOT_PROC_TYPE", ERR_LIB_PEM, 107}, + #endif + #ifdef PEM_R_NO_START_LINE + {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, + #else + {"NO_START_LINE", ERR_LIB_PEM, 108}, + #endif + #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD + {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, + #else + {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109}, + #endif + #ifdef PEM_R_PUBLIC_KEY_NO_RSA + {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA}, + #else + {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110}, + #endif + #ifdef PEM_R_PVK_DATA_TOO_SHORT + {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, + #else + {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124}, + #endif + #ifdef PEM_R_PVK_TOO_SHORT + {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, + #else + {"PVK_TOO_SHORT", ERR_LIB_PEM, 125}, + #endif + #ifdef PEM_R_READ_KEY + {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, + #else + {"READ_KEY", ERR_LIB_PEM, 111}, + #endif + #ifdef PEM_R_SHORT_HEADER + {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, + #else + {"SHORT_HEADER", ERR_LIB_PEM, 112}, + #endif + #ifdef PEM_R_UNEXPECTED_DEK_IV + {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV}, + #else + {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, 130}, + #endif + #ifdef PEM_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113}, + #endif + #ifdef PEM_R_UNSUPPORTED_ENCRYPTION + {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, + #else + {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114}, + #endif + #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS + {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, + #else + {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126}, + #endif + #ifdef PKCS12_R_CANT_PACK_STRUCTURE + {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE}, + #else + {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, 100}, + #endif + #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA + {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA}, + #else + {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, 121}, + #endif + #ifdef PKCS12_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", ERR_LIB_PKCS12, 101}, + #endif + #ifdef PKCS12_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR}, + #else + {"ENCODE_ERROR", ERR_LIB_PKCS12, 102}, + #endif + #ifdef PKCS12_R_ENCRYPT_ERROR + {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR}, + #else + {"ENCRYPT_ERROR", ERR_LIB_PKCS12, 103}, + #endif + #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE}, + #else + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, 120}, + #endif + #ifdef PKCS12_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, 104}, + #endif + #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER + {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER}, + #else + {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, 105}, + #endif + #ifdef PKCS12_R_IV_GEN_ERROR + {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR}, + #else + {"IV_GEN_ERROR", ERR_LIB_PKCS12, 106}, + #endif + #ifdef PKCS12_R_KEY_GEN_ERROR + {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR}, + #else + {"KEY_GEN_ERROR", ERR_LIB_PKCS12, 107}, + #endif + #ifdef PKCS12_R_MAC_ABSENT + {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT}, + #else + {"MAC_ABSENT", ERR_LIB_PKCS12, 108}, + #endif + #ifdef PKCS12_R_MAC_GENERATION_ERROR + {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR}, + #else + {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, 109}, + #endif + #ifdef PKCS12_R_MAC_SETUP_ERROR + {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR}, + #else + {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, 110}, + #endif + #ifdef PKCS12_R_MAC_STRING_SET_ERROR + {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR}, + #else + {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, 111}, + #endif + #ifdef PKCS12_R_MAC_VERIFY_FAILURE + {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE}, + #else + {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, 113}, + #endif + #ifdef PKCS12_R_PARSE_ERROR + {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR}, + #else + {"PARSE_ERROR", ERR_LIB_PKCS12, 114}, + #endif + #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR + {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR}, + #else + {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, 115}, + #endif + #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR + {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR}, + #else + {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, 116}, + #endif + #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR + {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR}, + #else + {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, 117}, + #endif + #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, 118}, + #endif + #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE + {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE}, + #else + {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, 119}, + #endif + #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, 117}, + #endif + #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, + #else + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, 144}, + #endif + #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED + {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED}, + #else + {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, 116}, + #endif + #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT + {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT}, + #else + {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, 118}, + #endif + #ifdef PKCS7_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR}, + #else + {"CTRL_ERROR", ERR_LIB_PKCS7, 152}, + #endif + #ifdef PKCS7_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR}, + #else + {"DECRYPT_ERROR", ERR_LIB_PKCS7, 119}, + #endif + #ifdef PKCS7_R_DIGEST_FAILURE + {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE}, + #else + {"DIGEST_FAILURE", ERR_LIB_PKCS7, 101}, + #endif + #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE + {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE}, + #else + {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, 149}, + #endif + #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 150}, + #endif + #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT + {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT}, + #else + {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, 120}, + #endif + #ifdef PKCS7_R_ERROR_SETTING_CIPHER + {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER}, + #else + {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, 121}, + #endif + #ifdef PKCS7_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, 143}, + #endif + #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE + {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE}, + #else + {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, 155}, + #endif + #ifdef PKCS7_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT}, + #else + {"NO_CONTENT", ERR_LIB_PKCS7, 122}, + #endif + #ifdef PKCS7_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, 151}, + #endif + #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND + {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND}, + #else + {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, 154}, + #endif + #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE + {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE}, + #else + {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, 115}, + #endif + #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA + {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA}, + #else + {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, 123}, + #endif + #ifdef PKCS7_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS}, + #else + {"NO_SIGNERS", ERR_LIB_PKCS7, 142}, + #endif + #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE}, + #else + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, 104}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, 124}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR + {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR}, + #else + {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, 153}, + #endif + #ifdef PKCS7_R_PKCS7_DATASIGN + {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN}, + #else + {"PKCS7_DATASIGN", ERR_LIB_PKCS7, 145}, + #endif + #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, 127}, + #endif + #ifdef PKCS7_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, 105}, + #endif + #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, 128}, + #endif + #ifdef PKCS7_R_SIGNING_CTRL_FAILURE + {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE}, + #else + {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, 147}, + #endif + #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 148}, + #endif + #ifdef PKCS7_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR}, + #else + {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, 129}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE + {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE}, + #else + {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, 106}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO + {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO}, + #else + {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, 107}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST + {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST}, + #else + {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, 108}, + #endif + #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE + {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE}, + #else + {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, 109}, + #endif + #ifdef PKCS7_R_UNKNOWN_OPERATION + {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION}, + #else + {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, 110}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE + {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE}, + #else + {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, 111}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, 112}, + #endif + #ifdef PKCS7_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE}, + #else + {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, 113}, + #endif + #ifdef PKCS7_R_WRONG_PKCS7_TYPE + {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE}, + #else + {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, 114}, + #endif + #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG}, + #else + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, 102}, + #endif + #ifdef RAND_R_ALREADY_INSTANTIATED + {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED}, + #else + {"ALREADY_INSTANTIATED", ERR_LIB_RAND, 103}, + #endif + #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE + {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE}, + #else + {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, 105}, + #endif + #ifdef RAND_R_CANNOT_OPEN_FILE + {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE}, + #else + {"CANNOT_OPEN_FILE", ERR_LIB_RAND, 121}, + #endif + #ifdef RAND_R_DRBG_ALREADY_INITIALIZED + {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED}, + #else + {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, 129}, + #endif + #ifdef RAND_R_DRBG_NOT_INITIALISED + {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED}, + #else + {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, 104}, + #endif + #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG + {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG}, + #else + {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, 106}, + #endif + #ifdef RAND_R_ENTROPY_OUT_OF_RANGE + {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE}, + #else + {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, 124}, + #endif + #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED + {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED}, + #else + {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, 127}, + #endif + #ifdef RAND_R_ERROR_INITIALISING_DRBG + {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG}, + #else + {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, 107}, + #endif + #ifdef RAND_R_ERROR_INSTANTIATING_DRBG + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG}, + #else + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, 108}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT}, + #else + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, 109}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY}, + #else + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, 110}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_NONCE + {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE}, + #else + {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, 111}, + #endif + #ifdef RAND_R_FAILED_TO_CREATE_LOCK + {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK}, + #else + {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, 126}, + #endif + #ifdef RAND_R_FUNC_NOT_IMPLEMENTED + {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED}, + #else + {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, 101}, + #endif + #ifdef RAND_R_FWRITE_ERROR + {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR}, + #else + {"FWRITE_ERROR", ERR_LIB_RAND, 123}, + #endif + #ifdef RAND_R_GENERATE_ERROR + {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR}, + #else + {"GENERATE_ERROR", ERR_LIB_RAND, 112}, + #endif + #ifdef RAND_R_INTERNAL_ERROR + {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR}, + #else + {"INTERNAL_ERROR", ERR_LIB_RAND, 113}, + #endif + #ifdef RAND_R_IN_ERROR_STATE + {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE}, + #else + {"IN_ERROR_STATE", ERR_LIB_RAND, 114}, + #endif + #ifdef RAND_R_NOT_A_REGULAR_FILE + {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE}, + #else + {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, 122}, + #endif + #ifdef RAND_R_NOT_INSTANTIATED + {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED}, + #else + {"NOT_INSTANTIATED", ERR_LIB_RAND, 115}, + #endif + #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED + {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED}, + #else + {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, 128}, + #endif + #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED}, + #else + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, 130}, + #endif + #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK}, + #else + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, 131}, + #endif + #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG}, + #else + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, 116}, + #endif + #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED}, + #else + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, 133}, + #endif + #ifdef RAND_R_PRNG_NOT_SEEDED + {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED}, + #else + {"PRNG_NOT_SEEDED", ERR_LIB_RAND, 100}, + #endif + #ifdef RAND_R_RANDOM_POOL_OVERFLOW + {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW}, + #else + {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, 125}, + #endif + #ifdef RAND_R_RANDOM_POOL_UNDERFLOW + {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW}, + #else + {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, 134}, + #endif + #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG}, + #else + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, 117}, + #endif + #ifdef RAND_R_RESEED_ERROR + {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR}, + #else + {"RESEED_ERROR", ERR_LIB_RAND, 118}, + #endif + #ifdef RAND_R_SELFTEST_FAILURE + {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE}, + #else + {"SELFTEST_FAILURE", ERR_LIB_RAND, 119}, + #endif + #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED + {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED}, + #else + {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, 135}, + #endif + #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED + {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED}, + #else + {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, 136}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS + {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS}, + #else + {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, 132}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE + {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE}, + #else + {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, 120}, + #endif + #ifdef RSA_R_ALGORITHM_MISMATCH + {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH}, + #else + {"ALGORITHM_MISMATCH", ERR_LIB_RSA, 100}, + #endif + #ifdef RSA_R_BAD_E_VALUE + {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE}, + #else + {"BAD_E_VALUE", ERR_LIB_RSA, 101}, + #endif + #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT + {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT}, + #else + {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, 102}, + #endif + #ifdef RSA_R_BAD_PAD_BYTE_COUNT + {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT}, + #else + {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, 103}, + #endif + #ifdef RSA_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", ERR_LIB_RSA, 104}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01 + {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01}, + #else + {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, 106}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02 + {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02}, + #else + {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, 107}, + #endif + #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN + {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN}, + #else + {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, 108}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE + {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE}, + #else + {"DATA_TOO_LARGE", ERR_LIB_RSA, 109}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE}, + #else + {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, 110}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS + {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS}, + #else + {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, 132}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL + {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL}, + #else + {"DATA_TOO_SMALL", ERR_LIB_RSA, 111}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE + {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE}, + #else + {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, 122}, + #endif + #ifdef RSA_R_DIGEST_DOES_NOT_MATCH + {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH}, + #else + {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, 158}, + #endif + #ifdef RSA_R_DIGEST_NOT_ALLOWED + {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED}, + #else + {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 145}, + #endif + #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY + {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY}, + #else + {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, 112}, + #endif + #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D + {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D}, + #else + {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 124}, + #endif + #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D + {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D}, + #else + {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 125}, + #endif + #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1 + {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1}, + #else + {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, 123}, + #endif + #ifdef RSA_R_FIRST_OCTET_INVALID + {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID}, + #else + {"FIRST_OCTET_INVALID", ERR_LIB_RSA, 133}, + #endif + #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, + #else + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, 144}, + #endif + #ifdef RSA_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", ERR_LIB_RSA, 157}, + #endif + #ifdef RSA_R_INVALID_DIGEST_LENGTH + {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH}, + #else + {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, 143}, + #endif + #ifdef RSA_R_INVALID_HEADER + {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER}, + #else + {"INVALID_HEADER", ERR_LIB_RSA, 137}, + #endif + #ifdef RSA_R_INVALID_LABEL + {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL}, + #else + {"INVALID_LABEL", ERR_LIB_RSA, 160}, + #endif + #ifdef RSA_R_INVALID_MESSAGE_LENGTH + {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH}, + #else + {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, 131}, + #endif + #ifdef RSA_R_INVALID_MGF1_MD + {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD}, + #else + {"INVALID_MGF1_MD", ERR_LIB_RSA, 156}, + #endif + #ifdef RSA_R_INVALID_MULTI_PRIME_KEY + {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY}, + #else + {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, 167}, + #endif + #ifdef RSA_R_INVALID_OAEP_PARAMETERS + {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS}, + #else + {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, 161}, + #endif + #ifdef RSA_R_INVALID_PADDING + {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING}, + #else + {"INVALID_PADDING", ERR_LIB_RSA, 138}, + #endif + #ifdef RSA_R_INVALID_PADDING_MODE + {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE}, + #else + {"INVALID_PADDING_MODE", ERR_LIB_RSA, 141}, + #endif + #ifdef RSA_R_INVALID_PSS_PARAMETERS + {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS}, + #else + {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, 149}, + #endif + #ifdef RSA_R_INVALID_PSS_SALTLEN + {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN}, + #else + {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, 146}, + #endif + #ifdef RSA_R_INVALID_SALT_LENGTH + {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH}, + #else + {"INVALID_SALT_LENGTH", ERR_LIB_RSA, 150}, + #endif + #ifdef RSA_R_INVALID_TRAILER + {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER}, + #else + {"INVALID_TRAILER", ERR_LIB_RSA, 139}, + #endif + #ifdef RSA_R_INVALID_X931_DIGEST + {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST}, + #else + {"INVALID_X931_DIGEST", ERR_LIB_RSA, 142}, + #endif + #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q + {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q}, + #else + {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, 126}, + #endif + #ifdef RSA_R_KEY_PRIME_NUM_INVALID + {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID}, + #else + {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, 165}, + #endif + #ifdef RSA_R_KEY_SIZE_TOO_SMALL + {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL}, + #else + {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, 120}, + #endif + #ifdef RSA_R_LAST_OCTET_INVALID + {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID}, + #else + {"LAST_OCTET_INVALID", ERR_LIB_RSA, 134}, + #endif + #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED + {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED}, + #else + {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 152}, + #endif + #ifdef RSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, 179}, + #endif + #ifdef RSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", ERR_LIB_RSA, 105}, + #endif + #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R}, + #else + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, 168}, + #endif + #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D}, + #else + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 169}, + #endif + #ifdef RSA_R_MP_R_NOT_PRIME + {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME}, + #else + {"MP_R_NOT_PRIME", ERR_LIB_RSA, 170}, + #endif + #ifdef RSA_R_NO_PUBLIC_EXPONENT + {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT}, + #else + {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, 140}, + #endif + #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING + {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING}, + #else + {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, 113}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES}, + #else + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, 172}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q + {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q}, + #else + {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, 127}, + #endif + #ifdef RSA_R_OAEP_DECODING_ERROR + {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR}, + #else + {"OAEP_DECODING_ERROR", ERR_LIB_RSA, 121}, + #endif + #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, 148}, + #endif + #ifdef RSA_R_PADDING_CHECK_FAILED + {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED}, + #else + {"PADDING_CHECK_FAILED", ERR_LIB_RSA, 114}, + #endif + #ifdef RSA_R_PKCS_DECODING_ERROR + {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR}, + #else + {"PKCS_DECODING_ERROR", ERR_LIB_RSA, 159}, + #endif + #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL}, + #else + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, 164}, + #endif + #ifdef RSA_R_P_NOT_PRIME + {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME}, + #else + {"P_NOT_PRIME", ERR_LIB_RSA, 128}, + #endif + #ifdef RSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", ERR_LIB_RSA, 129}, + #endif + #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED + {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED}, + #else + {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, 130}, + #endif + #ifdef RSA_R_SLEN_CHECK_FAILED + {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED}, + #else + {"SLEN_CHECK_FAILED", ERR_LIB_RSA, 136}, + #endif + #ifdef RSA_R_SLEN_RECOVERY_FAILED + {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED}, + #else + {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, 135}, + #endif + #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK + {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK}, + #else + {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, 115}, + #endif + #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, + #else + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, 116}, + #endif + #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE + {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE}, + #else + {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, 117}, + #endif + #ifdef RSA_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", ERR_LIB_RSA, 166}, + #endif + #ifdef RSA_R_UNKNOWN_MASK_DIGEST + {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST}, + #else + {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, 151}, + #endif + #ifdef RSA_R_UNKNOWN_PADDING_TYPE + {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE}, + #else + {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, 118}, + #endif + #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE}, + #else + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, 162}, + #endif + #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE}, + #else + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, 163}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM + {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM}, + #else + {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, 153}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER + {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER}, + #else + {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, 154}, + #endif + #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE + {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE}, + #else + {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, 155}, + #endif + #ifdef RSA_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", ERR_LIB_RSA, 147}, + #endif + #ifdef RSA_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, 119}, + #endif + #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY}, + #else + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, 291}, + #endif + #ifdef SSL_R_APP_DATA_IN_HANDSHAKE + {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, + #else + {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100}, + #endif + #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, + #else + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE}, + #else + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, 143}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE}, + #else + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, 158}, + #endif + #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC + {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, + #else + {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103}, + #endif + #ifdef SSL_R_BAD_CIPHER + {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER}, + #else + {"BAD_CIPHER", ERR_LIB_SSL, 186}, + #endif + #ifdef SSL_R_BAD_DATA + {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, + #else + {"BAD_DATA", ERR_LIB_SSL, 390}, + #endif + #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK + {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, + #else + {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106}, + #endif + #ifdef SSL_R_BAD_DECOMPRESSION + {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, + #else + {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107}, + #endif + #ifdef SSL_R_BAD_DH_VALUE + {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE}, + #else + {"BAD_DH_VALUE", ERR_LIB_SSL, 102}, + #endif + #ifdef SSL_R_BAD_DIGEST_LENGTH + {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, + #else + {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111}, + #endif + #ifdef SSL_R_BAD_EARLY_DATA + {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA}, + #else + {"BAD_EARLY_DATA", ERR_LIB_SSL, 233}, + #endif + #ifdef SSL_R_BAD_ECC_CERT + {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, + #else + {"BAD_ECC_CERT", ERR_LIB_SSL, 304}, + #endif + #ifdef SSL_R_BAD_ECDSA_SIGNATURE + {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE}, + #else + {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305}, + #endif + #ifdef SSL_R_BAD_ECPOINT + {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, + #else + {"BAD_ECPOINT", ERR_LIB_SSL, 306}, + #endif + #ifdef SSL_R_BAD_EXTENSION + {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION}, + #else + {"BAD_EXTENSION", ERR_LIB_SSL, 110}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_LENGTH + {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, + #else + {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_STATE + {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE}, + #else + {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, 236}, + #endif + #ifdef SSL_R_BAD_HELLO_REQUEST + {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, + #else + {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105}, + #endif + #ifdef SSL_R_BAD_HRR_VERSION + {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION}, + #else + {"BAD_HRR_VERSION", ERR_LIB_SSL, 263}, + #endif + #ifdef SSL_R_BAD_KEY_SHARE + {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE}, + #else + {"BAD_KEY_SHARE", ERR_LIB_SSL, 108}, + #endif + #ifdef SSL_R_BAD_KEY_UPDATE + {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE}, + #else + {"BAD_KEY_UPDATE", ERR_LIB_SSL, 122}, + #endif + #ifdef SSL_R_BAD_LEGACY_VERSION + {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION}, + #else + {"BAD_LEGACY_VERSION", ERR_LIB_SSL, 292}, + #endif + #ifdef SSL_R_BAD_LENGTH + {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, + #else + {"BAD_LENGTH", ERR_LIB_SSL, 271}, + #endif + #ifdef SSL_R_BAD_MAC_LENGTH + {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH}, + #else + {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333}, + #endif + #ifdef SSL_R_BAD_PACKET + {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET}, + #else + {"BAD_PACKET", ERR_LIB_SSL, 240}, + #endif + #ifdef SSL_R_BAD_PACKET_LENGTH + {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, + #else + {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115}, + #endif + #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER + {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, + #else + {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116}, + #endif + #ifdef SSL_R_BAD_PSK + {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK}, + #else + {"BAD_PSK", ERR_LIB_SSL, 219}, + #endif + #ifdef SSL_R_BAD_PSK_IDENTITY + {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY}, + #else + {"BAD_PSK_IDENTITY", ERR_LIB_SSL, 114}, + #endif + #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH + {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH}, + #else + {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316}, + #endif + #ifdef SSL_R_BAD_RECORD_TYPE + {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE}, + #else + {"BAD_RECORD_TYPE", ERR_LIB_SSL, 443}, + #endif + #ifdef SSL_R_BAD_RSA_ENCRYPT + {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, + #else + {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119}, + #endif + #ifdef SSL_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", ERR_LIB_SSL, 123}, + #endif + #ifdef SSL_R_BAD_SRP_A_LENGTH + {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, + #else + {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347}, + #endif + #ifdef SSL_R_BAD_SRP_B_LENGTH + {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH}, + #else + {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348}, + #endif + #ifdef SSL_R_BAD_SRP_G_LENGTH + {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH}, + #else + {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349}, + #endif + #ifdef SSL_R_BAD_SRP_N_LENGTH + {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH}, + #else + {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350}, + #endif + #ifdef SSL_R_BAD_SRP_PARAMETERS + {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, + #else + {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371}, + #endif + #ifdef SSL_R_BAD_SRP_S_LENGTH + {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH}, + #else + {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351}, + #endif + #ifdef SSL_R_BAD_SRTP_MKI_VALUE + {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, + #else + {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352}, + #endif + #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST + {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353}, + #endif + #ifdef SSL_R_BAD_SSL_FILETYPE + {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, + #else + {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124}, + #endif + #ifdef SSL_R_BAD_VALUE + {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, + #else + {"BAD_VALUE", ERR_LIB_SSL, 384}, + #endif + #ifdef SSL_R_BAD_WRITE_RETRY + {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, + #else + {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127}, + #endif + #ifdef SSL_R_BINDER_DOES_NOT_VERIFY + {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY}, + #else + {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, 253}, + #endif + #ifdef SSL_R_BIO_NOT_SET + {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, + #else + {"BIO_NOT_SET", ERR_LIB_SSL, 128}, + #endif + #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG + {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, + #else + {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129}, + #endif + #ifdef SSL_R_BN_LIB + {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, + #else + {"BN_LIB", ERR_LIB_SSL, 130}, + #endif + #ifdef SSL_R_CALLBACK_FAILED + {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED}, + #else + {"CALLBACK_FAILED", ERR_LIB_SSL, 234}, + #endif + #ifdef SSL_R_CANNOT_CHANGE_CIPHER + {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER}, + #else + {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, 109}, + #endif + #ifdef SSL_R_CA_DN_LENGTH_MISMATCH + {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, + #else + {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131}, + #endif + #ifdef SSL_R_CA_KEY_TOO_SMALL + {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, + #else + {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397}, + #endif + #ifdef SSL_R_CA_MD_TOO_WEAK + {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, + #else + {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398}, + #endif + #ifdef SSL_R_CCS_RECEIVED_EARLY + {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, + #else + {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133}, + #endif + #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED + {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, + #else + {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134}, + #endif + #ifdef SSL_R_CERT_CB_ERROR + {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, + #else + {"CERT_CB_ERROR", ERR_LIB_SSL, 377}, + #endif + #ifdef SSL_R_CERT_LENGTH_MISMATCH + {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, + #else + {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135}, + #endif + #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED + {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED}, + #else + {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, 218}, + #endif + #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH + {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, + #else + {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137}, + #endif + #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE + {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, + #else + {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138}, + #endif + #ifdef SSL_R_CLIENTHELLO_TLSEXT + {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, + #else + {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226}, + #endif + #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG + {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, + #else + {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140}, + #endif + #ifdef SSL_R_COMPRESSION_DISABLED + {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, + #else + {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343}, + #endif + #ifdef SSL_R_COMPRESSION_FAILURE + {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, + #else + {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141}, + #endif + #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, + #else + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307}, + #endif + #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR + {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, + #else + {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142}, + #endif + #ifdef SSL_R_CONNECTION_TYPE_NOT_SET + {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, + #else + {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144}, + #endif + #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED + {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED}, + #else + {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, 167}, + #endif + #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE + {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE}, + #else + {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, 400}, + #endif + #ifdef SSL_R_COOKIE_MISMATCH + {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, + #else + {"COOKIE_MISMATCH", ERR_LIB_SSL, 308}, + #endif + #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED}, + #else + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, 206}, + #endif + #ifdef SSL_R_DANE_ALREADY_ENABLED + {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED}, + #else + {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, 172}, + #endif + #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL}, + #else + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, 173}, + #endif + #ifdef SSL_R_DANE_NOT_ENABLED + {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED}, + #else + {"DANE_NOT_ENABLED", ERR_LIB_SSL, 175}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE + {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, 180}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, 184}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH + {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH}, + #else + {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, 189}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH + {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH}, + #else + {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, 192}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE + {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE}, + #else + {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, 200}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY + {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY}, + #else + {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, 201}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR + {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR}, + #else + {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, 202}, + #endif + #ifdef SSL_R_DANE_TLSA_NULL_DATA + {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA}, + #else + {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, 203}, + #endif + #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED + {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, + #else + {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145}, + #endif + #ifdef SSL_R_DATA_LENGTH_TOO_LONG + {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, + #else + {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED + {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, + #else + {"DECRYPTION_FAILED", ERR_LIB_SSL, 147}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, + #else + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281}, + #endif + #ifdef SSL_R_DH_KEY_TOO_SMALL + {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, + #else + {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394}, + #endif + #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, + #else + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148}, + #endif + #ifdef SSL_R_DIGEST_CHECK_FAILED + {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, + #else + {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149}, + #endif + #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG + {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, + #else + {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334}, + #endif + #ifdef SSL_R_DUPLICATE_COMPRESSION_ID + {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, + #else + {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309}, + #endif + #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT + {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT}, + #else + {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317}, + #endif + #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING + {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, + #else + {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318}, + #endif + #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE + {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE}, + #else + {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322}, + #endif + #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE + {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE}, + #else + {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323}, + #endif + #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE + {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, + #else + {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374}, + #endif + #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER + {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER}, + #else + {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310}, + #endif + #ifdef SSL_R_EE_KEY_TOO_SMALL + {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, + #else + {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399}, + #endif + #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354}, + #endif + #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG + {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, + #else + {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150}, + #endif + #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST + {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, + #else + {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151}, + #endif + #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN + {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN}, + #else + {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, 204}, + #endif + #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE + {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE}, + #else + {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, 194}, + #endif + #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE + {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, + #else + {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152}, + #endif + #ifdef SSL_R_EXTENSION_NOT_RECEIVED + {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED}, + #else + {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, 279}, + #endif + #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE + {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, + #else + {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153}, + #endif + #ifdef SSL_R_EXT_LENGTH_MISMATCH + {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH}, + #else + {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, 163}, + #endif + #ifdef SSL_R_FAILED_TO_INIT_ASYNC + {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC}, + #else + {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, 405}, + #endif + #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO + {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO}, + #else + {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, 401}, + #endif + #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS + {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, + #else + {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154}, + #endif + #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS + {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS}, + #else + {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355}, + #endif + #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION + {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION}, + #else + {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356}, + #endif + #ifdef SSL_R_HTTPS_PROXY_REQUEST + {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, + #else + {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155}, + #endif + #ifdef SSL_R_HTTP_REQUEST + {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, + #else + {"HTTP_REQUEST", ERR_LIB_SSL, 156}, + #endif + #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION + {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION}, + #else + {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, 162}, + #endif + #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST + {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, + #else + {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380}, + #endif + #ifdef SSL_R_INAPPROPRIATE_FALLBACK + {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, + #else + {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373}, + #endif + #ifdef SSL_R_INCONSISTENT_COMPRESSION + {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, + #else + {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN + {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN}, + #else + {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, 222}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI + {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI}, + #else + {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, 231}, + #endif + #ifdef SSL_R_INCONSISTENT_EXTMS + {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS}, + #else + {"INCONSISTENT_EXTMS", ERR_LIB_SSL, 104}, + #endif + #ifdef SSL_R_INSUFFICIENT_SECURITY + {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY}, + #else + {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, 241}, + #endif + #ifdef SSL_R_INVALID_ALERT + {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT}, + #else + {"INVALID_ALERT", ERR_LIB_SSL, 205}, + #endif + #ifdef SSL_R_INVALID_CCS_MESSAGE + {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE}, + #else + {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, 260}, + #endif + #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG + {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG}, + #else + {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, 238}, + #endif + #ifdef SSL_R_INVALID_COMMAND + {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, + #else + {"INVALID_COMMAND", ERR_LIB_SSL, 280}, + #endif + #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM + {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, + #else + {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341}, + #endif + #ifdef SSL_R_INVALID_CONFIG + {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG}, + #else + {"INVALID_CONFIG", ERR_LIB_SSL, 283}, + #endif + #ifdef SSL_R_INVALID_CONFIGURATION_NAME + {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME}, + #else + {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, 113}, + #endif + #ifdef SSL_R_INVALID_CONTEXT + {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT}, + #else + {"INVALID_CONTEXT", ERR_LIB_SSL, 282}, + #endif + #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE + {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE}, + #else + {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, 212}, + #endif + #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE + {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE}, + #else + {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, 120}, + #endif + #ifdef SSL_R_INVALID_MAX_EARLY_DATA + {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA}, + #else + {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, 174}, + #endif + #ifdef SSL_R_INVALID_NULL_CMD_NAME + {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, + #else + {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385}, + #endif + #ifdef SSL_R_INVALID_SEQUENCE_NUMBER + {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER}, + #else + {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, 402}, + #endif + #ifdef SSL_R_INVALID_SERVERINFO_DATA + {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, + #else + {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388}, + #endif + #ifdef SSL_R_INVALID_SESSION_ID + {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID}, + #else + {"INVALID_SESSION_ID", ERR_LIB_SSL, 999}, + #endif + #ifdef SSL_R_INVALID_SRP_USERNAME + {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, + #else + {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357}, + #endif + #ifdef SSL_R_INVALID_STATUS_RESPONSE + {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, + #else + {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328}, + #endif + #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH + {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, + #else + {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325}, + #endif + #ifdef SSL_R_KRB5_S_TKT_NYV + {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV}, + #else + {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294}, + #endif + #ifdef SSL_R_KRB5_S_TKT_SKEW + {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW}, + #else + {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295}, + #endif + #ifdef SSL_R_LENGTH_MISMATCH + {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, + #else + {"LENGTH_MISMATCH", ERR_LIB_SSL, 159}, + #endif + #ifdef SSL_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", ERR_LIB_SSL, 404}, + #endif + #ifdef SSL_R_LENGTH_TOO_SHORT + {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, + #else + {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160}, + #endif + #ifdef SSL_R_LIBRARY_BUG + {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, + #else + {"LIBRARY_BUG", ERR_LIB_SSL, 274}, + #endif + #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS + {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, + #else + {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161}, + #endif + #ifdef SSL_R_MESSAGE_TOO_LONG + {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG}, + #else + {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296}, + #endif + #ifdef SSL_R_MISSING_DSA_SIGNING_CERT + {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, + #else + {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165}, + #endif + #ifdef SSL_R_MISSING_ECDH_CERT + {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT}, + #else + {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382}, + #endif + #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT + {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, + #else + {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381}, + #endif + #ifdef SSL_R_MISSING_FATAL + {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL}, + #else + {"MISSING_FATAL", ERR_LIB_SSL, 256}, + #endif + #ifdef SSL_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", ERR_LIB_SSL, 290}, + #endif + #ifdef SSL_R_MISSING_RSA_CERTIFICATE + {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, + #else + {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168}, + #endif + #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT + {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, + #else + {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169}, + #endif + #ifdef SSL_R_MISSING_RSA_SIGNING_CERT + {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, + #else + {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170}, + #endif + #ifdef SSL_R_MISSING_SIGALGS_EXTENSION + {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION}, + #else + {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, 112}, + #endif + #ifdef SSL_R_MISSING_SIGNING_CERT + {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT}, + #else + {"MISSING_SIGNING_CERT", ERR_LIB_SSL, 221}, + #endif + #ifdef SSL_R_MISSING_SRP_PARAM + {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, + #else + {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358}, + #endif + #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION + {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION}, + #else + {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, 209}, + #endif + #ifdef SSL_R_MISSING_TMP_DH_KEY + {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, + #else + {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171}, + #endif + #ifdef SSL_R_MISSING_TMP_ECDH_KEY + {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, + #else + {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311}, + #endif + #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA}, + #else + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, 293}, + #endif + #ifdef SSL_R_MULTIPLE_SGC_RESTARTS + {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS}, + #else + {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346}, + #endif + #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY + {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY}, + #else + {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, 182}, + #endif + #ifdef SSL_R_NOT_REPLACING_CERTIFICATE + {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE}, + #else + {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, 289}, + #endif + #ifdef SSL_R_NOT_SERVER + {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER}, + #else + {"NOT_SERVER", ERR_LIB_SSL, 284}, + #endif + #ifdef SSL_R_NO_APPLICATION_PROTOCOL + {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL}, + #else + {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, 235}, + #endif + #ifdef SSL_R_NO_CERTIFICATES_RETURNED + {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, + #else + {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED + {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, + #else + {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_SET + {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, + #else + {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179}, + #endif + #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR + {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR}, + #else + {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, 214}, + #endif + #ifdef SSL_R_NO_CIPHERS_AVAILABLE + {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, + #else + {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181}, + #endif + #ifdef SSL_R_NO_CIPHERS_SPECIFIED + {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, + #else + {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183}, + #endif + #ifdef SSL_R_NO_CIPHER_MATCH + {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, + #else + {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185}, + #endif + #ifdef SSL_R_NO_CLIENT_CERT_METHOD + {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, + #else + {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331}, + #endif + #ifdef SSL_R_NO_COMPRESSION_SPECIFIED + {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, + #else + {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187}, + #endif + #ifdef SSL_R_NO_COOKIE_CALLBACK_SET + {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET}, + #else + {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, 287}, + #endif + #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, + #else + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330}, + #endif + #ifdef SSL_R_NO_METHOD_SPECIFIED + {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, + #else + {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188}, + #endif + #ifdef SSL_R_NO_PEM_EXTENSIONS + {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, + #else + {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389}, + #endif + #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED + {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, + #else + {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190}, + #endif + #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE + {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, + #else + {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191}, + #endif + #ifdef SSL_R_NO_RENEGOTIATION + {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, + #else + {"NO_RENEGOTIATION", ERR_LIB_SSL, 339}, + #endif + #ifdef SSL_R_NO_REQUIRED_DIGEST + {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, + #else + {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324}, + #endif + #ifdef SSL_R_NO_SHARED_CIPHER + {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, + #else + {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193}, + #endif + #ifdef SSL_R_NO_SHARED_GROUPS + {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS}, + #else + {"NO_SHARED_GROUPS", ERR_LIB_SSL, 410}, + #endif + #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS + {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS}, + #else + {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, 376}, + #endif + #ifdef SSL_R_NO_SRTP_PROFILES + {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, + #else + {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359}, + #endif + #ifdef SSL_R_NO_SUITABLE_KEY_SHARE + {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE}, + #else + {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, 101}, + #endif + #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM + {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM}, + #else + {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, 118}, + #endif + #ifdef SSL_R_NO_VALID_SCTS + {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS}, + #else + {"NO_VALID_SCTS", ERR_LIB_SSL, 216}, + #endif + #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK + {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK}, + #else + {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, 403}, + #endif + #ifdef SSL_R_NULL_SSL_CTX + {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, + #else + {"NULL_SSL_CTX", ERR_LIB_SSL, 195}, + #endif + #ifdef SSL_R_NULL_SSL_METHOD_PASSED + {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, + #else + {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196}, + #endif + #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED + {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, + #else + {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197}, + #endif + #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, + #else + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344}, + #endif + #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE + {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #else + {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387}, + #endif + #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE + {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE}, + #else + {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379}, + #endif + #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE + {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE}, + #else + {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297}, + #endif + #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG + {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG}, + #else + {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327}, + #endif + #ifdef SSL_R_OVERFLOW_ERROR + {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR}, + #else + {"OVERFLOW_ERROR", ERR_LIB_SSL, 237}, + #endif + #ifdef SSL_R_PACKET_LENGTH_TOO_LONG + {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, + #else + {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198}, + #endif + #ifdef SSL_R_PARSE_TLSEXT + {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, + #else + {"PARSE_TLSEXT", ERR_LIB_SSL, 227}, + #endif + #ifdef SSL_R_PATH_TOO_LONG + {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, + #else + {"PATH_TOO_LONG", ERR_LIB_SSL, 270}, + #endif + #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, + #else + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199}, + #endif + #ifdef SSL_R_PEM_NAME_BAD_PREFIX + {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, + #else + {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391}, + #endif + #ifdef SSL_R_PEM_NAME_TOO_SHORT + {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, + #else + {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392}, + #endif + #ifdef SSL_R_PIPELINE_FAILURE + {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE}, + #else + {"PIPELINE_FAILURE", ERR_LIB_SSL, 406}, + #endif + #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR}, + #else + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, 278}, + #endif + #ifdef SSL_R_PRIVATE_KEY_MISMATCH + {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH}, + #else + {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, 288}, + #endif + #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN + {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, + #else + {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207}, + #endif + #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND + {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, + #else + {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223}, + #endif + #ifdef SSL_R_PSK_NO_CLIENT_CB + {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, + #else + {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224}, + #endif + #ifdef SSL_R_PSK_NO_SERVER_CB + {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, + #else + {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225}, + #endif + #ifdef SSL_R_READ_BIO_NOT_SET + {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, + #else + {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211}, + #endif + #ifdef SSL_R_READ_TIMEOUT_EXPIRED + {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, + #else + {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312}, + #endif + #ifdef SSL_R_RECORD_LENGTH_MISMATCH + {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, + #else + {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213}, + #endif + #ifdef SSL_R_RECORD_TOO_SMALL + {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, + #else + {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298}, + #endif + #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG + {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, #else {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335}, #endif - #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR - {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, + #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR + {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, + #else + {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336}, + #endif + #ifdef SSL_R_RENEGOTIATION_MISMATCH + {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, + #else + {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337}, + #endif + #ifdef SSL_R_REQUEST_PENDING + {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING}, + #else + {"REQUEST_PENDING", ERR_LIB_SSL, 285}, + #endif + #ifdef SSL_R_REQUEST_SENT + {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT}, + #else + {"REQUEST_SENT", ERR_LIB_SSL, 286}, + #endif + #ifdef SSL_R_REQUIRED_CIPHER_MISSING + {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, + #else + {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215}, + #endif + #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING}, + #else + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342}, + #endif + #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, + #else + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345}, + #endif + #ifdef SSL_R_SCT_VERIFICATION_FAILED + {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED}, + #else + {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, 208}, + #endif + #ifdef SSL_R_SERVERHELLO_TLSEXT + {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, + #else + {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275}, + #endif + #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED + {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, + #else + {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277}, + #endif + #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT + {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT}, + #else + {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, 407}, + #endif + #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR + {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, + #else + {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360}, + #endif + #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, + #else + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220}, + #endif + #ifdef SSL_R_SRP_A_CALC + {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, + #else + {"SRP_A_CALC", ERR_LIB_SSL, 361}, + #endif + #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, + #else + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362}, + #endif + #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, + #else + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363}, + #endif + #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE + {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, + #else + {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364}, + #endif + #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG + {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG}, + #else + {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT + {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT}, + #else + {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH}, + #else + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, 232}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME + {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, + #else + {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, + #else + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320}, + #endif + #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG + {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, + #else + {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE + {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, + #else + {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC + {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, + #else + {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, + #else + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED + {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, + #else + {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, + #else + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046}, + #endif + #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, + #else + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030}, + #endif + #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE + {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, + #else + {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040}, + #endif + #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER + {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, + #else + {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047}, + #endif + #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE + {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, + #else + {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, + #else + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, + #else + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, 117}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, 125}, + #endif + #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, + #else + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228}, + #endif + #ifdef SSL_R_SSL_HANDSHAKE_FAILURE + {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, + #else + {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229}, + #endif + #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS + {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, + #else + {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230}, + #endif + #ifdef SSL_R_SSL_NEGATIVE_LENGTH + {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, + #else + {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372}, + #endif + #ifdef SSL_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", ERR_LIB_SSL, 126}, + #endif + #ifdef SSL_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, 136}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED + {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, + #else + {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONFLICT + {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, + #else + {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, + #else + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH + {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, + #else + {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG + {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG}, + #else + {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 408}, + #endif + #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH + {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH}, + #else + {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, 210}, + #endif + #ifdef SSL_R_STILL_IN_INIT + {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT}, + #else + {"STILL_IN_INIT", ERR_LIB_SSL, 121}, + #endif + #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED}, + #else + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, 1116}, + #endif + #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION + {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION}, + #else + {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, 1109}, + #endif + #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED + {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, + #else + {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR + {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, + #else + {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED + {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, + #else + {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR + {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, + #else + {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051}, + #endif + #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION + {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, + #else + {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, + #else + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, + #else + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR + {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, + #else + {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080}, + #endif + #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION + {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, + #else + {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100}, + #endif + #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION + {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, + #else + {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070}, + #endif + #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW + {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, + #else + {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022}, + #endif + #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA + {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, + #else + {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048}, + #endif + #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED + {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, + #else + {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, + #else + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, + #else + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113}, + #endif + #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE + {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, + #else + {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111}, + #endif + #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME + {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, + #else + {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112}, + #endif + #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION + {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, + #else + {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110}, + #endif + #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, + #else + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365}, + #endif + #ifdef SSL_R_TLS_HEARTBEAT_PENDING + {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, + #else + {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366}, + #endif + #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL + {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, + #else + {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367}, + #endif + #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST + {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, #else - {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336}, + {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157}, #endif - #ifdef SSL_R_RENEGOTIATION_MISMATCH - {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, + #ifdef SSL_R_TOO_MANY_KEY_UPDATES + {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES}, #else - {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337}, + {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, 132}, #endif - #ifdef SSL_R_REQUIRED_CIPHER_MISSING - {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, + #ifdef SSL_R_TOO_MANY_WARN_ALERTS + {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS}, #else - {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215}, + {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, 409}, #endif - #ifdef SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING - {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING}, + #ifdef SSL_R_TOO_MUCH_EARLY_DATA + {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA}, #else - {"REQUIRED_COMPRESSSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342}, + {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, 164}, #endif - #ifdef SSL_R_REUSE_CERT_LENGTH_NOT_ZERO - {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CERT_LENGTH_NOT_ZERO}, + #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS + {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS}, #else - {"REUSE_CERT_LENGTH_NOT_ZERO", ERR_LIB_SSL, 216}, + {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313}, #endif - #ifdef SSL_R_REUSE_CERT_TYPE_NOT_ZERO - {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CERT_TYPE_NOT_ZERO}, + #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS + {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, #else - {"REUSE_CERT_TYPE_NOT_ZERO", ERR_LIB_SSL, 217}, + {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314}, #endif - #ifdef SSL_R_REUSE_CIPHER_LIST_NOT_ZERO - {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, SSL_R_REUSE_CIPHER_LIST_NOT_ZERO}, + #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, #else - {"REUSE_CIPHER_LIST_NOT_ZERO", ERR_LIB_SSL, 218}, + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239}, #endif - #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING - {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, #else - {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345}, + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242}, #endif - #ifdef SSL_R_SERVERHELLO_TLSEXT - {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, #else - {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275}, + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243}, #endif - #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED - {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, + #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE + {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE}, #else - {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277}, + {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, 262}, #endif - #ifdef SSL_R_SHORT_READ - {"SHORT_READ", ERR_LIB_SSL, SSL_R_SHORT_READ}, + #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA + {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA}, #else - {"SHORT_READ", ERR_LIB_SSL, 219}, + {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, 178}, #endif - #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR - {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, + #ifdef SSL_R_UNEXPECTED_MESSAGE + {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, #else - {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360}, + {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244}, #endif - #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE - {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, + #ifdef SSL_R_UNEXPECTED_RECORD + {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, #else - {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220}, + {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245}, #endif - #ifdef SSL_R_SRP_A_CALC - {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, + #ifdef SSL_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, #else - {"SRP_A_CALC", ERR_LIB_SSL, 361}, + {"UNINITIALIZED", ERR_LIB_SSL, 276}, #endif - #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES - {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, + #ifdef SSL_R_UNKNOWN_ALERT_TYPE + {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, #else - {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362}, + {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246}, #endif - #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG - {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, + #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE + {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, #else - {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363}, + {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247}, #endif - #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE - {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, + #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED + {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, #else - {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364}, + {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248}, #endif - #ifdef SSL_R_SSL23_DOING_SESSION_ID_REUSE - {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, SSL_R_SSL23_DOING_SESSION_ID_REUSE}, + #ifdef SSL_R_UNKNOWN_CIPHER_TYPE + {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, #else - {"SSL23_DOING_SESSION_ID_REUSE", ERR_LIB_SSL, 221}, + {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249}, #endif - #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG - {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG}, + #ifdef SSL_R_UNKNOWN_CMD_NAME + {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, #else - {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299}, + {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386}, #endif - #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT - {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT}, + #ifdef SSL_R_UNKNOWN_COMMAND + {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND}, #else - {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321}, + {"UNKNOWN_COMMAND", ERR_LIB_SSL, 139}, #endif - #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME - {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, + #ifdef SSL_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368}, + #endif + #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE + {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, + #else + {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250}, + #endif + #ifdef SSL_R_UNKNOWN_PKEY_TYPE + {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, + #else + {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251}, + #endif + #ifdef SSL_R_UNKNOWN_PROTOCOL + {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, + #else + {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252}, + #endif + #ifdef SSL_R_UNKNOWN_SSL_VERSION + {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, + #else + {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254}, + #endif + #ifdef SSL_R_UNKNOWN_STATE + {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, + #else + {"UNKNOWN_STATE", ERR_LIB_SSL, 255}, + #endif + #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, + #else + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338}, + #endif + #ifdef SSL_R_UNSOLICITED_EXTENSION + {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION}, + #else + {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, 217}, + #endif + #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257}, + #endif + #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE + {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE}, + #else + {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326}, + #endif + #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE + {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, + #else + {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315}, + #endif + #ifdef SSL_R_UNSUPPORTED_PROTOCOL + {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, + #else + {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258}, + #endif + #ifdef SSL_R_UNSUPPORTED_SSL_VERSION + {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, + #else + {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259}, + #endif + #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE + {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, + #else + {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329}, + #endif + #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED + {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, + #else + {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369}, + #endif + #ifdef SSL_R_VERSION_TOO_HIGH + {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH}, + #else + {"VERSION_TOO_HIGH", ERR_LIB_SSL, 166}, + #endif + #ifdef SSL_R_VERSION_TOO_LOW + {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, + #else + {"VERSION_TOO_LOW", ERR_LIB_SSL, 396}, + #endif + #ifdef SSL_R_WRONG_CERTIFICATE_TYPE + {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, + #else + {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383}, + #endif + #ifdef SSL_R_WRONG_CIPHER_RETURNED + {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, + #else + {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261}, + #endif + #ifdef SSL_R_WRONG_CURVE + {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, + #else + {"WRONG_CURVE", ERR_LIB_SSL, 378}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_SIZE + {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, + #else + {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_TYPE + {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, + #else + {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370}, + #endif + #ifdef SSL_R_WRONG_SSL_VERSION + {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, + #else + {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266}, + #endif + #ifdef SSL_R_WRONG_VERSION_NUMBER + {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, + #else + {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267}, + #endif + #ifdef SSL_R_X509_LIB + {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, + #else + {"X509_LIB", ERR_LIB_SSL, 268}, + #endif + #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS + {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, + #else + {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269}, + #endif + #ifdef TS_R_BAD_PKCS7_TYPE + {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE}, + #else + {"BAD_PKCS7_TYPE", ERR_LIB_TS, 132}, + #endif + #ifdef TS_R_BAD_TYPE + {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE}, + #else + {"BAD_TYPE", ERR_LIB_TS, 133}, + #endif + #ifdef TS_R_CANNOT_LOAD_CERT + {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT}, + #else + {"CANNOT_LOAD_CERT", ERR_LIB_TS, 137}, + #endif + #ifdef TS_R_CANNOT_LOAD_KEY + {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY}, + #else + {"CANNOT_LOAD_KEY", ERR_LIB_TS, 138}, + #endif + #ifdef TS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, 100}, + #endif + #ifdef TS_R_COULD_NOT_SET_ENGINE + {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE}, + #else + {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, 127}, + #endif + #ifdef TS_R_COULD_NOT_SET_TIME + {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME}, + #else + {"COULD_NOT_SET_TIME", ERR_LIB_TS, 115}, + #endif + #ifdef TS_R_DETACHED_CONTENT + {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT}, + #else + {"DETACHED_CONTENT", ERR_LIB_TS, 134}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR + {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, 116}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR + {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, 139}, + #endif + #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR}, + #else + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, 101}, + #endif + #ifdef TS_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", ERR_LIB_TS, 102}, + #endif + #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE}, + #else + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, 117}, + #endif + #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH + {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH}, + #else + {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, 103}, + #endif + #ifdef TS_R_NONCE_MISMATCH + {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH}, + #else + {"NONCE_MISMATCH", ERR_LIB_TS, 104}, + #endif + #ifdef TS_R_NONCE_NOT_RETURNED + {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED}, + #else + {"NONCE_NOT_RETURNED", ERR_LIB_TS, 105}, + #endif + #ifdef TS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT}, + #else + {"NO_CONTENT", ERR_LIB_TS, 106}, + #endif + #ifdef TS_R_NO_TIME_STAMP_TOKEN + {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN}, + #else + {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, 107}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, 118}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR + {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR}, #else - {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319}, + {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, 119}, #endif - #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE - {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, + #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED + {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED}, #else - {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320}, + {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, 129}, #endif - #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG - {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, + #ifdef TS_R_POLICY_MISMATCH + {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH}, #else - {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300}, + {"POLICY_MISMATCH", ERR_LIB_TS, 108}, #endif - #ifdef SSL_R_SSL3_SESSION_ID_TOO_SHORT - {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_SHORT}, + #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"SSL3_SESSION_ID_TOO_SHORT", ERR_LIB_SSL, 222}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, 120}, #endif - #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE - {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, + #ifdef TS_R_RESPONSE_SETUP_ERROR + {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR}, #else - {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042}, + {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, 121}, #endif - #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC - {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, + #ifdef TS_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE}, #else - {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020}, + {"SIGNATURE_FAILURE", ERR_LIB_TS, 109}, #endif - #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED - {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, + #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER + {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER}, #else - {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045}, + {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, 110}, #endif - #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED - {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, + #ifdef TS_R_TIME_SYSCALL_ERROR + {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR}, #else - {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044}, + {"TIME_SYSCALL_ERROR", ERR_LIB_TS, 122}, #endif - #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN - {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, + #ifdef TS_R_TOKEN_NOT_PRESENT + {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT}, #else - {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046}, + {"TOKEN_NOT_PRESENT", ERR_LIB_TS, 130}, #endif - #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE - {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, + #ifdef TS_R_TOKEN_PRESENT + {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT}, #else - {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030}, + {"TOKEN_PRESENT", ERR_LIB_TS, 131}, #endif - #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE - {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, + #ifdef TS_R_TSA_NAME_MISMATCH + {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH}, #else - {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040}, + {"TSA_NAME_MISMATCH", ERR_LIB_TS, 111}, #endif - #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER - {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, + #ifdef TS_R_TSA_UNTRUSTED + {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED}, #else - {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047}, + {"TSA_UNTRUSTED", ERR_LIB_TS, 112}, #endif - #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE - {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, + #ifdef TS_R_TST_INFO_SETUP_ERROR + {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR}, #else - {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041}, + {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, 123}, #endif - #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE - {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, + #ifdef TS_R_TS_DATASIGN + {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN}, #else - {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010}, + {"TS_DATASIGN", ERR_LIB_TS, 124}, #endif - #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE - {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, + #ifdef TS_R_UNACCEPTABLE_POLICY + {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY}, #else - {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043}, + {"UNACCEPTABLE_POLICY", ERR_LIB_TS, 125}, #endif - #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION - {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, + #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM + {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM}, #else - {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228}, + {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, 126}, #endif - #ifdef SSL_R_SSL_HANDSHAKE_FAILURE - {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, + #ifdef TS_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION}, #else - {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229}, + {"UNSUPPORTED_VERSION", ERR_LIB_TS, 113}, #endif - #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS - {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, + #ifdef TS_R_VAR_BAD_VALUE + {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE}, #else - {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230}, + {"VAR_BAD_VALUE", ERR_LIB_TS, 135}, #endif - #ifdef SSL_R_SSL_NEGATIVE_LENGTH - {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, + #ifdef TS_R_VAR_LOOKUP_FAILURE + {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE}, #else - {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372}, + {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, 136}, #endif - #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED - {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, + #ifdef TS_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE}, #else - {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301}, + {"WRONG_CONTENT_TYPE", ERR_LIB_TS, 114}, #endif - #ifdef SSL_R_SSL_SESSION_ID_CONFLICT - {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, + #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS + {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS}, #else - {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302}, + {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, 104}, #endif - #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG - {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, + #ifdef UI_R_INDEX_TOO_LARGE + {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE}, #else - {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273}, + {"INDEX_TOO_LARGE", ERR_LIB_UI, 102}, #endif - #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH - {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, + #ifdef UI_R_INDEX_TOO_SMALL + {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL}, #else - {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303}, + {"INDEX_TOO_SMALL", ERR_LIB_UI, 103}, #endif - #ifdef SSL_R_SSL_SESSION_ID_IS_DIFFERENT - {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_IS_DIFFERENT}, + #ifdef UI_R_NO_RESULT_BUFFER + {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER}, #else - {"SSL_SESSION_ID_IS_DIFFERENT", ERR_LIB_SSL, 231}, + {"NO_RESULT_BUFFER", ERR_LIB_UI, 105}, #endif - #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED - {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, + #ifdef UI_R_PROCESSING_ERROR + {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR}, #else - {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049}, + {"PROCESSING_ERROR", ERR_LIB_UI, 107}, #endif - #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR - {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, + #ifdef UI_R_RESULT_TOO_LARGE + {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE}, #else - {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050}, + {"RESULT_TOO_LARGE", ERR_LIB_UI, 100}, #endif - #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED - {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, + #ifdef UI_R_RESULT_TOO_SMALL + {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL}, #else - {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021}, + {"RESULT_TOO_SMALL", ERR_LIB_UI, 101}, #endif - #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR - {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, + #ifdef UI_R_SYSASSIGN_ERROR + {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR}, #else - {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051}, + {"SYSASSIGN_ERROR", ERR_LIB_UI, 109}, #endif - #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION - {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, + #ifdef UI_R_SYSDASSGN_ERROR + {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR}, #else - {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060}, + {"SYSDASSGN_ERROR", ERR_LIB_UI, 110}, #endif - #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK - {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, + #ifdef UI_R_SYSQIOW_ERROR + {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR}, #else - {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086}, + {"SYSQIOW_ERROR", ERR_LIB_UI, 111}, #endif - #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY - {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, + #ifdef UI_R_UNKNOWN_CONTROL_COMMAND + {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND}, #else - {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071}, + {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, 106}, #endif - #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR - {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, + #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE + {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE}, #else - {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080}, + {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, 108}, #endif - #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION - {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, + #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED + {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED}, #else - {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100}, + {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, 112}, #endif - #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION - {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, + #ifdef X509V3_R_BAD_IP_ADDRESS + {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS}, #else - {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070}, + {"BAD_IP_ADDRESS", ERR_LIB_X509V3, 118}, #endif - #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW - {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, + #ifdef X509V3_R_BAD_OBJECT + {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT}, #else - {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022}, + {"BAD_OBJECT", ERR_LIB_X509V3, 119}, #endif - #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA - {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, + #ifdef X509V3_R_BN_DEC2BN_ERROR + {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR}, #else - {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048}, + {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, 100}, #endif - #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED - {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, + #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR + {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR}, #else - {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090}, + {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, 101}, #endif - #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE - {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, + #ifdef X509V3_R_DIRNAME_ERROR + {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR}, #else - {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114}, + {"DIRNAME_ERROR", ERR_LIB_X509V3, 149}, #endif - #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE - {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, + #ifdef X509V3_R_DISTPOINT_ALREADY_SET + {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET}, #else - {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113}, + {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, 160}, #endif - #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE - {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, + #ifdef X509V3_R_DUPLICATE_ZONE_ID + {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID}, #else - {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111}, + {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, 133}, #endif - #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME - {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, + #ifdef X509V3_R_ERROR_CONVERTING_ZONE + {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE}, #else - {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112}, + {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, 131}, #endif - #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION - {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, + #ifdef X509V3_R_ERROR_CREATING_EXTENSION + {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION}, #else - {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110}, + {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, 144}, #endif - #ifdef SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER - {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER}, + #ifdef X509V3_R_ERROR_IN_EXTENSION + {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION}, #else - {"TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER", ERR_LIB_SSL, 232}, + {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, 128}, #endif - #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT - {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, + #ifdef X509V3_R_EXPECTED_A_SECTION_NAME + {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME}, #else - {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365}, + {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, 137}, #endif - #ifdef SSL_R_TLS_HEARTBEAT_PENDING - {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, + #ifdef X509V3_R_EXTENSION_EXISTS + {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS}, #else - {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366}, + {"EXTENSION_EXISTS", ERR_LIB_X509V3, 145}, #endif - #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL - {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, + #ifdef X509V3_R_EXTENSION_NAME_ERROR + {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR}, #else - {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367}, + {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, 115}, #endif - #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST - {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, + #ifdef X509V3_R_EXTENSION_NOT_FOUND + {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND}, #else - {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157}, + {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, 102}, #endif - #ifdef SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST - {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST}, + #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED + {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED}, #else - {"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST", ERR_LIB_SSL, 233}, + {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, 103}, #endif - #ifdef SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG - {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG}, + #ifdef X509V3_R_EXTENSION_VALUE_ERROR + {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR}, #else - {"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 234}, + {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, 116}, #endif - #ifdef SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER - {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER}, + #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION + {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION}, #else - {"TRIED_TO_USE_UNSUPPORTED_CIPHER", ERR_LIB_SSL, 235}, + {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, 151}, #endif - #ifdef SSL_R_UNABLE_TO_DECODE_DH_CERTS - {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_DH_CERTS}, + #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG + {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG}, #else - {"UNABLE_TO_DECODE_DH_CERTS", ERR_LIB_SSL, 236}, + {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, 152}, #endif - #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS - {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS}, + #ifdef X509V3_R_INVALID_ASNUMBER + {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER}, #else - {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313}, + {"INVALID_ASNUMBER", ERR_LIB_X509V3, 162}, #endif - #ifdef SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY - {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY}, + #ifdef X509V3_R_INVALID_ASRANGE + {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE}, #else - {"UNABLE_TO_EXTRACT_PUBLIC_KEY", ERR_LIB_SSL, 237}, + {"INVALID_ASRANGE", ERR_LIB_X509V3, 163}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_DH_PARAMETERS - {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_DH_PARAMETERS}, + #ifdef X509V3_R_INVALID_BOOLEAN_STRING + {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING}, #else - {"UNABLE_TO_FIND_DH_PARAMETERS", ERR_LIB_SSL, 238}, + {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, 104}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS - {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, + #ifdef X509V3_R_INVALID_EXTENSION_STRING + {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING}, #else - {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314}, + {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, 105}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS - {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, + #ifdef X509V3_R_INVALID_INHERITANCE + {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE}, #else - {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239}, + {"INVALID_INHERITANCE", ERR_LIB_X509V3, 165}, #endif - #ifdef SSL_R_UNABLE_TO_FIND_SSL_METHOD - {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_SSL_METHOD}, + #ifdef X509V3_R_INVALID_IPADDRESS + {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS}, #else - {"UNABLE_TO_FIND_SSL_METHOD", ERR_LIB_SSL, 240}, + {"INVALID_IPADDRESS", ERR_LIB_X509V3, 166}, #endif - #ifdef SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES - {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES}, + #ifdef X509V3_R_INVALID_MULTIPLE_RDNS + {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS}, #else - {"UNABLE_TO_LOAD_SSL2_MD5_ROUTINES", ERR_LIB_SSL, 241}, + {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, 161}, #endif - #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES - {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, + #ifdef X509V3_R_INVALID_NAME + {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME}, #else - {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242}, + {"INVALID_NAME", ERR_LIB_X509V3, 106}, #endif - #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES - {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, + #ifdef X509V3_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT}, #else - {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243}, + {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, 107}, #endif - #ifdef SSL_R_UNEXPECTED_MESSAGE - {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, + #ifdef X509V3_R_INVALID_NULL_NAME + {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME}, #else - {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244}, + {"INVALID_NULL_NAME", ERR_LIB_X509V3, 108}, #endif - #ifdef SSL_R_UNEXPECTED_RECORD - {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, + #ifdef X509V3_R_INVALID_NULL_VALUE + {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE}, #else - {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245}, + {"INVALID_NULL_VALUE", ERR_LIB_X509V3, 109}, #endif - #ifdef SSL_R_UNINITIALIZED - {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, + #ifdef X509V3_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER}, #else - {"UNINITIALIZED", ERR_LIB_SSL, 276}, + {"INVALID_NUMBER", ERR_LIB_X509V3, 140}, #endif - #ifdef SSL_R_UNKNOWN_ALERT_TYPE - {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, + #ifdef X509V3_R_INVALID_NUMBERS + {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS}, #else - {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246}, + {"INVALID_NUMBERS", ERR_LIB_X509V3, 141}, #endif - #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE - {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, + #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER + {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER}, #else - {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247}, + {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, 110}, #endif - #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED - {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, + #ifdef X509V3_R_INVALID_OPTION + {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION}, #else - {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248}, + {"INVALID_OPTION", ERR_LIB_X509V3, 138}, #endif - #ifdef SSL_R_UNKNOWN_CIPHER_TYPE - {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, + #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER + {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER}, #else - {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249}, + {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, 134}, #endif - #ifdef SSL_R_UNKNOWN_CMD_NAME - {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, + #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING + {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING}, #else - {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386}, + {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, 153}, #endif - #ifdef SSL_R_UNKNOWN_DIGEST - {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, + #ifdef X509V3_R_INVALID_PURPOSE + {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE}, #else - {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368}, + {"INVALID_PURPOSE", ERR_LIB_X509V3, 146}, #endif - #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE - {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, + #ifdef X509V3_R_INVALID_SAFI + {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI}, #else - {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250}, + {"INVALID_SAFI", ERR_LIB_X509V3, 164}, #endif - #ifdef SSL_R_UNKNOWN_PKEY_TYPE - {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, + #ifdef X509V3_R_INVALID_SECTION + {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION}, #else - {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251}, + {"INVALID_SECTION", ERR_LIB_X509V3, 135}, #endif - #ifdef SSL_R_UNKNOWN_PROTOCOL - {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, + #ifdef X509V3_R_INVALID_SYNTAX + {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX}, #else - {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252}, + {"INVALID_SYNTAX", ERR_LIB_X509V3, 143}, #endif - #ifdef SSL_R_UNKNOWN_REMOTE_ERROR_TYPE - {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_REMOTE_ERROR_TYPE}, + #ifdef X509V3_R_ISSUER_DECODE_ERROR + {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR}, #else - {"UNKNOWN_REMOTE_ERROR_TYPE", ERR_LIB_SSL, 253}, + {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, 126}, #endif - #ifdef SSL_R_UNKNOWN_SSL_VERSION - {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, + #ifdef X509V3_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE}, #else - {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254}, + {"MISSING_VALUE", ERR_LIB_X509V3, 124}, #endif - #ifdef SSL_R_UNKNOWN_STATE - {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, + #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS + {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS}, #else - {"UNKNOWN_STATE", ERR_LIB_SSL, 255}, + {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, 142}, #endif - #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED - {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, + #ifdef X509V3_R_NO_CONFIG_DATABASE + {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE}, #else - {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338}, + {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, 136}, #endif - #ifdef SSL_R_UNSUPPORTED_CIPHER - {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, SSL_R_UNSUPPORTED_CIPHER}, + #ifdef X509V3_R_NO_ISSUER_CERTIFICATE + {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_SSL, 256}, + {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, 121}, #endif - #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #ifdef X509V3_R_NO_ISSUER_DETAILS + {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS}, #else - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257}, + {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, 127}, #endif - #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE - {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE}, + #ifdef X509V3_R_NO_POLICY_IDENTIFIER + {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER}, #else - {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326}, + {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, 139}, #endif - #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE - {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, + #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED}, #else - {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315}, + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, 154}, #endif - #ifdef SSL_R_UNSUPPORTED_PROTOCOL - {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, + #ifdef X509V3_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY}, #else - {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258}, + {"NO_PUBLIC_KEY", ERR_LIB_X509V3, 114}, #endif - #ifdef SSL_R_UNSUPPORTED_SSL_VERSION - {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, + #ifdef X509V3_R_NO_SUBJECT_DETAILS + {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS}, #else - {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259}, + {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, 125}, #endif - #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE - {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, + #ifdef X509V3_R_OPERATION_NOT_DEFINED + {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED}, #else - {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329}, + {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, 148}, #endif - #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED - {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, + #ifdef X509V3_R_OTHERNAME_ERROR + {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR}, #else - {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369}, + {"OTHERNAME_ERROR", ERR_LIB_X509V3, 147}, #endif - #ifdef SSL_R_VERSION_TOO_LOW - {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, + #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED + {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED}, #else - {"VERSION_TOO_LOW", ERR_LIB_SSL, 396}, + {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, 155}, #endif - #ifdef SSL_R_WRITE_BIO_NOT_SET - {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_WRITE_BIO_NOT_SET}, + #ifdef X509V3_R_POLICY_PATH_LENGTH + {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH}, #else - {"WRITE_BIO_NOT_SET", ERR_LIB_SSL, 260}, + {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, 156}, #endif - #ifdef SSL_R_WRONG_CERTIFICATE_TYPE - {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, + #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED}, #else - {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383}, + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, 157}, #endif - #ifdef SSL_R_WRONG_CIPHER_RETURNED - {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, + #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY}, #else - {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261}, + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, 159}, #endif - #ifdef SSL_R_WRONG_CURVE - {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, + #ifdef X509V3_R_SECTION_NOT_FOUND + {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND}, #else - {"WRONG_CURVE", ERR_LIB_SSL, 378}, + {"SECTION_NOT_FOUND", ERR_LIB_X509V3, 150}, #endif - #ifdef SSL_R_WRONG_MESSAGE_TYPE - {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_MESSAGE_TYPE}, + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS + {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS}, #else - {"WRONG_MESSAGE_TYPE", ERR_LIB_SSL, 262}, + {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, 122}, #endif - #ifdef SSL_R_WRONG_NUMBER_OF_KEY_BITS - {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, SSL_R_WRONG_NUMBER_OF_KEY_BITS}, + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID + {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID}, #else - {"WRONG_NUMBER_OF_KEY_BITS", ERR_LIB_SSL, 263}, + {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, 123}, #endif - #ifdef SSL_R_WRONG_SIGNATURE_LENGTH - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, + #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT + {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT}, #else - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264}, + {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, 111}, #endif - #ifdef SSL_R_WRONG_SIGNATURE_SIZE - {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, + #ifdef X509V3_R_UNKNOWN_EXTENSION + {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION}, #else - {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265}, + {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, 129}, #endif - #ifdef SSL_R_WRONG_SIGNATURE_TYPE - {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, + #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME + {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME}, #else - {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370}, + {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, 130}, #endif - #ifdef SSL_R_WRONG_SSL_VERSION - {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, + #ifdef X509V3_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION}, #else - {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266}, + {"UNKNOWN_OPTION", ERR_LIB_X509V3, 120}, #endif - #ifdef SSL_R_WRONG_VERSION_NUMBER - {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, + #ifdef X509V3_R_UNSUPPORTED_OPTION + {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION}, #else - {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267}, + {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, 117}, #endif - #ifdef SSL_R_X509_LIB - {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, + #ifdef X509V3_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE}, #else - {"X509_LIB", ERR_LIB_SSL, 268}, + {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, 167}, #endif - #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS - {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, + #ifdef X509V3_R_USER_TOO_LONG + {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG}, #else - {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269}, + {"USER_TOO_LONG", ERR_LIB_X509V3, 132}, #endif #ifdef X509_R_AKID_MISMATCH {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH}, #else {"AKID_MISMATCH", ERR_LIB_X509, 110}, #endif + #ifdef X509_R_BAD_SELECTOR + {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR}, + #else + {"BAD_SELECTOR", ERR_LIB_X509, 133}, + #endif #ifdef X509_R_BAD_X509_FILETYPE {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE}, #else @@ -1824,6 +6122,11 @@ static struct py_ssl_error_code error_codes[] = { #else {"IDP_MISMATCH", ERR_LIB_X509, 128}, #endif + #ifdef X509_R_INVALID_ATTRIBUTES + {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES}, + #else + {"INVALID_ATTRIBUTES", ERR_LIB_X509, 138}, + #endif #ifdef X509_R_INVALID_DIRECTORY {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY}, #else @@ -1869,16 +6172,36 @@ static struct py_ssl_error_code error_codes[] = { #else {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124}, #endif + #ifdef X509_R_NAME_TOO_LONG + {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG}, + #else + {"NAME_TOO_LONG", ERR_LIB_X509, 134}, + #endif #ifdef X509_R_NEWER_CRL_NOT_NEWER {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER}, #else {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, 132}, #endif + #ifdef X509_R_NO_CERTIFICATE_FOUND + {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND}, + #else + {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, 135}, + #endif + #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND + {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND}, + #else + {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, 136}, + #endif #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY}, #else {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105}, #endif + #ifdef X509_R_NO_CRL_FOUND + {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND}, + #else + {"NO_CRL_FOUND", ERR_LIB_X509, 137}, + #endif #ifdef X509_R_NO_CRL_NUMBER {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER}, #else diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index 3fb49852f4c25..2297c85fe0ce0 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -11,6 +11,7 @@ """ import datetime +import glob import os import re import sys @@ -18,7 +19,7 @@ def parse_error_codes(h_file, prefix, libcode): - pat = re.compile(r"#define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix)) + pat = re.compile(r"#\s*define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix)) codes = [] with open(h_file, "r", encoding="latin1") as f: for line in f: @@ -28,6 +29,7 @@ def parse_error_codes(h_file, prefix, libcode): num = int(num) # e.g. ("SSL_R_BAD_DATA", ("ERR_LIB_SSL", "BAD_DATA", 390)) codes.append((code, (libcode, name, num))) + assert codes, f"no codes found in {h_file}" return codes if __name__ == "__main__": @@ -35,18 +37,23 @@ def parse_error_codes(h_file, prefix, libcode): outfile = sys.argv[2] use_stdout = outfile == '-' f = sys.stdout if use_stdout else open(outfile, "w") - error_libraries = { - # mnemonic -> (library code, error prefix, header file) - 'PEM': ('ERR_LIB_PEM', 'PEM_R_', 'crypto/pem/pem.h'), - 'SSL': ('ERR_LIB_SSL', 'SSL_R_', 'ssl/ssl.h'), - 'X509': ('ERR_LIB_X509', 'X509_R_', 'crypto/x509/x509.h'), - } + # mnemonic -> (library code, error prefix, header file) + error_libraries = {} + for error_header in glob.glob(os.path.join(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. + continue + mnemonic = base[:-5].upper() + if mnemonic == "": + # Skip err.h. + continue + error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) # Read codes from libraries new_codes = [] for libcode, prefix, h_file in sorted(error_libraries.values()): - new_codes += parse_error_codes(os.path.join(openssl_inc, h_file), - prefix, libcode) + new_codes += parse_error_codes(h_file, prefix, libcode) new_code_nums = set((libcode, num) for (code, (libcode, name, num)) in new_codes) From webhook-mailer at python.org Sun Apr 12 07:53:50 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 12 Apr 2020 11:53:50 -0000 Subject: [Python-checkins] [3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483) Message-ID: https://github.com/python/cpython/commit/ee249d798ba08f065efbf4f450880a446c6ca49d commit: ee249d798ba08f065efbf4f450880a446c6ca49d branch: 3.8 author: Serhiy Storchaka committer: GitHub date: 2020-04-12T14:53:46+03:00 summary: [3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483) Patcher's __exit__() is now never called if its __enter__() is failed. Returning true from __exit__() silences now the exception. (cherry picked from commit 4b222c9491d1700e9bdd98e6889b8d0ea1c7321e) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst M Lib/unittest/mock.py diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index a8f74a95791c1..3629cf61098f6 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -1229,11 +1229,6 @@ def _importer(target): return thing -def _is_started(patcher): - # XXXX horrible - return hasattr(patcher, 'is_local') - - class _patch(object): attribute_name = None @@ -1304,14 +1299,9 @@ def decorate_class(self, klass): @contextlib.contextmanager def decoration_helper(self, patched, args, keywargs): extra_args = [] - entered_patchers = [] - patching = None - - exc_info = tuple() - try: + with contextlib.ExitStack() as exit_stack: for patching in patched.patchings: - arg = patching.__enter__() - entered_patchers.append(patching) + arg = exit_stack.enter_context(patching) if patching.attribute_name is not None: keywargs.update(arg) elif patching.new is DEFAULT: @@ -1319,19 +1309,6 @@ def decoration_helper(self, patched, args, keywargs): args += tuple(extra_args) yield (args, keywargs) - except: - if (patching not in entered_patchers and - _is_started(patching)): - # the patcher may have been started, but an exception - # raised whilst entering one of its additional_patchers - entered_patchers.append(patching) - # Pass the exception to __exit__ - exc_info = sys.exc_info() - # re-raise the exception - raise - finally: - for patching in reversed(entered_patchers): - patching.__exit__(*exc_info) def decorate_callable(self, func): @@ -1508,25 +1485,26 @@ def __enter__(self): self.temp_original = original self.is_local = local - setattr(self.target, self.attribute, new_attr) - if self.attribute_name is not None: - extra_args = {} - if self.new is DEFAULT: - extra_args[self.attribute_name] = new - for patching in self.additional_patchers: - arg = patching.__enter__() - if patching.new is DEFAULT: - extra_args.update(arg) - return extra_args - - return new - + self._exit_stack = contextlib.ExitStack() + try: + setattr(self.target, self.attribute, new_attr) + if self.attribute_name is not None: + extra_args = {} + if self.new is DEFAULT: + extra_args[self.attribute_name] = new + for patching in self.additional_patchers: + arg = self._exit_stack.enter_context(patching) + if patching.new is DEFAULT: + extra_args.update(arg) + return extra_args + + return new + except: + if not self.__exit__(*sys.exc_info()): + raise def __exit__(self, *exc_info): """Undo the patch.""" - if not _is_started(self): - return - if self.is_local and self.temp_original is not DEFAULT: setattr(self.target, self.attribute, self.temp_original) else: @@ -1541,9 +1519,9 @@ def __exit__(self, *exc_info): del self.temp_original del self.is_local del self.target - for patcher in reversed(self.additional_patchers): - if _is_started(patcher): - patcher.__exit__(*exc_info) + exit_stack = self._exit_stack + del self._exit_stack + return exit_stack.__exit__(*exc_info) def start(self): @@ -1559,9 +1537,9 @@ def stop(self): self._active_patches.remove(self) except ValueError: # If the patch hasn't been started this will fail - pass + return None - return self.__exit__() + return self.__exit__(None, None, None) diff --git a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst new file mode 100644 index 0000000000000..8f725cfba86e2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst @@ -0,0 +1,3 @@ +Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` +is now never called if its ``__enter__()`` is failed. Returning true from +``__exit__()`` silences now the exception. From webhook-mailer at python.org Sun Apr 12 07:54:07 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 12 Apr 2020 11:54:07 -0000 Subject: [Python-checkins] [3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19484) Message-ID: https://github.com/python/cpython/commit/4057e8f9b56789223a1e691d7601003aceb84ad1 commit: 4057e8f9b56789223a1e691d7601003aceb84ad1 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2020-04-12T14:54:03+03:00 summary: [3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19484) Patcher's __exit__() is now never called if its __enter__() is failed. Returning true from __exit__() silences now the exception. (cherry picked from commit 4b222c9491d1700e9bdd98e6889b8d0ea1c7321e) Co-authored-by: Serhiy Storchaka files: A Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst M Lib/unittest/mock.py diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 87e8735e958d5..43fb00feac462 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -30,6 +30,7 @@ import pprint import sys import builtins +import contextlib from types import ModuleType, MethodType from functools import wraps, partial @@ -1243,13 +1244,9 @@ def decorate_callable(self, func): @wraps(func) def patched(*args, **keywargs): extra_args = [] - entered_patchers = [] - - exc_info = tuple() - try: + with contextlib.ExitStack() as exit_stack: for patching in patched.patchings: - arg = patching.__enter__() - entered_patchers.append(patching) + arg = exit_stack.enter_context(patching) if patching.attribute_name is not None: keywargs.update(arg) elif patching.new is DEFAULT: @@ -1257,19 +1254,6 @@ def patched(*args, **keywargs): args += tuple(extra_args) return func(*args, **keywargs) - except: - if (patching not in entered_patchers and - _is_started(patching)): - # the patcher may have been started, but an exception - # raised whilst entering one of its additional_patchers - entered_patchers.append(patching) - # Pass the exception to __exit__ - exc_info = sys.exc_info() - # re-raise the exception - raise - finally: - for patching in reversed(entered_patchers): - patching.__exit__(*exc_info) patched.patchings = [self] return patched @@ -1411,19 +1395,23 @@ def __enter__(self): self.temp_original = original self.is_local = local - setattr(self.target, self.attribute, new_attr) - if self.attribute_name is not None: - extra_args = {} - if self.new is DEFAULT: - extra_args[self.attribute_name] = new - for patching in self.additional_patchers: - arg = patching.__enter__() - if patching.new is DEFAULT: - extra_args.update(arg) - return extra_args - - return new - + self._exit_stack = contextlib.ExitStack() + try: + setattr(self.target, self.attribute, new_attr) + if self.attribute_name is not None: + extra_args = {} + if self.new is DEFAULT: + extra_args[self.attribute_name] = new + for patching in self.additional_patchers: + arg = self._exit_stack.enter_context(patching) + if patching.new is DEFAULT: + extra_args.update(arg) + return extra_args + + return new + except: + if not self.__exit__(*sys.exc_info()): + raise def __exit__(self, *exc_info): """Undo the patch.""" @@ -1444,9 +1432,9 @@ def __exit__(self, *exc_info): del self.temp_original del self.is_local del self.target - for patcher in reversed(self.additional_patchers): - if _is_started(patcher): - patcher.__exit__(*exc_info) + exit_stack = self._exit_stack + del self._exit_stack + return exit_stack.__exit__(*exc_info) def start(self): @@ -1464,7 +1452,7 @@ def stop(self): # If the patch hasn't been started this will fail pass - return self.__exit__() + return self.__exit__(None, None, None) diff --git a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst new file mode 100644 index 0000000000000..8f725cfba86e2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst @@ -0,0 +1,3 @@ +Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` +is now never called if its ``__enter__()`` is failed. Returning true from +``__exit__()`` silences now the exception. From webhook-mailer at python.org Sun Apr 12 07:58:31 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 12 Apr 2020 11:58:31 -0000 Subject: [Python-checkins] bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472) Message-ID: https://github.com/python/cpython/commit/8f87eefe7f0576c05c488874eb9601a7a87c7312 commit: 8f87eefe7f0576c05c488874eb9601a7a87c7312 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-12T14:58:27+03:00 summary: bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472) files: M Modules/_ctypes/_ctypes.c M Modules/_ctypes/callproc.c M Modules/_ctypes/cfield.c M Modules/_cursesmodule.c M Modules/_elementtree.c M Modules/_io/bytesio.c M Modules/_io/textio.c M Modules/_localemodule.c M Modules/_sqlite/connection.c M Modules/_ssl.c M Modules/_struct.c M Modules/_tkinter.c M Modules/cjkcodecs/multibytecodec.c M Modules/readline.c M Objects/bytesobject.c M Objects/fileobject.c M Objects/longobject.c M Objects/stringlib/join.h M Objects/unicodeobject.c M Python/fileutils.c diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index ba5ef397cf05b..5548c50cf53e4 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -1310,7 +1310,7 @@ CharArray_get_value(CDataObject *self, void *Py_UNUSED(ignored)) static int CharArray_set_value(CDataObject *self, PyObject *value, void *Py_UNUSED(ignored)) { - char *ptr; + const char *ptr; Py_ssize_t size; if (value == NULL) { diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index d1c552af99bd1..815fc6664d0ba 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1384,7 +1384,7 @@ copy_com_pointer(PyObject *self, PyObject *args) static PyObject *py_dl_open(PyObject *self, PyObject *args) { PyObject *name, *name2; - char *name_str; + const char *name_str; void * handle; #if HAVE_DECL_RTLD_LOCAL int mode = RTLD_NOW | RTLD_LOCAL; diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index f860e6e51b246..2060d15a64de5 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1283,7 +1283,7 @@ s_get(void *ptr, Py_ssize_t size) static PyObject * s_set(void *ptr, PyObject *value, Py_ssize_t length) { - char *data; + const char *data; Py_ssize_t size; if(!PyBytes_Check(value)) { @@ -1321,7 +1321,7 @@ z_set(void *ptr, PyObject *value, Py_ssize_t size) return value; } if (PyBytes_Check(value)) { - *(char **)ptr = PyBytes_AsString(value); + *(const char **)ptr = PyBytes_AsString(value); Py_INCREF(value); return value; } else if (PyLong_Check(value)) { diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index ca6a89f1dbeb3..08991fd54808f 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -709,7 +709,7 @@ _curses_window_addstr_impl(PyCursesWindowObject *self, int group_left_1, else #endif { - char *str = PyBytes_AS_STRING(bytesobj); + const char *str = PyBytes_AS_STRING(bytesobj); funcname = "addstr"; if (use_xy) rtn = mvwaddstr(self->win,y,x,str); @@ -792,7 +792,7 @@ _curses_window_addnstr_impl(PyCursesWindowObject *self, int group_left_1, else #endif { - char *str = PyBytes_AS_STRING(bytesobj); + const char *str = PyBytes_AS_STRING(bytesobj); funcname = "addnstr"; if (use_xy) rtn = mvwaddnstr(self->win,y,x,str,n); @@ -1710,7 +1710,7 @@ _curses_window_insstr_impl(PyCursesWindowObject *self, int group_left_1, else #endif { - char *str = PyBytes_AS_STRING(bytesobj); + const char *str = PyBytes_AS_STRING(bytesobj); funcname = "insstr"; if (use_xy) rtn = mvwinsstr(self->win,y,x,str); @@ -1795,7 +1795,7 @@ _curses_window_insnstr_impl(PyCursesWindowObject *self, int group_left_1, else #endif { - char *str = PyBytes_AS_STRING(bytesobj); + const char *str = PyBytes_AS_STRING(bytesobj); funcname = "insnstr"; if (use_xy) rtn = mvwinsnstr(self->win,y,x,str,n); diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index c0c741e51c712..10d78dd58f011 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -1153,7 +1153,7 @@ checkpath(PyObject* tag) return 0; } if (PyBytes_Check(tag)) { - char *p = PyBytes_AS_STRING(tag); + const char *p = PyBytes_AS_STRING(tag); const Py_ssize_t len = PyBytes_GET_SIZE(tag); if (len >= 3 && p[0] == '{' && ( p[1] == '}' || (p[1] == '*' && p[2] == '}'))) { diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index b5d308a8bca42..f4261b3713ac1 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -393,7 +393,7 @@ _io_BytesIO_tell_impl(bytesio *self) static PyObject * read_bytes(bytesio *self, Py_ssize_t size) { - char *output; + const char *output; assert(self->buf != NULL); assert(size <= self->string_size); @@ -502,7 +502,7 @@ _io_BytesIO_readlines_impl(bytesio *self, PyObject *arg) { Py_ssize_t maxsize, size, n; PyObject *result, *line; - char *output; + const char *output; CHECK_CLOSED(self); diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 12dba38d73bf0..92d6faafa2ea5 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -2640,7 +2640,7 @@ _io_TextIOWrapper_tell_impl(textio *self) Py_ssize_t chars_to_skip, chars_decoded; Py_ssize_t skip_bytes, skip_back; PyObject *saved_state = NULL; - char *input, *input_end; + const char *input, *input_end; Py_ssize_t dec_buffer_len; int dec_flags; diff --git a/Modules/_localemodule.c b/Modules/_localemodule.c index 5bf6638ed2a64..0819d0e192408 100644 --- a/Modules/_localemodule.c +++ b/Modules/_localemodule.c @@ -637,7 +637,7 @@ PyDoc_STRVAR(bindtextdomain__doc__, static PyObject* PyIntl_bindtextdomain(PyObject* self, PyObject*args) { - char *domain, *dirname, *current_dirname; + const char *domain, *dirname, *current_dirname; PyObject *dirname_obj, *dirname_bytes = NULL, *result; if (!PyArg_ParseTuple(args, "sO", &domain, &dirname_obj)) diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 92bdfe36e6a43..91041b95cd82f 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -79,7 +79,7 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject NULL }; - char* database; + const char* database; PyObject* database_obj; int detect_types = 0; PyObject* isolation_level = NULL; diff --git a/Modules/_ssl.c b/Modules/_ssl.c index ef047126361ed..a471a26e93360 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -4037,7 +4037,7 @@ _ssl__SSLContext_load_cert_chain_impl(PySSLContext *self, PyObject *certfile, /* internal helper function, returns -1 on error */ static int -_add_ca_certs(PySSLContext *self, void *data, Py_ssize_t len, +_add_ca_certs(PySSLContext *self, const void *data, Py_ssize_t len, int filetype) { BIO *biobuf = NULL; diff --git a/Modules/_struct.c b/Modules/_struct.c index 242ca9c10df2d..82ac0a19208d9 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1785,7 +1785,7 @@ s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset, char* if (e->format == 's') { Py_ssize_t n; int isstring; - void *p; + const void *p; isstring = PyBytes_Check(v); if (!isstring && !PyByteArray_Check(v)) { PyErr_SetString(_structmodulestate_global->StructError, @@ -1807,7 +1807,7 @@ s_pack_internal(PyStructObject *soself, PyObject *const *args, int offset, char* } else if (e->format == 'p') { Py_ssize_t n; int isstring; - void *p; + const void *p; isstring = PyBytes_Check(v); if (!isstring && !PyByteArray_Check(v)) { PyErr_SetString(_structmodulestate_global->StructError, diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 5f001c6e73c6d..199ae4f0db8f0 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -574,9 +574,9 @@ SplitObj(PyObject *arg) else if (PyBytes_Check(arg)) { int argc; const char **argv; - char *list = PyBytes_AS_STRING(arg); + const char *list = PyBytes_AS_STRING(arg); - if (Tcl_SplitList((Tcl_Interp *)NULL, list, &argc, &argv) != TCL_OK) { + if (Tcl_SplitList((Tcl_Interp *)NULL, (char *)list, &argc, &argv) != TCL_OK) { Py_INCREF(arg); return arg; } diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 9f9fbeb02ab69..319dc52749c65 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -1246,7 +1246,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate_impl(MultibyteIncrementalDe PyObject *buffer; PyLongObject *statelong; Py_ssize_t buffersize; - char *bufferstr; + const char *bufferstr; unsigned char statebytes[8]; if (!PyArg_ParseTuple(state, "SO!;setstate(): illegal state argument", diff --git a/Modules/readline.c b/Modules/readline.c index 225d06b0360d3..12d6cc78e38a7 100644 --- a/Modules/readline.c +++ b/Modules/readline.c @@ -234,7 +234,7 @@ static PyObject * write_history_file(PyObject *self, PyObject *args) { PyObject *filename_obj = Py_None, *filename_bytes; - char *filename; + const char *filename; int err; if (!PyArg_ParseTuple(args, "|O:write_history_file", &filename_obj)) return NULL; @@ -270,7 +270,7 @@ append_history_file(PyObject *self, PyObject *args) { int nelements; PyObject *filename_obj = Py_None, *filename_bytes; - char *filename; + const char *filename; int err; if (!PyArg_ParseTuple(args, "i|O:append_history_file", &nelements, &filename_obj)) return NULL; diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 987d98d4ed50f..7be075b72e32a 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -1598,7 +1598,7 @@ bytes_subscript(PyBytesObject* self, PyObject* item) else if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength, i; size_t cur; - char* source_buf; + const char* source_buf; char* result_buf; PyObject* result; @@ -1863,7 +1863,7 @@ Py_LOCAL_INLINE(PyObject *) do_xstrip(PyBytesObject *self, int striptype, PyObject *sepobj) { Py_buffer vsep; - char *s = PyBytes_AS_STRING(self); + const char *s = PyBytes_AS_STRING(self); Py_ssize_t len = PyBytes_GET_SIZE(self); char *sep; Py_ssize_t seplen; @@ -1903,7 +1903,7 @@ do_xstrip(PyBytesObject *self, int striptype, PyObject *sepobj) Py_LOCAL_INLINE(PyObject *) do_strip(PyBytesObject *self, int striptype) { - char *s = PyBytes_AS_STRING(self); + const char *s = PyBytes_AS_STRING(self); Py_ssize_t len = PyBytes_GET_SIZE(self), i, j; i = 0; @@ -2020,7 +2020,8 @@ bytes_translate_impl(PyBytesObject *self, PyObject *table, PyObject *deletechars) /*[clinic end generated code: output=43be3437f1956211 input=0ecdf159f654233c]*/ { - char *input, *output; + const char *input; + char *output; Py_buffer table_view = {NULL, NULL}; Py_buffer del_table_view = {NULL, NULL}; const char *table_chars; @@ -2371,7 +2372,7 @@ static PyObject * bytes_hex_impl(PyBytesObject *self, PyObject *sep, int bytes_per_sep) /*[clinic end generated code: output=1f134da504064139 input=f1238d3455990218]*/ { - char* argbuf = PyBytes_AS_STRING(self); + const char *argbuf = PyBytes_AS_STRING(self); Py_ssize_t arglen = PyBytes_GET_SIZE(self); return _Py_strhex_with_sep(argbuf, arglen, sep, bytes_per_sep); } @@ -3188,7 +3189,7 @@ _PyBytesWriter_AsString(_PyBytesWriter *writer) Py_LOCAL_INLINE(Py_ssize_t) _PyBytesWriter_GetSize(_PyBytesWriter *writer, char *str) { - char *start = _PyBytesWriter_AsString(writer); + const char *start = _PyBytesWriter_AsString(writer); assert(str != NULL); assert(str >= start); assert(str - start <= writer->allocated); @@ -3199,7 +3200,7 @@ _PyBytesWriter_GetSize(_PyBytesWriter *writer, char *str) Py_LOCAL_INLINE(int) _PyBytesWriter_CheckConsistency(_PyBytesWriter *writer, char *str) { - char *start, *end; + const char *start, *end; if (writer->use_small_buffer) { assert(writer->buffer == NULL); diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 840d17bee66ba..b8ec56e994ca6 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -76,7 +76,7 @@ PyFile_GetLine(PyObject *f, int n) } if (n < 0 && result != NULL && PyBytes_Check(result)) { - char *s = PyBytes_AS_STRING(result); + const char *s = PyBytes_AS_STRING(result); Py_ssize_t len = PyBytes_GET_SIZE(result); if (len == 0) { Py_DECREF(result); diff --git a/Objects/longobject.c b/Objects/longobject.c index 5d225cbd2fbde..a66e1c49241af 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5071,7 +5071,7 @@ long_new_impl(PyTypeObject *type, PyObject *x, PyObject *obase) if (PyUnicode_Check(x)) return PyLong_FromUnicodeObject(x, (int)base); else if (PyByteArray_Check(x) || PyBytes_Check(x)) { - char *string; + const char *string; if (PyByteArray_Check(x)) string = PyByteArray_AS_STRING(x); else diff --git a/Objects/stringlib/join.h b/Objects/stringlib/join.h index 8ad598ad5c9fd..53bcbdea7ade9 100644 --- a/Objects/stringlib/join.h +++ b/Objects/stringlib/join.h @@ -7,8 +7,8 @@ Py_LOCAL_INLINE(PyObject *) STRINGLIB(bytes_join)(PyObject *sep, PyObject *iterable) { - char *sepstr = STRINGLIB_STR(sep); - const Py_ssize_t seplen = STRINGLIB_LEN(sep); + const char *sepstr = STRINGLIB_STR(sep); + Py_ssize_t seplen = STRINGLIB_LEN(sep); PyObject *res = NULL; char *p; Py_ssize_t seqlen = 0; diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 3c79febea7788..7f39022d1e0b7 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3887,7 +3887,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr) PyObject *path = NULL; PyObject *output = NULL; Py_ssize_t size; - void *data; + const char *data; if (arg == NULL) { Py_DECREF(*(PyObject**)addr); *(PyObject**)addr = NULL; @@ -4718,7 +4718,7 @@ _PyUnicode_EncodeUTF7(PyObject *str, unsigned int base64bits = 0; unsigned long base64buffer = 0; char * out; - char * start; + const char * start; if (PyUnicode_READY(str) == -1) return NULL; @@ -5446,7 +5446,7 @@ unicode_fill_utf8(PyObject *unicode) return -1; } - char *start = writer.use_small_buffer ? writer.small_buffer : + const char *start = writer.use_small_buffer ? writer.small_buffer : PyBytes_AS_STRING(writer.buffer); Py_ssize_t len = end - start; diff --git a/Python/fileutils.c b/Python/fileutils.c index 6345553f484c7..19ead9d676c7f 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1452,7 +1452,7 @@ _Py_fopen_obj(PyObject *path, const char *mode) && errno == EINTR && !(async_err = PyErr_CheckSignals())); #else PyObject *bytes; - char *path_bytes; + const char *path_bytes; assert(PyGILState_Check()); From webhook-mailer at python.org Sun Apr 12 08:52:19 2020 From: webhook-mailer at python.org (mefistotelis) Date: Sun, 12 Apr 2020 12:52:19 -0000 Subject: [Python-checkins] bpo-39011: Preserve line endings within ElementTree attributes (GH-18468) Message-ID: https://github.com/python/cpython/commit/5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac commit: 5fd8123dfdf6df0a9c29363c8327ccfa0c1d41ac branch: master author: mefistotelis committer: GitHub date: 2020-04-12T14:51:58+02:00 summary: bpo-39011: Preserve line endings within ElementTree attributes (GH-18468) * bpo-39011: Preserve line endings within attributes Line endings within attributes were previously normalized to "\n" in Py3.7/3.8. This patch removes that normalization, as line endings which were replaced by entity numbers should be preserved in original form. files: A Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst M Doc/whatsnew/3.9.rst M Lib/test/test_xml_etree.py M Lib/xml/etree/ElementTree.py diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 3beb721ed318e..6cd80ce8e4ff9 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -412,6 +412,15 @@ customization consistently by always using the value specified by case), and one used ``__VENV_NAME__`` instead. (Contributed by Brett Cannon in :issue:`37663`.) +xml +--- + +White space characters within attributes are now preserved when serializing +:mod:`xml.etree.ElementTree` to XML file. EOLNs are no longer normalized +to "\n". This is the result of discussion about how to interpret +section 2.11 of XML spec. +(Contributed by Mefistotelis in :issue:`39011`.) + Optimizations ============= diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 785edb737021a..d01649d1c31b2 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -430,13 +430,14 @@ def test_attrib(self): self.assertEqual(ET.tostring(elem), b'aa') + # Test preserving white space chars in attributes elem = ET.Element('test') elem.set('a', '\r') elem.set('b', '\r\n') elem.set('c', '\t\n\r ') - elem.set('d', '\n\n') + elem.set('d', '\n\n\r\r\t\t ') self.assertEqual(ET.tostring(elem), - b'') + b'') def test_makeelement(self): # Test makeelement handling. diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index c8d898f32816d..da2bcad0b4d62 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -1057,15 +1057,15 @@ def _escape_attrib(text): text = text.replace(">", ">") if "\"" in text: text = text.replace("\"", """) - # The following business with carriage returns is to satisfy - # Section 2.11 of the XML specification, stating that - # CR or CR LN should be replaced with just LN + # Although section 2.11 of the XML specification states that CR or + # CR LN should be replaced with just LN, it applies only to EOLNs + # which take part of organizing file into lines. Within attributes, + # we are replacing these with entity numbers, so they do not count. # http://www.w3.org/TR/REC-xml/#sec-line-ends - if "\r\n" in text: - text = text.replace("\r\n", "\n") + # The current solution, contained in following six lines, was + # discussed in issue 17582 and 39011. if "\r" in text: - text = text.replace("\r", "\n") - #The following four lines are issue 17582 + text = text.replace("\r", " ") if "\n" in text: text = text.replace("\n", " ") if "\t" in text: diff --git a/Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst b/Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst new file mode 100644 index 0000000000000..43962f0bf17fd --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst @@ -0,0 +1,3 @@ +Normalization of line endings in ElementTree attributes was removed, as line +endings which were replaced by entity numbers should be preserved in +original form. From webhook-mailer at python.org Sun Apr 12 10:22:06 2020 From: webhook-mailer at python.org (Alex Itkes) Date: Sun, 12 Apr 2020 14:22:06 -0000 Subject: [Python-checkins] bpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355) Message-ID: https://github.com/python/cpython/commit/63e5b59c06fc99f95d274e7f181296e094cc3ee7 commit: 63e5b59c06fc99f95d274e7f181296e094cc3ee7 branch: master author: Alex Itkes <38556752+alexitkes at users.noreply.github.com> committer: GitHub date: 2020-04-12T16:21:58+02:00 summary: bpo-13743: Add some documentation strings to xml.dom.minidom (GH-16355) files: A Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy.rst M Lib/xml/dom/minidom.py diff --git a/Lib/xml/dom/minidom.py b/Lib/xml/dom/minidom.py index 1083b48138710..d09ef5e7d0371 100644 --- a/Lib/xml/dom/minidom.py +++ b/Lib/xml/dom/minidom.py @@ -719,6 +719,14 @@ def unlink(self): Node.unlink(self) def getAttribute(self, attname): + """Returns the value of the specified attribute. + + Returns the value of the element's attribute named attname as + a string. An empty string is returned if the element does not + have such an attribute. Note that an empty string may also be + returned as an explicitly given attribute value, use the + hasAttribute method to distinguish these two cases. + """ if self._attrs is None: return "" try: @@ -829,6 +837,11 @@ def removeAttributeNode(self, node): removeAttributeNodeNS = removeAttributeNode def hasAttribute(self, name): + """Checks whether the element has an attribute with the specified name. + + Returns True if the element has an attribute with the specified name. + Otherwise, returns False. + """ if self._attrs is None: return False return name in self._attrs @@ -839,6 +852,11 @@ def hasAttributeNS(self, namespaceURI, localName): return (namespaceURI, localName) in self._attrsNS def getElementsByTagName(self, name): + """Returns all descendant elements with the given tag name. + + Returns the list of all descendant elements (not direct children + only) with the specified tag name. + """ return _get_elements_by_tagName_helper(self, name, NodeList()) def getElementsByTagNameNS(self, namespaceURI, localName): @@ -849,6 +867,11 @@ def __repr__(self): return "" % (self.tagName, id(self)) def writexml(self, writer, indent="", addindent="", newl=""): + """Write an XML element to a file-like object + + Write the element to the writer object that must provide + a write method (e.g. a file or StringIO object). + """ # indent = current indentation # addindent = indentation to add to higher levels # newl = newline string diff --git a/Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy.rst b/Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy.rst new file mode 100644 index 0000000000000..02dc4331a1251 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy.rst @@ -0,0 +1 @@ +Some methods within xml.dom.minidom.Element class are now better documented. From webhook-mailer at python.org Sun Apr 12 10:36:49 2020 From: webhook-mailer at python.org (Oren Milman) Date: Sun, 12 Apr 2020 14:36:49 -0000 Subject: [Python-checkins] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) Message-ID: https://github.com/python/cpython/commit/402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527 commit: 402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527 branch: master author: Oren Milman committer: GitHub date: 2020-04-12T16:36:41+02:00 summary: bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) files: A Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst M Lib/test/test_xml_etree_c.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index 15496fdba2ff8..7437e13d0611c 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -115,6 +115,21 @@ def __del__(self): elem.tail = X() elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure + @support.cpython_only + def test_uninitialized_parser(self): + # The interpreter shouldn't crash in case of calling methods or + # accessing attributes of uninitialized XMLParser objects. + parser = cET.XMLParser.__new__(cET.XMLParser) + self.assertRaises(ValueError, parser.close) + self.assertRaises(ValueError, parser.feed, 'foo') + class MockFile: + def read(*args): + return '' + self.assertRaises(ValueError, parser._parse_whole, MockFile()) + self.assertRaises(ValueError, parser._setevents, None) + self.assertIsNone(parser.entity) + self.assertIsNone(parser.target) + def test_setstate_leaks(self): # Test reference leaks elem = cET.Element.__new__(cET.Element) diff --git a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst new file mode 100644 index 0000000000000..92e55db2b0986 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst @@ -0,0 +1,2 @@ +Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` +object. Patch by Oren Milman. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 10d78dd58f011..03ac6b6c0743d 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3818,6 +3818,17 @@ xmlparser_dealloc(XMLParserObject* self) Py_TYPE(self)->tp_free((PyObject *)self); } +Py_LOCAL_INLINE(int) +_check_xmlparser(XMLParserObject* self) +{ + if (self->target == NULL) { + PyErr_SetString(PyExc_ValueError, + "XMLParser.__init__() wasn't called"); + return 0; + } + return 1; +} + LOCAL(PyObject*) expat_parse(XMLParserObject* self, const char* data, int data_len, int final) { @@ -3854,6 +3865,10 @@ _elementtree_XMLParser_close_impl(XMLParserObject *self) /* end feeding data to parser */ PyObject* res; + + if (!_check_xmlparser(self)) { + return NULL; + } res = expat_parse(self, "", 0, 1); if (!res) return NULL; @@ -3885,6 +3900,9 @@ _elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data) { /* feed data to parser */ + if (!_check_xmlparser(self)) { + return NULL; + } if (PyUnicode_Check(data)) { Py_ssize_t data_len; const char *data_ptr = PyUnicode_AsUTF8AndSize(data, &data_len); @@ -3932,6 +3950,9 @@ _elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file) PyObject* temp; PyObject* res; + if (!_check_xmlparser(self)) { + return NULL; + } reader = PyObject_GetAttrString(file, "read"); if (!reader) return NULL; @@ -4019,6 +4040,9 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self, TreeBuilderObject *target; PyObject *events_append, *events_seq; + if (!_check_xmlparser(self)) { + return NULL; + } if (!TreeBuilder_CheckExact(self->target)) { PyErr_SetString( PyExc_TypeError, From webhook-mailer at python.org Sun Apr 12 11:19:02 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 12 Apr 2020 15:19:02 -0000 Subject: [Python-checkins] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19485) Message-ID: https://github.com/python/cpython/commit/61511488cf4e7a1cb57a38efba7e0a84a387fe58 commit: 61511488cf4e7a1cb57a38efba7e0a84a387fe58 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-12T17:18:57+02:00 summary: bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19485) (cherry picked from commit 402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527) files: A Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst M Lib/test/test_xml_etree_c.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index 2144d203e1e95..e26e1714a540b 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -118,6 +118,21 @@ def __del__(self): elem.tail = X() elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure + @support.cpython_only + def test_uninitialized_parser(self): + # The interpreter shouldn't crash in case of calling methods or + # accessing attributes of uninitialized XMLParser objects. + parser = cET.XMLParser.__new__(cET.XMLParser) + self.assertRaises(ValueError, parser.close) + self.assertRaises(ValueError, parser.feed, 'foo') + class MockFile: + def read(*args): + return '' + self.assertRaises(ValueError, parser._parse_whole, MockFile()) + self.assertRaises(ValueError, parser._setevents, None) + self.assertIsNone(parser.entity) + self.assertIsNone(parser.target) + def test_setstate_leaks(self): # Test reference leaks elem = cET.Element.__new__(cET.Element) diff --git a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst new file mode 100644 index 0000000000000..92e55db2b0986 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst @@ -0,0 +1,2 @@ +Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` +object. Patch by Oren Milman. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 776b86cf51a9d..a96e3f43b5597 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3877,6 +3877,17 @@ xmlparser_dealloc(XMLParserObject* self) Py_TYPE(self)->tp_free((PyObject *)self); } +Py_LOCAL_INLINE(int) +_check_xmlparser(XMLParserObject* self) +{ + if (self->target == NULL) { + PyErr_SetString(PyExc_ValueError, + "XMLParser.__init__() wasn't called"); + return 0; + } + return 1; +} + LOCAL(PyObject*) expat_parse(XMLParserObject* self, const char* data, int data_len, int final) { @@ -3913,6 +3924,10 @@ _elementtree_XMLParser_close_impl(XMLParserObject *self) /* end feeding data to parser */ PyObject* res; + + if (!_check_xmlparser(self)) { + return NULL; + } res = expat_parse(self, "", 0, 1); if (!res) return NULL; @@ -3944,6 +3959,9 @@ _elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data) { /* feed data to parser */ + if (!_check_xmlparser(self)) { + return NULL; + } if (PyUnicode_Check(data)) { Py_ssize_t data_len; const char *data_ptr = PyUnicode_AsUTF8AndSize(data, &data_len); @@ -3991,6 +4009,9 @@ _elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file) PyObject* temp; PyObject* res; + if (!_check_xmlparser(self)) { + return NULL; + } reader = PyObject_GetAttrString(file, "read"); if (!reader) return NULL; @@ -4078,6 +4099,9 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self, TreeBuilderObject *target; PyObject *events_append, *events_seq; + if (!_check_xmlparser(self)) { + return NULL; + } if (!TreeBuilder_CheckExact(self->target)) { PyErr_SetString( PyExc_TypeError, From webhook-mailer at python.org Sun Apr 12 13:15:42 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 12 Apr 2020 17:15:42 -0000 Subject: [Python-checkins] [3.7] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19487) Message-ID: https://github.com/python/cpython/commit/096e41aa4e558b28b7260fe01eb21414b1458b20 commit: 096e41aa4e558b28b7260fe01eb21414b1458b20 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-12T19:15:35+02:00 summary: [3.7] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19487) (cherry picked from commit 402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527) files: A Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst M Lib/test/test_xml_etree_c.py M Modules/_elementtree.c diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index 2144d203e1e95..24bf7f3d2c8eb 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -118,6 +118,23 @@ def __del__(self): elem.tail = X() elem.__setstate__({'tag': 42}) # shouldn't cause an assertion failure + @support.cpython_only + def test_uninitialized_parser(self): + # The interpreter shouldn't crash in case of calling methods or + # accessing attributes of uninitialized XMLParser objects. + parser = cET.XMLParser.__new__(cET.XMLParser) + self.assertRaises(ValueError, parser.close) + self.assertRaises(ValueError, parser.feed, 'foo') + class MockFile: + def read(*args): + return '' + self.assertRaises(ValueError, parser._parse_whole, MockFile()) + self.assertRaises(ValueError, parser._setevents, None) + with self.assertRaises(ValueError): + parser.entity + with self.assertRaises(ValueError): + parser.target + def test_setstate_leaks(self): # Test reference leaks elem = cET.Element.__new__(cET.Element) diff --git a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst new file mode 100644 index 0000000000000..92e55db2b0986 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst @@ -0,0 +1,2 @@ +Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` +object. Patch by Oren Milman. diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 605933f9649e3..9d5e635b9d75f 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -3474,6 +3474,17 @@ xmlparser_dealloc(XMLParserObject* self) Py_TYPE(self)->tp_free((PyObject *)self); } +Py_LOCAL_INLINE(int) +_check_xmlparser(XMLParserObject* self) +{ + if (self->target == NULL) { + PyErr_SetString(PyExc_ValueError, + "XMLParser.__init__() wasn't called"); + return 0; + } + return 1; +} + LOCAL(PyObject*) expat_parse(XMLParserObject* self, const char* data, int data_len, int final) { @@ -3510,6 +3521,10 @@ _elementtree_XMLParser_close_impl(XMLParserObject *self) /* end feeding data to parser */ PyObject* res; + + if (!_check_xmlparser(self)) { + return NULL; + } res = expat_parse(self, "", 0, 1); if (!res) return NULL; @@ -3541,6 +3556,9 @@ _elementtree_XMLParser_feed(XMLParserObject *self, PyObject *data) { /* feed data to parser */ + if (!_check_xmlparser(self)) { + return NULL; + } if (PyUnicode_Check(data)) { Py_ssize_t data_len; const char *data_ptr = PyUnicode_AsUTF8AndSize(data, &data_len); @@ -3588,6 +3606,9 @@ _elementtree_XMLParser__parse_whole(XMLParserObject *self, PyObject *file) PyObject* temp; PyObject* res; + if (!_check_xmlparser(self)) { + return NULL; + } reader = PyObject_GetAttrString(file, "read"); if (!reader) return NULL; @@ -3699,6 +3720,9 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self, TreeBuilderObject *target; PyObject *events_append, *events_seq; + if (!_check_xmlparser(self)) { + return NULL; + } if (!TreeBuilder_CheckExact(self->target)) { PyErr_SetString( PyExc_TypeError, @@ -3794,6 +3818,9 @@ xmlparser_getattro(XMLParserObject* self, PyObject* nameobj) else goto generic; + if (!res && !_check_xmlparser(self)) { + return NULL; + } Py_INCREF(res); return res; } From webhook-mailer at python.org Sun Apr 12 14:21:07 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Sun, 12 Apr 2020 18:21:07 -0000 Subject: [Python-checkins] bpo-40246: Report a better error message for invalid string prefixes (GH-19476) Message-ID: https://github.com/python/cpython/commit/41d5b94af44e34ac05d4cd57460ed104ccf96628 commit: 41d5b94af44e34ac05d4cd57460ed104ccf96628 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-12T19:21:00+01:00 summary: bpo-40246: Report a better error message for invalid string prefixes (GH-19476) files: A Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246.vXPze5.rst M Include/errcode.h M Lib/test/test_fstring.py M Parser/tokenizer.c M Python/pythonrun.c diff --git a/Include/errcode.h b/Include/errcode.h index b37cd261d5ec4..9af8d5c03d59b 100644 --- a/Include/errcode.h +++ b/Include/errcode.h @@ -31,6 +31,7 @@ extern "C" { #define E_LINECONT 25 /* Unexpected characters after a line continuation */ #define E_IDENTIFIER 26 /* Invalid characters in identifier */ #define E_BADSINGLE 27 /* Ill-formed single statement input */ +#define E_BADPREFIX 28 /* Bad string prefixes */ #ifdef __cplusplus } diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 49663923e7f5a..ef0ccb8cf53c1 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -841,7 +841,7 @@ def test_nested_fstrings(self): self.assertEqual(f'{f"{y}"*3}', '555') def test_invalid_string_prefixes(self): - self.assertAllRaise(SyntaxError, 'unexpected EOF while parsing', + self.assertAllRaise(SyntaxError, 'invalid string prefix', ["fu''", "uf''", "Fu''", diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246.vXPze5.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246.vXPze5.rst new file mode 100644 index 0000000000000..056b7f8472912 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246.vXPze5.rst @@ -0,0 +1 @@ +Report a specialized error message, `invalid string prefix`, when the tokenizer encounters a string with an invalid prefix. \ No newline at end of file diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index c650442a4a7fb..97986aa8ef40a 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1392,6 +1392,10 @@ tok_get(struct tok_state *tok, const char **p_start, const char **p_end) if (nonascii && !verify_identifier(tok)) { return ERRORTOKEN; } + if (c == '"' || c == '\'') { + tok->done = E_BADPREFIX; + return ERRORTOKEN; + } *p_start = tok->start; *p_end = tok->cur; diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 95571a8c7518a..eb9159f1b5c52 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1574,6 +1574,9 @@ err_input(perrdetail *err) case E_BADSINGLE: msg = "multiple statements found while compiling a single statement"; break; + case E_BADPREFIX: + msg = "invalid string prefix"; + break; default: fprintf(stderr, "error=%d\n", err->error); msg = "unknown parsing error"; From webhook-mailer at python.org Sun Apr 12 14:59:35 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 12 Apr 2020 18:59:35 -0000 Subject: [Python-checkins] closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490) Message-ID: https://github.com/python/cpython/commit/909b87d2bb3d6330d39c48e43f7f50f4d086cc41 commit: 909b87d2bb3d6330d39c48e43f7f50f4d086cc41 branch: master author: Benjamin Peterson committer: GitHub date: 2020-04-12T13:59:31-05:00 summary: closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490) files: M Modules/_ssl_data.h M Tools/ssl/make_ssl_data.py diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h index f01c019c45b19..e22f827032042 100644 --- a/Modules/_ssl_data.h +++ b/Modules/_ssl_data.h @@ -1,33 +1,85 @@ /* File generated by Tools/ssl/make_ssl_data.py */ -/* Generated on 2020-04-11T14:59:43.709585 */ +/* Generated on 2020-04-12T13:38:13.871723 */ static struct py_ssl_library_code library_codes[] = { +#ifdef ERR_LIB_ASN1 {"ASN1", ERR_LIB_ASN1}, +#endif +#ifdef ERR_LIB_ASYNC {"ASYNC", ERR_LIB_ASYNC}, +#endif +#ifdef ERR_LIB_BIO {"BIO", ERR_LIB_BIO}, +#endif +#ifdef ERR_LIB_BN {"BN", ERR_LIB_BN}, +#endif +#ifdef ERR_LIB_CMS {"CMS", ERR_LIB_CMS}, +#endif +#ifdef ERR_LIB_COMP {"COMP", ERR_LIB_COMP}, +#endif +#ifdef ERR_LIB_CONF {"CONF", ERR_LIB_CONF}, +#endif +#ifdef ERR_LIB_CRYPTO {"CRYPTO", ERR_LIB_CRYPTO}, +#endif +#ifdef ERR_LIB_CT {"CT", ERR_LIB_CT}, +#endif +#ifdef ERR_LIB_DH {"DH", ERR_LIB_DH}, +#endif +#ifdef ERR_LIB_DSA {"DSA", ERR_LIB_DSA}, +#endif +#ifdef ERR_LIB_EC {"EC", ERR_LIB_EC}, +#endif +#ifdef ERR_LIB_ENGINE {"ENGINE", ERR_LIB_ENGINE}, +#endif +#ifdef ERR_LIB_EVP {"EVP", ERR_LIB_EVP}, +#endif +#ifdef ERR_LIB_KDF {"KDF", ERR_LIB_KDF}, +#endif +#ifdef ERR_LIB_OCSP {"OCSP", ERR_LIB_OCSP}, +#endif +#ifdef ERR_LIB_PEM {"PEM", ERR_LIB_PEM}, +#endif +#ifdef ERR_LIB_PKCS12 {"PKCS12", ERR_LIB_PKCS12}, +#endif +#ifdef ERR_LIB_PKCS7 {"PKCS7", ERR_LIB_PKCS7}, +#endif +#ifdef ERR_LIB_RAND {"RAND", ERR_LIB_RAND}, +#endif +#ifdef ERR_LIB_RSA {"RSA", ERR_LIB_RSA}, +#endif +#ifdef ERR_LIB_SSL {"SSL", ERR_LIB_SSL}, +#endif +#ifdef ERR_LIB_TS {"TS", ERR_LIB_TS}, +#endif +#ifdef ERR_LIB_UI {"UI", ERR_LIB_UI}, +#endif +#ifdef ERR_LIB_X509 {"X509", ERR_LIB_X509}, +#endif +#ifdef ERR_LIB_X509V3 {"X509V3", ERR_LIB_X509V3}, +#endif { NULL } }; diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index 1c7a5a9fb28e3..a8562a225d256 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -76,7 +76,9 @@ def w(l): w("static struct py_ssl_library_code library_codes[] = {") for mnemo, (libcode, _, _) in sorted(error_libraries.items()): + w(f'#ifdef {libcode}') w(' {"%s", %s},' % (mnemo, libcode)) + w('#endif') w(' { NULL }') w('};') w("") From webhook-mailer at python.org Sun Apr 12 15:17:39 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 12 Apr 2020 19:17:39 -0000 Subject: [Python-checkins] closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490) Message-ID: https://github.com/python/cpython/commit/f35e7d3bb0488a15cbb45ff10f02be558a3777cd commit: f35e7d3bb0488a15cbb45ff10f02be558a3777cd branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-12T12:17:34-07:00 summary: closes bpo-39953: Generate ifdefs around library code definitions. (GH-19490) (cherry picked from commit 909b87d2bb3d6330d39c48e43f7f50f4d086cc41) Co-authored-by: Benjamin Peterson files: M Modules/_ssl_data.h M Tools/ssl/make_ssl_data.py diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h index f01c019c45b19..e22f827032042 100644 --- a/Modules/_ssl_data.h +++ b/Modules/_ssl_data.h @@ -1,33 +1,85 @@ /* File generated by Tools/ssl/make_ssl_data.py */ -/* Generated on 2020-04-11T14:59:43.709585 */ +/* Generated on 2020-04-12T13:38:13.871723 */ static struct py_ssl_library_code library_codes[] = { +#ifdef ERR_LIB_ASN1 {"ASN1", ERR_LIB_ASN1}, +#endif +#ifdef ERR_LIB_ASYNC {"ASYNC", ERR_LIB_ASYNC}, +#endif +#ifdef ERR_LIB_BIO {"BIO", ERR_LIB_BIO}, +#endif +#ifdef ERR_LIB_BN {"BN", ERR_LIB_BN}, +#endif +#ifdef ERR_LIB_CMS {"CMS", ERR_LIB_CMS}, +#endif +#ifdef ERR_LIB_COMP {"COMP", ERR_LIB_COMP}, +#endif +#ifdef ERR_LIB_CONF {"CONF", ERR_LIB_CONF}, +#endif +#ifdef ERR_LIB_CRYPTO {"CRYPTO", ERR_LIB_CRYPTO}, +#endif +#ifdef ERR_LIB_CT {"CT", ERR_LIB_CT}, +#endif +#ifdef ERR_LIB_DH {"DH", ERR_LIB_DH}, +#endif +#ifdef ERR_LIB_DSA {"DSA", ERR_LIB_DSA}, +#endif +#ifdef ERR_LIB_EC {"EC", ERR_LIB_EC}, +#endif +#ifdef ERR_LIB_ENGINE {"ENGINE", ERR_LIB_ENGINE}, +#endif +#ifdef ERR_LIB_EVP {"EVP", ERR_LIB_EVP}, +#endif +#ifdef ERR_LIB_KDF {"KDF", ERR_LIB_KDF}, +#endif +#ifdef ERR_LIB_OCSP {"OCSP", ERR_LIB_OCSP}, +#endif +#ifdef ERR_LIB_PEM {"PEM", ERR_LIB_PEM}, +#endif +#ifdef ERR_LIB_PKCS12 {"PKCS12", ERR_LIB_PKCS12}, +#endif +#ifdef ERR_LIB_PKCS7 {"PKCS7", ERR_LIB_PKCS7}, +#endif +#ifdef ERR_LIB_RAND {"RAND", ERR_LIB_RAND}, +#endif +#ifdef ERR_LIB_RSA {"RSA", ERR_LIB_RSA}, +#endif +#ifdef ERR_LIB_SSL {"SSL", ERR_LIB_SSL}, +#endif +#ifdef ERR_LIB_TS {"TS", ERR_LIB_TS}, +#endif +#ifdef ERR_LIB_UI {"UI", ERR_LIB_UI}, +#endif +#ifdef ERR_LIB_X509 {"X509", ERR_LIB_X509}, +#endif +#ifdef ERR_LIB_X509V3 {"X509V3", ERR_LIB_X509V3}, +#endif { NULL } }; diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index 2297c85fe0ce0..f604e3a40d472 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -76,7 +76,9 @@ def w(l): w("static struct py_ssl_library_code library_codes[] = {") for mnemo, (libcode, _, _) in sorted(error_libraries.items()): + w(f'#ifdef {libcode}') w(' {"%s", %s},' % (mnemo, libcode)) + w('#endif') w(' { NULL }') w('};') w("") From webhook-mailer at python.org Sun Apr 12 17:45:21 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Sun, 12 Apr 2020 21:45:21 -0000 Subject: [Python-checkins] bpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)" (GH-19456) Message-ID: https://github.com/python/cpython/commit/14d5331eb5e6c38be12bad421bd59ad0fac9e448 commit: 14d5331eb5e6c38be12bad421bd59ad0fac9e448 branch: master author: Victor Stinner committer: GitHub date: 2020-04-12T23:45:09+02:00 summary: bpo-40234: Revert "bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)" (GH-19456) This reverts commit 066e5b1a917ec2134e8997d2cadd815724314252. files: A Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst D Modules/clinic/_threadmodule.c.h M Doc/library/threading.rst M Doc/whatsnew/3.9.rst M Lib/test/test_threading.py M Lib/threading.py M Modules/_threadmodule.c diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 1e90294142796..3a446adfac8c5 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -280,8 +280,6 @@ since it is impossible to detect the termination of alien threads. base class constructor (``Thread.__init__()``) before doing anything else to the thread. - Daemon threads must not be used in subinterpreters. - .. versionchanged:: 3.3 Added the *daemon* argument. @@ -296,12 +294,6 @@ since it is impossible to detect the termination of alien threads. This method will raise a :exc:`RuntimeError` if called more than once on the same thread object. - Raise a :exc:`RuntimeError` if the thread is a daemon thread and the - method is called from a subinterpreter. - - .. versionchanged:: 3.9 - In a subinterpreter, spawning a daemon thread now raises an exception. - .. method:: run() Method representing the thread's activity. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 6cd80ce8e4ff9..020a86958f7af 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -369,15 +369,6 @@ The :mod:`socket` module now exports the :data:`~socket.CAN_RAW_JOIN_FILTERS` constant on Linux 4.1 and greater. (Contributed by Stefan Tatschner and Zackery Spytz in :issue:`25780`.) -threading ---------- - -In a subinterpreter, spawning a daemon thread now raises a :exc:`RuntimeError`. Daemon -threads were never supported in subinterpreters. Previously, the subinterpreter -finalization crashed with a Python fatal error if a daemon thread was still -running. -(Contributed by Victor Stinner in :issue:`37266`.) - sys --- diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index 8a4efd647096a..81e5f70d6d6ae 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -1022,32 +1022,28 @@ def f(): # The thread was joined properly. self.assertEqual(os.read(r, 1), b"x") - def test_daemon_thread(self): - r, w = self.pipe() - code = textwrap.dedent(f""" + @cpython_only + def test_daemon_threads_fatal_error(self): + subinterp_code = f"""if 1: + import os import threading - import sys - - channel = open({w}, "w", closefd=False) - - def func(): - pass + import time - thread = threading.Thread(target=func, daemon=True) - try: - thread.start() - except RuntimeError as exc: - print("ok: %s" % exc, file=channel, flush=True) - else: - thread.join() - print("fail: RuntimeError not raised", file=channel, flush=True) - """) - ret = test.support.run_in_subinterp(code) - self.assertEqual(ret, 0) + def f(): + # Make sure the daemon thread is still running when + # Py_EndInterpreter is called. + time.sleep({test.support.SHORT_TIMEOUT}) + threading.Thread(target=f, daemon=True).start() + """ + script = r"""if 1: + import _testcapi - msg = os.read(r, 100).decode().rstrip() - self.assertEqual("ok: daemon thread are not supported " - "in subinterpreters", msg) + _testcapi.run_in_subinterp(%r) + """ % (subinterp_code,) + with test.support.SuppressCrashReport(): + rc, out, err = assert_python_failure("-c", script) + self.assertIn("Fatal Python error: Py_EndInterpreter: " + "not the last thread", err.decode()) class ThreadingExceptionTests(BaseTestCase): diff --git a/Lib/threading.py b/Lib/threading.py index 5424db3dabc44..ab29db77a747a 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -35,7 +35,6 @@ _allocate_lock = _thread.allocate_lock _set_sentinel = _thread._set_sentinel get_ident = _thread.get_ident -_is_main_interpreter = _thread._is_main_interpreter try: get_native_id = _thread.get_native_id _HAVE_THREAD_NATIVE_ID = True @@ -865,10 +864,6 @@ def start(self): if self._started.is_set(): raise RuntimeError("threads can only be started once") - if self.daemon and not _is_main_interpreter(): - raise RuntimeError("daemon thread are not supported " - "in subinterpreters") - with _active_limbo_lock: _limbo[self] = self try: diff --git a/Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst b/Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst new file mode 100644 index 0000000000000..ed7a9f355dbac --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst @@ -0,0 +1,2 @@ +Allow again to spawn daemon threads in subinterpreters (revert change which +denied them). diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index addef3ee54e0f..e2bb14ec728b4 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -8,14 +8,6 @@ #include "structmember.h" /* offsetof */ #include "pythread.h" -#include "clinic/_threadmodule.c.h" - -/*[clinic input] -module _thread -[clinic start generated code]*/ -/*[clinic end generated code: output=da39a3ee5e6b4b0d input=be8dbe5cc4b16df7]*/ - - static PyObject *ThreadError; static PyObject *str_dict; @@ -1493,21 +1485,6 @@ PyDoc_STRVAR(excepthook_doc, \n\ Handle uncaught Thread.run() exception."); -/*[clinic input] -_thread._is_main_interpreter - -Return True if the current interpreter is the main Python interpreter. -[clinic start generated code]*/ - -static PyObject * -_thread__is_main_interpreter_impl(PyObject *module) -/*[clinic end generated code: output=7dd82e1728339adc input=cc1eb00fd4598915]*/ -{ - PyThreadState *tstate = _PyThreadState_GET(); - int is_main = _Py_IsMainInterpreter(tstate); - return PyBool_FromLong(is_main); -} - static PyMethodDef thread_methods[] = { {"start_new_thread", (PyCFunction)thread_PyThread_start_new_thread, METH_VARARGS, start_new_doc}, @@ -1537,7 +1514,6 @@ static PyMethodDef thread_methods[] = { METH_NOARGS, _set_sentinel_doc}, {"_excepthook", thread_excepthook, METH_O, excepthook_doc}, - _THREAD__IS_MAIN_INTERPRETER_METHODDEF {NULL, NULL} /* sentinel */ }; diff --git a/Modules/clinic/_threadmodule.c.h b/Modules/clinic/_threadmodule.c.h deleted file mode 100644 index 07ea08b1750d5..0000000000000 --- a/Modules/clinic/_threadmodule.c.h +++ /dev/null @@ -1,22 +0,0 @@ -/*[clinic input] -preserve -[clinic start generated code]*/ - -PyDoc_STRVAR(_thread__is_main_interpreter__doc__, -"_is_main_interpreter($module, /)\n" -"--\n" -"\n" -"Return True if the current interpreter is the main Python interpreter."); - -#define _THREAD__IS_MAIN_INTERPRETER_METHODDEF \ - {"_is_main_interpreter", (PyCFunction)_thread__is_main_interpreter, METH_NOARGS, _thread__is_main_interpreter__doc__}, - -static PyObject * -_thread__is_main_interpreter_impl(PyObject *module); - -static PyObject * -_thread__is_main_interpreter(PyObject *module, PyObject *Py_UNUSED(ignored)) -{ - return _thread__is_main_interpreter_impl(module); -} -/*[clinic end generated code: output=505840d1b9101789 input=a9049054013a1b77]*/ From webhook-mailer at python.org Sun Apr 12 21:04:33 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 13 Apr 2020 01:04:33 -0000 Subject: [Python-checkins] bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492) Message-ID: https://github.com/python/cpython/commit/da7933ecc30e37b119756cb02b89a6ad99db22e0 commit: da7933ecc30e37b119756cb02b89a6ad99db22e0 branch: master author: Victor Stinner committer: GitHub date: 2020-04-13T03:04:28+02:00 summary: bpo-40268: Add _PyInterpreterState_GetConfig() (GH-19492) Don't access PyInterpreterState.config member directly anymore, but use new functions: * _PyInterpreterState_GetConfig() * _PyInterpreterState_SetConfig() * _Py_GetConfig() files: M Include/cpython/pystate.h M Include/internal/pycore_pystate.h M Modules/_io/_iomodule.c M Modules/_io/iobase.c M Modules/_io/textio.c M Modules/main.c M Objects/bytearrayobject.c M Objects/bytesobject.c M Objects/moduleobject.c M Objects/unicodeobject.c M Python/bltinmodule.c M Python/compile.c M Python/dynload_hpux.c M Python/import.c M Python/initconfig.c M Python/pylifecycle.c M Python/pystate.c M Python/pythonrun.c M Python/sysmodule.c diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index 27097270a0cb9..7052228804119 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -192,6 +192,13 @@ PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc( PyInterpreterState *interp, _PyFrameEvalFunction eval_frame); +PyAPI_FUNC(const PyConfig*) _PyInterpreterState_GetConfig(PyInterpreterState *interp); + +// Get the configuration of the currrent interpreter. +// The caller must hold the GIL. +PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void); + + /* cross-interpreter data */ struct _xid; diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 13a957ab2fb78..c28df89b5a3af 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -380,6 +380,10 @@ PyAPI_FUNC(void) _PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime); /* Used by _PyImport_Cleanup() */ extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); +extern PyStatus _PyInterpreterState_SetConfig( + PyInterpreterState *interp, + const PyConfig *config); + PyAPI_FUNC(void) _PyGILState_Reinit(_PyRuntimeState *runtime); diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index e880992070d0d..571f22552527f 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -9,7 +9,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_pystate.h" /* _PyInterpreterState_GET_UNSAFE() */ #include "structmember.h" #include "_iomodule.h" @@ -377,7 +376,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode, { PyObject *RawIO_class = (PyObject *)&PyFileIO_Type; #ifdef MS_WINDOWS - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; + const PyConfig *config = _Py_GetConfig(); if (!config->legacy_windows_stdio && _PyIO_get_console_type(path_or_fd) != '\0') { RawIO_class = (PyObject *)&PyWindowsConsoleIO_Type; encoding = "utf-8"; diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 1ff35648e550f..924ffb57ca95c 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -287,8 +287,7 @@ iobase_finalize(PyObject *self) shutdown issues). */ if (res == NULL) { #ifndef Py_DEBUG - const PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; - if (config->dev_mode) { + if (_Py_GetConfig()->dev_mode) { PyErr_WriteUnraisable(self); } else { diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 92d6faafa2ea5..492988ef422a0 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -9,6 +9,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_object.h" +#include "pycore_pystate.h" #include "structmember.h" #include "_iomodule.h" @@ -996,7 +997,7 @@ io_check_errors(PyObject *errors) PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); #ifndef Py_DEBUG /* In release mode, only check in development mode (-X dev) */ - if (!interp->config.dev_mode) { + if (!_PyInterpreterState_GetConfig(interp)->dev_mode) { return 0; } #else diff --git a/Modules/main.c b/Modules/main.c index 0288f17324d80..00a0fc3ece401 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -301,7 +301,7 @@ pymain_run_module(const wchar_t *modname, int set_argv0) static int -pymain_run_file(PyConfig *config, PyCompilerFlags *cf) +pymain_run_file(const PyConfig *config, PyCompilerFlags *cf) { const wchar_t *filename = config->run_filename; if (PySys_Audit("cpython.run_file", "u", filename) < 0) { @@ -499,7 +499,7 @@ pymain_run_python(int *exitcode) { PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); /* pymain_run_stdin() modify the config */ - PyConfig *config = &interp->config; + PyConfig *config = (PyConfig*)_PyInterpreterState_GetConfig(interp); PyObject *main_importer_path = NULL; if (config->run_filename != NULL) { diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 7ebfa1f9434cc..4d1ddec3822ff 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -6,7 +6,6 @@ #include "pycore_bytes_methods.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "structmember.h" #include "bytesobject.h" #include "pystrhex.h" @@ -997,8 +996,7 @@ bytearray_repr(PyByteArrayObject *self) static PyObject * bytearray_str(PyObject *op) { - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; - if (config->bytes_warning) { + if (_Py_GetConfig()->bytes_warning) { if (PyErr_WarnEx(PyExc_BytesWarning, "str() on a bytearray instance", 1)) { return NULL; @@ -1023,8 +1021,7 @@ bytearray_richcompare(PyObject *self, PyObject *other, int op) if (rc < 0) return NULL; if (rc) { - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; - if (config->bytes_warning && (op == Py_EQ || op == Py_NE)) { + if (_Py_GetConfig()->bytes_warning && (op == Py_EQ || op == Py_NE)) { if (PyErr_WarnEx(PyExc_BytesWarning, "Comparison between bytearray and string", 1)) return NULL; diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 7be075b72e32a..30bc739ceea7f 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -7,7 +7,6 @@ #include "pycore_bytes_methods.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "pystrhex.h" #include @@ -1342,8 +1341,7 @@ bytes_repr(PyObject *op) static PyObject * bytes_str(PyObject *op) { - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; - if (config->bytes_warning) { + if (_Py_GetConfig()->bytes_warning) { if (PyErr_WarnEx(PyExc_BytesWarning, "str() on a bytes instance", 1)) { return NULL; @@ -1500,8 +1498,7 @@ bytes_richcompare(PyBytesObject *a, PyBytesObject *b, int op) /* Make sure both arguments are strings. */ if (!(PyBytes_Check(a) && PyBytes_Check(b))) { - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; - if (config->bytes_warning && (op == Py_EQ || op == Py_NE)) { + if (_Py_GetConfig()->bytes_warning && (op == Py_EQ || op == Py_NE)) { rc = PyObject_IsInstance((PyObject*)a, (PyObject*)&PyUnicode_Type); if (!rc) diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index f02ca75c9ee04..30adc92acf660 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -572,7 +572,7 @@ _PyModule_ClearDict(PyObject *d) Py_ssize_t pos; PyObject *key, *value; - int verbose = _PyInterpreterState_GET_UNSAFE()->config.verbose; + int verbose = _Py_GetConfig()->verbose; /* First, clear only names starting with a single underscore */ pos = 0; @@ -659,7 +659,7 @@ module___init___impl(PyModuleObject *self, PyObject *name, PyObject *doc) static void module_dealloc(PyModuleObject *m) { - int verbose = _PyInterpreterState_GET_UNSAFE()->config.verbose; + int verbose = _Py_GetConfig()->verbose; PyObject_GC_UnTrack(m); if (verbose && m->md_name) { diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7f39022d1e0b7..938df24e1dfbc 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -439,7 +439,7 @@ unicode_check_encoding_errors(const char *encoding, const char *errors) PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); #ifndef Py_DEBUG /* In release mode, only check in development mode (-X dev) */ - if (!interp->config.dev_mode) { + if (!_PyInterpreterState_GetConfig(interp)->dev_mode) { return 0; } #else @@ -3632,7 +3632,8 @@ PyUnicode_EncodeFSDefault(PyObject *unicode) /* Before _PyUnicode_InitEncodings() is called, the Python codec machinery is not ready and so cannot be used: use wcstombs() in this case. */ - const wchar_t *filesystem_errors = interp->config.filesystem_errors; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); + const wchar_t *filesystem_errors = config->filesystem_errors; assert(filesystem_errors != NULL); _Py_error_handler errors = get_error_handler_wide(filesystem_errors); assert(errors != _Py_ERROR_UNKNOWN); @@ -3868,7 +3869,8 @@ PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) /* Before _PyUnicode_InitEncodings() is called, the Python codec machinery is not ready and so cannot be used: use mbstowcs() in this case. */ - const wchar_t *filesystem_errors = interp->config.filesystem_errors; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); + const wchar_t *filesystem_errors = config->filesystem_errors; assert(filesystem_errors != NULL); _Py_error_handler errors = get_error_handler_wide(filesystem_errors); assert(errors != _Py_ERROR_UNKNOWN); @@ -15894,7 +15896,7 @@ static PyStatus init_stdio_encoding(PyThreadState *tstate) { /* Update the stdio encoding to the normalized Python codec name. */ - PyConfig *config = &tstate->interp->config; + PyConfig *config = (PyConfig*)_PyInterpreterState_GetConfig(tstate->interp); if (config_get_codec_name(&config->stdio_encoding) < 0) { return _PyStatus_ERR("failed to get the Python codec name " "of the stdio encoding"); @@ -15906,7 +15908,7 @@ init_stdio_encoding(PyThreadState *tstate) static int init_fs_codec(PyInterpreterState *interp) { - PyConfig *config = &interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); _Py_error_handler error_handler; error_handler = get_error_handler_wide(config->filesystem_errors); @@ -15964,7 +15966,7 @@ init_fs_encoding(PyThreadState *tstate) /* Update the filesystem encoding to the normalized Python codec name. For example, replace "ANSI_X3.4-1968" (locale encoding) with "ascii" (Python codec name). */ - PyConfig *config = &interp->config; + PyConfig *config = (PyConfig*)_PyInterpreterState_GetConfig(interp); if (config_get_codec_name(&config->filesystem_encoding) < 0) { _Py_DumpPathConfig(tstate); return _PyStatus_ERR("failed to get the Python codec " @@ -16008,7 +16010,7 @@ int _PyUnicode_EnableLegacyWindowsFSEncoding(void) { PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); - PyConfig *config = &interp->config; + PyConfig *config = (PyConfig *)_PyInterpreterState_GetConfig(interp); /* Set the filesystem encoding to mbcs/replace (PEP 529) */ wchar_t *encoding = _PyMem_RawWcsdup(L"mbcs"); diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index cb048af97855f..8063c2186d3e6 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2770,7 +2770,7 @@ _PyBuiltin_Init(PyThreadState *tstate) { PyObject *mod, *dict, *debug; - const PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); if (PyType_Ready(&PyFilter_Type) < 0 || PyType_Ready(&PyMap_Type) < 0 || diff --git a/Python/compile.c b/Python/compile.c index 329add9d068ba..54e6516b3ad01 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -23,7 +23,6 @@ #include "Python.h" -#include "pycore_pystate.h" /* _PyInterpreterState_GET_UNSAFE() */ #include "Python-ast.h" #include "ast.h" #include "code.h" @@ -323,7 +322,6 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, PyCodeObject *co = NULL; PyCompilerFlags local_flags = _PyCompilerFlags_INIT; int merged; - PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; if (!__doc__) { __doc__ = PyUnicode_InternFromString("__doc__"); @@ -350,7 +348,7 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, c.c_future->ff_features = merged; flags->cf_flags = merged; c.c_flags = flags; - c.c_optimize = (optimize == -1) ? config->optimization_level : optimize; + c.c_optimize = (optimize == -1) ? _Py_GetConfig()->optimization_level : optimize; c.c_nestlevel = 0; c.c_do_not_emit_bytecode = 0; diff --git a/Python/dynload_hpux.c b/Python/dynload_hpux.c index e59d00435ec7d..4b964a69d3bde 100644 --- a/Python/dynload_hpux.c +++ b/Python/dynload_hpux.c @@ -6,7 +6,6 @@ #include "Python.h" #include "importdl.h" -#include "pycore_pystate.h" #if defined(__hp9000s300) #define FUNCNAME_PATTERN "_%.20s_%.200s" @@ -21,7 +20,7 @@ dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix, const char *pathname, FILE *fp) { int flags = BIND_FIRST | BIND_DEFERRED; - int verbose = _PyInterpreterState_GET_UNSAFE()->config.verbose; + int verbose = _Py_GetConfig()->verbose; if (verbose) { flags = BIND_FIRST | BIND_IMMEDIATE | BIND_NONFATAL | BIND_VERBOSE; diff --git a/Python/import.c b/Python/import.c index 2e434561f63c5..d79fa18e30898 100644 --- a/Python/import.c +++ b/Python/import.c @@ -102,7 +102,7 @@ _PyImportZip_Init(PyThreadState *tstate) goto error; } - int verbose = tstate->interp->config.verbose; + int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; if (verbose) { PySys_WriteStderr("# installing zipimport hook\n"); } @@ -446,7 +446,7 @@ _PyImport_Cleanup(PyThreadState *tstate) /* XXX Perhaps these precautions are obsolete. Who knows? */ - int verbose = interp->config.verbose; + int verbose = _PyInterpreterState_GetConfig(interp)->verbose; if (verbose) { PySys_WriteStderr("# clear builtins._\n"); } @@ -811,7 +811,7 @@ import_find_extension(PyThreadState *tstate, PyObject *name, return NULL; } - int verbose = tstate->interp->config.verbose; + int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; if (verbose) { PySys_FormatStderr("import %U # previously loaded (%R)\n", name, filename); @@ -1523,7 +1523,7 @@ remove_importlib_frames(PyThreadState *tstate) which end with a call to "_call_with_frames_removed". */ _PyErr_Fetch(tstate, &exception, &value, &base_tb); - if (!exception || tstate->interp->config.verbose) { + if (!exception || _PyInterpreterState_GetConfig(tstate->interp)->verbose) { goto done; } @@ -1727,7 +1727,7 @@ import_find_and_load(PyThreadState *tstate, PyObject *abs_name) _Py_IDENTIFIER(_find_and_load); PyObject *mod = NULL; PyInterpreterState *interp = tstate->interp; - int import_time = interp->config.import_time; + int import_time = _PyInterpreterState_GetConfig(interp)->import_time; static int import_level; static _PyTime_t accumulated; @@ -2413,7 +2413,7 @@ PyInit__imp(void) goto failure; } - const wchar_t *mode = _PyInterpreterState_GET_UNSAFE()->config.check_hash_pycs_mode; + const wchar_t *mode = _Py_GetConfig()->check_hash_pycs_mode; PyObject *pyc_mode = PyUnicode_FromWideChar(mode, -1); if (pyc_mode == NULL) { goto failure; diff --git a/Python/initconfig.c b/Python/initconfig.c index 7bad36ef17b81..e63d6f64f3321 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -2595,7 +2595,7 @@ _Py_GetConfigsAsDict(void) Py_CLEAR(dict); /* core config */ - const PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); dict = config_as_dict(config); if (dict == NULL) { goto error; @@ -2662,7 +2662,7 @@ _Py_DumpPathConfig(PyThreadState *tstate) PySys_WriteStderr("\n"); \ } while (0) - PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); DUMP_CONFIG("PYTHONHOME", home); DUMP_CONFIG("PYTHONPATH", pythonpath_env); DUMP_CONFIG("program name", program_name); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 9b413c631875a..1bc7d77d35227 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -157,7 +157,7 @@ init_importlib(PyThreadState *tstate, PyObject *sysmod) PyObject *impmod; PyObject *value; PyInterpreterState *interp = tstate->interp; - int verbose = interp->config.verbose; + int verbose = _PyInterpreterState_GetConfig(interp)->verbose; /* Import _importlib through its frozen version, _frozen_importlib. */ if (PyImport_ImportFrozenModule("_frozen_importlib") <= 0) { @@ -473,11 +473,11 @@ pyinit_core_reconfigure(_PyRuntimeState *runtime, _PyConfig_Write(config, runtime); - status = _PyConfig_Copy(&interp->config, config); + status = _PyInterpreterState_SetConfig(interp, config); if (_PyStatus_EXCEPTION(status)) { return status; } - config = &interp->config; + config = _PyInterpreterState_GetConfig(interp); if (config->_install_importlib) { status = _PyConfig_WritePathConfig(config); @@ -558,7 +558,7 @@ pycore_create_interpreter(_PyRuntimeState *runtime, return _PyStatus_ERR("can't make main interpreter"); } - PyStatus status = _PyConfig_Copy(&interp->config, config); + PyStatus status = _PyInterpreterState_SetConfig(interp, config); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -692,7 +692,7 @@ pycore_init_import_warnings(PyThreadState *tstate, PyObject *sysmod) return status; } - const PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); if (_Py_IsMainInterpreter(tstate)) { /* Initialize _warnings. */ status = _PyWarnings_InitState(tstate); @@ -953,7 +953,7 @@ pyinit_core(_PyRuntimeState *runtime, static PyStatus _Py_ReconfigureMainInterpreter(PyThreadState *tstate) { - PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); PyObject *argv = _PyWideStringList_AsList(&config->argv); if (argv == NULL) { @@ -977,7 +977,7 @@ init_interp_main(PyThreadState *tstate) PyStatus status; int is_main_interp = _Py_IsMainInterpreter(tstate); PyInterpreterState *interp = tstate->interp; - PyConfig *config = &interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); if (!config->_install_importlib) { /* Special mode for freeze_importlib: run with no import system @@ -1146,7 +1146,7 @@ Py_InitializeFromConfig(const PyConfig *config) if (_PyStatus_EXCEPTION(status)) { return status; } - config = &tstate->interp->config; + config = _PyInterpreterState_GetConfig(tstate->interp); if (config->_init_main) { status = pyinit_main(tstate); @@ -1571,16 +1571,16 @@ new_interpreter(PyThreadState **tstate_p) PyThreadState *save_tstate = PyThreadState_Swap(tstate); /* Copy the current interpreter config into the new interpreter */ - PyConfig *config; + const PyConfig *config; if (save_tstate != NULL) { - config = &save_tstate->interp->config; + config = _PyInterpreterState_GetConfig(save_tstate->interp); } else { /* No current thread state, copy from the main interpreter */ PyInterpreterState *main_interp = PyInterpreterState_Main(); - config = &main_interp->config; + config = _PyInterpreterState_GetConfig(main_interp); } - status = _PyConfig_Copy(&interp->config, config); + status = _PyInterpreterState_SetConfig(interp, config); if (_PyStatus_EXCEPTION(status)) { goto error; } @@ -1953,7 +1953,7 @@ init_sys_streams(PyThreadState *tstate) int fd; PyObject * encoding_attr; PyStatus res = _PyStatus_OK(); - const PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); /* Check that stdin is not a directory Using shell redirection, you can redirect stdin to a directory, diff --git a/Python/pystate.c b/Python/pystate.c index 0539096bdc55d..19beaf05eb118 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -790,7 +790,7 @@ _PyInterpreterState_ClearModules(PyInterpreterState *interp) void PyThreadState_Clear(PyThreadState *tstate) { - int verbose = tstate->interp->config.verbose; + int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; if (verbose && tstate->frame != NULL) { /* bpo-20526: After the main thread calls @@ -1808,6 +1808,30 @@ _PyInterpreterState_SetEvalFrameFunc(PyInterpreterState *interp, interp->eval_frame = eval_frame; } + +const PyConfig* +_PyInterpreterState_GetConfig(PyInterpreterState *interp) +{ + return &interp->config; +} + + +PyStatus +_PyInterpreterState_SetConfig(PyInterpreterState *interp, + const PyConfig *config) +{ + return _PyConfig_Copy(&interp->config, config); +} + + +const PyConfig* +_Py_GetConfig(void) +{ + assert(PyGILState_Check()); + PyThreadState *tstate = _PyThreadState_GET(); + return _PyInterpreterState_GetConfig(tstate->interp); +} + #ifdef __cplusplus } #endif diff --git a/Python/pythonrun.c b/Python/pythonrun.c index eb9159f1b5c52..522d152994e7b 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -96,7 +96,7 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename_str, PyCompilerFlags * PyCompilerFlags local_flags = _PyCompilerFlags_INIT; int nomem_count = 0; #ifdef Py_REF_DEBUG - int show_ref_count = _PyInterpreterState_GET_UNSAFE()->config.show_ref_count; + int show_ref_count = _Py_GetConfig()->show_ref_count; #endif filename = PyUnicode_DecodeFSDefault(filename_str); @@ -584,7 +584,7 @@ print_error_text(PyObject *f, int offset, PyObject *text_obj) int _Py_HandleSystemExit(int *exitcode_p) { - int inspect = _PyInterpreterState_GET_UNSAFE()->config.inspect; + int inspect = _Py_GetConfig()->inspect; if (inspect) { /* Don't exit if -i flag was given. This flag is set to 0 * when entering interactive mode for inspecting. */ diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 994e3582fe6b5..fd0a9c0bf576c 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -23,7 +23,6 @@ Data members: #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "pycore_tupleobject.h" #include "pythread.h" #include "pydtrace.h" @@ -337,7 +336,7 @@ _PySys_ClearAuditHooks(PyThreadState *ts) return; } - const PyConfig *config = &ts->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(ts->interp); if (config->verbose) { PySys_WriteStderr("# clear sys.audit hooks\n"); } @@ -846,8 +845,8 @@ static PyObject * sys_getfilesystemencoding_impl(PyObject *module) /*[clinic end generated code: output=1dc4bdbe9be44aa7 input=8475f8649b8c7d8c]*/ { - PyThreadState *tstate = _PyThreadState_GET(); - const PyConfig *config = &tstate->interp->config; + PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + const PyConfig *config = _PyInterpreterState_GetConfig(interp); return PyUnicode_FromWideChar(config->filesystem_encoding, -1); } @@ -861,8 +860,8 @@ static PyObject * sys_getfilesystemencodeerrors_impl(PyObject *module) /*[clinic end generated code: output=ba77b36bbf7c96f5 input=22a1e8365566f1e5]*/ { - PyThreadState *tstate = _PyThreadState_GET(); - const PyConfig *config = &tstate->interp->config; + PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + const PyConfig *config = _PyInterpreterState_GetConfig(interp); return PyUnicode_FromWideChar(config->filesystem_errors, -1); } @@ -2455,7 +2454,7 @@ make_flags(PyThreadState *tstate) { PyInterpreterState *interp = tstate->interp; const PyPreConfig *preconfig = &interp->runtime->preconfig; - const PyConfig *config = &interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(interp); PyObject *seq = PyStructSequence_New(&FlagsType); if (seq == NULL) { @@ -2889,7 +2888,7 @@ int _PySys_InitMain(PyThreadState *tstate) { PyObject *sysdict = tstate->interp->sysdict; - const PyConfig *config = &tstate->interp->config; + const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); int res; #define COPY_LIST(KEY, VALUE) \ From webhook-mailer at python.org Sun Apr 12 21:47:42 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 13 Apr 2020 01:47:42 -0000 Subject: [Python-checkins] Add double quote cases to invalid prefix tests (GH-19489) Message-ID: https://github.com/python/cpython/commit/70c188eee019778583f19886e3b620d17bc86cd8 commit: 70c188eee019778583f19886e3b620d17bc86cd8 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-13T02:47:35+01:00 summary: Add double quote cases to invalid prefix tests (GH-19489) files: M Lib/test/test_fstring.py diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index ef0ccb8cf53c1..8fd7cf09a99f4 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -841,8 +841,7 @@ def test_nested_fstrings(self): self.assertEqual(f'{f"{y}"*3}', '555') def test_invalid_string_prefixes(self): - self.assertAllRaise(SyntaxError, 'invalid string prefix', - ["fu''", + single_quote_cases = ["fu''", "uf''", "Fu''", "fU''", @@ -863,8 +862,10 @@ def test_invalid_string_prefixes(self): "bf''", "bF''", "Bf''", - "BF''", - ]) + "BF''",] + double_quote_cases = [case.replace("'", '"') for case in single_quote_cases] + self.assertAllRaise(SyntaxError, 'invalid string prefix', + single_quote_cases + double_quote_cases) def test_leading_trailing_spaces(self): self.assertEqual(f'{ 3}', '3') From webhook-mailer at python.org Sun Apr 12 22:55:50 2020 From: webhook-mailer at python.org (laike9m) Date: Mon, 13 Apr 2020 02:55:50 -0000 Subject: [Python-checkins] Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) Message-ID: https://github.com/python/cpython/commit/85dd6bb1f61f7edcd6ac0b640a98644531690a0e commit: 85dd6bb1f61f7edcd6ac0b640a98644531690a0e branch: master author: laike9m committer: GitHub date: 2020-04-13T10:55:45+08:00 summary: Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) files: M Doc/library/dis.rst diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 96574a098696c..f871ec4f13def 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -844,9 +844,9 @@ All of the following opcodes use their arguments. .. opcode:: BUILD_CONST_KEY_MAP (count) - The version of :opcode:`BUILD_MAP` specialized for constant keys. *count* - values are consumed from the stack. The top element on the stack contains - a tuple of keys. + The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the + top element on the stack which contains a tuple of keys, then starting from + ``TOS1``, pops *count* values to form values in the built dictionary. .. versionadded:: 3.6 From webhook-mailer at python.org Sun Apr 12 23:01:47 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 13 Apr 2020 03:01:47 -0000 Subject: [Python-checkins] [3.7] Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) (GH-19496) Message-ID: https://github.com/python/cpython/commit/0a9ec9faa7b54f5a1a66263f5047b322e0222492 commit: 0a9ec9faa7b54f5a1a66263f5047b322e0222492 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-12T20:01:39-07:00 summary: [3.7] Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) (GH-19496) (cherry picked from commit 85dd6bb1f61f7edcd6ac0b640a98644531690a0e) Co-authored-by: laike9m Automerge-Triggered-By: @zhangyangyu files: M Doc/library/dis.rst diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 4b604f5921658..239cf74a1a72e 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -835,9 +835,9 @@ All of the following opcodes use their arguments. .. opcode:: BUILD_CONST_KEY_MAP (count) - The version of :opcode:`BUILD_MAP` specialized for constant keys. *count* - values are consumed from the stack. The top element on the stack contains - a tuple of keys. + The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the + top element on the stack which contains a tuple of keys, then starting from + ``TOS1``, pops *count* values to form values in the built dictionary. .. versionadded:: 3.6 From webhook-mailer at python.org Sun Apr 12 23:01:58 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 13 Apr 2020 03:01:58 -0000 Subject: [Python-checkins] [3.8] Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) (GH-19495) Message-ID: https://github.com/python/cpython/commit/ee691b078b23543af71027e353a6bafa2aa722d9 commit: ee691b078b23543af71027e353a6bafa2aa722d9 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-12T20:01:53-07:00 summary: [3.8] Improved documentation for `BUILD_CONST_KEY_MAP` (GH-19454) (GH-19495) (cherry picked from commit 85dd6bb1f61f7edcd6ac0b640a98644531690a0e) Co-authored-by: laike9m Automerge-Triggered-By: @zhangyangyu files: M Doc/library/dis.rst diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 34ae1a3a6d83d..5b34e68cb027c 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -894,9 +894,9 @@ All of the following opcodes use their arguments. .. opcode:: BUILD_CONST_KEY_MAP (count) - The version of :opcode:`BUILD_MAP` specialized for constant keys. *count* - values are consumed from the stack. The top element on the stack contains - a tuple of keys. + The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the + top element on the stack which contains a tuple of keys, then starting from + ``TOS1``, pops *count* values to form values in the built dictionary. .. versionadded:: 3.6 From webhook-mailer at python.org Mon Apr 13 05:38:47 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 13 Apr 2020 09:38:47 -0000 Subject: [Python-checkins] bpo-40241: Add pycore_gc.h header file (GH-19494) Message-ID: https://github.com/python/cpython/commit/0135598d729d01f35ce08d47160adaa095a6149f commit: 0135598d729d01f35ce08d47160adaa095a6149f branch: master author: Victor Stinner committer: GitHub date: 2020-04-13T11:38:42+02:00 summary: bpo-40241: Add pycore_gc.h header file (GH-19494) Move the PyGC_Head structure and the following private macros to the internal C API: * _PyGCHead_FINALIZED() * _PyGCHead_NEXT() * _PyGCHead_PREV() * _PyGCHead_SET_FINALIZED() * _PyGCHead_SET_NEXT() * _PyGCHead_SET_PREV() * _PyGC_FINALIZED() * _PyGC_PREV_MASK * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_SHIFT * _PyGC_SET_FINALIZED() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * _Py_AS_GC(o) Keep the private _PyGC_FINALIZED() macro in the public C API for backward compatibility with Python 3.8: make it an alias to the new PyObject_GC_IsFinalized() function. Move the SIZEOF_PYGC_HEAD constant from _testcapi module to _testinternalcapi module. files: A Include/internal/pycore_gc.h A Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst M Include/cpython/objimpl.h M Include/internal/pycore_pymem.h M Lib/test/support/__init__.py M Lib/test/test_sys.py M Modules/_testcapimodule.c M Modules/_testinternalcapi.c diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h index 832622cb61921..6634f29c8c873 100644 --- a/Include/cpython/objimpl.h +++ b/Include/cpython/objimpl.h @@ -125,61 +125,12 @@ PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); (PyType_IS_GC(Py_TYPE(o)) \ && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) -/* GC information is stored BEFORE the object structure. */ -typedef struct { - // Pointer to next object in the list. - // 0 means the object is not tracked - uintptr_t _gc_next; - - // Pointer to previous object in the list. - // Lowest two bits are used for flags documented later. - uintptr_t _gc_prev; -} PyGC_Head; - -#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) - -/* True if the object is currently tracked by the GC. */ -#define _PyObject_GC_IS_TRACKED(o) (_Py_AS_GC(o)->_gc_next != 0) - -/* True if the object may be tracked by the GC in the future, or already is. - This can be useful to implement some optimizations. */ -#define _PyObject_GC_MAY_BE_TRACKED(obj) \ - (PyObject_IS_GC(obj) && \ - (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) - - -/* Bit flags for _gc_prev */ -/* Bit 0 is set when tp_finalize is called */ -#define _PyGC_PREV_MASK_FINALIZED (1) -/* Bit 1 is set when the object is in generation which is GCed currently. */ -#define _PyGC_PREV_MASK_COLLECTING (2) -/* The (N-2) most significant bits contain the real address. */ -#define _PyGC_PREV_SHIFT (2) -#define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT) - -// Lowest bit of _gc_next is used for flags only in GC. -// But it is always 0 for normal code. -#define _PyGCHead_NEXT(g) ((PyGC_Head*)(g)->_gc_next) -#define _PyGCHead_SET_NEXT(g, p) ((g)->_gc_next = (uintptr_t)(p)) - -// Lowest two bits of _gc_prev is used for _PyGC_PREV_MASK_* flags. -#define _PyGCHead_PREV(g) ((PyGC_Head*)((g)->_gc_prev & _PyGC_PREV_MASK)) -#define _PyGCHead_SET_PREV(g, p) do { \ - assert(((uintptr_t)p & ~_PyGC_PREV_MASK) == 0); \ - (g)->_gc_prev = ((g)->_gc_prev & ~_PyGC_PREV_MASK) \ - | ((uintptr_t)(p)); \ - } while (0) - -#define _PyGCHead_FINALIZED(g) \ - (((g)->_gc_prev & _PyGC_PREV_MASK_FINALIZED) != 0) -#define _PyGCHead_SET_FINALIZED(g) \ - ((g)->_gc_prev |= _PyGC_PREV_MASK_FINALIZED) - -#define _PyGC_FINALIZED(o) \ - _PyGCHead_FINALIZED(_Py_AS_GC(o)) -#define _PyGC_SET_FINALIZED(o) \ - _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) - +/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which + defines a different _PyGC_FINALIZED() macro. */ +#ifndef Py_BUILD_CORE + // Kept for backward compatibility with Python 3.8 +# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o) +#endif PyAPI_FUNC(PyObject *) _PyObject_GC_Malloc(size_t size); PyAPI_FUNC(PyObject *) _PyObject_GC_Calloc(size_t size); diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h new file mode 100644 index 0000000000000..7309205ed1229 --- /dev/null +++ b/Include/internal/pycore_gc.h @@ -0,0 +1,69 @@ +#ifndef Py_INTERNAL_GC_H +#define Py_INTERNAL_GC_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +/* GC information is stored BEFORE the object structure. */ +typedef struct { + // Pointer to next object in the list. + // 0 means the object is not tracked + uintptr_t _gc_next; + + // Pointer to previous object in the list. + // Lowest two bits are used for flags documented later. + uintptr_t _gc_prev; +} PyGC_Head; + +#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1) + +/* True if the object is currently tracked by the GC. */ +#define _PyObject_GC_IS_TRACKED(o) (_Py_AS_GC(o)->_gc_next != 0) + +/* True if the object may be tracked by the GC in the future, or already is. + This can be useful to implement some optimizations. */ +#define _PyObject_GC_MAY_BE_TRACKED(obj) \ + (PyObject_IS_GC(obj) && \ + (!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj))) + + +/* Bit flags for _gc_prev */ +/* Bit 0 is set when tp_finalize is called */ +#define _PyGC_PREV_MASK_FINALIZED (1) +/* Bit 1 is set when the object is in generation which is GCed currently. */ +#define _PyGC_PREV_MASK_COLLECTING (2) +/* The (N-2) most significant bits contain the real address. */ +#define _PyGC_PREV_SHIFT (2) +#define _PyGC_PREV_MASK (((uintptr_t) -1) << _PyGC_PREV_SHIFT) + +// Lowest bit of _gc_next is used for flags only in GC. +// But it is always 0 for normal code. +#define _PyGCHead_NEXT(g) ((PyGC_Head*)(g)->_gc_next) +#define _PyGCHead_SET_NEXT(g, p) ((g)->_gc_next = (uintptr_t)(p)) + +// Lowest two bits of _gc_prev is used for _PyGC_PREV_MASK_* flags. +#define _PyGCHead_PREV(g) ((PyGC_Head*)((g)->_gc_prev & _PyGC_PREV_MASK)) +#define _PyGCHead_SET_PREV(g, p) do { \ + assert(((uintptr_t)p & ~_PyGC_PREV_MASK) == 0); \ + (g)->_gc_prev = ((g)->_gc_prev & ~_PyGC_PREV_MASK) \ + | ((uintptr_t)(p)); \ + } while (0) + +#define _PyGCHead_FINALIZED(g) \ + (((g)->_gc_prev & _PyGC_PREV_MASK_FINALIZED) != 0) +#define _PyGCHead_SET_FINALIZED(g) \ + ((g)->_gc_prev |= _PyGC_PREV_MASK_FINALIZED) + +#define _PyGC_FINALIZED(o) \ + _PyGCHead_FINALIZED(_Py_AS_GC(o)) +#define _PyGC_SET_FINALIZED(o) \ + _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_GC_H */ diff --git a/Include/internal/pycore_pymem.h b/Include/internal/pycore_pymem.h index db153e0bd2d71..34a17d5ae0979 100644 --- a/Include/internal/pycore_pymem.h +++ b/Include/internal/pycore_pymem.h @@ -8,7 +8,8 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pymem.h" /* PyMemAllocatorName */ +#include "pymem.h" // PyMemAllocatorName +#include "pycore_gc.h" // PyGC_Head /* GC runtime state */ diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 1f792d8514da0..9f43b4071c044 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1764,12 +1764,12 @@ def calcvobjsize(fmt): _TPFLAGS_HEAPTYPE = 1<<9 def check_sizeof(test, o, size): - import _testcapi + import _testinternalcapi result = sys.getsizeof(o) # add GC header size if ((type(o) == type) and (o.__flags__ & _TPFLAGS_HEAPTYPE) or\ ((type(o) != type) and (type(o).__flags__ & _TPFLAGS_HAVE_GC))): - size += _testcapi.SIZEOF_PYGC_HEAD + size += _testinternalcapi.SIZEOF_PYGC_HEAD msg = 'wrong size for %s: got %d, expected %d' \ % (type(o), result, size) test.assertEqual(result, size, msg) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 395725857b7c0..329f7ddeb2c57 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1056,8 +1056,8 @@ class SizeofTest(unittest.TestCase): def setUp(self): self.P = struct.calcsize('P') self.longdigit = sys.int_info.sizeof_digit - import _testcapi - self.gc_headsize = _testcapi.SIZEOF_PYGC_HEAD + import _testinternalcapi + self.gc_headsize = _testinternalcapi.SIZEOF_PYGC_HEAD check_sizeof = test.support.check_sizeof diff --git a/Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst b/Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst new file mode 100644 index 0000000000000..b3e4aafe992df --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst @@ -0,0 +1 @@ +Move the :c:type:`PyGC_Head` structure to the internal C API. diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 0a30fea9e8747..c97cbe8355197 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -6716,7 +6716,6 @@ PyInit__testcapi(void) PyModule_AddObject(m, "ULLONG_MAX", PyLong_FromUnsignedLongLong(ULLONG_MAX)); PyModule_AddObject(m, "PY_SSIZE_T_MAX", PyLong_FromSsize_t(PY_SSIZE_T_MAX)); PyModule_AddObject(m, "PY_SSIZE_T_MIN", PyLong_FromSsize_t(PY_SSIZE_T_MIN)); - PyModule_AddObject(m, "SIZEOF_PYGC_HEAD", PyLong_FromSsize_t(sizeof(PyGC_Head))); PyModule_AddObject(m, "SIZEOF_TIME_T", PyLong_FromSsize_t(sizeof(time_t))); Py_INCREF(&PyInstanceMethod_Type); PyModule_AddObject(m, "instancemethod", (PyObject *)&PyInstanceMethod_Type); diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 394b870e90780..8352f6e2590c5 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -10,6 +10,7 @@ #include "Python.h" #include "pycore_initconfig.h" // _Py_GetConfigsAsDict() +#include "pycore_gc.h" // PyGC_Head static PyObject * @@ -52,5 +53,19 @@ static struct PyModuleDef _testcapimodule = { PyMODINIT_FUNC PyInit__testinternalcapi(void) { - return PyModule_Create(&_testcapimodule); + PyObject *module = PyModule_Create(&_testcapimodule); + if (module == NULL) { + return NULL; + } + + if (PyModule_AddObject(module, "SIZEOF_PYGC_HEAD", + PyLong_FromSsize_t(sizeof(PyGC_Head))) < 0) { + goto error; + } + + return module; + +error: + Py_DECREF(module); + return NULL; } From webhook-mailer at python.org Mon Apr 13 05:45:25 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 13 Apr 2020 09:45:25 -0000 Subject: [Python-checkins] bpo-40268: Add pycore_runtime.h header file (GH-19493) Message-ID: https://github.com/python/cpython/commit/1c4cbdf94dbb4a6ac1093d2fa7a75efa802b25bc commit: 1c4cbdf94dbb4a6ac1093d2fa7a75efa802b25bc branch: master author: Victor Stinner committer: GitHub date: 2020-04-13T11:45:21+02:00 summary: bpo-40268: Add pycore_runtime.h header file (GH-19493) Move PyRuntimeState from pycore_pystate.h to pycore_runtime.h. Remove _PyGILState_check_enabled macro: access directly _PyRuntime.gilstate.check_enabled. files: A Include/internal/pycore_runtime.h M Include/internal/pycore_pystate.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M Python/pylifecycle.c M Python/pystate.c diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index c28df89b5a3af..c9275a74cd1f1 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -11,6 +11,7 @@ extern "C" { #include "pycore_gil.h" /* struct _gil_runtime_state */ #include "pycore_pymem.h" /* struct _gc_runtime_state */ #include "pycore_warnings.h" /* struct _warnings_runtime_state */ +#include "pycore_runtime.h" /* PyRuntimestate */ /* ceval state */ @@ -32,15 +33,6 @@ struct _pending_calls { int last; }; -struct _ceval_runtime_state { - int recursion_limit; - /* Request for dropping the GIL */ - _Py_atomic_int gil_drop_request; - /* Request for checking signals. */ - _Py_atomic_int signals_pending; - struct _gil_runtime_state gil; -}; - struct _ceval_state { /* Records whether tracing is on for any thread. Counts the number of threads for which tstate->c_tracefunc is non-NULL, so if the @@ -176,118 +168,6 @@ struct _xidregitem { struct _xidregitem *next; }; -/* runtime audit hook state */ - -typedef struct _Py_AuditHookEntry { - struct _Py_AuditHookEntry *next; - Py_AuditHookFunction hookCFunction; - void *userData; -} _Py_AuditHookEntry; - -/* GIL state */ - -struct _gilstate_runtime_state { - int check_enabled; - /* Assuming the current thread holds the GIL, this is the - PyThreadState for the current thread. */ - _Py_atomic_address tstate_current; - /* The single PyInterpreterState used by this process' - GILState implementation - */ - /* TODO: Given interp_main, it may be possible to kill this ref */ - PyInterpreterState *autoInterpreterState; - Py_tss_t autoTSSkey; -}; - -/* Issue #26558: Flag to disable PyGILState_Check(). - If set to non-zero, PyGILState_Check() always return 1. */ -#define _PyGILState_check_enabled _PyRuntime.gilstate.check_enabled - - -/* Full Python runtime state */ - -typedef struct pyruntimestate { - /* Is running Py_PreInitialize()? */ - int preinitializing; - - /* Is Python preinitialized? Set to 1 by Py_PreInitialize() */ - int preinitialized; - - /* Is Python core initialized? Set to 1 by _Py_InitializeCore() */ - int core_initialized; - - /* Is Python fully initialized? Set to 1 by Py_Initialize() */ - int initialized; - - /* Set by Py_FinalizeEx(). Only reset to NULL if Py_Initialize() - is called again. - - Use _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing() - to access it, don't access it directly. */ - _Py_atomic_address _finalizing; - - struct pyinterpreters { - PyThread_type_lock mutex; - PyInterpreterState *head; - PyInterpreterState *main; - /* _next_interp_id is an auto-numbered sequence of small - integers. It gets initialized in _PyInterpreterState_Init(), - which is called in Py_Initialize(), and used in - PyInterpreterState_New(). A negative interpreter ID - indicates an error occurred. The main interpreter will - always have an ID of 0. Overflow results in a RuntimeError. - If that becomes a problem later then we can adjust, e.g. by - using a Python int. */ - int64_t next_id; - } interpreters; - // XXX Remove this field once we have a tp_* slot. - struct _xidregistry { - PyThread_type_lock mutex; - struct _xidregitem *head; - } xidregistry; - - unsigned long main_thread; - -#define NEXITFUNCS 32 - void (*exitfuncs[NEXITFUNCS])(void); - int nexitfuncs; - - struct _ceval_runtime_state ceval; - struct _gilstate_runtime_state gilstate; - - PyPreConfig preconfig; - - Py_OpenCodeHookFunction open_code_hook; - void *open_code_userdata; - _Py_AuditHookEntry *audit_hook_head; - - // XXX Consolidate globals found via the check-c-globals script. -} _PyRuntimeState; - -#define _PyRuntimeState_INIT \ - {.preinitialized = 0, .core_initialized = 0, .initialized = 0} -/* Note: _PyRuntimeState_INIT sets other fields to 0/NULL */ - -PyAPI_DATA(_PyRuntimeState) _PyRuntime; -PyAPI_FUNC(PyStatus) _PyRuntimeState_Init(_PyRuntimeState *runtime); -PyAPI_FUNC(void) _PyRuntimeState_Fini(_PyRuntimeState *runtime); -PyAPI_FUNC(void) _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime); - -/* Initialize _PyRuntimeState. - Return NULL on success, or return an error message on failure. */ -PyAPI_FUNC(PyStatus) _PyRuntime_Initialize(void); - -PyAPI_FUNC(void) _PyRuntime_Finalize(void); - -static inline PyThreadState* -_PyRuntimeState_GetFinalizing(_PyRuntimeState *runtime) { - return (PyThreadState*)_Py_atomic_load_relaxed(&runtime->_finalizing); -} - -static inline void -_PyRuntimeState_SetFinalizing(_PyRuntimeState *runtime, PyThreadState *tstate) { - _Py_atomic_store_relaxed(&runtime->_finalizing, (uintptr_t)tstate); -} /* Check if the current thread is the main thread. Use _Py_IsMainInterpreter() to check if it's the main interpreter. */ diff --git a/Include/internal/pycore_runtime.h b/Include/internal/pycore_runtime.h new file mode 100644 index 0000000000000..54dbaeb77c73f --- /dev/null +++ b/Include/internal/pycore_runtime.h @@ -0,0 +1,143 @@ +#ifndef Py_INTERNAL_RUNTIME_H +#define Py_INTERNAL_RUNTIME_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_atomic.h" /* _Py_atomic_address */ +#include "pycore_gil.h" // struct _gil_runtime_state + +/* ceval state */ + +struct _ceval_runtime_state { + int recursion_limit; + /* Request for dropping the GIL */ + _Py_atomic_int gil_drop_request; + /* Request for checking signals. */ + _Py_atomic_int signals_pending; + struct _gil_runtime_state gil; +}; + +/* GIL state */ + +struct _gilstate_runtime_state { + /* bpo-26558: Flag to disable PyGILState_Check(). + If set to non-zero, PyGILState_Check() always return 1. */ + int check_enabled; + /* Assuming the current thread holds the GIL, this is the + PyThreadState for the current thread. */ + _Py_atomic_address tstate_current; + /* The single PyInterpreterState used by this process' + GILState implementation + */ + /* TODO: Given interp_main, it may be possible to kill this ref */ + PyInterpreterState *autoInterpreterState; + Py_tss_t autoTSSkey; +}; + +/* Runtime audit hook state */ + +typedef struct _Py_AuditHookEntry { + struct _Py_AuditHookEntry *next; + Py_AuditHookFunction hookCFunction; + void *userData; +} _Py_AuditHookEntry; + +/* Full Python runtime state */ + +typedef struct pyruntimestate { + /* Is running Py_PreInitialize()? */ + int preinitializing; + + /* Is Python preinitialized? Set to 1 by Py_PreInitialize() */ + int preinitialized; + + /* Is Python core initialized? Set to 1 by _Py_InitializeCore() */ + int core_initialized; + + /* Is Python fully initialized? Set to 1 by Py_Initialize() */ + int initialized; + + /* Set by Py_FinalizeEx(). Only reset to NULL if Py_Initialize() + is called again. + + Use _PyRuntimeState_GetFinalizing() and _PyRuntimeState_SetFinalizing() + to access it, don't access it directly. */ + _Py_atomic_address _finalizing; + + struct pyinterpreters { + PyThread_type_lock mutex; + PyInterpreterState *head; + PyInterpreterState *main; + /* _next_interp_id is an auto-numbered sequence of small + integers. It gets initialized in _PyInterpreterState_Init(), + which is called in Py_Initialize(), and used in + PyInterpreterState_New(). A negative interpreter ID + indicates an error occurred. The main interpreter will + always have an ID of 0. Overflow results in a RuntimeError. + If that becomes a problem later then we can adjust, e.g. by + using a Python int. */ + int64_t next_id; + } interpreters; + // XXX Remove this field once we have a tp_* slot. + struct _xidregistry { + PyThread_type_lock mutex; + struct _xidregitem *head; + } xidregistry; + + unsigned long main_thread; + +#define NEXITFUNCS 32 + void (*exitfuncs[NEXITFUNCS])(void); + int nexitfuncs; + + struct _ceval_runtime_state ceval; + struct _gilstate_runtime_state gilstate; + + PyPreConfig preconfig; + + Py_OpenCodeHookFunction open_code_hook; + void *open_code_userdata; + _Py_AuditHookEntry *audit_hook_head; + + // XXX Consolidate globals found via the check-c-globals script. +} _PyRuntimeState; + +#define _PyRuntimeState_INIT \ + {.preinitialized = 0, .core_initialized = 0, .initialized = 0} +/* Note: _PyRuntimeState_INIT sets other fields to 0/NULL */ + + +PyAPI_DATA(_PyRuntimeState) _PyRuntime; + +PyAPI_FUNC(PyStatus) _PyRuntimeState_Init(_PyRuntimeState *runtime); +PyAPI_FUNC(void) _PyRuntimeState_Fini(_PyRuntimeState *runtime); + +PyAPI_FUNC(void) _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime); + + +/* Initialize _PyRuntimeState. + Return NULL on success, or return an error message on failure. */ +PyAPI_FUNC(PyStatus) _PyRuntime_Initialize(void); + +PyAPI_FUNC(void) _PyRuntime_Finalize(void); + + +static inline PyThreadState* +_PyRuntimeState_GetFinalizing(_PyRuntimeState *runtime) { + return (PyThreadState*)_Py_atomic_load_relaxed(&runtime->_finalizing); +} + +static inline void +_PyRuntimeState_SetFinalizing(_PyRuntimeState *runtime, PyThreadState *tstate) { + _Py_atomic_store_relaxed(&runtime->_finalizing, (uintptr_t)tstate); +} + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_RUNTIME_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index ac6c2b1288965..45e7a836affbb 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1103,6 +1103,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_pylifecycle.h \ $(srcdir)/Include/internal/pycore_pymem.h \ $(srcdir)/Include/internal/pycore_pystate.h \ + $(srcdir)/Include/internal/pycore_runtime.h \ $(srcdir)/Include/internal/pycore_sysmodule.h \ $(srcdir)/Include/internal/pycore_traceback.h \ $(srcdir)/Include/internal/pycore_tupleobject.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 95f9e9b445fa9..df0eb3af9dc44 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -184,6 +184,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 32da3659d341f..8c605c8d72019 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -255,6 +255,9 @@ Include + + Include + Include diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 1bc7d77d35227..c2a078163a316 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1553,7 +1553,7 @@ new_interpreter(PyThreadState **tstate_p) /* Issue #10915, #15751: The GIL API doesn't work with multiple interpreters: disable PyGILState_Check(). */ - _PyGILState_check_enabled = 0; + runtime->gilstate.check_enabled = 0; PyInterpreterState *interp = PyInterpreterState_New(); if (interp == NULL) { diff --git a/Python/pystate.c b/Python/pystate.c index 19beaf05eb118..3636dc9c047f5 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1329,12 +1329,11 @@ PyGILState_GetThisThreadState(void) int PyGILState_Check(void) { - - if (!_PyGILState_check_enabled) { + struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; + if (!gilstate->check_enabled) { return 1; } - struct _gilstate_runtime_state *gilstate = &_PyRuntime.gilstate; if (!PyThread_tss_is_created(&gilstate->autoTSSkey)) { return 1; } From webhook-mailer at python.org Mon Apr 13 06:47:22 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 13 Apr 2020 10:47:22 -0000 Subject: [Python-checkins] bpo-40241: Add pycore_interp.h header (GH-19499) Message-ID: https://github.com/python/cpython/commit/0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac commit: 0c13e1f96a9487e0efe63c3d3a05ff9738bd7dac branch: master author: Victor Stinner committer: GitHub date: 2020-04-13T12:47:17+02:00 summary: bpo-40241: Add pycore_interp.h header (GH-19499) Move PyInterpreterState and related functions to a new internal pycore_interp.h header file. files: A Include/internal/pycore_interp.h M Include/internal/pycore_pystate.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h new file mode 100644 index 0000000000000..d720829f3f295 --- /dev/null +++ b/Include/internal/pycore_interp.h @@ -0,0 +1,183 @@ +#ifndef Py_INTERNAL_INTERP_H +#define Py_INTERNAL_INTERP_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_atomic.h" /* _Py_atomic_address */ +#include "pycore_gil.h" /* struct _gil_runtime_state */ +#include "pycore_pymem.h" /* struct _gc_runtime_state */ +#include "pycore_warnings.h" /* struct _warnings_runtime_state */ + +/* ceval state */ + +struct _pending_calls { + PyThread_type_lock lock; + /* Request for running pending calls. */ + _Py_atomic_int calls_to_do; + /* Request for looking at the `async_exc` field of the current + thread state. + Guarded by the GIL. */ + int async_exc; +#define NPENDINGCALLS 32 + struct { + int (*func)(void *); + void *arg; + } calls[NPENDINGCALLS]; + int first; + int last; +}; + +struct _ceval_state { + /* Records whether tracing is on for any thread. Counts the number + of threads for which tstate->c_tracefunc is non-NULL, so if the + value is 0, we know we don't have to check this thread's + c_tracefunc. This speeds up the if statement in + _PyEval_EvalFrameDefault() after fast_next_opcode. */ + int tracing_possible; + /* This single variable consolidates all requests to break out of + the fast path in the eval loop. */ + _Py_atomic_int eval_breaker; + struct _pending_calls pending; +}; + + +/* interpreter state */ + +#define _PY_NSMALLPOSINTS 257 +#define _PY_NSMALLNEGINTS 5 + +// The PyInterpreterState typedef is in Include/pystate.h. +struct _is { + + struct _is *next; + struct _ts *tstate_head; + + /* Reference to the _PyRuntime global variable. This field exists + to not have to pass runtime in addition to tstate to a function. + Get runtime from tstate: tstate->interp->runtime. */ + struct pyruntimestate *runtime; + + int64_t id; + int64_t id_refcount; + int requires_idref; + PyThread_type_lock id_mutex; + + int finalizing; + + struct _ceval_state ceval; + struct _gc_runtime_state gc; + + PyObject *modules; + PyObject *modules_by_index; + PyObject *sysdict; + PyObject *builtins; + PyObject *importlib; + + /* Used in Modules/_threadmodule.c. */ + long num_threads; + /* Support for runtime thread stack size tuning. + A value of 0 means using the platform's default stack size + or the size specified by the THREAD_STACK_SIZE macro. */ + /* Used in Python/thread.c. */ + size_t pythread_stacksize; + + PyObject *codec_search_path; + PyObject *codec_search_cache; + PyObject *codec_error_registry; + int codecs_initialized; + + /* fs_codec.encoding is initialized to NULL. + Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */ + struct { + char *encoding; /* Filesystem encoding (encoded to UTF-8) */ + int utf8; /* encoding=="utf-8"? */ + char *errors; /* Filesystem errors (encoded to UTF-8) */ + _Py_error_handler error_handler; + } fs_codec; + + PyConfig config; +#ifdef HAVE_DLOPEN + int dlopenflags; +#endif + + PyObject *dict; /* Stores per-interpreter state */ + + PyObject *builtins_copy; + PyObject *import_func; + /* Initialized to PyEval_EvalFrameDefault(). */ + _PyFrameEvalFunction eval_frame; + + Py_ssize_t co_extra_user_count; + freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; + +#ifdef HAVE_FORK + PyObject *before_forkers; + PyObject *after_forkers_parent; + PyObject *after_forkers_child; +#endif + /* AtExit module */ + void (*pyexitfunc)(PyObject *); + PyObject *pyexitmodule; + + uint64_t tstate_next_unique_id; + + struct _warnings_runtime_state warnings; + + PyObject *audit_hooks; + + struct { + struct { + int level; + int atbol; + } listnode; + } parser; + +#if _PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS > 0 + /* Small integers are preallocated in this array so that they + can be shared. + The integers that are preallocated are those in the range + -_PY_NSMALLNEGINTS (inclusive) to _PY_NSMALLPOSINTS (not inclusive). + */ + PyLongObject* small_ints[_PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS]; +#endif +}; + +/* Used by _PyImport_Cleanup() */ +extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); + +extern PyStatus _PyInterpreterState_SetConfig( + PyInterpreterState *interp, + const PyConfig *config); + + + +/* cross-interpreter data registry */ + +/* For now we use a global registry of shareable classes. An + alternative would be to add a tp_* slot for a class's + crossinterpdatafunc. It would be simpler and more efficient. */ + +struct _xidregitem; + +struct _xidregitem { + PyTypeObject *cls; + crossinterpdatafunc getdata; + struct _xidregitem *next; +}; + +PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(PY_INT64_T); + +PyAPI_FUNC(int) _PyInterpreterState_IDInitref(struct _is *); +PyAPI_FUNC(void) _PyInterpreterState_IDIncref(struct _is *); +PyAPI_FUNC(void) _PyInterpreterState_IDDecref(struct _is *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_INTERP_H */ + diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index c9275a74cd1f1..748aa63a43063 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -8,167 +8,10 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_gil.h" /* struct _gil_runtime_state */ -#include "pycore_pymem.h" /* struct _gc_runtime_state */ -#include "pycore_warnings.h" /* struct _warnings_runtime_state */ +#include "pycore_interp.h" /* PyInterpreterState */ #include "pycore_runtime.h" /* PyRuntimestate */ -/* ceval state */ - -struct _pending_calls { - PyThread_type_lock lock; - /* Request for running pending calls. */ - _Py_atomic_int calls_to_do; - /* Request for looking at the `async_exc` field of the current - thread state. - Guarded by the GIL. */ - int async_exc; -#define NPENDINGCALLS 32 - struct { - int (*func)(void *); - void *arg; - } calls[NPENDINGCALLS]; - int first; - int last; -}; - -struct _ceval_state { - /* Records whether tracing is on for any thread. Counts the number - of threads for which tstate->c_tracefunc is non-NULL, so if the - value is 0, we know we don't have to check this thread's - c_tracefunc. This speeds up the if statement in - _PyEval_EvalFrameDefault() after fast_next_opcode. */ - int tracing_possible; - /* This single variable consolidates all requests to break out of - the fast path in the eval loop. */ - _Py_atomic_int eval_breaker; - struct _pending_calls pending; -}; - -/* interpreter state */ - -#define _PY_NSMALLPOSINTS 257 -#define _PY_NSMALLNEGINTS 5 - -// The PyInterpreterState typedef is in Include/pystate.h. -struct _is { - - struct _is *next; - struct _ts *tstate_head; - - /* Reference to the _PyRuntime global variable. This field exists - to not have to pass runtime in addition to tstate to a function. - Get runtime from tstate: tstate->interp->runtime. */ - struct pyruntimestate *runtime; - - int64_t id; - int64_t id_refcount; - int requires_idref; - PyThread_type_lock id_mutex; - - int finalizing; - - struct _ceval_state ceval; - struct _gc_runtime_state gc; - - PyObject *modules; - PyObject *modules_by_index; - PyObject *sysdict; - PyObject *builtins; - PyObject *importlib; - - /* Used in Modules/_threadmodule.c. */ - long num_threads; - /* Support for runtime thread stack size tuning. - A value of 0 means using the platform's default stack size - or the size specified by the THREAD_STACK_SIZE macro. */ - /* Used in Python/thread.c. */ - size_t pythread_stacksize; - - PyObject *codec_search_path; - PyObject *codec_search_cache; - PyObject *codec_error_registry; - int codecs_initialized; - - /* fs_codec.encoding is initialized to NULL. - Later, it is set to a non-NULL string by _PyUnicode_InitEncodings(). */ - struct { - char *encoding; /* Filesystem encoding (encoded to UTF-8) */ - int utf8; /* encoding=="utf-8"? */ - char *errors; /* Filesystem errors (encoded to UTF-8) */ - _Py_error_handler error_handler; - } fs_codec; - - PyConfig config; -#ifdef HAVE_DLOPEN - int dlopenflags; -#endif - - PyObject *dict; /* Stores per-interpreter state */ - - PyObject *builtins_copy; - PyObject *import_func; - /* Initialized to PyEval_EvalFrameDefault(). */ - _PyFrameEvalFunction eval_frame; - - Py_ssize_t co_extra_user_count; - freefunc co_extra_freefuncs[MAX_CO_EXTRA_USERS]; - -#ifdef HAVE_FORK - PyObject *before_forkers; - PyObject *after_forkers_parent; - PyObject *after_forkers_child; -#endif - /* AtExit module */ - void (*pyexitfunc)(PyObject *); - PyObject *pyexitmodule; - - uint64_t tstate_next_unique_id; - - struct _warnings_runtime_state warnings; - - PyObject *audit_hooks; - - struct { - struct { - int level; - int atbol; - } listnode; - } parser; - -#if _PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS > 0 - /* Small integers are preallocated in this array so that they - can be shared. - The integers that are preallocated are those in the range - -_PY_NSMALLNEGINTS (inclusive) to _PY_NSMALLPOSINTS (not inclusive). - */ - PyLongObject* small_ints[_PY_NSMALLNEGINTS + _PY_NSMALLPOSINTS]; -#endif -}; - -PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(PY_INT64_T); - -PyAPI_FUNC(int) _PyInterpreterState_IDInitref(struct _is *); -PyAPI_FUNC(void) _PyInterpreterState_IDIncref(struct _is *); -PyAPI_FUNC(void) _PyInterpreterState_IDDecref(struct _is *); - - -/* cross-interpreter data registry */ - -/* For now we use a global registry of shareable classes. An - alternative would be to add a tp_* slot for a class's - crossinterpdatafunc. It would be simpler and more efficient. */ - -struct _xidregitem; - -struct _xidregitem { - PyTypeObject *cls; - crossinterpdatafunc getdata; - struct _xidregitem *next; -}; - - /* Check if the current thread is the main thread. Use _Py_IsMainInterpreter() to check if it's the main interpreter. */ static inline int @@ -257,13 +100,6 @@ PyAPI_FUNC(PyThreadState *) _PyThreadState_Swap( PyAPI_FUNC(PyStatus) _PyInterpreterState_Enable(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime); -/* Used by _PyImport_Cleanup() */ -extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); - -extern PyStatus _PyInterpreterState_SetConfig( - PyInterpreterState *interp, - const PyConfig *config); - PyAPI_FUNC(void) _PyGILState_Reinit(_PyRuntimeState *runtime); diff --git a/Makefile.pre.in b/Makefile.pre.in index 45e7a836affbb..6b265226c4966 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1096,6 +1096,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_hamt.h \ $(srcdir)/Include/internal/pycore_import.h \ $(srcdir)/Include/internal/pycore_initconfig.h \ + $(srcdir)/Include/internal/pycore_interp.h \ $(srcdir)/Include/internal/pycore_object.h \ $(srcdir)/Include/internal/pycore_pathconfig.h \ $(srcdir)/Include/internal/pycore_pyerrors.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index df0eb3af9dc44..c35499e0eb772 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -177,6 +177,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 8c605c8d72019..c04df27de5860 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -234,6 +234,9 @@ Include + + Include + Include From webhook-mailer at python.org Mon Apr 13 18:00:32 2020 From: webhook-mailer at python.org (Chih-Hsuan Yen) Date: Mon, 13 Apr 2020 22:00:32 -0000 Subject: [Python-checkins] bpo-39481: fix test_genericalias on Android (GH-19469) Message-ID: https://github.com/python/cpython/commit/25a6833f7945f14cad83509ec73954d0ad70bdb1 commit: 25a6833f7945f14cad83509ec73954d0ad70bdb1 branch: master author: Chih-Hsuan Yen committer: GitHub date: 2020-04-13T15:00:16-07:00 summary: bpo-39481: fix test_genericalias on Android (GH-19469) Android bionic does not implement shm_open/shm_unlink [1]. As a result _posixshmem extension does not exist and multiprocessing.shared_memory cannot be imported. [1] https://android.googlesource.com/platform/bionic/+/master/docs/status.md files: M Lib/test/test_genericalias.py diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index a00899f5267d7..02b72838277e9 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -19,7 +19,11 @@ from http.cookies import Morsel from multiprocessing.managers import ValueProxy from multiprocessing.pool import ApplyResult -from multiprocessing.shared_memory import ShareableList +try: + from multiprocessing.shared_memory import ShareableList +except ImportError: + # multiprocessing.shared_memory is not available on e.g. Android + ShareableList = None from multiprocessing.queues import SimpleQueue from os import DirEntry from re import Pattern, Match @@ -71,6 +75,8 @@ def test_subscriptable(self): Future, _WorkItem, Morsel, ): + if t is None: + continue tname = t.__name__ with self.subTest(f"Testing {tname}"): alias = t[int] From webhook-mailer at python.org Mon Apr 13 18:25:41 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 13 Apr 2020 22:25:41 -0000 Subject: [Python-checkins] bpo-40091: Fix a hang at fork in the logging module (GH-19416) Message-ID: https://github.com/python/cpython/commit/4c3da783cffb8471303fbae3e09f3d67b31c3d06 commit: 4c3da783cffb8471303fbae3e09f3d67b31c3d06 branch: master author: Victor Stinner committer: GitHub date: 2020-04-14T00:25:34+02:00 summary: bpo-40091: Fix a hang at fork in the logging module (GH-19416) Fix a hang at fork in the logging module: the new private _at_fork_reinit() method is now used to reinitialize locks at fork in the child process. The createLock() method is no longer used at fork. files: A Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst M Lib/logging/__init__.py diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 59d5fa5b64d22..84a177559908a 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -234,11 +234,9 @@ def _releaseLock(): def _register_at_fork_reinit_lock(instance): pass # no-op when os.register_at_fork does not exist. else: - # A collection of instances with a createLock method (logging.Handler) + # A collection of instances with a _at_fork_reinit method (logging.Handler) # to be called in the child after forking. The weakref avoids us keeping - # discarded Handler instances alive. A set is used to avoid accumulating - # duplicate registrations as createLock() is responsible for registering - # a new Handler instance with this set in the first place. + # discarded Handler instances alive. _at_fork_reinit_lock_weakset = weakref.WeakSet() def _register_at_fork_reinit_lock(instance): @@ -249,16 +247,12 @@ def _register_at_fork_reinit_lock(instance): _releaseLock() def _after_at_fork_child_reinit_locks(): - # _acquireLock() was called in the parent before forking. for handler in _at_fork_reinit_lock_weakset: - try: - handler.createLock() - except Exception as err: - # Similar to what PyErr_WriteUnraisable does. - print("Ignoring exception from logging atfork", instance, - "._reinit_lock() method:", err, file=sys.stderr) - _releaseLock() # Acquired by os.register_at_fork(before=. + handler._at_fork_reinit() + # _acquireLock() was called in the parent before forking. + # The lock is reinitialized to unlocked state. + _lock._at_fork_reinit() os.register_at_fork(before=_acquireLock, after_in_child=_after_at_fork_child_reinit_locks, @@ -891,6 +885,9 @@ def createLock(self): self.lock = threading.RLock() _register_at_fork_reinit_lock(self) + def _at_fork_reinit(self): + self.lock._at_fork_reinit() + def acquire(self): """ Acquire the I/O thread lock. @@ -2168,6 +2165,9 @@ def emit(self, record): def createLock(self): self.lock = None + def _at_fork_reinit(self): + pass + # Warnings integration _warnings_showwarning = None diff --git a/Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst b/Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst new file mode 100644 index 0000000000000..4a98aa50f2371 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst @@ -0,0 +1,2 @@ +Fix a hang at fork in the logging module: the new private _at_fork_reinit() +method is now used to reinitialize locks at fork in the child process. From webhook-mailer at python.org Mon Apr 13 19:08:04 2020 From: webhook-mailer at python.org (Sebastian Pedersen) Date: Mon, 13 Apr 2020 23:08:04 -0000 Subject: [Python-checkins] bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048) Message-ID: https://github.com/python/cpython/commit/a1a0eb4a394a5ac7a8422616ce1ee4125a3ef74f commit: a1a0eb4a394a5ac7a8422616ce1ee4125a3ef74f branch: master author: Sebastian Pedersen <31063917+SebastianGPedersen at users.noreply.github.com> committer: GitHub date: 2020-04-14T01:07:56+02:00 summary: bpo-39380: Change ftplib encoding from latin-1 to utf-8 (GH-18048) Add the encoding in ftplib.FTP and ftplib.FTP_TLS to the constructor as keyword-only and change the default from "latin-1" to "utf-8" to follow RFC 2640. files: A Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst M Doc/library/ftplib.rst M Doc/whatsnew/3.9.rst M Lib/ftplib.py M Lib/test/test_ftplib.py diff --git a/Doc/library/ftplib.rst b/Doc/library/ftplib.rst index a4bb695a9ab10..f4d4cdf9ada9d 100644 --- a/Doc/library/ftplib.rst +++ b/Doc/library/ftplib.rst @@ -19,6 +19,8 @@ as mirroring other FTP servers. It is also used by the module :mod:`urllib.request` to handle URLs that use FTP. For more information on FTP (File Transfer Protocol), see Internet :rfc:`959`. +The default encoding is UTF-8, following :rfc:`2640`. + Here's a sample session using the :mod:`ftplib` module:: >>> from ftplib import FTP @@ -41,7 +43,7 @@ Here's a sample session using the :mod:`ftplib` module:: The module defines the following items: -.. class:: FTP(host='', user='', passwd='', acct='', timeout=None, source_address=None) +.. class:: FTP(host='', user='', passwd='', acct='', timeout=None, source_address=None, *, encoding='utf-8') Return a new instance of the :class:`FTP` class. When *host* is given, the method call ``connect(host)`` is made. When *user* is given, additionally @@ -50,7 +52,8 @@ The module defines the following items: parameter specifies a timeout in seconds for blocking operations like the connection attempt (if is not specified, the global default timeout setting will be used). *source_address* is a 2-tuple ``(host, port)`` for the socket - to bind to as its source address before connecting. + to bind to as its source address before connecting. The *encoding* parameter + specifies the encoding for directories and filenames. The :class:`FTP` class supports the :keyword:`with` statement, e.g.: @@ -74,9 +77,11 @@ The module defines the following items: .. versionchanged:: 3.9 If the *timeout* parameter is set to be zero, it will raise a - :class:`ValueError` to prevent the creation of a non-blocking socket + :class:`ValueError` to prevent the creation of a non-blocking socket. + The *encoding* parameter was added, and the default was changed from + Latin-1 to UTF-8 to follow :rfc:`2640`. -.. class:: FTP_TLS(host='', user='', passwd='', acct='', keyfile=None, certfile=None, context=None, timeout=None, source_address=None) +.. class:: FTP_TLS(host='', user='', passwd='', acct='', keyfile=None, certfile=None, context=None, timeout=None, source_address=None, *, encoding='utf-8') A :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:`4217`. @@ -110,7 +115,9 @@ The module defines the following items: .. versionchanged:: 3.9 If the *timeout* parameter is set to be zero, it will raise a - :class:`ValueError` to prevent the creation of a non-blocking socket + :class:`ValueError` to prevent the creation of a non-blocking socket. + The *encoding* parameter was added, and the default was changed from + Latin-1 to UTF-8 to follow :rfc:`2640`. Here's a sample session using the :class:`FTP_TLS` class:: @@ -259,9 +266,10 @@ followed by ``lines`` for the text version or ``binary`` for the binary version. .. method:: FTP.retrlines(cmd, callback=None) - Retrieve a file or directory listing in ASCII transfer mode. *cmd* should be - an appropriate ``RETR`` command (see :meth:`retrbinary`) or a command such as - ``LIST`` or ``NLST`` (usually just the string ``'LIST'``). + Retrieve a file or directory listing in the encoding specified by the + *encoding* parameter at initialization. + *cmd* should be an appropriate ``RETR`` command (see :meth:`retrbinary`) or + a command such as ``LIST`` or ``NLST`` (usually just the string ``'LIST'``). ``LIST`` retrieves a list of files and information about those files. ``NLST`` retrieves a list of file names. The *callback* function is called for each line with a string argument @@ -291,7 +299,7 @@ followed by ``lines`` for the text version or ``binary`` for the binary version. .. method:: FTP.storlines(cmd, fp, callback=None) - Store a file in ASCII transfer mode. *cmd* should be an appropriate + Store a file in line mode. *cmd* should be an appropriate ``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the :term:`file object` *fp* (opened in binary mode) using its :meth:`~io.IOBase.readline` method to provide the data to be stored. *callback* is an optional single @@ -309,10 +317,9 @@ followed by ``lines`` for the text version or ``binary`` for the binary version. If optional *rest* is given, a ``REST`` command is sent to the server, passing *rest* as an argument. *rest* is usually a byte offset into the requested file, telling the server to restart sending the file's bytes at the requested offset, - skipping over the initial bytes. Note however that :rfc:`959` requires only that - *rest* be a string containing characters in the printable range from ASCII code - 33 to ASCII code 126. The :meth:`transfercmd` method, therefore, converts - *rest* to a string, but no check is performed on the string's contents. If the + skipping over the initial bytes. Note however that the :meth:`transfercmd` + method converts *rest* to a string with the *encoding* parameter specified + at initialization, but no check is performed on the string's contents. If the server does not recognize the ``REST`` command, an :exc:`error_reply` exception will be raised. If this happens, simply call :meth:`transfercmd` without a *rest* argument. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 020a86958f7af..1bbcae36a1a10 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -790,6 +790,9 @@ Changes in the Python API environment variable when the :option:`-E` or :option:`-I` command line options are being used. +* The *encoding* parameter has been added to the classes :class:`ftplib.FTP` and + :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default encoding + is changed from Latin-1 to UTF-8 to follow :rfc:`2640`. CPython bytecode changes ------------------------ diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 71b3c289551fd..1f760ed1ce0bf 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -75,13 +75,14 @@ class FTP: '''An FTP client class. To create a connection, call the class using these arguments: - host, user, passwd, acct, timeout + host, user, passwd, acct, timeout, source_address, encoding The first four arguments are all strings, and have default value ''. - timeout must be numeric and defaults to None if not passed, - meaning that no timeout will be set on any ftp socket(s) + The parameter ?timeout? must be numeric and defaults to None if not + passed, meaning that no timeout will be set on any ftp socket(s). If a timeout is passed, then this is now the default timeout for all ftp socket operations for this instance. + The last parameter is the encoding of filenames, which defaults to utf-8. Then use self.connect() with optional host and port argument. @@ -102,15 +103,16 @@ class FTP: file = None welcome = None passiveserver = 1 - encoding = "latin-1" def __init__(self, host='', user='', passwd='', acct='', - timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None): + timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, + encoding='utf-8'): """Initialization method (called by class instantiation). Initialize host to localhost, port to standard ftp port. Optional arguments are host (for connect()), and user, passwd, acct (for login()). """ + self.encoding = encoding self.source_address = source_address self.timeout = timeout if host: @@ -706,9 +708,10 @@ class FTP_TLS(FTP): ''' ssl_version = ssl.PROTOCOL_TLS_CLIENT - def __init__(self, host='', user='', passwd='', acct='', keyfile=None, - certfile=None, context=None, - timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None): + def __init__(self, host='', user='', passwd='', acct='', + keyfile=None, certfile=None, context=None, + timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *, + encoding='utf-8'): if context is not None and keyfile is not None: raise ValueError("context and keyfile arguments are mutually " "exclusive") @@ -727,7 +730,8 @@ def __init__(self, host='', user='', passwd='', acct='', keyfile=None, keyfile=keyfile) self.context = context self._prot_p = False - super().__init__(host, user, passwd, acct, timeout, source_address) + super().__init__(host, user, passwd, acct, + timeout, source_address, encoding=encoding) def login(self, user='', passwd='', acct='', secure=True): if secure and not isinstance(self.sock, ssl.SSLSocket): diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index f40f3a4d9f7ab..cf30a3df35f12 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -22,11 +22,12 @@ from test.support import HOST, HOSTv6 TIMEOUT = support.LOOPBACK_TIMEOUT +DEFAULT_ENCODING = 'utf-8' # the dummy data returned by server over the data channel when # RETR, LIST, NLST, MLSD commands are issued -RETR_DATA = 'abcde12345\r\n' * 1000 -LIST_DATA = 'foo\r\nbar\r\n' -NLST_DATA = 'foo\r\nbar\r\n' +RETR_DATA = 'abcde12345\r\n' * 1000 + 'non-ascii char \xAE\r\n' +LIST_DATA = 'foo\r\nbar\r\n non-ascii char \xAE\r\n' +NLST_DATA = 'foo\r\nbar\r\n non-ascii char \xAE\r\n' MLSD_DATA = ("type=cdir;perm=el;unique==keVO1+ZF4; test\r\n" "type=pdir;perm=e;unique==keVO1+d?3; ..\r\n" "type=OS.unix=slink:/foobar;perm=;unique==keVO1+4G4; foobar\r\n" @@ -41,7 +42,9 @@ "type=dir;perm=cpmel;unique==keVO1+7G4; incoming\r\n" "type=file;perm=r;unique==keVO1+1G4; file2\r\n" "type=file;perm=r;unique==keVO1+1G4; file3\r\n" - "type=file;perm=r;unique==keVO1+1G4; file4\r\n") + "type=file;perm=r;unique==keVO1+1G4; file4\r\n" + "type=dir;perm=cpmel;unique==SGP1; dir \xAE non-ascii char\r\n" + "type=file;perm=r;unique==SGP2; file \xAE non-ascii char\r\n") class DummyDTPHandler(asynchat.async_chat): @@ -51,9 +54,11 @@ def __init__(self, conn, baseclass): asynchat.async_chat.__init__(self, conn) self.baseclass = baseclass self.baseclass.last_received_data = '' + self.encoding = baseclass.encoding def handle_read(self): - self.baseclass.last_received_data += self.recv(1024).decode('ascii') + new_data = self.recv(1024).decode(self.encoding, 'replace') + self.baseclass.last_received_data += new_data def handle_close(self): # XXX: this method can be called many times in a row for a single @@ -70,7 +75,7 @@ def push(self, what): self.baseclass.next_data = None if not what: return self.close_when_done() - super(DummyDTPHandler, self).push(what.encode('ascii')) + super(DummyDTPHandler, self).push(what.encode(self.encoding)) def handle_error(self): raise Exception @@ -80,7 +85,7 @@ class DummyFTPHandler(asynchat.async_chat): dtp_handler = DummyDTPHandler - def __init__(self, conn): + def __init__(self, conn, encoding=DEFAULT_ENCODING): asynchat.async_chat.__init__(self, conn) # tells the socket to handle urgent data inline (ABOR command) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_OOBINLINE, 1) @@ -94,12 +99,13 @@ def __init__(self, conn): self.rest = None self.next_retr_data = RETR_DATA self.push('220 welcome') + self.encoding = encoding def collect_incoming_data(self, data): self.in_buffer.append(data) def found_terminator(self): - line = b''.join(self.in_buffer).decode('ascii') + line = b''.join(self.in_buffer).decode(self.encoding) self.in_buffer = [] if self.next_response: self.push(self.next_response) @@ -121,7 +127,7 @@ def handle_error(self): raise Exception def push(self, data): - asynchat.async_chat.push(self, data.encode('ascii') + b'\r\n') + asynchat.async_chat.push(self, data.encode(self.encoding) + b'\r\n') def cmd_port(self, arg): addr = list(map(int, arg.split(','))) @@ -251,7 +257,7 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread): handler = DummyFTPHandler - def __init__(self, address, af=socket.AF_INET): + def __init__(self, address, af=socket.AF_INET, encoding=DEFAULT_ENCODING): threading.Thread.__init__(self) asyncore.dispatcher.__init__(self) self.daemon = True @@ -262,6 +268,7 @@ def __init__(self, address, af=socket.AF_INET): self.active_lock = threading.Lock() self.host, self.port = self.socket.getsockname()[:2] self.handler_instance = None + self.encoding = encoding def start(self): assert not self.active @@ -284,7 +291,7 @@ def stop(self): self.join() def handle_accepted(self, conn, addr): - self.handler_instance = self.handler(conn) + self.handler_instance = self.handler(conn, encoding=self.encoding) def handle_connect(self): self.close() @@ -421,8 +428,8 @@ class DummyTLS_FTPHandler(SSLConnection, DummyFTPHandler): dtp_handler = DummyTLS_DTPHandler - def __init__(self, conn): - DummyFTPHandler.__init__(self, conn) + def __init__(self, conn, encoding=DEFAULT_ENCODING): + DummyFTPHandler.__init__(self, conn, encoding=encoding) self.secure_data_channel = False self._ccc = False @@ -462,10 +469,10 @@ class DummyTLS_FTPServer(DummyFTPServer): class TestFTPClass(TestCase): - def setUp(self): - self.server = DummyFTPServer((HOST, 0)) + def setUp(self, encoding=DEFAULT_ENCODING): + self.server = DummyFTPServer((HOST, 0), encoding=encoding) self.server.start() - self.client = ftplib.FTP(timeout=TIMEOUT) + self.client = ftplib.FTP(timeout=TIMEOUT, encoding=encoding) self.client.connect(self.server.host, self.server.port) def tearDown(self): @@ -565,14 +572,14 @@ def test_abort(self): def test_retrbinary(self): def callback(data): - received.append(data.decode('ascii')) + received.append(data.decode(self.client.encoding)) received = [] self.client.retrbinary('retr', callback) self.check_data(''.join(received), RETR_DATA) def test_retrbinary_rest(self): def callback(data): - received.append(data.decode('ascii')) + received.append(data.decode(self.client.encoding)) for rest in (0, 10, 20): received = [] self.client.retrbinary('retr', callback, rest=rest) @@ -584,7 +591,7 @@ def test_retrlines(self): self.check_data(''.join(received), RETR_DATA.replace('\r\n', '')) def test_storbinary(self): - f = io.BytesIO(RETR_DATA.encode('ascii')) + f = io.BytesIO(RETR_DATA.encode(self.client.encoding)) self.client.storbinary('stor', f) self.check_data(self.server.handler_instance.last_received_data, RETR_DATA) # test new callback arg @@ -594,14 +601,16 @@ def test_storbinary(self): self.assertTrue(flag) def test_storbinary_rest(self): - f = io.BytesIO(RETR_DATA.replace('\r\n', '\n').encode('ascii')) + data = RETR_DATA.replace('\r\n', '\n').encode(self.client.encoding) + f = io.BytesIO(data) for r in (30, '30'): f.seek(0) self.client.storbinary('stor', f, rest=r) self.assertEqual(self.server.handler_instance.rest, str(r)) def test_storlines(self): - f = io.BytesIO(RETR_DATA.replace('\r\n', '\n').encode('ascii')) + data = RETR_DATA.replace('\r\n', '\n').encode(self.client.encoding) + f = io.BytesIO(data) self.client.storlines('stor', f) self.check_data(self.server.handler_instance.last_received_data, RETR_DATA) # test new callback arg @@ -790,14 +799,32 @@ def test_storlines_too_long(self): f = io.BytesIO(b'x' * self.client.maxline * 2) self.assertRaises(ftplib.Error, self.client.storlines, 'stor', f) + def test_encoding_param(self): + encodings = ['latin-1', 'utf-8'] + for encoding in encodings: + with self.subTest(encoding=encoding): + self.tearDown() + self.setUp(encoding=encoding) + self.assertEqual(encoding, self.client.encoding) + self.test_retrbinary() + self.test_storbinary() + self.test_retrlines() + new_dir = self.client.mkd('/non-ascii dir \xAE') + self.check_data(new_dir, '/non-ascii dir \xAE') + # Check default encoding + client = ftplib.FTP(timeout=TIMEOUT) + self.assertEqual(DEFAULT_ENCODING, client.encoding) + @skipUnless(support.IPV6_ENABLED, "IPv6 not enabled") class TestIPv6Environment(TestCase): def setUp(self): - self.server = DummyFTPServer((HOSTv6, 0), af=socket.AF_INET6) + self.server = DummyFTPServer((HOSTv6, 0), + af=socket.AF_INET6, + encoding=DEFAULT_ENCODING) self.server.start() - self.client = ftplib.FTP(timeout=TIMEOUT) + self.client = ftplib.FTP(timeout=TIMEOUT, encoding=DEFAULT_ENCODING) self.client.connect(self.server.host, self.server.port) def tearDown(self): @@ -824,7 +851,7 @@ def test_makepasv(self): def test_transfer(self): def retr(): def callback(data): - received.append(data.decode('ascii')) + received.append(data.decode(self.client.encoding)) received = [] self.client.retrbinary('retr', callback) self.assertEqual(len(''.join(received)), len(RETR_DATA)) @@ -841,10 +868,10 @@ class TestTLS_FTPClassMixin(TestFTPClass): and data connections first. """ - def setUp(self): - self.server = DummyTLS_FTPServer((HOST, 0)) + def setUp(self, encoding=DEFAULT_ENCODING): + self.server = DummyTLS_FTPServer((HOST, 0), encoding=encoding) self.server.start() - self.client = ftplib.FTP_TLS(timeout=TIMEOUT) + self.client = ftplib.FTP_TLS(timeout=TIMEOUT, encoding=encoding) self.client.connect(self.server.host, self.server.port) # enable TLS self.client.auth() @@ -855,8 +882,8 @@ def setUp(self): class TestTLS_FTPClass(TestCase): """Specific TLS_FTP class tests.""" - def setUp(self): - self.server = DummyTLS_FTPServer((HOST, 0)) + def setUp(self, encoding=DEFAULT_ENCODING): + self.server = DummyTLS_FTPServer((HOST, 0), encoding=encoding) self.server.start() self.client = ftplib.FTP_TLS(timeout=TIMEOUT) self.client.connect(self.server.host, self.server.port) @@ -877,7 +904,8 @@ def test_data_connection(self): # clear text with self.client.transfercmd('list') as sock: self.assertNotIsInstance(sock, ssl.SSLSocket) - self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii')) + self.assertEqual(sock.recv(1024), + LIST_DATA.encode(self.client.encoding)) self.assertEqual(self.client.voidresp(), "226 transfer complete") # secured, after PROT P @@ -886,14 +914,16 @@ def test_data_connection(self): self.assertIsInstance(sock, ssl.SSLSocket) # consume from SSL socket to finalize handshake and avoid # "SSLError [SSL] shutdown while in init" - self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii')) + self.assertEqual(sock.recv(1024), + LIST_DATA.encode(self.client.encoding)) self.assertEqual(self.client.voidresp(), "226 transfer complete") # PROT C is issued, the connection must be in cleartext again self.client.prot_c() with self.client.transfercmd('list') as sock: self.assertNotIsInstance(sock, ssl.SSLSocket) - self.assertEqual(sock.recv(1024), LIST_DATA.encode('ascii')) + self.assertEqual(sock.recv(1024), + LIST_DATA.encode(self.client.encoding)) self.assertEqual(self.client.voidresp(), "226 transfer complete") def test_login(self): diff --git a/Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst b/Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst new file mode 100644 index 0000000000000..1ac9ead0eb321 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst @@ -0,0 +1,3 @@ +Add the encoding in :class:`ftplib.FTP` and :class:`ftplib.FTP_TLS` to the +constructor as keyword-only and change the default from ``latin-1`` to ``utf-8`` +to follow :rfc:`2640`. From webhook-mailer at python.org Mon Apr 13 20:04:39 2020 From: webhook-mailer at python.org (Galden) Date: Tue, 14 Apr 2020 00:04:39 -0000 Subject: [Python-checkins] Fix typo from Lib/asyncio/events.py (GH-19410) Message-ID: https://github.com/python/cpython/commit/02152b7332593a00ccf0eb77faf066ba97ca8687 commit: 02152b7332593a00ccf0eb77faf066ba97ca8687 branch: master author: Galden committer: GitHub date: 2020-04-14T09:04:32+09:00 summary: Fix typo from Lib/asyncio/events.py (GH-19410) files: M Lib/asyncio/events.py diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index c7343f515ca22..16a6cfd438bdc 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -397,7 +397,7 @@ async def create_unix_server( The return value is a Server object, which can be used to stop the service. - path is a str, representing a file systsem path to bind the + path is a str, representing a file system path to bind the server socket to. sock can optionally be specified in order to use a preexisting From webhook-mailer at python.org Mon Apr 13 23:11:53 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Tue, 14 Apr 2020 03:11:53 -0000 Subject: [Python-checkins] closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506) Message-ID: https://github.com/python/cpython/commit/584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca commit: 584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca branch: master author: Benjamin Peterson committer: GitHub date: 2020-04-13T22:11:40-05:00 summary: closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506) files: M Modules/_ssl_data.h M Tools/ssl/make_ssl_data.py diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h index e22f827032042..8f2994f52dfef 100644 --- a/Modules/_ssl_data.h +++ b/Modules/_ssl_data.h @@ -1,5 +1,5 @@ /* File generated by Tools/ssl/make_ssl_data.py */ -/* Generated on 2020-04-12T13:38:13.871723 */ +/* Generated on 2020-04-13T21:45:54.559159 */ static struct py_ssl_library_code library_codes[] = { #ifdef ERR_LIB_ASN1 @@ -87,6237 +87,6237 @@ static struct py_ssl_error_code error_codes[] = { #ifdef ASN1_R_ADDING_OBJECT {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT}, #else - {"ADDING_OBJECT", ERR_LIB_ASN1, 171}, + {"ADDING_OBJECT", 13, 171}, #endif #ifdef ASN1_R_ASN1_PARSE_ERROR {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR}, #else - {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, 203}, + {"ASN1_PARSE_ERROR", 13, 203}, #endif #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR}, #else - {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, 204}, + {"ASN1_SIG_PARSE_ERROR", 13, 204}, #endif #ifdef ASN1_R_AUX_ERROR {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR}, #else - {"AUX_ERROR", ERR_LIB_ASN1, 100}, + {"AUX_ERROR", 13, 100}, #endif #ifdef ASN1_R_BAD_OBJECT_HEADER {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER}, #else - {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, 102}, + {"BAD_OBJECT_HEADER", 13, 102}, #endif #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH}, #else - {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 214}, + {"BMPSTRING_IS_WRONG_LENGTH", 13, 214}, #endif #ifdef ASN1_R_BN_LIB {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB}, #else - {"BN_LIB", ERR_LIB_ASN1, 105}, + {"BN_LIB", 13, 105}, #endif #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH}, #else - {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, 106}, + {"BOOLEAN_IS_WRONG_LENGTH", 13, 106}, #endif #ifdef ASN1_R_BUFFER_TOO_SMALL {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL}, #else - {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, 107}, + {"BUFFER_TOO_SMALL", 13, 107}, #endif #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, #else - {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, 108}, + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108}, #endif #ifdef ASN1_R_CONTEXT_NOT_INITIALISED {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED}, #else - {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, 217}, + {"CONTEXT_NOT_INITIALISED", 13, 217}, #endif #ifdef ASN1_R_DATA_IS_WRONG {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG}, #else - {"DATA_IS_WRONG", ERR_LIB_ASN1, 109}, + {"DATA_IS_WRONG", 13, 109}, #endif #ifdef ASN1_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_ASN1, 110}, + {"DECODE_ERROR", 13, 110}, #endif #ifdef ASN1_R_DEPTH_EXCEEDED {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED}, #else - {"DEPTH_EXCEEDED", ERR_LIB_ASN1, 174}, + {"DEPTH_EXCEEDED", 13, 174}, #endif #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED}, #else - {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, 198}, + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198}, #endif #ifdef ASN1_R_ENCODE_ERROR {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR}, #else - {"ENCODE_ERROR", ERR_LIB_ASN1, 112}, + {"ENCODE_ERROR", 13, 112}, #endif #ifdef ASN1_R_ERROR_GETTING_TIME {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME}, #else - {"ERROR_GETTING_TIME", ERR_LIB_ASN1, 173}, + {"ERROR_GETTING_TIME", 13, 173}, #endif #ifdef ASN1_R_ERROR_LOADING_SECTION {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION}, #else - {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, 172}, + {"ERROR_LOADING_SECTION", 13, 172}, #endif #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS}, #else - {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, 114}, + {"ERROR_SETTING_CIPHER_PARAMS", 13, 114}, #endif #ifdef ASN1_R_EXPECTING_AN_INTEGER {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER}, #else - {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, 115}, + {"EXPECTING_AN_INTEGER", 13, 115}, #endif #ifdef ASN1_R_EXPECTING_AN_OBJECT {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT}, #else - {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, 116}, + {"EXPECTING_AN_OBJECT", 13, 116}, #endif #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH}, #else - {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, 119}, + {"EXPLICIT_LENGTH_MISMATCH", 13, 119}, #endif #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED}, #else - {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, 120}, + {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120}, #endif #ifdef ASN1_R_FIELD_MISSING {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING}, #else - {"FIELD_MISSING", ERR_LIB_ASN1, 121}, + {"FIELD_MISSING", 13, 121}, #endif #ifdef ASN1_R_FIRST_NUM_TOO_LARGE {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE}, #else - {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, 122}, + {"FIRST_NUM_TOO_LARGE", 13, 122}, #endif #ifdef ASN1_R_HEADER_TOO_LONG {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG}, #else - {"HEADER_TOO_LONG", ERR_LIB_ASN1, 123}, + {"HEADER_TOO_LONG", 13, 123}, #endif #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT}, #else - {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, 175}, + {"ILLEGAL_BITSTRING_FORMAT", 13, 175}, #endif #ifdef ASN1_R_ILLEGAL_BOOLEAN {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN}, #else - {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, 176}, + {"ILLEGAL_BOOLEAN", 13, 176}, #endif #ifdef ASN1_R_ILLEGAL_CHARACTERS {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS}, #else - {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, 124}, + {"ILLEGAL_CHARACTERS", 13, 124}, #endif #ifdef ASN1_R_ILLEGAL_FORMAT {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT}, #else - {"ILLEGAL_FORMAT", ERR_LIB_ASN1, 177}, + {"ILLEGAL_FORMAT", 13, 177}, #endif #ifdef ASN1_R_ILLEGAL_HEX {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX}, #else - {"ILLEGAL_HEX", ERR_LIB_ASN1, 178}, + {"ILLEGAL_HEX", 13, 178}, #endif #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG}, #else - {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, 179}, + {"ILLEGAL_IMPLICIT_TAG", 13, 179}, #endif #ifdef ASN1_R_ILLEGAL_INTEGER {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER}, #else - {"ILLEGAL_INTEGER", ERR_LIB_ASN1, 180}, + {"ILLEGAL_INTEGER", 13, 180}, #endif #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE}, #else - {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, 226}, + {"ILLEGAL_NEGATIVE_VALUE", 13, 226}, #endif #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING}, #else - {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, 181}, + {"ILLEGAL_NESTED_TAGGING", 13, 181}, #endif #ifdef ASN1_R_ILLEGAL_NULL {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL}, #else - {"ILLEGAL_NULL", ERR_LIB_ASN1, 125}, + {"ILLEGAL_NULL", 13, 125}, #endif #ifdef ASN1_R_ILLEGAL_NULL_VALUE {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE}, #else - {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, 182}, + {"ILLEGAL_NULL_VALUE", 13, 182}, #endif #ifdef ASN1_R_ILLEGAL_OBJECT {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT}, #else - {"ILLEGAL_OBJECT", ERR_LIB_ASN1, 183}, + {"ILLEGAL_OBJECT", 13, 183}, #endif #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY}, #else - {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, 126}, + {"ILLEGAL_OPTIONAL_ANY", 13, 126}, #endif #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE}, #else - {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, 170}, + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170}, #endif #ifdef ASN1_R_ILLEGAL_PADDING {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING}, #else - {"ILLEGAL_PADDING", ERR_LIB_ASN1, 221}, + {"ILLEGAL_PADDING", 13, 221}, #endif #ifdef ASN1_R_ILLEGAL_TAGGED_ANY {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY}, #else - {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, 127}, + {"ILLEGAL_TAGGED_ANY", 13, 127}, #endif #ifdef ASN1_R_ILLEGAL_TIME_VALUE {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE}, #else - {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, 184}, + {"ILLEGAL_TIME_VALUE", 13, 184}, #endif #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT}, #else - {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, 222}, + {"ILLEGAL_ZERO_CONTENT", 13, 222}, #endif #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT}, #else - {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 185}, + {"INTEGER_NOT_ASCII_FORMAT", 13, 185}, #endif #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG}, #else - {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, 128}, + {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128}, #endif #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT}, #else - {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, 220}, + {"INVALID_BIT_STRING_BITS_LEFT", 13, 220}, #endif #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH}, #else - {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, 129}, + {"INVALID_BMPSTRING_LENGTH", 13, 129}, #endif #ifdef ASN1_R_INVALID_DIGIT {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT}, #else - {"INVALID_DIGIT", ERR_LIB_ASN1, 130}, + {"INVALID_DIGIT", 13, 130}, #endif #ifdef ASN1_R_INVALID_MIME_TYPE {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE}, #else - {"INVALID_MIME_TYPE", ERR_LIB_ASN1, 205}, + {"INVALID_MIME_TYPE", 13, 205}, #endif #ifdef ASN1_R_INVALID_MODIFIER {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER}, #else - {"INVALID_MODIFIER", ERR_LIB_ASN1, 186}, + {"INVALID_MODIFIER", 13, 186}, #endif #ifdef ASN1_R_INVALID_NUMBER {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER}, #else - {"INVALID_NUMBER", ERR_LIB_ASN1, 187}, + {"INVALID_NUMBER", 13, 187}, #endif #ifdef ASN1_R_INVALID_OBJECT_ENCODING {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING}, #else - {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, 216}, + {"INVALID_OBJECT_ENCODING", 13, 216}, #endif #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS}, #else - {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, 227}, + {"INVALID_SCRYPT_PARAMETERS", 13, 227}, #endif #ifdef ASN1_R_INVALID_SEPARATOR {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR}, #else - {"INVALID_SEPARATOR", ERR_LIB_ASN1, 131}, + {"INVALID_SEPARATOR", 13, 131}, #endif #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE}, #else - {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, 218}, + {"INVALID_STRING_TABLE_VALUE", 13, 218}, #endif #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH}, #else - {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, 133}, + {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133}, #endif #ifdef ASN1_R_INVALID_UTF8STRING {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING}, #else - {"INVALID_UTF8STRING", ERR_LIB_ASN1, 134}, + {"INVALID_UTF8STRING", 13, 134}, #endif #ifdef ASN1_R_INVALID_VALUE {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE}, #else - {"INVALID_VALUE", ERR_LIB_ASN1, 219}, + {"INVALID_VALUE", 13, 219}, #endif #ifdef ASN1_R_LIST_ERROR {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR}, #else - {"LIST_ERROR", ERR_LIB_ASN1, 188}, + {"LIST_ERROR", 13, 188}, #endif #ifdef ASN1_R_MIME_NO_CONTENT_TYPE {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE}, #else - {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, 206}, + {"MIME_NO_CONTENT_TYPE", 13, 206}, #endif #ifdef ASN1_R_MIME_PARSE_ERROR {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR}, #else - {"MIME_PARSE_ERROR", ERR_LIB_ASN1, 207}, + {"MIME_PARSE_ERROR", 13, 207}, #endif #ifdef ASN1_R_MIME_SIG_PARSE_ERROR {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR}, #else - {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, 208}, + {"MIME_SIG_PARSE_ERROR", 13, 208}, #endif #ifdef ASN1_R_MISSING_EOC {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC}, #else - {"MISSING_EOC", ERR_LIB_ASN1, 137}, + {"MISSING_EOC", 13, 137}, #endif #ifdef ASN1_R_MISSING_SECOND_NUMBER {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER}, #else - {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, 138}, + {"MISSING_SECOND_NUMBER", 13, 138}, #endif #ifdef ASN1_R_MISSING_VALUE {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE}, #else - {"MISSING_VALUE", ERR_LIB_ASN1, 189}, + {"MISSING_VALUE", 13, 189}, #endif #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL}, #else - {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, 139}, + {"MSTRING_NOT_UNIVERSAL", 13, 139}, #endif #ifdef ASN1_R_MSTRING_WRONG_TAG {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG}, #else - {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, 140}, + {"MSTRING_WRONG_TAG", 13, 140}, #endif #ifdef ASN1_R_NESTED_ASN1_STRING {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING}, #else - {"NESTED_ASN1_STRING", ERR_LIB_ASN1, 197}, + {"NESTED_ASN1_STRING", 13, 197}, #endif #ifdef ASN1_R_NESTED_TOO_DEEP {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP}, #else - {"NESTED_TOO_DEEP", ERR_LIB_ASN1, 201}, + {"NESTED_TOO_DEEP", 13, 201}, #endif #ifdef ASN1_R_NON_HEX_CHARACTERS {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS}, #else - {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, 141}, + {"NON_HEX_CHARACTERS", 13, 141}, #endif #ifdef ASN1_R_NOT_ASCII_FORMAT {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT}, #else - {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, 190}, + {"NOT_ASCII_FORMAT", 13, 190}, #endif #ifdef ASN1_R_NOT_ENOUGH_DATA {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA}, #else - {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, 142}, + {"NOT_ENOUGH_DATA", 13, 142}, #endif #ifdef ASN1_R_NO_CONTENT_TYPE {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE}, #else - {"NO_CONTENT_TYPE", ERR_LIB_ASN1, 209}, + {"NO_CONTENT_TYPE", 13, 209}, #endif #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE}, #else - {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, 143}, + {"NO_MATCHING_CHOICE_TYPE", 13, 143}, #endif #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE}, #else - {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, 210}, + {"NO_MULTIPART_BODY_FAILURE", 13, 210}, #endif #ifdef ASN1_R_NO_MULTIPART_BOUNDARY {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY}, #else - {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, 211}, + {"NO_MULTIPART_BOUNDARY", 13, 211}, #endif #ifdef ASN1_R_NO_SIG_CONTENT_TYPE {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE}, #else - {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, 212}, + {"NO_SIG_CONTENT_TYPE", 13, 212}, #endif #ifdef ASN1_R_NULL_IS_WRONG_LENGTH {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH}, #else - {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, 144}, + {"NULL_IS_WRONG_LENGTH", 13, 144}, #endif #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT}, #else - {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 191}, + {"OBJECT_NOT_ASCII_FORMAT", 13, 191}, #endif #ifdef ASN1_R_ODD_NUMBER_OF_CHARS {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS}, #else - {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, 145}, + {"ODD_NUMBER_OF_CHARS", 13, 145}, #endif #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE}, #else - {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, 147}, + {"SECOND_NUMBER_TOO_LARGE", 13, 147}, #endif #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH}, #else - {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, 148}, + {"SEQUENCE_LENGTH_MISMATCH", 13, 148}, #endif #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED}, #else - {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 149}, + {"SEQUENCE_NOT_CONSTRUCTED", 13, 149}, #endif #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG}, #else - {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, 192}, + {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192}, #endif #ifdef ASN1_R_SHORT_LINE {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE}, #else - {"SHORT_LINE", ERR_LIB_ASN1, 150}, + {"SHORT_LINE", 13, 150}, #endif #ifdef ASN1_R_SIG_INVALID_MIME_TYPE {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE}, #else - {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, 213}, + {"SIG_INVALID_MIME_TYPE", 13, 213}, #endif #ifdef ASN1_R_STREAMING_NOT_SUPPORTED {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED}, #else - {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, 202}, + {"STREAMING_NOT_SUPPORTED", 13, 202}, #endif #ifdef ASN1_R_STRING_TOO_LONG {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG}, #else - {"STRING_TOO_LONG", ERR_LIB_ASN1, 151}, + {"STRING_TOO_LONG", 13, 151}, #endif #ifdef ASN1_R_STRING_TOO_SHORT {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT}, #else - {"STRING_TOO_SHORT", ERR_LIB_ASN1, 152}, + {"STRING_TOO_SHORT", 13, 152}, #endif #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, #else - {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, 154}, + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154}, #endif #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT}, #else - {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 193}, + {"TIME_NOT_ASCII_FORMAT", 13, 193}, #endif #ifdef ASN1_R_TOO_LARGE {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE}, #else - {"TOO_LARGE", ERR_LIB_ASN1, 223}, + {"TOO_LARGE", 13, 223}, #endif #ifdef ASN1_R_TOO_LONG {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG}, #else - {"TOO_LONG", ERR_LIB_ASN1, 155}, + {"TOO_LONG", 13, 155}, #endif #ifdef ASN1_R_TOO_SMALL {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL}, #else - {"TOO_SMALL", ERR_LIB_ASN1, 224}, + {"TOO_SMALL", 13, 224}, #endif #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED}, #else - {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 156}, + {"TYPE_NOT_CONSTRUCTED", 13, 156}, #endif #ifdef ASN1_R_TYPE_NOT_PRIMITIVE {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE}, #else - {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, 195}, + {"TYPE_NOT_PRIMITIVE", 13, 195}, #endif #ifdef ASN1_R_UNEXPECTED_EOC {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC}, #else - {"UNEXPECTED_EOC", ERR_LIB_ASN1, 159}, + {"UNEXPECTED_EOC", 13, 159}, #endif #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH}, #else - {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 215}, + {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215}, #endif #ifdef ASN1_R_UNKNOWN_FORMAT {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT}, #else - {"UNKNOWN_FORMAT", ERR_LIB_ASN1, 160}, + {"UNKNOWN_FORMAT", 13, 160}, #endif #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM}, #else - {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, 161}, + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161}, #endif #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE}, #else - {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, 162}, + {"UNKNOWN_OBJECT_TYPE", 13, 162}, #endif #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE}, #else - {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 163}, + {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163}, #endif #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM}, #else - {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, 199}, + {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199}, #endif #ifdef ASN1_R_UNKNOWN_TAG {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG}, #else - {"UNKNOWN_TAG", ERR_LIB_ASN1, 194}, + {"UNKNOWN_TAG", 13, 194}, #endif #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE}, #else - {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, 164}, + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164}, #endif #ifdef ASN1_R_UNSUPPORTED_CIPHER {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, 228}, + {"UNSUPPORTED_CIPHER", 13, 228}, #endif #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, #else - {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 167}, + {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167}, #endif #ifdef ASN1_R_UNSUPPORTED_TYPE {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE}, #else - {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, 196}, + {"UNSUPPORTED_TYPE", 13, 196}, #endif #ifdef ASN1_R_WRONG_INTEGER_TYPE {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE}, #else - {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, 225}, + {"WRONG_INTEGER_TYPE", 13, 225}, #endif #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE}, #else - {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 200}, + {"WRONG_PUBLIC_KEY_TYPE", 13, 200}, #endif #ifdef ASN1_R_WRONG_TAG {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG}, #else - {"WRONG_TAG", ERR_LIB_ASN1, 168}, + {"WRONG_TAG", 13, 168}, #endif #ifdef ASYNC_R_FAILED_TO_SET_POOL {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL}, #else - {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101}, + {"FAILED_TO_SET_POOL", 51, 101}, #endif #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT}, #else - {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, 102}, + {"FAILED_TO_SWAP_CONTEXT", 51, 102}, #endif #ifdef ASYNC_R_INIT_FAILED {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED}, #else - {"INIT_FAILED", ERR_LIB_ASYNC, 105}, + {"INIT_FAILED", 51, 105}, #endif #ifdef ASYNC_R_INVALID_POOL_SIZE {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE}, #else - {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, 103}, + {"INVALID_POOL_SIZE", 51, 103}, #endif #ifdef BIO_R_ACCEPT_ERROR {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR}, #else - {"ACCEPT_ERROR", ERR_LIB_BIO, 100}, + {"ACCEPT_ERROR", 32, 100}, #endif #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET}, #else - {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 141}, + {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141}, #endif #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE}, #else - {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, 129}, + {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129}, #endif #ifdef BIO_R_BAD_FOPEN_MODE {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE}, #else - {"BAD_FOPEN_MODE", ERR_LIB_BIO, 101}, + {"BAD_FOPEN_MODE", 32, 101}, #endif #ifdef BIO_R_BROKEN_PIPE {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE}, #else - {"BROKEN_PIPE", ERR_LIB_BIO, 124}, + {"BROKEN_PIPE", 32, 124}, #endif #ifdef BIO_R_CONNECT_ERROR {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR}, #else - {"CONNECT_ERROR", ERR_LIB_BIO, 103}, + {"CONNECT_ERROR", 32, 103}, #endif #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET}, #else - {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 107}, + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107}, #endif #ifdef BIO_R_GETSOCKNAME_ERROR {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR}, #else - {"GETSOCKNAME_ERROR", ERR_LIB_BIO, 132}, + {"GETSOCKNAME_ERROR", 32, 132}, #endif #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS}, #else - {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, 133}, + {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133}, #endif #ifdef BIO_R_GETTING_SOCKTYPE {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE}, #else - {"GETTING_SOCKTYPE", ERR_LIB_BIO, 134}, + {"GETTING_SOCKTYPE", 32, 134}, #endif #ifdef BIO_R_INVALID_ARGUMENT {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT}, #else - {"INVALID_ARGUMENT", ERR_LIB_BIO, 125}, + {"INVALID_ARGUMENT", 32, 125}, #endif #ifdef BIO_R_INVALID_SOCKET {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET}, #else - {"INVALID_SOCKET", ERR_LIB_BIO, 135}, + {"INVALID_SOCKET", 32, 135}, #endif #ifdef BIO_R_IN_USE {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE}, #else - {"IN_USE", ERR_LIB_BIO, 123}, + {"IN_USE", 32, 123}, #endif #ifdef BIO_R_LENGTH_TOO_LONG {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG}, #else - {"LENGTH_TOO_LONG", ERR_LIB_BIO, 102}, + {"LENGTH_TOO_LONG", 32, 102}, #endif #ifdef BIO_R_LISTEN_V6_ONLY {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY}, #else - {"LISTEN_V6_ONLY", ERR_LIB_BIO, 136}, + {"LISTEN_V6_ONLY", 32, 136}, #endif #ifdef BIO_R_LOOKUP_RETURNED_NOTHING {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING}, #else - {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, 142}, + {"LOOKUP_RETURNED_NOTHING", 32, 142}, #endif #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE}, #else - {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, 130}, + {"MALFORMED_HOST_OR_SERVICE", 32, 130}, #endif #ifdef BIO_R_NBIO_CONNECT_ERROR {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR}, #else - {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, 110}, + {"NBIO_CONNECT_ERROR", 32, 110}, #endif #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED}, #else - {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 143}, + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143}, #endif #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED}, #else - {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 144}, + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144}, #endif #ifdef BIO_R_NO_PORT_DEFINED {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED}, #else - {"NO_PORT_DEFINED", ERR_LIB_BIO, 113}, + {"NO_PORT_DEFINED", 32, 113}, #endif #ifdef BIO_R_NO_SUCH_FILE {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE}, #else - {"NO_SUCH_FILE", ERR_LIB_BIO, 128}, + {"NO_SUCH_FILE", 32, 128}, #endif #ifdef BIO_R_NULL_PARAMETER {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER}, #else - {"NULL_PARAMETER", ERR_LIB_BIO, 115}, + {"NULL_PARAMETER", 32, 115}, #endif #ifdef BIO_R_UNABLE_TO_BIND_SOCKET {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET}, #else - {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, 117}, + {"UNABLE_TO_BIND_SOCKET", 32, 117}, #endif #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET}, #else - {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, 118}, + {"UNABLE_TO_CREATE_SOCKET", 32, 118}, #endif #ifdef BIO_R_UNABLE_TO_KEEPALIVE {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE}, #else - {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, 137}, + {"UNABLE_TO_KEEPALIVE", 32, 137}, #endif #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET}, #else - {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, 119}, + {"UNABLE_TO_LISTEN_SOCKET", 32, 119}, #endif #ifdef BIO_R_UNABLE_TO_NODELAY {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY}, #else - {"UNABLE_TO_NODELAY", ERR_LIB_BIO, 138}, + {"UNABLE_TO_NODELAY", 32, 138}, #endif #ifdef BIO_R_UNABLE_TO_REUSEADDR {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR}, #else - {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, 139}, + {"UNABLE_TO_REUSEADDR", 32, 139}, #endif #ifdef BIO_R_UNAVAILABLE_IP_FAMILY {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY}, #else - {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, 145}, + {"UNAVAILABLE_IP_FAMILY", 32, 145}, #endif #ifdef BIO_R_UNINITIALIZED {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED}, #else - {"UNINITIALIZED", ERR_LIB_BIO, 120}, + {"UNINITIALIZED", 32, 120}, #endif #ifdef BIO_R_UNKNOWN_INFO_TYPE {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE}, #else - {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, 140}, + {"UNKNOWN_INFO_TYPE", 32, 140}, #endif #ifdef BIO_R_UNSUPPORTED_IP_FAMILY {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY}, #else - {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, 146}, + {"UNSUPPORTED_IP_FAMILY", 32, 146}, #endif #ifdef BIO_R_UNSUPPORTED_METHOD {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD}, #else - {"UNSUPPORTED_METHOD", ERR_LIB_BIO, 121}, + {"UNSUPPORTED_METHOD", 32, 121}, #endif #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY}, #else - {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, 131}, + {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131}, #endif #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO}, #else - {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, 126}, + {"WRITE_TO_READ_ONLY_BIO", 32, 126}, #endif #ifdef BIO_R_WSASTARTUP {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP}, #else - {"WSASTARTUP", ERR_LIB_BIO, 122}, + {"WSASTARTUP", 32, 122}, #endif #ifdef BN_R_ARG2_LT_ARG3 {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3}, #else - {"ARG2_LT_ARG3", ERR_LIB_BN, 100}, + {"ARG2_LT_ARG3", 3, 100}, #endif #ifdef BN_R_BAD_RECIPROCAL {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL}, #else - {"BAD_RECIPROCAL", ERR_LIB_BN, 101}, + {"BAD_RECIPROCAL", 3, 101}, #endif #ifdef BN_R_BIGNUM_TOO_LONG {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG}, #else - {"BIGNUM_TOO_LONG", ERR_LIB_BN, 114}, + {"BIGNUM_TOO_LONG", 3, 114}, #endif #ifdef BN_R_BITS_TOO_SMALL {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL}, #else - {"BITS_TOO_SMALL", ERR_LIB_BN, 118}, + {"BITS_TOO_SMALL", 3, 118}, #endif #ifdef BN_R_CALLED_WITH_EVEN_MODULUS {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS}, #else - {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, 102}, + {"CALLED_WITH_EVEN_MODULUS", 3, 102}, #endif #ifdef BN_R_DIV_BY_ZERO {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO}, #else - {"DIV_BY_ZERO", ERR_LIB_BN, 103}, + {"DIV_BY_ZERO", 3, 103}, #endif #ifdef BN_R_ENCODING_ERROR {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR}, #else - {"ENCODING_ERROR", ERR_LIB_BN, 104}, + {"ENCODING_ERROR", 3, 104}, #endif #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA}, #else - {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, 105}, + {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105}, #endif #ifdef BN_R_INPUT_NOT_REDUCED {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED}, #else - {"INPUT_NOT_REDUCED", ERR_LIB_BN, 110}, + {"INPUT_NOT_REDUCED", 3, 110}, #endif #ifdef BN_R_INVALID_LENGTH {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH}, #else - {"INVALID_LENGTH", ERR_LIB_BN, 106}, + {"INVALID_LENGTH", 3, 106}, #endif #ifdef BN_R_INVALID_RANGE {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE}, #else - {"INVALID_RANGE", ERR_LIB_BN, 115}, + {"INVALID_RANGE", 3, 115}, #endif #ifdef BN_R_INVALID_SHIFT {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT}, #else - {"INVALID_SHIFT", ERR_LIB_BN, 119}, + {"INVALID_SHIFT", 3, 119}, #endif #ifdef BN_R_NOT_A_SQUARE {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE}, #else - {"NOT_A_SQUARE", ERR_LIB_BN, 111}, + {"NOT_A_SQUARE", 3, 111}, #endif #ifdef BN_R_NOT_INITIALIZED {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED}, #else - {"NOT_INITIALIZED", ERR_LIB_BN, 107}, + {"NOT_INITIALIZED", 3, 107}, #endif #ifdef BN_R_NO_INVERSE {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE}, #else - {"NO_INVERSE", ERR_LIB_BN, 108}, + {"NO_INVERSE", 3, 108}, #endif #ifdef BN_R_NO_SOLUTION {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION}, #else - {"NO_SOLUTION", ERR_LIB_BN, 116}, + {"NO_SOLUTION", 3, 116}, #endif #ifdef BN_R_PRIVATE_KEY_TOO_LARGE {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE}, #else - {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, 117}, + {"PRIVATE_KEY_TOO_LARGE", 3, 117}, #endif #ifdef BN_R_P_IS_NOT_PRIME {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME}, #else - {"P_IS_NOT_PRIME", ERR_LIB_BN, 112}, + {"P_IS_NOT_PRIME", 3, 112}, #endif #ifdef BN_R_TOO_MANY_ITERATIONS {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS}, #else - {"TOO_MANY_ITERATIONS", ERR_LIB_BN, 113}, + {"TOO_MANY_ITERATIONS", 3, 113}, #endif #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES}, #else - {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, 109}, + {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109}, #endif #ifdef CMS_R_ADD_SIGNER_ERROR {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR}, #else - {"ADD_SIGNER_ERROR", ERR_LIB_CMS, 99}, + {"ADD_SIGNER_ERROR", 46, 99}, #endif #ifdef CMS_R_ATTRIBUTE_ERROR {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR}, #else - {"ATTRIBUTE_ERROR", ERR_LIB_CMS, 161}, + {"ATTRIBUTE_ERROR", 46, 161}, #endif #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT}, #else - {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, 175}, + {"CERTIFICATE_ALREADY_PRESENT", 46, 175}, #endif #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID}, #else - {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, 160}, + {"CERTIFICATE_HAS_NO_KEYID", 46, 160}, #endif #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, 100}, + {"CERTIFICATE_VERIFY_ERROR", 46, 100}, #endif #ifdef CMS_R_CIPHER_INITIALISATION_ERROR {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR}, #else - {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, 101}, + {"CIPHER_INITIALISATION_ERROR", 46, 101}, #endif #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR}, #else - {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, 102}, + {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102}, #endif #ifdef CMS_R_CMS_DATAFINAL_ERROR {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR}, #else - {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, 103}, + {"CMS_DATAFINAL_ERROR", 46, 103}, #endif #ifdef CMS_R_CMS_LIB {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB}, #else - {"CMS_LIB", ERR_LIB_CMS, 104}, + {"CMS_LIB", 46, 104}, #endif #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH}, #else - {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, 170}, + {"CONTENTIDENTIFIER_MISMATCH", 46, 170}, #endif #ifdef CMS_R_CONTENT_NOT_FOUND {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND}, #else - {"CONTENT_NOT_FOUND", ERR_LIB_CMS, 105}, + {"CONTENT_NOT_FOUND", 46, 105}, #endif #ifdef CMS_R_CONTENT_TYPE_MISMATCH {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH}, #else - {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, 171}, + {"CONTENT_TYPE_MISMATCH", 46, 171}, #endif #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA}, #else - {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 106}, + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106}, #endif #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA}, #else - {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 107}, + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107}, #endif #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA}, #else - {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, 108}, + {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108}, #endif #ifdef CMS_R_CONTENT_VERIFY_ERROR {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR}, #else - {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, 109}, + {"CONTENT_VERIFY_ERROR", 46, 109}, #endif #ifdef CMS_R_CTRL_ERROR {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR}, #else - {"CTRL_ERROR", ERR_LIB_CMS, 110}, + {"CTRL_ERROR", 46, 110}, #endif #ifdef CMS_R_CTRL_FAILURE {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE}, #else - {"CTRL_FAILURE", ERR_LIB_CMS, 111}, + {"CTRL_FAILURE", 46, 111}, #endif #ifdef CMS_R_DECRYPT_ERROR {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR}, #else - {"DECRYPT_ERROR", ERR_LIB_CMS, 112}, + {"DECRYPT_ERROR", 46, 112}, #endif #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY}, #else - {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, 113}, + {"ERROR_GETTING_PUBLIC_KEY", 46, 113}, #endif #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE}, #else - {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, 114}, + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114}, #endif #ifdef CMS_R_ERROR_SETTING_KEY {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY}, #else - {"ERROR_SETTING_KEY", ERR_LIB_CMS, 115}, + {"ERROR_SETTING_KEY", 46, 115}, #endif #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO}, #else - {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, 116}, + {"ERROR_SETTING_RECIPIENTINFO", 46, 116}, #endif #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH}, #else - {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, 117}, + {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117}, #endif #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER}, #else - {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, 176}, + {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176}, #endif #ifdef CMS_R_INVALID_KEY_LENGTH {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH}, #else - {"INVALID_KEY_LENGTH", ERR_LIB_CMS, 118}, + {"INVALID_KEY_LENGTH", 46, 118}, #endif #ifdef CMS_R_MD_BIO_INIT_ERROR {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR}, #else - {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, 119}, + {"MD_BIO_INIT_ERROR", 46, 119}, #endif #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH}, #else - {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, 120}, + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120}, #endif #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH}, #else - {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 121}, + {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121}, #endif #ifdef CMS_R_MSGSIGDIGEST_ERROR {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR}, #else - {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, 172}, + {"MSGSIGDIGEST_ERROR", 46, 172}, #endif #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE}, #else - {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, 162}, + {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162}, #endif #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH}, #else - {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 163}, + {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163}, #endif #ifdef CMS_R_NEED_ONE_SIGNER {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER}, #else - {"NEED_ONE_SIGNER", ERR_LIB_CMS, 164}, + {"NEED_ONE_SIGNER", 46, 164}, #endif #ifdef CMS_R_NOT_A_SIGNED_RECEIPT {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT}, #else - {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, 165}, + {"NOT_A_SIGNED_RECEIPT", 46, 165}, #endif #ifdef CMS_R_NOT_ENCRYPTED_DATA {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA}, #else - {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 122}, + {"NOT_ENCRYPTED_DATA", 46, 122}, #endif #ifdef CMS_R_NOT_KEK {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK}, #else - {"NOT_KEK", ERR_LIB_CMS, 123}, + {"NOT_KEK", 46, 123}, #endif #ifdef CMS_R_NOT_KEY_AGREEMENT {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT}, #else - {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, 181}, + {"NOT_KEY_AGREEMENT", 46, 181}, #endif #ifdef CMS_R_NOT_KEY_TRANSPORT {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT}, #else - {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, 124}, + {"NOT_KEY_TRANSPORT", 46, 124}, #endif #ifdef CMS_R_NOT_PWRI {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI}, #else - {"NOT_PWRI", ERR_LIB_CMS, 177}, + {"NOT_PWRI", 46, 177}, #endif #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, 125}, + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125}, #endif #ifdef CMS_R_NO_CIPHER {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER}, #else - {"NO_CIPHER", ERR_LIB_CMS, 126}, + {"NO_CIPHER", 46, 126}, #endif #ifdef CMS_R_NO_CONTENT {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT}, #else - {"NO_CONTENT", ERR_LIB_CMS, 127}, + {"NO_CONTENT", 46, 127}, #endif #ifdef CMS_R_NO_CONTENT_TYPE {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE}, #else - {"NO_CONTENT_TYPE", ERR_LIB_CMS, 173}, + {"NO_CONTENT_TYPE", 46, 173}, #endif #ifdef CMS_R_NO_DEFAULT_DIGEST {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST}, #else - {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, 128}, + {"NO_DEFAULT_DIGEST", 46, 128}, #endif #ifdef CMS_R_NO_DIGEST_SET {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET}, #else - {"NO_DIGEST_SET", ERR_LIB_CMS, 129}, + {"NO_DIGEST_SET", 46, 129}, #endif #ifdef CMS_R_NO_KEY {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY}, #else - {"NO_KEY", ERR_LIB_CMS, 130}, + {"NO_KEY", 46, 130}, #endif #ifdef CMS_R_NO_KEY_OR_CERT {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT}, #else - {"NO_KEY_OR_CERT", ERR_LIB_CMS, 174}, + {"NO_KEY_OR_CERT", 46, 174}, #endif #ifdef CMS_R_NO_MATCHING_DIGEST {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST}, #else - {"NO_MATCHING_DIGEST", ERR_LIB_CMS, 131}, + {"NO_MATCHING_DIGEST", 46, 131}, #endif #ifdef CMS_R_NO_MATCHING_RECIPIENT {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT}, #else - {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, 132}, + {"NO_MATCHING_RECIPIENT", 46, 132}, #endif #ifdef CMS_R_NO_MATCHING_SIGNATURE {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE}, #else - {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, 166}, + {"NO_MATCHING_SIGNATURE", 46, 166}, #endif #ifdef CMS_R_NO_MSGSIGDIGEST {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST}, #else - {"NO_MSGSIGDIGEST", ERR_LIB_CMS, 167}, + {"NO_MSGSIGDIGEST", 46, 167}, #endif #ifdef CMS_R_NO_PASSWORD {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD}, #else - {"NO_PASSWORD", ERR_LIB_CMS, 178}, + {"NO_PASSWORD", 46, 178}, #endif #ifdef CMS_R_NO_PRIVATE_KEY {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY}, #else - {"NO_PRIVATE_KEY", ERR_LIB_CMS, 133}, + {"NO_PRIVATE_KEY", 46, 133}, #endif #ifdef CMS_R_NO_PUBLIC_KEY {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY}, #else - {"NO_PUBLIC_KEY", ERR_LIB_CMS, 134}, + {"NO_PUBLIC_KEY", 46, 134}, #endif #ifdef CMS_R_NO_RECEIPT_REQUEST {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST}, #else - {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, 168}, + {"NO_RECEIPT_REQUEST", 46, 168}, #endif #ifdef CMS_R_NO_SIGNERS {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS}, #else - {"NO_SIGNERS", ERR_LIB_CMS, 135}, + {"NO_SIGNERS", 46, 135}, #endif #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, 136}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136}, #endif #ifdef CMS_R_RECEIPT_DECODE_ERROR {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR}, #else - {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, 169}, + {"RECEIPT_DECODE_ERROR", 46, 169}, #endif #ifdef CMS_R_RECIPIENT_ERROR {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR}, #else - {"RECIPIENT_ERROR", ERR_LIB_CMS, 137}, + {"RECIPIENT_ERROR", 46, 137}, #endif #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, 138}, + {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138}, #endif #ifdef CMS_R_SIGNFINAL_ERROR {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR}, #else - {"SIGNFINAL_ERROR", ERR_LIB_CMS, 139}, + {"SIGNFINAL_ERROR", 46, 139}, #endif #ifdef CMS_R_SMIME_TEXT_ERROR {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR}, #else - {"SMIME_TEXT_ERROR", ERR_LIB_CMS, 140}, + {"SMIME_TEXT_ERROR", 46, 140}, #endif #ifdef CMS_R_STORE_INIT_ERROR {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR}, #else - {"STORE_INIT_ERROR", ERR_LIB_CMS, 141}, + {"STORE_INIT_ERROR", 46, 141}, #endif #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA}, #else - {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 142}, + {"TYPE_NOT_COMPRESSED_DATA", 46, 142}, #endif #ifdef CMS_R_TYPE_NOT_DATA {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA}, #else - {"TYPE_NOT_DATA", ERR_LIB_CMS, 143}, + {"TYPE_NOT_DATA", 46, 143}, #endif #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA}, #else - {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, 144}, + {"TYPE_NOT_DIGESTED_DATA", 46, 144}, #endif #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA}, #else - {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 145}, + {"TYPE_NOT_ENCRYPTED_DATA", 46, 145}, #endif #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA}, #else - {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 146}, + {"TYPE_NOT_ENVELOPED_DATA", 46, 146}, #endif #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT}, #else - {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, 147}, + {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147}, #endif #ifdef CMS_R_UNKNOWN_CIPHER {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER}, #else - {"UNKNOWN_CIPHER", ERR_LIB_CMS, 148}, + {"UNKNOWN_CIPHER", 46, 148}, #endif #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM}, #else - {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, 149}, + {"UNKNOWN_DIGEST_ALGORITHM", 46, 149}, #endif #ifdef CMS_R_UNKNOWN_ID {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID}, #else - {"UNKNOWN_ID", ERR_LIB_CMS, 150}, + {"UNKNOWN_ID", 46, 150}, #endif #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, #else - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, 151}, + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151}, #endif #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE}, #else - {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, 152}, + {"UNSUPPORTED_CONTENT_TYPE", 46, 152}, #endif #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM}, #else - {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, 153}, + {"UNSUPPORTED_KEK_ALGORITHM", 46, 153}, #endif #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM}, #else - {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, 179}, + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179}, #endif #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE}, #else - {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, 155}, + {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155}, #endif #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE}, #else - {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, 154}, + {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154}, #endif #ifdef CMS_R_UNSUPPORTED_TYPE {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE}, #else - {"UNSUPPORTED_TYPE", ERR_LIB_CMS, 156}, + {"UNSUPPORTED_TYPE", 46, 156}, #endif #ifdef CMS_R_UNWRAP_ERROR {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR}, #else - {"UNWRAP_ERROR", ERR_LIB_CMS, 157}, + {"UNWRAP_ERROR", 46, 157}, #endif #ifdef CMS_R_UNWRAP_FAILURE {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE}, #else - {"UNWRAP_FAILURE", ERR_LIB_CMS, 180}, + {"UNWRAP_FAILURE", 46, 180}, #endif #ifdef CMS_R_VERIFICATION_FAILURE {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE}, #else - {"VERIFICATION_FAILURE", ERR_LIB_CMS, 158}, + {"VERIFICATION_FAILURE", 46, 158}, #endif #ifdef CMS_R_WRAP_ERROR {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR}, #else - {"WRAP_ERROR", ERR_LIB_CMS, 159}, + {"WRAP_ERROR", 46, 159}, #endif #ifdef COMP_R_ZLIB_DEFLATE_ERROR {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR}, #else - {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, 99}, + {"ZLIB_DEFLATE_ERROR", 41, 99}, #endif #ifdef COMP_R_ZLIB_INFLATE_ERROR {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR}, #else - {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, 100}, + {"ZLIB_INFLATE_ERROR", 41, 100}, #endif #ifdef COMP_R_ZLIB_NOT_SUPPORTED {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED}, #else - {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, 101}, + {"ZLIB_NOT_SUPPORTED", 41, 101}, #endif #ifdef CONF_R_ERROR_LOADING_DSO {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO}, #else - {"ERROR_LOADING_DSO", ERR_LIB_CONF, 110}, + {"ERROR_LOADING_DSO", 14, 110}, #endif #ifdef CONF_R_LIST_CANNOT_BE_NULL {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL}, #else - {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, 115}, + {"LIST_CANNOT_BE_NULL", 14, 115}, #endif #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET}, #else - {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, 100}, + {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100}, #endif #ifdef CONF_R_MISSING_EQUAL_SIGN {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN}, #else - {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, 101}, + {"MISSING_EQUAL_SIGN", 14, 101}, #endif #ifdef CONF_R_MISSING_INIT_FUNCTION {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION}, #else - {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, 112}, + {"MISSING_INIT_FUNCTION", 14, 112}, #endif #ifdef CONF_R_MODULE_INITIALIZATION_ERROR {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR}, #else - {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, 109}, + {"MODULE_INITIALIZATION_ERROR", 14, 109}, #endif #ifdef CONF_R_NO_CLOSE_BRACE {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE}, #else - {"NO_CLOSE_BRACE", ERR_LIB_CONF, 102}, + {"NO_CLOSE_BRACE", 14, 102}, #endif #ifdef CONF_R_NO_CONF {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF}, #else - {"NO_CONF", ERR_LIB_CONF, 105}, + {"NO_CONF", 14, 105}, #endif #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE}, #else - {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, 106}, + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106}, #endif #ifdef CONF_R_NO_SECTION {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION}, #else - {"NO_SECTION", ERR_LIB_CONF, 107}, + {"NO_SECTION", 14, 107}, #endif #ifdef CONF_R_NO_SUCH_FILE {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE}, #else - {"NO_SUCH_FILE", ERR_LIB_CONF, 114}, + {"NO_SUCH_FILE", 14, 114}, #endif #ifdef CONF_R_NO_VALUE {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE}, #else - {"NO_VALUE", ERR_LIB_CONF, 108}, + {"NO_VALUE", 14, 108}, #endif #ifdef CONF_R_NUMBER_TOO_LARGE {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE}, #else - {"NUMBER_TOO_LARGE", ERR_LIB_CONF, 121}, + {"NUMBER_TOO_LARGE", 14, 121}, #endif #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE}, #else - {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, 111}, + {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111}, #endif #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY}, #else - {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, 117}, + {"SSL_COMMAND_SECTION_EMPTY", 14, 117}, #endif #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND}, #else - {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, 118}, + {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118}, #endif #ifdef CONF_R_SSL_SECTION_EMPTY {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY}, #else - {"SSL_SECTION_EMPTY", ERR_LIB_CONF, 119}, + {"SSL_SECTION_EMPTY", 14, 119}, #endif #ifdef CONF_R_SSL_SECTION_NOT_FOUND {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND}, #else - {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, 120}, + {"SSL_SECTION_NOT_FOUND", 14, 120}, #endif #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION}, #else - {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, 103}, + {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103}, #endif #ifdef CONF_R_UNKNOWN_MODULE_NAME {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME}, #else - {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, 113}, + {"UNKNOWN_MODULE_NAME", 14, 113}, #endif #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG}, #else - {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, 116}, + {"VARIABLE_EXPANSION_TOO_LONG", 14, 116}, #endif #ifdef CONF_R_VARIABLE_HAS_NO_VALUE {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE}, #else - {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, 104}, + {"VARIABLE_HAS_NO_VALUE", 14, 104}, #endif #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED}, #else - {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, 101}, + {"FIPS_MODE_NOT_SUPPORTED", 15, 101}, #endif #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT}, #else - {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, 102}, + {"ILLEGAL_HEX_DIGIT", 15, 102}, #endif #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS}, #else - {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, 103}, + {"ODD_NUMBER_OF_DIGITS", 15, 103}, #endif #ifdef CT_R_BASE64_DECODE_ERROR {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR}, #else - {"BASE64_DECODE_ERROR", ERR_LIB_CT, 108}, + {"BASE64_DECODE_ERROR", 50, 108}, #endif #ifdef CT_R_INVALID_LOG_ID_LENGTH {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH}, #else - {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, 100}, + {"INVALID_LOG_ID_LENGTH", 50, 100}, #endif #ifdef CT_R_LOG_CONF_INVALID {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID}, #else - {"LOG_CONF_INVALID", ERR_LIB_CT, 109}, + {"LOG_CONF_INVALID", 50, 109}, #endif #ifdef CT_R_LOG_CONF_INVALID_KEY {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY}, #else - {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, 110}, + {"LOG_CONF_INVALID_KEY", 50, 110}, #endif #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION}, #else - {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, 111}, + {"LOG_CONF_MISSING_DESCRIPTION", 50, 111}, #endif #ifdef CT_R_LOG_CONF_MISSING_KEY {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY}, #else - {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, 112}, + {"LOG_CONF_MISSING_KEY", 50, 112}, #endif #ifdef CT_R_LOG_KEY_INVALID {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID}, #else - {"LOG_KEY_INVALID", ERR_LIB_CT, 113}, + {"LOG_KEY_INVALID", 50, 113}, #endif #ifdef CT_R_SCT_FUTURE_TIMESTAMP {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP}, #else - {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, 116}, + {"SCT_FUTURE_TIMESTAMP", 50, 116}, #endif #ifdef CT_R_SCT_INVALID {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID}, #else - {"SCT_INVALID", ERR_LIB_CT, 104}, + {"SCT_INVALID", 50, 104}, #endif #ifdef CT_R_SCT_INVALID_SIGNATURE {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE}, #else - {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, 107}, + {"SCT_INVALID_SIGNATURE", 50, 107}, #endif #ifdef CT_R_SCT_LIST_INVALID {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID}, #else - {"SCT_LIST_INVALID", ERR_LIB_CT, 105}, + {"SCT_LIST_INVALID", 50, 105}, #endif #ifdef CT_R_SCT_LOG_ID_MISMATCH {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH}, #else - {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, 114}, + {"SCT_LOG_ID_MISMATCH", 50, 114}, #endif #ifdef CT_R_SCT_NOT_SET {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET}, #else - {"SCT_NOT_SET", ERR_LIB_CT, 106}, + {"SCT_NOT_SET", 50, 106}, #endif #ifdef CT_R_SCT_UNSUPPORTED_VERSION {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION}, #else - {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, 115}, + {"SCT_UNSUPPORTED_VERSION", 50, 115}, #endif #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID}, #else - {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, 101}, + {"UNRECOGNIZED_SIGNATURE_NID", 50, 101}, #endif #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE}, #else - {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, 102}, + {"UNSUPPORTED_ENTRY_TYPE", 50, 102}, #endif #ifdef CT_R_UNSUPPORTED_VERSION {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION}, #else - {"UNSUPPORTED_VERSION", ERR_LIB_CT, 103}, + {"UNSUPPORTED_VERSION", 50, 103}, #endif #ifdef DH_R_BAD_GENERATOR {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR}, #else - {"BAD_GENERATOR", ERR_LIB_DH, 101}, + {"BAD_GENERATOR", 5, 101}, #endif #ifdef DH_R_BN_DECODE_ERROR {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR}, #else - {"BN_DECODE_ERROR", ERR_LIB_DH, 109}, + {"BN_DECODE_ERROR", 5, 109}, #endif #ifdef DH_R_BN_ERROR {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR}, #else - {"BN_ERROR", ERR_LIB_DH, 106}, + {"BN_ERROR", 5, 106}, #endif #ifdef DH_R_CHECK_INVALID_J_VALUE {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE}, #else - {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, 115}, + {"CHECK_INVALID_J_VALUE", 5, 115}, #endif #ifdef DH_R_CHECK_INVALID_Q_VALUE {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE}, #else - {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, 116}, + {"CHECK_INVALID_Q_VALUE", 5, 116}, #endif #ifdef DH_R_CHECK_PUBKEY_INVALID {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID}, #else - {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, 122}, + {"CHECK_PUBKEY_INVALID", 5, 122}, #endif #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE}, #else - {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, 123}, + {"CHECK_PUBKEY_TOO_LARGE", 5, 123}, #endif #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL}, #else - {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, 124}, + {"CHECK_PUBKEY_TOO_SMALL", 5, 124}, #endif #ifdef DH_R_CHECK_P_NOT_PRIME {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME}, #else - {"CHECK_P_NOT_PRIME", ERR_LIB_DH, 117}, + {"CHECK_P_NOT_PRIME", 5, 117}, #endif #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME}, #else - {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, 118}, + {"CHECK_P_NOT_SAFE_PRIME", 5, 118}, #endif #ifdef DH_R_CHECK_Q_NOT_PRIME {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME}, #else - {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, 119}, + {"CHECK_Q_NOT_PRIME", 5, 119}, #endif #ifdef DH_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_DH, 104}, + {"DECODE_ERROR", 5, 104}, #endif #ifdef DH_R_INVALID_PARAMETER_NAME {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME}, #else - {"INVALID_PARAMETER_NAME", ERR_LIB_DH, 110}, + {"INVALID_PARAMETER_NAME", 5, 110}, #endif #ifdef DH_R_INVALID_PARAMETER_NID {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID}, #else - {"INVALID_PARAMETER_NID", ERR_LIB_DH, 114}, + {"INVALID_PARAMETER_NID", 5, 114}, #endif #ifdef DH_R_INVALID_PUBKEY {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY}, #else - {"INVALID_PUBKEY", ERR_LIB_DH, 102}, + {"INVALID_PUBKEY", 5, 102}, #endif #ifdef DH_R_KDF_PARAMETER_ERROR {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR}, #else - {"KDF_PARAMETER_ERROR", ERR_LIB_DH, 112}, + {"KDF_PARAMETER_ERROR", 5, 112}, #endif #ifdef DH_R_KEYS_NOT_SET {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET}, #else - {"KEYS_NOT_SET", ERR_LIB_DH, 108}, + {"KEYS_NOT_SET", 5, 108}, #endif #ifdef DH_R_MISSING_PUBKEY {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY}, #else - {"MISSING_PUBKEY", ERR_LIB_DH, 125}, + {"MISSING_PUBKEY", 5, 125}, #endif #ifdef DH_R_MODULUS_TOO_LARGE {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE}, #else - {"MODULUS_TOO_LARGE", ERR_LIB_DH, 103}, + {"MODULUS_TOO_LARGE", 5, 103}, #endif #ifdef DH_R_NOT_SUITABLE_GENERATOR {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR}, #else - {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, 120}, + {"NOT_SUITABLE_GENERATOR", 5, 120}, #endif #ifdef DH_R_NO_PARAMETERS_SET {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET}, #else - {"NO_PARAMETERS_SET", ERR_LIB_DH, 107}, + {"NO_PARAMETERS_SET", 5, 107}, #endif #ifdef DH_R_NO_PRIVATE_VALUE {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE}, #else - {"NO_PRIVATE_VALUE", ERR_LIB_DH, 100}, + {"NO_PRIVATE_VALUE", 5, 100}, #endif #ifdef DH_R_PARAMETER_ENCODING_ERROR {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR}, #else - {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, 105}, + {"PARAMETER_ENCODING_ERROR", 5, 105}, #endif #ifdef DH_R_PEER_KEY_ERROR {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR}, #else - {"PEER_KEY_ERROR", ERR_LIB_DH, 111}, + {"PEER_KEY_ERROR", 5, 111}, #endif #ifdef DH_R_SHARED_INFO_ERROR {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR}, #else - {"SHARED_INFO_ERROR", ERR_LIB_DH, 113}, + {"SHARED_INFO_ERROR", 5, 113}, #endif #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR}, #else - {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, 121}, + {"UNABLE_TO_CHECK_GENERATOR", 5, 121}, #endif #ifdef DSA_R_BAD_Q_VALUE {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE}, #else - {"BAD_Q_VALUE", ERR_LIB_DSA, 102}, + {"BAD_Q_VALUE", 10, 102}, #endif #ifdef DSA_R_BN_DECODE_ERROR {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR}, #else - {"BN_DECODE_ERROR", ERR_LIB_DSA, 108}, + {"BN_DECODE_ERROR", 10, 108}, #endif #ifdef DSA_R_BN_ERROR {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR}, #else - {"BN_ERROR", ERR_LIB_DSA, 109}, + {"BN_ERROR", 10, 109}, #endif #ifdef DSA_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_DSA, 104}, + {"DECODE_ERROR", 10, 104}, #endif #ifdef DSA_R_INVALID_DIGEST_TYPE {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE}, #else - {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, 106}, + {"INVALID_DIGEST_TYPE", 10, 106}, #endif #ifdef DSA_R_INVALID_PARAMETERS {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS}, #else - {"INVALID_PARAMETERS", ERR_LIB_DSA, 112}, + {"INVALID_PARAMETERS", 10, 112}, #endif #ifdef DSA_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_DSA, 101}, + {"MISSING_PARAMETERS", 10, 101}, #endif #ifdef DSA_R_MISSING_PRIVATE_KEY {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY}, #else - {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, 111}, + {"MISSING_PRIVATE_KEY", 10, 111}, #endif #ifdef DSA_R_MODULUS_TOO_LARGE {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE}, #else - {"MODULUS_TOO_LARGE", ERR_LIB_DSA, 103}, + {"MODULUS_TOO_LARGE", 10, 103}, #endif #ifdef DSA_R_NO_PARAMETERS_SET {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET}, #else - {"NO_PARAMETERS_SET", ERR_LIB_DSA, 107}, + {"NO_PARAMETERS_SET", 10, 107}, #endif #ifdef DSA_R_PARAMETER_ENCODING_ERROR {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR}, #else - {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, 105}, + {"PARAMETER_ENCODING_ERROR", 10, 105}, #endif #ifdef DSA_R_Q_NOT_PRIME {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME}, #else - {"Q_NOT_PRIME", ERR_LIB_DSA, 113}, + {"Q_NOT_PRIME", 10, 113}, #endif #ifdef DSA_R_SEED_LEN_SMALL {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL}, #else - {"SEED_LEN_SMALL", ERR_LIB_DSA, 110}, + {"SEED_LEN_SMALL", 10, 110}, #endif #ifdef EC_R_ASN1_ERROR {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR}, #else - {"ASN1_ERROR", ERR_LIB_EC, 115}, + {"ASN1_ERROR", 16, 115}, #endif #ifdef EC_R_BAD_SIGNATURE {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE}, #else - {"BAD_SIGNATURE", ERR_LIB_EC, 156}, + {"BAD_SIGNATURE", 16, 156}, #endif #ifdef EC_R_BIGNUM_OUT_OF_RANGE {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE}, #else - {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, 144}, + {"BIGNUM_OUT_OF_RANGE", 16, 144}, #endif #ifdef EC_R_BUFFER_TOO_SMALL {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL}, #else - {"BUFFER_TOO_SMALL", ERR_LIB_EC, 100}, + {"BUFFER_TOO_SMALL", 16, 100}, #endif #ifdef EC_R_CANNOT_INVERT {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT}, #else - {"CANNOT_INVERT", ERR_LIB_EC, 165}, + {"CANNOT_INVERT", 16, 165}, #endif #ifdef EC_R_COORDINATES_OUT_OF_RANGE {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE}, #else - {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, 146}, + {"COORDINATES_OUT_OF_RANGE", 16, 146}, #endif #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH}, #else - {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, 160}, + {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160}, #endif #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING}, #else - {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, 159}, + {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159}, #endif #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE}, #else - {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 117}, + {"D2I_ECPKPARAMETERS_FAILURE", 16, 117}, #endif #ifdef EC_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_EC, 142}, + {"DECODE_ERROR", 16, 142}, #endif #ifdef EC_R_DISCRIMINANT_IS_ZERO {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO}, #else - {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, 118}, + {"DISCRIMINANT_IS_ZERO", 16, 118}, #endif #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE}, #else - {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, 119}, + {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119}, #endif #ifdef EC_R_FIELD_TOO_LARGE {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE}, #else - {"FIELD_TOO_LARGE", ERR_LIB_EC, 143}, + {"FIELD_TOO_LARGE", 16, 143}, #endif #ifdef EC_R_GF2M_NOT_SUPPORTED {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED}, #else - {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, 147}, + {"GF2M_NOT_SUPPORTED", 16, 147}, #endif #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE}, #else - {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, 120}, + {"GROUP2PKPARAMETERS_FAILURE", 16, 120}, #endif #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE}, #else - {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 121}, + {"I2D_ECPKPARAMETERS_FAILURE", 16, 121}, #endif #ifdef EC_R_INCOMPATIBLE_OBJECTS {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS}, #else - {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, 101}, + {"INCOMPATIBLE_OBJECTS", 16, 101}, #endif #ifdef EC_R_INVALID_ARGUMENT {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT}, #else - {"INVALID_ARGUMENT", ERR_LIB_EC, 112}, + {"INVALID_ARGUMENT", 16, 112}, #endif #ifdef EC_R_INVALID_COMPRESSED_POINT {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT}, #else - {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, 110}, + {"INVALID_COMPRESSED_POINT", 16, 110}, #endif #ifdef EC_R_INVALID_COMPRESSION_BIT {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT}, #else - {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, 109}, + {"INVALID_COMPRESSION_BIT", 16, 109}, #endif #ifdef EC_R_INVALID_CURVE {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE}, #else - {"INVALID_CURVE", ERR_LIB_EC, 141}, + {"INVALID_CURVE", 16, 141}, #endif #ifdef EC_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_EC, 151}, + {"INVALID_DIGEST", 16, 151}, #endif #ifdef EC_R_INVALID_DIGEST_TYPE {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE}, #else - {"INVALID_DIGEST_TYPE", ERR_LIB_EC, 138}, + {"INVALID_DIGEST_TYPE", 16, 138}, #endif #ifdef EC_R_INVALID_ENCODING {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING}, #else - {"INVALID_ENCODING", ERR_LIB_EC, 102}, + {"INVALID_ENCODING", 16, 102}, #endif #ifdef EC_R_INVALID_FIELD {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD}, #else - {"INVALID_FIELD", ERR_LIB_EC, 103}, + {"INVALID_FIELD", 16, 103}, #endif #ifdef EC_R_INVALID_FORM {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM}, #else - {"INVALID_FORM", ERR_LIB_EC, 104}, + {"INVALID_FORM", 16, 104}, #endif #ifdef EC_R_INVALID_GROUP_ORDER {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER}, #else - {"INVALID_GROUP_ORDER", ERR_LIB_EC, 122}, + {"INVALID_GROUP_ORDER", 16, 122}, #endif #ifdef EC_R_INVALID_KEY {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY}, #else - {"INVALID_KEY", ERR_LIB_EC, 116}, + {"INVALID_KEY", 16, 116}, #endif #ifdef EC_R_INVALID_OUTPUT_LENGTH {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH}, #else - {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, 161}, + {"INVALID_OUTPUT_LENGTH", 16, 161}, #endif #ifdef EC_R_INVALID_PEER_KEY {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY}, #else - {"INVALID_PEER_KEY", ERR_LIB_EC, 133}, + {"INVALID_PEER_KEY", 16, 133}, #endif #ifdef EC_R_INVALID_PENTANOMIAL_BASIS {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS}, #else - {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, 132}, + {"INVALID_PENTANOMIAL_BASIS", 16, 132}, #endif #ifdef EC_R_INVALID_PRIVATE_KEY {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY}, #else - {"INVALID_PRIVATE_KEY", ERR_LIB_EC, 123}, + {"INVALID_PRIVATE_KEY", 16, 123}, #endif #ifdef EC_R_INVALID_TRINOMIAL_BASIS {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS}, #else - {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, 137}, + {"INVALID_TRINOMIAL_BASIS", 16, 137}, #endif #ifdef EC_R_KDF_PARAMETER_ERROR {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR}, #else - {"KDF_PARAMETER_ERROR", ERR_LIB_EC, 148}, + {"KDF_PARAMETER_ERROR", 16, 148}, #endif #ifdef EC_R_KEYS_NOT_SET {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET}, #else - {"KEYS_NOT_SET", ERR_LIB_EC, 140}, + {"KEYS_NOT_SET", 16, 140}, #endif #ifdef EC_R_LADDER_POST_FAILURE {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE}, #else - {"LADDER_POST_FAILURE", ERR_LIB_EC, 136}, + {"LADDER_POST_FAILURE", 16, 136}, #endif #ifdef EC_R_LADDER_PRE_FAILURE {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE}, #else - {"LADDER_PRE_FAILURE", ERR_LIB_EC, 153}, + {"LADDER_PRE_FAILURE", 16, 153}, #endif #ifdef EC_R_LADDER_STEP_FAILURE {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE}, #else - {"LADDER_STEP_FAILURE", ERR_LIB_EC, 162}, + {"LADDER_STEP_FAILURE", 16, 162}, #endif #ifdef EC_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_EC, 124}, + {"MISSING_PARAMETERS", 16, 124}, #endif #ifdef EC_R_MISSING_PRIVATE_KEY {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY}, #else - {"MISSING_PRIVATE_KEY", ERR_LIB_EC, 125}, + {"MISSING_PRIVATE_KEY", 16, 125}, #endif #ifdef EC_R_NEED_NEW_SETUP_VALUES {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES}, #else - {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, 157}, + {"NEED_NEW_SETUP_VALUES", 16, 157}, #endif #ifdef EC_R_NOT_A_NIST_PRIME {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME}, #else - {"NOT_A_NIST_PRIME", ERR_LIB_EC, 135}, + {"NOT_A_NIST_PRIME", 16, 135}, #endif #ifdef EC_R_NOT_IMPLEMENTED {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED}, #else - {"NOT_IMPLEMENTED", ERR_LIB_EC, 126}, + {"NOT_IMPLEMENTED", 16, 126}, #endif #ifdef EC_R_NOT_INITIALIZED {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED}, #else - {"NOT_INITIALIZED", ERR_LIB_EC, 111}, + {"NOT_INITIALIZED", 16, 111}, #endif #ifdef EC_R_NO_PARAMETERS_SET {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET}, #else - {"NO_PARAMETERS_SET", ERR_LIB_EC, 139}, + {"NO_PARAMETERS_SET", 16, 139}, #endif #ifdef EC_R_NO_PRIVATE_VALUE {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE}, #else - {"NO_PRIVATE_VALUE", ERR_LIB_EC, 154}, + {"NO_PRIVATE_VALUE", 16, 154}, #endif #ifdef EC_R_OPERATION_NOT_SUPPORTED {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED}, #else - {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, 152}, + {"OPERATION_NOT_SUPPORTED", 16, 152}, #endif #ifdef EC_R_PASSED_NULL_PARAMETER {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER}, #else - {"PASSED_NULL_PARAMETER", ERR_LIB_EC, 134}, + {"PASSED_NULL_PARAMETER", 16, 134}, #endif #ifdef EC_R_PEER_KEY_ERROR {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR}, #else - {"PEER_KEY_ERROR", ERR_LIB_EC, 149}, + {"PEER_KEY_ERROR", 16, 149}, #endif #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE}, #else - {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, 127}, + {"PKPARAMETERS2GROUP_FAILURE", 16, 127}, #endif #ifdef EC_R_POINT_ARITHMETIC_FAILURE {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE}, #else - {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, 155}, + {"POINT_ARITHMETIC_FAILURE", 16, 155}, #endif #ifdef EC_R_POINT_AT_INFINITY {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY}, #else - {"POINT_AT_INFINITY", ERR_LIB_EC, 106}, + {"POINT_AT_INFINITY", 16, 106}, #endif #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE}, #else - {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, 163}, + {"POINT_COORDINATES_BLIND_FAILURE", 16, 163}, #endif #ifdef EC_R_POINT_IS_NOT_ON_CURVE {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE}, #else - {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, 107}, + {"POINT_IS_NOT_ON_CURVE", 16, 107}, #endif #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED}, #else - {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, 158}, + {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158}, #endif #ifdef EC_R_SHARED_INFO_ERROR {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR}, #else - {"SHARED_INFO_ERROR", ERR_LIB_EC, 150}, + {"SHARED_INFO_ERROR", 16, 150}, #endif #ifdef EC_R_SLOT_FULL {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL}, #else - {"SLOT_FULL", ERR_LIB_EC, 108}, + {"SLOT_FULL", 16, 108}, #endif #ifdef EC_R_UNDEFINED_GENERATOR {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR}, #else - {"UNDEFINED_GENERATOR", ERR_LIB_EC, 113}, + {"UNDEFINED_GENERATOR", 16, 113}, #endif #ifdef EC_R_UNDEFINED_ORDER {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER}, #else - {"UNDEFINED_ORDER", ERR_LIB_EC, 128}, + {"UNDEFINED_ORDER", 16, 128}, #endif #ifdef EC_R_UNKNOWN_COFACTOR {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR}, #else - {"UNKNOWN_COFACTOR", ERR_LIB_EC, 164}, + {"UNKNOWN_COFACTOR", 16, 164}, #endif #ifdef EC_R_UNKNOWN_GROUP {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP}, #else - {"UNKNOWN_GROUP", ERR_LIB_EC, 129}, + {"UNKNOWN_GROUP", 16, 129}, #endif #ifdef EC_R_UNKNOWN_ORDER {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER}, #else - {"UNKNOWN_ORDER", ERR_LIB_EC, 114}, + {"UNKNOWN_ORDER", 16, 114}, #endif #ifdef EC_R_UNSUPPORTED_FIELD {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD}, #else - {"UNSUPPORTED_FIELD", ERR_LIB_EC, 131}, + {"UNSUPPORTED_FIELD", 16, 131}, #endif #ifdef EC_R_WRONG_CURVE_PARAMETERS {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS}, #else - {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, 145}, + {"WRONG_CURVE_PARAMETERS", 16, 145}, #endif #ifdef EC_R_WRONG_ORDER {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER}, #else - {"WRONG_ORDER", ERR_LIB_EC, 130}, + {"WRONG_ORDER", 16, 130}, #endif #ifdef ENGINE_R_ALREADY_LOADED {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED}, #else - {"ALREADY_LOADED", ERR_LIB_ENGINE, 100}, + {"ALREADY_LOADED", 38, 100}, #endif #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER}, #else - {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, 133}, + {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133}, #endif #ifdef ENGINE_R_CMD_NOT_EXECUTABLE {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE}, #else - {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, 134}, + {"CMD_NOT_EXECUTABLE", 38, 134}, #endif #ifdef ENGINE_R_COMMAND_TAKES_INPUT {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT}, #else - {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, 135}, + {"COMMAND_TAKES_INPUT", 38, 135}, #endif #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT}, #else - {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, 136}, + {"COMMAND_TAKES_NO_INPUT", 38, 136}, #endif #ifdef ENGINE_R_CONFLICTING_ENGINE_ID {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID}, #else - {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, 103}, + {"CONFLICTING_ENGINE_ID", 38, 103}, #endif #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED}, #else - {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, 119}, + {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119}, #endif #ifdef ENGINE_R_DSO_FAILURE {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE}, #else - {"DSO_FAILURE", ERR_LIB_ENGINE, 104}, + {"DSO_FAILURE", 38, 104}, #endif #ifdef ENGINE_R_DSO_NOT_FOUND {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND}, #else - {"DSO_NOT_FOUND", ERR_LIB_ENGINE, 132}, + {"DSO_NOT_FOUND", 38, 132}, #endif #ifdef ENGINE_R_ENGINES_SECTION_ERROR {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR}, #else - {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, 148}, + {"ENGINES_SECTION_ERROR", 38, 148}, #endif #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR}, #else - {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, 102}, + {"ENGINE_CONFIGURATION_ERROR", 38, 102}, #endif #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST}, #else - {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, 105}, + {"ENGINE_IS_NOT_IN_LIST", 38, 105}, #endif #ifdef ENGINE_R_ENGINE_SECTION_ERROR {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR}, #else - {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, 149}, + {"ENGINE_SECTION_ERROR", 38, 149}, #endif #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY}, #else - {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, 128}, + {"FAILED_LOADING_PRIVATE_KEY", 38, 128}, #endif #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY}, #else - {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, 129}, + {"FAILED_LOADING_PUBLIC_KEY", 38, 129}, #endif #ifdef ENGINE_R_FINISH_FAILED {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED}, #else - {"FINISH_FAILED", ERR_LIB_ENGINE, 106}, + {"FINISH_FAILED", 38, 106}, #endif #ifdef ENGINE_R_ID_OR_NAME_MISSING {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING}, #else - {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, 108}, + {"ID_OR_NAME_MISSING", 38, 108}, #endif #ifdef ENGINE_R_INIT_FAILED {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED}, #else - {"INIT_FAILED", ERR_LIB_ENGINE, 109}, + {"INIT_FAILED", 38, 109}, #endif #ifdef ENGINE_R_INTERNAL_LIST_ERROR {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR}, #else - {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, 110}, + {"INTERNAL_LIST_ERROR", 38, 110}, #endif #ifdef ENGINE_R_INVALID_ARGUMENT {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT}, #else - {"INVALID_ARGUMENT", ERR_LIB_ENGINE, 143}, + {"INVALID_ARGUMENT", 38, 143}, #endif #ifdef ENGINE_R_INVALID_CMD_NAME {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME}, #else - {"INVALID_CMD_NAME", ERR_LIB_ENGINE, 137}, + {"INVALID_CMD_NAME", 38, 137}, #endif #ifdef ENGINE_R_INVALID_CMD_NUMBER {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER}, #else - {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, 138}, + {"INVALID_CMD_NUMBER", 38, 138}, #endif #ifdef ENGINE_R_INVALID_INIT_VALUE {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE}, #else - {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, 151}, + {"INVALID_INIT_VALUE", 38, 151}, #endif #ifdef ENGINE_R_INVALID_STRING {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING}, #else - {"INVALID_STRING", ERR_LIB_ENGINE, 150}, + {"INVALID_STRING", 38, 150}, #endif #ifdef ENGINE_R_NOT_INITIALISED {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED}, #else - {"NOT_INITIALISED", ERR_LIB_ENGINE, 117}, + {"NOT_INITIALISED", 38, 117}, #endif #ifdef ENGINE_R_NOT_LOADED {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED}, #else - {"NOT_LOADED", ERR_LIB_ENGINE, 112}, + {"NOT_LOADED", 38, 112}, #endif #ifdef ENGINE_R_NO_CONTROL_FUNCTION {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION}, #else - {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, 120}, + {"NO_CONTROL_FUNCTION", 38, 120}, #endif #ifdef ENGINE_R_NO_INDEX {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX}, #else - {"NO_INDEX", ERR_LIB_ENGINE, 144}, + {"NO_INDEX", 38, 144}, #endif #ifdef ENGINE_R_NO_LOAD_FUNCTION {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION}, #else - {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, 125}, + {"NO_LOAD_FUNCTION", 38, 125}, #endif #ifdef ENGINE_R_NO_REFERENCE {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE}, #else - {"NO_REFERENCE", ERR_LIB_ENGINE, 130}, + {"NO_REFERENCE", 38, 130}, #endif #ifdef ENGINE_R_NO_SUCH_ENGINE {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE}, #else - {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, 116}, + {"NO_SUCH_ENGINE", 38, 116}, #endif #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER}, #else - {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, 146}, + {"UNIMPLEMENTED_CIPHER", 38, 146}, #endif #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST}, #else - {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, 147}, + {"UNIMPLEMENTED_DIGEST", 38, 147}, #endif #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD}, #else - {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, 101}, + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101}, #endif #ifdef ENGINE_R_VERSION_INCOMPATIBILITY {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY}, #else - {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, 145}, + {"VERSION_INCOMPATIBILITY", 38, 145}, #endif #ifdef EVP_R_AES_KEY_SETUP_FAILED {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED}, #else - {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, 143}, + {"AES_KEY_SETUP_FAILED", 6, 143}, #endif #ifdef EVP_R_ARIA_KEY_SETUP_FAILED {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED}, #else - {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 176}, + {"ARIA_KEY_SETUP_FAILED", 6, 176}, #endif #ifdef EVP_R_BAD_DECRYPT {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT}, #else - {"BAD_DECRYPT", ERR_LIB_EVP, 100}, + {"BAD_DECRYPT", 6, 100}, #endif #ifdef EVP_R_BAD_KEY_LENGTH {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH}, #else - {"BAD_KEY_LENGTH", ERR_LIB_EVP, 195}, + {"BAD_KEY_LENGTH", 6, 195}, #endif #ifdef EVP_R_BUFFER_TOO_SMALL {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL}, #else - {"BUFFER_TOO_SMALL", ERR_LIB_EVP, 155}, + {"BUFFER_TOO_SMALL", 6, 155}, #endif #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED}, #else - {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 157}, + {"CAMELLIA_KEY_SETUP_FAILED", 6, 157}, #endif #ifdef EVP_R_CIPHER_PARAMETER_ERROR {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR}, #else - {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, 122}, + {"CIPHER_PARAMETER_ERROR", 6, 122}, #endif #ifdef EVP_R_COMMAND_NOT_SUPPORTED {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED}, #else - {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, 147}, + {"COMMAND_NOT_SUPPORTED", 6, 147}, #endif #ifdef EVP_R_COPY_ERROR {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR}, #else - {"COPY_ERROR", ERR_LIB_EVP, 173}, + {"COPY_ERROR", 6, 173}, #endif #ifdef EVP_R_CTRL_NOT_IMPLEMENTED {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED}, #else - {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, 132}, + {"CTRL_NOT_IMPLEMENTED", 6, 132}, #endif #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED}, #else - {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, 133}, + {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133}, #endif #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH}, #else - {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, 138}, + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138}, #endif #ifdef EVP_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_EVP, 114}, + {"DECODE_ERROR", 6, 114}, #endif #ifdef EVP_R_DIFFERENT_KEY_TYPES {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES}, #else - {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, 101}, + {"DIFFERENT_KEY_TYPES", 6, 101}, #endif #ifdef EVP_R_DIFFERENT_PARAMETERS {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS}, #else - {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, 153}, + {"DIFFERENT_PARAMETERS", 6, 153}, #endif #ifdef EVP_R_ERROR_LOADING_SECTION {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION}, #else - {"ERROR_LOADING_SECTION", ERR_LIB_EVP, 165}, + {"ERROR_LOADING_SECTION", 6, 165}, #endif #ifdef EVP_R_ERROR_SETTING_FIPS_MODE {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE}, #else - {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, 166}, + {"ERROR_SETTING_FIPS_MODE", 6, 166}, #endif #ifdef EVP_R_EXPECTING_AN_HMAC_KEY {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY}, #else - {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, 174}, + {"EXPECTING_AN_HMAC_KEY", 6, 174}, #endif #ifdef EVP_R_EXPECTING_AN_RSA_KEY {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY}, #else - {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, 127}, + {"EXPECTING_AN_RSA_KEY", 6, 127}, #endif #ifdef EVP_R_EXPECTING_A_DH_KEY {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY}, #else - {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, 128}, + {"EXPECTING_A_DH_KEY", 6, 128}, #endif #ifdef EVP_R_EXPECTING_A_DSA_KEY {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY}, #else - {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, 129}, + {"EXPECTING_A_DSA_KEY", 6, 129}, #endif #ifdef EVP_R_EXPECTING_A_EC_KEY {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY}, #else - {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, 142}, + {"EXPECTING_A_EC_KEY", 6, 142}, #endif #ifdef EVP_R_EXPECTING_A_POLY1305_KEY {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY}, #else - {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, 164}, + {"EXPECTING_A_POLY1305_KEY", 6, 164}, #endif #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY}, #else - {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, 175}, + {"EXPECTING_A_SIPHASH_KEY", 6, 175}, #endif #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED}, #else - {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, 167}, + {"FIPS_MODE_NOT_SUPPORTED", 6, 167}, #endif #ifdef EVP_R_GET_RAW_KEY_FAILED {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED}, #else - {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, 182}, + {"GET_RAW_KEY_FAILED", 6, 182}, #endif #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS}, #else - {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, 171}, + {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171}, #endif #ifdef EVP_R_INITIALIZATION_ERROR {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR}, #else - {"INITIALIZATION_ERROR", ERR_LIB_EVP, 134}, + {"INITIALIZATION_ERROR", 6, 134}, #endif #ifdef EVP_R_INPUT_NOT_INITIALIZED {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED}, #else - {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, 111}, + {"INPUT_NOT_INITIALIZED", 6, 111}, #endif #ifdef EVP_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_EVP, 152}, + {"INVALID_DIGEST", 6, 152}, #endif #ifdef EVP_R_INVALID_FIPS_MODE {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE}, #else - {"INVALID_FIPS_MODE", ERR_LIB_EVP, 168}, + {"INVALID_FIPS_MODE", 6, 168}, #endif #ifdef EVP_R_INVALID_IV_LENGTH {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH}, #else - {"INVALID_IV_LENGTH", ERR_LIB_EVP, 194}, + {"INVALID_IV_LENGTH", 6, 194}, #endif #ifdef EVP_R_INVALID_KEY {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY}, #else - {"INVALID_KEY", ERR_LIB_EVP, 163}, + {"INVALID_KEY", 6, 163}, #endif #ifdef EVP_R_INVALID_KEY_LENGTH {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH}, #else - {"INVALID_KEY_LENGTH", ERR_LIB_EVP, 130}, + {"INVALID_KEY_LENGTH", 6, 130}, #endif #ifdef EVP_R_INVALID_OPERATION {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION}, #else - {"INVALID_OPERATION", ERR_LIB_EVP, 148}, + {"INVALID_OPERATION", 6, 148}, #endif #ifdef EVP_R_KEYGEN_FAILURE {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE}, #else - {"KEYGEN_FAILURE", ERR_LIB_EVP, 120}, + {"KEYGEN_FAILURE", 6, 120}, #endif #ifdef EVP_R_KEY_SETUP_FAILED {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED}, #else - {"KEY_SETUP_FAILED", ERR_LIB_EVP, 180}, + {"KEY_SETUP_FAILED", 6, 180}, #endif #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED}, #else - {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, 172}, + {"MEMORY_LIMIT_EXCEEDED", 6, 172}, #endif #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL}, #else - {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, 159}, + {"MESSAGE_DIGEST_IS_NULL", 6, 159}, #endif #ifdef EVP_R_METHOD_NOT_SUPPORTED {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED}, #else - {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, 144}, + {"METHOD_NOT_SUPPORTED", 6, 144}, #endif #ifdef EVP_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_EVP, 103}, + {"MISSING_PARAMETERS", 6, 103}, #endif #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH}, #else - {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, 178}, + {"NOT_XOF_OR_INVALID_LENGTH", 6, 178}, #endif #ifdef EVP_R_NO_CIPHER_SET {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET}, #else - {"NO_CIPHER_SET", ERR_LIB_EVP, 131}, + {"NO_CIPHER_SET", 6, 131}, #endif #ifdef EVP_R_NO_DEFAULT_DIGEST {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST}, #else - {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, 158}, + {"NO_DEFAULT_DIGEST", 6, 158}, #endif #ifdef EVP_R_NO_DIGEST_SET {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET}, #else - {"NO_DIGEST_SET", ERR_LIB_EVP, 139}, + {"NO_DIGEST_SET", 6, 139}, #endif #ifdef EVP_R_NO_KEY_SET {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET}, #else - {"NO_KEY_SET", ERR_LIB_EVP, 154}, + {"NO_KEY_SET", 6, 154}, #endif #ifdef EVP_R_NO_OPERATION_SET {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET}, #else - {"NO_OPERATION_SET", ERR_LIB_EVP, 149}, + {"NO_OPERATION_SET", 6, 149}, #endif #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED}, #else - {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, 177}, + {"ONLY_ONESHOT_SUPPORTED", 6, 177}, #endif #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, #else - {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, 150}, + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150}, #endif #ifdef EVP_R_OPERATON_NOT_INITIALIZED {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED}, #else - {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, 151}, + {"OPERATON_NOT_INITIALIZED", 6, 151}, #endif #ifdef EVP_R_PARTIALLY_OVERLAPPING {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING}, #else - {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, 162}, + {"PARTIALLY_OVERLAPPING", 6, 162}, #endif #ifdef EVP_R_PBKDF2_ERROR {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR}, #else - {"PBKDF2_ERROR", ERR_LIB_EVP, 181}, + {"PBKDF2_ERROR", 6, 181}, #endif #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED}, #else - {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, 179}, + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179}, #endif #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR}, #else - {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, 145}, + {"PRIVATE_KEY_DECODE_ERROR", 6, 145}, #endif #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR}, #else - {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, 146}, + {"PRIVATE_KEY_ENCODE_ERROR", 6, 146}, #endif #ifdef EVP_R_PUBLIC_KEY_NOT_RSA {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA}, #else - {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, 106}, + {"PUBLIC_KEY_NOT_RSA", 6, 106}, #endif #ifdef EVP_R_UNKNOWN_CIPHER {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER}, #else - {"UNKNOWN_CIPHER", ERR_LIB_EVP, 160}, + {"UNKNOWN_CIPHER", 6, 160}, #endif #ifdef EVP_R_UNKNOWN_DIGEST {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST}, #else - {"UNKNOWN_DIGEST", ERR_LIB_EVP, 161}, + {"UNKNOWN_DIGEST", 6, 161}, #endif #ifdef EVP_R_UNKNOWN_OPTION {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION}, #else - {"UNKNOWN_OPTION", ERR_LIB_EVP, 169}, + {"UNKNOWN_OPTION", 6, 169}, #endif #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM}, #else - {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, 121}, + {"UNKNOWN_PBE_ALGORITHM", 6, 121}, #endif #ifdef EVP_R_UNSUPPORTED_ALGORITHM {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM}, #else - {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, 156}, + {"UNSUPPORTED_ALGORITHM", 6, 156}, #endif #ifdef EVP_R_UNSUPPORTED_CIPHER {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, 107}, + {"UNSUPPORTED_CIPHER", 6, 107}, #endif #ifdef EVP_R_UNSUPPORTED_KEYLENGTH {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH}, #else - {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, 123}, + {"UNSUPPORTED_KEYLENGTH", 6, 123}, #endif #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION}, #else - {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, 124}, + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124}, #endif #ifdef EVP_R_UNSUPPORTED_KEY_SIZE {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE}, #else - {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, 108}, + {"UNSUPPORTED_KEY_SIZE", 6, 108}, #endif #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, #else - {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, 135}, + {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135}, #endif #ifdef EVP_R_UNSUPPORTED_PRF {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF}, #else - {"UNSUPPORTED_PRF", ERR_LIB_EVP, 125}, + {"UNSUPPORTED_PRF", 6, 125}, #endif #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM}, #else - {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, 118}, + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118}, #endif #ifdef EVP_R_UNSUPPORTED_SALT_TYPE {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE}, #else - {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, 126}, + {"UNSUPPORTED_SALT_TYPE", 6, 126}, #endif #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED}, #else - {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, 170}, + {"WRAP_MODE_NOT_ALLOWED", 6, 170}, #endif #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH}, #else - {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, 109}, + {"WRONG_FINAL_BLOCK_LENGTH", 6, 109}, #endif #ifdef EVP_R_XTS_DUPLICATED_KEYS {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS}, #else - {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, 183}, + {"XTS_DUPLICATED_KEYS", 6, 183}, #endif #ifdef KDF_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_KDF, 100}, + {"INVALID_DIGEST", 52, 100}, #endif #ifdef KDF_R_MISSING_ITERATION_COUNT {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT}, #else - {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, 109}, + {"MISSING_ITERATION_COUNT", 52, 109}, #endif #ifdef KDF_R_MISSING_KEY {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY}, #else - {"MISSING_KEY", ERR_LIB_KDF, 104}, + {"MISSING_KEY", 52, 104}, #endif #ifdef KDF_R_MISSING_MESSAGE_DIGEST {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST}, #else - {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, 105}, + {"MISSING_MESSAGE_DIGEST", 52, 105}, #endif #ifdef KDF_R_MISSING_PARAMETER {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER}, #else - {"MISSING_PARAMETER", ERR_LIB_KDF, 101}, + {"MISSING_PARAMETER", 52, 101}, #endif #ifdef KDF_R_MISSING_PASS {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS}, #else - {"MISSING_PASS", ERR_LIB_KDF, 110}, + {"MISSING_PASS", 52, 110}, #endif #ifdef KDF_R_MISSING_SALT {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT}, #else - {"MISSING_SALT", ERR_LIB_KDF, 111}, + {"MISSING_SALT", 52, 111}, #endif #ifdef KDF_R_MISSING_SECRET {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET}, #else - {"MISSING_SECRET", ERR_LIB_KDF, 107}, + {"MISSING_SECRET", 52, 107}, #endif #ifdef KDF_R_MISSING_SEED {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED}, #else - {"MISSING_SEED", ERR_LIB_KDF, 106}, + {"MISSING_SEED", 52, 106}, #endif #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE}, #else - {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, 103}, + {"UNKNOWN_PARAMETER_TYPE", 52, 103}, #endif #ifdef KDF_R_VALUE_ERROR {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR}, #else - {"VALUE_ERROR", ERR_LIB_KDF, 108}, + {"VALUE_ERROR", 52, 108}, #endif #ifdef KDF_R_VALUE_MISSING {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING}, #else - {"VALUE_MISSING", ERR_LIB_KDF, 102}, + {"VALUE_MISSING", 52, 102}, #endif #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, 101}, + {"CERTIFICATE_VERIFY_ERROR", 39, 101}, #endif #ifdef OCSP_R_DIGEST_ERR {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR}, #else - {"DIGEST_ERR", ERR_LIB_OCSP, 102}, + {"DIGEST_ERR", 39, 102}, #endif #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD}, #else - {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, 122}, + {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122}, #endif #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD}, #else - {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, 123}, + {"ERROR_IN_THISUPDATE_FIELD", 39, 123}, #endif #ifdef OCSP_R_ERROR_PARSING_URL {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL}, #else - {"ERROR_PARSING_URL", ERR_LIB_OCSP, 121}, + {"ERROR_PARSING_URL", 39, 121}, #endif #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE}, #else - {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, 103}, + {"MISSING_OCSPSIGNING_USAGE", 39, 103}, #endif #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE}, #else - {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, 124}, + {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124}, #endif #ifdef OCSP_R_NOT_BASIC_RESPONSE {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE}, #else - {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, 104}, + {"NOT_BASIC_RESPONSE", 39, 104}, #endif #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN}, #else - {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, 105}, + {"NO_CERTIFICATES_IN_CHAIN", 39, 105}, #endif #ifdef OCSP_R_NO_RESPONSE_DATA {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA}, #else - {"NO_RESPONSE_DATA", ERR_LIB_OCSP, 108}, + {"NO_RESPONSE_DATA", 39, 108}, #endif #ifdef OCSP_R_NO_REVOKED_TIME {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME}, #else - {"NO_REVOKED_TIME", ERR_LIB_OCSP, 109}, + {"NO_REVOKED_TIME", 39, 109}, #endif #ifdef OCSP_R_NO_SIGNER_KEY {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY}, #else - {"NO_SIGNER_KEY", ERR_LIB_OCSP, 130}, + {"NO_SIGNER_KEY", 39, 130}, #endif #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, 110}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110}, #endif #ifdef OCSP_R_REQUEST_NOT_SIGNED {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED}, #else - {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, 128}, + {"REQUEST_NOT_SIGNED", 39, 128}, #endif #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA}, #else - {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, 111}, + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111}, #endif #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED}, #else - {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, 112}, + {"ROOT_CA_NOT_TRUSTED", 39, 112}, #endif #ifdef OCSP_R_SERVER_RESPONSE_ERROR {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR}, #else - {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, 114}, + {"SERVER_RESPONSE_ERROR", 39, 114}, #endif #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR}, #else - {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, 115}, + {"SERVER_RESPONSE_PARSE_ERROR", 39, 115}, #endif #ifdef OCSP_R_SIGNATURE_FAILURE {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE}, #else - {"SIGNATURE_FAILURE", ERR_LIB_OCSP, 117}, + {"SIGNATURE_FAILURE", 39, 117}, #endif #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, 118}, + {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118}, #endif #ifdef OCSP_R_STATUS_EXPIRED {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED}, #else - {"STATUS_EXPIRED", ERR_LIB_OCSP, 125}, + {"STATUS_EXPIRED", 39, 125}, #endif #ifdef OCSP_R_STATUS_NOT_YET_VALID {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID}, #else - {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, 126}, + {"STATUS_NOT_YET_VALID", 39, 126}, #endif #ifdef OCSP_R_STATUS_TOO_OLD {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD}, #else - {"STATUS_TOO_OLD", ERR_LIB_OCSP, 127}, + {"STATUS_TOO_OLD", 39, 127}, #endif #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST}, #else - {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, 119}, + {"UNKNOWN_MESSAGE_DIGEST", 39, 119}, #endif #ifdef OCSP_R_UNKNOWN_NID {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID}, #else - {"UNKNOWN_NID", ERR_LIB_OCSP, 120}, + {"UNKNOWN_NID", 39, 120}, #endif #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE}, #else - {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, 129}, + {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129}, #endif #ifdef PEM_R_BAD_BASE64_DECODE {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, #else - {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100}, + {"BAD_BASE64_DECODE", 9, 100}, #endif #ifdef PEM_R_BAD_DECRYPT {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, #else - {"BAD_DECRYPT", ERR_LIB_PEM, 101}, + {"BAD_DECRYPT", 9, 101}, #endif #ifdef PEM_R_BAD_END_LINE {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, #else - {"BAD_END_LINE", ERR_LIB_PEM, 102}, + {"BAD_END_LINE", 9, 102}, #endif #ifdef PEM_R_BAD_IV_CHARS {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, #else - {"BAD_IV_CHARS", ERR_LIB_PEM, 103}, + {"BAD_IV_CHARS", 9, 103}, #endif #ifdef PEM_R_BAD_MAGIC_NUMBER {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, #else - {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116}, + {"BAD_MAGIC_NUMBER", 9, 116}, #endif #ifdef PEM_R_BAD_PASSWORD_READ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, #else - {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104}, + {"BAD_PASSWORD_READ", 9, 104}, #endif #ifdef PEM_R_BAD_VERSION_NUMBER {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, #else - {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117}, + {"BAD_VERSION_NUMBER", 9, 117}, #endif #ifdef PEM_R_BIO_WRITE_FAILURE {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, #else - {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118}, + {"BIO_WRITE_FAILURE", 9, 118}, #endif #ifdef PEM_R_CIPHER_IS_NULL {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, #else - {"CIPHER_IS_NULL", ERR_LIB_PEM, 127}, + {"CIPHER_IS_NULL", 9, 127}, #endif #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, #else - {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115}, + {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115}, #endif #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, #else - {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119}, + {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119}, #endif #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, #else - {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120}, + {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120}, #endif #ifdef PEM_R_HEADER_TOO_LONG {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG}, #else - {"HEADER_TOO_LONG", ERR_LIB_PEM, 128}, + {"HEADER_TOO_LONG", 9, 128}, #endif #ifdef PEM_R_INCONSISTENT_HEADER {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, #else - {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121}, + {"INCONSISTENT_HEADER", 9, 121}, #endif #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, #else - {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122}, + {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122}, #endif #ifdef PEM_R_KEYBLOB_TOO_SHORT {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, #else - {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123}, + {"KEYBLOB_TOO_SHORT", 9, 123}, #endif #ifdef PEM_R_MISSING_DEK_IV {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV}, #else - {"MISSING_DEK_IV", ERR_LIB_PEM, 129}, + {"MISSING_DEK_IV", 9, 129}, #endif #ifdef PEM_R_NOT_DEK_INFO {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, #else - {"NOT_DEK_INFO", ERR_LIB_PEM, 105}, + {"NOT_DEK_INFO", 9, 105}, #endif #ifdef PEM_R_NOT_ENCRYPTED {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, #else - {"NOT_ENCRYPTED", ERR_LIB_PEM, 106}, + {"NOT_ENCRYPTED", 9, 106}, #endif #ifdef PEM_R_NOT_PROC_TYPE {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, #else - {"NOT_PROC_TYPE", ERR_LIB_PEM, 107}, + {"NOT_PROC_TYPE", 9, 107}, #endif #ifdef PEM_R_NO_START_LINE {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, #else - {"NO_START_LINE", ERR_LIB_PEM, 108}, + {"NO_START_LINE", 9, 108}, #endif #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, #else - {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109}, + {"PROBLEMS_GETTING_PASSWORD", 9, 109}, #endif #ifdef PEM_R_PUBLIC_KEY_NO_RSA {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA}, #else - {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110}, + {"PUBLIC_KEY_NO_RSA", 9, 110}, #endif #ifdef PEM_R_PVK_DATA_TOO_SHORT {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, #else - {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124}, + {"PVK_DATA_TOO_SHORT", 9, 124}, #endif #ifdef PEM_R_PVK_TOO_SHORT {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, #else - {"PVK_TOO_SHORT", ERR_LIB_PEM, 125}, + {"PVK_TOO_SHORT", 9, 125}, #endif #ifdef PEM_R_READ_KEY {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, #else - {"READ_KEY", ERR_LIB_PEM, 111}, + {"READ_KEY", 9, 111}, #endif #ifdef PEM_R_SHORT_HEADER {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, #else - {"SHORT_HEADER", ERR_LIB_PEM, 112}, + {"SHORT_HEADER", 9, 112}, #endif #ifdef PEM_R_UNEXPECTED_DEK_IV {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV}, #else - {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, 130}, + {"UNEXPECTED_DEK_IV", 9, 130}, #endif #ifdef PEM_R_UNSUPPORTED_CIPHER {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113}, + {"UNSUPPORTED_CIPHER", 9, 113}, #endif #ifdef PEM_R_UNSUPPORTED_ENCRYPTION {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, #else - {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114}, + {"UNSUPPORTED_ENCRYPTION", 9, 114}, #endif #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, #else - {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126}, + {"UNSUPPORTED_KEY_COMPONENTS", 9, 126}, #endif #ifdef PKCS12_R_CANT_PACK_STRUCTURE {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE}, #else - {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, 100}, + {"CANT_PACK_STRUCTURE", 35, 100}, #endif #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA}, #else - {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, 121}, + {"CONTENT_TYPE_NOT_DATA", 35, 121}, #endif #ifdef PKCS12_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_PKCS12, 101}, + {"DECODE_ERROR", 35, 101}, #endif #ifdef PKCS12_R_ENCODE_ERROR {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR}, #else - {"ENCODE_ERROR", ERR_LIB_PKCS12, 102}, + {"ENCODE_ERROR", 35, 102}, #endif #ifdef PKCS12_R_ENCRYPT_ERROR {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR}, #else - {"ENCRYPT_ERROR", ERR_LIB_PKCS12, 103}, + {"ENCRYPT_ERROR", 35, 103}, #endif #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE}, #else - {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, 120}, + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120}, #endif #ifdef PKCS12_R_INVALID_NULL_ARGUMENT {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT}, #else - {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, 104}, + {"INVALID_NULL_ARGUMENT", 35, 104}, #endif #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER}, #else - {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, 105}, + {"INVALID_NULL_PKCS12_POINTER", 35, 105}, #endif #ifdef PKCS12_R_IV_GEN_ERROR {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR}, #else - {"IV_GEN_ERROR", ERR_LIB_PKCS12, 106}, + {"IV_GEN_ERROR", 35, 106}, #endif #ifdef PKCS12_R_KEY_GEN_ERROR {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR}, #else - {"KEY_GEN_ERROR", ERR_LIB_PKCS12, 107}, + {"KEY_GEN_ERROR", 35, 107}, #endif #ifdef PKCS12_R_MAC_ABSENT {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT}, #else - {"MAC_ABSENT", ERR_LIB_PKCS12, 108}, + {"MAC_ABSENT", 35, 108}, #endif #ifdef PKCS12_R_MAC_GENERATION_ERROR {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR}, #else - {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, 109}, + {"MAC_GENERATION_ERROR", 35, 109}, #endif #ifdef PKCS12_R_MAC_SETUP_ERROR {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR}, #else - {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, 110}, + {"MAC_SETUP_ERROR", 35, 110}, #endif #ifdef PKCS12_R_MAC_STRING_SET_ERROR {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR}, #else - {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, 111}, + {"MAC_STRING_SET_ERROR", 35, 111}, #endif #ifdef PKCS12_R_MAC_VERIFY_FAILURE {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE}, #else - {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, 113}, + {"MAC_VERIFY_FAILURE", 35, 113}, #endif #ifdef PKCS12_R_PARSE_ERROR {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR}, #else - {"PARSE_ERROR", ERR_LIB_PKCS12, 114}, + {"PARSE_ERROR", 35, 114}, #endif #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR}, #else - {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, 115}, + {"PKCS12_ALGOR_CIPHERINIT_ERROR", 35, 115}, #endif #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR}, #else - {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, 116}, + {"PKCS12_CIPHERFINAL_ERROR", 35, 116}, #endif #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR}, #else - {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, 117}, + {"PKCS12_PBE_CRYPT_ERROR", 35, 117}, #endif #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM}, #else - {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, 118}, + {"UNKNOWN_DIGEST_ALGORITHM", 35, 118}, #endif #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE}, #else - {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, 119}, + {"UNSUPPORTED_PKCS12_MODE", 35, 119}, #endif #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, 117}, + {"CERTIFICATE_VERIFY_ERROR", 33, 117}, #endif #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, #else - {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, 144}, + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144}, #endif #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED}, #else - {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, 116}, + {"CIPHER_NOT_INITIALIZED", 33, 116}, #endif #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT}, #else - {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, 118}, + {"CONTENT_AND_DATA_PRESENT", 33, 118}, #endif #ifdef PKCS7_R_CTRL_ERROR {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR}, #else - {"CTRL_ERROR", ERR_LIB_PKCS7, 152}, + {"CTRL_ERROR", 33, 152}, #endif #ifdef PKCS7_R_DECRYPT_ERROR {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR}, #else - {"DECRYPT_ERROR", ERR_LIB_PKCS7, 119}, + {"DECRYPT_ERROR", 33, 119}, #endif #ifdef PKCS7_R_DIGEST_FAILURE {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE}, #else - {"DIGEST_FAILURE", ERR_LIB_PKCS7, 101}, + {"DIGEST_FAILURE", 33, 101}, #endif #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE}, #else - {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, 149}, + {"ENCRYPTION_CTRL_FAILURE", 33, 149}, #endif #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 150}, + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150}, #endif #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT}, #else - {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, 120}, + {"ERROR_ADDING_RECIPIENT", 33, 120}, #endif #ifdef PKCS7_R_ERROR_SETTING_CIPHER {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER}, #else - {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, 121}, + {"ERROR_SETTING_CIPHER", 33, 121}, #endif #ifdef PKCS7_R_INVALID_NULL_POINTER {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER}, #else - {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, 143}, + {"INVALID_NULL_POINTER", 33, 143}, #endif #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE}, #else - {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, 155}, + {"INVALID_SIGNED_DATA_TYPE", 33, 155}, #endif #ifdef PKCS7_R_NO_CONTENT {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT}, #else - {"NO_CONTENT", ERR_LIB_PKCS7, 122}, + {"NO_CONTENT", 33, 122}, #endif #ifdef PKCS7_R_NO_DEFAULT_DIGEST {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST}, #else - {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, 151}, + {"NO_DEFAULT_DIGEST", 33, 151}, #endif #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND}, #else - {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, 154}, + {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154}, #endif #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE}, #else - {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, 115}, + {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115}, #endif #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA}, #else - {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, 123}, + {"NO_SIGNATURES_ON_DATA", 33, 123}, #endif #ifdef PKCS7_R_NO_SIGNERS {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS}, #else - {"NO_SIGNERS", ERR_LIB_PKCS7, 142}, + {"NO_SIGNERS", 33, 142}, #endif #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE}, #else - {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, 104}, + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104}, #endif #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR}, #else - {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, 124}, + {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124}, #endif #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR}, #else - {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, 153}, + {"PKCS7_ADD_SIGNER_ERROR", 33, 153}, #endif #ifdef PKCS7_R_PKCS7_DATASIGN {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN}, #else - {"PKCS7_DATASIGN", ERR_LIB_PKCS7, 145}, + {"PKCS7_DATASIGN", 33, 145}, #endif #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, 127}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127}, #endif #ifdef PKCS7_R_SIGNATURE_FAILURE {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE}, #else - {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, 105}, + {"SIGNATURE_FAILURE", 33, 105}, #endif #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, 128}, + {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128}, #endif #ifdef PKCS7_R_SIGNING_CTRL_FAILURE {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE}, #else - {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, 147}, + {"SIGNING_CTRL_FAILURE", 33, 147}, #endif #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 148}, + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148}, #endif #ifdef PKCS7_R_SMIME_TEXT_ERROR {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR}, #else - {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, 129}, + {"SMIME_TEXT_ERROR", 33, 129}, #endif #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE}, #else - {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, 106}, + {"UNABLE_TO_FIND_CERTIFICATE", 33, 106}, #endif #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO}, #else - {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, 107}, + {"UNABLE_TO_FIND_MEM_BIO", 33, 107}, #endif #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST}, #else - {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, 108}, + {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108}, #endif #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE}, #else - {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, 109}, + {"UNKNOWN_DIGEST_TYPE", 33, 109}, #endif #ifdef PKCS7_R_UNKNOWN_OPERATION {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION}, #else - {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, 110}, + {"UNKNOWN_OPERATION", 33, 110}, #endif #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE}, #else - {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, 111}, + {"UNSUPPORTED_CIPHER_TYPE", 33, 111}, #endif #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE}, #else - {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, 112}, + {"UNSUPPORTED_CONTENT_TYPE", 33, 112}, #endif #ifdef PKCS7_R_WRONG_CONTENT_TYPE {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE}, #else - {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, 113}, + {"WRONG_CONTENT_TYPE", 33, 113}, #endif #ifdef PKCS7_R_WRONG_PKCS7_TYPE {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE}, #else - {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, 114}, + {"WRONG_PKCS7_TYPE", 33, 114}, #endif #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG}, #else - {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, 102}, + {"ADDITIONAL_INPUT_TOO_LONG", 36, 102}, #endif #ifdef RAND_R_ALREADY_INSTANTIATED {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED}, #else - {"ALREADY_INSTANTIATED", ERR_LIB_RAND, 103}, + {"ALREADY_INSTANTIATED", 36, 103}, #endif #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE}, #else - {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, 105}, + {"ARGUMENT_OUT_OF_RANGE", 36, 105}, #endif #ifdef RAND_R_CANNOT_OPEN_FILE {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE}, #else - {"CANNOT_OPEN_FILE", ERR_LIB_RAND, 121}, + {"CANNOT_OPEN_FILE", 36, 121}, #endif #ifdef RAND_R_DRBG_ALREADY_INITIALIZED {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED}, #else - {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, 129}, + {"DRBG_ALREADY_INITIALIZED", 36, 129}, #endif #ifdef RAND_R_DRBG_NOT_INITIALISED {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED}, #else - {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, 104}, + {"DRBG_NOT_INITIALISED", 36, 104}, #endif #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG}, #else - {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, 106}, + {"ENTROPY_INPUT_TOO_LONG", 36, 106}, #endif #ifdef RAND_R_ENTROPY_OUT_OF_RANGE {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE}, #else - {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, 124}, + {"ENTROPY_OUT_OF_RANGE", 36, 124}, #endif #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED}, #else - {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, 127}, + {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127}, #endif #ifdef RAND_R_ERROR_INITIALISING_DRBG {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG}, #else - {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, 107}, + {"ERROR_INITIALISING_DRBG", 36, 107}, #endif #ifdef RAND_R_ERROR_INSTANTIATING_DRBG {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG}, #else - {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, 108}, + {"ERROR_INSTANTIATING_DRBG", 36, 108}, #endif #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT}, #else - {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, 109}, + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109}, #endif #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY}, #else - {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, 110}, + {"ERROR_RETRIEVING_ENTROPY", 36, 110}, #endif #ifdef RAND_R_ERROR_RETRIEVING_NONCE {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE}, #else - {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, 111}, + {"ERROR_RETRIEVING_NONCE", 36, 111}, #endif #ifdef RAND_R_FAILED_TO_CREATE_LOCK {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK}, #else - {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, 126}, + {"FAILED_TO_CREATE_LOCK", 36, 126}, #endif #ifdef RAND_R_FUNC_NOT_IMPLEMENTED {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED}, #else - {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, 101}, + {"FUNC_NOT_IMPLEMENTED", 36, 101}, #endif #ifdef RAND_R_FWRITE_ERROR {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR}, #else - {"FWRITE_ERROR", ERR_LIB_RAND, 123}, + {"FWRITE_ERROR", 36, 123}, #endif #ifdef RAND_R_GENERATE_ERROR {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR}, #else - {"GENERATE_ERROR", ERR_LIB_RAND, 112}, + {"GENERATE_ERROR", 36, 112}, #endif #ifdef RAND_R_INTERNAL_ERROR {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR}, #else - {"INTERNAL_ERROR", ERR_LIB_RAND, 113}, + {"INTERNAL_ERROR", 36, 113}, #endif #ifdef RAND_R_IN_ERROR_STATE {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE}, #else - {"IN_ERROR_STATE", ERR_LIB_RAND, 114}, + {"IN_ERROR_STATE", 36, 114}, #endif #ifdef RAND_R_NOT_A_REGULAR_FILE {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE}, #else - {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, 122}, + {"NOT_A_REGULAR_FILE", 36, 122}, #endif #ifdef RAND_R_NOT_INSTANTIATED {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED}, #else - {"NOT_INSTANTIATED", ERR_LIB_RAND, 115}, + {"NOT_INSTANTIATED", 36, 115}, #endif #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED}, #else - {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, 128}, + {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128}, #endif #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED}, #else - {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, 130}, + {"PARENT_LOCKING_NOT_ENABLED", 36, 130}, #endif #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK}, #else - {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, 131}, + {"PARENT_STRENGTH_TOO_WEAK", 36, 131}, #endif #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG}, #else - {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, 116}, + {"PERSONALISATION_STRING_TOO_LONG", 36, 116}, #endif #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED}, #else - {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, 133}, + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133}, #endif #ifdef RAND_R_PRNG_NOT_SEEDED {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED}, #else - {"PRNG_NOT_SEEDED", ERR_LIB_RAND, 100}, + {"PRNG_NOT_SEEDED", 36, 100}, #endif #ifdef RAND_R_RANDOM_POOL_OVERFLOW {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW}, #else - {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, 125}, + {"RANDOM_POOL_OVERFLOW", 36, 125}, #endif #ifdef RAND_R_RANDOM_POOL_UNDERFLOW {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW}, #else - {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, 134}, + {"RANDOM_POOL_UNDERFLOW", 36, 134}, #endif #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG}, #else - {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, 117}, + {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117}, #endif #ifdef RAND_R_RESEED_ERROR {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR}, #else - {"RESEED_ERROR", ERR_LIB_RAND, 118}, + {"RESEED_ERROR", 36, 118}, #endif #ifdef RAND_R_SELFTEST_FAILURE {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE}, #else - {"SELFTEST_FAILURE", ERR_LIB_RAND, 119}, + {"SELFTEST_FAILURE", 36, 119}, #endif #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED}, #else - {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, 135}, + {"TOO_LITTLE_NONCE_REQUESTED", 36, 135}, #endif #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED}, #else - {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, 136}, + {"TOO_MUCH_NONCE_REQUESTED", 36, 136}, #endif #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS}, #else - {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, 132}, + {"UNSUPPORTED_DRBG_FLAGS", 36, 132}, #endif #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE}, #else - {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, 120}, + {"UNSUPPORTED_DRBG_TYPE", 36, 120}, #endif #ifdef RSA_R_ALGORITHM_MISMATCH {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH}, #else - {"ALGORITHM_MISMATCH", ERR_LIB_RSA, 100}, + {"ALGORITHM_MISMATCH", 4, 100}, #endif #ifdef RSA_R_BAD_E_VALUE {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE}, #else - {"BAD_E_VALUE", ERR_LIB_RSA, 101}, + {"BAD_E_VALUE", 4, 101}, #endif #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT}, #else - {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, 102}, + {"BAD_FIXED_HEADER_DECRYPT", 4, 102}, #endif #ifdef RSA_R_BAD_PAD_BYTE_COUNT {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT}, #else - {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, 103}, + {"BAD_PAD_BYTE_COUNT", 4, 103}, #endif #ifdef RSA_R_BAD_SIGNATURE {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE}, #else - {"BAD_SIGNATURE", ERR_LIB_RSA, 104}, + {"BAD_SIGNATURE", 4, 104}, #endif #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01 {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01}, #else - {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, 106}, + {"BLOCK_TYPE_IS_NOT_01", 4, 106}, #endif #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02 {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02}, #else - {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, 107}, + {"BLOCK_TYPE_IS_NOT_02", 4, 107}, #endif #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN}, #else - {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, 108}, + {"DATA_GREATER_THAN_MOD_LEN", 4, 108}, #endif #ifdef RSA_R_DATA_TOO_LARGE {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE}, #else - {"DATA_TOO_LARGE", ERR_LIB_RSA, 109}, + {"DATA_TOO_LARGE", 4, 109}, #endif #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE}, #else - {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, 110}, + {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110}, #endif #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS}, #else - {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, 132}, + {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132}, #endif #ifdef RSA_R_DATA_TOO_SMALL {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL}, #else - {"DATA_TOO_SMALL", ERR_LIB_RSA, 111}, + {"DATA_TOO_SMALL", 4, 111}, #endif #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE}, #else - {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, 122}, + {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122}, #endif #ifdef RSA_R_DIGEST_DOES_NOT_MATCH {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH}, #else - {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, 158}, + {"DIGEST_DOES_NOT_MATCH", 4, 158}, #endif #ifdef RSA_R_DIGEST_NOT_ALLOWED {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED}, #else - {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 145}, + {"DIGEST_NOT_ALLOWED", 4, 145}, #endif #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY}, #else - {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, 112}, + {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112}, #endif #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D}, #else - {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 124}, + {"DMP1_NOT_CONGRUENT_TO_D", 4, 124}, #endif #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D}, #else - {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 125}, + {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125}, #endif #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1 {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1}, #else - {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, 123}, + {"D_E_NOT_CONGRUENT_TO_1", 4, 123}, #endif #ifdef RSA_R_FIRST_OCTET_INVALID {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID}, #else - {"FIRST_OCTET_INVALID", ERR_LIB_RSA, 133}, + {"FIRST_OCTET_INVALID", 4, 133}, #endif #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, #else - {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, 144}, + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144}, #endif #ifdef RSA_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_RSA, 157}, + {"INVALID_DIGEST", 4, 157}, #endif #ifdef RSA_R_INVALID_DIGEST_LENGTH {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH}, #else - {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, 143}, + {"INVALID_DIGEST_LENGTH", 4, 143}, #endif #ifdef RSA_R_INVALID_HEADER {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER}, #else - {"INVALID_HEADER", ERR_LIB_RSA, 137}, + {"INVALID_HEADER", 4, 137}, #endif #ifdef RSA_R_INVALID_LABEL {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL}, #else - {"INVALID_LABEL", ERR_LIB_RSA, 160}, + {"INVALID_LABEL", 4, 160}, #endif #ifdef RSA_R_INVALID_MESSAGE_LENGTH {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH}, #else - {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, 131}, + {"INVALID_MESSAGE_LENGTH", 4, 131}, #endif #ifdef RSA_R_INVALID_MGF1_MD {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD}, #else - {"INVALID_MGF1_MD", ERR_LIB_RSA, 156}, + {"INVALID_MGF1_MD", 4, 156}, #endif #ifdef RSA_R_INVALID_MULTI_PRIME_KEY {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY}, #else - {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, 167}, + {"INVALID_MULTI_PRIME_KEY", 4, 167}, #endif #ifdef RSA_R_INVALID_OAEP_PARAMETERS {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS}, #else - {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, 161}, + {"INVALID_OAEP_PARAMETERS", 4, 161}, #endif #ifdef RSA_R_INVALID_PADDING {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING}, #else - {"INVALID_PADDING", ERR_LIB_RSA, 138}, + {"INVALID_PADDING", 4, 138}, #endif #ifdef RSA_R_INVALID_PADDING_MODE {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE}, #else - {"INVALID_PADDING_MODE", ERR_LIB_RSA, 141}, + {"INVALID_PADDING_MODE", 4, 141}, #endif #ifdef RSA_R_INVALID_PSS_PARAMETERS {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS}, #else - {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, 149}, + {"INVALID_PSS_PARAMETERS", 4, 149}, #endif #ifdef RSA_R_INVALID_PSS_SALTLEN {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN}, #else - {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, 146}, + {"INVALID_PSS_SALTLEN", 4, 146}, #endif #ifdef RSA_R_INVALID_SALT_LENGTH {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH}, #else - {"INVALID_SALT_LENGTH", ERR_LIB_RSA, 150}, + {"INVALID_SALT_LENGTH", 4, 150}, #endif #ifdef RSA_R_INVALID_TRAILER {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER}, #else - {"INVALID_TRAILER", ERR_LIB_RSA, 139}, + {"INVALID_TRAILER", 4, 139}, #endif #ifdef RSA_R_INVALID_X931_DIGEST {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST}, #else - {"INVALID_X931_DIGEST", ERR_LIB_RSA, 142}, + {"INVALID_X931_DIGEST", 4, 142}, #endif #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q}, #else - {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, 126}, + {"IQMP_NOT_INVERSE_OF_Q", 4, 126}, #endif #ifdef RSA_R_KEY_PRIME_NUM_INVALID {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID}, #else - {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, 165}, + {"KEY_PRIME_NUM_INVALID", 4, 165}, #endif #ifdef RSA_R_KEY_SIZE_TOO_SMALL {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL}, #else - {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, 120}, + {"KEY_SIZE_TOO_SMALL", 4, 120}, #endif #ifdef RSA_R_LAST_OCTET_INVALID {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID}, #else - {"LAST_OCTET_INVALID", ERR_LIB_RSA, 134}, + {"LAST_OCTET_INVALID", 4, 134}, #endif #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED}, #else - {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 152}, + {"MGF1_DIGEST_NOT_ALLOWED", 4, 152}, #endif #ifdef RSA_R_MISSING_PRIVATE_KEY {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY}, #else - {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, 179}, + {"MISSING_PRIVATE_KEY", 4, 179}, #endif #ifdef RSA_R_MODULUS_TOO_LARGE {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE}, #else - {"MODULUS_TOO_LARGE", ERR_LIB_RSA, 105}, + {"MODULUS_TOO_LARGE", 4, 105}, #endif #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R}, #else - {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, 168}, + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168}, #endif #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D}, #else - {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 169}, + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169}, #endif #ifdef RSA_R_MP_R_NOT_PRIME {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME}, #else - {"MP_R_NOT_PRIME", ERR_LIB_RSA, 170}, + {"MP_R_NOT_PRIME", 4, 170}, #endif #ifdef RSA_R_NO_PUBLIC_EXPONENT {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT}, #else - {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, 140}, + {"NO_PUBLIC_EXPONENT", 4, 140}, #endif #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING}, #else - {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, 113}, + {"NULL_BEFORE_BLOCK_MISSING", 4, 113}, #endif #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES}, #else - {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, 172}, + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172}, #endif #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q}, #else - {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, 127}, + {"N_DOES_NOT_EQUAL_P_Q", 4, 127}, #endif #ifdef RSA_R_OAEP_DECODING_ERROR {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR}, #else - {"OAEP_DECODING_ERROR", ERR_LIB_RSA, 121}, + {"OAEP_DECODING_ERROR", 4, 121}, #endif #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, #else - {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, 148}, + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148}, #endif #ifdef RSA_R_PADDING_CHECK_FAILED {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED}, #else - {"PADDING_CHECK_FAILED", ERR_LIB_RSA, 114}, + {"PADDING_CHECK_FAILED", 4, 114}, #endif #ifdef RSA_R_PKCS_DECODING_ERROR {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR}, #else - {"PKCS_DECODING_ERROR", ERR_LIB_RSA, 159}, + {"PKCS_DECODING_ERROR", 4, 159}, #endif #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL}, #else - {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, 164}, + {"PSS_SALTLEN_TOO_SMALL", 4, 164}, #endif #ifdef RSA_R_P_NOT_PRIME {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME}, #else - {"P_NOT_PRIME", ERR_LIB_RSA, 128}, + {"P_NOT_PRIME", 4, 128}, #endif #ifdef RSA_R_Q_NOT_PRIME {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME}, #else - {"Q_NOT_PRIME", ERR_LIB_RSA, 129}, + {"Q_NOT_PRIME", 4, 129}, #endif #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED}, #else - {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, 130}, + {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130}, #endif #ifdef RSA_R_SLEN_CHECK_FAILED {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED}, #else - {"SLEN_CHECK_FAILED", ERR_LIB_RSA, 136}, + {"SLEN_CHECK_FAILED", 4, 136}, #endif #ifdef RSA_R_SLEN_RECOVERY_FAILED {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED}, #else - {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, 135}, + {"SLEN_RECOVERY_FAILED", 4, 135}, #endif #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK}, #else - {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, 115}, + {"SSLV3_ROLLBACK_ATTACK", 4, 115}, #endif #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, #else - {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, 116}, + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116}, #endif #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE}, #else - {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, 117}, + {"UNKNOWN_ALGORITHM_TYPE", 4, 117}, #endif #ifdef RSA_R_UNKNOWN_DIGEST {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST}, #else - {"UNKNOWN_DIGEST", ERR_LIB_RSA, 166}, + {"UNKNOWN_DIGEST", 4, 166}, #endif #ifdef RSA_R_UNKNOWN_MASK_DIGEST {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST}, #else - {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, 151}, + {"UNKNOWN_MASK_DIGEST", 4, 151}, #endif #ifdef RSA_R_UNKNOWN_PADDING_TYPE {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE}, #else - {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, 118}, + {"UNKNOWN_PADDING_TYPE", 4, 118}, #endif #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE}, #else - {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, 162}, + {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162}, #endif #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE}, #else - {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, 163}, + {"UNSUPPORTED_LABEL_SOURCE", 4, 163}, #endif #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM}, #else - {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, 153}, + {"UNSUPPORTED_MASK_ALGORITHM", 4, 153}, #endif #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER}, #else - {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, 154}, + {"UNSUPPORTED_MASK_PARAMETER", 4, 154}, #endif #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE}, #else - {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, 155}, + {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155}, #endif #ifdef RSA_R_VALUE_MISSING {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING}, #else - {"VALUE_MISSING", ERR_LIB_RSA, 147}, + {"VALUE_MISSING", 4, 147}, #endif #ifdef RSA_R_WRONG_SIGNATURE_LENGTH {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH}, #else - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, 119}, + {"WRONG_SIGNATURE_LENGTH", 4, 119}, #endif #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY}, #else - {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, 291}, + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291}, #endif #ifdef SSL_R_APP_DATA_IN_HANDSHAKE {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, #else - {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100}, + {"APP_DATA_IN_HANDSHAKE", 20, 100}, #endif #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, #else - {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272}, + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272}, #endif #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE}, #else - {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, 143}, + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143}, #endif #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE}, #else - {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, 158}, + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158}, #endif #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, #else - {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103}, + {"BAD_CHANGE_CIPHER_SPEC", 20, 103}, #endif #ifdef SSL_R_BAD_CIPHER {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER}, #else - {"BAD_CIPHER", ERR_LIB_SSL, 186}, + {"BAD_CIPHER", 20, 186}, #endif #ifdef SSL_R_BAD_DATA {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, #else - {"BAD_DATA", ERR_LIB_SSL, 390}, + {"BAD_DATA", 20, 390}, #endif #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, #else - {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106}, + {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106}, #endif #ifdef SSL_R_BAD_DECOMPRESSION {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, #else - {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107}, + {"BAD_DECOMPRESSION", 20, 107}, #endif #ifdef SSL_R_BAD_DH_VALUE {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE}, #else - {"BAD_DH_VALUE", ERR_LIB_SSL, 102}, + {"BAD_DH_VALUE", 20, 102}, #endif #ifdef SSL_R_BAD_DIGEST_LENGTH {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, #else - {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111}, + {"BAD_DIGEST_LENGTH", 20, 111}, #endif #ifdef SSL_R_BAD_EARLY_DATA {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA}, #else - {"BAD_EARLY_DATA", ERR_LIB_SSL, 233}, + {"BAD_EARLY_DATA", 20, 233}, #endif #ifdef SSL_R_BAD_ECC_CERT {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, #else - {"BAD_ECC_CERT", ERR_LIB_SSL, 304}, + {"BAD_ECC_CERT", 20, 304}, #endif #ifdef SSL_R_BAD_ECDSA_SIGNATURE {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE}, #else - {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305}, + {"BAD_ECDSA_SIGNATURE", 20, 305}, #endif #ifdef SSL_R_BAD_ECPOINT {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, #else - {"BAD_ECPOINT", ERR_LIB_SSL, 306}, + {"BAD_ECPOINT", 20, 306}, #endif #ifdef SSL_R_BAD_EXTENSION {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION}, #else - {"BAD_EXTENSION", ERR_LIB_SSL, 110}, + {"BAD_EXTENSION", 20, 110}, #endif #ifdef SSL_R_BAD_HANDSHAKE_LENGTH {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, #else - {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332}, + {"BAD_HANDSHAKE_LENGTH", 20, 332}, #endif #ifdef SSL_R_BAD_HANDSHAKE_STATE {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE}, #else - {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, 236}, + {"BAD_HANDSHAKE_STATE", 20, 236}, #endif #ifdef SSL_R_BAD_HELLO_REQUEST {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, #else - {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105}, + {"BAD_HELLO_REQUEST", 20, 105}, #endif #ifdef SSL_R_BAD_HRR_VERSION {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION}, #else - {"BAD_HRR_VERSION", ERR_LIB_SSL, 263}, + {"BAD_HRR_VERSION", 20, 263}, #endif #ifdef SSL_R_BAD_KEY_SHARE {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE}, #else - {"BAD_KEY_SHARE", ERR_LIB_SSL, 108}, + {"BAD_KEY_SHARE", 20, 108}, #endif #ifdef SSL_R_BAD_KEY_UPDATE {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE}, #else - {"BAD_KEY_UPDATE", ERR_LIB_SSL, 122}, + {"BAD_KEY_UPDATE", 20, 122}, #endif #ifdef SSL_R_BAD_LEGACY_VERSION {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION}, #else - {"BAD_LEGACY_VERSION", ERR_LIB_SSL, 292}, + {"BAD_LEGACY_VERSION", 20, 292}, #endif #ifdef SSL_R_BAD_LENGTH {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, #else - {"BAD_LENGTH", ERR_LIB_SSL, 271}, + {"BAD_LENGTH", 20, 271}, #endif #ifdef SSL_R_BAD_MAC_LENGTH {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH}, #else - {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333}, + {"BAD_MAC_LENGTH", 20, 333}, #endif #ifdef SSL_R_BAD_PACKET {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET}, #else - {"BAD_PACKET", ERR_LIB_SSL, 240}, + {"BAD_PACKET", 20, 240}, #endif #ifdef SSL_R_BAD_PACKET_LENGTH {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, #else - {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115}, + {"BAD_PACKET_LENGTH", 20, 115}, #endif #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, #else - {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116}, + {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116}, #endif #ifdef SSL_R_BAD_PSK {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK}, #else - {"BAD_PSK", ERR_LIB_SSL, 219}, + {"BAD_PSK", 20, 219}, #endif #ifdef SSL_R_BAD_PSK_IDENTITY {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY}, #else - {"BAD_PSK_IDENTITY", ERR_LIB_SSL, 114}, + {"BAD_PSK_IDENTITY", 20, 114}, #endif #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH}, #else - {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316}, + {"BAD_PSK_IDENTITY_HINT_LENGTH", 20, 316}, #endif #ifdef SSL_R_BAD_RECORD_TYPE {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE}, #else - {"BAD_RECORD_TYPE", ERR_LIB_SSL, 443}, + {"BAD_RECORD_TYPE", 20, 443}, #endif #ifdef SSL_R_BAD_RSA_ENCRYPT {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, #else - {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119}, + {"BAD_RSA_ENCRYPT", 20, 119}, #endif #ifdef SSL_R_BAD_SIGNATURE {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, #else - {"BAD_SIGNATURE", ERR_LIB_SSL, 123}, + {"BAD_SIGNATURE", 20, 123}, #endif #ifdef SSL_R_BAD_SRP_A_LENGTH {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, #else - {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347}, + {"BAD_SRP_A_LENGTH", 20, 347}, #endif #ifdef SSL_R_BAD_SRP_B_LENGTH {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH}, #else - {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348}, + {"BAD_SRP_B_LENGTH", 20, 348}, #endif #ifdef SSL_R_BAD_SRP_G_LENGTH {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH}, #else - {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349}, + {"BAD_SRP_G_LENGTH", 20, 349}, #endif #ifdef SSL_R_BAD_SRP_N_LENGTH {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH}, #else - {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350}, + {"BAD_SRP_N_LENGTH", 20, 350}, #endif #ifdef SSL_R_BAD_SRP_PARAMETERS {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, #else - {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371}, + {"BAD_SRP_PARAMETERS", 20, 371}, #endif #ifdef SSL_R_BAD_SRP_S_LENGTH {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH}, #else - {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351}, + {"BAD_SRP_S_LENGTH", 20, 351}, #endif #ifdef SSL_R_BAD_SRTP_MKI_VALUE {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, #else - {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352}, + {"BAD_SRTP_MKI_VALUE", 20, 352}, #endif #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, #else - {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353}, + {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353}, #endif #ifdef SSL_R_BAD_SSL_FILETYPE {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, #else - {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124}, + {"BAD_SSL_FILETYPE", 20, 124}, #endif #ifdef SSL_R_BAD_VALUE {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, #else - {"BAD_VALUE", ERR_LIB_SSL, 384}, + {"BAD_VALUE", 20, 384}, #endif #ifdef SSL_R_BAD_WRITE_RETRY {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, #else - {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127}, + {"BAD_WRITE_RETRY", 20, 127}, #endif #ifdef SSL_R_BINDER_DOES_NOT_VERIFY {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY}, #else - {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, 253}, + {"BINDER_DOES_NOT_VERIFY", 20, 253}, #endif #ifdef SSL_R_BIO_NOT_SET {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, #else - {"BIO_NOT_SET", ERR_LIB_SSL, 128}, + {"BIO_NOT_SET", 20, 128}, #endif #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, #else - {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129}, + {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129}, #endif #ifdef SSL_R_BN_LIB {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, #else - {"BN_LIB", ERR_LIB_SSL, 130}, + {"BN_LIB", 20, 130}, #endif #ifdef SSL_R_CALLBACK_FAILED {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED}, #else - {"CALLBACK_FAILED", ERR_LIB_SSL, 234}, + {"CALLBACK_FAILED", 20, 234}, #endif #ifdef SSL_R_CANNOT_CHANGE_CIPHER {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER}, #else - {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, 109}, + {"CANNOT_CHANGE_CIPHER", 20, 109}, #endif #ifdef SSL_R_CA_DN_LENGTH_MISMATCH {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, #else - {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131}, + {"CA_DN_LENGTH_MISMATCH", 20, 131}, #endif #ifdef SSL_R_CA_KEY_TOO_SMALL {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, #else - {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397}, + {"CA_KEY_TOO_SMALL", 20, 397}, #endif #ifdef SSL_R_CA_MD_TOO_WEAK {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, #else - {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398}, + {"CA_MD_TOO_WEAK", 20, 398}, #endif #ifdef SSL_R_CCS_RECEIVED_EARLY {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, #else - {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133}, + {"CCS_RECEIVED_EARLY", 20, 133}, #endif #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, #else - {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134}, + {"CERTIFICATE_VERIFY_FAILED", 20, 134}, #endif #ifdef SSL_R_CERT_CB_ERROR {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, #else - {"CERT_CB_ERROR", ERR_LIB_SSL, 377}, + {"CERT_CB_ERROR", 20, 377}, #endif #ifdef SSL_R_CERT_LENGTH_MISMATCH {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, #else - {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135}, + {"CERT_LENGTH_MISMATCH", 20, 135}, #endif #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED}, #else - {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, 218}, + {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218}, #endif #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, #else - {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137}, + {"CIPHER_CODE_WRONG_LENGTH", 20, 137}, #endif #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, #else - {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138}, + {"CIPHER_OR_HASH_UNAVAILABLE", 20, 138}, #endif #ifdef SSL_R_CLIENTHELLO_TLSEXT {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, #else - {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226}, + {"CLIENTHELLO_TLSEXT", 20, 226}, #endif #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, #else - {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140}, + {"COMPRESSED_LENGTH_TOO_LONG", 20, 140}, #endif #ifdef SSL_R_COMPRESSION_DISABLED {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, #else - {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343}, + {"COMPRESSION_DISABLED", 20, 343}, #endif #ifdef SSL_R_COMPRESSION_FAILURE {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, #else - {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141}, + {"COMPRESSION_FAILURE", 20, 141}, #endif #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, #else - {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307}, + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307}, #endif #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, #else - {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142}, + {"COMPRESSION_LIBRARY_ERROR", 20, 142}, #endif #ifdef SSL_R_CONNECTION_TYPE_NOT_SET {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, #else - {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144}, + {"CONNECTION_TYPE_NOT_SET", 20, 144}, #endif #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED}, #else - {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, 167}, + {"CONTEXT_NOT_DANE_ENABLED", 20, 167}, #endif #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE}, #else - {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, 400}, + {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400}, #endif #ifdef SSL_R_COOKIE_MISMATCH {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, #else - {"COOKIE_MISMATCH", ERR_LIB_SSL, 308}, + {"COOKIE_MISMATCH", 20, 308}, #endif #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED}, #else - {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, 206}, + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206}, #endif #ifdef SSL_R_DANE_ALREADY_ENABLED {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED}, #else - {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, 172}, + {"DANE_ALREADY_ENABLED", 20, 172}, #endif #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL}, #else - {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, 173}, + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173}, #endif #ifdef SSL_R_DANE_NOT_ENABLED {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED}, #else - {"DANE_NOT_ENABLED", ERR_LIB_SSL, 175}, + {"DANE_NOT_ENABLED", 20, 175}, #endif #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE}, #else - {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, 180}, + {"DANE_TLSA_BAD_CERTIFICATE", 20, 180}, #endif #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE}, #else - {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, 184}, + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184}, #endif #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH}, #else - {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, 189}, + {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189}, #endif #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH}, #else - {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, 192}, + {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192}, #endif #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE}, #else - {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, 200}, + {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200}, #endif #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY}, #else - {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, 201}, + {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201}, #endif #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR}, #else - {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, 202}, + {"DANE_TLSA_BAD_SELECTOR", 20, 202}, #endif #ifdef SSL_R_DANE_TLSA_NULL_DATA {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA}, #else - {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, 203}, + {"DANE_TLSA_NULL_DATA", 20, 203}, #endif #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, #else - {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145}, + {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145}, #endif #ifdef SSL_R_DATA_LENGTH_TOO_LONG {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, #else - {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146}, + {"DATA_LENGTH_TOO_LONG", 20, 146}, #endif #ifdef SSL_R_DECRYPTION_FAILED {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, #else - {"DECRYPTION_FAILED", ERR_LIB_SSL, 147}, + {"DECRYPTION_FAILED", 20, 147}, #endif #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, #else - {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281}, + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281}, #endif #ifdef SSL_R_DH_KEY_TOO_SMALL {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, #else - {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394}, + {"DH_KEY_TOO_SMALL", 20, 394}, #endif #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, #else - {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148}, + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148}, #endif #ifdef SSL_R_DIGEST_CHECK_FAILED {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, #else - {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149}, + {"DIGEST_CHECK_FAILED", 20, 149}, #endif #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, #else - {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334}, + {"DTLS_MESSAGE_TOO_BIG", 20, 334}, #endif #ifdef SSL_R_DUPLICATE_COMPRESSION_ID {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, #else - {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309}, + {"DUPLICATE_COMPRESSION_ID", 20, 309}, #endif #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT}, #else - {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317}, + {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", 20, 317}, #endif #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, #else - {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318}, + {"ECC_CERT_NOT_FOR_SIGNING", 20, 318}, #endif #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE}, #else - {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322}, + {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", 20, 322}, #endif #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE}, #else - {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323}, + {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", 20, 323}, #endif #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, #else - {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374}, + {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374}, #endif #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER}, #else - {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310}, + {"ECGROUP_TOO_LARGE_FOR_CIPHER", 20, 310}, #endif #ifdef SSL_R_EE_KEY_TOO_SMALL {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, #else - {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399}, + {"EE_KEY_TOO_SMALL", 20, 399}, #endif #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, #else - {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354}, + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354}, #endif #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, #else - {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150}, + {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150}, #endif #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, #else - {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151}, + {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151}, #endif #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN}, #else - {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, 204}, + {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204}, #endif #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE}, #else - {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, 194}, + {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194}, #endif #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, #else - {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152}, + {"EXCESSIVE_MESSAGE_SIZE", 20, 152}, #endif #ifdef SSL_R_EXTENSION_NOT_RECEIVED {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED}, #else - {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, 279}, + {"EXTENSION_NOT_RECEIVED", 20, 279}, #endif #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, #else - {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153}, + {"EXTRA_DATA_IN_MESSAGE", 20, 153}, #endif #ifdef SSL_R_EXT_LENGTH_MISMATCH {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH}, #else - {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, 163}, + {"EXT_LENGTH_MISMATCH", 20, 163}, #endif #ifdef SSL_R_FAILED_TO_INIT_ASYNC {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC}, #else - {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, 405}, + {"FAILED_TO_INIT_ASYNC", 20, 405}, #endif #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO}, #else - {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, 401}, + {"FRAGMENTED_CLIENT_HELLO", 20, 401}, #endif #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, #else - {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154}, + {"GOT_A_FIN_BEFORE_A_CCS", 20, 154}, #endif #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS}, #else - {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355}, + {"GOT_NEXT_PROTO_BEFORE_A_CCS", 20, 355}, #endif #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION}, #else - {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356}, + {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", 20, 356}, #endif #ifdef SSL_R_HTTPS_PROXY_REQUEST {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, #else - {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155}, + {"HTTPS_PROXY_REQUEST", 20, 155}, #endif #ifdef SSL_R_HTTP_REQUEST {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, #else - {"HTTP_REQUEST", ERR_LIB_SSL, 156}, + {"HTTP_REQUEST", 20, 156}, #endif #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION}, #else - {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, 162}, + {"ILLEGAL_POINT_COMPRESSION", 20, 162}, #endif #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, #else - {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380}, + {"ILLEGAL_SUITEB_DIGEST", 20, 380}, #endif #ifdef SSL_R_INAPPROPRIATE_FALLBACK {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, #else - {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373}, + {"INAPPROPRIATE_FALLBACK", 20, 373}, #endif #ifdef SSL_R_INCONSISTENT_COMPRESSION {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, #else - {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340}, + {"INCONSISTENT_COMPRESSION", 20, 340}, #endif #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN}, #else - {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, 222}, + {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222}, #endif #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI}, #else - {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, 231}, + {"INCONSISTENT_EARLY_DATA_SNI", 20, 231}, #endif #ifdef SSL_R_INCONSISTENT_EXTMS {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS}, #else - {"INCONSISTENT_EXTMS", ERR_LIB_SSL, 104}, + {"INCONSISTENT_EXTMS", 20, 104}, #endif #ifdef SSL_R_INSUFFICIENT_SECURITY {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY}, #else - {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, 241}, + {"INSUFFICIENT_SECURITY", 20, 241}, #endif #ifdef SSL_R_INVALID_ALERT {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT}, #else - {"INVALID_ALERT", ERR_LIB_SSL, 205}, + {"INVALID_ALERT", 20, 205}, #endif #ifdef SSL_R_INVALID_CCS_MESSAGE {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE}, #else - {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, 260}, + {"INVALID_CCS_MESSAGE", 20, 260}, #endif #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG}, #else - {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, 238}, + {"INVALID_CERTIFICATE_OR_ALG", 20, 238}, #endif #ifdef SSL_R_INVALID_COMMAND {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, #else - {"INVALID_COMMAND", ERR_LIB_SSL, 280}, + {"INVALID_COMMAND", 20, 280}, #endif #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, #else - {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341}, + {"INVALID_COMPRESSION_ALGORITHM", 20, 341}, #endif #ifdef SSL_R_INVALID_CONFIG {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG}, #else - {"INVALID_CONFIG", ERR_LIB_SSL, 283}, + {"INVALID_CONFIG", 20, 283}, #endif #ifdef SSL_R_INVALID_CONFIGURATION_NAME {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME}, #else - {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, 113}, + {"INVALID_CONFIGURATION_NAME", 20, 113}, #endif #ifdef SSL_R_INVALID_CONTEXT {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT}, #else - {"INVALID_CONTEXT", ERR_LIB_SSL, 282}, + {"INVALID_CONTEXT", 20, 282}, #endif #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE}, #else - {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, 212}, + {"INVALID_CT_VALIDATION_TYPE", 20, 212}, #endif #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE}, #else - {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, 120}, + {"INVALID_KEY_UPDATE_TYPE", 20, 120}, #endif #ifdef SSL_R_INVALID_MAX_EARLY_DATA {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA}, #else - {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, 174}, + {"INVALID_MAX_EARLY_DATA", 20, 174}, #endif #ifdef SSL_R_INVALID_NULL_CMD_NAME {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, #else - {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385}, + {"INVALID_NULL_CMD_NAME", 20, 385}, #endif #ifdef SSL_R_INVALID_SEQUENCE_NUMBER {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER}, #else - {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, 402}, + {"INVALID_SEQUENCE_NUMBER", 20, 402}, #endif #ifdef SSL_R_INVALID_SERVERINFO_DATA {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, #else - {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388}, + {"INVALID_SERVERINFO_DATA", 20, 388}, #endif #ifdef SSL_R_INVALID_SESSION_ID {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID}, #else - {"INVALID_SESSION_ID", ERR_LIB_SSL, 999}, + {"INVALID_SESSION_ID", 20, 999}, #endif #ifdef SSL_R_INVALID_SRP_USERNAME {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, #else - {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357}, + {"INVALID_SRP_USERNAME", 20, 357}, #endif #ifdef SSL_R_INVALID_STATUS_RESPONSE {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, #else - {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328}, + {"INVALID_STATUS_RESPONSE", 20, 328}, #endif #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, #else - {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325}, + {"INVALID_TICKET_KEYS_LENGTH", 20, 325}, #endif #ifdef SSL_R_KRB5_S_TKT_NYV {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV}, #else - {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294}, + {"KRB5_S_TKT_NYV", 20, 294}, #endif #ifdef SSL_R_KRB5_S_TKT_SKEW {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW}, #else - {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295}, + {"KRB5_S_TKT_SKEW", 20, 295}, #endif #ifdef SSL_R_LENGTH_MISMATCH {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, #else - {"LENGTH_MISMATCH", ERR_LIB_SSL, 159}, + {"LENGTH_MISMATCH", 20, 159}, #endif #ifdef SSL_R_LENGTH_TOO_LONG {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG}, #else - {"LENGTH_TOO_LONG", ERR_LIB_SSL, 404}, + {"LENGTH_TOO_LONG", 20, 404}, #endif #ifdef SSL_R_LENGTH_TOO_SHORT {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, #else - {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160}, + {"LENGTH_TOO_SHORT", 20, 160}, #endif #ifdef SSL_R_LIBRARY_BUG {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, #else - {"LIBRARY_BUG", ERR_LIB_SSL, 274}, + {"LIBRARY_BUG", 20, 274}, #endif #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, #else - {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161}, + {"LIBRARY_HAS_NO_CIPHERS", 20, 161}, #endif #ifdef SSL_R_MESSAGE_TOO_LONG {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG}, #else - {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296}, + {"MESSAGE_TOO_LONG", 20, 296}, #endif #ifdef SSL_R_MISSING_DSA_SIGNING_CERT {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, #else - {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165}, + {"MISSING_DSA_SIGNING_CERT", 20, 165}, #endif #ifdef SSL_R_MISSING_ECDH_CERT {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT}, #else - {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382}, + {"MISSING_ECDH_CERT", 20, 382}, #endif #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, #else - {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381}, + {"MISSING_ECDSA_SIGNING_CERT", 20, 381}, #endif #ifdef SSL_R_MISSING_FATAL {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL}, #else - {"MISSING_FATAL", ERR_LIB_SSL, 256}, + {"MISSING_FATAL", 20, 256}, #endif #ifdef SSL_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_SSL, 290}, + {"MISSING_PARAMETERS", 20, 290}, #endif #ifdef SSL_R_MISSING_RSA_CERTIFICATE {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, #else - {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168}, + {"MISSING_RSA_CERTIFICATE", 20, 168}, #endif #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, #else - {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169}, + {"MISSING_RSA_ENCRYPTING_CERT", 20, 169}, #endif #ifdef SSL_R_MISSING_RSA_SIGNING_CERT {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, #else - {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170}, + {"MISSING_RSA_SIGNING_CERT", 20, 170}, #endif #ifdef SSL_R_MISSING_SIGALGS_EXTENSION {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION}, #else - {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, 112}, + {"MISSING_SIGALGS_EXTENSION", 20, 112}, #endif #ifdef SSL_R_MISSING_SIGNING_CERT {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT}, #else - {"MISSING_SIGNING_CERT", ERR_LIB_SSL, 221}, + {"MISSING_SIGNING_CERT", 20, 221}, #endif #ifdef SSL_R_MISSING_SRP_PARAM {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, #else - {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358}, + {"MISSING_SRP_PARAM", 20, 358}, #endif #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION}, #else - {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, 209}, + {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209}, #endif #ifdef SSL_R_MISSING_TMP_DH_KEY {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, #else - {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171}, + {"MISSING_TMP_DH_KEY", 20, 171}, #endif #ifdef SSL_R_MISSING_TMP_ECDH_KEY {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, #else - {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311}, + {"MISSING_TMP_ECDH_KEY", 20, 311}, #endif #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA}, #else - {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, 293}, + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293}, #endif #ifdef SSL_R_MULTIPLE_SGC_RESTARTS {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS}, #else - {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346}, + {"MULTIPLE_SGC_RESTARTS", 20, 346}, #endif #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY}, #else - {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, 182}, + {"NOT_ON_RECORD_BOUNDARY", 20, 182}, #endif #ifdef SSL_R_NOT_REPLACING_CERTIFICATE {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE}, #else - {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, 289}, + {"NOT_REPLACING_CERTIFICATE", 20, 289}, #endif #ifdef SSL_R_NOT_SERVER {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER}, #else - {"NOT_SERVER", ERR_LIB_SSL, 284}, + {"NOT_SERVER", 20, 284}, #endif #ifdef SSL_R_NO_APPLICATION_PROTOCOL {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL}, #else - {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, 235}, + {"NO_APPLICATION_PROTOCOL", 20, 235}, #endif #ifdef SSL_R_NO_CERTIFICATES_RETURNED {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, #else - {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176}, + {"NO_CERTIFICATES_RETURNED", 20, 176}, #endif #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, #else - {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177}, + {"NO_CERTIFICATE_ASSIGNED", 20, 177}, #endif #ifdef SSL_R_NO_CERTIFICATE_SET {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, #else - {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179}, + {"NO_CERTIFICATE_SET", 20, 179}, #endif #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR}, #else - {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, 214}, + {"NO_CHANGE_FOLLOWING_HRR", 20, 214}, #endif #ifdef SSL_R_NO_CIPHERS_AVAILABLE {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, #else - {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181}, + {"NO_CIPHERS_AVAILABLE", 20, 181}, #endif #ifdef SSL_R_NO_CIPHERS_SPECIFIED {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, #else - {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183}, + {"NO_CIPHERS_SPECIFIED", 20, 183}, #endif #ifdef SSL_R_NO_CIPHER_MATCH {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, #else - {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185}, + {"NO_CIPHER_MATCH", 20, 185}, #endif #ifdef SSL_R_NO_CLIENT_CERT_METHOD {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, #else - {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331}, + {"NO_CLIENT_CERT_METHOD", 20, 331}, #endif #ifdef SSL_R_NO_COMPRESSION_SPECIFIED {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, #else - {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187}, + {"NO_COMPRESSION_SPECIFIED", 20, 187}, #endif #ifdef SSL_R_NO_COOKIE_CALLBACK_SET {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET}, #else - {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, 287}, + {"NO_COOKIE_CALLBACK_SET", 20, 287}, #endif #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, #else - {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330}, + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330}, #endif #ifdef SSL_R_NO_METHOD_SPECIFIED {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, #else - {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188}, + {"NO_METHOD_SPECIFIED", 20, 188}, #endif #ifdef SSL_R_NO_PEM_EXTENSIONS {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, #else - {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389}, + {"NO_PEM_EXTENSIONS", 20, 389}, #endif #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, #else - {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190}, + {"NO_PRIVATE_KEY_ASSIGNED", 20, 190}, #endif #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, #else - {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191}, + {"NO_PROTOCOLS_AVAILABLE", 20, 191}, #endif #ifdef SSL_R_NO_RENEGOTIATION {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, #else - {"NO_RENEGOTIATION", ERR_LIB_SSL, 339}, + {"NO_RENEGOTIATION", 20, 339}, #endif #ifdef SSL_R_NO_REQUIRED_DIGEST {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, #else - {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324}, + {"NO_REQUIRED_DIGEST", 20, 324}, #endif #ifdef SSL_R_NO_SHARED_CIPHER {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, #else - {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193}, + {"NO_SHARED_CIPHER", 20, 193}, #endif #ifdef SSL_R_NO_SHARED_GROUPS {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS}, #else - {"NO_SHARED_GROUPS", ERR_LIB_SSL, 410}, + {"NO_SHARED_GROUPS", 20, 410}, #endif #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS}, #else - {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, 376}, + {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376}, #endif #ifdef SSL_R_NO_SRTP_PROFILES {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, #else - {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359}, + {"NO_SRTP_PROFILES", 20, 359}, #endif #ifdef SSL_R_NO_SUITABLE_KEY_SHARE {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE}, #else - {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, 101}, + {"NO_SUITABLE_KEY_SHARE", 20, 101}, #endif #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM}, #else - {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, 118}, + {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118}, #endif #ifdef SSL_R_NO_VALID_SCTS {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS}, #else - {"NO_VALID_SCTS", ERR_LIB_SSL, 216}, + {"NO_VALID_SCTS", 20, 216}, #endif #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK}, #else - {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, 403}, + {"NO_VERIFY_COOKIE_CALLBACK", 20, 403}, #endif #ifdef SSL_R_NULL_SSL_CTX {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, #else - {"NULL_SSL_CTX", ERR_LIB_SSL, 195}, + {"NULL_SSL_CTX", 20, 195}, #endif #ifdef SSL_R_NULL_SSL_METHOD_PASSED {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, #else - {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196}, + {"NULL_SSL_METHOD_PASSED", 20, 196}, #endif #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, #else - {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197}, + {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197}, #endif #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, #else - {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344}, + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344}, #endif #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE}, #else - {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387}, + {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 387}, #endif #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE}, #else - {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379}, + {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 379}, #endif #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE}, #else - {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297}, + {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", 20, 297}, #endif #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG}, #else - {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327}, + {"OPAQUE_PRF_INPUT_TOO_LONG", 20, 327}, #endif #ifdef SSL_R_OVERFLOW_ERROR {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR}, #else - {"OVERFLOW_ERROR", ERR_LIB_SSL, 237}, + {"OVERFLOW_ERROR", 20, 237}, #endif #ifdef SSL_R_PACKET_LENGTH_TOO_LONG {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, #else - {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198}, + {"PACKET_LENGTH_TOO_LONG", 20, 198}, #endif #ifdef SSL_R_PARSE_TLSEXT {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, #else - {"PARSE_TLSEXT", ERR_LIB_SSL, 227}, + {"PARSE_TLSEXT", 20, 227}, #endif #ifdef SSL_R_PATH_TOO_LONG {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, #else - {"PATH_TOO_LONG", ERR_LIB_SSL, 270}, + {"PATH_TOO_LONG", 20, 270}, #endif #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, #else - {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199}, + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199}, #endif #ifdef SSL_R_PEM_NAME_BAD_PREFIX {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, #else - {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391}, + {"PEM_NAME_BAD_PREFIX", 20, 391}, #endif #ifdef SSL_R_PEM_NAME_TOO_SHORT {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, #else - {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392}, + {"PEM_NAME_TOO_SHORT", 20, 392}, #endif #ifdef SSL_R_PIPELINE_FAILURE {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE}, #else - {"PIPELINE_FAILURE", ERR_LIB_SSL, 406}, + {"PIPELINE_FAILURE", 20, 406}, #endif #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR}, #else - {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, 278}, + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278}, #endif #ifdef SSL_R_PRIVATE_KEY_MISMATCH {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH}, #else - {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, 288}, + {"PRIVATE_KEY_MISMATCH", 20, 288}, #endif #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, #else - {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207}, + {"PROTOCOL_IS_SHUTDOWN", 20, 207}, #endif #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, #else - {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223}, + {"PSK_IDENTITY_NOT_FOUND", 20, 223}, #endif #ifdef SSL_R_PSK_NO_CLIENT_CB {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, #else - {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224}, + {"PSK_NO_CLIENT_CB", 20, 224}, #endif #ifdef SSL_R_PSK_NO_SERVER_CB {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, #else - {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225}, + {"PSK_NO_SERVER_CB", 20, 225}, #endif #ifdef SSL_R_READ_BIO_NOT_SET {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, #else - {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211}, + {"READ_BIO_NOT_SET", 20, 211}, #endif #ifdef SSL_R_READ_TIMEOUT_EXPIRED {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, #else - {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312}, + {"READ_TIMEOUT_EXPIRED", 20, 312}, #endif #ifdef SSL_R_RECORD_LENGTH_MISMATCH {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, #else - {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213}, + {"RECORD_LENGTH_MISMATCH", 20, 213}, #endif #ifdef SSL_R_RECORD_TOO_SMALL {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, #else - {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298}, + {"RECORD_TOO_SMALL", 20, 298}, #endif #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, #else - {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335}, + {"RENEGOTIATE_EXT_TOO_LONG", 20, 335}, #endif #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, #else - {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336}, + {"RENEGOTIATION_ENCODING_ERR", 20, 336}, #endif #ifdef SSL_R_RENEGOTIATION_MISMATCH {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, #else - {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337}, + {"RENEGOTIATION_MISMATCH", 20, 337}, #endif #ifdef SSL_R_REQUEST_PENDING {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING}, #else - {"REQUEST_PENDING", ERR_LIB_SSL, 285}, + {"REQUEST_PENDING", 20, 285}, #endif #ifdef SSL_R_REQUEST_SENT {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT}, #else - {"REQUEST_SENT", ERR_LIB_SSL, 286}, + {"REQUEST_SENT", 20, 286}, #endif #ifdef SSL_R_REQUIRED_CIPHER_MISSING {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, #else - {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215}, + {"REQUIRED_CIPHER_MISSING", 20, 215}, #endif #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING}, #else - {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342}, + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342}, #endif #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, #else - {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345}, + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345}, #endif #ifdef SSL_R_SCT_VERIFICATION_FAILED {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED}, #else - {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, 208}, + {"SCT_VERIFICATION_FAILED", 20, 208}, #endif #ifdef SSL_R_SERVERHELLO_TLSEXT {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, #else - {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275}, + {"SERVERHELLO_TLSEXT", 20, 275}, #endif #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, #else - {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277}, + {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277}, #endif #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT}, #else - {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, 407}, + {"SHUTDOWN_WHILE_IN_INIT", 20, 407}, #endif #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, #else - {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360}, + {"SIGNATURE_ALGORITHMS_ERROR", 20, 360}, #endif #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, #else - {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220}, + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220}, #endif #ifdef SSL_R_SRP_A_CALC {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, #else - {"SRP_A_CALC", ERR_LIB_SSL, 361}, + {"SRP_A_CALC", 20, 361}, #endif #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, #else - {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362}, + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362}, #endif #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, #else - {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363}, + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363}, #endif #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, #else - {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364}, + {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364}, #endif #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG}, #else - {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299}, + {"SSL2_CONNECTION_ID_TOO_LONG", 20, 299}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT}, #else - {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321}, + {"SSL3_EXT_INVALID_ECPOINTFORMAT", 20, 321}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH}, #else - {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, 232}, + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, #else - {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319}, + {"SSL3_EXT_INVALID_SERVERNAME", 20, 319}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, #else - {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320}, + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320}, #endif #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, #else - {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300}, + {"SSL3_SESSION_ID_TOO_LONG", 20, 300}, #endif #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, #else - {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042}, + {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042}, #endif #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, #else - {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020}, + {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020}, #endif #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, #else - {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045}, + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045}, #endif #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, #else - {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044}, + {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044}, #endif #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, #else - {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046}, + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046}, #endif #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, #else - {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030}, + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030}, #endif #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, #else - {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040}, + {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040}, #endif #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, #else - {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047}, + {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047}, #endif #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, #else - {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041}, + {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041}, #endif #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, #else - {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010}, + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010}, #endif #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, #else - {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043}, + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043}, #endif #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY}, #else - {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, 117}, + {"SSL_COMMAND_SECTION_EMPTY", 20, 117}, #endif #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND}, #else - {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, 125}, + {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125}, #endif #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, #else - {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228}, + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228}, #endif #ifdef SSL_R_SSL_HANDSHAKE_FAILURE {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, #else - {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229}, + {"SSL_HANDSHAKE_FAILURE", 20, 229}, #endif #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, #else - {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230}, + {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230}, #endif #ifdef SSL_R_SSL_NEGATIVE_LENGTH {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, #else - {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372}, + {"SSL_NEGATIVE_LENGTH", 20, 372}, #endif #ifdef SSL_R_SSL_SECTION_EMPTY {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY}, #else - {"SSL_SECTION_EMPTY", ERR_LIB_SSL, 126}, + {"SSL_SECTION_EMPTY", 20, 126}, #endif #ifdef SSL_R_SSL_SECTION_NOT_FOUND {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND}, #else - {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, 136}, + {"SSL_SECTION_NOT_FOUND", 20, 136}, #endif #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, #else - {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301}, + {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301}, #endif #ifdef SSL_R_SSL_SESSION_ID_CONFLICT {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, #else - {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302}, + {"SSL_SESSION_ID_CONFLICT", 20, 302}, #endif #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, #else - {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273}, + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273}, #endif #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, #else - {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303}, + {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303}, #endif #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG}, #else - {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 408}, + {"SSL_SESSION_ID_TOO_LONG", 20, 408}, #endif #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH}, #else - {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, 210}, + {"SSL_SESSION_VERSION_MISMATCH", 20, 210}, #endif #ifdef SSL_R_STILL_IN_INIT {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT}, #else - {"STILL_IN_INIT", ERR_LIB_SSL, 121}, + {"STILL_IN_INIT", 20, 121}, #endif #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED}, #else - {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, 1116}, + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116}, #endif #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION}, #else - {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, 1109}, + {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109}, #endif #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, #else - {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049}, + {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049}, #endif #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, #else - {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050}, + {"TLSV1_ALERT_DECODE_ERROR", 20, 1050}, #endif #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, #else - {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021}, + {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021}, #endif #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, #else - {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051}, + {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051}, #endif #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, #else - {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060}, + {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060}, #endif #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, #else - {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086}, + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086}, #endif #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, #else - {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071}, + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071}, #endif #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, #else - {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080}, + {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080}, #endif #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, #else - {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100}, + {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100}, #endif #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, #else - {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070}, + {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070}, #endif #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, #else - {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022}, + {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022}, #endif #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, #else - {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048}, + {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048}, #endif #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, #else - {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090}, + {"TLSV1_ALERT_USER_CANCELLED", 20, 1090}, #endif #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, #else - {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114}, + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114}, #endif #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, #else - {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113}, + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113}, #endif #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, #else - {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111}, + {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111}, #endif #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, #else - {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112}, + {"TLSV1_UNRECOGNIZED_NAME", 20, 1112}, #endif #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, #else - {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110}, + {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110}, #endif #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, #else - {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365}, + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", 20, 365}, #endif #ifdef SSL_R_TLS_HEARTBEAT_PENDING {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, #else - {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366}, + {"TLS_HEARTBEAT_PENDING", 20, 366}, #endif #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, #else - {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367}, + {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367}, #endif #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, #else - {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157}, + {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157}, #endif #ifdef SSL_R_TOO_MANY_KEY_UPDATES {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES}, #else - {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, 132}, + {"TOO_MANY_KEY_UPDATES", 20, 132}, #endif #ifdef SSL_R_TOO_MANY_WARN_ALERTS {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS}, #else - {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, 409}, + {"TOO_MANY_WARN_ALERTS", 20, 409}, #endif #ifdef SSL_R_TOO_MUCH_EARLY_DATA {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA}, #else - {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, 164}, + {"TOO_MUCH_EARLY_DATA", 20, 164}, #endif #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS}, #else - {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313}, + {"UNABLE_TO_DECODE_ECDH_CERTS", 20, 313}, #endif #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, #else - {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314}, + {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314}, #endif #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, #else - {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239}, + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239}, #endif #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, #else - {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242}, + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242}, #endif #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, #else - {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243}, + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243}, #endif #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE}, #else - {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, 262}, + {"UNEXPECTED_CCS_MESSAGE", 20, 262}, #endif #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA}, #else - {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, 178}, + {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178}, #endif #ifdef SSL_R_UNEXPECTED_MESSAGE {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, #else - {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244}, + {"UNEXPECTED_MESSAGE", 20, 244}, #endif #ifdef SSL_R_UNEXPECTED_RECORD {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, #else - {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245}, + {"UNEXPECTED_RECORD", 20, 245}, #endif #ifdef SSL_R_UNINITIALIZED {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, #else - {"UNINITIALIZED", ERR_LIB_SSL, 276}, + {"UNINITIALIZED", 20, 276}, #endif #ifdef SSL_R_UNKNOWN_ALERT_TYPE {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, #else - {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246}, + {"UNKNOWN_ALERT_TYPE", 20, 246}, #endif #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, #else - {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247}, + {"UNKNOWN_CERTIFICATE_TYPE", 20, 247}, #endif #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, #else - {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248}, + {"UNKNOWN_CIPHER_RETURNED", 20, 248}, #endif #ifdef SSL_R_UNKNOWN_CIPHER_TYPE {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, #else - {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249}, + {"UNKNOWN_CIPHER_TYPE", 20, 249}, #endif #ifdef SSL_R_UNKNOWN_CMD_NAME {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, #else - {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386}, + {"UNKNOWN_CMD_NAME", 20, 386}, #endif #ifdef SSL_R_UNKNOWN_COMMAND {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND}, #else - {"UNKNOWN_COMMAND", ERR_LIB_SSL, 139}, + {"UNKNOWN_COMMAND", 20, 139}, #endif #ifdef SSL_R_UNKNOWN_DIGEST {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, #else - {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368}, + {"UNKNOWN_DIGEST", 20, 368}, #endif #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, #else - {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250}, + {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250}, #endif #ifdef SSL_R_UNKNOWN_PKEY_TYPE {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, #else - {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251}, + {"UNKNOWN_PKEY_TYPE", 20, 251}, #endif #ifdef SSL_R_UNKNOWN_PROTOCOL {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, #else - {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252}, + {"UNKNOWN_PROTOCOL", 20, 252}, #endif #ifdef SSL_R_UNKNOWN_SSL_VERSION {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, #else - {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254}, + {"UNKNOWN_SSL_VERSION", 20, 254}, #endif #ifdef SSL_R_UNKNOWN_STATE {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, #else - {"UNKNOWN_STATE", ERR_LIB_SSL, 255}, + {"UNKNOWN_STATE", 20, 255}, #endif #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, #else - {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338}, + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338}, #endif #ifdef SSL_R_UNSOLICITED_EXTENSION {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION}, #else - {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, 217}, + {"UNSOLICITED_EXTENSION", 20, 217}, #endif #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, #else - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257}, + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257}, #endif #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE}, #else - {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326}, + {"UNSUPPORTED_DIGEST_TYPE", 20, 326}, #endif #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, #else - {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315}, + {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315}, #endif #ifdef SSL_R_UNSUPPORTED_PROTOCOL {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, #else - {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258}, + {"UNSUPPORTED_PROTOCOL", 20, 258}, #endif #ifdef SSL_R_UNSUPPORTED_SSL_VERSION {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, #else - {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259}, + {"UNSUPPORTED_SSL_VERSION", 20, 259}, #endif #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, #else - {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329}, + {"UNSUPPORTED_STATUS_TYPE", 20, 329}, #endif #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, #else - {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369}, + {"USE_SRTP_NOT_NEGOTIATED", 20, 369}, #endif #ifdef SSL_R_VERSION_TOO_HIGH {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH}, #else - {"VERSION_TOO_HIGH", ERR_LIB_SSL, 166}, + {"VERSION_TOO_HIGH", 20, 166}, #endif #ifdef SSL_R_VERSION_TOO_LOW {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, #else - {"VERSION_TOO_LOW", ERR_LIB_SSL, 396}, + {"VERSION_TOO_LOW", 20, 396}, #endif #ifdef SSL_R_WRONG_CERTIFICATE_TYPE {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, #else - {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383}, + {"WRONG_CERTIFICATE_TYPE", 20, 383}, #endif #ifdef SSL_R_WRONG_CIPHER_RETURNED {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, #else - {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261}, + {"WRONG_CIPHER_RETURNED", 20, 261}, #endif #ifdef SSL_R_WRONG_CURVE {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, #else - {"WRONG_CURVE", ERR_LIB_SSL, 378}, + {"WRONG_CURVE", 20, 378}, #endif #ifdef SSL_R_WRONG_SIGNATURE_LENGTH {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, #else - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264}, + {"WRONG_SIGNATURE_LENGTH", 20, 264}, #endif #ifdef SSL_R_WRONG_SIGNATURE_SIZE {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, #else - {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265}, + {"WRONG_SIGNATURE_SIZE", 20, 265}, #endif #ifdef SSL_R_WRONG_SIGNATURE_TYPE {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, #else - {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370}, + {"WRONG_SIGNATURE_TYPE", 20, 370}, #endif #ifdef SSL_R_WRONG_SSL_VERSION {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, #else - {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266}, + {"WRONG_SSL_VERSION", 20, 266}, #endif #ifdef SSL_R_WRONG_VERSION_NUMBER {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, #else - {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267}, + {"WRONG_VERSION_NUMBER", 20, 267}, #endif #ifdef SSL_R_X509_LIB {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, #else - {"X509_LIB", ERR_LIB_SSL, 268}, + {"X509_LIB", 20, 268}, #endif #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, #else - {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269}, + {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269}, #endif #ifdef TS_R_BAD_PKCS7_TYPE {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE}, #else - {"BAD_PKCS7_TYPE", ERR_LIB_TS, 132}, + {"BAD_PKCS7_TYPE", 47, 132}, #endif #ifdef TS_R_BAD_TYPE {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE}, #else - {"BAD_TYPE", ERR_LIB_TS, 133}, + {"BAD_TYPE", 47, 133}, #endif #ifdef TS_R_CANNOT_LOAD_CERT {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT}, #else - {"CANNOT_LOAD_CERT", ERR_LIB_TS, 137}, + {"CANNOT_LOAD_CERT", 47, 137}, #endif #ifdef TS_R_CANNOT_LOAD_KEY {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY}, #else - {"CANNOT_LOAD_KEY", ERR_LIB_TS, 138}, + {"CANNOT_LOAD_KEY", 47, 138}, #endif #ifdef TS_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, 100}, + {"CERTIFICATE_VERIFY_ERROR", 47, 100}, #endif #ifdef TS_R_COULD_NOT_SET_ENGINE {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE}, #else - {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, 127}, + {"COULD_NOT_SET_ENGINE", 47, 127}, #endif #ifdef TS_R_COULD_NOT_SET_TIME {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME}, #else - {"COULD_NOT_SET_TIME", ERR_LIB_TS, 115}, + {"COULD_NOT_SET_TIME", 47, 115}, #endif #ifdef TS_R_DETACHED_CONTENT {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT}, #else - {"DETACHED_CONTENT", ERR_LIB_TS, 134}, + {"DETACHED_CONTENT", 47, 134}, #endif #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR}, #else - {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, 116}, + {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116}, #endif #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR}, #else - {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, 139}, + {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139}, #endif #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR}, #else - {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, 101}, + {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101}, #endif #ifdef TS_R_INVALID_NULL_POINTER {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER}, #else - {"INVALID_NULL_POINTER", ERR_LIB_TS, 102}, + {"INVALID_NULL_POINTER", 47, 102}, #endif #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE}, #else - {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, 117}, + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117}, #endif #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH}, #else - {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, 103}, + {"MESSAGE_IMPRINT_MISMATCH", 47, 103}, #endif #ifdef TS_R_NONCE_MISMATCH {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH}, #else - {"NONCE_MISMATCH", ERR_LIB_TS, 104}, + {"NONCE_MISMATCH", 47, 104}, #endif #ifdef TS_R_NONCE_NOT_RETURNED {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED}, #else - {"NONCE_NOT_RETURNED", ERR_LIB_TS, 105}, + {"NONCE_NOT_RETURNED", 47, 105}, #endif #ifdef TS_R_NO_CONTENT {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT}, #else - {"NO_CONTENT", ERR_LIB_TS, 106}, + {"NO_CONTENT", 47, 106}, #endif #ifdef TS_R_NO_TIME_STAMP_TOKEN {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN}, #else - {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, 107}, + {"NO_TIME_STAMP_TOKEN", 47, 107}, #endif #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR}, #else - {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, 118}, + {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118}, #endif #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR}, #else - {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, 119}, + {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119}, #endif #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED}, #else - {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, 129}, + {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129}, #endif #ifdef TS_R_POLICY_MISMATCH {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH}, #else - {"POLICY_MISMATCH", ERR_LIB_TS, 108}, + {"POLICY_MISMATCH", 47, 108}, #endif #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, 120}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120}, #endif #ifdef TS_R_RESPONSE_SETUP_ERROR {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR}, #else - {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, 121}, + {"RESPONSE_SETUP_ERROR", 47, 121}, #endif #ifdef TS_R_SIGNATURE_FAILURE {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE}, #else - {"SIGNATURE_FAILURE", ERR_LIB_TS, 109}, + {"SIGNATURE_FAILURE", 47, 109}, #endif #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER}, #else - {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, 110}, + {"THERE_MUST_BE_ONE_SIGNER", 47, 110}, #endif #ifdef TS_R_TIME_SYSCALL_ERROR {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR}, #else - {"TIME_SYSCALL_ERROR", ERR_LIB_TS, 122}, + {"TIME_SYSCALL_ERROR", 47, 122}, #endif #ifdef TS_R_TOKEN_NOT_PRESENT {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT}, #else - {"TOKEN_NOT_PRESENT", ERR_LIB_TS, 130}, + {"TOKEN_NOT_PRESENT", 47, 130}, #endif #ifdef TS_R_TOKEN_PRESENT {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT}, #else - {"TOKEN_PRESENT", ERR_LIB_TS, 131}, + {"TOKEN_PRESENT", 47, 131}, #endif #ifdef TS_R_TSA_NAME_MISMATCH {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH}, #else - {"TSA_NAME_MISMATCH", ERR_LIB_TS, 111}, + {"TSA_NAME_MISMATCH", 47, 111}, #endif #ifdef TS_R_TSA_UNTRUSTED {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED}, #else - {"TSA_UNTRUSTED", ERR_LIB_TS, 112}, + {"TSA_UNTRUSTED", 47, 112}, #endif #ifdef TS_R_TST_INFO_SETUP_ERROR {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR}, #else - {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, 123}, + {"TST_INFO_SETUP_ERROR", 47, 123}, #endif #ifdef TS_R_TS_DATASIGN {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN}, #else - {"TS_DATASIGN", ERR_LIB_TS, 124}, + {"TS_DATASIGN", 47, 124}, #endif #ifdef TS_R_UNACCEPTABLE_POLICY {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY}, #else - {"UNACCEPTABLE_POLICY", ERR_LIB_TS, 125}, + {"UNACCEPTABLE_POLICY", 47, 125}, #endif #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM}, #else - {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, 126}, + {"UNSUPPORTED_MD_ALGORITHM", 47, 126}, #endif #ifdef TS_R_UNSUPPORTED_VERSION {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION}, #else - {"UNSUPPORTED_VERSION", ERR_LIB_TS, 113}, + {"UNSUPPORTED_VERSION", 47, 113}, #endif #ifdef TS_R_VAR_BAD_VALUE {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE}, #else - {"VAR_BAD_VALUE", ERR_LIB_TS, 135}, + {"VAR_BAD_VALUE", 47, 135}, #endif #ifdef TS_R_VAR_LOOKUP_FAILURE {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE}, #else - {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, 136}, + {"VAR_LOOKUP_FAILURE", 47, 136}, #endif #ifdef TS_R_WRONG_CONTENT_TYPE {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE}, #else - {"WRONG_CONTENT_TYPE", ERR_LIB_TS, 114}, + {"WRONG_CONTENT_TYPE", 47, 114}, #endif #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS}, #else - {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, 104}, + {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104}, #endif #ifdef UI_R_INDEX_TOO_LARGE {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE}, #else - {"INDEX_TOO_LARGE", ERR_LIB_UI, 102}, + {"INDEX_TOO_LARGE", 40, 102}, #endif #ifdef UI_R_INDEX_TOO_SMALL {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL}, #else - {"INDEX_TOO_SMALL", ERR_LIB_UI, 103}, + {"INDEX_TOO_SMALL", 40, 103}, #endif #ifdef UI_R_NO_RESULT_BUFFER {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER}, #else - {"NO_RESULT_BUFFER", ERR_LIB_UI, 105}, + {"NO_RESULT_BUFFER", 40, 105}, #endif #ifdef UI_R_PROCESSING_ERROR {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR}, #else - {"PROCESSING_ERROR", ERR_LIB_UI, 107}, + {"PROCESSING_ERROR", 40, 107}, #endif #ifdef UI_R_RESULT_TOO_LARGE {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE}, #else - {"RESULT_TOO_LARGE", ERR_LIB_UI, 100}, + {"RESULT_TOO_LARGE", 40, 100}, #endif #ifdef UI_R_RESULT_TOO_SMALL {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL}, #else - {"RESULT_TOO_SMALL", ERR_LIB_UI, 101}, + {"RESULT_TOO_SMALL", 40, 101}, #endif #ifdef UI_R_SYSASSIGN_ERROR {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR}, #else - {"SYSASSIGN_ERROR", ERR_LIB_UI, 109}, + {"SYSASSIGN_ERROR", 40, 109}, #endif #ifdef UI_R_SYSDASSGN_ERROR {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR}, #else - {"SYSDASSGN_ERROR", ERR_LIB_UI, 110}, + {"SYSDASSGN_ERROR", 40, 110}, #endif #ifdef UI_R_SYSQIOW_ERROR {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR}, #else - {"SYSQIOW_ERROR", ERR_LIB_UI, 111}, + {"SYSQIOW_ERROR", 40, 111}, #endif #ifdef UI_R_UNKNOWN_CONTROL_COMMAND {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND}, #else - {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, 106}, + {"UNKNOWN_CONTROL_COMMAND", 40, 106}, #endif #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE}, #else - {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, 108}, + {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108}, #endif #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED}, #else - {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, 112}, + {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112}, #endif #ifdef X509V3_R_BAD_IP_ADDRESS {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS}, #else - {"BAD_IP_ADDRESS", ERR_LIB_X509V3, 118}, + {"BAD_IP_ADDRESS", 34, 118}, #endif #ifdef X509V3_R_BAD_OBJECT {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT}, #else - {"BAD_OBJECT", ERR_LIB_X509V3, 119}, + {"BAD_OBJECT", 34, 119}, #endif #ifdef X509V3_R_BN_DEC2BN_ERROR {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR}, #else - {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, 100}, + {"BN_DEC2BN_ERROR", 34, 100}, #endif #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR}, #else - {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, 101}, + {"BN_TO_ASN1_INTEGER_ERROR", 34, 101}, #endif #ifdef X509V3_R_DIRNAME_ERROR {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR}, #else - {"DIRNAME_ERROR", ERR_LIB_X509V3, 149}, + {"DIRNAME_ERROR", 34, 149}, #endif #ifdef X509V3_R_DISTPOINT_ALREADY_SET {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET}, #else - {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, 160}, + {"DISTPOINT_ALREADY_SET", 34, 160}, #endif #ifdef X509V3_R_DUPLICATE_ZONE_ID {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID}, #else - {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, 133}, + {"DUPLICATE_ZONE_ID", 34, 133}, #endif #ifdef X509V3_R_ERROR_CONVERTING_ZONE {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE}, #else - {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, 131}, + {"ERROR_CONVERTING_ZONE", 34, 131}, #endif #ifdef X509V3_R_ERROR_CREATING_EXTENSION {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION}, #else - {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, 144}, + {"ERROR_CREATING_EXTENSION", 34, 144}, #endif #ifdef X509V3_R_ERROR_IN_EXTENSION {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION}, #else - {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, 128}, + {"ERROR_IN_EXTENSION", 34, 128}, #endif #ifdef X509V3_R_EXPECTED_A_SECTION_NAME {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME}, #else - {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, 137}, + {"EXPECTED_A_SECTION_NAME", 34, 137}, #endif #ifdef X509V3_R_EXTENSION_EXISTS {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS}, #else - {"EXTENSION_EXISTS", ERR_LIB_X509V3, 145}, + {"EXTENSION_EXISTS", 34, 145}, #endif #ifdef X509V3_R_EXTENSION_NAME_ERROR {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR}, #else - {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, 115}, + {"EXTENSION_NAME_ERROR", 34, 115}, #endif #ifdef X509V3_R_EXTENSION_NOT_FOUND {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND}, #else - {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, 102}, + {"EXTENSION_NOT_FOUND", 34, 102}, #endif #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED}, #else - {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, 103}, + {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103}, #endif #ifdef X509V3_R_EXTENSION_VALUE_ERROR {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR}, #else - {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, 116}, + {"EXTENSION_VALUE_ERROR", 34, 116}, #endif #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION}, #else - {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, 151}, + {"ILLEGAL_EMPTY_EXTENSION", 34, 151}, #endif #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG}, #else - {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, 152}, + {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152}, #endif #ifdef X509V3_R_INVALID_ASNUMBER {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER}, #else - {"INVALID_ASNUMBER", ERR_LIB_X509V3, 162}, + {"INVALID_ASNUMBER", 34, 162}, #endif #ifdef X509V3_R_INVALID_ASRANGE {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE}, #else - {"INVALID_ASRANGE", ERR_LIB_X509V3, 163}, + {"INVALID_ASRANGE", 34, 163}, #endif #ifdef X509V3_R_INVALID_BOOLEAN_STRING {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING}, #else - {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, 104}, + {"INVALID_BOOLEAN_STRING", 34, 104}, #endif #ifdef X509V3_R_INVALID_EXTENSION_STRING {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING}, #else - {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, 105}, + {"INVALID_EXTENSION_STRING", 34, 105}, #endif #ifdef X509V3_R_INVALID_INHERITANCE {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE}, #else - {"INVALID_INHERITANCE", ERR_LIB_X509V3, 165}, + {"INVALID_INHERITANCE", 34, 165}, #endif #ifdef X509V3_R_INVALID_IPADDRESS {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS}, #else - {"INVALID_IPADDRESS", ERR_LIB_X509V3, 166}, + {"INVALID_IPADDRESS", 34, 166}, #endif #ifdef X509V3_R_INVALID_MULTIPLE_RDNS {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS}, #else - {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, 161}, + {"INVALID_MULTIPLE_RDNS", 34, 161}, #endif #ifdef X509V3_R_INVALID_NAME {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME}, #else - {"INVALID_NAME", ERR_LIB_X509V3, 106}, + {"INVALID_NAME", 34, 106}, #endif #ifdef X509V3_R_INVALID_NULL_ARGUMENT {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT}, #else - {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, 107}, + {"INVALID_NULL_ARGUMENT", 34, 107}, #endif #ifdef X509V3_R_INVALID_NULL_NAME {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME}, #else - {"INVALID_NULL_NAME", ERR_LIB_X509V3, 108}, + {"INVALID_NULL_NAME", 34, 108}, #endif #ifdef X509V3_R_INVALID_NULL_VALUE {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE}, #else - {"INVALID_NULL_VALUE", ERR_LIB_X509V3, 109}, + {"INVALID_NULL_VALUE", 34, 109}, #endif #ifdef X509V3_R_INVALID_NUMBER {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER}, #else - {"INVALID_NUMBER", ERR_LIB_X509V3, 140}, + {"INVALID_NUMBER", 34, 140}, #endif #ifdef X509V3_R_INVALID_NUMBERS {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS}, #else - {"INVALID_NUMBERS", ERR_LIB_X509V3, 141}, + {"INVALID_NUMBERS", 34, 141}, #endif #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER}, #else - {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, 110}, + {"INVALID_OBJECT_IDENTIFIER", 34, 110}, #endif #ifdef X509V3_R_INVALID_OPTION {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION}, #else - {"INVALID_OPTION", ERR_LIB_X509V3, 138}, + {"INVALID_OPTION", 34, 138}, #endif #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER}, #else - {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, 134}, + {"INVALID_POLICY_IDENTIFIER", 34, 134}, #endif #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING}, #else - {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, 153}, + {"INVALID_PROXY_POLICY_SETTING", 34, 153}, #endif #ifdef X509V3_R_INVALID_PURPOSE {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE}, #else - {"INVALID_PURPOSE", ERR_LIB_X509V3, 146}, + {"INVALID_PURPOSE", 34, 146}, #endif #ifdef X509V3_R_INVALID_SAFI {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI}, #else - {"INVALID_SAFI", ERR_LIB_X509V3, 164}, + {"INVALID_SAFI", 34, 164}, #endif #ifdef X509V3_R_INVALID_SECTION {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION}, #else - {"INVALID_SECTION", ERR_LIB_X509V3, 135}, + {"INVALID_SECTION", 34, 135}, #endif #ifdef X509V3_R_INVALID_SYNTAX {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX}, #else - {"INVALID_SYNTAX", ERR_LIB_X509V3, 143}, + {"INVALID_SYNTAX", 34, 143}, #endif #ifdef X509V3_R_ISSUER_DECODE_ERROR {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR}, #else - {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, 126}, + {"ISSUER_DECODE_ERROR", 34, 126}, #endif #ifdef X509V3_R_MISSING_VALUE {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE}, #else - {"MISSING_VALUE", ERR_LIB_X509V3, 124}, + {"MISSING_VALUE", 34, 124}, #endif #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS}, #else - {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, 142}, + {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142}, #endif #ifdef X509V3_R_NO_CONFIG_DATABASE {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE}, #else - {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, 136}, + {"NO_CONFIG_DATABASE", 34, 136}, #endif #ifdef X509V3_R_NO_ISSUER_CERTIFICATE {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE}, #else - {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, 121}, + {"NO_ISSUER_CERTIFICATE", 34, 121}, #endif #ifdef X509V3_R_NO_ISSUER_DETAILS {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS}, #else - {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, 127}, + {"NO_ISSUER_DETAILS", 34, 127}, #endif #ifdef X509V3_R_NO_POLICY_IDENTIFIER {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER}, #else - {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, 139}, + {"NO_POLICY_IDENTIFIER", 34, 139}, #endif #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED}, #else - {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, 154}, + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154}, #endif #ifdef X509V3_R_NO_PUBLIC_KEY {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY}, #else - {"NO_PUBLIC_KEY", ERR_LIB_X509V3, 114}, + {"NO_PUBLIC_KEY", 34, 114}, #endif #ifdef X509V3_R_NO_SUBJECT_DETAILS {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS}, #else - {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, 125}, + {"NO_SUBJECT_DETAILS", 34, 125}, #endif #ifdef X509V3_R_OPERATION_NOT_DEFINED {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED}, #else - {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, 148}, + {"OPERATION_NOT_DEFINED", 34, 148}, #endif #ifdef X509V3_R_OTHERNAME_ERROR {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR}, #else - {"OTHERNAME_ERROR", ERR_LIB_X509V3, 147}, + {"OTHERNAME_ERROR", 34, 147}, #endif #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED}, #else - {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, 155}, + {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155}, #endif #ifdef X509V3_R_POLICY_PATH_LENGTH {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH}, #else - {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, 156}, + {"POLICY_PATH_LENGTH", 34, 156}, #endif #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED}, #else - {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, 157}, + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157}, #endif #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY}, #else - {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, 159}, + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159}, #endif #ifdef X509V3_R_SECTION_NOT_FOUND {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND}, #else - {"SECTION_NOT_FOUND", ERR_LIB_X509V3, 150}, + {"SECTION_NOT_FOUND", 34, 150}, #endif #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS}, #else - {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, 122}, + {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122}, #endif #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID}, #else - {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, 123}, + {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123}, #endif #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT}, #else - {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, 111}, + {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111}, #endif #ifdef X509V3_R_UNKNOWN_EXTENSION {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION}, #else - {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, 129}, + {"UNKNOWN_EXTENSION", 34, 129}, #endif #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME}, #else - {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, 130}, + {"UNKNOWN_EXTENSION_NAME", 34, 130}, #endif #ifdef X509V3_R_UNKNOWN_OPTION {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION}, #else - {"UNKNOWN_OPTION", ERR_LIB_X509V3, 120}, + {"UNKNOWN_OPTION", 34, 120}, #endif #ifdef X509V3_R_UNSUPPORTED_OPTION {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION}, #else - {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, 117}, + {"UNSUPPORTED_OPTION", 34, 117}, #endif #ifdef X509V3_R_UNSUPPORTED_TYPE {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE}, #else - {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, 167}, + {"UNSUPPORTED_TYPE", 34, 167}, #endif #ifdef X509V3_R_USER_TOO_LONG {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG}, #else - {"USER_TOO_LONG", ERR_LIB_X509V3, 132}, + {"USER_TOO_LONG", 34, 132}, #endif #ifdef X509_R_AKID_MISMATCH {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH}, #else - {"AKID_MISMATCH", ERR_LIB_X509, 110}, + {"AKID_MISMATCH", 11, 110}, #endif #ifdef X509_R_BAD_SELECTOR {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR}, #else - {"BAD_SELECTOR", ERR_LIB_X509, 133}, + {"BAD_SELECTOR", 11, 133}, #endif #ifdef X509_R_BAD_X509_FILETYPE {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE}, #else - {"BAD_X509_FILETYPE", ERR_LIB_X509, 100}, + {"BAD_X509_FILETYPE", 11, 100}, #endif #ifdef X509_R_BASE64_DECODE_ERROR {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR}, #else - {"BASE64_DECODE_ERROR", ERR_LIB_X509, 118}, + {"BASE64_DECODE_ERROR", 11, 118}, #endif #ifdef X509_R_CANT_CHECK_DH_KEY {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY}, #else - {"CANT_CHECK_DH_KEY", ERR_LIB_X509, 114}, + {"CANT_CHECK_DH_KEY", 11, 114}, #endif #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE}, #else - {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, 101}, + {"CERT_ALREADY_IN_HASH_TABLE", 11, 101}, #endif #ifdef X509_R_CRL_ALREADY_DELTA {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA}, #else - {"CRL_ALREADY_DELTA", ERR_LIB_X509, 127}, + {"CRL_ALREADY_DELTA", 11, 127}, #endif #ifdef X509_R_CRL_VERIFY_FAILURE {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE}, #else - {"CRL_VERIFY_FAILURE", ERR_LIB_X509, 131}, + {"CRL_VERIFY_FAILURE", 11, 131}, #endif #ifdef X509_R_ERR_ASN1_LIB {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB}, #else - {"ERR_ASN1_LIB", ERR_LIB_X509, 102}, + {"ERR_ASN1_LIB", 11, 102}, #endif #ifdef X509_R_IDP_MISMATCH {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH}, #else - {"IDP_MISMATCH", ERR_LIB_X509, 128}, + {"IDP_MISMATCH", 11, 128}, #endif #ifdef X509_R_INVALID_ATTRIBUTES {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES}, #else - {"INVALID_ATTRIBUTES", ERR_LIB_X509, 138}, + {"INVALID_ATTRIBUTES", 11, 138}, #endif #ifdef X509_R_INVALID_DIRECTORY {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY}, #else - {"INVALID_DIRECTORY", ERR_LIB_X509, 113}, + {"INVALID_DIRECTORY", 11, 113}, #endif #ifdef X509_R_INVALID_FIELD_NAME {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME}, #else - {"INVALID_FIELD_NAME", ERR_LIB_X509, 119}, + {"INVALID_FIELD_NAME", 11, 119}, #endif #ifdef X509_R_INVALID_TRUST {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST}, #else - {"INVALID_TRUST", ERR_LIB_X509, 123}, + {"INVALID_TRUST", 11, 123}, #endif #ifdef X509_R_ISSUER_MISMATCH {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH}, #else - {"ISSUER_MISMATCH", ERR_LIB_X509, 129}, + {"ISSUER_MISMATCH", 11, 129}, #endif #ifdef X509_R_KEY_TYPE_MISMATCH {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH}, #else - {"KEY_TYPE_MISMATCH", ERR_LIB_X509, 115}, + {"KEY_TYPE_MISMATCH", 11, 115}, #endif #ifdef X509_R_KEY_VALUES_MISMATCH {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH}, #else - {"KEY_VALUES_MISMATCH", ERR_LIB_X509, 116}, + {"KEY_VALUES_MISMATCH", 11, 116}, #endif #ifdef X509_R_LOADING_CERT_DIR {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR}, #else - {"LOADING_CERT_DIR", ERR_LIB_X509, 103}, + {"LOADING_CERT_DIR", 11, 103}, #endif #ifdef X509_R_LOADING_DEFAULTS {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS}, #else - {"LOADING_DEFAULTS", ERR_LIB_X509, 104}, + {"LOADING_DEFAULTS", 11, 104}, #endif #ifdef X509_R_METHOD_NOT_SUPPORTED {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED}, #else - {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124}, + {"METHOD_NOT_SUPPORTED", 11, 124}, #endif #ifdef X509_R_NAME_TOO_LONG {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG}, #else - {"NAME_TOO_LONG", ERR_LIB_X509, 134}, + {"NAME_TOO_LONG", 11, 134}, #endif #ifdef X509_R_NEWER_CRL_NOT_NEWER {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER}, #else - {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, 132}, + {"NEWER_CRL_NOT_NEWER", 11, 132}, #endif #ifdef X509_R_NO_CERTIFICATE_FOUND {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND}, #else - {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, 135}, + {"NO_CERTIFICATE_FOUND", 11, 135}, #endif #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND}, #else - {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, 136}, + {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136}, #endif #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY}, #else - {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105}, + {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105}, #endif #ifdef X509_R_NO_CRL_FOUND {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND}, #else - {"NO_CRL_FOUND", ERR_LIB_X509, 137}, + {"NO_CRL_FOUND", 11, 137}, #endif #ifdef X509_R_NO_CRL_NUMBER {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER}, #else - {"NO_CRL_NUMBER", ERR_LIB_X509, 130}, + {"NO_CRL_NUMBER", 11, 130}, #endif #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR}, #else - {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, 125}, + {"PUBLIC_KEY_DECODE_ERROR", 11, 125}, #endif #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR}, #else - {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, 126}, + {"PUBLIC_KEY_ENCODE_ERROR", 11, 126}, #endif #ifdef X509_R_SHOULD_RETRY {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY}, #else - {"SHOULD_RETRY", ERR_LIB_X509, 106}, + {"SHOULD_RETRY", 11, 106}, #endif #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN}, #else - {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, 107}, + {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107}, #endif #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY}, #else - {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, 108}, + {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108}, #endif #ifdef X509_R_UNKNOWN_KEY_TYPE {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE}, #else - {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, 117}, + {"UNKNOWN_KEY_TYPE", 11, 117}, #endif #ifdef X509_R_UNKNOWN_NID {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID}, #else - {"UNKNOWN_NID", ERR_LIB_X509, 109}, + {"UNKNOWN_NID", 11, 109}, #endif #ifdef X509_R_UNKNOWN_PURPOSE_ID {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID}, #else - {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, 121}, + {"UNKNOWN_PURPOSE_ID", 11, 121}, #endif #ifdef X509_R_UNKNOWN_TRUST_ID {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID}, #else - {"UNKNOWN_TRUST_ID", ERR_LIB_X509, 120}, + {"UNKNOWN_TRUST_ID", 11, 120}, #endif #ifdef X509_R_UNSUPPORTED_ALGORITHM {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM}, #else - {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, 111}, + {"UNSUPPORTED_ALGORITHM", 11, 111}, #endif #ifdef X509_R_WRONG_LOOKUP_TYPE {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE}, #else - {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, 112}, + {"WRONG_LOOKUP_TYPE", 11, 112}, #endif #ifdef X509_R_WRONG_TYPE {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE}, #else - {"WRONG_TYPE", ERR_LIB_X509, 122}, + {"WRONG_TYPE", 11, 122}, #endif { NULL } }; diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index a8562a225d256..a29c04ab57183 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -46,9 +46,13 @@ def parse_error_codes(h_file, prefix, libcode): continue mnemonic = base[:-5].upper() if mnemonic == "": - # Skip err.h. - continue - error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) + # err.h + lib_codes = { + code: num + for (code, (_, _, num)) in parse_error_codes(error_header, 'ERR_LIB_', None) + } + else: + error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) # Read codes from libraries new_codes = [] @@ -88,7 +92,7 @@ def w(l): w(' #ifdef %s' % (errcode)) w(' {"%s", %s, %s},' % (name, libcode, errcode)) w(' #else') - w(' {"%s", %s, %d},' % (name, libcode, num)) + w(' {"%s", %s, %d},' % (name, lib_codes[libcode], num)) w(' #endif') w(' { NULL }') w('};') From webhook-mailer at python.org Mon Apr 13 23:31:27 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 14 Apr 2020 03:31:27 -0000 Subject: [Python-checkins] closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506) Message-ID: https://github.com/python/cpython/commit/c496e29c2bd0c29327c93174d5a40d2dc5a09402 commit: c496e29c2bd0c29327c93174d5a40d2dc5a09402 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-13T20:31:18-07:00 summary: closes bpo-40266, closes bpo-39953: Use numeric lib code if compiling against old OpenSSL. (GH-19506) (cherry picked from commit 584a3cfda4d7a65ea0c1ea1ee541378bb7be46ca) Co-authored-by: Benjamin Peterson files: M Modules/_ssl_data.h M Tools/ssl/make_ssl_data.py diff --git a/Modules/_ssl_data.h b/Modules/_ssl_data.h index e22f827032042..8f2994f52dfef 100644 --- a/Modules/_ssl_data.h +++ b/Modules/_ssl_data.h @@ -1,5 +1,5 @@ /* File generated by Tools/ssl/make_ssl_data.py */ -/* Generated on 2020-04-12T13:38:13.871723 */ +/* Generated on 2020-04-13T21:45:54.559159 */ static struct py_ssl_library_code library_codes[] = { #ifdef ERR_LIB_ASN1 @@ -87,6237 +87,6237 @@ static struct py_ssl_error_code error_codes[] = { #ifdef ASN1_R_ADDING_OBJECT {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT}, #else - {"ADDING_OBJECT", ERR_LIB_ASN1, 171}, + {"ADDING_OBJECT", 13, 171}, #endif #ifdef ASN1_R_ASN1_PARSE_ERROR {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR}, #else - {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, 203}, + {"ASN1_PARSE_ERROR", 13, 203}, #endif #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR}, #else - {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, 204}, + {"ASN1_SIG_PARSE_ERROR", 13, 204}, #endif #ifdef ASN1_R_AUX_ERROR {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR}, #else - {"AUX_ERROR", ERR_LIB_ASN1, 100}, + {"AUX_ERROR", 13, 100}, #endif #ifdef ASN1_R_BAD_OBJECT_HEADER {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER}, #else - {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, 102}, + {"BAD_OBJECT_HEADER", 13, 102}, #endif #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH}, #else - {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 214}, + {"BMPSTRING_IS_WRONG_LENGTH", 13, 214}, #endif #ifdef ASN1_R_BN_LIB {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB}, #else - {"BN_LIB", ERR_LIB_ASN1, 105}, + {"BN_LIB", 13, 105}, #endif #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH}, #else - {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, 106}, + {"BOOLEAN_IS_WRONG_LENGTH", 13, 106}, #endif #ifdef ASN1_R_BUFFER_TOO_SMALL {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL}, #else - {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, 107}, + {"BUFFER_TOO_SMALL", 13, 107}, #endif #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, #else - {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, 108}, + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108}, #endif #ifdef ASN1_R_CONTEXT_NOT_INITIALISED {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED}, #else - {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, 217}, + {"CONTEXT_NOT_INITIALISED", 13, 217}, #endif #ifdef ASN1_R_DATA_IS_WRONG {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG}, #else - {"DATA_IS_WRONG", ERR_LIB_ASN1, 109}, + {"DATA_IS_WRONG", 13, 109}, #endif #ifdef ASN1_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_ASN1, 110}, + {"DECODE_ERROR", 13, 110}, #endif #ifdef ASN1_R_DEPTH_EXCEEDED {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED}, #else - {"DEPTH_EXCEEDED", ERR_LIB_ASN1, 174}, + {"DEPTH_EXCEEDED", 13, 174}, #endif #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED}, #else - {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, 198}, + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198}, #endif #ifdef ASN1_R_ENCODE_ERROR {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR}, #else - {"ENCODE_ERROR", ERR_LIB_ASN1, 112}, + {"ENCODE_ERROR", 13, 112}, #endif #ifdef ASN1_R_ERROR_GETTING_TIME {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME}, #else - {"ERROR_GETTING_TIME", ERR_LIB_ASN1, 173}, + {"ERROR_GETTING_TIME", 13, 173}, #endif #ifdef ASN1_R_ERROR_LOADING_SECTION {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION}, #else - {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, 172}, + {"ERROR_LOADING_SECTION", 13, 172}, #endif #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS}, #else - {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, 114}, + {"ERROR_SETTING_CIPHER_PARAMS", 13, 114}, #endif #ifdef ASN1_R_EXPECTING_AN_INTEGER {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER}, #else - {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, 115}, + {"EXPECTING_AN_INTEGER", 13, 115}, #endif #ifdef ASN1_R_EXPECTING_AN_OBJECT {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT}, #else - {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, 116}, + {"EXPECTING_AN_OBJECT", 13, 116}, #endif #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH}, #else - {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, 119}, + {"EXPLICIT_LENGTH_MISMATCH", 13, 119}, #endif #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED}, #else - {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, 120}, + {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120}, #endif #ifdef ASN1_R_FIELD_MISSING {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING}, #else - {"FIELD_MISSING", ERR_LIB_ASN1, 121}, + {"FIELD_MISSING", 13, 121}, #endif #ifdef ASN1_R_FIRST_NUM_TOO_LARGE {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE}, #else - {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, 122}, + {"FIRST_NUM_TOO_LARGE", 13, 122}, #endif #ifdef ASN1_R_HEADER_TOO_LONG {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG}, #else - {"HEADER_TOO_LONG", ERR_LIB_ASN1, 123}, + {"HEADER_TOO_LONG", 13, 123}, #endif #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT}, #else - {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, 175}, + {"ILLEGAL_BITSTRING_FORMAT", 13, 175}, #endif #ifdef ASN1_R_ILLEGAL_BOOLEAN {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN}, #else - {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, 176}, + {"ILLEGAL_BOOLEAN", 13, 176}, #endif #ifdef ASN1_R_ILLEGAL_CHARACTERS {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS}, #else - {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, 124}, + {"ILLEGAL_CHARACTERS", 13, 124}, #endif #ifdef ASN1_R_ILLEGAL_FORMAT {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT}, #else - {"ILLEGAL_FORMAT", ERR_LIB_ASN1, 177}, + {"ILLEGAL_FORMAT", 13, 177}, #endif #ifdef ASN1_R_ILLEGAL_HEX {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX}, #else - {"ILLEGAL_HEX", ERR_LIB_ASN1, 178}, + {"ILLEGAL_HEX", 13, 178}, #endif #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG}, #else - {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, 179}, + {"ILLEGAL_IMPLICIT_TAG", 13, 179}, #endif #ifdef ASN1_R_ILLEGAL_INTEGER {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER}, #else - {"ILLEGAL_INTEGER", ERR_LIB_ASN1, 180}, + {"ILLEGAL_INTEGER", 13, 180}, #endif #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE}, #else - {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, 226}, + {"ILLEGAL_NEGATIVE_VALUE", 13, 226}, #endif #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING}, #else - {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, 181}, + {"ILLEGAL_NESTED_TAGGING", 13, 181}, #endif #ifdef ASN1_R_ILLEGAL_NULL {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL}, #else - {"ILLEGAL_NULL", ERR_LIB_ASN1, 125}, + {"ILLEGAL_NULL", 13, 125}, #endif #ifdef ASN1_R_ILLEGAL_NULL_VALUE {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE}, #else - {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, 182}, + {"ILLEGAL_NULL_VALUE", 13, 182}, #endif #ifdef ASN1_R_ILLEGAL_OBJECT {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT}, #else - {"ILLEGAL_OBJECT", ERR_LIB_ASN1, 183}, + {"ILLEGAL_OBJECT", 13, 183}, #endif #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY}, #else - {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, 126}, + {"ILLEGAL_OPTIONAL_ANY", 13, 126}, #endif #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE}, #else - {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, 170}, + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170}, #endif #ifdef ASN1_R_ILLEGAL_PADDING {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING}, #else - {"ILLEGAL_PADDING", ERR_LIB_ASN1, 221}, + {"ILLEGAL_PADDING", 13, 221}, #endif #ifdef ASN1_R_ILLEGAL_TAGGED_ANY {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY}, #else - {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, 127}, + {"ILLEGAL_TAGGED_ANY", 13, 127}, #endif #ifdef ASN1_R_ILLEGAL_TIME_VALUE {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE}, #else - {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, 184}, + {"ILLEGAL_TIME_VALUE", 13, 184}, #endif #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT}, #else - {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, 222}, + {"ILLEGAL_ZERO_CONTENT", 13, 222}, #endif #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT}, #else - {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 185}, + {"INTEGER_NOT_ASCII_FORMAT", 13, 185}, #endif #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG}, #else - {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, 128}, + {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128}, #endif #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT}, #else - {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, 220}, + {"INVALID_BIT_STRING_BITS_LEFT", 13, 220}, #endif #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH}, #else - {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, 129}, + {"INVALID_BMPSTRING_LENGTH", 13, 129}, #endif #ifdef ASN1_R_INVALID_DIGIT {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT}, #else - {"INVALID_DIGIT", ERR_LIB_ASN1, 130}, + {"INVALID_DIGIT", 13, 130}, #endif #ifdef ASN1_R_INVALID_MIME_TYPE {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE}, #else - {"INVALID_MIME_TYPE", ERR_LIB_ASN1, 205}, + {"INVALID_MIME_TYPE", 13, 205}, #endif #ifdef ASN1_R_INVALID_MODIFIER {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER}, #else - {"INVALID_MODIFIER", ERR_LIB_ASN1, 186}, + {"INVALID_MODIFIER", 13, 186}, #endif #ifdef ASN1_R_INVALID_NUMBER {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER}, #else - {"INVALID_NUMBER", ERR_LIB_ASN1, 187}, + {"INVALID_NUMBER", 13, 187}, #endif #ifdef ASN1_R_INVALID_OBJECT_ENCODING {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING}, #else - {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, 216}, + {"INVALID_OBJECT_ENCODING", 13, 216}, #endif #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS}, #else - {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, 227}, + {"INVALID_SCRYPT_PARAMETERS", 13, 227}, #endif #ifdef ASN1_R_INVALID_SEPARATOR {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR}, #else - {"INVALID_SEPARATOR", ERR_LIB_ASN1, 131}, + {"INVALID_SEPARATOR", 13, 131}, #endif #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE}, #else - {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, 218}, + {"INVALID_STRING_TABLE_VALUE", 13, 218}, #endif #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH}, #else - {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, 133}, + {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133}, #endif #ifdef ASN1_R_INVALID_UTF8STRING {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING}, #else - {"INVALID_UTF8STRING", ERR_LIB_ASN1, 134}, + {"INVALID_UTF8STRING", 13, 134}, #endif #ifdef ASN1_R_INVALID_VALUE {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE}, #else - {"INVALID_VALUE", ERR_LIB_ASN1, 219}, + {"INVALID_VALUE", 13, 219}, #endif #ifdef ASN1_R_LIST_ERROR {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR}, #else - {"LIST_ERROR", ERR_LIB_ASN1, 188}, + {"LIST_ERROR", 13, 188}, #endif #ifdef ASN1_R_MIME_NO_CONTENT_TYPE {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE}, #else - {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, 206}, + {"MIME_NO_CONTENT_TYPE", 13, 206}, #endif #ifdef ASN1_R_MIME_PARSE_ERROR {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR}, #else - {"MIME_PARSE_ERROR", ERR_LIB_ASN1, 207}, + {"MIME_PARSE_ERROR", 13, 207}, #endif #ifdef ASN1_R_MIME_SIG_PARSE_ERROR {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR}, #else - {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, 208}, + {"MIME_SIG_PARSE_ERROR", 13, 208}, #endif #ifdef ASN1_R_MISSING_EOC {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC}, #else - {"MISSING_EOC", ERR_LIB_ASN1, 137}, + {"MISSING_EOC", 13, 137}, #endif #ifdef ASN1_R_MISSING_SECOND_NUMBER {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER}, #else - {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, 138}, + {"MISSING_SECOND_NUMBER", 13, 138}, #endif #ifdef ASN1_R_MISSING_VALUE {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE}, #else - {"MISSING_VALUE", ERR_LIB_ASN1, 189}, + {"MISSING_VALUE", 13, 189}, #endif #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL}, #else - {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, 139}, + {"MSTRING_NOT_UNIVERSAL", 13, 139}, #endif #ifdef ASN1_R_MSTRING_WRONG_TAG {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG}, #else - {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, 140}, + {"MSTRING_WRONG_TAG", 13, 140}, #endif #ifdef ASN1_R_NESTED_ASN1_STRING {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING}, #else - {"NESTED_ASN1_STRING", ERR_LIB_ASN1, 197}, + {"NESTED_ASN1_STRING", 13, 197}, #endif #ifdef ASN1_R_NESTED_TOO_DEEP {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP}, #else - {"NESTED_TOO_DEEP", ERR_LIB_ASN1, 201}, + {"NESTED_TOO_DEEP", 13, 201}, #endif #ifdef ASN1_R_NON_HEX_CHARACTERS {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS}, #else - {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, 141}, + {"NON_HEX_CHARACTERS", 13, 141}, #endif #ifdef ASN1_R_NOT_ASCII_FORMAT {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT}, #else - {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, 190}, + {"NOT_ASCII_FORMAT", 13, 190}, #endif #ifdef ASN1_R_NOT_ENOUGH_DATA {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA}, #else - {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, 142}, + {"NOT_ENOUGH_DATA", 13, 142}, #endif #ifdef ASN1_R_NO_CONTENT_TYPE {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE}, #else - {"NO_CONTENT_TYPE", ERR_LIB_ASN1, 209}, + {"NO_CONTENT_TYPE", 13, 209}, #endif #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE}, #else - {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, 143}, + {"NO_MATCHING_CHOICE_TYPE", 13, 143}, #endif #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE}, #else - {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, 210}, + {"NO_MULTIPART_BODY_FAILURE", 13, 210}, #endif #ifdef ASN1_R_NO_MULTIPART_BOUNDARY {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY}, #else - {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, 211}, + {"NO_MULTIPART_BOUNDARY", 13, 211}, #endif #ifdef ASN1_R_NO_SIG_CONTENT_TYPE {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE}, #else - {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, 212}, + {"NO_SIG_CONTENT_TYPE", 13, 212}, #endif #ifdef ASN1_R_NULL_IS_WRONG_LENGTH {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH}, #else - {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, 144}, + {"NULL_IS_WRONG_LENGTH", 13, 144}, #endif #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT}, #else - {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 191}, + {"OBJECT_NOT_ASCII_FORMAT", 13, 191}, #endif #ifdef ASN1_R_ODD_NUMBER_OF_CHARS {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS}, #else - {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, 145}, + {"ODD_NUMBER_OF_CHARS", 13, 145}, #endif #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE}, #else - {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, 147}, + {"SECOND_NUMBER_TOO_LARGE", 13, 147}, #endif #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH}, #else - {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, 148}, + {"SEQUENCE_LENGTH_MISMATCH", 13, 148}, #endif #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED}, #else - {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 149}, + {"SEQUENCE_NOT_CONSTRUCTED", 13, 149}, #endif #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG}, #else - {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, 192}, + {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192}, #endif #ifdef ASN1_R_SHORT_LINE {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE}, #else - {"SHORT_LINE", ERR_LIB_ASN1, 150}, + {"SHORT_LINE", 13, 150}, #endif #ifdef ASN1_R_SIG_INVALID_MIME_TYPE {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE}, #else - {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, 213}, + {"SIG_INVALID_MIME_TYPE", 13, 213}, #endif #ifdef ASN1_R_STREAMING_NOT_SUPPORTED {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED}, #else - {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, 202}, + {"STREAMING_NOT_SUPPORTED", 13, 202}, #endif #ifdef ASN1_R_STRING_TOO_LONG {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG}, #else - {"STRING_TOO_LONG", ERR_LIB_ASN1, 151}, + {"STRING_TOO_LONG", 13, 151}, #endif #ifdef ASN1_R_STRING_TOO_SHORT {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT}, #else - {"STRING_TOO_SHORT", ERR_LIB_ASN1, 152}, + {"STRING_TOO_SHORT", 13, 152}, #endif #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, #else - {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, 154}, + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154}, #endif #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT}, #else - {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, 193}, + {"TIME_NOT_ASCII_FORMAT", 13, 193}, #endif #ifdef ASN1_R_TOO_LARGE {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE}, #else - {"TOO_LARGE", ERR_LIB_ASN1, 223}, + {"TOO_LARGE", 13, 223}, #endif #ifdef ASN1_R_TOO_LONG {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG}, #else - {"TOO_LONG", ERR_LIB_ASN1, 155}, + {"TOO_LONG", 13, 155}, #endif #ifdef ASN1_R_TOO_SMALL {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL}, #else - {"TOO_SMALL", ERR_LIB_ASN1, 224}, + {"TOO_SMALL", 13, 224}, #endif #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED}, #else - {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, 156}, + {"TYPE_NOT_CONSTRUCTED", 13, 156}, #endif #ifdef ASN1_R_TYPE_NOT_PRIMITIVE {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE}, #else - {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, 195}, + {"TYPE_NOT_PRIMITIVE", 13, 195}, #endif #ifdef ASN1_R_UNEXPECTED_EOC {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC}, #else - {"UNEXPECTED_EOC", ERR_LIB_ASN1, 159}, + {"UNEXPECTED_EOC", 13, 159}, #endif #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH}, #else - {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, 215}, + {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215}, #endif #ifdef ASN1_R_UNKNOWN_FORMAT {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT}, #else - {"UNKNOWN_FORMAT", ERR_LIB_ASN1, 160}, + {"UNKNOWN_FORMAT", 13, 160}, #endif #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM}, #else - {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, 161}, + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161}, #endif #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE}, #else - {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, 162}, + {"UNKNOWN_OBJECT_TYPE", 13, 162}, #endif #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE}, #else - {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 163}, + {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163}, #endif #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM}, #else - {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, 199}, + {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199}, #endif #ifdef ASN1_R_UNKNOWN_TAG {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG}, #else - {"UNKNOWN_TAG", ERR_LIB_ASN1, 194}, + {"UNKNOWN_TAG", 13, 194}, #endif #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE}, #else - {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, 164}, + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164}, #endif #ifdef ASN1_R_UNSUPPORTED_CIPHER {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, 228}, + {"UNSUPPORTED_CIPHER", 13, 228}, #endif #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, #else - {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 167}, + {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167}, #endif #ifdef ASN1_R_UNSUPPORTED_TYPE {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE}, #else - {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, 196}, + {"UNSUPPORTED_TYPE", 13, 196}, #endif #ifdef ASN1_R_WRONG_INTEGER_TYPE {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE}, #else - {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, 225}, + {"WRONG_INTEGER_TYPE", 13, 225}, #endif #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE}, #else - {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, 200}, + {"WRONG_PUBLIC_KEY_TYPE", 13, 200}, #endif #ifdef ASN1_R_WRONG_TAG {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG}, #else - {"WRONG_TAG", ERR_LIB_ASN1, 168}, + {"WRONG_TAG", 13, 168}, #endif #ifdef ASYNC_R_FAILED_TO_SET_POOL {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL}, #else - {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, 101}, + {"FAILED_TO_SET_POOL", 51, 101}, #endif #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT}, #else - {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, 102}, + {"FAILED_TO_SWAP_CONTEXT", 51, 102}, #endif #ifdef ASYNC_R_INIT_FAILED {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED}, #else - {"INIT_FAILED", ERR_LIB_ASYNC, 105}, + {"INIT_FAILED", 51, 105}, #endif #ifdef ASYNC_R_INVALID_POOL_SIZE {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE}, #else - {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, 103}, + {"INVALID_POOL_SIZE", 51, 103}, #endif #ifdef BIO_R_ACCEPT_ERROR {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR}, #else - {"ACCEPT_ERROR", ERR_LIB_BIO, 100}, + {"ACCEPT_ERROR", 32, 100}, #endif #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET}, #else - {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 141}, + {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141}, #endif #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE}, #else - {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, 129}, + {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129}, #endif #ifdef BIO_R_BAD_FOPEN_MODE {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE}, #else - {"BAD_FOPEN_MODE", ERR_LIB_BIO, 101}, + {"BAD_FOPEN_MODE", 32, 101}, #endif #ifdef BIO_R_BROKEN_PIPE {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE}, #else - {"BROKEN_PIPE", ERR_LIB_BIO, 124}, + {"BROKEN_PIPE", 32, 124}, #endif #ifdef BIO_R_CONNECT_ERROR {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR}, #else - {"CONNECT_ERROR", ERR_LIB_BIO, 103}, + {"CONNECT_ERROR", 32, 103}, #endif #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET}, #else - {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, 107}, + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107}, #endif #ifdef BIO_R_GETSOCKNAME_ERROR {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR}, #else - {"GETSOCKNAME_ERROR", ERR_LIB_BIO, 132}, + {"GETSOCKNAME_ERROR", 32, 132}, #endif #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS}, #else - {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, 133}, + {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133}, #endif #ifdef BIO_R_GETTING_SOCKTYPE {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE}, #else - {"GETTING_SOCKTYPE", ERR_LIB_BIO, 134}, + {"GETTING_SOCKTYPE", 32, 134}, #endif #ifdef BIO_R_INVALID_ARGUMENT {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT}, #else - {"INVALID_ARGUMENT", ERR_LIB_BIO, 125}, + {"INVALID_ARGUMENT", 32, 125}, #endif #ifdef BIO_R_INVALID_SOCKET {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET}, #else - {"INVALID_SOCKET", ERR_LIB_BIO, 135}, + {"INVALID_SOCKET", 32, 135}, #endif #ifdef BIO_R_IN_USE {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE}, #else - {"IN_USE", ERR_LIB_BIO, 123}, + {"IN_USE", 32, 123}, #endif #ifdef BIO_R_LENGTH_TOO_LONG {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG}, #else - {"LENGTH_TOO_LONG", ERR_LIB_BIO, 102}, + {"LENGTH_TOO_LONG", 32, 102}, #endif #ifdef BIO_R_LISTEN_V6_ONLY {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY}, #else - {"LISTEN_V6_ONLY", ERR_LIB_BIO, 136}, + {"LISTEN_V6_ONLY", 32, 136}, #endif #ifdef BIO_R_LOOKUP_RETURNED_NOTHING {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING}, #else - {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, 142}, + {"LOOKUP_RETURNED_NOTHING", 32, 142}, #endif #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE}, #else - {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, 130}, + {"MALFORMED_HOST_OR_SERVICE", 32, 130}, #endif #ifdef BIO_R_NBIO_CONNECT_ERROR {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR}, #else - {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, 110}, + {"NBIO_CONNECT_ERROR", 32, 110}, #endif #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED}, #else - {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 143}, + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143}, #endif #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED}, #else - {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, 144}, + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144}, #endif #ifdef BIO_R_NO_PORT_DEFINED {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED}, #else - {"NO_PORT_DEFINED", ERR_LIB_BIO, 113}, + {"NO_PORT_DEFINED", 32, 113}, #endif #ifdef BIO_R_NO_SUCH_FILE {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE}, #else - {"NO_SUCH_FILE", ERR_LIB_BIO, 128}, + {"NO_SUCH_FILE", 32, 128}, #endif #ifdef BIO_R_NULL_PARAMETER {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER}, #else - {"NULL_PARAMETER", ERR_LIB_BIO, 115}, + {"NULL_PARAMETER", 32, 115}, #endif #ifdef BIO_R_UNABLE_TO_BIND_SOCKET {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET}, #else - {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, 117}, + {"UNABLE_TO_BIND_SOCKET", 32, 117}, #endif #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET}, #else - {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, 118}, + {"UNABLE_TO_CREATE_SOCKET", 32, 118}, #endif #ifdef BIO_R_UNABLE_TO_KEEPALIVE {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE}, #else - {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, 137}, + {"UNABLE_TO_KEEPALIVE", 32, 137}, #endif #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET}, #else - {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, 119}, + {"UNABLE_TO_LISTEN_SOCKET", 32, 119}, #endif #ifdef BIO_R_UNABLE_TO_NODELAY {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY}, #else - {"UNABLE_TO_NODELAY", ERR_LIB_BIO, 138}, + {"UNABLE_TO_NODELAY", 32, 138}, #endif #ifdef BIO_R_UNABLE_TO_REUSEADDR {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR}, #else - {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, 139}, + {"UNABLE_TO_REUSEADDR", 32, 139}, #endif #ifdef BIO_R_UNAVAILABLE_IP_FAMILY {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY}, #else - {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, 145}, + {"UNAVAILABLE_IP_FAMILY", 32, 145}, #endif #ifdef BIO_R_UNINITIALIZED {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED}, #else - {"UNINITIALIZED", ERR_LIB_BIO, 120}, + {"UNINITIALIZED", 32, 120}, #endif #ifdef BIO_R_UNKNOWN_INFO_TYPE {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE}, #else - {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, 140}, + {"UNKNOWN_INFO_TYPE", 32, 140}, #endif #ifdef BIO_R_UNSUPPORTED_IP_FAMILY {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY}, #else - {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, 146}, + {"UNSUPPORTED_IP_FAMILY", 32, 146}, #endif #ifdef BIO_R_UNSUPPORTED_METHOD {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD}, #else - {"UNSUPPORTED_METHOD", ERR_LIB_BIO, 121}, + {"UNSUPPORTED_METHOD", 32, 121}, #endif #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY}, #else - {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, 131}, + {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131}, #endif #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO}, #else - {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, 126}, + {"WRITE_TO_READ_ONLY_BIO", 32, 126}, #endif #ifdef BIO_R_WSASTARTUP {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP}, #else - {"WSASTARTUP", ERR_LIB_BIO, 122}, + {"WSASTARTUP", 32, 122}, #endif #ifdef BN_R_ARG2_LT_ARG3 {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3}, #else - {"ARG2_LT_ARG3", ERR_LIB_BN, 100}, + {"ARG2_LT_ARG3", 3, 100}, #endif #ifdef BN_R_BAD_RECIPROCAL {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL}, #else - {"BAD_RECIPROCAL", ERR_LIB_BN, 101}, + {"BAD_RECIPROCAL", 3, 101}, #endif #ifdef BN_R_BIGNUM_TOO_LONG {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG}, #else - {"BIGNUM_TOO_LONG", ERR_LIB_BN, 114}, + {"BIGNUM_TOO_LONG", 3, 114}, #endif #ifdef BN_R_BITS_TOO_SMALL {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL}, #else - {"BITS_TOO_SMALL", ERR_LIB_BN, 118}, + {"BITS_TOO_SMALL", 3, 118}, #endif #ifdef BN_R_CALLED_WITH_EVEN_MODULUS {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS}, #else - {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, 102}, + {"CALLED_WITH_EVEN_MODULUS", 3, 102}, #endif #ifdef BN_R_DIV_BY_ZERO {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO}, #else - {"DIV_BY_ZERO", ERR_LIB_BN, 103}, + {"DIV_BY_ZERO", 3, 103}, #endif #ifdef BN_R_ENCODING_ERROR {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR}, #else - {"ENCODING_ERROR", ERR_LIB_BN, 104}, + {"ENCODING_ERROR", 3, 104}, #endif #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA}, #else - {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, 105}, + {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105}, #endif #ifdef BN_R_INPUT_NOT_REDUCED {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED}, #else - {"INPUT_NOT_REDUCED", ERR_LIB_BN, 110}, + {"INPUT_NOT_REDUCED", 3, 110}, #endif #ifdef BN_R_INVALID_LENGTH {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH}, #else - {"INVALID_LENGTH", ERR_LIB_BN, 106}, + {"INVALID_LENGTH", 3, 106}, #endif #ifdef BN_R_INVALID_RANGE {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE}, #else - {"INVALID_RANGE", ERR_LIB_BN, 115}, + {"INVALID_RANGE", 3, 115}, #endif #ifdef BN_R_INVALID_SHIFT {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT}, #else - {"INVALID_SHIFT", ERR_LIB_BN, 119}, + {"INVALID_SHIFT", 3, 119}, #endif #ifdef BN_R_NOT_A_SQUARE {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE}, #else - {"NOT_A_SQUARE", ERR_LIB_BN, 111}, + {"NOT_A_SQUARE", 3, 111}, #endif #ifdef BN_R_NOT_INITIALIZED {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED}, #else - {"NOT_INITIALIZED", ERR_LIB_BN, 107}, + {"NOT_INITIALIZED", 3, 107}, #endif #ifdef BN_R_NO_INVERSE {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE}, #else - {"NO_INVERSE", ERR_LIB_BN, 108}, + {"NO_INVERSE", 3, 108}, #endif #ifdef BN_R_NO_SOLUTION {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION}, #else - {"NO_SOLUTION", ERR_LIB_BN, 116}, + {"NO_SOLUTION", 3, 116}, #endif #ifdef BN_R_PRIVATE_KEY_TOO_LARGE {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE}, #else - {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, 117}, + {"PRIVATE_KEY_TOO_LARGE", 3, 117}, #endif #ifdef BN_R_P_IS_NOT_PRIME {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME}, #else - {"P_IS_NOT_PRIME", ERR_LIB_BN, 112}, + {"P_IS_NOT_PRIME", 3, 112}, #endif #ifdef BN_R_TOO_MANY_ITERATIONS {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS}, #else - {"TOO_MANY_ITERATIONS", ERR_LIB_BN, 113}, + {"TOO_MANY_ITERATIONS", 3, 113}, #endif #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES}, #else - {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, 109}, + {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109}, #endif #ifdef CMS_R_ADD_SIGNER_ERROR {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR}, #else - {"ADD_SIGNER_ERROR", ERR_LIB_CMS, 99}, + {"ADD_SIGNER_ERROR", 46, 99}, #endif #ifdef CMS_R_ATTRIBUTE_ERROR {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR}, #else - {"ATTRIBUTE_ERROR", ERR_LIB_CMS, 161}, + {"ATTRIBUTE_ERROR", 46, 161}, #endif #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT}, #else - {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, 175}, + {"CERTIFICATE_ALREADY_PRESENT", 46, 175}, #endif #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID}, #else - {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, 160}, + {"CERTIFICATE_HAS_NO_KEYID", 46, 160}, #endif #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, 100}, + {"CERTIFICATE_VERIFY_ERROR", 46, 100}, #endif #ifdef CMS_R_CIPHER_INITIALISATION_ERROR {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR}, #else - {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, 101}, + {"CIPHER_INITIALISATION_ERROR", 46, 101}, #endif #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR}, #else - {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, 102}, + {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102}, #endif #ifdef CMS_R_CMS_DATAFINAL_ERROR {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR}, #else - {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, 103}, + {"CMS_DATAFINAL_ERROR", 46, 103}, #endif #ifdef CMS_R_CMS_LIB {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB}, #else - {"CMS_LIB", ERR_LIB_CMS, 104}, + {"CMS_LIB", 46, 104}, #endif #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH}, #else - {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, 170}, + {"CONTENTIDENTIFIER_MISMATCH", 46, 170}, #endif #ifdef CMS_R_CONTENT_NOT_FOUND {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND}, #else - {"CONTENT_NOT_FOUND", ERR_LIB_CMS, 105}, + {"CONTENT_NOT_FOUND", 46, 105}, #endif #ifdef CMS_R_CONTENT_TYPE_MISMATCH {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH}, #else - {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, 171}, + {"CONTENT_TYPE_MISMATCH", 46, 171}, #endif #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA}, #else - {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 106}, + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106}, #endif #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA}, #else - {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 107}, + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107}, #endif #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA}, #else - {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, 108}, + {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108}, #endif #ifdef CMS_R_CONTENT_VERIFY_ERROR {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR}, #else - {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, 109}, + {"CONTENT_VERIFY_ERROR", 46, 109}, #endif #ifdef CMS_R_CTRL_ERROR {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR}, #else - {"CTRL_ERROR", ERR_LIB_CMS, 110}, + {"CTRL_ERROR", 46, 110}, #endif #ifdef CMS_R_CTRL_FAILURE {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE}, #else - {"CTRL_FAILURE", ERR_LIB_CMS, 111}, + {"CTRL_FAILURE", 46, 111}, #endif #ifdef CMS_R_DECRYPT_ERROR {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR}, #else - {"DECRYPT_ERROR", ERR_LIB_CMS, 112}, + {"DECRYPT_ERROR", 46, 112}, #endif #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY}, #else - {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, 113}, + {"ERROR_GETTING_PUBLIC_KEY", 46, 113}, #endif #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE}, #else - {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, 114}, + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114}, #endif #ifdef CMS_R_ERROR_SETTING_KEY {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY}, #else - {"ERROR_SETTING_KEY", ERR_LIB_CMS, 115}, + {"ERROR_SETTING_KEY", 46, 115}, #endif #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO}, #else - {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, 116}, + {"ERROR_SETTING_RECIPIENTINFO", 46, 116}, #endif #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH}, #else - {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, 117}, + {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117}, #endif #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER}, #else - {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, 176}, + {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176}, #endif #ifdef CMS_R_INVALID_KEY_LENGTH {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH}, #else - {"INVALID_KEY_LENGTH", ERR_LIB_CMS, 118}, + {"INVALID_KEY_LENGTH", 46, 118}, #endif #ifdef CMS_R_MD_BIO_INIT_ERROR {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR}, #else - {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, 119}, + {"MD_BIO_INIT_ERROR", 46, 119}, #endif #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH}, #else - {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, 120}, + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120}, #endif #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH}, #else - {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 121}, + {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121}, #endif #ifdef CMS_R_MSGSIGDIGEST_ERROR {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR}, #else - {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, 172}, + {"MSGSIGDIGEST_ERROR", 46, 172}, #endif #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE}, #else - {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, 162}, + {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162}, #endif #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH}, #else - {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, 163}, + {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163}, #endif #ifdef CMS_R_NEED_ONE_SIGNER {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER}, #else - {"NEED_ONE_SIGNER", ERR_LIB_CMS, 164}, + {"NEED_ONE_SIGNER", 46, 164}, #endif #ifdef CMS_R_NOT_A_SIGNED_RECEIPT {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT}, #else - {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, 165}, + {"NOT_A_SIGNED_RECEIPT", 46, 165}, #endif #ifdef CMS_R_NOT_ENCRYPTED_DATA {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA}, #else - {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 122}, + {"NOT_ENCRYPTED_DATA", 46, 122}, #endif #ifdef CMS_R_NOT_KEK {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK}, #else - {"NOT_KEK", ERR_LIB_CMS, 123}, + {"NOT_KEK", 46, 123}, #endif #ifdef CMS_R_NOT_KEY_AGREEMENT {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT}, #else - {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, 181}, + {"NOT_KEY_AGREEMENT", 46, 181}, #endif #ifdef CMS_R_NOT_KEY_TRANSPORT {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT}, #else - {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, 124}, + {"NOT_KEY_TRANSPORT", 46, 124}, #endif #ifdef CMS_R_NOT_PWRI {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI}, #else - {"NOT_PWRI", ERR_LIB_CMS, 177}, + {"NOT_PWRI", 46, 177}, #endif #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, 125}, + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125}, #endif #ifdef CMS_R_NO_CIPHER {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER}, #else - {"NO_CIPHER", ERR_LIB_CMS, 126}, + {"NO_CIPHER", 46, 126}, #endif #ifdef CMS_R_NO_CONTENT {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT}, #else - {"NO_CONTENT", ERR_LIB_CMS, 127}, + {"NO_CONTENT", 46, 127}, #endif #ifdef CMS_R_NO_CONTENT_TYPE {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE}, #else - {"NO_CONTENT_TYPE", ERR_LIB_CMS, 173}, + {"NO_CONTENT_TYPE", 46, 173}, #endif #ifdef CMS_R_NO_DEFAULT_DIGEST {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST}, #else - {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, 128}, + {"NO_DEFAULT_DIGEST", 46, 128}, #endif #ifdef CMS_R_NO_DIGEST_SET {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET}, #else - {"NO_DIGEST_SET", ERR_LIB_CMS, 129}, + {"NO_DIGEST_SET", 46, 129}, #endif #ifdef CMS_R_NO_KEY {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY}, #else - {"NO_KEY", ERR_LIB_CMS, 130}, + {"NO_KEY", 46, 130}, #endif #ifdef CMS_R_NO_KEY_OR_CERT {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT}, #else - {"NO_KEY_OR_CERT", ERR_LIB_CMS, 174}, + {"NO_KEY_OR_CERT", 46, 174}, #endif #ifdef CMS_R_NO_MATCHING_DIGEST {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST}, #else - {"NO_MATCHING_DIGEST", ERR_LIB_CMS, 131}, + {"NO_MATCHING_DIGEST", 46, 131}, #endif #ifdef CMS_R_NO_MATCHING_RECIPIENT {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT}, #else - {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, 132}, + {"NO_MATCHING_RECIPIENT", 46, 132}, #endif #ifdef CMS_R_NO_MATCHING_SIGNATURE {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE}, #else - {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, 166}, + {"NO_MATCHING_SIGNATURE", 46, 166}, #endif #ifdef CMS_R_NO_MSGSIGDIGEST {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST}, #else - {"NO_MSGSIGDIGEST", ERR_LIB_CMS, 167}, + {"NO_MSGSIGDIGEST", 46, 167}, #endif #ifdef CMS_R_NO_PASSWORD {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD}, #else - {"NO_PASSWORD", ERR_LIB_CMS, 178}, + {"NO_PASSWORD", 46, 178}, #endif #ifdef CMS_R_NO_PRIVATE_KEY {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY}, #else - {"NO_PRIVATE_KEY", ERR_LIB_CMS, 133}, + {"NO_PRIVATE_KEY", 46, 133}, #endif #ifdef CMS_R_NO_PUBLIC_KEY {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY}, #else - {"NO_PUBLIC_KEY", ERR_LIB_CMS, 134}, + {"NO_PUBLIC_KEY", 46, 134}, #endif #ifdef CMS_R_NO_RECEIPT_REQUEST {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST}, #else - {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, 168}, + {"NO_RECEIPT_REQUEST", 46, 168}, #endif #ifdef CMS_R_NO_SIGNERS {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS}, #else - {"NO_SIGNERS", ERR_LIB_CMS, 135}, + {"NO_SIGNERS", 46, 135}, #endif #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, 136}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136}, #endif #ifdef CMS_R_RECEIPT_DECODE_ERROR {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR}, #else - {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, 169}, + {"RECEIPT_DECODE_ERROR", 46, 169}, #endif #ifdef CMS_R_RECIPIENT_ERROR {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR}, #else - {"RECIPIENT_ERROR", ERR_LIB_CMS, 137}, + {"RECIPIENT_ERROR", 46, 137}, #endif #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, 138}, + {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138}, #endif #ifdef CMS_R_SIGNFINAL_ERROR {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR}, #else - {"SIGNFINAL_ERROR", ERR_LIB_CMS, 139}, + {"SIGNFINAL_ERROR", 46, 139}, #endif #ifdef CMS_R_SMIME_TEXT_ERROR {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR}, #else - {"SMIME_TEXT_ERROR", ERR_LIB_CMS, 140}, + {"SMIME_TEXT_ERROR", 46, 140}, #endif #ifdef CMS_R_STORE_INIT_ERROR {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR}, #else - {"STORE_INIT_ERROR", ERR_LIB_CMS, 141}, + {"STORE_INIT_ERROR", 46, 141}, #endif #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA}, #else - {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, 142}, + {"TYPE_NOT_COMPRESSED_DATA", 46, 142}, #endif #ifdef CMS_R_TYPE_NOT_DATA {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA}, #else - {"TYPE_NOT_DATA", ERR_LIB_CMS, 143}, + {"TYPE_NOT_DATA", 46, 143}, #endif #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA}, #else - {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, 144}, + {"TYPE_NOT_DIGESTED_DATA", 46, 144}, #endif #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA}, #else - {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, 145}, + {"TYPE_NOT_ENCRYPTED_DATA", 46, 145}, #endif #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA}, #else - {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, 146}, + {"TYPE_NOT_ENVELOPED_DATA", 46, 146}, #endif #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT}, #else - {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, 147}, + {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147}, #endif #ifdef CMS_R_UNKNOWN_CIPHER {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER}, #else - {"UNKNOWN_CIPHER", ERR_LIB_CMS, 148}, + {"UNKNOWN_CIPHER", 46, 148}, #endif #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM}, #else - {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, 149}, + {"UNKNOWN_DIGEST_ALGORITHM", 46, 149}, #endif #ifdef CMS_R_UNKNOWN_ID {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID}, #else - {"UNKNOWN_ID", ERR_LIB_CMS, 150}, + {"UNKNOWN_ID", 46, 150}, #endif #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, #else - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, 151}, + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151}, #endif #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE}, #else - {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, 152}, + {"UNSUPPORTED_CONTENT_TYPE", 46, 152}, #endif #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM}, #else - {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, 153}, + {"UNSUPPORTED_KEK_ALGORITHM", 46, 153}, #endif #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM}, #else - {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, 179}, + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179}, #endif #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE}, #else - {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, 155}, + {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155}, #endif #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE}, #else - {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, 154}, + {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154}, #endif #ifdef CMS_R_UNSUPPORTED_TYPE {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE}, #else - {"UNSUPPORTED_TYPE", ERR_LIB_CMS, 156}, + {"UNSUPPORTED_TYPE", 46, 156}, #endif #ifdef CMS_R_UNWRAP_ERROR {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR}, #else - {"UNWRAP_ERROR", ERR_LIB_CMS, 157}, + {"UNWRAP_ERROR", 46, 157}, #endif #ifdef CMS_R_UNWRAP_FAILURE {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE}, #else - {"UNWRAP_FAILURE", ERR_LIB_CMS, 180}, + {"UNWRAP_FAILURE", 46, 180}, #endif #ifdef CMS_R_VERIFICATION_FAILURE {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE}, #else - {"VERIFICATION_FAILURE", ERR_LIB_CMS, 158}, + {"VERIFICATION_FAILURE", 46, 158}, #endif #ifdef CMS_R_WRAP_ERROR {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR}, #else - {"WRAP_ERROR", ERR_LIB_CMS, 159}, + {"WRAP_ERROR", 46, 159}, #endif #ifdef COMP_R_ZLIB_DEFLATE_ERROR {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR}, #else - {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, 99}, + {"ZLIB_DEFLATE_ERROR", 41, 99}, #endif #ifdef COMP_R_ZLIB_INFLATE_ERROR {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR}, #else - {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, 100}, + {"ZLIB_INFLATE_ERROR", 41, 100}, #endif #ifdef COMP_R_ZLIB_NOT_SUPPORTED {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED}, #else - {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, 101}, + {"ZLIB_NOT_SUPPORTED", 41, 101}, #endif #ifdef CONF_R_ERROR_LOADING_DSO {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO}, #else - {"ERROR_LOADING_DSO", ERR_LIB_CONF, 110}, + {"ERROR_LOADING_DSO", 14, 110}, #endif #ifdef CONF_R_LIST_CANNOT_BE_NULL {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL}, #else - {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, 115}, + {"LIST_CANNOT_BE_NULL", 14, 115}, #endif #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET}, #else - {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, 100}, + {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100}, #endif #ifdef CONF_R_MISSING_EQUAL_SIGN {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN}, #else - {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, 101}, + {"MISSING_EQUAL_SIGN", 14, 101}, #endif #ifdef CONF_R_MISSING_INIT_FUNCTION {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION}, #else - {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, 112}, + {"MISSING_INIT_FUNCTION", 14, 112}, #endif #ifdef CONF_R_MODULE_INITIALIZATION_ERROR {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR}, #else - {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, 109}, + {"MODULE_INITIALIZATION_ERROR", 14, 109}, #endif #ifdef CONF_R_NO_CLOSE_BRACE {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE}, #else - {"NO_CLOSE_BRACE", ERR_LIB_CONF, 102}, + {"NO_CLOSE_BRACE", 14, 102}, #endif #ifdef CONF_R_NO_CONF {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF}, #else - {"NO_CONF", ERR_LIB_CONF, 105}, + {"NO_CONF", 14, 105}, #endif #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE}, #else - {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, 106}, + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106}, #endif #ifdef CONF_R_NO_SECTION {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION}, #else - {"NO_SECTION", ERR_LIB_CONF, 107}, + {"NO_SECTION", 14, 107}, #endif #ifdef CONF_R_NO_SUCH_FILE {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE}, #else - {"NO_SUCH_FILE", ERR_LIB_CONF, 114}, + {"NO_SUCH_FILE", 14, 114}, #endif #ifdef CONF_R_NO_VALUE {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE}, #else - {"NO_VALUE", ERR_LIB_CONF, 108}, + {"NO_VALUE", 14, 108}, #endif #ifdef CONF_R_NUMBER_TOO_LARGE {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE}, #else - {"NUMBER_TOO_LARGE", ERR_LIB_CONF, 121}, + {"NUMBER_TOO_LARGE", 14, 121}, #endif #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE}, #else - {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, 111}, + {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111}, #endif #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY}, #else - {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, 117}, + {"SSL_COMMAND_SECTION_EMPTY", 14, 117}, #endif #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND}, #else - {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, 118}, + {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118}, #endif #ifdef CONF_R_SSL_SECTION_EMPTY {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY}, #else - {"SSL_SECTION_EMPTY", ERR_LIB_CONF, 119}, + {"SSL_SECTION_EMPTY", 14, 119}, #endif #ifdef CONF_R_SSL_SECTION_NOT_FOUND {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND}, #else - {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, 120}, + {"SSL_SECTION_NOT_FOUND", 14, 120}, #endif #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION}, #else - {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, 103}, + {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103}, #endif #ifdef CONF_R_UNKNOWN_MODULE_NAME {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME}, #else - {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, 113}, + {"UNKNOWN_MODULE_NAME", 14, 113}, #endif #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG}, #else - {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, 116}, + {"VARIABLE_EXPANSION_TOO_LONG", 14, 116}, #endif #ifdef CONF_R_VARIABLE_HAS_NO_VALUE {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE}, #else - {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, 104}, + {"VARIABLE_HAS_NO_VALUE", 14, 104}, #endif #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED}, #else - {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, 101}, + {"FIPS_MODE_NOT_SUPPORTED", 15, 101}, #endif #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT}, #else - {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, 102}, + {"ILLEGAL_HEX_DIGIT", 15, 102}, #endif #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS}, #else - {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, 103}, + {"ODD_NUMBER_OF_DIGITS", 15, 103}, #endif #ifdef CT_R_BASE64_DECODE_ERROR {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR}, #else - {"BASE64_DECODE_ERROR", ERR_LIB_CT, 108}, + {"BASE64_DECODE_ERROR", 50, 108}, #endif #ifdef CT_R_INVALID_LOG_ID_LENGTH {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH}, #else - {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, 100}, + {"INVALID_LOG_ID_LENGTH", 50, 100}, #endif #ifdef CT_R_LOG_CONF_INVALID {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID}, #else - {"LOG_CONF_INVALID", ERR_LIB_CT, 109}, + {"LOG_CONF_INVALID", 50, 109}, #endif #ifdef CT_R_LOG_CONF_INVALID_KEY {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY}, #else - {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, 110}, + {"LOG_CONF_INVALID_KEY", 50, 110}, #endif #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION}, #else - {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, 111}, + {"LOG_CONF_MISSING_DESCRIPTION", 50, 111}, #endif #ifdef CT_R_LOG_CONF_MISSING_KEY {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY}, #else - {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, 112}, + {"LOG_CONF_MISSING_KEY", 50, 112}, #endif #ifdef CT_R_LOG_KEY_INVALID {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID}, #else - {"LOG_KEY_INVALID", ERR_LIB_CT, 113}, + {"LOG_KEY_INVALID", 50, 113}, #endif #ifdef CT_R_SCT_FUTURE_TIMESTAMP {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP}, #else - {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, 116}, + {"SCT_FUTURE_TIMESTAMP", 50, 116}, #endif #ifdef CT_R_SCT_INVALID {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID}, #else - {"SCT_INVALID", ERR_LIB_CT, 104}, + {"SCT_INVALID", 50, 104}, #endif #ifdef CT_R_SCT_INVALID_SIGNATURE {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE}, #else - {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, 107}, + {"SCT_INVALID_SIGNATURE", 50, 107}, #endif #ifdef CT_R_SCT_LIST_INVALID {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID}, #else - {"SCT_LIST_INVALID", ERR_LIB_CT, 105}, + {"SCT_LIST_INVALID", 50, 105}, #endif #ifdef CT_R_SCT_LOG_ID_MISMATCH {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH}, #else - {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, 114}, + {"SCT_LOG_ID_MISMATCH", 50, 114}, #endif #ifdef CT_R_SCT_NOT_SET {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET}, #else - {"SCT_NOT_SET", ERR_LIB_CT, 106}, + {"SCT_NOT_SET", 50, 106}, #endif #ifdef CT_R_SCT_UNSUPPORTED_VERSION {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION}, #else - {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, 115}, + {"SCT_UNSUPPORTED_VERSION", 50, 115}, #endif #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID}, #else - {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, 101}, + {"UNRECOGNIZED_SIGNATURE_NID", 50, 101}, #endif #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE}, #else - {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, 102}, + {"UNSUPPORTED_ENTRY_TYPE", 50, 102}, #endif #ifdef CT_R_UNSUPPORTED_VERSION {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION}, #else - {"UNSUPPORTED_VERSION", ERR_LIB_CT, 103}, + {"UNSUPPORTED_VERSION", 50, 103}, #endif #ifdef DH_R_BAD_GENERATOR {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR}, #else - {"BAD_GENERATOR", ERR_LIB_DH, 101}, + {"BAD_GENERATOR", 5, 101}, #endif #ifdef DH_R_BN_DECODE_ERROR {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR}, #else - {"BN_DECODE_ERROR", ERR_LIB_DH, 109}, + {"BN_DECODE_ERROR", 5, 109}, #endif #ifdef DH_R_BN_ERROR {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR}, #else - {"BN_ERROR", ERR_LIB_DH, 106}, + {"BN_ERROR", 5, 106}, #endif #ifdef DH_R_CHECK_INVALID_J_VALUE {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE}, #else - {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, 115}, + {"CHECK_INVALID_J_VALUE", 5, 115}, #endif #ifdef DH_R_CHECK_INVALID_Q_VALUE {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE}, #else - {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, 116}, + {"CHECK_INVALID_Q_VALUE", 5, 116}, #endif #ifdef DH_R_CHECK_PUBKEY_INVALID {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID}, #else - {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, 122}, + {"CHECK_PUBKEY_INVALID", 5, 122}, #endif #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE}, #else - {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, 123}, + {"CHECK_PUBKEY_TOO_LARGE", 5, 123}, #endif #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL}, #else - {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, 124}, + {"CHECK_PUBKEY_TOO_SMALL", 5, 124}, #endif #ifdef DH_R_CHECK_P_NOT_PRIME {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME}, #else - {"CHECK_P_NOT_PRIME", ERR_LIB_DH, 117}, + {"CHECK_P_NOT_PRIME", 5, 117}, #endif #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME}, #else - {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, 118}, + {"CHECK_P_NOT_SAFE_PRIME", 5, 118}, #endif #ifdef DH_R_CHECK_Q_NOT_PRIME {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME}, #else - {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, 119}, + {"CHECK_Q_NOT_PRIME", 5, 119}, #endif #ifdef DH_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_DH, 104}, + {"DECODE_ERROR", 5, 104}, #endif #ifdef DH_R_INVALID_PARAMETER_NAME {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME}, #else - {"INVALID_PARAMETER_NAME", ERR_LIB_DH, 110}, + {"INVALID_PARAMETER_NAME", 5, 110}, #endif #ifdef DH_R_INVALID_PARAMETER_NID {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID}, #else - {"INVALID_PARAMETER_NID", ERR_LIB_DH, 114}, + {"INVALID_PARAMETER_NID", 5, 114}, #endif #ifdef DH_R_INVALID_PUBKEY {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY}, #else - {"INVALID_PUBKEY", ERR_LIB_DH, 102}, + {"INVALID_PUBKEY", 5, 102}, #endif #ifdef DH_R_KDF_PARAMETER_ERROR {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR}, #else - {"KDF_PARAMETER_ERROR", ERR_LIB_DH, 112}, + {"KDF_PARAMETER_ERROR", 5, 112}, #endif #ifdef DH_R_KEYS_NOT_SET {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET}, #else - {"KEYS_NOT_SET", ERR_LIB_DH, 108}, + {"KEYS_NOT_SET", 5, 108}, #endif #ifdef DH_R_MISSING_PUBKEY {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY}, #else - {"MISSING_PUBKEY", ERR_LIB_DH, 125}, + {"MISSING_PUBKEY", 5, 125}, #endif #ifdef DH_R_MODULUS_TOO_LARGE {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE}, #else - {"MODULUS_TOO_LARGE", ERR_LIB_DH, 103}, + {"MODULUS_TOO_LARGE", 5, 103}, #endif #ifdef DH_R_NOT_SUITABLE_GENERATOR {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR}, #else - {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, 120}, + {"NOT_SUITABLE_GENERATOR", 5, 120}, #endif #ifdef DH_R_NO_PARAMETERS_SET {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET}, #else - {"NO_PARAMETERS_SET", ERR_LIB_DH, 107}, + {"NO_PARAMETERS_SET", 5, 107}, #endif #ifdef DH_R_NO_PRIVATE_VALUE {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE}, #else - {"NO_PRIVATE_VALUE", ERR_LIB_DH, 100}, + {"NO_PRIVATE_VALUE", 5, 100}, #endif #ifdef DH_R_PARAMETER_ENCODING_ERROR {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR}, #else - {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, 105}, + {"PARAMETER_ENCODING_ERROR", 5, 105}, #endif #ifdef DH_R_PEER_KEY_ERROR {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR}, #else - {"PEER_KEY_ERROR", ERR_LIB_DH, 111}, + {"PEER_KEY_ERROR", 5, 111}, #endif #ifdef DH_R_SHARED_INFO_ERROR {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR}, #else - {"SHARED_INFO_ERROR", ERR_LIB_DH, 113}, + {"SHARED_INFO_ERROR", 5, 113}, #endif #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR}, #else - {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, 121}, + {"UNABLE_TO_CHECK_GENERATOR", 5, 121}, #endif #ifdef DSA_R_BAD_Q_VALUE {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE}, #else - {"BAD_Q_VALUE", ERR_LIB_DSA, 102}, + {"BAD_Q_VALUE", 10, 102}, #endif #ifdef DSA_R_BN_DECODE_ERROR {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR}, #else - {"BN_DECODE_ERROR", ERR_LIB_DSA, 108}, + {"BN_DECODE_ERROR", 10, 108}, #endif #ifdef DSA_R_BN_ERROR {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR}, #else - {"BN_ERROR", ERR_LIB_DSA, 109}, + {"BN_ERROR", 10, 109}, #endif #ifdef DSA_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_DSA, 104}, + {"DECODE_ERROR", 10, 104}, #endif #ifdef DSA_R_INVALID_DIGEST_TYPE {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE}, #else - {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, 106}, + {"INVALID_DIGEST_TYPE", 10, 106}, #endif #ifdef DSA_R_INVALID_PARAMETERS {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS}, #else - {"INVALID_PARAMETERS", ERR_LIB_DSA, 112}, + {"INVALID_PARAMETERS", 10, 112}, #endif #ifdef DSA_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_DSA, 101}, + {"MISSING_PARAMETERS", 10, 101}, #endif #ifdef DSA_R_MISSING_PRIVATE_KEY {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY}, #else - {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, 111}, + {"MISSING_PRIVATE_KEY", 10, 111}, #endif #ifdef DSA_R_MODULUS_TOO_LARGE {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE}, #else - {"MODULUS_TOO_LARGE", ERR_LIB_DSA, 103}, + {"MODULUS_TOO_LARGE", 10, 103}, #endif #ifdef DSA_R_NO_PARAMETERS_SET {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET}, #else - {"NO_PARAMETERS_SET", ERR_LIB_DSA, 107}, + {"NO_PARAMETERS_SET", 10, 107}, #endif #ifdef DSA_R_PARAMETER_ENCODING_ERROR {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR}, #else - {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, 105}, + {"PARAMETER_ENCODING_ERROR", 10, 105}, #endif #ifdef DSA_R_Q_NOT_PRIME {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME}, #else - {"Q_NOT_PRIME", ERR_LIB_DSA, 113}, + {"Q_NOT_PRIME", 10, 113}, #endif #ifdef DSA_R_SEED_LEN_SMALL {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL}, #else - {"SEED_LEN_SMALL", ERR_LIB_DSA, 110}, + {"SEED_LEN_SMALL", 10, 110}, #endif #ifdef EC_R_ASN1_ERROR {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR}, #else - {"ASN1_ERROR", ERR_LIB_EC, 115}, + {"ASN1_ERROR", 16, 115}, #endif #ifdef EC_R_BAD_SIGNATURE {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE}, #else - {"BAD_SIGNATURE", ERR_LIB_EC, 156}, + {"BAD_SIGNATURE", 16, 156}, #endif #ifdef EC_R_BIGNUM_OUT_OF_RANGE {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE}, #else - {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, 144}, + {"BIGNUM_OUT_OF_RANGE", 16, 144}, #endif #ifdef EC_R_BUFFER_TOO_SMALL {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL}, #else - {"BUFFER_TOO_SMALL", ERR_LIB_EC, 100}, + {"BUFFER_TOO_SMALL", 16, 100}, #endif #ifdef EC_R_CANNOT_INVERT {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT}, #else - {"CANNOT_INVERT", ERR_LIB_EC, 165}, + {"CANNOT_INVERT", 16, 165}, #endif #ifdef EC_R_COORDINATES_OUT_OF_RANGE {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE}, #else - {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, 146}, + {"COORDINATES_OUT_OF_RANGE", 16, 146}, #endif #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH}, #else - {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, 160}, + {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160}, #endif #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING}, #else - {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, 159}, + {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159}, #endif #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE}, #else - {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 117}, + {"D2I_ECPKPARAMETERS_FAILURE", 16, 117}, #endif #ifdef EC_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_EC, 142}, + {"DECODE_ERROR", 16, 142}, #endif #ifdef EC_R_DISCRIMINANT_IS_ZERO {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO}, #else - {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, 118}, + {"DISCRIMINANT_IS_ZERO", 16, 118}, #endif #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE}, #else - {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, 119}, + {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119}, #endif #ifdef EC_R_FIELD_TOO_LARGE {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE}, #else - {"FIELD_TOO_LARGE", ERR_LIB_EC, 143}, + {"FIELD_TOO_LARGE", 16, 143}, #endif #ifdef EC_R_GF2M_NOT_SUPPORTED {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED}, #else - {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, 147}, + {"GF2M_NOT_SUPPORTED", 16, 147}, #endif #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE}, #else - {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, 120}, + {"GROUP2PKPARAMETERS_FAILURE", 16, 120}, #endif #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE}, #else - {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, 121}, + {"I2D_ECPKPARAMETERS_FAILURE", 16, 121}, #endif #ifdef EC_R_INCOMPATIBLE_OBJECTS {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS}, #else - {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, 101}, + {"INCOMPATIBLE_OBJECTS", 16, 101}, #endif #ifdef EC_R_INVALID_ARGUMENT {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT}, #else - {"INVALID_ARGUMENT", ERR_LIB_EC, 112}, + {"INVALID_ARGUMENT", 16, 112}, #endif #ifdef EC_R_INVALID_COMPRESSED_POINT {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT}, #else - {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, 110}, + {"INVALID_COMPRESSED_POINT", 16, 110}, #endif #ifdef EC_R_INVALID_COMPRESSION_BIT {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT}, #else - {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, 109}, + {"INVALID_COMPRESSION_BIT", 16, 109}, #endif #ifdef EC_R_INVALID_CURVE {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE}, #else - {"INVALID_CURVE", ERR_LIB_EC, 141}, + {"INVALID_CURVE", 16, 141}, #endif #ifdef EC_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_EC, 151}, + {"INVALID_DIGEST", 16, 151}, #endif #ifdef EC_R_INVALID_DIGEST_TYPE {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE}, #else - {"INVALID_DIGEST_TYPE", ERR_LIB_EC, 138}, + {"INVALID_DIGEST_TYPE", 16, 138}, #endif #ifdef EC_R_INVALID_ENCODING {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING}, #else - {"INVALID_ENCODING", ERR_LIB_EC, 102}, + {"INVALID_ENCODING", 16, 102}, #endif #ifdef EC_R_INVALID_FIELD {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD}, #else - {"INVALID_FIELD", ERR_LIB_EC, 103}, + {"INVALID_FIELD", 16, 103}, #endif #ifdef EC_R_INVALID_FORM {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM}, #else - {"INVALID_FORM", ERR_LIB_EC, 104}, + {"INVALID_FORM", 16, 104}, #endif #ifdef EC_R_INVALID_GROUP_ORDER {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER}, #else - {"INVALID_GROUP_ORDER", ERR_LIB_EC, 122}, + {"INVALID_GROUP_ORDER", 16, 122}, #endif #ifdef EC_R_INVALID_KEY {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY}, #else - {"INVALID_KEY", ERR_LIB_EC, 116}, + {"INVALID_KEY", 16, 116}, #endif #ifdef EC_R_INVALID_OUTPUT_LENGTH {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH}, #else - {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, 161}, + {"INVALID_OUTPUT_LENGTH", 16, 161}, #endif #ifdef EC_R_INVALID_PEER_KEY {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY}, #else - {"INVALID_PEER_KEY", ERR_LIB_EC, 133}, + {"INVALID_PEER_KEY", 16, 133}, #endif #ifdef EC_R_INVALID_PENTANOMIAL_BASIS {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS}, #else - {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, 132}, + {"INVALID_PENTANOMIAL_BASIS", 16, 132}, #endif #ifdef EC_R_INVALID_PRIVATE_KEY {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY}, #else - {"INVALID_PRIVATE_KEY", ERR_LIB_EC, 123}, + {"INVALID_PRIVATE_KEY", 16, 123}, #endif #ifdef EC_R_INVALID_TRINOMIAL_BASIS {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS}, #else - {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, 137}, + {"INVALID_TRINOMIAL_BASIS", 16, 137}, #endif #ifdef EC_R_KDF_PARAMETER_ERROR {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR}, #else - {"KDF_PARAMETER_ERROR", ERR_LIB_EC, 148}, + {"KDF_PARAMETER_ERROR", 16, 148}, #endif #ifdef EC_R_KEYS_NOT_SET {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET}, #else - {"KEYS_NOT_SET", ERR_LIB_EC, 140}, + {"KEYS_NOT_SET", 16, 140}, #endif #ifdef EC_R_LADDER_POST_FAILURE {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE}, #else - {"LADDER_POST_FAILURE", ERR_LIB_EC, 136}, + {"LADDER_POST_FAILURE", 16, 136}, #endif #ifdef EC_R_LADDER_PRE_FAILURE {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE}, #else - {"LADDER_PRE_FAILURE", ERR_LIB_EC, 153}, + {"LADDER_PRE_FAILURE", 16, 153}, #endif #ifdef EC_R_LADDER_STEP_FAILURE {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE}, #else - {"LADDER_STEP_FAILURE", ERR_LIB_EC, 162}, + {"LADDER_STEP_FAILURE", 16, 162}, #endif #ifdef EC_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_EC, 124}, + {"MISSING_PARAMETERS", 16, 124}, #endif #ifdef EC_R_MISSING_PRIVATE_KEY {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY}, #else - {"MISSING_PRIVATE_KEY", ERR_LIB_EC, 125}, + {"MISSING_PRIVATE_KEY", 16, 125}, #endif #ifdef EC_R_NEED_NEW_SETUP_VALUES {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES}, #else - {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, 157}, + {"NEED_NEW_SETUP_VALUES", 16, 157}, #endif #ifdef EC_R_NOT_A_NIST_PRIME {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME}, #else - {"NOT_A_NIST_PRIME", ERR_LIB_EC, 135}, + {"NOT_A_NIST_PRIME", 16, 135}, #endif #ifdef EC_R_NOT_IMPLEMENTED {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED}, #else - {"NOT_IMPLEMENTED", ERR_LIB_EC, 126}, + {"NOT_IMPLEMENTED", 16, 126}, #endif #ifdef EC_R_NOT_INITIALIZED {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED}, #else - {"NOT_INITIALIZED", ERR_LIB_EC, 111}, + {"NOT_INITIALIZED", 16, 111}, #endif #ifdef EC_R_NO_PARAMETERS_SET {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET}, #else - {"NO_PARAMETERS_SET", ERR_LIB_EC, 139}, + {"NO_PARAMETERS_SET", 16, 139}, #endif #ifdef EC_R_NO_PRIVATE_VALUE {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE}, #else - {"NO_PRIVATE_VALUE", ERR_LIB_EC, 154}, + {"NO_PRIVATE_VALUE", 16, 154}, #endif #ifdef EC_R_OPERATION_NOT_SUPPORTED {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED}, #else - {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, 152}, + {"OPERATION_NOT_SUPPORTED", 16, 152}, #endif #ifdef EC_R_PASSED_NULL_PARAMETER {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER}, #else - {"PASSED_NULL_PARAMETER", ERR_LIB_EC, 134}, + {"PASSED_NULL_PARAMETER", 16, 134}, #endif #ifdef EC_R_PEER_KEY_ERROR {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR}, #else - {"PEER_KEY_ERROR", ERR_LIB_EC, 149}, + {"PEER_KEY_ERROR", 16, 149}, #endif #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE}, #else - {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, 127}, + {"PKPARAMETERS2GROUP_FAILURE", 16, 127}, #endif #ifdef EC_R_POINT_ARITHMETIC_FAILURE {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE}, #else - {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, 155}, + {"POINT_ARITHMETIC_FAILURE", 16, 155}, #endif #ifdef EC_R_POINT_AT_INFINITY {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY}, #else - {"POINT_AT_INFINITY", ERR_LIB_EC, 106}, + {"POINT_AT_INFINITY", 16, 106}, #endif #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE}, #else - {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, 163}, + {"POINT_COORDINATES_BLIND_FAILURE", 16, 163}, #endif #ifdef EC_R_POINT_IS_NOT_ON_CURVE {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE}, #else - {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, 107}, + {"POINT_IS_NOT_ON_CURVE", 16, 107}, #endif #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED}, #else - {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, 158}, + {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158}, #endif #ifdef EC_R_SHARED_INFO_ERROR {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR}, #else - {"SHARED_INFO_ERROR", ERR_LIB_EC, 150}, + {"SHARED_INFO_ERROR", 16, 150}, #endif #ifdef EC_R_SLOT_FULL {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL}, #else - {"SLOT_FULL", ERR_LIB_EC, 108}, + {"SLOT_FULL", 16, 108}, #endif #ifdef EC_R_UNDEFINED_GENERATOR {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR}, #else - {"UNDEFINED_GENERATOR", ERR_LIB_EC, 113}, + {"UNDEFINED_GENERATOR", 16, 113}, #endif #ifdef EC_R_UNDEFINED_ORDER {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER}, #else - {"UNDEFINED_ORDER", ERR_LIB_EC, 128}, + {"UNDEFINED_ORDER", 16, 128}, #endif #ifdef EC_R_UNKNOWN_COFACTOR {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR}, #else - {"UNKNOWN_COFACTOR", ERR_LIB_EC, 164}, + {"UNKNOWN_COFACTOR", 16, 164}, #endif #ifdef EC_R_UNKNOWN_GROUP {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP}, #else - {"UNKNOWN_GROUP", ERR_LIB_EC, 129}, + {"UNKNOWN_GROUP", 16, 129}, #endif #ifdef EC_R_UNKNOWN_ORDER {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER}, #else - {"UNKNOWN_ORDER", ERR_LIB_EC, 114}, + {"UNKNOWN_ORDER", 16, 114}, #endif #ifdef EC_R_UNSUPPORTED_FIELD {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD}, #else - {"UNSUPPORTED_FIELD", ERR_LIB_EC, 131}, + {"UNSUPPORTED_FIELD", 16, 131}, #endif #ifdef EC_R_WRONG_CURVE_PARAMETERS {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS}, #else - {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, 145}, + {"WRONG_CURVE_PARAMETERS", 16, 145}, #endif #ifdef EC_R_WRONG_ORDER {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER}, #else - {"WRONG_ORDER", ERR_LIB_EC, 130}, + {"WRONG_ORDER", 16, 130}, #endif #ifdef ENGINE_R_ALREADY_LOADED {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED}, #else - {"ALREADY_LOADED", ERR_LIB_ENGINE, 100}, + {"ALREADY_LOADED", 38, 100}, #endif #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER}, #else - {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, 133}, + {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133}, #endif #ifdef ENGINE_R_CMD_NOT_EXECUTABLE {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE}, #else - {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, 134}, + {"CMD_NOT_EXECUTABLE", 38, 134}, #endif #ifdef ENGINE_R_COMMAND_TAKES_INPUT {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT}, #else - {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, 135}, + {"COMMAND_TAKES_INPUT", 38, 135}, #endif #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT}, #else - {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, 136}, + {"COMMAND_TAKES_NO_INPUT", 38, 136}, #endif #ifdef ENGINE_R_CONFLICTING_ENGINE_ID {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID}, #else - {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, 103}, + {"CONFLICTING_ENGINE_ID", 38, 103}, #endif #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED}, #else - {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, 119}, + {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119}, #endif #ifdef ENGINE_R_DSO_FAILURE {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE}, #else - {"DSO_FAILURE", ERR_LIB_ENGINE, 104}, + {"DSO_FAILURE", 38, 104}, #endif #ifdef ENGINE_R_DSO_NOT_FOUND {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND}, #else - {"DSO_NOT_FOUND", ERR_LIB_ENGINE, 132}, + {"DSO_NOT_FOUND", 38, 132}, #endif #ifdef ENGINE_R_ENGINES_SECTION_ERROR {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR}, #else - {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, 148}, + {"ENGINES_SECTION_ERROR", 38, 148}, #endif #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR}, #else - {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, 102}, + {"ENGINE_CONFIGURATION_ERROR", 38, 102}, #endif #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST}, #else - {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, 105}, + {"ENGINE_IS_NOT_IN_LIST", 38, 105}, #endif #ifdef ENGINE_R_ENGINE_SECTION_ERROR {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR}, #else - {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, 149}, + {"ENGINE_SECTION_ERROR", 38, 149}, #endif #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY}, #else - {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, 128}, + {"FAILED_LOADING_PRIVATE_KEY", 38, 128}, #endif #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY}, #else - {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, 129}, + {"FAILED_LOADING_PUBLIC_KEY", 38, 129}, #endif #ifdef ENGINE_R_FINISH_FAILED {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED}, #else - {"FINISH_FAILED", ERR_LIB_ENGINE, 106}, + {"FINISH_FAILED", 38, 106}, #endif #ifdef ENGINE_R_ID_OR_NAME_MISSING {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING}, #else - {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, 108}, + {"ID_OR_NAME_MISSING", 38, 108}, #endif #ifdef ENGINE_R_INIT_FAILED {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED}, #else - {"INIT_FAILED", ERR_LIB_ENGINE, 109}, + {"INIT_FAILED", 38, 109}, #endif #ifdef ENGINE_R_INTERNAL_LIST_ERROR {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR}, #else - {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, 110}, + {"INTERNAL_LIST_ERROR", 38, 110}, #endif #ifdef ENGINE_R_INVALID_ARGUMENT {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT}, #else - {"INVALID_ARGUMENT", ERR_LIB_ENGINE, 143}, + {"INVALID_ARGUMENT", 38, 143}, #endif #ifdef ENGINE_R_INVALID_CMD_NAME {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME}, #else - {"INVALID_CMD_NAME", ERR_LIB_ENGINE, 137}, + {"INVALID_CMD_NAME", 38, 137}, #endif #ifdef ENGINE_R_INVALID_CMD_NUMBER {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER}, #else - {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, 138}, + {"INVALID_CMD_NUMBER", 38, 138}, #endif #ifdef ENGINE_R_INVALID_INIT_VALUE {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE}, #else - {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, 151}, + {"INVALID_INIT_VALUE", 38, 151}, #endif #ifdef ENGINE_R_INVALID_STRING {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING}, #else - {"INVALID_STRING", ERR_LIB_ENGINE, 150}, + {"INVALID_STRING", 38, 150}, #endif #ifdef ENGINE_R_NOT_INITIALISED {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED}, #else - {"NOT_INITIALISED", ERR_LIB_ENGINE, 117}, + {"NOT_INITIALISED", 38, 117}, #endif #ifdef ENGINE_R_NOT_LOADED {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED}, #else - {"NOT_LOADED", ERR_LIB_ENGINE, 112}, + {"NOT_LOADED", 38, 112}, #endif #ifdef ENGINE_R_NO_CONTROL_FUNCTION {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION}, #else - {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, 120}, + {"NO_CONTROL_FUNCTION", 38, 120}, #endif #ifdef ENGINE_R_NO_INDEX {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX}, #else - {"NO_INDEX", ERR_LIB_ENGINE, 144}, + {"NO_INDEX", 38, 144}, #endif #ifdef ENGINE_R_NO_LOAD_FUNCTION {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION}, #else - {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, 125}, + {"NO_LOAD_FUNCTION", 38, 125}, #endif #ifdef ENGINE_R_NO_REFERENCE {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE}, #else - {"NO_REFERENCE", ERR_LIB_ENGINE, 130}, + {"NO_REFERENCE", 38, 130}, #endif #ifdef ENGINE_R_NO_SUCH_ENGINE {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE}, #else - {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, 116}, + {"NO_SUCH_ENGINE", 38, 116}, #endif #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER}, #else - {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, 146}, + {"UNIMPLEMENTED_CIPHER", 38, 146}, #endif #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST}, #else - {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, 147}, + {"UNIMPLEMENTED_DIGEST", 38, 147}, #endif #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD}, #else - {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, 101}, + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101}, #endif #ifdef ENGINE_R_VERSION_INCOMPATIBILITY {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY}, #else - {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, 145}, + {"VERSION_INCOMPATIBILITY", 38, 145}, #endif #ifdef EVP_R_AES_KEY_SETUP_FAILED {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED}, #else - {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, 143}, + {"AES_KEY_SETUP_FAILED", 6, 143}, #endif #ifdef EVP_R_ARIA_KEY_SETUP_FAILED {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED}, #else - {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 176}, + {"ARIA_KEY_SETUP_FAILED", 6, 176}, #endif #ifdef EVP_R_BAD_DECRYPT {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT}, #else - {"BAD_DECRYPT", ERR_LIB_EVP, 100}, + {"BAD_DECRYPT", 6, 100}, #endif #ifdef EVP_R_BAD_KEY_LENGTH {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH}, #else - {"BAD_KEY_LENGTH", ERR_LIB_EVP, 195}, + {"BAD_KEY_LENGTH", 6, 195}, #endif #ifdef EVP_R_BUFFER_TOO_SMALL {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL}, #else - {"BUFFER_TOO_SMALL", ERR_LIB_EVP, 155}, + {"BUFFER_TOO_SMALL", 6, 155}, #endif #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED}, #else - {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, 157}, + {"CAMELLIA_KEY_SETUP_FAILED", 6, 157}, #endif #ifdef EVP_R_CIPHER_PARAMETER_ERROR {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR}, #else - {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, 122}, + {"CIPHER_PARAMETER_ERROR", 6, 122}, #endif #ifdef EVP_R_COMMAND_NOT_SUPPORTED {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED}, #else - {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, 147}, + {"COMMAND_NOT_SUPPORTED", 6, 147}, #endif #ifdef EVP_R_COPY_ERROR {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR}, #else - {"COPY_ERROR", ERR_LIB_EVP, 173}, + {"COPY_ERROR", 6, 173}, #endif #ifdef EVP_R_CTRL_NOT_IMPLEMENTED {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED}, #else - {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, 132}, + {"CTRL_NOT_IMPLEMENTED", 6, 132}, #endif #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED}, #else - {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, 133}, + {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133}, #endif #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH}, #else - {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, 138}, + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138}, #endif #ifdef EVP_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_EVP, 114}, + {"DECODE_ERROR", 6, 114}, #endif #ifdef EVP_R_DIFFERENT_KEY_TYPES {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES}, #else - {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, 101}, + {"DIFFERENT_KEY_TYPES", 6, 101}, #endif #ifdef EVP_R_DIFFERENT_PARAMETERS {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS}, #else - {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, 153}, + {"DIFFERENT_PARAMETERS", 6, 153}, #endif #ifdef EVP_R_ERROR_LOADING_SECTION {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION}, #else - {"ERROR_LOADING_SECTION", ERR_LIB_EVP, 165}, + {"ERROR_LOADING_SECTION", 6, 165}, #endif #ifdef EVP_R_ERROR_SETTING_FIPS_MODE {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE}, #else - {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, 166}, + {"ERROR_SETTING_FIPS_MODE", 6, 166}, #endif #ifdef EVP_R_EXPECTING_AN_HMAC_KEY {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY}, #else - {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, 174}, + {"EXPECTING_AN_HMAC_KEY", 6, 174}, #endif #ifdef EVP_R_EXPECTING_AN_RSA_KEY {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY}, #else - {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, 127}, + {"EXPECTING_AN_RSA_KEY", 6, 127}, #endif #ifdef EVP_R_EXPECTING_A_DH_KEY {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY}, #else - {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, 128}, + {"EXPECTING_A_DH_KEY", 6, 128}, #endif #ifdef EVP_R_EXPECTING_A_DSA_KEY {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY}, #else - {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, 129}, + {"EXPECTING_A_DSA_KEY", 6, 129}, #endif #ifdef EVP_R_EXPECTING_A_EC_KEY {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY}, #else - {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, 142}, + {"EXPECTING_A_EC_KEY", 6, 142}, #endif #ifdef EVP_R_EXPECTING_A_POLY1305_KEY {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY}, #else - {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, 164}, + {"EXPECTING_A_POLY1305_KEY", 6, 164}, #endif #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY}, #else - {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, 175}, + {"EXPECTING_A_SIPHASH_KEY", 6, 175}, #endif #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED}, #else - {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, 167}, + {"FIPS_MODE_NOT_SUPPORTED", 6, 167}, #endif #ifdef EVP_R_GET_RAW_KEY_FAILED {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED}, #else - {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, 182}, + {"GET_RAW_KEY_FAILED", 6, 182}, #endif #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS}, #else - {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, 171}, + {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171}, #endif #ifdef EVP_R_INITIALIZATION_ERROR {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR}, #else - {"INITIALIZATION_ERROR", ERR_LIB_EVP, 134}, + {"INITIALIZATION_ERROR", 6, 134}, #endif #ifdef EVP_R_INPUT_NOT_INITIALIZED {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED}, #else - {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, 111}, + {"INPUT_NOT_INITIALIZED", 6, 111}, #endif #ifdef EVP_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_EVP, 152}, + {"INVALID_DIGEST", 6, 152}, #endif #ifdef EVP_R_INVALID_FIPS_MODE {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE}, #else - {"INVALID_FIPS_MODE", ERR_LIB_EVP, 168}, + {"INVALID_FIPS_MODE", 6, 168}, #endif #ifdef EVP_R_INVALID_IV_LENGTH {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH}, #else - {"INVALID_IV_LENGTH", ERR_LIB_EVP, 194}, + {"INVALID_IV_LENGTH", 6, 194}, #endif #ifdef EVP_R_INVALID_KEY {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY}, #else - {"INVALID_KEY", ERR_LIB_EVP, 163}, + {"INVALID_KEY", 6, 163}, #endif #ifdef EVP_R_INVALID_KEY_LENGTH {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH}, #else - {"INVALID_KEY_LENGTH", ERR_LIB_EVP, 130}, + {"INVALID_KEY_LENGTH", 6, 130}, #endif #ifdef EVP_R_INVALID_OPERATION {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION}, #else - {"INVALID_OPERATION", ERR_LIB_EVP, 148}, + {"INVALID_OPERATION", 6, 148}, #endif #ifdef EVP_R_KEYGEN_FAILURE {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE}, #else - {"KEYGEN_FAILURE", ERR_LIB_EVP, 120}, + {"KEYGEN_FAILURE", 6, 120}, #endif #ifdef EVP_R_KEY_SETUP_FAILED {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED}, #else - {"KEY_SETUP_FAILED", ERR_LIB_EVP, 180}, + {"KEY_SETUP_FAILED", 6, 180}, #endif #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED}, #else - {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, 172}, + {"MEMORY_LIMIT_EXCEEDED", 6, 172}, #endif #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL}, #else - {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, 159}, + {"MESSAGE_DIGEST_IS_NULL", 6, 159}, #endif #ifdef EVP_R_METHOD_NOT_SUPPORTED {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED}, #else - {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, 144}, + {"METHOD_NOT_SUPPORTED", 6, 144}, #endif #ifdef EVP_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_EVP, 103}, + {"MISSING_PARAMETERS", 6, 103}, #endif #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH}, #else - {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, 178}, + {"NOT_XOF_OR_INVALID_LENGTH", 6, 178}, #endif #ifdef EVP_R_NO_CIPHER_SET {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET}, #else - {"NO_CIPHER_SET", ERR_LIB_EVP, 131}, + {"NO_CIPHER_SET", 6, 131}, #endif #ifdef EVP_R_NO_DEFAULT_DIGEST {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST}, #else - {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, 158}, + {"NO_DEFAULT_DIGEST", 6, 158}, #endif #ifdef EVP_R_NO_DIGEST_SET {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET}, #else - {"NO_DIGEST_SET", ERR_LIB_EVP, 139}, + {"NO_DIGEST_SET", 6, 139}, #endif #ifdef EVP_R_NO_KEY_SET {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET}, #else - {"NO_KEY_SET", ERR_LIB_EVP, 154}, + {"NO_KEY_SET", 6, 154}, #endif #ifdef EVP_R_NO_OPERATION_SET {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET}, #else - {"NO_OPERATION_SET", ERR_LIB_EVP, 149}, + {"NO_OPERATION_SET", 6, 149}, #endif #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED}, #else - {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, 177}, + {"ONLY_ONESHOT_SUPPORTED", 6, 177}, #endif #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, #else - {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, 150}, + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150}, #endif #ifdef EVP_R_OPERATON_NOT_INITIALIZED {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED}, #else - {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, 151}, + {"OPERATON_NOT_INITIALIZED", 6, 151}, #endif #ifdef EVP_R_PARTIALLY_OVERLAPPING {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING}, #else - {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, 162}, + {"PARTIALLY_OVERLAPPING", 6, 162}, #endif #ifdef EVP_R_PBKDF2_ERROR {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR}, #else - {"PBKDF2_ERROR", ERR_LIB_EVP, 181}, + {"PBKDF2_ERROR", 6, 181}, #endif #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED}, #else - {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, 179}, + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179}, #endif #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR}, #else - {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, 145}, + {"PRIVATE_KEY_DECODE_ERROR", 6, 145}, #endif #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR}, #else - {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, 146}, + {"PRIVATE_KEY_ENCODE_ERROR", 6, 146}, #endif #ifdef EVP_R_PUBLIC_KEY_NOT_RSA {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA}, #else - {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, 106}, + {"PUBLIC_KEY_NOT_RSA", 6, 106}, #endif #ifdef EVP_R_UNKNOWN_CIPHER {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER}, #else - {"UNKNOWN_CIPHER", ERR_LIB_EVP, 160}, + {"UNKNOWN_CIPHER", 6, 160}, #endif #ifdef EVP_R_UNKNOWN_DIGEST {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST}, #else - {"UNKNOWN_DIGEST", ERR_LIB_EVP, 161}, + {"UNKNOWN_DIGEST", 6, 161}, #endif #ifdef EVP_R_UNKNOWN_OPTION {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION}, #else - {"UNKNOWN_OPTION", ERR_LIB_EVP, 169}, + {"UNKNOWN_OPTION", 6, 169}, #endif #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM}, #else - {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, 121}, + {"UNKNOWN_PBE_ALGORITHM", 6, 121}, #endif #ifdef EVP_R_UNSUPPORTED_ALGORITHM {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM}, #else - {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, 156}, + {"UNSUPPORTED_ALGORITHM", 6, 156}, #endif #ifdef EVP_R_UNSUPPORTED_CIPHER {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, 107}, + {"UNSUPPORTED_CIPHER", 6, 107}, #endif #ifdef EVP_R_UNSUPPORTED_KEYLENGTH {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH}, #else - {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, 123}, + {"UNSUPPORTED_KEYLENGTH", 6, 123}, #endif #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION}, #else - {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, 124}, + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124}, #endif #ifdef EVP_R_UNSUPPORTED_KEY_SIZE {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE}, #else - {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, 108}, + {"UNSUPPORTED_KEY_SIZE", 6, 108}, #endif #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, #else - {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, 135}, + {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135}, #endif #ifdef EVP_R_UNSUPPORTED_PRF {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF}, #else - {"UNSUPPORTED_PRF", ERR_LIB_EVP, 125}, + {"UNSUPPORTED_PRF", 6, 125}, #endif #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM}, #else - {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, 118}, + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118}, #endif #ifdef EVP_R_UNSUPPORTED_SALT_TYPE {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE}, #else - {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, 126}, + {"UNSUPPORTED_SALT_TYPE", 6, 126}, #endif #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED}, #else - {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, 170}, + {"WRAP_MODE_NOT_ALLOWED", 6, 170}, #endif #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH}, #else - {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, 109}, + {"WRONG_FINAL_BLOCK_LENGTH", 6, 109}, #endif #ifdef EVP_R_XTS_DUPLICATED_KEYS {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS}, #else - {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, 183}, + {"XTS_DUPLICATED_KEYS", 6, 183}, #endif #ifdef KDF_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_KDF, 100}, + {"INVALID_DIGEST", 52, 100}, #endif #ifdef KDF_R_MISSING_ITERATION_COUNT {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT}, #else - {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, 109}, + {"MISSING_ITERATION_COUNT", 52, 109}, #endif #ifdef KDF_R_MISSING_KEY {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY}, #else - {"MISSING_KEY", ERR_LIB_KDF, 104}, + {"MISSING_KEY", 52, 104}, #endif #ifdef KDF_R_MISSING_MESSAGE_DIGEST {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST}, #else - {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, 105}, + {"MISSING_MESSAGE_DIGEST", 52, 105}, #endif #ifdef KDF_R_MISSING_PARAMETER {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER}, #else - {"MISSING_PARAMETER", ERR_LIB_KDF, 101}, + {"MISSING_PARAMETER", 52, 101}, #endif #ifdef KDF_R_MISSING_PASS {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS}, #else - {"MISSING_PASS", ERR_LIB_KDF, 110}, + {"MISSING_PASS", 52, 110}, #endif #ifdef KDF_R_MISSING_SALT {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT}, #else - {"MISSING_SALT", ERR_LIB_KDF, 111}, + {"MISSING_SALT", 52, 111}, #endif #ifdef KDF_R_MISSING_SECRET {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET}, #else - {"MISSING_SECRET", ERR_LIB_KDF, 107}, + {"MISSING_SECRET", 52, 107}, #endif #ifdef KDF_R_MISSING_SEED {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED}, #else - {"MISSING_SEED", ERR_LIB_KDF, 106}, + {"MISSING_SEED", 52, 106}, #endif #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE}, #else - {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, 103}, + {"UNKNOWN_PARAMETER_TYPE", 52, 103}, #endif #ifdef KDF_R_VALUE_ERROR {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR}, #else - {"VALUE_ERROR", ERR_LIB_KDF, 108}, + {"VALUE_ERROR", 52, 108}, #endif #ifdef KDF_R_VALUE_MISSING {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING}, #else - {"VALUE_MISSING", ERR_LIB_KDF, 102}, + {"VALUE_MISSING", 52, 102}, #endif #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, 101}, + {"CERTIFICATE_VERIFY_ERROR", 39, 101}, #endif #ifdef OCSP_R_DIGEST_ERR {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR}, #else - {"DIGEST_ERR", ERR_LIB_OCSP, 102}, + {"DIGEST_ERR", 39, 102}, #endif #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD}, #else - {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, 122}, + {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122}, #endif #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD}, #else - {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, 123}, + {"ERROR_IN_THISUPDATE_FIELD", 39, 123}, #endif #ifdef OCSP_R_ERROR_PARSING_URL {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL}, #else - {"ERROR_PARSING_URL", ERR_LIB_OCSP, 121}, + {"ERROR_PARSING_URL", 39, 121}, #endif #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE}, #else - {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, 103}, + {"MISSING_OCSPSIGNING_USAGE", 39, 103}, #endif #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE}, #else - {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, 124}, + {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124}, #endif #ifdef OCSP_R_NOT_BASIC_RESPONSE {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE}, #else - {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, 104}, + {"NOT_BASIC_RESPONSE", 39, 104}, #endif #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN}, #else - {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, 105}, + {"NO_CERTIFICATES_IN_CHAIN", 39, 105}, #endif #ifdef OCSP_R_NO_RESPONSE_DATA {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA}, #else - {"NO_RESPONSE_DATA", ERR_LIB_OCSP, 108}, + {"NO_RESPONSE_DATA", 39, 108}, #endif #ifdef OCSP_R_NO_REVOKED_TIME {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME}, #else - {"NO_REVOKED_TIME", ERR_LIB_OCSP, 109}, + {"NO_REVOKED_TIME", 39, 109}, #endif #ifdef OCSP_R_NO_SIGNER_KEY {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY}, #else - {"NO_SIGNER_KEY", ERR_LIB_OCSP, 130}, + {"NO_SIGNER_KEY", 39, 130}, #endif #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, 110}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110}, #endif #ifdef OCSP_R_REQUEST_NOT_SIGNED {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED}, #else - {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, 128}, + {"REQUEST_NOT_SIGNED", 39, 128}, #endif #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA}, #else - {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, 111}, + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111}, #endif #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED}, #else - {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, 112}, + {"ROOT_CA_NOT_TRUSTED", 39, 112}, #endif #ifdef OCSP_R_SERVER_RESPONSE_ERROR {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR}, #else - {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, 114}, + {"SERVER_RESPONSE_ERROR", 39, 114}, #endif #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR}, #else - {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, 115}, + {"SERVER_RESPONSE_PARSE_ERROR", 39, 115}, #endif #ifdef OCSP_R_SIGNATURE_FAILURE {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE}, #else - {"SIGNATURE_FAILURE", ERR_LIB_OCSP, 117}, + {"SIGNATURE_FAILURE", 39, 117}, #endif #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, 118}, + {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118}, #endif #ifdef OCSP_R_STATUS_EXPIRED {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED}, #else - {"STATUS_EXPIRED", ERR_LIB_OCSP, 125}, + {"STATUS_EXPIRED", 39, 125}, #endif #ifdef OCSP_R_STATUS_NOT_YET_VALID {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID}, #else - {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, 126}, + {"STATUS_NOT_YET_VALID", 39, 126}, #endif #ifdef OCSP_R_STATUS_TOO_OLD {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD}, #else - {"STATUS_TOO_OLD", ERR_LIB_OCSP, 127}, + {"STATUS_TOO_OLD", 39, 127}, #endif #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST}, #else - {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, 119}, + {"UNKNOWN_MESSAGE_DIGEST", 39, 119}, #endif #ifdef OCSP_R_UNKNOWN_NID {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID}, #else - {"UNKNOWN_NID", ERR_LIB_OCSP, 120}, + {"UNKNOWN_NID", 39, 120}, #endif #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE}, #else - {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, 129}, + {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129}, #endif #ifdef PEM_R_BAD_BASE64_DECODE {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, #else - {"BAD_BASE64_DECODE", ERR_LIB_PEM, 100}, + {"BAD_BASE64_DECODE", 9, 100}, #endif #ifdef PEM_R_BAD_DECRYPT {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, #else - {"BAD_DECRYPT", ERR_LIB_PEM, 101}, + {"BAD_DECRYPT", 9, 101}, #endif #ifdef PEM_R_BAD_END_LINE {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, #else - {"BAD_END_LINE", ERR_LIB_PEM, 102}, + {"BAD_END_LINE", 9, 102}, #endif #ifdef PEM_R_BAD_IV_CHARS {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, #else - {"BAD_IV_CHARS", ERR_LIB_PEM, 103}, + {"BAD_IV_CHARS", 9, 103}, #endif #ifdef PEM_R_BAD_MAGIC_NUMBER {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, #else - {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, 116}, + {"BAD_MAGIC_NUMBER", 9, 116}, #endif #ifdef PEM_R_BAD_PASSWORD_READ {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, #else - {"BAD_PASSWORD_READ", ERR_LIB_PEM, 104}, + {"BAD_PASSWORD_READ", 9, 104}, #endif #ifdef PEM_R_BAD_VERSION_NUMBER {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, #else - {"BAD_VERSION_NUMBER", ERR_LIB_PEM, 117}, + {"BAD_VERSION_NUMBER", 9, 117}, #endif #ifdef PEM_R_BIO_WRITE_FAILURE {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, #else - {"BIO_WRITE_FAILURE", ERR_LIB_PEM, 118}, + {"BIO_WRITE_FAILURE", 9, 118}, #endif #ifdef PEM_R_CIPHER_IS_NULL {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, #else - {"CIPHER_IS_NULL", ERR_LIB_PEM, 127}, + {"CIPHER_IS_NULL", 9, 127}, #endif #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, #else - {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, 115}, + {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115}, #endif #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, #else - {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, 119}, + {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119}, #endif #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, #else - {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, 120}, + {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120}, #endif #ifdef PEM_R_HEADER_TOO_LONG {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG}, #else - {"HEADER_TOO_LONG", ERR_LIB_PEM, 128}, + {"HEADER_TOO_LONG", 9, 128}, #endif #ifdef PEM_R_INCONSISTENT_HEADER {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, #else - {"INCONSISTENT_HEADER", ERR_LIB_PEM, 121}, + {"INCONSISTENT_HEADER", 9, 121}, #endif #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, #else - {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, 122}, + {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122}, #endif #ifdef PEM_R_KEYBLOB_TOO_SHORT {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, #else - {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, 123}, + {"KEYBLOB_TOO_SHORT", 9, 123}, #endif #ifdef PEM_R_MISSING_DEK_IV {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV}, #else - {"MISSING_DEK_IV", ERR_LIB_PEM, 129}, + {"MISSING_DEK_IV", 9, 129}, #endif #ifdef PEM_R_NOT_DEK_INFO {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, #else - {"NOT_DEK_INFO", ERR_LIB_PEM, 105}, + {"NOT_DEK_INFO", 9, 105}, #endif #ifdef PEM_R_NOT_ENCRYPTED {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, #else - {"NOT_ENCRYPTED", ERR_LIB_PEM, 106}, + {"NOT_ENCRYPTED", 9, 106}, #endif #ifdef PEM_R_NOT_PROC_TYPE {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, #else - {"NOT_PROC_TYPE", ERR_LIB_PEM, 107}, + {"NOT_PROC_TYPE", 9, 107}, #endif #ifdef PEM_R_NO_START_LINE {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, #else - {"NO_START_LINE", ERR_LIB_PEM, 108}, + {"NO_START_LINE", 9, 108}, #endif #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, #else - {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, 109}, + {"PROBLEMS_GETTING_PASSWORD", 9, 109}, #endif #ifdef PEM_R_PUBLIC_KEY_NO_RSA {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, PEM_R_PUBLIC_KEY_NO_RSA}, #else - {"PUBLIC_KEY_NO_RSA", ERR_LIB_PEM, 110}, + {"PUBLIC_KEY_NO_RSA", 9, 110}, #endif #ifdef PEM_R_PVK_DATA_TOO_SHORT {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, #else - {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, 124}, + {"PVK_DATA_TOO_SHORT", 9, 124}, #endif #ifdef PEM_R_PVK_TOO_SHORT {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, #else - {"PVK_TOO_SHORT", ERR_LIB_PEM, 125}, + {"PVK_TOO_SHORT", 9, 125}, #endif #ifdef PEM_R_READ_KEY {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, #else - {"READ_KEY", ERR_LIB_PEM, 111}, + {"READ_KEY", 9, 111}, #endif #ifdef PEM_R_SHORT_HEADER {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, #else - {"SHORT_HEADER", ERR_LIB_PEM, 112}, + {"SHORT_HEADER", 9, 112}, #endif #ifdef PEM_R_UNEXPECTED_DEK_IV {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV}, #else - {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, 130}, + {"UNEXPECTED_DEK_IV", 9, 130}, #endif #ifdef PEM_R_UNSUPPORTED_CIPHER {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, #else - {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, 113}, + {"UNSUPPORTED_CIPHER", 9, 113}, #endif #ifdef PEM_R_UNSUPPORTED_ENCRYPTION {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, #else - {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, 114}, + {"UNSUPPORTED_ENCRYPTION", 9, 114}, #endif #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, #else - {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, 126}, + {"UNSUPPORTED_KEY_COMPONENTS", 9, 126}, #endif #ifdef PKCS12_R_CANT_PACK_STRUCTURE {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE}, #else - {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, 100}, + {"CANT_PACK_STRUCTURE", 35, 100}, #endif #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA}, #else - {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, 121}, + {"CONTENT_TYPE_NOT_DATA", 35, 121}, #endif #ifdef PKCS12_R_DECODE_ERROR {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR}, #else - {"DECODE_ERROR", ERR_LIB_PKCS12, 101}, + {"DECODE_ERROR", 35, 101}, #endif #ifdef PKCS12_R_ENCODE_ERROR {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR}, #else - {"ENCODE_ERROR", ERR_LIB_PKCS12, 102}, + {"ENCODE_ERROR", 35, 102}, #endif #ifdef PKCS12_R_ENCRYPT_ERROR {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR}, #else - {"ENCRYPT_ERROR", ERR_LIB_PKCS12, 103}, + {"ENCRYPT_ERROR", 35, 103}, #endif #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE}, #else - {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, 120}, + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120}, #endif #ifdef PKCS12_R_INVALID_NULL_ARGUMENT {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT}, #else - {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, 104}, + {"INVALID_NULL_ARGUMENT", 35, 104}, #endif #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER}, #else - {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, 105}, + {"INVALID_NULL_PKCS12_POINTER", 35, 105}, #endif #ifdef PKCS12_R_IV_GEN_ERROR {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR}, #else - {"IV_GEN_ERROR", ERR_LIB_PKCS12, 106}, + {"IV_GEN_ERROR", 35, 106}, #endif #ifdef PKCS12_R_KEY_GEN_ERROR {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR}, #else - {"KEY_GEN_ERROR", ERR_LIB_PKCS12, 107}, + {"KEY_GEN_ERROR", 35, 107}, #endif #ifdef PKCS12_R_MAC_ABSENT {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT}, #else - {"MAC_ABSENT", ERR_LIB_PKCS12, 108}, + {"MAC_ABSENT", 35, 108}, #endif #ifdef PKCS12_R_MAC_GENERATION_ERROR {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR}, #else - {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, 109}, + {"MAC_GENERATION_ERROR", 35, 109}, #endif #ifdef PKCS12_R_MAC_SETUP_ERROR {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR}, #else - {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, 110}, + {"MAC_SETUP_ERROR", 35, 110}, #endif #ifdef PKCS12_R_MAC_STRING_SET_ERROR {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR}, #else - {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, 111}, + {"MAC_STRING_SET_ERROR", 35, 111}, #endif #ifdef PKCS12_R_MAC_VERIFY_FAILURE {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE}, #else - {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, 113}, + {"MAC_VERIFY_FAILURE", 35, 113}, #endif #ifdef PKCS12_R_PARSE_ERROR {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR}, #else - {"PARSE_ERROR", ERR_LIB_PKCS12, 114}, + {"PARSE_ERROR", 35, 114}, #endif #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR}, #else - {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, 115}, + {"PKCS12_ALGOR_CIPHERINIT_ERROR", 35, 115}, #endif #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR}, #else - {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, 116}, + {"PKCS12_CIPHERFINAL_ERROR", 35, 116}, #endif #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR}, #else - {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, 117}, + {"PKCS12_PBE_CRYPT_ERROR", 35, 117}, #endif #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM}, #else - {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, 118}, + {"UNKNOWN_DIGEST_ALGORITHM", 35, 118}, #endif #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE}, #else - {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, 119}, + {"UNSUPPORTED_PKCS12_MODE", 35, 119}, #endif #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, 117}, + {"CERTIFICATE_VERIFY_ERROR", 33, 117}, #endif #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, #else - {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, 144}, + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144}, #endif #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED}, #else - {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, 116}, + {"CIPHER_NOT_INITIALIZED", 33, 116}, #endif #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT}, #else - {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, 118}, + {"CONTENT_AND_DATA_PRESENT", 33, 118}, #endif #ifdef PKCS7_R_CTRL_ERROR {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR}, #else - {"CTRL_ERROR", ERR_LIB_PKCS7, 152}, + {"CTRL_ERROR", 33, 152}, #endif #ifdef PKCS7_R_DECRYPT_ERROR {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR}, #else - {"DECRYPT_ERROR", ERR_LIB_PKCS7, 119}, + {"DECRYPT_ERROR", 33, 119}, #endif #ifdef PKCS7_R_DIGEST_FAILURE {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE}, #else - {"DIGEST_FAILURE", ERR_LIB_PKCS7, 101}, + {"DIGEST_FAILURE", 33, 101}, #endif #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE}, #else - {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, 149}, + {"ENCRYPTION_CTRL_FAILURE", 33, 149}, #endif #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 150}, + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150}, #endif #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT}, #else - {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, 120}, + {"ERROR_ADDING_RECIPIENT", 33, 120}, #endif #ifdef PKCS7_R_ERROR_SETTING_CIPHER {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER}, #else - {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, 121}, + {"ERROR_SETTING_CIPHER", 33, 121}, #endif #ifdef PKCS7_R_INVALID_NULL_POINTER {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER}, #else - {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, 143}, + {"INVALID_NULL_POINTER", 33, 143}, #endif #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE}, #else - {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, 155}, + {"INVALID_SIGNED_DATA_TYPE", 33, 155}, #endif #ifdef PKCS7_R_NO_CONTENT {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT}, #else - {"NO_CONTENT", ERR_LIB_PKCS7, 122}, + {"NO_CONTENT", 33, 122}, #endif #ifdef PKCS7_R_NO_DEFAULT_DIGEST {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST}, #else - {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, 151}, + {"NO_DEFAULT_DIGEST", 33, 151}, #endif #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND}, #else - {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, 154}, + {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154}, #endif #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE}, #else - {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, 115}, + {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115}, #endif #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA}, #else - {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, 123}, + {"NO_SIGNATURES_ON_DATA", 33, 123}, #endif #ifdef PKCS7_R_NO_SIGNERS {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS}, #else - {"NO_SIGNERS", ERR_LIB_PKCS7, 142}, + {"NO_SIGNERS", 33, 142}, #endif #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE}, #else - {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, 104}, + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104}, #endif #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR}, #else - {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, 124}, + {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124}, #endif #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR}, #else - {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, 153}, + {"PKCS7_ADD_SIGNER_ERROR", 33, 153}, #endif #ifdef PKCS7_R_PKCS7_DATASIGN {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN}, #else - {"PKCS7_DATASIGN", ERR_LIB_PKCS7, 145}, + {"PKCS7_DATASIGN", 33, 145}, #endif #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, 127}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127}, #endif #ifdef PKCS7_R_SIGNATURE_FAILURE {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE}, #else - {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, 105}, + {"SIGNATURE_FAILURE", 33, 105}, #endif #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND}, #else - {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, 128}, + {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128}, #endif #ifdef PKCS7_R_SIGNING_CTRL_FAILURE {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE}, #else - {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, 147}, + {"SIGNING_CTRL_FAILURE", 33, 147}, #endif #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, #else - {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, 148}, + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148}, #endif #ifdef PKCS7_R_SMIME_TEXT_ERROR {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR}, #else - {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, 129}, + {"SMIME_TEXT_ERROR", 33, 129}, #endif #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE}, #else - {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, 106}, + {"UNABLE_TO_FIND_CERTIFICATE", 33, 106}, #endif #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO}, #else - {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, 107}, + {"UNABLE_TO_FIND_MEM_BIO", 33, 107}, #endif #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST}, #else - {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, 108}, + {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108}, #endif #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE}, #else - {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, 109}, + {"UNKNOWN_DIGEST_TYPE", 33, 109}, #endif #ifdef PKCS7_R_UNKNOWN_OPERATION {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION}, #else - {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, 110}, + {"UNKNOWN_OPERATION", 33, 110}, #endif #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE}, #else - {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, 111}, + {"UNSUPPORTED_CIPHER_TYPE", 33, 111}, #endif #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE}, #else - {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, 112}, + {"UNSUPPORTED_CONTENT_TYPE", 33, 112}, #endif #ifdef PKCS7_R_WRONG_CONTENT_TYPE {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE}, #else - {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, 113}, + {"WRONG_CONTENT_TYPE", 33, 113}, #endif #ifdef PKCS7_R_WRONG_PKCS7_TYPE {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE}, #else - {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, 114}, + {"WRONG_PKCS7_TYPE", 33, 114}, #endif #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG}, #else - {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, 102}, + {"ADDITIONAL_INPUT_TOO_LONG", 36, 102}, #endif #ifdef RAND_R_ALREADY_INSTANTIATED {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED}, #else - {"ALREADY_INSTANTIATED", ERR_LIB_RAND, 103}, + {"ALREADY_INSTANTIATED", 36, 103}, #endif #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE}, #else - {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, 105}, + {"ARGUMENT_OUT_OF_RANGE", 36, 105}, #endif #ifdef RAND_R_CANNOT_OPEN_FILE {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE}, #else - {"CANNOT_OPEN_FILE", ERR_LIB_RAND, 121}, + {"CANNOT_OPEN_FILE", 36, 121}, #endif #ifdef RAND_R_DRBG_ALREADY_INITIALIZED {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED}, #else - {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, 129}, + {"DRBG_ALREADY_INITIALIZED", 36, 129}, #endif #ifdef RAND_R_DRBG_NOT_INITIALISED {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED}, #else - {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, 104}, + {"DRBG_NOT_INITIALISED", 36, 104}, #endif #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG}, #else - {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, 106}, + {"ENTROPY_INPUT_TOO_LONG", 36, 106}, #endif #ifdef RAND_R_ENTROPY_OUT_OF_RANGE {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE}, #else - {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, 124}, + {"ENTROPY_OUT_OF_RANGE", 36, 124}, #endif #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED}, #else - {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, 127}, + {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127}, #endif #ifdef RAND_R_ERROR_INITIALISING_DRBG {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG}, #else - {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, 107}, + {"ERROR_INITIALISING_DRBG", 36, 107}, #endif #ifdef RAND_R_ERROR_INSTANTIATING_DRBG {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG}, #else - {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, 108}, + {"ERROR_INSTANTIATING_DRBG", 36, 108}, #endif #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT}, #else - {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, 109}, + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109}, #endif #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY}, #else - {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, 110}, + {"ERROR_RETRIEVING_ENTROPY", 36, 110}, #endif #ifdef RAND_R_ERROR_RETRIEVING_NONCE {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE}, #else - {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, 111}, + {"ERROR_RETRIEVING_NONCE", 36, 111}, #endif #ifdef RAND_R_FAILED_TO_CREATE_LOCK {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK}, #else - {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, 126}, + {"FAILED_TO_CREATE_LOCK", 36, 126}, #endif #ifdef RAND_R_FUNC_NOT_IMPLEMENTED {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED}, #else - {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, 101}, + {"FUNC_NOT_IMPLEMENTED", 36, 101}, #endif #ifdef RAND_R_FWRITE_ERROR {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR}, #else - {"FWRITE_ERROR", ERR_LIB_RAND, 123}, + {"FWRITE_ERROR", 36, 123}, #endif #ifdef RAND_R_GENERATE_ERROR {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR}, #else - {"GENERATE_ERROR", ERR_LIB_RAND, 112}, + {"GENERATE_ERROR", 36, 112}, #endif #ifdef RAND_R_INTERNAL_ERROR {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR}, #else - {"INTERNAL_ERROR", ERR_LIB_RAND, 113}, + {"INTERNAL_ERROR", 36, 113}, #endif #ifdef RAND_R_IN_ERROR_STATE {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE}, #else - {"IN_ERROR_STATE", ERR_LIB_RAND, 114}, + {"IN_ERROR_STATE", 36, 114}, #endif #ifdef RAND_R_NOT_A_REGULAR_FILE {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE}, #else - {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, 122}, + {"NOT_A_REGULAR_FILE", 36, 122}, #endif #ifdef RAND_R_NOT_INSTANTIATED {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED}, #else - {"NOT_INSTANTIATED", ERR_LIB_RAND, 115}, + {"NOT_INSTANTIATED", 36, 115}, #endif #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED}, #else - {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, 128}, + {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128}, #endif #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED}, #else - {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, 130}, + {"PARENT_LOCKING_NOT_ENABLED", 36, 130}, #endif #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK}, #else - {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, 131}, + {"PARENT_STRENGTH_TOO_WEAK", 36, 131}, #endif #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG}, #else - {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, 116}, + {"PERSONALISATION_STRING_TOO_LONG", 36, 116}, #endif #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED}, #else - {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, 133}, + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133}, #endif #ifdef RAND_R_PRNG_NOT_SEEDED {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED}, #else - {"PRNG_NOT_SEEDED", ERR_LIB_RAND, 100}, + {"PRNG_NOT_SEEDED", 36, 100}, #endif #ifdef RAND_R_RANDOM_POOL_OVERFLOW {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW}, #else - {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, 125}, + {"RANDOM_POOL_OVERFLOW", 36, 125}, #endif #ifdef RAND_R_RANDOM_POOL_UNDERFLOW {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW}, #else - {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, 134}, + {"RANDOM_POOL_UNDERFLOW", 36, 134}, #endif #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG}, #else - {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, 117}, + {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117}, #endif #ifdef RAND_R_RESEED_ERROR {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR}, #else - {"RESEED_ERROR", ERR_LIB_RAND, 118}, + {"RESEED_ERROR", 36, 118}, #endif #ifdef RAND_R_SELFTEST_FAILURE {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE}, #else - {"SELFTEST_FAILURE", ERR_LIB_RAND, 119}, + {"SELFTEST_FAILURE", 36, 119}, #endif #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED}, #else - {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, 135}, + {"TOO_LITTLE_NONCE_REQUESTED", 36, 135}, #endif #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED}, #else - {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, 136}, + {"TOO_MUCH_NONCE_REQUESTED", 36, 136}, #endif #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS}, #else - {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, 132}, + {"UNSUPPORTED_DRBG_FLAGS", 36, 132}, #endif #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE}, #else - {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, 120}, + {"UNSUPPORTED_DRBG_TYPE", 36, 120}, #endif #ifdef RSA_R_ALGORITHM_MISMATCH {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH}, #else - {"ALGORITHM_MISMATCH", ERR_LIB_RSA, 100}, + {"ALGORITHM_MISMATCH", 4, 100}, #endif #ifdef RSA_R_BAD_E_VALUE {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE}, #else - {"BAD_E_VALUE", ERR_LIB_RSA, 101}, + {"BAD_E_VALUE", 4, 101}, #endif #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT}, #else - {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, 102}, + {"BAD_FIXED_HEADER_DECRYPT", 4, 102}, #endif #ifdef RSA_R_BAD_PAD_BYTE_COUNT {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT}, #else - {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, 103}, + {"BAD_PAD_BYTE_COUNT", 4, 103}, #endif #ifdef RSA_R_BAD_SIGNATURE {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE}, #else - {"BAD_SIGNATURE", ERR_LIB_RSA, 104}, + {"BAD_SIGNATURE", 4, 104}, #endif #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01 {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01}, #else - {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, 106}, + {"BLOCK_TYPE_IS_NOT_01", 4, 106}, #endif #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02 {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02}, #else - {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, 107}, + {"BLOCK_TYPE_IS_NOT_02", 4, 107}, #endif #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN}, #else - {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, 108}, + {"DATA_GREATER_THAN_MOD_LEN", 4, 108}, #endif #ifdef RSA_R_DATA_TOO_LARGE {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE}, #else - {"DATA_TOO_LARGE", ERR_LIB_RSA, 109}, + {"DATA_TOO_LARGE", 4, 109}, #endif #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE}, #else - {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, 110}, + {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110}, #endif #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS}, #else - {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, 132}, + {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132}, #endif #ifdef RSA_R_DATA_TOO_SMALL {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL}, #else - {"DATA_TOO_SMALL", ERR_LIB_RSA, 111}, + {"DATA_TOO_SMALL", 4, 111}, #endif #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE}, #else - {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, 122}, + {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122}, #endif #ifdef RSA_R_DIGEST_DOES_NOT_MATCH {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH}, #else - {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, 158}, + {"DIGEST_DOES_NOT_MATCH", 4, 158}, #endif #ifdef RSA_R_DIGEST_NOT_ALLOWED {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED}, #else - {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 145}, + {"DIGEST_NOT_ALLOWED", 4, 145}, #endif #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY}, #else - {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, 112}, + {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112}, #endif #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D}, #else - {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 124}, + {"DMP1_NOT_CONGRUENT_TO_D", 4, 124}, #endif #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D}, #else - {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 125}, + {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125}, #endif #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1 {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1}, #else - {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, 123}, + {"D_E_NOT_CONGRUENT_TO_1", 4, 123}, #endif #ifdef RSA_R_FIRST_OCTET_INVALID {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID}, #else - {"FIRST_OCTET_INVALID", ERR_LIB_RSA, 133}, + {"FIRST_OCTET_INVALID", 4, 133}, #endif #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, #else - {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, 144}, + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144}, #endif #ifdef RSA_R_INVALID_DIGEST {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST}, #else - {"INVALID_DIGEST", ERR_LIB_RSA, 157}, + {"INVALID_DIGEST", 4, 157}, #endif #ifdef RSA_R_INVALID_DIGEST_LENGTH {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH}, #else - {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, 143}, + {"INVALID_DIGEST_LENGTH", 4, 143}, #endif #ifdef RSA_R_INVALID_HEADER {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER}, #else - {"INVALID_HEADER", ERR_LIB_RSA, 137}, + {"INVALID_HEADER", 4, 137}, #endif #ifdef RSA_R_INVALID_LABEL {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL}, #else - {"INVALID_LABEL", ERR_LIB_RSA, 160}, + {"INVALID_LABEL", 4, 160}, #endif #ifdef RSA_R_INVALID_MESSAGE_LENGTH {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH}, #else - {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, 131}, + {"INVALID_MESSAGE_LENGTH", 4, 131}, #endif #ifdef RSA_R_INVALID_MGF1_MD {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD}, #else - {"INVALID_MGF1_MD", ERR_LIB_RSA, 156}, + {"INVALID_MGF1_MD", 4, 156}, #endif #ifdef RSA_R_INVALID_MULTI_PRIME_KEY {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY}, #else - {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, 167}, + {"INVALID_MULTI_PRIME_KEY", 4, 167}, #endif #ifdef RSA_R_INVALID_OAEP_PARAMETERS {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS}, #else - {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, 161}, + {"INVALID_OAEP_PARAMETERS", 4, 161}, #endif #ifdef RSA_R_INVALID_PADDING {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING}, #else - {"INVALID_PADDING", ERR_LIB_RSA, 138}, + {"INVALID_PADDING", 4, 138}, #endif #ifdef RSA_R_INVALID_PADDING_MODE {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE}, #else - {"INVALID_PADDING_MODE", ERR_LIB_RSA, 141}, + {"INVALID_PADDING_MODE", 4, 141}, #endif #ifdef RSA_R_INVALID_PSS_PARAMETERS {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS}, #else - {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, 149}, + {"INVALID_PSS_PARAMETERS", 4, 149}, #endif #ifdef RSA_R_INVALID_PSS_SALTLEN {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN}, #else - {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, 146}, + {"INVALID_PSS_SALTLEN", 4, 146}, #endif #ifdef RSA_R_INVALID_SALT_LENGTH {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH}, #else - {"INVALID_SALT_LENGTH", ERR_LIB_RSA, 150}, + {"INVALID_SALT_LENGTH", 4, 150}, #endif #ifdef RSA_R_INVALID_TRAILER {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER}, #else - {"INVALID_TRAILER", ERR_LIB_RSA, 139}, + {"INVALID_TRAILER", 4, 139}, #endif #ifdef RSA_R_INVALID_X931_DIGEST {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST}, #else - {"INVALID_X931_DIGEST", ERR_LIB_RSA, 142}, + {"INVALID_X931_DIGEST", 4, 142}, #endif #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q}, #else - {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, 126}, + {"IQMP_NOT_INVERSE_OF_Q", 4, 126}, #endif #ifdef RSA_R_KEY_PRIME_NUM_INVALID {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID}, #else - {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, 165}, + {"KEY_PRIME_NUM_INVALID", 4, 165}, #endif #ifdef RSA_R_KEY_SIZE_TOO_SMALL {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL}, #else - {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, 120}, + {"KEY_SIZE_TOO_SMALL", 4, 120}, #endif #ifdef RSA_R_LAST_OCTET_INVALID {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID}, #else - {"LAST_OCTET_INVALID", ERR_LIB_RSA, 134}, + {"LAST_OCTET_INVALID", 4, 134}, #endif #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED}, #else - {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, 152}, + {"MGF1_DIGEST_NOT_ALLOWED", 4, 152}, #endif #ifdef RSA_R_MISSING_PRIVATE_KEY {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY}, #else - {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, 179}, + {"MISSING_PRIVATE_KEY", 4, 179}, #endif #ifdef RSA_R_MODULUS_TOO_LARGE {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE}, #else - {"MODULUS_TOO_LARGE", ERR_LIB_RSA, 105}, + {"MODULUS_TOO_LARGE", 4, 105}, #endif #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R}, #else - {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, 168}, + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168}, #endif #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D}, #else - {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, 169}, + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169}, #endif #ifdef RSA_R_MP_R_NOT_PRIME {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME}, #else - {"MP_R_NOT_PRIME", ERR_LIB_RSA, 170}, + {"MP_R_NOT_PRIME", 4, 170}, #endif #ifdef RSA_R_NO_PUBLIC_EXPONENT {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT}, #else - {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, 140}, + {"NO_PUBLIC_EXPONENT", 4, 140}, #endif #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING}, #else - {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, 113}, + {"NULL_BEFORE_BLOCK_MISSING", 4, 113}, #endif #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES}, #else - {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, 172}, + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172}, #endif #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q}, #else - {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, 127}, + {"N_DOES_NOT_EQUAL_P_Q", 4, 127}, #endif #ifdef RSA_R_OAEP_DECODING_ERROR {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR}, #else - {"OAEP_DECODING_ERROR", ERR_LIB_RSA, 121}, + {"OAEP_DECODING_ERROR", 4, 121}, #endif #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, #else - {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, 148}, + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148}, #endif #ifdef RSA_R_PADDING_CHECK_FAILED {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED}, #else - {"PADDING_CHECK_FAILED", ERR_LIB_RSA, 114}, + {"PADDING_CHECK_FAILED", 4, 114}, #endif #ifdef RSA_R_PKCS_DECODING_ERROR {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR}, #else - {"PKCS_DECODING_ERROR", ERR_LIB_RSA, 159}, + {"PKCS_DECODING_ERROR", 4, 159}, #endif #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL}, #else - {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, 164}, + {"PSS_SALTLEN_TOO_SMALL", 4, 164}, #endif #ifdef RSA_R_P_NOT_PRIME {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME}, #else - {"P_NOT_PRIME", ERR_LIB_RSA, 128}, + {"P_NOT_PRIME", 4, 128}, #endif #ifdef RSA_R_Q_NOT_PRIME {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME}, #else - {"Q_NOT_PRIME", ERR_LIB_RSA, 129}, + {"Q_NOT_PRIME", 4, 129}, #endif #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED}, #else - {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, 130}, + {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130}, #endif #ifdef RSA_R_SLEN_CHECK_FAILED {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED}, #else - {"SLEN_CHECK_FAILED", ERR_LIB_RSA, 136}, + {"SLEN_CHECK_FAILED", 4, 136}, #endif #ifdef RSA_R_SLEN_RECOVERY_FAILED {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED}, #else - {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, 135}, + {"SLEN_RECOVERY_FAILED", 4, 135}, #endif #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK}, #else - {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, 115}, + {"SSLV3_ROLLBACK_ATTACK", 4, 115}, #endif #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, #else - {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, 116}, + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116}, #endif #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE}, #else - {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, 117}, + {"UNKNOWN_ALGORITHM_TYPE", 4, 117}, #endif #ifdef RSA_R_UNKNOWN_DIGEST {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST}, #else - {"UNKNOWN_DIGEST", ERR_LIB_RSA, 166}, + {"UNKNOWN_DIGEST", 4, 166}, #endif #ifdef RSA_R_UNKNOWN_MASK_DIGEST {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST}, #else - {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, 151}, + {"UNKNOWN_MASK_DIGEST", 4, 151}, #endif #ifdef RSA_R_UNKNOWN_PADDING_TYPE {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE}, #else - {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, 118}, + {"UNKNOWN_PADDING_TYPE", 4, 118}, #endif #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE}, #else - {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, 162}, + {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162}, #endif #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE}, #else - {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, 163}, + {"UNSUPPORTED_LABEL_SOURCE", 4, 163}, #endif #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM}, #else - {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, 153}, + {"UNSUPPORTED_MASK_ALGORITHM", 4, 153}, #endif #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER}, #else - {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, 154}, + {"UNSUPPORTED_MASK_PARAMETER", 4, 154}, #endif #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE}, #else - {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, 155}, + {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155}, #endif #ifdef RSA_R_VALUE_MISSING {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING}, #else - {"VALUE_MISSING", ERR_LIB_RSA, 147}, + {"VALUE_MISSING", 4, 147}, #endif #ifdef RSA_R_WRONG_SIGNATURE_LENGTH {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH}, #else - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, 119}, + {"WRONG_SIGNATURE_LENGTH", 4, 119}, #endif #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY}, #else - {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, 291}, + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291}, #endif #ifdef SSL_R_APP_DATA_IN_HANDSHAKE {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, #else - {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, 100}, + {"APP_DATA_IN_HANDSHAKE", 20, 100}, #endif #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, #else - {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, 272}, + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272}, #endif #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE}, #else - {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, 143}, + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143}, #endif #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE}, #else - {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, 158}, + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158}, #endif #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, #else - {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, 103}, + {"BAD_CHANGE_CIPHER_SPEC", 20, 103}, #endif #ifdef SSL_R_BAD_CIPHER {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER}, #else - {"BAD_CIPHER", ERR_LIB_SSL, 186}, + {"BAD_CIPHER", 20, 186}, #endif #ifdef SSL_R_BAD_DATA {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, #else - {"BAD_DATA", ERR_LIB_SSL, 390}, + {"BAD_DATA", 20, 390}, #endif #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, #else - {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, 106}, + {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106}, #endif #ifdef SSL_R_BAD_DECOMPRESSION {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, #else - {"BAD_DECOMPRESSION", ERR_LIB_SSL, 107}, + {"BAD_DECOMPRESSION", 20, 107}, #endif #ifdef SSL_R_BAD_DH_VALUE {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE}, #else - {"BAD_DH_VALUE", ERR_LIB_SSL, 102}, + {"BAD_DH_VALUE", 20, 102}, #endif #ifdef SSL_R_BAD_DIGEST_LENGTH {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, #else - {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, 111}, + {"BAD_DIGEST_LENGTH", 20, 111}, #endif #ifdef SSL_R_BAD_EARLY_DATA {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA}, #else - {"BAD_EARLY_DATA", ERR_LIB_SSL, 233}, + {"BAD_EARLY_DATA", 20, 233}, #endif #ifdef SSL_R_BAD_ECC_CERT {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, #else - {"BAD_ECC_CERT", ERR_LIB_SSL, 304}, + {"BAD_ECC_CERT", 20, 304}, #endif #ifdef SSL_R_BAD_ECDSA_SIGNATURE {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_ECDSA_SIGNATURE}, #else - {"BAD_ECDSA_SIGNATURE", ERR_LIB_SSL, 305}, + {"BAD_ECDSA_SIGNATURE", 20, 305}, #endif #ifdef SSL_R_BAD_ECPOINT {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, #else - {"BAD_ECPOINT", ERR_LIB_SSL, 306}, + {"BAD_ECPOINT", 20, 306}, #endif #ifdef SSL_R_BAD_EXTENSION {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION}, #else - {"BAD_EXTENSION", ERR_LIB_SSL, 110}, + {"BAD_EXTENSION", 20, 110}, #endif #ifdef SSL_R_BAD_HANDSHAKE_LENGTH {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, #else - {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, 332}, + {"BAD_HANDSHAKE_LENGTH", 20, 332}, #endif #ifdef SSL_R_BAD_HANDSHAKE_STATE {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE}, #else - {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, 236}, + {"BAD_HANDSHAKE_STATE", 20, 236}, #endif #ifdef SSL_R_BAD_HELLO_REQUEST {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, #else - {"BAD_HELLO_REQUEST", ERR_LIB_SSL, 105}, + {"BAD_HELLO_REQUEST", 20, 105}, #endif #ifdef SSL_R_BAD_HRR_VERSION {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION}, #else - {"BAD_HRR_VERSION", ERR_LIB_SSL, 263}, + {"BAD_HRR_VERSION", 20, 263}, #endif #ifdef SSL_R_BAD_KEY_SHARE {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE}, #else - {"BAD_KEY_SHARE", ERR_LIB_SSL, 108}, + {"BAD_KEY_SHARE", 20, 108}, #endif #ifdef SSL_R_BAD_KEY_UPDATE {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE}, #else - {"BAD_KEY_UPDATE", ERR_LIB_SSL, 122}, + {"BAD_KEY_UPDATE", 20, 122}, #endif #ifdef SSL_R_BAD_LEGACY_VERSION {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION}, #else - {"BAD_LEGACY_VERSION", ERR_LIB_SSL, 292}, + {"BAD_LEGACY_VERSION", 20, 292}, #endif #ifdef SSL_R_BAD_LENGTH {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, #else - {"BAD_LENGTH", ERR_LIB_SSL, 271}, + {"BAD_LENGTH", 20, 271}, #endif #ifdef SSL_R_BAD_MAC_LENGTH {"BAD_MAC_LENGTH", ERR_LIB_SSL, SSL_R_BAD_MAC_LENGTH}, #else - {"BAD_MAC_LENGTH", ERR_LIB_SSL, 333}, + {"BAD_MAC_LENGTH", 20, 333}, #endif #ifdef SSL_R_BAD_PACKET {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET}, #else - {"BAD_PACKET", ERR_LIB_SSL, 240}, + {"BAD_PACKET", 20, 240}, #endif #ifdef SSL_R_BAD_PACKET_LENGTH {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, #else - {"BAD_PACKET_LENGTH", ERR_LIB_SSL, 115}, + {"BAD_PACKET_LENGTH", 20, 115}, #endif #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, #else - {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, 116}, + {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116}, #endif #ifdef SSL_R_BAD_PSK {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK}, #else - {"BAD_PSK", ERR_LIB_SSL, 219}, + {"BAD_PSK", 20, 219}, #endif #ifdef SSL_R_BAD_PSK_IDENTITY {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY}, #else - {"BAD_PSK_IDENTITY", ERR_LIB_SSL, 114}, + {"BAD_PSK_IDENTITY", 20, 114}, #endif #ifdef SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH}, #else - {"BAD_PSK_IDENTITY_HINT_LENGTH", ERR_LIB_SSL, 316}, + {"BAD_PSK_IDENTITY_HINT_LENGTH", 20, 316}, #endif #ifdef SSL_R_BAD_RECORD_TYPE {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE}, #else - {"BAD_RECORD_TYPE", ERR_LIB_SSL, 443}, + {"BAD_RECORD_TYPE", 20, 443}, #endif #ifdef SSL_R_BAD_RSA_ENCRYPT {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, #else - {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, 119}, + {"BAD_RSA_ENCRYPT", 20, 119}, #endif #ifdef SSL_R_BAD_SIGNATURE {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, #else - {"BAD_SIGNATURE", ERR_LIB_SSL, 123}, + {"BAD_SIGNATURE", 20, 123}, #endif #ifdef SSL_R_BAD_SRP_A_LENGTH {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, #else - {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, 347}, + {"BAD_SRP_A_LENGTH", 20, 347}, #endif #ifdef SSL_R_BAD_SRP_B_LENGTH {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_B_LENGTH}, #else - {"BAD_SRP_B_LENGTH", ERR_LIB_SSL, 348}, + {"BAD_SRP_B_LENGTH", 20, 348}, #endif #ifdef SSL_R_BAD_SRP_G_LENGTH {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_G_LENGTH}, #else - {"BAD_SRP_G_LENGTH", ERR_LIB_SSL, 349}, + {"BAD_SRP_G_LENGTH", 20, 349}, #endif #ifdef SSL_R_BAD_SRP_N_LENGTH {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_N_LENGTH}, #else - {"BAD_SRP_N_LENGTH", ERR_LIB_SSL, 350}, + {"BAD_SRP_N_LENGTH", 20, 350}, #endif #ifdef SSL_R_BAD_SRP_PARAMETERS {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, #else - {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, 371}, + {"BAD_SRP_PARAMETERS", 20, 371}, #endif #ifdef SSL_R_BAD_SRP_S_LENGTH {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_S_LENGTH}, #else - {"BAD_SRP_S_LENGTH", ERR_LIB_SSL, 351}, + {"BAD_SRP_S_LENGTH", 20, 351}, #endif #ifdef SSL_R_BAD_SRTP_MKI_VALUE {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, #else - {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, 352}, + {"BAD_SRTP_MKI_VALUE", 20, 352}, #endif #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, #else - {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 353}, + {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353}, #endif #ifdef SSL_R_BAD_SSL_FILETYPE {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, #else - {"BAD_SSL_FILETYPE", ERR_LIB_SSL, 124}, + {"BAD_SSL_FILETYPE", 20, 124}, #endif #ifdef SSL_R_BAD_VALUE {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, #else - {"BAD_VALUE", ERR_LIB_SSL, 384}, + {"BAD_VALUE", 20, 384}, #endif #ifdef SSL_R_BAD_WRITE_RETRY {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, #else - {"BAD_WRITE_RETRY", ERR_LIB_SSL, 127}, + {"BAD_WRITE_RETRY", 20, 127}, #endif #ifdef SSL_R_BINDER_DOES_NOT_VERIFY {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY}, #else - {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, 253}, + {"BINDER_DOES_NOT_VERIFY", 20, 253}, #endif #ifdef SSL_R_BIO_NOT_SET {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, #else - {"BIO_NOT_SET", ERR_LIB_SSL, 128}, + {"BIO_NOT_SET", 20, 128}, #endif #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, #else - {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, 129}, + {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129}, #endif #ifdef SSL_R_BN_LIB {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, #else - {"BN_LIB", ERR_LIB_SSL, 130}, + {"BN_LIB", 20, 130}, #endif #ifdef SSL_R_CALLBACK_FAILED {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED}, #else - {"CALLBACK_FAILED", ERR_LIB_SSL, 234}, + {"CALLBACK_FAILED", 20, 234}, #endif #ifdef SSL_R_CANNOT_CHANGE_CIPHER {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER}, #else - {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, 109}, + {"CANNOT_CHANGE_CIPHER", 20, 109}, #endif #ifdef SSL_R_CA_DN_LENGTH_MISMATCH {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, #else - {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, 131}, + {"CA_DN_LENGTH_MISMATCH", 20, 131}, #endif #ifdef SSL_R_CA_KEY_TOO_SMALL {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, #else - {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, 397}, + {"CA_KEY_TOO_SMALL", 20, 397}, #endif #ifdef SSL_R_CA_MD_TOO_WEAK {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, #else - {"CA_MD_TOO_WEAK", ERR_LIB_SSL, 398}, + {"CA_MD_TOO_WEAK", 20, 398}, #endif #ifdef SSL_R_CCS_RECEIVED_EARLY {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, #else - {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, 133}, + {"CCS_RECEIVED_EARLY", 20, 133}, #endif #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, #else - {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, 134}, + {"CERTIFICATE_VERIFY_FAILED", 20, 134}, #endif #ifdef SSL_R_CERT_CB_ERROR {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, #else - {"CERT_CB_ERROR", ERR_LIB_SSL, 377}, + {"CERT_CB_ERROR", 20, 377}, #endif #ifdef SSL_R_CERT_LENGTH_MISMATCH {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, #else - {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, 135}, + {"CERT_LENGTH_MISMATCH", 20, 135}, #endif #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED}, #else - {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, 218}, + {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218}, #endif #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, #else - {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, 137}, + {"CIPHER_CODE_WRONG_LENGTH", 20, 137}, #endif #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, #else - {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, 138}, + {"CIPHER_OR_HASH_UNAVAILABLE", 20, 138}, #endif #ifdef SSL_R_CLIENTHELLO_TLSEXT {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, #else - {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, 226}, + {"CLIENTHELLO_TLSEXT", 20, 226}, #endif #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, #else - {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, 140}, + {"COMPRESSED_LENGTH_TOO_LONG", 20, 140}, #endif #ifdef SSL_R_COMPRESSION_DISABLED {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, #else - {"COMPRESSION_DISABLED", ERR_LIB_SSL, 343}, + {"COMPRESSION_DISABLED", 20, 343}, #endif #ifdef SSL_R_COMPRESSION_FAILURE {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, #else - {"COMPRESSION_FAILURE", ERR_LIB_SSL, 141}, + {"COMPRESSION_FAILURE", 20, 141}, #endif #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, #else - {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, 307}, + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307}, #endif #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, #else - {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, 142}, + {"COMPRESSION_LIBRARY_ERROR", 20, 142}, #endif #ifdef SSL_R_CONNECTION_TYPE_NOT_SET {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, #else - {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, 144}, + {"CONNECTION_TYPE_NOT_SET", 20, 144}, #endif #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED}, #else - {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, 167}, + {"CONTEXT_NOT_DANE_ENABLED", 20, 167}, #endif #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE}, #else - {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, 400}, + {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400}, #endif #ifdef SSL_R_COOKIE_MISMATCH {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, #else - {"COOKIE_MISMATCH", ERR_LIB_SSL, 308}, + {"COOKIE_MISMATCH", 20, 308}, #endif #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED}, #else - {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, 206}, + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206}, #endif #ifdef SSL_R_DANE_ALREADY_ENABLED {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED}, #else - {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, 172}, + {"DANE_ALREADY_ENABLED", 20, 172}, #endif #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL}, #else - {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, 173}, + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173}, #endif #ifdef SSL_R_DANE_NOT_ENABLED {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED}, #else - {"DANE_NOT_ENABLED", ERR_LIB_SSL, 175}, + {"DANE_NOT_ENABLED", 20, 175}, #endif #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE}, #else - {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, 180}, + {"DANE_TLSA_BAD_CERTIFICATE", 20, 180}, #endif #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE}, #else - {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, 184}, + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184}, #endif #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH}, #else - {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, 189}, + {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189}, #endif #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH}, #else - {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, 192}, + {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192}, #endif #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE}, #else - {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, 200}, + {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200}, #endif #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY}, #else - {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, 201}, + {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201}, #endif #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR}, #else - {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, 202}, + {"DANE_TLSA_BAD_SELECTOR", 20, 202}, #endif #ifdef SSL_R_DANE_TLSA_NULL_DATA {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA}, #else - {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, 203}, + {"DANE_TLSA_NULL_DATA", 20, 203}, #endif #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, #else - {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, 145}, + {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145}, #endif #ifdef SSL_R_DATA_LENGTH_TOO_LONG {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, #else - {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, 146}, + {"DATA_LENGTH_TOO_LONG", 20, 146}, #endif #ifdef SSL_R_DECRYPTION_FAILED {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, #else - {"DECRYPTION_FAILED", ERR_LIB_SSL, 147}, + {"DECRYPTION_FAILED", 20, 147}, #endif #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, #else - {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, 281}, + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281}, #endif #ifdef SSL_R_DH_KEY_TOO_SMALL {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, #else - {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, 394}, + {"DH_KEY_TOO_SMALL", 20, 394}, #endif #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, #else - {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, 148}, + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148}, #endif #ifdef SSL_R_DIGEST_CHECK_FAILED {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, #else - {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, 149}, + {"DIGEST_CHECK_FAILED", 20, 149}, #endif #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, #else - {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, 334}, + {"DTLS_MESSAGE_TOO_BIG", 20, 334}, #endif #ifdef SSL_R_DUPLICATE_COMPRESSION_ID {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, #else - {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, 309}, + {"DUPLICATE_COMPRESSION_ID", 20, 309}, #endif #ifdef SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT}, #else - {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", ERR_LIB_SSL, 317}, + {"ECC_CERT_NOT_FOR_KEY_AGREEMENT", 20, 317}, #endif #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, #else - {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, 318}, + {"ECC_CERT_NOT_FOR_SIGNING", 20, 318}, #endif #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE}, #else - {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", ERR_LIB_SSL, 322}, + {"ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE", 20, 322}, #endif #ifdef SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE}, #else - {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", ERR_LIB_SSL, 323}, + {"ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE", 20, 323}, #endif #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, #else - {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, 374}, + {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374}, #endif #ifdef SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER}, #else - {"ECGROUP_TOO_LARGE_FOR_CIPHER", ERR_LIB_SSL, 310}, + {"ECGROUP_TOO_LARGE_FOR_CIPHER", 20, 310}, #endif #ifdef SSL_R_EE_KEY_TOO_SMALL {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, #else - {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, 399}, + {"EE_KEY_TOO_SMALL", 20, 399}, #endif #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, #else - {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, 354}, + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354}, #endif #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, #else - {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, 150}, + {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150}, #endif #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, #else - {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, 151}, + {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151}, #endif #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN}, #else - {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, 204}, + {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204}, #endif #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE}, #else - {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, 194}, + {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194}, #endif #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, #else - {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, 152}, + {"EXCESSIVE_MESSAGE_SIZE", 20, 152}, #endif #ifdef SSL_R_EXTENSION_NOT_RECEIVED {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED}, #else - {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, 279}, + {"EXTENSION_NOT_RECEIVED", 20, 279}, #endif #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, #else - {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, 153}, + {"EXTRA_DATA_IN_MESSAGE", 20, 153}, #endif #ifdef SSL_R_EXT_LENGTH_MISMATCH {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH}, #else - {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, 163}, + {"EXT_LENGTH_MISMATCH", 20, 163}, #endif #ifdef SSL_R_FAILED_TO_INIT_ASYNC {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC}, #else - {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, 405}, + {"FAILED_TO_INIT_ASYNC", 20, 405}, #endif #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO}, #else - {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, 401}, + {"FRAGMENTED_CLIENT_HELLO", 20, 401}, #endif #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, #else - {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, 154}, + {"GOT_A_FIN_BEFORE_A_CCS", 20, 154}, #endif #ifdef SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS}, #else - {"GOT_NEXT_PROTO_BEFORE_A_CCS", ERR_LIB_SSL, 355}, + {"GOT_NEXT_PROTO_BEFORE_A_CCS", 20, 355}, #endif #ifdef SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION}, #else - {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", ERR_LIB_SSL, 356}, + {"GOT_NEXT_PROTO_WITHOUT_EXTENSION", 20, 356}, #endif #ifdef SSL_R_HTTPS_PROXY_REQUEST {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, #else - {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, 155}, + {"HTTPS_PROXY_REQUEST", 20, 155}, #endif #ifdef SSL_R_HTTP_REQUEST {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, #else - {"HTTP_REQUEST", ERR_LIB_SSL, 156}, + {"HTTP_REQUEST", 20, 156}, #endif #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION}, #else - {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, 162}, + {"ILLEGAL_POINT_COMPRESSION", 20, 162}, #endif #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, #else - {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, 380}, + {"ILLEGAL_SUITEB_DIGEST", 20, 380}, #endif #ifdef SSL_R_INAPPROPRIATE_FALLBACK {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, #else - {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 373}, + {"INAPPROPRIATE_FALLBACK", 20, 373}, #endif #ifdef SSL_R_INCONSISTENT_COMPRESSION {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, #else - {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, 340}, + {"INCONSISTENT_COMPRESSION", 20, 340}, #endif #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN}, #else - {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, 222}, + {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222}, #endif #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI}, #else - {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, 231}, + {"INCONSISTENT_EARLY_DATA_SNI", 20, 231}, #endif #ifdef SSL_R_INCONSISTENT_EXTMS {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS}, #else - {"INCONSISTENT_EXTMS", ERR_LIB_SSL, 104}, + {"INCONSISTENT_EXTMS", 20, 104}, #endif #ifdef SSL_R_INSUFFICIENT_SECURITY {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY}, #else - {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, 241}, + {"INSUFFICIENT_SECURITY", 20, 241}, #endif #ifdef SSL_R_INVALID_ALERT {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT}, #else - {"INVALID_ALERT", ERR_LIB_SSL, 205}, + {"INVALID_ALERT", 20, 205}, #endif #ifdef SSL_R_INVALID_CCS_MESSAGE {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE}, #else - {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, 260}, + {"INVALID_CCS_MESSAGE", 20, 260}, #endif #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG}, #else - {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, 238}, + {"INVALID_CERTIFICATE_OR_ALG", 20, 238}, #endif #ifdef SSL_R_INVALID_COMMAND {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, #else - {"INVALID_COMMAND", ERR_LIB_SSL, 280}, + {"INVALID_COMMAND", 20, 280}, #endif #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, #else - {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 341}, + {"INVALID_COMPRESSION_ALGORITHM", 20, 341}, #endif #ifdef SSL_R_INVALID_CONFIG {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG}, #else - {"INVALID_CONFIG", ERR_LIB_SSL, 283}, + {"INVALID_CONFIG", 20, 283}, #endif #ifdef SSL_R_INVALID_CONFIGURATION_NAME {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME}, #else - {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, 113}, + {"INVALID_CONFIGURATION_NAME", 20, 113}, #endif #ifdef SSL_R_INVALID_CONTEXT {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT}, #else - {"INVALID_CONTEXT", ERR_LIB_SSL, 282}, + {"INVALID_CONTEXT", 20, 282}, #endif #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE}, #else - {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, 212}, + {"INVALID_CT_VALIDATION_TYPE", 20, 212}, #endif #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE}, #else - {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, 120}, + {"INVALID_KEY_UPDATE_TYPE", 20, 120}, #endif #ifdef SSL_R_INVALID_MAX_EARLY_DATA {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA}, #else - {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, 174}, + {"INVALID_MAX_EARLY_DATA", 20, 174}, #endif #ifdef SSL_R_INVALID_NULL_CMD_NAME {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, #else - {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, 385}, + {"INVALID_NULL_CMD_NAME", 20, 385}, #endif #ifdef SSL_R_INVALID_SEQUENCE_NUMBER {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER}, #else - {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, 402}, + {"INVALID_SEQUENCE_NUMBER", 20, 402}, #endif #ifdef SSL_R_INVALID_SERVERINFO_DATA {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, #else - {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, 388}, + {"INVALID_SERVERINFO_DATA", 20, 388}, #endif #ifdef SSL_R_INVALID_SESSION_ID {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID}, #else - {"INVALID_SESSION_ID", ERR_LIB_SSL, 999}, + {"INVALID_SESSION_ID", 20, 999}, #endif #ifdef SSL_R_INVALID_SRP_USERNAME {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, #else - {"INVALID_SRP_USERNAME", ERR_LIB_SSL, 357}, + {"INVALID_SRP_USERNAME", 20, 357}, #endif #ifdef SSL_R_INVALID_STATUS_RESPONSE {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, #else - {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, 328}, + {"INVALID_STATUS_RESPONSE", 20, 328}, #endif #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, #else - {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, 325}, + {"INVALID_TICKET_KEYS_LENGTH", 20, 325}, #endif #ifdef SSL_R_KRB5_S_TKT_NYV {"KRB5_S_TKT_NYV", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_NYV}, #else - {"KRB5_S_TKT_NYV", ERR_LIB_SSL, 294}, + {"KRB5_S_TKT_NYV", 20, 294}, #endif #ifdef SSL_R_KRB5_S_TKT_SKEW {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, SSL_R_KRB5_S_TKT_SKEW}, #else - {"KRB5_S_TKT_SKEW", ERR_LIB_SSL, 295}, + {"KRB5_S_TKT_SKEW", 20, 295}, #endif #ifdef SSL_R_LENGTH_MISMATCH {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, #else - {"LENGTH_MISMATCH", ERR_LIB_SSL, 159}, + {"LENGTH_MISMATCH", 20, 159}, #endif #ifdef SSL_R_LENGTH_TOO_LONG {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG}, #else - {"LENGTH_TOO_LONG", ERR_LIB_SSL, 404}, + {"LENGTH_TOO_LONG", 20, 404}, #endif #ifdef SSL_R_LENGTH_TOO_SHORT {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, #else - {"LENGTH_TOO_SHORT", ERR_LIB_SSL, 160}, + {"LENGTH_TOO_SHORT", 20, 160}, #endif #ifdef SSL_R_LIBRARY_BUG {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, #else - {"LIBRARY_BUG", ERR_LIB_SSL, 274}, + {"LIBRARY_BUG", 20, 274}, #endif #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, #else - {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 161}, + {"LIBRARY_HAS_NO_CIPHERS", 20, 161}, #endif #ifdef SSL_R_MESSAGE_TOO_LONG {"MESSAGE_TOO_LONG", ERR_LIB_SSL, SSL_R_MESSAGE_TOO_LONG}, #else - {"MESSAGE_TOO_LONG", ERR_LIB_SSL, 296}, + {"MESSAGE_TOO_LONG", 20, 296}, #endif #ifdef SSL_R_MISSING_DSA_SIGNING_CERT {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, #else - {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, 165}, + {"MISSING_DSA_SIGNING_CERT", 20, 165}, #endif #ifdef SSL_R_MISSING_ECDH_CERT {"MISSING_ECDH_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDH_CERT}, #else - {"MISSING_ECDH_CERT", ERR_LIB_SSL, 382}, + {"MISSING_ECDH_CERT", 20, 382}, #endif #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, #else - {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, 381}, + {"MISSING_ECDSA_SIGNING_CERT", 20, 381}, #endif #ifdef SSL_R_MISSING_FATAL {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL}, #else - {"MISSING_FATAL", ERR_LIB_SSL, 256}, + {"MISSING_FATAL", 20, 256}, #endif #ifdef SSL_R_MISSING_PARAMETERS {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS}, #else - {"MISSING_PARAMETERS", ERR_LIB_SSL, 290}, + {"MISSING_PARAMETERS", 20, 290}, #endif #ifdef SSL_R_MISSING_RSA_CERTIFICATE {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, #else - {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, 168}, + {"MISSING_RSA_CERTIFICATE", 20, 168}, #endif #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, #else - {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, 169}, + {"MISSING_RSA_ENCRYPTING_CERT", 20, 169}, #endif #ifdef SSL_R_MISSING_RSA_SIGNING_CERT {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, #else - {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, 170}, + {"MISSING_RSA_SIGNING_CERT", 20, 170}, #endif #ifdef SSL_R_MISSING_SIGALGS_EXTENSION {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION}, #else - {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, 112}, + {"MISSING_SIGALGS_EXTENSION", 20, 112}, #endif #ifdef SSL_R_MISSING_SIGNING_CERT {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT}, #else - {"MISSING_SIGNING_CERT", ERR_LIB_SSL, 221}, + {"MISSING_SIGNING_CERT", 20, 221}, #endif #ifdef SSL_R_MISSING_SRP_PARAM {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, #else - {"MISSING_SRP_PARAM", ERR_LIB_SSL, 358}, + {"MISSING_SRP_PARAM", 20, 358}, #endif #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION}, #else - {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, 209}, + {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209}, #endif #ifdef SSL_R_MISSING_TMP_DH_KEY {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, #else - {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, 171}, + {"MISSING_TMP_DH_KEY", 20, 171}, #endif #ifdef SSL_R_MISSING_TMP_ECDH_KEY {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, #else - {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, 311}, + {"MISSING_TMP_ECDH_KEY", 20, 311}, #endif #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA}, #else - {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, 293}, + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293}, #endif #ifdef SSL_R_MULTIPLE_SGC_RESTARTS {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, SSL_R_MULTIPLE_SGC_RESTARTS}, #else - {"MULTIPLE_SGC_RESTARTS", ERR_LIB_SSL, 346}, + {"MULTIPLE_SGC_RESTARTS", 20, 346}, #endif #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY}, #else - {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, 182}, + {"NOT_ON_RECORD_BOUNDARY", 20, 182}, #endif #ifdef SSL_R_NOT_REPLACING_CERTIFICATE {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE}, #else - {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, 289}, + {"NOT_REPLACING_CERTIFICATE", 20, 289}, #endif #ifdef SSL_R_NOT_SERVER {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER}, #else - {"NOT_SERVER", ERR_LIB_SSL, 284}, + {"NOT_SERVER", 20, 284}, #endif #ifdef SSL_R_NO_APPLICATION_PROTOCOL {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL}, #else - {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, 235}, + {"NO_APPLICATION_PROTOCOL", 20, 235}, #endif #ifdef SSL_R_NO_CERTIFICATES_RETURNED {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, #else - {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, 176}, + {"NO_CERTIFICATES_RETURNED", 20, 176}, #endif #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, #else - {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, 177}, + {"NO_CERTIFICATE_ASSIGNED", 20, 177}, #endif #ifdef SSL_R_NO_CERTIFICATE_SET {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, #else - {"NO_CERTIFICATE_SET", ERR_LIB_SSL, 179}, + {"NO_CERTIFICATE_SET", 20, 179}, #endif #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR}, #else - {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, 214}, + {"NO_CHANGE_FOLLOWING_HRR", 20, 214}, #endif #ifdef SSL_R_NO_CIPHERS_AVAILABLE {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, #else - {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, 181}, + {"NO_CIPHERS_AVAILABLE", 20, 181}, #endif #ifdef SSL_R_NO_CIPHERS_SPECIFIED {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, #else - {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, 183}, + {"NO_CIPHERS_SPECIFIED", 20, 183}, #endif #ifdef SSL_R_NO_CIPHER_MATCH {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, #else - {"NO_CIPHER_MATCH", ERR_LIB_SSL, 185}, + {"NO_CIPHER_MATCH", 20, 185}, #endif #ifdef SSL_R_NO_CLIENT_CERT_METHOD {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, #else - {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, 331}, + {"NO_CLIENT_CERT_METHOD", 20, 331}, #endif #ifdef SSL_R_NO_COMPRESSION_SPECIFIED {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, #else - {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, 187}, + {"NO_COMPRESSION_SPECIFIED", 20, 187}, #endif #ifdef SSL_R_NO_COOKIE_CALLBACK_SET {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET}, #else - {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, 287}, + {"NO_COOKIE_CALLBACK_SET", 20, 287}, #endif #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, #else - {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, 330}, + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330}, #endif #ifdef SSL_R_NO_METHOD_SPECIFIED {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, #else - {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, 188}, + {"NO_METHOD_SPECIFIED", 20, 188}, #endif #ifdef SSL_R_NO_PEM_EXTENSIONS {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, #else - {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, 389}, + {"NO_PEM_EXTENSIONS", 20, 389}, #endif #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, #else - {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, 190}, + {"NO_PRIVATE_KEY_ASSIGNED", 20, 190}, #endif #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, #else - {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, 191}, + {"NO_PROTOCOLS_AVAILABLE", 20, 191}, #endif #ifdef SSL_R_NO_RENEGOTIATION {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, #else - {"NO_RENEGOTIATION", ERR_LIB_SSL, 339}, + {"NO_RENEGOTIATION", 20, 339}, #endif #ifdef SSL_R_NO_REQUIRED_DIGEST {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, #else - {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, 324}, + {"NO_REQUIRED_DIGEST", 20, 324}, #endif #ifdef SSL_R_NO_SHARED_CIPHER {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, #else - {"NO_SHARED_CIPHER", ERR_LIB_SSL, 193}, + {"NO_SHARED_CIPHER", 20, 193}, #endif #ifdef SSL_R_NO_SHARED_GROUPS {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS}, #else - {"NO_SHARED_GROUPS", ERR_LIB_SSL, 410}, + {"NO_SHARED_GROUPS", 20, 410}, #endif #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS}, #else - {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, 376}, + {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376}, #endif #ifdef SSL_R_NO_SRTP_PROFILES {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, #else - {"NO_SRTP_PROFILES", ERR_LIB_SSL, 359}, + {"NO_SRTP_PROFILES", 20, 359}, #endif #ifdef SSL_R_NO_SUITABLE_KEY_SHARE {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE}, #else - {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, 101}, + {"NO_SUITABLE_KEY_SHARE", 20, 101}, #endif #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM}, #else - {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, 118}, + {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118}, #endif #ifdef SSL_R_NO_VALID_SCTS {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS}, #else - {"NO_VALID_SCTS", ERR_LIB_SSL, 216}, + {"NO_VALID_SCTS", 20, 216}, #endif #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK}, #else - {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, 403}, + {"NO_VERIFY_COOKIE_CALLBACK", 20, 403}, #endif #ifdef SSL_R_NULL_SSL_CTX {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, #else - {"NULL_SSL_CTX", ERR_LIB_SSL, 195}, + {"NULL_SSL_CTX", 20, 195}, #endif #ifdef SSL_R_NULL_SSL_METHOD_PASSED {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, #else - {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, 196}, + {"NULL_SSL_METHOD_PASSED", 20, 196}, #endif #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, #else - {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, 197}, + {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197}, #endif #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, #else - {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, 344}, + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344}, #endif #ifdef SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE}, #else - {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 387}, + {"ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 387}, #endif #ifdef SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE}, #else - {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", ERR_LIB_SSL, 379}, + {"ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE", 20, 379}, #endif #ifdef SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE}, #else - {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", ERR_LIB_SSL, 297}, + {"ONLY_TLS_ALLOWED_IN_FIPS_MODE", 20, 297}, #endif #ifdef SSL_R_OPAQUE_PRF_INPUT_TOO_LONG {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, SSL_R_OPAQUE_PRF_INPUT_TOO_LONG}, #else - {"OPAQUE_PRF_INPUT_TOO_LONG", ERR_LIB_SSL, 327}, + {"OPAQUE_PRF_INPUT_TOO_LONG", 20, 327}, #endif #ifdef SSL_R_OVERFLOW_ERROR {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR}, #else - {"OVERFLOW_ERROR", ERR_LIB_SSL, 237}, + {"OVERFLOW_ERROR", 20, 237}, #endif #ifdef SSL_R_PACKET_LENGTH_TOO_LONG {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, #else - {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, 198}, + {"PACKET_LENGTH_TOO_LONG", 20, 198}, #endif #ifdef SSL_R_PARSE_TLSEXT {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, #else - {"PARSE_TLSEXT", ERR_LIB_SSL, 227}, + {"PARSE_TLSEXT", 20, 227}, #endif #ifdef SSL_R_PATH_TOO_LONG {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, #else - {"PATH_TOO_LONG", ERR_LIB_SSL, 270}, + {"PATH_TOO_LONG", 20, 270}, #endif #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, #else - {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, 199}, + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199}, #endif #ifdef SSL_R_PEM_NAME_BAD_PREFIX {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, #else - {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, 391}, + {"PEM_NAME_BAD_PREFIX", 20, 391}, #endif #ifdef SSL_R_PEM_NAME_TOO_SHORT {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, #else - {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, 392}, + {"PEM_NAME_TOO_SHORT", 20, 392}, #endif #ifdef SSL_R_PIPELINE_FAILURE {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE}, #else - {"PIPELINE_FAILURE", ERR_LIB_SSL, 406}, + {"PIPELINE_FAILURE", 20, 406}, #endif #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR}, #else - {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, 278}, + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278}, #endif #ifdef SSL_R_PRIVATE_KEY_MISMATCH {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH}, #else - {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, 288}, + {"PRIVATE_KEY_MISMATCH", 20, 288}, #endif #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, #else - {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, 207}, + {"PROTOCOL_IS_SHUTDOWN", 20, 207}, #endif #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, #else - {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, 223}, + {"PSK_IDENTITY_NOT_FOUND", 20, 223}, #endif #ifdef SSL_R_PSK_NO_CLIENT_CB {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, #else - {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, 224}, + {"PSK_NO_CLIENT_CB", 20, 224}, #endif #ifdef SSL_R_PSK_NO_SERVER_CB {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, #else - {"PSK_NO_SERVER_CB", ERR_LIB_SSL, 225}, + {"PSK_NO_SERVER_CB", 20, 225}, #endif #ifdef SSL_R_READ_BIO_NOT_SET {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, #else - {"READ_BIO_NOT_SET", ERR_LIB_SSL, 211}, + {"READ_BIO_NOT_SET", 20, 211}, #endif #ifdef SSL_R_READ_TIMEOUT_EXPIRED {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, #else - {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, 312}, + {"READ_TIMEOUT_EXPIRED", 20, 312}, #endif #ifdef SSL_R_RECORD_LENGTH_MISMATCH {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, #else - {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, 213}, + {"RECORD_LENGTH_MISMATCH", 20, 213}, #endif #ifdef SSL_R_RECORD_TOO_SMALL {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, #else - {"RECORD_TOO_SMALL", ERR_LIB_SSL, 298}, + {"RECORD_TOO_SMALL", 20, 298}, #endif #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, #else - {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, 335}, + {"RENEGOTIATE_EXT_TOO_LONG", 20, 335}, #endif #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, #else - {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, 336}, + {"RENEGOTIATION_ENCODING_ERR", 20, 336}, #endif #ifdef SSL_R_RENEGOTIATION_MISMATCH {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, #else - {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, 337}, + {"RENEGOTIATION_MISMATCH", 20, 337}, #endif #ifdef SSL_R_REQUEST_PENDING {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING}, #else - {"REQUEST_PENDING", ERR_LIB_SSL, 285}, + {"REQUEST_PENDING", 20, 285}, #endif #ifdef SSL_R_REQUEST_SENT {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT}, #else - {"REQUEST_SENT", ERR_LIB_SSL, 286}, + {"REQUEST_SENT", 20, 286}, #endif #ifdef SSL_R_REQUIRED_CIPHER_MISSING {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, #else - {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, 215}, + {"REQUIRED_CIPHER_MISSING", 20, 215}, #endif #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING}, #else - {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, 342}, + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342}, #endif #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, #else - {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, 345}, + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345}, #endif #ifdef SSL_R_SCT_VERIFICATION_FAILED {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED}, #else - {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, 208}, + {"SCT_VERIFICATION_FAILED", 20, 208}, #endif #ifdef SSL_R_SERVERHELLO_TLSEXT {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, #else - {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, 275}, + {"SERVERHELLO_TLSEXT", 20, 275}, #endif #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, #else - {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, 277}, + {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277}, #endif #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT}, #else - {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, 407}, + {"SHUTDOWN_WHILE_IN_INIT", 20, 407}, #endif #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, #else - {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, 360}, + {"SIGNATURE_ALGORITHMS_ERROR", 20, 360}, #endif #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, #else - {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, 220}, + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220}, #endif #ifdef SSL_R_SRP_A_CALC {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, #else - {"SRP_A_CALC", ERR_LIB_SSL, 361}, + {"SRP_A_CALC", 20, 361}, #endif #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, #else - {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, 362}, + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362}, #endif #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, #else - {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, 363}, + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363}, #endif #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, #else - {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, 364}, + {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364}, #endif #ifdef SSL_R_SSL2_CONNECTION_ID_TOO_LONG {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL2_CONNECTION_ID_TOO_LONG}, #else - {"SSL2_CONNECTION_ID_TOO_LONG", ERR_LIB_SSL, 299}, + {"SSL2_CONNECTION_ID_TOO_LONG", 20, 299}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT}, #else - {"SSL3_EXT_INVALID_ECPOINTFORMAT", ERR_LIB_SSL, 321}, + {"SSL3_EXT_INVALID_ECPOINTFORMAT", 20, 321}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH}, #else - {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, 232}, + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, #else - {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, 319}, + {"SSL3_EXT_INVALID_SERVERNAME", 20, 319}, #endif #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, #else - {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, 320}, + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320}, #endif #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, #else - {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 300}, + {"SSL3_SESSION_ID_TOO_LONG", 20, 300}, #endif #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, #else - {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, 1042}, + {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042}, #endif #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, #else - {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, 1020}, + {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020}, #endif #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, #else - {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, 1045}, + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045}, #endif #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, #else - {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, 1044}, + {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044}, #endif #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, #else - {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, 1046}, + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046}, #endif #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, #else - {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, 1030}, + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030}, #endif #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, #else - {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, 1040}, + {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040}, #endif #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, #else - {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, 1047}, + {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047}, #endif #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, #else - {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, 1041}, + {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041}, #endif #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, #else - {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, 1010}, + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010}, #endif #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, #else - {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, 1043}, + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043}, #endif #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY}, #else - {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, 117}, + {"SSL_COMMAND_SECTION_EMPTY", 20, 117}, #endif #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND}, #else - {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, 125}, + {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125}, #endif #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, #else - {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, 228}, + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228}, #endif #ifdef SSL_R_SSL_HANDSHAKE_FAILURE {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, #else - {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, 229}, + {"SSL_HANDSHAKE_FAILURE", 20, 229}, #endif #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, #else - {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, 230}, + {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230}, #endif #ifdef SSL_R_SSL_NEGATIVE_LENGTH {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, #else - {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, 372}, + {"SSL_NEGATIVE_LENGTH", 20, 372}, #endif #ifdef SSL_R_SSL_SECTION_EMPTY {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY}, #else - {"SSL_SECTION_EMPTY", ERR_LIB_SSL, 126}, + {"SSL_SECTION_EMPTY", 20, 126}, #endif #ifdef SSL_R_SSL_SECTION_NOT_FOUND {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND}, #else - {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, 136}, + {"SSL_SECTION_NOT_FOUND", 20, 136}, #endif #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, #else - {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, 301}, + {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301}, #endif #ifdef SSL_R_SSL_SESSION_ID_CONFLICT {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, #else - {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, 302}, + {"SSL_SESSION_ID_CONFLICT", 20, 302}, #endif #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, #else - {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, 273}, + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273}, #endif #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, #else - {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, 303}, + {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303}, #endif #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG}, #else - {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, 408}, + {"SSL_SESSION_ID_TOO_LONG", 20, 408}, #endif #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH}, #else - {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, 210}, + {"SSL_SESSION_VERSION_MISMATCH", 20, 210}, #endif #ifdef SSL_R_STILL_IN_INIT {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT}, #else - {"STILL_IN_INIT", ERR_LIB_SSL, 121}, + {"STILL_IN_INIT", 20, 121}, #endif #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED}, #else - {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, 1116}, + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116}, #endif #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION}, #else - {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, 1109}, + {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109}, #endif #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, #else - {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, 1049}, + {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049}, #endif #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, #else - {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, 1050}, + {"TLSV1_ALERT_DECODE_ERROR", 20, 1050}, #endif #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, #else - {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, 1021}, + {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021}, #endif #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, #else - {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, 1051}, + {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051}, #endif #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, #else - {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, 1060}, + {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060}, #endif #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, #else - {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, 1086}, + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086}, #endif #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, #else - {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, 1071}, + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071}, #endif #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, #else - {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, 1080}, + {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080}, #endif #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, #else - {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, 1100}, + {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100}, #endif #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, #else - {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, 1070}, + {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070}, #endif #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, #else - {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, 1022}, + {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022}, #endif #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, #else - {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, 1048}, + {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048}, #endif #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, #else - {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, 1090}, + {"TLSV1_ALERT_USER_CANCELLED", 20, 1090}, #endif #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, #else - {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, 1114}, + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114}, #endif #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, #else - {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, 1113}, + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113}, #endif #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, #else - {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, 1111}, + {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111}, #endif #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, #else - {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, 1112}, + {"TLSV1_UNRECOGNIZED_NAME", 20, 1112}, #endif #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, #else - {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, 1110}, + {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110}, #endif #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, #else - {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, 365}, + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", 20, 365}, #endif #ifdef SSL_R_TLS_HEARTBEAT_PENDING {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, #else - {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, 366}, + {"TLS_HEARTBEAT_PENDING", 20, 366}, #endif #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, #else - {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, 367}, + {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367}, #endif #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, #else - {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, 157}, + {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157}, #endif #ifdef SSL_R_TOO_MANY_KEY_UPDATES {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES}, #else - {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, 132}, + {"TOO_MANY_KEY_UPDATES", 20, 132}, #endif #ifdef SSL_R_TOO_MANY_WARN_ALERTS {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS}, #else - {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, 409}, + {"TOO_MANY_WARN_ALERTS", 20, 409}, #endif #ifdef SSL_R_TOO_MUCH_EARLY_DATA {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA}, #else - {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, 164}, + {"TOO_MUCH_EARLY_DATA", 20, 164}, #endif #ifdef SSL_R_UNABLE_TO_DECODE_ECDH_CERTS {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, SSL_R_UNABLE_TO_DECODE_ECDH_CERTS}, #else - {"UNABLE_TO_DECODE_ECDH_CERTS", ERR_LIB_SSL, 313}, + {"UNABLE_TO_DECODE_ECDH_CERTS", 20, 313}, #endif #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, #else - {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, 314}, + {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314}, #endif #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, #else - {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, 239}, + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239}, #endif #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, #else - {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, 242}, + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242}, #endif #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, #else - {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, 243}, + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243}, #endif #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE}, #else - {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, 262}, + {"UNEXPECTED_CCS_MESSAGE", 20, 262}, #endif #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA}, #else - {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, 178}, + {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178}, #endif #ifdef SSL_R_UNEXPECTED_MESSAGE {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, #else - {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, 244}, + {"UNEXPECTED_MESSAGE", 20, 244}, #endif #ifdef SSL_R_UNEXPECTED_RECORD {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, #else - {"UNEXPECTED_RECORD", ERR_LIB_SSL, 245}, + {"UNEXPECTED_RECORD", 20, 245}, #endif #ifdef SSL_R_UNINITIALIZED {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, #else - {"UNINITIALIZED", ERR_LIB_SSL, 276}, + {"UNINITIALIZED", 20, 276}, #endif #ifdef SSL_R_UNKNOWN_ALERT_TYPE {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, #else - {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, 246}, + {"UNKNOWN_ALERT_TYPE", 20, 246}, #endif #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, #else - {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, 247}, + {"UNKNOWN_CERTIFICATE_TYPE", 20, 247}, #endif #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, #else - {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, 248}, + {"UNKNOWN_CIPHER_RETURNED", 20, 248}, #endif #ifdef SSL_R_UNKNOWN_CIPHER_TYPE {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, #else - {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, 249}, + {"UNKNOWN_CIPHER_TYPE", 20, 249}, #endif #ifdef SSL_R_UNKNOWN_CMD_NAME {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, #else - {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, 386}, + {"UNKNOWN_CMD_NAME", 20, 386}, #endif #ifdef SSL_R_UNKNOWN_COMMAND {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND}, #else - {"UNKNOWN_COMMAND", ERR_LIB_SSL, 139}, + {"UNKNOWN_COMMAND", 20, 139}, #endif #ifdef SSL_R_UNKNOWN_DIGEST {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, #else - {"UNKNOWN_DIGEST", ERR_LIB_SSL, 368}, + {"UNKNOWN_DIGEST", 20, 368}, #endif #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, #else - {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, 250}, + {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250}, #endif #ifdef SSL_R_UNKNOWN_PKEY_TYPE {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, #else - {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, 251}, + {"UNKNOWN_PKEY_TYPE", 20, 251}, #endif #ifdef SSL_R_UNKNOWN_PROTOCOL {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, #else - {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, 252}, + {"UNKNOWN_PROTOCOL", 20, 252}, #endif #ifdef SSL_R_UNKNOWN_SSL_VERSION {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, #else - {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, 254}, + {"UNKNOWN_SSL_VERSION", 20, 254}, #endif #ifdef SSL_R_UNKNOWN_STATE {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, #else - {"UNKNOWN_STATE", ERR_LIB_SSL, 255}, + {"UNKNOWN_STATE", 20, 255}, #endif #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, #else - {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, 338}, + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338}, #endif #ifdef SSL_R_UNSOLICITED_EXTENSION {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION}, #else - {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, 217}, + {"UNSOLICITED_EXTENSION", 20, 217}, #endif #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, #else - {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, 257}, + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257}, #endif #ifdef SSL_R_UNSUPPORTED_DIGEST_TYPE {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_DIGEST_TYPE}, #else - {"UNSUPPORTED_DIGEST_TYPE", ERR_LIB_SSL, 326}, + {"UNSUPPORTED_DIGEST_TYPE", 20, 326}, #endif #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, #else - {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, 315}, + {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315}, #endif #ifdef SSL_R_UNSUPPORTED_PROTOCOL {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, #else - {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, 258}, + {"UNSUPPORTED_PROTOCOL", 20, 258}, #endif #ifdef SSL_R_UNSUPPORTED_SSL_VERSION {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, #else - {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, 259}, + {"UNSUPPORTED_SSL_VERSION", 20, 259}, #endif #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, #else - {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, 329}, + {"UNSUPPORTED_STATUS_TYPE", 20, 329}, #endif #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, #else - {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, 369}, + {"USE_SRTP_NOT_NEGOTIATED", 20, 369}, #endif #ifdef SSL_R_VERSION_TOO_HIGH {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH}, #else - {"VERSION_TOO_HIGH", ERR_LIB_SSL, 166}, + {"VERSION_TOO_HIGH", 20, 166}, #endif #ifdef SSL_R_VERSION_TOO_LOW {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, #else - {"VERSION_TOO_LOW", ERR_LIB_SSL, 396}, + {"VERSION_TOO_LOW", 20, 396}, #endif #ifdef SSL_R_WRONG_CERTIFICATE_TYPE {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, #else - {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, 383}, + {"WRONG_CERTIFICATE_TYPE", 20, 383}, #endif #ifdef SSL_R_WRONG_CIPHER_RETURNED {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, #else - {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, 261}, + {"WRONG_CIPHER_RETURNED", 20, 261}, #endif #ifdef SSL_R_WRONG_CURVE {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, #else - {"WRONG_CURVE", ERR_LIB_SSL, 378}, + {"WRONG_CURVE", 20, 378}, #endif #ifdef SSL_R_WRONG_SIGNATURE_LENGTH {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, #else - {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, 264}, + {"WRONG_SIGNATURE_LENGTH", 20, 264}, #endif #ifdef SSL_R_WRONG_SIGNATURE_SIZE {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, #else - {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, 265}, + {"WRONG_SIGNATURE_SIZE", 20, 265}, #endif #ifdef SSL_R_WRONG_SIGNATURE_TYPE {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, #else - {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, 370}, + {"WRONG_SIGNATURE_TYPE", 20, 370}, #endif #ifdef SSL_R_WRONG_SSL_VERSION {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, #else - {"WRONG_SSL_VERSION", ERR_LIB_SSL, 266}, + {"WRONG_SSL_VERSION", 20, 266}, #endif #ifdef SSL_R_WRONG_VERSION_NUMBER {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, #else - {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, 267}, + {"WRONG_VERSION_NUMBER", 20, 267}, #endif #ifdef SSL_R_X509_LIB {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, #else - {"X509_LIB", ERR_LIB_SSL, 268}, + {"X509_LIB", 20, 268}, #endif #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, #else - {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, 269}, + {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269}, #endif #ifdef TS_R_BAD_PKCS7_TYPE {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE}, #else - {"BAD_PKCS7_TYPE", ERR_LIB_TS, 132}, + {"BAD_PKCS7_TYPE", 47, 132}, #endif #ifdef TS_R_BAD_TYPE {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE}, #else - {"BAD_TYPE", ERR_LIB_TS, 133}, + {"BAD_TYPE", 47, 133}, #endif #ifdef TS_R_CANNOT_LOAD_CERT {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT}, #else - {"CANNOT_LOAD_CERT", ERR_LIB_TS, 137}, + {"CANNOT_LOAD_CERT", 47, 137}, #endif #ifdef TS_R_CANNOT_LOAD_KEY {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY}, #else - {"CANNOT_LOAD_KEY", ERR_LIB_TS, 138}, + {"CANNOT_LOAD_KEY", 47, 138}, #endif #ifdef TS_R_CERTIFICATE_VERIFY_ERROR {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR}, #else - {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, 100}, + {"CERTIFICATE_VERIFY_ERROR", 47, 100}, #endif #ifdef TS_R_COULD_NOT_SET_ENGINE {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE}, #else - {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, 127}, + {"COULD_NOT_SET_ENGINE", 47, 127}, #endif #ifdef TS_R_COULD_NOT_SET_TIME {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME}, #else - {"COULD_NOT_SET_TIME", ERR_LIB_TS, 115}, + {"COULD_NOT_SET_TIME", 47, 115}, #endif #ifdef TS_R_DETACHED_CONTENT {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT}, #else - {"DETACHED_CONTENT", ERR_LIB_TS, 134}, + {"DETACHED_CONTENT", 47, 134}, #endif #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR}, #else - {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, 116}, + {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116}, #endif #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR}, #else - {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, 139}, + {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139}, #endif #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR}, #else - {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, 101}, + {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101}, #endif #ifdef TS_R_INVALID_NULL_POINTER {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER}, #else - {"INVALID_NULL_POINTER", ERR_LIB_TS, 102}, + {"INVALID_NULL_POINTER", 47, 102}, #endif #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE}, #else - {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, 117}, + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117}, #endif #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH}, #else - {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, 103}, + {"MESSAGE_IMPRINT_MISMATCH", 47, 103}, #endif #ifdef TS_R_NONCE_MISMATCH {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH}, #else - {"NONCE_MISMATCH", ERR_LIB_TS, 104}, + {"NONCE_MISMATCH", 47, 104}, #endif #ifdef TS_R_NONCE_NOT_RETURNED {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED}, #else - {"NONCE_NOT_RETURNED", ERR_LIB_TS, 105}, + {"NONCE_NOT_RETURNED", 47, 105}, #endif #ifdef TS_R_NO_CONTENT {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT}, #else - {"NO_CONTENT", ERR_LIB_TS, 106}, + {"NO_CONTENT", 47, 106}, #endif #ifdef TS_R_NO_TIME_STAMP_TOKEN {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN}, #else - {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, 107}, + {"NO_TIME_STAMP_TOKEN", 47, 107}, #endif #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR}, #else - {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, 118}, + {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118}, #endif #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR}, #else - {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, 119}, + {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119}, #endif #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED}, #else - {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, 129}, + {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129}, #endif #ifdef TS_R_POLICY_MISMATCH {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH}, #else - {"POLICY_MISMATCH", ERR_LIB_TS, 108}, + {"POLICY_MISMATCH", 47, 108}, #endif #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, #else - {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, 120}, + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120}, #endif #ifdef TS_R_RESPONSE_SETUP_ERROR {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR}, #else - {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, 121}, + {"RESPONSE_SETUP_ERROR", 47, 121}, #endif #ifdef TS_R_SIGNATURE_FAILURE {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE}, #else - {"SIGNATURE_FAILURE", ERR_LIB_TS, 109}, + {"SIGNATURE_FAILURE", 47, 109}, #endif #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER}, #else - {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, 110}, + {"THERE_MUST_BE_ONE_SIGNER", 47, 110}, #endif #ifdef TS_R_TIME_SYSCALL_ERROR {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR}, #else - {"TIME_SYSCALL_ERROR", ERR_LIB_TS, 122}, + {"TIME_SYSCALL_ERROR", 47, 122}, #endif #ifdef TS_R_TOKEN_NOT_PRESENT {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT}, #else - {"TOKEN_NOT_PRESENT", ERR_LIB_TS, 130}, + {"TOKEN_NOT_PRESENT", 47, 130}, #endif #ifdef TS_R_TOKEN_PRESENT {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT}, #else - {"TOKEN_PRESENT", ERR_LIB_TS, 131}, + {"TOKEN_PRESENT", 47, 131}, #endif #ifdef TS_R_TSA_NAME_MISMATCH {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH}, #else - {"TSA_NAME_MISMATCH", ERR_LIB_TS, 111}, + {"TSA_NAME_MISMATCH", 47, 111}, #endif #ifdef TS_R_TSA_UNTRUSTED {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED}, #else - {"TSA_UNTRUSTED", ERR_LIB_TS, 112}, + {"TSA_UNTRUSTED", 47, 112}, #endif #ifdef TS_R_TST_INFO_SETUP_ERROR {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR}, #else - {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, 123}, + {"TST_INFO_SETUP_ERROR", 47, 123}, #endif #ifdef TS_R_TS_DATASIGN {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN}, #else - {"TS_DATASIGN", ERR_LIB_TS, 124}, + {"TS_DATASIGN", 47, 124}, #endif #ifdef TS_R_UNACCEPTABLE_POLICY {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY}, #else - {"UNACCEPTABLE_POLICY", ERR_LIB_TS, 125}, + {"UNACCEPTABLE_POLICY", 47, 125}, #endif #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM}, #else - {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, 126}, + {"UNSUPPORTED_MD_ALGORITHM", 47, 126}, #endif #ifdef TS_R_UNSUPPORTED_VERSION {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION}, #else - {"UNSUPPORTED_VERSION", ERR_LIB_TS, 113}, + {"UNSUPPORTED_VERSION", 47, 113}, #endif #ifdef TS_R_VAR_BAD_VALUE {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE}, #else - {"VAR_BAD_VALUE", ERR_LIB_TS, 135}, + {"VAR_BAD_VALUE", 47, 135}, #endif #ifdef TS_R_VAR_LOOKUP_FAILURE {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE}, #else - {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, 136}, + {"VAR_LOOKUP_FAILURE", 47, 136}, #endif #ifdef TS_R_WRONG_CONTENT_TYPE {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE}, #else - {"WRONG_CONTENT_TYPE", ERR_LIB_TS, 114}, + {"WRONG_CONTENT_TYPE", 47, 114}, #endif #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS}, #else - {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, 104}, + {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104}, #endif #ifdef UI_R_INDEX_TOO_LARGE {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE}, #else - {"INDEX_TOO_LARGE", ERR_LIB_UI, 102}, + {"INDEX_TOO_LARGE", 40, 102}, #endif #ifdef UI_R_INDEX_TOO_SMALL {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL}, #else - {"INDEX_TOO_SMALL", ERR_LIB_UI, 103}, + {"INDEX_TOO_SMALL", 40, 103}, #endif #ifdef UI_R_NO_RESULT_BUFFER {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER}, #else - {"NO_RESULT_BUFFER", ERR_LIB_UI, 105}, + {"NO_RESULT_BUFFER", 40, 105}, #endif #ifdef UI_R_PROCESSING_ERROR {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR}, #else - {"PROCESSING_ERROR", ERR_LIB_UI, 107}, + {"PROCESSING_ERROR", 40, 107}, #endif #ifdef UI_R_RESULT_TOO_LARGE {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE}, #else - {"RESULT_TOO_LARGE", ERR_LIB_UI, 100}, + {"RESULT_TOO_LARGE", 40, 100}, #endif #ifdef UI_R_RESULT_TOO_SMALL {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL}, #else - {"RESULT_TOO_SMALL", ERR_LIB_UI, 101}, + {"RESULT_TOO_SMALL", 40, 101}, #endif #ifdef UI_R_SYSASSIGN_ERROR {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR}, #else - {"SYSASSIGN_ERROR", ERR_LIB_UI, 109}, + {"SYSASSIGN_ERROR", 40, 109}, #endif #ifdef UI_R_SYSDASSGN_ERROR {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR}, #else - {"SYSDASSGN_ERROR", ERR_LIB_UI, 110}, + {"SYSDASSGN_ERROR", 40, 110}, #endif #ifdef UI_R_SYSQIOW_ERROR {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR}, #else - {"SYSQIOW_ERROR", ERR_LIB_UI, 111}, + {"SYSQIOW_ERROR", 40, 111}, #endif #ifdef UI_R_UNKNOWN_CONTROL_COMMAND {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND}, #else - {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, 106}, + {"UNKNOWN_CONTROL_COMMAND", 40, 106}, #endif #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE}, #else - {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, 108}, + {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108}, #endif #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED}, #else - {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, 112}, + {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112}, #endif #ifdef X509V3_R_BAD_IP_ADDRESS {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS}, #else - {"BAD_IP_ADDRESS", ERR_LIB_X509V3, 118}, + {"BAD_IP_ADDRESS", 34, 118}, #endif #ifdef X509V3_R_BAD_OBJECT {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT}, #else - {"BAD_OBJECT", ERR_LIB_X509V3, 119}, + {"BAD_OBJECT", 34, 119}, #endif #ifdef X509V3_R_BN_DEC2BN_ERROR {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR}, #else - {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, 100}, + {"BN_DEC2BN_ERROR", 34, 100}, #endif #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR}, #else - {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, 101}, + {"BN_TO_ASN1_INTEGER_ERROR", 34, 101}, #endif #ifdef X509V3_R_DIRNAME_ERROR {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR}, #else - {"DIRNAME_ERROR", ERR_LIB_X509V3, 149}, + {"DIRNAME_ERROR", 34, 149}, #endif #ifdef X509V3_R_DISTPOINT_ALREADY_SET {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET}, #else - {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, 160}, + {"DISTPOINT_ALREADY_SET", 34, 160}, #endif #ifdef X509V3_R_DUPLICATE_ZONE_ID {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID}, #else - {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, 133}, + {"DUPLICATE_ZONE_ID", 34, 133}, #endif #ifdef X509V3_R_ERROR_CONVERTING_ZONE {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE}, #else - {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, 131}, + {"ERROR_CONVERTING_ZONE", 34, 131}, #endif #ifdef X509V3_R_ERROR_CREATING_EXTENSION {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION}, #else - {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, 144}, + {"ERROR_CREATING_EXTENSION", 34, 144}, #endif #ifdef X509V3_R_ERROR_IN_EXTENSION {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION}, #else - {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, 128}, + {"ERROR_IN_EXTENSION", 34, 128}, #endif #ifdef X509V3_R_EXPECTED_A_SECTION_NAME {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME}, #else - {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, 137}, + {"EXPECTED_A_SECTION_NAME", 34, 137}, #endif #ifdef X509V3_R_EXTENSION_EXISTS {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS}, #else - {"EXTENSION_EXISTS", ERR_LIB_X509V3, 145}, + {"EXTENSION_EXISTS", 34, 145}, #endif #ifdef X509V3_R_EXTENSION_NAME_ERROR {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR}, #else - {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, 115}, + {"EXTENSION_NAME_ERROR", 34, 115}, #endif #ifdef X509V3_R_EXTENSION_NOT_FOUND {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND}, #else - {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, 102}, + {"EXTENSION_NOT_FOUND", 34, 102}, #endif #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED}, #else - {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, 103}, + {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103}, #endif #ifdef X509V3_R_EXTENSION_VALUE_ERROR {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR}, #else - {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, 116}, + {"EXTENSION_VALUE_ERROR", 34, 116}, #endif #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION}, #else - {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, 151}, + {"ILLEGAL_EMPTY_EXTENSION", 34, 151}, #endif #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG}, #else - {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, 152}, + {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152}, #endif #ifdef X509V3_R_INVALID_ASNUMBER {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER}, #else - {"INVALID_ASNUMBER", ERR_LIB_X509V3, 162}, + {"INVALID_ASNUMBER", 34, 162}, #endif #ifdef X509V3_R_INVALID_ASRANGE {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE}, #else - {"INVALID_ASRANGE", ERR_LIB_X509V3, 163}, + {"INVALID_ASRANGE", 34, 163}, #endif #ifdef X509V3_R_INVALID_BOOLEAN_STRING {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING}, #else - {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, 104}, + {"INVALID_BOOLEAN_STRING", 34, 104}, #endif #ifdef X509V3_R_INVALID_EXTENSION_STRING {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING}, #else - {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, 105}, + {"INVALID_EXTENSION_STRING", 34, 105}, #endif #ifdef X509V3_R_INVALID_INHERITANCE {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE}, #else - {"INVALID_INHERITANCE", ERR_LIB_X509V3, 165}, + {"INVALID_INHERITANCE", 34, 165}, #endif #ifdef X509V3_R_INVALID_IPADDRESS {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS}, #else - {"INVALID_IPADDRESS", ERR_LIB_X509V3, 166}, + {"INVALID_IPADDRESS", 34, 166}, #endif #ifdef X509V3_R_INVALID_MULTIPLE_RDNS {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS}, #else - {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, 161}, + {"INVALID_MULTIPLE_RDNS", 34, 161}, #endif #ifdef X509V3_R_INVALID_NAME {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME}, #else - {"INVALID_NAME", ERR_LIB_X509V3, 106}, + {"INVALID_NAME", 34, 106}, #endif #ifdef X509V3_R_INVALID_NULL_ARGUMENT {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT}, #else - {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, 107}, + {"INVALID_NULL_ARGUMENT", 34, 107}, #endif #ifdef X509V3_R_INVALID_NULL_NAME {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME}, #else - {"INVALID_NULL_NAME", ERR_LIB_X509V3, 108}, + {"INVALID_NULL_NAME", 34, 108}, #endif #ifdef X509V3_R_INVALID_NULL_VALUE {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE}, #else - {"INVALID_NULL_VALUE", ERR_LIB_X509V3, 109}, + {"INVALID_NULL_VALUE", 34, 109}, #endif #ifdef X509V3_R_INVALID_NUMBER {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER}, #else - {"INVALID_NUMBER", ERR_LIB_X509V3, 140}, + {"INVALID_NUMBER", 34, 140}, #endif #ifdef X509V3_R_INVALID_NUMBERS {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS}, #else - {"INVALID_NUMBERS", ERR_LIB_X509V3, 141}, + {"INVALID_NUMBERS", 34, 141}, #endif #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER}, #else - {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, 110}, + {"INVALID_OBJECT_IDENTIFIER", 34, 110}, #endif #ifdef X509V3_R_INVALID_OPTION {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION}, #else - {"INVALID_OPTION", ERR_LIB_X509V3, 138}, + {"INVALID_OPTION", 34, 138}, #endif #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER}, #else - {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, 134}, + {"INVALID_POLICY_IDENTIFIER", 34, 134}, #endif #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING}, #else - {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, 153}, + {"INVALID_PROXY_POLICY_SETTING", 34, 153}, #endif #ifdef X509V3_R_INVALID_PURPOSE {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE}, #else - {"INVALID_PURPOSE", ERR_LIB_X509V3, 146}, + {"INVALID_PURPOSE", 34, 146}, #endif #ifdef X509V3_R_INVALID_SAFI {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI}, #else - {"INVALID_SAFI", ERR_LIB_X509V3, 164}, + {"INVALID_SAFI", 34, 164}, #endif #ifdef X509V3_R_INVALID_SECTION {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION}, #else - {"INVALID_SECTION", ERR_LIB_X509V3, 135}, + {"INVALID_SECTION", 34, 135}, #endif #ifdef X509V3_R_INVALID_SYNTAX {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX}, #else - {"INVALID_SYNTAX", ERR_LIB_X509V3, 143}, + {"INVALID_SYNTAX", 34, 143}, #endif #ifdef X509V3_R_ISSUER_DECODE_ERROR {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR}, #else - {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, 126}, + {"ISSUER_DECODE_ERROR", 34, 126}, #endif #ifdef X509V3_R_MISSING_VALUE {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE}, #else - {"MISSING_VALUE", ERR_LIB_X509V3, 124}, + {"MISSING_VALUE", 34, 124}, #endif #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS}, #else - {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, 142}, + {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142}, #endif #ifdef X509V3_R_NO_CONFIG_DATABASE {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE}, #else - {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, 136}, + {"NO_CONFIG_DATABASE", 34, 136}, #endif #ifdef X509V3_R_NO_ISSUER_CERTIFICATE {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE}, #else - {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, 121}, + {"NO_ISSUER_CERTIFICATE", 34, 121}, #endif #ifdef X509V3_R_NO_ISSUER_DETAILS {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS}, #else - {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, 127}, + {"NO_ISSUER_DETAILS", 34, 127}, #endif #ifdef X509V3_R_NO_POLICY_IDENTIFIER {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER}, #else - {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, 139}, + {"NO_POLICY_IDENTIFIER", 34, 139}, #endif #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED}, #else - {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, 154}, + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154}, #endif #ifdef X509V3_R_NO_PUBLIC_KEY {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY}, #else - {"NO_PUBLIC_KEY", ERR_LIB_X509V3, 114}, + {"NO_PUBLIC_KEY", 34, 114}, #endif #ifdef X509V3_R_NO_SUBJECT_DETAILS {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS}, #else - {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, 125}, + {"NO_SUBJECT_DETAILS", 34, 125}, #endif #ifdef X509V3_R_OPERATION_NOT_DEFINED {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED}, #else - {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, 148}, + {"OPERATION_NOT_DEFINED", 34, 148}, #endif #ifdef X509V3_R_OTHERNAME_ERROR {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR}, #else - {"OTHERNAME_ERROR", ERR_LIB_X509V3, 147}, + {"OTHERNAME_ERROR", 34, 147}, #endif #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED}, #else - {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, 155}, + {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155}, #endif #ifdef X509V3_R_POLICY_PATH_LENGTH {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH}, #else - {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, 156}, + {"POLICY_PATH_LENGTH", 34, 156}, #endif #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED}, #else - {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, 157}, + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157}, #endif #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY}, #else - {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, 159}, + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159}, #endif #ifdef X509V3_R_SECTION_NOT_FOUND {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND}, #else - {"SECTION_NOT_FOUND", ERR_LIB_X509V3, 150}, + {"SECTION_NOT_FOUND", 34, 150}, #endif #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS}, #else - {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, 122}, + {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122}, #endif #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID}, #else - {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, 123}, + {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123}, #endif #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT}, #else - {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, 111}, + {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111}, #endif #ifdef X509V3_R_UNKNOWN_EXTENSION {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION}, #else - {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, 129}, + {"UNKNOWN_EXTENSION", 34, 129}, #endif #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME}, #else - {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, 130}, + {"UNKNOWN_EXTENSION_NAME", 34, 130}, #endif #ifdef X509V3_R_UNKNOWN_OPTION {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION}, #else - {"UNKNOWN_OPTION", ERR_LIB_X509V3, 120}, + {"UNKNOWN_OPTION", 34, 120}, #endif #ifdef X509V3_R_UNSUPPORTED_OPTION {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION}, #else - {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, 117}, + {"UNSUPPORTED_OPTION", 34, 117}, #endif #ifdef X509V3_R_UNSUPPORTED_TYPE {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE}, #else - {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, 167}, + {"UNSUPPORTED_TYPE", 34, 167}, #endif #ifdef X509V3_R_USER_TOO_LONG {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG}, #else - {"USER_TOO_LONG", ERR_LIB_X509V3, 132}, + {"USER_TOO_LONG", 34, 132}, #endif #ifdef X509_R_AKID_MISMATCH {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH}, #else - {"AKID_MISMATCH", ERR_LIB_X509, 110}, + {"AKID_MISMATCH", 11, 110}, #endif #ifdef X509_R_BAD_SELECTOR {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR}, #else - {"BAD_SELECTOR", ERR_LIB_X509, 133}, + {"BAD_SELECTOR", 11, 133}, #endif #ifdef X509_R_BAD_X509_FILETYPE {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE}, #else - {"BAD_X509_FILETYPE", ERR_LIB_X509, 100}, + {"BAD_X509_FILETYPE", 11, 100}, #endif #ifdef X509_R_BASE64_DECODE_ERROR {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR}, #else - {"BASE64_DECODE_ERROR", ERR_LIB_X509, 118}, + {"BASE64_DECODE_ERROR", 11, 118}, #endif #ifdef X509_R_CANT_CHECK_DH_KEY {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY}, #else - {"CANT_CHECK_DH_KEY", ERR_LIB_X509, 114}, + {"CANT_CHECK_DH_KEY", 11, 114}, #endif #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE}, #else - {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, 101}, + {"CERT_ALREADY_IN_HASH_TABLE", 11, 101}, #endif #ifdef X509_R_CRL_ALREADY_DELTA {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA}, #else - {"CRL_ALREADY_DELTA", ERR_LIB_X509, 127}, + {"CRL_ALREADY_DELTA", 11, 127}, #endif #ifdef X509_R_CRL_VERIFY_FAILURE {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE}, #else - {"CRL_VERIFY_FAILURE", ERR_LIB_X509, 131}, + {"CRL_VERIFY_FAILURE", 11, 131}, #endif #ifdef X509_R_ERR_ASN1_LIB {"ERR_ASN1_LIB", ERR_LIB_X509, X509_R_ERR_ASN1_LIB}, #else - {"ERR_ASN1_LIB", ERR_LIB_X509, 102}, + {"ERR_ASN1_LIB", 11, 102}, #endif #ifdef X509_R_IDP_MISMATCH {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH}, #else - {"IDP_MISMATCH", ERR_LIB_X509, 128}, + {"IDP_MISMATCH", 11, 128}, #endif #ifdef X509_R_INVALID_ATTRIBUTES {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES}, #else - {"INVALID_ATTRIBUTES", ERR_LIB_X509, 138}, + {"INVALID_ATTRIBUTES", 11, 138}, #endif #ifdef X509_R_INVALID_DIRECTORY {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY}, #else - {"INVALID_DIRECTORY", ERR_LIB_X509, 113}, + {"INVALID_DIRECTORY", 11, 113}, #endif #ifdef X509_R_INVALID_FIELD_NAME {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME}, #else - {"INVALID_FIELD_NAME", ERR_LIB_X509, 119}, + {"INVALID_FIELD_NAME", 11, 119}, #endif #ifdef X509_R_INVALID_TRUST {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST}, #else - {"INVALID_TRUST", ERR_LIB_X509, 123}, + {"INVALID_TRUST", 11, 123}, #endif #ifdef X509_R_ISSUER_MISMATCH {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH}, #else - {"ISSUER_MISMATCH", ERR_LIB_X509, 129}, + {"ISSUER_MISMATCH", 11, 129}, #endif #ifdef X509_R_KEY_TYPE_MISMATCH {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH}, #else - {"KEY_TYPE_MISMATCH", ERR_LIB_X509, 115}, + {"KEY_TYPE_MISMATCH", 11, 115}, #endif #ifdef X509_R_KEY_VALUES_MISMATCH {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH}, #else - {"KEY_VALUES_MISMATCH", ERR_LIB_X509, 116}, + {"KEY_VALUES_MISMATCH", 11, 116}, #endif #ifdef X509_R_LOADING_CERT_DIR {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR}, #else - {"LOADING_CERT_DIR", ERR_LIB_X509, 103}, + {"LOADING_CERT_DIR", 11, 103}, #endif #ifdef X509_R_LOADING_DEFAULTS {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS}, #else - {"LOADING_DEFAULTS", ERR_LIB_X509, 104}, + {"LOADING_DEFAULTS", 11, 104}, #endif #ifdef X509_R_METHOD_NOT_SUPPORTED {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED}, #else - {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, 124}, + {"METHOD_NOT_SUPPORTED", 11, 124}, #endif #ifdef X509_R_NAME_TOO_LONG {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG}, #else - {"NAME_TOO_LONG", ERR_LIB_X509, 134}, + {"NAME_TOO_LONG", 11, 134}, #endif #ifdef X509_R_NEWER_CRL_NOT_NEWER {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER}, #else - {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, 132}, + {"NEWER_CRL_NOT_NEWER", 11, 132}, #endif #ifdef X509_R_NO_CERTIFICATE_FOUND {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND}, #else - {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, 135}, + {"NO_CERTIFICATE_FOUND", 11, 135}, #endif #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND}, #else - {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, 136}, + {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136}, #endif #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY}, #else - {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, 105}, + {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105}, #endif #ifdef X509_R_NO_CRL_FOUND {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND}, #else - {"NO_CRL_FOUND", ERR_LIB_X509, 137}, + {"NO_CRL_FOUND", 11, 137}, #endif #ifdef X509_R_NO_CRL_NUMBER {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER}, #else - {"NO_CRL_NUMBER", ERR_LIB_X509, 130}, + {"NO_CRL_NUMBER", 11, 130}, #endif #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR}, #else - {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, 125}, + {"PUBLIC_KEY_DECODE_ERROR", 11, 125}, #endif #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR}, #else - {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, 126}, + {"PUBLIC_KEY_ENCODE_ERROR", 11, 126}, #endif #ifdef X509_R_SHOULD_RETRY {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY}, #else - {"SHOULD_RETRY", ERR_LIB_X509, 106}, + {"SHOULD_RETRY", 11, 106}, #endif #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN}, #else - {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, 107}, + {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107}, #endif #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY}, #else - {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, 108}, + {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108}, #endif #ifdef X509_R_UNKNOWN_KEY_TYPE {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE}, #else - {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, 117}, + {"UNKNOWN_KEY_TYPE", 11, 117}, #endif #ifdef X509_R_UNKNOWN_NID {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID}, #else - {"UNKNOWN_NID", ERR_LIB_X509, 109}, + {"UNKNOWN_NID", 11, 109}, #endif #ifdef X509_R_UNKNOWN_PURPOSE_ID {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID}, #else - {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, 121}, + {"UNKNOWN_PURPOSE_ID", 11, 121}, #endif #ifdef X509_R_UNKNOWN_TRUST_ID {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID}, #else - {"UNKNOWN_TRUST_ID", ERR_LIB_X509, 120}, + {"UNKNOWN_TRUST_ID", 11, 120}, #endif #ifdef X509_R_UNSUPPORTED_ALGORITHM {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM}, #else - {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, 111}, + {"UNSUPPORTED_ALGORITHM", 11, 111}, #endif #ifdef X509_R_WRONG_LOOKUP_TYPE {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE}, #else - {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, 112}, + {"WRONG_LOOKUP_TYPE", 11, 112}, #endif #ifdef X509_R_WRONG_TYPE {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE}, #else - {"WRONG_TYPE", ERR_LIB_X509, 122}, + {"WRONG_TYPE", 11, 122}, #endif { NULL } }; diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index f604e3a40d472..d60f352882e30 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -46,9 +46,13 @@ def parse_error_codes(h_file, prefix, libcode): continue mnemonic = base[:-5].upper() if mnemonic == "": - # Skip err.h. - continue - error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) + # err.h + lib_codes = { + code: num + for (code, (_, _, num)) in parse_error_codes(error_header, 'ERR_LIB_', None) + } + else: + error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) # Read codes from libraries new_codes = [] @@ -88,7 +92,7 @@ def w(l): w(' #ifdef %s' % (errcode)) w(' {"%s", %s, %s},' % (name, libcode, errcode)) w(' #else') - w(' {"%s", %s, %d},' % (name, libcode, num)) + w(' {"%s", %s, %d},' % (name, lib_codes[libcode], num)) w(' #endif') w(' { NULL }') w('};') From webhook-mailer at python.org Tue Apr 14 00:53:12 2020 From: webhook-mailer at python.org (Ethan Smith) Date: Tue, 14 Apr 2020 04:53:12 -0000 Subject: [Python-checkins] bpo-39481: Make functools.cached_property, partial, partialmethod generic (#19427) Message-ID: https://github.com/python/cpython/commit/cecf049673da6a24435acd1a6a3b34472b323c97 commit: cecf049673da6a24435acd1a6a3b34472b323c97 branch: master author: Ethan Smith committer: GitHub date: 2020-04-13T21:53:04-07:00 summary: bpo-39481: Make functools.cached_property, partial, partialmethod generic (#19427) files: M Lib/functools.py M Lib/test/test_genericalias.py M Modules/_functoolsmodule.c diff --git a/Lib/functools.py b/Lib/functools.py index 70fcec5a8f6d6..f05b106b62c00 100644 --- a/Lib/functools.py +++ b/Lib/functools.py @@ -20,6 +20,7 @@ # import types, weakref # Deferred to single_dispatch() from reprlib import recursive_repr from _thread import RLock +from types import GenericAlias ################################################################################ @@ -656,6 +657,9 @@ def __get__(self, obj, cls=None): def __isabstractmethod__(self): return getattr(self.func, "__isabstractmethod__", False) + __class_getitem__ = classmethod(GenericAlias) + + # Helper functions def _unwrap_partial(func): @@ -1208,3 +1212,5 @@ def __get__(self, instance, owner=None): ) raise TypeError(msg) from None return val + + __class_getitem__ = classmethod(GenericAlias) diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 02b72838277e9..770aeef45105b 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -9,6 +9,7 @@ from concurrent.futures import Future from concurrent.futures.thread import _WorkItem from contextlib import AbstractContextManager, AbstractAsyncContextManager +from functools import partial, partialmethod, _lru_cache_wrapper, cached_property from ctypes import Array, LibraryLoader from difflib import SequenceMatcher from filecmp import dircmp @@ -49,6 +50,7 @@ def test_subscriptable(self): FileInput, OrderedDict, Counter, UserDict, UserList, Pattern, Match, + partial, partialmethod, cached_property, AbstractContextManager, AbstractAsyncContextManager, Awaitable, Coroutine, AsyncIterable, AsyncIterator, diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index f3d8658044b99..2f1b47a5b061d 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -414,6 +414,8 @@ partial_setstate(partialobject *pto, PyObject *state) static PyMethodDef partial_methods[] = { {"__reduce__", (PyCFunction)partial_reduce, METH_NOARGS}, {"__setstate__", (PyCFunction)partial_setstate, METH_O}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; From webhook-mailer at python.org Tue Apr 14 00:54:44 2020 From: webhook-mailer at python.org (Ethan Smith) Date: Tue, 14 Apr 2020 04:54:44 -0000 Subject: [Python-checkins] bpo-39481: Make weakref and WeakSet generic (GH-19497) Message-ID: https://github.com/python/cpython/commit/8ef875028a3644a329c87ce420a73793e315143f commit: 8ef875028a3644a329c87ce420a73793e315143f branch: master author: Ethan Smith committer: GitHub date: 2020-04-13T21:54:40-07:00 summary: bpo-39481: Make weakref and WeakSet generic (GH-19497) files: M Lib/_weakrefset.py M Lib/test/test_genericalias.py M Objects/weakrefobject.c diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py index 7a84823622ee7..b267780f0ced7 100644 --- a/Lib/_weakrefset.py +++ b/Lib/_weakrefset.py @@ -3,6 +3,7 @@ # by abc.py to load everything else at startup. from _weakref import ref +from types import GenericAlias __all__ = ['WeakSet'] @@ -197,3 +198,5 @@ def isdisjoint(self, other): def __repr__(self): return repr(self.data) + + __class_getitem__ = classmethod(GenericAlias) diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 770aeef45105b..686df17d6a961 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -33,6 +33,7 @@ from urllib.parse import SplitResult, ParseResult from unittest.case import _AssertRaisesContext from queue import Queue, SimpleQueue +from weakref import WeakSet, ReferenceType, ref import typing from typing import TypeVar @@ -73,6 +74,7 @@ def test_subscriptable(self): Array, LibraryLoader, SplitResult, ParseResult, ValueProxy, ApplyResult, + WeakSet, ReferenceType, ref, ShareableList, SimpleQueue, Future, _WorkItem, Morsel, diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index 1e6697b729c9c..dd9b789823512 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -362,6 +362,12 @@ static PyMemberDef weakref_members[] = { {NULL} /* Sentinel */ }; +static PyMethodDef weakref_methods[] = { + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, + {NULL} /* Sentinel */ +}; + PyTypeObject _PyWeakref_RefType = { PyVarObject_HEAD_INIT(&PyType_Type, 0) @@ -392,7 +398,7 @@ _PyWeakref_RefType = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - 0, /*tp_methods*/ + weakref_methods, /*tp_methods*/ weakref_members, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ From webhook-mailer at python.org Tue Apr 14 08:26:32 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 12:26:32 -0000 Subject: [Python-checkins] bpo-40268: Include explicitly pycore_interp.h (GH-19505) Message-ID: https://github.com/python/cpython/commit/4a3fe0835310643193ea45529ab0fb45c5f8f2fd commit: 4a3fe0835310643193ea45529ab0fb45c5f8f2fd branch: master author: Victor Stinner committer: GitHub date: 2020-04-14T14:26:24+02:00 summary: bpo-40268: Include explicitly pycore_interp.h (GH-19505) pycore_pystate.h no longer includes pycore_interp.h: it's now included explicitly in files accessing PyInterpreterState. files: M Include/internal/pycore_ceval.h M Include/internal/pycore_object.h M Include/internal/pycore_pystate.h M Modules/_threadmodule.c M Modules/main.c M Objects/codeobject.c M Objects/interpreteridobject.c M Objects/longobject.c M Objects/moduleobject.c M Parser/listnode.c M Python/_warnings.c M Python/codecs.c M Python/dynload_shlib.c M Python/import.c M Python/initconfig.c M Python/preconfig.c M Python/sysmodule.c M Python/thread_nt.h M Python/thread_pthread.h diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 811aada3dcb18..298018a872b1a 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -13,7 +13,7 @@ struct pyruntimestate; struct _ceval_runtime_state; struct _frame; -#include "pycore_pystate.h" /* PyInterpreterState.eval_frame */ +#include "pycore_interp.h" /* PyInterpreterState.eval_frame */ extern void _Py_FinishPendingCalls(PyThreadState *tstate); extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *); @@ -50,7 +50,7 @@ extern PyObject *_PyEval_EvalCode( PyObject *kwdefs, PyObject *closure, PyObject *name, PyObject *qualname); -extern int _PyEval_ThreadsInitialized(_PyRuntimeState *runtime); +extern int _PyEval_ThreadsInitialized(struct pyruntimestate *runtime); extern PyStatus _PyEval_InitGIL(PyThreadState *tstate); extern void _PyEval_FiniGIL(PyThreadState *tstate); diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 5c3d3cae235f4..7c0f24ac07d7f 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -8,7 +8,9 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_pystate.h" /* PyInterpreterState.gc */ +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() +#include "pycore_interp.h" // PyInterpreterState.gc +#include "pycore_pystate.h" // _PyThreadState_GET() PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type); PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content); diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 748aa63a43063..2e783781ada60 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -8,8 +8,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_interp.h" /* PyInterpreterState */ -#include "pycore_runtime.h" /* PyRuntimestate */ +#include "pycore_runtime.h" /* PyRuntimeState */ /* Check if the current thread is the main thread. diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index e2bb14ec728b4..9853699771a75 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -4,9 +4,10 @@ #include "Python.h" #include "pycore_pylifecycle.h" +#include "pycore_interp.h" // _PyInterpreterState.num_threads #include "pycore_pystate.h" -#include "structmember.h" /* offsetof */ #include "pythread.h" +#include // offsetof() static PyObject *ThreadError; static PyObject *str_dict; diff --git a/Modules/main.c b/Modules/main.c index 00a0fc3ece401..a9de70b6b09ea 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -2,6 +2,7 @@ #include "Python.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // _PyInterpreterState.sysdict #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 1820d8c8a5688..7cb72ceab4480 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -5,7 +5,8 @@ #include "opcode.h" #include "structmember.h" #include "pycore_code.h" -#include "pycore_pystate.h" +#include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs +#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() #include "pycore_tupleobject.h" #include "clinic/codeobject.c.h" diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c index 3f316873ed516..84fd85845207a 100644 --- a/Objects/interpreteridobject.c +++ b/Objects/interpreteridobject.c @@ -2,6 +2,7 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_interp.h" // _PyInterpreterState_LookUpID() #include "pycore_pystate.h" #include "interpreteridobject.h" diff --git a/Objects/longobject.c b/Objects/longobject.c index a66e1c49241af..a0bb6bc52be02 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -3,7 +3,8 @@ /* XXX The functional organization of this file is terrible */ #include "Python.h" -#include "pycore_pystate.h" /* _Py_IsMainInterpreter() */ +#include "pycore_interp.h" // _PY_NSMALLPOSINTS +#include "pycore_pystate.h" // _Py_IsMainInterpreter() #include "longintrepr.h" #include diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 30adc92acf660..acb920a4c0714 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -2,6 +2,7 @@ /* Module object implementation */ #include "Python.h" +#include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_pystate.h" #include "structmember.h" diff --git a/Parser/listnode.c b/Parser/listnode.c index d431ae537e3b4..f53b265efe6cb 100644 --- a/Parser/listnode.c +++ b/Parser/listnode.c @@ -2,7 +2,8 @@ /* List a node on a file */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_interp.h" // PyInterpreterState.parser +#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE #include "token.h" #include "node.h" diff --git a/Python/_warnings.c b/Python/_warnings.c index e4dfb7391eaf1..d005f12910b48 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -1,5 +1,6 @@ #include "Python.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // PyInterpreterState.warnings #include "pycore_pyerrors.h" #include "pycore_pystate.h" #include "frameobject.h" diff --git a/Python/codecs.c b/Python/codecs.c index 7b35ded2edcd5..66919856ced84 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -9,6 +9,7 @@ Copyright (c) Corporation for National Research Initiatives. ------------------------------------------------------------------------ */ #include "Python.h" +#include "pycore_interp.h" // PyInterpreterState.codec_search_path #include "pycore_pystate.h" #include "ucnhash.h" #include diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 360387113366f..223e0d03f680e 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -2,6 +2,7 @@ /* Support for dynamic loading of extension modules */ #include "Python.h" +#include "pycore_interp.h" // _PyInterpreterState.dlopenflags #include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() #include "importdl.h" diff --git a/Python/import.c b/Python/import.c index d79fa18e30898..3bf8fe0581ef0 100644 --- a/Python/import.c +++ b/Python/import.c @@ -9,6 +9,7 @@ #include "pycore_pyhash.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" +#include "pycore_interp.h" // _PyInterpreterState_ClearModules() #include "pycore_pystate.h" #include "pycore_sysmodule.h" #include "errcode.h" diff --git a/Python/initconfig.c b/Python/initconfig.c index e63d6f64f3321..43e0ccb09b7c2 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -3,6 +3,7 @@ #include "pycore_fileutils.h" #include "pycore_getopt.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // _PyInterpreterState.runtime #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" diff --git a/Python/preconfig.c b/Python/preconfig.c index 89a6227fa6721..db328759c13a1 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -1,8 +1,9 @@ #include "Python.h" -#include "pycore_initconfig.h" #include "pycore_getopt.h" -#include "pycore_pystate.h" /* _PyRuntime_Initialize() */ -#include /* setlocale() */ +#include "pycore_initconfig.h" +#include "pycore_pymem.h" // _PyMem_GetAllocatorName() +#include "pycore_pystate.h" // _PyRuntime_Initialize() +#include // setlocale() #define DECODE_LOCALE_ERR(NAME, LEN) \ diff --git a/Python/sysmodule.c b/Python/sysmodule.c index fd0a9c0bf576c..814e4abad58e2 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -17,7 +17,9 @@ Data members: #include "Python.h" #include "code.h" #include "frameobject.h" -#include "pycore_ceval.h" +#include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_tupleobject.h" #include "pycore_initconfig.h" #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" diff --git a/Python/thread_nt.h b/Python/thread_nt.h index 23d585cf9fa6c..e4bd0f70581ee 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -1,3 +1,4 @@ +#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize /* This code implemented by Dag.Gruneau at elsa.preseco.comm.se */ /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch at iso.ru */ diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index e3497e7d595b1..440d845312a7d 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -1,3 +1,4 @@ +#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize /* Posix threads interface */ From webhook-mailer at python.org Tue Apr 14 09:14:11 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 13:14:11 -0000 Subject: [Python-checkins] bpo-40268: Rename _PyInterpreterState_GET_UNSAFE() (GH-19509) Message-ID: https://github.com/python/cpython/commit/81a7be3fa22c983209cc0ffb3537b92b0370f83c commit: 81a7be3fa22c983209cc0ffb3537b92b0370f83c branch: master author: Victor Stinner committer: GitHub date: 2020-04-14T15:14:01+02:00 summary: bpo-40268: Rename _PyInterpreterState_GET_UNSAFE() (GH-19509) Rename _PyInterpreterState_GET_UNSAFE() to _PyInterpreterState_GET() for consistency with _PyThreadState_GET() and to have a shorter name (help to fit into 80 columns). Add also "assert(tstate != NULL);" to the function. files: M Include/cpython/pystate.h M Include/internal/pycore_pystate.h M Modules/_io/textio.c M Modules/_threadmodule.c M Modules/main.c M Modules/posixmodule.c M Modules/signalmodule.c M Objects/codeobject.c M Objects/moduleobject.c M Objects/unicodeobject.c M Parser/listnode.c M Python/_warnings.c M Python/ceval.c M Python/codecs.c M Python/dynload_shlib.c M Python/import.c M Python/pylifecycle.c M Python/pystate.c M Python/pythonrun.c M Python/sysmodule.c M Python/thread.c M Python/thread_nt.h M Python/thread_pthread.h diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index 7052228804119..9b28f66fdba58 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -165,7 +165,7 @@ PyAPI_FUNC(int) PyGILState_Check(void); This function doesn't check for error. Return NULL before _PyGILState_Init() is called and after _PyGILState_Fini() is called. - See also _PyInterpreterState_Get() and _PyInterpreterState_GET_UNSAFE(). */ + See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */ PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void); /* The implementation of sys._current_frames() Returns a dict mapping diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 2e783781ada60..c82e8db905188 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -78,8 +78,9 @@ static inline PyThreadState *_PyThreadState_GET(void) { See also _PyInterpreterState_Get() and _PyGILState_GetInterpreterStateUnsafe(). */ -static inline PyInterpreterState* _PyInterpreterState_GET_UNSAFE(void) { +static inline PyInterpreterState* _PyInterpreterState_GET(void) { PyThreadState *tstate = _PyThreadState_GET(); + assert(tstate != NULL); return tstate->interp; } diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 492988ef422a0..95b023d17908e 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -994,7 +994,7 @@ io_check_errors(PyObject *errors) { assert(errors != NULL && errors != Py_None); - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); #ifndef Py_DEBUG /* In release mode, only check in development mode (-X dev) */ if (!_PyInterpreterState_GetConfig(interp)->dev_mode) { diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 9853699771a75..5636140dde4d3 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -1091,7 +1091,7 @@ thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs) boot = PyMem_NEW(struct bootstate, 1); if (boot == NULL) return PyErr_NoMemory(); - boot->interp = _PyInterpreterState_GET_UNSAFE(); + boot->interp = _PyInterpreterState_GET(); boot->func = func; boot->args = args; boot->keyw = keyw; @@ -1213,7 +1213,7 @@ particular thread within a system."); static PyObject * thread__count(PyObject *self, PyObject *Py_UNUSED(ignored)) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); return PyLong_FromLong(interp->num_threads); } @@ -1556,7 +1556,7 @@ PyInit__thread(void) PyObject *m, *d, *v; double time_max; double timeout_max; - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); /* Initialize types: */ if (PyType_Ready(&localdummytype) < 0) diff --git a/Modules/main.c b/Modules/main.c index a9de70b6b09ea..fb24c6c6c2892 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -498,7 +498,7 @@ pymain_repl(PyConfig *config, PyCompilerFlags *cf, int *exitcode) static void pymain_run_python(int *exitcode) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); /* pymain_run_stdin() modify the config */ PyConfig *config = (PyConfig*)_PyInterpreterState_GetConfig(interp); diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 57f148726bc22..2d603d14e8df5 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -451,7 +451,7 @@ run_at_forkers(PyObject *lst, int reverse) void PyOS_BeforeFork(void) { - run_at_forkers(_PyInterpreterState_GET_UNSAFE()->before_forkers, 1); + run_at_forkers(_PyInterpreterState_GET()->before_forkers, 1); _PyImport_AcquireLock(); } @@ -462,7 +462,7 @@ PyOS_AfterFork_Parent(void) if (_PyImport_ReleaseLock() <= 0) Py_FatalError("failed releasing import lock after fork"); - run_at_forkers(_PyInterpreterState_GET_UNSAFE()->after_forkers_parent, 0); + run_at_forkers(_PyInterpreterState_GET()->after_forkers_parent, 0); } void @@ -476,7 +476,7 @@ PyOS_AfterFork_Child(void) _PyRuntimeState_ReInitThreads(runtime); _PyInterpreterState_DeleteExceptMain(runtime); - run_at_forkers(_PyInterpreterState_GET_UNSAFE()->after_forkers_child, 0); + run_at_forkers(_PyInterpreterState_GET()->after_forkers_child, 0); } static int @@ -6185,7 +6185,7 @@ os_register_at_fork_impl(PyObject *module, PyObject *before, check_null_or_callable(after_in_parent, "after_in_parent")) { return NULL; } - interp = _PyInterpreterState_GET_UNSAFE(); + interp = _PyInterpreterState_GET(); if (register_at_forker(&interp->before_forkers, before)) { return NULL; @@ -6216,7 +6216,7 @@ os_fork1_impl(PyObject *module) { pid_t pid; - if (_PyInterpreterState_GET_UNSAFE() != PyInterpreterState_Main()) { + if (_PyInterpreterState_GET() != PyInterpreterState_Main()) { PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters"); return NULL; } @@ -6251,7 +6251,7 @@ os_fork_impl(PyObject *module) { pid_t pid; - if (_PyInterpreterState_GET_UNSAFE() != PyInterpreterState_Main()) { + if (_PyInterpreterState_GET() != PyInterpreterState_Main()) { PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters"); return NULL; } @@ -6859,7 +6859,7 @@ os_forkpty_impl(PyObject *module) int master_fd = -1; pid_t pid; - if (_PyInterpreterState_GET_UNSAFE() != PyInterpreterState_Main()) { + if (_PyInterpreterState_GET() != PyInterpreterState_Main()) { PyErr_SetString(PyExc_RuntimeError, "fork not supported for subinterpreters"); return NULL; } diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index b089a80785b06..ceb986bddcbd3 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1784,7 +1784,7 @@ PyOS_FiniInterrupts(void) int PyOS_InterruptOccurred(void) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (!_Py_ThreadCanHandleSignals(interp)) { return 0; } @@ -1821,7 +1821,7 @@ _PySignal_AfterFork(void) int _PyOS_IsMainThread(void) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); return _Py_ThreadCanHandleSignals(interp); } diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 7cb72ceab4480..da04af43a4a25 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -6,7 +6,7 @@ #include "structmember.h" #include "pycore_code.h" #include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs -#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_tupleobject.h" #include "clinic/codeobject.c.h" @@ -555,7 +555,7 @@ code_dealloc(PyCodeObject *co) co->co_opcache_size = 0; if (co->co_extra != NULL) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); _PyCodeObjectExtra *co_extra = co->co_extra; for (Py_ssize_t i = 0; i < co_extra->ce_size; i++) { @@ -1074,7 +1074,7 @@ _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra) int _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (!PyCode_Check(code) || index < 0 || index >= interp->co_extra_user_count) { diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index acb920a4c0714..1f419ad08317e 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -165,7 +165,7 @@ _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions) PyObject * PyModule_Create2(struct PyModuleDef* module, int module_api_version) { - if (!_PyImport_IsInitialized(_PyInterpreterState_GET_UNSAFE())) { + if (!_PyImport_IsInitialized(_PyInterpreterState_GET())) { PyErr_SetString(PyExc_SystemError, "Python import machinery not initialized"); return NULL; @@ -684,7 +684,7 @@ module_dealloc(PyModuleObject *m) static PyObject * module_repr(PyModuleObject *m) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); return PyObject_CallMethod(interp->importlib, "_module_repr", "O", m); } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 938df24e1dfbc..28ec8f10dcb3d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -436,7 +436,7 @@ unicode_check_encoding_errors(const char *encoding, const char *errors) return 0; } - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); #ifndef Py_DEBUG /* In release mode, only check in development mode (-X dev) */ if (!_PyInterpreterState_GetConfig(interp)->dev_mode) { @@ -3615,7 +3615,7 @@ PyUnicode_EncodeLocale(PyObject *unicode, const char *errors) PyObject * PyUnicode_EncodeFSDefault(PyObject *unicode) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->fs_codec.utf8) { return unicode_encode_utf8(unicode, interp->fs_codec.error_handler, @@ -3851,7 +3851,7 @@ PyUnicode_DecodeFSDefault(const char *s) { PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->fs_codec.utf8) { return unicode_decode_utf8(s, size, interp->fs_codec.error_handler, @@ -16009,7 +16009,7 @@ _PyUnicode_FiniEncodings(PyThreadState *tstate) int _PyUnicode_EnableLegacyWindowsFSEncoding(void) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyConfig *config = (PyConfig *)_PyInterpreterState_GetConfig(interp); /* Set the filesystem encoding to mbcs/replace (PEP 529) */ diff --git a/Parser/listnode.c b/Parser/listnode.c index f53b265efe6cb..3bcc03e93526a 100644 --- a/Parser/listnode.c +++ b/Parser/listnode.c @@ -3,7 +3,7 @@ #include "Python.h" #include "pycore_interp.h" // PyInterpreterState.parser -#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE +#include "pycore_pystate.h" // _PyInterpreterState_GET #include "token.h" #include "node.h" @@ -20,7 +20,7 @@ PyNode_ListTree(node *n) static void listnode(FILE *fp, node *n) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); interp->parser.listnode.level = 0; interp->parser.listnode.atbol = 1; @@ -40,7 +40,7 @@ list1node(FILE *fp, node *n) list1node(fp, CHILD(n, i)); } else if (ISTERMINAL(TYPE(n))) { - interp = _PyInterpreterState_GET_UNSAFE(); + interp = _PyInterpreterState_GET(); switch (TYPE(n)) { case INDENT: interp->parser.listnode.level++; diff --git a/Python/_warnings.c b/Python/_warnings.c index d005f12910b48..0236cabdf11c2 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -212,7 +212,7 @@ get_warnings_attr(_Py_Identifier *attr_id, int try_import) gone, then we can't even use PyImport_GetModule without triggering an interpreter abort. */ - if (!_PyInterpreterState_GET_UNSAFE()->modules) { + if (!_PyInterpreterState_GET()->modules) { return NULL; } warnings_module = PyImport_GetModule(warnings_str); @@ -840,7 +840,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, } if (f == NULL) { - globals = _PyInterpreterState_GET_UNSAFE()->sysdict; + globals = _PyInterpreterState_GET()->sysdict; *filename = PyUnicode_FromString("sys"); *lineno = 1; } diff --git a/Python/ceval.c b/Python/ceval.c index b7129201593bf..fc720b4ba403a 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5562,7 +5562,7 @@ _Py_GetDXProfile(PyObject *self, PyObject *args) Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); Py_ssize_t new_index; if (interp->co_extra_user_count == MAX_CO_EXTRA_USERS - 1) { diff --git a/Python/codecs.c b/Python/codecs.c index 66919856ced84..32cc110d8ec13 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -33,7 +33,7 @@ static int _PyCodecRegistry_Init(void); /* Forward */ int PyCodec_Register(PyObject *search_function) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) goto onError; if (search_function == NULL) { @@ -105,7 +105,7 @@ PyObject *_PyCodec_Lookup(const char *encoding) return NULL; } - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) { return NULL; } @@ -188,7 +188,7 @@ int _PyCodec_Forget(const char *encoding) PyObject *v; int result; - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL) { return -1; } @@ -621,7 +621,7 @@ PyObject *_PyCodec_DecodeText(PyObject *object, Return 0 on success, -1 on error */ int PyCodec_RegisterError(const char *name, PyObject *error) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) return -1; if (!PyCallable_Check(error)) { @@ -639,7 +639,7 @@ PyObject *PyCodec_LookupError(const char *name) { PyObject *handler = NULL; - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->codec_search_path == NULL && _PyCodecRegistry_Init()) return NULL; @@ -1491,7 +1491,7 @@ static int _PyCodecRegistry_Init(void) } }; - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyObject *mod; if (interp->codec_search_path != NULL) diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c index 223e0d03f680e..082154dd91b1f 100644 --- a/Python/dynload_shlib.c +++ b/Python/dynload_shlib.c @@ -3,7 +3,7 @@ #include "Python.h" #include "pycore_interp.h" // _PyInterpreterState.dlopenflags -#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "importdl.h" #include @@ -95,7 +95,7 @@ _PyImport_FindSharedFuncptr(const char *prefix, } } - dlopenflags = _PyInterpreterState_GET_UNSAFE()->dlopenflags; + dlopenflags = _PyInterpreterState_GET()->dlopenflags; handle = dlopen(pathname, dlopenflags); diff --git a/Python/import.c b/Python/import.c index 3bf8fe0581ef0..042691d30b0de 100644 --- a/Python/import.c +++ b/Python/import.c @@ -310,7 +310,7 @@ _PyImport_Fini2(void) PyObject * PyImport_GetModuleDict(void) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); if (interp->modules == NULL) { Py_FatalError("interpreter has no modules dictionary"); } @@ -644,7 +644,7 @@ long PyImport_GetMagicNumber(void) { long res; - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); PyObject *external, *pyc_magic; external = PyObject_GetAttrString(interp->importlib, "_bootstrap_external"); @@ -980,7 +980,7 @@ PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, goto error; } else if (cpathobj != NULL) { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); _Py_IDENTIFIER(_get_sourcefile); if (interp == NULL) { diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index c2a078163a316..ac0ea107bcf90 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2355,7 +2355,7 @@ Py_ExitStatusException(PyStatus status) /* For the atexit module. */ void _Py_PyAtExit(void (*func)(PyObject *), PyObject *module) { - PyInterpreterState *is = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *is = _PyInterpreterState_GET(); /* Guard against API misuse (see bpo-17852) */ assert(is->pyexitfunc == NULL || is->pyexitfunc == func); diff --git a/Python/pystate.c b/Python/pystate.c index 3636dc9c047f5..65d46a2bb4248 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -661,7 +661,7 @@ PyObject* PyState_FindModule(struct PyModuleDef* module) { Py_ssize_t index = module->m_base.m_index; - PyInterpreterState *state = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *state = _PyInterpreterState_GET(); PyObject *res; if (module->m_slots) { return NULL; diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 522d152994e7b..d1165e2b4d2f3 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -347,7 +347,7 @@ set_main_loader(PyObject *d, const char *filename, const char *loader_name) filename_obj = PyUnicode_DecodeFSDefault(filename); if (filename_obj == NULL) return -1; - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); bootstrap = PyObject_GetAttrString(interp->importlib, "_bootstrap_external"); if (bootstrap != NULL) { diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 814e4abad58e2..6b3a1c38b9d9b 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -847,7 +847,7 @@ static PyObject * sys_getfilesystemencoding_impl(PyObject *module) /*[clinic end generated code: output=1dc4bdbe9be44aa7 input=8475f8649b8c7d8c]*/ { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); const PyConfig *config = _PyInterpreterState_GetConfig(interp); return PyUnicode_FromWideChar(config->filesystem_encoding, -1); } @@ -862,7 +862,7 @@ static PyObject * sys_getfilesystemencodeerrors_impl(PyObject *module) /*[clinic end generated code: output=ba77b36bbf7c96f5 input=22a1e8365566f1e5]*/ { - PyInterpreterState *interp = _PyInterpreterState_GET_UNSAFE(); + PyInterpreterState *interp = _PyInterpreterState_GET(); const PyConfig *config = _PyInterpreterState_GetConfig(interp); return PyUnicode_FromWideChar(config->filesystem_errors, -1); } diff --git a/Python/thread.c b/Python/thread.c index ec6909c41b88f..bac0e6992ae02 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -92,7 +92,7 @@ PyThread_init_thread(void) size_t PyThread_get_stacksize(void) { - return _PyInterpreterState_GET_UNSAFE()->pythread_stacksize; + return _PyInterpreterState_GET()->pythread_stacksize; } /* Only platforms defining a THREAD_SET_STACKSIZE() macro diff --git a/Python/thread_nt.h b/Python/thread_nt.h index e4bd0f70581ee..05b982d32dc52 100644 --- a/Python/thread_nt.h +++ b/Python/thread_nt.h @@ -359,13 +359,13 @@ _pythread_nt_set_stacksize(size_t size) { /* set to default */ if (size == 0) { - _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = 0; + _PyInterpreterState_GET()->pythread_stacksize = 0; return 0; } /* valid range? */ if (size >= THREAD_MIN_STACKSIZE && size < THREAD_MAX_STACKSIZE) { - _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = size; + _PyInterpreterState_GET()->pythread_stacksize = size; return 0; } diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 440d845312a7d..cf4e854d829cb 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -735,7 +735,7 @@ _pythread_pthread_set_stacksize(size_t size) /* set to default */ if (size == 0) { - _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = 0; + _PyInterpreterState_GET()->pythread_stacksize = 0; return 0; } @@ -752,7 +752,7 @@ _pythread_pthread_set_stacksize(size_t size) rc = pthread_attr_setstacksize(&attrs, size); pthread_attr_destroy(&attrs); if (rc == 0) { - _PyInterpreterState_GET_UNSAFE()->pythread_stacksize = size; + _PyInterpreterState_GET()->pythread_stacksize = size; return 0; } } From webhook-mailer at python.org Tue Apr 14 09:16:00 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Tue, 14 Apr 2020 13:16:00 -0000 Subject: [Python-checkins] bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19477) Message-ID: https://github.com/python/cpython/commit/e1945307d36849f8be8937144cf3dd6ebab6274c commit: e1945307d36849f8be8937144cf3dd6ebab6274c branch: master author: Dong-hee Na committer: GitHub date: 2020-04-14T22:15:52+09:00 summary: bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19477) files: M Lib/multiprocessing/util.py diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index 32c7a96d2534d..21f2a7ebe2500 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -367,13 +367,13 @@ def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers, class ForkAwareThreadLock(object): def __init__(self): - self._reset() - register_after_fork(self, ForkAwareThreadLock._reset) - - def _reset(self): self._lock = threading.Lock() self.acquire = self._lock.acquire self.release = self._lock.release + register_after_fork(self, ForkAwareThreadLock._at_fork_reinit) + + def _at_fork_reinit(self): + self._lock._at_fork_reinit() def __enter__(self): return self._lock.__enter__() From webhook-mailer at python.org Tue Apr 14 11:52:20 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 15:52:20 -0000 Subject: [Python-checkins] bpo-40268: Remove a few pycore_pystate.h includes (GH-19510) Message-ID: https://github.com/python/cpython/commit/e5014be0497d06d78343623588a80f491a6f7b74 commit: e5014be0497d06d78343623588a80f491a6f7b74 branch: master author: Victor Stinner committer: GitHub date: 2020-04-14T17:52:15+02:00 summary: bpo-40268: Remove a few pycore_pystate.h includes (GH-19510) files: M Modules/_functoolsmodule.c M Modules/_io/bufferedio.c M Modules/_io/textio.c M Modules/_threadmodule.c M Modules/gcmodule.c M Modules/getpath.c M Modules/main.c M Modules/posixmodule.c M Modules/signalmodule.c M Objects/abstract.c M Objects/call.c M Objects/cellobject.c M Objects/classobject.c M Objects/descrobject.c M Objects/dictobject.c M Objects/exceptions.c M Objects/fileobject.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genobject.c M Objects/interpreteridobject.c M Objects/iterobject.c M Objects/listobject.c M Objects/memoryobject.c M Objects/methodobject.c M Objects/moduleobject.c M Objects/object.c M Objects/odictobject.c M Objects/setobject.c M Objects/sliceobject.c M Objects/tupleobject.c M Objects/typeobject.c M Objects/unicodeobject.c M PC/getpathp.c M Parser/listnode.c M Parser/myreadline.c M Programs/_testembed.c M Python/_warnings.c M Python/bltinmodule.c M Python/ceval.c M Python/codecs.c M Python/context.c M Python/errors.c M Python/frozenmain.c M Python/hamt.c M Python/import.c M Python/initconfig.c M Python/pathconfig.c M Python/preconfig.c M Python/pylifecycle.c M Python/pystate.c M Python/pythonrun.c M Python/symtable.c M Python/sysmodule.c M Python/thread.c M Python/traceback.c diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 2f1b47a5b061d..d9536bb4e92d0 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,6 +1,6 @@ #include "Python.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "structmember.h" diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 6e76db42c3a60..4ec42eb01082c 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -10,7 +10,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_object.h" -#include "pycore_pystate.h" #include "structmember.h" #include "pythread.h" #include "_iomodule.h" diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 95b023d17908e..9e33c1ed17b0f 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -8,8 +8,9 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_interp.h" // PyInterpreterState.fs_codec #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "structmember.h" #include "_iomodule.h" diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 5636140dde4d3..8ff06698a807c 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -5,7 +5,7 @@ #include "Python.h" #include "pycore_pylifecycle.h" #include "pycore_interp.h" // _PyInterpreterState.num_threads -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_Init() #include "pythread.h" #include // offsetof() diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 17541824761a1..281ab33e06523 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -26,13 +26,14 @@ #include "Python.h" #include "pycore_context.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // PyInterpreterState.gc #include "pycore_object.h" #include "pycore_pyerrors.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_pymem.h" -#include "pycore_pystate.h" -#include "frameobject.h" /* for PyFrame_ClearFreeList */ +#include "frameobject.h" // PyFrame_ClearFreeList #include "pydtrace.h" -#include "pytime.h" /* for _PyTime_GetMonotonicClock() */ +#include "pytime.h" // _PyTime_GetMonotonicClock() typedef struct _gc_runtime_state GCState; diff --git a/Modules/getpath.c b/Modules/getpath.c index e97ea8b30799d..1dd8dd0134e7c 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -1,11 +1,10 @@ /* Return the initial module search path. */ #include "Python.h" -#include "pycore_initconfig.h" -#include "osdefs.h" #include "pycore_fileutils.h" +#include "pycore_initconfig.h" #include "pycore_pathconfig.h" -#include "pycore_pystate.h" +#include "osdefs.h" #include #include diff --git a/Modules/main.c b/Modules/main.c index fb24c6c6c2892..fa9c6b4eb9418 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -6,7 +6,7 @@ #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() /* Includes for exit_sigint() */ #include /* perror() */ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2d603d14e8df5..692dda314b304 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -37,7 +37,7 @@ #include "pycore_ceval.h" /* _PyEval_ReInitThreads() */ #include "pycore_import.h" /* _PyImport_ReInitLock() */ -#include "pycore_pystate.h" /* _PyRuntime */ +#include "pycore_pystate.h" /* _PyInterpreterState_GET() */ #include "pythread.h" #include "structmember.h" #ifndef MS_WINDOWS diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index ceb986bddcbd3..69d69ace28ebb 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -8,7 +8,7 @@ #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #ifndef MS_WINDOWS #include "posixmodule.h" diff --git a/Objects/abstract.c b/Objects/abstract.c index 7e1e51b4c87c2..8e22dfeca99b4 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -4,7 +4,7 @@ #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include #include "structmember.h" /* we need the offsetof() macro from there */ #include "longintrepr.h" diff --git a/Objects/call.c b/Objects/call.c index 0861414324609..61426c7e09e4e 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -1,9 +1,9 @@ #include "Python.h" #include "pycore_call.h" -#include "pycore_ceval.h" /* _PyEval_EvalFrame() */ +#include "pycore_ceval.h" // _PyEval_EvalFrame() #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "frameobject.h" diff --git a/Objects/cellobject.c b/Objects/cellobject.c index e97feefbf6d04..6efae626bf5b7 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" PyObject * PyCell_New(PyObject *obj) diff --git a/Objects/classobject.c b/Objects/classobject.c index 999b91c0a2dc8..ce4bf7b5ff97c 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -4,7 +4,7 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" #define TP_DESCR_GET(t) ((t)->tp_descr_get) diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 5fab222b82cae..fe7ba79770a6a 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1,9 +1,9 @@ /* Descriptors -- a new, flexible way to describe attributes */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "structmember.h" /* Why is this not included in Python.h? */ diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 60660adf897c3..8f9d4e7b73140 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -111,10 +111,11 @@ converting the dict to the combined table. #define PyDict_MINSIZE 8 #include "Python.h" +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "dict-common.h" -#include "stringlib/eq.h" /* to get unicode_eq() */ +#include "stringlib/eq.h" // unicode_eq() /*[clinic input] class dict "PyDictObject *" "&PyDict_Type" diff --git a/Objects/exceptions.c b/Objects/exceptions.c index dad177a1ab606..cb661f84ff2de 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -9,7 +9,6 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "structmember.h" #include "osdefs.h" diff --git a/Objects/fileobject.c b/Objects/fileobject.c index b8ec56e994ca6..1c6ecaf82c24e 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -2,7 +2,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_runtime.h" // _PyRuntime #if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER) /* clang MemorySanitizer doesn't yet understand getc_unlocked. */ diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 340267bd47907..3c140acad7ea6 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -2,7 +2,7 @@ #include "Python.h" #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() #include "code.h" #include "frameobject.h" diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 3ec949d573bf5..af6766fbd7a9f 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -4,7 +4,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "pycore_tupleobject.h" #include "code.h" #include "structmember.h" diff --git a/Objects/genobject.c b/Objects/genobject.c index d3455f8dcd792..b1a749d140e82 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1,9 +1,9 @@ /* Generator object implementation */ #include "Python.h" -#include "pycore_ceval.h" /* _PyEval_EvalFrame() */ +#include "pycore_ceval.h" // _PyEval_EvalFrame() #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "structmember.h" #include "opcode.h" diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c index 84fd85845207a..a250293a47277 100644 --- a/Objects/interpreteridobject.c +++ b/Objects/interpreteridobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_interp.h" // _PyInterpreterState_LookUpID() -#include "pycore_pystate.h" #include "interpreteridobject.h" diff --git a/Objects/iterobject.c b/Objects/iterobject.c index fe1de7e211c5d..51104fbe9695f 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" typedef struct { PyObject_HEAD diff --git a/Objects/listobject.c b/Objects/listobject.c index 7058fe4396eec..7d2f006617ba5 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" -#include "pycore_pystate.h" #include "pycore_tupleobject.h" #include "pycore_accu.h" diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index da06338017cae..4340f0675f163 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -14,7 +14,6 @@ #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "pystrhex.h" #include diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 44ae00f7e0023..4b4927db82094 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -2,11 +2,11 @@ /* Method object implementation */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" /* undefine macro trampoline to PyCFunction_NewEx */ diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 1f419ad08317e..499ce09ae6b5b 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -3,7 +3,7 @@ #include "Python.h" #include "pycore_interp.h" // PyInterpreterState.importlib -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "structmember.h" static Py_ssize_t max_module_number; diff --git a/Objects/object.c b/Objects/object.c index ef4ba997de427..4fa488e8d08b6 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2,13 +2,13 @@ /* Generic object operations; and implementation of None */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_context.h" #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "interpreteridobject.h" diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 220ae92ec9296..2fcaa47876513 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -466,7 +466,6 @@ Potential Optimizations #include "Python.h" #include "pycore_object.h" -#include "pycore_pystate.h" #include "structmember.h" #include "dict-common.h" #include @@ -890,7 +889,7 @@ odict_inplace_or(PyObject *self, PyObject *other) if (mutablemapping_update_arg(self, other) < 0) { return NULL; } - Py_INCREF(self); + Py_INCREF(self); return self; } diff --git a/Objects/setobject.c b/Objects/setobject.c index 232ba6d97a070..0b15bedeb4ff3 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -32,8 +32,7 @@ */ #include "Python.h" -#include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_object.h" // _PyObject_GC_UNTRACK() #include "structmember.h" /* Object used as dummy key to fill deleted entries */ diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 4fd216388fdfd..0a5f00dbe0a39 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -17,7 +17,6 @@ this type and there is exactly one in existence. #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "structmember.h" static PyObject * diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 110c0925ccd94..b65b8abc2806d 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -3,9 +3,9 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_object.h" -#include "pycore_pystate.h" #include "pycore_accu.h" +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() +#include "pycore_object.h" /*[clinic input] class tuple "PyTupleObject *" "&PyTuple_Type" diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 209c6a554eedd..47766bf6fbbbf 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5,7 +5,7 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "structmember.h" diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 28ec8f10dcb3d..51775df199d1e 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -40,14 +40,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_fileutils.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // PyInterpreterState.fs_codec #include "pycore_object.h" #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "ucnhash.h" #include "stringlib/eq.h" diff --git a/PC/getpathp.c b/PC/getpathp.c index aa820e57a9cb2..24a9323e6e67e 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -82,7 +82,6 @@ #include "Python.h" #include "pycore_initconfig.h" /* PyStatus */ #include "pycore_pathconfig.h" /* _PyPathConfig */ -#include "pycore_pystate.h" #include "osdefs.h" #include diff --git a/Parser/listnode.c b/Parser/listnode.c index 3bcc03e93526a..c806b98e48c35 100644 --- a/Parser/listnode.c +++ b/Parser/listnode.c @@ -2,8 +2,8 @@ /* List a node on a file */ #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.parser -#include "pycore_pystate.h" // _PyInterpreterState_GET +#include "pycore_interp.h" // PyInterpreterState.parser +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "token.h" #include "node.h" diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 43e5583b8bcc4..7da8ea8378065 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -10,10 +10,10 @@ */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #ifdef MS_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include "windows.h" +# define WIN32_LEAN_AND_MEAN +# include "windows.h" #endif /* MS_WINDOWS */ diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 900a4b1d427a6..da3e7861d1e80 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -6,8 +6,8 @@ #undef NDEBUG #include -#include "pycore_initconfig.h" /* _PyConfig_InitCompatConfig() */ -#include "pycore_pystate.h" /* _PyRuntime */ +#include "pycore_initconfig.h" // _PyConfig_InitCompatConfig() +#include "pycore_runtime.h" // _PyRuntime #include #include "pythread.h" #include diff --git a/Python/_warnings.c b/Python/_warnings.c index 0236cabdf11c2..f4ef0bb4b1214 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -2,7 +2,7 @@ #include "pycore_initconfig.h" #include "pycore_interp.h" // PyInterpreterState.warnings #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "clinic/_warnings.c.h" diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 8063c2186d3e6..a9fc21f108774 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -6,7 +6,7 @@ #undef Yield /* undefine macro conflicting with */ #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" _Py_IDENTIFIER(__builtins__); diff --git a/Python/ceval.c b/Python/ceval.c index fc720b4ba403a..16e2d0b1fbea9 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -10,7 +10,7 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_code.h" @@ -18,7 +18,7 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "pycore_tupleobject.h" diff --git a/Python/codecs.c b/Python/codecs.c index 32cc110d8ec13..0f18c27e5fe46 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -9,8 +9,8 @@ Copyright (c) Corporation for National Research Initiatives. ------------------------------------------------------------------------ */ #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.codec_search_path -#include "pycore_pystate.h" +#include "pycore_interp.h" // PyInterpreterState.codec_search_path +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "ucnhash.h" #include diff --git a/Python/context.c b/Python/context.c index e0338c97e1873..00f25ddab41d1 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1,10 +1,11 @@ #include "Python.h" #include "pycore_context.h" +#include "pycore_gc.h" // _PyObject_GC_MAY_BE_TRACKED() #include "pycore_hamt.h" #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" diff --git a/Python/errors.c b/Python/errors.c index a2fe52b812006..db007709d263e 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -4,7 +4,7 @@ #include "Python.h" #include "pycore_initconfig.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" #include "pycore_traceback.h" diff --git a/Python/frozenmain.c b/Python/frozenmain.c index 508721b855902..dd04d609d24f9 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -2,7 +2,7 @@ /* Python interpreter main program for frozen scripts */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_runtime.h" // _PyRuntime_Initialize() #include #ifdef MS_WINDOWS diff --git a/Python/hamt.c b/Python/hamt.c index 729981033f4a7..9924e3351243e 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -1,8 +1,7 @@ #include "Python.h" #include "pycore_hamt.h" -#include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_object.h" // _PyObject_GC_TRACK() #include "structmember.h" /* diff --git a/Python/import.c b/Python/import.c index 042691d30b0de..8a2f9de066a68 100644 --- a/Python/import.c +++ b/Python/import.c @@ -9,8 +9,8 @@ #include "pycore_pyhash.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_interp.h" // _PyInterpreterState_ClearModules() -#include "pycore_pystate.h" +#include "pycore_interp.h" // _PyInterpreterState_ClearModules() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "errcode.h" #include "marshal.h" diff --git a/Python/initconfig.c b/Python/initconfig.c index 43e0ccb09b7c2..201d930f7d8d2 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -1,25 +1,25 @@ #include "Python.h" -#include "osdefs.h" /* DELIM */ +#include "osdefs.h" // DELIM #include "pycore_fileutils.h" #include "pycore_getopt.h" #include "pycore_initconfig.h" -#include "pycore_interp.h" // _PyInterpreterState.runtime +#include "pycore_interp.h" // _PyInterpreterState.runtime #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" /* _PyRuntime */ -#include /* setlocale() */ +#include "pycore_pystate.h" // _PyThreadState_GET() +#include // setlocale() #ifdef HAVE_LANGINFO_H -# include /* nl_langinfo(CODESET) */ +# include // nl_langinfo(CODESET) #endif #if defined(MS_WINDOWS) || defined(__CYGWIN__) -# include /* GetACP() */ +# include // GetACP() # ifdef HAVE_IO_H # include # endif # ifdef HAVE_FCNTL_H -# include /* O_BINARY */ +# include // O_BINARY # endif #endif diff --git a/Python/pathconfig.c b/Python/pathconfig.c index aa1d6f8139bcc..1515926531a1c 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -6,8 +6,10 @@ #include "pycore_fileutils.h" #include "pycore_pathconfig.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include +#ifdef MS_WINDOWS +# include // GetFullPathNameW(), MAX_PATH +#endif #ifdef __cplusplus extern "C" { diff --git a/Python/preconfig.c b/Python/preconfig.c index db328759c13a1..531d8d0df3504 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -2,7 +2,7 @@ #include "pycore_getopt.h" #include "pycore_initconfig.h" #include "pycore_pymem.h" // _PyMem_GetAllocatorName() -#include "pycore_pystate.h" // _PyRuntime_Initialize() +#include "pycore_runtime.h" // _PyRuntime_Initialize() #include // setlocale() diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index ac0ea107bcf90..754e7620a0cc0 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -6,7 +6,7 @@ #undef Yield /* undefine macro conflicting with */ #include "pycore_ceval.h" #include "pycore_context.h" -#include "pycore_import.h" /* _PyImport_FindBuiltin */ +#include "pycore_import.h" // _PyImport_Cleanup() #include "pycore_initconfig.h" #include "pycore_fileutils.h" #include "pycore_hamt.h" @@ -15,7 +15,7 @@ #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" #include "pycore_traceback.h" #include "grammar.h" diff --git a/Python/pystate.c b/Python/pystate.c index 65d46a2bb4248..3c427c1210714 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -7,7 +7,7 @@ #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" /* -------------------------------------------------------------------------- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d1165e2b4d2f3..246669994c4dd 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -12,10 +12,11 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with */ +#include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "grammar.h" #include "node.h" diff --git a/Python/symtable.c b/Python/symtable.c index 014570e6ef78f..a3c5d650d1edc 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "symtable.h" #undef Yield /* undefine macro conflicting with */ #include "structmember.h" diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 6b3a1c38b9d9b..79e5df06d3037 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -18,13 +18,12 @@ Data members: #include "code.h" #include "frameobject.h" #include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" #include "pycore_initconfig.h" #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "pythread.h" #include "pydtrace.h" diff --git a/Python/thread.c b/Python/thread.c index bac0e6992ae02..127610318663d 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -6,7 +6,7 @@ Stuff shared by all thread_*.h files is collected here. */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #ifndef _POSIX_THREADS /* This means pthreads are not implemented in libc headers, hence the macro diff --git a/Python/traceback.c b/Python/traceback.c index 2167e07a9b85d..610c2172ef833 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -2,7 +2,6 @@ /* Traceback implementation */ #include "Python.h" -#include "pycore_pystate.h" #include "code.h" #include "frameobject.h" From webhook-mailer at python.org Tue Apr 14 12:16:28 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Tue, 14 Apr 2020 16:16:28 -0000 Subject: [Python-checkins] bpo-40232: Update PyOS_AfterFork_Child() to use _PyThread_at_fork_reinit() (GH-19450) Message-ID: https://github.com/python/cpython/commit/62f75fe3dd138f72303814d27183aa469eefcca6 commit: 62f75fe3dd138f72303814d27183aa469eefcca6 branch: master author: Dong-hee Na committer: GitHub date: 2020-04-15T01:16:24+09:00 summary: bpo-40232: Update PyOS_AfterFork_Child() to use _PyThread_at_fork_reinit() (GH-19450) files: M Include/internal/pycore_ceval.h M Include/internal/pycore_import.h M Include/internal/pycore_runtime.h M Python/ceval.c M Python/import.c M Python/pystate.c diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 298018a872b1a..050dd59ed15f0 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -25,8 +25,9 @@ PyAPI_FUNC(int) _PyEval_AddPendingCall( int (*func)(void *), void *arg); PyAPI_FUNC(void) _PyEval_SignalAsyncExc(PyThreadState *tstate); -PyAPI_FUNC(void) _PyEval_ReInitThreads( - struct pyruntimestate *runtime); +#ifdef HAVE_FORK +extern void _PyEval_ReInitThreads(struct pyruntimestate *runtime); +#endif PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth( PyThreadState *tstate, int new_depth); diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h index 5d3203e5b97fd..b011ea4425112 100644 --- a/Include/internal/pycore_import.h +++ b/Include/internal/pycore_import.h @@ -10,7 +10,9 @@ PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin( const char *name /* UTF-8 encoded string */ ); +#ifdef HAVE_FORK extern void _PyImport_ReInitLock(void); +#endif extern void _PyImport_Cleanup(PyThreadState *tstate); #ifdef __cplusplus diff --git a/Include/internal/pycore_runtime.h b/Include/internal/pycore_runtime.h index 54dbaeb77c73f..995fe231c3214 100644 --- a/Include/internal/pycore_runtime.h +++ b/Include/internal/pycore_runtime.h @@ -117,8 +117,9 @@ PyAPI_DATA(_PyRuntimeState) _PyRuntime; PyAPI_FUNC(PyStatus) _PyRuntimeState_Init(_PyRuntimeState *runtime); PyAPI_FUNC(void) _PyRuntimeState_Fini(_PyRuntimeState *runtime); +#ifdef HAVE_FORK PyAPI_FUNC(void) _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime); - +#endif /* Initialize _PyRuntimeState. Return NULL on success, or return an error message on failure. */ diff --git a/Python/ceval.c b/Python/ceval.c index 16e2d0b1fbea9..77b7a83869e80 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -397,6 +397,7 @@ PyEval_ReleaseThread(PyThreadState *tstate) drop_gil(&runtime->ceval, tstate); } +#ifdef HAVE_FORK /* This function is called from PyOS_AfterFork_Child to destroy all threads * which are not running in the child process, and clear internal locks * which might be held by those threads. @@ -416,14 +417,14 @@ _PyEval_ReInitThreads(_PyRuntimeState *runtime) take_gil(tstate); struct _pending_calls *pending = &tstate->interp->ceval.pending; - pending->lock = PyThread_allocate_lock(); - if (pending->lock == NULL) { + if (_PyThread_at_fork_reinit(&pending->lock) < 0) { Py_FatalError("Can't initialize threads for pending calls"); } /* Destroy all threads except the current one */ _PyThreadState_DeleteExcept(runtime, tstate); } +#endif /* This function is used to signal that async exceptions are waiting to be raised. */ diff --git a/Python/import.c b/Python/import.c index 8a2f9de066a68..49334637d6754 100644 --- a/Python/import.c +++ b/Python/import.c @@ -200,6 +200,7 @@ _PyImport_ReleaseLock(void) return 1; } +#ifdef HAVE_FORK /* This function is called from PyOS_AfterFork_Child to ensure that newly created child processes do not share locks with the parent. We now acquire the import lock around fork() calls but on some platforms @@ -209,8 +210,7 @@ void _PyImport_ReInitLock(void) { if (import_lock != NULL) { - import_lock = PyThread_allocate_lock(); - if (import_lock == NULL) { + if (_PyThread_at_fork_reinit(&import_lock) < 0) { _Py_FatalErrorFunc(__func__, "failed to create a new lock"); } } @@ -229,6 +229,7 @@ _PyImport_ReInitLock(void) import_lock_level = 0; } } +#endif /*[clinic input] _imp.lock_held diff --git a/Python/pystate.c b/Python/pystate.c index 3c427c1210714..d25fb3a2a626e 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -132,6 +132,7 @@ _PyRuntimeState_Fini(_PyRuntimeState *runtime) PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); } +#ifdef HAVE_FORK /* This function is called from PyOS_AfterFork_Child to ensure that * newly created child processes do not share locks with the parent. */ @@ -147,24 +148,25 @@ _PyRuntimeState_ReInitThreads(_PyRuntimeState *runtime) PyMemAllocatorEx old_alloc; _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - runtime->interpreters.mutex = PyThread_allocate_lock(); - runtime->interpreters.main->id_mutex = PyThread_allocate_lock(); - runtime->xidregistry.mutex = PyThread_allocate_lock(); + int interp_mutex = _PyThread_at_fork_reinit(&runtime->interpreters.mutex); + int main_interp_id_mutex = _PyThread_at_fork_reinit(&runtime->interpreters.main->id_mutex); + int xidregistry_mutex = _PyThread_at_fork_reinit(&runtime->xidregistry.mutex); PyMem_SetAllocator(PYMEM_DOMAIN_RAW, &old_alloc); - if (runtime->interpreters.mutex == NULL) { + if (interp_mutex < 0) { Py_FatalError("Can't initialize lock for runtime interpreters"); } - if (runtime->interpreters.main->id_mutex == NULL) { + if (main_interp_id_mutex < 0) { Py_FatalError("Can't initialize ID lock for main interpreter"); } - if (runtime->xidregistry.mutex == NULL) { + if (xidregistry_mutex < 0) { Py_FatalError("Can't initialize lock for cross-interpreter data registry"); } } +#endif #define HEAD_LOCK(runtime) \ PyThread_acquire_lock((runtime)->interpreters.mutex, WAIT_LOCK) From webhook-mailer at python.org Tue Apr 14 12:30:02 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 16:30:02 -0000 Subject: [Python-checkins] regrtest: log timeout at startup (GH-19514) Message-ID: https://github.com/python/cpython/commit/4cf65a630a8d45bad3fe5cdc4c2632ec64e7ba27 commit: 4cf65a630a8d45bad3fe5cdc4c2632ec64e7ba27 branch: master author: Victor Stinner committer: GitHub date: 2020-04-14T18:29:44+02:00 summary: regrtest: log timeout at startup (GH-19514) Reduce also worker timeout. files: M Lib/test/libregrtest/main.py M Lib/test/libregrtest/runtest_mp.py diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 1de51b740a98c..95b4856c8bed7 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -394,7 +394,10 @@ def run_tests_sequential(self): save_modules = sys.modules.keys() - self.log("Run tests sequentially") + msg = "Run tests sequentially" + if self.ns.timeout: + msg += " (timeout: %s)" % format_duration(self.ns.timeout) + self.log(msg) previous_test = None for test_index, test_name in enumerate(self.tests, 1): diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index fc12ea7c5fc14..7a18e45434bb4 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -352,7 +352,11 @@ def __init__(self, regrtest): self.output = queue.Queue() self.pending = MultiprocessIterator(self.regrtest.tests) if self.ns.timeout is not None: - self.worker_timeout = self.ns.timeout * 1.5 + # Rely on faulthandler to kill a worker process. This timouet is + # when faulthandler fails to kill a worker process. Give a maximum + # of 5 minutes to faulthandler to kill the worker. + self.worker_timeout = min(self.ns.timeout * 1.5, + self.ns.timeout + 5 * 60) else: self.worker_timeout = None self.workers = None @@ -360,8 +364,12 @@ def __init__(self, regrtest): def start_workers(self): self.workers = [TestWorkerProcess(index, self) for index in range(1, self.ns.use_mp + 1)] - self.log("Run tests in parallel using %s child processes" - % len(self.workers)) + msg = f"Run tests in parallel using {len(self.workers)} child processes" + if self.ns.timeout: + msg += (" (timeout: %s, worker timeout: %s)" + % (format_duration(self.ns.timeout), + format_duration(self.worker_timeout))) + self.log(msg) for worker in self.workers: worker.start() From webhook-mailer at python.org Tue Apr 14 12:30:45 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 16:30:45 -0000 Subject: [Python-checkins] bpo-40268: Move struct _gc_runtime_state to pycore_gc.h (GH-19515) Message-ID: https://github.com/python/cpython/commit/e560f90602870601945ea7a4f7770827608817d2 commit: e560f90602870601945ea7a4f7770827608817d2 branch: master author: Victor Stinner committer: GitHub date: 2020-04-14T18:30:41+02:00 summary: bpo-40268: Move struct _gc_runtime_state to pycore_gc.h (GH-19515) files: M Include/internal/pycore_gc.h M Include/internal/pycore_interp.h M Include/internal/pycore_pymem.h M Modules/_tracemalloc.c M Objects/object.c M Python/ceval.c diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h index 7309205ed1229..62b8800e24998 100644 --- a/Include/internal/pycore_gc.h +++ b/Include/internal/pycore_gc.h @@ -63,6 +63,106 @@ typedef struct { #define _PyGC_SET_FINALIZED(o) \ _PyGCHead_SET_FINALIZED(_Py_AS_GC(o)) + +/* GC runtime state */ + +/* If we change this, we need to change the default value in the + signature of gc.collect. */ +#define NUM_GENERATIONS 3 +/* + NOTE: about untracking of mutable objects. + + Certain types of container cannot participate in a reference cycle, and + so do not need to be tracked by the garbage collector. Untracking these + objects reduces the cost of garbage collections. However, determining + which objects may be untracked is not free, and the costs must be + weighed against the benefits for garbage collection. + + There are two possible strategies for when to untrack a container: + + i) When the container is created. + ii) When the container is examined by the garbage collector. + + Tuples containing only immutable objects (integers, strings etc, and + recursively, tuples of immutable objects) do not need to be tracked. + The interpreter creates a large number of tuples, many of which will + not survive until garbage collection. It is therefore not worthwhile + to untrack eligible tuples at creation time. + + Instead, all tuples except the empty tuple are tracked when created. + During garbage collection it is determined whether any surviving tuples + can be untracked. A tuple can be untracked if all of its contents are + already not tracked. Tuples are examined for untracking in all garbage + collection cycles. It may take more than one cycle to untrack a tuple. + + Dictionaries containing only immutable objects also do not need to be + tracked. Dictionaries are untracked when created. If a tracked item is + inserted into a dictionary (either as a key or value), the dictionary + becomes tracked. During a full garbage collection (all generations), + the collector will untrack any dictionaries whose contents are not + tracked. + + The module provides the python function is_tracked(obj), which returns + the CURRENT tracking status of the object. Subsequent garbage + collections may change the tracking status of the object. + + Untracking of certain containers was introduced in issue #4688, and + the algorithm was refined in response to issue #14775. +*/ + +struct gc_generation { + PyGC_Head head; + int threshold; /* collection threshold */ + int count; /* count of allocations or collections of younger + generations */ +}; + +/* Running stats per generation */ +struct gc_generation_stats { + /* total number of collections */ + Py_ssize_t collections; + /* total number of collected objects */ + Py_ssize_t collected; + /* total number of uncollectable objects (put into gc.garbage) */ + Py_ssize_t uncollectable; +}; + +struct _gc_runtime_state { + /* List of objects that still need to be cleaned up, singly linked + * via their gc headers' gc_prev pointers. */ + PyObject *trash_delete_later; + /* Current call-stack depth of tp_dealloc calls. */ + int trash_delete_nesting; + + int enabled; + int debug; + /* linked lists of container objects */ + struct gc_generation generations[NUM_GENERATIONS]; + PyGC_Head *generation0; + /* a permanent generation which won't be collected */ + struct gc_generation permanent_generation; + struct gc_generation_stats generation_stats[NUM_GENERATIONS]; + /* true if we are currently running the collector */ + int collecting; + /* list of uncollectable objects */ + PyObject *garbage; + /* a list of callbacks to be invoked when collection is performed */ + PyObject *callbacks; + /* This is the number of objects that survived the last full + collection. It approximates the number of long lived objects + tracked by the GC. + + (by "full collection", we mean a collection of the oldest + generation). */ + Py_ssize_t long_lived_total; + /* This is the number of objects that survived all "non-full" + collections, and are awaiting to undergo a full collection for + the first time. */ + Py_ssize_t long_lived_pending; +}; + +PyAPI_FUNC(void) _PyGC_InitState(struct _gc_runtime_state *); + #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index d720829f3f295..c6fc6aff5ab25 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -10,7 +10,7 @@ extern "C" { #include "pycore_atomic.h" /* _Py_atomic_address */ #include "pycore_gil.h" /* struct _gil_runtime_state */ -#include "pycore_pymem.h" /* struct _gc_runtime_state */ +#include "pycore_gc.h" /* struct _gc_runtime_state */ #include "pycore_warnings.h" /* struct _warnings_runtime_state */ /* ceval state */ diff --git a/Include/internal/pycore_pymem.h b/Include/internal/pycore_pymem.h index 34a17d5ae0979..18203e30f5cfe 100644 --- a/Include/internal/pycore_pymem.h +++ b/Include/internal/pycore_pymem.h @@ -9,107 +9,6 @@ extern "C" { #endif #include "pymem.h" // PyMemAllocatorName -#include "pycore_gc.h" // PyGC_Head - - -/* GC runtime state */ - -/* If we change this, we need to change the default value in the - signature of gc.collect. */ -#define NUM_GENERATIONS 3 -/* - NOTE: about untracking of mutable objects. - - Certain types of container cannot participate in a reference cycle, and - so do not need to be tracked by the garbage collector. Untracking these - objects reduces the cost of garbage collections. However, determining - which objects may be untracked is not free, and the costs must be - weighed against the benefits for garbage collection. - - There are two possible strategies for when to untrack a container: - - i) When the container is created. - ii) When the container is examined by the garbage collector. - - Tuples containing only immutable objects (integers, strings etc, and - recursively, tuples of immutable objects) do not need to be tracked. - The interpreter creates a large number of tuples, many of which will - not survive until garbage collection. It is therefore not worthwhile - to untrack eligible tuples at creation time. - - Instead, all tuples except the empty tuple are tracked when created. - During garbage collection it is determined whether any surviving tuples - can be untracked. A tuple can be untracked if all of its contents are - already not tracked. Tuples are examined for untracking in all garbage - collection cycles. It may take more than one cycle to untrack a tuple. - - Dictionaries containing only immutable objects also do not need to be - tracked. Dictionaries are untracked when created. If a tracked item is - inserted into a dictionary (either as a key or value), the dictionary - becomes tracked. During a full garbage collection (all generations), - the collector will untrack any dictionaries whose contents are not - tracked. - - The module provides the python function is_tracked(obj), which returns - the CURRENT tracking status of the object. Subsequent garbage - collections may change the tracking status of the object. - - Untracking of certain containers was introduced in issue #4688, and - the algorithm was refined in response to issue #14775. -*/ - -struct gc_generation { - PyGC_Head head; - int threshold; /* collection threshold */ - int count; /* count of allocations or collections of younger - generations */ -}; - -/* Running stats per generation */ -struct gc_generation_stats { - /* total number of collections */ - Py_ssize_t collections; - /* total number of collected objects */ - Py_ssize_t collected; - /* total number of uncollectable objects (put into gc.garbage) */ - Py_ssize_t uncollectable; -}; - -struct _gc_runtime_state { - /* List of objects that still need to be cleaned up, singly linked - * via their gc headers' gc_prev pointers. */ - PyObject *trash_delete_later; - /* Current call-stack depth of tp_dealloc calls. */ - int trash_delete_nesting; - - int enabled; - int debug; - /* linked lists of container objects */ - struct gc_generation generations[NUM_GENERATIONS]; - PyGC_Head *generation0; - /* a permanent generation which won't be collected */ - struct gc_generation permanent_generation; - struct gc_generation_stats generation_stats[NUM_GENERATIONS]; - /* true if we are currently running the collector */ - int collecting; - /* list of uncollectable objects */ - PyObject *garbage; - /* a list of callbacks to be invoked when collection is performed */ - PyObject *callbacks; - /* This is the number of objects that survived the last full - collection. It approximates the number of long lived objects - tracked by the GC. - - (by "full collection", we mean a collection of the oldest - generation). */ - Py_ssize_t long_lived_total; - /* This is the number of objects that survived all "non-full" - collections, and are awaiting to undergo a full collection for - the first time. */ - Py_ssize_t long_lived_pending; -}; - -PyAPI_FUNC(void) _PyGC_InitState(struct _gc_runtime_state *); /* Set the memory allocator of the specified domain to the default. diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index bef44dbc28bf2..6f3f31a67b518 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -1,5 +1,6 @@ #include "Python.h" -#include "pycore_pymem.h" +#include "pycore_gc.h" // PyGC_Head +#include "pycore_pymem.h" // _Py_tracemalloc_config #include "pycore_traceback.h" #include "hashtable.h" #include "frameobject.h" diff --git a/Objects/object.c b/Objects/object.c index 4fa488e8d08b6..c759ccc568472 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -8,6 +8,7 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" +#include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "interpreteridobject.h" diff --git a/Python/ceval.c b/Python/ceval.c index 77b7a83869e80..505f05cadd1ae 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -10,7 +10,7 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_code.h" @@ -18,7 +18,8 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_pymem.h" // _PyMem_IsPtrFreed() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "pycore_tupleobject.h" From webhook-mailer at python.org Tue Apr 14 12:35:44 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Tue, 14 Apr 2020 16:35:44 -0000 Subject: [Python-checkins] bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19511) Message-ID: https://github.com/python/cpython/commit/a5900ecf9f22e65bef489633692e9ea6941379c5 commit: a5900ecf9f22e65bef489633692e9ea6941379c5 branch: master author: Dong-hee Na committer: GitHub date: 2020-04-15T01:35:36+09:00 summary: bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19511) files: M Lib/multiprocessing/queues.py M Lib/multiprocessing/resource_sharer.py diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index 835070118387e..c0a284d10c807 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -49,8 +49,7 @@ def __init__(self, maxsize=0, *, ctx): self._sem = ctx.BoundedSemaphore(maxsize) # For use by concurrent.futures self._ignore_epipe = False - - self._after_fork() + self._reset() if sys.platform != 'win32': register_after_fork(self, Queue._after_fork) @@ -63,11 +62,17 @@ def __getstate__(self): def __setstate__(self, state): (self._ignore_epipe, self._maxsize, self._reader, self._writer, self._rlock, self._wlock, self._sem, self._opid) = state - self._after_fork() + self._reset() def _after_fork(self): debug('Queue._after_fork()') - self._notempty = threading.Condition(threading.Lock()) + self._reset(after_fork=True) + + def _reset(self, after_fork=False): + if after_fork: + self._notempty._at_fork_reinit() + else: + self._notempty = threading.Condition(threading.Lock()) self._buffer = collections.deque() self._thread = None self._jointhread = None diff --git a/Lib/multiprocessing/resource_sharer.py b/Lib/multiprocessing/resource_sharer.py index 8d5c9900f69fe..66076509a1202 100644 --- a/Lib/multiprocessing/resource_sharer.py +++ b/Lib/multiprocessing/resource_sharer.py @@ -63,7 +63,6 @@ class _ResourceSharer(object): def __init__(self): self._key = 0 self._cache = {} - self._old_locks = [] self._lock = threading.Lock() self._listener = None self._address = None @@ -113,10 +112,7 @@ def _afterfork(self): for key, (send, close) in self._cache.items(): close() self._cache.clear() - # If self._lock was locked at the time of the fork, it may be broken - # -- see issue 6721. Replace it without letting it be gc'ed. - self._old_locks.append(self._lock) - self._lock = threading.Lock() + self._lock._at_fork_reinit() if self._listener is not None: self._listener.close() self._listener = None From webhook-mailer at python.org Tue Apr 14 13:51:26 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 17:51:26 -0000 Subject: [Python-checkins] [3.8] Update libregrtest from master (GH-19516) Message-ID: https://github.com/python/cpython/commit/67b8a1f0f0f78ec38b8626fa9f5b2f5a55c17e15 commit: 67b8a1f0f0f78ec38b8626fa9f5b2f5a55c17e15 branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-14T19:51:18+02:00 summary: [3.8] Update libregrtest from master (GH-19516) * bpo-37531: regrtest now catchs ProcessLookupError (GH-16827) Fix a warning on a race condition on TestWorkerProcess.kill(): ignore silently ProcessLookupError rather than logging an useless warning. (cherry picked from commit a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be) * bpo-38502: regrtest uses process groups if available (GH-16829) test.regrtest now uses process groups in the multiprocessing mode (-jN command line option) if process groups are available: if os.setsid() and os.killpg() functions are available. (cherry picked from commit ecb035cd14c11521276343397151929a94018a22) * bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989) When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored. For these reasons, add a new option to allow to ignore a list of test and subtests for these situations. (cherry picked from commit e0cd8aa70a3ce19c3d3712568940aa0cbd9aa97b) * regrtest: log timeout at startup (GH-19514) Reduce also worker timeout. (cherry picked from commit 4cf65a630a8d45bad3fe5cdc4c2632ec64e7ba27) Co-authored-by: Pablo Galindo files: A Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst A Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst M Lib/test/libregrtest/cmdline.py M Lib/test/libregrtest/main.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/runtest_mp.py M Lib/test/support/__init__.py M Lib/test/test_regrtest.py M Lib/test/test_support.py diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py index c8fedc7ad329b..c0bb051bd0783 100644 --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -207,10 +207,17 @@ def _create_parser(): group.add_argument('-m', '--match', metavar='PAT', dest='match_tests', action='append', help='match test cases and methods with glob pattern PAT') + group.add_argument('-i', '--ignore', metavar='PAT', + dest='ignore_tests', action='append', + help='ignore test cases and methods with glob pattern PAT') group.add_argument('--matchfile', metavar='FILENAME', dest='match_filename', help='similar to --match but get patterns from a ' 'text file, one pattern per line') + group.add_argument('--ignorefile', metavar='FILENAME', + dest='ignore_filename', + help='similar to --matchfile but it receives patterns ' + 'from text file to ignore') group.add_argument('-G', '--failfast', action='store_true', help='fail as soon as a test fails (only with -v or -W)') group.add_argument('-u', '--use', metavar='RES1,RES2,...', @@ -317,7 +324,8 @@ def _parse_args(args, **kwargs): findleaks=1, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, random_seed=None, use_mp=None, verbose3=False, forever=False, - header=False, failfast=False, match_tests=None, pgo=False) + header=False, failfast=False, match_tests=None, ignore_tests=None, + pgo=False) for k, v in kwargs.items(): if not hasattr(ns, k): raise TypeError('%r is an invalid keyword argument ' @@ -395,6 +403,12 @@ def _parse_args(args, **kwargs): with open(ns.match_filename) as fp: for line in fp: ns.match_tests.append(line.strip()) + if ns.ignore_filename: + if ns.ignore_tests is None: + ns.ignore_tests = [] + with open(ns.ignore_filename) as fp: + for line in fp: + ns.ignore_tests.append(line.strip()) if ns.forever: # --forever implies --failfast ns.failfast = True diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 76ad3359f2d7a..95b4856c8bed7 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -287,7 +287,7 @@ def _list_cases(self, suite): def list_cases(self): support.verbose = False - support.set_match_tests(self.ns.match_tests) + support.set_match_tests(self.ns.match_tests, self.ns.ignore_tests) for test_name in self.selected: abstest = get_abs_module(self.ns, test_name) @@ -394,7 +394,10 @@ def run_tests_sequential(self): save_modules = sys.modules.keys() - self.log("Run tests sequentially") + msg = "Run tests sequentially" + if self.ns.timeout: + msg += " (timeout: %s)" % format_duration(self.ns.timeout) + self.log(msg) previous_test = None for test_index, test_name in enumerate(self.tests, 1): diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index eeb108bb44739..558f2099c66f5 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -123,7 +123,7 @@ def _runtest(ns, test_name): start_time = time.perf_counter() try: - support.set_match_tests(ns.match_tests) + support.set_match_tests(ns.match_tests, ns.ignore_tests) support.junit_xml_list = xml_list = [] if ns.xmlpath else None if ns.failfast: support.failfast = True diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index 71db8d6966859..7a18e45434bb4 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -3,6 +3,7 @@ import json import os import queue +import signal import subprocess import sys import threading @@ -31,6 +32,8 @@ # Time to wait until a worker completes: should be immediate JOIN_TIMEOUT = 30.0 # seconds +USE_PROCESS_GROUP = (hasattr(os, "setsid") and hasattr(os, "killpg")) + def must_stop(result, ns): if result.result == INTERRUPTED: @@ -59,12 +62,16 @@ def run_test_in_subprocess(testname, ns): # Running the child from the same working directory as regrtest's original # invocation ensures that TEMPDIR for the child is the same when # sysconfig.is_python_build() is true. See issue 15300. + kw = {} + if USE_PROCESS_GROUP: + kw['start_new_session'] = True return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, close_fds=(os.name != 'nt'), - cwd=support.SAVEDCWD) + cwd=support.SAVEDCWD, + **kw) def run_tests_worker(ns, test_name): @@ -149,11 +156,24 @@ def _kill(self): return self._killed = True - print(f"Kill {self}", file=sys.stderr, flush=True) + if USE_PROCESS_GROUP: + what = f"{self} process group" + else: + what = f"{self}" + + print(f"Kill {what}", file=sys.stderr, flush=True) try: - popen.kill() + if USE_PROCESS_GROUP: + os.killpg(popen.pid, signal.SIGKILL) + else: + popen.kill() + except ProcessLookupError: + # popen.kill(): the process completed, the TestWorkerProcess thread + # read its exit status, but Popen.send_signal() read the returncode + # just before Popen.wait() set returncode. + pass except OSError as exc: - print_warning(f"Failed to kill {self}: {exc!r}") + print_warning(f"Failed to kill {what}: {exc!r}") def stop(self): # Method called from a different thread to stop this thread @@ -332,7 +352,11 @@ def __init__(self, regrtest): self.output = queue.Queue() self.pending = MultiprocessIterator(self.regrtest.tests) if self.ns.timeout is not None: - self.worker_timeout = self.ns.timeout * 1.5 + # Rely on faulthandler to kill a worker process. This timouet is + # when faulthandler fails to kill a worker process. Give a maximum + # of 5 minutes to faulthandler to kill the worker. + self.worker_timeout = min(self.ns.timeout * 1.5, + self.ns.timeout + 5 * 60) else: self.worker_timeout = None self.workers = None @@ -340,8 +364,12 @@ def __init__(self, regrtest): def start_workers(self): self.workers = [TestWorkerProcess(index, self) for index in range(1, self.ns.use_mp + 1)] - self.log("Run tests in parallel using %s child processes" - % len(self.workers)) + msg = f"Run tests in parallel using {len(self.workers)} child processes" + if self.ns.timeout: + msg += (" (timeout: %s, worker timeout: %s)" + % (format_duration(self.ns.timeout), + format_duration(self.worker_timeout))) + self.log(msg) for worker in self.workers: worker.start() diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index d6a7819cb0139..a42c6f771b3d3 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2047,7 +2047,9 @@ def _run_suite(suite): # By default, don't filter tests _match_test_func = None -_match_test_patterns = None + +_accept_test_patterns = None +_ignore_test_patterns = None def match_test(test): @@ -2063,18 +2065,45 @@ def _is_full_match_test(pattern): # as a full test identifier. # Example: 'test.test_os.FileTests.test_access'. # - # Reject patterns which contain fnmatch patterns: '*', '?', '[...]' - # or '[!...]'. For example, reject 'test_access*'. + # ignore patterns which contain fnmatch patterns: '*', '?', '[...]' + # or '[!...]'. For example, ignore 'test_access*'. return ('.' in pattern) and (not re.search(r'[?*\[\]]', pattern)) -def set_match_tests(patterns): - global _match_test_func, _match_test_patterns +def set_match_tests(accept_patterns=None, ignore_patterns=None): + global _match_test_func, _accept_test_patterns, _ignore_test_patterns - if patterns == _match_test_patterns: - # No change: no need to recompile patterns. - return + if accept_patterns is None: + accept_patterns = () + if ignore_patterns is None: + ignore_patterns = () + + accept_func = ignore_func = None + + if accept_patterns != _accept_test_patterns: + accept_patterns, accept_func = _compile_match_function(accept_patterns) + if ignore_patterns != _ignore_test_patterns: + ignore_patterns, ignore_func = _compile_match_function(ignore_patterns) + + # Create a copy since patterns can be mutable and so modified later + _accept_test_patterns = tuple(accept_patterns) + _ignore_test_patterns = tuple(ignore_patterns) + + if accept_func is not None or ignore_func is not None: + def match_function(test_id): + accept = True + ignore = False + if accept_func: + accept = accept_func(test_id) + if ignore_func: + ignore = ignore_func(test_id) + return accept and not ignore + + _match_test_func = match_function + + +def _compile_match_function(patterns): if not patterns: func = None # set_match_tests(None) behaves as set_match_tests(()) @@ -2102,10 +2131,7 @@ def match_test_regex(test_id): func = match_test_regex - # Create a copy since patterns can be mutable and so modified later - _match_test_patterns = tuple(patterns) - _match_test_func = func - + return patterns, func def run_unittest(*classes): diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index d2221b3448fa3..e2fa1977ba6c7 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -157,6 +157,24 @@ def test_single(self): self.assertTrue(ns.single) self.checkError([opt, '-f', 'foo'], "don't go together") + def test_ignore(self): + for opt in '-i', '--ignore': + with self.subTest(opt=opt): + ns = libregrtest._parse_args([opt, 'pattern']) + self.assertEqual(ns.ignore_tests, ['pattern']) + self.checkError([opt], 'expected one argument') + + self.addCleanup(support.unlink, support.TESTFN) + with open(support.TESTFN, "w") as fp: + print('matchfile1', file=fp) + print('matchfile2', file=fp) + + filename = os.path.abspath(support.TESTFN) + ns = libregrtest._parse_args(['-m', 'match', + '--ignorefile', filename]) + self.assertEqual(ns.ignore_tests, + ['matchfile1', 'matchfile2']) + def test_match(self): for opt in '-m', '--match': with self.subTest(opt=opt): @@ -960,6 +978,42 @@ def parse_methods(self, output): regex = re.compile("^(test[^ ]+).*ok$", flags=re.MULTILINE) return [match.group(1) for match in regex.finditer(output)] + def test_ignorefile(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_method1(self): + pass + def test_method2(self): + pass + def test_method3(self): + pass + def test_method4(self): + pass + """) + all_methods = ['test_method1', 'test_method2', + 'test_method3', 'test_method4'] + testname = self.create_test(code=code) + + # only run a subset + filename = support.TESTFN + self.addCleanup(support.unlink, filename) + + subset = [ + # only ignore the method name + 'test_method1', + # ignore the full identifier + '%s.Tests.test_method3' % testname] + with open(filename, "w") as fp: + for name in subset: + print(name, file=fp) + + output = self.run_tests("-v", "--ignorefile", filename, testname) + methods = self.parse_methods(output) + subset = ['test_method2', 'test_method4'] + self.assertEqual(methods, subset) + def test_matchfile(self): code = textwrap.dedent(""" import unittest diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 8f0746aed8299..e3ce670b8437f 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -527,6 +527,7 @@ def id(self): test_access = Test('test.test_os.FileTests.test_access') test_chdir = Test('test.test_os.Win32ErrorTests.test_chdir') + # Test acceptance with support.swap_attr(support, '_match_test_func', None): # match all support.set_match_tests([]) @@ -534,45 +535,92 @@ def id(self): self.assertTrue(support.match_test(test_chdir)) # match all using None - support.set_match_tests(None) + support.set_match_tests(None, None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # match the full test identifier - support.set_match_tests([test_access.id()]) + support.set_match_tests([test_access.id()], None) self.assertTrue(support.match_test(test_access)) self.assertFalse(support.match_test(test_chdir)) # match the module name - support.set_match_tests(['test_os']) + support.set_match_tests(['test_os'], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # Test '*' pattern - support.set_match_tests(['test_*']) + support.set_match_tests(['test_*'], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # Test case sensitivity - support.set_match_tests(['filetests']) + support.set_match_tests(['filetests'], None) self.assertFalse(support.match_test(test_access)) - support.set_match_tests(['FileTests']) + support.set_match_tests(['FileTests'], None) self.assertTrue(support.match_test(test_access)) # Test pattern containing '.' and a '*' metacharacter - support.set_match_tests(['*test_os.*.test_*']) + support.set_match_tests(['*test_os.*.test_*'], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # Multiple patterns - support.set_match_tests([test_access.id(), test_chdir.id()]) + support.set_match_tests([test_access.id(), test_chdir.id()], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) - support.set_match_tests(['test_access', 'DONTMATCH']) + support.set_match_tests(['test_access', 'DONTMATCH'], None) self.assertTrue(support.match_test(test_access)) self.assertFalse(support.match_test(test_chdir)) + # Test rejection + with support.swap_attr(support, '_match_test_func', None): + # match all + support.set_match_tests(ignore_patterns=[]) + self.assertTrue(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + + # match all using None + support.set_match_tests(None, None) + self.assertTrue(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + + # match the full test identifier + support.set_match_tests(None, [test_access.id()]) + self.assertFalse(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + + # match the module name + support.set_match_tests(None, ['test_os']) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + # Test '*' pattern + support.set_match_tests(None, ['test_*']) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + # Test case sensitivity + support.set_match_tests(None, ['filetests']) + self.assertTrue(support.match_test(test_access)) + support.set_match_tests(None, ['FileTests']) + self.assertFalse(support.match_test(test_access)) + + # Test pattern containing '.' and a '*' metacharacter + support.set_match_tests(None, ['*test_os.*.test_*']) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + # Multiple patterns + support.set_match_tests(None, [test_access.id(), test_chdir.id()]) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + support.set_match_tests(None, ['test_access', 'DONTMATCH']) + self.assertFalse(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + def test_fd_count(self): # We cannot test the absolute value of fd_count(): on old Linux # kernel or glibc versions, os.urandom() keeps a FD open on diff --git a/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst b/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst new file mode 100644 index 0000000000000..1df523e90c388 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst @@ -0,0 +1,3 @@ +test.regrtest now uses process groups in the multiprocessing mode (-jN command +line option) if process groups are available: if :func:`os.setsid` and +:func:`os.killpg` functions are available. diff --git a/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst b/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst new file mode 100644 index 0000000000000..75e186ef33e07 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst @@ -0,0 +1,3 @@ +test.regrtest now can receive a list of test patterns to ignore (using the +-i/--ignore argument) or a file with a list of patterns to ignore (using the +--ignore-file argument). Patch by Pablo Galindo. From webhook-mailer at python.org Tue Apr 14 14:11:25 2020 From: webhook-mailer at python.org (Hai Shi) Date: Tue, 14 Apr 2020 18:11:25 -0000 Subject: [Python-checkins] bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464) Message-ID: https://github.com/python/cpython/commit/675d9a3d7afc767a2818c84da7ba4bf4181dcf26 commit: 675d9a3d7afc767a2818c84da7ba4bf4181dcf26 branch: master author: Hai Shi committer: GitHub date: 2020-04-14T20:11:20+02:00 summary: bpo-40170: Convert PyObject_IS_GC() macro to a function (GH-19464) files: A Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst M Doc/c-api/gcsupport.rst M Include/cpython/objimpl.h M Include/internal/pycore_object.h M Modules/gcmodule.c M Objects/object.c M Python/sysmodule.c diff --git a/Doc/c-api/gcsupport.rst b/Doc/c-api/gcsupport.rst index 4cab0f544ed81..eee114c19d590 100644 --- a/Doc/c-api/gcsupport.rst +++ b/Doc/c-api/gcsupport.rst @@ -60,6 +60,15 @@ Constructors for container types must conform to two rules: followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, usually near the end of the constructor. + +.. c:function:: int PyObject_IS_GC(PyObject *obj) + + Returns non-zero if the object implements the garbage collector protocol, + otherwise returns 0. + + The object cannot be tracked by the garbage collector if this function returns 0. + + .. c:function:: int PyObject_GC_IsTracked(PyObject *op) Returns 1 if the object type of *op* implements the GC protocol and *op* is being diff --git a/Include/cpython/objimpl.h b/Include/cpython/objimpl.h index 6634f29c8c873..b835936db7011 100644 --- a/Include/cpython/objimpl.h +++ b/Include/cpython/objimpl.h @@ -120,10 +120,9 @@ PyAPI_FUNC(Py_ssize_t) _PyGC_CollectNoFail(void); PyAPI_FUNC(Py_ssize_t) _PyGC_CollectIfEnabled(void); -/* Test if an object has a GC head */ -#define PyObject_IS_GC(o) \ - (PyType_IS_GC(Py_TYPE(o)) \ - && (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) +/* Test if an object implements the garbage collector protocol */ +PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj); + /* Code built with Py_BUILD_CORE must include pycore_gc.h instead which defines a different _PyGC_FINALIZED() macro. */ diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 7c0f24ac07d7f..32e86d06db5b4 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -102,6 +102,15 @@ _PyType_HasFeature(PyTypeObject *type, unsigned long feature) { return ((type->tp_flags & feature) != 0); } +// Fast inlined version of PyObject_IS_GC() +static inline int +_PyObject_IS_GC(PyObject *obj) +{ + return (PyType_IS_GC(Py_TYPE(obj)) + && (Py_TYPE(obj)->tp_is_gc == NULL + || Py_TYPE(obj)->tp_is_gc(obj))); +} + // Fast inlined version of PyType_IS_GC() #define _PyType_IS_GC(t) _PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) diff --git a/Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst b/Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst new file mode 100644 index 0000000000000..832b7f6e081d5 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst @@ -0,0 +1,2 @@ +Convert :c:func:`PyObject_IS_GC` macro to a function to hide +implementation details. diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 281ab33e06523..d2cd2c9296616 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -442,7 +442,7 @@ visit_decref(PyObject *op, void *parent) { _PyObject_ASSERT(_PyObject_CAST(parent), !_PyObject_IsFreed(op)); - if (PyObject_IS_GC(op)) { + if (_PyObject_IS_GC(op)) { PyGC_Head *gc = AS_GC(op); /* We're only interested in gc_refs for objects in the * generation being collected, which can be recognized @@ -478,7 +478,7 @@ subtract_refs(PyGC_Head *containers) static int visit_reachable(PyObject *op, PyGC_Head *reachable) { - if (!PyObject_IS_GC(op)) { + if (!_PyObject_IS_GC(op)) { return 0; } @@ -705,7 +705,7 @@ clear_unreachable_mask(PyGC_Head *unreachable) static int visit_move(PyObject *op, PyGC_Head *tolist) { - if (PyObject_IS_GC(op)) { + if (_PyObject_IS_GC(op)) { PyGC_Head *gc = AS_GC(op); if (gc_is_collecting(gc)) { gc_list_move(gc, tolist); @@ -1716,7 +1716,7 @@ gc_get_referents(PyObject *self, PyObject *args) traverseproc traverse; PyObject *obj = PyTuple_GET_ITEM(args, i); - if (! PyObject_IS_GC(obj)) + if (!_PyObject_IS_GC(obj)) continue; traverse = Py_TYPE(obj)->tp_traverse; if (! traverse) @@ -1856,7 +1856,7 @@ gc_is_tracked(PyObject *module, PyObject *obj) { PyObject *result; - if (PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) + if (_PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) result = Py_True; else result = Py_False; @@ -1877,7 +1877,7 @@ static PyObject * gc_is_finalized(PyObject *module, PyObject *obj) /*[clinic end generated code: output=e1516ac119a918ed input=201d0c58f69ae390]*/ { - if (PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) { + if (_PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) { Py_RETURN_TRUE; } Py_RETURN_FALSE; @@ -2204,6 +2204,12 @@ PyObject_GC_UnTrack(void *op_raw) } } +int +PyObject_IS_GC(PyObject *obj) +{ + return _PyObject_IS_GC(obj); +} + static PyObject * _PyObject_GC_Alloc(int use_calloc, size_t basicsize) { @@ -2317,7 +2323,7 @@ PyObject_GC_Del(void *op) int PyObject_GC_IsTracked(PyObject* obj) { - if (PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) { + if (_PyObject_IS_GC(obj) && _PyObject_GC_IS_TRACKED(obj)) { return 1; } return 0; @@ -2326,7 +2332,7 @@ PyObject_GC_IsTracked(PyObject* obj) int PyObject_GC_IsFinalized(PyObject *obj) { - if (PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) { + if (_PyObject_IS_GC(obj) && _PyGCHead_FINALIZED(AS_GC(obj))) { return 1; } return 0; diff --git a/Objects/object.c b/Objects/object.c index c759ccc568472..75ea92ad9005c 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2031,7 +2031,7 @@ _PyTrash_deposit_object(PyObject *op) PyThreadState *tstate = _PyThreadState_GET(); struct _gc_runtime_state *gcstate = &tstate->interp->gc; - _PyObject_ASSERT(op, PyObject_IS_GC(op)); + _PyObject_ASSERT(op, _PyObject_IS_GC(op)); _PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op)); _PyObject_ASSERT(op, Py_REFCNT(op) == 0); _PyGCHead_SET_PREV(_Py_AS_GC(op), gcstate->trash_delete_later); @@ -2043,7 +2043,7 @@ void _PyTrash_thread_deposit_object(PyObject *op) { PyThreadState *tstate = _PyThreadState_GET(); - _PyObject_ASSERT(op, PyObject_IS_GC(op)); + _PyObject_ASSERT(op, _PyObject_IS_GC(op)); _PyObject_ASSERT(op, !_PyObject_GC_IS_TRACKED(op)); _PyObject_ASSERT(op, Py_REFCNT(op) == 0); _PyGCHead_SET_PREV(_Py_AS_GC(op), tstate->trash_delete_later); diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 79e5df06d3037..741979a09acc0 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -19,6 +19,7 @@ Data members: #include "frameobject.h" #include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() #include "pycore_initconfig.h" +#include "pycore_object.h" #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" @@ -1679,7 +1680,7 @@ _PySys_GetSizeOf(PyObject *o) } /* add gc_head size */ - if (PyObject_IS_GC(o)) + if (_PyObject_IS_GC(o)) return ((size_t)size) + sizeof(PyGC_Head); return (size_t)size; } From webhook-mailer at python.org Tue Apr 14 14:11:51 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Tue, 14 Apr 2020 18:11:51 -0000 Subject: [Python-checkins] bpo-32033: Fix test_pwd failures on Android (GH-19502) Message-ID: https://github.com/python/cpython/commit/96515e9f6785328c52ebc5d4ce60e0087a9adc2d commit: 96515e9f6785328c52ebc5d4ce60e0087a9adc2d branch: master author: Zackery Spytz committer: GitHub date: 2020-04-14T20:11:46+02:00 summary: bpo-32033: Fix test_pwd failures on Android (GH-19502) files: M Lib/test/test_pwd.py diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index c13a7c9294f98..85740cecd8229 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -21,7 +21,7 @@ def test_values(self): self.assertEqual(e[3], e.pw_gid) self.assertIsInstance(e.pw_gid, int) self.assertEqual(e[4], e.pw_gecos) - self.assertIsInstance(e.pw_gecos, str) + self.assertIn(type(e.pw_gecos), (str, type(None))) self.assertEqual(e[5], e.pw_dir) self.assertIsInstance(e.pw_dir, str) self.assertEqual(e[6], e.pw_shell) From webhook-mailer at python.org Tue Apr 14 14:31:08 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 14 Apr 2020 18:31:08 -0000 Subject: [Python-checkins] bpo-32033: Fix test_pwd failures on Android (GH-19502) Message-ID: https://github.com/python/cpython/commit/1e1dbdf23f7a18f53a3257badc3541973831f2c4 commit: 1e1dbdf23f7a18f53a3257badc3541973831f2c4 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-14T11:31:00-07:00 summary: bpo-32033: Fix test_pwd failures on Android (GH-19502) (cherry picked from commit 96515e9f6785328c52ebc5d4ce60e0087a9adc2d) Co-authored-by: Zackery Spytz files: M Lib/test/test_pwd.py diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index c13a7c9294f98..85740cecd8229 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -21,7 +21,7 @@ def test_values(self): self.assertEqual(e[3], e.pw_gid) self.assertIsInstance(e.pw_gid, int) self.assertEqual(e[4], e.pw_gecos) - self.assertIsInstance(e.pw_gecos, str) + self.assertIn(type(e.pw_gecos), (str, type(None))) self.assertEqual(e[5], e.pw_dir) self.assertIsInstance(e.pw_dir, str) self.assertEqual(e[6], e.pw_shell) From webhook-mailer at python.org Tue Apr 14 14:31:43 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 14 Apr 2020 18:31:43 -0000 Subject: [Python-checkins] bpo-32033: Fix test_pwd failures on Android (GH-19502) Message-ID: https://github.com/python/cpython/commit/8821200d85657ef3bbec78dcb43694449c05e896 commit: 8821200d85657ef3bbec78dcb43694449c05e896 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-14T11:31:34-07:00 summary: bpo-32033: Fix test_pwd failures on Android (GH-19502) (cherry picked from commit 96515e9f6785328c52ebc5d4ce60e0087a9adc2d) Co-authored-by: Zackery Spytz files: M Lib/test/test_pwd.py diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index c13a7c9294f98..85740cecd8229 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -21,7 +21,7 @@ def test_values(self): self.assertEqual(e[3], e.pw_gid) self.assertIsInstance(e.pw_gid, int) self.assertEqual(e[4], e.pw_gecos) - self.assertIsInstance(e.pw_gecos, str) + self.assertIn(type(e.pw_gecos), (str, type(None))) self.assertEqual(e[5], e.pw_dir) self.assertIsInstance(e.pw_dir, str) self.assertEqual(e[6], e.pw_shell) From webhook-mailer at python.org Tue Apr 14 15:16:11 2020 From: webhook-mailer at python.org (Barry) Date: Tue, 14 Apr 2020 19:16:11 -0000 Subject: [Python-checkins] bpo-40260: Update modulefinder to use io.open_code() and respect coding comments (GH-19488) Message-ID: https://github.com/python/cpython/commit/d42e5820631cd66ee1eab8f610d4b58f3dfdd81c commit: d42e5820631cd66ee1eab8f610d4b58f3dfdd81c branch: master author: Barry committer: GitHub date: 2020-04-14T20:16:06+01:00 summary: bpo-40260: Update modulefinder to use io.open_code() and respect coding comments (GH-19488) files: A Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst M Lib/modulefinder.py M Lib/test/test_modulefinder.py diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index e0d29984f862c..84ddbdb6ee3df 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -5,6 +5,7 @@ import importlib.machinery import marshal import os +import io import sys import types import warnings @@ -68,35 +69,32 @@ def _find_module(name, path=None): # Some special cases: if spec.loader is importlib.machinery.BuiltinImporter: - return None, None, ("", "", _C_BUILTIN) + return None, None, ("", _C_BUILTIN) if spec.loader is importlib.machinery.FrozenImporter: - return None, None, ("", "", _PY_FROZEN) + return None, None, ("", _PY_FROZEN) file_path = spec.origin if spec.loader.is_package(name): - return None, os.path.dirname(file_path), ("", "", _PKG_DIRECTORY) + return None, os.path.dirname(file_path), ("", _PKG_DIRECTORY) if isinstance(spec.loader, importlib.machinery.SourceFileLoader): kind = _PY_SOURCE - mode = "r" elif isinstance(spec.loader, importlib.machinery.ExtensionFileLoader): kind = _C_EXTENSION - mode = "rb" elif isinstance(spec.loader, importlib.machinery.SourcelessFileLoader): kind = _PY_COMPILED - mode = "rb" else: # Should never happen. - return None, None, ("", "", _SEARCH_ERROR) + return None, None, ("", _SEARCH_ERROR) - file = open(file_path, mode) + file = io.open_code(file_path) suffix = os.path.splitext(file_path)[-1] - return file, file_path, (suffix, mode, kind) + return file, file_path, (suffix, kind) class Module: @@ -160,15 +158,15 @@ def msgout(self, *args): def run_script(self, pathname): self.msg(2, "run_script", pathname) - with open(pathname) as fp: - stuff = ("", "r", _PY_SOURCE) + with io.open_code(pathname) as fp: + stuff = ("", _PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) - with open(pathname) as fp: - stuff = (ext, "r", _PY_SOURCE) + with io.open_code(pathname) as fp: + stuff = (ext, _PY_SOURCE) self.load_module(name, fp, pathname, stuff) def import_hook(self, name, caller=None, fromlist=None, level=-1): @@ -333,14 +331,14 @@ def import_module(self, partname, fqname, parent): return m def load_module(self, fqname, fp, pathname, file_info): - suffix, mode, type = file_info + suffix, type = file_info self.msgin(2, "load_module", fqname, fp and "fp", pathname) if type == _PKG_DIRECTORY: m = self.load_package(fqname, pathname) self.msgout(2, "load_module ->", m) return m if type == _PY_SOURCE: - co = compile(fp.read()+'\n', pathname, 'exec') + co = compile(fp.read()+b'\n', pathname, 'exec') elif type == _PY_COMPILED: try: data = fp.read() @@ -504,7 +502,7 @@ def find_module(self, name, path, parent=None): if path is None: if name in sys.builtin_module_names: - return (None, None, ("", "", _C_BUILTIN)) + return (None, None, ("", _C_BUILTIN)) path = self.path diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py index ebd96e1c8a2dd..1aa45011df0bb 100644 --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -40,7 +40,8 @@ from c import something b/__init__.py from sys import * -"""] +""", +] maybe_test_new = [ "a.module", @@ -245,6 +246,48 @@ def foo(): pass b/c.py """] +coding_default_utf8_test = [ + "a_utf8", + ["a_utf8", "b_utf8"], + [], [], + """\ +a_utf8.py + # use the default of utf8 + print('Unicode test A code point 2090 \u2090 that is not valid in cp1252') + import b_utf8 +b_utf8.py + # use the default of utf8 + print('Unicode test B code point 2090 \u2090 that is not valid in cp1252') +"""] + +coding_explicit_utf8_test = [ + "a_utf8", + ["a_utf8", "b_utf8"], + [], [], + """\ +a_utf8.py + # coding=utf8 + print('Unicode test A code point 2090 \u2090 that is not valid in cp1252') + import b_utf8 +b_utf8.py + # use the default of utf8 + print('Unicode test B code point 2090 \u2090 that is not valid in cp1252') +"""] + +coding_explicit_cp1252_test = [ + "a_cp1252", + ["a_cp1252", "b_utf8"], + [], [], + b"""\ +a_cp1252.py + # coding=cp1252 + # 0xe2 is not allowed in utf8 + print('CP1252 test P\xe2t\xe9') + import b_utf8 +b_utf8.py + # use the default of utf8 + print('Unicode test A code point 2090 \u2090 that is not valid in cp1252') +"""] def open_file(path): dirname = os.path.dirname(path) @@ -253,18 +296,22 @@ def open_file(path): except OSError as e: if e.errno != errno.EEXIST: raise - return open(path, "w") + return open(path, 'wb') def create_package(source): ofi = None try: for line in source.splitlines(): - if line.startswith(" ") or line.startswith("\t"): - ofi.write(line.strip() + "\n") + if type(line) != bytes: + line = line.encode('utf-8') + if line.startswith(b' ') or line.startswith(b'\t'): + ofi.write(line.strip() + b'\n') else: if ofi: ofi.close() + if type(line) == bytes: + line = line.decode('utf-8') ofi = open_file(os.path.join(TEST_DIR, line.strip())) finally: if ofi: @@ -337,7 +384,7 @@ def test_bytecode(self): source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] with open_file(source_path) as file: - file.write('testing_modulefinder = True\n') + file.write('testing_modulefinder = True\n'.encode('utf-8')) py_compile.compile(source_path, cfile=bytecode_path) os.remove(source_path) self._do_test(bytecode_test) @@ -365,6 +412,14 @@ def test_extended_opargs(self): """ % list(range(2**16))] # 2**16 constants self._do_test(extended_opargs_test) + def test_coding_default_utf8(self): + self._do_test(coding_default_utf8_test) + + def test_coding_explicit_utf8(self): + self._do_test(coding_explicit_utf8_test) + + def test_coding_explicit_cp1252(self): + self._do_test(coding_explicit_cp1252_test) if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst b/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst new file mode 100644 index 0000000000000..decc073bf4d61 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst @@ -0,0 +1 @@ +Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding comments. From webhook-mailer at python.org Tue Apr 14 15:34:52 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 14 Apr 2020 19:34:52 -0000 Subject: [Python-checkins] bpo-40260: Update modulefinder to use io.open_code() and respect coding comments (GH-19488) Message-ID: https://github.com/python/cpython/commit/59047fab0ef37f583c9e7c3a48d67792fd10ff91 commit: 59047fab0ef37f583c9e7c3a48d67792fd10ff91 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-14T12:34:41-07:00 summary: bpo-40260: Update modulefinder to use io.open_code() and respect coding comments (GH-19488) (cherry picked from commit d42e5820631cd66ee1eab8f610d4b58f3dfdd81c) Co-authored-by: Barry files: A Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst M Lib/modulefinder.py M Lib/test/test_modulefinder.py diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index e0d29984f862c..84ddbdb6ee3df 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -5,6 +5,7 @@ import importlib.machinery import marshal import os +import io import sys import types import warnings @@ -68,35 +69,32 @@ def _find_module(name, path=None): # Some special cases: if spec.loader is importlib.machinery.BuiltinImporter: - return None, None, ("", "", _C_BUILTIN) + return None, None, ("", _C_BUILTIN) if spec.loader is importlib.machinery.FrozenImporter: - return None, None, ("", "", _PY_FROZEN) + return None, None, ("", _PY_FROZEN) file_path = spec.origin if spec.loader.is_package(name): - return None, os.path.dirname(file_path), ("", "", _PKG_DIRECTORY) + return None, os.path.dirname(file_path), ("", _PKG_DIRECTORY) if isinstance(spec.loader, importlib.machinery.SourceFileLoader): kind = _PY_SOURCE - mode = "r" elif isinstance(spec.loader, importlib.machinery.ExtensionFileLoader): kind = _C_EXTENSION - mode = "rb" elif isinstance(spec.loader, importlib.machinery.SourcelessFileLoader): kind = _PY_COMPILED - mode = "rb" else: # Should never happen. - return None, None, ("", "", _SEARCH_ERROR) + return None, None, ("", _SEARCH_ERROR) - file = open(file_path, mode) + file = io.open_code(file_path) suffix = os.path.splitext(file_path)[-1] - return file, file_path, (suffix, mode, kind) + return file, file_path, (suffix, kind) class Module: @@ -160,15 +158,15 @@ def msgout(self, *args): def run_script(self, pathname): self.msg(2, "run_script", pathname) - with open(pathname) as fp: - stuff = ("", "r", _PY_SOURCE) + with io.open_code(pathname) as fp: + stuff = ("", _PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) - with open(pathname) as fp: - stuff = (ext, "r", _PY_SOURCE) + with io.open_code(pathname) as fp: + stuff = (ext, _PY_SOURCE) self.load_module(name, fp, pathname, stuff) def import_hook(self, name, caller=None, fromlist=None, level=-1): @@ -333,14 +331,14 @@ def import_module(self, partname, fqname, parent): return m def load_module(self, fqname, fp, pathname, file_info): - suffix, mode, type = file_info + suffix, type = file_info self.msgin(2, "load_module", fqname, fp and "fp", pathname) if type == _PKG_DIRECTORY: m = self.load_package(fqname, pathname) self.msgout(2, "load_module ->", m) return m if type == _PY_SOURCE: - co = compile(fp.read()+'\n', pathname, 'exec') + co = compile(fp.read()+b'\n', pathname, 'exec') elif type == _PY_COMPILED: try: data = fp.read() @@ -504,7 +502,7 @@ def find_module(self, name, path, parent=None): if path is None: if name in sys.builtin_module_names: - return (None, None, ("", "", _C_BUILTIN)) + return (None, None, ("", _C_BUILTIN)) path = self.path diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py index ebd96e1c8a2dd..1aa45011df0bb 100644 --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -40,7 +40,8 @@ from c import something b/__init__.py from sys import * -"""] +""", +] maybe_test_new = [ "a.module", @@ -245,6 +246,48 @@ def foo(): pass b/c.py """] +coding_default_utf8_test = [ + "a_utf8", + ["a_utf8", "b_utf8"], + [], [], + """\ +a_utf8.py + # use the default of utf8 + print('Unicode test A code point 2090 \u2090 that is not valid in cp1252') + import b_utf8 +b_utf8.py + # use the default of utf8 + print('Unicode test B code point 2090 \u2090 that is not valid in cp1252') +"""] + +coding_explicit_utf8_test = [ + "a_utf8", + ["a_utf8", "b_utf8"], + [], [], + """\ +a_utf8.py + # coding=utf8 + print('Unicode test A code point 2090 \u2090 that is not valid in cp1252') + import b_utf8 +b_utf8.py + # use the default of utf8 + print('Unicode test B code point 2090 \u2090 that is not valid in cp1252') +"""] + +coding_explicit_cp1252_test = [ + "a_cp1252", + ["a_cp1252", "b_utf8"], + [], [], + b"""\ +a_cp1252.py + # coding=cp1252 + # 0xe2 is not allowed in utf8 + print('CP1252 test P\xe2t\xe9') + import b_utf8 +b_utf8.py + # use the default of utf8 + print('Unicode test A code point 2090 \u2090 that is not valid in cp1252') +"""] def open_file(path): dirname = os.path.dirname(path) @@ -253,18 +296,22 @@ def open_file(path): except OSError as e: if e.errno != errno.EEXIST: raise - return open(path, "w") + return open(path, 'wb') def create_package(source): ofi = None try: for line in source.splitlines(): - if line.startswith(" ") or line.startswith("\t"): - ofi.write(line.strip() + "\n") + if type(line) != bytes: + line = line.encode('utf-8') + if line.startswith(b' ') or line.startswith(b'\t'): + ofi.write(line.strip() + b'\n') else: if ofi: ofi.close() + if type(line) == bytes: + line = line.decode('utf-8') ofi = open_file(os.path.join(TEST_DIR, line.strip())) finally: if ofi: @@ -337,7 +384,7 @@ def test_bytecode(self): source_path = base_path + importlib.machinery.SOURCE_SUFFIXES[0] bytecode_path = base_path + importlib.machinery.BYTECODE_SUFFIXES[0] with open_file(source_path) as file: - file.write('testing_modulefinder = True\n') + file.write('testing_modulefinder = True\n'.encode('utf-8')) py_compile.compile(source_path, cfile=bytecode_path) os.remove(source_path) self._do_test(bytecode_test) @@ -365,6 +412,14 @@ def test_extended_opargs(self): """ % list(range(2**16))] # 2**16 constants self._do_test(extended_opargs_test) + def test_coding_default_utf8(self): + self._do_test(coding_default_utf8_test) + + def test_coding_explicit_utf8(self): + self._do_test(coding_explicit_utf8_test) + + def test_coding_explicit_cp1252(self): + self._do_test(coding_explicit_cp1252_test) if __name__ == "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst b/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst new file mode 100644 index 0000000000000..decc073bf4d61 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst @@ -0,0 +1 @@ +Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding comments. From webhook-mailer at python.org Tue Apr 14 16:40:45 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Tue, 14 Apr 2020 20:40:45 -0000 Subject: [Python-checkins] bpo-39522: Always initialise kind attribute in constant ast nodes (GH-19525) Message-ID: https://github.com/python/cpython/commit/33986465bde2a2188537c4ef6cdb6055e348f31f commit: 33986465bde2a2188537c4ef6cdb6055e348f31f branch: master author: Pablo Galindo committer: GitHub date: 2020-04-14T21:40:41+01:00 summary: bpo-39522: Always initialise kind attribute in constant ast nodes (GH-19525) files: M Python/ast_opt.c diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 1393c3473bf54..1766321a11a5b 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -19,6 +19,7 @@ make_const(expr_ty node, PyObject *val, PyArena *arena) return 0; } node->kind = Constant_kind; + node->v.Constant.kind = NULL; node->v.Constant.value = val; return 1; } From webhook-mailer at python.org Tue Apr 14 19:05:25 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 14 Apr 2020 23:05:25 -0000 Subject: [Python-checkins] Update libregrtest from master (GH-19517) Message-ID: https://github.com/python/cpython/commit/b894b669c98cc365b84cbb8d20f531f1d0686f59 commit: b894b669c98cc365b84cbb8d20f531f1d0686f59 branch: 3.7 author: Victor Stinner committer: GitHub date: 2020-04-15T01:05:20+02:00 summary: Update libregrtest from master (GH-19517) * bpo-36670: regrtest bug fixes (GH-16537) * Fix TestWorkerProcess.__repr__(): start_time is only valid if _popen is not None. * Fix _kill(): don't set _killed to True if _popen is None. * _run_process(): only set _killed to False after calling run_test_in_subprocess(). (cherry picked from commit 2ea71a07d0a720707094ee55f78fd232c40724bc) * [3.8] Update libregrtest from master (GH-19516) * bpo-37531: regrtest now catchs ProcessLookupError (GH-16827) Fix a warning on a race condition on TestWorkerProcess.kill(): ignore silently ProcessLookupError rather than logging an useless warning. (cherry picked from commit a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be) * bpo-38502: regrtest uses process groups if available (GH-16829) test.regrtest now uses process groups in the multiprocessing mode (-jN command line option) if process groups are available: if os.setsid() and os.killpg() functions are available. (cherry picked from commit ecb035cd14c11521276343397151929a94018a22) * bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989) When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored. For these reasons, add a new option to allow to ignore a list of test and subtests for these situations. (cherry picked from commit e0cd8aa70a3ce19c3d3712568940aa0cbd9aa97b) * regrtest: log timeout at startup (GH-19514) Reduce also worker timeout. (cherry picked from commit 4cf65a630a8d45bad3fe5cdc4c2632ec64e7ba27) Co-authored-by: Pablo Galindo (cherry picked from commit 67b8a1f0f0f78ec38b8626fa9f5b2f5a55c17e15) * bpo-36842: Fix reference leak in tests by running out-of-proc (GH-13556) (cherry picked from commit 9ddc416e9f6635376312c3615193f19480ac772a) * Backport libregrtest changes from master Co-authored-by: Steve Dower files: A Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst A Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst M Lib/test/libregrtest/__init__.py M Lib/test/libregrtest/cmdline.py M Lib/test/libregrtest/main.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/runtest_mp.py M Lib/test/libregrtest/setup.py M Lib/test/support/__init__.py M Lib/test/test_regrtest.py M Lib/test/test_support.py diff --git a/Lib/test/libregrtest/__init__.py b/Lib/test/libregrtest/__init__.py index 3427b51b60af8..5e8dba5dbde71 100644 --- a/Lib/test/libregrtest/__init__.py +++ b/Lib/test/libregrtest/__init__.py @@ -1,5 +1,2 @@ -# We import importlib *ASAP* in order to test #15386 -import importlib - from test.libregrtest.cmdline import _parse_args, RESOURCE_NAMES, ALL_RESOURCES from test.libregrtest.main import main diff --git a/Lib/test/libregrtest/cmdline.py b/Lib/test/libregrtest/cmdline.py index 9f1bf6800824a..6e24a8681b27e 100644 --- a/Lib/test/libregrtest/cmdline.py +++ b/Lib/test/libregrtest/cmdline.py @@ -207,10 +207,17 @@ def _create_parser(): group.add_argument('-m', '--match', metavar='PAT', dest='match_tests', action='append', help='match test cases and methods with glob pattern PAT') + group.add_argument('-i', '--ignore', metavar='PAT', + dest='ignore_tests', action='append', + help='ignore test cases and methods with glob pattern PAT') group.add_argument('--matchfile', metavar='FILENAME', dest='match_filename', help='similar to --match but get patterns from a ' 'text file, one pattern per line') + group.add_argument('--ignorefile', metavar='FILENAME', + dest='ignore_filename', + help='similar to --matchfile but it receives patterns ' + 'from text file to ignore') group.add_argument('-G', '--failfast', action='store_true', help='fail as soon as a test fails (only with -v or -W)') group.add_argument('-u', '--use', metavar='RES1,RES2,...', @@ -315,7 +322,8 @@ def _parse_args(args, **kwargs): findleaks=1, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, random_seed=None, use_mp=None, verbose3=False, forever=False, - header=False, failfast=False, match_tests=None, pgo=False) + header=False, failfast=False, match_tests=None, ignore_tests=None, + pgo=False) for k, v in kwargs.items(): if not hasattr(ns, k): raise TypeError('%r is an invalid keyword argument ' @@ -391,6 +399,12 @@ def _parse_args(args, **kwargs): with open(ns.match_filename) as fp: for line in fp: ns.match_tests.append(line.strip()) + if ns.ignore_filename: + if ns.ignore_tests is None: + ns.ignore_tests = [] + with open(ns.ignore_filename) as fp: + for line in fp: + ns.ignore_tests.append(line.strip()) if ns.forever: # --forever implies --failfast ns.failfast = True diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 05878a8af4c32..c521d530ce161 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -282,7 +282,7 @@ def _list_cases(self, suite): def list_cases(self): support.verbose = False - support.set_match_tests(self.ns.match_tests) + support.set_match_tests(self.ns.match_tests, self.ns.ignore_tests) for test_name in self.selected: abstest = get_abs_module(self.ns, test_name) @@ -389,7 +389,10 @@ def run_tests_sequential(self): save_modules = sys.modules.keys() - self.log("Run tests sequentially") + msg = "Run tests sequentially" + if self.ns.timeout: + msg += " (timeout: %s)" % format_duration(self.ns.timeout) + self.log(msg) previous_test = None for test_index, test_name in enumerate(self.tests, 1): diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index e7dce180cb375..558f2099c66f5 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -123,7 +123,7 @@ def _runtest(ns, test_name): start_time = time.perf_counter() try: - support.set_match_tests(ns.match_tests) + support.set_match_tests(ns.match_tests, ns.ignore_tests) support.junit_xml_list = xml_list = [] if ns.xmlpath else None if ns.failfast: support.failfast = True @@ -313,9 +313,7 @@ def cleanup_test_droppings(test_name, verbose): # since if a test leaves a file open, it cannot be deleted by name (while # there's nothing we can do about that here either, we can display the # name of the offending test, which is a real help). - for name in (support.TESTFN, - "db_home", - ): + for name in (support.TESTFN,): if not os.path.exists(name): continue diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index 2770cf93bd7d8..7a18e45434bb4 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -3,6 +3,7 @@ import json import os import queue +import signal import subprocess import sys import threading @@ -31,6 +32,8 @@ # Time to wait until a worker completes: should be immediate JOIN_TIMEOUT = 30.0 # seconds +USE_PROCESS_GROUP = (hasattr(os, "setsid") and hasattr(os, "killpg")) + def must_stop(result, ns): if result.result == INTERRUPTED: @@ -59,12 +62,16 @@ def run_test_in_subprocess(testname, ns): # Running the child from the same working directory as regrtest's original # invocation ensures that TEMPDIR for the child is the same when # sysconfig.is_python_build() is true. See issue 15300. + kw = {} + if USE_PROCESS_GROUP: + kw['start_new_session'] = True return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, close_fds=(os.name != 'nt'), - cwd=support.SAVEDCWD) + cwd=support.SAVEDCWD, + **kw) def run_tests_worker(ns, test_name): @@ -127,32 +134,46 @@ def __init__(self, worker_id, runner): def __repr__(self): info = [f'TestWorkerProcess #{self.worker_id}'] if self.is_alive(): - dt = time.monotonic() - self.start_time - info.append("running for %s" % format_duration(dt)) + info.append("running") else: info.append('stopped') test = self.current_test_name if test: info.append(f'test={test}') popen = self._popen - if popen: - info.append(f'pid={popen.pid}') + if popen is not None: + dt = time.monotonic() - self.start_time + info.extend((f'pid={self._popen.pid}', + f'time={format_duration(dt)}')) return '<%s>' % ' '.join(info) def _kill(self): + popen = self._popen + if popen is None: + return + if self._killed: return self._killed = True - popen = self._popen - if popen is None: - return + if USE_PROCESS_GROUP: + what = f"{self} process group" + else: + what = f"{self}" - print(f"Kill {self}", file=sys.stderr, flush=True) + print(f"Kill {what}", file=sys.stderr, flush=True) try: - popen.kill() + if USE_PROCESS_GROUP: + os.killpg(popen.pid, signal.SIGKILL) + else: + popen.kill() + except ProcessLookupError: + # popen.kill(): the process completed, the TestWorkerProcess thread + # read its exit status, but Popen.send_signal() read the returncode + # just before Popen.wait() set returncode. + pass except OSError as exc: - print_warning(f"Failed to kill {self}: {exc!r}") + print_warning(f"Failed to kill {what}: {exc!r}") def stop(self): # Method called from a different thread to stop this thread @@ -170,9 +191,10 @@ def _run_process(self, test_name): self.current_test_name = test_name try: + popen = run_test_in_subprocess(test_name, self.ns) + self._killed = False - self._popen = run_test_in_subprocess(test_name, self.ns) - popen = self._popen + self._popen = popen except: self.current_test_name = None raise @@ -330,7 +352,11 @@ def __init__(self, regrtest): self.output = queue.Queue() self.pending = MultiprocessIterator(self.regrtest.tests) if self.ns.timeout is not None: - self.worker_timeout = self.ns.timeout * 1.5 + # Rely on faulthandler to kill a worker process. This timouet is + # when faulthandler fails to kill a worker process. Give a maximum + # of 5 minutes to faulthandler to kill the worker. + self.worker_timeout = min(self.ns.timeout * 1.5, + self.ns.timeout + 5 * 60) else: self.worker_timeout = None self.workers = None @@ -338,8 +364,12 @@ def __init__(self, regrtest): def start_workers(self): self.workers = [TestWorkerProcess(index, self) for index in range(1, self.ns.use_mp + 1)] - self.log("Run tests in parallel using %s child processes" - % len(self.workers)) + msg = f"Run tests in parallel using {len(self.workers)} child processes" + if self.ns.timeout: + msg += (" (timeout: %s, worker timeout: %s)" + % (format_duration(self.ns.timeout), + format_duration(self.worker_timeout))) + self.log(msg) for worker in self.workers: worker.start() diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index 4362e92fbda90..ea7f2c2f185c3 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -67,29 +67,34 @@ def setup_tests(ns): if ns.threshold is not None: gc.set_threshold(ns.threshold) + suppress_msvcrt_asserts(ns.verbose and ns.verbose >= 2) + + support.use_resources = ns.use_resources + + +def suppress_msvcrt_asserts(verbose): try: import msvcrt except ImportError: - pass - else: - msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS| - msvcrt.SEM_NOALIGNMENTFAULTEXCEPT| - msvcrt.SEM_NOGPFAULTERRORBOX| - msvcrt.SEM_NOOPENFILEERRORBOX) - try: - msvcrt.CrtSetReportMode - except AttributeError: - # release build - pass + return + + msvcrt.SetErrorMode(msvcrt.SEM_FAILCRITICALERRORS| + msvcrt.SEM_NOALIGNMENTFAULTEXCEPT| + msvcrt.SEM_NOGPFAULTERRORBOX| + msvcrt.SEM_NOOPENFILEERRORBOX) + try: + msvcrt.CrtSetReportMode + except AttributeError: + # release build + return + + for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]: + if verbose: + msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE) + msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR) else: - for m in [msvcrt.CRT_WARN, msvcrt.CRT_ERROR, msvcrt.CRT_ASSERT]: - if ns.verbose and ns.verbose >= 2: - msvcrt.CrtSetReportMode(m, msvcrt.CRTDBG_MODE_FILE) - msvcrt.CrtSetReportFile(m, msvcrt.CRTDBG_FILE_STDERR) - else: - msvcrt.CrtSetReportMode(m, 0) + msvcrt.CrtSetReportMode(m, 0) - support.use_resources = ns.use_resources def replace_stdout(): diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index d04d19985f7a0..b198c2ca76391 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1936,7 +1936,9 @@ def _run_suite(suite): # By default, don't filter tests _match_test_func = None -_match_test_patterns = None + +_accept_test_patterns = None +_ignore_test_patterns = None def match_test(test): @@ -1952,18 +1954,45 @@ def _is_full_match_test(pattern): # as a full test identifier. # Example: 'test.test_os.FileTests.test_access'. # - # Reject patterns which contain fnmatch patterns: '*', '?', '[...]' - # or '[!...]'. For example, reject 'test_access*'. + # ignore patterns which contain fnmatch patterns: '*', '?', '[...]' + # or '[!...]'. For example, ignore 'test_access*'. return ('.' in pattern) and (not re.search(r'[?*\[\]]', pattern)) -def set_match_tests(patterns): - global _match_test_func, _match_test_patterns +def set_match_tests(accept_patterns=None, ignore_patterns=None): + global _match_test_func, _accept_test_patterns, _ignore_test_patterns - if patterns == _match_test_patterns: - # No change: no need to recompile patterns. - return + if accept_patterns is None: + accept_patterns = () + if ignore_patterns is None: + ignore_patterns = () + + accept_func = ignore_func = None + + if accept_patterns != _accept_test_patterns: + accept_patterns, accept_func = _compile_match_function(accept_patterns) + if ignore_patterns != _ignore_test_patterns: + ignore_patterns, ignore_func = _compile_match_function(ignore_patterns) + + # Create a copy since patterns can be mutable and so modified later + _accept_test_patterns = tuple(accept_patterns) + _ignore_test_patterns = tuple(ignore_patterns) + + if accept_func is not None or ignore_func is not None: + def match_function(test_id): + accept = True + ignore = False + if accept_func: + accept = accept_func(test_id) + if ignore_func: + ignore = ignore_func(test_id) + return accept and not ignore + + _match_test_func = match_function + + +def _compile_match_function(patterns): if not patterns: func = None # set_match_tests(None) behaves as set_match_tests(()) @@ -1991,10 +2020,7 @@ def match_test_regex(test_id): func = match_test_regex - # Create a copy since patterns can be mutable and so modified later - _match_test_patterns = tuple(patterns) - _match_test_func = func - + return patterns, func def run_unittest(*classes): diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 26c9b16293c2b..a5ac8102008c1 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -157,6 +157,24 @@ def test_single(self): self.assertTrue(ns.single) self.checkError([opt, '-f', 'foo'], "don't go together") + def test_ignore(self): + for opt in '-i', '--ignore': + with self.subTest(opt=opt): + ns = libregrtest._parse_args([opt, 'pattern']) + self.assertEqual(ns.ignore_tests, ['pattern']) + self.checkError([opt], 'expected one argument') + + self.addCleanup(support.unlink, support.TESTFN) + with open(support.TESTFN, "w") as fp: + print('matchfile1', file=fp) + print('matchfile2', file=fp) + + filename = os.path.abspath(support.TESTFN) + ns = libregrtest._parse_args(['-m', 'match', + '--ignorefile', filename]) + self.assertEqual(ns.ignore_tests, + ['matchfile1', 'matchfile2']) + def test_match(self): for opt in '-m', '--match': with self.subTest(opt=opt): @@ -931,6 +949,42 @@ def parse_methods(self, output): regex = re.compile("^(test[^ ]+).*ok$", flags=re.MULTILINE) return [match.group(1) for match in regex.finditer(output)] + def test_ignorefile(self): + code = textwrap.dedent(""" + import unittest + + class Tests(unittest.TestCase): + def test_method1(self): + pass + def test_method2(self): + pass + def test_method3(self): + pass + def test_method4(self): + pass + """) + all_methods = ['test_method1', 'test_method2', + 'test_method3', 'test_method4'] + testname = self.create_test(code=code) + + # only run a subset + filename = support.TESTFN + self.addCleanup(support.unlink, filename) + + subset = [ + # only ignore the method name + 'test_method1', + # ignore the full identifier + '%s.Tests.test_method3' % testname] + with open(filename, "w") as fp: + for name in subset: + print(name, file=fp) + + output = self.run_tests("-v", "--ignorefile", filename, testname) + methods = self.parse_methods(output) + subset = ['test_method2', 'test_method4'] + self.assertEqual(methods, subset) + def test_matchfile(self): code = textwrap.dedent(""" import unittest diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index e29846efe5540..7c1ddb87f1922 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -529,6 +529,7 @@ def id(self): test_access = Test('test.test_os.FileTests.test_access') test_chdir = Test('test.test_os.Win32ErrorTests.test_chdir') + # Test acceptance with support.swap_attr(support, '_match_test_func', None): # match all support.set_match_tests([]) @@ -536,45 +537,92 @@ def id(self): self.assertTrue(support.match_test(test_chdir)) # match all using None - support.set_match_tests(None) + support.set_match_tests(None, None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # match the full test identifier - support.set_match_tests([test_access.id()]) + support.set_match_tests([test_access.id()], None) self.assertTrue(support.match_test(test_access)) self.assertFalse(support.match_test(test_chdir)) # match the module name - support.set_match_tests(['test_os']) + support.set_match_tests(['test_os'], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # Test '*' pattern - support.set_match_tests(['test_*']) + support.set_match_tests(['test_*'], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # Test case sensitivity - support.set_match_tests(['filetests']) + support.set_match_tests(['filetests'], None) self.assertFalse(support.match_test(test_access)) - support.set_match_tests(['FileTests']) + support.set_match_tests(['FileTests'], None) self.assertTrue(support.match_test(test_access)) # Test pattern containing '.' and a '*' metacharacter - support.set_match_tests(['*test_os.*.test_*']) + support.set_match_tests(['*test_os.*.test_*'], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) # Multiple patterns - support.set_match_tests([test_access.id(), test_chdir.id()]) + support.set_match_tests([test_access.id(), test_chdir.id()], None) self.assertTrue(support.match_test(test_access)) self.assertTrue(support.match_test(test_chdir)) - support.set_match_tests(['test_access', 'DONTMATCH']) + support.set_match_tests(['test_access', 'DONTMATCH'], None) self.assertTrue(support.match_test(test_access)) self.assertFalse(support.match_test(test_chdir)) + # Test rejection + with support.swap_attr(support, '_match_test_func', None): + # match all + support.set_match_tests(ignore_patterns=[]) + self.assertTrue(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + + # match all using None + support.set_match_tests(None, None) + self.assertTrue(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + + # match the full test identifier + support.set_match_tests(None, [test_access.id()]) + self.assertFalse(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + + # match the module name + support.set_match_tests(None, ['test_os']) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + # Test '*' pattern + support.set_match_tests(None, ['test_*']) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + # Test case sensitivity + support.set_match_tests(None, ['filetests']) + self.assertTrue(support.match_test(test_access)) + support.set_match_tests(None, ['FileTests']) + self.assertFalse(support.match_test(test_access)) + + # Test pattern containing '.' and a '*' metacharacter + support.set_match_tests(None, ['*test_os.*.test_*']) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + # Multiple patterns + support.set_match_tests(None, [test_access.id(), test_chdir.id()]) + self.assertFalse(support.match_test(test_access)) + self.assertFalse(support.match_test(test_chdir)) + + support.set_match_tests(None, ['test_access', 'DONTMATCH']) + self.assertFalse(support.match_test(test_access)) + self.assertTrue(support.match_test(test_chdir)) + def test_fd_count(self): # We cannot test the absolute value of fd_count(): on old Linux # kernel or glibc versions, os.urandom() keeps a FD open on diff --git a/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst b/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst new file mode 100644 index 0000000000000..1df523e90c388 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst @@ -0,0 +1,3 @@ +test.regrtest now uses process groups in the multiprocessing mode (-jN command +line option) if process groups are available: if :func:`os.setsid` and +:func:`os.killpg` functions are available. diff --git a/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst b/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst new file mode 100644 index 0000000000000..75e186ef33e07 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst @@ -0,0 +1,3 @@ +test.regrtest now can receive a list of test patterns to ignore (using the +-i/--ignore argument) or a file with a list of patterns to ignore (using the +--ignore-file argument). Patch by Pablo Galindo. From webhook-mailer at python.org Tue Apr 14 19:14:22 2020 From: webhook-mailer at python.org (Ethan Smith) Date: Tue, 14 Apr 2020 23:14:22 -0000 Subject: [Python-checkins] bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425) Message-ID: https://github.com/python/cpython/commit/d01628e411752ee6849f862cae66a1c69fe512b7 commit: d01628e411752ee6849f862cae66a1c69fe512b7 branch: master author: Ethan Smith committer: GitHub date: 2020-04-14T16:14:15-07:00 summary: bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425) files: M Lib/dataclasses.py M Lib/mailbox.py M Lib/test/test_context.py M Lib/test/test_genericalias.py M Python/context.c diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 00851c648a13b..fc69508354bbe 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -7,6 +7,7 @@ import builtins import functools import _thread +from types import GenericAlias __all__ = ['dataclass', @@ -284,6 +285,8 @@ def __set_name__(self, owner, name): # it. func(self.default, owner, name) + __class_getitem__ = classmethod(GenericAlias) + class _DataclassParams: __slots__ = ('init', diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 5b4e86419f117..70da07ed2e9e8 100644 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -18,6 +18,7 @@ import email.generator import io import contextlib +from types import GenericAlias try: import fcntl except ImportError: @@ -260,6 +261,8 @@ def _dump_message(self, message, target, mangle_from_=False): else: raise TypeError('Invalid message type: %s' % type(message)) + __class_getitem__ = classmethod(GenericAlias) + class Maildir(Mailbox): """A qmail-style Maildir mailbox.""" @@ -2015,6 +2018,8 @@ def closed(self): return False return self._file.closed + __class_getitem__ = classmethod(GenericAlias) + class _PartialFile(_ProxyFile): """A read-only wrapper of part of a file.""" diff --git a/Lib/test/test_context.py b/Lib/test/test_context.py index b9e991a400092..2d8b63a1f5958 100644 --- a/Lib/test/test_context.py +++ b/Lib/test/test_context.py @@ -358,10 +358,6 @@ def sub(num): tp.shutdown() self.assertEqual(results, list(range(10))) - def test_contextvar_getitem(self): - clss = contextvars.ContextVar - self.assertEqual(clss[str], clss) - # HAMT Tests diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 686df17d6a961..37cbf92ed1161 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -9,7 +9,10 @@ from concurrent.futures import Future from concurrent.futures.thread import _WorkItem from contextlib import AbstractContextManager, AbstractAsyncContextManager -from functools import partial, partialmethod, _lru_cache_wrapper, cached_property +from contextvars import ContextVar, Token +from dataclasses import Field +from functools import partial, partialmethod, cached_property +from mailbox import Mailbox, _PartialFile from ctypes import Array, LibraryLoader from difflib import SequenceMatcher from filecmp import dircmp @@ -60,6 +63,9 @@ def test_subscriptable(self): Reversible, Container, Collection, Callable, + Mailbox, _PartialFile, + ContextVar, Token, + Field, Set, MutableSet, Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, diff --git a/Python/context.c b/Python/context.c index 00f25ddab41d1..15749e9fd7741 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1024,13 +1024,6 @@ _contextvars_ContextVar_reset(PyContextVar *self, PyObject *token) } -static PyObject * -contextvar_cls_getitem(PyObject *self, PyObject *arg) -{ - Py_INCREF(self); - return self; -} - static PyMemberDef PyContextVar_members[] = { {"name", T_OBJECT, offsetof(PyContextVar, var_name), READONLY}, {NULL} @@ -1040,8 +1033,8 @@ static PyMethodDef PyContextVar_methods[] = { _CONTEXTVARS_CONTEXTVAR_GET_METHODDEF _CONTEXTVARS_CONTEXTVAR_SET_METHODDEF _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF - {"__class_getitem__", contextvar_cls_getitem, - METH_O | METH_CLASS, NULL}, + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} }; @@ -1180,10 +1173,17 @@ static PyGetSetDef PyContextTokenType_getsetlist[] = { {NULL} }; +static PyMethodDef PyContextTokenType_methods[] = { + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, + {NULL} +}; + PyTypeObject PyContextToken_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "Token", sizeof(PyContextToken), + .tp_methods = PyContextTokenType_methods, .tp_getset = PyContextTokenType_getsetlist, .tp_dealloc = (destructor)token_tp_dealloc, .tp_getattro = PyObject_GenericGetAttr, From webhook-mailer at python.org Tue Apr 14 20:04:50 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 00:04:50 -0000 Subject: [Python-checkins] bpo-40268: Remove explicit pythread.h includes (#19529) Message-ID: https://github.com/python/cpython/commit/62183b8d6d49e59c6a98bbdaa65b7ea1415abb7f commit: 62183b8d6d49e59c6a98bbdaa65b7ea1415abb7f branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T02:04:42+02:00 summary: bpo-40268: Remove explicit pythread.h includes (#19529) Remove explicit pythread.h includes: it is always included by Python.h. files: M Include/Python.h M Include/pystate.h M Modules/_blake2/blake2b_impl.c M Modules/_blake2/blake2s_impl.c M Modules/_bz2module.c M Modules/_decimal/_decimal.c M Modules/_io/bufferedio.c M Modules/_lzmamodule.c M Modules/_queuemodule.c M Modules/_sqlite/connection.c M Modules/_ssl.c M Modules/_testcapimodule.c M Modules/_threadmodule.c M Modules/_tkinter.c M Modules/_tracemalloc.c M Modules/faulthandler.c M Modules/posixmodule.c M Modules/signalmodule.c M Modules/socketmodule.c M Modules/timemodule.c M Modules/zlibmodule.c M Parser/myreadline.c M Programs/_testembed.c M Python/ceval.c M Python/import.c M Python/pylifecycle.c M Python/sysmodule.c M Python/thread.c diff --git a/Include/Python.h b/Include/Python.h index 769ec49779c0f..7fdb9df7065de 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -131,6 +131,7 @@ #include "pyerrors.h" #include "cpython/initconfig.h" +#include "pythread.h" #include "pystate.h" #include "context.h" diff --git a/Include/pystate.h b/Include/pystate.h index c46d3fef15d77..65b0a24e87f86 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -7,8 +7,6 @@ extern "C" { #endif -#include "pythread.h" - /* This limitation is for performance and simplicity. If needed it can be removed (with effort). */ #define MAX_CO_EXTRA_USERS 255 diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c index 88c103f56c4af..7fb1296f8b2b9 100644 --- a/Modules/_blake2/blake2b_impl.c +++ b/Modules/_blake2/blake2b_impl.c @@ -15,7 +15,6 @@ #include "Python.h" #include "pystrhex.h" -#include "pythread.h" #include "../hashlib.h" #include "blake2ns.h" diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c index c7c7eafdee229..e3e90d0587b80 100644 --- a/Modules/_blake2/blake2s_impl.c +++ b/Modules/_blake2/blake2s_impl.c @@ -15,7 +15,6 @@ #include "Python.h" #include "pystrhex.h" -#include "pythread.h" #include "../hashlib.h" #include "blake2ns.h" diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c index 008aef0555f4f..d46f96cc866ef 100644 --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -5,8 +5,6 @@ #include "Python.h" #include "structmember.h" -#include "pythread.h" - #include #include diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index cdc942f2158c3..99f12364ad81b 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -28,7 +28,6 @@ #include #include "longintrepr.h" -#include "pythread.h" #include "structmember.h" #include "complexobject.h" #include "mpdecimal.h" diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 4ec42eb01082c..f243ac84e9e77 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -11,7 +11,6 @@ #include "Python.h" #include "pycore_object.h" #include "structmember.h" -#include "pythread.h" #include "_iomodule.h" /*[clinic input] diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index 714458be783f9..eac36b2d72f22 100644 --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -9,7 +9,6 @@ #include "Python.h" #include "structmember.h" -#include "pythread.h" #include #include diff --git a/Modules/_queuemodule.c b/Modules/_queuemodule.c index 28bf8991285d8..062102e5c81bc 100644 --- a/Modules/_queuemodule.c +++ b/Modules/_queuemodule.c @@ -1,6 +1,5 @@ #include "Python.h" #include "structmember.h" /* offsetof */ -#include "pythread.h" /*[clinic input] module _queue diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 91041b95cd82f..87a9f41021390 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -30,8 +30,6 @@ #include "prepare_protocol.h" #include "util.h" -#include "pythread.h" - #define ACTION_FINALIZE 1 #define ACTION_RESET 2 diff --git a/Modules/_ssl.c b/Modules/_ssl.c index a471a26e93360..d633a06053ae3 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -18,8 +18,6 @@ #include "Python.h" -#include "pythread.h" - /* Redefined below for Windows debug builds after important #includes */ #define _PySSL_FIX_ERRNO diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index c97cbe8355197..8a76a3b1f2480 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -17,7 +17,6 @@ #include "Python.h" #include "datetime.h" #include "marshal.h" -#include "pythread.h" #include "structmember.h" #include #include diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 8ff06698a807c..6e7ee0f43e3e0 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -6,7 +6,6 @@ #include "pycore_pylifecycle.h" #include "pycore_interp.h" // _PyInterpreterState.num_threads #include "pycore_pystate.h" // _PyThreadState_Init() -#include "pythread.h" #include // offsetof() static PyObject *ThreadError; diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index 199ae4f0db8f0..f530c5b0eb7b6 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -26,8 +26,6 @@ Copyright (C) 1994 Steen Lumholt. #include "Python.h" #include -#include "pythread.h" - #ifdef MS_WINDOWS #include #endif diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 6f3f31a67b518..691de07b9b3c6 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -4,7 +4,6 @@ #include "pycore_traceback.h" #include "hashtable.h" #include "frameobject.h" -#include "pythread.h" #include "osdefs.h" #include "clinic/_tracemalloc.c.h" diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index ec9debcd94854..e7a285033051d 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -1,7 +1,6 @@ #include "Python.h" #include "pycore_initconfig.h" #include "pycore_traceback.h" -#include "pythread.h" #include #include #include diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 692dda314b304..7ac74842152ef 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -38,7 +38,6 @@ #include "pycore_ceval.h" /* _PyEval_ReInitThreads() */ #include "pycore_import.h" /* _PyImport_ReInitLock() */ #include "pycore_pystate.h" /* _PyInterpreterState_GET() */ -#include "pythread.h" #include "structmember.h" #ifndef MS_WINDOWS # include "posixmodule.h" diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 69d69ace28ebb..8348971c353ba 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -104,8 +104,6 @@ class sigset_t_converter(CConverter): may not be the thread that received the signal. */ -#include "pythread.h" - static volatile struct { _Py_atomic_int tripped; PyObject *func; diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 722c06e372e38..2be0c103f802f 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -234,13 +234,8 @@ if_indextoname(index) -- return the corresponding interface name\n\ #define RELEASE_GETADDRINFO_LOCK #endif -#if defined(USE_GETHOSTBYNAME_LOCK) || defined(USE_GETADDRINFO_LOCK) -# include "pythread.h" -#endif - - #if defined(__APPLE__) || defined(__CYGWIN__) || defined(__NetBSD__) -# include +# include #endif diff --git a/Modules/timemodule.c b/Modules/timemodule.c index e269cd047fb43..a0e66ac170b21 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -25,13 +25,12 @@ #endif #if defined(__WATCOMC__) && !defined(__QNX__) -#include +# include #else -#ifdef MS_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include -#include "pythread.h" -#endif /* MS_WINDOWS */ +# ifdef MS_WINDOWS +# define WIN32_LEAN_AND_MEAN +# include +# endif /* MS_WINDOWS */ #endif /* !__WATCOMC__ || __QNX__ */ #ifdef _Py_MEMORY_SANITIZER diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index 49d231a4baacb..c2900a1243f29 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -10,7 +10,6 @@ #include "zlib.h" -#include "pythread.h" #define ENTER_ZLIB(obj) \ Py_BEGIN_ALLOW_THREADS; \ PyThread_acquire_lock((obj)->lock, 1); \ diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 7da8ea8378065..04c2793225cb3 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -19,7 +19,6 @@ PyThreadState* _PyOS_ReadlineTState = NULL; -#include "pythread.h" static PyThread_type_lock _PyOS_ReadlineLock = NULL; int (*PyOS_InputHook)(void) = NULL; diff --git a/Programs/_testembed.c b/Programs/_testembed.c index da3e7861d1e80..249f7e2304f92 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -9,7 +9,6 @@ #include "pycore_initconfig.h" // _PyConfig_InitCompatConfig() #include "pycore_runtime.h" // _PyRuntime #include -#include "pythread.h" #include #include #include diff --git a/Python/ceval.c b/Python/ceval.c index 505f05cadd1ae..5e54356719377 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -240,7 +240,6 @@ UNSIGNAL_ASYNC_EXC(PyInterpreterState *interp) #ifdef HAVE_ERRNO_H #include #endif -#include "pythread.h" #include "ceval_gil.h" static void diff --git a/Python/import.c b/Python/import.c index 49334637d6754..2f2e9d17061bf 100644 --- a/Python/import.c +++ b/Python/import.c @@ -150,8 +150,6 @@ _PyImportZip_Init(PyThreadState *tstate) in different threads to return with a partially loaded module. These calls are serialized by the global interpreter lock. */ -#include "pythread.h" - static PyThread_type_lock import_lock = 0; static unsigned long import_lock_thread = PYTHREAD_INVALID_THREAD_ID; static int import_lock_level = 0; diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 754e7620a0cc0..974b425712cc8 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2350,8 +2350,6 @@ Py_ExitStatusException(PyStatus status) /* Clean up and exit */ -# include "pythread.h" - /* For the atexit module. */ void _Py_PyAtExit(void (*func)(PyObject *), PyObject *module) { diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 741979a09acc0..63111d58ab2e1 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -26,7 +26,6 @@ Data members: #include "pycore_pymem.h" #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" -#include "pythread.h" #include "pydtrace.h" #include "osdefs.h" diff --git a/Python/thread.c b/Python/thread.c index 127610318663d..a10f5728dc0ce 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -23,8 +23,6 @@ #include -#include "pythread.h" - #ifndef _POSIX_THREADS /* Check if we're running on HP-UX and _SC_THREADS is defined. If so, then From webhook-mailer at python.org Tue Apr 14 20:35:49 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 00:35:49 -0000 Subject: [Python-checkins] bpo-40268: Remove unused structmember.h includes (GH-19530) Message-ID: https://github.com/python/cpython/commit/4a21e57fe55076c77b0ee454e1994ca544d09dc0 commit: 4a21e57fe55076c77b0ee454e1994ca544d09dc0 branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T02:35:41+02:00 summary: bpo-40268: Remove unused structmember.h includes (GH-19530) If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used. files: M Modules/_abc.c M Modules/_asynciomodule.c M Modules/_bz2module.c M Modules/_collectionsmodule.c M Modules/_csv.c M Modules/_ctypes/_ctypes.c M Modules/_ctypes/callproc.c M Modules/_datetimemodule.c M Modules/_decimal/_decimal.c M Modules/_elementtree.c M Modules/_functoolsmodule.c M Modules/_hashopenssl.c M Modules/_io/_iomodule.c M Modules/_io/bufferedio.c M Modules/_io/bytesio.c M Modules/_io/fileio.c M Modules/_io/iobase.c M Modules/_io/stringio.c M Modules/_io/textio.c M Modules/_io/winconsoleio.c M Modules/_json.c M Modules/_lzmamodule.c M Modules/_multiprocessing/posixshmem.c M Modules/_pickle.c M Modules/_queuemodule.c M Modules/_sqlite/connection.c M Modules/_sqlite/microprotocols.c M Modules/_sre.c M Modules/_statisticsmodule.c M Modules/_struct.c M Modules/_testcapimodule.c M Modules/_threadmodule.c M Modules/_winapi.c M Modules/arraymodule.c M Modules/cjkcodecs/multibytecodec.c M Modules/itertoolsmodule.c M Modules/mmapmodule.c M Modules/ossaudiodev.c M Modules/overlapped.c M Modules/posixmodule.c M Modules/pyexpat.c M Modules/selectmodule.c M Modules/sha256module.c M Modules/sha512module.c M Modules/socketmodule.c M Modules/unicodedata.c M Modules/xxsubtype.c M Modules/zlibmodule.c M Objects/abstract.c M Objects/bytearrayobject.c M Objects/classobject.c M Objects/codeobject.c M Objects/complexobject.c M Objects/descrobject.c M Objects/exceptions.c M Objects/frameobject.c M Objects/funcobject.c M Objects/genericaliasobject.c M Objects/genobject.c M Objects/methodobject.c M Objects/moduleobject.c M Objects/namespaceobject.c M Objects/odictobject.c M Objects/rangeobject.c M Objects/setobject.c M Objects/sliceobject.c M Objects/structseq.c M Objects/typeobject.c M Objects/weakrefobject.c M PC/winreg.c M Parser/asdl_c.py M Python/Python-ast.c M Python/ceval.c M Python/context.c M Python/hamt.c M Python/structmember.c M Python/symtable.c M Python/traceback.c diff --git a/Modules/_abc.c b/Modules/_abc.c index 1efc98bf72c07..7c040ef80ba3d 100644 --- a/Modules/_abc.c +++ b/Modules/_abc.c @@ -1,7 +1,6 @@ /* ABCMeta implementation */ #include "Python.h" -#include "structmember.h" #include "clinic/_abc.c.h" /*[clinic input] diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index c10866aba7ce3..96a99fe49ceb0 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "structmember.h" +#include // offsetof() /*[clinic input] diff --git a/Modules/_bz2module.c b/Modules/_bz2module.c index d46f96cc866ef..880632c62349f 100644 --- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -3,7 +3,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include #include diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 181e3229da4f2..978ea03bd9058 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -1,10 +1,10 @@ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #ifdef STDC_HEADERS #include #else -#include /* For size_t */ +#include // size_t #endif /*[clinic input] diff --git a/Modules/_csv.c b/Modules/_csv.c index 950b0d7005522..3a52632ccfd45 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -11,7 +11,7 @@ module instead. #define MODULE_VERSION "1.0" #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 5548c50cf53e4..ceae67ebb1612 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -102,7 +102,7 @@ bytes(cdata) #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include #ifdef MS_WIN32 diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index 815fc6664d0ba..5c1ecabd8164d 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -55,7 +55,7 @@ */ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #ifdef MS_WIN32 #include @@ -751,7 +751,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa) #if defined(MS_WIN32) && !defined(_WIN32_WCE) /* Per: https://msdn.microsoft.com/en-us/library/7572ztz4.aspx -To be returned by value in RAX, user-defined types must have a length +To be returned by value in RAX, user-defined types must have a length of 1, 2, 4, 8, 16, 32, or 64 bits */ int can_return_struct_as_int(size_t s) diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index f7c1b69def3e7..9bdc52e949718 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -9,7 +9,7 @@ #include "Python.h" #include "datetime.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index 99f12364ad81b..20ba8fb77ad44 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -28,7 +28,6 @@ #include #include "longintrepr.h" -#include "structmember.h" #include "complexobject.h" #include "mpdecimal.h" diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 03ac6b6c0743d..2c92a8aedb5a8 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -14,7 +14,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef /* -------------------------------------------------------------------- */ /* configuration */ diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index d9536bb4e92d0..90e388c1c635c 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,8 +1,8 @@ #include "Python.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef /* _functools module written and maintained by Hye-Shik Chang diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 1782636dbc6d7..0919cd3f47caa 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -14,7 +14,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #include "hashlib.h" #include "pystrhex.h" diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 571f22552527f..d7cadacea1b5b 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -9,7 +9,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" #include "_iomodule.h" #ifdef HAVE_SYS_TYPES_H diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index f243ac84e9e77..f8e21f206f316 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -10,7 +10,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_object.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "_iomodule.h" /*[clinic input] diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c index f4261b3713ac1..2468f45f941e2 100644 --- a/Modules/_io/bytesio.c +++ b/Modules/_io/bytesio.c @@ -1,6 +1,6 @@ #include "Python.h" #include "pycore_object.h" -#include "structmember.h" /* for offsetof() */ +#include // offsetof() #include "_iomodule.h" /*[clinic input] diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 1855b83449d2a..caf91dfdb749e 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -3,7 +3,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_object.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include #ifdef HAVE_SYS_TYPES_H #include diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 924ffb57ca95c..a8e55c34799bd 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -11,7 +11,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_object.h" -#include "structmember.h" +#include // offsetof() #include "_iomodule.h" /*[clinic input] diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 9feb76e7ffaf4..e76152e617bdc 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -1,6 +1,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include // offsetof() #include "pycore_accu.h" #include "pycore_object.h" #include "_iomodule.h" diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 9e33c1ed17b0f..1abc9ca6f206a 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -8,10 +8,10 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.fs_codec +#include "pycore_interp.h" // PyInterpreterState.fs_codec #include "pycore_object.h" -#include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "structmember.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "structmember.h" // PyMemberDef #include "_iomodule.h" /*[clinic input] diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c index 94760acd47bf2..a83ef37a1fcf7 100644 --- a/Modules/_io/winconsoleio.c +++ b/Modules/_io/winconsoleio.c @@ -12,7 +12,7 @@ #ifdef MS_WINDOWS -#include "structmember.h" +#include "structmember.h" // PyMemberDef #ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/Modules/_json.c b/Modules/_json.c index 17544165d8241..075aa3d2f4f6c 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -9,7 +9,7 @@ #endif #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "pycore_accu.h" typedef struct { diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c index eac36b2d72f22..2a62a68356850 100644 --- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -8,7 +8,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include #include diff --git a/Modules/_multiprocessing/posixshmem.c b/Modules/_multiprocessing/posixshmem.c index 2049dbbc6fa83..436ac6d6b39f4 100644 --- a/Modules/_multiprocessing/posixshmem.c +++ b/Modules/_multiprocessing/posixshmem.c @@ -5,7 +5,6 @@ posixshmem - A Python extension that provides shm_open() and shm_unlink() #define PY_SSIZE_T_CLEAN #include -#include "structmember.h" // for shm_open() and shm_unlink() #ifdef HAVE_SYS_MMAN_H diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 4b46c1fe2af68..d07fa53a1235e 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -9,7 +9,7 @@ #endif #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef PyDoc_STRVAR(pickle_module_doc, "Optimized C implementation for the Python pickle module."); diff --git a/Modules/_queuemodule.c b/Modules/_queuemodule.c index 062102e5c81bc..b155ea942398b 100644 --- a/Modules/_queuemodule.c +++ b/Modules/_queuemodule.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "structmember.h" /* offsetof */ +#include // offsetof() /*[clinic input] module _queue diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 87a9f41021390..958be7d869794 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -23,7 +23,7 @@ #include "cache.h" #include "module.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "connection.h" #include "statement.h" #include "cursor.h" diff --git a/Modules/_sqlite/microprotocols.c b/Modules/_sqlite/microprotocols.c index bb0d19f653b31..3b2d7f42b8735 100644 --- a/Modules/_sqlite/microprotocols.c +++ b/Modules/_sqlite/microprotocols.c @@ -24,7 +24,6 @@ */ #include -#include #include "cursor.h" #include "microprotocols.h" diff --git a/Modules/_sre.c b/Modules/_sre.c index 836d7961832ea..244e4f1f84dff 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -41,7 +41,7 @@ static const char copyright[] = #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" /* offsetof */ +#include "structmember.h" // PyMemberDef #include "sre.h" diff --git a/Modules/_statisticsmodule.c b/Modules/_statisticsmodule.c index e98359a8d8dee..78c0676a01f02 100644 --- a/Modules/_statisticsmodule.c +++ b/Modules/_statisticsmodule.c @@ -1,7 +1,6 @@ /* statistics accelerator C extension: _statistics module. */ #include "Python.h" -#include "structmember.h" #include "clinic/_statisticsmodule.c.h" /*[clinic input] diff --git a/Modules/_struct.c b/Modules/_struct.c index 82ac0a19208d9..13d8072f61218 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -6,7 +6,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include /*[clinic input] diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 8a76a3b1f2480..8e18b14a0a890 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -17,7 +17,7 @@ #include "Python.h" #include "datetime.h" #include "marshal.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include #include diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 6e7ee0f43e3e0..b3d90b22c5a66 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -4,9 +4,9 @@ #include "Python.h" #include "pycore_pylifecycle.h" -#include "pycore_interp.h" // _PyInterpreterState.num_threads -#include "pycore_pystate.h" // _PyThreadState_Init() -#include // offsetof() +#include "pycore_interp.h" // _PyInterpreterState.num_threads +#include "pycore_pystate.h" // _PyThreadState_Init() +#include // offsetof() static PyObject *ThreadError; static PyObject *str_dict; @@ -587,8 +587,6 @@ newlockobject(void) /* Thread-local objects */ -#include "structmember.h" - /* Quick overview: We need to be able to reclaim reference cycles as soon as possible diff --git a/Modules/_winapi.c b/Modules/_winapi.c index 5dc50fbe4d59d..1b28adb0b3983 100644 --- a/Modules/_winapi.c +++ b/Modules/_winapi.c @@ -35,7 +35,7 @@ /* See http://www.python.org/2.4/license for licensing details. */ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #define WINDOWS_LEAN_AND_MEAN #include "windows.h" @@ -1110,8 +1110,8 @@ _winapi_CreateProcess_impl(PyObject *module, } } else if (command_line != Py_None) { - PyErr_Format(PyExc_TypeError, - "CreateProcess() argument 2 must be str or None, not %s", + PyErr_Format(PyExc_TypeError, + "CreateProcess() argument 2 must be str or None, not %s", Py_TYPE(command_line)->tp_name); goto cleanup; } diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 95ee5f881cc35..4920ad7b82124 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -5,7 +5,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include // offsetof() #ifdef STDC_HEADERS #include diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c index 319dc52749c65..86402768b6ee6 100644 --- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -6,7 +6,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "multibytecodec.h" #include "clinic/multibytecodec.c.h" diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 4ebeb741b6b5c..18fcebdf25b46 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -2,7 +2,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_tupleobject.h" -#include "structmember.h" +#include // offsetof() /* Itertools module written and maintained by Raymond D. Hettinger diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index a1267bdd549c1..6c503b3429b23 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -20,7 +20,7 @@ #define PY_SSIZE_T_CLEAN #include -#include "structmember.h" +#include // offsetof() #ifndef MS_WINDOWS #define UNIX diff --git a/Modules/ossaudiodev.c b/Modules/ossaudiodev.c index 0711d519b5cb6..2a1ac10814a69 100644 --- a/Modules/ossaudiodev.c +++ b/Modules/ossaudiodev.c @@ -19,7 +19,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #ifdef HAVE_FCNTL_H #include diff --git a/Modules/overlapped.c b/Modules/overlapped.c index e8029e72f90c7..a16797c47b5d6 100644 --- a/Modules/overlapped.c +++ b/Modules/overlapped.c @@ -8,7 +8,7 @@ Check itemsize */ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #define WINDOWS_LEAN_AND_MEAN #include diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7ac74842152ef..f5beb09240130 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -35,10 +35,10 @@ # include #endif -#include "pycore_ceval.h" /* _PyEval_ReInitThreads() */ -#include "pycore_import.h" /* _PyImport_ReInitLock() */ -#include "pycore_pystate.h" /* _PyInterpreterState_GET() */ -#include "structmember.h" +#include "pycore_ceval.h" // _PyEval_ReInitThreads() +#include "pycore_import.h" // _PyImport_ReInitLock() +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "structmember.h" // PyMemberDef #ifndef MS_WINDOWS # include "posixmodule.h" #else diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index d930e3e12bbba..12ae66d945bda 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -1,7 +1,7 @@ #include "Python.h" #include -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "frameobject.h" #include "expat.h" diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 1d09adcfd35be..5c15e9973ab84 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -9,7 +9,7 @@ #endif #include "Python.h" -#include +#include "structmember.h" // PyMemberDef #ifdef HAVE_SYS_DEVPOLL_H #include diff --git a/Modules/sha256module.c b/Modules/sha256module.c index eee582cdd35cc..731082655c0ec 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -17,7 +17,7 @@ /* SHA objects */ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "hashlib.h" #include "pystrhex.h" diff --git a/Modules/sha512module.c b/Modules/sha512module.c index b2e07273436e9..38d303d369ec5 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -17,7 +17,7 @@ /* SHA objects */ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "hashlib.h" #include "pystrhex.h" diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 2be0c103f802f..9db8535eb3434 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -101,7 +101,7 @@ Local naming conventions: #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #ifdef _Py_MEMORY_SANITIZER # include diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c index 569e785b291d3..8a1198a2b712d 100644 --- a/Modules/unicodedata.c +++ b/Modules/unicodedata.c @@ -17,7 +17,7 @@ #include "Python.h" #include "ucnhash.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index 031005d36e20f..7200337724e08 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef PyDoc_STRVAR(xxsubtype__doc__, "xxsubtype is an example module showing how to subtype builtin types from C.\n" diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index c2900a1243f29..fe27909ae8a75 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -6,7 +6,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "zlib.h" diff --git a/Objects/abstract.c b/Objects/abstract.c index 8e22dfeca99b4..6e390dd92c3ae 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1,12 +1,12 @@ /* Abstract Object Interface (many thanks to Jim Fulton) */ #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_pystate.h" // _PyThreadState_GET() #include -#include "structmember.h" /* we need the offsetof() macro from there */ +#include // offsetof() #include "longintrepr.h" diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 4d1ddec3822ff..f05a98acba043 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -2,11 +2,10 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "structmember.h" #include "bytesobject.h" #include "pystrhex.h" diff --git a/Objects/classobject.c b/Objects/classobject.c index ce4bf7b5ff97c..242a6428b8ef2 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -4,8 +4,8 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "structmember.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "structmember.h" // PyMemberDef #define TP_DESCR_GET(t) ((t)->tp_descr_get) diff --git a/Objects/codeobject.c b/Objects/codeobject.c index da04af43a4a25..737635943aced 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -3,7 +3,7 @@ #include "Python.h" #include "code.h" #include "opcode.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "pycore_code.h" #include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs #include "pycore_pystate.h" // _PyInterpreterState_GET() diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 8d1461b29b488..a49037783be77 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -6,7 +6,7 @@ /* Submitted by Jim Hugunin */ #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef /*[clinic input] class complex "PyComplexObject *" "&PyComplex_Type" diff --git a/Objects/descrobject.c b/Objects/descrobject.c index fe7ba79770a6a..572baa5e312d2 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -5,7 +5,7 @@ #include "pycore_object.h" #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" -#include "structmember.h" /* Why is this not included in Python.h? */ +#include "structmember.h" // PyMemberDef _Py_IDENTIFIER(getattr); diff --git a/Objects/exceptions.c b/Objects/exceptions.c index cb661f84ff2de..db1ff329ac143 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -9,7 +9,7 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "osdefs.h" diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 3c140acad7ea6..bdd7862b3c9d2 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -7,7 +7,7 @@ #include "code.h" #include "frameobject.h" #include "opcode.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #define OFF(x) offsetof(PyFrameObject, x) diff --git a/Objects/funcobject.c b/Objects/funcobject.c index af6766fbd7a9f..750c7aea0dfd6 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -6,7 +6,7 @@ #include "pycore_pymem.h" #include "pycore_tupleobject.h" #include "code.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef PyObject * PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname) diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 49f537ef96845..b8ad4d7014b0c 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -2,7 +2,7 @@ #include "Python.h" #include "pycore_object.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef typedef struct { PyObject_HEAD @@ -118,7 +118,7 @@ ga_repr(PyObject *self) _PyUnicodeWriter writer; _PyUnicodeWriter_Init(&writer); - + if (ga_repr_item(&writer, alias->origin) < 0) { goto error; } diff --git a/Objects/genobject.c b/Objects/genobject.c index b1a749d140e82..66c6ccba0c490 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1,11 +1,11 @@ /* Generator object implementation */ #include "Python.h" -#include "pycore_ceval.h" // _PyEval_EvalFrame() +#include "pycore_ceval.h" // _PyEval_EvalFrame() #include "pycore_object.h" -#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "opcode.h" static PyObject *gen_close(PyGenObject *, PyObject *); diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 4b4927db82094..f483671316225 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -2,12 +2,12 @@ /* Method object implementation */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "structmember.h" +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "structmember.h" // PyMemberDef /* undefine macro trampoline to PyCFunction_NewEx */ #undef PyCFunction_New diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 499ce09ae6b5b..ee4ed97588e29 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -2,9 +2,9 @@ /* Module object implementation */ #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.importlib -#include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "structmember.h" +#include "pycore_interp.h" // PyInterpreterState.importlib +#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "structmember.h" // PyMemberDef static Py_ssize_t max_module_number; diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index a28b9e509fcfb..29141a81d71ec 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -1,7 +1,7 @@ // namespace object implementation #include "Python.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef typedef struct { diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 2fcaa47876513..d5bf499575d09 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -466,7 +466,7 @@ Potential Optimizations #include "Python.h" #include "pycore_object.h" -#include "structmember.h" +#include // offsetof() #include "dict-common.h" #include diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 4bea8d78e12fa..751dbb9815d82 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -3,7 +3,7 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_tupleobject.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef /* Support objects whose length is > PY_SSIZE_T_MAX. diff --git a/Objects/setobject.c b/Objects/setobject.c index 0b15bedeb4ff3..8452546008bd1 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -32,8 +32,8 @@ */ #include "Python.h" -#include "pycore_object.h" // _PyObject_GC_UNTRACK() -#include "structmember.h" +#include "pycore_object.h" // _PyObject_GC_UNTRACK() +#include // offsetof() /* Object used as dummy key to fill deleted entries */ static PyObject _dummy_struct; diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 0a5f00dbe0a39..6093b3bd1534d 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -14,10 +14,10 @@ this type and there is exactly one in existence. */ #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef static PyObject * ellipsis_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) diff --git a/Objects/structseq.c b/Objects/structseq.c index 1865e2461a2f4..9bdda87ae0be0 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -10,7 +10,7 @@ #include "Python.h" #include "pycore_tupleobject.h" #include "pycore_object.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef static const char visible_length_key[] = "n_sequence_fields"; static const char real_length_key[] = "n_fields"; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 47766bf6fbbbf..a107715808fff 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5,9 +5,9 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index dd9b789823512..9640d93aaf2da 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -1,6 +1,6 @@ #include "Python.h" -#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR -#include "structmember.h" +#include "pycore_object.h" // _PyObject_GET_WEAKREFS_LISTPTR() +#include "structmember.h" // PyMemberDef #define GET_WEAKREFS_LISTPTR(o) \ diff --git a/PC/winreg.c b/PC/winreg.c index ec2f607d4a818..3e13e75826f15 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -14,8 +14,8 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "structmember.h" -#include "windows.h" +#include "structmember.h" // PyMemberDef +#include static BOOL PyHKEY_AsHKEY(PyObject *ob, HKEY *pRes, BOOL bNoneOK); static BOOL clinic_HKEY_converter(PyObject *ob, void *p); diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index bd22fb6bf73fe..c98f949042f30 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1428,7 +1428,7 @@ def main(srcfile, dump_module=False): f.write('\n') f.write('#include "Python.h"\n') f.write('#include "%s-ast.h"\n' % mod.name) - f.write('#include "structmember.h"\n') + f.write('#include "structmember.h" // PyMemberDef\n') f.write('\n') generate_module_def(f, mod) diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 488276a455546..80f91646fd62e 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -4,7 +4,7 @@ #include "Python.h" #include "Python-ast.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef typedef struct { int initialized; diff --git a/Python/ceval.c b/Python/ceval.c index 5e54356719377..59765d850ba1d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -29,7 +29,6 @@ #include "opcode.h" #include "pydtrace.h" #include "setobject.h" -#include "structmember.h" #include diff --git a/Python/context.c b/Python/context.c index 15749e9fd7741..f0217f280180a 100644 --- a/Python/context.c +++ b/Python/context.c @@ -6,7 +6,7 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "structmember.h" +#include "structmember.h" // PyMemberDef #define CONTEXT_FREELIST_MAXLEN 255 diff --git a/Python/hamt.c b/Python/hamt.c index 9924e3351243e..8801c5ea418c7 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -1,8 +1,8 @@ #include "Python.h" #include "pycore_hamt.h" -#include "pycore_object.h" // _PyObject_GC_TRACK() -#include "structmember.h" +#include "pycore_object.h" // _PyObject_GC_TRACK() +#include // offsetof() /* This file provides an implementation of an immutable mapping using the diff --git a/Python/structmember.c b/Python/structmember.c index e653d0277c1a1..ba88e15f93869 100644 --- a/Python/structmember.c +++ b/Python/structmember.c @@ -2,8 +2,7 @@ /* Map C struct members to Python object attributes */ #include "Python.h" - -#include "structmember.h" +#include "structmember.h" // PyMemberDef PyObject * PyMember_GetOne(const char *addr, PyMemberDef *l) diff --git a/Python/symtable.c b/Python/symtable.c index a3c5d650d1edc..d192f31deefb7 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -2,7 +2,7 @@ #include "pycore_pystate.h" // _PyThreadState_GET() #include "symtable.h" #undef Yield /* undefine macro conflicting with */ -#include "structmember.h" +#include "structmember.h" // PyMemberDef /* error strings used for warnings */ #define GLOBAL_PARAM \ diff --git a/Python/traceback.c b/Python/traceback.c index 610c2172ef833..e3397ecfe48f5 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -5,7 +5,7 @@ #include "code.h" #include "frameobject.h" -#include "structmember.h" +#include "structmember.h" // PyMemberDef #include "osdefs.h" #ifdef HAVE_FCNTL_H #include From webhook-mailer at python.org Tue Apr 14 20:57:58 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 00:57:58 -0000 Subject: [Python-checkins] bpo-40268: Remove unused pycore_pymem.h includes (GH-19531) Message-ID: https://github.com/python/cpython/commit/d9ea5cae1d07e1ee8b03540a9367c26205e0e360 commit: d9ea5cae1d07e1ee8b03540a9367c26205e0e360 branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T02:57:50+02:00 summary: bpo-40268: Remove unused pycore_pymem.h includes (GH-19531) files: M Modules/_functoolsmodule.c M Modules/gcmodule.c M Modules/main.c M Objects/bytearrayobject.c M Objects/bytesobject.c M Objects/cellobject.c M Objects/classobject.c M Objects/exceptions.c M Objects/funcobject.c M Objects/iterobject.c M Objects/memoryobject.c M Objects/methodobject.c M Objects/obmalloc.c M Objects/sliceobject.c M Python/import.c M Python/initconfig.c M Python/pathconfig.c M Python/preconfig.c M Python/pylifecycle.c M Python/pystate.c M Python/sysmodule.c diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 90e388c1c635c..78706b6ec3c4c 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,5 +1,4 @@ #include "Python.h" -#include "pycore_pymem.h" #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "structmember.h" // PyMemberDef diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index d2cd2c9296616..5727820f09bbb 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -30,7 +30,6 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_pymem.h" #include "frameobject.h" // PyFrame_ClearFreeList #include "pydtrace.h" #include "pytime.h" // _PyTime_GetMonotonicClock() diff --git a/Modules/main.c b/Modules/main.c index fa9c6b4eb9418..4d696a3590136 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -5,7 +5,6 @@ #include "pycore_interp.h" // _PyInterpreterState.sysdict #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" -#include "pycore_pymem.h" #include "pycore_pystate.h" // _PyInterpreterState_GET() /* Includes for exit_sigint() */ diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index f05a98acba043..b271e57abb686 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -5,7 +5,6 @@ #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_object.h" -#include "pycore_pymem.h" #include "bytesobject.h" #include "pystrhex.h" diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 30bc739ceea7f..06ead2b58f980 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -3,10 +3,10 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_object.h" -#include "pycore_pymem.h" +#include "pycore_pymem.h" // PYMEM_CLEANBYTE #include "pystrhex.h" #include diff --git a/Objects/cellobject.c b/Objects/cellobject.c index 6efae626bf5b7..86a89f02e60d3 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -2,7 +2,6 @@ #include "Python.h" #include "pycore_object.h" -#include "pycore_pymem.h" PyObject * PyCell_New(PyObject *obj) diff --git a/Objects/classobject.c b/Objects/classobject.c index 242a6428b8ef2..fd9f8757f84ab 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pymem.h" #include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" // PyMemberDef diff --git a/Objects/exceptions.c b/Objects/exceptions.c index db1ff329ac143..69a6b5c284dfa 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -8,7 +8,6 @@ #include #include "pycore_initconfig.h" #include "pycore_object.h" -#include "pycore_pymem.h" #include "structmember.h" // PyMemberDef #include "osdefs.h" diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 750c7aea0dfd6..bd24f67b9740a 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" -#include "pycore_pymem.h" #include "pycore_tupleobject.h" #include "code.h" #include "structmember.h" // PyMemberDef diff --git a/Objects/iterobject.c b/Objects/iterobject.c index 51104fbe9695f..6cac41ad539db 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -2,7 +2,6 @@ #include "Python.h" #include "pycore_object.h" -#include "pycore_pymem.h" typedef struct { PyObject_HEAD diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 4340f0675f163..682bbe8a61e85 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -13,7 +13,6 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" -#include "pycore_pymem.h" #include "pystrhex.h" #include diff --git a/Objects/methodobject.c b/Objects/methodobject.c index f483671316225..20eba6fa8643b 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -5,7 +5,6 @@ #include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pymem.h" #include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" // PyMemberDef diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index 3f6f9cf9ca4a4..eb34f10bddf99 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "pycore_pymem.h" +#include "pycore_pymem.h" // _PyTraceMalloc_Config #include diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 6093b3bd1534d..391711f711aae 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -16,7 +16,6 @@ this type and there is exactly one in existence. #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" -#include "pycore_pymem.h" #include "structmember.h" // PyMemberDef static PyObject * diff --git a/Python/import.c b/Python/import.c index 2f2e9d17061bf..a2aa4afa18a72 100644 --- a/Python/import.c +++ b/Python/import.c @@ -8,7 +8,7 @@ #include "pycore_pyerrors.h" #include "pycore_pyhash.h" #include "pycore_pylifecycle.h" -#include "pycore_pymem.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_interp.h" // _PyInterpreterState_ClearModules() #include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" diff --git a/Python/initconfig.c b/Python/initconfig.c index 201d930f7d8d2..32aafdb57addf 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -7,7 +7,7 @@ #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pymem.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_pystate.h" // _PyThreadState_GET() #include // setlocale() #ifdef HAVE_LANGINFO_H diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 1515926531a1c..6ebfdac3fd2d3 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -5,7 +5,7 @@ #include "pycore_initconfig.h" #include "pycore_fileutils.h" #include "pycore_pathconfig.h" -#include "pycore_pymem.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include #ifdef MS_WINDOWS # include // GetFullPathNameW(), MAX_PATH diff --git a/Python/preconfig.c b/Python/preconfig.c index 531d8d0df3504..1cbfccfe69ce1 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -1,9 +1,9 @@ #include "Python.h" #include "pycore_getopt.h" #include "pycore_initconfig.h" -#include "pycore_pymem.h" // _PyMem_GetAllocatorName() -#include "pycore_runtime.h" // _PyRuntime_Initialize() -#include // setlocale() +#include "pycore_pymem.h" // _PyMem_GetAllocatorName() +#include "pycore_runtime.h" // _PyRuntime_Initialize() +#include // setlocale() #define DECODE_LOCALE_ERR(NAME, LEN) \ diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 974b425712cc8..9c13274dac04d 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -14,7 +14,6 @@ #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pymem.h" #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" #include "pycore_traceback.h" diff --git a/Python/pystate.c b/Python/pystate.c index d25fb3a2a626e..84a694b32e5d0 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -6,7 +6,7 @@ #include "pycore_initconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pymem.h" +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 63111d58ab2e1..4e67325318aaf 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -17,14 +17,14 @@ Data members: #include "Python.h" #include "code.h" #include "frameobject.h" -#include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() +#include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pymem.h" -#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "pydtrace.h" From webhook-mailer at python.org Tue Apr 14 21:25:01 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 01:25:01 -0000 Subject: [Python-checkins] bpo-40268: Remove unused osdefs.h includes (GH-19532) Message-ID: https://github.com/python/cpython/commit/361dcdcefc80f5729ed18ac0ef73327794fbf400 commit: 361dcdcefc80f5729ed18ac0ef73327794fbf400 branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T03:24:57+02:00 summary: bpo-40268: Remove unused osdefs.h includes (GH-19532) When the include is needed, add required symbol in a comment. files: M Modules/_tracemalloc.c M Modules/getpath.c M Modules/posixmodule.c M Modules/syslogmodule.c M Objects/exceptions.c M PC/getpathp.c M Python/fileutils.c M Python/import.c M Python/pathconfig.c M Python/pylifecycle.c M Python/pythonrun.c M Python/sysmodule.c M Python/traceback.c diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 691de07b9b3c6..dbae107c2da20 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -4,7 +4,6 @@ #include "pycore_traceback.h" #include "hashtable.h" #include "frameobject.h" -#include "osdefs.h" #include "clinic/_tracemalloc.c.h" /*[clinic input] diff --git a/Modules/getpath.c b/Modules/getpath.c index 1dd8dd0134e7c..94e06b3e3e86b 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -4,7 +4,7 @@ #include "pycore_fileutils.h" #include "pycore_initconfig.h" #include "pycore_pathconfig.h" -#include "osdefs.h" +#include "osdefs.h" // DELIM #include #include diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f5beb09240130..89f9757c515bb 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -312,11 +312,11 @@ extern char *ctermid_r(char *); #ifndef IO_REPARSE_TAG_MOUNT_POINT #define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L) #endif -#include "osdefs.h" +#include "osdefs.h" // SEP #include #include -#include /* for ShellExecute() */ -#include /* for UNLEN */ +#include // ShellExecute() +#include // UNLEN #define HAVE_SYMLINK #endif /* _MSC_VER */ diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index 24517925c32eb..11718e277432f 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -50,7 +50,7 @@ Revision history: /* syslog module */ #include "Python.h" -#include "osdefs.h" +#include "osdefs.h" // SEP #include diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 69a6b5c284dfa..ca917b436c4bb 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -9,7 +9,7 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "structmember.h" // PyMemberDef -#include "osdefs.h" +#include "osdefs.h" // SEP /* Compatibility aliases */ @@ -1435,11 +1435,13 @@ my_basename(PyObject *name) size = PyUnicode_GET_LENGTH(name); offset = 0; for(i=0; i < size; i++) { - if (PyUnicode_READ(kind, data, i) == SEP) + if (PyUnicode_READ(kind, data, i) == SEP) { offset = i + 1; + } } - if (offset != 0) + if (offset != 0) { return PyUnicode_Substring(name, offset, size); + } else { Py_INCREF(name); return name; diff --git a/PC/getpathp.c b/PC/getpathp.c index 24a9323e6e67e..d23d2bbde809f 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -80,9 +80,9 @@ #include "Python.h" -#include "pycore_initconfig.h" /* PyStatus */ -#include "pycore_pathconfig.h" /* _PyPathConfig */ -#include "osdefs.h" +#include "pycore_initconfig.h" // PyStatus +#include "pycore_pathconfig.h" // _PyPathConfig +#include "osdefs.h" // SEP, ALTSEP #include #ifndef MS_WINDOWS diff --git a/Python/fileutils.c b/Python/fileutils.c index 19ead9d676c7f..439bc351596f7 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -1,6 +1,6 @@ #include "Python.h" #include "pycore_fileutils.h" -#include "osdefs.h" +#include "osdefs.h" // SEP #include #ifdef MS_WINDOWS diff --git a/Python/import.c b/Python/import.c index a2aa4afa18a72..a8743458dd5c9 100644 --- a/Python/import.c +++ b/Python/import.c @@ -16,7 +16,6 @@ #include "marshal.h" #include "code.h" #include "frameobject.h" -#include "osdefs.h" #include "importdl.h" #include "pydtrace.h" diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 6ebfdac3fd2d3..fe3ac3ee3d812 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -1,7 +1,7 @@ /* Path configuration like module_search_path (sys.path) */ #include "Python.h" -#include "osdefs.h" +#include "osdefs.h" // DELIM #include "pycore_initconfig.h" #include "pycore_fileutils.h" #include "pycore_pathconfig.h" diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 9c13274dac04d..688ee0c133b1e 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -26,7 +26,6 @@ #include "symtable.h" #include "ast.h" #include "marshal.h" -#include "osdefs.h" #include #ifdef HAVE_SIGNAL_H diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 246669994c4dd..d6bc88320358c 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -27,7 +27,6 @@ #include "symtable.h" #include "ast.h" #include "marshal.h" -#include "osdefs.h" #include #ifdef HAVE_SIGNAL_H diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 4e67325318aaf..92ea5e7d637b9 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -26,9 +26,9 @@ Data members: #include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" -#include "pydtrace.h" -#include "osdefs.h" +#include "pydtrace.h" +#include "osdefs.h" // DELIM #include #ifdef MS_WINDOWS diff --git a/Python/traceback.c b/Python/traceback.c index e3397ecfe48f5..85e9124bb6a68 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -6,7 +6,7 @@ #include "code.h" #include "frameobject.h" #include "structmember.h" // PyMemberDef -#include "osdefs.h" +#include "osdefs.h" // SEP #ifdef HAVE_FCNTL_H #include #endif From webhook-mailer at python.org Tue Apr 14 22:02:06 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 02:02:06 -0000 Subject: [Python-checkins] bpo-40268: Remove unused imports in pylifecycle.c (GH-19533) Message-ID: https://github.com/python/cpython/commit/4f98f465f14e7258c5b18a62c5aa114dbe1174d8 commit: 4f98f465f14e7258c5b18a62c5aa114dbe1174d8 branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T04:01:58+02:00 summary: bpo-40268: Remove unused imports in pylifecycle.c (GH-19533) Remove unused imports in files: * initconfig.c * main.c * preconfig.h * pylifecycle.c * python.c * pythonrun.c files: M Modules/main.c M Programs/python.c M Python/initconfig.c M Python/preconfig.c M Python/pylifecycle.c M Python/pythonrun.c diff --git a/Modules/main.c b/Modules/main.c index 4d696a3590136..bc3a2ed8ed8d1 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -1,22 +1,22 @@ /* Python interpreter main program */ #include "Python.h" -#include "pycore_initconfig.h" -#include "pycore_interp.h" // _PyInterpreterState.sysdict -#include "pycore_pathconfig.h" -#include "pycore_pylifecycle.h" -#include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "pycore_initconfig.h" // _PyArgv +#include "pycore_interp.h" // _PyInterpreterState.sysdict +#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0() +#include "pycore_pylifecycle.h" // _Py_PreInitializeFromPyArgv() +#include "pycore_pystate.h" // _PyInterpreterState_GET() /* Includes for exit_sigint() */ -#include /* perror() */ +#include // perror() #ifdef HAVE_SIGNAL_H -# include /* SIGINT */ +# include // SIGINT #endif #if defined(HAVE_GETPID) && defined(HAVE_UNISTD_H) -# include /* getpid() */ +# include // getpid() #endif #ifdef MS_WINDOWS -# include /* STATUS_CONTROL_C_EXIT */ +# include // STATUS_CONTROL_C_EXIT #endif /* End of includes for exit_sigint() */ diff --git a/Programs/python.c b/Programs/python.c index 1cc3c42cfcbf9..84148f7767a7e 100644 --- a/Programs/python.c +++ b/Programs/python.c @@ -1,7 +1,6 @@ /* Minimal main program -- everything is loaded from the library */ #include "Python.h" -#include "pycore_pylifecycle.h" #ifdef MS_WINDOWS int diff --git a/Python/initconfig.c b/Python/initconfig.c index 32aafdb57addf..c313d91ac7309 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -1,14 +1,15 @@ #include "Python.h" -#include "osdefs.h" // DELIM -#include "pycore_fileutils.h" -#include "pycore_getopt.h" -#include "pycore_initconfig.h" +#include "pycore_fileutils.h" // _Py_HasFileSystemDefaultEncodeErrors +#include "pycore_getopt.h" // _PyOS_GetOpt() +#include "pycore_initconfig.h" // _PyStatus_OK() #include "pycore_interp.h" // _PyInterpreterState.runtime -#include "pycore_pathconfig.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" +#include "pycore_pathconfig.h" // _Py_path_config +#include "pycore_pyerrors.h" // _PyErr_Fetch() +#include "pycore_pylifecycle.h" // _Py_PreInitializeFromConfig() #include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_pystate.h" // _PyThreadState_GET() + +#include "osdefs.h" // DELIM #include // setlocale() #ifdef HAVE_LANGINFO_H # include // nl_langinfo(CODESET) diff --git a/Python/preconfig.c b/Python/preconfig.c index 1cbfccfe69ce1..262738fa57da5 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -1,6 +1,6 @@ #include "Python.h" -#include "pycore_getopt.h" -#include "pycore_initconfig.h" +#include "pycore_getopt.h" // _PyOS_GetOpt() +#include "pycore_initconfig.h" // _PyArgv #include "pycore_pymem.h" // _PyMem_GetAllocatorName() #include "pycore_runtime.h" // _PyRuntime_Initialize() #include // setlocale() diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 688ee0c133b1e..7909cdbf5b772 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -4,50 +4,41 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with */ -#include "pycore_ceval.h" -#include "pycore_context.h" + +#include "pycore_ceval.h" // _PyEval_FiniGIL() +#include "pycore_context.h" // _PyContext_Init() +#include "pycore_fileutils.h" // _Py_ResetForceASCII() #include "pycore_import.h" // _PyImport_Cleanup() -#include "pycore_initconfig.h" -#include "pycore_fileutils.h" -#include "pycore_hamt.h" -#include "pycore_object.h" -#include "pycore_pathconfig.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" +#include "pycore_initconfig.h" // _PyStatus_OK() +#include "pycore_object.h" // _PyDebug_PrintTotalRefs() +#include "pycore_pathconfig.h" // _PyConfig_WritePathConfig() +#include "pycore_pyerrors.h" // _PyErr_Occurred() +#include "pycore_pylifecycle.h" // _PyErr_Print() #include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_sysmodule.h" -#include "pycore_traceback.h" -#include "grammar.h" -#include "node.h" -#include "token.h" -#include "parsetok.h" -#include "errcode.h" -#include "code.h" -#include "symtable.h" -#include "ast.h" -#include "marshal.h" -#include +#include "pycore_sysmodule.h" // _PySys_ClearAuditHooks() +#include "pycore_traceback.h" // _Py_DumpTracebackThreads() -#ifdef HAVE_SIGNAL_H -#include -#endif +#include "grammar.h" // PyGrammar_RemoveAccelerators() +#include // setlocale() -#ifdef MS_WINDOWS -#include "malloc.h" /* for alloca */ +#ifdef HAVE_SIGNAL_H +# include // SIG_IGN #endif #ifdef HAVE_LANGINFO_H -#include +# include // nl_langinfo(CODESET) #endif #ifdef MS_WINDOWS -#undef BYTE -#include "windows.h" +# undef BYTE +# include "windows.h" -extern PyTypeObject PyWindowsConsoleIO_Type; -#define PyWindowsConsoleIO_Check(op) (PyObject_TypeCheck((op), &PyWindowsConsoleIO_Type)) + extern PyTypeObject PyWindowsConsoleIO_Type; +# define PyWindowsConsoleIO_Check(op) \ + (PyObject_TypeCheck((op), &PyWindowsConsoleIO_Type)) #endif + _Py_IDENTIFIER(flush); _Py_IDENTIFIER(name); _Py_IDENTIFIER(stdin); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d6bc88320358c..0a25ebc854ff5 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -12,36 +12,33 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with */ + #include "pycore_interp.h" // PyInterpreterState.importlib -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" +#include "pycore_object.h" // _PyDebug_PrintTotalRefs() +#include "pycore_pyerrors.h" // _PyErr_Fetch +#include "pycore_pylifecycle.h" // _Py_UnhandledKeyboardInterrupt #include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_sysmodule.h" -#include "grammar.h" -#include "node.h" -#include "token.h" -#include "parsetok.h" -#include "errcode.h" -#include "code.h" -#include "symtable.h" -#include "ast.h" -#include "marshal.h" -#include - -#ifdef HAVE_SIGNAL_H -#include -#endif +#include "pycore_sysmodule.h" // _PySys_Audit() + +#include "node.h" // node +#include "token.h" // INDENT +#include "parsetok.h" // perrdetail +#include "errcode.h" // E_EOF +#include "code.h" // PyCodeObject +#include "symtable.h" // PySymtable_BuildObject() +#include "ast.h" // PyAST_FromNodeObject() +#include "marshal.h" // PyMarshal_ReadLongFromFile() #ifdef MS_WINDOWS -#include "malloc.h" /* for alloca */ +# include "malloc.h" // alloca() #endif #ifdef MS_WINDOWS -#undef BYTE -#include "windows.h" +# undef BYTE +# include "windows.h" #endif + _Py_IDENTIFIER(builtins); _Py_IDENTIFIER(excepthook); _Py_IDENTIFIER(flush); From webhook-mailer at python.org Wed Apr 15 02:36:21 2020 From: webhook-mailer at python.org (Ammar Askar) Date: Wed, 15 Apr 2020 06:36:21 -0000 Subject: [Python-checkins] bpo-40277: Add a repr() to namedtuple's _tuplegetter to aid with introspection (GH-19537) Message-ID: https://github.com/python/cpython/commit/a86b522d8f1c8b9c26b5550de221d2227158cf4d commit: a86b522d8f1c8b9c26b5550de221d2227158cf4d branch: master author: Ammar Askar committer: GitHub date: 2020-04-14T23:36:08-07:00 summary: bpo-40277: Add a repr() to namedtuple's _tuplegetter to aid with introspection (GH-19537) files: A Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst M Lib/test/test_collections.py M Modules/_collectionsmodule.c diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index 0207823f5aab7..a8d3337ef5288 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -411,6 +411,18 @@ def test_field_doc_reuse(self): self.assertIs(P.m.__doc__, Q.o.__doc__) self.assertIs(P.n.__doc__, Q.p.__doc__) + @support.cpython_only + def test_field_repr(self): + Point = namedtuple('Point', 'x y') + self.assertEqual(repr(Point.x), "_tuplegetter(0, 'Alias for field number 0')") + self.assertEqual(repr(Point.y), "_tuplegetter(1, 'Alias for field number 1')") + + Point.x.__doc__ = 'The x-coordinate' + Point.y.__doc__ = 'The y-coordinate' + + self.assertEqual(repr(Point.x), "_tuplegetter(0, 'The x-coordinate')") + self.assertEqual(repr(Point.y), "_tuplegetter(1, 'The y-coordinate')") + def test_name_fixer(self): for spec, renamed in [ [('efg', 'g%hi'), ('efg', '_1')], # field with non-alpha char diff --git a/Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst b/Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst new file mode 100644 index 0000000000000..1fa2999f7f0a4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst @@ -0,0 +1,2 @@ +:func:`collections.namedtuple` now provides a human-readable repr for its +field accessors. diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index 978ea03bd9058..7120e4dda0ed2 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -2493,6 +2493,14 @@ tuplegetter_reduce(_tuplegetterobject *self, PyObject *Py_UNUSED(ignored)) return Py_BuildValue("(O(nO))", (PyObject*) Py_TYPE(self), self->index, self->doc); } +static PyObject* +tuplegetter_repr(_tuplegetterobject *self) +{ + return PyUnicode_FromFormat("%s(%zd, %R)", + _PyType_Name(Py_TYPE(self)), + self->index, self->doc); +} + static PyMemberDef tuplegetter_members[] = { {"__doc__", T_OBJECT, offsetof(_tuplegetterobject, doc), 0}, @@ -2515,7 +2523,7 @@ static PyTypeObject tuplegetter_type = { 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_as_async */ - 0, /* tp_repr */ + (reprfunc)tuplegetter_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ From webhook-mailer at python.org Wed Apr 15 08:05:48 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 12:05:48 -0000 Subject: [Python-checkins] Optimize _Py_strhex_impl() (GH-19535) Message-ID: https://github.com/python/cpython/commit/455df9779873b8335b20292b8d0c43d66338a4db commit: 455df9779873b8335b20292b8d0c43d66338a4db branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T14:05:24+02:00 summary: Optimize _Py_strhex_impl() (GH-19535) Avoid a temporary buffer to create a bytes string: use PyBytes_FromStringAndSize() to directly allocate a bytes object. Cleanup also the code: PEP 7 formatting, move variable definitions closer to where they are used. Fix assertion checking "j" index. files: M Python/pystrhex.c diff --git a/Python/pystrhex.c b/Python/pystrhex.c index 9d34f71a2e9cf..7e4fad303200e 100644 --- a/Python/pystrhex.c +++ b/Python/pystrhex.c @@ -8,12 +8,9 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, const PyObject* sep, int bytes_per_sep_group, const int return_bytes) { - PyObject *retval; - Py_UCS1* retbuf; - Py_ssize_t i, j, resultlen = 0; - Py_UCS1 sep_char = 0; - unsigned int abs_bytes_per_sep; + assert(arglen >= 0); + Py_UCS1 sep_char = 0; if (sep) { Py_ssize_t seplen = PyObject_Length((PyObject*)sep); if (seplen < 0) { @@ -31,9 +28,11 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, return NULL; } sep_char = PyUnicode_READ_CHAR(sep, 0); - } else if (PyBytes_Check(sep)) { + } + else if (PyBytes_Check(sep)) { sep_char = PyBytes_AS_STRING(sep)[0]; - } else { + } + else { PyErr_SetString(PyExc_TypeError, "sep must be str or bytes."); return NULL; } @@ -41,12 +40,13 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, PyErr_SetString(PyExc_ValueError, "sep must be ASCII."); return NULL; } - } else { + } + else { bytes_per_sep_group = 0; } - assert(arglen >= 0); - abs_bytes_per_sep = abs(bytes_per_sep_group); + unsigned int abs_bytes_per_sep = abs(bytes_per_sep_group); + Py_ssize_t resultlen = 0; if (bytes_per_sep_group && arglen > 0) { /* How many sep characters we'll be inserting. */ resultlen = (arglen - 1) / abs_bytes_per_sep; @@ -62,26 +62,32 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, abs_bytes_per_sep = 0; } + PyObject *retval; + Py_UCS1 *retbuf; if (return_bytes) { /* If _PyBytes_FromSize() were public we could avoid malloc+copy. */ - retbuf = (Py_UCS1*) PyMem_Malloc(resultlen); - if (!retbuf) - return PyErr_NoMemory(); - retval = NULL; /* silence a compiler warning, assigned later. */ - } else { + retval = PyBytes_FromStringAndSize(NULL, resultlen); + if (!retval) { + return NULL; + } + retbuf = (Py_UCS1 *)PyBytes_AS_STRING(retval); + } + else { retval = PyUnicode_New(resultlen, 127); - if (!retval) + if (!retval) { return NULL; + } retbuf = PyUnicode_1BYTE_DATA(retval); } /* Hexlify */ + Py_ssize_t i, j; for (i=j=0; i < arglen; ++i) { - assert(j < resultlen); + assert((j + 1) < resultlen); unsigned char c; - c = (argbuf[i] >> 4) & 0xf; + c = (argbuf[i] >> 4) & 0x0f; retbuf[j++] = Py_hexdigits[c]; - c = argbuf[i] & 0xf; + c = argbuf[i] & 0x0f; retbuf[j++] = Py_hexdigits[c]; if (bytes_per_sep_group && i < arglen - 1) { Py_ssize_t anchor; @@ -93,12 +99,8 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, } assert(j == resultlen); - if (return_bytes) { - retval = PyBytes_FromStringAndSize((const char *)retbuf, resultlen); - PyMem_Free(retbuf); - } #ifdef Py_DEBUG - else { + if (!return_bytes) { assert(_PyUnicode_CheckConsistency(retval, 1)); } #endif From webhook-mailer at python.org Wed Apr 15 09:07:42 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 15 Apr 2020 13:07:42 -0000 Subject: [Python-checkins] bpo-40268: Reformat posixmodule.c includes (GH-19536) Message-ID: https://github.com/python/cpython/commit/5eca75df031d3cbe577c75dd87734b48c787e7f6 commit: 5eca75df031d3cbe577c75dd87734b48c787e7f6 branch: master author: Victor Stinner committer: GitHub date: 2020-04-15T15:07:31+02:00 summary: bpo-40268: Reformat posixmodule.c includes (GH-19536) files: M Modules/posixmodule.c diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 89f9757c515bb..4085b922a7c7c 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1,4 +1,3 @@ - /* POSIX module implementation */ /* This file is also used for Windows NT/MS-Win. In that case the @@ -8,8 +7,6 @@ of the compiler used. Different compilers define their own feature test macro, e.g. '_MSC_VER'. */ - - #ifdef __APPLE__ /* * Step 1 of support for weak-linking a number of symbols existing on @@ -48,7 +45,7 @@ /* On android API level 21, 'AT_EACCESS' is not declared although * HAVE_FACCESSAT is defined. */ #ifdef __ANDROID__ -#undef HAVE_FACCESSAT +# undef HAVE_FACCESSAT #endif #include /* needed for ctermid() */ @@ -65,89 +62,89 @@ corresponding Unix manual entries for more information on calls."); #ifdef HAVE_SYS_UIO_H -#include +# include #endif #ifdef HAVE_SYS_SYSMACROS_H /* GNU C Library: major(), minor(), makedev() */ -#include +# include #endif #ifdef HAVE_SYS_TYPES_H -#include +# include #endif /* HAVE_SYS_TYPES_H */ #ifdef HAVE_SYS_STAT_H -#include +# include #endif /* HAVE_SYS_STAT_H */ #ifdef HAVE_SYS_WAIT_H -#include /* For WNOHANG */ +# include // WNOHANG #endif #ifdef HAVE_LINUX_WAIT_H -#include // For P_PIDFD +# include // P_PIDFD #endif #ifdef HAVE_SIGNAL_H -#include +# include #endif #ifdef HAVE_FCNTL_H -#include -#endif /* HAVE_FCNTL_H */ +# include +#endif #ifdef HAVE_GRP_H -#include +# include #endif #ifdef HAVE_SYSEXITS_H -#include -#endif /* HAVE_SYSEXITS_H */ +# include +#endif #ifdef HAVE_SYS_LOADAVG_H -#include +# include #endif #ifdef HAVE_SYS_SENDFILE_H -#include +# include #endif #if defined(__APPLE__) -#include +# include #endif #ifdef HAVE_SCHED_H -#include +# include #endif #ifdef HAVE_COPY_FILE_RANGE -#include +# include #endif #if !defined(CPU_ALLOC) && defined(HAVE_SCHED_SETAFFINITY) -#undef HAVE_SCHED_SETAFFINITY +# undef HAVE_SCHED_SETAFFINITY #endif #if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) -#define USE_XATTRS +# define USE_XATTRS #endif #ifdef USE_XATTRS -#include +# include #endif #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__) -#ifdef HAVE_SYS_SOCKET_H -#include -#endif +# ifdef HAVE_SYS_SOCKET_H +# include +# endif #endif #ifdef HAVE_DLFCN_H -#include +# include #endif #ifdef __hpux -#include +# include #endif #if defined(__DragonFly__) || \ @@ -155,7 +152,7 @@ corresponding Unix manual entries for more information on calls."); defined(__FreeBSD__) || \ defined(__NetBSD__) || \ defined(__APPLE__) -#include +# include #endif #ifdef HAVE_LINUX_RANDOM_H @@ -180,43 +177,44 @@ corresponding Unix manual entries for more information on calls."); /* Various compilers have only certain posix functions */ /* XXX Gosh I wish these were all moved into pyconfig.h */ #if defined(__WATCOMC__) && !defined(__QNX__) /* Watcom compiler */ -#define HAVE_OPENDIR 1 -#define HAVE_SYSTEM 1 -#include -#else -#ifdef _MSC_VER /* Microsoft compiler */ -#define HAVE_GETPPID 1 -#define HAVE_GETLOGIN 1 -#define HAVE_SPAWNV 1 -#define HAVE_EXECV 1 -#define HAVE_WSPAWNV 1 -#define HAVE_WEXECV 1 -#define HAVE_PIPE 1 -#define HAVE_SYSTEM 1 -#define HAVE_CWAIT 1 -#define HAVE_FSYNC 1 -#define fsync _commit -#else -/* Unix functions that the configure script doesn't check for */ -#ifndef __VXWORKS__ -#define HAVE_EXECV 1 -#define HAVE_FORK 1 -#if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */ -#define HAVE_FORK1 1 -#endif -#endif -#define HAVE_GETEGID 1 -#define HAVE_GETEUID 1 -#define HAVE_GETGID 1 -#define HAVE_GETPPID 1 -#define HAVE_GETUID 1 -#define HAVE_KILL 1 -#define HAVE_OPENDIR 1 -#define HAVE_PIPE 1 -#define HAVE_SYSTEM 1 -#define HAVE_WAIT 1 -#define HAVE_TTYNAME 1 -#endif /* _MSC_VER */ +# define HAVE_OPENDIR 1 +# define HAVE_SYSTEM 1 +# include +#else +# ifdef _MSC_VER + /* Microsoft compiler */ +# define HAVE_GETPPID 1 +# define HAVE_GETLOGIN 1 +# define HAVE_SPAWNV 1 +# define HAVE_EXECV 1 +# define HAVE_WSPAWNV 1 +# define HAVE_WEXECV 1 +# define HAVE_PIPE 1 +# define HAVE_SYSTEM 1 +# define HAVE_CWAIT 1 +# define HAVE_FSYNC 1 +# define fsync _commit +# else + /* Unix functions that the configure script doesn't check for */ +# ifndef __VXWORKS__ +# define HAVE_EXECV 1 +# define HAVE_FORK 1 +# if defined(__USLC__) && defined(__SCO_VERSION__) /* SCO UDK Compiler */ +# define HAVE_FORK1 1 +# endif +# endif +# define HAVE_GETEGID 1 +# define HAVE_GETEUID 1 +# define HAVE_GETGID 1 +# define HAVE_GETPPID 1 +# define HAVE_GETUID 1 +# define HAVE_KILL 1 +# define HAVE_OPENDIR 1 +# define HAVE_PIPE 1 +# define HAVE_SYSTEM 1 +# define HAVE_WAIT 1 +# define HAVE_TTYNAME 1 +# endif /* _MSC_VER */ #endif /* ! __WATCOMC__ || __QNX__ */ _Py_IDENTIFIER(__fspath__); @@ -238,123 +236,119 @@ extern char *ctermid_r(char *); #endif /* !_MSC_VER */ #if defined(__VXWORKS__) -#include -#include -#include -#include -#ifndef _P_WAIT -#define _P_WAIT 0 -#define _P_NOWAIT 1 -#define _P_NOWAITO 1 -#endif +# include +# include +# include +# include +# ifndef _P_WAIT +# define _P_WAIT 0 +# define _P_NOWAIT 1 +# define _P_NOWAITO 1 +# endif #endif /* __VXWORKS__ */ #ifdef HAVE_POSIX_SPAWN -#include +# include #endif #ifdef HAVE_UTIME_H -#include +# include #endif /* HAVE_UTIME_H */ #ifdef HAVE_SYS_UTIME_H -#include -#define HAVE_UTIME_H /* pretend we do for the rest of this file */ +# include +# define HAVE_UTIME_H /* pretend we do for the rest of this file */ #endif /* HAVE_SYS_UTIME_H */ #ifdef HAVE_SYS_TIMES_H -#include +# include #endif /* HAVE_SYS_TIMES_H */ #ifdef HAVE_SYS_PARAM_H -#include +# include #endif /* HAVE_SYS_PARAM_H */ #ifdef HAVE_SYS_UTSNAME_H -#include +# include #endif /* HAVE_SYS_UTSNAME_H */ #ifdef HAVE_DIRENT_H -#include -#define NAMLEN(dirent) strlen((dirent)->d_name) +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) #else -#if defined(__WATCOMC__) && !defined(__QNX__) -#include -#define NAMLEN(dirent) strlen((dirent)->d_name) -#else -#define dirent direct -#define NAMLEN(dirent) (dirent)->d_namlen -#endif -#ifdef HAVE_SYS_NDIR_H -#include -#endif -#ifdef HAVE_SYS_DIR_H -#include -#endif -#ifdef HAVE_NDIR_H -#include -#endif +# if defined(__WATCOMC__) && !defined(__QNX__) +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +# else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# endif +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif #endif #ifdef _MSC_VER -#ifdef HAVE_DIRECT_H -#include -#endif -#ifdef HAVE_IO_H -#include -#endif -#ifdef HAVE_PROCESS_H -#include -#endif -#ifndef IO_REPARSE_TAG_SYMLINK -#define IO_REPARSE_TAG_SYMLINK (0xA000000CL) -#endif -#ifndef IO_REPARSE_TAG_MOUNT_POINT -#define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L) -#endif -#include "osdefs.h" // SEP -#include -#include -#include // ShellExecute() -#include // UNLEN -#define HAVE_SYMLINK +# ifdef HAVE_DIRECT_H +# include +# endif +# ifdef HAVE_IO_H +# include +# endif +# ifdef HAVE_PROCESS_H +# include +# endif +# ifndef IO_REPARSE_TAG_SYMLINK +# define IO_REPARSE_TAG_SYMLINK (0xA000000CL) +# endif +# ifndef IO_REPARSE_TAG_MOUNT_POINT +# define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L) +# endif +# include "osdefs.h" // SEP +# include +# include +# include // ShellExecute() +# include // UNLEN +# define HAVE_SYMLINK #endif /* _MSC_VER */ #ifndef MAXPATHLEN -#if defined(PATH_MAX) && PATH_MAX > 1024 -#define MAXPATHLEN PATH_MAX -#else -#define MAXPATHLEN 1024 -#endif +# if defined(PATH_MAX) && PATH_MAX > 1024 +# define MAXPATHLEN PATH_MAX +# else +# define MAXPATHLEN 1024 +# endif #endif /* MAXPATHLEN */ #ifdef UNION_WAIT -/* Emulate some macros on systems that have a union instead of macros */ - -#ifndef WIFEXITED -#define WIFEXITED(u_wait) (!(u_wait).w_termsig && !(u_wait).w_coredump) -#endif - -#ifndef WEXITSTATUS -#define WEXITSTATUS(u_wait) (WIFEXITED(u_wait)?((u_wait).w_retcode):-1) -#endif - -#ifndef WTERMSIG -#define WTERMSIG(u_wait) ((u_wait).w_termsig) -#endif - -#define WAIT_TYPE union wait -#define WAIT_STATUS_INT(s) (s.w_status) - -#else /* !UNION_WAIT */ -#define WAIT_TYPE int -#define WAIT_STATUS_INT(s) (s) + /* Emulate some macros on systems that have a union instead of macros */ +# ifndef WIFEXITED +# define WIFEXITED(u_wait) (!(u_wait).w_termsig && !(u_wait).w_coredump) +# endif +# ifndef WEXITSTATUS +# define WEXITSTATUS(u_wait) (WIFEXITED(u_wait)?((u_wait).w_retcode):-1) +# endif +# ifndef WTERMSIG +# define WTERMSIG(u_wait) ((u_wait).w_termsig) +# endif +# define WAIT_TYPE union wait +# define WAIT_STATUS_INT(s) (s.w_status) +#else + /* !UNION_WAIT */ +# define WAIT_TYPE int +# define WAIT_STATUS_INT(s) (s) #endif /* UNION_WAIT */ /* Don't use the "_r" form if we don't need it (also, won't have a prototype for it, at least on Solaris -- maybe others as well?). */ #if defined(HAVE_CTERMID_R) -#define USE_CTERMID_R +# define USE_CTERMID_R #endif /* choose the appropriate stat and fstat functions and return structs */ @@ -362,56 +356,56 @@ extern char *ctermid_r(char *); #undef FSTAT #undef STRUCT_STAT #ifdef MS_WINDOWS -# define STAT win32_stat -# define LSTAT win32_lstat -# define FSTAT _Py_fstat_noraise -# define STRUCT_STAT struct _Py_stat_struct +# define STAT win32_stat +# define LSTAT win32_lstat +# define FSTAT _Py_fstat_noraise +# define STRUCT_STAT struct _Py_stat_struct #else -# define STAT stat -# define LSTAT lstat -# define FSTAT fstat -# define STRUCT_STAT struct stat +# define STAT stat +# define LSTAT lstat +# define FSTAT fstat +# define STRUCT_STAT struct stat #endif #if defined(MAJOR_IN_MKDEV) -#include +# include #else -#if defined(MAJOR_IN_SYSMACROS) -#include -#endif -#if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H) -#include -#endif +# if defined(MAJOR_IN_SYSMACROS) +# include +# endif +# if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H) +# include +# endif #endif #ifdef MS_WINDOWS -#define INITFUNC PyInit_nt -#define MODNAME "nt" +# define INITFUNC PyInit_nt +# define MODNAME "nt" #else -#define INITFUNC PyInit_posix -#define MODNAME "posix" +# define INITFUNC PyInit_posix +# define MODNAME "posix" #endif #if defined(__sun) /* Something to implement in autoconf, not present in autoconf 2.69 */ -#define HAVE_STRUCT_STAT_ST_FSTYPE 1 +# define HAVE_STRUCT_STAT_ST_FSTYPE 1 #endif /* memfd_create is either defined in sys/mman.h or sys/memfd.h * linux/memfd.h defines additional flags */ #ifdef HAVE_SYS_MMAN_H -#include +# include #endif #ifdef HAVE_SYS_MEMFD_H -#include +# include #endif #ifdef HAVE_LINUX_MEMFD_H -#include +# include #endif #ifdef _Py_MEMORY_SANITIZER -# include +# include #endif #ifdef HAVE_FORK From webhook-mailer at python.org Wed Apr 15 13:55:51 2020 From: webhook-mailer at python.org (Jason R. Coombs) Date: Wed, 15 Apr 2020 17:55:51 -0000 Subject: [Python-checkins] Clean up compatibility code in importlib fixtures (#19156) Message-ID: https://github.com/python/cpython/commit/574547a75c79b506261520c5773ae08a1dcea1b9 commit: 574547a75c79b506261520c5773ae08a1dcea1b9 branch: master author: Jason R. Coombs committer: GitHub date: 2020-04-15T13:55:43-04:00 summary: Clean up compatibility code in importlib fixtures (#19156) files: M Lib/test/test_importlib/fixtures.py diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index 695c92a786cb0..d923cec26ea8f 100644 --- a/Lib/test/test_importlib/fixtures.py +++ b/Lib/test/test_importlib/fixtures.py @@ -1,25 +1,11 @@ -from __future__ import unicode_literals - import os import sys import shutil +import pathlib import tempfile import textwrap import contextlib -try: - from contextlib import ExitStack -except ImportError: - from contextlib2 import ExitStack - -try: - import pathlib -except ImportError: - import pathlib2 as pathlib - - -__metaclass__ = type - @contextlib.contextmanager def tempdir(): @@ -58,7 +44,7 @@ def install_finder(finder): class Fixtures: def setUp(self): - self.fixtures = ExitStack() + self.fixtures = contextlib.ExitStack() self.addCleanup(self.fixtures.close) From webhook-mailer at python.org Wed Apr 15 14:22:19 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Wed, 15 Apr 2020 18:22:19 -0000 Subject: [Python-checkins] bpo-40267: Fix message when last input character produces a SyntaxError (GH-19521) Message-ID: https://github.com/python/cpython/commit/9a4b38f66b3e674db94e07980e1cacb39e388c73 commit: 9a4b38f66b3e674db94e07980e1cacb39e388c73 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-15T11:22:10-07:00 summary: bpo-40267: Fix message when last input character produces a SyntaxError (GH-19521) When there is a SyntaxError after reading the last input character from the tokenizer and if no newline follows it, the error message used to be `unexpected EOF while parsing`, which is wrong. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267.Q2N6Bw.rst M Include/token.h M Lib/test/test_fstring.py M Parser/parsetok.c M Tools/scripts/generate_token.py diff --git a/Include/token.h b/Include/token.h index e08708baf196e..9b8a3aae07467 100644 --- a/Include/token.h +++ b/Include/token.h @@ -78,6 +78,10 @@ extern "C" { #define ISTERMINAL(x) ((x) < NT_OFFSET) #define ISNONTERMINAL(x) ((x) >= NT_OFFSET) #define ISEOF(x) ((x) == ENDMARKER) +#define ISWHITESPACE(x) ((x) == ENDMARKER || \ + (x) == NEWLINE || \ + (x) == INDENT || \ + (x) == DEDENT) PyAPI_DATA(const char * const) _PyParser_TokenNames[]; /* Token names */ diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 8fd7cf09a99f4..fe465b7e1d43d 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -713,7 +713,7 @@ def test_lambda(self): # lambda doesn't work without parens, because the colon # makes the parser think it's a format_spec - self.assertAllRaise(SyntaxError, 'unexpected EOF while parsing', + self.assertAllRaise(SyntaxError, 'invalid syntax', ["f'{lambda x:x}'", ]) diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267.Q2N6Bw.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267.Q2N6Bw.rst new file mode 100644 index 0000000000000..a778594ce9ced --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267.Q2N6Bw.rst @@ -0,0 +1 @@ +Fix the tokenizer to display the correct error message, when there is a SyntaxError on the last input character and no newline follows. It used to be `unexpected EOF while parsing`, while it should be `invalid syntax`. \ No newline at end of file diff --git a/Parser/parsetok.c b/Parser/parsetok.c index cb9472150f2ca..37ca65c275a58 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -332,6 +332,9 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, PyParser_AddToken(ps, (int)type, str, lineno, col_offset, tok->lineno, end_col_offset, &(err_ret->expected))) != E_OK) { + if (tok->done == E_EOF && !ISWHITESPACE(type)) { + tok->done = E_SYNTAX; + } if (err_ret->error != E_DONE) { PyObject_FREE(str); err_ret->token = type; diff --git a/Tools/scripts/generate_token.py b/Tools/scripts/generate_token.py index f2745e8353fc3..77bb5bd5eca02 100755 --- a/Tools/scripts/generate_token.py +++ b/Tools/scripts/generate_token.py @@ -69,6 +69,10 @@ def update_file(file, content): #define ISTERMINAL(x) ((x) < NT_OFFSET) #define ISNONTERMINAL(x) ((x) >= NT_OFFSET) #define ISEOF(x) ((x) == ENDMARKER) +#define ISWHITESPACE(x) ((x) == ENDMARKER || \\ + (x) == NEWLINE || \\ + (x) == INDENT || \\ + (x) == DEDENT) PyAPI_DATA(const char * const) _PyParser_TokenNames[]; /* Token names */ From webhook-mailer at python.org Wed Apr 15 14:32:11 2020 From: webhook-mailer at python.org (Jason R. Coombs) Date: Wed, 15 Apr 2020 18:32:11 -0000 Subject: [Python-checkins] bpo-35967: Baseline values for uname -p (GH-12824) Message-ID: https://github.com/python/cpython/commit/4b4e90a51848578dc06341777a929a0be4f4757f commit: 4b4e90a51848578dc06341777a929a0be4f4757f branch: master author: Jason R. Coombs committer: GitHub date: 2020-04-15T14:32:01-04:00 summary: bpo-35967: Baseline values for uname -p (GH-12824) * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call. files: M Lib/test/test_platform.py diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index f167fb1e7b9bf..0e6cb6db1ee98 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -3,6 +3,8 @@ import subprocess import sys import unittest +import collections +import contextlib from unittest import mock from test import support @@ -160,6 +162,18 @@ def test_uname(self): self.assertEqual(res[4], res.machine) self.assertEqual(res[5], res.processor) + @unittest.skipIf(sys.platform in ['win32', 'OpenVMS'], "uname -p not used") + def test_uname_processor(self): + """ + On some systems, the processor must match the output + of 'uname -p'. See Issue 35967 for rationale. + """ + with contextlib.suppress(subprocess.CalledProcessError): + self.assertEqual( + platform.uname().processor, + subprocess.check_output(['uname', '-p'], text=True).strip(), + ) + @unittest.skipUnless(sys.platform.startswith('win'), "windows only test") def test_uname_win32_ARCHITEW6432(self): # Issue 7860: make sure we get architecture from the correct variable From webhook-mailer at python.org Wed Apr 15 14:45:32 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 15 Apr 2020 18:45:32 -0000 Subject: [Python-checkins] [3.8] bpo-39667: Sync zipp 3.0 (GH-18540) (GH-18701) Message-ID: https://github.com/python/cpython/commit/3e72de9e08b03a15875f5b226c5f096e567dab42 commit: 3e72de9e08b03a15875f5b226c5f096e567dab42 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-15T14:45:25-04:00 summary: [3.8] bpo-39667: Sync zipp 3.0 (GH-18540) (GH-18701) * bpo-39667: Sync zipp 3.0 (GH-18540) * bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0 * ?? Added by blurb_it. * Update docs for new zipfile.Path.open * Rely on dict, faster than OrderedDict. * Syntax edits on docs Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> (cherry picked from commit 0aeab5c4381f0cc11479362af2533b3a391312ac) Co-authored-by: Jason R. Coombs * Clarify the change in behavior with a couple of workaround options. * Restore API compatibility while backporting performance improvements. Co-authored-by: Jason R. Coombs files: A Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst M Doc/library/zipfile.rst M Lib/test/test_zipfile.py M Lib/zipfile.py diff --git a/Doc/library/zipfile.rst b/Doc/library/zipfile.rst index e8a2530fb8c17..97da6cab806e3 100644 --- a/Doc/library/zipfile.rst +++ b/Doc/library/zipfile.rst @@ -494,6 +494,12 @@ Path objects are traversable using the ``/`` operator. Invoke :meth:`ZipFile.open` on the current path. Accepts the same arguments as :meth:`ZipFile.open`. + .. caution:: + + The signature on this function changes in an incompatible way + in Python 3.9. For a future-compatible version, consider using + the third-party zipp.Path package (3.0 or later). + .. method:: Path.iterdir() Enumerate the children of the current directory. diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 61bca8651c02a..28e62dc5c61c5 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -5,6 +5,7 @@ import os import pathlib import posixpath +import string import struct import subprocess import sys @@ -2933,6 +2934,11 @@ def test_joinpath_constant_time(self): # Check the file iterated all items assert entries.count == self.HUGE_ZIPFILE_NUM_ENTRIES + # @func_timeout.func_set_timeout(3) + def test_implied_dirs_performance(self): + data = ['/'.join(string.ascii_lowercase + str(n)) for n in range(10000)] + zipfile.CompleteDirs._implied_dirs(data) + if __name__ == "__main__": unittest.main() diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 5dc6516cc47b7..07faaccac9226 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -17,7 +17,6 @@ import threading import time import contextlib -from collections import OrderedDict try: import zlib # We may need its compression method @@ -2125,24 +2124,6 @@ def _compile(file, optimize=-1): return (fname, archivename) -def _unique_everseen(iterable, key=None): - "List unique elements, preserving order. Remember all elements ever seen." - # unique_everseen('AAAABBBCCDAABBB') --> A B C D - # unique_everseen('ABBCcAD', str.lower) --> A B C D - seen = set() - seen_add = seen.add - if key is None: - for element in itertools.filterfalse(seen.__contains__, iterable): - seen_add(element) - yield element - else: - for element in iterable: - k = key(element) - if k not in seen: - seen_add(k) - yield element - - def _parents(path): """ Given a path with elements separated by @@ -2184,6 +2165,18 @@ def _ancestry(path): path, tail = posixpath.split(path) +_dedupe = dict.fromkeys +"""Deduplicate an iterable in original order""" + + +def _difference(minuend, subtrahend): + """ + Return items in minuend not in subtrahend, retaining order + with O(1) lookup. + """ + return itertools.filterfalse(set(subtrahend).__contains__, minuend) + + class CompleteDirs(ZipFile): """ A ZipFile subclass that ensures that implied directories @@ -2193,13 +2186,8 @@ class CompleteDirs(ZipFile): @staticmethod def _implied_dirs(names): parents = itertools.chain.from_iterable(map(_parents, names)) - # Deduplicate entries in original order - implied_dirs = OrderedDict.fromkeys( - p + posixpath.sep for p in parents - # Cast names to a set for O(1) lookups - if p + posixpath.sep not in set(names) - ) - return implied_dirs + as_dirs = (p + posixpath.sep for p in parents) + return _dedupe(_difference(as_dirs, names)) def namelist(self): names = super(CompleteDirs, self).namelist() diff --git a/Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst b/Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst new file mode 100644 index 0000000000000..ccc33e289846a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst @@ -0,0 +1 @@ +Correct performance degradation in ``zipfile.Path`` as found in zipp 3.0. While retaining compatibility, this change discourages the use of ``zipfile.Path.open`` due to the signature change in Python 3.9. For compatibility across Python 3.8 and later versions, consider using ``zipp.Path`` on Python 3.8.x and earlier. From webhook-mailer at python.org Wed Apr 15 14:57:14 2020 From: webhook-mailer at python.org (Russell Davis) Date: Wed, 15 Apr 2020 18:57:14 -0000 Subject: [Python-checkins] bpo-29255: Wait in KqueueSelector.select when no fds are registered (GH-19508) Message-ID: https://github.com/python/cpython/commit/ba1bcffe5cafc1bb0ac6fdf9ecef51e75e342707 commit: ba1bcffe5cafc1bb0ac6fdf9ecef51e75e342707 branch: master author: Russell Davis <551404+russelldavis at users.noreply.github.com> committer: GitHub date: 2020-04-15T11:57:06-07:00 summary: bpo-29255: Wait in KqueueSelector.select when no fds are registered (GH-19508) Also partially fixes bpo-25680 (there's still a discrepancy in behavior on Windows that needs to be fixed). files: A Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst M Lib/selectors.py M Lib/test/test_selectors.py diff --git a/Lib/selectors.py b/Lib/selectors.py index a9a0801ef0713..90251dc34a0b3 100644 --- a/Lib/selectors.py +++ b/Lib/selectors.py @@ -552,7 +552,10 @@ def unregister(self, fileobj): def select(self, timeout=None): timeout = None if timeout is None else max(timeout, 0) - max_ev = len(self._fd_to_key) + # If max_ev is 0, kqueue will ignore the timeout. For consistent + # behavior with the other selector classes, we prevent that here + # (using max). See https://bugs.python.org/issue29255 + max_ev = max(len(self._fd_to_key), 1) ready = [] try: kev_list = self._selector.control(None, max_ev, timeout) diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index 31611224dc71e..c449155c4b49f 100644 --- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -543,6 +543,19 @@ def test_register_bad_fd(self): with self.assertRaises(KeyError): s.get_key(bad_f) + def test_empty_select_timeout(self): + # Issues #23009, #29255: Make sure timeout is applied when no fds + # are registered. + s = self.SELECTOR() + self.addCleanup(s.close) + + t0 = time() + self.assertEqual(s.select(1), []) + t1 = time() + dt = t1 - t0 + # Tolerate 2.0 seconds for very slow buildbots + self.assertTrue(0.8 <= dt <= 2.0, dt) + @unittest.skipUnless(hasattr(selectors, 'DevpollSelector'), "Test needs selectors.DevpollSelector") diff --git a/Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst b/Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst new file mode 100644 index 0000000000000..18fbddf2cee73 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst @@ -0,0 +1 @@ +Wait in `KqueueSelector.select` when no fds are registered From webhook-mailer at python.org Wed Apr 15 16:00:24 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 15 Apr 2020 20:00:24 -0000 Subject: [Python-checkins] bpo-40257: Output object's own docstring in pydoc (GH-19479) Message-ID: https://github.com/python/cpython/commit/fbf2786c4c89430e2067016603078cf3500cfe94 commit: fbf2786c4c89430e2067016603078cf3500cfe94 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-15T23:00:20+03:00 summary: bpo-40257: Output object's own docstring in pydoc (GH-19479) files: A Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst M Doc/library/inspect.rst M Doc/whatsnew/3.9.rst M Lib/inspect.py M Lib/pydoc.py M Lib/test/test_inspect.py M Lib/test/test_pydoc.py diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index d00a30ff00406..634645124c786 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -473,12 +473,15 @@ Retrieving source code Get the documentation string for an object, cleaned up with :func:`cleandoc`. If the documentation string for an object is not provided and the object is - a class, a method, a property or a descriptor, retrieve the documentation + a method, a property or a descriptor, retrieve the documentation string from the inheritance hierarchy. .. versionchanged:: 3.5 Documentation strings are now inherited if not overridden. + .. versionchanged:: 3.9 + Documentation strings for classes are no longer inherited. + .. function:: getcomments(object) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index afb099a4ec558..aae8e5b0c9716 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -346,6 +346,13 @@ pprint :mod:`pprint` can now pretty-print :class:`types.SimpleNamespace`. (Contributed by Carl Bordum Hansen in :issue:`37376`.) +pydoc +----- + +The documentation string is now shown not only for class, function, +method etc, but for any object that has its own ``__doc__`` attribute. +(Contributed by Serhiy Storchaka in :issue:`40257`.) + signal ------ @@ -798,6 +805,12 @@ Changes in the Python API :class:`ftplib.FTP_TLS` as a keyword-only parameter, and the default encoding is changed from Latin-1 to UTF-8 to follow :rfc:`2640`. +* :func:`inspect.getdoc` no longer returns docstring inherited from the type + of the object or from parent class if it is a class if it is not defined + in the object itself. + (Contributed by Serhiy Storchaka in :issue:`40257`.) + + CPython bytecode changes ------------------------ diff --git a/Lib/inspect.py b/Lib/inspect.py index 90435a10caac7..6f7d5cd19ce4c 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -542,17 +542,6 @@ def _findclass(func): return cls def _finddoc(obj): - if isclass(obj): - for base in obj.__mro__: - if base is not object: - try: - doc = base.__doc__ - except AttributeError: - continue - if doc is not None: - return doc - return None - if ismethod(obj): name = obj.__func__.__name__ self = obj.__self__ @@ -596,23 +585,35 @@ def _finddoc(obj): return None for base in cls.__mro__: try: - doc = getattr(base, name).__doc__ + doc = _getowndoc(getattr(base, name)) except AttributeError: continue if doc is not None: return doc return None +def _getowndoc(obj): + """Get the documentation string for an object if it is not + inherited from its class.""" + try: + doc = object.__getattribute__(obj, '__doc__') + if doc is None: + return None + if obj is not type: + typedoc = type(obj).__doc__ + if isinstance(typedoc, str) and typedoc == doc: + return None + return doc + except AttributeError: + return None + def getdoc(object): """Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.""" - try: - doc = object.__doc__ - except AttributeError: - return None + doc = _getowndoc(object) if doc is None: try: doc = _finddoc(object) diff --git a/Lib/pydoc.py b/Lib/pydoc.py index f172700a15f9d..a89b8045709c2 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -825,11 +825,8 @@ def spilldata(msg, attrs, predicate): push(msg) for name, kind, homecls, value in ok: base = self.docother(getattr(object, name), name, mod) - if callable(value) or inspect.isdatadescriptor(value): - doc = getattr(value, "__doc__", None) - else: - doc = None - if doc is None: + doc = getdoc(value) + if not doc: push('
%s
\n' % base) else: doc = self.markup(getdoc(value), self.preformat, @@ -1309,10 +1306,7 @@ def spilldata(msg, attrs, predicate): hr.maybe() push(msg) for name, kind, homecls, value in ok: - if callable(value) or inspect.isdatadescriptor(value): - doc = getdoc(value) - else: - doc = None + doc = getdoc(value) try: obj = getattr(object, name) except AttributeError: @@ -1448,7 +1442,9 @@ def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=No chop = maxlen - len(line) if chop < 0: repr = repr[:chop] + '...' line = (name and self.bold(name) + ' = ' or '') + repr - if doc is not None: + if not doc: + doc = getdoc(object) + if doc: line += '\n' + self.indent(str(doc)) return line @@ -1672,7 +1668,8 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0, if not (inspect.ismodule(object) or inspect.isclass(object) or inspect.isroutine(object) or - inspect.isdatadescriptor(object)): + inspect.isdatadescriptor(object) or + inspect.getdoc(object)): # If the passed object is a piece of data or an instance, # document its available methods instead of its value. object = type(object) diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index f193807e80473..2dc8454595e17 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -439,8 +439,7 @@ def test_getdoc(self): @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") def test_getdoc_inherited(self): - self.assertEqual(inspect.getdoc(mod.FesteringGob), - 'A longer,\n\nindented\n\ndocstring.') + self.assertIsNone(inspect.getdoc(mod.FesteringGob)) self.assertEqual(inspect.getdoc(mod.FesteringGob.abuse), 'Another\n\ndocstring\n\ncontaining\n\ntabs') self.assertEqual(inspect.getdoc(mod.FesteringGob().abuse), @@ -448,10 +447,20 @@ def test_getdoc_inherited(self): self.assertEqual(inspect.getdoc(mod.FesteringGob.contradiction), 'The automatic gainsaying.') + @unittest.skipIf(MISSING_C_DOCSTRINGS, "test requires docstrings") + def test_getowndoc(self): + getowndoc = inspect._getowndoc + self.assertEqual(getowndoc(type), type.__doc__) + self.assertEqual(getowndoc(int), int.__doc__) + self.assertEqual(getowndoc(int.to_bytes), int.to_bytes.__doc__) + self.assertEqual(getowndoc(int().to_bytes), int.to_bytes.__doc__) + self.assertEqual(getowndoc(int.from_bytes), int.from_bytes.__doc__) + self.assertEqual(getowndoc(int.real), int.real.__doc__) + @unittest.skipIf(MISSING_C_DOCSTRINGS, "test requires docstrings") def test_finddoc(self): finddoc = inspect._finddoc - self.assertEqual(finddoc(int), int.__doc__) + self.assertIsNone(finddoc(int)) self.assertEqual(finddoc(int.to_bytes), int.to_bytes.__doc__) self.assertEqual(finddoc(int().to_bytes), int.to_bytes.__doc__) self.assertEqual(finddoc(int.from_bytes), int.from_bytes.__doc__) diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index ebd8d4a6c3db1..800913b425a25 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1254,7 +1254,8 @@ class X: X.attr.__doc__ = 'Custom descriptor' self.assertEqual(self._get_summary_lines(X.attr), """\ -.Descr object>""") +.Descr object> + Custom descriptor""") X.attr.__name__ = 'foo' self.assertEqual(self._get_summary_lines(X.attr), """\ diff --git a/Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst b/Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst new file mode 100644 index 0000000000000..52247b2d1a7c1 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst @@ -0,0 +1,5 @@ +func:`inspect.getdoc` no longer returns docstring inherited from the type of +the object or from parent class if it is a class if it is not defined in the +object itself. In :mod:`pydoc` the documentation string is now shown not +only for class, function, method etc, but for any object that has its own +``__doc__`` attribute. From webhook-mailer at python.org Wed Apr 15 17:19:31 2020 From: webhook-mailer at python.org (Ammar Askar) Date: Wed, 15 Apr 2020 21:19:31 -0000 Subject: [Python-checkins] bpo-40270: Enable json extension in Windows sqlite extension (GH-19528) Message-ID: https://github.com/python/cpython/commit/58d6f2ee3aeb699156d4784acccd2910d27982e7 commit: 58d6f2ee3aeb699156d4784acccd2910d27982e7 branch: master author: Ammar Askar committer: GitHub date: 2020-04-15T16:19:26-05:00 summary: bpo-40270: Enable json extension in Windows sqlite extension (GH-19528) files: A Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst M PCbuild/sqlite3.vcxproj diff --git a/Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst b/Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst new file mode 100644 index 0000000000000..c23f7c9d37d98 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst @@ -0,0 +1,2 @@ +The included copy of sqlite3 on Windows is now compiled with the json +extension. This allows the use of functions such as ``json_object``. diff --git a/PCbuild/sqlite3.vcxproj b/PCbuild/sqlite3.vcxproj index 90b4d3108fa55..7351a6dda2c76 100644 --- a/PCbuild/sqlite3.vcxproj +++ b/PCbuild/sqlite3.vcxproj @@ -98,7 +98,7 @@ $(sqlite3Dir);%(AdditionalIncludeDirectories) - SQLITE_ENABLE_FTS4;SQLITE_ENABLE_FTS5;SQLITE_API=__declspec(dllexport);%(PreprocessorDefinitions) + SQLITE_ENABLE_JSON1;SQLITE_ENABLE_FTS4;SQLITE_ENABLE_FTS5;SQLITE_API=__declspec(dllexport);%(PreprocessorDefinitions) Level1 From webhook-mailer at python.org Wed Apr 15 19:55:40 2020 From: webhook-mailer at python.org (Jason R. Coombs) Date: Wed, 15 Apr 2020 23:55:40 -0000 Subject: [Python-checkins] bpo-35967: Make test_platform.test_uname_processor more lenient to satisfy build bots. (GH-19544) Message-ID: https://github.com/python/cpython/commit/e72cbcb346cfcc1ed7741ed6baf1929764e1ee74 commit: e72cbcb346cfcc1ed7741ed6baf1929764e1ee74 branch: master author: Jason R. Coombs committer: GitHub date: 2020-04-15T19:55:35-04:00 summary: bpo-35967: Make test_platform.test_uname_processor more lenient to satisfy build bots. (GH-19544) * bpo-35967: Make test more lenient to satisfy build bots. * Update Lib/test/test_platform.py Co-Authored-By: Kyle Stanley * Expect '' for 'unknown' Co-authored-by: Kyle Stanley files: M Lib/test/test_platform.py diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 0e6cb6db1ee98..63215a06358b6 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -169,10 +169,12 @@ def test_uname_processor(self): of 'uname -p'. See Issue 35967 for rationale. """ with contextlib.suppress(subprocess.CalledProcessError): - self.assertEqual( - platform.uname().processor, - subprocess.check_output(['uname', '-p'], text=True).strip(), - ) + expect = subprocess.check_output(['uname', '-p'], text=True).strip() + + if expect == 'unknown': + expect = '' + + self.assertEqual(platform.uname().processor, expect) @unittest.skipUnless(sys.platform.startswith('win'), "windows only test") def test_uname_win32_ARCHITEW6432(self): From webhook-mailer at python.org Thu Apr 16 06:10:28 2020 From: webhook-mailer at python.org (Shantanu) Date: Thu, 16 Apr 2020 10:10:28 -0000 Subject: [Python-checkins] Fix typo in exception thrown by ast.unparse (GH-19534) Message-ID: https://github.com/python/cpython/commit/01508dcde47af993288134ab85d09ad03b43113c commit: 01508dcde47af993288134ab85d09ad03b43113c branch: master author: Shantanu committer: GitHub date: 2020-04-16T11:10:12+01:00 summary: Fix typo in exception thrown by ast.unparse (GH-19534) files: M Lib/ast.py diff --git a/Lib/ast.py b/Lib/ast.py index f51c71fb8c608..401af5647a240 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -1149,7 +1149,7 @@ def visit_IfExp(self, node): def visit_Set(self, node): if not node.elts: - raise ValueError("Set node should has at least one item") + raise ValueError("Set node should have at least one item") with self.delimit("{", "}"): self.interleave(lambda: self.write(", "), self.traverse, node.elts) From webhook-mailer at python.org Thu Apr 16 08:28:17 2020 From: webhook-mailer at python.org (Jason R. Coombs) Date: Thu, 16 Apr 2020 12:28:17 -0000 Subject: [Python-checkins] bpo-35967 resolve platform.processor late (GH-12239) Message-ID: https://github.com/python/cpython/commit/518835f3354d6672e61c9f52348c1e4a2533ea00 commit: 518835f3354d6672e61c9f52348c1e4a2533ea00 branch: master author: Jason R. Coombs committer: GitHub date: 2020-04-16T08:28:09-04:00 summary: bpo-35967 resolve platform.processor late (GH-12239) * Replace flag-flip indirection with direct inspection * Use any for simpler code * Avoid flag flip and set results directly. * Resolve processor in a single function. * Extract processor handling into a namespace (class) * Remove _syscmd_uname, unused * Restore platform.processor behavior to match prior expectation (reliant on uname -p in a subprocess). * Extract '_unknown_as_blank' function. * Override uname_result to resolve the processor late. * Add a test intended to capture the expected values from 'uname -p' * Instead of trying to keep track of all of the possible outputs on different systems (probably a fool's errand), simply assert that except for the known platform variance, uname().processor matches the output of 'uname -p' * Use a skipIf directive * Use contextlib.suppress to suppress the error. Inline strip call. * ?? Added by blurb_it. * Remove use of contextlib.suppress (it would fail with NameError if it had any effect). Rely on _unknown_as_blank to replace unknown with blank. Co-authored-by: blurb-it[bot] files: A Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst M Lib/platform.py M Lib/test/test_platform.py diff --git a/Lib/platform.py b/Lib/platform.py index ed41edc98fe08..3f442ef0fbb65 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -116,6 +116,9 @@ import os import re import sys +import subprocess +import functools +import itertools ### Globals & Constants @@ -600,22 +603,6 @@ def _follow_symlinks(filepath): os.path.join(os.path.dirname(filepath), os.readlink(filepath))) return filepath -def _syscmd_uname(option, default=''): - - """ Interface to the system's uname command. - """ - if sys.platform in ('dos', 'win32', 'win16'): - # XXX Others too ? - return default - - import subprocess - try: - output = subprocess.check_output(('uname', option), - stderr=subprocess.DEVNULL, - text=True) - except (OSError, subprocess.CalledProcessError): - return default - return (output.strip() or default) def _syscmd_file(target, default=''): @@ -736,13 +723,89 @@ def architecture(executable=sys.executable, bits='', linkage=''): return bits, linkage + +def _get_machine_win32(): + # Try to use the PROCESSOR_* environment variables + # available on Win XP and later; see + # http://support.microsoft.com/kb/888731 and + # http://www.geocities.com/rick_lively/MANUALS/ENV/MSWIN/PROCESSI.HTM + + # WOW64 processes mask the native architecture + return ( + os.environ.get('PROCESSOR_ARCHITEW6432', '') or + os.environ.get('PROCESSOR_ARCHITECTURE', '') + ) + + +class _Processor: + @classmethod + def get(cls): + func = getattr(cls, f'get_{sys.platform}', cls.from_subprocess) + return func() or '' + + def get_win32(): + return os.environ.get('PROCESSOR_IDENTIFIER', _get_machine_win32()) + + def get_OpenVMS(): + try: + import vms_lib + except ImportError: + pass + else: + csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0) + return 'Alpha' if cpu_number >= 128 else 'VAX' + + def from_subprocess(): + """ + Fall back to `uname -p` + """ + try: + return subprocess.check_output( + ['uname', '-p'], + stderr=subprocess.DEVNULL, + text=True, + ).strip() + except (OSError, subprocess.CalledProcessError): + pass + + +def _unknown_as_blank(val): + return '' if val == 'unknown' else val + + ### Portable uname() interface -uname_result = collections.namedtuple("uname_result", - "system node release version machine processor") +class uname_result( + collections.namedtuple( + "uname_result_base", + "system node release version machine") + ): + """ + A uname_result that's largely compatible with a + simple namedtuple except that 'platform' is + resolved late and cached to avoid calling "uname" + except when needed. + """ + + @functools.cached_property + def processor(self): + return _unknown_as_blank(_Processor.get()) + + def __iter__(self): + return itertools.chain( + super().__iter__(), + (self.processor,) + ) + + def __getitem__(self, key): + if key == 5: + return self.processor + return super().__getitem__(key) + _uname_cache = None + def uname(): """ Fairly portable uname interface. Returns a tuple @@ -756,52 +819,30 @@ def uname(): """ global _uname_cache - no_os_uname = 0 if _uname_cache is not None: return _uname_cache - processor = '' - # Get some infos from the builtin os.uname API... try: - system, node, release, version, machine = os.uname() + system, node, release, version, machine = infos = os.uname() except AttributeError: - no_os_uname = 1 - - if no_os_uname or not list(filter(None, (system, node, release, version, machine))): - # Hmm, no there is either no uname or uname has returned - #'unknowns'... we'll have to poke around the system then. - if no_os_uname: - system = sys.platform - release = '' - version = '' - node = _node() - machine = '' + system = sys.platform + node = _node() + release = version = machine = '' + infos = () - use_syscmd_ver = 1 + if not any(infos): + # uname is not available # Try win32_ver() on win32 platforms if system == 'win32': release, version, csd, ptype = win32_ver() - if release and version: - use_syscmd_ver = 0 - # Try to use the PROCESSOR_* environment variables - # available on Win XP and later; see - # http://support.microsoft.com/kb/888731 and - # http://www.geocities.com/rick_lively/MANUALS/ENV/MSWIN/PROCESSI.HTM - if not machine: - # WOW64 processes mask the native architecture - if "PROCESSOR_ARCHITEW6432" in os.environ: - machine = os.environ.get("PROCESSOR_ARCHITEW6432", '') - else: - machine = os.environ.get('PROCESSOR_ARCHITECTURE', '') - if not processor: - processor = os.environ.get('PROCESSOR_IDENTIFIER', machine) + machine = machine or _get_machine_win32() # Try the 'ver' system command available on some # platforms - if use_syscmd_ver: + if not (release and version): system, release, version = _syscmd_ver(system) # Normalize system to what win32_ver() normally returns # (_syscmd_ver() tends to return the vendor name as well) @@ -841,42 +882,15 @@ def uname(): if not release or release == '0': release = version version = '' - # Get processor information - try: - import vms_lib - except ImportError: - pass - else: - csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0) - if (cpu_number >= 128): - processor = 'Alpha' - else: - processor = 'VAX' - if not processor: - # Get processor information from the uname system command - processor = _syscmd_uname('-p', '') - - #If any unknowns still exist, replace them with ''s, which are more portable - if system == 'unknown': - system = '' - if node == 'unknown': - node = '' - if release == 'unknown': - release = '' - if version == 'unknown': - version = '' - if machine == 'unknown': - machine = '' - if processor == 'unknown': - processor = '' # normalize name if system == 'Microsoft' and release == 'Windows': system = 'Windows' release = 'Vista' - _uname_cache = uname_result(system, node, release, version, - machine, processor) + vals = system, node, release, version, machine + # Replace 'unknown' values with the more portable '' + _uname_cache = uname_result(*map(_unknown_as_blank, vals)) return _uname_cache ### Direct interfaces to some of the uname() return values diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 63215a06358b6..855304a68c204 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -4,7 +4,6 @@ import sys import unittest import collections -import contextlib from unittest import mock from test import support @@ -168,12 +167,8 @@ def test_uname_processor(self): On some systems, the processor must match the output of 'uname -p'. See Issue 35967 for rationale. """ - with contextlib.suppress(subprocess.CalledProcessError): - expect = subprocess.check_output(['uname', '-p'], text=True).strip() - - if expect == 'unknown': - expect = '' - + proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() + expect = platform._unknown_as_blank(proc_res) self.assertEqual(platform.uname().processor, expect) @unittest.skipUnless(sys.platform.startswith('win'), "windows only test") diff --git a/Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst b/Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst new file mode 100644 index 0000000000000..38bec77313ac0 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst @@ -0,0 +1 @@ +In platform, delay the invocation of 'uname -p' until the processor attribute is requested. \ No newline at end of file From webhook-mailer at python.org Thu Apr 16 13:25:27 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Thu, 16 Apr 2020 17:25:27 -0000 Subject: [Python-checkins] bpo-40290: Add zscore() to statistics.NormalDist. (GH-19547) Message-ID: https://github.com/python/cpython/commit/70f027dd22d6522b777d10c250f951e5e416b93a commit: 70f027dd22d6522b777d10c250f951e5e416b93a branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-16T10:25:14-07:00 summary: bpo-40290: Add zscore() to statistics.NormalDist. (GH-19547) files: A Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst M Doc/library/statistics.rst M Lib/statistics.py M Lib/test/test_statistics.py diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst index 026f4aa462d3d..38a499ab37e89 100644 --- a/Doc/library/statistics.rst +++ b/Doc/library/statistics.rst @@ -696,6 +696,16 @@ of applications in statistics. Set *n* to 100 for percentiles which gives the 99 cuts points that separate the normal distribution into 100 equal sized groups. + .. method:: NormalDist.zscore(x) + + Compute the + `Standard Score `_ + describing *x* in terms of the number of standard deviations + above or below the mean of the normal distribution: + ``(x - mean) / stdev``. + + .. versionadded:: 3.9 + Instances of :class:`NormalDist` support addition, subtraction, multiplication and division by a constant. These operations are used for translation and scaling. For example: diff --git a/Lib/statistics.py b/Lib/statistics.py index 1e95c0b6639f1..9beafb341b3ad 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -999,6 +999,17 @@ def overlap(self, other): x2 = (a - b) / dv return 1.0 - (fabs(Y.cdf(x1) - X.cdf(x1)) + fabs(Y.cdf(x2) - X.cdf(x2))) + def zscore(self, x): + """Compute the Standard Score. (x - mean) / stdev + + Describes *x* in terms of the number of standard deviations + above or below the mean of the normal distribution. + """ + # https://www.statisticshowto.com/probability-and-statistics/z-score/ + if not self._sigma: + raise StatisticsError('zscore() not defined when sigma is zero') + return (x - self._mu) / self._sigma + @property def mean(self): "Arithmetic mean of the normal distribution." diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py index a9a427bc8d972..0e46a7119f0ef 100644 --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -2602,6 +2602,21 @@ def overlap_numeric(X, Y, *, steps=8_192, z=5): with self.assertRaises(self.module.StatisticsError): NormalDist(1, 0).overlap(X) # left operand sigma is zero + def test_zscore(self): + NormalDist = self.module.NormalDist + X = NormalDist(100, 15) + self.assertEqual(X.zscore(142), 2.8) + self.assertEqual(X.zscore(58), -2.8) + self.assertEqual(X.zscore(100), 0.0) + with self.assertRaises(TypeError): + X.zscore() # too few arguments + with self.assertRaises(TypeError): + X.zscore(1, 1) # too may arguments + with self.assertRaises(TypeError): + X.zscore(None) # non-numeric type + with self.assertRaises(self.module.StatisticsError): + NormalDist(1, 0).zscore(100) # sigma is zero + def test_properties(self): X = self.module.NormalDist(100, 15) self.assertEqual(X.mean, 100) diff --git a/Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst b/Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst new file mode 100644 index 0000000000000..a930cee1c8b24 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst @@ -0,0 +1 @@ +Added zscore() to statistics.NormalDist(). From webhook-mailer at python.org Thu Apr 16 14:08:05 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 16 Apr 2020 18:08:05 -0000 Subject: [Python-checkins] bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19554) Message-ID: https://github.com/python/cpython/commit/ccf30e96d4bdcf04396e00899a0319041144509f commit: ccf30e96d4bdcf04396e00899a0319041144509f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-16T14:07:52-04:00 summary: bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19554) (cherry picked from commit 5565c30f0b25996a0e73477fc0e1e1aced52b926) Co-authored-by: Batuhan Ta?kaya files: A Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst M Lib/test/test_email/test_email.py diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 5414cf070cc12..9e5c6adca835d 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -11,8 +11,8 @@ from io import StringIO, BytesIO from itertools import chain from random import choice -from socket import getfqdn from threading import Thread +from unittest.mock import patch import email import email.policy @@ -3342,9 +3342,11 @@ def test_make_msgid_idstring(self): '.test-idstring at testdomain-string>') def test_make_msgid_default_domain(self): - self.assertTrue( - email.utils.make_msgid().endswith( - '@' + getfqdn() + '>')) + with patch('socket.getfqdn') as mock_getfqdn: + mock_getfqdn.return_value = domain = 'pythontest.example.com' + self.assertTrue( + email.utils.make_msgid().endswith( + '@' + domain + '>')) def test_Generator_linend(self): # Issue 14645. diff --git a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst new file mode 100644 index 0000000000000..6fa0d15ba2fdc --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst @@ -0,0 +1 @@ +Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. From webhook-mailer at python.org Thu Apr 16 14:09:04 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 16 Apr 2020 18:09:04 -0000 Subject: [Python-checkins] bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19555) Message-ID: https://github.com/python/cpython/commit/cd09d7e55d160edc454763d3fb6a48180988741a commit: cd09d7e55d160edc454763d3fb6a48180988741a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-16T14:08:59-04:00 summary: bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19555) (cherry picked from commit 5565c30f0b25996a0e73477fc0e1e1aced52b926) Co-authored-by: Batuhan Ta?kaya files: A Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst M Lib/test/test_email/test_email.py diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 5414cf070cc12..9e5c6adca835d 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -11,8 +11,8 @@ from io import StringIO, BytesIO from itertools import chain from random import choice -from socket import getfqdn from threading import Thread +from unittest.mock import patch import email import email.policy @@ -3342,9 +3342,11 @@ def test_make_msgid_idstring(self): '.test-idstring at testdomain-string>') def test_make_msgid_default_domain(self): - self.assertTrue( - email.utils.make_msgid().endswith( - '@' + getfqdn() + '>')) + with patch('socket.getfqdn') as mock_getfqdn: + mock_getfqdn.return_value = domain = 'pythontest.example.com' + self.assertTrue( + email.utils.make_msgid().endswith( + '@' + domain + '>')) def test_Generator_linend(self): # Issue 14645. diff --git a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst new file mode 100644 index 0000000000000..6fa0d15ba2fdc --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst @@ -0,0 +1 @@ +Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. From webhook-mailer at python.org Thu Apr 16 21:55:01 2020 From: webhook-mailer at python.org (Christoph Zwerschke) Date: Fri, 17 Apr 2020 01:55:01 -0000 Subject: [Python-checkins] Fix parameter names in assertIn() docs (GH-18829) Message-ID: https://github.com/python/cpython/commit/a388bbd3f129364c39843f63e92f08bc53c71905 commit: a388bbd3f129364c39843f63e92f08bc53c71905 branch: master author: Christoph Zwerschke committer: GitHub date: 2020-04-16T18:54:53-07:00 summary: Fix parameter names in assertIn() docs (GH-18829) The names "member" and "container" for the arguments are also used in the module and shown with the help() function, and are immediately understandable in this context, contrary to "first" and "second". files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index e2e4f2cdc220a..b2e16cf331e03 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -910,10 +910,10 @@ Test cases .. versionadded:: 3.1 - .. method:: assertIn(first, second, msg=None) - assertNotIn(first, second, msg=None) + .. method:: assertIn(member, container, msg=None) + assertNotIn(member, container, msg=None) - Test that *first* is (or is not) in *second*. + Test that *member* is (or is not) in *container*. .. versionadded:: 3.1 From webhook-mailer at python.org Thu Apr 16 22:06:19 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 17 Apr 2020 02:06:19 -0000 Subject: [Python-checkins] Fix parameter names in assertIn() docs (GH-18829) Message-ID: https://github.com/python/cpython/commit/08b640f5727d76dbda1233c182b43a670849a0fa commit: 08b640f5727d76dbda1233c182b43a670849a0fa branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-16T19:06:11-07:00 summary: Fix parameter names in assertIn() docs (GH-18829) The names "member" and "container" for the arguments are also used in the module and shown with the help() function, and are immediately understandable in this context, contrary to "first" and "second". (cherry picked from commit a388bbd3f129364c39843f63e92f08bc53c71905) Co-authored-by: Christoph Zwerschke files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index a559d0988bee2..d9f080a862ff2 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -910,10 +910,10 @@ Test cases .. versionadded:: 3.1 - .. method:: assertIn(first, second, msg=None) - assertNotIn(first, second, msg=None) + .. method:: assertIn(member, container, msg=None) + assertNotIn(member, container, msg=None) - Test that *first* is (or is not) in *second*. + Test that *member* is (or is not) in *container*. .. versionadded:: 3.1 From webhook-mailer at python.org Thu Apr 16 22:07:36 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 17 Apr 2020 02:07:36 -0000 Subject: [Python-checkins] Fix parameter names in assertIn() docs (GH-18829) Message-ID: https://github.com/python/cpython/commit/6fd47fabe04a1d52c61e87d594d10dd65e6432ee commit: 6fd47fabe04a1d52c61e87d594d10dd65e6432ee branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-16T19:07:31-07:00 summary: Fix parameter names in assertIn() docs (GH-18829) The names "member" and "container" for the arguments are also used in the module and shown with the help() function, and are immediately understandable in this context, contrary to "first" and "second". (cherry picked from commit a388bbd3f129364c39843f63e92f08bc53c71905) Co-authored-by: Christoph Zwerschke files: M Doc/library/unittest.rst diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 0cd6918b1d253..3cc0665d00b03 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -910,10 +910,10 @@ Test cases .. versionadded:: 3.1 - .. method:: assertIn(first, second, msg=None) - assertNotIn(first, second, msg=None) + .. method:: assertIn(member, container, msg=None) + assertNotIn(member, container, msg=None) - Test that *first* is (or is not) in *second*. + Test that *member* is (or is not) in *container*. .. versionadded:: 3.1 From webhook-mailer at python.org Thu Apr 16 22:09:50 2020 From: webhook-mailer at python.org (Jeffrey Quesnelle) Date: Fri, 17 Apr 2020 02:09:50 -0000 Subject: [Python-checkins] bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (GH-19542) Message-ID: https://github.com/python/cpython/commit/a75e730075cd25be1143e6183006f3b1d61bb80f commit: a75e730075cd25be1143e6183006f3b1d61bb80f branch: master author: Jeffrey Quesnelle committer: GitHub date: 2020-04-17T04:09:45+02:00 summary: bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (GH-19542) files: M Modules/_asynciomodule.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 96a99fe49ceb0..a03a63119bab3 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -3271,6 +3271,8 @@ module_free(void *m) Py_CLEAR(context_kwname); module_free_freelists(); + + module_initialized = 0; } static int From webhook-mailer at python.org Thu Apr 16 22:30:01 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 17 Apr 2020 02:30:01 -0000 Subject: [Python-checkins] bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (GH-19542) Message-ID: https://github.com/python/cpython/commit/6b0ca0aeab04d7b7b54086248ca9d5e70f770f2f commit: 6b0ca0aeab04d7b7b54086248ca9d5e70f770f2f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-16T19:29:50-07:00 summary: bpo-40294: Fix _asyncio when module is loaded/unloaded multiple times (GH-19542) (cherry picked from commit a75e730075cd25be1143e6183006f3b1d61bb80f) Co-authored-by: Jeffrey Quesnelle files: M Modules/_asynciomodule.c diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index f4efa2120a9c8..5ba2bc4975709 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -3261,6 +3261,8 @@ module_free(void *m) Py_CLEAR(context_kwname); module_free_freelists(); + + module_initialized = 0; } static int From webhook-mailer at python.org Thu Apr 16 22:54:24 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Fri, 17 Apr 2020 02:54:24 -0000 Subject: [Python-checkins] Minor modernization and readability improvement to the tokenizer example (GH-19558) Message-ID: https://github.com/python/cpython/commit/bf1a81258c0ecc8b52b9dcc53321c066b3ed4a67 commit: bf1a81258c0ecc8b52b9dcc53321c066b3ed4a67 branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-16T19:54:13-07:00 summary: Minor modernization and readability improvement to the tokenizer example (GH-19558) files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 7c950bfd5b1fd..9abbd8ba73616 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1617,10 +1617,14 @@ The text categories are specified with regular expressions. The technique is to combine those into a single master regular expression and to loop over successive matches:: - import collections + from typing import NamedTuple import re - Token = collections.namedtuple('Token', ['type', 'value', 'line', 'column']) + class Token(NamedTuple): + type: str + value: str + line: int + column: int def tokenize(code): keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'} From webhook-mailer at python.org Fri Apr 17 02:56:57 2020 From: webhook-mailer at python.org (Inada Naoki) Date: Fri, 17 Apr 2020 06:56:57 -0000 Subject: [Python-checkins] bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540) Message-ID: https://github.com/python/cpython/commit/485e715cb1ff92bc9882cd51ec32589f9cb30503 commit: 485e715cb1ff92bc9882cd51ec32589f9cb30503 branch: master author: Inada Naoki committer: GitHub date: 2020-04-17T15:56:35+09:00 summary: bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540) It has not returned the file position after the seek. files: A Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst M Lib/tempfile.py M Lib/test/test_tempfile.py diff --git a/Lib/tempfile.py b/Lib/tempfile.py index ed15c0fd1f8af..ba04be8f9058e 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -738,7 +738,7 @@ def readlines(self, *args): return self._file.readlines(*args) def seek(self, *args): - self._file.seek(*args) + return self._file.seek(*args) def tell(self): return self._file.tell() diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index f4cba0fa8dcf1..69d5de2e1b95f 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1018,7 +1018,8 @@ def test_writelines(self): # Verify writelines with a SpooledTemporaryFile f = self.do_create() f.writelines((b'x', b'y', b'z')) - f.seek(0) + pos = f.seek(0) + self.assertEqual(pos, 0) buf = f.read() self.assertEqual(buf, b'xyz') @@ -1036,7 +1037,8 @@ def test_sparse(self): # when that occurs f = self.do_create(max_size=30) self.assertFalse(f._rolled) - f.seek(100, 0) + pos = f.seek(100, 0) + self.assertEqual(pos, 100) self.assertFalse(f._rolled) f.write(b'x') self.assertTrue(f._rolled) diff --git a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst new file mode 100644 index 0000000000000..d4db192b71076 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst @@ -0,0 +1 @@ +Fixed ``SpooledTemporaryFile.seek()`` to return the position. From webhook-mailer at python.org Fri Apr 17 03:13:39 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 17 Apr 2020 07:13:39 -0000 Subject: [Python-checkins] bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540) Message-ID: https://github.com/python/cpython/commit/11ae7d075293fe855c8af26b577656d1026cd9bb commit: 11ae7d075293fe855c8af26b577656d1026cd9bb branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-17T00:13:34-07:00 summary: bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540) It has not returned the file position after the seek. (cherry picked from commit 485e715cb1ff92bc9882cd51ec32589f9cb30503) Co-authored-by: Inada Naoki files: A Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst M Lib/tempfile.py M Lib/test/test_tempfile.py diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 24f673c64aa8d..f92db5313215e 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -744,7 +744,7 @@ def readlines(self, *args): return self._file.readlines(*args) def seek(self, *args): - self._file.seek(*args) + return self._file.seek(*args) @property def softspace(self): diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index c0464200a3aa3..2d47e70bd0328 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1034,7 +1034,8 @@ def test_writelines(self): # Verify writelines with a SpooledTemporaryFile f = self.do_create() f.writelines((b'x', b'y', b'z')) - f.seek(0) + pos = f.seek(0) + self.assertEqual(pos, 0) buf = f.read() self.assertEqual(buf, b'xyz') @@ -1052,7 +1053,8 @@ def test_sparse(self): # when that occurs f = self.do_create(max_size=30) self.assertFalse(f._rolled) - f.seek(100, 0) + pos = f.seek(100, 0) + self.assertEqual(pos, 100) self.assertFalse(f._rolled) f.write(b'x') self.assertTrue(f._rolled) diff --git a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst new file mode 100644 index 0000000000000..d4db192b71076 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst @@ -0,0 +1 @@ +Fixed ``SpooledTemporaryFile.seek()`` to return the position. From webhook-mailer at python.org Fri Apr 17 03:15:00 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 17 Apr 2020 07:15:00 -0000 Subject: [Python-checkins] bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540) Message-ID: https://github.com/python/cpython/commit/9796fe88da7415925b3e8f7e0a5e55301548734f commit: 9796fe88da7415925b3e8f7e0a5e55301548734f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-17T00:14:55-07:00 summary: bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540) It has not returned the file position after the seek. (cherry picked from commit 485e715cb1ff92bc9882cd51ec32589f9cb30503) Co-authored-by: Inada Naoki files: A Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst M Lib/tempfile.py M Lib/test/test_tempfile.py diff --git a/Lib/tempfile.py b/Lib/tempfile.py index 62875540f8b92..5b990e067f23a 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -735,7 +735,7 @@ def readlines(self, *args): return self._file.readlines(*args) def seek(self, *args): - self._file.seek(*args) + return self._file.seek(*args) @property def softspace(self): diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 232c5dae10fdf..f129454f4c33e 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -1025,7 +1025,8 @@ def test_writelines(self): # Verify writelines with a SpooledTemporaryFile f = self.do_create() f.writelines((b'x', b'y', b'z')) - f.seek(0) + pos = f.seek(0) + self.assertEqual(pos, 0) buf = f.read() self.assertEqual(buf, b'xyz') @@ -1043,7 +1044,8 @@ def test_sparse(self): # when that occurs f = self.do_create(max_size=30) self.assertFalse(f._rolled) - f.seek(100, 0) + pos = f.seek(100, 0) + self.assertEqual(pos, 100) self.assertFalse(f._rolled) f.write(b'x') self.assertTrue(f._rolled) diff --git a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst new file mode 100644 index 0000000000000..d4db192b71076 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst @@ -0,0 +1 @@ +Fixed ``SpooledTemporaryFile.seek()`` to return the position. From webhook-mailer at python.org Fri Apr 17 11:47:28 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 17 Apr 2020 15:47:28 -0000 Subject: [Python-checkins] bpo-40302: Add pycore_byteswap.h header file (GH-19552) Message-ID: https://github.com/python/cpython/commit/1ae035b7e847064d09df01ca62b8a761e9b5aae3 commit: 1ae035b7e847064d09df01ca62b8a761e9b5aae3 branch: master author: Victor Stinner committer: GitHub date: 2020-04-17T17:47:20+02:00 summary: bpo-40302: Add pycore_byteswap.h header file (GH-19552) Add a new internal pycore_byteswap.h header file with the following functions: * _Py_bswap16() * _Py_bswap32() * _Py_bswap64() Use these functions in _ctypes, sha256 and sha512 modules, and also use in the UTF-32 encoder. sha256, sha512 and _ctypes modules are now built with the internal C API. files: A Include/internal/pycore_byteswap.h M Include/pyport.h M Lib/test/test_capi.py M Makefile.pre.in M Modules/Setup M Modules/_ctypes/cfield.c M Modules/_testinternalcapi.c M Modules/sha256module.c M Modules/sha512module.c M Objects/stringlib/codecs.h M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M setup.py diff --git a/Include/internal/pycore_byteswap.h b/Include/internal/pycore_byteswap.h new file mode 100644 index 0000000000000..5e64704a004c8 --- /dev/null +++ b/Include/internal/pycore_byteswap.h @@ -0,0 +1,89 @@ +/* Bytes swap functions, reverse order of bytes: + + - _Py_bswap16(uint16_t) + - _Py_bswap32(uint32_t) + - _Py_bswap64(uint64_t) +*/ + +#ifndef Py_INTERNAL_BSWAP_H +#define Py_INTERNAL_BSWAP_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#if defined(__clang__) || \ + (defined(__GNUC__) && \ + ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8))) + /* __builtin_bswap16() is available since GCC 4.8, + __builtin_bswap32() is available since GCC 4.3, + __builtin_bswap64() is available since GCC 4.3. */ +# define _PY_HAVE_BUILTIN_BSWAP +#endif + +#ifdef _MSC_VER + /* Get _byteswap_ushort(), _byteswap_ulong(), _byteswap_uint64() */ +# include +#endif + +static inline uint16_t +_Py_bswap16(uint16_t word) +{ +#ifdef _PY_HAVE_BUILTIN_BSWAP + return __builtin_bswap16(word); +#elif defined(_MSC_VER) + Py_BUILD_ASSERT(sizeof(word) == sizeof(unsigned short)); + return _byteswap_ushort(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT16_C(0x00FF)) << 8) + | ((word & UINT16_C(0xFF00)) >> 8)); +#endif +} + +static inline uint32_t +_Py_bswap32(uint32_t word) +{ +#ifdef _PY_HAVE_BUILTIN_BSWAP + return __builtin_bswap32(word); +#elif defined(_MSC_VER) + Py_BUILD_ASSERT(sizeof(word) == sizeof(unsigned long)); + return _byteswap_ulong(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT32_C(0x000000FF)) << 24) + | ((word & UINT32_C(0x0000FF00)) << 8) + | ((word & UINT32_C(0x00FF0000)) >> 8) + | ((word & UINT32_C(0xFF000000)) >> 24)); +#endif +} + +static inline uint64_t +_Py_bswap64(uint64_t word) +{ +#ifdef _PY_HAVE_BUILTIN_BSWAP + return __builtin_bswap64(word); +#elif defined(_MSC_VER) + return _byteswap_uint64(word); +#else + // Portable implementation which doesn't rely on circular bit shift + return ( ((word & UINT64_C(0x00000000000000FF)) << 56) + | ((word & UINT64_C(0x000000000000FF00)) << 40) + | ((word & UINT64_C(0x0000000000FF0000)) << 24) + | ((word & UINT64_C(0x00000000FF000000)) << 8) + | ((word & UINT64_C(0x000000FF00000000)) >> 8) + | ((word & UINT64_C(0x0000FF0000000000)) >> 24) + | ((word & UINT64_C(0x00FF000000000000)) >> 40) + | ((word & UINT64_C(0xFF00000000000000)) >> 56)); +#endif +} + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_BSWAP_H */ + diff --git a/Include/pyport.h b/Include/pyport.h index 72e74e046a5ee..63d3b81de5d23 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -768,11 +768,11 @@ extern char * _getpty(int *, int, mode_t, int); */ #ifdef WORDS_BIGENDIAN -#define PY_BIG_ENDIAN 1 -#define PY_LITTLE_ENDIAN 0 +# define PY_BIG_ENDIAN 1 +# define PY_LITTLE_ENDIAN 0 #else -#define PY_BIG_ENDIAN 0 -#define PY_LITTLE_ENDIAN 1 +# define PY_BIG_ENDIAN 0 +# define PY_LITTLE_ENDIAN 1 #endif #ifdef Py_BUILD_CORE diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py index 024343963b605..f9578d3afa81f 100644 --- a/Lib/test/test_capi.py +++ b/Lib/test/test_capi.py @@ -24,6 +24,8 @@ # Skip this test if the _testcapi module isn't available. _testcapi = support.import_module('_testcapi') +import _testinternalcapi + # Were we compiled --with-pydebug or with #define Py_DEBUG? Py_DEBUG = hasattr(sys, 'gettotalrefcount') @@ -658,6 +660,12 @@ class Test_testcapi(unittest.TestCase): if name.startswith('test_') and not name.endswith('_code')) +class Test_testinternalcapi(unittest.TestCase): + locals().update((name, getattr(_testinternalcapi, name)) + for name in dir(_testinternalcapi) + if name.startswith('test_')) + + class PyMemDebugTests(unittest.TestCase): PYTHONMALLOC = 'debug' # '0x04c06e0' or '04C06E0' diff --git a/Makefile.pre.in b/Makefile.pre.in index 6b265226c4966..4511e607d89aa 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1083,6 +1083,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ $(srcdir)/Include/internal/pycore_atomic.h \ + $(srcdir)/Include/internal/pycore_byteswap.h \ $(srcdir)/Include/internal/pycore_bytes_methods.h \ $(srcdir)/Include/internal/pycore_call.h \ $(srcdir)/Include/internal/pycore_ceval.h \ diff --git a/Modules/Setup b/Modules/Setup index 40266a192bc5e..9dcca13100078 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -247,8 +247,8 @@ _symtable symtablemodule.c # The _sha module implements the SHA checksum algorithms. # (NIST's Secure Hash Algorithms.) #_sha1 sha1module.c -#_sha256 sha256module.c -#_sha512 sha512module.c +#_sha256 sha256module.c -DPy_BUILD_CORE_BUILTIN +#_sha512 sha512module.c -DPy_BUILD_CORE_BUILTIN #_sha3 _sha3/sha3module.c # _blake module diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 2060d15a64de5..a72682d7292ca 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_byteswap.h" // _Py_bswap32() #include #ifdef MS_WIN32 @@ -448,46 +449,32 @@ get_ulonglong(PyObject *v, unsigned long long *p) ( ( (type)x & ~(BIT_MASK(type, size) << LOW_BIT(size)) ) | ( ((type)v & BIT_MASK(type, size)) << LOW_BIT(size) ) ) \ : (type)v) -/* byte swapping macros */ -#define SWAP_2(v) \ - ( ( (v >> 8) & 0x00FF) | \ - ( (v << 8) & 0xFF00) ) - -#define SWAP_4(v) \ - ( ( (v & 0x000000FF) << 24 ) | \ - ( (v & 0x0000FF00) << 8 ) | \ - ( (v & 0x00FF0000) >> 8 ) | \ - ( ((v >> 24) & 0xFF)) ) - -#ifdef _MSC_VER -#define SWAP_8(v) \ - ( ( (v & 0x00000000000000FFL) << 56 ) | \ - ( (v & 0x000000000000FF00L) << 40 ) | \ - ( (v & 0x0000000000FF0000L) << 24 ) | \ - ( (v & 0x00000000FF000000L) << 8 ) | \ - ( (v & 0x000000FF00000000L) >> 8 ) | \ - ( (v & 0x0000FF0000000000L) >> 24 ) | \ - ( (v & 0x00FF000000000000L) >> 40 ) | \ - ( ((v >> 56) & 0xFF)) ) +#if SIZEOF_SHORT == 2 +# define SWAP_SHORT _Py_bswap16 #else -#define SWAP_8(v) \ - ( ( (v & 0x00000000000000FFLL) << 56 ) | \ - ( (v & 0x000000000000FF00LL) << 40 ) | \ - ( (v & 0x0000000000FF0000LL) << 24 ) | \ - ( (v & 0x00000000FF000000LL) << 8 ) | \ - ( (v & 0x000000FF00000000LL) >> 8 ) | \ - ( (v & 0x0000FF0000000000LL) >> 24 ) | \ - ( (v & 0x00FF000000000000LL) >> 40 ) | \ - ( ((v >> 56) & 0xFF)) ) +# error "unsupported short size" #endif -#define SWAP_INT SWAP_4 +#if SIZEOF_INT == 4 +# define SWAP_INT _Py_bswap32 +#else +# error "unsupported int size" +#endif #if SIZEOF_LONG == 4 -# define SWAP_LONG SWAP_4 +# define SWAP_LONG _Py_bswap32 #elif SIZEOF_LONG == 8 -# define SWAP_LONG SWAP_8 +# define SWAP_LONG _Py_bswap64 +#else +# error "unsupported long size" +#endif + +#if SIZEOF_LONG_LONG == 8 +# define SWAP_LONG_LONG _Py_bswap64 +#else +# error "unsupported long long size" #endif + /***************************************************************** * The setter methods return an object which must be kept alive, to keep the * data valid which has been stored in the memory block. The ctypes object @@ -569,12 +556,13 @@ h_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { long val; short field; - if (get_long(value, &val) < 0) + if (get_long(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); - field = SWAP_2(field); + field = SWAP_SHORT(field); field = SET(short, field, val, size); - field = SWAP_2(field); + field = SWAP_SHORT(field); memcpy(ptr, &field, sizeof(field)); _RET(value); } @@ -593,7 +581,7 @@ h_get_sw(void *ptr, Py_ssize_t size) { short val; memcpy(&val, ptr, sizeof(val)); - val = SWAP_2(val); + val = SWAP_SHORT(val); GET_BITFIELD(val, size); return PyLong_FromLong(val); } @@ -616,12 +604,13 @@ H_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { unsigned long val; unsigned short field; - if (get_ulong(value, &val) < 0) + if (get_ulong(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); - field = SWAP_2(field); + field = SWAP_SHORT(field); field = SET(unsigned short, field, val, size); - field = SWAP_2(field); + field = SWAP_SHORT(field); memcpy(ptr, &field, sizeof(field)); _RET(value); } @@ -641,7 +630,7 @@ H_get_sw(void *ptr, Py_ssize_t size) { unsigned short val; memcpy(&val, ptr, sizeof(val)); - val = SWAP_2(val); + val = SWAP_SHORT(val); GET_BITFIELD(val, size); return PyLong_FromLong(val); } @@ -664,8 +653,9 @@ i_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { long val; int field; - if (get_long(value, &val) < 0) + if (get_long(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); field = SWAP_INT(field); field = SET(int, field, val, size); @@ -757,8 +747,9 @@ I_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { unsigned long val; unsigned int field; - if (get_ulong(value, &val) < 0) + if (get_ulong(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); field = SWAP_INT(field); field = SET(unsigned int, field, (unsigned int)val, size); @@ -805,8 +796,9 @@ l_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { long val; long field; - if (get_long(value, &val) < 0) + if (get_long(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); field = SWAP_LONG(field); field = SET(long, field, val, size); @@ -853,8 +845,9 @@ L_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { unsigned long val; unsigned long field; - if (get_ulong(value, &val) < 0) + if (get_ulong(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); field = SWAP_LONG(field); field = SET(unsigned long, field, val, size); @@ -901,12 +894,13 @@ q_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { long long val; long long field; - if (get_longlong(value, &val) < 0) + if (get_longlong(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); - field = SWAP_8(field); + field = SWAP_LONG_LONG(field); field = SET(long long, field, val, size); - field = SWAP_8(field); + field = SWAP_LONG_LONG(field); memcpy(ptr, &field, sizeof(field)); _RET(value); } @@ -925,7 +919,7 @@ q_get_sw(void *ptr, Py_ssize_t size) { long long val; memcpy(&val, ptr, sizeof(val)); - val = SWAP_8(val); + val = SWAP_LONG_LONG(val); GET_BITFIELD(val, size); return PyLong_FromLongLong(val); } @@ -948,12 +942,13 @@ Q_set_sw(void *ptr, PyObject *value, Py_ssize_t size) { unsigned long long val; unsigned long long field; - if (get_ulonglong(value, &val) < 0) + if (get_ulonglong(value, &val) < 0) { return NULL; + } memcpy(&field, ptr, sizeof(field)); - field = SWAP_8(field); + field = SWAP_LONG_LONG(field); field = SET(unsigned long long, field, val, size); - field = SWAP_8(field); + field = SWAP_LONG_LONG(field); memcpy(ptr, &field, sizeof(field)); _RET(value); } @@ -972,7 +967,7 @@ Q_get_sw(void *ptr, Py_ssize_t size) { unsigned long long val; memcpy(&val, ptr, sizeof(val)); - val = SWAP_8(val); + val = SWAP_LONG_LONG(val); GET_BITFIELD(val, size); return PyLong_FromUnsignedLongLong(val); } diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 8352f6e2590c5..9330e2625b3a0 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -9,6 +9,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_byteswap.h" // _Py_bswap32() #include "pycore_initconfig.h" // _Py_GetConfigsAsDict() #include "pycore_gc.h" // PyGC_Head @@ -21,7 +22,7 @@ get_configs(PyObject *self, PyObject *Py_UNUSED(args)) static PyObject* -get_recursion_depth(PyObject *self, PyObject *args) +get_recursion_depth(PyObject *self, PyObject *Py_UNUSED(args)) { PyThreadState *tstate = PyThreadState_Get(); @@ -30,9 +31,38 @@ get_recursion_depth(PyObject *self, PyObject *args) } +static PyObject* +test_bswap(PyObject *self, PyObject *Py_UNUSED(args)) +{ + uint16_t u16 = _Py_bswap16(UINT16_C(0x3412)); + if (u16 != UINT16_C(0x1234)) { + PyErr_Format(PyExc_AssertionError, + "_Py_bswap16(0x3412) returns %u", u16); + return NULL; + } + + uint32_t u32 = _Py_bswap32(UINT32_C(0x78563412)); + if (u32 != UINT32_C(0x12345678)) { + PyErr_Format(PyExc_AssertionError, + "_Py_bswap32(0x78563412) returns %lu", u32); + return NULL; + } + + uint64_t u64 = _Py_bswap64(UINT64_C(0xEFCDAB9078563412)); + if (u64 != UINT64_C(0x1234567890ABCDEF)) { + PyErr_Format(PyExc_AssertionError, + "_Py_bswap64(0xEFCDAB9078563412) returns %llu", u64); + return NULL; + } + + Py_RETURN_NONE; +} + + static PyMethodDef TestMethods[] = { {"get_configs", get_configs, METH_NOARGS}, {"get_recursion_depth", get_recursion_depth, METH_NOARGS}, + {"test_bswap", test_bswap, METH_NOARGS}, {NULL, NULL} /* sentinel */ }; diff --git a/Modules/sha256module.c b/Modules/sha256module.c index 731082655c0ec..e0ff9b2b3a187 100644 --- a/Modules/sha256module.c +++ b/Modules/sha256module.c @@ -17,6 +17,7 @@ /* SHA objects */ #include "Python.h" +#include "pycore_byteswap.h" // _Py_bswap32() #include "structmember.h" // PyMemberDef #include "hashlib.h" #include "pystrhex.h" @@ -30,12 +31,7 @@ class SHA256Type "SHAobject *" "&PyType_Type" /* Some useful types */ typedef unsigned char SHA_BYTE; - -#if SIZEOF_INT == 4 -typedef unsigned int SHA_INT32; /* 32-bit integer */ -#else -/* not defined. compilation will die. */ -#endif +typedef uint32_t SHA_INT32; /* 32-bit integer */ /* The SHA block size and message digest sizes, in bytes */ @@ -61,14 +57,9 @@ typedef struct { #if PY_LITTLE_ENDIAN static void longReverse(SHA_INT32 *buffer, int byteCount) { - SHA_INT32 value; - byteCount /= sizeof(*buffer); - while (byteCount--) { - value = *buffer; - value = ( ( value & 0xFF00FF00L ) >> 8 ) | \ - ( ( value & 0x00FF00FFL ) << 8 ); - *buffer++ = ( value << 16 ) | ( value >> 16 ); + for (; byteCount--; buffer++) { + *buffer = _Py_bswap32(*buffer); } } #endif diff --git a/Modules/sha512module.c b/Modules/sha512module.c index 38d303d369ec5..780f8e7f06c9e 100644 --- a/Modules/sha512module.c +++ b/Modules/sha512module.c @@ -17,6 +17,7 @@ /* SHA objects */ #include "Python.h" +#include "pycore_byteswap.h" // _Py_bswap32() #include "structmember.h" // PyMemberDef #include "hashlib.h" #include "pystrhex.h" @@ -30,13 +31,8 @@ class SHA512Type "SHAobject *" "&PyType_Type" /* Some useful types */ typedef unsigned char SHA_BYTE; - -#if SIZEOF_INT == 4 -typedef unsigned int SHA_INT32; /* 32-bit integer */ -typedef unsigned long long SHA_INT64; /* 64-bit integer */ -#else -/* not defined. compilation will die. */ -#endif +typedef uint32_t SHA_INT32; /* 32-bit integer */ +typedef uint64_t SHA_INT64; /* 64-bit integer */ /* The SHA block size and message digest sizes, in bytes */ @@ -62,22 +58,9 @@ typedef struct { #if PY_LITTLE_ENDIAN static void longReverse(SHA_INT64 *buffer, int byteCount) { - SHA_INT64 value; - byteCount /= sizeof(*buffer); - while (byteCount--) { - value = *buffer; - - ((unsigned char*)buffer)[0] = (unsigned char)(value >> 56) & 0xff; - ((unsigned char*)buffer)[1] = (unsigned char)(value >> 48) & 0xff; - ((unsigned char*)buffer)[2] = (unsigned char)(value >> 40) & 0xff; - ((unsigned char*)buffer)[3] = (unsigned char)(value >> 32) & 0xff; - ((unsigned char*)buffer)[4] = (unsigned char)(value >> 24) & 0xff; - ((unsigned char*)buffer)[5] = (unsigned char)(value >> 16) & 0xff; - ((unsigned char*)buffer)[6] = (unsigned char)(value >> 8) & 0xff; - ((unsigned char*)buffer)[7] = (unsigned char)(value ) & 0xff; - - buffer++; + for (; byteCount--; buffer++) { + *buffer = _Py_bswap64(*buffer); } } #endif diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index cd7aa699b8f0f..208e8fe4a48bb 100644 --- a/Objects/stringlib/codecs.h +++ b/Objects/stringlib/codecs.h @@ -4,6 +4,8 @@ # error "codecs.h is specific to Unicode" #endif +#include "pycore_byteswap.h" // _Py_bswap32() + /* Mask to quickly check whether a C 'long' contains a non-ASCII, UTF8-encoded char. */ #if (SIZEOF_LONG == 8) @@ -732,24 +734,28 @@ STRINGLIB(utf16_encode)(const STRINGLIB_CHAR *in, #endif } +static inline uint32_t +STRINGLIB(SWAB4)(STRINGLIB_CHAR ch) +{ + uint32_t word = ch; #if STRINGLIB_SIZEOF_CHAR == 1 -# define SWAB4(CH, tmp) ((CH) << 24) /* high bytes are zero */ + /* high bytes are zero */ + return (word << 24); #elif STRINGLIB_SIZEOF_CHAR == 2 -# define SWAB4(CH, tmp) (tmp = (CH), \ - ((tmp & 0x00FFu) << 24) + ((tmp & 0xFF00u) << 8)) - /* high bytes are zero */ + /* high bytes are zero */ + return ((word & 0x00FFu) << 24) + ((word & 0xFF00u) << 8); #else -# define SWAB4(CH, tmp) (tmp = (CH), \ - tmp = ((tmp & 0x00FF00FFu) << 8) + ((tmp >> 8) & 0x00FF00FFu), \ - ((tmp & 0x0000FFFFu) << 16) + ((tmp >> 16) & 0x0000FFFFu)) + return _Py_bswap32(word); #endif +} + Py_LOCAL_INLINE(Py_ssize_t) STRINGLIB(utf32_encode)(const STRINGLIB_CHAR *in, Py_ssize_t len, - PY_UINT32_T **outptr, + uint32_t **outptr, int native_ordering) { - PY_UINT32_T *out = *outptr; + uint32_t *out = *outptr; const STRINGLIB_CHAR *end = in + len; if (native_ordering) { const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4); @@ -783,7 +789,6 @@ STRINGLIB(utf32_encode)(const STRINGLIB_CHAR *in, const STRINGLIB_CHAR *unrolled_end = in + _Py_SIZE_ROUND_DOWN(len, 4); while (in < unrolled_end) { #if STRINGLIB_SIZEOF_CHAR > 1 - Py_UCS4 ch1, ch2, ch3, ch4; /* check if any character is a surrogate character */ if (((in[0] ^ 0xd800) & (in[1] ^ 0xd800) & @@ -791,10 +796,10 @@ STRINGLIB(utf32_encode)(const STRINGLIB_CHAR *in, (in[3] ^ 0xd800) & 0xf800) == 0) break; #endif - out[0] = SWAB4(in[0], ch1); - out[1] = SWAB4(in[1], ch2); - out[2] = SWAB4(in[2], ch3); - out[3] = SWAB4(in[3], ch4); + out[0] = STRINGLIB(SWAB4)(in[0]); + out[1] = STRINGLIB(SWAB4)(in[1]); + out[2] = STRINGLIB(SWAB4)(in[2]); + out[3] = STRINGLIB(SWAB4)(in[3]); in += 4; out += 4; } while (in < end) { @@ -805,7 +810,7 @@ STRINGLIB(utf32_encode)(const STRINGLIB_CHAR *in, goto fail; } #endif - *out++ = SWAB4(ch, ch); + *out++ = STRINGLIB(SWAB4)(ch); } } *outptr = out; @@ -816,6 +821,5 @@ STRINGLIB(utf32_encode)(const STRINGLIB_CHAR *in, return len - (end - in + 1); #endif } -#undef SWAB4 #endif diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index c35499e0eb772..862c5a821b1f9 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -164,6 +164,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index c04df27de5860..9d6d997b5267e 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -195,6 +195,9 @@ Include + + Include + Include diff --git a/setup.py b/setup.py index 0357a0124f8b8..65a1cfab078c5 100644 --- a/setup.py +++ b/setup.py @@ -2044,7 +2044,7 @@ def detect_ctypes(self): # Thomas Heller's _ctypes module self.use_system_libffi = False include_dirs = [] - extra_compile_args = [] + extra_compile_args = ['-DPy_BUILD_CORE_MODULE'] extra_link_args = [] sources = ['_ctypes/_ctypes.c', '_ctypes/callbacks.c', @@ -2298,8 +2298,10 @@ def detect_hash_builtins(self): # It's harmless and the object code is tiny (40-50 KiB per module, # only loaded when actually used). self.add(Extension('_sha256', ['sha256module.c'], + extra_compile_args=['-DPy_BUILD_CORE_MODULE'], depends=['hashlib.h'])) self.add(Extension('_sha512', ['sha512module.c'], + extra_compile_args=['-DPy_BUILD_CORE_MODULE'], depends=['hashlib.h'])) self.add(Extension('_md5', ['md5module.c'], depends=['hashlib.h'])) From webhook-mailer at python.org Fri Apr 17 12:03:01 2020 From: webhook-mailer at python.org (Mariusz Felisiak) Date: Fri, 17 Apr 2020 16:03:01 -0000 Subject: [Python-checkins] bpo-40300: Allow empty logging.Formatter.default_msec_format. (GH-19551) Message-ID: https://github.com/python/cpython/commit/06a35542aad15666cace307d841a95e33f3cbee6 commit: 06a35542aad15666cace307d841a95e33f3cbee6 branch: master author: Mariusz Felisiak committer: GitHub date: 2020-04-17T17:02:47+01:00 summary: bpo-40300: Allow empty logging.Formatter.default_msec_format. (GH-19551) files: M Doc/library/logging.rst M Lib/logging/__init__.py M Lib/test/test_logging.py diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst index e943011c8afd8..7267f812cc192 100644 --- a/Doc/library/logging.rst +++ b/Doc/library/logging.rst @@ -608,6 +608,9 @@ The useful mapping keys in a :class:`LogRecord` are given in the section on attributes are ``default_time_format`` (for the strptime format string) and ``default_msec_format`` (for appending the millisecond value). + .. versionchanged:: 3.9 + The ``default_msec_format`` can be ``None``. + .. method:: formatException(exc_info) Formats the specified exception information (a standard exception tuple as diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 84a177559908a..403dc81b13ef4 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -597,8 +597,9 @@ def formatTime(self, record, datefmt=None): if datefmt: s = time.strftime(datefmt, ct) else: - t = time.strftime(self.default_time_format, ct) - s = self.default_msec_format % (t, record.msecs) + s = time.strftime(self.default_time_format, ct) + if self.default_msec_format: + s = self.default_msec_format % (s, record.msecs) return s def formatException(self, ei): diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 2ad3c5c208583..99e74ebff6087 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -3941,6 +3941,19 @@ def test_time(self): f.format(r) self.assertEqual(r.asctime, '1993-04-21 08:03:00,123') + def test_default_msec_format_none(self): + class NoMsecFormatter(logging.Formatter): + default_msec_format = None + default_time_format = '%d/%m/%Y %H:%M:%S' + + r = self.get_record() + dt = datetime.datetime(1993, 4, 21, 8, 3, 0, 123, utc) + r.created = time.mktime(dt.astimezone(None).timetuple()) + f = NoMsecFormatter() + f.converter = time.gmtime + self.assertEqual(f.formatTime(r), '21/04/1993 08:03:00') + + class TestBufferingFormatter(logging.BufferingFormatter): def formatHeader(self, records): return '[(%d)' % len(records) From webhook-mailer at python.org Fri Apr 17 12:41:15 2020 From: webhook-mailer at python.org (Barney Gale) Date: Fri, 17 Apr 2020 16:41:15 -0000 Subject: [Python-checkins] bpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the path accessor. (GH-18844) Message-ID: https://github.com/python/cpython/commit/22386bb4ef740ee92d34c87b8cb90d681423a853 commit: 22386bb4ef740ee92d34c87b8cb90d681423a853 branch: master author: Barney Gale committer: GitHub date: 2020-04-17T18:41:07+02:00 summary: bpo-39901: Move `pathlib.Path.owner()` and `group()` implementations into the path accessor. (GH-18844) files: M Lib/pathlib.py diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 96b8b59530c72..d2053e6284501 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -447,6 +447,20 @@ def symlink(a, b, target_is_directory): def readlink(self, path): return os.readlink(path) + def owner(self, path): + try: + import pwd + return pwd.getpwuid(self.stat(path).st_uid).pw_name + except ImportError: + raise NotImplementedError("Path.owner() is unsupported on this system") + + def group(self, path): + try: + import grp + return grp.getgrgid(self.stat(path).st_gid).gr_name + except ImportError: + raise NotImplementedError("Path.group() is unsupported on this system") + _normal_accessor = _NormalAccessor() @@ -1202,15 +1216,13 @@ def owner(self): """ Return the login name of the file owner. """ - import pwd - return pwd.getpwuid(self.stat().st_uid).pw_name + return self._accessor.owner(self) def group(self): """ Return the group name of the file gid. """ - import grp - return grp.getgrgid(self.stat().st_gid).gr_name + return self._accessor.group(self) def open(self, mode='r', buffering=-1, encoding=None, errors=None, newline=None): @@ -1544,11 +1556,5 @@ class WindowsPath(Path, PureWindowsPath): """ __slots__ = () - def owner(self): - raise NotImplementedError("Path.owner() is unsupported on this system") - - def group(self): - raise NotImplementedError("Path.group() is unsupported on this system") - def is_mount(self): raise NotImplementedError("Path.is_mount() is unsupported on this system") From webhook-mailer at python.org Fri Apr 17 13:05:51 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 17 Apr 2020 17:05:51 -0000 Subject: [Python-checkins] bpo-40286: Add randbytes() method to random.Random (GH-19527) Message-ID: https://github.com/python/cpython/commit/9f5fe7910f4a1bf5a425837d4915e332b945eb7b commit: 9f5fe7910f4a1bf5a425837d4915e332b945eb7b branch: master author: Victor Stinner committer: GitHub date: 2020-04-17T19:05:35+02:00 summary: bpo-40286: Add randbytes() method to random.Random (GH-19527) Add random.randbytes() function and random.Random.randbytes() method to generate random bytes. Modify secrets.token_bytes() to use SystemRandom.randbytes() rather than calling directly os.urandom(). Rename also genrand_int32() to genrand_uint32(), since it returns an unsigned 32-bit integer, not a signed integer. The _random module is now built with Py_BUILD_CORE_MODULE defined. files: A Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst M Doc/library/random.rst M Doc/whatsnew/3.9.rst M Lib/random.py M Lib/secrets.py M Lib/test/test_random.py M Modules/Setup M Modules/_randommodule.c M Modules/clinic/_randommodule.c.h M setup.py diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 1eb39bbda42e8..51242cb0e9581 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -112,6 +112,13 @@ Bookkeeping functions :meth:`randrange` to handle arbitrarily large ranges. +.. function:: randbytes(n) + + Generate *n* random bytes. + + .. versionadded:: 3.9 + + Functions for integers ---------------------- diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index aae8e5b0c9716..2b36b0f154b31 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -353,6 +353,12 @@ The documentation string is now shown not only for class, function, method etc, but for any object that has its own ``__doc__`` attribute. (Contributed by Serhiy Storchaka in :issue:`40257`.) +random +------ + +Add a new :attr:`random.Random.randbytes` method: generate random bytes. +(Contributed by Victor Stinner in :issue:`40286`.) + signal ------ diff --git a/Lib/random.py b/Lib/random.py index e24737d4508a8..82345fab92131 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -739,6 +739,12 @@ def getrandbits(self, k): x = int.from_bytes(_urandom(numbytes), 'big') return x >> (numbytes * 8 - k) # trim excess bits + def randbytes(self, n): + """Generate n random bytes.""" + # os.urandom(n) fails with ValueError for n < 0 + # and returns an empty bytes string for n == 0. + return _urandom(n) + def seed(self, *args, **kwds): "Stub method. Not used for a system random number generator." return None @@ -819,6 +825,7 @@ def _test(N=2000): getstate = _inst.getstate setstate = _inst.setstate getrandbits = _inst.getrandbits +randbytes = _inst.randbytes if hasattr(_os, "fork"): _os.register_at_fork(after_in_child=_inst.seed) diff --git a/Lib/secrets.py b/Lib/secrets.py index 130434229e96a..a546efbdd4204 100644 --- a/Lib/secrets.py +++ b/Lib/secrets.py @@ -14,7 +14,6 @@ import base64 import binascii -import os from hmac import compare_digest from random import SystemRandom @@ -44,7 +43,7 @@ def token_bytes(nbytes=None): """ if nbytes is None: nbytes = DEFAULT_ENTROPY - return os.urandom(nbytes) + return _sysrand.randbytes(nbytes) def token_hex(nbytes=None): """Return a random text string, in hexadecimal. diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 548af706dbee2..f709e52ecb805 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -291,6 +291,22 @@ def test_bug_9025(self): k = sum(randrange(6755399441055744) % 3 == 2 for i in range(n)) self.assertTrue(0.30 < k/n < .37, (k/n)) + def test_randbytes(self): + # Verify ranges + for n in range(1, 10): + data = self.gen.randbytes(n) + self.assertEqual(type(data), bytes) + self.assertEqual(len(data), n) + + self.assertEqual(self.gen.randbytes(0), b'') + + # Verify argument checking + self.assertRaises(TypeError, self.gen.randbytes) + self.assertRaises(TypeError, self.gen.randbytes, 1, 2) + self.assertRaises(ValueError, self.gen.randbytes, -1) + self.assertRaises(TypeError, self.gen.randbytes, 1.0) + + try: random.SystemRandom().random() except NotImplementedError: @@ -747,6 +763,41 @@ def test_choices_algorithms(self): c = self.gen.choices(population, cum_weights=cum_weights, k=10000) self.assertEqual(a, c) + def test_randbytes(self): + super().test_randbytes() + + # Mersenne Twister randbytes() is deterministic + # and does not depend on the endian and bitness. + seed = 8675309 + expected = b'f\xf9\xa836\xd0\xa4\xf4\x82\x9f\x8f\x19\xf0eo\x02' + + self.gen.seed(seed) + self.assertEqual(self.gen.randbytes(16), expected) + + # randbytes(0) must not consume any entropy + self.gen.seed(seed) + self.assertEqual(self.gen.randbytes(0), b'') + self.assertEqual(self.gen.randbytes(16), expected) + + # Four randbytes(4) calls give the same output than randbytes(16) + self.gen.seed(seed) + self.assertEqual(b''.join([self.gen.randbytes(4) for _ in range(4)]), + expected) + + # Each randbytes(2) or randbytes(3) call consumes 4 bytes of entropy + self.gen.seed(seed) + expected2 = b''.join(expected[i:i + 2] + for i in range(0, len(expected), 4)) + self.assertEqual(b''.join(self.gen.randbytes(2) for _ in range(4)), + expected2) + + self.gen.seed(seed) + expected3 = b''.join(expected[i:i + 3] + for i in range(0, len(expected), 4)) + self.assertEqual(b''.join(self.gen.randbytes(3) for _ in range(4)), + expected3) + + def gamma(z, sqrt2pi=(2.0*pi)**0.5): # Reflection to right half of complex plane if z < 0.5: diff --git a/Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst b/Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst new file mode 100644 index 0000000000000..69c9cff10aa99 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst @@ -0,0 +1,2 @@ +Add :func:`random.randbytes` function and +:meth:`random.Random.randbytes` method to generate random bytes. diff --git a/Modules/Setup b/Modules/Setup index 9dcca13100078..6f0374a206315 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -174,7 +174,7 @@ _symtable symtablemodule.c #_weakref _weakref.c # basic weak reference support #_testcapi _testcapimodule.c # Python C API test module #_testinternalcapi _testinternalcapi.c -I$(srcdir)/Include/internal -DPy_BUILD_CORE_MODULE # Python internal C API test module -#_random _randommodule.c # Random number generator +#_random _randommodule.c -DPy_BUILD_CORE_MODULE # Random number generator #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator #_pickle _pickle.c # pickle accelerator #_datetime _datetimemodule.c # datetime accelerator diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 90762758f9311..560460b9a44be 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -11,7 +11,7 @@ * renamed genrand_res53() to random_random() and wrapped in python calling/return code. - * genrand_int32() and the helper functions, init_genrand() + * genrand_uint32() and the helper functions, init_genrand() and init_by_array(), were declared static, wrapped in Python calling/return code. also, their global data references were replaced with structure references. @@ -67,9 +67,9 @@ /* ---------------------------------------------------------------*/ #include "Python.h" -#include /* for seeding to current time */ +#include "pycore_byteswap.h" // _Py_bswap32() #ifdef HAVE_PROCESS_H -# include /* needed for getpid() */ +# include // getpid() #endif /* Period parameters -- These are all magic. Don't change. */ @@ -116,7 +116,7 @@ class _random.Random "RandomObject *" "&Random_Type" /* generates a random number on [0,0xffffffff]-interval */ static uint32_t -genrand_int32(RandomObject *self) +genrand_uint32(RandomObject *self) { uint32_t y; static const uint32_t mag01[2] = {0x0U, MATRIX_A}; @@ -171,7 +171,7 @@ static PyObject * _random_Random_random_impl(RandomObject *self) /*[clinic end generated code: output=117ff99ee53d755c input=afb2a59cbbb00349]*/ { - uint32_t a=genrand_int32(self)>>5, b=genrand_int32(self)>>6; + uint32_t a=genrand_uint32(self)>>5, b=genrand_uint32(self)>>6; return PyFloat_FromDouble((a*67108864.0+b)*(1.0/9007199254740992.0)); } @@ -481,7 +481,7 @@ _random_Random_getrandbits_impl(RandomObject *self, int k) } if (k <= 32) /* Fast path */ - return PyLong_FromUnsignedLong(genrand_int32(self) >> (32 - k)); + return PyLong_FromUnsignedLong(genrand_uint32(self) >> (32 - k)); words = (k - 1) / 32 + 1; wordarray = (uint32_t *)PyMem_Malloc(words * 4); @@ -498,7 +498,7 @@ _random_Random_getrandbits_impl(RandomObject *self, int k) for (i = words - 1; i >= 0; i--, k -= 32) #endif { - r = genrand_int32(self); + r = genrand_uint32(self); if (k < 32) r >>= (32 - k); /* Drop least significant bits */ wordarray[i] = r; @@ -510,6 +510,56 @@ _random_Random_getrandbits_impl(RandomObject *self, int k) return result; } +/*[clinic input] + +_random.Random.randbytes + + self: self(type="RandomObject *") + n: Py_ssize_t + / + +Generate n random bytes. +[clinic start generated code]*/ + +static PyObject * +_random_Random_randbytes_impl(RandomObject *self, Py_ssize_t n) +/*[clinic end generated code: output=67a28548079a17ea input=7ba658a24150d233]*/ +{ + if (n < 0) { + PyErr_SetString(PyExc_ValueError, + "number of bytes must be non-negative"); + return NULL; + } + + if (n == 0) { + /* Don't consume any entropy */ + return PyBytes_FromStringAndSize(NULL, 0); + } + + PyObject *bytes = PyBytes_FromStringAndSize(NULL, n); + if (bytes == NULL) { + return NULL; + } + uint8_t *ptr = (uint8_t *)PyBytes_AS_STRING(bytes); + + do { + uint32_t word = genrand_uint32(self); +#if PY_LITTLE_ENDIAN + /* Convert to big endian */ + word = _Py_bswap32(word); +#endif + if (n < 4) { + memcpy(ptr, &word, n); + break; + } + memcpy(ptr, &word, 4); + ptr += 4; + n -= 4; + } while (n); + + return bytes; +} + static PyObject * random_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -539,6 +589,7 @@ static PyMethodDef random_methods[] = { _RANDOM_RANDOM_GETSTATE_METHODDEF _RANDOM_RANDOM_SETSTATE_METHODDEF _RANDOM_RANDOM_GETRANDBITS_METHODDEF + _RANDOM_RANDOM_RANDBYTES_METHODDEF {NULL, NULL} /* sentinel */ }; diff --git a/Modules/clinic/_randommodule.c.h b/Modules/clinic/_randommodule.c.h index a467811d93b27..dda78f6013cfe 100644 --- a/Modules/clinic/_randommodule.c.h +++ b/Modules/clinic/_randommodule.c.h @@ -114,4 +114,45 @@ _random_Random_getrandbits(RandomObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=a7feb0c9c8d1b627 input=a9049054013a1b77]*/ + +PyDoc_STRVAR(_random_Random_randbytes__doc__, +"randbytes($self, n, /)\n" +"--\n" +"\n" +"Generate n random bytes."); + +#define _RANDOM_RANDOM_RANDBYTES_METHODDEF \ + {"randbytes", (PyCFunction)_random_Random_randbytes, METH_O, _random_Random_randbytes__doc__}, + +static PyObject * +_random_Random_randbytes_impl(RandomObject *self, Py_ssize_t n); + +static PyObject * +_random_Random_randbytes(RandomObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_ssize_t n; + + if (PyFloat_Check(arg)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + { + Py_ssize_t ival = -1; + PyObject *iobj = PyNumber_Index(arg); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + goto exit; + } + n = ival; + } + return_value = _random_Random_randbytes_impl(self, n); + +exit: + return return_value; +} +/*[clinic end generated code: output=e515c651860c4001 input=a9049054013a1b77]*/ diff --git a/setup.py b/setup.py index 65a1cfab078c5..d241dc0b4b406 100644 --- a/setup.py +++ b/setup.py @@ -808,7 +808,8 @@ def detect_simple_extensions(self): self.add(Extension('_datetime', ['_datetimemodule.c'], libraries=['m'])) # random number generator implemented in C - self.add(Extension("_random", ["_randommodule.c"])) + self.add(Extension("_random", ["_randommodule.c"], + extra_compile_args=['-DPy_BUILD_CORE_MODULE'])) # bisect self.add(Extension("_bisect", ["_bisectmodule.c"])) # heapq From webhook-mailer at python.org Fri Apr 17 13:13:11 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 17 Apr 2020 17:13:11 -0000 Subject: [Python-checkins] bpo-40302: Replace PY_INT64_T with int64_t (GH-19573) Message-ID: https://github.com/python/cpython/commit/1a1bd2e23871619adc1405e1cdc7c1e61252fd2c commit: 1a1bd2e23871619adc1405e1cdc7c1e61252fd2c branch: master author: Victor Stinner committer: GitHub date: 2020-04-17T19:13:06+02:00 summary: bpo-40302: Replace PY_INT64_T with int64_t (GH-19573) * Replace PY_INT64_T with int64_t * Replace PY_UINT32_T with uint32_t * Replace PY_UINT64_T with uint64_t sha3module.c no longer checks if PY_UINT64_T is defined since it's always defined and uint64_t is always available on platforms supported by Python. files: M Doc/c-api/init.rst M Include/internal/pycore_interp.h M Modules/_randommodule.c M Modules/_sha3/sha3module.c M Modules/_xxsubinterpretersmodule.c M Objects/interpreteridobject.c M Python/pystate.c diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index b5c647f9b1c62..435808f537b88 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -1114,7 +1114,7 @@ All of the following functions must be called after :c:func:`Py_Initialize`. .. versionadded:: 3.9 -.. c:function:: PY_INT64_T PyInterpreterState_GetID(PyInterpreterState *interp) +.. c:function:: int64_t PyInterpreterState_GetID(PyInterpreterState *interp) Return the interpreter's unique ID. If there was any error in doing so then ``-1`` is returned and an error is set. diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index c6fc6aff5ab25..6e9937caa9dbf 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -170,7 +170,7 @@ struct _xidregitem { struct _xidregitem *next; }; -PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(PY_INT64_T); +PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(int64_t); PyAPI_FUNC(int) _PyInterpreterState_IDInitref(struct _is *); PyAPI_FUNC(void) _PyInterpreterState_IDIncref(struct _is *); diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 560460b9a44be..51c084288fc4b 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -234,7 +234,7 @@ init_by_array(RandomObject *self, uint32_t init_key[], size_t key_length) static int random_seed_urandom(RandomObject *self) { - PY_UINT32_T key[N]; + uint32_t key[N]; if (_PyOS_URandomNonblock(key, sizeof(key)) < 0) { return -1; @@ -250,14 +250,14 @@ random_seed_time_pid(RandomObject *self) uint32_t key[5]; now = _PyTime_GetSystemClock(); - key[0] = (PY_UINT32_T)(now & 0xffffffffU); - key[1] = (PY_UINT32_T)(now >> 32); + key[0] = (uint32_t)(now & 0xffffffffU); + key[1] = (uint32_t)(now >> 32); - key[2] = (PY_UINT32_T)getpid(); + key[2] = (uint32_t)getpid(); now = _PyTime_GetMonotonicClock(); - key[3] = (PY_UINT32_T)(now & 0xffffffffU); - key[4] = (PY_UINT32_T)(now >> 32); + key[3] = (uint32_t)(now & 0xffffffffU); + key[4] = (uint32_t)(now >> 32); init_by_array(self, key, Py_ARRAY_LENGTH(key)); } diff --git a/Modules/_sha3/sha3module.c b/Modules/_sha3/sha3module.c index 9cdee5869a271..c826b42df13f9 100644 --- a/Modules/_sha3/sha3module.c +++ b/Modules/_sha3/sha3module.c @@ -40,7 +40,7 @@ #elif PY_BIG_ENDIAN /* opt64 is not yet supported on big endian platforms */ #define KeccakOpt 32 -#elif SIZEOF_VOID_P == 8 && defined(PY_UINT64_T) +#elif SIZEOF_VOID_P == 8 /* opt64 works only on little-endian 64bit platforms with unsigned int64 */ #define KeccakOpt 64 #else @@ -48,9 +48,9 @@ #define KeccakOpt 32 #endif -#if KeccakOpt == 64 && defined(PY_UINT64_T) +#if KeccakOpt == 64 /* 64bit platforms with unsigned int64 */ - typedef PY_UINT64_T UINT64; + typedef uint64_t UINT64; typedef unsigned char UINT8; #endif diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index b3616ae1b7665..fa35e14c55401 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -2135,7 +2135,7 @@ static PyObject * interp_get_main(PyObject *self, PyObject *Py_UNUSED(ignored)) { // Currently, 0 is always the main interpreter. - PY_INT64_T id = 0; + int64_t id = 0; return _PyInterpreterID_New(id); } diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c index a250293a47277..39bde97269590 100644 --- a/Objects/interpreteridobject.c +++ b/Objects/interpreteridobject.c @@ -270,7 +270,7 @@ _PyInterpreterState_GetIDObject(PyInterpreterState *interp) if (_PyInterpreterState_IDInitref(interp) != 0) { return NULL; }; - PY_INT64_T id = PyInterpreterState_GetID(interp); + int64_t id = PyInterpreterState_GetID(interp); if (id < 0) { return NULL; } diff --git a/Python/pystate.c b/Python/pystate.c index 84a694b32e5d0..d6f58822b64ae 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -452,11 +452,11 @@ PyInterpreterState_GetID(PyInterpreterState *interp) static PyInterpreterState * -interp_look_up_id(_PyRuntimeState *runtime, PY_INT64_T requested_id) +interp_look_up_id(_PyRuntimeState *runtime, int64_t requested_id) { PyInterpreterState *interp = runtime->interpreters.head; while (interp != NULL) { - PY_INT64_T id = PyInterpreterState_GetID(interp); + int64_t id = PyInterpreterState_GetID(interp); if (id < 0) { return NULL; } @@ -469,7 +469,7 @@ interp_look_up_id(_PyRuntimeState *runtime, PY_INT64_T requested_id) } PyInterpreterState * -_PyInterpreterState_LookUpID(PY_INT64_T requested_id) +_PyInterpreterState_LookUpID(int64_t requested_id) { PyInterpreterState *interp = NULL; if (requested_id >= 0) { From webhook-mailer at python.org Fri Apr 17 13:13:39 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 17 Apr 2020 17:13:39 -0000 Subject: [Python-checkins] bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572) Message-ID: https://github.com/python/cpython/commit/d7c657d4b121164caa439253da5266b2e29a1bed commit: d7c657d4b121164caa439253da5266b2e29a1bed branch: master author: Victor Stinner committer: GitHub date: 2020-04-17T19:13:34+02:00 summary: bpo-40302: UTF-32 encoder SWAB4() macro use a|b rather than a+b (GH-19572) files: M Objects/stringlib/codecs.h diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index 208e8fe4a48bb..9b2a29ba3b8c2 100644 --- a/Objects/stringlib/codecs.h +++ b/Objects/stringlib/codecs.h @@ -743,7 +743,7 @@ STRINGLIB(SWAB4)(STRINGLIB_CHAR ch) return (word << 24); #elif STRINGLIB_SIZEOF_CHAR == 2 /* high bytes are zero */ - return ((word & 0x00FFu) << 24) + ((word & 0xFF00u) << 8); + return ((word & 0x00FFu) << 24) | ((word & 0xFF00u) << 8); #else return _Py_bswap32(word); #endif From webhook-mailer at python.org Fri Apr 17 13:32:21 2020 From: webhook-mailer at python.org (Antoine Pitrou) Date: Fri, 17 Apr 2020 17:32:21 -0000 Subject: [Python-checkins] bpo-40282: Allow random.getrandbits(0) (GH-19539) Message-ID: https://github.com/python/cpython/commit/75a3378810bab03949ad9f653f78d933bdf3879c commit: 75a3378810bab03949ad9f653f78d933bdf3879c branch: master author: Antoine Pitrou committer: GitHub date: 2020-04-17T19:32:14+02:00 summary: bpo-40282: Allow random.getrandbits(0) (GH-19539) files: A Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst M Doc/library/random.rst M Lib/random.py M Lib/test/test_random.py M Modules/_randommodule.c diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 51242cb0e9581..9964af46b2efe 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -111,6 +111,9 @@ Bookkeeping functions as an optional part of the API. When available, :meth:`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges. + .. versionchanged:: 3.9 + This method now accepts zero for *k*. + .. function:: randbytes(n) diff --git a/Lib/random.py b/Lib/random.py index 82345fab92131..3243938282b50 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -261,6 +261,8 @@ def randint(self, a, b): def _randbelow_with_getrandbits(self, n): "Return a random int in the range [0,n). Raises ValueError if n==0." + if not n: + raise ValueError("Boundary cannot be zero") getrandbits = self.getrandbits k = n.bit_length() # don't use (n-1) here because n can be 1 r = getrandbits(k) # 0 <= r < 2**k @@ -733,8 +735,8 @@ def random(self): def getrandbits(self, k): """getrandbits(k) -> x. Generates an int with k random bits.""" - if k <= 0: - raise ValueError('number of bits must be greater than zero') + if k < 0: + raise ValueError('number of bits must be non-negative') numbytes = (k + 7) // 8 # bits / 8 and rounded up x = int.from_bytes(_urandom(numbytes), 'big') return x >> (numbytes * 8 - k) # trim excess bits diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index f709e52ecb805..efac36a63b963 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -263,6 +263,31 @@ def test_gauss(self): self.assertEqual(x1, x2) self.assertEqual(y1, y2) + def test_getrandbits(self): + # Verify ranges + for k in range(1, 1000): + self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k) + self.assertEqual(self.gen.getrandbits(0), 0) + + # Verify all bits active + getbits = self.gen.getrandbits + for span in [1, 2, 3, 4, 31, 32, 32, 52, 53, 54, 119, 127, 128, 129]: + all_bits = 2**span-1 + cum = 0 + cpl_cum = 0 + for i in range(100): + v = getbits(span) + cum |= v + cpl_cum |= all_bits ^ v + self.assertEqual(cum, all_bits) + self.assertEqual(cpl_cum, all_bits) + + # Verify argument checking + self.assertRaises(TypeError, self.gen.getrandbits) + self.assertRaises(TypeError, self.gen.getrandbits, 1, 2) + self.assertRaises(ValueError, self.gen.getrandbits, -1) + self.assertRaises(TypeError, self.gen.getrandbits, 10.1) + def test_pickling(self): for proto in range(pickle.HIGHEST_PROTOCOL + 1): state = pickle.dumps(self.gen, proto) @@ -390,26 +415,6 @@ def test_randrange_errors(self): raises(0, 42, 0) raises(0, 42, 3.14159) - def test_genrandbits(self): - # Verify ranges - for k in range(1, 1000): - self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k) - - # Verify all bits active - getbits = self.gen.getrandbits - for span in [1, 2, 3, 4, 31, 32, 32, 52, 53, 54, 119, 127, 128, 129]: - cum = 0 - for i in range(100): - cum |= getbits(span) - self.assertEqual(cum, 2**span-1) - - # Verify argument checking - self.assertRaises(TypeError, self.gen.getrandbits) - self.assertRaises(TypeError, self.gen.getrandbits, 1, 2) - self.assertRaises(ValueError, self.gen.getrandbits, 0) - self.assertRaises(ValueError, self.gen.getrandbits, -1) - self.assertRaises(TypeError, self.gen.getrandbits, 10.1) - def test_randbelow_logic(self, _log=log, int=int): # check bitcount transition points: 2**i and 2**(i+1)-1 # show that: k = int(1.001 + _log(n, 2)) @@ -629,34 +634,18 @@ def test_rangelimits(self): self.assertEqual(set(range(start,stop)), set([self.gen.randrange(start,stop) for i in range(100)])) - def test_genrandbits(self): + def test_getrandbits(self): + super().test_getrandbits() + # Verify cross-platform repeatability self.gen.seed(1234567) self.assertEqual(self.gen.getrandbits(100), 97904845777343510404718956115) - # Verify ranges - for k in range(1, 1000): - self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k) - - # Verify all bits active - getbits = self.gen.getrandbits - for span in [1, 2, 3, 4, 31, 32, 32, 52, 53, 54, 119, 127, 128, 129]: - cum = 0 - for i in range(100): - cum |= getbits(span) - self.assertEqual(cum, 2**span-1) - - # Verify argument checking - self.assertRaises(TypeError, self.gen.getrandbits) - self.assertRaises(TypeError, self.gen.getrandbits, 'a') - self.assertRaises(TypeError, self.gen.getrandbits, 1, 2) - self.assertRaises(ValueError, self.gen.getrandbits, 0) - self.assertRaises(ValueError, self.gen.getrandbits, -1) def test_randrange_uses_getrandbits(self): # Verify use of getrandbits by randrange # Use same seed as in the cross-platform repeatability test - # in test_genrandbits above. + # in test_getrandbits above. self.gen.seed(1234567) # If randrange uses getrandbits, it should pick getrandbits(100) # when called with a 100-bits stop argument. diff --git a/Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst b/Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst new file mode 100644 index 0000000000000..699282a7fb59c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst @@ -0,0 +1 @@ +Allow ``random.getrandbits(0)`` to succeed and to return 0. diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 51c084288fc4b..64e44e3bc9f15 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -474,12 +474,15 @@ _random_Random_getrandbits_impl(RandomObject *self, int k) uint32_t *wordarray; PyObject *result; - if (k <= 0) { + if (k < 0) { PyErr_SetString(PyExc_ValueError, - "number of bits must be greater than zero"); + "number of bits must be non-negative"); return NULL; } + if (k == 0) + return PyLong_FromLong(0); + if (k <= 32) /* Fast path */ return PyLong_FromUnsignedLong(genrand_uint32(self) >> (32 - k)); From webhook-mailer at python.org Fri Apr 17 13:42:14 2020 From: webhook-mailer at python.org (Barney Gale) Date: Fri, 17 Apr 2020 17:42:14 -0000 Subject: [Python-checkins] bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (GH-18839) Message-ID: https://github.com/python/cpython/commit/c746c4f353510a17683a49ed7f90ffaae664ff7b commit: c746c4f353510a17683a49ed7f90ffaae664ff7b branch: master author: Barney Gale committer: GitHub date: 2020-04-17T19:42:06+02:00 summary: bpo-39897: Remove needless `Path(self.parent)` call, which makes `is_mount()` misbehave in `Path` subclasses. (GH-18839) files: M Lib/pathlib.py diff --git a/Lib/pathlib.py b/Lib/pathlib.py index d2053e6284501..d3e89dfbc88ac 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1438,9 +1438,8 @@ def is_mount(self): if not self.exists() or not self.is_dir(): return False - parent = Path(self.parent) try: - parent_dev = parent.stat().st_dev + parent_dev = self.parent.stat().st_dev except OSError: return False @@ -1448,7 +1447,7 @@ def is_mount(self): if dev != parent_dev: return True ino = self.stat().st_ino - parent_ino = parent.stat().st_ino + parent_ino = self.parent.stat().st_ino return ino == parent_ino def is_symlink(self): From webhook-mailer at python.org Fri Apr 17 13:47:32 2020 From: webhook-mailer at python.org (Barney Gale) Date: Fri, 17 Apr 2020 17:47:32 -0000 Subject: [Python-checkins] bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (GH-18836) Message-ID: https://github.com/python/cpython/commit/5b1d9184bb0e34391637c06bc7651fb6de8a6240 commit: 5b1d9184bb0e34391637c06bc7651fb6de8a6240 branch: master author: Barney Gale committer: GitHub date: 2020-04-17T19:47:27+02:00 summary: bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (GH-18836) files: M Lib/pathlib.py diff --git a/Lib/pathlib.py b/Lib/pathlib.py index d3e89dfbc88ac..88ebe030c7ff7 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1131,7 +1131,7 @@ def samefile(self, other_path): try: other_st = other_path.stat() except AttributeError: - other_st = os.stat(other_path) + other_st = self._accessor.stat(other_path) return os.path.samestat(st, other_st) def iterdir(self): From webhook-mailer at python.org Fri Apr 17 16:51:36 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Fri, 17 Apr 2020 20:51:36 -0000 Subject: [Python-checkins] bpo-40286: Makes simpler the relation between randbytes() and getrandbits() (GH-19574) Message-ID: https://github.com/python/cpython/commit/223221b290db00ca1042c77103efcbc072f29c90 commit: 223221b290db00ca1042c77103efcbc072f29c90 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-17T23:51:28+03:00 summary: bpo-40286: Makes simpler the relation between randbytes() and getrandbits() (GH-19574) files: M Lib/test/test_random.py M Modules/_randommodule.c diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index efac36a63b963..50d4e94ca22f8 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -758,7 +758,7 @@ def test_randbytes(self): # Mersenne Twister randbytes() is deterministic # and does not depend on the endian and bitness. seed = 8675309 - expected = b'f\xf9\xa836\xd0\xa4\xf4\x82\x9f\x8f\x19\xf0eo\x02' + expected = b'3\xa8\xf9f\xf4\xa4\xd06\x19\x8f\x9f\x82\x02oe\xf0' self.gen.seed(seed) self.assertEqual(self.gen.randbytes(16), expected) @@ -773,19 +773,35 @@ def test_randbytes(self): self.assertEqual(b''.join([self.gen.randbytes(4) for _ in range(4)]), expected) - # Each randbytes(2) or randbytes(3) call consumes 4 bytes of entropy + # Each randbytes(1), randbytes(2) or randbytes(3) call consumes + # 4 bytes of entropy self.gen.seed(seed) - expected2 = b''.join(expected[i:i + 2] + expected1 = expected[3::4] + self.assertEqual(b''.join(self.gen.randbytes(1) for _ in range(4)), + expected1) + + self.gen.seed(seed) + expected2 = b''.join(expected[i + 2: i + 4] for i in range(0, len(expected), 4)) self.assertEqual(b''.join(self.gen.randbytes(2) for _ in range(4)), expected2) self.gen.seed(seed) - expected3 = b''.join(expected[i:i + 3] + expected3 = b''.join(expected[i + 1: i + 4] for i in range(0, len(expected), 4)) self.assertEqual(b''.join(self.gen.randbytes(3) for _ in range(4)), expected3) + def test_randbytes_getrandbits(self): + # There is a simple relation between randbytes() and getrandbits() + seed = 2849427419 + gen2 = random.Random() + self.gen.seed(seed) + gen2.seed(seed) + for n in range(9): + self.assertEqual(self.gen.randbytes(n), + gen2.getrandbits(n * 8).to_bytes(n, 'little')) + def gamma(z, sqrt2pi=(2.0*pi)**0.5): # Reflection to right half of complex plane diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 64e44e3bc9f15..0fc2d07bb50e4 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -534,31 +534,25 @@ _random_Random_randbytes_impl(RandomObject *self, Py_ssize_t n) return NULL; } - if (n == 0) { - /* Don't consume any entropy */ - return PyBytes_FromStringAndSize(NULL, 0); - } - PyObject *bytes = PyBytes_FromStringAndSize(NULL, n); if (bytes == NULL) { return NULL; } uint8_t *ptr = (uint8_t *)PyBytes_AS_STRING(bytes); - do { + for (; n; ptr += 4, n -= 4) { uint32_t word = genrand_uint32(self); -#if PY_LITTLE_ENDIAN - /* Convert to big endian */ +#if PY_BIG_ENDIAN + /* Convert to little endian */ word = _Py_bswap32(word); #endif if (n < 4) { - memcpy(ptr, &word, n); + /* Drop least significant bits */ + memcpy(ptr, (uint8_t *)&word + (4 - n), n); break; } memcpy(ptr, &word, 4); - ptr += 4; - n -= 4; - } while (n); + } return bytes; } From webhook-mailer at python.org Fri Apr 17 16:54:42 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 17 Apr 2020 20:54:42 -0000 Subject: [Python-checkins] bpo-40286: Use random.randbytes() in tests (GH-19575) Message-ID: https://github.com/python/cpython/commit/87502ddd710eb1f030b8ff5a60b05becea3f474f commit: 87502ddd710eb1f030b8ff5a60b05becea3f474f branch: master author: Victor Stinner committer: GitHub date: 2020-04-17T22:54:38+02:00 summary: bpo-40286: Use random.randbytes() in tests (GH-19575) files: M Lib/test/test_bz2.py M Lib/test/test_lzma.py M Lib/test/test_tarfile.py M Lib/test/test_zipfile.py M Lib/test/test_zlib.py diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index 030d564fc59e6..78b95d88faafa 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -710,7 +710,7 @@ def testEOFError(self): def testDecompress4G(self, size): # "Test BZ2Decompressor.decompress() with >4GiB input" blocksize = 10 * 1024 * 1024 - block = random.getrandbits(blocksize * 8).to_bytes(blocksize, 'little') + block = random.randbytes(blocksize) try: data = block * (size // blocksize + 1) compressed = bz2.compress(data) diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py index f24ed3ca3d439..0f3af27efa909 100644 --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -350,7 +350,7 @@ def test_compressor_bigmem(self, size): def test_decompressor_bigmem(self, size): lzd = LZMADecompressor() blocksize = 10 * 1024 * 1024 - block = random.getrandbits(blocksize * 8).to_bytes(blocksize, "little") + block = random.randbytes(blocksize) try: input = block * (size // blocksize + 1) cdata = lzma.compress(input) diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index cae96802ded67..99196f6043191 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -386,7 +386,7 @@ def test_null_tarfile(self): def test_ignore_zeros(self): # Test TarFile's ignore_zeros option. # generate 512 pseudorandom bytes - data = Random(0).getrandbits(512*8).to_bytes(512, 'big') + data = Random(0).randbytes(512) for char in (b'\0', b'a'): # Test if EOFHeaderError ('\0') and InvalidHeaderError ('a') # are ignored correctly. diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 643c5b477bab3..29d98c8092d30 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -16,7 +16,7 @@ from tempfile import TemporaryFile -from random import randint, random, getrandbits +from random import randint, random, randbytes from test.support import script_helper from test.support import (TESTFN, findfile, unlink, rmtree, temp_dir, temp_cwd, @@ -33,9 +33,6 @@ ('ziptest2dir/ziptest3dir/_ziptest3', 'azsxdcfvgb'), ('ziptest2dir/ziptest3dir/ziptest4dir/_ziptest3', '6y7u8i9o0p')] -def getrandbytes(size): - return getrandbits(8 * size).to_bytes(size, 'little') - def get_files(test): yield TESTFN2 with TemporaryFile() as f: @@ -324,7 +321,7 @@ def test_read_return_size(self): # than requested. for test_size in (1, 4095, 4096, 4097, 16384): file_size = test_size + 1 - junk = getrandbytes(file_size) + junk = randbytes(file_size) with zipfile.ZipFile(io.BytesIO(), "w", self.compression) as zipf: zipf.writestr('foo', junk) with zipf.open('foo', 'r') as fp: @@ -2423,8 +2420,8 @@ def test_open_write(self): class TestsWithMultipleOpens(unittest.TestCase): @classmethod def setUpClass(cls): - cls.data1 = b'111' + getrandbytes(10000) - cls.data2 = b'222' + getrandbytes(10000) + cls.data1 = b'111' + randbytes(10000) + cls.data2 = b'222' + randbytes(10000) def make_test_archive(self, f): # Create the ZIP archive diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index f828b4c737a5f..02509cdf5532c 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -134,8 +134,7 @@ def check_big_compress_buffer(self, size, compress_func): # Generate 10 MiB worth of random, and expand it by repeating it. # The assumption is that zlib's memory is not big enough to exploit # such spread out redundancy. - data = b''.join([random.getrandbits(8 * _1M).to_bytes(_1M, 'little') - for i in range(10)]) + data = random.randbytes(_1M * 10) data = data * (size // len(data) + 1) try: compress_func(data) @@ -488,7 +487,7 @@ def test_odd_flush(self): # others might simply have a single RNG gen = random gen.seed(1) - data = genblock(1, 17 * 1024, generator=gen) + data = gen.randbytes(17 * 1024) # compress, sync-flush, and decompress first = co.compress(data) @@ -825,20 +824,6 @@ def test_wbits(self): self.assertEqual(dco.decompress(gzip), HAMLET_SCENE) -def genblock(seed, length, step=1024, generator=random): - """length-byte stream of random data from a seed (in step-byte blocks).""" - if seed is not None: - generator.seed(seed) - randint = generator.randint - if length < step or step < 2: - step = length - blocks = bytes() - for i in range(0, length, step): - blocks += bytes(randint(0, 255) for x in range(step)) - return blocks - - - def choose_lines(source, number, seed=None, generator=random): """Return a list of number lines randomly chosen from the source""" if seed is not None: @@ -847,7 +832,6 @@ def choose_lines(source, number, seed=None, generator=random): return [generator.choice(sources) for n in range(number)] - HAMLET_SCENE = b""" LAERTES From webhook-mailer at python.org Fri Apr 17 19:31:36 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 17 Apr 2020 23:31:36 -0000 Subject: [Python-checkins] bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824) Message-ID: https://github.com/python/cpython/commit/c46dc6f72b4b23a33e66f196f174602d520716df commit: c46dc6f72b4b23a33e66f196f174602d520716df branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-17T16:31:28-07:00 summary: bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824) (cherry picked from commit 7aebbd1182bc818324656b2fb764679faf51fdff) Co-authored-by: Steve Dower files: A Misc/NEWS.d/next/Windows/2019-10-16-09-49-09.bpo-38492.Te1LxC.rst M PCbuild/pythonw_uwp.vcxproj diff --git a/Misc/NEWS.d/next/Windows/2019-10-16-09-49-09.bpo-38492.Te1LxC.rst b/Misc/NEWS.d/next/Windows/2019-10-16-09-49-09.bpo-38492.Te1LxC.rst new file mode 100644 index 0000000000000..41fe695413f97 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2019-10-16-09-49-09.bpo-38492.Te1LxC.rst @@ -0,0 +1 @@ +Remove ``pythonw.exe`` dependency on the Microsoft C++ runtime. diff --git a/PCbuild/pythonw_uwp.vcxproj b/PCbuild/pythonw_uwp.vcxproj index 3da05e351d483..6ff6abb57161b 100644 --- a/PCbuild/pythonw_uwp.vcxproj +++ b/PCbuild/pythonw_uwp.vcxproj @@ -66,6 +66,15 @@ Windows + + + Multithreaded + + + ucrt.lib;%(AdditionalDependencies) + libucrt;%(IgnoreSpecificDefaultLibraries) + + From webhook-mailer at python.org Sat Apr 18 02:58:39 2020 From: webhook-mailer at python.org (Galden) Date: Sat, 18 Apr 2020 06:58:39 -0000 Subject: [Python-checkins] Fix two typos in multiprocessing (GH-19571) Message-ID: https://github.com/python/cpython/commit/c606624af8d4cb3b4a052fb263bb983b3f87585b commit: c606624af8d4cb3b4a052fb263bb983b3f87585b branch: master author: Galden committer: GitHub date: 2020-04-18T08:58:29+02:00 summary: Fix two typos in multiprocessing (GH-19571) files: M Lib/multiprocessing/managers.py diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 9d490a1d8b352..0eb16c664cfab 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -60,7 +60,7 @@ def rebuild_as_list(obj): class Token(object): ''' - Type to uniquely indentify a shared object + Type to uniquely identify a shared object ''' __slots__ = ('typeid', 'address', 'id') @@ -795,7 +795,7 @@ def _connect(self): def _callmethod(self, methodname, args=(), kwds={}): ''' - Try to call a method of the referrent and return a copy of the result + Try to call a method of the referent and return a copy of the result ''' try: conn = self._tls.connection From webhook-mailer at python.org Sat Apr 18 03:24:10 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 18 Apr 2020 07:24:10 -0000 Subject: [Python-checkins] Fix two typos in multiprocessing (GH-19571) (GH-19579) Message-ID: https://github.com/python/cpython/commit/9c7727ba30ab6f174d041f14bbe81cc72b515581 commit: 9c7727ba30ab6f174d041f14bbe81cc72b515581 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-18T09:24:05+02:00 summary: Fix two typos in multiprocessing (GH-19571) (GH-19579) (cherry picked from commit c606624af8d4cb3b4a052fb263bb983b3f87585b) Co-authored-by: Galden Co-authored-by: Galden files: M Lib/multiprocessing/managers.py diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 8e8d28f4b7cde..c5043a4d3c2aa 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -50,7 +50,7 @@ def rebuild_as_list(obj): class Token(object): ''' - Type to uniquely indentify a shared object + Type to uniquely identify a shared object ''' __slots__ = ('typeid', 'address', 'id') @@ -805,7 +805,7 @@ def _connect(self): def _callmethod(self, methodname, args=(), kwds={}): ''' - Try to call a method of the referrent and return a copy of the result + Try to call a method of the referent and return a copy of the result ''' try: conn = self._tls.connection From webhook-mailer at python.org Sat Apr 18 03:24:19 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 18 Apr 2020 07:24:19 -0000 Subject: [Python-checkins] Fix two typos in multiprocessing (GH-19571) (GH-19578) Message-ID: https://github.com/python/cpython/commit/904dd068fb6dc9a70f30dc46061e8b57d7797119 commit: 904dd068fb6dc9a70f30dc46061e8b57d7797119 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-18T09:24:15+02:00 summary: Fix two typos in multiprocessing (GH-19571) (GH-19578) (cherry picked from commit c606624af8d4cb3b4a052fb263bb983b3f87585b) Co-authored-by: Galden Co-authored-by: Galden files: M Lib/multiprocessing/managers.py diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index fc6a25fa623f0..85e0d886f5647 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -59,7 +59,7 @@ def rebuild_as_list(obj): class Token(object): ''' - Type to uniquely indentify a shared object + Type to uniquely identify a shared object ''' __slots__ = ('typeid', 'address', 'id') @@ -821,7 +821,7 @@ def _connect(self): def _callmethod(self, methodname, args=(), kwds={}): ''' - Try to call a method of the referrent and return a copy of the result + Try to call a method of the referent and return a copy of the result ''' try: conn = self._tls.connection From webhook-mailer at python.org Sat Apr 18 10:13:26 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 18 Apr 2020 14:13:26 -0000 Subject: [Python-checkins] bpo-40257: Improve help for the typing module (GH-19546) Message-ID: https://github.com/python/cpython/commit/7e64414f57b70dc5bc0ab19a3162a0735f9bfabf commit: 7e64414f57b70dc5bc0ab19a3162a0735f9bfabf branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-18T17:13:21+03:00 summary: bpo-40257: Improve help for the typing module (GH-19546) * Show docstring for special forms. * Show docstring for special generic aliases. * Show documentation for __origin__ for generic aliases. files: A Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst M Doc/whatsnew/3.9.rst M Lib/pydoc.py M Lib/test/test_pydoc.py M Lib/typing.py diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 2b36b0f154b31..8147d8f185c7c 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -142,6 +142,12 @@ Other Language Changes grammar was much more restrictive. See :pep:`614` for details. (Contributed by Brandt Bucher in :issue:`39702`.) +* Improved help for the :mod:`typing` module. Docstrings are now shown for + all special forms and special generic aliases (like ``Union`` and ``List``). + Using :func:`help` with generic alias like ``List[int]`` will show the help + for the correspondent concrete type (``list`` in this case). + (Contributed by Serhiy Storchaka in :issue:`40257`.) + New Modules =========== diff --git a/Lib/pydoc.py b/Lib/pydoc.py index a89b8045709c2..898cc44b295ee 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1445,7 +1445,7 @@ def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=No if not doc: doc = getdoc(object) if doc: - line += '\n' + self.indent(str(doc)) + line += '\n' + self.indent(str(doc)) + '\n' return line class _PlainTextDoc(TextDoc): @@ -1672,8 +1672,11 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0, inspect.getdoc(object)): # If the passed object is a piece of data or an instance, # document its available methods instead of its value. - object = type(object) - desc += ' object' + if hasattr(object, '__origin__'): + object = object.__origin__ + else: + object = type(object) + desc += ' object' return title % desc + '\n\n' + renderer.document(object, name) def doc(thing, title='Python Library Documentation: %s', forceload=0, diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 800913b425a25..6d358f4fe2fc3 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1255,7 +1255,8 @@ class X: X.attr.__doc__ = 'Custom descriptor' self.assertEqual(self._get_summary_lines(X.attr), """\ .Descr object> - Custom descriptor""") + Custom descriptor +""") X.attr.__name__ = 'foo' self.assertEqual(self._get_summary_lines(X.attr), """\ diff --git a/Lib/typing.py b/Lib/typing.py index 9cacaa840ca35..df3650001e78e 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -323,6 +323,10 @@ def __init__(self, name, doc): self._name = name self._doc = doc + @property + def __doc__(self): + return self._doc + def __eq__(self, other): if not isinstance(other, _SpecialForm): return NotImplemented @@ -672,6 +676,8 @@ def __init__(self, origin, params, *, inst=True, special=False, name=None): self.__slots__ = None # This is not documented. if not name: self.__module__ = origin.__module__ + if special: + self.__doc__ = f'A generic version of {origin.__module__}.{origin.__qualname__}' @_tp_cache def __getitem__(self, params): diff --git a/Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst b/Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst new file mode 100644 index 0000000000000..6ed094add1f62 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst @@ -0,0 +1,4 @@ +Improved help for the :mod:`typing` module. Docstrings are now shown for all +special forms and special generic aliases (like ``Union`` and ``List``). +Using ``help()`` with generic alias like ``List[int]`` will show the help +for the correspondent concrete type (``list`` in this case). From webhook-mailer at python.org Sat Apr 18 10:20:58 2020 From: webhook-mailer at python.org (Chih-Hsuan Yen) Date: Sat, 18 Apr 2020 14:20:58 -0000 Subject: [Python-checkins] bpo-35967: Skip test with `uname -p` on Android (GH-19577) Message-ID: https://github.com/python/cpython/commit/fb940408cea1fb34fed1418832f240f886dadf57 commit: fb940408cea1fb34fed1418832f240f886dadf57 branch: master author: Chih-Hsuan Yen committer: GitHub date: 2020-04-18T07:20:54-07:00 summary: bpo-35967: Skip test with `uname -p` on Android (GH-19577) The uname binary on Android does not support -p [1]. Here is a sample log: ``` 0:06:03 load avg: 0.56 [254/421/8] test_platform failed -- running: test_asyncio (5 min 53 sec) uname: Unknown option p (see "uname --help") test test_platform failed -- Traceback (most recent call last): File "/data/local/tmp/lib/python3.9/test/test_platform.py", line 170, in test_uname_processor proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() File "/data/local/tmp/lib/python3.9/subprocess.py", line 420, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/data/local/tmp/lib/python3.9/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['uname', '-p']' returned non-zero exit status 1. ``` [1] https://android.googlesource.com/platform/external/toybox/+/refs/heads/master/toys/posix/uname.c Automerge-Triggered-By: @jaraco files: M Lib/test/test_platform.py diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 855304a68c204..998f1e0dc315a 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -167,8 +167,11 @@ def test_uname_processor(self): On some systems, the processor must match the output of 'uname -p'. See Issue 35967 for rationale. """ - proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() - expect = platform._unknown_as_blank(proc_res) + try: + proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() + expect = platform._unknown_as_blank(proc_res) + except (OSError, subprocess.CalledProcessError): + expect = '' self.assertEqual(platform.uname().processor, expect) @unittest.skipUnless(sys.platform.startswith('win'), "windows only test") From webhook-mailer at python.org Sat Apr 18 10:52:52 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 18 Apr 2020 14:52:52 -0000 Subject: [Python-checkins] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) Message-ID: https://github.com/python/cpython/commit/12446e6a605f066d837d3a595d0a73e4f3b43b65 commit: 12446e6a605f066d837d3a595d0a73e4f3b43b65 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-18T17:52:48+03:00 summary: bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) Co-authored-by: Ammar Askar files: A Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst M Lib/test/clinic.test M Modules/clinic/posixmodule.c.h M Tools/clinic/cpp.py diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index 6ee9dc5a84b93..cb76c3746c307 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -3260,3 +3260,108 @@ exit: static PyObject * test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab) /*[clinic end generated code: output=f25914b402039493 input=303df5046c7e37a3]*/ + + +/*[clinic input] +output push +output preset buffer +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5bff3376ee0df0b5]*/ + +#ifdef CONDITION_A +/*[clinic input] +test_preprocessor_guarded_condition_a +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_condition_a_impl(PyObject *module) +/*[clinic end generated code: output=ad012af18085add6 input=8edb8706a98cda7e]*/ +#elif CONDITION_B +/*[clinic input] +test_preprocessor_guarded_elif_condition_b +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_elif_condition_b_impl(PyObject *module) +/*[clinic end generated code: output=615f2dee82b138d1 input=53777cebbf7fee32]*/ +#else +/*[clinic input] +test_preprocessor_guarded_else +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_else_impl(PyObject *module) +/*[clinic end generated code: output=13af7670aac51b12 input=6657ab31d74c29fc]*/ +#endif + +/*[clinic input] +dump buffer +output pop +[clinic start generated code]*/ + +#if defined(CONDITION_A) + +PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__, +"test_preprocessor_guarded_condition_a($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF \ + {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, + +static PyObject * +test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_condition_a_impl(module); +} + +#endif /* defined(CONDITION_A) */ + +#if !defined(CONDITION_A) && (CONDITION_B) + +PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__, +"test_preprocessor_guarded_elif_condition_b($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF \ + {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, + +static PyObject * +test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_elif_condition_b_impl(module); +} + +#endif /* !defined(CONDITION_A) && (CONDITION_B) */ + +#if !defined(CONDITION_A) && !(CONDITION_B) + +PyDoc_STRVAR(test_preprocessor_guarded_else__doc__, +"test_preprocessor_guarded_else($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF \ + {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, + +static PyObject * +test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_else_impl(module); +} + +#endif /* !defined(CONDITION_A) && !(CONDITION_B) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF) */ +/*[clinic end generated code: output=3804bb18d454038c input=3fc80c9989d2f2e1]*/ diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst new file mode 100644 index 0000000000000..61bd2e3d94aab --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst @@ -0,0 +1 @@ +Fixed translation of ``#elif`` in Argument Clinic. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 8ff06feb12ec6..9465be9a3043d 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -3900,7 +3900,7 @@ os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #endif /* defined(HAVE_WAITPID) */ -#if defined(HAVE_CWAIT) +#if !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) PyDoc_STRVAR(os_waitpid__doc__, "waitpid($module, pid, options, /)\n" @@ -3936,7 +3936,7 @@ os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -#endif /* defined(HAVE_CWAIT) */ +#endif /* !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) */ #if defined(HAVE_WAIT) @@ -8869,4 +8869,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=4e28994a729eddf9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ca63e471c11dc6e7 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/cpp.py b/Tools/clinic/cpp.py index e099590a3326c..77f5f9696a6d8 100644 --- a/Tools/clinic/cpp.py +++ b/Tools/clinic/cpp.py @@ -141,23 +141,15 @@ def pop_stack(): token = fields[0].lower() condition = ' '.join(fields[1:]).strip() - if_tokens = {'if', 'ifdef', 'ifndef'} - all_tokens = if_tokens | {'elif', 'else', 'endif'} - - if token not in all_tokens: - return - - # cheat a little here, to reuse the implementation of if - if token == 'elif': - pop_stack() - token = 'if' - - if token in if_tokens: + if token in {'if', 'ifdef', 'ifndef', 'elif'}: if not condition: self.fail("Invalid format for #" + token + " line: no argument!") - if token == 'if': + if token in {'if', 'elif'}: if not self.is_a_simple_defined(condition): condition = "(" + condition + ")" + if token == 'elif': + previous_token, previous_condition = pop_stack() + self.stack.append((previous_token, negate(previous_condition))) else: fields = condition.split() if len(fields) != 1: @@ -166,18 +158,21 @@ def pop_stack(): condition = 'defined(' + symbol + ')' if token == 'ifndef': condition = '!' + condition + token = 'if' - self.stack.append(("if", condition)) - if self.verbose: - print(self.status()) - return + self.stack.append((token, condition)) - previous_token, previous_condition = pop_stack() + elif token == 'else': + previous_token, previous_condition = pop_stack() + self.stack.append((previous_token, negate(previous_condition))) - if token == 'else': - self.stack.append(('else', negate(previous_condition))) elif token == 'endif': - pass + while pop_stack()[0] != 'if': + pass + + else: + return + if self.verbose: print(self.status()) From webhook-mailer at python.org Sat Apr 18 12:11:53 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 18 Apr 2020 16:11:53 -0000 Subject: [Python-checkins] [3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583) Message-ID: https://github.com/python/cpython/commit/bfda4db0d2c05eef4e4ae90d899d0b67cb2e33e5 commit: bfda4db0d2c05eef4e4ae90d899d0b67cb2e33e5 branch: 3.8 author: Serhiy Storchaka committer: GitHub date: 2020-04-18T19:11:48+03:00 summary: [3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583) Co-authored-by: Ammar Askar (cherry picked from commit 12446e6a605f066d837d3a595d0a73e4f3b43b65) files: A Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst M Lib/test/clinic.test M Modules/clinic/posixmodule.c.h M Tools/clinic/cpp.py diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index 0d84d5ef5359a..845b165a9ed3c 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -3260,3 +3260,108 @@ exit: static PyObject * test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab) /*[clinic end generated code: output=f25914b402039493 input=303df5046c7e37a3]*/ + + +/*[clinic input] +output push +output preset buffer +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5bff3376ee0df0b5]*/ + +#ifdef CONDITION_A +/*[clinic input] +test_preprocessor_guarded_condition_a +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_condition_a_impl(PyObject *module) +/*[clinic end generated code: output=ad012af18085add6 input=8edb8706a98cda7e]*/ +#elif CONDITION_B +/*[clinic input] +test_preprocessor_guarded_elif_condition_b +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_elif_condition_b_impl(PyObject *module) +/*[clinic end generated code: output=615f2dee82b138d1 input=53777cebbf7fee32]*/ +#else +/*[clinic input] +test_preprocessor_guarded_else +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_else_impl(PyObject *module) +/*[clinic end generated code: output=13af7670aac51b12 input=6657ab31d74c29fc]*/ +#endif + +/*[clinic input] +dump buffer +output pop +[clinic start generated code]*/ + +#if defined(CONDITION_A) + +PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__, +"test_preprocessor_guarded_condition_a($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF \ + {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, + +static PyObject * +test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_condition_a_impl(module); +} + +#endif /* defined(CONDITION_A) */ + +#if !defined(CONDITION_A) && (CONDITION_B) + +PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__, +"test_preprocessor_guarded_elif_condition_b($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF \ + {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, + +static PyObject * +test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_elif_condition_b_impl(module); +} + +#endif /* !defined(CONDITION_A) && (CONDITION_B) */ + +#if !defined(CONDITION_A) && !(CONDITION_B) + +PyDoc_STRVAR(test_preprocessor_guarded_else__doc__, +"test_preprocessor_guarded_else($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF \ + {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, + +static PyObject * +test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_else_impl(module); +} + +#endif /* !defined(CONDITION_A) && !(CONDITION_B) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF) */ +/*[clinic end generated code: output=3804bb18d454038c input=3fc80c9989d2f2e1]*/ diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst new file mode 100644 index 0000000000000..61bd2e3d94aab --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst @@ -0,0 +1 @@ +Fixed translation of ``#elif`` in Argument Clinic. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index c0d1d4df7957f..09ecdb358e27d 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -3900,7 +3900,7 @@ os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #endif /* defined(HAVE_WAITPID) */ -#if defined(HAVE_CWAIT) +#if !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) PyDoc_STRVAR(os_waitpid__doc__, "waitpid($module, pid, options, /)\n" @@ -3936,7 +3936,7 @@ os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -#endif /* defined(HAVE_CWAIT) */ +#endif /* !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) */ #if defined(HAVE_WAIT) @@ -8723,4 +8723,4 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF #define OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */ -/*[clinic end generated code: output=1ded1fbc8fd37b27 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=edb5a840b51fcaa8 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/cpp.py b/Tools/clinic/cpp.py index e099590a3326c..77f5f9696a6d8 100644 --- a/Tools/clinic/cpp.py +++ b/Tools/clinic/cpp.py @@ -141,23 +141,15 @@ def pop_stack(): token = fields[0].lower() condition = ' '.join(fields[1:]).strip() - if_tokens = {'if', 'ifdef', 'ifndef'} - all_tokens = if_tokens | {'elif', 'else', 'endif'} - - if token not in all_tokens: - return - - # cheat a little here, to reuse the implementation of if - if token == 'elif': - pop_stack() - token = 'if' - - if token in if_tokens: + if token in {'if', 'ifdef', 'ifndef', 'elif'}: if not condition: self.fail("Invalid format for #" + token + " line: no argument!") - if token == 'if': + if token in {'if', 'elif'}: if not self.is_a_simple_defined(condition): condition = "(" + condition + ")" + if token == 'elif': + previous_token, previous_condition = pop_stack() + self.stack.append((previous_token, negate(previous_condition))) else: fields = condition.split() if len(fields) != 1: @@ -166,18 +158,21 @@ def pop_stack(): condition = 'defined(' + symbol + ')' if token == 'ifndef': condition = '!' + condition + token = 'if' - self.stack.append(("if", condition)) - if self.verbose: - print(self.status()) - return + self.stack.append((token, condition)) - previous_token, previous_condition = pop_stack() + elif token == 'else': + previous_token, previous_condition = pop_stack() + self.stack.append((previous_token, negate(previous_condition))) - if token == 'else': - self.stack.append(('else', negate(previous_condition))) elif token == 'endif': - pass + while pop_stack()[0] != 'if': + pass + + else: + return + if self.verbose: print(self.status()) From webhook-mailer at python.org Sat Apr 18 12:12:19 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 18 Apr 2020 16:12:19 -0000 Subject: [Python-checkins] [3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584) Message-ID: https://github.com/python/cpython/commit/67ae454da749a7ca67115b43205d9fe98bea3213 commit: 67ae454da749a7ca67115b43205d9fe98bea3213 branch: 3.7 author: Serhiy Storchaka committer: GitHub date: 2020-04-18T19:12:14+03:00 summary: [3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584) Co-authored-by: Ammar Askar (cherry picked from commit 12446e6a605f066d837d3a595d0a73e4f3b43b65) files: A Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst M Lib/test/clinic.test M Modules/clinic/posixmodule.c.h M Tools/clinic/cpp.py diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index a113b942b0105..75c9947256ff1 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -1203,3 +1203,107 @@ static PyObject * test_Py_buffer_converter_impl(PyObject *module, Py_buffer *a, Py_buffer *b, Py_buffer *c, Py_buffer *d, Py_buffer *e) /*[clinic end generated code: output=92937215f10bc937 input=6a9da0f56f9525fd]*/ + +/*[clinic input] +output push +output preset buffer +[clinic start generated code]*/ +/*[clinic end generated code: output=da39a3ee5e6b4b0d input=5bff3376ee0df0b5]*/ + +#ifdef CONDITION_A +/*[clinic input] +test_preprocessor_guarded_condition_a +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_condition_a_impl(PyObject *module) +/*[clinic end generated code: output=ad012af18085add6 input=8edb8706a98cda7e]*/ +#elif CONDITION_B +/*[clinic input] +test_preprocessor_guarded_elif_condition_b +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_elif_condition_b_impl(PyObject *module) +/*[clinic end generated code: output=615f2dee82b138d1 input=53777cebbf7fee32]*/ +#else +/*[clinic input] +test_preprocessor_guarded_else +[clinic start generated code]*/ + +static PyObject * +test_preprocessor_guarded_else_impl(PyObject *module) +/*[clinic end generated code: output=13af7670aac51b12 input=6657ab31d74c29fc]*/ +#endif + +/*[clinic input] +dump buffer +output pop +[clinic start generated code]*/ + +#if defined(CONDITION_A) + +PyDoc_STRVAR(test_preprocessor_guarded_condition_a__doc__, +"test_preprocessor_guarded_condition_a($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF \ + {"test_preprocessor_guarded_condition_a", (PyCFunction)test_preprocessor_guarded_condition_a, METH_NOARGS, test_preprocessor_guarded_condition_a__doc__}, + +static PyObject * +test_preprocessor_guarded_condition_a(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_condition_a_impl(module); +} + +#endif /* defined(CONDITION_A) */ + +#if !defined(CONDITION_A) && (CONDITION_B) + +PyDoc_STRVAR(test_preprocessor_guarded_elif_condition_b__doc__, +"test_preprocessor_guarded_elif_condition_b($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF \ + {"test_preprocessor_guarded_elif_condition_b", (PyCFunction)test_preprocessor_guarded_elif_condition_b, METH_NOARGS, test_preprocessor_guarded_elif_condition_b__doc__}, + +static PyObject * +test_preprocessor_guarded_elif_condition_b(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_elif_condition_b_impl(module); +} + +#endif /* !defined(CONDITION_A) && (CONDITION_B) */ + +#if !defined(CONDITION_A) && !(CONDITION_B) + +PyDoc_STRVAR(test_preprocessor_guarded_else__doc__, +"test_preprocessor_guarded_else($module, /)\n" +"--\n" +"\n"); + +#define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF \ + {"test_preprocessor_guarded_else", (PyCFunction)test_preprocessor_guarded_else, METH_NOARGS, test_preprocessor_guarded_else__doc__}, + +static PyObject * +test_preprocessor_guarded_else(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + return test_preprocessor_guarded_else_impl(module); +} + +#endif /* !defined(CONDITION_A) && !(CONDITION_B) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_CONDITION_A_METHODDEF) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELIF_CONDITION_B_METHODDEF) */ + +#ifndef TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF + #define TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF +#endif /* !defined(TEST_PREPROCESSOR_GUARDED_ELSE_METHODDEF) */ +/*[clinic end generated code: output=3804bb18d454038c input=3fc80c9989d2f2e1]*/ diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst new file mode 100644 index 0000000000000..61bd2e3d94aab --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst @@ -0,0 +1 @@ +Fixed translation of ``#elif`` in Argument Clinic. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index caa1cacd3f0a9..22eef6893b82a 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -3054,7 +3054,7 @@ os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #endif /* defined(HAVE_WAITPID) */ -#if defined(HAVE_CWAIT) +#if !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) PyDoc_STRVAR(os_waitpid__doc__, "waitpid($module, pid, options, /)\n" @@ -3090,7 +3090,7 @@ os_waitpid(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -#endif /* defined(HAVE_CWAIT) */ +#endif /* !defined(HAVE_WAITPID) && defined(HAVE_CWAIT) */ #if defined(HAVE_WAIT) @@ -6538,4 +6538,4 @@ os_getrandom(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject #ifndef OS_GETRANDOM_METHODDEF #define OS_GETRANDOM_METHODDEF #endif /* !defined(OS_GETRANDOM_METHODDEF) */ -/*[clinic end generated code: output=32c935671ee020d5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f6eff86ac86bfce4 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/cpp.py b/Tools/clinic/cpp.py index e099590a3326c..77f5f9696a6d8 100644 --- a/Tools/clinic/cpp.py +++ b/Tools/clinic/cpp.py @@ -141,23 +141,15 @@ def pop_stack(): token = fields[0].lower() condition = ' '.join(fields[1:]).strip() - if_tokens = {'if', 'ifdef', 'ifndef'} - all_tokens = if_tokens | {'elif', 'else', 'endif'} - - if token not in all_tokens: - return - - # cheat a little here, to reuse the implementation of if - if token == 'elif': - pop_stack() - token = 'if' - - if token in if_tokens: + if token in {'if', 'ifdef', 'ifndef', 'elif'}: if not condition: self.fail("Invalid format for #" + token + " line: no argument!") - if token == 'if': + if token in {'if', 'elif'}: if not self.is_a_simple_defined(condition): condition = "(" + condition + ")" + if token == 'elif': + previous_token, previous_condition = pop_stack() + self.stack.append((previous_token, negate(previous_condition))) else: fields = condition.split() if len(fields) != 1: @@ -166,18 +158,21 @@ def pop_stack(): condition = 'defined(' + symbol + ')' if token == 'ifndef': condition = '!' + condition + token = 'if' - self.stack.append(("if", condition)) - if self.verbose: - print(self.status()) - return + self.stack.append((token, condition)) - previous_token, previous_condition = pop_stack() + elif token == 'else': + previous_token, previous_condition = pop_stack() + self.stack.append((previous_token, negate(previous_condition))) - if token == 'else': - self.stack.append(('else', negate(previous_condition))) elif token == 'endif': - pass + while pop_stack()[0] != 'if': + pass + + else: + return + if self.verbose: print(self.status()) From webhook-mailer at python.org Sat Apr 18 12:14:15 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 18 Apr 2020 16:14:15 -0000 Subject: [Python-checkins] bpo-40178: Convert the remaining os functions to Argument Clinic. (GH-19360) Message-ID: https://github.com/python/cpython/commit/2b5603140c09766a7d4e8243a70d7144f684f6f9 commit: 2b5603140c09766a7d4e8243a70d7144f684f6f9 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-18T19:14:10+03:00 summary: bpo-40178: Convert the remaining os functions to Argument Clinic. (GH-19360) Convert os.getgrouplist(), os.initgroups(), os.sendfile() and os.get_terminal_size(). files: M Doc/library/os.rst M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c diff --git a/Doc/library/os.rst b/Doc/library/os.rst index f27cf3dbeaf0b..943e67625c8ee 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -1266,7 +1266,7 @@ or `the MSDN `_ on Windo .. function:: sendfile(out_fd, in_fd, offset, count) - sendfile(out_fd, in_fd, offset, count, [headers], [trailers], flags=0) + sendfile(out_fd, in_fd, offset, count, headers=(), trailers=(), flags=0) Copy *count* bytes from file descriptor *in_fd* to file descriptor *out_fd* starting at *offset*. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 9465be9a3043d..9a605e4841a00 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -3247,6 +3247,118 @@ os_getpid(PyObject *module, PyObject *Py_UNUSED(ignored)) #endif /* defined(HAVE_GETPID) */ +#if defined(HAVE_GETGROUPLIST) && defined(__APPLE__) + +PyDoc_STRVAR(os_getgrouplist__doc__, +"getgrouplist($module, user, group, /)\n" +"--\n" +"\n" +"Returns a list of groups to which a user belongs.\n" +"\n" +" user\n" +" username to lookup\n" +" group\n" +" base group id of the user"); + +#define OS_GETGROUPLIST_METHODDEF \ + {"getgrouplist", (PyCFunction)(void(*)(void))os_getgrouplist, METH_FASTCALL, os_getgrouplist__doc__}, + +static PyObject * +os_getgrouplist_impl(PyObject *module, const char *user, int basegid); + +static PyObject * +os_getgrouplist(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *user; + int basegid; + + if (!_PyArg_CheckPositional("getgrouplist", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("getgrouplist", "argument 1", "str", args[0]); + goto exit; + } + Py_ssize_t user_length; + user = PyUnicode_AsUTF8AndSize(args[0], &user_length); + if (user == NULL) { + goto exit; + } + if (strlen(user) != (size_t)user_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + basegid = _PyLong_AsInt(args[1]); + if (basegid == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = os_getgrouplist_impl(module, user, basegid); + +exit: + return return_value; +} + +#endif /* defined(HAVE_GETGROUPLIST) && defined(__APPLE__) */ + +#if defined(HAVE_GETGROUPLIST) && !defined(__APPLE__) + +PyDoc_STRVAR(os_getgrouplist__doc__, +"getgrouplist($module, user, group, /)\n" +"--\n" +"\n" +"Returns a list of groups to which a user belongs.\n" +"\n" +" user\n" +" username to lookup\n" +" group\n" +" base group id of the user"); + +#define OS_GETGROUPLIST_METHODDEF \ + {"getgrouplist", (PyCFunction)(void(*)(void))os_getgrouplist, METH_FASTCALL, os_getgrouplist__doc__}, + +static PyObject * +os_getgrouplist_impl(PyObject *module, const char *user, gid_t basegid); + +static PyObject * +os_getgrouplist(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + const char *user; + gid_t basegid; + + if (!_PyArg_CheckPositional("getgrouplist", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_Check(args[0])) { + _PyArg_BadArgument("getgrouplist", "argument 1", "str", args[0]); + goto exit; + } + Py_ssize_t user_length; + user = PyUnicode_AsUTF8AndSize(args[0], &user_length); + if (user == NULL) { + goto exit; + } + if (strlen(user) != (size_t)user_length) { + PyErr_SetString(PyExc_ValueError, "embedded null character"); + goto exit; + } + if (!_Py_Gid_Converter(args[1], &basegid)) { + goto exit; + } + return_value = os_getgrouplist_impl(module, user, basegid); + +exit: + return return_value; +} + +#endif /* defined(HAVE_GETGROUPLIST) && !defined(__APPLE__) */ + #if defined(HAVE_GETGROUPS) PyDoc_STRVAR(os_getgroups__doc__, @@ -3269,6 +3381,102 @@ os_getgroups(PyObject *module, PyObject *Py_UNUSED(ignored)) #endif /* defined(HAVE_GETGROUPS) */ +#if defined(HAVE_INITGROUPS) && defined(__APPLE__) + +PyDoc_STRVAR(os_initgroups__doc__, +"initgroups($module, username, gid, /)\n" +"--\n" +"\n" +"Initialize the group access list.\n" +"\n" +"Call the system initgroups() to initialize the group access list with all of\n" +"the groups of which the specified username is a member, plus the specified\n" +"group id."); + +#define OS_INITGROUPS_METHODDEF \ + {"initgroups", (PyCFunction)(void(*)(void))os_initgroups, METH_FASTCALL, os_initgroups__doc__}, + +static PyObject * +os_initgroups_impl(PyObject *module, PyObject *oname, int gid); + +static PyObject * +os_initgroups(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *oname = NULL; + int gid; + + if (!_PyArg_CheckPositional("initgroups", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_FSConverter(args[0], &oname)) { + goto exit; + } + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + gid = _PyLong_AsInt(args[1]); + if (gid == -1 && PyErr_Occurred()) { + goto exit; + } + return_value = os_initgroups_impl(module, oname, gid); + +exit: + /* Cleanup for oname */ + Py_XDECREF(oname); + + return return_value; +} + +#endif /* defined(HAVE_INITGROUPS) && defined(__APPLE__) */ + +#if defined(HAVE_INITGROUPS) && !defined(__APPLE__) + +PyDoc_STRVAR(os_initgroups__doc__, +"initgroups($module, username, gid, /)\n" +"--\n" +"\n" +"Initialize the group access list.\n" +"\n" +"Call the system initgroups() to initialize the group access list with all of\n" +"the groups of which the specified username is a member, plus the specified\n" +"group id."); + +#define OS_INITGROUPS_METHODDEF \ + {"initgroups", (PyCFunction)(void(*)(void))os_initgroups, METH_FASTCALL, os_initgroups__doc__}, + +static PyObject * +os_initgroups_impl(PyObject *module, PyObject *oname, gid_t gid); + +static PyObject * +os_initgroups(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *oname = NULL; + gid_t gid; + + if (!_PyArg_CheckPositional("initgroups", nargs, 2, 2)) { + goto exit; + } + if (!PyUnicode_FSConverter(args[0], &oname)) { + goto exit; + } + if (!_Py_Gid_Converter(args[1], &gid)) { + goto exit; + } + return_value = os_initgroups_impl(module, oname, gid); + +exit: + /* Cleanup for oname */ + Py_XDECREF(oname); + + return return_value; +} + +#endif /* defined(HAVE_INITGROUPS) && !defined(__APPLE__) */ + #if defined(HAVE_GETPGID) PyDoc_STRVAR(os_getpgid__doc__, @@ -5021,6 +5229,283 @@ os_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } +#if defined(HAVE_SENDFILE) && defined(__APPLE__) + +PyDoc_STRVAR(os_sendfile__doc__, +"sendfile($module, /, out_fd, in_fd, offset, count, headers=(),\n" +" trailers=(), flags=0)\n" +"--\n" +"\n" +"Copy count bytes from file descriptor in_fd to file descriptor out_fd."); + +#define OS_SENDFILE_METHODDEF \ + {"sendfile", (PyCFunction)(void(*)(void))os_sendfile, METH_FASTCALL|METH_KEYWORDS, os_sendfile__doc__}, + +static PyObject * +os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset, + Py_off_t sbytes, PyObject *headers, PyObject *trailers, + int flags); + +static PyObject * +os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "sendfile", 0}; + PyObject *argsbuf[7]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 4; + int out_fd; + int in_fd; + Py_off_t offset; + Py_off_t sbytes; + PyObject *headers = NULL; + PyObject *trailers = NULL; + int flags = 0; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 7, 0, argsbuf); + if (!args) { + goto exit; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + out_fd = _PyLong_AsInt(args[0]); + if (out_fd == -1 && PyErr_Occurred()) { + goto exit; + } + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + in_fd = _PyLong_AsInt(args[1]); + if (in_fd == -1 && PyErr_Occurred()) { + goto exit; + } + if (!Py_off_t_converter(args[2], &offset)) { + goto exit; + } + if (!Py_off_t_converter(args[3], &sbytes)) { + goto exit; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[4]) { + headers = args[4]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (args[5]) { + trailers = args[5]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (PyFloat_Check(args[6])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + flags = _PyLong_AsInt(args[6]); + if (flags == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional_pos: + return_value = os_sendfile_impl(module, out_fd, in_fd, offset, sbytes, headers, trailers, flags); + +exit: + return return_value; +} + +#endif /* defined(HAVE_SENDFILE) && defined(__APPLE__) */ + +#if defined(HAVE_SENDFILE) && !defined(__APPLE__) && (defined(__FreeBSD__) || defined(__DragonFly__)) + +PyDoc_STRVAR(os_sendfile__doc__, +"sendfile($module, /, out_fd, in_fd, offset, count, headers=(),\n" +" trailers=(), flags=0)\n" +"--\n" +"\n" +"Copy count bytes from file descriptor in_fd to file descriptor out_fd."); + +#define OS_SENDFILE_METHODDEF \ + {"sendfile", (PyCFunction)(void(*)(void))os_sendfile, METH_FASTCALL|METH_KEYWORDS, os_sendfile__doc__}, + +static PyObject * +os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset, + Py_ssize_t count, PyObject *headers, PyObject *trailers, + int flags); + +static PyObject * +os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", "headers", "trailers", "flags", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "sendfile", 0}; + PyObject *argsbuf[7]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 4; + int out_fd; + int in_fd; + Py_off_t offset; + Py_ssize_t count; + PyObject *headers = NULL; + PyObject *trailers = NULL; + int flags = 0; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 7, 0, argsbuf); + if (!args) { + goto exit; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + out_fd = _PyLong_AsInt(args[0]); + if (out_fd == -1 && PyErr_Occurred()) { + goto exit; + } + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + in_fd = _PyLong_AsInt(args[1]); + if (in_fd == -1 && PyErr_Occurred()) { + goto exit; + } + if (!Py_off_t_converter(args[2], &offset)) { + goto exit; + } + if (PyFloat_Check(args[3])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + { + Py_ssize_t ival = -1; + PyObject *iobj = PyNumber_Index(args[3]); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + goto exit; + } + count = ival; + } + if (!noptargs) { + goto skip_optional_pos; + } + if (args[4]) { + headers = args[4]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (args[5]) { + trailers = args[5]; + if (!--noptargs) { + goto skip_optional_pos; + } + } + if (PyFloat_Check(args[6])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + flags = _PyLong_AsInt(args[6]); + if (flags == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional_pos: + return_value = os_sendfile_impl(module, out_fd, in_fd, offset, count, headers, trailers, flags); + +exit: + return return_value; +} + +#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && (defined(__FreeBSD__) || defined(__DragonFly__)) */ + +#if defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) + +PyDoc_STRVAR(os_sendfile__doc__, +"sendfile($module, /, out_fd, in_fd, offset, count)\n" +"--\n" +"\n" +"Copy count bytes from file descriptor in_fd to file descriptor out_fd."); + +#define OS_SENDFILE_METHODDEF \ + {"sendfile", (PyCFunction)(void(*)(void))os_sendfile, METH_FASTCALL|METH_KEYWORDS, os_sendfile__doc__}, + +static PyObject * +os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj, + Py_ssize_t count); + +static PyObject * +os_sendfile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"out_fd", "in_fd", "offset", "count", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "sendfile", 0}; + PyObject *argsbuf[4]; + int out_fd; + int in_fd; + PyObject *offobj; + Py_ssize_t count; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 4, 4, 0, argsbuf); + if (!args) { + goto exit; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + out_fd = _PyLong_AsInt(args[0]); + if (out_fd == -1 && PyErr_Occurred()) { + goto exit; + } + if (PyFloat_Check(args[1])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + in_fd = _PyLong_AsInt(args[1]); + if (in_fd == -1 && PyErr_Occurred()) { + goto exit; + } + offobj = args[2]; + if (PyFloat_Check(args[3])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + { + Py_ssize_t ival = -1; + PyObject *iobj = PyNumber_Index(args[3]); + if (iobj != NULL) { + ival = PyLong_AsSsize_t(iobj); + Py_DECREF(iobj); + } + if (ival == -1 && PyErr_Occurred()) { + goto exit; + } + count = ival; + } + return_value = os_sendfile_impl(module, out_fd, in_fd, offobj, count); + +exit: + return return_value; +} + +#endif /* defined(HAVE_SENDFILE) && !defined(__APPLE__) && !(defined(__FreeBSD__) || defined(__DragonFly__)) */ + #if defined(__APPLE__) PyDoc_STRVAR(os__fcopyfile__doc__, @@ -7568,6 +8053,62 @@ os_memfd_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj #endif /* defined(HAVE_MEMFD_CREATE) */ +#if (defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL)) + +PyDoc_STRVAR(os_get_terminal_size__doc__, +"get_terminal_size($module, fd=, /)\n" +"--\n" +"\n" +"Return the size of the terminal window as (columns, lines).\n" +"\n" +"The optional argument fd (default standard output) specifies\n" +"which file descriptor should be queried.\n" +"\n" +"If the file descriptor is not connected to a terminal, an OSError\n" +"is thrown.\n" +"\n" +"This function will only be defined if an implementation is\n" +"available for this system.\n" +"\n" +"shutil.get_terminal_size is the high-level function which should\n" +"normally be used, os.get_terminal_size is the low-level implementation."); + +#define OS_GET_TERMINAL_SIZE_METHODDEF \ + {"get_terminal_size", (PyCFunction)(void(*)(void))os_get_terminal_size, METH_FASTCALL, os_get_terminal_size__doc__}, + +static PyObject * +os_get_terminal_size_impl(PyObject *module, int fd); + +static PyObject * +os_get_terminal_size(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + int fd = fileno(stdout); + + if (!_PyArg_CheckPositional("get_terminal_size", nargs, 0, 1)) { + goto exit; + } + if (nargs < 1) { + goto skip_optional; + } + if (PyFloat_Check(args[0])) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + goto exit; + } + fd = _PyLong_AsInt(args[0]); + if (fd == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional: + return_value = os_get_terminal_size_impl(module, fd); + +exit: + return return_value; +} + +#endif /* (defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL)) */ + PyDoc_STRVAR(os_cpu_count__doc__, "cpu_count($module, /)\n" "--\n" @@ -8522,10 +9063,18 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #define OS_GETPID_METHODDEF #endif /* !defined(OS_GETPID_METHODDEF) */ +#ifndef OS_GETGROUPLIST_METHODDEF + #define OS_GETGROUPLIST_METHODDEF +#endif /* !defined(OS_GETGROUPLIST_METHODDEF) */ + #ifndef OS_GETGROUPS_METHODDEF #define OS_GETGROUPS_METHODDEF #endif /* !defined(OS_GETGROUPS_METHODDEF) */ +#ifndef OS_INITGROUPS_METHODDEF + #define OS_INITGROUPS_METHODDEF +#endif /* !defined(OS_INITGROUPS_METHODDEF) */ + #ifndef OS_GETPGID_METHODDEF #define OS_GETPGID_METHODDEF #endif /* !defined(OS_GETPGID_METHODDEF) */ @@ -8662,6 +9211,10 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #define OS_PREADV_METHODDEF #endif /* !defined(OS_PREADV_METHODDEF) */ +#ifndef OS_SENDFILE_METHODDEF + #define OS_SENDFILE_METHODDEF +#endif /* !defined(OS_SENDFILE_METHODDEF) */ + #ifndef OS__FCOPYFILE_METHODDEF #define OS__FCOPYFILE_METHODDEF #endif /* !defined(OS__FCOPYFILE_METHODDEF) */ @@ -8838,6 +9391,10 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na #define OS_MEMFD_CREATE_METHODDEF #endif /* !defined(OS_MEMFD_CREATE_METHODDEF) */ +#ifndef OS_GET_TERMINAL_SIZE_METHODDEF + #define OS_GET_TERMINAL_SIZE_METHODDEF +#endif /* !defined(OS_GET_TERMINAL_SIZE_METHODDEF) */ + #ifndef OS_GET_HANDLE_INHERITABLE_METHODDEF #define OS_GET_HANDLE_INHERITABLE_METHODDEF #endif /* !defined(OS_GET_HANDLE_INHERITABLE_METHODDEF) */ @@ -8869,4 +9426,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=ca63e471c11dc6e7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=545c08f76d7a6286 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4085b922a7c7c..2157cbbe5d9b5 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6947,23 +6947,46 @@ os_getpid_impl(PyObject *module) #ifdef HAVE_GETGROUPLIST -/* AC 3.5: funny apple logic below */ -PyDoc_STRVAR(posix_getgrouplist__doc__, -"getgrouplist(user, group) -> list of groups to which a user belongs\n\n\ -Returns a list of groups to which a user belongs.\n\n\ - user: username to lookup\n\ - group: base group id of the user"); +#ifdef __APPLE__ +/*[clinic input] +os.getgrouplist + + user: str + username to lookup + group as basegid: int + base group id of the user + / + +Returns a list of groups to which a user belongs. +[clinic start generated code]*/ static PyObject * -posix_getgrouplist(PyObject *self, PyObject *args) +os_getgrouplist_impl(PyObject *module, const char *user, int basegid) +/*[clinic end generated code: output=6e734697b8c26de0 input=f8d870374b09a490]*/ +#else +/*[clinic input] +os.getgrouplist + + user: str + username to lookup + group as basegid: gid_t + base group id of the user + / + +Returns a list of groups to which a user belongs. +[clinic start generated code]*/ + +static PyObject * +os_getgrouplist_impl(PyObject *module, const char *user, gid_t basegid) +/*[clinic end generated code: output=0ebd7fb70115575b input=cc61d5c20b08958d]*/ +#endif { - const char *user; int i, ngroups; PyObject *list; #ifdef __APPLE__ - int *groups, basegid; + int *groups; #else - gid_t *groups, basegid; + gid_t *groups; #endif /* @@ -6976,15 +6999,6 @@ posix_getgrouplist(PyObject *self, PyObject *args) */ ngroups = 1 + MAX_GROUPS; -#ifdef __APPLE__ - if (!PyArg_ParseTuple(args, "si:getgrouplist", &user, &basegid)) - return NULL; -#else - if (!PyArg_ParseTuple(args, "sO&:getgrouplist", &user, - _Py_Gid_Converter, &basegid)) - return NULL; -#endif - while (1) { #ifdef __APPLE__ groups = PyMem_New(int, ngroups); @@ -7155,40 +7169,47 @@ os_getgroups_impl(PyObject *module) #endif /* HAVE_GETGROUPS */ #ifdef HAVE_INITGROUPS -PyDoc_STRVAR(posix_initgroups__doc__, -"initgroups(username, gid) -> None\n\n\ -Call the system initgroups() to initialize the group access list with all of\n\ -the groups of which the specified username is a member, plus the specified\n\ -group id."); +#ifdef __APPLE__ +/*[clinic input] +os.initgroups + + username as oname: FSConverter + gid: int + / + +Initialize the group access list. + +Call the system initgroups() to initialize the group access list with all of +the groups of which the specified username is a member, plus the specified +group id. +[clinic start generated code]*/ -/* AC 3.5: funny apple logic */ static PyObject * -posix_initgroups(PyObject *self, PyObject *args) -{ - PyObject *oname; - const char *username; - int res; -#ifdef __APPLE__ - int gid; +os_initgroups_impl(PyObject *module, PyObject *oname, int gid) +/*[clinic end generated code: output=7f074d30a425fd3a input=df3d54331b0af204]*/ #else - gid_t gid; -#endif +/*[clinic input] +os.initgroups -#ifdef __APPLE__ - if (!PyArg_ParseTuple(args, "O&i:initgroups", - PyUnicode_FSConverter, &oname, - &gid)) -#else - if (!PyArg_ParseTuple(args, "O&O&:initgroups", - PyUnicode_FSConverter, &oname, - _Py_Gid_Converter, &gid)) + username as oname: FSConverter + gid: gid_t + / + +Initialize the group access list. + +Call the system initgroups() to initialize the group access list with all of +the groups of which the specified username is a member, plus the specified +group id. +[clinic start generated code]*/ + +static PyObject * +os_initgroups_impl(PyObject *module, PyObject *oname, gid_t gid) +/*[clinic end generated code: output=59341244521a9e3f input=0cb91bdc59a4c564]*/ #endif - return NULL; - username = PyBytes_AS_STRING(oname); +{ + const char *username = PyBytes_AS_STRING(oname); - res = initgroups(username, gid); - Py_DECREF(oname); - if (res == -1) + if (initgroups(username, gid) == -1) return PyErr_SetFromErrno(PyExc_OSError); Py_RETURN_NONE; @@ -9220,46 +9241,77 @@ os_write_impl(PyObject *module, int fd, Py_buffer *data) } #ifdef HAVE_SENDFILE -PyDoc_STRVAR(posix_sendfile__doc__, -"sendfile(out_fd, in_fd, offset, count) -> byteswritten\n\ -sendfile(out_fd, in_fd, offset, count[, headers][, trailers], flags=0)\n\ - -> byteswritten\n\ -Copy count bytes from file descriptor in_fd to file descriptor out_fd."); +#ifdef __APPLE__ +/*[clinic input] +os.sendfile + + out_fd: int + in_fd: int + offset: Py_off_t + count as sbytes: Py_off_t + headers: object(c_default="NULL") = () + trailers: object(c_default="NULL") = () + flags: int = 0 + +Copy count bytes from file descriptor in_fd to file descriptor out_fd. +[clinic start generated code]*/ -/* AC 3.5: don't bother converting, has optional group*/ static PyObject * -posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) +os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset, + Py_off_t sbytes, PyObject *headers, PyObject *trailers, + int flags) +/*[clinic end generated code: output=81c4bcd143f5c82b input=b0d72579d4c69afa]*/ +#elif defined(__FreeBSD__) || defined(__DragonFly__) +/*[clinic input] +os.sendfile + + out_fd: int + in_fd: int + offset: Py_off_t + count: Py_ssize_t + headers: object(c_default="NULL") = () + trailers: object(c_default="NULL") = () + flags: int = 0 + +Copy count bytes from file descriptor in_fd to file descriptor out_fd. +[clinic start generated code]*/ + +static PyObject * +os_sendfile_impl(PyObject *module, int out_fd, int in_fd, Py_off_t offset, + Py_ssize_t count, PyObject *headers, PyObject *trailers, + int flags) +/*[clinic end generated code: output=329ea009bdd55afc input=338adb8ff84ae8cd]*/ +#else +/*[clinic input] +os.sendfile + + out_fd: int + in_fd: int + offset as offobj: object + count: Py_ssize_t + +Copy count bytes from file descriptor in_fd to file descriptor out_fd. +[clinic start generated code]*/ + +static PyObject * +os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj, + Py_ssize_t count) +/*[clinic end generated code: output=ae81216e40f167d8 input=76d64058c74477ba]*/ +#endif { - int in, out; Py_ssize_t ret; int async_err = 0; - off_t offset; #if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__APPLE__) #ifndef __APPLE__ - Py_ssize_t len; + off_t sbytes; #endif - PyObject *headers = NULL, *trailers = NULL; Py_buffer *hbuf, *tbuf; - off_t sbytes; struct sf_hdtr sf; - int flags = 0; - static char *keywords[] = {"out_fd", "in_fd", - "offset", "count", - "headers", "trailers", "flags", NULL}; sf.headers = NULL; sf.trailers = NULL; -#ifdef __APPLE__ - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iiO&O&|OOi:sendfile", - keywords, &out, &in, Py_off_t_converter, &offset, Py_off_t_converter, &sbytes, -#else - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iiO&n|OOi:sendfile", - keywords, &out, &in, Py_off_t_converter, &offset, &len, -#endif - &headers, &trailers, &flags)) - return NULL; if (headers != NULL) { if (!PySequence_Check(headers)) { PyErr_SetString(PyExc_TypeError, @@ -9321,9 +9373,9 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) do { Py_BEGIN_ALLOW_THREADS #ifdef __APPLE__ - ret = sendfile(in, out, offset, &sbytes, &sf, flags); + ret = sendfile(in_fd, out_fd, offset, &sbytes, &sf, flags); #else - ret = sendfile(in, out, offset, len, &sf, &sbytes, flags); + ret = sendfile(in_fd, out_fd, offset, count, &sf, &sbytes, flags); #endif Py_END_ALLOW_THREADS } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); @@ -9358,18 +9410,11 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) #endif #else - Py_ssize_t count; - PyObject *offobj; - static char *keywords[] = {"out_fd", "in_fd", - "offset", "count", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iiOn:sendfile", - keywords, &out, &in, &offobj, &count)) - return NULL; #ifdef __linux__ if (offobj == Py_None) { do { Py_BEGIN_ALLOW_THREADS - ret = sendfile(out, in, NULL, count); + ret = sendfile(out_fd, in_fd, NULL, count); Py_END_ALLOW_THREADS } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) @@ -9377,12 +9422,13 @@ posix_sendfile(PyObject *self, PyObject *args, PyObject *kwdict) return Py_BuildValue("n", ret); } #endif + off_t offset; if (!Py_off_t_converter(offobj, &offset)) return NULL; do { Py_BEGIN_ALLOW_THREADS - ret = sendfile(out, in, &offset, count); + ret = sendfile(out_fd, in_fd, &offset, count); Py_END_ALLOW_THREADS } while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); if (ret < 0) @@ -12360,29 +12406,34 @@ static PyStructSequence_Desc TerminalSize_desc = { }; #if defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL) -/* AC 3.5: fd should accept None */ -PyDoc_STRVAR(termsize__doc__, - "Return the size of the terminal window as (columns, lines).\n" \ - "\n" \ - "The optional argument fd (default standard output) specifies\n" \ - "which file descriptor should be queried.\n" \ - "\n" \ - "If the file descriptor is not connected to a terminal, an OSError\n" \ - "is thrown.\n" \ - "\n" \ - "This function will only be defined if an implementation is\n" \ - "available for this system.\n" \ - "\n" \ - "shutil.get_terminal_size is the high-level function which should\n" \ - "normally be used, os.get_terminal_size is the low-level implementation."); +/*[clinic input] +os.get_terminal_size -static PyObject* -get_terminal_size(PyObject *self, PyObject *args) + fd: int(c_default="fileno(stdout)", py_default="") = -1 + / + +Return the size of the terminal window as (columns, lines). + +The optional argument fd (default standard output) specifies +which file descriptor should be queried. + +If the file descriptor is not connected to a terminal, an OSError +is thrown. + +This function will only be defined if an implementation is +available for this system. + +shutil.get_terminal_size is the high-level function which should +normally be used, os.get_terminal_size is the low-level implementation. +[clinic start generated code]*/ + +static PyObject * +os_get_terminal_size_impl(PyObject *module, int fd) +/*[clinic end generated code: output=fbab93acef980508 input=ead5679b82ddb920]*/ { int columns, lines; PyObject *termsize; - int fd = fileno(stdout); /* Under some conditions stdout may not be connected and * fileno(stdout) may point to an invalid file descriptor. For example * GUI apps don't have valid standard streams by default. @@ -12391,9 +12442,6 @@ get_terminal_size(PyObject *self, PyObject *args) * the ioctl below will fail returning EBADF. This is what we want. */ - if (!PyArg_ParseTuple(args, "|i", &fd)) - return NULL; - #ifdef TERMSIZE_USE_IOCTL { struct winsize w; @@ -12433,7 +12481,7 @@ get_terminal_size(PyObject *self, PyObject *args) } #endif /* TERMSIZE_USE_CONIO */ - PyObject *TerminalSizeType = get_posix_state(self)->TerminalSizeType; + PyObject *TerminalSizeType = get_posix_state(module)->TerminalSizeType; termsize = PyStructSequence_New((PyTypeObject *)TerminalSizeType); if (termsize == NULL) return NULL; @@ -13912,9 +13960,7 @@ static PyMethodDef posix_methods[] = { OS_GETEGID_METHODDEF OS_GETEUID_METHODDEF OS_GETGID_METHODDEF -#ifdef HAVE_GETGROUPLIST - {"getgrouplist", posix_getgrouplist, METH_VARARGS, posix_getgrouplist__doc__}, -#endif + OS_GETGROUPLIST_METHODDEF OS_GETGROUPS_METHODDEF OS_GETPID_METHODDEF OS_GETPGRP_METHODDEF @@ -13924,9 +13970,7 @@ static PyMethodDef posix_methods[] = { OS_KILL_METHODDEF OS_KILLPG_METHODDEF OS_PLOCK_METHODDEF -#ifdef MS_WINDOWS OS_STARTFILE_METHODDEF -#endif OS_SETUID_METHODDEF OS_SETEUID_METHODDEF OS_SETREUID_METHODDEF @@ -13934,9 +13978,7 @@ static PyMethodDef posix_methods[] = { OS_SETEGID_METHODDEF OS_SETREGID_METHODDEF OS_SETGROUPS_METHODDEF -#ifdef HAVE_INITGROUPS - {"initgroups", posix_initgroups, METH_VARARGS, posix_initgroups__doc__}, -#endif /* HAVE_INITGROUPS */ + OS_INITGROUPS_METHODDEF OS_GETPGID_METHODDEF OS_SETPGRP_METHODDEF OS_WAIT_METHODDEF @@ -13966,10 +14008,7 @@ static PyMethodDef posix_methods[] = { OS_WRITEV_METHODDEF OS_PWRITE_METHODDEF OS_PWRITEV_METHODDEF -#ifdef HAVE_SENDFILE - {"sendfile", (PyCFunction)(void(*)(void))posix_sendfile, METH_VARARGS | METH_KEYWORDS, - posix_sendfile__doc__}, -#endif + OS_SENDFILE_METHODDEF OS_FSTAT_METHODDEF OS_ISATTY_METHODDEF OS_PIPE_METHODDEF @@ -14021,26 +14060,20 @@ static PyMethodDef posix_methods[] = { OS_REMOVEXATTR_METHODDEF OS_LISTXATTR_METHODDEF -#if defined(TERMSIZE_USE_CONIO) || defined(TERMSIZE_USE_IOCTL) - {"get_terminal_size", get_terminal_size, METH_VARARGS, termsize__doc__}, -#endif + OS_GET_TERMINAL_SIZE_METHODDEF OS_CPU_COUNT_METHODDEF OS_GET_INHERITABLE_METHODDEF OS_SET_INHERITABLE_METHODDEF OS_GET_HANDLE_INHERITABLE_METHODDEF OS_SET_HANDLE_INHERITABLE_METHODDEF -#ifndef MS_WINDOWS OS_GET_BLOCKING_METHODDEF OS_SET_BLOCKING_METHODDEF -#endif OS_SCANDIR_METHODDEF OS_FSPATH_METHODDEF OS_GETRANDOM_METHODDEF OS_MEMFD_CREATE_METHODDEF -#ifdef MS_WINDOWS OS__ADD_DLL_DIRECTORY_METHODDEF OS__REMOVE_DLL_DIRECTORY_METHODDEF -#endif OS_WAITSTATUS_TO_EXITCODE_METHODDEF {NULL, NULL} /* Sentinel */ }; From webhook-mailer at python.org Sat Apr 18 12:19:40 2020 From: webhook-mailer at python.org (Karthikeyan Singaravelan) Date: Sat, 18 Apr 2020 16:19:40 -0000 Subject: [Python-checkins] bpo-35113: Fix inspect.getsource to return correct source for inner classes (#10307) Message-ID: https://github.com/python/cpython/commit/696136b993e11b37c4f34d729a0375e5ad544ade commit: 696136b993e11b37c4f34d729a0375e5ad544ade branch: master author: Karthikeyan Singaravelan committer: GitHub date: 2020-04-18T21:49:32+05:30 summary: bpo-35113: Fix inspect.getsource to return correct source for inner classes (#10307) * Use ast module to find class definition * Add NEWS entry * Fix class with multiple children and move decorator code to the method * Fix PR comments 1. Use node.decorator_list to select decorators 2. Remove unwanted variables in ClassVisitor 3. Simplify stack management as per review * Add test for nested functions and async calls * Fix pydoc test since comments are returned now correctly * Set event loop policy as None to fix environment related change * Refactor visit_AsyncFunctionDef and tests * Refactor to use local variables and fix tests * Add patch attribution * Use self.addCleanup for asyncio * Rename ClassVisitor to ClassFinder and fix asyncio cleanup * Return first class inside conditional in case of multiple definitions. Remove decorator for class source. * Add docstring to make the test correct * Modify NEWS entry regarding decorators * Return decorators too for bpo-15856 * Move ast and the class source code to top. Use proper Exception. files: A Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst M Lib/inspect.py M Lib/test/inspect_fodder2.py M Lib/test/test_inspect.py M Lib/test/test_pydoc.py diff --git a/Lib/inspect.py b/Lib/inspect.py index 6f7d5cd19ce4c..ad7e8cb1203e7 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -32,6 +32,7 @@ 'Yury Selivanov ') import abc +import ast import dis import collections.abc import enum @@ -770,6 +771,42 @@ def getmodule(object, _filename=None): if builtinobject is object: return builtin + +class ClassFoundException(Exception): + pass + + +class _ClassFinder(ast.NodeVisitor): + + def __init__(self, qualname): + self.stack = [] + self.qualname = qualname + + def visit_FunctionDef(self, node): + self.stack.append(node.name) + self.stack.append('') + self.generic_visit(node) + self.stack.pop() + self.stack.pop() + + visit_AsyncFunctionDef = visit_FunctionDef + + def visit_ClassDef(self, node): + self.stack.append(node.name) + if self.qualname == '.'.join(self.stack): + # Return the decorator for the class if present + if node.decorator_list: + line_number = node.decorator_list[0].lineno + else: + line_number = node.lineno + + # decrement by one since lines starts with indexing by zero + line_number -= 1 + raise ClassFoundException(line_number) + self.generic_visit(node) + self.stack.pop() + + def findsource(object): """Return the entire source file and starting line number for an object. @@ -802,25 +839,15 @@ def findsource(object): return lines, 0 if isclass(object): - name = object.__name__ - pat = re.compile(r'^(\s*)class\s*' + name + r'\b') - # make some effort to find the best matching class definition: - # use the one with the least indentation, which is the one - # that's most probably not inside a function definition. - candidates = [] - for i in range(len(lines)): - match = pat.match(lines[i]) - if match: - # if it's at toplevel, it's already the best one - if lines[i][0] == 'c': - return lines, i - # else add whitespace to candidate list - candidates.append((match.group(1), i)) - if candidates: - # this will sort by whitespace, and by line number, - # less whitespace first - candidates.sort() - return lines, candidates[0][1] + qualname = object.__qualname__ + source = ''.join(lines) + tree = ast.parse(source) + class_finder = _ClassFinder(qualname) + try: + class_finder.visit(tree) + except ClassFoundException as e: + line_number = e.args[0] + return lines, line_number else: raise OSError('could not find class definition') diff --git a/Lib/test/inspect_fodder2.py b/Lib/test/inspect_fodder2.py index 5a7b559d07d76..e7d4b53ebefcc 100644 --- a/Lib/test/inspect_fodder2.py +++ b/Lib/test/inspect_fodder2.py @@ -138,18 +138,124 @@ def func137(): never_reached1 never_reached2 -#line 141 +# line 141 +class cls142: + a = """ +class cls149: + ... +""" + +# line 148 +class cls149: + + def func151(self): + pass + +''' +class cls160: + pass +''' + +# line 159 +class cls160: + + def func162(self): + pass + +# line 165 +class cls166: + a = ''' + class cls175: + ... + ''' + +# line 172 +class cls173: + + class cls175: + pass + +# line 178 +class cls179: + pass + +# line 182 +class cls183: + + class cls185: + + def func186(self): + pass + +def class_decorator(cls): + return cls + +# line 193 + at class_decorator + at class_decorator +class cls196: + + @class_decorator + @class_decorator + class cls200: + pass + +class cls203: + class cls204: + class cls205: + pass + class cls207: + class cls205: + pass + +# line 211 +def func212(): + class cls213: + pass + return cls213 + +# line 217 +class cls213: + def func219(self): + class cls220: + pass + return cls220 + +# line 224 +async def func225(): + class cls226: + pass + return cls226 + +# line 230 +class cls226: + async def func232(self): + class cls233: + pass + return cls233 + +if True: + class cls238: + class cls239: + '''if clause cls239''' +else: + class cls238: + class cls239: + '''else clause 239''' + pass + +#line 247 def positional_only_arg(a, /): pass -#line 145 +#line 251 def all_markers(a, b, /, c, d, *, e, f): pass -# line 149 +# line 255 def all_markers_with_args_and_kwargs(a, b, /, c, d, *args, e, f, **kwargs): pass -#line 153 +#line 259 def all_markers_with_defaults(a, b=1, /, c=2, d=3, *, e=4, f=5): pass diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 2dc8454595e17..98a9c0a662a09 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -473,6 +473,7 @@ def test_cleandoc(self): def test_getcomments(self): self.assertEqual(inspect.getcomments(mod), '# line 1\n') self.assertEqual(inspect.getcomments(mod.StupidGit), '# line 20\n') + self.assertEqual(inspect.getcomments(mod2.cls160), '# line 159\n') # If the object source file is not available, return None. co = compile('x=1', '_non_existing_filename.py', 'exec') self.assertIsNone(inspect.getcomments(co)) @@ -709,6 +710,45 @@ def test_getsource_on_method(self): def test_nested_func(self): self.assertSourceEqual(mod2.cls135.func136, 136, 139) + def test_class_definition_in_multiline_string_definition(self): + self.assertSourceEqual(mod2.cls149, 149, 152) + + def test_class_definition_in_multiline_comment(self): + self.assertSourceEqual(mod2.cls160, 160, 163) + + def test_nested_class_definition_indented_string(self): + self.assertSourceEqual(mod2.cls173.cls175, 175, 176) + + def test_nested_class_definition(self): + self.assertSourceEqual(mod2.cls183, 183, 188) + self.assertSourceEqual(mod2.cls183.cls185, 185, 188) + + def test_class_decorator(self): + self.assertSourceEqual(mod2.cls196, 194, 201) + self.assertSourceEqual(mod2.cls196.cls200, 198, 201) + + def test_class_inside_conditional(self): + self.assertSourceEqual(mod2.cls238, 238, 240) + self.assertSourceEqual(mod2.cls238.cls239, 239, 240) + + def test_multiple_children_classes(self): + self.assertSourceEqual(mod2.cls203, 203, 209) + self.assertSourceEqual(mod2.cls203.cls204, 204, 206) + self.assertSourceEqual(mod2.cls203.cls204.cls205, 205, 206) + self.assertSourceEqual(mod2.cls203.cls207, 207, 209) + self.assertSourceEqual(mod2.cls203.cls207.cls205, 208, 209) + + def test_nested_class_definition_inside_function(self): + self.assertSourceEqual(mod2.func212(), 213, 214) + self.assertSourceEqual(mod2.cls213, 218, 222) + self.assertSourceEqual(mod2.cls213().func219(), 220, 221) + + def test_nested_class_definition_inside_async_function(self): + import asyncio + self.addCleanup(asyncio.set_event_loop_policy, None) + self.assertSourceEqual(asyncio.run(mod2.func225()), 226, 227) + self.assertSourceEqual(mod2.cls226, 231, 235) + self.assertSourceEqual(asyncio.run(mod2.cls226().func232()), 233, 234) class TestNoEOL(GetSourceBase): def setUp(self): diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 6d358f4fe2fc3..ffabb7f1b9407 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -476,6 +476,7 @@ def test_getpager_with_stdin_none(self): def test_non_str_name(self): # issue14638 # Treat illegal (non-str) name like no name + class A: __name__ = 42 class B: diff --git a/Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst b/Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst new file mode 100644 index 0000000000000..bf6b672964fa6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst @@ -0,0 +1,3 @@ +:meth:`inspect.getsource` now returns correct source code for inner class +with same name as module level class. Decorators are also returned as part +of source of the class. Patch by Karthikeyan Singaravelan. From webhook-mailer at python.org Sat Apr 18 14:14:45 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 18 Apr 2020 18:14:45 -0000 Subject: [Python-checkins] bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269) Message-ID: https://github.com/python/cpython/commit/0abb548cc7b239fbe426ca9e00968130e53ffc98 commit: 0abb548cc7b239fbe426ca9e00968130e53ffc98 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-18T11:14:41-07:00 summary: bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269) Automerge-Triggered-By: @pitrou (cherry picked from commit 482259d0dcf27714a84cf56b93977320bea7e093) Co-authored-by: Furkan ?nder files: A Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst M Doc/library/pickle.rst diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index f741976c93064..d638944756e7a 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -562,9 +562,9 @@ the methods :meth:`__getstate__` and :meth:`__setstate__`. At unpickling time, some methods like :meth:`__getattr__`, :meth:`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. In case those methods rely on some internal invariant being - true, the type should implement :meth:`__getnewargs__` or - :meth:`__getnewargs_ex__` to establish such an invariant; otherwise, - neither :meth:`__new__` nor :meth:`__init__` will be called. + true, the type should implement :meth:`__new__` to establish such an + invariant, as :meth:`__init__` is not called when unpickling an + instance. .. index:: pair: copy; protocol diff --git a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst new file mode 100644 index 0000000000000..24f640bd4ef5f --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst @@ -0,0 +1,2 @@ +The pickle documentation incorrectly claimed that ``__new__`` isn't called by +default when unpickling. From webhook-mailer at python.org Sat Apr 18 14:14:59 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 18 Apr 2020 18:14:59 -0000 Subject: [Python-checkins] bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269) Message-ID: https://github.com/python/cpython/commit/020f2aaaea95aef6f54ab31488926ed76017e41a commit: 020f2aaaea95aef6f54ab31488926ed76017e41a branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-18T11:14:55-07:00 summary: bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269) Automerge-Triggered-By: @pitrou (cherry picked from commit 482259d0dcf27714a84cf56b93977320bea7e093) Co-authored-by: Furkan ?nder files: A Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst M Doc/library/pickle.rst diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index 779b60ed4da00..a7b92bb9538d9 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -639,9 +639,9 @@ the methods :meth:`__getstate__` and :meth:`__setstate__`. At unpickling time, some methods like :meth:`__getattr__`, :meth:`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. In case those methods rely on some internal invariant being - true, the type should implement :meth:`__getnewargs__` or - :meth:`__getnewargs_ex__` to establish such an invariant; otherwise, - neither :meth:`__new__` nor :meth:`__init__` will be called. + true, the type should implement :meth:`__new__` to establish such an + invariant, as :meth:`__init__` is not called when unpickling an + instance. .. index:: pair: copy; protocol diff --git a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst new file mode 100644 index 0000000000000..24f640bd4ef5f --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst @@ -0,0 +1,2 @@ +The pickle documentation incorrectly claimed that ``__new__`` isn't called by +default when unpickling. From webhook-mailer at python.org Sat Apr 18 18:55:18 2020 From: webhook-mailer at python.org (Leonard Richardson) Date: Sat, 18 Apr 2020 22:55:18 -0000 Subject: [Python-checkins] [2.7] Doc: Add an optional obsolete header. (GH-19229) Message-ID: https://github.com/python/cpython/commit/0fc82e95878234291f23155a64408fced71892b2 commit: 0fc82e95878234291f23155a64408fced71892b2 branch: 2.7 author: Leonard Richardson committer: GitHub date: 2020-04-18T17:55:10-05:00 summary: [2.7] Doc: Add an optional obsolete header. (GH-19229) files: M Doc/README.txt M Doc/conf.py M Doc/tools/templates/layout.html diff --git a/Doc/README.txt b/Doc/README.txt index a362ecca94273..625efd47532b5 100644 --- a/Doc/README.txt +++ b/Doc/README.txt @@ -104,6 +104,13 @@ Then, from the ``Doc`` directory, run :: where ```` is one of html, text, latex, or htmlhelp (for explanations see the make targets above). +Deprecation header +================== + +Following the sunsetting of Python 2.7, a red banner displays at the +top of each page redirecting to the corresponding page on +``https://docs.python.org/3/``. + Contributing ============ diff --git a/Doc/conf.py b/Doc/conf.py index 393018d08f51d..29927c3bbbb82 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -80,6 +80,10 @@ # Split the index html_split_index = True +html_context = { + 'outdated': True +} + # Options for LaTeX output # ------------------------ diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index 8d6d3e5bd1193..dbbfdeae2aa2d 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -1,4 +1,14 @@ {% extends "!layout.html" %} +{% block header %} +{%- if outdated %} +
+ {% trans %}This document is for an old version of Python that is {% endtrans %}{% trans %}no longer supported{% endtrans %}. + {% trans %}You should upgrade, and read the {% endtrans %} + {% trans %} Python documentation for the current stable release{% endtrans %}. +
+{%- endif %} +{% endblock %} + {% block rootrellink %}
  • From webhook-mailer at python.org Sun Apr 19 03:36:52 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Sun, 19 Apr 2020 07:36:52 -0000 Subject: [Python-checkins] bpo-40325: Deprecate set object support in random.sample() (GH-19591) Message-ID: https://github.com/python/cpython/commit/4fe002045fcf40823154b709fef0948b2bc5e934 commit: 4fe002045fcf40823154b709fef0948b2bc5e934 branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-19T00:36:42-07:00 summary: bpo-40325: Deprecate set object support in random.sample() (GH-19591) files: A Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst M Doc/library/random.rst M Lib/random.py M Lib/test/test_random.py diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 9964af46b2efe..82e900d3a20ab 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -230,6 +230,13 @@ Functions for sequences If the sample size is larger than the population size, a :exc:`ValueError` is raised. + .. deprecated:: 3.9 + In the future, the *population* must be a sequence. Instances of + :class:`set` are no longer supported. The set must first be converted + to a :class:`list` or :class:`tuple`, preferably in a deterministic + order so that the sample is reproducible. + + Real-valued distributions ------------------------- diff --git a/Lib/random.py b/Lib/random.py index 3243938282b50..f1df18d5c187b 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -367,9 +367,12 @@ def sample(self, population, k): # causing them to eat more entropy than necessary. if isinstance(population, _Set): + _warn('Sampling from a set deprecated\n' + 'since Python 3.9 and will be removed in a subsequent version.', + DeprecationWarning, 2) population = tuple(population) if not isinstance(population, _Sequence): - raise TypeError("Population must be a sequence or set. For dicts, use list(d).") + raise TypeError("Population must be a sequence. For dicts or sets, use sorted(d).") randbelow = self._randbelow n = len(population) if not 0 <= k <= n: diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 50d4e94ca22f8..42c68dd1c2442 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -147,7 +147,6 @@ def test_sample_distribution(self): def test_sample_inputs(self): # SF bug #801342 -- population can be any iterable defining __len__() - self.gen.sample(set(range(20)), 2) self.gen.sample(range(20), 2) self.gen.sample(range(20), 2) self.gen.sample(str('abcdefghijklmnopqrst'), 2) @@ -156,6 +155,11 @@ def test_sample_inputs(self): def test_sample_on_dicts(self): self.assertRaises(TypeError, self.gen.sample, dict.fromkeys('abcdef'), 2) + def test_sample_on_sets(self): + with self.assertWarns(DeprecationWarning): + population = {10, 20, 30, 40, 50, 60, 70} + self.gen.sample(population, k=5) + def test_choices(self): choices = self.gen.choices data = ['red', 'green', 'blue', 'yellow'] diff --git a/Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst b/Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst new file mode 100644 index 0000000000000..3df5fade6676a --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst @@ -0,0 +1 @@ +Deprecated support for set objects in random.sample(). From webhook-mailer at python.org Sun Apr 19 05:43:15 2020 From: webhook-mailer at python.org (Tim Lo) Date: Sun, 19 Apr 2020 09:43:15 -0000 Subject: [Python-checkins] bpo-39285: Clarify example for PurePath.match (GH-19458) Message-ID: https://github.com/python/cpython/commit/c12375aa0b838d34067efa3f1b9a1fbc632d0413 commit: c12375aa0b838d34067efa3f1b9a1fbc632d0413 branch: master author: Tim Lo committer: GitHub date: 2020-04-19T02:43:11-07:00 summary: bpo-39285: Clarify example for PurePath.match (GH-19458) Fixes Issue39285 The example incorrectly returned True for match. Furthermore the example is ambiguous in its usage of PureWindowsPath. Windows is case-insensitve, however the underlying match functionality utilizes fnmatch.fnmatchcase. Automerge-Triggered-By: @pitrou files: M Doc/library/pathlib.rst diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 004c156e11885..d4329e7a4c64a 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -528,8 +528,10 @@ Pure paths provide the following methods and properties: >>> PurePath('a/b.py').match('/*.py') False - As with other methods, case-sensitivity is observed:: + As with other methods, case-sensitivity follows platform defaults:: + >>> PurePosixPath('b.py').match('*.PY') + False >>> PureWindowsPath('b.py').match('*.PY') True From webhook-mailer at python.org Sun Apr 19 06:03:40 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 19 Apr 2020 10:03:40 -0000 Subject: [Python-checkins] bpo-39285: Clarify example for PurePath.match (GH-19458) Message-ID: https://github.com/python/cpython/commit/8c0734397603d84e3a2e753463b44cf904147cc4 commit: 8c0734397603d84e3a2e753463b44cf904147cc4 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-19T03:03:35-07:00 summary: bpo-39285: Clarify example for PurePath.match (GH-19458) Fixes Issue39285 The example incorrectly returned True for match. Furthermore the example is ambiguous in its usage of PureWindowsPath. Windows is case-insensitve, however the underlying match functionality utilizes fnmatch.fnmatchcase. Automerge-Triggered-By: @pitrou (cherry picked from commit c12375aa0b838d34067efa3f1b9a1fbc632d0413) Co-authored-by: Tim Lo files: M Doc/library/pathlib.rst diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 03408145cf572..b900d093b7565 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -515,8 +515,10 @@ Pure paths provide the following methods and properties: >>> PurePath('a/b.py').match('/*.py') False - As with other methods, case-sensitivity is observed:: + As with other methods, case-sensitivity follows platform defaults:: + >>> PurePosixPath('b.py').match('*.PY') + False >>> PureWindowsPath('b.py').match('*.PY') True From webhook-mailer at python.org Sun Apr 19 06:03:46 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sun, 19 Apr 2020 10:03:46 -0000 Subject: [Python-checkins] bpo-39285: Clarify example for PurePath.match (GH-19458) Message-ID: https://github.com/python/cpython/commit/143147d94f3e55a929327ddae1d0d3c260d71cef commit: 143147d94f3e55a929327ddae1d0d3c260d71cef branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-19T03:03:42-07:00 summary: bpo-39285: Clarify example for PurePath.match (GH-19458) Fixes Issue39285 The example incorrectly returned True for match. Furthermore the example is ambiguous in its usage of PureWindowsPath. Windows is case-insensitve, however the underlying match functionality utilizes fnmatch.fnmatchcase. Automerge-Triggered-By: @pitrou (cherry picked from commit c12375aa0b838d34067efa3f1b9a1fbc632d0413) Co-authored-by: Tim Lo files: M Doc/library/pathlib.rst diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index 9ed5d9da55a21..0449174295896 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -515,8 +515,10 @@ Pure paths provide the following methods and properties: >>> PurePath('a/b.py').match('/*.py') False - As with other methods, case-sensitivity is observed:: + As with other methods, case-sensitivity follows platform defaults:: + >>> PurePosixPath('b.py').match('*.PY') + False >>> PureWindowsPath('b.py').match('*.PY') True From webhook-mailer at python.org Sun Apr 19 10:01:04 2020 From: webhook-mailer at python.org (Kyle Stanley) Date: Sun, 19 Apr 2020 14:01:04 -0000 Subject: [Python-checkins] bpo-39207: Spawn workers on demand in ProcessPoolExecutor (GH-19453) Message-ID: https://github.com/python/cpython/commit/1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe commit: 1ac6e379297cc1cf8acf6c1b011fccc7b3da2cbe branch: master author: Kyle Stanley committer: GitHub date: 2020-04-19T07:00:59-07:00 summary: bpo-39207: Spawn workers on demand in ProcessPoolExecutor (GH-19453) Roughly based on https://github.com/python/cpython/commit/904e34d4e6b6007986dcc585d5c553ee8ae06f95, but with a few substantial differences. /cc @pitrou @brianquinlan files: A Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst M Doc/whatsnew/3.9.rst M Lib/concurrent/futures/process.py M Lib/test/test_concurrent_futures.py diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 8147d8f185c7c..c4b49feed9fc1 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -206,6 +206,11 @@ and :class:`~concurrent.futures.ProcessPoolExecutor`. This improves compatibility with subinterpreters and predictability in their shutdown processes. (Contributed by Kyle Stanley in :issue:`39812`.) +Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned on +demand, only when there are no available idle workers to reuse. This optimizes +startup overhead and reduces the amount of lost CPU time to idle workers. +(Contributed by Kyle Stanley in :issue:`39207`.) + curses ------ diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 4c39500d675ff..36355ae8756db 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -318,6 +318,12 @@ def run(self): # while waiting on new results. del result_item + # attempt to increment idle process count + executor = self.executor_reference() + if executor is not None: + executor._idle_worker_semaphore.release() + del executor + if self.is_shutting_down(): self.flag_executor_shutting_down() @@ -601,6 +607,7 @@ def __init__(self, max_workers=None, mp_context=None, # Shutdown is a two-step process. self._shutdown_thread = False self._shutdown_lock = threading.Lock() + self._idle_worker_semaphore = threading.Semaphore(0) self._broken = False self._queue_count = 0 self._pending_work_items = {} @@ -633,14 +640,18 @@ def __init__(self, max_workers=None, mp_context=None, def _start_executor_manager_thread(self): if self._executor_manager_thread is None: # Start the processes so that their sentinels are known. - self._adjust_process_count() self._executor_manager_thread = _ExecutorManagerThread(self) self._executor_manager_thread.start() _threads_wakeups[self._executor_manager_thread] = \ self._executor_manager_thread_wakeup def _adjust_process_count(self): - for _ in range(len(self._processes), self._max_workers): + # if there's an idle process, we don't need to spawn a new one. + if self._idle_worker_semaphore.acquire(blocking=False): + return + + process_count = len(self._processes) + if process_count < self._max_workers: p = self._mp_context.Process( target=_process_worker, args=(self._call_queue, @@ -669,6 +680,7 @@ def submit(self, fn, /, *args, **kwargs): # Wake up queue management thread self._executor_manager_thread_wakeup.wakeup() + self._adjust_process_count() self._start_executor_manager_thread() return f submit.__doc__ = _base.Executor.submit.__doc__ diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 868415ab29916..a8c5bb6aa1a3a 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -486,10 +486,16 @@ def _prime_executor(self): pass def test_processes_terminate(self): - self.executor.submit(mul, 21, 2) - self.executor.submit(mul, 6, 7) - self.executor.submit(mul, 3, 14) - self.assertEqual(len(self.executor._processes), 5) + def acquire_lock(lock): + lock.acquire() + + mp_context = get_context() + sem = mp_context.Semaphore(0) + for _ in range(3): + self.executor.submit(acquire_lock, sem) + self.assertEqual(len(self.executor._processes), 3) + for _ in range(3): + sem.release() processes = self.executor._processes self.executor.shutdown() @@ -964,6 +970,36 @@ def test_ressources_gced_in_workers(self): mgr.shutdown() mgr.join() + def test_saturation(self): + executor = self.executor_type(4) + mp_context = get_context() + sem = mp_context.Semaphore(0) + job_count = 15 * executor._max_workers + try: + for _ in range(job_count): + executor.submit(sem.acquire) + self.assertEqual(len(executor._processes), executor._max_workers) + for _ in range(job_count): + sem.release() + finally: + executor.shutdown() + + def test_idle_process_reuse_one(self): + executor = self.executor_type(4) + executor.submit(mul, 21, 2).result() + executor.submit(mul, 6, 7).result() + executor.submit(mul, 3, 14).result() + self.assertEqual(len(executor._processes), 1) + executor.shutdown() + + def test_idle_process_reuse_multiple(self): + executor = self.executor_type(4) + executor.submit(mul, 12, 7).result() + executor.submit(mul, 33, 25) + executor.submit(mul, 25, 26).result() + executor.submit(mul, 18, 29) + self.assertLessEqual(len(executor._processes), 2) + executor.shutdown() create_executor_tests(ProcessPoolExecutorTest, executor_mixins=(ProcessPoolForkMixin, diff --git a/Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst b/Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst new file mode 100644 index 0000000000000..3fa82771ded23 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst @@ -0,0 +1,4 @@ +Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned on +demand, only when there are no available idle workers to reuse. This optimizes +startup overhead and reduces the amount of lost CPU time to idle workers. +Patch by Kyle Stanley. \ No newline at end of file From webhook-mailer at python.org Sun Apr 19 10:08:22 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 19 Apr 2020 14:08:22 -0000 Subject: [Python-checkins] Remove incorrect comma. (GH-19604) Message-ID: https://github.com/python/cpython/commit/f2f950e3d0ebc4ccfacf3d2ddcc201685e9bc129 commit: f2f950e3d0ebc4ccfacf3d2ddcc201685e9bc129 branch: 2.7 author: Benjamin Peterson committer: GitHub date: 2020-04-19T09:08:18-05:00 summary: Remove incorrect comma. (GH-19604) files: M Doc/tools/templates/layout.html diff --git a/Doc/tools/templates/layout.html b/Doc/tools/templates/layout.html index dbbfdeae2aa2d..34a87ae42d867 100644 --- a/Doc/tools/templates/layout.html +++ b/Doc/tools/templates/layout.html @@ -3,7 +3,7 @@ {%- if outdated %}
    {% trans %}This document is for an old version of Python that is {% endtrans %}{% trans %}no longer supported{% endtrans %}. - {% trans %}You should upgrade, and read the {% endtrans %} + {% trans %}You should upgrade and read the {% endtrans %} {% trans %} Python documentation for the current stable release{% endtrans %}.
    {%- endif %} From webhook-mailer at python.org Sun Apr 19 11:19:29 2020 From: webhook-mailer at python.org (Thomas Krennwallner) Date: Sun, 19 Apr 2020 15:19:29 -0000 Subject: [Python-checkins] bpo-38891: avoid quadratic item access performance of ShareableList (GH-18996) Message-ID: https://github.com/python/cpython/commit/c8f1715283ec51822fb37a702bf253cbac1af276 commit: c8f1715283ec51822fb37a702bf253cbac1af276 branch: master author: Thomas Krennwallner committer: GitHub date: 2020-04-19T17:19:24+02:00 summary: bpo-38891: avoid quadratic item access performance of ShareableList (GH-18996) Avoid linear runtime of ShareableList.__getitem__ and ShareableList.__setitem__ by storing running allocated bytes in ShareableList._allocated_bytes instead of the number of bytes for a particular stored item. Co-authored-by: Antoine Pitrou files: A Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst M Lib/multiprocessing/shared_memory.py diff --git a/Lib/multiprocessing/shared_memory.py b/Lib/multiprocessing/shared_memory.py index 9f954d9c38feb..87e46cfbe526d 100644 --- a/Lib/multiprocessing/shared_memory.py +++ b/Lib/multiprocessing/shared_memory.py @@ -252,6 +252,15 @@ class ShareableList: packing format for any storable value must require no more than 8 characters to describe its format.""" + # The shared memory area is organized as follows: + # - 8 bytes: number of items (N) as a 64-bit integer + # - (N + 1) * 8 bytes: offsets of each element from the start of the + # data area + # - K bytes: the data area storing item values (with encoding and size + # depending on their respective types) + # - N * 8 bytes: `struct` format string for each element + # - N bytes: index into _back_transforms_mapping for each element + # (for reconstructing the corresponding Python value) _types_mapping = { int: "q", float: "d", @@ -283,7 +292,8 @@ def _extract_recreation_code(value): return 3 # NoneType def __init__(self, sequence=None, *, name=None): - if sequence is not None: + if name is None or sequence is not None: + sequence = sequence or () _formats = [ self._types_mapping[type(item)] if not isinstance(item, (str, bytes)) @@ -294,10 +304,14 @@ def __init__(self, sequence=None, *, name=None): ] self._list_len = len(_formats) assert sum(len(fmt) <= 8 for fmt in _formats) == self._list_len - self._allocated_bytes = tuple( - self._alignment if fmt[-1] != "s" else int(fmt[:-1]) - for fmt in _formats - ) + offset = 0 + # The offsets of each list element into the shared memory's + # data area (0 meaning the start of the data area, not the start + # of the shared memory area). + self._allocated_offsets = [0] + for fmt in _formats: + offset += self._alignment if fmt[-1] != "s" else int(fmt[:-1]) + self._allocated_offsets.append(offset) _recreation_codes = [ self._extract_recreation_code(item) for item in sequence ] @@ -308,13 +322,9 @@ def __init__(self, sequence=None, *, name=None): self._format_back_transform_codes ) + self.shm = SharedMemory(name, create=True, size=requested_size) else: - requested_size = 8 # Some platforms require > 0. - - if name is not None and sequence is None: self.shm = SharedMemory(name) - else: - self.shm = SharedMemory(name, create=True, size=requested_size) if sequence is not None: _enc = _encoding @@ -323,7 +333,7 @@ def __init__(self, sequence=None, *, name=None): self.shm.buf, 0, self._list_len, - *(self._allocated_bytes) + *(self._allocated_offsets) ) struct.pack_into( "".join(_formats), @@ -346,10 +356,12 @@ def __init__(self, sequence=None, *, name=None): else: self._list_len = len(self) # Obtains size from offset 0 in buffer. - self._allocated_bytes = struct.unpack_from( - self._format_size_metainfo, - self.shm.buf, - 1 * 8 + self._allocated_offsets = list( + struct.unpack_from( + self._format_size_metainfo, + self.shm.buf, + 1 * 8 + ) ) def _get_packing_format(self, position): @@ -371,7 +383,6 @@ def _get_packing_format(self, position): def _get_back_transform(self, position): "Gets the back transformation function for a single value." - position = position if position >= 0 else position + self._list_len if (position >= self._list_len) or (self._list_len < 0): raise IndexError("Requested position out of range.") @@ -388,7 +399,6 @@ def _set_packing_format_and_transform(self, position, fmt_as_str, value): """Sets the packing format and back transformation code for a single value in the list at the specified position.""" - position = position if position >= 0 else position + self._list_len if (position >= self._list_len) or (self._list_len < 0): raise IndexError("Requested position out of range.") @@ -408,9 +418,9 @@ def _set_packing_format_and_transform(self, position, fmt_as_str, value): ) def __getitem__(self, position): + position = position if position >= 0 else position + self._list_len try: - offset = self._offset_data_start \ - + sum(self._allocated_bytes[:position]) + offset = self._offset_data_start + self._allocated_offsets[position] (v,) = struct.unpack_from( self._get_packing_format(position), self.shm.buf, @@ -425,9 +435,10 @@ def __getitem__(self, position): return v def __setitem__(self, position, value): + position = position if position >= 0 else position + self._list_len try: - offset = self._offset_data_start \ - + sum(self._allocated_bytes[:position]) + item_offset = self._allocated_offsets[position] + offset = self._offset_data_start + item_offset current_format = self._get_packing_format(position) except IndexError: raise IndexError("assignment index out of range") @@ -435,13 +446,15 @@ def __setitem__(self, position, value): if not isinstance(value, (str, bytes)): new_format = self._types_mapping[type(value)] else: - if len(value) > self._allocated_bytes[position]: + allocated_length = self._allocated_offsets[position + 1] - item_offset + + if len(value) > allocated_length: raise ValueError("exceeds available storage for existing str") if current_format[-1] == "s": new_format = current_format else: new_format = self._types_mapping[str] % ( - self._allocated_bytes[position], + allocated_length, ) self._set_packing_format_and_transform( @@ -463,33 +476,35 @@ def __repr__(self): @property def format(self): - "The struct packing format used by all currently stored values." + "The struct packing format used by all currently stored items." return "".join( self._get_packing_format(i) for i in range(self._list_len) ) @property def _format_size_metainfo(self): - "The struct packing format used for metainfo on storage sizes." - return f"{self._list_len}q" + "The struct packing format used for the items' storage offsets." + return "q" * (self._list_len + 1) @property def _format_packing_metainfo(self): - "The struct packing format used for the values' packing formats." + "The struct packing format used for the items' packing formats." return "8s" * self._list_len @property def _format_back_transform_codes(self): - "The struct packing format used for the values' back transforms." + "The struct packing format used for the items' back transforms." return "b" * self._list_len @property def _offset_data_start(self): - return (self._list_len + 1) * 8 # 8 bytes per "q" + # - 8 bytes for the list length + # - (N + 1) * 8 bytes for the element offsets + return (self._list_len + 2) * 8 @property def _offset_packing_formats(self): - return self._offset_data_start + sum(self._allocated_bytes) + return self._offset_data_start + self._allocated_offsets[-1] @property def _offset_back_transform_codes(self): diff --git a/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst b/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst new file mode 100644 index 0000000000000..fdb8a05d18347 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst @@ -0,0 +1,3 @@ +Fix linear runtime behaviour of the `__getitem__` and `__setitem__` methods in +:class:`multiprocessing.shared_memory.ShareableList`. This avoids quadratic +performance when iterating a `ShareableList`. Patch by Thomas Krennwallner. From webhook-mailer at python.org Sun Apr 19 11:29:57 2020 From: webhook-mailer at python.org (Tim Hoffmann) Date: Sun, 19 Apr 2020 15:29:57 -0000 Subject: [Python-checkins] bpo-40148: Add PurePath.with_stem() (GH-19295) Message-ID: https://github.com/python/cpython/commit/8aea4b3605059e243f1827d9328d6fc8d698c0a7 commit: 8aea4b3605059e243f1827d9328d6fc8d698c0a7 branch: master author: Tim Hoffmann <2836374+timhoffm at users.noreply.github.com> committer: GitHub date: 2020-04-19T17:29:49+02:00 summary: bpo-40148: Add PurePath.with_stem() (GH-19295) Add PurePath.with_stem() files: A Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst M Doc/library/pathlib.rst M Lib/pathlib.py M Lib/test/test_pathlib.py diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index d4329e7a4c64a..dead49b630dcd 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -571,6 +571,30 @@ Pure paths provide the following methods and properties: ValueError: PureWindowsPath('c:/') has an empty name +.. method:: PurePath.with_stem(stem) + + Return a new path with the :attr:`stem` changed. If the original path + doesn't have a name, ValueError is raised:: + + >>> p = PureWindowsPath('c:/Downloads/draft.txt') + >>> p.with_stem('final') + PureWindowsPath('c:/Downloads/final.txt') + >>> p = PureWindowsPath('c:/Downloads/pathlib.tar.gz') + >>> p.with_stem('lib') + PureWindowsPath('c:/Downloads/lib.gz') + >>> p = PureWindowsPath('c:/') + >>> p.with_stem('') + Traceback (most recent call last): + File "", line 1, in + File "/home/antoine/cpython/default/Lib/pathlib.py", line 861, in with_stem + return self.with_name(stem + self.suffix) + File "/home/antoine/cpython/default/Lib/pathlib.py", line 851, in with_name + raise ValueError("%r has an empty name" % (self,)) + ValueError: PureWindowsPath('c:/') has an empty name + + .. versionadded:: 3.9 + + .. method:: PurePath.with_suffix(suffix) Return a new path with the :attr:`suffix` changed. If the original path diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 88ebe030c7ff7..f98d69eb04ac3 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -870,6 +870,10 @@ def with_name(self, name): return self._from_parsed_parts(self._drv, self._root, self._parts[:-1] + [name]) + def with_stem(self, stem): + """Return a new path with the stem changed.""" + return self.with_name(stem + self.suffix) + def with_suffix(self, suffix): """Return a new path with the file suffix changed. If the path has no suffix, add given suffix. If the given suffix is an empty diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 8b19cffba37e9..1589282886b6b 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -559,6 +559,23 @@ def test_with_name_common(self): self.assertRaises(ValueError, P('a/b').with_name, 'c/') self.assertRaises(ValueError, P('a/b').with_name, 'c/d') + def test_with_stem_common(self): + P = self.cls + self.assertEqual(P('a/b').with_stem('d'), P('a/d')) + self.assertEqual(P('/a/b').with_stem('d'), P('/a/d')) + self.assertEqual(P('a/b.py').with_stem('d'), P('a/d.py')) + self.assertEqual(P('/a/b.py').with_stem('d'), P('/a/d.py')) + self.assertEqual(P('/a/b.tar.gz').with_stem('d'), P('/a/d.gz')) + self.assertEqual(P('a/Dot ending.').with_stem('d'), P('a/d')) + self.assertEqual(P('/a/Dot ending.').with_stem('d'), P('/a/d')) + self.assertRaises(ValueError, P('').with_stem, 'd') + self.assertRaises(ValueError, P('.').with_stem, 'd') + self.assertRaises(ValueError, P('/').with_stem, 'd') + self.assertRaises(ValueError, P('a/b').with_stem, '') + self.assertRaises(ValueError, P('a/b').with_stem, '/c') + self.assertRaises(ValueError, P('a/b').with_stem, 'c/') + self.assertRaises(ValueError, P('a/b').with_stem, 'c/d') + def test_with_suffix_common(self): P = self.cls self.assertEqual(P('a/b').with_suffix('.gz'), P('a/b.gz')) @@ -1014,6 +1031,20 @@ def test_with_name(self): self.assertRaises(ValueError, P('c:a/b').with_name, 'd:/e') self.assertRaises(ValueError, P('c:a/b').with_name, '//My/Share') + def test_with_stem(self): + P = self.cls + self.assertEqual(P('c:a/b').with_stem('d'), P('c:a/d')) + self.assertEqual(P('c:/a/b').with_stem('d'), P('c:/a/d')) + self.assertEqual(P('c:a/Dot ending.').with_stem('d'), P('c:a/d')) + self.assertEqual(P('c:/a/Dot ending.').with_stem('d'), P('c:/a/d')) + self.assertRaises(ValueError, P('c:').with_stem, 'd') + self.assertRaises(ValueError, P('c:/').with_stem, 'd') + self.assertRaises(ValueError, P('//My/Share').with_stem, 'd') + self.assertRaises(ValueError, P('c:a/b').with_stem, 'd:') + self.assertRaises(ValueError, P('c:a/b').with_stem, 'd:e') + self.assertRaises(ValueError, P('c:a/b').with_stem, 'd:/e') + self.assertRaises(ValueError, P('c:a/b').with_stem, '//My/Share') + def test_with_suffix(self): P = self.cls self.assertEqual(P('c:a/b').with_suffix('.gz'), P('c:a/b.gz')) diff --git a/Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst b/Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst new file mode 100644 index 0000000000000..02a5f9d708410 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst @@ -0,0 +1 @@ +Added :meth:`pathlib.Path.with_stem()` to create a new Path with the stem replaced. \ No newline at end of file From webhook-mailer at python.org Sun Apr 19 17:49:24 2020 From: webhook-mailer at python.org (Benjamin Peterson) Date: Sun, 19 Apr 2020 21:49:24 -0000 Subject: [Python-checkins] Bump version to 2.7.18. Message-ID: https://github.com/python/cpython/commit/8323757381eb3f9dbe5b98edd59bfb4a6d80b493 commit: 8323757381eb3f9dbe5b98edd59bfb4a6d80b493 branch: 2.7 author: Benjamin Peterson committer: Benjamin Peterson date: 2020-04-19T16:12:51-05:00 summary: Bump version to 2.7.18. files: M Include/patchlevel.h diff --git a/Include/patchlevel.h b/Include/patchlevel.h index 91215f8b19c0b..0ce6313fa9413 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -23,11 +23,11 @@ #define PY_MAJOR_VERSION 2 #define PY_MINOR_VERSION 7 #define PY_MICRO_VERSION 18 -#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 /* Version as a string */ -#define PY_VERSION "2.7.18rc1" +#define PY_VERSION "2.7.18" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository). Empty From webhook-mailer at python.org Sun Apr 19 22:17:45 2020 From: webhook-mailer at python.org (Galden) Date: Mon, 20 Apr 2020 02:17:45 -0000 Subject: [Python-checkins] Fix typo in Lib/tracepack.py (GH-19605) Message-ID: https://github.com/python/cpython/commit/df8913f7c48d267efd662e8ffd9496595115eee8 commit: df8913f7c48d267efd662e8ffd9496595115eee8 branch: master author: Galden committer: GitHub date: 2020-04-19T19:17:37-07:00 summary: Fix typo in Lib/tracepack.py (GH-19605) Typo fix: "emites" -> "emit". files: M Lib/traceback.py diff --git a/Lib/traceback.py b/Lib/traceback.py index 7a4c8e19f9896..bf34bbab8a162 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -551,7 +551,7 @@ def format_exception_only(self): The return value is a generator of strings, each ending in a newline. Normally, the generator emits a single string; however, for - SyntaxError exceptions, it emites several lines that (when + SyntaxError exceptions, it emits several lines that (when printed) display detailed information about where the syntax error occurred. From webhook-mailer at python.org Sun Apr 19 22:36:15 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 20 Apr 2020 02:36:15 -0000 Subject: [Python-checkins] Fix typo in Lib/tracepack.py (GH-19605) Message-ID: https://github.com/python/cpython/commit/984a567cbb2dc4645f2baf72f608d44c9173d190 commit: 984a567cbb2dc4645f2baf72f608d44c9173d190 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-19T19:36:03-07:00 summary: Fix typo in Lib/tracepack.py (GH-19605) Typo fix: "emites" -> "emit". (cherry picked from commit df8913f7c48d267efd662e8ffd9496595115eee8) Co-authored-by: Galden files: M Lib/traceback.py diff --git a/Lib/traceback.py b/Lib/traceback.py index ab35da94b51ea..5ef3be74be74a 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -549,7 +549,7 @@ def format_exception_only(self): The return value is a generator of strings, each ending in a newline. Normally, the generator emits a single string; however, for - SyntaxError exceptions, it emites several lines that (when + SyntaxError exceptions, it emits several lines that (when printed) display detailed information about where the syntax error occurred. From webhook-mailer at python.org Sun Apr 19 22:36:57 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 20 Apr 2020 02:36:57 -0000 Subject: [Python-checkins] Fix typo in Lib/tracepack.py (GH-19605) Message-ID: https://github.com/python/cpython/commit/d0d4e33d26a5463d7a4536525f9c6501ef2b3c17 commit: d0d4e33d26a5463d7a4536525f9c6501ef2b3c17 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-19T19:36:52-07:00 summary: Fix typo in Lib/tracepack.py (GH-19605) Typo fix: "emites" -> "emit". (cherry picked from commit df8913f7c48d267efd662e8ffd9496595115eee8) Co-authored-by: Galden files: M Lib/traceback.py diff --git a/Lib/traceback.py b/Lib/traceback.py index 4e7605d15fa4d..59d6d1d069877 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -546,7 +546,7 @@ def format_exception_only(self): The return value is a generator of strings, each ending in a newline. Normally, the generator emits a single string; however, for - SyntaxError exceptions, it emites several lines that (when + SyntaxError exceptions, it emits several lines that (when printed) display detailed information about where the syntax error occurred. From webhook-mailer at python.org Mon Apr 20 10:58:51 2020 From: webhook-mailer at python.org (Barry) Date: Mon, 20 Apr 2020 14:58:51 -0000 Subject: [Python-checkins] bpo-40260: Revert breaking changes made in modulefinder (GH-19595) Message-ID: https://github.com/python/cpython/commit/9b0b5d2baebd0b6a545317200c313a6a7408731e commit: 9b0b5d2baebd0b6a545317200c313a6a7408731e branch: master author: Barry committer: GitHub date: 2020-04-20T15:58:42+01:00 summary: bpo-40260: Revert breaking changes made in modulefinder (GH-19595) files: M Lib/modulefinder.py M Lib/test/test_modulefinder.py diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index 84ddbdb6ee3df..361a6730c0674 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -69,15 +69,15 @@ def _find_module(name, path=None): # Some special cases: if spec.loader is importlib.machinery.BuiltinImporter: - return None, None, ("", _C_BUILTIN) + return None, None, ("", "", _C_BUILTIN) if spec.loader is importlib.machinery.FrozenImporter: - return None, None, ("", _PY_FROZEN) + return None, None, ("", "", _PY_FROZEN) file_path = spec.origin if spec.loader.is_package(name): - return None, os.path.dirname(file_path), ("", _PKG_DIRECTORY) + return None, os.path.dirname(file_path), ("", "", _PKG_DIRECTORY) if isinstance(spec.loader, importlib.machinery.SourceFileLoader): kind = _PY_SOURCE @@ -89,12 +89,12 @@ def _find_module(name, path=None): kind = _PY_COMPILED else: # Should never happen. - return None, None, ("", _SEARCH_ERROR) + return None, None, ("", "", _SEARCH_ERROR) file = io.open_code(file_path) suffix = os.path.splitext(file_path)[-1] - return file, file_path, (suffix, kind) + return file, file_path, (suffix, "rb", kind) class Module: @@ -159,14 +159,14 @@ def msgout(self, *args): def run_script(self, pathname): self.msg(2, "run_script", pathname) with io.open_code(pathname) as fp: - stuff = ("", _PY_SOURCE) + stuff = ("", "rb", _PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) with io.open_code(pathname) as fp: - stuff = (ext, _PY_SOURCE) + stuff = (ext, "rb", _PY_SOURCE) self.load_module(name, fp, pathname, stuff) def import_hook(self, name, caller=None, fromlist=None, level=-1): @@ -320,6 +320,7 @@ def import_module(self, partname, fqname, parent): except ImportError: self.msgout(3, "import_module ->", None) return None + try: m = self.load_module(fqname, fp, pathname, stuff) finally: @@ -331,7 +332,7 @@ def import_module(self, partname, fqname, parent): return m def load_module(self, fqname, fp, pathname, file_info): - suffix, type = file_info + suffix, mode, type = file_info self.msgin(2, "load_module", fqname, fp and "fp", pathname) if type == _PKG_DIRECTORY: m = self.load_package(fqname, pathname) @@ -502,7 +503,7 @@ def find_module(self, name, path, parent=None): if path is None: if name in sys.builtin_module_names: - return (None, None, ("", _C_BUILTIN)) + return (None, None, ("", "", _C_BUILTIN)) path = self.path diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py index 1aa45011df0bb..23c7e5fb0f563 100644 --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -317,13 +317,12 @@ def create_package(source): if ofi: ofi.close() - class ModuleFinderTest(unittest.TestCase): - def _do_test(self, info, report=False, debug=0, replace_paths=[]): + def _do_test(self, info, report=False, debug=0, replace_paths=[], modulefinder_class=modulefinder.ModuleFinder): import_this, modules, missing, maybe_missing, source = info create_package(source) try: - mf = modulefinder.ModuleFinder(path=TEST_PATH, debug=debug, + mf = modulefinder_class(path=TEST_PATH, debug=debug, replace_paths=replace_paths) mf.import_hook(import_this) if report: @@ -421,5 +420,17 @@ def test_coding_explicit_utf8(self): def test_coding_explicit_cp1252(self): self._do_test(coding_explicit_cp1252_test) + def test_load_module_api(self): + class CheckLoadModuleApi(modulefinder.ModuleFinder): + def __init__(self, *args, **kwds): + super().__init__(*args, **kwds) + + def load_module(self, fqname, fp, pathname, file_info): + # confirm that the fileinfo is a tuple of 3 elements + suffix, mode, type = file_info + return super().load_module(fqname, fp, pathname, file_info) + + self._do_test(absolute_import_test, modulefinder_class=CheckLoadModuleApi) + if __name__ == "__main__": unittest.main() From webhook-mailer at python.org Mon Apr 20 11:18:19 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 20 Apr 2020 15:18:19 -0000 Subject: [Python-checkins] bpo-40260: Revert breaking changes made in modulefinder (GH-19595) Message-ID: https://github.com/python/cpython/commit/81de3c225774179cdc82a1733a64e4a876ff02b5 commit: 81de3c225774179cdc82a1733a64e4a876ff02b5 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-20T08:18:11-07:00 summary: bpo-40260: Revert breaking changes made in modulefinder (GH-19595) (cherry picked from commit 9b0b5d2baebd0b6a545317200c313a6a7408731e) Co-authored-by: Barry files: M Lib/modulefinder.py M Lib/test/test_modulefinder.py diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index 84ddbdb6ee3df..361a6730c0674 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -69,15 +69,15 @@ def _find_module(name, path=None): # Some special cases: if spec.loader is importlib.machinery.BuiltinImporter: - return None, None, ("", _C_BUILTIN) + return None, None, ("", "", _C_BUILTIN) if spec.loader is importlib.machinery.FrozenImporter: - return None, None, ("", _PY_FROZEN) + return None, None, ("", "", _PY_FROZEN) file_path = spec.origin if spec.loader.is_package(name): - return None, os.path.dirname(file_path), ("", _PKG_DIRECTORY) + return None, os.path.dirname(file_path), ("", "", _PKG_DIRECTORY) if isinstance(spec.loader, importlib.machinery.SourceFileLoader): kind = _PY_SOURCE @@ -89,12 +89,12 @@ def _find_module(name, path=None): kind = _PY_COMPILED else: # Should never happen. - return None, None, ("", _SEARCH_ERROR) + return None, None, ("", "", _SEARCH_ERROR) file = io.open_code(file_path) suffix = os.path.splitext(file_path)[-1] - return file, file_path, (suffix, kind) + return file, file_path, (suffix, "rb", kind) class Module: @@ -159,14 +159,14 @@ def msgout(self, *args): def run_script(self, pathname): self.msg(2, "run_script", pathname) with io.open_code(pathname) as fp: - stuff = ("", _PY_SOURCE) + stuff = ("", "rb", _PY_SOURCE) self.load_module('__main__', fp, pathname, stuff) def load_file(self, pathname): dir, name = os.path.split(pathname) name, ext = os.path.splitext(name) with io.open_code(pathname) as fp: - stuff = (ext, _PY_SOURCE) + stuff = (ext, "rb", _PY_SOURCE) self.load_module(name, fp, pathname, stuff) def import_hook(self, name, caller=None, fromlist=None, level=-1): @@ -320,6 +320,7 @@ def import_module(self, partname, fqname, parent): except ImportError: self.msgout(3, "import_module ->", None) return None + try: m = self.load_module(fqname, fp, pathname, stuff) finally: @@ -331,7 +332,7 @@ def import_module(self, partname, fqname, parent): return m def load_module(self, fqname, fp, pathname, file_info): - suffix, type = file_info + suffix, mode, type = file_info self.msgin(2, "load_module", fqname, fp and "fp", pathname) if type == _PKG_DIRECTORY: m = self.load_package(fqname, pathname) @@ -502,7 +503,7 @@ def find_module(self, name, path, parent=None): if path is None: if name in sys.builtin_module_names: - return (None, None, ("", _C_BUILTIN)) + return (None, None, ("", "", _C_BUILTIN)) path = self.path diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py index 1aa45011df0bb..23c7e5fb0f563 100644 --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -317,13 +317,12 @@ def create_package(source): if ofi: ofi.close() - class ModuleFinderTest(unittest.TestCase): - def _do_test(self, info, report=False, debug=0, replace_paths=[]): + def _do_test(self, info, report=False, debug=0, replace_paths=[], modulefinder_class=modulefinder.ModuleFinder): import_this, modules, missing, maybe_missing, source = info create_package(source) try: - mf = modulefinder.ModuleFinder(path=TEST_PATH, debug=debug, + mf = modulefinder_class(path=TEST_PATH, debug=debug, replace_paths=replace_paths) mf.import_hook(import_this) if report: @@ -421,5 +420,17 @@ def test_coding_explicit_utf8(self): def test_coding_explicit_cp1252(self): self._do_test(coding_explicit_cp1252_test) + def test_load_module_api(self): + class CheckLoadModuleApi(modulefinder.ModuleFinder): + def __init__(self, *args, **kwds): + super().__init__(*args, **kwds) + + def load_module(self, fqname, fp, pathname, file_info): + # confirm that the fileinfo is a tuple of 3 elements + suffix, mode, type = file_info + return super().load_module(fqname, fp, pathname, file_info) + + self._do_test(absolute_import_test, modulefinder_class=CheckLoadModuleApi) + if __name__ == "__main__": unittest.main() From webhook-mailer at python.org Mon Apr 20 12:49:25 2020 From: webhook-mailer at python.org (Hai Shi) Date: Mon, 20 Apr 2020 16:49:25 -0000 Subject: [Python-checkins] bpo-39849: Enable assertions in _testcapimodule.c and _testinternalcapi.c (GH-19623) Message-ID: https://github.com/python/cpython/commit/5dd21f5d1c9b5a9316deca4535932675f04efeee commit: 5dd21f5d1c9b5a9316deca4535932675f04efeee branch: master author: Hai Shi committer: GitHub date: 2020-04-21T01:49:13+09:00 summary: bpo-39849: Enable assertions in _testcapimodule.c and _testinternalcapi.c (GH-19623) files: M Modules/_testcapimodule.c M Modules/_testinternalcapi.c diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 8e18b14a0a890..101d54932d913 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -10,7 +10,10 @@ The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE macro defined, but only the public C API must be tested here. */ + #undef Py_BUILD_CORE_MODULE +/* Always enable assertions */ +#undef NDEBUG #define PY_SSIZE_T_CLEAN diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index 9330e2625b3a0..1b7563cb20fc5 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -6,6 +6,9 @@ # error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined" #endif +/* Always enable assertions */ +#undef NDEBUG + #define PY_SSIZE_T_CLEAN #include "Python.h" From webhook-mailer at python.org Mon Apr 20 14:55:10 2020 From: webhook-mailer at python.org (Antoine Pitrou) Date: Mon, 20 Apr 2020 18:55:10 -0000 Subject: [Python-checkins] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) Message-ID: https://github.com/python/cpython/commit/eba9f6155df59c9beed97fb5764c9f01dd941af0 commit: eba9f6155df59c9beed97fb5764c9f01dd941af0 branch: master author: Antoine Pitrou committer: GitHub date: 2020-04-20T11:54:55-07:00 summary: bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) The item size must be checked after encoding to bytes, not before. Automerge-Triggered-By: @pitrou files: A Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst M Lib/multiprocessing/shared_memory.py M Lib/test/_test_multiprocessing.py diff --git a/Lib/multiprocessing/shared_memory.py b/Lib/multiprocessing/shared_memory.py index 87e46cfbe526d..a3a5fcf4aba1e 100644 --- a/Lib/multiprocessing/shared_memory.py +++ b/Lib/multiprocessing/shared_memory.py @@ -445,11 +445,14 @@ def __setitem__(self, position, value): if not isinstance(value, (str, bytes)): new_format = self._types_mapping[type(value)] + encoded_value = value else: allocated_length = self._allocated_offsets[position + 1] - item_offset - if len(value) > allocated_length: - raise ValueError("exceeds available storage for existing str") + encoded_value = (value.encode(_encoding) + if isinstance(value, str) else value) + if len(encoded_value) > allocated_length: + raise ValueError("bytes/str item exceeds available storage") if current_format[-1] == "s": new_format = current_format else: @@ -462,8 +465,7 @@ def __setitem__(self, position, value): new_format, value ) - value = value.encode(_encoding) if isinstance(value, str) else value - struct.pack_into(new_format, self.shm.buf, offset, value) + struct.pack_into(new_format, self.shm.buf, offset, encoded_value) def __reduce__(self): return partial(self.__class__, name=self.shm.name), () diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d00e928c17790..d633e02d016fc 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3995,9 +3995,21 @@ def test_shared_memory_ShareableList_basics(self): sl[4] = 'some' # Change type at a given position. self.assertEqual(sl[4], 'some') self.assertEqual(sl.format, '8s8sdq8sxxxxxxx?q') - with self.assertRaises(ValueError): - sl[4] = 'far too many' # Exceeds available storage. + with self.assertRaisesRegex(ValueError, + "exceeds available storage"): + sl[4] = 'far too many' self.assertEqual(sl[4], 'some') + sl[0] = 'encod?s' # Exactly 8 bytes of UTF-8 data + self.assertEqual(sl[0], 'encod?s') + self.assertEqual(sl[1], b'HoWdY') # no spillage + with self.assertRaisesRegex(ValueError, + "exceeds available storage"): + sl[0] = 'encod?es' # Exactly 9 bytes of UTF-8 data + self.assertEqual(sl[1], b'HoWdY') + with self.assertRaisesRegex(ValueError, + "exceeds available storage"): + sl[1] = b'123456789' + self.assertEqual(sl[1], b'HoWdY') # Exercise count(). with warnings.catch_warnings(): diff --git a/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst b/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst new file mode 100644 index 0000000000000..98cb62f1b115e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst @@ -0,0 +1,2 @@ +In :meth:`ShareableList.__setitem__`, check the size of a new string item +after encoding it to utf-8, not before. From webhook-mailer at python.org Mon Apr 20 15:22:54 2020 From: webhook-mailer at python.org (Antoine Pitrou) Date: Mon, 20 Apr 2020 19:22:54 -0000 Subject: [Python-checkins] [3.8] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) (GH-19625) Message-ID: https://github.com/python/cpython/commit/887ff8e37e238fbce18c647e588283904f38ab24 commit: 887ff8e37e238fbce18c647e588283904f38ab24 branch: 3.8 author: Antoine Pitrou committer: GitHub date: 2020-04-20T21:22:50+02:00 summary: [3.8] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) (GH-19625) The item size must be checked after encoding to bytes, not before. Automerge-Triggered-By: @pitrou. (cherry picked from commit eba9f6155df59c9beed97fb5764c9f01dd941af0) Co-authored-by: Antoine Pitrou files: A Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst M Lib/multiprocessing/shared_memory.py M Lib/test/_test_multiprocessing.py diff --git a/Lib/multiprocessing/shared_memory.py b/Lib/multiprocessing/shared_memory.py index 184e36704baae..f92eb012c8316 100644 --- a/Lib/multiprocessing/shared_memory.py +++ b/Lib/multiprocessing/shared_memory.py @@ -433,9 +433,12 @@ def __setitem__(self, position, value): if not isinstance(value, (str, bytes)): new_format = self._types_mapping[type(value)] + encoded_value = value else: - if len(value) > self._allocated_bytes[position]: - raise ValueError("exceeds available storage for existing str") + encoded_value = (value.encode(_encoding) + if isinstance(value, str) else value) + if len(encoded_value) > self._allocated_bytes[position]: + raise ValueError("bytes/str item exceeds available storage") if current_format[-1] == "s": new_format = current_format else: @@ -448,8 +451,7 @@ def __setitem__(self, position, value): new_format, value ) - value = value.encode(_encoding) if isinstance(value, str) else value - struct.pack_into(new_format, self.shm.buf, offset, value) + struct.pack_into(new_format, self.shm.buf, offset, encoded_value) def __reduce__(self): return partial(self.__class__, name=self.shm.name), () diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index e64a8e9b3b879..d5336e4d7be30 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3964,9 +3964,21 @@ def test_shared_memory_ShareableList_basics(self): sl[4] = 'some' # Change type at a given position. self.assertEqual(sl[4], 'some') self.assertEqual(sl.format, '8s8sdq8sxxxxxxx?q') - with self.assertRaises(ValueError): - sl[4] = 'far too many' # Exceeds available storage. + with self.assertRaisesRegex(ValueError, + "exceeds available storage"): + sl[4] = 'far too many' self.assertEqual(sl[4], 'some') + sl[0] = 'encod?s' # Exactly 8 bytes of UTF-8 data + self.assertEqual(sl[0], 'encod?s') + self.assertEqual(sl[1], b'HoWdY') # no spillage + with self.assertRaisesRegex(ValueError, + "exceeds available storage"): + sl[0] = 'encod?es' # Exactly 9 bytes of UTF-8 data + self.assertEqual(sl[1], b'HoWdY') + with self.assertRaisesRegex(ValueError, + "exceeds available storage"): + sl[1] = b'123456789' + self.assertEqual(sl[1], b'HoWdY') # Exercise count(). with warnings.catch_warnings(): diff --git a/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst b/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst new file mode 100644 index 0000000000000..98cb62f1b115e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst @@ -0,0 +1,2 @@ +In :meth:`ShareableList.__setitem__`, check the size of a new string item +after encoding it to utf-8, not before. From webhook-mailer at python.org Mon Apr 20 16:02:01 2020 From: webhook-mailer at python.org (HongWeipeng) Date: Mon, 20 Apr 2020 20:02:01 -0000 Subject: [Python-checkins] bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616) Message-ID: https://github.com/python/cpython/commit/a25a04fea5446b1712cde0cff556574be139285a commit: a25a04fea5446b1712cde0cff556574be139285a branch: master author: HongWeipeng committer: GitHub date: 2020-04-20T21:01:53+01:00 summary: bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616) https://bugs.python.org/issue39942 files: A Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.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 489836c459b1c..b3a671732167e 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -221,6 +221,13 @@ def test_bound_errors(self): with self.assertRaises(TypeError): TypeVar('X', str, float, bound=Employee) + def test_missing__name__(self): + # See bpo-39942 + code = ("import typing\n" + "T = typing.TypeVar('T')\n" + ) + exec(code, {}) + def test_no_bivariant(self): with self.assertRaises(ValueError): TypeVar('T', covariant=True, contravariant=True) diff --git a/Lib/typing.py b/Lib/typing.py index df3650001e78e..9383fb8ff3a23 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -606,7 +606,10 @@ def __init__(self, name, *constraints, bound=None, self.__bound__ = _type_check(bound, "Bound must be a type.") else: self.__bound__ = None - def_mod = sys._getframe(1).f_globals['__name__'] # for pickling + try: + def_mod = sys._getframe(1).f_globals.get('__name__', '__main__') # for pickling + except (AttributeError, ValueError): + def_mod = None if def_mod != 'typing': self.__module__ = def_mod diff --git a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst new file mode 100644 index 0000000000000..3b83037d170f6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst @@ -0,0 +1,2 @@ +Set "__main__" as the default module name when "__name__" is missing in +:class:`typing.TypeVar`. Patch by Weipeng Hong. From webhook-mailer at python.org Mon Apr 20 16:22:42 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 20 Apr 2020 20:22:42 -0000 Subject: [Python-checkins] bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616) Message-ID: https://github.com/python/cpython/commit/694a95ff437613e6295f531336b5bc7cab9e3713 commit: 694a95ff437613e6295f531336b5bc7cab9e3713 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-20T13:22:34-07:00 summary: bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616) https://bugs.python.org/issue39942 (cherry picked from commit a25a04fea5446b1712cde0cff556574be139285a) Co-authored-by: HongWeipeng files: A Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.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 6e7e5a210a658..c141baf1a99a9 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -218,6 +218,13 @@ def test_bound_errors(self): with self.assertRaises(TypeError): TypeVar('X', str, float, bound=Employee) + def test_missing__name__(self): + # See bpo-39942 + code = ("import typing\n" + "T = typing.TypeVar('T')\n" + ) + exec(code, {}) + def test_no_bivariant(self): with self.assertRaises(ValueError): TypeVar('T', covariant=True, contravariant=True) diff --git a/Lib/typing.py b/Lib/typing.py index 1749c2fd35cd1..3deb1eac3b90f 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -549,7 +549,10 @@ def __init__(self, name, *constraints, bound=None, self.__bound__ = _type_check(bound, "Bound must be a type.") else: self.__bound__ = None - def_mod = sys._getframe(1).f_globals['__name__'] # for pickling + try: + def_mod = sys._getframe(1).f_globals.get('__name__', '__main__') # for pickling + except (AttributeError, ValueError): + def_mod = None if def_mod != 'typing': self.__module__ = def_mod diff --git a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst new file mode 100644 index 0000000000000..3b83037d170f6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst @@ -0,0 +1,2 @@ +Set "__main__" as the default module name when "__name__" is missing in +:class:`typing.TypeVar`. Patch by Weipeng Hong. From webhook-mailer at python.org Mon Apr 20 16:24:43 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 20 Apr 2020 20:24:43 -0000 Subject: [Python-checkins] bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616) Message-ID: https://github.com/python/cpython/commit/41660cac63c1a216e43335007e329e213054100e commit: 41660cac63c1a216e43335007e329e213054100e branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-20T13:24:35-07:00 summary: bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616) https://bugs.python.org/issue39942 (cherry picked from commit a25a04fea5446b1712cde0cff556574be139285a) Co-authored-by: HongWeipeng files: A Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.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 ded5a8b39db3e..bdd7acd85914c 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -220,6 +220,13 @@ def test_bound_errors(self): with self.assertRaises(TypeError): TypeVar('X', str, float, bound=Employee) + def test_missing__name__(self): + # See bpo-39942 + code = ("import typing\n" + "T = typing.TypeVar('T')\n" + ) + exec(code, {}) + def test_no_bivariant(self): with self.assertRaises(ValueError): TypeVar('T', covariant=True, contravariant=True) diff --git a/Lib/typing.py b/Lib/typing.py index 7aab8db065670..f4fb08f4500de 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -600,7 +600,10 @@ def __init__(self, name, *constraints, bound=None, self.__bound__ = _type_check(bound, "Bound must be a type.") else: self.__bound__ = None - def_mod = sys._getframe(1).f_globals['__name__'] # for pickling + try: + def_mod = sys._getframe(1).f_globals.get('__name__', '__main__') # for pickling + except (AttributeError, ValueError): + def_mod = None if def_mod != 'typing': self.__module__ = def_mod diff --git a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst new file mode 100644 index 0000000000000..3b83037d170f6 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst @@ -0,0 +1,2 @@ +Set "__main__" as the default module name when "__name__" is missing in +:class:`typing.TypeVar`. Patch by Weipeng Hong. From webhook-mailer at python.org Mon Apr 20 16:47:23 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 20 Apr 2020 20:47:23 -0000 Subject: [Python-checkins] Fix uninitialized struct member (GH-19589) Message-ID: https://github.com/python/cpython/commit/bba760e9b6c7da3586ed9c8e3d5a0ce2909a97bb commit: bba760e9b6c7da3586ed9c8e3d5a0ce2909a97bb branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-20T13:47:12-07:00 summary: Fix uninitialized struct member (GH-19589) files: M Modules/_functoolsmodule.c diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 78706b6ec3c4c..fd4b4c268cc97 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1195,6 +1195,7 @@ lru_cache_new(PyTypeObject *type, PyObject *args, PyObject *kw) obj->maxsize = maxsize; Py_INCREF(cache_info_type); obj->cache_info_type = cache_info_type; + obj->dict = NULL; return (PyObject *)obj; } From webhook-mailer at python.org Mon Apr 20 20:18:00 2020 From: webhook-mailer at python.org (sweeneyde) Date: Tue, 21 Apr 2020 00:18:00 -0000 Subject: [Python-checkins] bpo-40313: speed up bytes.hex() (GH-19594) Message-ID: https://github.com/python/cpython/commit/6a9e80a93148b13e4d3bceaab5ea1804ab0e64d5 commit: 6a9e80a93148b13e4d3bceaab5ea1804ab0e64d5 branch: master author: sweeneyde <36520290+sweeneyde at users.noreply.github.com> committer: GitHub date: 2020-04-20T17:17:52-07:00 summary: bpo-40313: speed up bytes.hex() (GH-19594) Automerge-Triggered-By: @gpshead files: A Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313.USVRW8.rst M Python/pystrhex.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313.USVRW8.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313.USVRW8.rst new file mode 100644 index 0000000000000..52880abe9c2d9 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313.USVRW8.rst @@ -0,0 +1 @@ +Improve the performance of bytes.hex(). \ No newline at end of file diff --git a/Python/pystrhex.c b/Python/pystrhex.c index 7e4fad303200e..b74e57ad913b1 100644 --- a/Python/pystrhex.c +++ b/Python/pystrhex.c @@ -82,22 +82,59 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen, /* Hexlify */ Py_ssize_t i, j; - for (i=j=0; i < arglen; ++i) { - assert((j + 1) < resultlen); - unsigned char c; - c = (argbuf[i] >> 4) & 0x0f; - retbuf[j++] = Py_hexdigits[c]; - c = argbuf[i] & 0x0f; - retbuf[j++] = Py_hexdigits[c]; - if (bytes_per_sep_group && i < arglen - 1) { - Py_ssize_t anchor; - anchor = (bytes_per_sep_group > 0) ? (arglen - 1 - i) : (i + 1); - if (anchor % abs_bytes_per_sep == 0) { + unsigned char c; + + if (bytes_per_sep_group == 0) { + for (i = j = 0; i < arglen; ++i) { + assert((j + 1) < resultlen); + c = argbuf[i]; + retbuf[j++] = Py_hexdigits[c >> 4]; + retbuf[j++] = Py_hexdigits[c & 0x0f]; + } + assert(j == resultlen); + } + else { + /* The number of complete chunk+sep periods */ + Py_ssize_t chunks = (arglen - 1) / abs_bytes_per_sep; + Py_ssize_t chunk; + unsigned int k; + + if (bytes_per_sep_group < 0) { + i = j = 0; + for (chunk = 0; chunk < chunks; chunk++) { + for (k = 0; k < abs_bytes_per_sep; k++) { + c = argbuf[i++]; + retbuf[j++] = Py_hexdigits[c >> 4]; + retbuf[j++] = Py_hexdigits[c & 0x0f]; + } retbuf[j++] = sep_char; } + while (i < arglen) { + c = argbuf[i++]; + retbuf[j++] = Py_hexdigits[c >> 4]; + retbuf[j++] = Py_hexdigits[c & 0x0f]; + } + assert(j == resultlen); + } + else { + i = arglen - 1; + j = resultlen - 1; + for (chunk = 0; chunk < chunks; chunk++) { + for (k = 0; k < abs_bytes_per_sep; k++) { + c = argbuf[i--]; + retbuf[j--] = Py_hexdigits[c & 0x0f]; + retbuf[j--] = Py_hexdigits[c >> 4]; + } + retbuf[j--] = sep_char; + } + while (i >= 0) { + c = argbuf[i--]; + retbuf[j--] = Py_hexdigits[c & 0x0f]; + retbuf[j--] = Py_hexdigits[c >> 4]; + } + assert(j == -1); } } - assert(j == resultlen); #ifdef Py_DEBUG if (!return_bytes) { From webhook-mailer at python.org Mon Apr 20 20:53:12 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Tue, 21 Apr 2020 00:53:12 -0000 Subject: [Python-checkins] bpo-40335: Correctly handle multi-line strings in tokenize error scenarios (GH-19619) Message-ID: https://github.com/python/cpython/commit/11a7f158ef51b0edcde3c3d9215172354e385877 commit: 11a7f158ef51b0edcde3c3d9215172354e385877 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-21T01:53:04+01:00 summary: bpo-40335: Correctly handle multi-line strings in tokenize error scenarios (GH-19619) Co-authored-by: Guido van Rossum files: M Lib/test/test_exceptions.py M Parser/parsetok.c M Parser/tokenizer.c diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index d6739f18660a3..8c4a2882bad82 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -188,7 +188,7 @@ def check(src, lineno, offset, encoding='utf-8'): if not isinstance(src, str): src = src.decode(encoding, 'replace') line = src.split('\n')[lineno-1] - self.assertEqual(cm.exception.text.rstrip('\n'), line) + self.assertIn(line, cm.exception.text) check('def fact(x):\n\treturn x!\n', 2, 10) check('1 +\n', 1, 4) @@ -217,6 +217,16 @@ def check(src, lineno, offset, encoding='utf-8'): check(b'\xce\xb1 = 0xI', 1, 6) check(b'# -*- coding: iso8859-7 -*-\n\xe1 = 0xI', 2, 6, encoding='iso8859-7') + check(b"""if 1: + def foo(): + ''' + + def bar(): + pass + + def baz(): + '''quux''' + """, 9, 20) # Errors thrown by symtable.c check('x = [(yield i) for i in range(3)]', 1, 5) diff --git a/Parser/parsetok.c b/Parser/parsetok.c index 37ca65c275a58..1ecb2c4a16df9 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -251,25 +251,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, const char *line_start; type = PyTokenizer_Get(tok, &a, &b); - if (type == ERRORTOKEN) { - err_ret->error = tok->done; - break; - } - if (type == ENDMARKER && started) { - type = NEWLINE; /* Add an extra newline */ - started = 0; - /* Add the right number of dedent tokens, - except if a certain flag is given -- - codeop.py uses this. */ - if (tok->indent && - !(*flags & PyPARSE_DONT_IMPLY_DEDENT)) - { - tok->pendin = -tok->indent; - tok->indent = 0; - } - } - else - started = 1; + len = (a != NULL && b != NULL) ? b - a : 0; str = (char *) PyObject_MALLOC(len + 1); if (str == NULL) { @@ -328,6 +310,27 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, continue; } + if (type == ERRORTOKEN) { + err_ret->error = tok->done; + break; + } + if (type == ENDMARKER && started) { + type = NEWLINE; /* Add an extra newline */ + started = 0; + /* Add the right number of dedent tokens, + except if a certain flag is given -- + codeop.py uses this. */ + if (tok->indent && + !(*flags & PyPARSE_DONT_IMPLY_DEDENT)) + { + tok->pendin = -tok->indent; + tok->indent = 0; + } + } + else { + started = 1; + } + if ((err_ret->error = PyParser_AddToken(ps, (int)type, str, lineno, col_offset, tok->lineno, end_col_offset, diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 97986aa8ef40a..95dfc5388037d 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1392,13 +1392,14 @@ tok_get(struct tok_state *tok, const char **p_start, const char **p_end) if (nonascii && !verify_identifier(tok)) { return ERRORTOKEN; } + + *p_start = tok->start; + *p_end = tok->cur; + if (c == '"' || c == '\'') { tok->done = E_BADPREFIX; return ERRORTOKEN; } - *p_start = tok->start; - *p_end = tok->cur; - /* async/await parsing block. */ if (tok->cur - tok->start == 5 && tok->start[0] == 'a') { /* May be an 'async' or 'await' token. For Python 3.7 or From webhook-mailer at python.org Tue Apr 21 16:50:56 2020 From: webhook-mailer at python.org (Kyle Stanley) Date: Tue, 21 Apr 2020 20:50:56 -0000 Subject: [Python-checkins] bpo-34037: Add Python API whatsnew for loop.shutdown_default_executor() (#19634) Message-ID: https://github.com/python/cpython/commit/9c82ea7868a1c5ecf88891c627b5c399357eb05e commit: 9c82ea7868a1c5ecf88891c627b5c399357eb05e branch: master author: Kyle Stanley committer: GitHub date: 2020-04-21T16:50:51-04:00 summary: bpo-34037: Add Python API whatsnew for loop.shutdown_default_executor() (#19634) Co-Authored-By: Victor Stinner files: M Doc/whatsnew/3.9.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index c4b49feed9fc1..20ebe92865a14 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -827,6 +827,11 @@ Changes in the Python API in the object itself. (Contributed by Serhiy Storchaka in :issue:`40257`.) +* :meth:`asyncio.loop.shutdown_default_executor` has been added to + :class:`~asyncio.AbstractEventLoop`, meaning alternative event loops that + inherit from it should have this method defined. + (Contributed by Kyle Stanley in :issue:`34037`.) + CPython bytecode changes ------------------------ From webhook-mailer at python.org Tue Apr 21 19:11:07 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Tue, 21 Apr 2020 23:11:07 -0000 Subject: [Python-checkins] Small improvements to the recipes and examples. (GH-19635) Message-ID: https://github.com/python/cpython/commit/d3a8d616faf3364b22fde18dce8c168de9368146 commit: d3a8d616faf3364b22fde18dce8c168de9368146 branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-21T16:11:00-07:00 summary: Small improvements to the recipes and examples. (GH-19635) * Add underscores to long numbers to improve readability * Use bigger dataset in the bootstrapping example * Convert single-server queue example to more useful multi-server queue files: M Doc/library/random.rst diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 82e900d3a20ab..291eca3a3f16a 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -425,29 +425,28 @@ Simulations:: >>> def trial(): ... return choices('HT', cum_weights=(0.60, 1.00), k=7).count('H') >= 5 ... - >>> sum(trial() for i in range(10000)) / 10000 + >>> sum(trial() for i in range(10_000)) / 10_000 0.4169 >>> # Probability of the median of 5 samples being in middle two quartiles >>> def trial(): - ... return 2500 <= sorted(choices(range(10000), k=5))[2] < 7500 + ... return 2_500 <= sorted(choices(range(10_000), k=5))[2] < 7_500 ... - >>> sum(trial() for i in range(10000)) / 10000 + >>> sum(trial() for i in range(10_000)) / 10_000 0.7958 Example of `statistical bootstrapping `_ using resampling -with replacement to estimate a confidence interval for the mean of a sample of -size five:: +with replacement to estimate a confidence interval for the mean of a sample:: # http://statistics.about.com/od/Applications/a/Example-Of-Bootstrapping.htm from statistics import fmean as mean from random import choices - data = 1, 2, 4, 4, 10 - means = sorted(mean(choices(data, k=5)) for i in range(20)) + data = [41, 50, 29, 37, 81, 30, 73, 63, 20, 35, 68, 22, 60, 31, 95] + means = sorted(mean(choices(data, k=len(data))) for i in range(100)) print(f'The sample mean of {mean(data):.1f} has a 90% confidence ' - f'interval from {means[1]:.1f} to {means[-2]:.1f}') + f'interval from {means[5]:.1f} to {means[94]:.1f}') Example of a `resampling permutation test `_ @@ -463,7 +462,7 @@ between the effects of a drug versus a placebo:: placebo = [54, 51, 58, 44, 55, 52, 42, 47, 58, 46] observed_diff = mean(drug) - mean(placebo) - n = 10000 + n = 10_000 count = 0 combined = drug + placebo for i in range(n): @@ -476,32 +475,29 @@ between the effects of a drug versus a placebo:: print(f'The one-sided p-value of {count / n:.4f} leads us to reject the null') print(f'hypothesis that there is no difference between the drug and the placebo.') -Simulation of arrival times and service deliveries in a single server queue:: +Simulation of arrival times and service deliveries for a multiserver queue:: + from heapq import heappush, heappop from random import expovariate, gauss from statistics import mean, median, stdev average_arrival_interval = 5.6 - average_service_time = 5.0 - stdev_service_time = 0.5 - - num_waiting = 0 - arrivals = [] - starts = [] - arrival = service_end = 0.0 - for i in range(20000): - if arrival <= service_end: - num_waiting += 1 - arrival += expovariate(1.0 / average_arrival_interval) - arrivals.append(arrival) - else: - num_waiting -= 1 - service_start = service_end if num_waiting else arrival - service_time = gauss(average_service_time, stdev_service_time) - service_end = service_start + service_time - starts.append(service_start) - - waits = [start - arrival for arrival, start in zip(arrivals, starts)] + average_service_time = 15.0 + stdev_service_time = 3.5 + num_servers = 3 + + waits = [] + arrival_time = 0.0 + servers = [0.0] * num_servers # time when each server becomes available + for i in range(100_000): + arrival_time += expovariate(1.0 / average_arrival_interval) + next_server_available = heappop(servers) + wait = max(0.0, next_server_available - arrival_time) + waits.append(wait) + service_duration = gauss(average_service_time, stdev_service_time) + service_completed = arrival_time + wait + service_duration + heappush(servers, service_completed) + print(f'Mean wait: {mean(waits):.1f}. Stdev wait: {stdev(waits):.1f}.') print(f'Median wait: {median(waits):.1f}. Max wait: {max(waits):.1f}.') From webhook-mailer at python.org Tue Apr 21 19:18:58 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Tue, 21 Apr 2020 23:18:58 -0000 Subject: [Python-checkins] Small improvements to the recipes and examples. (GH-19635) (GH-19638) Message-ID: https://github.com/python/cpython/commit/7d65c045dec90d6632b90d82dd4fb5913135ac6e commit: 7d65c045dec90d6632b90d82dd4fb5913135ac6e branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-21T16:18:49-07:00 summary: Small improvements to the recipes and examples. (GH-19635) (GH-19638) * Add underscores to long numbers to improve readability * Use bigger dataset in the bootstrapping example * Convert single-server queue example to more useful multi-server queue (cherry picked from commit d3a8d616faf3364b22fde18dce8c168de9368146) files: M Doc/library/random.rst diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 90b86248e6e1c..c01b2294b0436 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -394,29 +394,28 @@ Simulations:: >>> def trial(): ... return choices('HT', cum_weights=(0.60, 1.00), k=7).count('H') >= 5 ... - >>> sum(trial() for i in range(10000)) / 10000 + >>> sum(trial() for i in range(10_000)) / 10_000 0.4169 >>> # Probability of the median of 5 samples being in middle two quartiles >>> def trial(): - ... return 2500 <= sorted(choices(range(10000), k=5))[2] < 7500 + ... return 2_500 <= sorted(choices(range(10_000), k=5))[2] < 7_500 ... - >>> sum(trial() for i in range(10000)) / 10000 + >>> sum(trial() for i in range(10_000)) / 10_000 0.7958 Example of `statistical bootstrapping `_ using resampling -with replacement to estimate a confidence interval for the mean of a sample of -size five:: +with replacement to estimate a confidence interval for the mean of a sample:: # http://statistics.about.com/od/Applications/a/Example-Of-Bootstrapping.htm from statistics import fmean as mean from random import choices - data = 1, 2, 4, 4, 10 - means = sorted(mean(choices(data, k=5)) for i in range(20)) + data = [41, 50, 29, 37, 81, 30, 73, 63, 20, 35, 68, 22, 60, 31, 95] + means = sorted(mean(choices(data, k=len(data))) for i in range(100)) print(f'The sample mean of {mean(data):.1f} has a 90% confidence ' - f'interval from {means[1]:.1f} to {means[-2]:.1f}') + f'interval from {means[5]:.1f} to {means[94]:.1f}') Example of a `resampling permutation test `_ @@ -432,7 +431,7 @@ between the effects of a drug versus a placebo:: placebo = [54, 51, 58, 44, 55, 52, 42, 47, 58, 46] observed_diff = mean(drug) - mean(placebo) - n = 10000 + n = 10_000 count = 0 combined = drug + placebo for i in range(n): @@ -445,32 +444,29 @@ between the effects of a drug versus a placebo:: print(f'The one-sided p-value of {count / n:.4f} leads us to reject the null') print(f'hypothesis that there is no difference between the drug and the placebo.') -Simulation of arrival times and service deliveries in a single server queue:: +Simulation of arrival times and service deliveries for a multiserver queue:: + from heapq import heappush, heappop from random import expovariate, gauss from statistics import mean, median, stdev average_arrival_interval = 5.6 - average_service_time = 5.0 - stdev_service_time = 0.5 - - num_waiting = 0 - arrivals = [] - starts = [] - arrival = service_end = 0.0 - for i in range(20000): - if arrival <= service_end: - num_waiting += 1 - arrival += expovariate(1.0 / average_arrival_interval) - arrivals.append(arrival) - else: - num_waiting -= 1 - service_start = service_end if num_waiting else arrival - service_time = gauss(average_service_time, stdev_service_time) - service_end = service_start + service_time - starts.append(service_start) - - waits = [start - arrival for arrival, start in zip(arrivals, starts)] + average_service_time = 15.0 + stdev_service_time = 3.5 + num_servers = 3 + + waits = [] + arrival_time = 0.0 + servers = [0.0] * num_servers # time when each server becomes available + for i in range(100_000): + arrival_time += expovariate(1.0 / average_arrival_interval) + next_server_available = heappop(servers) + wait = max(0.0, next_server_available - arrival_time) + waits.append(wait) + service_duration = gauss(average_service_time, stdev_service_time) + service_completed = arrival_time + wait + service_duration + heappush(servers, service_completed) + print(f'Mean wait: {mean(waits):.1f}. Stdev wait: {stdev(waits):.1f}.') print(f'Median wait: {median(waits):.1f}. Max wait: {max(waits):.1f}.') From webhook-mailer at python.org Tue Apr 21 19:20:56 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Tue, 21 Apr 2020 23:20:56 -0000 Subject: [Python-checkins] bpo-40327: Improve atomicity, speed, and memory efficiency of the items() loop (GH-19628) Message-ID: https://github.com/python/cpython/commit/75bedbe2ed4119ff18a2ea86c544b3cf08a92e75 commit: 75bedbe2ed4119ff18a2ea86c544b3cf08a92e75 branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-21T16:20:52-07:00 summary: bpo-40327: Improve atomicity, speed, and memory efficiency of the items() loop (GH-19628) files: M Lib/pickle.py diff --git a/Lib/pickle.py b/Lib/pickle.py index d7adc162c98de..1fc8b0d26c6c4 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -339,7 +339,7 @@ def whichmodule(obj, name): return module_name # Protect the iteration by using a list copy of sys.modules against dynamic # modules that trigger imports of other modules upon calls to getattr. - for module_name, module in list(sys.modules.items()): + for module_name, module in sys.modules.copy().items(): if module_name == '__main__' or module is None: continue try: From webhook-mailer at python.org Tue Apr 21 22:41:41 2020 From: webhook-mailer at python.org (Ned Deily) Date: Wed, 22 Apr 2020 02:41:41 -0000 Subject: [Python-checkins] bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) Message-ID: https://github.com/python/cpython/commit/783a673f23c5e9ffafe12fe172e119dc0fa2abda commit: 783a673f23c5e9ffafe12fe172e119dc0fa2abda branch: master author: Ned Deily committer: GitHub date: 2020-04-21T22:41:33-04:00 summary: bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) files: A Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 0d69c04ba26b2..956d94407a18e 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -215,9 +215,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1d", - url="https://www.openssl.org/source/openssl-1.1.1d.tar.gz", - checksum='3be209000dbc7e1b95bcdf47980a3baa', + name="OpenSSL 1.1.1g", + url="https://www.openssl.org/source/openssl-1.1.1g.tar.gz", + checksum='76766e98997660138cdaf13a187bd234', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst new file mode 100644 index 0000000000000..05c568190e7d8 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst @@ -0,0 +1 @@ +Update macOS installer builds to use OpenSSL 1.1.1g. From webhook-mailer at python.org Tue Apr 21 23:00:35 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 03:00:35 -0000 Subject: [Python-checkins] bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) Message-ID: https://github.com/python/cpython/commit/9e51aab37e9af6fa0fe406fd56184a0aded28e11 commit: 9e51aab37e9af6fa0fe406fd56184a0aded28e11 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-21T20:00:27-07:00 summary: bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) (cherry picked from commit 783a673f23c5e9ffafe12fe172e119dc0fa2abda) Co-authored-by: Ned Deily files: A Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 31e80637d8a85..0ad7298e98242 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -215,9 +215,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1d", - url="https://www.openssl.org/source/openssl-1.1.1d.tar.gz", - checksum='3be209000dbc7e1b95bcdf47980a3baa', + name="OpenSSL 1.1.1g", + url="https://www.openssl.org/source/openssl-1.1.1g.tar.gz", + checksum='76766e98997660138cdaf13a187bd234', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst new file mode 100644 index 0000000000000..05c568190e7d8 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst @@ -0,0 +1 @@ +Update macOS installer builds to use OpenSSL 1.1.1g. From webhook-mailer at python.org Tue Apr 21 23:04:20 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 03:04:20 -0000 Subject: [Python-checkins] bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) (GH-19644) Message-ID: https://github.com/python/cpython/commit/7ad3adda9bff8a9055eaf0b66489e8204f1e7cc6 commit: 7ad3adda9bff8a9055eaf0b66489e8204f1e7cc6 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-21T23:04:15-04:00 summary: bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) (GH-19644) (cherry picked from commit 783a673f23c5e9ffafe12fe172e119dc0fa2abda) Co-authored-by: Ned Deily files: A Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 81d3f4643f441..d3a0c182ccae7 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -215,9 +215,9 @@ def library_recipes(): result.extend([ dict( - name="OpenSSL 1.1.1d", - url="https://www.openssl.org/source/openssl-1.1.1d.tar.gz", - checksum='3be209000dbc7e1b95bcdf47980a3baa', + name="OpenSSL 1.1.1g", + url="https://www.openssl.org/source/openssl-1.1.1g.tar.gz", + checksum='76766e98997660138cdaf13a187bd234', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst new file mode 100644 index 0000000000000..05c568190e7d8 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst @@ -0,0 +1 @@ +Update macOS installer builds to use OpenSSL 1.1.1g. From webhook-mailer at python.org Wed Apr 22 03:38:47 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 07:38:47 -0000 Subject: [Python-checkins] bpo-38439: Add 256px IDLE icon (GH-17473) Message-ID: https://github.com/python/cpython/commit/abdfb3b47156a6ca5696b6f4380d412a460b718a commit: abdfb3b47156a6ca5696b6f4380d412a460b718a branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T00:38:37-07:00 summary: bpo-38439: Add 256px IDLE icon (GH-17473) Icon author: Andrew Clover, bpo-1490384 (cherry picked from commit 3a69f3caeeaea57048ed3bc3051e16854b9a4cd6) Co-authored-by: Miro Hron?ok files: A Lib/idlelib/Icons/README.txt A Lib/idlelib/Icons/idle_256.png A Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst D Lib/idlelib/Icons/idle.icns M Lib/idlelib/pyshell.py M PCbuild/lib.pyproj diff --git a/Lib/idlelib/Icons/README.txt b/Lib/idlelib/Icons/README.txt new file mode 100644 index 0000000000000..8b471629ecb3e --- /dev/null +++ b/Lib/idlelib/Icons/README.txt @@ -0,0 +1,9 @@ +The IDLE icons are from https://bugs.python.org/issue1490384 + +Created by Andrew Clover. + +The original sources are available from Andrew's website: +https://www.doxdesk.com/software/py/pyicons.html + +Various different formats and sizes are available at this GitHub Pull Request: +https://github.com/python/cpython/pull/17473 diff --git a/Lib/idlelib/Icons/idle.icns b/Lib/idlelib/Icons/idle.icns deleted file mode 100644 index f65e3130f0aff..0000000000000 Binary files a/Lib/idlelib/Icons/idle.icns and /dev/null differ diff --git a/Lib/idlelib/Icons/idle_256.png b/Lib/idlelib/Icons/idle_256.png new file mode 100644 index 0000000000000..99ffa6fad4a92 Binary files /dev/null and b/Lib/idlelib/Icons/idle_256.png differ diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 43fb597c2ba6e..66ae0f7435dab 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -1485,9 +1485,14 @@ def main(): iconfile = os.path.join(icondir, 'idle.ico') root.wm_iconbitmap(default=iconfile) elif not macosx.isAquaTk(): - ext = '.png' if TkVersion >= 8.6 else '.gif' + if TkVersion >= 8.6: + ext = '.png' + sizes = (16, 32, 48, 256) + else: + ext = '.gif' + sizes = (16, 32, 48) iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext)) - for size in (16, 32, 48)] + for size in sizes] icons = [PhotoImage(master=root, file=iconfile) for iconfile in iconfiles] root.wm_iconphoto(True, *icons) diff --git a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst b/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst new file mode 100644 index 0000000000000..de048d005cee7 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst @@ -0,0 +1,2 @@ +Add a 256?256 pixel IDLE icon to support more modern environments. Created by Andrew Clover. +Delete the unused macOS idle.icns icon file. diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj index 273d5ef7529e9..5eafdeb474c2e 100644 --- a/PCbuild/lib.pyproj +++ b/PCbuild/lib.pyproj @@ -1592,6 +1592,7 @@ + From webhook-mailer at python.org Wed Apr 22 03:40:06 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 07:40:06 -0000 Subject: [Python-checkins] bpo-38439: Add 256px IDLE icon (GH-17473) Message-ID: https://github.com/python/cpython/commit/3a5545025685040842420c85a4a9aab5f044aeb8 commit: 3a5545025685040842420c85a4a9aab5f044aeb8 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T00:39:59-07:00 summary: bpo-38439: Add 256px IDLE icon (GH-17473) Icon author: Andrew Clover, bpo-1490384 (cherry picked from commit 3a69f3caeeaea57048ed3bc3051e16854b9a4cd6) Co-authored-by: Miro Hron?ok files: A Lib/idlelib/Icons/README.txt A Lib/idlelib/Icons/idle_256.png A Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst D Lib/idlelib/Icons/idle.icns M Lib/idlelib/pyshell.py M PCbuild/lib.pyproj diff --git a/Lib/idlelib/Icons/README.txt b/Lib/idlelib/Icons/README.txt new file mode 100644 index 0000000000000..8b471629ecb3e --- /dev/null +++ b/Lib/idlelib/Icons/README.txt @@ -0,0 +1,9 @@ +The IDLE icons are from https://bugs.python.org/issue1490384 + +Created by Andrew Clover. + +The original sources are available from Andrew's website: +https://www.doxdesk.com/software/py/pyicons.html + +Various different formats and sizes are available at this GitHub Pull Request: +https://github.com/python/cpython/pull/17473 diff --git a/Lib/idlelib/Icons/idle.icns b/Lib/idlelib/Icons/idle.icns deleted file mode 100644 index f65e3130f0aff..0000000000000 Binary files a/Lib/idlelib/Icons/idle.icns and /dev/null differ diff --git a/Lib/idlelib/Icons/idle_256.png b/Lib/idlelib/Icons/idle_256.png new file mode 100644 index 0000000000000..99ffa6fad4a92 Binary files /dev/null and b/Lib/idlelib/Icons/idle_256.png differ diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 43fb597c2ba6e..66ae0f7435dab 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -1485,9 +1485,14 @@ def main(): iconfile = os.path.join(icondir, 'idle.ico') root.wm_iconbitmap(default=iconfile) elif not macosx.isAquaTk(): - ext = '.png' if TkVersion >= 8.6 else '.gif' + if TkVersion >= 8.6: + ext = '.png' + sizes = (16, 32, 48, 256) + else: + ext = '.gif' + sizes = (16, 32, 48) iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext)) - for size in (16, 32, 48)] + for size in sizes] icons = [PhotoImage(master=root, file=iconfile) for iconfile in iconfiles] root.wm_iconphoto(True, *icons) diff --git a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst b/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst new file mode 100644 index 0000000000000..de048d005cee7 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst @@ -0,0 +1,2 @@ +Add a 256?256 pixel IDLE icon to support more modern environments. Created by Andrew Clover. +Delete the unused macOS idle.icns icon file. diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj index 7ed71bd819cb5..6e9d54511fef1 100644 --- a/PCbuild/lib.pyproj +++ b/PCbuild/lib.pyproj @@ -1589,6 +1589,7 @@ + From webhook-mailer at python.org Wed Apr 22 03:44:20 2020 From: webhook-mailer at python.org (Joshua Root) Date: Wed, 22 Apr 2020 07:44:20 -0000 Subject: [Python-checkins] bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480) Message-ID: https://github.com/python/cpython/commit/b310700976524b4b99ee319c947ca40468716fc9 commit: b310700976524b4b99ee319c947ca40468716fc9 branch: master author: Joshua Root committer: GitHub date: 2020-04-22T03:44:10-04:00 summary: bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480) It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily files: A Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst M Lib/_osx_support.py M Lib/distutils/unixccompiler.py M Lib/test/test__osx_support.py M setup.py diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py index db6674ea293fb..e9efce7d7ed5b 100644 --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -211,7 +211,7 @@ def _remove_universal_flags(_config_vars): if cv in _config_vars and cv not in os.environ: flags = _config_vars[cv] flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII) - flags = re.sub('-isysroot [^ \t]*', ' ', flags) + flags = re.sub(r'-isysroot\s*\S+', ' ', flags) _save_modified_value(_config_vars, cv, flags) return _config_vars @@ -287,7 +287,7 @@ def _check_for_unavailable_sdk(_config_vars): # to /usr and /System/Library by either a standalone CLT # package or the CLT component within Xcode. cflags = _config_vars.get('CFLAGS', '') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): @@ -295,7 +295,7 @@ def _check_for_unavailable_sdk(_config_vars): # Do not alter a config var explicitly overridden by env var if cv in _config_vars and cv not in os.environ: flags = _config_vars[cv] - flags = re.sub(r'-isysroot\s+\S+(?:\s|$)', ' ', flags) + flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags) _save_modified_value(_config_vars, cv, flags) return _config_vars @@ -320,7 +320,7 @@ def compiler_fixup(compiler_so, cc_args): stripArch = stripSysroot = True else: stripArch = '-arch' in cc_args - stripSysroot = '-isysroot' in cc_args + stripSysroot = any(arg for arg in cc_args if arg.startswith('-isysroot')) if stripArch or 'ARCHFLAGS' in os.environ: while True: @@ -338,23 +338,34 @@ def compiler_fixup(compiler_so, cc_args): if stripSysroot: while True: - try: - index = compiler_so.index('-isysroot') + indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')] + if not indices: + break + index = indices[0] + if compiler_so[index] == '-isysroot': # Strip this argument and the next one: del compiler_so[index:index+2] - except ValueError: - break + else: + # It's '-isysroot/some/path' in one arg + del compiler_so[index:index+1] # Check if the SDK that is used during compilation actually exists, # the universal build requires the usage of a universal SDK and not all # users have that installed by default. sysroot = None - if '-isysroot' in cc_args: - idx = cc_args.index('-isysroot') - sysroot = cc_args[idx+1] - elif '-isysroot' in compiler_so: - idx = compiler_so.index('-isysroot') - sysroot = compiler_so[idx+1] + argvar = cc_args + indices = [i for i,x in enumerate(cc_args) if x.startswith('-isysroot')] + if not indices: + argvar = compiler_so + indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')] + + for idx in indices: + if argvar[idx] == '-isysroot': + sysroot = argvar[idx+1] + break + else: + sysroot = argvar[idx][len('-isysroot'):] + break if sysroot and not os.path.isdir(sysroot): from distutils import log diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index d10a78da31140..4d7a6de740ab3 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -288,7 +288,7 @@ def find_library_file(self, dirs, lib, debug=0): # vs # /usr/lib/libedit.dylib cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is None: sysroot = '/' else: diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py index 388a2b1a84b17..1a5d649b40f53 100644 --- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -174,6 +174,29 @@ def test__remove_universal_flags(self): _osx_support._remove_universal_flags( config_vars)) + def test__remove_universal_flags_alternate(self): + # bpo-38360: also test the alternate single-argument form of -isysroot + config_vars = { + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdk', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.4u.sdk -g', + } + expected_vars = { + 'CFLAGS': '-fno-strict-aliasing -g -O3 ', + 'LDFLAGS': ' -g', + 'CPPFLAGS': '-I. ', + 'BLDSHARED': 'gcc-4.0 -bundle -g', + 'LDSHARED': 'gcc-4.0 -bundle -g', + } + self.add_expected_saved_initial_values(config_vars, expected_vars) + + self.assertEqual(expected_vars, + _osx_support._remove_universal_flags( + config_vars)) + def test__remove_unsupported_archs(self): config_vars = { 'CC': 'clang', @@ -261,6 +284,34 @@ def test__check_for_unavailable_sdk(self): _osx_support._check_for_unavailable_sdk( config_vars)) + def test__check_for_unavailable_sdk_alternate(self): + # bpo-38360: also test the alternate single-argument form of -isysroot + config_vars = { + 'CC': 'clang', + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.1.sdk', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.1.sdk', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.1.sdk -g', + } + expected_vars = { + 'CC': 'clang', + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' + ' ', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. ', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + ' -g', + } + self.add_expected_saved_initial_values(config_vars, expected_vars) + + self.assertEqual(expected_vars, + _osx_support._check_for_unavailable_sdk( + config_vars)) + def test_get_platform_osx(self): # Note, get_platform_osx is currently tested more extensively # indirectly by test_sysconfig and test_distutils diff --git a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst new file mode 100644 index 0000000000000..e96ca14919919 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst @@ -0,0 +1 @@ +Support single-argument form of macOS -isysroot flag. diff --git a/setup.py b/setup.py index d241dc0b4b406..878372154d411 100644 --- a/setup.py +++ b/setup.py @@ -170,7 +170,7 @@ def macosx_sdk_root(): return MACOS_SDK_ROOT cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is not None: MACOS_SDK_ROOT = m.group(1) else: From webhook-mailer at python.org Wed Apr 22 04:27:30 2020 From: webhook-mailer at python.org (Ned Deily) Date: Wed, 22 Apr 2020 08:27:30 -0000 Subject: [Python-checkins] bpo-38329: python.org macOS installers now update Current symlink (GH-19650) Message-ID: https://github.com/python/cpython/commit/bcc136ba892e62078a67ad0ca0b34072ec9c88aa commit: bcc136ba892e62078a67ad0ca0b34072ec9c88aa branch: master author: Ned Deily committer: GitHub date: 2020-04-22T04:27:13-04:00 summary: bpo-38329: python.org macOS installers now update Current symlink (GH-19650) Previously, python.org macOS installers did not alter the Current version symlink in /Library/Frameworks/Python.framework/Versions when installing a version of Python 3.x, only when installing 2.x. Now that Python 2 is retired, it's time to change that. This should make it a bit easier to embed Python 3 into other macOS applications. files: A Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst M Mac/BuildScript/build-installer.py diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index 956d94407a18e..a10601bed9f8c 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -1309,12 +1309,6 @@ def buildPython(): os.chdir(curdir) - if PYTHON_3: - # Remove the 'Current' link, that way we don't accidentally mess - # with an already installed version of python 2 - os.unlink(os.path.join(rootDir, 'Library', 'Frameworks', - 'Python.framework', 'Versions', 'Current')) - def patchFile(inPath, outPath): data = fileContents(inPath) data = data.replace('$FULL_VERSION', getFullVersion()) diff --git a/Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst b/Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst new file mode 100644 index 0000000000000..0caf8a0f52434 --- /dev/null +++ b/Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst @@ -0,0 +1,4 @@ +python.org macOS installers now update the Current version symlink of +/Library/Frameworks/Python.framework/Versions for 3.9 installs. Previously, +Current was only updated for Python 2.x installs. This should make it easier +to embed Python 3 into other macOS applications. From webhook-mailer at python.org Wed Apr 22 10:30:43 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 22 Apr 2020 14:30:43 -0000 Subject: [Python-checkins] bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19637) Message-ID: https://github.com/python/cpython/commit/9bee32b34e4fb3e67a88bf14d38153851d4c4598 commit: 9bee32b34e4fb3e67a88bf14d38153851d4c4598 branch: master author: Victor Stinner committer: GitHub date: 2020-04-22T16:30:35+02:00 summary: bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19637) Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number. os.waitstatus_to_exitcode() now accepts wait status larger than INT_MAX. files: A Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst M Lib/test/test_os.py M Modules/clinic/posixmodule.c.h M Modules/posixmodule.c diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 73dc064d5ff75..74aef47243428 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2789,40 +2789,66 @@ def test_getppid(self): # We are the parent of our subprocess self.assertEqual(int(stdout), os.getpid()) + def check_waitpid(self, code, exitcode, callback=None): + if sys.platform == 'win32': + # On Windows, os.spawnv() simply joins arguments with spaces: + # arguments need to be quoted + args = [f'"{sys.executable}"', '-c', f'"{code}"'] + else: + args = [sys.executable, '-c', code] + pid = os.spawnv(os.P_NOWAIT, sys.executable, args) + + if callback is not None: + callback(pid) + + # don't use support.wait_process() to test directly os.waitpid() + # and os.waitstatus_to_exitcode() + pid2, status = os.waitpid(pid, 0) + self.assertEqual(os.waitstatus_to_exitcode(status), exitcode) + self.assertEqual(pid2, pid) + def test_waitpid(self): - args = [sys.executable, '-c', 'pass'] - # Add an implicit test for PyUnicode_FSConverter(). - pid = os.spawnv(os.P_NOWAIT, FakePath(args[0]), args) - support.wait_process(pid, exitcode=0) + self.check_waitpid(code='pass', exitcode=0) def test_waitstatus_to_exitcode(self): exitcode = 23 - filename = support.TESTFN - self.addCleanup(support.unlink, filename) + code = f'import sys; sys.exit({exitcode})' + self.check_waitpid(code, exitcode=exitcode) - with open(filename, "w") as fp: - print(f'import sys; sys.exit({exitcode})', file=fp) - fp.flush() - args = [sys.executable, filename] - pid = os.spawnv(os.P_NOWAIT, args[0], args) + with self.assertRaises(TypeError): + os.waitstatus_to_exitcode(0.0) - pid2, status = os.waitpid(pid, 0) - self.assertEqual(os.waitstatus_to_exitcode(status), exitcode) - self.assertEqual(pid2, pid) + @unittest.skipUnless(sys.platform == 'win32', 'win32-specific test') + def test_waitpid_windows(self): + # bpo-40138: test os.waitpid() and os.waitstatus_to_exitcode() + # with exit code larger than INT_MAX. + STATUS_CONTROL_C_EXIT = 0xC000013A + code = f'import _winapi; _winapi.ExitProcess({STATUS_CONTROL_C_EXIT})' + self.check_waitpid(code, exitcode=STATUS_CONTROL_C_EXIT) + + @unittest.skipUnless(sys.platform == 'win32', 'win32-specific test') + def test_waitstatus_to_exitcode_windows(self): + max_exitcode = 2 ** 32 - 1 + for exitcode in (0, 1, 5, max_exitcode): + self.assertEqual(os.waitstatus_to_exitcode(exitcode << 8), + exitcode) + + # invalid values + with self.assertRaises(ValueError): + os.waitstatus_to_exitcode((max_exitcode + 1) << 8) + with self.assertRaises(OverflowError): + os.waitstatus_to_exitcode(-1) # Skip the test on Windows @unittest.skipUnless(hasattr(signal, 'SIGKILL'), 'need signal.SIGKILL') def test_waitstatus_to_exitcode_kill(self): + code = f'import time; time.sleep({support.LONG_TIMEOUT})' signum = signal.SIGKILL - args = [sys.executable, '-c', - f'import time; time.sleep({support.LONG_TIMEOUT})'] - pid = os.spawnv(os.P_NOWAIT, args[0], args) - os.kill(pid, signum) + def kill_process(pid): + os.kill(pid, signum) - pid2, status = os.waitpid(pid, 0) - self.assertEqual(os.waitstatus_to_exitcode(status), -signum) - self.assertEqual(pid2, pid) + self.check_waitpid(code, exitcode=-signum, callback=kill_process) class SpawnTests(unittest.TestCase): @@ -2884,6 +2910,10 @@ def test_spawnv(self): exitcode = os.spawnv(os.P_WAIT, args[0], args) self.assertEqual(exitcode, self.exitcode) + # Test for PyUnicode_FSConverter() + exitcode = os.spawnv(os.P_WAIT, FakePath(args[0]), args) + self.assertEqual(exitcode, self.exitcode) + @requires_os_func('spawnve') def test_spawnve(self): args = self.create_args(with_env=True) diff --git a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst new file mode 100644 index 0000000000000..ad5faf3865751 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst @@ -0,0 +1,2 @@ +Fix the Windows implementation of :func:`os.waitpid` for exit code larger than +``INT_MAX >> 8``. The exit status is now interpreted as an unsigned number. diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 9a605e4841a00..a2b4566443b51 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -8839,7 +8839,7 @@ PyDoc_STRVAR(os_waitstatus_to_exitcode__doc__, {"waitstatus_to_exitcode", (PyCFunction)(void(*)(void))os_waitstatus_to_exitcode, METH_FASTCALL|METH_KEYWORDS, os_waitstatus_to_exitcode__doc__}, static PyObject * -os_waitstatus_to_exitcode_impl(PyObject *module, int status); +os_waitstatus_to_exitcode_impl(PyObject *module, PyObject *status_obj); static PyObject * os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -8848,22 +8848,14 @@ os_waitstatus_to_exitcode(PyObject *module, PyObject *const *args, Py_ssize_t na static const char * const _keywords[] = {"status", NULL}; static _PyArg_Parser _parser = {NULL, _keywords, "waitstatus_to_exitcode", 0}; PyObject *argsbuf[1]; - int status; + PyObject *status_obj; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); if (!args) { goto exit; } - if (PyFloat_Check(args[0])) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - status = _PyLong_AsInt(args[0]); - if (status == -1 && PyErr_Occurred()) { - goto exit; - } - return_value = os_waitstatus_to_exitcode_impl(module, status); + status_obj = args[0]; + return_value = os_waitstatus_to_exitcode_impl(module, status_obj); exit: return return_value; @@ -9426,4 +9418,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=545c08f76d7a6286 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ba73b68f1c435ff6 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2157cbbe5d9b5..3386be0fbc85a 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7972,8 +7972,10 @@ os_waitpid_impl(PyObject *module, intptr_t pid, int options) if (res < 0) return (!async_err) ? posix_error() : NULL; + unsigned long long ustatus = (unsigned int)status; + /* shift the status left a byte so this is more like the POSIX waitpid */ - return Py_BuildValue(_Py_PARSE_INTPTR "i", res, status << 8); + return Py_BuildValue(_Py_PARSE_INTPTR "K", res, ustatus << 8); } #endif @@ -13829,7 +13831,7 @@ os__remove_dll_directory_impl(PyObject *module, PyObject *cookie) /*[clinic input] os.waitstatus_to_exitcode - status: int + status as status_obj: object Convert a wait status to an exit code. @@ -13847,10 +13849,20 @@ This function must not be called if WIFSTOPPED(status) is true. [clinic start generated code]*/ static PyObject * -os_waitstatus_to_exitcode_impl(PyObject *module, int status) -/*[clinic end generated code: output=c7c2265731f79b7a input=edfa5ca5006276fb]*/ +os_waitstatus_to_exitcode_impl(PyObject *module, PyObject *status_obj) +/*[clinic end generated code: output=db50b1b0ba3c7153 input=7fe2d7fdaea3db42]*/ { + if (PyFloat_Check(status_obj)) { + PyErr_SetString(PyExc_TypeError, + "integer argument expected, got float" ); + return NULL; + } #ifndef MS_WINDOWS + int status = _PyLong_AsInt(status_obj); + if (status == -1 && PyErr_Occurred()) { + return NULL; + } + WAIT_TYPE wait_status; WAIT_STATUS_INT(wait_status) = status; int exitcode; @@ -13889,8 +13901,19 @@ os_waitstatus_to_exitcode_impl(PyObject *module, int status) #else /* Windows implementation: see os.waitpid() implementation which uses _cwait(). */ - int exitcode = (status >> 8); - return PyLong_FromLong(exitcode); + unsigned long long status = PyLong_AsUnsignedLongLong(status_obj); + if (status == (unsigned long long)-1 && PyErr_Occurred()) { + return NULL; + } + + unsigned long long exitcode = (status >> 8); + /* ExitProcess() accepts an UINT type: + reject exit code which doesn't fit in an UINT */ + if (exitcode > UINT_MAX) { + PyErr_Format(PyExc_ValueError, "invalid exit code: %llu", exitcode); + return NULL; + } + return PyLong_FromUnsignedLong((unsigned long)exitcode); #endif } #endif From webhook-mailer at python.org Wed Apr 22 11:58:08 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 22 Apr 2020 15:58:08 -0000 Subject: [Python-checkins] bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654) Message-ID: https://github.com/python/cpython/commit/b07350901cac9197aef41855d8a4d56533636b91 commit: b07350901cac9197aef41855d8a4d56533636b91 branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-22T17:57:59+02:00 summary: bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654) Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number. files: A Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst M Lib/test/test_os.py M Modules/posixmodule.c diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 11454b2e88ff6..2a4ae1573ef59 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2675,12 +2675,37 @@ def test_getppid(self): # We are the parent of our subprocess self.assertEqual(int(stdout), os.getpid()) + def check_waitpid(self, code, exitcode): + if sys.platform == 'win32': + # On Windows, os.spawnv() simply joins arguments with spaces: + # arguments need to be quoted + args = [f'"{sys.executable}"', '-c', f'"{code}"'] + else: + args = [sys.executable, '-c', code] + pid = os.spawnv(os.P_NOWAIT, sys.executable, args) + + pid2, status = os.waitpid(pid, 0) + if sys.platform == 'win32': + self.assertEqual(status, exitcode << 8) + else: + self.assertTrue(os.WIFEXITED(status), status) + self.assertEqual(os.WEXITSTATUS(status), exitcode) + self.assertEqual(pid2, pid) + def test_waitpid(self): - args = [sys.executable, '-c', 'pass'] - # Add an implicit test for PyUnicode_FSConverter(). - pid = os.spawnv(os.P_NOWAIT, FakePath(args[0]), args) - status = os.waitpid(pid, 0) - self.assertEqual(status, (pid, 0)) + self.check_waitpid(code='pass', exitcode=0) + + def test_waitpid_exitcode(self): + exitcode = 23 + code = f'import sys; sys.exit({exitcode})' + self.check_waitpid(code, exitcode=exitcode) + + @unittest.skipUnless(sys.platform == 'win32', 'win32-specific test') + def test_waitpid_windows(self): + # bpo-40138: test os.waitpid() with exit code larger than INT_MAX. + STATUS_CONTROL_C_EXIT = 0xC000013A + code = f'import _winapi; _winapi.ExitProcess({STATUS_CONTROL_C_EXIT})' + self.check_waitpid(code, exitcode=STATUS_CONTROL_C_EXIT) class SpawnTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst new file mode 100644 index 0000000000000..ad5faf3865751 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst @@ -0,0 +1,2 @@ +Fix the Windows implementation of :func:`os.waitpid` for exit code larger than +``INT_MAX >> 8``. The exit status is now interpreted as an unsigned number. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d40827dfcb269..eb0b56aebbaa3 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7867,8 +7867,10 @@ os_waitpid_impl(PyObject *module, intptr_t pid, int options) if (res < 0) return (!async_err) ? posix_error() : NULL; + unsigned long long ustatus = (unsigned int)status; + /* shift the status left a byte so this is more like the POSIX waitpid */ - return Py_BuildValue(_Py_PARSE_INTPTR "i", res, status << 8); + return Py_BuildValue(_Py_PARSE_INTPTR "K", res, ustatus << 8); } #endif From webhook-mailer at python.org Wed Apr 22 12:04:54 2020 From: webhook-mailer at python.org (Steve Dower) Date: Wed, 22 Apr 2020 16:04:54 -0000 Subject: [Python-checkins] bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652) Message-ID: https://github.com/python/cpython/commit/9b498939009f49b8c772c89e8fc80efbfd8afcb5 commit: 9b498939009f49b8c772c89e8fc80efbfd8afcb5 branch: master author: Steve Dower committer: GitHub date: 2020-04-22T17:04:46+01:00 summary: bpo-40214: Fix ctypes WinDLL test with insecure flags (GH-19652) files: M Lib/ctypes/test/test_loading.py diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index a62044e370af6..5c48b0db4c393 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -158,11 +158,9 @@ def should_fail(command): # Relative path (but not just filename) should succeed should_pass("WinDLL('./_sqlite3.dll')") - # XXX: This test has started failing on Azure Pipelines CI. See - # bpo-40214 for more information. - if 0: - # Insecure load flags should succeed - should_pass("WinDLL('_sqlite3.dll', winmode=0)") + # Insecure load flags should succeed + # Clear the DLL directory to avoid safe search settings propagating + should_pass("windll.kernel32.SetDllDirectoryW(None); WinDLL('_sqlite3.dll', winmode=0)") # Full path load without DLL_LOAD_DIR shouldn't find dependency should_fail("WinDLL(nt._getfullpathname('_sqlite3.dll'), " + From webhook-mailer at python.org Wed Apr 22 12:16:52 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 16:16:52 -0000 Subject: [Python-checkins] bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654) Message-ID: https://github.com/python/cpython/commit/de5dcfa3bcabf52e43468a2b088ed71b5e5c4503 commit: de5dcfa3bcabf52e43468a2b088ed71b5e5c4503 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T09:16:42-07:00 summary: bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654) Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number. (cherry picked from commit b07350901cac9197aef41855d8a4d56533636b91) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst M Lib/test/test_os.py M Modules/posixmodule.c diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 411e5aa507389..3a76940a08947 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -2417,12 +2417,37 @@ def test_getppid(self): # We are the parent of our subprocess self.assertEqual(int(stdout), os.getpid()) + def check_waitpid(self, code, exitcode): + if sys.platform == 'win32': + # On Windows, os.spawnv() simply joins arguments with spaces: + # arguments need to be quoted + args = [f'"{sys.executable}"', '-c', f'"{code}"'] + else: + args = [sys.executable, '-c', code] + pid = os.spawnv(os.P_NOWAIT, sys.executable, args) + + pid2, status = os.waitpid(pid, 0) + if sys.platform == 'win32': + self.assertEqual(status, exitcode << 8) + else: + self.assertTrue(os.WIFEXITED(status), status) + self.assertEqual(os.WEXITSTATUS(status), exitcode) + self.assertEqual(pid2, pid) + def test_waitpid(self): - args = [sys.executable, '-c', 'pass'] - # Add an implicit test for PyUnicode_FSConverter(). - pid = os.spawnv(os.P_NOWAIT, FakePath(args[0]), args) - status = os.waitpid(pid, 0) - self.assertEqual(status, (pid, 0)) + self.check_waitpid(code='pass', exitcode=0) + + def test_waitpid_exitcode(self): + exitcode = 23 + code = f'import sys; sys.exit({exitcode})' + self.check_waitpid(code, exitcode=exitcode) + + @unittest.skipUnless(sys.platform == 'win32', 'win32-specific test') + def test_waitpid_windows(self): + # bpo-40138: test os.waitpid() with exit code larger than INT_MAX. + STATUS_CONTROL_C_EXIT = 0xC000013A + code = f'import _winapi; _winapi.ExitProcess({STATUS_CONTROL_C_EXIT})' + self.check_waitpid(code, exitcode=STATUS_CONTROL_C_EXIT) class SpawnTests(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst new file mode 100644 index 0000000000000..ad5faf3865751 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst @@ -0,0 +1,2 @@ +Fix the Windows implementation of :func:`os.waitpid` for exit code larger than +``INT_MAX >> 8``. The exit status is now interpreted as an unsigned number. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 87ef2a9e0d22e..977e49f432a34 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -7127,8 +7127,10 @@ os_waitpid_impl(PyObject *module, intptr_t pid, int options) if (res < 0) return (!async_err) ? posix_error() : NULL; + unsigned long long ustatus = (unsigned int)status; + /* shift the status left a byte so this is more like the POSIX waitpid */ - return Py_BuildValue(_Py_PARSE_INTPTR "i", res, status << 8); + return Py_BuildValue(_Py_PARSE_INTPTR "K", res, ustatus << 8); } #endif From webhook-mailer at python.org Wed Apr 22 12:27:32 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 16:27:32 -0000 Subject: [Python-checkins] bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480) Message-ID: https://github.com/python/cpython/commit/e7f8684ef77d280eb99b8533fd18455caa0fe194 commit: e7f8684ef77d280eb99b8533fd18455caa0fe194 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T09:27:24-07:00 summary: bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480) It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily (cherry picked from commit b310700976524b4b99ee319c947ca40468716fc9) Co-authored-by: Joshua Root files: A Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst M Lib/_osx_support.py M Lib/distutils/unixccompiler.py M Lib/test/test__osx_support.py M setup.py diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py index db6674ea293fb..e9efce7d7ed5b 100644 --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -211,7 +211,7 @@ def _remove_universal_flags(_config_vars): if cv in _config_vars and cv not in os.environ: flags = _config_vars[cv] flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII) - flags = re.sub('-isysroot [^ \t]*', ' ', flags) + flags = re.sub(r'-isysroot\s*\S+', ' ', flags) _save_modified_value(_config_vars, cv, flags) return _config_vars @@ -287,7 +287,7 @@ def _check_for_unavailable_sdk(_config_vars): # to /usr and /System/Library by either a standalone CLT # package or the CLT component within Xcode. cflags = _config_vars.get('CFLAGS', '') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): @@ -295,7 +295,7 @@ def _check_for_unavailable_sdk(_config_vars): # Do not alter a config var explicitly overridden by env var if cv in _config_vars and cv not in os.environ: flags = _config_vars[cv] - flags = re.sub(r'-isysroot\s+\S+(?:\s|$)', ' ', flags) + flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags) _save_modified_value(_config_vars, cv, flags) return _config_vars @@ -320,7 +320,7 @@ def compiler_fixup(compiler_so, cc_args): stripArch = stripSysroot = True else: stripArch = '-arch' in cc_args - stripSysroot = '-isysroot' in cc_args + stripSysroot = any(arg for arg in cc_args if arg.startswith('-isysroot')) if stripArch or 'ARCHFLAGS' in os.environ: while True: @@ -338,23 +338,34 @@ def compiler_fixup(compiler_so, cc_args): if stripSysroot: while True: - try: - index = compiler_so.index('-isysroot') + indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')] + if not indices: + break + index = indices[0] + if compiler_so[index] == '-isysroot': # Strip this argument and the next one: del compiler_so[index:index+2] - except ValueError: - break + else: + # It's '-isysroot/some/path' in one arg + del compiler_so[index:index+1] # Check if the SDK that is used during compilation actually exists, # the universal build requires the usage of a universal SDK and not all # users have that installed by default. sysroot = None - if '-isysroot' in cc_args: - idx = cc_args.index('-isysroot') - sysroot = cc_args[idx+1] - elif '-isysroot' in compiler_so: - idx = compiler_so.index('-isysroot') - sysroot = compiler_so[idx+1] + argvar = cc_args + indices = [i for i,x in enumerate(cc_args) if x.startswith('-isysroot')] + if not indices: + argvar = compiler_so + indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')] + + for idx in indices: + if argvar[idx] == '-isysroot': + sysroot = argvar[idx+1] + break + else: + sysroot = argvar[idx][len('-isysroot'):] + break if sysroot and not os.path.isdir(sysroot): from distutils import log diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index d10a78da31140..4d7a6de740ab3 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -288,7 +288,7 @@ def find_library_file(self, dirs, lib, debug=0): # vs # /usr/lib/libedit.dylib cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is None: sysroot = '/' else: diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py index 388a2b1a84b17..1a5d649b40f53 100644 --- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -174,6 +174,29 @@ def test__remove_universal_flags(self): _osx_support._remove_universal_flags( config_vars)) + def test__remove_universal_flags_alternate(self): + # bpo-38360: also test the alternate single-argument form of -isysroot + config_vars = { + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdk', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.4u.sdk -g', + } + expected_vars = { + 'CFLAGS': '-fno-strict-aliasing -g -O3 ', + 'LDFLAGS': ' -g', + 'CPPFLAGS': '-I. ', + 'BLDSHARED': 'gcc-4.0 -bundle -g', + 'LDSHARED': 'gcc-4.0 -bundle -g', + } + self.add_expected_saved_initial_values(config_vars, expected_vars) + + self.assertEqual(expected_vars, + _osx_support._remove_universal_flags( + config_vars)) + def test__remove_unsupported_archs(self): config_vars = { 'CC': 'clang', @@ -261,6 +284,34 @@ def test__check_for_unavailable_sdk(self): _osx_support._check_for_unavailable_sdk( config_vars)) + def test__check_for_unavailable_sdk_alternate(self): + # bpo-38360: also test the alternate single-argument form of -isysroot + config_vars = { + 'CC': 'clang', + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.1.sdk', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.1.sdk', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.1.sdk -g', + } + expected_vars = { + 'CC': 'clang', + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' + ' ', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. ', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + ' -g', + } + self.add_expected_saved_initial_values(config_vars, expected_vars) + + self.assertEqual(expected_vars, + _osx_support._check_for_unavailable_sdk( + config_vars)) + def test_get_platform_osx(self): # Note, get_platform_osx is currently tested more extensively # indirectly by test_sysconfig and test_distutils diff --git a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst new file mode 100644 index 0000000000000..e96ca14919919 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst @@ -0,0 +1 @@ +Support single-argument form of macOS -isysroot flag. diff --git a/setup.py b/setup.py index 88cff6164d712..bf90600eaad38 100644 --- a/setup.py +++ b/setup.py @@ -110,7 +110,7 @@ def macosx_sdk_root(): return MACOS_SDK_ROOT cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is not None: MACOS_SDK_ROOT = m.group(1) else: From webhook-mailer at python.org Wed Apr 22 13:13:54 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 17:13:54 -0000 Subject: [Python-checkins] bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480) Message-ID: https://github.com/python/cpython/commit/4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d commit: 4a6da0b63ba0fb811bfa3cacd69d22a9c0b24a4d branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T10:13:47-07:00 summary: bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480) It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily (cherry picked from commit b310700976524b4b99ee319c947ca40468716fc9) Co-authored-by: Joshua Root files: A Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst M Lib/_osx_support.py M Lib/distutils/unixccompiler.py M Lib/test/test__osx_support.py M setup.py diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py index db6674ea293fb..e9efce7d7ed5b 100644 --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -211,7 +211,7 @@ def _remove_universal_flags(_config_vars): if cv in _config_vars and cv not in os.environ: flags = _config_vars[cv] flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII) - flags = re.sub('-isysroot [^ \t]*', ' ', flags) + flags = re.sub(r'-isysroot\s*\S+', ' ', flags) _save_modified_value(_config_vars, cv, flags) return _config_vars @@ -287,7 +287,7 @@ def _check_for_unavailable_sdk(_config_vars): # to /usr and /System/Library by either a standalone CLT # package or the CLT component within Xcode. cflags = _config_vars.get('CFLAGS', '') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): @@ -295,7 +295,7 @@ def _check_for_unavailable_sdk(_config_vars): # Do not alter a config var explicitly overridden by env var if cv in _config_vars and cv not in os.environ: flags = _config_vars[cv] - flags = re.sub(r'-isysroot\s+\S+(?:\s|$)', ' ', flags) + flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags) _save_modified_value(_config_vars, cv, flags) return _config_vars @@ -320,7 +320,7 @@ def compiler_fixup(compiler_so, cc_args): stripArch = stripSysroot = True else: stripArch = '-arch' in cc_args - stripSysroot = '-isysroot' in cc_args + stripSysroot = any(arg for arg in cc_args if arg.startswith('-isysroot')) if stripArch or 'ARCHFLAGS' in os.environ: while True: @@ -338,23 +338,34 @@ def compiler_fixup(compiler_so, cc_args): if stripSysroot: while True: - try: - index = compiler_so.index('-isysroot') + indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')] + if not indices: + break + index = indices[0] + if compiler_so[index] == '-isysroot': # Strip this argument and the next one: del compiler_so[index:index+2] - except ValueError: - break + else: + # It's '-isysroot/some/path' in one arg + del compiler_so[index:index+1] # Check if the SDK that is used during compilation actually exists, # the universal build requires the usage of a universal SDK and not all # users have that installed by default. sysroot = None - if '-isysroot' in cc_args: - idx = cc_args.index('-isysroot') - sysroot = cc_args[idx+1] - elif '-isysroot' in compiler_so: - idx = compiler_so.index('-isysroot') - sysroot = compiler_so[idx+1] + argvar = cc_args + indices = [i for i,x in enumerate(cc_args) if x.startswith('-isysroot')] + if not indices: + argvar = compiler_so + indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')] + + for idx in indices: + if argvar[idx] == '-isysroot': + sysroot = argvar[idx+1] + break + else: + sysroot = argvar[idx][len('-isysroot'):] + break if sysroot and not os.path.isdir(sysroot): from distutils import log diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py index d10a78da31140..4d7a6de740ab3 100644 --- a/Lib/distutils/unixccompiler.py +++ b/Lib/distutils/unixccompiler.py @@ -288,7 +288,7 @@ def find_library_file(self, dirs, lib, debug=0): # vs # /usr/lib/libedit.dylib cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is None: sysroot = '/' else: diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py index 388a2b1a84b17..1a5d649b40f53 100644 --- a/Lib/test/test__osx_support.py +++ b/Lib/test/test__osx_support.py @@ -174,6 +174,29 @@ def test__remove_universal_flags(self): _osx_support._remove_universal_flags( config_vars)) + def test__remove_universal_flags_alternate(self): + # bpo-38360: also test the alternate single-argument form of -isysroot + config_vars = { + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.4u.sdk', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.4u.sdk -g', + } + expected_vars = { + 'CFLAGS': '-fno-strict-aliasing -g -O3 ', + 'LDFLAGS': ' -g', + 'CPPFLAGS': '-I. ', + 'BLDSHARED': 'gcc-4.0 -bundle -g', + 'LDSHARED': 'gcc-4.0 -bundle -g', + } + self.add_expected_saved_initial_values(config_vars, expected_vars) + + self.assertEqual(expected_vars, + _osx_support._remove_universal_flags( + config_vars)) + def test__remove_unsupported_archs(self): config_vars = { 'CC': 'clang', @@ -261,6 +284,34 @@ def test__check_for_unavailable_sdk(self): _osx_support._check_for_unavailable_sdk( config_vars)) + def test__check_for_unavailable_sdk_alternate(self): + # bpo-38360: also test the alternate single-argument form of -isysroot + config_vars = { + 'CC': 'clang', + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.1.sdk', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. -isysroot/Developer/SDKs/MacOSX10.1.sdk', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + '-isysroot/Developer/SDKs/MacOSX10.1.sdk -g', + } + expected_vars = { + 'CC': 'clang', + 'CFLAGS': '-fno-strict-aliasing -g -O3 -arch ppc -arch i386 ' + ' ', + 'LDFLAGS': '-arch ppc -arch i386 -g', + 'CPPFLAGS': '-I. ', + 'BLDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 -g', + 'LDSHARED': 'gcc-4.0 -bundle -arch ppc -arch i386 ' + ' -g', + } + self.add_expected_saved_initial_values(config_vars, expected_vars) + + self.assertEqual(expected_vars, + _osx_support._check_for_unavailable_sdk( + config_vars)) + def test_get_platform_osx(self): # Note, get_platform_osx is currently tested more extensively # indirectly by test_sysconfig and test_distutils diff --git a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst new file mode 100644 index 0000000000000..e96ca14919919 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst @@ -0,0 +1 @@ +Support single-argument form of macOS -isysroot flag. diff --git a/setup.py b/setup.py index 20d7f35652fe5..b168ed4082fd3 100644 --- a/setup.py +++ b/setup.py @@ -146,7 +146,7 @@ def macosx_sdk_root(): return MACOS_SDK_ROOT cflags = sysconfig.get_config_var('CFLAGS') - m = re.search(r'-isysroot\s+(\S+)', cflags) + m = re.search(r'-isysroot\s*(\S+)', cflags) if m is not None: MACOS_SDK_ROOT = m.group(1) else: From webhook-mailer at python.org Wed Apr 22 14:43:08 2020 From: webhook-mailer at python.org (Anthony Sottile) Date: Wed, 22 Apr 2020 18:43:08 -0000 Subject: [Python-checkins] bpo-40260: Remove unnecessary newline in compile() call (GH-19641) Message-ID: https://github.com/python/cpython/commit/39652cd8bdf7c82b7c6055089a4ed90ee546a448 commit: 39652cd8bdf7c82b7c6055089a4ed90ee546a448 branch: master author: Anthony Sottile committer: GitHub date: 2020-04-22T19:42:53+01:00 summary: bpo-40260: Remove unnecessary newline in compile() call (GH-19641) Because some people subclass this class and call undocumented methods, and we don't want to break them. files: M Lib/modulefinder.py diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index 361a6730c0674..aadcd23edbaaa 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -339,7 +339,7 @@ def load_module(self, fqname, fp, pathname, file_info): self.msgout(2, "load_module ->", m) return m if type == _PY_SOURCE: - co = compile(fp.read()+b'\n', pathname, 'exec') + co = compile(fp.read(), pathname, 'exec') elif type == _PY_COMPILED: try: data = fp.read() From webhook-mailer at python.org Wed Apr 22 15:05:18 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 19:05:18 -0000 Subject: [Python-checkins] bpo-40260: Remove unnecessary newline in compile() call (GH-19641) Message-ID: https://github.com/python/cpython/commit/fc45cb4400409572f05c8b54f2c6f06cbefb1b4e commit: fc45cb4400409572f05c8b54f2c6f06cbefb1b4e branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T12:05:10-07:00 summary: bpo-40260: Remove unnecessary newline in compile() call (GH-19641) Because some people subclass this class and call undocumented methods, and we don't want to break them. (cherry picked from commit 39652cd8bdf7c82b7c6055089a4ed90ee546a448) Co-authored-by: Anthony Sottile files: M Lib/modulefinder.py diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index 361a6730c0674..aadcd23edbaaa 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -339,7 +339,7 @@ def load_module(self, fqname, fp, pathname, file_info): self.msgout(2, "load_module ->", m) return m if type == _PY_SOURCE: - co = compile(fp.read()+b'\n', pathname, 'exec') + co = compile(fp.read(), pathname, 'exec') elif type == _PY_COMPILED: try: data = fp.read() From webhook-mailer at python.org Wed Apr 22 16:50:36 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 22 Apr 2020 20:50:36 -0000 Subject: [Python-checkins] Minor modernization and readability improvement to the tokenizer example (GH-19558) (GH-19661) Message-ID: https://github.com/python/cpython/commit/22a4849cd8356de0f6ed8586ed8aac7ad1f3df6c commit: 22a4849cd8356de0f6ed8586ed8aac7ad1f3df6c branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-22T13:50:32-07:00 summary: Minor modernization and readability improvement to the tokenizer example (GH-19558) (GH-19661) (cherry picked from commit bf1a81258c0ecc8b52b9dcc53321c066b3ed4a67) files: M Doc/library/re.rst diff --git a/Doc/library/re.rst b/Doc/library/re.rst index 7c950bfd5b1fd..9abbd8ba73616 100644 --- a/Doc/library/re.rst +++ b/Doc/library/re.rst @@ -1617,10 +1617,14 @@ The text categories are specified with regular expressions. The technique is to combine those into a single master regular expression and to loop over successive matches:: - import collections + from typing import NamedTuple import re - Token = collections.namedtuple('Token', ['type', 'value', 'line', 'column']) + class Token(NamedTuple): + type: str + value: str + line: int + column: int def tokenize(code): keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'} From webhook-mailer at python.org Wed Apr 22 17:05:53 2020 From: webhook-mailer at python.org (sweeneyde) Date: Wed, 22 Apr 2020 21:05:53 -0000 Subject: [Python-checkins] bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939) Message-ID: https://github.com/python/cpython/commit/a81849b0315277bb3937271174aaaa5059c0b445 commit: a81849b0315277bb3937271174aaaa5059c0b445 branch: master author: sweeneyde <36520290+sweeneyde at users.noreply.github.com> committer: GitHub date: 2020-04-22T23:05:48+02:00 summary: bpo-39939: Add str.removeprefix and str.removesuffix (GH-18939) Added str.removeprefix and str.removesuffix methods and corresponding bytes, bytearray, and collections.UserString methods to remove affixes from a string if present. See PEP 616 for a full description. files: A Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM.rst M Doc/library/stdtypes.rst M Doc/whatsnew/3.9.rst M Lib/collections/__init__.py M Lib/test/string_tests.py M Lib/test/test_doctest.py M Misc/ACKS M Objects/bytearrayobject.c M Objects/bytesobject.c M Objects/clinic/bytearrayobject.c.h M Objects/clinic/bytesobject.c.h M Objects/clinic/unicodeobject.c.h M Objects/unicodeobject.c diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index a1364d472da73..4e7729c83f49a 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1549,6 +1549,33 @@ expression support in the :mod:`re` module). interpreted as in slice notation. +.. method:: str.removeprefix(prefix, /) + + If the string starts with the *prefix* string, return + ``string[len(prefix):]``. Otherwise, return a copy of the original + string:: + + >>> 'TestHook'.removeprefix('Test') + 'Hook' + >>> 'BaseTestCase'.removeprefix('Test') + 'BaseTestCase' + + .. versionadded:: 3.9 + +.. method:: str.removesuffix(suffix, /) + + If the string ends with the *suffix* string and that *suffix* is not empty, + return ``string[:-len(suffix)]``. Otherwise, return a copy of the + original string:: + + >>> 'MiscTests'.removesuffix('Tests') + 'Misc' + >>> 'TmpDirMixin'.removesuffix('Tests') + 'TmpDirMixin' + + .. versionadded:: 3.9 + + .. method:: str.encode(encoding="utf-8", errors="strict") Return an encoded version of the string as a bytes object. Default encoding @@ -1831,6 +1858,14 @@ expression support in the :mod:`re` module). >>> 'www.example.com'.lstrip('cmowz.') 'example.com' + See :meth:`str.removeprefix` for a method that will remove a single prefix + string rather than all of a set of characters. For example:: + + >>> 'Arthur: three!'.lstrip('Arthur: ') + 'ee!' + >>> 'Arthur: three!'.removeprefix('Arthur: ') + 'three!' + .. staticmethod:: str.maketrans(x[, y[, z]]) @@ -1911,6 +1946,13 @@ expression support in the :mod:`re` module). >>> 'mississippi'.rstrip('ipz') 'mississ' + See :meth:`str.removesuffix` for a method that will remove a single suffix + string rather than all of a set of characters. For example:: + + >>> 'Monty Python'.rstrip(' Python') + 'M' + >>> 'Monty Python'.removesuffix(' Python') + 'Monty' .. method:: str.split(sep=None, maxsplit=-1) @@ -2591,6 +2633,50 @@ arbitrary binary data. Also accept an integer in the range 0 to 255 as the subsequence. +.. method:: bytes.removeprefix(prefix, /) + bytearray.removeprefix(prefix, /) + + If the binary data starts with the *prefix* string, return + ``bytes[len(prefix):]``. Otherwise, return a copy of the original + binary data:: + + >>> b'TestHook'.removeprefix(b'Test') + b'Hook' + >>> b'BaseTestCase'.removeprefix(b'Test') + b'BaseTestCase' + + The *prefix* may be any :term:`bytes-like object`. + + .. note:: + + The bytearray version of this method does *not* operate in place - + it always produces a new object, even if no changes were made. + + .. versionadded:: 3.9 + + +.. method:: bytes.removesuffix(suffix, /) + bytearray.removesuffix(suffix, /) + + If the binary data ends with the *suffix* string and that *suffix* is + not empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of + the original binary data:: + + >>> b'MiscTests'.removesuffix(b'Tests') + b'Misc' + >>> b'TmpDirMixin'.removesuffix(b'Tests') + b'TmpDirMixin' + + The *suffix* may be any :term:`bytes-like object`. + + .. note:: + + The bytearray version of this method does *not* operate in place - + it always produces a new object, even if no changes were made. + + .. versionadded:: 3.9 + + .. method:: bytes.decode(encoding="utf-8", errors="strict") bytearray.decode(encoding="utf-8", errors="strict") @@ -2841,7 +2927,14 @@ produce new objects. b'example.com' The binary sequence of byte values to remove may be any - :term:`bytes-like object`. + :term:`bytes-like object`. See :meth:`~bytes.removeprefix` for a method + that will remove a single prefix string rather than all of a set of + characters. For example:: + + >>> b'Arthur: three!'.lstrip(b'Arthur: ') + b'ee!' + >>> b'Arthur: three!'.removeprefix(b'Arthur: ') + b'three!' .. note:: @@ -2890,7 +2983,14 @@ produce new objects. b'mississ' The binary sequence of byte values to remove may be any - :term:`bytes-like object`. + :term:`bytes-like object`. See :meth:`~bytes.removesuffix` for a method + that will remove a single suffix string rather than all of a set of + characters. For example:: + + >>> b'Monty Python'.rstrip(b' Python') + b'M' + >>> b'Monty Python'.removesuffix(b' Python') + b'Monty' .. note:: diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 8064785178c49..ee851706055a3 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -105,6 +105,16 @@ Merge (``|``) and update (``|=``) operators have been added to the built-in :class:`dict` class. See :pep:`584` for a full description. (Contributed by Brandt Bucher in :issue:`36144`.) +PEP 616: New removeprefix() and removesuffix() string methods +------------------------------------------------------------- + +:meth:`str.removeprefix(prefix)` and +:meth:`str.removesuffix(suffix)` have been added +to easily remove an unneeded prefix or a suffix from a string. Corresponding +``bytes``, ``bytearray``, and ``collections.UserString`` methods have also been +added. See :pep:`616` for a full description. (Contributed by Dennis Sweeney in +:issue:`18939`.) + Other Language Changes ====================== diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index e19840650dd7e..bb9a605a994f4 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -1239,6 +1239,14 @@ def count(self, sub, start=0, end=_sys.maxsize): if isinstance(sub, UserString): sub = sub.data return self.data.count(sub, start, end) + def removeprefix(self, prefix, /): + if isinstance(prefix, UserString): + prefix = prefix.data + return self.__class__(self.data.removeprefix(prefix)) + def removesuffix(self, suffix, /): + if isinstance(suffix, UserString): + suffix = suffix.data + return self.__class__(self.data.removesuffix(suffix)) def encode(self, encoding='utf-8', errors='strict'): encoding = 'utf-8' if encoding is None else encoding errors = 'strict' if errors is None else errors diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 948e2a3c3c56b..527f505c0169b 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -682,6 +682,42 @@ def test_replace_overflow(self): self.checkraises(OverflowError, A2_16, "replace", "A", A2_16) self.checkraises(OverflowError, A2_16, "replace", "AA", A2_16+A2_16) + def test_removeprefix(self): + self.checkequal('am', 'spam', 'removeprefix', 'sp') + self.checkequal('spamspam', 'spamspamspam', 'removeprefix', 'spam') + self.checkequal('spam', 'spam', 'removeprefix', 'python') + self.checkequal('spam', 'spam', 'removeprefix', 'spider') + self.checkequal('spam', 'spam', 'removeprefix', 'spam and eggs') + + self.checkequal('', '', 'removeprefix', '') + self.checkequal('', '', 'removeprefix', 'abcde') + self.checkequal('abcde', 'abcde', 'removeprefix', '') + self.checkequal('', 'abcde', 'removeprefix', 'abcde') + + self.checkraises(TypeError, 'hello', 'removeprefix') + self.checkraises(TypeError, 'hello', 'removeprefix', 42) + self.checkraises(TypeError, 'hello', 'removeprefix', 42, 'h') + self.checkraises(TypeError, 'hello', 'removeprefix', 'h', 42) + self.checkraises(TypeError, 'hello', 'removeprefix', ("he", "l")) + + def test_removesuffix(self): + self.checkequal('sp', 'spam', 'removesuffix', 'am') + self.checkequal('spamspam', 'spamspamspam', 'removesuffix', 'spam') + self.checkequal('spam', 'spam', 'removesuffix', 'python') + self.checkequal('spam', 'spam', 'removesuffix', 'blam') + self.checkequal('spam', 'spam', 'removesuffix', 'eggs and spam') + + self.checkequal('', '', 'removesuffix', '') + self.checkequal('', '', 'removesuffix', 'abcde') + self.checkequal('abcde', 'abcde', 'removesuffix', '') + self.checkequal('', 'abcde', 'removesuffix', 'abcde') + + self.checkraises(TypeError, 'hello', 'removesuffix') + self.checkraises(TypeError, 'hello', 'removesuffix', 42) + self.checkraises(TypeError, 'hello', 'removesuffix', 42, 'h') + self.checkraises(TypeError, 'hello', 'removesuffix', 'h', 42) + self.checkraises(TypeError, 'hello', 'removesuffix', ("lo", "l")) + def test_capitalize(self): self.checkequal(' hello ', ' hello ', 'capitalize') self.checkequal('Hello ', 'Hello ','capitalize') diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 71426277d2d93..16196fed39247 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -665,7 +665,7 @@ def non_Python_modules(): r""" >>> import builtins >>> tests = doctest.DocTestFinder().find(builtins) - >>> 810 < len(tests) < 830 # approximate number of objects with docstrings + >>> 816 < len(tests) < 836 # approximate number of objects with docstrings True >>> real_tests = [t for t in tests if len(t.examples) > 0] >>> len(real_tests) # objects that actually have doctests diff --git a/Misc/ACKS b/Misc/ACKS index 8cb95dc0cf863..69865febeeae1 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1660,6 +1660,7 @@ Hisao Suzuki Kalle Svensson Andrew Svetlov Paul Swartz +Dennis Sweeney Al Sweigart Sviatoslav Sydorenko Thenault Sylvain diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM.rst new file mode 100644 index 0000000000000..bf094f1ce9b9b --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM.rst @@ -0,0 +1,5 @@ +Added str.removeprefix and str.removesuffix methods and corresponding +bytes, bytearray, and collections.UserString methods to remove affixes +from a string if present. +See :pep:`616` for a full description. +Patch by Dennis Sweeney. diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index b271e57abb686..5a803be6277c8 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1181,6 +1181,71 @@ bytearray_endswith(PyByteArrayObject *self, PyObject *args) return _Py_bytes_endswith(PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self), args); } +/*[clinic input] +bytearray.removeprefix as bytearray_removeprefix + + prefix: Py_buffer + / + +Return a bytearray with the given prefix string removed if present. + +If the bytearray starts with the prefix string, return +bytearray[len(prefix):]. Otherwise, return a copy of the original +bytearray. +[clinic start generated code]*/ + +static PyObject * +bytearray_removeprefix_impl(PyByteArrayObject *self, Py_buffer *prefix) +/*[clinic end generated code: output=6cabc585e7f502e0 input=968aada38aedd262]*/ +{ + const char *self_start = PyByteArray_AS_STRING(self); + Py_ssize_t self_len = PyByteArray_GET_SIZE(self); + const char *prefix_start = prefix->buf; + Py_ssize_t prefix_len = prefix->len; + + if (self_len >= prefix_len + && memcmp(self_start, prefix_start, prefix_len) == 0) + { + return PyByteArray_FromStringAndSize(self_start + prefix_len, + self_len - prefix_len); + } + + return PyByteArray_FromStringAndSize(self_start, self_len); +} + +/*[clinic input] +bytearray.removesuffix as bytearray_removesuffix + + suffix: Py_buffer + / + +Return a bytearray with the given suffix string removed if present. + +If the bytearray ends with the suffix string and that suffix is not +empty, return bytearray[:-len(suffix)]. Otherwise, return a copy of +the original bytearray. +[clinic start generated code]*/ + +static PyObject * +bytearray_removesuffix_impl(PyByteArrayObject *self, Py_buffer *suffix) +/*[clinic end generated code: output=2bc8cfb79de793d3 input=c1827e810b2f6b99]*/ +{ + const char *self_start = PyByteArray_AS_STRING(self); + Py_ssize_t self_len = PyByteArray_GET_SIZE(self); + const char *suffix_start = suffix->buf; + Py_ssize_t suffix_len = suffix->len; + + if (self_len >= suffix_len + && memcmp(self_start + self_len - suffix_len, + suffix_start, suffix_len) == 0) + { + return PyByteArray_FromStringAndSize(self_start, + self_len - suffix_len); + } + + return PyByteArray_FromStringAndSize(self_start, self_len); +} + /*[clinic input] bytearray.translate @@ -2203,6 +2268,8 @@ bytearray_methods[] = { BYTEARRAY_POP_METHODDEF BYTEARRAY_REMOVE_METHODDEF BYTEARRAY_REPLACE_METHODDEF + BYTEARRAY_REMOVEPREFIX_METHODDEF + BYTEARRAY_REMOVESUFFIX_METHODDEF BYTEARRAY_REVERSE_METHODDEF {"rfind", (PyCFunction)bytearray_rfind, METH_VARARGS, _Py_rfind__doc__}, {"rindex", (PyCFunction)bytearray_rindex, METH_VARARGS, _Py_rindex__doc__}, diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c index 06ead2b58f980..25d9814dd6d8b 100644 --- a/Objects/bytesobject.c +++ b/Objects/bytesobject.c @@ -2182,6 +2182,81 @@ bytes_replace_impl(PyBytesObject *self, Py_buffer *old, Py_buffer *new, /** End DALKE **/ +/*[clinic input] +bytes.removeprefix as bytes_removeprefix + + prefix: Py_buffer + / + +Return a bytes object with the given prefix string removed if present. + +If the bytes starts with the prefix string, return bytes[len(prefix):]. +Otherwise, return a copy of the original bytes. +[clinic start generated code]*/ + +static PyObject * +bytes_removeprefix_impl(PyBytesObject *self, Py_buffer *prefix) +/*[clinic end generated code: output=f006865331a06ab6 input=0c93bac817a8502c]*/ +{ + const char *self_start = PyBytes_AS_STRING(self); + Py_ssize_t self_len = PyBytes_GET_SIZE(self); + const char *prefix_start = prefix->buf; + Py_ssize_t prefix_len = prefix->len; + + if (self_len >= prefix_len + && prefix_len > 0 + && memcmp(self_start, prefix_start, prefix_len) == 0) + { + return PyBytes_FromStringAndSize(self_start + prefix_len, + self_len - prefix_len); + } + + if (PyBytes_CheckExact(self)) { + Py_INCREF(self); + return (PyObject *)self; + } + + return PyBytes_FromStringAndSize(self_start, self_len); +} + +/*[clinic input] +bytes.removesuffix as bytes_removesuffix + + suffix: Py_buffer + / + +Return a bytes object with the given suffix string removed if present. + +If the bytes ends with the suffix string and that suffix is not empty, +return bytes[:-len(prefix)]. Otherwise, return a copy of the original +bytes. +[clinic start generated code]*/ + +static PyObject * +bytes_removesuffix_impl(PyBytesObject *self, Py_buffer *suffix) +/*[clinic end generated code: output=d887d308e3242eeb input=9f4e1da8c637bbf1]*/ +{ + const char *self_start = PyBytes_AS_STRING(self); + Py_ssize_t self_len = PyBytes_GET_SIZE(self); + const char *suffix_start = suffix->buf; + Py_ssize_t suffix_len = suffix->len; + + if (self_len >= suffix_len + && suffix_len > 0 + && memcmp(self_start + self_len - suffix_len, + suffix_start, suffix_len) == 0) + { + return PyBytes_FromStringAndSize(self_start, + self_len - suffix_len); + } + + if (PyBytes_CheckExact(self)) { + Py_INCREF(self); + return (PyObject *)self; + } + + return PyBytes_FromStringAndSize(self_start, self_len); +} static PyObject * bytes_startswith(PyBytesObject *self, PyObject *args) @@ -2421,6 +2496,8 @@ bytes_methods[] = { BYTES_MAKETRANS_METHODDEF BYTES_PARTITION_METHODDEF BYTES_REPLACE_METHODDEF + BYTES_REMOVEPREFIX_METHODDEF + BYTES_REMOVESUFFIX_METHODDEF {"rfind", (PyCFunction)bytes_rfind, METH_VARARGS, _Py_rfind__doc__}, {"rindex", (PyCFunction)bytes_rindex, METH_VARARGS, _Py_rindex__doc__}, STRINGLIB_RJUST_METHODDEF diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 05577077a5f8d..35ba1ff3d576d 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -38,6 +38,86 @@ bytearray_copy(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) return bytearray_copy_impl(self); } +PyDoc_STRVAR(bytearray_removeprefix__doc__, +"removeprefix($self, prefix, /)\n" +"--\n" +"\n" +"Return a bytearray with the given prefix string removed if present.\n" +"\n" +"If the bytearray starts with the prefix string, return\n" +"bytearray[len(prefix):]. Otherwise, return a copy of the original\n" +"bytearray."); + +#define BYTEARRAY_REMOVEPREFIX_METHODDEF \ + {"removeprefix", (PyCFunction)bytearray_removeprefix, METH_O, bytearray_removeprefix__doc__}, + +static PyObject * +bytearray_removeprefix_impl(PyByteArrayObject *self, Py_buffer *prefix); + +static PyObject * +bytearray_removeprefix(PyByteArrayObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_buffer prefix = {NULL, NULL}; + + if (PyObject_GetBuffer(arg, &prefix, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&prefix, 'C')) { + _PyArg_BadArgument("removeprefix", "argument", "contiguous buffer", arg); + goto exit; + } + return_value = bytearray_removeprefix_impl(self, &prefix); + +exit: + /* Cleanup for prefix */ + if (prefix.obj) { + PyBuffer_Release(&prefix); + } + + return return_value; +} + +PyDoc_STRVAR(bytearray_removesuffix__doc__, +"removesuffix($self, suffix, /)\n" +"--\n" +"\n" +"Return a bytearray with the given suffix string removed if present.\n" +"\n" +"If the bytearray ends with the suffix string and that suffix is not\n" +"empty, return bytearray[:-len(suffix)]. Otherwise, return a copy of\n" +"the original bytearray."); + +#define BYTEARRAY_REMOVESUFFIX_METHODDEF \ + {"removesuffix", (PyCFunction)bytearray_removesuffix, METH_O, bytearray_removesuffix__doc__}, + +static PyObject * +bytearray_removesuffix_impl(PyByteArrayObject *self, Py_buffer *suffix); + +static PyObject * +bytearray_removesuffix(PyByteArrayObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_buffer suffix = {NULL, NULL}; + + if (PyObject_GetBuffer(arg, &suffix, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&suffix, 'C')) { + _PyArg_BadArgument("removesuffix", "argument", "contiguous buffer", arg); + goto exit; + } + return_value = bytearray_removesuffix_impl(self, &suffix); + +exit: + /* Cleanup for suffix */ + if (suffix.obj) { + PyBuffer_Release(&suffix); + } + + return return_value; +} + PyDoc_STRVAR(bytearray_translate__doc__, "translate($self, table, /, delete=b\'\')\n" "--\n" @@ -1011,4 +1091,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=508dce79cf2dffcc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b2919f76709e48dc input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index 22024ab155c8e..063a3777b4907 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -526,6 +526,85 @@ bytes_replace(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs) return return_value; } +PyDoc_STRVAR(bytes_removeprefix__doc__, +"removeprefix($self, prefix, /)\n" +"--\n" +"\n" +"Return a bytes object with the given prefix string removed if present.\n" +"\n" +"If the bytes starts with the prefix string, return bytes[len(prefix):].\n" +"Otherwise, return a copy of the original bytes."); + +#define BYTES_REMOVEPREFIX_METHODDEF \ + {"removeprefix", (PyCFunction)bytes_removeprefix, METH_O, bytes_removeprefix__doc__}, + +static PyObject * +bytes_removeprefix_impl(PyBytesObject *self, Py_buffer *prefix); + +static PyObject * +bytes_removeprefix(PyBytesObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_buffer prefix = {NULL, NULL}; + + if (PyObject_GetBuffer(arg, &prefix, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&prefix, 'C')) { + _PyArg_BadArgument("removeprefix", "argument", "contiguous buffer", arg); + goto exit; + } + return_value = bytes_removeprefix_impl(self, &prefix); + +exit: + /* Cleanup for prefix */ + if (prefix.obj) { + PyBuffer_Release(&prefix); + } + + return return_value; +} + +PyDoc_STRVAR(bytes_removesuffix__doc__, +"removesuffix($self, suffix, /)\n" +"--\n" +"\n" +"Return a bytes object with the given suffix string removed if present.\n" +"\n" +"If the bytes ends with the suffix string and that suffix is not empty,\n" +"return bytes[:-len(prefix)]. Otherwise, return a copy of the original\n" +"bytes."); + +#define BYTES_REMOVESUFFIX_METHODDEF \ + {"removesuffix", (PyCFunction)bytes_removesuffix, METH_O, bytes_removesuffix__doc__}, + +static PyObject * +bytes_removesuffix_impl(PyBytesObject *self, Py_buffer *suffix); + +static PyObject * +bytes_removesuffix(PyBytesObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + Py_buffer suffix = {NULL, NULL}; + + if (PyObject_GetBuffer(arg, &suffix, PyBUF_SIMPLE) != 0) { + goto exit; + } + if (!PyBuffer_IsContiguous(&suffix, 'C')) { + _PyArg_BadArgument("removesuffix", "argument", "contiguous buffer", arg); + goto exit; + } + return_value = bytes_removesuffix_impl(self, &suffix); + +exit: + /* Cleanup for suffix */ + if (suffix.obj) { + PyBuffer_Release(&suffix); + } + + return return_value; +} + PyDoc_STRVAR(bytes_decode__doc__, "decode($self, /, encoding=\'utf-8\', errors=\'strict\')\n" "--\n" @@ -755,4 +834,4 @@ bytes_hex(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject exit: return return_value; } -/*[clinic end generated code: output=ca60dfccf8d51e88 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=220388917d7bf751 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 0d134064bab09..cf81df4af67b2 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -754,6 +754,77 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) return return_value; } +PyDoc_STRVAR(unicode_removeprefix__doc__, +"removeprefix($self, prefix, /)\n" +"--\n" +"\n" +"Return a str with the given prefix string removed if present.\n" +"\n" +"If the string starts with the prefix string, return string[len(prefix):].\n" +"Otherwise, return a copy of the original string."); + +#define UNICODE_REMOVEPREFIX_METHODDEF \ + {"removeprefix", (PyCFunction)unicode_removeprefix, METH_O, unicode_removeprefix__doc__}, + +static PyObject * +unicode_removeprefix_impl(PyObject *self, PyObject *prefix); + +static PyObject * +unicode_removeprefix(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *prefix; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("removeprefix", "argument", "str", arg); + goto exit; + } + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + prefix = arg; + return_value = unicode_removeprefix_impl(self, prefix); + +exit: + return return_value; +} + +PyDoc_STRVAR(unicode_removesuffix__doc__, +"removesuffix($self, suffix, /)\n" +"--\n" +"\n" +"Return a str with the given suffix string removed if present.\n" +"\n" +"If the string ends with the suffix string and that suffix is not empty,\n" +"return string[:-len(suffix)]. Otherwise, return a copy of the original\n" +"string."); + +#define UNICODE_REMOVESUFFIX_METHODDEF \ + {"removesuffix", (PyCFunction)unicode_removesuffix, METH_O, unicode_removesuffix__doc__}, + +static PyObject * +unicode_removesuffix_impl(PyObject *self, PyObject *suffix); + +static PyObject * +unicode_removesuffix(PyObject *self, PyObject *arg) +{ + PyObject *return_value = NULL; + PyObject *suffix; + + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("removesuffix", "argument", "str", arg); + goto exit; + } + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + suffix = arg; + return_value = unicode_removesuffix_impl(self, suffix); + +exit: + return return_value; +} + PyDoc_STRVAR(unicode_rjust__doc__, "rjust($self, width, fillchar=\' \', /)\n" "--\n" @@ -1232,4 +1303,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=e4ed33400979c7e8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b91233f3722643be input=a9049054013a1b77]*/ diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 51775df199d1e..aba7407533c4e 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -12789,6 +12789,61 @@ unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new, return replace(self, old, new, count); } +/*[clinic input] +str.removeprefix as unicode_removeprefix + + prefix: unicode + / + +Return a str with the given prefix string removed if present. + +If the string starts with the prefix string, return string[len(prefix):]. +Otherwise, return a copy of the original string. +[clinic start generated code]*/ + +static PyObject * +unicode_removeprefix_impl(PyObject *self, PyObject *prefix) +/*[clinic end generated code: output=f1e5945e9763bcb9 input=27ec40b99a37eb88]*/ +{ + int match = tailmatch(self, prefix, 0, PY_SSIZE_T_MAX, -1); + if (match == -1) { + return NULL; + } + if (match) { + return PyUnicode_Substring(self, PyUnicode_GET_LENGTH(prefix), + PyUnicode_GET_LENGTH(self)); + } + return unicode_result_unchanged(self); +} + +/*[clinic input] +str.removesuffix as unicode_removesuffix + + suffix: unicode + / + +Return a str with the given suffix string removed if present. + +If the string ends with the suffix string and that suffix is not empty, +return string[:-len(suffix)]. Otherwise, return a copy of the original +string. +[clinic start generated code]*/ + +static PyObject * +unicode_removesuffix_impl(PyObject *self, PyObject *suffix) +/*[clinic end generated code: output=d36629e227636822 input=12cc32561e769be4]*/ +{ + int match = tailmatch(self, suffix, 0, PY_SSIZE_T_MAX, +1); + if (match == -1) { + return NULL; + } + if (match) { + return PyUnicode_Substring(self, 0, PyUnicode_GET_LENGTH(self) + - PyUnicode_GET_LENGTH(suffix)); + } + return unicode_result_unchanged(self); +} + static PyObject * unicode_repr(PyObject *unicode) { @@ -14105,6 +14160,8 @@ static PyMethodDef unicode_methods[] = { UNICODE_UPPER_METHODDEF {"startswith", (PyCFunction) unicode_startswith, METH_VARARGS, startswith__doc__}, {"endswith", (PyCFunction) unicode_endswith, METH_VARARGS, endswith__doc__}, + UNICODE_REMOVEPREFIX_METHODDEF + UNICODE_REMOVESUFFIX_METHODDEF UNICODE_ISASCII_METHODDEF UNICODE_ISLOWER_METHODDEF UNICODE_ISUPPER_METHODDEF From webhook-mailer at python.org Wed Apr 22 18:29:52 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 22 Apr 2020 22:29:52 -0000 Subject: [Python-checkins] bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503) Message-ID: https://github.com/python/cpython/commit/c5fc15685202cda73f7c3f5c6f299b0945f58508 commit: c5fc15685202cda73f7c3f5c6f299b0945f58508 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-22T23:29:27+01:00 summary: bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503) Co-authored-by: Guido van Rossum Co-authored-by: Lysandros Nikolaou files: A Grammar/python.gram A Include/pegen_interface.h A Lib/test/test_peg_generator/__init__.py A Lib/test/test_peg_generator/__main__.py A Lib/test/test_peg_generator/ast_dump.py A Lib/test/test_peg_generator/test_c_parser.py A Lib/test/test_peg_generator/test_first_sets.py A Lib/test/test_peg_generator/test_pegen.py A Lib/test/test_peg_parser.py A Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334.CTLGEp.rst A Modules/_peg_parser.c A Parser/pegen/parse.c A Parser/pegen/parse_string.c A Parser/pegen/parse_string.h A Parser/pegen/peg_api.c A Parser/pegen/pegen.c A Parser/pegen/pegen.h A Tools/peg_generator/.clang-format A Tools/peg_generator/.gitignore A Tools/peg_generator/Makefile A Tools/peg_generator/data/cprog.py A Tools/peg_generator/data/xxl.zip A Tools/peg_generator/mypy.ini A Tools/peg_generator/peg_extension/peg_extension.c A Tools/peg_generator/pegen/__init__.py A Tools/peg_generator/pegen/__main__.py A Tools/peg_generator/pegen/build.py A Tools/peg_generator/pegen/c_generator.py A Tools/peg_generator/pegen/first_sets.py A Tools/peg_generator/pegen/grammar.py A Tools/peg_generator/pegen/grammar_parser.py A Tools/peg_generator/pegen/grammar_visualizer.py A Tools/peg_generator/pegen/metagrammar.gram A Tools/peg_generator/pegen/parser.py A Tools/peg_generator/pegen/parser_generator.py A Tools/peg_generator/pegen/python_generator.py A Tools/peg_generator/pegen/sccutils.py A Tools/peg_generator/pegen/testutil.py A Tools/peg_generator/pegen/tokenizer.py A Tools/peg_generator/pyproject.toml A Tools/peg_generator/requirements.pip A Tools/peg_generator/scripts/__init__.py A Tools/peg_generator/scripts/ast_timings.py A Tools/peg_generator/scripts/benchmark.py A Tools/peg_generator/scripts/download_pypi_packages.py A Tools/peg_generator/scripts/find_max_nesting.py A Tools/peg_generator/scripts/grammar_grapher.py A Tools/peg_generator/scripts/joinstats.py A Tools/peg_generator/scripts/show_parse.py A Tools/peg_generator/scripts/test_parse_directory.py A Tools/peg_generator/scripts/test_pypi_packages.py M .github/workflows/build.yml M .travis.yml M Doc/using/cmdline.rst M Include/compile.h M Include/cpython/initconfig.h M Lib/test/test_cmd_line_script.py M Lib/test/test_codeop.py M Lib/test/test_compile.py M Lib/test/test_embed.py M Lib/test/test_eof.py M Lib/test/test_exceptions.py M Lib/test/test_flufl.py M Lib/test/test_fstring.py M Lib/test/test_generators.py M Lib/test/test_parser.py M Lib/test/test_positional_only_arg.py M Lib/test/test_string_literals.py M Lib/test/test_syntax.py M Lib/test/test_sys.py M Lib/test/test_traceback.py M Lib/test/test_type_comments.py M Lib/test/test_unpack_ex.py M Lib/test/test_unparse.py M Makefile.pre.in M Modules/Setup M PC/config.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters M PCbuild/regen.vcxproj M Programs/_testembed.c M Python/ast_opt.c M Python/bltinmodule.c M Python/compile.c M Python/importlib.h M Python/importlib_external.h M Python/initconfig.c M Python/pythonrun.c M Python/sysmodule.c M Tools/README M Tools/scripts/run_tests.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50d1561518bd8..c9e9c53da23fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ on: - '**/*.rst' pull_request: branches: + - pegen - master - 3.8 - 3.7 @@ -50,6 +51,22 @@ jobs: build_macos: name: 'macOS' runs-on: macos-latest + env: + PYTHONOLDPARSER: old + steps: + - uses: actions/checkout at v1 + - name: Configure CPython + run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev + - name: Build CPython + run: make -j4 + - name: Display build info + run: make pythoninfo + - name: Tests + run: make buildbottest TESTOPTS="-j4 -uall,-cpu" + + build_macos_pegen: + name: 'macOS - Pegen' + runs-on: macos-latest steps: - uses: actions/checkout at v1 - name: Configure CPython @@ -64,6 +81,34 @@ jobs: build_ubuntu: name: 'Ubuntu' runs-on: ubuntu-latest + env: + OPENSSL_VER: 1.1.1f + PYTHONOLDPARSER: old + steps: + - uses: actions/checkout at v1 + - name: Install Dependencies + run: sudo ./.github/workflows/posix-deps-apt.sh + - name: 'Restore OpenSSL build' + id: cache-openssl + uses: actions/cache at v1 + with: + path: ./multissl/openssl/${{ env.OPENSSL_VER }} + key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} + - name: Install OpenSSL + if: steps.cache-openssl.outputs.cache-hit != 'true' + run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux + - name: Configure CPython + run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER + - name: Build CPython + run: make -j4 + - name: Display build info + run: make pythoninfo + - name: Tests + run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" + + build_ubuntu_pegen: + name: 'Ubuntu - Pegen' + runs-on: ubuntu-latest env: OPENSSL_VER: 1.1.1f steps: diff --git a/.travis.yml b/.travis.yml index c7fa9e3a7ca4f..80d7a16318adf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: c -dist: xenial +dist: bionic # To cache doc-building dependencies and C compiler output. cache: @@ -22,6 +22,7 @@ env: branches: only: - master + - pegen - /^\d\.\d+$/ - buildbot-custom @@ -157,7 +158,9 @@ install: before_script: # -Og is much faster than -O0 - CFLAGS="${CFLAGS} -Og" ./configure --with-pydebug - - make -j4 regen-all + - eval "$(pyenv init -)" + - pyenv global 3.8 + - PYTHON_FOR_REGEN=python3.8 make -j4 regen-all - changes=`git status --porcelain` - | # Check for changes in regenerated files diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index 9b30c288211ed..a815436b3a8ee 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -426,6 +426,8 @@ Miscellaneous options defines the following possible values: * ``-X faulthandler`` to enable :mod:`faulthandler`; + * ``-X oldparser``: enable the traditional LL(1) parser. See also + :envvar:`PYTHONOLDPARSER`. * ``-X showrefcount`` to output the total reference count and number of used memory blocks when the program finishes or after each statement in the interactive interpreter. This only works on debug builds. @@ -574,6 +576,12 @@ conflict. :option:`-d` multiple times. +.. envvar:: PYTHONOLDPARSER + + If this is set it is equivalent to specifying the :option:`-X` + ``oldparser`` option. + + .. envvar:: PYTHONINSPECT If this is set to a non-empty string it is equivalent to specifying the diff --git a/Grammar/python.gram b/Grammar/python.gram new file mode 100644 index 0000000000000..40ca3dc8d12a5 --- /dev/null +++ b/Grammar/python.gram @@ -0,0 +1,555 @@ +# Simplified grammar for Python + + at bytecode True + at trailer ''' +void * +_PyPegen_parse(Parser *p) +{ + // Initialize keywords + p->keywords = reserved_keywords; + p->n_keyword_lists = n_keyword_lists; + + // Run parser + void *result = NULL; + if (p->start_rule == Py_file_input) { + result = file_rule(p); + } else if (p->start_rule == Py_single_input) { + result = interactive_rule(p); + } else if (p->start_rule == Py_eval_input) { + result = eval_rule(p); + } else if (p->start_rule == Py_fstring_input) { + result = fstring_rule(p); + } + + return result; +} + +// The end +''' +file[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } +interactive[mod_ty]: a=statement_newline { Interactive(a, p->arena) } +eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { Expression(a, p->arena) } +fstring[expr_ty]: star_expressions + +statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) } +statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) } | simple_stmt +statement_newline[asdl_seq*]: + | a=compound_stmt NEWLINE { _PyPegen_singleton_seq(p, a) } + | simple_stmt + | NEWLINE { _PyPegen_singleton_seq(p, CHECK(_Py_Pass(EXTRA))) } + | ENDMARKER { _PyPegen_interactive_exit(p) } +simple_stmt[asdl_seq*]: + | a=small_stmt !';' NEWLINE { _PyPegen_singleton_seq(p, a) } # Not needed, there for speedup + | a=';'.small_stmt+ [';'] NEWLINE { a } +# NOTE: assignment MUST precede expression, else parsing a simple assignment +# will throw a SyntaxError. +small_stmt[stmt_ty] (memo): + | assignment + | e=star_expressions { _Py_Expr(e, EXTRA) } + | &'return' return_stmt + | &('import' | 'from') import_stmt + | &'raise' raise_stmt + | 'pass' { _Py_Pass(EXTRA) } + | &'del' del_stmt + | &'yield' yield_stmt + | &'assert' assert_stmt + | 'break' { _Py_Break(EXTRA) } + | 'continue' { _Py_Continue(EXTRA) } + | &'global' global_stmt + | &'nonlocal' nonlocal_stmt +compound_stmt[stmt_ty]: + | &('def' | '@' | ASYNC) function_def + | &'if' if_stmt + | &('class' | '@') class_def + | &('with' | ASYNC) with_stmt + | &('for' | ASYNC) for_stmt + | &'try' try_stmt + | &'while' while_stmt + +# NOTE: annotated_rhs may start with 'yield'; yield_expr must start with 'yield' +assignment: + | a=NAME ':' b=expression c=['=' d=annotated_rhs { d }] { + _Py_AnnAssign(CHECK(_PyPegen_set_expr_context(p, a, Store)), b, c, 1, EXTRA) } + | a=('(' b=inside_paren_ann_assign_target ')' { b } + | ann_assign_subscript_attribute_target) ':' b=expression c=['=' d=annotated_rhs { d }] { + _Py_AnnAssign(a, b, c, 0, EXTRA)} + | a=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) { + _Py_Assign(a, b, NULL, EXTRA) } + | a=target b=augassign c=(yield_expr | star_expressions) { + _Py_AugAssign(a, b->kind, c, EXTRA) } + | invalid_assignment + +augassign[AugOperator*]: + | '+=' {_PyPegen_augoperator(p, Add)} + | '-=' {_PyPegen_augoperator(p, Sub)} + | '*=' {_PyPegen_augoperator(p, Mult)} + | '@=' {_PyPegen_augoperator(p, MatMult)} + | '/=' {_PyPegen_augoperator(p, Div)} + | '%=' {_PyPegen_augoperator(p, Mod)} + | '&=' {_PyPegen_augoperator(p, BitAnd)} + | '|=' {_PyPegen_augoperator(p, BitOr)} + | '^=' {_PyPegen_augoperator(p, BitXor)} + | '<<=' {_PyPegen_augoperator(p, LShift)} + | '>>=' {_PyPegen_augoperator(p, RShift)} + | '**=' {_PyPegen_augoperator(p, Pow)} + | '//=' {_PyPegen_augoperator(p, FloorDiv)} + +global_stmt[stmt_ty]: 'global' a=','.NAME+ { + _Py_Global(CHECK(_PyPegen_map_names_to_ids(p, a)), EXTRA) } +nonlocal_stmt[stmt_ty]: 'nonlocal' a=','.NAME+ { + _Py_Nonlocal(CHECK(_PyPegen_map_names_to_ids(p, a)), EXTRA) } + +yield_stmt[stmt_ty]: y=yield_expr { _Py_Expr(y, EXTRA) } + +assert_stmt[stmt_ty]: 'assert' a=expression b=[',' z=expression { z }] { _Py_Assert(a, b, EXTRA) } + +del_stmt[stmt_ty]: 'del' a=del_targets { _Py_Delete(a, EXTRA) } + +import_stmt[stmt_ty]: import_name | import_from +import_name[stmt_ty]: 'import' a=dotted_as_names { _Py_Import(a, EXTRA) } +# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS +import_from[stmt_ty]: + | 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets { + _Py_ImportFrom(b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) } + | 'from' a=('.' | '...')+ 'import' b=import_from_targets { + _Py_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), EXTRA) } +import_from_targets[asdl_seq*]: + | '(' a=import_from_as_names [','] ')' { a } + | import_from_as_names + | '*' { _PyPegen_singleton_seq(p, CHECK(_PyPegen_alias_for_star(p))) } +import_from_as_names[asdl_seq*]: + | a=','.import_from_as_name+ { a } +import_from_as_name[alias_ty]: + | a=NAME b=['as' z=NAME { z }] { _Py_alias(a->v.Name.id, + (b) ? ((expr_ty) b)->v.Name.id : NULL, + p->arena) } +dotted_as_names[asdl_seq*]: + | a=','.dotted_as_name+ { a } +dotted_as_name[alias_ty]: + | a=dotted_name b=['as' z=NAME { z }] { _Py_alias(a->v.Name.id, + (b) ? ((expr_ty) b)->v.Name.id : NULL, + p->arena) } +dotted_name[expr_ty]: + | a=dotted_name '.' b=NAME { _PyPegen_join_names_with_dot(p, a, b) } + | NAME + +if_stmt[stmt_ty]: + | 'if' a=named_expression ':' b=block c=elif_stmt { _Py_If(a, b, CHECK(_PyPegen_singleton_seq(p, c)), EXTRA) } + | 'if' a=named_expression ':' b=block c=[else_block] { _Py_If(a, b, c, EXTRA) } +elif_stmt[stmt_ty]: + | 'elif' a=named_expression ':' b=block c=elif_stmt { _Py_If(a, b, CHECK(_PyPegen_singleton_seq(p, c)), EXTRA) } + | 'elif' a=named_expression ':' b=block c=[else_block] { _Py_If(a, b, c, EXTRA) } +else_block[asdl_seq*]: 'else' ':' b=block { b } + +while_stmt[stmt_ty]: + | 'while' a=named_expression ':' b=block c=[else_block] { _Py_While(a, b, c, EXTRA) } + +for_stmt[stmt_ty]: + | is_async=[ASYNC] 'for' t=star_targets 'in' ex=star_expressions ':' b=block el=[else_block] { + (is_async ? _Py_AsyncFor : _Py_For)(t, ex, b, el, NULL, EXTRA) } + +with_stmt[stmt_ty]: + | is_async=[ASYNC] 'with' '(' a=','.with_item+ ')' ':' b=block { + (is_async ? _Py_AsyncWith : _Py_With)(a, b, NULL, EXTRA) } + | is_async=[ASYNC] 'with' a=','.with_item+ ':' b=block { + (is_async ? _Py_AsyncWith : _Py_With)(a, b, NULL, EXTRA) } +with_item[withitem_ty]: + | e=expression o=['as' t=target { t }] { _Py_withitem(e, o, p->arena) } + +try_stmt[stmt_ty]: + | 'try' ':' b=block f=finally_block { _Py_Try(b, NULL, NULL, f, EXTRA) } + | 'try' ':' b=block ex=except_block+ el=[else_block] f=[finally_block] { _Py_Try(b, ex, el, f, EXTRA) } +except_block[excepthandler_ty]: + | 'except' e=expression t=['as' z=target { z }] ':' b=block { + _Py_ExceptHandler(e, (t) ? ((expr_ty) t)->v.Name.id : NULL, b, EXTRA) } + | 'except' ':' b=block { _Py_ExceptHandler(NULL, NULL, b, EXTRA) } +finally_block[asdl_seq*]: 'finally' ':' a=block { a } + +return_stmt[stmt_ty]: + | 'return' a=[star_expressions] { _Py_Return(a, EXTRA) } + +raise_stmt[stmt_ty]: + | 'raise' a=expression b=['from' z=expression { z }] { _Py_Raise(a, b, EXTRA) } + | 'raise' { _Py_Raise(NULL, NULL, EXTRA) } + +function_def[stmt_ty]: + | d=decorators f=function_def_raw { _PyPegen_function_def_decorators(p, d, f) } + | function_def_raw + +function_def_raw[stmt_ty]: + | is_async=[ASYNC] 'def' n=NAME '(' params=[params] ')' a=['->' z=annotation { z }] ':' b=block { + (is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef)(n->v.Name.id, + (params) ? params : CHECK(_PyPegen_empty_arguments(p)), + b, NULL, a, NULL, EXTRA) } + +params[arguments_ty]: + | invalid_parameters + | parameters +parameters[arguments_ty]: + | a=slash_without_default b=[',' x=plain_names { x }] c=[',' y=names_with_default { y }] d=[',' z=[star_etc] { z }] { + _PyPegen_make_arguments(p, a, NULL, b, c, d) } + | a=slash_with_default b=[',' y=names_with_default { y }] c=[',' z=[star_etc] { z }] { + _PyPegen_make_arguments(p, NULL, a, NULL, b, c) } + | a=plain_names b=[',' y=names_with_default { y }] c=[',' z=[star_etc] { z }] { + _PyPegen_make_arguments(p, NULL, NULL, a, b, c) } + | a=names_with_default b=[',' z=[star_etc] { z }] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)} + | a=star_etc { _PyPegen_make_arguments(p, NULL, NULL, NULL, NULL, a) } +slash_without_default[asdl_seq*]: a=plain_names ',' '/' { a } +slash_with_default[SlashWithDefault*]: a=[n=plain_names ',' { n }] b=names_with_default ',' '/' { + _PyPegen_slash_with_default(p, a, b) } +star_etc[StarEtc*]: + | '*' a=plain_name b=name_with_optional_default* c=[',' d=kwds { d }] [','] { + _PyPegen_star_etc(p, a, b, c) } + | '*' b=name_with_optional_default+ c=[',' d=kwds { d }] [','] { + _PyPegen_star_etc(p, NULL, b, c) } + | a=kwds [','] { _PyPegen_star_etc(p, NULL, NULL, a) } +name_with_optional_default[NameDefaultPair*]: + | ',' a=plain_name b=['=' e=expression { e }] { _PyPegen_name_default_pair(p, a, b) } +names_with_default[asdl_seq*]: a=','.name_with_default+ { a } +name_with_default[NameDefaultPair*]: + | n=plain_name '=' e=expression { _PyPegen_name_default_pair(p, n, e) } +plain_names[asdl_seq*] (memo): a=','.(plain_name !'=')+ { a } +plain_name[arg_ty]: + | a=NAME b=[':' z=annotation { z }] { _Py_arg(a->v.Name.id, b, NULL, EXTRA) } +kwds[arg_ty]: + | '**' a=plain_name { a } +annotation[expr_ty]: expression + +decorators[asdl_seq*]: a=('@' f=named_expression NEWLINE { f })+ { a } + +class_def[stmt_ty]: + | a=decorators b=class_def_raw { _PyPegen_class_def_decorators(p, a, b) } + | class_def_raw +class_def_raw[stmt_ty]: + | 'class' a=NAME b=['(' z=[arguments] ')' { z }] ':' c=block { + _Py_ClassDef(a->v.Name.id, + (b) ? ((expr_ty) b)->v.Call.args : NULL, + (b) ? ((expr_ty) b)->v.Call.keywords : NULL, + c, NULL, EXTRA) } + +block[asdl_seq*] (memo): + | NEWLINE INDENT a=statements DEDENT { a } + | simple_stmt + | invalid_block + +expressions_list[asdl_seq*]: a=','.star_expression+ [','] { a } +star_expressions[expr_ty]: + | a=star_expression b=(',' c=star_expression { c })+ [','] { + _Py_Tuple(CHECK(_PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) } + | a=star_expression ',' { _Py_Tuple(CHECK(_PyPegen_singleton_seq(p, a)), Load, EXTRA) } + | star_expression +star_expression[expr_ty] (memo): + | '*' a=bitwise_or { _Py_Starred(a, Load, EXTRA) } + | expression + +star_named_expressions[asdl_seq*]: a=','.star_named_expression+ [','] { a } +star_named_expression[expr_ty]: + | '*' a=bitwise_or { _Py_Starred(a, Load, EXTRA) } + | named_expression +named_expression[expr_ty]: + | a=NAME ':=' b=expression { _Py_NamedExpr(CHECK(_PyPegen_set_expr_context(p, a, Store)), b, EXTRA) } + | expression !':=' + | invalid_named_expression + +annotated_rhs[expr_ty]: yield_expr | star_expressions + +expressions[expr_ty]: + | a=expression b=(',' c=expression { c })+ [','] { + _Py_Tuple(CHECK(_PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) } + | a=expression ',' { _Py_Tuple(CHECK(_PyPegen_singleton_seq(p, a)), Load, EXTRA) } + | expression +expression[expr_ty] (memo): + | a=disjunction 'if' b=disjunction 'else' c=expression { _Py_IfExp(b, a, c, EXTRA) } + | disjunction + | lambdef + +lambdef[expr_ty]: + | 'lambda' a=[lambda_parameters] ':' b=expression { _Py_Lambda((a) ? a : CHECK(_PyPegen_empty_arguments(p)), b, EXTRA) } +lambda_parameters[arguments_ty]: + | a=lambda_slash_without_default b=[',' x=lambda_plain_names { x }] c=[',' y=lambda_names_with_default { y }] d=[',' z=[lambda_star_etc] { z }] { + _PyPegen_make_arguments(p, a, NULL, b, c, d) } + | a=lambda_slash_with_default b=[',' y=lambda_names_with_default { y }] c=[',' z=[lambda_star_etc] { z }] { + _PyPegen_make_arguments(p, NULL, a, NULL, b, c) } + | a=lambda_plain_names b=[',' y=lambda_names_with_default { y }] c=[',' z=[lambda_star_etc] { z }] { + _PyPegen_make_arguments(p, NULL, NULL, a, b, c) } + | a=lambda_names_with_default b=[',' z=[lambda_star_etc] { z }] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)} + | a=lambda_star_etc { _PyPegen_make_arguments(p, NULL, NULL, NULL, NULL, a) } +lambda_slash_without_default[asdl_seq*]: a=lambda_plain_names ',' '/' { a } +lambda_slash_with_default[SlashWithDefault*]: a=[n=lambda_plain_names ',' { n }] b=lambda_names_with_default ',' '/' { + _PyPegen_slash_with_default(p, a, b) } +lambda_star_etc[StarEtc*]: + | '*' a=lambda_plain_name b=lambda_name_with_optional_default* c=[',' d=lambda_kwds { d }] [','] { + _PyPegen_star_etc(p, a, b, c) } + | '*' b=lambda_name_with_optional_default+ c=[',' d=lambda_kwds { d }] [','] { + _PyPegen_star_etc(p, NULL, b, c) } + | a=lambda_kwds [','] { _PyPegen_star_etc(p, NULL, NULL, a) } +lambda_name_with_optional_default[NameDefaultPair*]: + | ',' a=lambda_plain_name b=['=' e=expression { e }] { _PyPegen_name_default_pair(p, a, b) } +lambda_names_with_default[asdl_seq*]: a=','.lambda_name_with_default+ { a } +lambda_name_with_default[NameDefaultPair*]: + | n=lambda_plain_name '=' e=expression { _PyPegen_name_default_pair(p, n, e) } +lambda_plain_names[asdl_seq*]: a=','.(lambda_plain_name !'=')+ { a } +lambda_plain_name[arg_ty]: a=NAME { _Py_arg(a->v.Name.id, NULL, NULL, EXTRA) } +lambda_kwds[arg_ty]: '**' a=lambda_plain_name { a } + +disjunction[expr_ty] (memo): + | a=conjunction b=('or' c=conjunction { c })+ { _Py_BoolOp( + Or, + CHECK(_PyPegen_seq_insert_in_front(p, a, b)), + EXTRA) } + | conjunction +conjunction[expr_ty] (memo): + | a=inversion b=('and' c=inversion { c })+ { _Py_BoolOp( + And, + CHECK(_PyPegen_seq_insert_in_front(p, a, b)), + EXTRA) } + | inversion +inversion[expr_ty] (memo): + | 'not' a=inversion { _Py_UnaryOp(Not, a, EXTRA) } + | comparison +comparison[expr_ty]: + | a=bitwise_or b=compare_op_bitwise_or_pair+ { + _Py_Compare(a, CHECK(_PyPegen_get_cmpops(p, b)), CHECK(_PyPegen_get_exprs(p, b)), EXTRA) } + | bitwise_or +compare_op_bitwise_or_pair[CmpopExprPair*]: + | eq_bitwise_or + | noteq_bitwise_or + | lte_bitwise_or + | lt_bitwise_or + | gte_bitwise_or + | gt_bitwise_or + | notin_bitwise_or + | in_bitwise_or + | isnot_bitwise_or + | is_bitwise_or +eq_bitwise_or[CmpopExprPair*]: '==' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Eq, a) } +noteq_bitwise_or[CmpopExprPair*]: '!=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, NotEq, a) } +lte_bitwise_or[CmpopExprPair*]: '<=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, LtE, a) } +lt_bitwise_or[CmpopExprPair*]: '<' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Lt, a) } +gte_bitwise_or[CmpopExprPair*]: '>=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, GtE, a) } +gt_bitwise_or[CmpopExprPair*]: '>' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Gt, a) } +notin_bitwise_or[CmpopExprPair*]: 'not' 'in' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, NotIn, a) } +in_bitwise_or[CmpopExprPair*]: 'in' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, In, a) } +isnot_bitwise_or[CmpopExprPair*]: 'is' 'not' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, IsNot, a) } +is_bitwise_or[CmpopExprPair*]: 'is' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Is, a) } + +bitwise_or[expr_ty]: + | a=bitwise_or '|' b=bitwise_xor { _Py_BinOp(a, BitOr, b, EXTRA) } + | bitwise_xor +bitwise_xor[expr_ty]: + | a=bitwise_xor '^' b=bitwise_and { _Py_BinOp(a, BitXor, b, EXTRA) } + | bitwise_and +bitwise_and[expr_ty]: + | a=bitwise_and '&' b=shift_expr { _Py_BinOp(a, BitAnd, b, EXTRA) } + | shift_expr +shift_expr[expr_ty]: + | a=shift_expr '<<' b=sum { _Py_BinOp(a, LShift, b, EXTRA) } + | a=shift_expr '>>' b=sum { _Py_BinOp(a, RShift, b, EXTRA) } + | sum + +sum[expr_ty]: + | a=sum '+' b=term { _Py_BinOp(a, Add, b, EXTRA) } + | a=sum '-' b=term { _Py_BinOp(a, Sub, b, EXTRA) } + | term +term[expr_ty]: + | a=term '*' b=factor { _Py_BinOp(a, Mult, b, EXTRA) } + | a=term '/' b=factor { _Py_BinOp(a, Div, b, EXTRA) } + | a=term '//' b=factor { _Py_BinOp(a, FloorDiv, b, EXTRA) } + | a=term '%' b=factor { _Py_BinOp(a, Mod, b, EXTRA) } + | a=term '@' b=factor { _Py_BinOp(a, MatMult, b, EXTRA) } + | factor +factor[expr_ty] (memo): + | '+' a=factor { _Py_UnaryOp(UAdd, a, EXTRA) } + | '-' a=factor { _Py_UnaryOp(USub, a, EXTRA) } + | '~' a=factor { _Py_UnaryOp(Invert, a, EXTRA) } + | power +power[expr_ty]: + | a=await_primary '**' b=factor { _Py_BinOp(a, Pow, b, EXTRA) } + | await_primary +await_primary[expr_ty] (memo): + | AWAIT a=primary { _Py_Await(a, EXTRA) } + | primary +primary[expr_ty]: + | a=primary '.' b=NAME { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) } + | a=primary b=genexp { _Py_Call(a, CHECK(_PyPegen_singleton_seq(p, b)), NULL, EXTRA) } + | a=primary '(' b=[arguments] ')' { + _Py_Call(a, + (b) ? ((expr_ty) b)->v.Call.args : NULL, + (b) ? ((expr_ty) b)->v.Call.keywords : NULL, + EXTRA) } + | a=primary '[' b=slices ']' { _Py_Subscript(a, b, Load, EXTRA) } + | atom + +slices[expr_ty]: + | a=slice !',' { a } + | a=','.slice+ [','] { _Py_Tuple(a, Load, EXTRA) } +slice[expr_ty]: + | a=[expression] ':' b=[expression] c=[':' d=[expression] { d }] { _Py_Slice(a, b, c, EXTRA) } + | a=expression { a } +atom[expr_ty]: + | NAME + | 'True' { _Py_Constant(Py_True, NULL, EXTRA) } + | 'False' { _Py_Constant(Py_False, NULL, EXTRA) } + | 'None' { _Py_Constant(Py_None, NULL, EXTRA) } + | '__new_parser__' { RAISE_SYNTAX_ERROR("You found it!") } + | &STRING strings + | NUMBER + | &'(' (tuple | group | genexp) + | &'[' (list | listcomp) + | &'{' (dict | set | dictcomp | setcomp) + | '...' { _Py_Constant(Py_Ellipsis, NULL, EXTRA) } + +strings[expr_ty] (memo): a=STRING+ { _PyPegen_concatenate_strings(p, a) } +list[expr_ty]: + | '[' a=[star_named_expressions] ']' { _Py_List(a, Load, EXTRA) } +listcomp[expr_ty]: + | '[' a=named_expression b=for_if_clauses ']' { _Py_ListComp(a, b, EXTRA) } + | invalid_comprehension +tuple[expr_ty]: + | '(' a=[y=star_named_expression ',' z=[star_named_expressions] { _PyPegen_seq_insert_in_front(p, y, z) } ] ')' { + _Py_Tuple(a, Load, EXTRA) } +group[expr_ty]: '(' a=(yield_expr | named_expression) ')' { a } +genexp[expr_ty]: + | '(' a=expression b=for_if_clauses ')' { _Py_GeneratorExp(a, b, EXTRA) } + | invalid_comprehension +set[expr_ty]: '{' a=expressions_list '}' { _Py_Set(a, EXTRA) } +setcomp[expr_ty]: + | '{' a=expression b=for_if_clauses '}' { _Py_SetComp(a, b, EXTRA) } + | invalid_comprehension +dict[expr_ty]: + | '{' a=[kvpairs] '}' { _Py_Dict(CHECK(_PyPegen_get_keys(p, a)), + CHECK(_PyPegen_get_values(p, a)), EXTRA) } +dictcomp[expr_ty]: + | '{' a=kvpair b=for_if_clauses '}' { _Py_DictComp(a->key, a->value, b, EXTRA) } +kvpairs[asdl_seq*]: a=','.kvpair+ [','] { a } +kvpair[KeyValuePair*]: + | '**' a=bitwise_or { _PyPegen_key_value_pair(p, NULL, a) } + | a=expression ':' b=expression { _PyPegen_key_value_pair(p, a, b) } +for_if_clauses[asdl_seq*]: + | a=(y=[ASYNC] 'for' a=star_targets 'in' b=disjunction c=('if' z=disjunction { z })* + { _Py_comprehension(a, b, c, y != NULL, p->arena) })+ { a } + +yield_expr[expr_ty]: + | 'yield' 'from' a=expression { _Py_YieldFrom(a, EXTRA) } + | 'yield' a=[star_expressions] { _Py_Yield(a, EXTRA) } + +arguments[expr_ty] (memo): + | a=args [','] &')' { a } + | incorrect_arguments +args[expr_ty]: + | a=starred_expression b=[',' c=args { c }] { + _Py_Call(_PyPegen_dummy_name(p), + (b) ? CHECK(_PyPegen_seq_insert_in_front(p, a, ((expr_ty) b)->v.Call.args)) + : CHECK(_PyPegen_singleton_seq(p, a)), + (b) ? ((expr_ty) b)->v.Call.keywords : NULL, + EXTRA) } + | a=kwargs { _Py_Call(_PyPegen_dummy_name(p), + CHECK_NULL_ALLOWED(_PyPegen_seq_extract_starred_exprs(p, a)), + CHECK_NULL_ALLOWED(_PyPegen_seq_delete_starred_exprs(p, a)), + EXTRA) } + | a=named_expression b=[',' c=args { c }] { + _Py_Call(_PyPegen_dummy_name(p), + (b) ? CHECK(_PyPegen_seq_insert_in_front(p, a, ((expr_ty) b)->v.Call.args)) + : CHECK(_PyPegen_singleton_seq(p, a)), + (b) ? ((expr_ty) b)->v.Call.keywords : NULL, + EXTRA) } +kwargs[asdl_seq*]: + | a=','.kwarg_or_starred+ ',' b=','.kwarg_or_double_starred+ { _PyPegen_join_sequences(p, a, b) } + | ','.kwarg_or_starred+ + | ','.kwarg_or_double_starred+ +starred_expression[expr_ty]: + | '*' a=expression { _Py_Starred(a, Load, EXTRA) } +kwarg_or_starred[KeywordOrStarred*]: + | a=NAME '=' b=expression { + _PyPegen_keyword_or_starred(p, CHECK(_Py_keyword(a->v.Name.id, b, EXTRA)), 1) } + | a=starred_expression { _PyPegen_keyword_or_starred(p, a, 0) } +kwarg_or_double_starred[KeywordOrStarred*]: + | a=NAME '=' b=expression { + _PyPegen_keyword_or_starred(p, CHECK(_Py_keyword(a->v.Name.id, b, EXTRA)), 1) } + | '**' a=expression { _PyPegen_keyword_or_starred(p, CHECK(_Py_keyword(NULL, a, EXTRA)), 1) } + +# NOTE: star_targets may contain *bitwise_or, targets may not. +star_targets[expr_ty]: + | a=star_target !',' { a } + | a=star_target b=(',' c=star_target { c })* [','] { + _Py_Tuple(CHECK(_PyPegen_seq_insert_in_front(p, a, b)), Store, EXTRA) } +star_targets_seq[asdl_seq*]: a=','.star_target+ [','] { a } +star_target[expr_ty] (memo): + | '*' a=(!'*' star_target) { + _Py_Starred(CHECK(_PyPegen_set_expr_context(p, a, Store)), Store, EXTRA) } + | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) } + | star_atom +star_atom[expr_ty]: + | a=NAME { _PyPegen_set_expr_context(p, a, Store) } + | '(' a=star_target ')' { _PyPegen_set_expr_context(p, a, Store) } + | '(' a=[star_targets_seq] ')' { _Py_Tuple(a, Store, EXTRA) } + | '[' a=[star_targets_seq] ']' { _Py_List(a, Store, EXTRA) } + +inside_paren_ann_assign_target[expr_ty]: + | ann_assign_subscript_attribute_target + | a=NAME { _PyPegen_set_expr_context(p, a, Store) } + | '(' a=inside_paren_ann_assign_target ')' { a } + +ann_assign_subscript_attribute_target[expr_ty]: + | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) } + +del_targets[asdl_seq*]: a=','.del_target+ [','] { a } +del_target[expr_ty] (memo): + | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Del, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Del, EXTRA) } + | del_t_atom +del_t_atom[expr_ty]: + | a=NAME { _PyPegen_set_expr_context(p, a, Del) } + | '(' a=del_target ')' { _PyPegen_set_expr_context(p, a, Del) } + | '(' a=[del_targets] ')' { _Py_Tuple(a, Del, EXTRA) } + | '[' a=[del_targets] ']' { _Py_List(a, Del, EXTRA) } + +targets[asdl_seq*]: a=','.target+ [','] { a } +target[expr_ty] (memo): + | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) } + | t_atom +t_primary[expr_ty]: + | a=t_primary '.' b=NAME &t_lookahead { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) } + | a=t_primary '[' b=slices ']' &t_lookahead { _Py_Subscript(a, b, Load, EXTRA) } + | a=t_primary b=genexp &t_lookahead { _Py_Call(a, CHECK(_PyPegen_singleton_seq(p, b)), NULL, EXTRA) } + | a=t_primary '(' b=[arguments] ')' &t_lookahead { + _Py_Call(a, + (b) ? ((expr_ty) b)->v.Call.args : NULL, + (b) ? ((expr_ty) b)->v.Call.keywords : NULL, + EXTRA) } + | a=atom &t_lookahead { a } +t_lookahead: '(' | '[' | '.' +t_atom[expr_ty]: + | a=NAME { _PyPegen_set_expr_context(p, a, Store) } + | '(' a=target ')' { _PyPegen_set_expr_context(p, a, Store) } + | '(' b=[targets] ')' { _Py_Tuple(b, Store, EXTRA) } + | '[' b=[targets] ']' { _Py_List(b, Store, EXTRA) } + + +# From here on, there are rules for invalid syntax with specialised error messages +incorrect_arguments: + | args ',' '*' { RAISE_SYNTAX_ERROR("iterable argument unpacking follows keyword argument unpacking") } + | expression for_if_clauses ',' [args | expression for_if_clauses] { + RAISE_SYNTAX_ERROR("Generator expression must be parenthesized") } + | a=args ',' args { _PyPegen_arguments_parsing_error(p, a) } +invalid_named_expression: + | a=expression ':=' expression { + RAISE_SYNTAX_ERROR("cannot use assignment expressions with %s", _PyPegen_get_expr_name(a)) } +invalid_assignment: + | list ':' { RAISE_SYNTAX_ERROR("only single target (not list) can be annotated") } + | tuple ':' { RAISE_SYNTAX_ERROR("only single target (not tuple) can be annotated") } + | expression ':' expression ['=' annotated_rhs] { + RAISE_SYNTAX_ERROR("illegal target for annotation") } + | a=expression ('=' | augassign) (yield_expr | star_expressions) { + RAISE_SYNTAX_ERROR("cannot assign to %s", _PyPegen_get_expr_name(a)) } +invalid_block: + | NEWLINE !INDENT { RAISE_INDENTATION_ERROR("expected an indented block") } +invalid_comprehension: + | ('[' | '(' | '{') '*' expression for_if_clauses { + RAISE_SYNTAX_ERROR("iterable unpacking cannot be used in comprehension") } +invalid_parameters: + | [plain_names ','] (slash_with_default | names_with_default) ',' plain_names { + RAISE_SYNTAX_ERROR("non-default argument follows default argument") } diff --git a/Include/compile.h b/Include/compile.h index a2db65d47f001..dbba85bb5f653 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -108,4 +108,7 @@ PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeSta #define Py_eval_input 258 #define Py_func_type_input 345 +/* This doesn't need to match anything */ +#define Py_fstring_input 800 + #endif /* !Py_COMPILE_H */ diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h index c5fa2b3857e7a..653959656f216 100644 --- a/Include/cpython/initconfig.h +++ b/Include/cpython/initconfig.h @@ -147,6 +147,10 @@ typedef struct { Set to 1 by -X faulthandler and PYTHONFAULTHANDLER. -1 means unset. */ int faulthandler; + /* Enable PEG parser? + 1 by default, set to 0 by -X oldparser and PYTHONOLDPARSER */ + int use_peg; + /* Enable tracemalloc? Set by -X tracemalloc=N and PYTHONTRACEMALLOC. -1 means unset */ int tracemalloc; diff --git a/Include/pegen_interface.h b/Include/pegen_interface.h new file mode 100644 index 0000000000000..bf5b29634ac33 --- /dev/null +++ b/Include/pegen_interface.h @@ -0,0 +1,32 @@ +#ifndef Py_LIMITED_API +#ifndef Py_PEGENINTERFACE +#define Py_PEGENINTERFACE +#ifdef __cplusplus +extern "C" { +#endif + +#include "Python.h" +#include "Python-ast.h" + +PyAPI_FUNC(mod_ty) PyPegen_ASTFromFile(const char *filename, int mode, PyArena *arena); +PyAPI_FUNC(mod_ty) PyPegen_ASTFromString(const char *str, int mode, PyCompilerFlags *flags, + PyArena *arena); +PyAPI_FUNC(mod_ty) PyPegen_ASTFromStringObject(const char *str, PyObject* filename, int mode, + PyCompilerFlags *flags, PyArena *arena); +PyAPI_FUNC(mod_ty) PyPegen_ASTFromFileObject(FILE *fp, PyObject *filename_ob, + int mode, const char *enc, const char *ps1, + const char *ps2, int *errcode, PyArena *arena); +PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromFile(const char *filename, int mode); +PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromString(const char *str, int mode, + PyCompilerFlags *flags); +PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromFileObject(FILE *, PyObject *filename_ob, + int mode, const char *enc, + const char *ps1, + const char *ps2, + int *errcode); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PEGENINTERFACE*/ +#endif /* !Py_LIMITED_API */ diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index 44a5487d75dff..f0130e376aec4 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -599,7 +599,7 @@ def test_syntaxerror_unindented_caret_position(self): exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read() # Confirm that the caret is located under the first 1 character - self.assertIn("\n 1 + 1 = 2\n ^", text) + self.assertIn("\n 1 + 1 = 2\n ^", text) def test_syntaxerror_indented_caret_position(self): script = textwrap.dedent("""\ @@ -611,7 +611,7 @@ def test_syntaxerror_indented_caret_position(self): exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read() # Confirm that the caret is located under the first 1 character - self.assertIn("\n 1 + 1 = 2\n ^", text) + self.assertIn("\n 1 + 1 = 2\n ^", text) # Try the same with a form feed at the start of the indented line script = ( @@ -622,7 +622,7 @@ def test_syntaxerror_indented_caret_position(self): exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), "ascii").read() self.assertNotIn("\f", text) - self.assertIn("\n 1 + 1 = 2\n ^", text) + self.assertIn("\n 1 + 1 = 2\n ^", text) def test_syntaxerror_multi_line_fstring(self): script = 'foo = f"""{}\nfoo"""\n' @@ -632,14 +632,14 @@ def test_syntaxerror_multi_line_fstring(self): self.assertEqual( stderr.splitlines()[-3:], [ - b' foo = f"""{}', - b' ^', + b' foo"""', + b' ^', b'SyntaxError: f-string: empty expression not allowed', ], ) def test_syntaxerror_invalid_escape_sequence_multi_line(self): - script = 'foo = """\\q\n"""\n' + script = 'foo = """\\q"""\n' with support.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'script', script) exitcode, stdout, stderr = assert_python_failure( @@ -647,10 +647,9 @@ def test_syntaxerror_invalid_escape_sequence_multi_line(self): ) self.assertEqual( stderr.splitlines()[-3:], - [ - b' foo = """\\q', - b' ^', - b'SyntaxError: invalid escape sequence \\q', + [ b' foo = """\\q"""', + b' ^', + b'SyntaxError: invalid escape sequence \\q' ], ) diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index 98da26fa5dab1..f1d74b1fb763e 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -2,6 +2,7 @@ Test cases for codeop.py Nick Mathewson """ +import sys import unittest from test.support import is_jython @@ -9,7 +10,6 @@ import io if is_jython: - import sys def unify_callables(d): for n,v in d.items(): @@ -122,6 +122,7 @@ def test_valid(self): av("def f():\n pass\n#foo\n") av("@a.b.c\ndef f():\n pass\n") + @unittest.skipIf(sys.flags.use_peg, "Pegen does not support PyCF_DONT_INPLY_DEDENT yet") def test_incomplete(self): ai = self.assertIncomplete diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 566ca27fca893..6535316dbea24 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -501,6 +501,7 @@ def test_single_statement(self): self.compile_single("if x:\n f(x)\nelse:\n g(x)") self.compile_single("class T:\n pass") + @unittest.skipIf(sys.flags.use_peg, 'Pegen does not disallow multiline single stmts') def test_bad_single_statement(self): self.assertInvalidSingle('1\n2') self.assertInvalidSingle('def f(): pass') diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 444097b4f0817..24ebc5ca9ba25 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -347,6 +347,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'isolated': 0, 'use_environment': 1, 'dev_mode': 0, + 'use_peg': 1, 'install_signal_handlers': 1, 'use_hash_seed': 0, @@ -728,6 +729,7 @@ def test_init_from_config(self): 'import_time': 1, 'show_ref_count': 1, 'malloc_stats': 1, + 'use_peg': 0, 'stdio_encoding': 'iso8859-1', 'stdio_errors': 'replace', diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index 9ef8eb1187486..bb1300c7c24d4 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -26,6 +26,7 @@ def test_EOFS(self): else: raise support.TestFailed + @unittest.skipIf(sys.flags.use_peg, "TODO for PEG -- fails with new parser") def test_line_continuation_EOF(self): """A continuation at the end of input must be an error; bpo2180.""" expect = 'unexpected EOF while parsing (, line 1)' @@ -36,6 +37,7 @@ def test_line_continuation_EOF(self): exec('\\') self.assertEqual(str(excinfo.exception), expect) + @unittest.skip("TODO for PEG -- fails even with old parser now") @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.""" diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 8c4a2882bad82..c234c2b739c5e 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -178,6 +178,7 @@ def ckmsg(src, msg, exception=SyntaxError): s = '''if True:\n print()\n\texec "mixed tabs and spaces"''' ckmsg(s, "inconsistent use of tabs and spaces in indentation", TabError) + @unittest.skipIf(sys.flags.use_peg, "Pegen column offsets might be different") def testSyntaxErrorOffset(self): def check(src, lineno, offset, encoding='utf-8'): with self.assertRaises(SyntaxError) as cm: diff --git a/Lib/test/test_flufl.py b/Lib/test/test_flufl.py index 33e52e609a761..297a8aa90c96c 100644 --- a/Lib/test/test_flufl.py +++ b/Lib/test/test_flufl.py @@ -1,6 +1,9 @@ import __future__ import unittest +import sys + + at unittest.skipIf(sys.flags.use_peg, "Not supported by pegen yet") class FLUFLTests(unittest.TestCase): def test_barry_as_bdfl(self): diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index fe465b7e1d43d..802b08341e2b5 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -10,6 +10,7 @@ import ast import types import decimal +import sys import unittest a_global = 'global variable' @@ -205,7 +206,8 @@ def test_ast_line_numbers_nested(self): call = binop.right.values[1].value self.assertEqual(type(call), ast.Call) self.assertEqual(call.lineno, 3) - self.assertEqual(call.col_offset, 11) + if not sys.flags.use_peg: + self.assertEqual(call.col_offset, 11) def test_ast_line_numbers_duplicate_expression(self): """Duplicate expression diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index f8d86da5e2f5b..3e42bc6b69a81 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1856,10 +1856,11 @@ def printsolution(self, x): ... SyntaxError: 'yield' outside function ->>> def f(): x = yield = y -Traceback (most recent call last): - ... -SyntaxError: assignment to yield expression not possible +# Pegen does not produce this error message yet +# >>> def f(): x = yield = y +# Traceback (most recent call last): +# ... +# SyntaxError: assignment to yield expression not possible >>> def f(): (yield bar) = y Traceback (most recent call last): diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 73178f3e7759b..124a2790bf2bd 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -8,6 +8,7 @@ import unittest import operator import struct +import sys from test import support from test.support.script_helper import assert_python_failure from test.support.script_helper import assert_python_ok @@ -899,9 +900,10 @@ def test_deeply_nested_list(self): st = parser.expr(e) st.compile() + @unittest.skipIf(sys.flags.use_peg, "Pegen does not trigger memory error with this many parenthesis") def test_trigger_memory_error(self): e = self._nested_expression(100) - rc, out, err = assert_python_failure('-c', e) + rc, out, err = assert_python_failure('-Xoldparser', '-c', e) # parsing the expression will result in an error message # followed by a MemoryError (see #11963) self.assertIn(b's_push: parser stack overflow', err) diff --git a/Lib/test/test_peg_generator/__init__.py b/Lib/test/test_peg_generator/__init__.py new file mode 100644 index 0000000000000..fa855f2104c58 --- /dev/null +++ b/Lib/test/test_peg_generator/__init__.py @@ -0,0 +1,7 @@ +import os + +from test.support import load_package_tests + +# Load all tests in package +def load_tests(*args): + return load_package_tests(os.path.dirname(__file__), *args) diff --git a/Lib/test/test_peg_generator/__main__.py b/Lib/test/test_peg_generator/__main__.py new file mode 100644 index 0000000000000..1fab1fddb5744 --- /dev/null +++ b/Lib/test/test_peg_generator/__main__.py @@ -0,0 +1,4 @@ +import unittest +from . import load_tests + +unittest.main() diff --git a/Lib/test/test_peg_generator/ast_dump.py b/Lib/test/test_peg_generator/ast_dump.py new file mode 100644 index 0000000000000..22d2dde775597 --- /dev/null +++ b/Lib/test/test_peg_generator/ast_dump.py @@ -0,0 +1,62 @@ +""" +Copy-parse of ast.dump, removing the `isinstance` checks. This is needed, +because testing pegen requires generating a C extension module, which contains +a copy of the symbols defined in Python-ast.c. Thus, the isinstance check would +always fail. We rely on string comparison of the base classes instead. +TODO: Remove the above-described hack. +""" + +def ast_dump(node, annotate_fields=True, include_attributes=False, *, indent=None): + def _format(node, level=0): + if indent is not None: + level += 1 + prefix = '\n' + indent * level + sep = ',\n' + indent * level + else: + prefix = '' + sep = ', ' + if any(cls.__name__ == 'AST' for cls in node.__class__.__mro__): + cls = type(node) + args = [] + allsimple = True + keywords = annotate_fields + for name in node._fields: + try: + value = getattr(node, name) + except AttributeError: + keywords = True + continue + if value is None and getattr(cls, name, ...) is None: + keywords = True + continue + value, simple = _format(value, level) + allsimple = allsimple and simple + if keywords: + args.append('%s=%s' % (name, value)) + else: + args.append(value) + if include_attributes and node._attributes: + for name in node._attributes: + try: + value = getattr(node, name) + except AttributeError: + continue + if value is None and getattr(cls, name, ...) is None: + continue + value, simple = _format(value, level) + allsimple = allsimple and simple + args.append('%s=%s' % (name, value)) + if allsimple and len(args) <= 3: + return '%s(%s)' % (node.__class__.__name__, ', '.join(args)), not args + return '%s(%s%s)' % (node.__class__.__name__, prefix, sep.join(args)), False + elif isinstance(node, list): + if not node: + return '[]', True + return '[%s%s]' % (prefix, sep.join(_format(x, level)[0] for x in node)), False + return repr(node), True + + if all(cls.__name__ != 'AST' for cls in node.__class__.__mro__): + raise TypeError('expected AST, got %r' % node.__class__.__name__) + if indent is not None and not isinstance(indent, str): + indent = ' ' * indent + return _format(node)[0] diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py new file mode 100644 index 0000000000000..f2f699c83df01 --- /dev/null +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -0,0 +1,333 @@ +import ast +import contextlib +import traceback +import tempfile +import shutil +import unittest +import sys + +from test import test_tools +from test.test_peg_generator.ast_dump import ast_dump +from pathlib import PurePath, Path +from typing import Sequence + +test_tools.skip_if_missing('peg_generator') +with test_tools.imports_under_tool('peg_generator'): + from pegen.grammar_parser import GeneratedParser as GrammarParser + from pegen.testutil import ( + parse_string, + generate_parser_c_extension, + generate_c_parser_source, + ) + + +class TestCParser(unittest.TestCase): + def setUp(self): + self.tmp_path = tempfile.mkdtemp() + + def tearDown(self): + with contextlib.suppress(PermissionError): + shutil.rmtree(self.tmp_path) + + def check_input_strings_for_grammar( + self, + source: str, + tmp_path: PurePath, + valid_cases: Sequence[str] = (), + invalid_cases: Sequence[str] = (), + ) -> None: + grammar = parse_string(source, GrammarParser) + extension = generate_parser_c_extension(grammar, Path(tmp_path)) + + if valid_cases: + for case in valid_cases: + extension.parse_string(case, mode=0) + + if invalid_cases: + for case in invalid_cases: + with self.assertRaises(SyntaxError): + extension.parse_string(case, mode=0) + + def verify_ast_generation(self, source: str, stmt: str, tmp_path: PurePath) -> None: + grammar = parse_string(source, GrammarParser) + extension = generate_parser_c_extension(grammar, Path(tmp_path)) + + expected_ast = ast.parse(stmt) + actual_ast = extension.parse_string(stmt, mode=1) + self.assertEqual(ast_dump(expected_ast), ast_dump(actual_ast)) + + def test_c_parser(self) -> None: + grammar_source = """ + start[mod_ty]: a=stmt* $ { Module(a, NULL, p->arena) } + stmt[stmt_ty]: a=expr_stmt { a } + expr_stmt[stmt_ty]: a=expression NEWLINE { _Py_Expr(a, EXTRA) } + expression[expr_ty]: ( l=expression '+' r=term { _Py_BinOp(l, Add, r, EXTRA) } + | l=expression '-' r=term { _Py_BinOp(l, Sub, r, EXTRA) } + | t=term { t } + ) + term[expr_ty]: ( l=term '*' r=factor { _Py_BinOp(l, Mult, r, EXTRA) } + | l=term '/' r=factor { _Py_BinOp(l, Div, r, EXTRA) } + | f=factor { f } + ) + factor[expr_ty]: ('(' e=expression ')' { e } + | a=atom { a } + ) + atom[expr_ty]: ( n=NAME { n } + | n=NUMBER { n } + | s=STRING { s } + ) + """ + grammar = parse_string(grammar_source, GrammarParser) + extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) + + expressions = [ + "4+5", + "4-5", + "4*5", + "1+4*5", + "1+4/5", + "(1+1) + (1+1)", + "(1+1) - (1+1)", + "(1+1) * (1+1)", + "(1+1) / (1+1)", + ] + + for expr in expressions: + the_ast = extension.parse_string(expr, mode=1) + expected_ast = ast.parse(expr) + self.assertEqual(ast_dump(the_ast), ast_dump(expected_ast)) + + def test_lookahead(self) -> None: + grammar = """ + start: NAME &NAME expr NEWLINE? ENDMARKER + expr: NAME | NUMBER + """ + valid_cases = ["foo bar"] + invalid_cases = ["foo 34"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + + def test_negative_lookahead(self) -> None: + grammar = """ + start: NAME !NAME expr NEWLINE? ENDMARKER + expr: NAME | NUMBER + """ + valid_cases = ["foo 34"] + invalid_cases = ["foo bar"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + + def test_cut(self) -> None: + grammar = """ + start: X ~ Y Z | X Q S + X: 'x' + Y: 'y' + Z: 'z' + Q: 'q' + S: 's' + """ + valid_cases = ["x y z"] + invalid_cases = ["x q s"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + + def test_gather(self) -> None: + grammar = """ + start: ';'.pass_stmt+ NEWLINE + pass_stmt: 'pass' + """ + valid_cases = ["pass", "pass; pass"] + invalid_cases = ["pass;", "pass; pass;"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + + def test_left_recursion(self) -> None: + grammar = """ + start: expr NEWLINE + expr: ('-' term | expr '+' term | term) + term: NUMBER + """ + valid_cases = ["-34", "34", "34 + 12", "1 + 1 + 2 + 3"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases) + + def test_advanced_left_recursive(self) -> None: + grammar = """ + start: NUMBER | sign start + sign: ['-'] + """ + valid_cases = ["23", "-34"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases) + + def test_mutually_left_recursive(self) -> None: + grammar = """ + start: foo 'E' + foo: bar 'A' | 'B' + bar: foo 'C' | 'D' + """ + valid_cases = ["B E", "D A C A E"] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases) + + def test_nasty_mutually_left_recursive(self) -> None: + grammar = """ + start: target '=' + target: maybe '+' | NAME + maybe: maybe '-' | target + """ + valid_cases = ["x ="] + invalid_cases = ["x - + ="] + self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + + def test_return_stmt_noexpr_action(self) -> None: + grammar = """ + start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + statements[asdl_seq*]: a=statement+ { a } + statement[stmt_ty]: simple_stmt + simple_stmt[stmt_ty]: small_stmt + small_stmt[stmt_ty]: return_stmt + return_stmt[stmt_ty]: a='return' NEWLINE { _Py_Return(NULL, EXTRA) } + """ + stmt = "return" + self.verify_ast_generation(grammar, stmt, self.tmp_path) + + def test_gather_action_ast(self) -> None: + grammar = """ + start[mod_ty]: a=';'.pass_stmt+ NEWLINE ENDMARKER { Module(a, NULL, p->arena) } + pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA)} + """ + stmt = "pass; pass" + self.verify_ast_generation(grammar, stmt, self.tmp_path) + + def test_pass_stmt_action(self) -> None: + grammar = """ + start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + statements[asdl_seq*]: a=statement+ { a } + statement[stmt_ty]: simple_stmt + simple_stmt[stmt_ty]: small_stmt + small_stmt[stmt_ty]: pass_stmt + pass_stmt[stmt_ty]: a='pass' NEWLINE { _Py_Pass(EXTRA) } + """ + stmt = "pass" + self.verify_ast_generation(grammar, stmt, self.tmp_path) + + def test_if_stmt_action(self) -> None: + grammar = """ + start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) } + statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) } | simple_stmt + + simple_stmt[asdl_seq*]: a=small_stmt b=further_small_stmt* [';'] NEWLINE { _PyPegen_seq_insert_in_front(p, a, b) } + further_small_stmt[stmt_ty]: ';' a=small_stmt { a } + + block: simple_stmt | NEWLINE INDENT a=statements DEDENT { a } + + compound_stmt: if_stmt + + if_stmt: 'if' a=full_expression ':' b=block { _Py_If(a, b, NULL, EXTRA) } + + small_stmt[stmt_ty]: pass_stmt + + pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA) } + + full_expression: NAME + """ + stmt = "pass" + self.verify_ast_generation(grammar, stmt, self.tmp_path) + + def test_same_name_different_types(self) -> None: + source = """ + start[mod_ty]: a=import_from+ NEWLINE ENDMARKER { Module(a, NULL, p->arena)} + import_from[stmt_ty]: ( a='from' !'import' c=simple_name 'import' d=import_as_names_from { + _Py_ImportFrom(c->v.Name.id, d, 0, EXTRA) } + | a='from' '.' 'import' c=import_as_names_from { + _Py_ImportFrom(NULL, c, 1, EXTRA) } + ) + simple_name[expr_ty]: NAME + import_as_names_from[asdl_seq*]: a=','.import_as_name_from+ { a } + import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _Py_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, p->arena) } + """ + grammar = parse_string(source, GrammarParser) + extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) + + for stmt in ("from a import b as c", "from . import a as b"): + expected_ast = ast.parse(stmt) + actual_ast = extension.parse_string(stmt, mode=1) + self.assertEqual(ast_dump(expected_ast), ast_dump(actual_ast)) + + def test_with_stmt_with_paren(self) -> None: + grammar_source = """ + start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) } + statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) } + compound_stmt[stmt_ty]: with_stmt + with_stmt[stmt_ty]: ( + a='with' '(' b=','.with_item+ ')' ':' c=block { + _Py_With(b, _PyPegen_singleton_seq(p, c), NULL, EXTRA) } + ) + with_item[withitem_ty]: ( + e=NAME o=['as' t=NAME { t }] { _Py_withitem(e, _PyPegen_set_expr_context(p, o, Store), p->arena) } + ) + block[stmt_ty]: a=pass_stmt NEWLINE { a } | NEWLINE INDENT a=pass_stmt DEDENT { a } + pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA) } + """ + stmt = "with (\n a as b,\n c as d\n): pass" + grammar = parse_string(grammar_source, GrammarParser) + extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) + the_ast = extension.parse_string(stmt, mode=1) + self.assertTrue(ast_dump(the_ast).startswith( + "Module(body=[With(items=[withitem(context_expr=Name(id='a', ctx=Load()), optional_vars=Name(id='b', ctx=Store())), " + "withitem(context_expr=Name(id='c', ctx=Load()), optional_vars=Name(id='d', ctx=Store()))]" + )) + + def test_ternary_operator(self) -> None: + grammar_source = """ + start[mod_ty]: a=expr ENDMARKER { Module(a, NULL, p->arena) } + expr[asdl_seq*]: a=listcomp NEWLINE { _PyPegen_singleton_seq(p, _Py_Expr(a, EXTRA)) } + listcomp[expr_ty]: ( + a='[' b=NAME c=for_if_clauses d=']' { _Py_ListComp(b, c, EXTRA) } + ) + for_if_clauses[asdl_seq*]: ( + a=(y=[ASYNC] 'for' a=NAME 'in' b=NAME c=('if' z=NAME { z })* + { _Py_comprehension(_Py_Name(((expr_ty) a)->v.Name.id, Store, EXTRA), b, c, (y == NULL) ? 0 : 1, p->arena) })+ { a } + ) + """ + stmt = "[i for i in a if b]" + self.verify_ast_generation(grammar_source, stmt, self.tmp_path) + + def test_syntax_error_for_string(self) -> None: + grammar_source = """ + start: expr+ NEWLINE? ENDMARKER + expr: NAME + """ + grammar = parse_string(grammar_source, GrammarParser) + print(list(Path(self.tmp_path).iterdir())) + extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) + for text in ("a b 42 b a", "? ? 42 ? ?"): + try: + extension.parse_string(text, mode=0) + except SyntaxError as e: + tb = traceback.format_exc() + self.assertTrue('File "", line 1' in tb) + self.assertTrue(f"SyntaxError: invalid syntax" in tb) + + def test_headers_and_trailer(self) -> None: + grammar_source = """ + @header 'SOME HEADER' + @subheader 'SOME SUBHEADER' + @trailer 'SOME TRAILER' + start: expr+ NEWLINE? ENDMARKER + expr: x=NAME + """ + grammar = parse_string(grammar_source, GrammarParser) + parser_source = generate_c_parser_source(grammar) + + self.assertTrue("SOME HEADER" in parser_source) + self.assertTrue("SOME SUBHEADER" in parser_source) + self.assertTrue("SOME TRAILER" in parser_source) + + + def test_error_in_rules(self) -> None: + grammar_source = """ + start: expr+ NEWLINE? ENDMARKER + expr: NAME {PyTuple_New(-1)} + """ + grammar = parse_string(grammar_source, GrammarParser) + extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) + # PyTuple_New raises SystemError if an invalid argument was passed. + with self.assertRaises(SystemError): + extension.parse_string("a", mode=0) diff --git a/Lib/test/test_peg_generator/test_first_sets.py b/Lib/test/test_peg_generator/test_first_sets.py new file mode 100644 index 0000000000000..425ee23aa1ab5 --- /dev/null +++ b/Lib/test/test_peg_generator/test_first_sets.py @@ -0,0 +1,225 @@ +import unittest + +from test import test_tools +from typing import Dict, Set + +test_tools.skip_if_missing('peg_generator') +with test_tools.imports_under_tool('peg_generator'): + from pegen.grammar_parser import GeneratedParser as GrammarParser + from pegen.testutil import parse_string + from pegen.first_sets import FirstSetCalculator + from pegen.grammar import Grammar + + +class TestFirstSets(unittest.TestCase): + def calculate_first_sets(self, grammar_source: str) -> Dict[str, Set[str]]: + grammar: Grammar = parse_string(grammar_source, GrammarParser) + return FirstSetCalculator(grammar.rules).calculate() + + def test_alternatives(self) -> None: + grammar = """ + start: expr NEWLINE? ENDMARKER + expr: A | B + A: 'a' | '-' + B: 'b' | '+' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "A": {"'a'", "'-'"}, + "B": {"'+'", "'b'"}, + "expr": {"'+'", "'a'", "'b'", "'-'"}, + "start": {"'+'", "'a'", "'b'", "'-'"}, + }) + + def test_optionals(self) -> None: + grammar = """ + start: expr NEWLINE + expr: ['a'] ['b'] 'c' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "expr": {"'c'", "'a'", "'b'"}, + "start": {"'c'", "'a'", "'b'"}, + }) + + def test_repeat_with_separator(self) -> None: + grammar = """ + start: ','.thing+ NEWLINE + thing: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"thing": {"NUMBER"}, "start": {"NUMBER"}}) + + def test_optional_operator(self) -> None: + grammar = """ + start: sum NEWLINE + sum: (term)? 'b' + term: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "term": {"NUMBER"}, + "sum": {"NUMBER", "'b'"}, + "start": {"'b'", "NUMBER"}, + }) + + def test_optional_literal(self) -> None: + grammar = """ + start: sum NEWLINE + sum: '+' ? term + term: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "term": {"NUMBER"}, + "sum": {"'+'", "NUMBER"}, + "start": {"'+'", "NUMBER"}, + }) + + def test_optional_after(self) -> None: + grammar = """ + start: term NEWLINE + term: NUMBER ['+'] + """ + self.assertEqual(self.calculate_first_sets(grammar), {"term": {"NUMBER"}, "start": {"NUMBER"}}) + + def test_optional_before(self) -> None: + grammar = """ + start: term NEWLINE + term: ['+'] NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"term": {"NUMBER", "'+'"}, "start": {"NUMBER", "'+'"}}) + + def test_repeat_0(self) -> None: + grammar = """ + start: thing* "+" NEWLINE + thing: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"thing": {"NUMBER"}, "start": {'"+"', "NUMBER"}}) + + def test_repeat_0_with_group(self) -> None: + grammar = """ + start: ('+' '-')* term NEWLINE + term: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"term": {"NUMBER"}, "start": {"'+'", "NUMBER"}}) + + def test_repeat_1(self) -> None: + grammar = """ + start: thing+ '-' NEWLINE + thing: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"thing": {"NUMBER"}, "start": {"NUMBER"}}) + + def test_repeat_1_with_group(self) -> None: + grammar = """ + start: ('+' term)+ term NEWLINE + term: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"term": {"NUMBER"}, "start": {"'+'"}}) + + def test_gather(self) -> None: + grammar = """ + start: ','.thing+ NEWLINE + thing: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), {"thing": {"NUMBER"}, "start": {"NUMBER"}}) + + def test_positive_lookahead(self) -> None: + grammar = """ + start: expr NEWLINE + expr: &'a' opt + opt: 'a' | 'b' | 'c' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "expr": {"'a'"}, + "start": {"'a'"}, + "opt": {"'b'", "'c'", "'a'"}, + }) + + def test_negative_lookahead(self) -> None: + grammar = """ + start: expr NEWLINE + expr: !'a' opt + opt: 'a' | 'b' | 'c' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "opt": {"'b'", "'a'", "'c'"}, + "expr": {"'b'", "'c'"}, + "start": {"'b'", "'c'"}, + }) + + def test_left_recursion(self) -> None: + grammar = """ + start: expr NEWLINE + expr: ('-' term | expr '+' term | term) + term: NUMBER + foo: 'foo' + bar: 'bar' + baz: 'baz' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "expr": {"NUMBER", "'-'"}, + "term": {"NUMBER"}, + "start": {"NUMBER", "'-'"}, + "foo": {"'foo'"}, + "bar": {"'bar'"}, + "baz": {"'baz'"}, + }) + + def test_advance_left_recursion(self) -> None: + grammar = """ + start: NUMBER | sign start + sign: ['-'] + """ + self.assertEqual(self.calculate_first_sets(grammar), {"sign": {"'-'", ""}, "start": {"'-'", "NUMBER"}}) + + def test_mutual_left_recursion(self) -> None: + grammar = """ + start: foo 'E' + foo: bar 'A' | 'B' + bar: foo 'C' | 'D' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "foo": {"'D'", "'B'"}, + "bar": {"'D'"}, + "start": {"'D'", "'B'"}, + }) + + def test_nasty_left_recursion(self) -> None: + # TODO: Validate this + grammar = """ + start: target '=' + target: maybe '+' | NAME + maybe: maybe '-' | target + """ + self.assertEqual(self.calculate_first_sets(grammar), {"maybe": set(), "target": {"NAME"}, "start": {"NAME"}}) + + def test_nullable_rule(self) -> None: + grammar = """ + start: sign thing $ + sign: ['-'] + thing: NUMBER + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "sign": {"", "'-'"}, + "thing": {"NUMBER"}, + "start": {"NUMBER", "'-'"}, + }) + + def test_epsilon_production_in_start_rule(self) -> None: + grammar = """ + start: ['-'] $ + """ + self.assertEqual(self.calculate_first_sets(grammar), {"start": {"ENDMARKER", "'-'"}}) + + def test_multiple_nullable_rules(self) -> None: + grammar = """ + start: sign thing other another $ + sign: ['-'] + thing: ['+'] + other: '*' + another: '/' + """ + self.assertEqual(self.calculate_first_sets(grammar), { + "sign": {"", "'-'"}, + "thing": {"'+'", ""}, + "start": {"'+'", "'-'", "'*'"}, + "other": {"'*'"}, + "another": {"'/'"}, + }) diff --git a/Lib/test/test_peg_generator/test_pegen.py b/Lib/test/test_peg_generator/test_pegen.py new file mode 100644 index 0000000000000..581c7acd337e4 --- /dev/null +++ b/Lib/test/test_peg_generator/test_pegen.py @@ -0,0 +1,728 @@ +import io +import textwrap +import unittest + +from test import test_tools +from typing import Dict, Any +from tokenize import TokenInfo, NAME, NEWLINE, NUMBER, OP + +test_tools.skip_if_missing('peg_generator') +with test_tools.imports_under_tool('peg_generator'): + from pegen.grammar_parser import GeneratedParser as GrammarParser + from pegen.testutil import ( + parse_string, + generate_parser, + make_parser + ) + from pegen.grammar import GrammarVisitor, GrammarError, Grammar + from pegen.grammar_visualizer import ASTGrammarPrinter + from pegen.parser import Parser + from pegen.python_generator import PythonParserGenerator + + +class TestPegen(unittest.TestCase): + def test_parse_grammar(self) -> None: + grammar_source = """ + start: sum NEWLINE + sum: t1=term '+' t2=term { action } | term + term: NUMBER + """ + expected = """ + start: sum NEWLINE + sum: term '+' term | term + term: NUMBER + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + rules = grammar.rules + self.assertEqual(str(grammar), textwrap.dedent(expected).strip()) + # Check the str() and repr() of a few rules; AST nodes don't support ==. + self.assertEqual(str(rules["start"]), "start: sum NEWLINE") + self.assertEqual(str(rules["sum"]), "sum: term '+' term | term") + expected_repr = "Rule('term', None, Rhs([Alt([NamedItem(None, NameLeaf('NUMBER'))])]))" + self.assertEqual(repr(rules["term"]), expected_repr) + + def test_long_rule_str(self) -> None: + grammar_source = """ + start: zero | one | one zero | one one | one zero zero | one zero one | one one zero | one one one + """ + expected = """ + start: + | zero + | one + | one zero + | one one + | one zero zero + | one zero one + | one one zero + | one one one + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + self.assertEqual(str(grammar.rules["start"]), textwrap.dedent(expected).strip()) + + def test_typed_rules(self) -> None: + grammar = """ + start[int]: sum NEWLINE + sum[int]: t1=term '+' t2=term { action } | term + term[int]: NUMBER + """ + rules = parse_string(grammar, GrammarParser).rules + # Check the str() and repr() of a few rules; AST nodes don't support ==. + self.assertEqual(str(rules["start"]), "start: sum NEWLINE") + self.assertEqual(str(rules["sum"]), "sum: term '+' term | term") + self.assertEqual( + repr(rules["term"]), + "Rule('term', 'int', Rhs([Alt([NamedItem(None, NameLeaf('NUMBER'))])]))" + ) + + def test_repeat_with_separator_rules(self) -> None: + grammar = """ + start: ','.thing+ NEWLINE + thing: NUMBER + """ + rules = parse_string(grammar, GrammarParser).rules + self.assertEqual(str(rules["start"]), "start: ','.thing+ NEWLINE") + print(repr(rules["start"])) + self.assertTrue(repr(rules["start"]).startswith( + "Rule('start', None, Rhs([Alt([NamedItem(None, Gather(StringLeaf(\"','\"), NameLeaf('thing'" + )) + self.assertEqual(str(rules["thing"]), "thing: NUMBER") + + def test_expr_grammar(self) -> None: + grammar = """ + start: sum NEWLINE + sum: term '+' term | term + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("42\n", parser_class) + self.assertEqual(node, [ + [[TokenInfo(NUMBER, string="42", start=(1, 0), end=(1, 2), line="42\n")]], + TokenInfo(NEWLINE, string="\n", start=(1, 2), end=(1, 3), line="42\n"), + ]) + + def test_optional_operator(self) -> None: + grammar = """ + start: sum NEWLINE + sum: term ('+' term)? + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1+2\n", parser_class) + self.assertEqual(node, [ + [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1+2\n")], + [ + TokenInfo(OP, string="+", start=(1, 1), end=(1, 2), line="1+2\n"), + [TokenInfo(NUMBER, string="2", start=(1, 2), end=(1, 3), line="1+2\n")], + ], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 3), end=(1, 4), line="1+2\n"), + ]) + node = parse_string("1\n", parser_class) + self.assertEqual(node, [ + [[TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1\n")], None], + TokenInfo(NEWLINE, string="\n", start=(1, 1), end=(1, 2), line="1\n"), + ]) + + def test_optional_literal(self) -> None: + grammar = """ + start: sum NEWLINE + sum: term '+' ? + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1+\n", parser_class) + self.assertEqual(node, [ + [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1+\n")], + TokenInfo(OP, string="+", start=(1, 1), end=(1, 2), line="1+\n"), + ], + TokenInfo(NEWLINE, string="\n", start=(1, 2), end=(1, 3), line="1+\n"), + ]) + node = parse_string("1\n", parser_class) + self.assertEqual(node, [ + [[TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1\n")], None], + TokenInfo(NEWLINE, string="\n", start=(1, 1), end=(1, 2), line="1\n"), + ]) + + def test_alt_optional_operator(self) -> None: + grammar = """ + start: sum NEWLINE + sum: term ['+' term] + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1 + 2\n", parser_class) + self.assertEqual(node, [ + [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1 + 2\n")], + [ + TokenInfo(OP, string="+", start=(1, 2), end=(1, 3), line="1 + 2\n"), + [TokenInfo(NUMBER, string="2", start=(1, 4), end=(1, 5), line="1 + 2\n")], + ], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 5), end=(1, 6), line="1 + 2\n"), + ]) + node = parse_string("1\n", parser_class) + self.assertEqual(node, [ + [[TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1\n")], None], + TokenInfo(NEWLINE, string="\n", start=(1, 1), end=(1, 2), line="1\n"), + ]) + + def test_repeat_0_simple(self) -> None: + grammar = """ + start: thing thing* NEWLINE + thing: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1 2 3\n", parser_class) + self.assertEqual(node, [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1 2 3\n")], + [ + [[TokenInfo(NUMBER, string="2", start=(1, 2), end=(1, 3), line="1 2 3\n")]], + [[TokenInfo(NUMBER, string="3", start=(1, 4), end=(1, 5), line="1 2 3\n")]], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 5), end=(1, 6), line="1 2 3\n"), + ]) + node = parse_string("1\n", parser_class) + self.assertEqual(node, [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1\n")], + [], + TokenInfo(NEWLINE, string="\n", start=(1, 1), end=(1, 2), line="1\n"), + ]) + + def test_repeat_0_complex(self) -> None: + grammar = """ + start: term ('+' term)* NEWLINE + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1 + 2 + 3\n", parser_class) + self.assertEqual(node, [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1 + 2 + 3\n")], + [ + [ + [ + TokenInfo(OP, string="+", start=(1, 2), end=(1, 3), line="1 + 2 + 3\n"), + [TokenInfo(NUMBER, string="2", start=(1, 4), end=(1, 5), line="1 + 2 + 3\n")], + ] + ], + [ + [ + TokenInfo(OP, string="+", start=(1, 6), end=(1, 7), line="1 + 2 + 3\n"), + [TokenInfo(NUMBER, string="3", start=(1, 8), end=(1, 9), line="1 + 2 + 3\n")], + ] + ], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 9), end=(1, 10), line="1 + 2 + 3\n"), + ]) + + def test_repeat_1_simple(self) -> None: + grammar = """ + start: thing thing+ NEWLINE + thing: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1 2 3\n", parser_class) + self.assertEqual(node, [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1 2 3\n")], + [ + [[TokenInfo(NUMBER, string="2", start=(1, 2), end=(1, 3), line="1 2 3\n")]], + [[TokenInfo(NUMBER, string="3", start=(1, 4), end=(1, 5), line="1 2 3\n")]], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 5), end=(1, 6), line="1 2 3\n"), + ]) + with self.assertRaises(SyntaxError): + parse_string("1\n", parser_class) + + def test_repeat_1_complex(self) -> None: + grammar = """ + start: term ('+' term)+ NEWLINE + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1 + 2 + 3\n", parser_class) + self.assertEqual(node, [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1 + 2 + 3\n")], + [ + [ + [ + TokenInfo(OP, string="+", start=(1, 2), end=(1, 3), line="1 + 2 + 3\n"), + [TokenInfo(NUMBER, string="2", start=(1, 4), end=(1, 5), line="1 + 2 + 3\n")], + ] + ], + [ + [ + TokenInfo(OP, string="+", start=(1, 6), end=(1, 7), line="1 + 2 + 3\n"), + [TokenInfo(NUMBER, string="3", start=(1, 8), end=(1, 9), line="1 + 2 + 3\n")], + ] + ], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 9), end=(1, 10), line="1 + 2 + 3\n"), + ]) + with self.assertRaises(SyntaxError): + parse_string("1\n", parser_class) + + def test_repeat_with_sep_simple(self) -> None: + grammar = """ + start: ','.thing+ NEWLINE + thing: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("1, 2, 3\n", parser_class) + self.assertEqual(node, [ + [ + [TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1, 2, 3\n")], + [TokenInfo(NUMBER, string="2", start=(1, 3), end=(1, 4), line="1, 2, 3\n")], + [TokenInfo(NUMBER, string="3", start=(1, 6), end=(1, 7), line="1, 2, 3\n")], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 7), end=(1, 8), line="1, 2, 3\n"), + ]) + + def test_left_recursive(self) -> None: + grammar_source = """ + start: expr NEWLINE + expr: ('-' term | expr '+' term | term) + term: NUMBER + foo: NAME+ + bar: NAME* + baz: NAME? + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + parser_class = generate_parser(grammar) + rules = grammar.rules + self.assertFalse(rules["start"].left_recursive) + self.assertTrue(rules["expr"].left_recursive) + self.assertFalse(rules["term"].left_recursive) + self.assertFalse(rules["foo"].left_recursive) + self.assertFalse(rules["bar"].left_recursive) + self.assertFalse(rules["baz"].left_recursive) + node = parse_string("1 + 2 + 3\n", parser_class) + self.assertEqual(node, [ + [ + [ + [[TokenInfo(NUMBER, string="1", start=(1, 0), end=(1, 1), line="1 + 2 + 3\n")]], + TokenInfo(OP, string="+", start=(1, 2), end=(1, 3), line="1 + 2 + 3\n"), + [TokenInfo(NUMBER, string="2", start=(1, 4), end=(1, 5), line="1 + 2 + 3\n")], + ], + TokenInfo(OP, string="+", start=(1, 6), end=(1, 7), line="1 + 2 + 3\n"), + [TokenInfo(NUMBER, string="3", start=(1, 8), end=(1, 9), line="1 + 2 + 3\n")], + ], + TokenInfo(NEWLINE, string="\n", start=(1, 9), end=(1, 10), line="1 + 2 + 3\n"), + ]) + + def test_python_expr(self) -> None: + grammar = """ + start: expr NEWLINE? $ { ast.Expression(expr, lineno=1, col_offset=0) } + expr: ( expr '+' term { ast.BinOp(expr, ast.Add(), term, lineno=expr.lineno, col_offset=expr.col_offset, end_lineno=term.end_lineno, end_col_offset=term.end_col_offset) } + | expr '-' term { ast.BinOp(expr, ast.Sub(), term, lineno=expr.lineno, col_offset=expr.col_offset, end_lineno=term.end_lineno, end_col_offset=term.end_col_offset) } + | term { term } + ) + term: ( l=term '*' r=factor { ast.BinOp(l, ast.Mult(), r, lineno=l.lineno, col_offset=l.col_offset, end_lineno=r.end_lineno, end_col_offset=r.end_col_offset) } + | l=term '/' r=factor { ast.BinOp(l, ast.Div(), r, lineno=l.lineno, col_offset=l.col_offset, end_lineno=r.end_lineno, end_col_offset=r.end_col_offset) } + | factor { factor } + ) + factor: ( '(' expr ')' { expr } + | atom { atom } + ) + atom: ( n=NAME { ast.Name(id=n.string, ctx=ast.Load(), lineno=n.start[0], col_offset=n.start[1], end_lineno=n.end[0], end_col_offset=n.end[1]) } + | n=NUMBER { ast.Constant(value=ast.literal_eval(n.string), lineno=n.start[0], col_offset=n.start[1], end_lineno=n.end[0], end_col_offset=n.end[1]) } + ) + """ + parser_class = make_parser(grammar) + node = parse_string("(1 + 2*3 + 5)/(6 - 2)\n", parser_class) + code = compile(node, "", "eval") + val = eval(code) + self.assertEqual(val, 3.0) + + def test_nullable(self) -> None: + grammar_source = """ + start: sign NUMBER + sign: ['-' | '+'] + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + out = io.StringIO() + genr = PythonParserGenerator(grammar, out) + rules = grammar.rules + self.assertFalse(rules["start"].nullable) # Not None! + self.assertTrue(rules["sign"].nullable) + + def test_advanced_left_recursive(self) -> None: + grammar_source = """ + start: NUMBER | sign start + sign: ['-'] + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + out = io.StringIO() + genr = PythonParserGenerator(grammar, out) + rules = grammar.rules + self.assertFalse(rules["start"].nullable) # Not None! + self.assertTrue(rules["sign"].nullable) + self.assertTrue(rules["start"].left_recursive) + self.assertFalse(rules["sign"].left_recursive) + + def test_mutually_left_recursive(self) -> None: + grammar_source = """ + start: foo 'E' + foo: bar 'A' | 'B' + bar: foo 'C' | 'D' + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + out = io.StringIO() + genr = PythonParserGenerator(grammar, out) + rules = grammar.rules + self.assertFalse(rules["start"].left_recursive) + self.assertTrue(rules["foo"].left_recursive) + self.assertTrue(rules["bar"].left_recursive) + genr.generate("") + ns: Dict[str, Any] = {} + exec(out.getvalue(), ns) + parser_class: Type[Parser] = ns["GeneratedParser"] + node = parse_string("D A C A E", parser_class) + self.assertEqual(node, [ + [ + [ + [ + [TokenInfo(type=NAME, string="D", start=(1, 0), end=(1, 1), line="D A C A E")], + TokenInfo(type=NAME, string="A", start=(1, 2), end=(1, 3), line="D A C A E"), + ], + TokenInfo(type=NAME, string="C", start=(1, 4), end=(1, 5), line="D A C A E"), + ], + TokenInfo(type=NAME, string="A", start=(1, 6), end=(1, 7), line="D A C A E"), + ], + TokenInfo(type=NAME, string="E", start=(1, 8), end=(1, 9), line="D A C A E"), + ]) + node = parse_string("B C A E", parser_class) + self.assertIsNotNone(node) + self.assertEqual(node, [ + [ + [ + [TokenInfo(type=NAME, string="B", start=(1, 0), end=(1, 1), line="B C A E")], + TokenInfo(type=NAME, string="C", start=(1, 2), end=(1, 3), line="B C A E"), + ], + TokenInfo(type=NAME, string="A", start=(1, 4), end=(1, 5), line="B C A E"), + ], + TokenInfo(type=NAME, string="E", start=(1, 6), end=(1, 7), line="B C A E"), + ]) + + def test_nasty_mutually_left_recursive(self) -> None: + # This grammar does not recognize 'x - + =', much to my chagrin. + # But that's the way PEG works. + # [Breathlessly] + # The problem is that the toplevel target call + # recurses into maybe, which recognizes 'x - +', + # and then the toplevel target looks for another '+', + # which fails, so it retreats to NAME, + # which succeeds, so we end up just recognizing 'x', + # and then start fails because there's no '=' after that. + grammar_source = """ + start: target '=' + target: maybe '+' | NAME + maybe: maybe '-' | target + """ + grammar: Grammar = parse_string(grammar_source, GrammarParser) + out = io.StringIO() + genr = PythonParserGenerator(grammar, out) + genr.generate("") + ns: Dict[str, Any] = {} + exec(out.getvalue(), ns) + parser_class = ns["GeneratedParser"] + with self.assertRaises(SyntaxError): + parse_string("x - + =", parser_class) + + def test_lookahead(self) -> None: + grammar = """ + start: (expr_stmt | assign_stmt) &'.' + expr_stmt: !(target '=') expr + assign_stmt: target '=' expr + expr: term ('+' term)* + target: NAME + term: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("foo = 12 + 12 .", parser_class) + self.assertEqual(node, [ + [ + [ + [TokenInfo(NAME, string="foo", start=(1, 0), end=(1, 3), line="foo = 12 + 12 .")], + TokenInfo(OP, string="=", start=(1, 4), end=(1, 5), line="foo = 12 + 12 ."), + [ + [ + TokenInfo( + NUMBER, string="12", start=(1, 6), end=(1, 8), line="foo = 12 + 12 ." + ) + ], + [ + [ + [ + TokenInfo( + OP, + string="+", + start=(1, 9), + end=(1, 10), + line="foo = 12 + 12 .", + ), + [ + TokenInfo( + NUMBER, + string="12", + start=(1, 11), + end=(1, 13), + line="foo = 12 + 12 .", + ) + ], + ] + ] + ], + ], + ] + ] + ]) + + def test_named_lookahead_error(self) -> None: + grammar = """ + start: foo=!'x' NAME + """ + with self.assertRaises(SyntaxError): + make_parser(grammar) + + def test_start_leader(self) -> None: + grammar = """ + start: attr | NAME + attr: start '.' NAME + """ + # Would assert False without a special case in compute_left_recursives(). + make_parser(grammar) + + def test_left_recursion_too_complex(self) -> None: + grammar = """ + start: foo + foo: bar '+' | baz '+' | '+' + bar: baz '-' | foo '-' | '-' + baz: foo '*' | bar '*' | '*' + """ + with self.assertRaises(ValueError) as errinfo: + make_parser(grammar) + self.assertTrue("no leader" in str(errinfo.exception.value)) + + def test_cut(self) -> None: + grammar = """ + start: '(' ~ expr ')' + expr: NUMBER + """ + parser_class = make_parser(grammar) + node = parse_string("(1)", parser_class, verbose=True) + self.assertEqual(node, [ + TokenInfo(OP, string="(", start=(1, 0), end=(1, 1), line="(1)"), + [TokenInfo(NUMBER, string="1", start=(1, 1), end=(1, 2), line="(1)")], + TokenInfo(OP, string=")", start=(1, 2), end=(1, 3), line="(1)"), + ]) + + def test_dangling_reference(self) -> None: + grammar = """ + start: foo ENDMARKER + foo: bar NAME + """ + with self.assertRaises(GrammarError): + parser_class = make_parser(grammar) + + def test_bad_token_reference(self) -> None: + grammar = """ + start: foo + foo: NAMEE + """ + with self.assertRaises(GrammarError): + parser_class = make_parser(grammar) + + def test_missing_start(self) -> None: + grammar = """ + foo: NAME + """ + with self.assertRaises(GrammarError): + parser_class = make_parser(grammar) + + +class TestGrammarVisitor: + class Visitor(GrammarVisitor): + def __init__(self) -> None: + self.n_nodes = 0 + + def visit(self, node: Any, *args: Any, **kwargs: Any) -> None: + self.n_nodes += 1 + super().visit(node, *args, **kwargs) + + def test_parse_trivial_grammar(self) -> None: + grammar = """ + start: 'a' + """ + rules = parse_string(grammar, GrammarParser) + visitor = self.Visitor() + + visitor.visit(rules) + + self.assertEqual(visitor.n_nodes, 6) + + def test_parse_or_grammar(self) -> None: + grammar = """ + start: rule + rule: 'a' | 'b' + """ + rules = parse_string(grammar, GrammarParser) + visitor = self.Visitor() + + visitor.visit(rules) + + # Grammar/Rule/Rhs/Alt/NamedItem/NameLeaf -> 6 + # Rule/Rhs/ -> 2 + # Alt/NamedItem/StringLeaf -> 3 + # Alt/NamedItem/StringLeaf -> 3 + + self.assertEqual(visitor.n_nodes, 14) + + def test_parse_repeat1_grammar(self) -> None: + grammar = """ + start: 'a'+ + """ + rules = parse_string(grammar, GrammarParser) + visitor = self.Visitor() + + visitor.visit(rules) + + # Grammar/Rule/Rhs/Alt/NamedItem/Repeat1/StringLeaf -> 6 + self.assertEqual(visitor.n_nodes, 7) + + def test_parse_repeat0_grammar(self) -> None: + grammar = """ + start: 'a'* + """ + rules = parse_string(grammar, GrammarParser) + visitor = self.Visitor() + + visitor.visit(rules) + + # Grammar/Rule/Rhs/Alt/NamedItem/Repeat0/StringLeaf -> 6 + + self.assertEqual(visitor.n_nodes, 7) + + def test_parse_optional_grammar(self) -> None: + grammar = """ + start: 'a' ['b'] + """ + rules = parse_string(grammar, GrammarParser) + visitor = self.Visitor() + + visitor.visit(rules) + + # Grammar/Rule/Rhs/Alt/NamedItem/StringLeaf -> 6 + # NamedItem/Opt/Rhs/Alt/NamedItem/Stringleaf -> 6 + + self.assertEqual(visitor.n_nodes, 12) + + +class TestGrammarVisualizer(unittest.TestCase): + def test_simple_rule(self) -> None: + grammar = """ + start: 'a' 'b' + """ + rules = parse_string(grammar, GrammarParser) + + printer = ASTGrammarPrinter() + lines: List[str] = [] + printer.print_grammar_ast(rules, printer=lines.append) + + output = "\n".join(lines) + expected_output = textwrap.dedent( + """\ + ???Rule + ???Rhs + ???Alt + ???NamedItem + ? ???StringLeaf("'a'") + ???NamedItem + ???StringLeaf("'b'") + """ + ) + + self.assertEqual(output, expected_output) + + def test_multiple_rules(self) -> None: + grammar = """ + start: a b + a: 'a' + b: 'b' + """ + rules = parse_string(grammar, GrammarParser) + + printer = ASTGrammarPrinter() + lines: List[str] = [] + printer.print_grammar_ast(rules, printer=lines.append) + + output = "\n".join(lines) + expected_output = textwrap.dedent( + """\ + ???Rule + ???Rhs + ???Alt + ???NamedItem + ? ???NameLeaf('a') + ???NamedItem + ???NameLeaf('b') + + ???Rule + ???Rhs + ???Alt + ???NamedItem + ???StringLeaf("'a'") + + ???Rule + ???Rhs + ???Alt + ???NamedItem + ???StringLeaf("'b'") + """ + ) + + self.assertEqual(output, expected_output) + + def test_deep_nested_rule(self) -> None: + grammar = """ + start: 'a' ['b'['c'['d']]] + """ + rules = parse_string(grammar, GrammarParser) + + printer = ASTGrammarPrinter() + lines: List[str] = [] + printer.print_grammar_ast(rules, printer=lines.append) + + output = "\n".join(lines) + print() + print(output) + expected_output = textwrap.dedent( + """\ + ???Rule + ???Rhs + ???Alt + ???NamedItem + ? ???StringLeaf("'a'") + ???NamedItem + ???Opt + ???Rhs + ???Alt + ???NamedItem + ? ???StringLeaf("'b'") + ???NamedItem + ???Opt + ???Rhs + ???Alt + ???NamedItem + ? ???StringLeaf("'c'") + ???NamedItem + ???Opt + ???Rhs + ???Alt + ???NamedItem + ???StringLeaf("'d'") + """ + ) + + self.assertEqual(output, expected_output) diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py new file mode 100644 index 0000000000000..5aa6c0d8f4814 --- /dev/null +++ b/Lib/test/test_peg_parser.py @@ -0,0 +1,764 @@ +import ast +import os +import sys +import _peg_parser as peg_parser +import unittest +from pathlib import PurePath +from typing import Any, Union, Iterable, Tuple +from textwrap import dedent + + +TEST_CASES = [ + ('annotated_assignment', 'x: int = 42'), + ('annotated_assignment_with_tuple', 'x: tuple = 1, 2'), + ('annotated_assignment_with_parens', '(paren): int = 3+2'), + ('annotated_assignment_with_yield', 'x: int = yield 42'), + ('annotated_no_assignment', 'x: int'), + ('annotation_with_multiple_parens', '((parens)): int'), + ('annotation_with_parens', '(parens): int'), + ('annotated_assignment_with_attr', 'a.b: int'), + ('annotated_assignment_with_subscript', 'a[b]: int'), + ('annotated_assignment_with_attr_and_parens', '(a.b): int'), + ('annotated_assignment_with_subscript_and_parens', '(a[b]): int'), + ('assert', 'assert a'), + ('assert_message', 'assert a, b'), + ('assignment_false', 'a = False'), + ('assignment_none', 'a = None'), + ('assignment_true', 'a = True'), + ('assignment_paren', '(a) = 42'), + ('assignment_paren_multiple', '(a, b) = (0, 1)'), + ('asyncfor', + ''' + async for i in a: + pass + '''), + ('attribute_call', 'a.b()'), + ('attribute_multiple_names', 'abcd.efg.hij'), + ('attribute_simple', 'a.b'), + ('attributes_subscript', 'a.b[0]'), + ('augmented_assignment', 'x += 42'), + ('binop_add', '1 + 1'), + ('binop_add_multiple', '1 + 1 + 1 + 1'), + ('binop_all', '1 + 2 * 5 + 3 ** 2 - -3'), + ('binop_boolop_comp', '1 + 1 == 2 or 1 + 1 == 3 and not b'), + ('boolop_or', 'a or b'), + ('boolop_or_multiple', 'a or b or c'), + ('class_def_bases', + ''' + class C(A, B): + pass + '''), + ('class_def_decorators', + ''' + @a + class C: + pass + '''), + ('class_def_decorator_with_expression', + ''' + @lambda x: 42 + class C: + pass + '''), + ('class_def_decorator_with_expression_and_walrus', + ''' + @x:=lambda x: 42 + class C: + pass + '''), + + ('class_def_keywords', + ''' + class C(keyword=a+b, **c): + pass + '''), + ('class_def_mixed', + ''' + class C(A, B, keyword=0, **a): + pass + '''), + ('class_def_simple', + ''' + class C: + pass + '''), + ('class_def_starred_and_kwarg', + ''' + class C(A, B, *x, **y): + pass + '''), + ('class_def_starred_in_kwargs', + ''' + class C(A, x=2, *[B, C], y=3): + pass + '''), + ('call_attribute', 'f().b'), + ('call_genexp', 'f(i for i in a)'), + ('call_mixed_args', 'f(a, b, *c, **d)'), + ('call_mixed_args_named', 'f(a, b, *c, d=4, **v)'), + ('call_one_arg', 'f(a)'), + ('call_posarg_genexp', 'f(a, (i for i in a))'), + ('call_simple', 'f()'), + ('call_subscript', 'f()[0]'), + ('comp', 'a == b'), + ('comp_multiple', 'a == b == c'), + ('comp_paren_end', 'a == (b-1)'), + ('comp_paren_start', '(a-1) == b'), + ('decorator', + ''' + @a + def f(): + pass + '''), + ('decorator_async', + ''' + @a + async def d(): + pass + '''), + ('decorator_with_expression', + ''' + @lambda x: 42 + def f(): + pass + '''), + ('decorator_with_expression_and_walrus', + ''' + @x:=lambda x: 42 + def f(): + pass + '''), + ('del_attribute', 'del a.b'), + ('del_call_attribute', 'del a().c'), + ('del_call_genexp_attribute', 'del a(i for i in b).c'), + ('del_empty', 'del()'), + ('del_list', 'del a, [b, c]'), + ('del_mixed', 'del a[0].b().c'), + ('del_multiple', 'del a, b'), + ('del_multiple_calls_attribute', 'del a()().b'), + ('del_paren', 'del(a,b)'), + ('del_paren_single_target', 'del(a)'), + ('del_subscript_attribute', 'del a[0].b'), + ('del_tuple', 'del a, (b, c)'), + ('delete', 'del a'), + ('dict', + ''' + { + a: 1, + b: 2, + c: 3 + } + '''), + ('dict_comp', '{x:1 for x in a}'), + ('dict_comp_if', '{x:1+2 for x in a if b}'), + ('dict_empty', '{}'), + ('for', + ''' + for i in a: + pass + '''), + ('for_else', + ''' + for i in a: + pass + else: + pass + '''), + ('for_star_target_in_paren', 'for (a) in b: pass'), + ('for_star_targets_attribute', 'for a.b in c: pass'), + ('for_star_targets_call_attribute', 'for a().c in b: pass'), + ('for_star_targets_empty', 'for () in a: pass'), + ('for_star_targets_mixed', 'for a[0].b().c in d: pass'), + ('for_star_targets_mixed_starred', + ''' + for a, *b, (c, d) in e: + pass + '''), + ('for_star_targets_multiple', 'for a, b in c: pass'), + ('for_star_targets_nested_starred', 'for *[*a] in b: pass'), + ('for_star_targets_starred', 'for *a in b: pass'), + ('for_star_targets_subscript_attribute', 'for a[0].b in c: pass'), + ('for_star_targets_trailing_comma', + ''' + for a, (b, c), in d: + pass + '''), + ('for_star_targets_tuple', 'for a, (b, c) in d: pass'), + ('for_underscore', + ''' + for _ in a: + pass + '''), + ('function_return_type', + ''' + def f() -> Any: + pass + '''), + ('f-string_slice', "f'{x[2]}'"), + ('f-string_slice_upper', "f'{x[2:3]}'"), + ('f-string_slice_step', "f'{x[2:3:-2]}'"), + ('f-string_constant', "f'{42}'"), + ('f-string_boolop', "f'{x and y}'"), + ('f-string_named_expr', "f'{(x:=42)}'"), + ('f-string_binop', "f'{x+y}'"), + ('f-string_unaryop', "f'{not x}'"), + ('f-string_lambda', "f'{(lambda x, /, y, y2=42 , *z, k1, k2=34, **k3: 42)}'"), + ('f-string_lambda_call', "f'{(lambda: 2)(2)}'"), + ('f-string_ifexpr', "f'{x if y else z}'"), + ('f-string_dict', "f'{ {2:34, 3:34} }'"), + ('f-string_set', "f'{ {2,-45} }'"), + ('f-string_list', "f'{ [2,-45] }'"), + ('f-string_tuple', "f'{ (2,-45) }'"), + ('f-string_listcomp', "f'{[x for x in y if z]}'"), + ('f-string_setcomp', "f'{ {x for x in y if z} }'"), + ('f-string_dictcomp', "f'{ {x:x for x in y if z} }'"), + ('f-string_genexpr', "f'{ (x for x in y if z) }'"), + ('f-string_yield', "f'{ (yield x) }'"), + ('f-string_yieldfrom', "f'{ (yield from x) }'"), + ('f-string_await', "f'{ await x }'"), + ('f-string_compare', "f'{ x == y }'"), + ('f-string_call', "f'{ f(x,y,z) }'"), + ('f-string_attribute', "f'{ f.x.y.z }'"), + ('f-string_starred', "f'{ *x, }'"), + ('f-string_doublestarred', "f'{ {**x} }'"), + ('f-string_escape_brace', "f'{{Escape'"), + ('f-string_escape_closing_brace', "f'Escape}}'"), + ('f-string_repr', "f'{a!r}'"), + ('f-string_str', "f'{a!s}'"), + ('f-string_ascii', "f'{a!a}'"), + ('f-string_debug', "f'{a=}'"), + ('f-string_padding', "f'{a:03d}'"), + ('f-string_multiline', + """ + f''' + {hello} + ''' + """), + ('f-string_multiline_in_expr', + """ + f''' + { + hello + } + ''' + """), + ('f-string_multiline_in_call', + """ + f''' + {f( + a, b, c + )} + ''' + """), + ('global', 'global a, b'), + ('group', '(yield a)'), + ('if_elif', + ''' + if a: + pass + elif b: + pass + '''), + ('if_elif_elif', + ''' + if a: + pass + elif b: + pass + elif c: + pass + '''), + ('if_elif_else', + ''' + if a: + pass + elif b: + pass + else: + pass + '''), + ('if_else', + ''' + if a: + pass + else: + pass + '''), + ('if_simple', 'if a: pass'), + ('import', 'import a'), + ('import_alias', 'import a as b'), + ('import_dotted', 'import a.b'), + ('import_dotted_alias', 'import a.b as c'), + ('import_dotted_multichar', 'import ab.cd'), + ('import_from', 'from a import b'), + ('import_from_alias', 'from a import b as c'), + ('import_from_dotted', 'from a.b import c'), + ('import_from_dotted_alias', 'from a.b import c as d'), + ('import_from_multiple_aliases', 'from a import b as c, d as e'), + ('import_from_one_dot', 'from .a import b'), + ('import_from_one_dot_alias', 'from .a import b as c'), + ('import_from_star', 'from a import *'), + ('import_from_three_dots', 'from ...a import b'), + ('import_from_trailing_comma', 'from a import (b,)'), + ('kwarg', + ''' + def f(**a): + pass + '''), + ('kwonly_args', + ''' + def f(*, a, b): + pass + '''), + ('kwonly_args_with_default', + ''' + def f(*, a=2, b): + pass + '''), + ('lambda_kwarg', 'lambda **a: 42'), + ('lambda_kwonly_args', 'lambda *, a, b: 42'), + ('lambda_kwonly_args_with_default', 'lambda *, a=2, b: 42'), + ('lambda_mixed_args', 'lambda a, /, b, *, c: 42'), + ('lambda_mixed_args_with_default', 'lambda a, b=2, /, c=3, *e, f, **g: 42'), + ('lambda_no_args', 'lambda: 42'), + ('lambda_pos_args', 'lambda a,b: 42'), + ('lambda_pos_args_with_default', 'lambda a, b=2: 42'), + ('lambda_pos_only_args', 'lambda a, /: 42'), + ('lambda_pos_only_args_with_default', 'lambda a=0, /: 42'), + ('lambda_pos_posonly_args', 'lambda a, b, /, c, d: 42'), + ('lambda_pos_posonly_args_with_default', 'lambda a, b=0, /, c=2: 42'), + ('lambda_vararg', 'lambda *a: 42'), + ('lambda_vararg_kwonly_args', 'lambda *a, b: 42'), + ('list', '[1, 2, a]'), + ('list_comp', '[i for i in a]'), + ('list_comp_if', '[i for i in a if b]'), + ('list_trailing_comma', '[1+2, a, 3+4,]'), + ('mixed_args', + ''' + def f(a, /, b, *, c): + pass + '''), + ('mixed_args_with_default', + ''' + def f(a, b=2, /, c=3, *e, f, **g): + pass + '''), + ('multipart_string_bytes', 'b"Hola" b"Hello" b"Bye"'), + ('multipart_string_triple', '"""Something here""" "and now"'), + ('multipart_string_different_prefixes', 'u"Something" "Other thing" r"last thing"'), + ('multiple_assignments', 'x = y = z = 42'), + ('multiple_assignments_with_yield', 'x = y = z = yield 42'), + ('multiple_pass', + ''' + pass; pass + pass + '''), + ('namedexpr', '(x := [1, 2, 3])'), + ('namedexpr_false', '(x := False)'), + ('namedexpr_none', '(x := None)'), + ('namedexpr_true', '(x := True)'), + ('nonlocal', 'nonlocal a, b'), + ('number_complex', '-2.234+1j'), + ('number_float', '-34.2333'), + ('number_imaginary_literal', '1.1234j'), + ('number_integer', '-234'), + ('number_underscores', '1_234_567'), + ('pass', 'pass'), + ('pos_args', + ''' + def f(a, b): + pass + '''), + ('pos_args_with_default', + ''' + def f(a, b=2): + pass + '''), + ('pos_only_args', + ''' + def f(a, /): + pass + '''), + ('pos_only_args_with_default', + ''' + def f(a=0, /): + pass + '''), + ('pos_posonly_args', + ''' + def f(a, b, /, c, d): + pass + '''), + ('pos_posonly_args_with_default', + ''' + def f(a, b=0, /, c=2): + pass + '''), + ('primary_mixed', 'a.b.c().d[0]'), + ('raise', 'raise'), + ('raise_ellipsis', 'raise ...'), + ('raise_expr', 'raise a'), + ('raise_from', 'raise a from b'), + ('return', 'return'), + ('return_expr', 'return a'), + ('set', '{1, 2+4, 3+5}'), + ('set_comp', '{i for i in a}'), + ('set_trailing_comma', '{1, 2, 3,}'), + ('simple_assignment', 'x = 42'), + ('simple_assignment_with_yield', 'x = yield 42'), + ('string_bytes', 'b"hello"'), + ('string_concatenation_bytes', 'b"hello" b"world"'), + ('string_concatenation_simple', '"abcd" "efgh"'), + ('string_format_simple', 'f"hello"'), + ('string_format_with_formatted_value', 'f"hello {world}"'), + ('string_simple', '"hello"'), + ('string_unicode', 'u"hello"'), + ('subscript_attribute', 'a[0].b'), + ('subscript_call', 'a[b]()'), + ('subscript_multiple_slices', 'a[0:a:2, 1]'), + ('subscript_simple', 'a[0]'), + ('subscript_single_element_tuple', 'a[0,]'), + ('subscript_trailing_comma', 'a[0, 1, 2,]'), + ('subscript_tuple', 'a[0, 1, 2]'), + ('subscript_whole_slice', 'a[0+1:b:c]'), + ('try_except', + ''' + try: + pass + except: + pass + '''), + ('try_except_else', + ''' + try: + pass + except: + pass + else: + pass + '''), + ('try_except_else_finally', + ''' + try: + pass + except: + pass + else: + pass + finally: + pass + '''), + ('try_except_expr', + ''' + try: + pass + except a: + pass + '''), + ('try_except_expr_target', + ''' + try: + pass + except a as b: + pass + '''), + ('try_except_finally', + ''' + try: + pass + except: + pass + finally: + pass + '''), + ('try_finally', + ''' + try: + pass + finally: + pass + '''), + ('unpacking_binop', '[*([1, 2, 3] + [3, 4, 5])]'), + ('unpacking_call', '[*b()]'), + ('unpacking_compare', '[*(x < y)]'), + ('unpacking_constant', '[*3]'), + ('unpacking_dict', '[*{1: 2, 3: 4}]'), + ('unpacking_dict_comprehension', '[*{x:y for x,y in z}]'), + ('unpacking_ifexpr', '[*([1, 2, 3] if x else y)]'), + ('unpacking_list', '[*[1,2,3]]'), + ('unpacking_list_comprehension', '[*[x for x in y]]'), + ('unpacking_namedexpr', '[*(x:=[1, 2, 3])]'), + ('unpacking_set', '[*{1,2,3}]'), + ('unpacking_set_comprehension', '[*{x for x in y}]'), + ('unpacking_string', '[*"myvalue"]'), + ('unpacking_tuple', '[*(1,2,3)]'), + ('unpacking_unaryop', '[*(not [1, 2, 3])]'), + ('unpacking_yield', '[*(yield 42)]'), + ('unpacking_yieldfrom', '[*(yield from x)]'), + ('tuple', '(1, 2, 3)'), + ('vararg', + ''' + def f(*a): + pass + '''), + ('vararg_kwonly_args', + ''' + def f(*a, b): + pass + '''), + ('while', + ''' + while a: + pass + '''), + ('while_else', + ''' + while a: + pass + else: + pass + '''), + ('with', + ''' + with a: + pass + '''), + ('with_as', + ''' + with a as b: + pass + '''), + ('with_as_paren', + ''' + with a as (b): + pass + '''), + ('with_as_empty', 'with a as (): pass'), + ('with_list_recursive', + ''' + with a as [x, [y, z]]: + pass + '''), + ('with_tuple_recursive', + ''' + with a as ((x, y), z): + pass + '''), + ('with_tuple_target', + ''' + with a as (x, y): + pass + '''), + ('yield', 'yield'), + ('yield_expr', 'yield a'), + ('yield_from', 'yield from a'), +] + +FAIL_TEST_CASES = [ + ("annotation_multiple_targets", "(a, b): int = 42"), + ("annotation_nested_tuple", "((a, b)): int"), + ("annotation_list", "[a]: int"), + ("annotation_lambda", "lambda: int = 42"), + ("annotation_tuple", "(a,): int"), + ("annotation_tuple_without_paren", "a,: int"), + ("assignment_keyword", "a = if"), + ("comprehension_lambda", "(a for a in lambda: b)"), + ("comprehension_else", "(a for a in b if c else d"), + ("del_call", "del a()"), + ("del_call_genexp", "del a(i for i in b)"), + ("del_subscript_call", "del a[b]()"), + ("del_attribute_call", "del a.b()"), + ("del_mixed_call", "del a[0].b().c.d()"), + ("for_star_targets_call", "for a() in b: pass"), + ("for_star_targets_subscript_call", "for a[b]() in c: pass"), + ("for_star_targets_attribute_call", "for a.b() in c: pass"), + ("for_star_targets_mixed_call", "for a[0].b().c.d() in e: pass"), + ("for_star_targets_in", "for a, in in b: pass"), + ("f-string_assignment", "f'{x = 42}'"), + ("f-string_empty", "f'{}'"), + ("f-string_function_def", "f'{def f(): pass}'"), + ("f-string_lambda", "f'{lambda x: 42}'"), + ("f-string_singe_brace", "f'{'"), + ("f-string_single_closing_brace", "f'}'"), + ("from_import_invalid", "from import import a"), + ("from_import_trailing_comma", "from a import b,"), + # This test case checks error paths involving tokens with uninitialized + # values of col_offset and end_col_offset. + ("invalid indentation", + """ + def f(): + a + a + """), + ("not_terminated_string", "a = 'example"), +] + +FAIL_SPECIALIZED_MESSAGE_CASES = [ + ("f(x, y, z=1, **b, *a", "iterable argument unpacking follows keyword argument unpacking"), + ("f(x, y=1, *z, **a, b", "positional argument follows keyword argument unpacking"), + ("f(x, y, z=1, a=2, b", "positional argument follows keyword argument"), + ("True = 1", "cannot assign to True"), + ("a() = 1", "cannot assign to function call"), + ("(a, b): int", "only single target (not tuple) can be annotated"), + ("[a, b]: int", "only single target (not list) can be annotated"), + ("a(): int", "illegal target for annotation"), + ("1 += 1", "cannot assign to literal"), + ("pass\n pass", "unexpected indent"), + ("def f():\npass", "expected an indented block"), +] + +GOOD_BUT_FAIL_TEST_CASES = [ + ('string_concatenation_format', 'f"{hello} world" f"again {and_again}"'), + ('string_concatenation_multiple', + ''' + f"hello" f"{world} again" f"and_again" + '''), + ('f-string_multiline_comp', + """ + f''' + {(i for i in a + if b)} + ''' + """), +] + +FSTRINGS_TRACEBACKS = { + 'multiline_fstrings_same_line_with_brace': ( + """ + f''' + {a$b} + ''' + """, + '(a$b)', + ), + 'multiline_fstring_brace_on_next_line': ( + """ + f''' + {a$b + }''' + """, + '(a$b', + ), + 'multiline_fstring_brace_on_previous_line': ( + """ + f''' + { + a$b}''' + """, + 'a$b)', + ), +} + +EXPRESSIONS_TEST_CASES = [ + ("expression_add", "1+1"), + ("expression_add_2", "a+b"), + ("expression_call", "f(a, b=2, **kw)"), + ("expression_tuple", "1, 2, 3"), + ("expression_tuple_one_value", "1,") +] + + +def cleanup_source(source: Any) -> str: + if isinstance(source, str): + result = dedent(source) + elif not isinstance(source, (list, tuple)): + result = "\n".join(source) + else: + raise TypeError(f"Invalid type for test source: {source}") + return result + + +def prepare_test_cases( + test_cases: Iterable[Tuple[str, Union[str, Iterable[str]]]] +) -> Tuple[Iterable[str], Iterable[str]]: + + test_ids, _test_sources = zip(*test_cases) + test_sources = list(_test_sources) + for index, source in enumerate(test_sources): + result = cleanup_source(source) + test_sources[index] = result + return test_ids, test_sources + + +TEST_IDS, TEST_SOURCES = prepare_test_cases(TEST_CASES) + +GOOD_BUT_FAIL_TEST_IDS, GOOD_BUT_FAIL_SOURCES = prepare_test_cases( + GOOD_BUT_FAIL_TEST_CASES +) + +FAIL_TEST_IDS, FAIL_SOURCES = prepare_test_cases(FAIL_TEST_CASES) + +EXPRESSIONS_TEST_IDS, EXPRESSIONS_TEST_SOURCES = prepare_test_cases( + EXPRESSIONS_TEST_CASES +) + + +class ASTGenerationTest(unittest.TestCase): + def test_correct_ast_generation_on_source_files(self) -> None: + self.maxDiff = None + for source in TEST_SOURCES: + actual_ast = peg_parser.parse_string(source) + expected_ast = ast.parse(source) + self.assertEqual( + ast.dump(actual_ast, include_attributes=True), + ast.dump(expected_ast, include_attributes=True), + f"Wrong AST generation for source: {source}", + ) + + def test_incorrect_ast_generation_on_source_files(self) -> None: + for source in FAIL_SOURCES: + with self.assertRaises(SyntaxError, msg=f"Parsing {source} did not raise an exception"): + peg_parser.parse_string(source) + + def test_incorrect_ast_generation_with_specialized_errors(self) -> None: + for source, error_text in FAIL_SPECIALIZED_MESSAGE_CASES: + exc = IndentationError if "indent" in error_text else SyntaxError + with self.assertRaises(exc) as se: + peg_parser.parse_string(source) + self.assertTrue( + error_text in se.exception.msg, + f"Actual error message does not match expexted for {source}" + ) + + @unittest.skipIf(sys.flags.use_peg, "This tests nothing for now, since compile uses pegen as well") + @unittest.expectedFailure + def test_correct_but_known_to_fail_ast_generation_on_source_files(self) -> None: + for source in GOOD_BUT_FAIL_SOURCES: + actual_ast = peg_parser.parse_string(source) + expected_ast = ast.parse(source) + self.assertEqual( + ast.dump(actual_ast, include_attributes=True), + ast.dump(expected_ast, include_attributes=True), + f"Wrong AST generation for source: {source}", + ) + + def test_correct_ast_generation_without_pos_info(self) -> None: + for source in GOOD_BUT_FAIL_SOURCES: + actual_ast = peg_parser.parse_string(source) + expected_ast = ast.parse(source) + self.assertEqual( + ast.dump(actual_ast), + ast.dump(expected_ast), + f"Wrong AST generation for source: {source}", + ) + + def test_fstring_parse_error_tracebacks(self) -> None: + for source, error_text in FSTRINGS_TRACEBACKS.values(): + with self.assertRaises(SyntaxError) as se: + peg_parser.parse_string(dedent(source)) + self.assertEqual(error_text, se.exception.text) + + def test_correct_ast_generatrion_eval(self) -> None: + for source in EXPRESSIONS_TEST_SOURCES: + actual_ast = peg_parser.parse_string(source, mode='eval') + expected_ast = ast.parse(source, mode='eval') + self.assertEqual( + ast.dump(actual_ast, include_attributes=True), + ast.dump(expected_ast, include_attributes=True), + f"Wrong AST generation for source: {source}", + ) + + def test_tokenizer_errors_are_propagated(self) -> None: + n=201 + with self.assertRaisesRegex(SyntaxError, "too many nested parentheses"): + peg_parser.parse_string(n*'(' + ')'*n) diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py index 0a9503e2025d6..332690051ed4d 100644 --- a/Lib/test/test_positional_only_arg.py +++ b/Lib/test/test_positional_only_arg.py @@ -3,6 +3,7 @@ import dis import pickle import unittest +import sys from test.support import check_syntax_error @@ -23,10 +24,12 @@ def assertRaisesSyntaxError(self, codestr, regex="invalid syntax"): compile(codestr + "\n", "", "single") def test_invalid_syntax_errors(self): - check_syntax_error(self, "def f(a, b = 5, /, c): pass", "non-default argument follows default argument") - check_syntax_error(self, "def f(a = 5, b, /, c): pass", "non-default argument follows default argument") - check_syntax_error(self, "def f(a = 5, b=1, /, c, *, d=2): pass", "non-default argument follows default argument") - check_syntax_error(self, "def f(a = 5, b, /): pass", "non-default argument follows default argument") + if not sys.flags.use_peg: + check_syntax_error(self, "def f(a, b = 5, /, c): pass", "non-default argument follows default argument") + check_syntax_error(self, "def f(a = 5, b, /, c): pass", "non-default argument follows default argument") + check_syntax_error(self, "def f(a = 5, b=1, /, c, *, d=2): pass", "non-default argument follows default argument") + check_syntax_error(self, "def f(a = 5, b, /): pass", "non-default argument follows default argument") + check_syntax_error(self, "def f(*args, /): pass") check_syntax_error(self, "def f(*args, a, /): pass") check_syntax_error(self, "def f(**kwargs, /): pass") @@ -44,10 +47,12 @@ def test_invalid_syntax_errors(self): check_syntax_error(self, "def f(a, *, c, /, d, e): pass") def test_invalid_syntax_errors_async(self): - check_syntax_error(self, "async def f(a, b = 5, /, c): pass", "non-default argument follows default argument") - check_syntax_error(self, "async def f(a = 5, b, /, c): pass", "non-default argument follows default argument") - check_syntax_error(self, "async def f(a = 5, b=1, /, c, d=2): pass", "non-default argument follows default argument") - check_syntax_error(self, "async def f(a = 5, b, /): pass", "non-default argument follows default argument") + if not sys.flags.use_peg: + check_syntax_error(self, "async def f(a, b = 5, /, c): pass", "non-default argument follows default argument") + check_syntax_error(self, "async def f(a = 5, b, /, c): pass", "non-default argument follows default argument") + check_syntax_error(self, "async def f(a = 5, b=1, /, c, d=2): pass", "non-default argument follows default argument") + check_syntax_error(self, "async def f(a = 5, b, /): pass", "non-default argument follows default argument") + check_syntax_error(self, "async def f(*args, /): pass") check_syntax_error(self, "async def f(*args, a, /): pass") check_syntax_error(self, "async def f(**kwargs, /): pass") @@ -231,9 +236,11 @@ def test_lambdas(self): self.assertEqual(x(1, 2), 3) def test_invalid_syntax_lambda(self): - check_syntax_error(self, "lambda a, b = 5, /, c: None", "non-default argument follows default argument") - check_syntax_error(self, "lambda a = 5, b, /, c: None", "non-default argument follows default argument") - check_syntax_error(self, "lambda a = 5, b, /: None", "non-default argument follows default argument") + if not sys.flags.use_peg: + check_syntax_error(self, "lambda a, b = 5, /, c: None", "non-default argument follows default argument") + check_syntax_error(self, "lambda a = 5, b, /, c: None", "non-default argument follows default argument") + check_syntax_error(self, "lambda a = 5, b, /: None", "non-default argument follows default argument") + check_syntax_error(self, "lambda *args, /: None") check_syntax_error(self, "lambda *args, a, /: None") check_syntax_error(self, "lambda **kwargs, /: None") diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py index 0cea2edc32afa..382c532df5e1e 100644 --- a/Lib/test/test_string_literals.py +++ b/Lib/test/test_string_literals.py @@ -119,7 +119,8 @@ def test_eval_str_invalid_escape(self): eval("'''\n\\z'''") self.assertEqual(len(w), 1) self.assertEqual(w[0].filename, '') - self.assertEqual(w[0].lineno, 1) + if not sys.flags.use_peg: + self.assertEqual(w[0].lineno, 1) with warnings.catch_warnings(record=True) as w: warnings.simplefilter('error', category=DeprecationWarning) @@ -128,7 +129,8 @@ def test_eval_str_invalid_escape(self): exc = cm.exception self.assertEqual(w, []) self.assertEqual(exc.filename, '') - self.assertEqual(exc.lineno, 1) + if not sys.flags.use_peg: + self.assertEqual(exc.lineno, 1) def test_eval_str_raw(self): self.assertEqual(eval(""" r'x' """), 'x') @@ -168,7 +170,8 @@ def test_eval_bytes_invalid_escape(self): eval("b'''\n\\z'''") self.assertEqual(len(w), 1) self.assertEqual(w[0].filename, '') - self.assertEqual(w[0].lineno, 1) + if not sys.flags.use_peg: + self.assertEqual(w[0].lineno, 1) with warnings.catch_warnings(record=True) as w: warnings.simplefilter('error', category=DeprecationWarning) @@ -177,7 +180,8 @@ def test_eval_bytes_invalid_escape(self): exc = cm.exception self.assertEqual(w, []) self.assertEqual(exc.filename, '') - self.assertEqual(exc.lineno, 1) + if not sys.flags.use_peg: + self.assertEqual(exc.lineno, 1) def test_eval_bytes_raw(self): self.assertEqual(eval(""" br'x' """), b'x') diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index a7e7e2c9e6f02..4798f22b2bb82 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -63,9 +63,10 @@ Traceback (most recent call last): SyntaxError: cannot assign to function call ->>> del f() -Traceback (most recent call last): -SyntaxError: cannot delete function call +# Pegen does not support this yet +# >>> del f() +# Traceback (most recent call last): +# SyntaxError: cannot delete function call >>> a + 1 = 2 Traceback (most recent call last): @@ -100,29 +101,30 @@ This test just checks a couple of cases rather than enumerating all of them. ->>> (a, "b", c) = (1, 2, 3) -Traceback (most recent call last): -SyntaxError: cannot assign to literal +# All of the following also produce different error messages with pegen +# >>> (a, "b", c) = (1, 2, 3) +# Traceback (most recent call last): +# SyntaxError: cannot assign to literal ->>> (a, True, c) = (1, 2, 3) -Traceback (most recent call last): -SyntaxError: cannot assign to True +# >>> (a, True, c) = (1, 2, 3) +# Traceback (most recent call last): +# SyntaxError: cannot assign to True >>> (a, __debug__, c) = (1, 2, 3) Traceback (most recent call last): SyntaxError: cannot assign to __debug__ ->>> (a, *True, c) = (1, 2, 3) -Traceback (most recent call last): -SyntaxError: cannot assign to True +# >>> (a, *True, c) = (1, 2, 3) +# Traceback (most recent call last): +# SyntaxError: cannot assign to True >>> (a, *__debug__, c) = (1, 2, 3) Traceback (most recent call last): SyntaxError: cannot assign to __debug__ ->>> [a, b, c + 1] = [1, 2, 3] -Traceback (most recent call last): -SyntaxError: cannot assign to operator +# >>> [a, b, c + 1] = [1, 2, 3] +# Traceback (most recent call last): +# SyntaxError: cannot assign to operator >>> a if 1 else b = 1 Traceback (most recent call last): @@ -186,9 +188,11 @@ >>> f(x for x in L, **{}) Traceback (most recent call last): SyntaxError: Generator expression must be parenthesized ->>> f(L, x for x in L) -Traceback (most recent call last): -SyntaxError: Generator expression must be parenthesized + +# >>> f(L, x for x in L) +# Traceback (most recent call last): +# SyntaxError: Generator expression must be parenthesized + >>> f(x for x in L, y for y in L) Traceback (most recent call last): SyntaxError: Generator expression must be parenthesized @@ -297,31 +301,34 @@ ... 290, 291, 292, 293, 294, 295, 296, 297, 298, 299) # doctest: +ELLIPSIS (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..., 297, 298, 299) ->>> f(lambda x: x[0] = 3) -Traceback (most recent call last): -SyntaxError: expression cannot contain assignment, perhaps you meant "=="? +# >>> f(lambda x: x[0] = 3) +# Traceback (most recent call last): +# SyntaxError: expression cannot contain assignment, perhaps you meant "=="? The grammar accepts any test (basically, any expression) in the keyword slot of a call site. Test a few different options. ->>> f(x()=2) -Traceback (most recent call last): -SyntaxError: expression cannot contain assignment, perhaps you meant "=="? ->>> f(a or b=1) -Traceback (most recent call last): -SyntaxError: expression cannot contain assignment, perhaps you meant "=="? ->>> f(x.y=1) -Traceback (most recent call last): -SyntaxError: expression cannot contain assignment, perhaps you meant "=="? ->>> f((x)=2) -Traceback (most recent call last): -SyntaxError: expression cannot contain assignment, perhaps you meant "=="? ->>> f(True=2) -Traceback (most recent call last): -SyntaxError: cannot assign to True +# >>> f(x()=2) +# Traceback (most recent call last): +# SyntaxError: expression cannot contain assignment, perhaps you meant "=="? +# >>> f(a or b=1) +# Traceback (most recent call last): +# SyntaxError: expression cannot contain assignment, perhaps you meant "=="? +# >>> f(x.y=1) +# Traceback (most recent call last): +# SyntaxError: expression cannot contain assignment, perhaps you meant "=="? +# >>> f((x)=2) +# Traceback (most recent call last): +# SyntaxError: expression cannot contain assignment, perhaps you meant "=="? +# >>> f(True=2) +# Traceback (most recent call last): +# SyntaxError: cannot assign to True >>> f(__debug__=1) Traceback (most recent call last): SyntaxError: cannot assign to __debug__ +>>> __debug__: int +Traceback (most recent call last): +SyntaxError: cannot assign to __debug__ More set_context(): @@ -620,9 +627,9 @@ Traceback (most recent call last): SyntaxError: cannot assign to __debug__ - >>> with (lambda *:0): pass - Traceback (most recent call last): - SyntaxError: named arguments must follow bare * + # >>> with (lambda *:0): pass + # Traceback (most recent call last): + # SyntaxError: named arguments must follow bare * Corner-cases that used to crash: @@ -637,6 +644,7 @@ """ import re +import sys import unittest from test import support @@ -670,6 +678,8 @@ def _check_error(self, code, errtext, def test_assign_call(self): self._check_error("f() = 1", "assign") + @unittest.skipIf(sys.flags.use_peg, "Pegen does not produce a specialized error " + "message yet") def test_assign_del(self): self._check_error("del f()", "delete") diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 329f7ddeb2c57..bd4ea4794426c 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -545,10 +545,10 @@ def __hash__(self): def test_sys_flags(self): self.assertTrue(sys.flags) attrs = ("debug", - "inspect", "interactive", "optimize", "dont_write_bytecode", - "no_user_site", "no_site", "ignore_environment", "verbose", - "bytes_warning", "quiet", "hash_randomization", "isolated", - "dev_mode", "utf8_mode") + "inspect", "interactive", "optimize", "use_peg", + "dont_write_bytecode", "no_user_site", "no_site", + "ignore_environment", "verbose", "bytes_warning", "quiet", + "hash_randomization", "isolated", "dev_mode", "utf8_mode") for attr in attrs: self.assertTrue(hasattr(sys.flags, attr), attr) attr_type = bool if attr == "dev_mode" else int diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 60e0b582756b5..45f55e1f8ab6c 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -656,6 +656,8 @@ def outer_raise(): self.assertIn('inner_raise() # Marker', blocks[2]) self.check_zero_div(blocks[2]) + @unittest.skipIf(sys.flags.use_peg, + "Pegen is arguably better here, so no need to fix this") def test_syntax_error_offset_at_eol(self): # See #10186. def e(): diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index 017073a9f1d50..80506e4b12d03 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -218,6 +218,7 @@ def favk( """ + at unittest.skipIf(sys.flags.use_peg, "Pegen does not support type comments yet") class TypeCommentTests(unittest.TestCase): lowest = 4 # Lowest minor version supported diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py index e333af78f1d2c..2f53457b232a6 100644 --- a/Lib/test/test_unpack_ex.py +++ b/Lib/test/test_unpack_ex.py @@ -158,14 +158,15 @@ ... SyntaxError: iterable unpacking cannot be used in comprehension -Generator expression in function arguments - - >>> list(*x for x in (range(5) for i in range(3))) - Traceback (most recent call last): - ... - list(*x for x in (range(5) for i in range(3))) - ^ - SyntaxError: invalid syntax +# Pegen is better here. +# Generator expression in function arguments + +# >>> list(*x for x in (range(5) for i in range(3))) +# Traceback (most recent call last): +# ... +# list(*x for x in (range(5) for i in range(3))) +# ^ +# SyntaxError: invalid syntax >>> dict(**x for x in [{1:2}]) Traceback (most recent call last): diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index d4089a3fc1cdf..f5441ed54eebf 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -6,6 +6,7 @@ import random import tokenize import ast +import sys def read_pyfile(filename): @@ -327,6 +328,7 @@ def test_constant_tuples(self): ast.Constant(value=(1, 2, 3), kind=None), "(1, 2, 3)" ) + @unittest.skipIf(sys.flags.use_peg, "Pegen does not support type annotation yet") def test_function_type(self): for function_type in ( "() -> int", diff --git a/Makefile.pre.in b/Makefile.pre.in index 4511e607d89aa..b34fa64ff4bdf 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -244,7 +244,7 @@ LIBOBJS= @LIBOBJS@ PYTHON= python$(EXE) BUILDPYTHON= python$(BUILDEXE) -PYTHON_FOR_REGEN=@PYTHON_FOR_REGEN@ +PYTHON_FOR_REGEN?=@PYTHON_FOR_REGEN@ UPDATE_FILE=@PYTHON_FOR_REGEN@ $(srcdir)/Tools/scripts/update_file.py PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@ @@ -295,6 +295,19 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@ ########################################################################## # Parser + +PEGEN_OBJS= \ + Parser/pegen/pegen.o \ + Parser/pegen/parse.o \ + Parser/pegen/parse_string.o \ + Parser/pegen/peg_api.o + + +PEGEN_HEADERS= \ + $(srcdir)/Include/pegen_interface.h \ + $(srcdir)/Parser/pegen/pegen.h \ + $(srcdir)/Parser/pegen/parse_string.h + POBJS= \ Parser/acceler.o \ Parser/grammar1.o \ @@ -303,9 +316,10 @@ POBJS= \ Parser/parser.o \ Parser/token.o \ -PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o +PARSER_OBJS= $(POBJS) $(PEGEN_OBJS) Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o PARSER_HEADERS= \ + $(PEGEN_HEADERS) \ $(srcdir)/Include/grammar.h \ $(srcdir)/Include/parsetok.h \ $(srcdir)/Parser/parser.h \ @@ -731,7 +745,7 @@ regen-importlib: Programs/_freeze_importlib ############################################################################ # Regenerate all generated files -regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar \ +regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar regen-pegen \ regen-token regen-keyword regen-symbol regen-ast regen-importlib clinic ############################################################################ @@ -806,6 +820,12 @@ regen-grammar: regen-token $(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new $(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new +.PHONY: regen-pegen +regen-pegen: + PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -c -q $(srcdir)/Grammar/python.gram \ + -o $(srcdir)/Parser/pegen/parse.new.c + $(UPDATE_FILE) $(srcdir)/Parser/pegen/parse.c $(srcdir)/Parser/pegen/parse.new.c + .PHONY=regen-ast regen-ast: # Regenerate Include/Python-ast.h using Parser/asdl_c.py -h diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334.CTLGEp.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334.CTLGEp.rst new file mode 100644 index 0000000000000..b52d310508a8a --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334.CTLGEp.rst @@ -0,0 +1,5 @@ +Switch to a new parser, based on PEG. For more details see PEP 617. To +temporarily switch back to the old parser, use ``-X oldparser`` or +``PYTHONOLDPARSER=1``. In Python 3.10 we will remove the old parser +completely, including the ``parser`` module (already deprecated) and +anything that depends on it. diff --git a/Modules/Setup b/Modules/Setup index 6f0374a206315..6bf142419de3d 100644 --- a/Modules/Setup +++ b/Modules/Setup @@ -134,6 +134,9 @@ faulthandler faulthandler.c # can call _PyTraceMalloc_NewReference(). _tracemalloc _tracemalloc.c hashtable.c +# PEG-based parser module -- slated to be *the* parser +_peg_parser _peg_parser.c + # The rest of the modules listed in this file are all commented out by # default. Usually they can be detected and built as dynamically # loaded modules by the new setup.py script added in Python 2.1. If diff --git a/Modules/_peg_parser.c b/Modules/_peg_parser.c new file mode 100644 index 0000000000000..0a84edcfc0082 --- /dev/null +++ b/Modules/_peg_parser.c @@ -0,0 +1,107 @@ +#include +#include + +PyObject * +_Py_parse_file(PyObject *self, PyObject *args, PyObject *kwds) +{ + static char *keywords[] = {"file", "mode", NULL}; + char *filename; + char *mode_str = "exec"; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s", keywords, &filename, &mode_str)) { + return NULL; + } + + int mode; + if (strcmp(mode_str, "exec") == 0) { + mode = Py_file_input; + } + else if (strcmp(mode_str, "single") == 0) { + mode = Py_single_input; + } + else { + return PyErr_Format(PyExc_ValueError, "mode must be either 'exec' or 'single'"); + } + + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyObject *result = NULL; + + mod_ty res = PyPegen_ASTFromFile(filename, mode, arena); + if (res == NULL) { + goto error; + } + result = PyAST_mod2obj(res); + +error: + PyArena_Free(arena); + return result; +} + +PyObject * +_Py_parse_string(PyObject *self, PyObject *args, PyObject *kwds) +{ + static char *keywords[] = {"string", "mode", NULL}; + char *the_string; + char *mode_str = "exec"; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s", keywords, &the_string, &mode_str)) { + return NULL; + } + + int mode; + if (strcmp(mode_str, "exec") == 0) { + mode = Py_file_input; + } + else if (strcmp(mode_str, "eval") == 0) { + mode = Py_eval_input; + } + else if (strcmp(mode_str, "single") == 0) { + mode = Py_single_input; + } + else { + return PyErr_Format(PyExc_ValueError, "mode must be either 'exec' or 'eval' or 'single'"); + } + + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyObject *result = NULL; + + PyCompilerFlags flags = _PyCompilerFlags_INIT; + flags.cf_flags = PyCF_IGNORE_COOKIE; + + mod_ty res = PyPegen_ASTFromString(the_string, mode, &flags, arena); + if (res == NULL) { + goto error; + } + result = PyAST_mod2obj(res); + +error: + PyArena_Free(arena); + return result; +} + +static PyMethodDef ParseMethods[] = { + {"parse_file", (PyCFunction)(void (*)(void))_Py_parse_file, METH_VARARGS|METH_KEYWORDS, "Parse a file."}, + {"parse_string", (PyCFunction)(void (*)(void))_Py_parse_string, METH_VARARGS|METH_KEYWORDS,"Parse a string."}, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +static struct PyModuleDef parsemodule = { + PyModuleDef_HEAD_INIT, + .m_name = "peg_parser", + .m_doc = "A parser.", + .m_methods = ParseMethods, +}; + +PyMODINIT_FUNC +PyInit__peg_parser(void) +{ + return PyModule_Create(&parsemodule); +} diff --git a/PC/config.c b/PC/config.c index 8eaeb31c9b934..32af2a81aeb41 100644 --- a/PC/config.c +++ b/PC/config.c @@ -75,6 +75,8 @@ extern PyObject* PyInit__opcode(void); extern PyObject* PyInit__contextvars(void); +extern PyObject* PyInit__peg_parser(void); + /* tools/freeze/makeconfig.py marker for additional "extern" */ /* -- ADDMODULE MARKER 1 -- */ @@ -169,6 +171,7 @@ struct _inittab _PyImport_Inittab[] = { {"_opcode", PyInit__opcode}, {"_contextvars", PyInit__contextvars}, + {"_peg_parser", PyInit__peg_parser}, /* Sentinel */ {0, 0} diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 862c5a821b1f9..d795c4d5a7d00 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -213,6 +213,8 @@ + + @@ -276,6 +278,8 @@ + + @@ -338,6 +342,7 @@ + @@ -419,6 +424,10 @@ + + + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 9d6d997b5267e..8c02622fd552d 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -902,6 +902,18 @@ Parser + + Parser + + + Parser + + + Parser + + + Parser + Parser diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 876b12bae9cdf..9fe8d6d0c3e11 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -166,6 +166,14 @@ + + + + + + + + @@ -222,4 +230,4 @@ -
    \ No newline at end of file +
    diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c new file mode 100644 index 0000000000000..25607eaf73cdc --- /dev/null +++ b/Parser/pegen/parse.c @@ -0,0 +1,15391 @@ +// @generated by pegen.py from ./Grammar/python.gram +#include "pegen.h" +static const int n_keyword_lists = 15; +static KeywordToken *reserved_keywords[] = { + NULL, + NULL, + (KeywordToken[]) { + {"if", 510}, + {"in", 518}, + {"is", 526}, + {"as", 531}, + {"or", 532}, + {NULL, -1}, + }, + (KeywordToken[]) { + {"del", 503}, + {"try", 511}, + {"for", 517}, + {"def", 522}, + {"not", 525}, + {"and", 533}, + {NULL, -1}, + }, + (KeywordToken[]) { + {"pass", 502}, + {"from", 514}, + {"elif", 515}, + {"else", 516}, + {"with", 519}, + {"True", 527}, + {"None", 529}, + {NULL, -1}, + }, + (KeywordToken[]) { + {"raise", 501}, + {"yield", 504}, + {"break", 506}, + {"while", 512}, + {"class", 523}, + {"False", 528}, + {NULL, -1}, + }, + (KeywordToken[]) { + {"return", 500}, + {"assert", 505}, + {"global", 508}, + {"import", 513}, + {"except", 520}, + {"lambda", 524}, + {NULL, -1}, + }, + (KeywordToken[]) { + {"finally", 521}, + {NULL, -1}, + }, + (KeywordToken[]) { + {"continue", 507}, + {"nonlocal", 509}, + {NULL, -1}, + }, + NULL, + NULL, + NULL, + NULL, + NULL, + (KeywordToken[]) { + {"__new_parser__", 530}, + {NULL, -1}, + }, +}; +#define file_type 1000 +#define interactive_type 1001 +#define eval_type 1002 +#define fstring_type 1003 +#define statements_type 1004 +#define statement_type 1005 +#define statement_newline_type 1006 +#define simple_stmt_type 1007 +#define small_stmt_type 1008 +#define compound_stmt_type 1009 +#define assignment_type 1010 +#define augassign_type 1011 +#define global_stmt_type 1012 +#define nonlocal_stmt_type 1013 +#define yield_stmt_type 1014 +#define assert_stmt_type 1015 +#define del_stmt_type 1016 +#define import_stmt_type 1017 +#define import_name_type 1018 +#define import_from_type 1019 +#define import_from_targets_type 1020 +#define import_from_as_names_type 1021 +#define import_from_as_name_type 1022 +#define dotted_as_names_type 1023 +#define dotted_as_name_type 1024 +#define dotted_name_type 1025 // Left-recursive +#define if_stmt_type 1026 +#define elif_stmt_type 1027 +#define else_block_type 1028 +#define while_stmt_type 1029 +#define for_stmt_type 1030 +#define with_stmt_type 1031 +#define with_item_type 1032 +#define try_stmt_type 1033 +#define except_block_type 1034 +#define finally_block_type 1035 +#define return_stmt_type 1036 +#define raise_stmt_type 1037 +#define function_def_type 1038 +#define function_def_raw_type 1039 +#define params_type 1040 +#define parameters_type 1041 +#define slash_without_default_type 1042 +#define slash_with_default_type 1043 +#define star_etc_type 1044 +#define name_with_optional_default_type 1045 +#define names_with_default_type 1046 +#define name_with_default_type 1047 +#define plain_names_type 1048 +#define plain_name_type 1049 +#define kwds_type 1050 +#define annotation_type 1051 +#define decorators_type 1052 +#define class_def_type 1053 +#define class_def_raw_type 1054 +#define block_type 1055 +#define expressions_list_type 1056 +#define star_expressions_type 1057 +#define star_expression_type 1058 +#define star_named_expressions_type 1059 +#define star_named_expression_type 1060 +#define named_expression_type 1061 +#define annotated_rhs_type 1062 +#define expressions_type 1063 +#define expression_type 1064 +#define lambdef_type 1065 +#define lambda_parameters_type 1066 +#define lambda_slash_without_default_type 1067 +#define lambda_slash_with_default_type 1068 +#define lambda_star_etc_type 1069 +#define lambda_name_with_optional_default_type 1070 +#define lambda_names_with_default_type 1071 +#define lambda_name_with_default_type 1072 +#define lambda_plain_names_type 1073 +#define lambda_plain_name_type 1074 +#define lambda_kwds_type 1075 +#define disjunction_type 1076 +#define conjunction_type 1077 +#define inversion_type 1078 +#define comparison_type 1079 +#define compare_op_bitwise_or_pair_type 1080 +#define eq_bitwise_or_type 1081 +#define noteq_bitwise_or_type 1082 +#define lte_bitwise_or_type 1083 +#define lt_bitwise_or_type 1084 +#define gte_bitwise_or_type 1085 +#define gt_bitwise_or_type 1086 +#define notin_bitwise_or_type 1087 +#define in_bitwise_or_type 1088 +#define isnot_bitwise_or_type 1089 +#define is_bitwise_or_type 1090 +#define bitwise_or_type 1091 // Left-recursive +#define bitwise_xor_type 1092 // Left-recursive +#define bitwise_and_type 1093 // Left-recursive +#define shift_expr_type 1094 // Left-recursive +#define sum_type 1095 // Left-recursive +#define term_type 1096 // Left-recursive +#define factor_type 1097 +#define power_type 1098 +#define await_primary_type 1099 +#define primary_type 1100 // Left-recursive +#define slices_type 1101 +#define slice_type 1102 +#define atom_type 1103 +#define strings_type 1104 +#define list_type 1105 +#define listcomp_type 1106 +#define tuple_type 1107 +#define group_type 1108 +#define genexp_type 1109 +#define set_type 1110 +#define setcomp_type 1111 +#define dict_type 1112 +#define dictcomp_type 1113 +#define kvpairs_type 1114 +#define kvpair_type 1115 +#define for_if_clauses_type 1116 +#define yield_expr_type 1117 +#define arguments_type 1118 +#define args_type 1119 +#define kwargs_type 1120 +#define starred_expression_type 1121 +#define kwarg_or_starred_type 1122 +#define kwarg_or_double_starred_type 1123 +#define star_targets_type 1124 +#define star_targets_seq_type 1125 +#define star_target_type 1126 +#define star_atom_type 1127 +#define inside_paren_ann_assign_target_type 1128 +#define ann_assign_subscript_attribute_target_type 1129 +#define del_targets_type 1130 +#define del_target_type 1131 +#define del_t_atom_type 1132 +#define targets_type 1133 +#define target_type 1134 +#define t_primary_type 1135 // Left-recursive +#define t_lookahead_type 1136 +#define t_atom_type 1137 +#define incorrect_arguments_type 1138 +#define invalid_named_expression_type 1139 +#define invalid_assignment_type 1140 +#define invalid_block_type 1141 +#define invalid_comprehension_type 1142 +#define invalid_parameters_type 1143 +#define _loop0_1_type 1144 +#define _loop1_2_type 1145 +#define _loop0_4_type 1146 +#define _gather_3_type 1147 +#define _tmp_5_type 1148 +#define _tmp_6_type 1149 +#define _tmp_7_type 1150 +#define _tmp_8_type 1151 +#define _tmp_9_type 1152 +#define _tmp_10_type 1153 +#define _tmp_11_type 1154 +#define _tmp_12_type 1155 +#define _loop1_13_type 1156 +#define _tmp_14_type 1157 +#define _tmp_15_type 1158 +#define _loop0_17_type 1159 +#define _gather_16_type 1160 +#define _loop0_19_type 1161 +#define _gather_18_type 1162 +#define _tmp_20_type 1163 +#define _loop0_21_type 1164 +#define _loop1_22_type 1165 +#define _loop0_24_type 1166 +#define _gather_23_type 1167 +#define _tmp_25_type 1168 +#define _loop0_27_type 1169 +#define _gather_26_type 1170 +#define _tmp_28_type 1171 +#define _loop0_30_type 1172 +#define _gather_29_type 1173 +#define _loop0_32_type 1174 +#define _gather_31_type 1175 +#define _tmp_33_type 1176 +#define _loop1_34_type 1177 +#define _tmp_35_type 1178 +#define _tmp_36_type 1179 +#define _tmp_37_type 1180 +#define _tmp_38_type 1181 +#define _tmp_39_type 1182 +#define _tmp_40_type 1183 +#define _tmp_41_type 1184 +#define _tmp_42_type 1185 +#define _tmp_43_type 1186 +#define _tmp_44_type 1187 +#define _tmp_45_type 1188 +#define _tmp_46_type 1189 +#define _loop0_47_type 1190 +#define _tmp_48_type 1191 +#define _loop1_49_type 1192 +#define _tmp_50_type 1193 +#define _tmp_51_type 1194 +#define _loop0_53_type 1195 +#define _gather_52_type 1196 +#define _loop0_55_type 1197 +#define _gather_54_type 1198 +#define _tmp_56_type 1199 +#define _loop1_57_type 1200 +#define _tmp_58_type 1201 +#define _loop0_60_type 1202 +#define _gather_59_type 1203 +#define _loop1_61_type 1204 +#define _loop0_63_type 1205 +#define _gather_62_type 1206 +#define _loop1_64_type 1207 +#define _tmp_65_type 1208 +#define _tmp_66_type 1209 +#define _tmp_67_type 1210 +#define _tmp_68_type 1211 +#define _tmp_69_type 1212 +#define _tmp_70_type 1213 +#define _tmp_71_type 1214 +#define _tmp_72_type 1215 +#define _tmp_73_type 1216 +#define _loop0_74_type 1217 +#define _tmp_75_type 1218 +#define _loop1_76_type 1219 +#define _tmp_77_type 1220 +#define _tmp_78_type 1221 +#define _loop0_80_type 1222 +#define _gather_79_type 1223 +#define _loop0_82_type 1224 +#define _gather_81_type 1225 +#define _loop1_83_type 1226 +#define _loop1_84_type 1227 +#define _loop1_85_type 1228 +#define _loop0_87_type 1229 +#define _gather_86_type 1230 +#define _tmp_88_type 1231 +#define _tmp_89_type 1232 +#define _tmp_90_type 1233 +#define _tmp_91_type 1234 +#define _loop1_92_type 1235 +#define _tmp_93_type 1236 +#define _tmp_94_type 1237 +#define _loop0_96_type 1238 +#define _gather_95_type 1239 +#define _loop1_97_type 1240 +#define _tmp_98_type 1241 +#define _tmp_99_type 1242 +#define _loop0_101_type 1243 +#define _gather_100_type 1244 +#define _loop0_103_type 1245 +#define _gather_102_type 1246 +#define _loop0_105_type 1247 +#define _gather_104_type 1248 +#define _loop0_107_type 1249 +#define _gather_106_type 1250 +#define _loop0_108_type 1251 +#define _loop0_110_type 1252 +#define _gather_109_type 1253 +#define _tmp_111_type 1254 +#define _loop0_113_type 1255 +#define _gather_112_type 1256 +#define _loop0_115_type 1257 +#define _gather_114_type 1258 +#define _tmp_116_type 1259 +#define _tmp_117_type 1260 +#define _tmp_118_type 1261 +#define _tmp_119_type 1262 +#define _tmp_120_type 1263 +#define _tmp_121_type 1264 +#define _tmp_122_type 1265 +#define _tmp_123_type 1266 +#define _tmp_124_type 1267 +#define _tmp_125_type 1268 +#define _tmp_126_type 1269 +#define _tmp_127_type 1270 +#define _tmp_128_type 1271 +#define _tmp_129_type 1272 +#define _tmp_130_type 1273 +#define _tmp_131_type 1274 +#define _tmp_132_type 1275 +#define _tmp_133_type 1276 +#define _tmp_134_type 1277 +#define _loop0_135_type 1278 +#define _tmp_136_type 1279 + +static mod_ty file_rule(Parser *p); +static mod_ty interactive_rule(Parser *p); +static mod_ty eval_rule(Parser *p); +static expr_ty fstring_rule(Parser *p); +static asdl_seq* statements_rule(Parser *p); +static asdl_seq* statement_rule(Parser *p); +static asdl_seq* statement_newline_rule(Parser *p); +static asdl_seq* simple_stmt_rule(Parser *p); +static stmt_ty small_stmt_rule(Parser *p); +static stmt_ty compound_stmt_rule(Parser *p); +static void *assignment_rule(Parser *p); +static AugOperator* augassign_rule(Parser *p); +static stmt_ty global_stmt_rule(Parser *p); +static stmt_ty nonlocal_stmt_rule(Parser *p); +static stmt_ty yield_stmt_rule(Parser *p); +static stmt_ty assert_stmt_rule(Parser *p); +static stmt_ty del_stmt_rule(Parser *p); +static stmt_ty import_stmt_rule(Parser *p); +static stmt_ty import_name_rule(Parser *p); +static stmt_ty import_from_rule(Parser *p); +static asdl_seq* import_from_targets_rule(Parser *p); +static asdl_seq* import_from_as_names_rule(Parser *p); +static alias_ty import_from_as_name_rule(Parser *p); +static asdl_seq* dotted_as_names_rule(Parser *p); +static alias_ty dotted_as_name_rule(Parser *p); +static expr_ty dotted_name_rule(Parser *p); +static stmt_ty if_stmt_rule(Parser *p); +static stmt_ty elif_stmt_rule(Parser *p); +static asdl_seq* else_block_rule(Parser *p); +static stmt_ty while_stmt_rule(Parser *p); +static stmt_ty for_stmt_rule(Parser *p); +static stmt_ty with_stmt_rule(Parser *p); +static withitem_ty with_item_rule(Parser *p); +static stmt_ty try_stmt_rule(Parser *p); +static excepthandler_ty except_block_rule(Parser *p); +static asdl_seq* finally_block_rule(Parser *p); +static stmt_ty return_stmt_rule(Parser *p); +static stmt_ty raise_stmt_rule(Parser *p); +static stmt_ty function_def_rule(Parser *p); +static stmt_ty function_def_raw_rule(Parser *p); +static arguments_ty params_rule(Parser *p); +static arguments_ty parameters_rule(Parser *p); +static asdl_seq* slash_without_default_rule(Parser *p); +static SlashWithDefault* slash_with_default_rule(Parser *p); +static StarEtc* star_etc_rule(Parser *p); +static NameDefaultPair* name_with_optional_default_rule(Parser *p); +static asdl_seq* names_with_default_rule(Parser *p); +static NameDefaultPair* name_with_default_rule(Parser *p); +static asdl_seq* plain_names_rule(Parser *p); +static arg_ty plain_name_rule(Parser *p); +static arg_ty kwds_rule(Parser *p); +static expr_ty annotation_rule(Parser *p); +static asdl_seq* decorators_rule(Parser *p); +static stmt_ty class_def_rule(Parser *p); +static stmt_ty class_def_raw_rule(Parser *p); +static asdl_seq* block_rule(Parser *p); +static asdl_seq* expressions_list_rule(Parser *p); +static expr_ty star_expressions_rule(Parser *p); +static expr_ty star_expression_rule(Parser *p); +static asdl_seq* star_named_expressions_rule(Parser *p); +static expr_ty star_named_expression_rule(Parser *p); +static expr_ty named_expression_rule(Parser *p); +static expr_ty annotated_rhs_rule(Parser *p); +static expr_ty expressions_rule(Parser *p); +static expr_ty expression_rule(Parser *p); +static expr_ty lambdef_rule(Parser *p); +static arguments_ty lambda_parameters_rule(Parser *p); +static asdl_seq* lambda_slash_without_default_rule(Parser *p); +static SlashWithDefault* lambda_slash_with_default_rule(Parser *p); +static StarEtc* lambda_star_etc_rule(Parser *p); +static NameDefaultPair* lambda_name_with_optional_default_rule(Parser *p); +static asdl_seq* lambda_names_with_default_rule(Parser *p); +static NameDefaultPair* lambda_name_with_default_rule(Parser *p); +static asdl_seq* lambda_plain_names_rule(Parser *p); +static arg_ty lambda_plain_name_rule(Parser *p); +static arg_ty lambda_kwds_rule(Parser *p); +static expr_ty disjunction_rule(Parser *p); +static expr_ty conjunction_rule(Parser *p); +static expr_ty inversion_rule(Parser *p); +static expr_ty comparison_rule(Parser *p); +static CmpopExprPair* compare_op_bitwise_or_pair_rule(Parser *p); +static CmpopExprPair* eq_bitwise_or_rule(Parser *p); +static CmpopExprPair* noteq_bitwise_or_rule(Parser *p); +static CmpopExprPair* lte_bitwise_or_rule(Parser *p); +static CmpopExprPair* lt_bitwise_or_rule(Parser *p); +static CmpopExprPair* gte_bitwise_or_rule(Parser *p); +static CmpopExprPair* gt_bitwise_or_rule(Parser *p); +static CmpopExprPair* notin_bitwise_or_rule(Parser *p); +static CmpopExprPair* in_bitwise_or_rule(Parser *p); +static CmpopExprPair* isnot_bitwise_or_rule(Parser *p); +static CmpopExprPair* is_bitwise_or_rule(Parser *p); +static expr_ty bitwise_or_rule(Parser *p); +static expr_ty bitwise_xor_rule(Parser *p); +static expr_ty bitwise_and_rule(Parser *p); +static expr_ty shift_expr_rule(Parser *p); +static expr_ty sum_rule(Parser *p); +static expr_ty term_rule(Parser *p); +static expr_ty factor_rule(Parser *p); +static expr_ty power_rule(Parser *p); +static expr_ty await_primary_rule(Parser *p); +static expr_ty primary_rule(Parser *p); +static expr_ty slices_rule(Parser *p); +static expr_ty slice_rule(Parser *p); +static expr_ty atom_rule(Parser *p); +static expr_ty strings_rule(Parser *p); +static expr_ty list_rule(Parser *p); +static expr_ty listcomp_rule(Parser *p); +static expr_ty tuple_rule(Parser *p); +static expr_ty group_rule(Parser *p); +static expr_ty genexp_rule(Parser *p); +static expr_ty set_rule(Parser *p); +static expr_ty setcomp_rule(Parser *p); +static expr_ty dict_rule(Parser *p); +static expr_ty dictcomp_rule(Parser *p); +static asdl_seq* kvpairs_rule(Parser *p); +static KeyValuePair* kvpair_rule(Parser *p); +static asdl_seq* for_if_clauses_rule(Parser *p); +static expr_ty yield_expr_rule(Parser *p); +static expr_ty arguments_rule(Parser *p); +static expr_ty args_rule(Parser *p); +static asdl_seq* kwargs_rule(Parser *p); +static expr_ty starred_expression_rule(Parser *p); +static KeywordOrStarred* kwarg_or_starred_rule(Parser *p); +static KeywordOrStarred* kwarg_or_double_starred_rule(Parser *p); +static expr_ty star_targets_rule(Parser *p); +static asdl_seq* star_targets_seq_rule(Parser *p); +static expr_ty star_target_rule(Parser *p); +static expr_ty star_atom_rule(Parser *p); +static expr_ty inside_paren_ann_assign_target_rule(Parser *p); +static expr_ty ann_assign_subscript_attribute_target_rule(Parser *p); +static asdl_seq* del_targets_rule(Parser *p); +static expr_ty del_target_rule(Parser *p); +static expr_ty del_t_atom_rule(Parser *p); +static asdl_seq* targets_rule(Parser *p); +static expr_ty target_rule(Parser *p); +static expr_ty t_primary_rule(Parser *p); +static void *t_lookahead_rule(Parser *p); +static expr_ty t_atom_rule(Parser *p); +static void *incorrect_arguments_rule(Parser *p); +static void *invalid_named_expression_rule(Parser *p); +static void *invalid_assignment_rule(Parser *p); +static void *invalid_block_rule(Parser *p); +static void *invalid_comprehension_rule(Parser *p); +static void *invalid_parameters_rule(Parser *p); +static asdl_seq *_loop0_1_rule(Parser *p); +static asdl_seq *_loop1_2_rule(Parser *p); +static asdl_seq *_loop0_4_rule(Parser *p); +static asdl_seq *_gather_3_rule(Parser *p); +static void *_tmp_5_rule(Parser *p); +static void *_tmp_6_rule(Parser *p); +static void *_tmp_7_rule(Parser *p); +static void *_tmp_8_rule(Parser *p); +static void *_tmp_9_rule(Parser *p); +static void *_tmp_10_rule(Parser *p); +static void *_tmp_11_rule(Parser *p); +static void *_tmp_12_rule(Parser *p); +static asdl_seq *_loop1_13_rule(Parser *p); +static void *_tmp_14_rule(Parser *p); +static void *_tmp_15_rule(Parser *p); +static asdl_seq *_loop0_17_rule(Parser *p); +static asdl_seq *_gather_16_rule(Parser *p); +static asdl_seq *_loop0_19_rule(Parser *p); +static asdl_seq *_gather_18_rule(Parser *p); +static void *_tmp_20_rule(Parser *p); +static asdl_seq *_loop0_21_rule(Parser *p); +static asdl_seq *_loop1_22_rule(Parser *p); +static asdl_seq *_loop0_24_rule(Parser *p); +static asdl_seq *_gather_23_rule(Parser *p); +static void *_tmp_25_rule(Parser *p); +static asdl_seq *_loop0_27_rule(Parser *p); +static asdl_seq *_gather_26_rule(Parser *p); +static void *_tmp_28_rule(Parser *p); +static asdl_seq *_loop0_30_rule(Parser *p); +static asdl_seq *_gather_29_rule(Parser *p); +static asdl_seq *_loop0_32_rule(Parser *p); +static asdl_seq *_gather_31_rule(Parser *p); +static void *_tmp_33_rule(Parser *p); +static asdl_seq *_loop1_34_rule(Parser *p); +static void *_tmp_35_rule(Parser *p); +static void *_tmp_36_rule(Parser *p); +static void *_tmp_37_rule(Parser *p); +static void *_tmp_38_rule(Parser *p); +static void *_tmp_39_rule(Parser *p); +static void *_tmp_40_rule(Parser *p); +static void *_tmp_41_rule(Parser *p); +static void *_tmp_42_rule(Parser *p); +static void *_tmp_43_rule(Parser *p); +static void *_tmp_44_rule(Parser *p); +static void *_tmp_45_rule(Parser *p); +static void *_tmp_46_rule(Parser *p); +static asdl_seq *_loop0_47_rule(Parser *p); +static void *_tmp_48_rule(Parser *p); +static asdl_seq *_loop1_49_rule(Parser *p); +static void *_tmp_50_rule(Parser *p); +static void *_tmp_51_rule(Parser *p); +static asdl_seq *_loop0_53_rule(Parser *p); +static asdl_seq *_gather_52_rule(Parser *p); +static asdl_seq *_loop0_55_rule(Parser *p); +static asdl_seq *_gather_54_rule(Parser *p); +static void *_tmp_56_rule(Parser *p); +static asdl_seq *_loop1_57_rule(Parser *p); +static void *_tmp_58_rule(Parser *p); +static asdl_seq *_loop0_60_rule(Parser *p); +static asdl_seq *_gather_59_rule(Parser *p); +static asdl_seq *_loop1_61_rule(Parser *p); +static asdl_seq *_loop0_63_rule(Parser *p); +static asdl_seq *_gather_62_rule(Parser *p); +static asdl_seq *_loop1_64_rule(Parser *p); +static void *_tmp_65_rule(Parser *p); +static void *_tmp_66_rule(Parser *p); +static void *_tmp_67_rule(Parser *p); +static void *_tmp_68_rule(Parser *p); +static void *_tmp_69_rule(Parser *p); +static void *_tmp_70_rule(Parser *p); +static void *_tmp_71_rule(Parser *p); +static void *_tmp_72_rule(Parser *p); +static void *_tmp_73_rule(Parser *p); +static asdl_seq *_loop0_74_rule(Parser *p); +static void *_tmp_75_rule(Parser *p); +static asdl_seq *_loop1_76_rule(Parser *p); +static void *_tmp_77_rule(Parser *p); +static void *_tmp_78_rule(Parser *p); +static asdl_seq *_loop0_80_rule(Parser *p); +static asdl_seq *_gather_79_rule(Parser *p); +static asdl_seq *_loop0_82_rule(Parser *p); +static asdl_seq *_gather_81_rule(Parser *p); +static asdl_seq *_loop1_83_rule(Parser *p); +static asdl_seq *_loop1_84_rule(Parser *p); +static asdl_seq *_loop1_85_rule(Parser *p); +static asdl_seq *_loop0_87_rule(Parser *p); +static asdl_seq *_gather_86_rule(Parser *p); +static void *_tmp_88_rule(Parser *p); +static void *_tmp_89_rule(Parser *p); +static void *_tmp_90_rule(Parser *p); +static void *_tmp_91_rule(Parser *p); +static asdl_seq *_loop1_92_rule(Parser *p); +static void *_tmp_93_rule(Parser *p); +static void *_tmp_94_rule(Parser *p); +static asdl_seq *_loop0_96_rule(Parser *p); +static asdl_seq *_gather_95_rule(Parser *p); +static asdl_seq *_loop1_97_rule(Parser *p); +static void *_tmp_98_rule(Parser *p); +static void *_tmp_99_rule(Parser *p); +static asdl_seq *_loop0_101_rule(Parser *p); +static asdl_seq *_gather_100_rule(Parser *p); +static asdl_seq *_loop0_103_rule(Parser *p); +static asdl_seq *_gather_102_rule(Parser *p); +static asdl_seq *_loop0_105_rule(Parser *p); +static asdl_seq *_gather_104_rule(Parser *p); +static asdl_seq *_loop0_107_rule(Parser *p); +static asdl_seq *_gather_106_rule(Parser *p); +static asdl_seq *_loop0_108_rule(Parser *p); +static asdl_seq *_loop0_110_rule(Parser *p); +static asdl_seq *_gather_109_rule(Parser *p); +static void *_tmp_111_rule(Parser *p); +static asdl_seq *_loop0_113_rule(Parser *p); +static asdl_seq *_gather_112_rule(Parser *p); +static asdl_seq *_loop0_115_rule(Parser *p); +static asdl_seq *_gather_114_rule(Parser *p); +static void *_tmp_116_rule(Parser *p); +static void *_tmp_117_rule(Parser *p); +static void *_tmp_118_rule(Parser *p); +static void *_tmp_119_rule(Parser *p); +static void *_tmp_120_rule(Parser *p); +static void *_tmp_121_rule(Parser *p); +static void *_tmp_122_rule(Parser *p); +static void *_tmp_123_rule(Parser *p); +static void *_tmp_124_rule(Parser *p); +static void *_tmp_125_rule(Parser *p); +static void *_tmp_126_rule(Parser *p); +static void *_tmp_127_rule(Parser *p); +static void *_tmp_128_rule(Parser *p); +static void *_tmp_129_rule(Parser *p); +static void *_tmp_130_rule(Parser *p); +static void *_tmp_131_rule(Parser *p); +static void *_tmp_132_rule(Parser *p); +static void *_tmp_133_rule(Parser *p); +static void *_tmp_134_rule(Parser *p); +static asdl_seq *_loop0_135_rule(Parser *p); +static void *_tmp_136_rule(Parser *p); + + +// file: statements? $ +static mod_ty +file_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + mod_ty res = NULL; + int mark = p->mark; + { // statements? $ + void *a; + void *endmarker_var; + if ( + (a = statements_rule(p), 1) + && + (endmarker_var = _PyPegen_endmarker_token(p)) + ) + { + res = Module ( a , NULL , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// interactive: statement_newline +static mod_ty +interactive_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + mod_ty res = NULL; + int mark = p->mark; + { // statement_newline + asdl_seq* a; + if ( + (a = statement_newline_rule(p)) + ) + { + res = Interactive ( a , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// eval: expressions NEWLINE* $ +static mod_ty +eval_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + mod_ty res = NULL; + int mark = p->mark; + { // expressions NEWLINE* $ + asdl_seq * _loop0_1_var; + expr_ty a; + void *endmarker_var; + if ( + (a = expressions_rule(p)) + && + (_loop0_1_var = _loop0_1_rule(p)) + && + (endmarker_var = _PyPegen_endmarker_token(p)) + ) + { + res = Expression ( a , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// fstring: star_expressions +static expr_ty +fstring_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// statements: statement+ +static asdl_seq* +statements_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // statement+ + asdl_seq * a; + if ( + (a = _loop1_2_rule(p)) + ) + { + res = _PyPegen_seq_flatten ( p , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// statement: compound_stmt | simple_stmt +static asdl_seq* +statement_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // compound_stmt + stmt_ty a; + if ( + (a = compound_stmt_rule(p)) + ) + { + res = _PyPegen_singleton_seq ( p , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // simple_stmt + asdl_seq* simple_stmt_var; + if ( + (simple_stmt_var = simple_stmt_rule(p)) + ) + { + res = simple_stmt_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// statement_newline: compound_stmt NEWLINE | simple_stmt | NEWLINE | $ +static asdl_seq* +statement_newline_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // compound_stmt NEWLINE + stmt_ty a; + void *newline_var; + if ( + (a = compound_stmt_rule(p)) + && + (newline_var = _PyPegen_newline_token(p)) + ) + { + res = _PyPegen_singleton_seq ( p , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // simple_stmt + asdl_seq* simple_stmt_var; + if ( + (simple_stmt_var = simple_stmt_rule(p)) + ) + { + res = simple_stmt_var; + goto done; + } + p->mark = mark; + } + { // NEWLINE + void *newline_var; + if ( + (newline_var = _PyPegen_newline_token(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _PyPegen_singleton_seq ( p , CHECK ( _Py_Pass ( EXTRA ) ) ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // $ + void *endmarker_var; + if ( + (endmarker_var = _PyPegen_endmarker_token(p)) + ) + { + res = _PyPegen_interactive_exit ( p ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// simple_stmt: small_stmt !';' NEWLINE | ';'.small_stmt+ ';'? NEWLINE +static asdl_seq* +simple_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // small_stmt !';' NEWLINE + stmt_ty a; + void *newline_var; + if ( + (a = small_stmt_rule(p)) + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 13) + && + (newline_var = _PyPegen_newline_token(p)) + ) + { + res = _PyPegen_singleton_seq ( p , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ';'.small_stmt+ ';'? NEWLINE + asdl_seq * a; + void *newline_var; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_3_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 13), 1) + && + (newline_var = _PyPegen_newline_token(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// small_stmt: +// | assignment +// | star_expressions +// | &'return' return_stmt +// | &('import' | 'from') import_stmt +// | &'raise' raise_stmt +// | 'pass' +// | &'del' del_stmt +// | &'yield' yield_stmt +// | &'assert' assert_stmt +// | 'break' +// | 'continue' +// | &'global' global_stmt +// | &'nonlocal' nonlocal_stmt +static stmt_ty +small_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + if (_PyPegen_is_memoized(p, small_stmt_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // assignment + void *assignment_var; + if ( + (assignment_var = assignment_rule(p)) + ) + { + res = assignment_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty e; + if ( + (e = star_expressions_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Expr ( e , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // &'return' return_stmt + stmt_ty return_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 500) + && + (return_stmt_var = return_stmt_rule(p)) + ) + { + res = return_stmt_var; + goto done; + } + p->mark = mark; + } + { // &('import' | 'from') import_stmt + stmt_ty import_stmt_var; + if ( + _PyPegen_lookahead(1, _tmp_5_rule, p) + && + (import_stmt_var = import_stmt_rule(p)) + ) + { + res = import_stmt_var; + goto done; + } + p->mark = mark; + } + { // &'raise' raise_stmt + stmt_ty raise_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 501) + && + (raise_stmt_var = raise_stmt_rule(p)) + ) + { + res = raise_stmt_var; + goto done; + } + p->mark = mark; + } + { // 'pass' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 502)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Pass ( EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // &'del' del_stmt + stmt_ty del_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 503) + && + (del_stmt_var = del_stmt_rule(p)) + ) + { + res = del_stmt_var; + goto done; + } + p->mark = mark; + } + { // &'yield' yield_stmt + stmt_ty yield_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 504) + && + (yield_stmt_var = yield_stmt_rule(p)) + ) + { + res = yield_stmt_var; + goto done; + } + p->mark = mark; + } + { // &'assert' assert_stmt + stmt_ty assert_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 505) + && + (assert_stmt_var = assert_stmt_rule(p)) + ) + { + res = assert_stmt_var; + goto done; + } + p->mark = mark; + } + { // 'break' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 506)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Break ( EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'continue' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 507)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Continue ( EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // &'global' global_stmt + stmt_ty global_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 508) + && + (global_stmt_var = global_stmt_rule(p)) + ) + { + res = global_stmt_var; + goto done; + } + p->mark = mark; + } + { // &'nonlocal' nonlocal_stmt + stmt_ty nonlocal_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 509) + && + (nonlocal_stmt_var = nonlocal_stmt_rule(p)) + ) + { + res = nonlocal_stmt_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, small_stmt_type, res); + return res; +} + +// compound_stmt: +// | &('def' | '@' | ASYNC) function_def +// | &'if' if_stmt +// | &('class' | '@') class_def +// | &('with' | ASYNC) with_stmt +// | &('for' | ASYNC) for_stmt +// | &'try' try_stmt +// | &'while' while_stmt +static stmt_ty +compound_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + { // &('def' | '@' | ASYNC) function_def + stmt_ty function_def_var; + if ( + _PyPegen_lookahead(1, _tmp_6_rule, p) + && + (function_def_var = function_def_rule(p)) + ) + { + res = function_def_var; + goto done; + } + p->mark = mark; + } + { // &'if' if_stmt + stmt_ty if_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 510) + && + (if_stmt_var = if_stmt_rule(p)) + ) + { + res = if_stmt_var; + goto done; + } + p->mark = mark; + } + { // &('class' | '@') class_def + stmt_ty class_def_var; + if ( + _PyPegen_lookahead(1, _tmp_7_rule, p) + && + (class_def_var = class_def_rule(p)) + ) + { + res = class_def_var; + goto done; + } + p->mark = mark; + } + { // &('with' | ASYNC) with_stmt + stmt_ty with_stmt_var; + if ( + _PyPegen_lookahead(1, _tmp_8_rule, p) + && + (with_stmt_var = with_stmt_rule(p)) + ) + { + res = with_stmt_var; + goto done; + } + p->mark = mark; + } + { // &('for' | ASYNC) for_stmt + stmt_ty for_stmt_var; + if ( + _PyPegen_lookahead(1, _tmp_9_rule, p) + && + (for_stmt_var = for_stmt_rule(p)) + ) + { + res = for_stmt_var; + goto done; + } + p->mark = mark; + } + { // &'try' try_stmt + stmt_ty try_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 511) + && + (try_stmt_var = try_stmt_rule(p)) + ) + { + res = try_stmt_var; + goto done; + } + p->mark = mark; + } + { // &'while' while_stmt + stmt_ty while_stmt_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 512) + && + (while_stmt_var = while_stmt_rule(p)) + ) + { + res = while_stmt_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// assignment: +// | NAME ':' expression ['=' annotated_rhs] +// | ('(' inside_paren_ann_assign_target ')' | ann_assign_subscript_attribute_target) ':' expression ['=' annotated_rhs] +// | ((star_targets '='))+ (yield_expr | star_expressions) +// | target augassign (yield_expr | star_expressions) +// | invalid_assignment +static void * +assignment_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME ':' expression ['=' annotated_rhs] + expr_ty a; + expr_ty b; + void *c; + void *literal; + if ( + (a = _PyPegen_name_token(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = expression_rule(p)) + && + (c = _tmp_10_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_AnnAssign ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ('(' inside_paren_ann_assign_target ')' | ann_assign_subscript_attribute_target) ':' expression ['=' annotated_rhs] + void *a; + expr_ty b; + void *c; + void *literal; + if ( + (a = _tmp_11_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = expression_rule(p)) + && + (c = _tmp_12_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_AnnAssign ( a , b , c , 0 , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ((star_targets '='))+ (yield_expr | star_expressions) + asdl_seq * a; + void *b; + if ( + (a = _loop1_13_rule(p)) + && + (b = _tmp_14_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Assign ( a , b , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // target augassign (yield_expr | star_expressions) + expr_ty a; + AugOperator* b; + void *c; + if ( + (a = target_rule(p)) + && + (b = augassign_rule(p)) + && + (c = _tmp_15_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_AugAssign ( a , b -> kind , c , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // invalid_assignment + void *invalid_assignment_var; + if ( + (invalid_assignment_var = invalid_assignment_rule(p)) + ) + { + res = invalid_assignment_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// augassign: +// | '+=' +// | '-=' +// | '*=' +// | '@=' +// | '/=' +// | '%=' +// | '&=' +// | '|=' +// | '^=' +// | '<<=' +// | '>>=' +// | '**=' +// | '//=' +static AugOperator* +augassign_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + AugOperator* res = NULL; + int mark = p->mark; + { // '+=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 36)) + ) + { + res = _PyPegen_augoperator ( p , Add ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '-=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 37)) + ) + { + res = _PyPegen_augoperator ( p , Sub ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '*=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 38)) + ) + { + res = _PyPegen_augoperator ( p , Mult ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '@=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 50)) + ) + { + res = _PyPegen_augoperator ( p , MatMult ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '/=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 39)) + ) + { + res = _PyPegen_augoperator ( p , Div ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '%=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 40)) + ) + { + res = _PyPegen_augoperator ( p , Mod ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '&=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 41)) + ) + { + res = _PyPegen_augoperator ( p , BitAnd ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '|=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 42)) + ) + { + res = _PyPegen_augoperator ( p , BitOr ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '^=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 43)) + ) + { + res = _PyPegen_augoperator ( p , BitXor ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '<<=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 44)) + ) + { + res = _PyPegen_augoperator ( p , LShift ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '>>=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 45)) + ) + { + res = _PyPegen_augoperator ( p , RShift ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '**=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 46)) + ) + { + res = _PyPegen_augoperator ( p , Pow ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '//=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 48)) + ) + { + res = _PyPegen_augoperator ( p , FloorDiv ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// global_stmt: 'global' ','.NAME+ +static stmt_ty +global_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'global' ','.NAME+ + asdl_seq * a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 508)) + && + (a = _gather_16_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Global ( CHECK ( _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// nonlocal_stmt: 'nonlocal' ','.NAME+ +static stmt_ty +nonlocal_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'nonlocal' ','.NAME+ + asdl_seq * a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 509)) + && + (a = _gather_18_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Nonlocal ( CHECK ( _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// yield_stmt: yield_expr +static stmt_ty +yield_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // yield_expr + expr_ty y; + if ( + (y = yield_expr_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Expr ( y , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// assert_stmt: 'assert' expression [',' expression] +static stmt_ty +assert_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'assert' expression [',' expression] + expr_ty a; + void *b; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 505)) + && + (a = expression_rule(p)) + && + (b = _tmp_20_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Assert ( a , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// del_stmt: 'del' del_targets +static stmt_ty +del_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'del' del_targets + asdl_seq* a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 503)) + && + (a = del_targets_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Delete ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// import_stmt: import_name | import_from +static stmt_ty +import_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + { // import_name + stmt_ty import_name_var; + if ( + (import_name_var = import_name_rule(p)) + ) + { + res = import_name_var; + goto done; + } + p->mark = mark; + } + { // import_from + stmt_ty import_from_var; + if ( + (import_from_var = import_from_rule(p)) + ) + { + res = import_from_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// import_name: 'import' dotted_as_names +static stmt_ty +import_name_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'import' dotted_as_names + asdl_seq* a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 513)) + && + (a = dotted_as_names_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Import ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// import_from: +// | 'from' (('.' | '...'))* dotted_name 'import' import_from_targets +// | 'from' (('.' | '...'))+ 'import' import_from_targets +static stmt_ty +import_from_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'from' (('.' | '...'))* dotted_name 'import' import_from_targets + asdl_seq * a; + expr_ty b; + asdl_seq* c; + void *keyword; + void *keyword_1; + if ( + (keyword = _PyPegen_expect_token(p, 514)) + && + (a = _loop0_21_rule(p)) + && + (b = dotted_name_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 513)) + && + (c = import_from_targets_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_ImportFrom ( b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'from' (('.' | '...'))+ 'import' import_from_targets + asdl_seq * a; + asdl_seq* b; + void *keyword; + void *keyword_1; + if ( + (keyword = _PyPegen_expect_token(p, 514)) + && + (a = _loop1_22_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 513)) + && + (b = import_from_targets_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// import_from_targets: '(' import_from_as_names ','? ')' | import_from_as_names | '*' +static asdl_seq* +import_from_targets_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // '(' import_from_as_names ','? ')' + asdl_seq* a; + void *literal; + void *literal_1; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = import_from_as_names_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // import_from_as_names + asdl_seq* import_from_as_names_var; + if ( + (import_from_as_names_var = import_from_as_names_rule(p)) + ) + { + res = import_from_as_names_var; + goto done; + } + p->mark = mark; + } + { // '*' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 16)) + ) + { + res = _PyPegen_singleton_seq ( p , CHECK ( _PyPegen_alias_for_star ( p ) ) ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// import_from_as_names: ','.import_from_as_name+ +static asdl_seq* +import_from_as_names_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.import_from_as_name+ + asdl_seq * a; + if ( + (a = _gather_23_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// import_from_as_name: NAME ['as' NAME] +static alias_ty +import_from_as_name_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + alias_ty res = NULL; + int mark = p->mark; + { // NAME ['as' NAME] + expr_ty a; + void *b; + if ( + (a = _PyPegen_name_token(p)) + && + (b = _tmp_25_rule(p), 1) + ) + { + res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// dotted_as_names: ','.dotted_as_name+ +static asdl_seq* +dotted_as_names_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.dotted_as_name+ + asdl_seq * a; + if ( + (a = _gather_26_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// dotted_as_name: dotted_name ['as' NAME] +static alias_ty +dotted_as_name_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + alias_ty res = NULL; + int mark = p->mark; + { // dotted_name ['as' NAME] + expr_ty a; + void *b; + if ( + (a = dotted_name_rule(p)) + && + (b = _tmp_28_rule(p), 1) + ) + { + res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// dotted_name: dotted_name '.' NAME | NAME +static expr_ty dotted_name_raw(Parser *); +static expr_ty +dotted_name_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, dotted_name_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_0 = _PyPegen_update_memo(p, mark, dotted_name_type, res); + if (tmpvar_0) { + return res; + } + p->mark = mark; + void *raw = dotted_name_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +dotted_name_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + { // dotted_name '.' NAME + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = dotted_name_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + ) + { + res = _PyPegen_join_names_with_dot ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // NAME + expr_ty name_var; + if ( + (name_var = _PyPegen_name_token(p)) + ) + { + res = name_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// if_stmt: +// | 'if' named_expression ':' block elif_stmt +// | 'if' named_expression ':' block else_block? +static stmt_ty +if_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'if' named_expression ':' block elif_stmt + expr_ty a; + asdl_seq* b; + stmt_ty c; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 510)) + && + (a = named_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (c = elif_stmt_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'if' named_expression ':' block else_block? + expr_ty a; + asdl_seq* b; + void *c; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 510)) + && + (a = named_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (c = else_block_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_If ( a , b , c , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// elif_stmt: +// | 'elif' named_expression ':' block elif_stmt +// | 'elif' named_expression ':' block else_block? +static stmt_ty +elif_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'elif' named_expression ':' block elif_stmt + expr_ty a; + asdl_seq* b; + stmt_ty c; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 515)) + && + (a = named_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (c = elif_stmt_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_If ( a , b , CHECK ( _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'elif' named_expression ':' block else_block? + expr_ty a; + asdl_seq* b; + void *c; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 515)) + && + (a = named_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (c = else_block_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_If ( a , b , c , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// else_block: 'else' ':' block +static asdl_seq* +else_block_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // 'else' ':' block + asdl_seq* b; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 516)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + res = b; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// while_stmt: 'while' named_expression ':' block else_block? +static stmt_ty +while_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'while' named_expression ':' block else_block? + expr_ty a; + asdl_seq* b; + void *c; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 512)) + && + (a = named_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (c = else_block_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_While ( a , b , c , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// for_stmt: ASYNC? 'for' star_targets 'in' star_expressions ':' block else_block? +static stmt_ty +for_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // ASYNC? 'for' star_targets 'in' star_expressions ':' block else_block? + asdl_seq* b; + void *el; + expr_ty ex; + void *is_async; + void *keyword; + void *keyword_1; + void *literal; + expr_ty t; + if ( + (is_async = _PyPegen_async_token(p), 1) + && + (keyword = _PyPegen_expect_token(p, 517)) + && + (t = star_targets_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 518)) + && + (ex = star_expressions_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (el = else_block_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = ( is_async ? _Py_AsyncFor : _Py_For ) ( t , ex , b , el , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// with_stmt: +// | ASYNC? 'with' '(' ','.with_item+ ')' ':' block +// | ASYNC? 'with' ','.with_item+ ':' block +static stmt_ty +with_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // ASYNC? 'with' '(' ','.with_item+ ')' ':' block + asdl_seq * a; + asdl_seq* b; + void *is_async; + void *keyword; + void *literal; + void *literal_1; + void *literal_2; + if ( + (is_async = _PyPegen_async_token(p), 1) + && + (keyword = _PyPegen_expect_token(p, 519)) + && + (literal = _PyPegen_expect_token(p, 7)) + && + (a = _gather_29_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + && + (literal_2 = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = ( is_async ? _Py_AsyncWith : _Py_With ) ( a , b , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ASYNC? 'with' ','.with_item+ ':' block + asdl_seq * a; + asdl_seq* b; + void *is_async; + void *keyword; + void *literal; + if ( + (is_async = _PyPegen_async_token(p), 1) + && + (keyword = _PyPegen_expect_token(p, 519)) + && + (a = _gather_31_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = ( is_async ? _Py_AsyncWith : _Py_With ) ( a , b , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// with_item: expression ['as' target] +static withitem_ty +with_item_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + withitem_ty res = NULL; + int mark = p->mark; + { // expression ['as' target] + expr_ty e; + void *o; + if ( + (e = expression_rule(p)) + && + (o = _tmp_33_rule(p), 1) + ) + { + res = _Py_withitem ( e , o , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// try_stmt: +// | 'try' ':' block finally_block +// | 'try' ':' block except_block+ else_block? finally_block? +static stmt_ty +try_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'try' ':' block finally_block + asdl_seq* b; + asdl_seq* f; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 511)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (f = finally_block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Try ( b , NULL , NULL , f , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'try' ':' block except_block+ else_block? finally_block? + asdl_seq* b; + void *el; + asdl_seq * ex; + void *f; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 511)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + && + (ex = _loop1_34_rule(p)) + && + (el = else_block_rule(p), 1) + && + (f = finally_block_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Try ( b , ex , el , f , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// except_block: 'except' expression ['as' target] ':' block | 'except' ':' block +static excepthandler_ty +except_block_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + excepthandler_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'except' expression ['as' target] ':' block + asdl_seq* b; + expr_ty e; + void *keyword; + void *literal; + void *t; + if ( + (keyword = _PyPegen_expect_token(p, 520)) + && + (e = expression_rule(p)) + && + (t = _tmp_35_rule(p), 1) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_ExceptHandler ( e , ( t ) ? ( ( expr_ty ) t ) -> v . Name . id : NULL , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'except' ':' block + asdl_seq* b; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 520)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_ExceptHandler ( NULL , NULL , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// finally_block: 'finally' ':' block +static asdl_seq* +finally_block_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // 'finally' ':' block + asdl_seq* a; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 521)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (a = block_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// return_stmt: 'return' star_expressions? +static stmt_ty +return_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'return' star_expressions? + void *a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 500)) + && + (a = star_expressions_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Return ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// raise_stmt: 'raise' expression ['from' expression] | 'raise' +static stmt_ty +raise_stmt_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'raise' expression ['from' expression] + expr_ty a; + void *b; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 501)) + && + (a = expression_rule(p)) + && + (b = _tmp_36_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Raise ( a , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'raise' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 501)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Raise ( NULL , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// function_def: decorators function_def_raw | function_def_raw +static stmt_ty +function_def_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + { // decorators function_def_raw + asdl_seq* d; + stmt_ty f; + if ( + (d = decorators_rule(p)) + && + (f = function_def_raw_rule(p)) + ) + { + res = _PyPegen_function_def_decorators ( p , d , f ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // function_def_raw + stmt_ty function_def_raw_var; + if ( + (function_def_raw_var = function_def_raw_rule(p)) + ) + { + res = function_def_raw_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// function_def_raw: ASYNC? 'def' NAME '(' params? ')' ['->' annotation] ':' block +static stmt_ty +function_def_raw_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // ASYNC? 'def' NAME '(' params? ')' ['->' annotation] ':' block + void *a; + asdl_seq* b; + void *is_async; + void *keyword; + void *literal; + void *literal_1; + void *literal_2; + expr_ty n; + void *params; + if ( + (is_async = _PyPegen_async_token(p), 1) + && + (keyword = _PyPegen_expect_token(p, 522)) + && + (n = _PyPegen_name_token(p)) + && + (literal = _PyPegen_expect_token(p, 7)) + && + (params = params_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + && + (a = _tmp_37_rule(p), 1) + && + (literal_2 = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = ( is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef ) ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// params: invalid_parameters | parameters +static arguments_ty +params_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arguments_ty res = NULL; + int mark = p->mark; + { // invalid_parameters + void *invalid_parameters_var; + if ( + (invalid_parameters_var = invalid_parameters_rule(p)) + ) + { + res = invalid_parameters_var; + goto done; + } + p->mark = mark; + } + { // parameters + arguments_ty parameters_var; + if ( + (parameters_var = parameters_rule(p)) + ) + { + res = parameters_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// parameters: +// | slash_without_default [',' plain_names] [',' names_with_default] [',' star_etc?] +// | slash_with_default [',' names_with_default] [',' star_etc?] +// | plain_names [',' names_with_default] [',' star_etc?] +// | names_with_default [',' star_etc?] +// | star_etc +static arguments_ty +parameters_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arguments_ty res = NULL; + int mark = p->mark; + { // slash_without_default [',' plain_names] [',' names_with_default] [',' star_etc?] + asdl_seq* a; + void *b; + void *c; + void *d; + if ( + (a = slash_without_default_rule(p)) + && + (b = _tmp_38_rule(p), 1) + && + (c = _tmp_39_rule(p), 1) + && + (d = _tmp_40_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // slash_with_default [',' names_with_default] [',' star_etc?] + SlashWithDefault* a; + void *b; + void *c; + if ( + (a = slash_with_default_rule(p)) + && + (b = _tmp_41_rule(p), 1) + && + (c = _tmp_42_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // plain_names [',' names_with_default] [',' star_etc?] + asdl_seq* a; + void *b; + void *c; + if ( + (a = plain_names_rule(p)) + && + (b = _tmp_43_rule(p), 1) + && + (c = _tmp_44_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // names_with_default [',' star_etc?] + asdl_seq* a; + void *b; + if ( + (a = names_with_default_rule(p)) + && + (b = _tmp_45_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // star_etc + StarEtc* a; + if ( + (a = star_etc_rule(p)) + ) + { + res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , NULL , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// slash_without_default: plain_names ',' '/' +static asdl_seq* +slash_without_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // plain_names ',' '/' + asdl_seq* a; + void *literal; + void *literal_1; + if ( + (a = plain_names_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 17)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// slash_with_default: [plain_names ','] names_with_default ',' '/' +static SlashWithDefault* +slash_with_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + SlashWithDefault* res = NULL; + int mark = p->mark; + { // [plain_names ','] names_with_default ',' '/' + void *a; + asdl_seq* b; + void *literal; + void *literal_1; + if ( + (a = _tmp_46_rule(p), 1) + && + (b = names_with_default_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 17)) + ) + { + res = _PyPegen_slash_with_default ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_etc: +// | '*' plain_name name_with_optional_default* [',' kwds] ','? +// | '*' name_with_optional_default+ [',' kwds] ','? +// | kwds ','? +static StarEtc* +star_etc_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + StarEtc* res = NULL; + int mark = p->mark; + { // '*' plain_name name_with_optional_default* [',' kwds] ','? + arg_ty a; + asdl_seq * b; + void *c; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (a = plain_name_rule(p)) + && + (b = _loop0_47_rule(p)) + && + (c = _tmp_48_rule(p), 1) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = _PyPegen_star_etc ( p , a , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '*' name_with_optional_default+ [',' kwds] ','? + asdl_seq * b; + void *c; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (b = _loop1_49_rule(p)) + && + (c = _tmp_50_rule(p), 1) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = _PyPegen_star_etc ( p , NULL , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // kwds ','? + arg_ty a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = kwds_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = _PyPegen_star_etc ( p , NULL , NULL , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// name_with_optional_default: ',' plain_name ['=' expression] +static NameDefaultPair* +name_with_optional_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + NameDefaultPair* res = NULL; + int mark = p->mark; + { // ',' plain_name ['=' expression] + arg_ty a; + void *b; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (a = plain_name_rule(p)) + && + (b = _tmp_51_rule(p), 1) + ) + { + res = _PyPegen_name_default_pair ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// names_with_default: ','.name_with_default+ +static asdl_seq* +names_with_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.name_with_default+ + asdl_seq * a; + if ( + (a = _gather_52_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// name_with_default: plain_name '=' expression +static NameDefaultPair* +name_with_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + NameDefaultPair* res = NULL; + int mark = p->mark; + { // plain_name '=' expression + expr_ty e; + void *literal; + arg_ty n; + if ( + (n = plain_name_rule(p)) + && + (literal = _PyPegen_expect_token(p, 22)) + && + (e = expression_rule(p)) + ) + { + res = _PyPegen_name_default_pair ( p , n , e ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// plain_names: ','.(plain_name !'=')+ +static asdl_seq* +plain_names_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + if (_PyPegen_is_memoized(p, plain_names_type, &res)) + return res; + int mark = p->mark; + { // ','.(plain_name !'=')+ + asdl_seq * a; + if ( + (a = _gather_54_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, plain_names_type, res); + return res; +} + +// plain_name: NAME [':' annotation] +static arg_ty +plain_name_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arg_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME [':' annotation] + expr_ty a; + void *b; + if ( + (a = _PyPegen_name_token(p)) + && + (b = _tmp_56_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_arg ( a -> v . Name . id , b , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// kwds: '**' plain_name +static arg_ty +kwds_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arg_ty res = NULL; + int mark = p->mark; + { // '**' plain_name + arg_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 35)) + && + (a = plain_name_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// annotation: expression +static expr_ty +annotation_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + { // expression + expr_ty expression_var; + if ( + (expression_var = expression_rule(p)) + ) + { + res = expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// decorators: (('@' named_expression NEWLINE))+ +static asdl_seq* +decorators_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // (('@' named_expression NEWLINE))+ + asdl_seq * a; + if ( + (a = _loop1_57_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// class_def: decorators class_def_raw | class_def_raw +static stmt_ty +class_def_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + { // decorators class_def_raw + asdl_seq* a; + stmt_ty b; + if ( + (a = decorators_rule(p)) + && + (b = class_def_raw_rule(p)) + ) + { + res = _PyPegen_class_def_decorators ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // class_def_raw + stmt_ty class_def_raw_var; + if ( + (class_def_raw_var = class_def_raw_rule(p)) + ) + { + res = class_def_raw_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// class_def_raw: 'class' NAME ['(' arguments? ')'] ':' block +static stmt_ty +class_def_raw_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + stmt_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'class' NAME ['(' arguments? ')'] ':' block + expr_ty a; + void *b; + asdl_seq* c; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 523)) + && + (a = _PyPegen_name_token(p)) + && + (b = _tmp_58_rule(p), 1) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (c = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_ClassDef ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , c , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// block: NEWLINE INDENT statements DEDENT | simple_stmt | invalid_block +static asdl_seq* +block_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + if (_PyPegen_is_memoized(p, block_type, &res)) + return res; + int mark = p->mark; + { // NEWLINE INDENT statements DEDENT + asdl_seq* a; + void *dedent_var; + void *indent_var; + void *newline_var; + if ( + (newline_var = _PyPegen_newline_token(p)) + && + (indent_var = _PyPegen_indent_token(p)) + && + (a = statements_rule(p)) + && + (dedent_var = _PyPegen_dedent_token(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // simple_stmt + asdl_seq* simple_stmt_var; + if ( + (simple_stmt_var = simple_stmt_rule(p)) + ) + { + res = simple_stmt_var; + goto done; + } + p->mark = mark; + } + { // invalid_block + void *invalid_block_var; + if ( + (invalid_block_var = invalid_block_rule(p)) + ) + { + res = invalid_block_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, block_type, res); + return res; +} + +// expressions_list: ','.star_expression+ ','? +static asdl_seq* +expressions_list_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.star_expression+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_59_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_expressions: +// | star_expression ((',' star_expression))+ ','? +// | star_expression ',' +// | star_expression +static expr_ty +star_expressions_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // star_expression ((',' star_expression))+ ','? + expr_ty a; + asdl_seq * b; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = star_expression_rule(p)) + && + (b = _loop1_61_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // star_expression ',' + expr_ty a; + void *literal; + if ( + (a = star_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( CHECK ( _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // star_expression + expr_ty star_expression_var; + if ( + (star_expression_var = star_expression_rule(p)) + ) + { + res = star_expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_expression: '*' bitwise_or | expression +static expr_ty +star_expression_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, star_expression_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '*' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (a = bitwise_or_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Starred ( a , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression + expr_ty expression_var; + if ( + (expression_var = expression_rule(p)) + ) + { + res = expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, star_expression_type, res); + return res; +} + +// star_named_expressions: ','.star_named_expression+ ','? +static asdl_seq* +star_named_expressions_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.star_named_expression+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_62_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_named_expression: '*' bitwise_or | named_expression +static expr_ty +star_named_expression_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '*' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (a = bitwise_or_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Starred ( a , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // named_expression + expr_ty named_expression_var; + if ( + (named_expression_var = named_expression_rule(p)) + ) + { + res = named_expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// named_expression: NAME ':=' expression | expression !':=' | invalid_named_expression +static expr_ty +named_expression_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME ':=' expression + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = _PyPegen_name_token(p)) + && + (literal = _PyPegen_expect_token(p, 53)) + && + (b = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_NamedExpr ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression !':=' + expr_ty expression_var; + if ( + (expression_var = expression_rule(p)) + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 53) + ) + { + res = expression_var; + goto done; + } + p->mark = mark; + } + { // invalid_named_expression + void *invalid_named_expression_var; + if ( + (invalid_named_expression_var = invalid_named_expression_rule(p)) + ) + { + res = invalid_named_expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// annotated_rhs: yield_expr | star_expressions +static expr_ty +annotated_rhs_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + { // yield_expr + expr_ty yield_expr_var; + if ( + (yield_expr_var = yield_expr_rule(p)) + ) + { + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// expressions: expression ((',' expression))+ ','? | expression ',' | expression +static expr_ty +expressions_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // expression ((',' expression))+ ','? + expr_ty a; + asdl_seq * b; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = expression_rule(p)) + && + (b = _loop1_64_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression ',' + expr_ty a; + void *literal; + if ( + (a = expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( CHECK ( _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression + expr_ty expression_var; + if ( + (expression_var = expression_rule(p)) + ) + { + res = expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// expression: disjunction 'if' disjunction 'else' expression | disjunction | lambdef +static expr_ty +expression_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, expression_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // disjunction 'if' disjunction 'else' expression + expr_ty a; + expr_ty b; + expr_ty c; + void *keyword; + void *keyword_1; + if ( + (a = disjunction_rule(p)) + && + (keyword = _PyPegen_expect_token(p, 510)) + && + (b = disjunction_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 516)) + && + (c = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_IfExp ( b , a , c , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // disjunction + expr_ty disjunction_var; + if ( + (disjunction_var = disjunction_rule(p)) + ) + { + res = disjunction_var; + goto done; + } + p->mark = mark; + } + { // lambdef + expr_ty lambdef_var; + if ( + (lambdef_var = lambdef_rule(p)) + ) + { + res = lambdef_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, expression_type, res); + return res; +} + +// lambdef: 'lambda' lambda_parameters? ':' expression +static expr_ty +lambdef_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'lambda' lambda_parameters? ':' expression + void *a; + expr_ty b; + void *keyword; + void *literal; + if ( + (keyword = _PyPegen_expect_token(p, 524)) + && + (a = lambda_parameters_rule(p), 1) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Lambda ( ( a ) ? a : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_parameters: +// | lambda_slash_without_default [',' lambda_plain_names] [',' lambda_names_with_default] [',' lambda_star_etc?] +// | lambda_slash_with_default [',' lambda_names_with_default] [',' lambda_star_etc?] +// | lambda_plain_names [',' lambda_names_with_default] [',' lambda_star_etc?] +// | lambda_names_with_default [',' lambda_star_etc?] +// | lambda_star_etc +static arguments_ty +lambda_parameters_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arguments_ty res = NULL; + int mark = p->mark; + { // lambda_slash_without_default [',' lambda_plain_names] [',' lambda_names_with_default] [',' lambda_star_etc?] + asdl_seq* a; + void *b; + void *c; + void *d; + if ( + (a = lambda_slash_without_default_rule(p)) + && + (b = _tmp_65_rule(p), 1) + && + (c = _tmp_66_rule(p), 1) + && + (d = _tmp_67_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // lambda_slash_with_default [',' lambda_names_with_default] [',' lambda_star_etc?] + SlashWithDefault* a; + void *b; + void *c; + if ( + (a = lambda_slash_with_default_rule(p)) + && + (b = _tmp_68_rule(p), 1) + && + (c = _tmp_69_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // lambda_plain_names [',' lambda_names_with_default] [',' lambda_star_etc?] + asdl_seq* a; + void *b; + void *c; + if ( + (a = lambda_plain_names_rule(p)) + && + (b = _tmp_70_rule(p), 1) + && + (c = _tmp_71_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // lambda_names_with_default [',' lambda_star_etc?] + asdl_seq* a; + void *b; + if ( + (a = lambda_names_with_default_rule(p)) + && + (b = _tmp_72_rule(p), 1) + ) + { + res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // lambda_star_etc + StarEtc* a; + if ( + (a = lambda_star_etc_rule(p)) + ) + { + res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , NULL , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_slash_without_default: lambda_plain_names ',' '/' +static asdl_seq* +lambda_slash_without_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // lambda_plain_names ',' '/' + asdl_seq* a; + void *literal; + void *literal_1; + if ( + (a = lambda_plain_names_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 17)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_slash_with_default: [lambda_plain_names ','] lambda_names_with_default ',' '/' +static SlashWithDefault* +lambda_slash_with_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + SlashWithDefault* res = NULL; + int mark = p->mark; + { // [lambda_plain_names ','] lambda_names_with_default ',' '/' + void *a; + asdl_seq* b; + void *literal; + void *literal_1; + if ( + (a = _tmp_73_rule(p), 1) + && + (b = lambda_names_with_default_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 17)) + ) + { + res = _PyPegen_slash_with_default ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_star_etc: +// | '*' lambda_plain_name lambda_name_with_optional_default* [',' lambda_kwds] ','? +// | '*' lambda_name_with_optional_default+ [',' lambda_kwds] ','? +// | lambda_kwds ','? +static StarEtc* +lambda_star_etc_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + StarEtc* res = NULL; + int mark = p->mark; + { // '*' lambda_plain_name lambda_name_with_optional_default* [',' lambda_kwds] ','? + arg_ty a; + asdl_seq * b; + void *c; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (a = lambda_plain_name_rule(p)) + && + (b = _loop0_74_rule(p)) + && + (c = _tmp_75_rule(p), 1) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = _PyPegen_star_etc ( p , a , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '*' lambda_name_with_optional_default+ [',' lambda_kwds] ','? + asdl_seq * b; + void *c; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (b = _loop1_76_rule(p)) + && + (c = _tmp_77_rule(p), 1) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = _PyPegen_star_etc ( p , NULL , b , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // lambda_kwds ','? + arg_ty a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = lambda_kwds_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = _PyPegen_star_etc ( p , NULL , NULL , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_name_with_optional_default: ',' lambda_plain_name ['=' expression] +static NameDefaultPair* +lambda_name_with_optional_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + NameDefaultPair* res = NULL; + int mark = p->mark; + { // ',' lambda_plain_name ['=' expression] + arg_ty a; + void *b; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (a = lambda_plain_name_rule(p)) + && + (b = _tmp_78_rule(p), 1) + ) + { + res = _PyPegen_name_default_pair ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_names_with_default: ','.lambda_name_with_default+ +static asdl_seq* +lambda_names_with_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.lambda_name_with_default+ + asdl_seq * a; + if ( + (a = _gather_79_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_name_with_default: lambda_plain_name '=' expression +static NameDefaultPair* +lambda_name_with_default_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + NameDefaultPair* res = NULL; + int mark = p->mark; + { // lambda_plain_name '=' expression + expr_ty e; + void *literal; + arg_ty n; + if ( + (n = lambda_plain_name_rule(p)) + && + (literal = _PyPegen_expect_token(p, 22)) + && + (e = expression_rule(p)) + ) + { + res = _PyPegen_name_default_pair ( p , n , e ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_plain_names: ','.(lambda_plain_name !'=')+ +static asdl_seq* +lambda_plain_names_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.(lambda_plain_name !'=')+ + asdl_seq * a; + if ( + (a = _gather_81_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_plain_name: NAME +static arg_ty +lambda_plain_name_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arg_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME + expr_ty a; + if ( + (a = _PyPegen_name_token(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_arg ( a -> v . Name . id , NULL , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lambda_kwds: '**' lambda_plain_name +static arg_ty +lambda_kwds_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + arg_ty res = NULL; + int mark = p->mark; + { // '**' lambda_plain_name + arg_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 35)) + && + (a = lambda_plain_name_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// disjunction: conjunction (('or' conjunction))+ | conjunction +static expr_ty +disjunction_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, disjunction_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // conjunction (('or' conjunction))+ + expr_ty a; + asdl_seq * b; + if ( + (a = conjunction_rule(p)) + && + (b = _loop1_83_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BoolOp ( Or , CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // conjunction + expr_ty conjunction_var; + if ( + (conjunction_var = conjunction_rule(p)) + ) + { + res = conjunction_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, disjunction_type, res); + return res; +} + +// conjunction: inversion (('and' inversion))+ | inversion +static expr_ty +conjunction_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, conjunction_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // inversion (('and' inversion))+ + expr_ty a; + asdl_seq * b; + if ( + (a = inversion_rule(p)) + && + (b = _loop1_84_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BoolOp ( And , CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // inversion + expr_ty inversion_var; + if ( + (inversion_var = inversion_rule(p)) + ) + { + res = inversion_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, conjunction_type, res); + return res; +} + +// inversion: 'not' inversion | comparison +static expr_ty +inversion_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, inversion_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'not' inversion + expr_ty a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 525)) + && + (a = inversion_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_UnaryOp ( Not , a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // comparison + expr_ty comparison_var; + if ( + (comparison_var = comparison_rule(p)) + ) + { + res = comparison_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, inversion_type, res); + return res; +} + +// comparison: bitwise_or compare_op_bitwise_or_pair+ | bitwise_or +static expr_ty +comparison_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // bitwise_or compare_op_bitwise_or_pair+ + expr_ty a; + asdl_seq * b; + if ( + (a = bitwise_or_rule(p)) + && + (b = _loop1_85_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Compare ( a , CHECK ( _PyPegen_get_cmpops ( p , b ) ) , CHECK ( _PyPegen_get_exprs ( p , b ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // bitwise_or + expr_ty bitwise_or_var; + if ( + (bitwise_or_var = bitwise_or_rule(p)) + ) + { + res = bitwise_or_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// compare_op_bitwise_or_pair: +// | eq_bitwise_or +// | noteq_bitwise_or +// | lte_bitwise_or +// | lt_bitwise_or +// | gte_bitwise_or +// | gt_bitwise_or +// | notin_bitwise_or +// | in_bitwise_or +// | isnot_bitwise_or +// | is_bitwise_or +static CmpopExprPair* +compare_op_bitwise_or_pair_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // eq_bitwise_or + CmpopExprPair* eq_bitwise_or_var; + if ( + (eq_bitwise_or_var = eq_bitwise_or_rule(p)) + ) + { + res = eq_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // noteq_bitwise_or + CmpopExprPair* noteq_bitwise_or_var; + if ( + (noteq_bitwise_or_var = noteq_bitwise_or_rule(p)) + ) + { + res = noteq_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // lte_bitwise_or + CmpopExprPair* lte_bitwise_or_var; + if ( + (lte_bitwise_or_var = lte_bitwise_or_rule(p)) + ) + { + res = lte_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // lt_bitwise_or + CmpopExprPair* lt_bitwise_or_var; + if ( + (lt_bitwise_or_var = lt_bitwise_or_rule(p)) + ) + { + res = lt_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // gte_bitwise_or + CmpopExprPair* gte_bitwise_or_var; + if ( + (gte_bitwise_or_var = gte_bitwise_or_rule(p)) + ) + { + res = gte_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // gt_bitwise_or + CmpopExprPair* gt_bitwise_or_var; + if ( + (gt_bitwise_or_var = gt_bitwise_or_rule(p)) + ) + { + res = gt_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // notin_bitwise_or + CmpopExprPair* notin_bitwise_or_var; + if ( + (notin_bitwise_or_var = notin_bitwise_or_rule(p)) + ) + { + res = notin_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // in_bitwise_or + CmpopExprPair* in_bitwise_or_var; + if ( + (in_bitwise_or_var = in_bitwise_or_rule(p)) + ) + { + res = in_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // isnot_bitwise_or + CmpopExprPair* isnot_bitwise_or_var; + if ( + (isnot_bitwise_or_var = isnot_bitwise_or_rule(p)) + ) + { + res = isnot_bitwise_or_var; + goto done; + } + p->mark = mark; + } + { // is_bitwise_or + CmpopExprPair* is_bitwise_or_var; + if ( + (is_bitwise_or_var = is_bitwise_or_rule(p)) + ) + { + res = is_bitwise_or_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// eq_bitwise_or: '==' bitwise_or +static CmpopExprPair* +eq_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // '==' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 27)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , Eq , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// noteq_bitwise_or: '!=' bitwise_or +static CmpopExprPair* +noteq_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // '!=' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 28)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , NotEq , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lte_bitwise_or: '<=' bitwise_or +static CmpopExprPair* +lte_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // '<=' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 29)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , LtE , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// lt_bitwise_or: '<' bitwise_or +static CmpopExprPair* +lt_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // '<' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 20)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , Lt , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// gte_bitwise_or: '>=' bitwise_or +static CmpopExprPair* +gte_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // '>=' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 30)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , GtE , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// gt_bitwise_or: '>' bitwise_or +static CmpopExprPair* +gt_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // '>' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 21)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , Gt , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// notin_bitwise_or: 'not' 'in' bitwise_or +static CmpopExprPair* +notin_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // 'not' 'in' bitwise_or + expr_ty a; + void *keyword; + void *keyword_1; + if ( + (keyword = _PyPegen_expect_token(p, 525)) + && + (keyword_1 = _PyPegen_expect_token(p, 518)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , NotIn , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// in_bitwise_or: 'in' bitwise_or +static CmpopExprPair* +in_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // 'in' bitwise_or + expr_ty a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 518)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , In , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// isnot_bitwise_or: 'is' 'not' bitwise_or +static CmpopExprPair* +isnot_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // 'is' 'not' bitwise_or + expr_ty a; + void *keyword; + void *keyword_1; + if ( + (keyword = _PyPegen_expect_token(p, 526)) + && + (keyword_1 = _PyPegen_expect_token(p, 525)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , IsNot , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// is_bitwise_or: 'is' bitwise_or +static CmpopExprPair* +is_bitwise_or_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + CmpopExprPair* res = NULL; + int mark = p->mark; + { // 'is' bitwise_or + expr_ty a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 526)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_cmpop_expr_pair ( p , Is , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// bitwise_or: bitwise_or '|' bitwise_xor | bitwise_xor +static expr_ty bitwise_or_raw(Parser *); +static expr_ty +bitwise_or_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, bitwise_or_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_1 = _PyPegen_update_memo(p, mark, bitwise_or_type, res); + if (tmpvar_1) { + return res; + } + p->mark = mark; + void *raw = bitwise_or_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +bitwise_or_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // bitwise_or '|' bitwise_xor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = bitwise_or_rule(p)) + && + (literal = _PyPegen_expect_token(p, 18)) + && + (b = bitwise_xor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , BitOr , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // bitwise_xor + expr_ty bitwise_xor_var; + if ( + (bitwise_xor_var = bitwise_xor_rule(p)) + ) + { + res = bitwise_xor_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// bitwise_xor: bitwise_xor '^' bitwise_and | bitwise_and +static expr_ty bitwise_xor_raw(Parser *); +static expr_ty +bitwise_xor_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, bitwise_xor_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_2 = _PyPegen_update_memo(p, mark, bitwise_xor_type, res); + if (tmpvar_2) { + return res; + } + p->mark = mark; + void *raw = bitwise_xor_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +bitwise_xor_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // bitwise_xor '^' bitwise_and + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = bitwise_xor_rule(p)) + && + (literal = _PyPegen_expect_token(p, 32)) + && + (b = bitwise_and_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , BitXor , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // bitwise_and + expr_ty bitwise_and_var; + if ( + (bitwise_and_var = bitwise_and_rule(p)) + ) + { + res = bitwise_and_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// bitwise_and: bitwise_and '&' shift_expr | shift_expr +static expr_ty bitwise_and_raw(Parser *); +static expr_ty +bitwise_and_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, bitwise_and_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_3 = _PyPegen_update_memo(p, mark, bitwise_and_type, res); + if (tmpvar_3) { + return res; + } + p->mark = mark; + void *raw = bitwise_and_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +bitwise_and_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // bitwise_and '&' shift_expr + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = bitwise_and_rule(p)) + && + (literal = _PyPegen_expect_token(p, 19)) + && + (b = shift_expr_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , BitAnd , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // shift_expr + expr_ty shift_expr_var; + if ( + (shift_expr_var = shift_expr_rule(p)) + ) + { + res = shift_expr_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// shift_expr: shift_expr '<<' sum | shift_expr '>>' sum | sum +static expr_ty shift_expr_raw(Parser *); +static expr_ty +shift_expr_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, shift_expr_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_4 = _PyPegen_update_memo(p, mark, shift_expr_type, res); + if (tmpvar_4) { + return res; + } + p->mark = mark; + void *raw = shift_expr_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +shift_expr_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // shift_expr '<<' sum + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = shift_expr_rule(p)) + && + (literal = _PyPegen_expect_token(p, 33)) + && + (b = sum_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , LShift , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // shift_expr '>>' sum + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = shift_expr_rule(p)) + && + (literal = _PyPegen_expect_token(p, 34)) + && + (b = sum_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , RShift , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // sum + expr_ty sum_var; + if ( + (sum_var = sum_rule(p)) + ) + { + res = sum_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// sum: sum '+' term | sum '-' term | term +static expr_ty sum_raw(Parser *); +static expr_ty +sum_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, sum_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_5 = _PyPegen_update_memo(p, mark, sum_type, res); + if (tmpvar_5) { + return res; + } + p->mark = mark; + void *raw = sum_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +sum_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // sum '+' term + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = sum_rule(p)) + && + (literal = _PyPegen_expect_token(p, 14)) + && + (b = term_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , Add , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // sum '-' term + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = sum_rule(p)) + && + (literal = _PyPegen_expect_token(p, 15)) + && + (b = term_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , Sub , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // term + expr_ty term_var; + if ( + (term_var = term_rule(p)) + ) + { + res = term_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// Left-recursive +// term: +// | term '*' factor +// | term '/' factor +// | term '//' factor +// | term '%' factor +// | term '@' factor +// | factor +static expr_ty term_raw(Parser *); +static expr_ty +term_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, term_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_6 = _PyPegen_update_memo(p, mark, term_type, res); + if (tmpvar_6) { + return res; + } + p->mark = mark; + void *raw = term_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +term_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // term '*' factor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = term_rule(p)) + && + (literal = _PyPegen_expect_token(p, 16)) + && + (b = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , Mult , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // term '/' factor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = term_rule(p)) + && + (literal = _PyPegen_expect_token(p, 17)) + && + (b = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , Div , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // term '//' factor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = term_rule(p)) + && + (literal = _PyPegen_expect_token(p, 47)) + && + (b = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , FloorDiv , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // term '%' factor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = term_rule(p)) + && + (literal = _PyPegen_expect_token(p, 24)) + && + (b = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , Mod , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // term '@' factor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = term_rule(p)) + && + (literal = _PyPegen_expect_token(p, 49)) + && + (b = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , MatMult , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // factor + expr_ty factor_var; + if ( + (factor_var = factor_rule(p)) + ) + { + res = factor_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// factor: '+' factor | '-' factor | '~' factor | power +static expr_ty +factor_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, factor_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '+' factor + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 14)) + && + (a = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_UnaryOp ( UAdd , a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '-' factor + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 15)) + && + (a = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_UnaryOp ( USub , a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '~' factor + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 31)) + && + (a = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_UnaryOp ( Invert , a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // power + expr_ty power_var; + if ( + (power_var = power_rule(p)) + ) + { + res = power_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, factor_type, res); + return res; +} + +// power: await_primary '**' factor | await_primary +static expr_ty +power_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // await_primary '**' factor + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = await_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 35)) + && + (b = factor_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_BinOp ( a , Pow , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // await_primary + expr_ty await_primary_var; + if ( + (await_primary_var = await_primary_rule(p)) + ) + { + res = await_primary_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// await_primary: AWAIT primary | primary +static expr_ty +await_primary_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, await_primary_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // AWAIT primary + expr_ty a; + void *await_var; + if ( + (await_var = _PyPegen_await_token(p)) + && + (a = primary_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Await ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // primary + expr_ty primary_var; + if ( + (primary_var = primary_rule(p)) + ) + { + res = primary_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, await_primary_type, res); + return res; +} + +// Left-recursive +// primary: +// | primary '.' NAME +// | primary genexp +// | primary '(' arguments? ')' +// | primary '[' slices ']' +// | atom +static expr_ty primary_raw(Parser *); +static expr_ty +primary_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, primary_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_7 = _PyPegen_update_memo(p, mark, primary_type, res); + if (tmpvar_7) { + return res; + } + p->mark = mark; + void *raw = primary_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +primary_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // primary '.' NAME + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // primary genexp + expr_ty a; + expr_ty b; + if ( + (a = primary_rule(p)) + && + (b = genexp_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( a , CHECK ( _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // primary '(' arguments? ')' + expr_ty a; + void *b; + void *literal; + void *literal_1; + if ( + (a = primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 7)) + && + (b = arguments_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // primary '[' slices ']' + expr_ty a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 9)) + && + (b = slices_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Subscript ( a , b , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // atom + expr_ty atom_var; + if ( + (atom_var = atom_rule(p)) + ) + { + res = atom_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// slices: slice !',' | ','.slice+ ','? +static expr_ty +slices_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // slice !',' + expr_ty a; + if ( + (a = slice_rule(p)) + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ','.slice+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_86_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( a , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// slice: expression? ':' expression? [':' expression?] | expression +static expr_ty +slice_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // expression? ':' expression? [':' expression?] + void *a; + void *b; + void *c; + void *literal; + if ( + (a = expression_rule(p), 1) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = expression_rule(p), 1) + && + (c = _tmp_88_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Slice ( a , b , c , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression + expr_ty a; + if ( + (a = expression_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// atom: +// | NAME +// | 'True' +// | 'False' +// | 'None' +// | '__new_parser__' +// | &STRING strings +// | NUMBER +// | &'(' (tuple | group | genexp) +// | &'[' (list | listcomp) +// | &'{' (dict | set | dictcomp | setcomp) +// | '...' +static expr_ty +atom_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME + expr_ty name_var; + if ( + (name_var = _PyPegen_name_token(p)) + ) + { + res = name_var; + goto done; + } + p->mark = mark; + } + { // 'True' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 527)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Constant ( Py_True , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'False' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 528)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Constant ( Py_False , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'None' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 529)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Constant ( Py_None , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '__new_parser__' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 530)) + ) + { + res = RAISE_SYNTAX_ERROR ( "You found it!" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // &STRING strings + expr_ty strings_var; + if ( + _PyPegen_lookahead(1, _PyPegen_string_token, p) + && + (strings_var = strings_rule(p)) + ) + { + res = strings_var; + goto done; + } + p->mark = mark; + } + { // NUMBER + expr_ty number_var; + if ( + (number_var = _PyPegen_number_token(p)) + ) + { + res = number_var; + goto done; + } + p->mark = mark; + } + { // &'(' (tuple | group | genexp) + void *_tmp_89_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7) + && + (_tmp_89_var = _tmp_89_rule(p)) + ) + { + res = _tmp_89_var; + goto done; + } + p->mark = mark; + } + { // &'[' (list | listcomp) + void *_tmp_90_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9) + && + (_tmp_90_var = _tmp_90_rule(p)) + ) + { + res = _tmp_90_var; + goto done; + } + p->mark = mark; + } + { // &'{' (dict | set | dictcomp | setcomp) + void *_tmp_91_var; + if ( + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25) + && + (_tmp_91_var = _tmp_91_rule(p)) + ) + { + res = _tmp_91_var; + goto done; + } + p->mark = mark; + } + { // '...' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 52)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Constant ( Py_Ellipsis , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// strings: STRING+ +static expr_ty +strings_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, strings_type, &res)) + return res; + int mark = p->mark; + { // STRING+ + asdl_seq * a; + if ( + (a = _loop1_92_rule(p)) + ) + { + res = _PyPegen_concatenate_strings ( p , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, strings_type, res); + return res; +} + +// list: '[' star_named_expressions? ']' +static expr_ty +list_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '[' star_named_expressions? ']' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 9)) + && + (a = star_named_expressions_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_List ( a , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// listcomp: '[' named_expression for_if_clauses ']' | invalid_comprehension +static expr_ty +listcomp_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '[' named_expression for_if_clauses ']' + expr_ty a; + asdl_seq* b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 9)) + && + (a = named_expression_rule(p)) + && + (b = for_if_clauses_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_ListComp ( a , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // invalid_comprehension + void *invalid_comprehension_var; + if ( + (invalid_comprehension_var = invalid_comprehension_rule(p)) + ) + { + res = invalid_comprehension_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// tuple: '(' [star_named_expression ',' star_named_expressions?] ')' +static expr_ty +tuple_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '(' [star_named_expression ',' star_named_expressions?] ')' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = _tmp_93_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( a , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// group: '(' (yield_expr | named_expression) ')' +static expr_ty +group_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + { // '(' (yield_expr | named_expression) ')' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = _tmp_94_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// genexp: '(' expression for_if_clauses ')' | invalid_comprehension +static expr_ty +genexp_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '(' expression for_if_clauses ')' + expr_ty a; + asdl_seq* b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = expression_rule(p)) + && + (b = for_if_clauses_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_GeneratorExp ( a , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // invalid_comprehension + void *invalid_comprehension_var; + if ( + (invalid_comprehension_var = invalid_comprehension_rule(p)) + ) + { + res = invalid_comprehension_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// set: '{' expressions_list '}' +static expr_ty +set_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '{' expressions_list '}' + asdl_seq* a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 25)) + && + (a = expressions_list_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 26)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Set ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// setcomp: '{' expression for_if_clauses '}' | invalid_comprehension +static expr_ty +setcomp_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '{' expression for_if_clauses '}' + expr_ty a; + asdl_seq* b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 25)) + && + (a = expression_rule(p)) + && + (b = for_if_clauses_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 26)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_SetComp ( a , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // invalid_comprehension + void *invalid_comprehension_var; + if ( + (invalid_comprehension_var = invalid_comprehension_rule(p)) + ) + { + res = invalid_comprehension_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// dict: '{' kvpairs? '}' +static expr_ty +dict_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '{' kvpairs? '}' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 25)) + && + (a = kvpairs_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 26)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Dict ( CHECK ( _PyPegen_get_keys ( p , a ) ) , CHECK ( _PyPegen_get_values ( p , a ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// dictcomp: '{' kvpair for_if_clauses '}' +static expr_ty +dictcomp_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '{' kvpair for_if_clauses '}' + KeyValuePair* a; + asdl_seq* b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 25)) + && + (a = kvpair_rule(p)) + && + (b = for_if_clauses_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 26)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_DictComp ( a -> key , a -> value , b , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// kvpairs: ','.kvpair+ ','? +static asdl_seq* +kvpairs_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.kvpair+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_95_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// kvpair: '**' bitwise_or | expression ':' expression +static KeyValuePair* +kvpair_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + KeyValuePair* res = NULL; + int mark = p->mark; + { // '**' bitwise_or + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 35)) + && + (a = bitwise_or_rule(p)) + ) + { + res = _PyPegen_key_value_pair ( p , NULL , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression ':' expression + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (b = expression_rule(p)) + ) + { + res = _PyPegen_key_value_pair ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// for_if_clauses: ((ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*))+ +static asdl_seq* +for_if_clauses_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ((ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*))+ + asdl_seq * a; + if ( + (a = _loop1_97_rule(p)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// yield_expr: 'yield' 'from' expression | 'yield' star_expressions? +static expr_ty +yield_expr_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // 'yield' 'from' expression + expr_ty a; + void *keyword; + void *keyword_1; + if ( + (keyword = _PyPegen_expect_token(p, 504)) + && + (keyword_1 = _PyPegen_expect_token(p, 514)) + && + (a = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_YieldFrom ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'yield' star_expressions? + void *a; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 504)) + && + (a = star_expressions_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Yield ( a , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// arguments: args ','? &')' | incorrect_arguments +static expr_ty +arguments_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, arguments_type, &res)) + return res; + int mark = p->mark; + { // args ','? &')' + expr_ty a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = args_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + && + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // incorrect_arguments + void *incorrect_arguments_var; + if ( + (incorrect_arguments_var = incorrect_arguments_rule(p)) + ) + { + res = incorrect_arguments_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, arguments_type, res); + return res; +} + +// args: starred_expression [',' args] | kwargs | named_expression [',' args] +static expr_ty +args_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // starred_expression [',' args] + expr_ty a; + void *b; + if ( + (a = starred_expression_rule(p)) + && + (b = _tmp_98_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( _PyPegen_dummy_name ( p ) , ( b ) ? CHECK ( _PyPegen_seq_insert_in_front ( p , a , ( ( expr_ty ) b ) -> v . Call . args ) ) : CHECK ( _PyPegen_singleton_seq ( p , a ) ) , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // kwargs + asdl_seq* a; + if ( + (a = kwargs_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( _PyPegen_dummy_name ( p ) , CHECK_NULL_ALLOWED ( _PyPegen_seq_extract_starred_exprs ( p , a ) ) , CHECK_NULL_ALLOWED ( _PyPegen_seq_delete_starred_exprs ( p , a ) ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // named_expression [',' args] + expr_ty a; + void *b; + if ( + (a = named_expression_rule(p)) + && + (b = _tmp_99_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( _PyPegen_dummy_name ( p ) , ( b ) ? CHECK ( _PyPegen_seq_insert_in_front ( p , a , ( ( expr_ty ) b ) -> v . Call . args ) ) : CHECK ( _PyPegen_singleton_seq ( p , a ) ) , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// kwargs: +// | ','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+ +// | ','.kwarg_or_starred+ +// | ','.kwarg_or_double_starred+ +static asdl_seq* +kwargs_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.kwarg_or_starred+ ',' ','.kwarg_or_double_starred+ + asdl_seq * a; + asdl_seq * b; + void *literal; + if ( + (a = _gather_100_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (b = _gather_102_rule(p)) + ) + { + res = _PyPegen_join_sequences ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ','.kwarg_or_starred+ + asdl_seq * _gather_104_var; + if ( + (_gather_104_var = _gather_104_rule(p)) + ) + { + res = _gather_104_var; + goto done; + } + p->mark = mark; + } + { // ','.kwarg_or_double_starred+ + asdl_seq * _gather_106_var; + if ( + (_gather_106_var = _gather_106_rule(p)) + ) + { + res = _gather_106_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// starred_expression: '*' expression +static expr_ty +starred_expression_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '*' expression + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (a = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Starred ( a , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// kwarg_or_starred: NAME '=' expression | starred_expression +static KeywordOrStarred* +kwarg_or_starred_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + KeywordOrStarred* res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME '=' expression + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = _PyPegen_name_token(p)) + && + (literal = _PyPegen_expect_token(p, 22)) + && + (b = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // starred_expression + expr_ty a; + if ( + (a = starred_expression_rule(p)) + ) + { + res = _PyPegen_keyword_or_starred ( p , a , 0 ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// kwarg_or_double_starred: NAME '=' expression | '**' expression +static KeywordOrStarred* +kwarg_or_double_starred_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + KeywordOrStarred* res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME '=' expression + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = _PyPegen_name_token(p)) + && + (literal = _PyPegen_expect_token(p, 22)) + && + (b = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '**' expression + expr_ty a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 35)) + && + (a = expression_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _PyPegen_keyword_or_starred ( p , CHECK ( _Py_keyword ( NULL , a , EXTRA ) ) , 1 ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_targets: star_target !',' | star_target ((',' star_target))* ','? +static expr_ty +star_targets_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // star_target !',' + expr_ty a; + if ( + (a = star_target_rule(p)) + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 12) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // star_target ((',' star_target))* ','? + expr_ty a; + asdl_seq * b; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = star_target_rule(p)) + && + (b = _loop0_108_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( CHECK ( _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_targets_seq: ','.star_target+ ','? +static asdl_seq* +star_targets_seq_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.star_target+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_109_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// star_target: +// | '*' (!'*' star_target) +// | t_primary '.' NAME !t_lookahead +// | t_primary '[' slices ']' !t_lookahead +// | star_atom +static expr_ty +star_target_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, star_target_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // '*' (!'*' star_target) + void *a; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 16)) + && + (a = _tmp_111_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Starred ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '.' NAME !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '[' slices ']' !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 9)) + && + (b = slices_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Subscript ( a , b , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // star_atom + expr_ty star_atom_var; + if ( + (star_atom_var = star_atom_rule(p)) + ) + { + res = star_atom_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, star_target_type, res); + return res; +} + +// star_atom: +// | NAME +// | '(' star_target ')' +// | '(' star_targets_seq? ')' +// | '[' star_targets_seq? ']' +static expr_ty +star_atom_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME + expr_ty a; + if ( + (a = _PyPegen_name_token(p)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Store ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' star_target ')' + expr_ty a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = star_target_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Store ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' star_targets_seq? ')' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = star_targets_seq_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( a , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '[' star_targets_seq? ']' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 9)) + && + (a = star_targets_seq_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_List ( a , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// inside_paren_ann_assign_target: +// | ann_assign_subscript_attribute_target +// | NAME +// | '(' inside_paren_ann_assign_target ')' +static expr_ty +inside_paren_ann_assign_target_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + { // ann_assign_subscript_attribute_target + expr_ty ann_assign_subscript_attribute_target_var; + if ( + (ann_assign_subscript_attribute_target_var = ann_assign_subscript_attribute_target_rule(p)) + ) + { + res = ann_assign_subscript_attribute_target_var; + goto done; + } + p->mark = mark; + } + { // NAME + expr_ty a; + if ( + (a = _PyPegen_name_token(p)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Store ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' inside_paren_ann_assign_target ')' + expr_ty a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = inside_paren_ann_assign_target_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// ann_assign_subscript_attribute_target: +// | t_primary '.' NAME !t_lookahead +// | t_primary '[' slices ']' !t_lookahead +static expr_ty +ann_assign_subscript_attribute_target_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // t_primary '.' NAME !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '[' slices ']' !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 9)) + && + (b = slices_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Subscript ( a , b , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// del_targets: ','.del_target+ ','? +static asdl_seq* +del_targets_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.del_target+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_112_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// del_target: +// | t_primary '.' NAME !t_lookahead +// | t_primary '[' slices ']' !t_lookahead +// | del_t_atom +static expr_ty +del_target_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, del_target_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // t_primary '.' NAME !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Attribute ( a , b -> v . Name . id , Del , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '[' slices ']' !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 9)) + && + (b = slices_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Subscript ( a , b , Del , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // del_t_atom + expr_ty del_t_atom_var; + if ( + (del_t_atom_var = del_t_atom_rule(p)) + ) + { + res = del_t_atom_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, del_target_type, res); + return res; +} + +// del_t_atom: NAME | '(' del_target ')' | '(' del_targets? ')' | '[' del_targets? ']' +static expr_ty +del_t_atom_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME + expr_ty a; + if ( + (a = _PyPegen_name_token(p)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Del ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' del_target ')' + expr_ty a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = del_target_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Del ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' del_targets? ')' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = del_targets_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( a , Del , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '[' del_targets? ']' + void *a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 9)) + && + (a = del_targets_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_List ( a , Del , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// targets: ','.target+ ','? +static asdl_seq* +targets_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.target+ ','? + asdl_seq * a; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (a = _gather_114_rule(p)) + && + (opt_var = _PyPegen_expect_token(p, 12), 1) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// target: +// | t_primary '.' NAME !t_lookahead +// | t_primary '[' slices ']' !t_lookahead +// | t_atom +static expr_ty +target_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, target_type, &res)) + return res; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // t_primary '.' NAME !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '[' slices ']' !t_lookahead + expr_ty a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 9)) + && + (b = slices_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + && + _PyPegen_lookahead(0, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Subscript ( a , b , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_atom + expr_ty t_atom_var; + if ( + (t_atom_var = t_atom_rule(p)) + ) + { + res = t_atom_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + _PyPegen_insert_memo(p, mark, target_type, res); + return res; +} + +// Left-recursive +// t_primary: +// | t_primary '.' NAME &t_lookahead +// | t_primary '[' slices ']' &t_lookahead +// | t_primary genexp &t_lookahead +// | t_primary '(' arguments? ')' &t_lookahead +// | atom &t_lookahead +static expr_ty t_primary_raw(Parser *); +static expr_ty +t_primary_rule(Parser *p) +{ + expr_ty res = NULL; + if (_PyPegen_is_memoized(p, t_primary_type, &res)) + return res; + int mark = p->mark; + int resmark = p->mark; + while (1) { + int tmpvar_8 = _PyPegen_update_memo(p, mark, t_primary_type, res); + if (tmpvar_8) { + return res; + } + p->mark = mark; + void *raw = t_primary_raw(p); + if (raw == NULL || p->mark <= resmark) + break; + resmark = p->mark; + res = raw; + } + p->mark = resmark; + return res; +} +static expr_ty +t_primary_raw(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // t_primary '.' NAME &t_lookahead + expr_ty a; + expr_ty b; + void *literal; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 23)) + && + (b = _PyPegen_name_token(p)) + && + _PyPegen_lookahead(1, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '[' slices ']' &t_lookahead + expr_ty a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 9)) + && + (b = slices_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + && + _PyPegen_lookahead(1, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Subscript ( a , b , Load , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary genexp &t_lookahead + expr_ty a; + expr_ty b; + if ( + (a = t_primary_rule(p)) + && + (b = genexp_rule(p)) + && + _PyPegen_lookahead(1, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( a , CHECK ( _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // t_primary '(' arguments? ')' &t_lookahead + expr_ty a; + void *b; + void *literal; + void *literal_1; + if ( + (a = t_primary_rule(p)) + && + (literal = _PyPegen_expect_token(p, 7)) + && + (b = arguments_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + && + _PyPegen_lookahead(1, t_lookahead_rule, p) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // atom &t_lookahead + expr_ty a; + if ( + (a = atom_rule(p)) + && + _PyPegen_lookahead(1, t_lookahead_rule, p) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// t_lookahead: '(' | '[' | '.' +static void * +t_lookahead_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '(' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 7)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // '[' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 9)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // '.' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 23)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// t_atom: NAME | '(' target ')' | '(' targets? ')' | '[' targets? ']' +static expr_ty +t_atom_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + expr_ty res = NULL; + int mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + return NULL; + } + int start_lineno = p->tokens[mark]->lineno; + UNUSED(start_lineno); // Only used by EXTRA macro + int start_col_offset = p->tokens[mark]->col_offset; + UNUSED(start_col_offset); // Only used by EXTRA macro + { // NAME + expr_ty a; + if ( + (a = _PyPegen_name_token(p)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Store ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' target ')' + expr_ty a; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = target_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = _PyPegen_set_expr_context ( p , a , Store ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '(' targets? ')' + void *b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (b = targets_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_Tuple ( b , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // '[' targets? ']' + void *b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 9)) + && + (b = targets_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 10)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_List ( b , Store , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// incorrect_arguments: +// | args ',' '*' +// | expression for_if_clauses ',' [args | expression for_if_clauses] +// | args ',' args +static void * +incorrect_arguments_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // args ',' '*' + expr_ty args_var; + void *literal; + void *literal_1; + if ( + (args_var = args_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 16)) + ) + { + res = RAISE_SYNTAX_ERROR ( "iterable argument unpacking follows keyword argument unpacking" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression for_if_clauses ',' [args | expression for_if_clauses] + expr_ty expression_var; + asdl_seq* for_if_clauses_var; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (expression_var = expression_rule(p)) + && + (for_if_clauses_var = for_if_clauses_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (opt_var = _tmp_116_rule(p), 1) + ) + { + res = RAISE_SYNTAX_ERROR ( "Generator expression must be parenthesized" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // args ',' args + expr_ty a; + expr_ty args_var; + void *literal; + if ( + (a = args_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (args_var = args_rule(p)) + ) + { + res = _PyPegen_arguments_parsing_error ( p , a ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// invalid_named_expression: expression ':=' expression +static void * +invalid_named_expression_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // expression ':=' expression + expr_ty a; + expr_ty expression_var; + void *literal; + if ( + (a = expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 53)) + && + (expression_var = expression_rule(p)) + ) + { + res = RAISE_SYNTAX_ERROR ( "cannot use assignment expressions with %s" , _PyPegen_get_expr_name ( a ) ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// invalid_assignment: +// | list ':' +// | tuple ':' +// | expression ':' expression ['=' annotated_rhs] +// | expression ('=' | augassign) (yield_expr | star_expressions) +static void * +invalid_assignment_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // list ':' + expr_ty list_var; + void *literal; + if ( + (list_var = list_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + ) + { + res = RAISE_SYNTAX_ERROR ( "only single target (not list) can be annotated" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // tuple ':' + void *literal; + expr_ty tuple_var; + if ( + (tuple_var = tuple_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + ) + { + res = RAISE_SYNTAX_ERROR ( "only single target (not tuple) can be annotated" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression ':' expression ['=' annotated_rhs] + expr_ty expression_var; + expr_ty expression_var_1; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + if ( + (expression_var = expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (expression_var_1 = expression_rule(p)) + && + (opt_var = _tmp_117_rule(p), 1) + ) + { + res = RAISE_SYNTAX_ERROR ( "illegal target for annotation" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // expression ('=' | augassign) (yield_expr | star_expressions) + void *_tmp_118_var; + void *_tmp_119_var; + expr_ty a; + if ( + (a = expression_rule(p)) + && + (_tmp_118_var = _tmp_118_rule(p)) + && + (_tmp_119_var = _tmp_119_rule(p)) + ) + { + res = RAISE_SYNTAX_ERROR ( "cannot assign to %s" , _PyPegen_get_expr_name ( a ) ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// invalid_block: NEWLINE !INDENT +static void * +invalid_block_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // NEWLINE !INDENT + void *newline_var; + if ( + (newline_var = _PyPegen_newline_token(p)) + && + _PyPegen_lookahead(0, _PyPegen_indent_token, p) + ) + { + res = RAISE_INDENTATION_ERROR ( "expected an indented block" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// invalid_comprehension: ('[' | '(' | '{') '*' expression for_if_clauses +static void * +invalid_comprehension_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ('[' | '(' | '{') '*' expression for_if_clauses + void *_tmp_120_var; + expr_ty expression_var; + asdl_seq* for_if_clauses_var; + void *literal; + if ( + (_tmp_120_var = _tmp_120_rule(p)) + && + (literal = _PyPegen_expect_token(p, 16)) + && + (expression_var = expression_rule(p)) + && + (for_if_clauses_var = for_if_clauses_rule(p)) + ) + { + res = RAISE_SYNTAX_ERROR ( "iterable unpacking cannot be used in comprehension" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// invalid_parameters: +// | [plain_names ','] (slash_with_default | names_with_default) ',' plain_names +static void * +invalid_parameters_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // [plain_names ','] (slash_with_default | names_with_default) ',' plain_names + void *_tmp_122_var; + void *literal; + void *opt_var; + UNUSED(opt_var); // Silence compiler warnings + asdl_seq* plain_names_var; + if ( + (opt_var = _tmp_121_rule(p), 1) + && + (_tmp_122_var = _tmp_122_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (plain_names_var = plain_names_rule(p)) + ) + { + res = RAISE_SYNTAX_ERROR ( "non-default argument follows default argument" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_1: NEWLINE +static asdl_seq * +_loop0_1_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // NEWLINE + void *newline_var; + while ( + (newline_var = _PyPegen_newline_token(p)) + ) + { + res = newline_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_1"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_1_type, seq); + return seq; +} + +// _loop1_2: statement +static asdl_seq * +_loop1_2_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // statement + asdl_seq* statement_var; + while ( + (statement_var = statement_rule(p)) + ) + { + res = statement_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_2"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_2_type, seq); + return seq; +} + +// _loop0_4: ';' small_stmt +static asdl_seq * +_loop0_4_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ';' small_stmt + stmt_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 13)) + && + (elem = small_stmt_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_4"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_4_type, seq); + return seq; +} + +// _gather_3: small_stmt _loop0_4 +static asdl_seq * +_gather_3_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // small_stmt _loop0_4 + stmt_ty elem; + asdl_seq * seq; + if ( + (elem = small_stmt_rule(p)) + && + (seq = _loop0_4_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_5: 'import' | 'from' +static void * +_tmp_5_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'import' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 513)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + { // 'from' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 514)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_6: 'def' | '@' | ASYNC +static void * +_tmp_6_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'def' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 522)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + { // '@' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 49)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // ASYNC + void *async_var; + if ( + (async_var = _PyPegen_async_token(p)) + ) + { + res = async_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_7: 'class' | '@' +static void * +_tmp_7_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'class' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 523)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + { // '@' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 49)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_8: 'with' | ASYNC +static void * +_tmp_8_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'with' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 519)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + { // ASYNC + void *async_var; + if ( + (async_var = _PyPegen_async_token(p)) + ) + { + res = async_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_9: 'for' | ASYNC +static void * +_tmp_9_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'for' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 517)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + { // ASYNC + void *async_var; + if ( + (async_var = _PyPegen_async_token(p)) + ) + { + res = async_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_10: '=' annotated_rhs +static void * +_tmp_10_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '=' annotated_rhs + expr_ty d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 22)) + && + (d = annotated_rhs_rule(p)) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_11: '(' inside_paren_ann_assign_target ')' | ann_assign_subscript_attribute_target +static void * +_tmp_11_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '(' inside_paren_ann_assign_target ')' + expr_ty b; + void *literal; + void *literal_1; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (b = inside_paren_ann_assign_target_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = b; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ann_assign_subscript_attribute_target + expr_ty ann_assign_subscript_attribute_target_var; + if ( + (ann_assign_subscript_attribute_target_var = ann_assign_subscript_attribute_target_rule(p)) + ) + { + res = ann_assign_subscript_attribute_target_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_12: '=' annotated_rhs +static void * +_tmp_12_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '=' annotated_rhs + expr_ty d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 22)) + && + (d = annotated_rhs_rule(p)) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_13: (star_targets '=') +static asdl_seq * +_loop1_13_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // (star_targets '=') + void *_tmp_123_var; + while ( + (_tmp_123_var = _tmp_123_rule(p)) + ) + { + res = _tmp_123_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_13"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_13_type, seq); + return seq; +} + +// _tmp_14: yield_expr | star_expressions +static void * +_tmp_14_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // yield_expr + expr_ty yield_expr_var; + if ( + (yield_expr_var = yield_expr_rule(p)) + ) + { + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_15: yield_expr | star_expressions +static void * +_tmp_15_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // yield_expr + expr_ty yield_expr_var; + if ( + (yield_expr_var = yield_expr_rule(p)) + ) + { + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_17: ',' NAME +static asdl_seq * +_loop0_17_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' NAME + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = _PyPegen_name_token(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_17"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_17_type, seq); + return seq; +} + +// _gather_16: NAME _loop0_17 +static asdl_seq * +_gather_16_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // NAME _loop0_17 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = _PyPegen_name_token(p)) + && + (seq = _loop0_17_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_19: ',' NAME +static asdl_seq * +_loop0_19_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' NAME + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = _PyPegen_name_token(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_19"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_19_type, seq); + return seq; +} + +// _gather_18: NAME _loop0_19 +static asdl_seq * +_gather_18_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // NAME _loop0_19 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = _PyPegen_name_token(p)) + && + (seq = _loop0_19_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_20: ',' expression +static void * +_tmp_20_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' expression + void *literal; + expr_ty z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = expression_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_21: ('.' | '...') +static asdl_seq * +_loop0_21_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('.' | '...') + void *_tmp_124_var; + while ( + (_tmp_124_var = _tmp_124_rule(p)) + ) + { + res = _tmp_124_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_21"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_21_type, seq); + return seq; +} + +// _loop1_22: ('.' | '...') +static asdl_seq * +_loop1_22_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('.' | '...') + void *_tmp_125_var; + while ( + (_tmp_125_var = _tmp_125_rule(p)) + ) + { + res = _tmp_125_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_22"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_22_type, seq); + return seq; +} + +// _loop0_24: ',' import_from_as_name +static asdl_seq * +_loop0_24_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' import_from_as_name + alias_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = import_from_as_name_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_24"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_24_type, seq); + return seq; +} + +// _gather_23: import_from_as_name _loop0_24 +static asdl_seq * +_gather_23_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // import_from_as_name _loop0_24 + alias_ty elem; + asdl_seq * seq; + if ( + (elem = import_from_as_name_rule(p)) + && + (seq = _loop0_24_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_25: 'as' NAME +static void * +_tmp_25_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'as' NAME + void *keyword; + expr_ty z; + if ( + (keyword = _PyPegen_expect_token(p, 531)) + && + (z = _PyPegen_name_token(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_27: ',' dotted_as_name +static asdl_seq * +_loop0_27_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' dotted_as_name + alias_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = dotted_as_name_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_27"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_27_type, seq); + return seq; +} + +// _gather_26: dotted_as_name _loop0_27 +static asdl_seq * +_gather_26_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // dotted_as_name _loop0_27 + alias_ty elem; + asdl_seq * seq; + if ( + (elem = dotted_as_name_rule(p)) + && + (seq = _loop0_27_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_28: 'as' NAME +static void * +_tmp_28_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'as' NAME + void *keyword; + expr_ty z; + if ( + (keyword = _PyPegen_expect_token(p, 531)) + && + (z = _PyPegen_name_token(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_30: ',' with_item +static asdl_seq * +_loop0_30_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' with_item + withitem_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = with_item_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_30"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_30_type, seq); + return seq; +} + +// _gather_29: with_item _loop0_30 +static asdl_seq * +_gather_29_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // with_item _loop0_30 + withitem_ty elem; + asdl_seq * seq; + if ( + (elem = with_item_rule(p)) + && + (seq = _loop0_30_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_32: ',' with_item +static asdl_seq * +_loop0_32_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' with_item + withitem_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = with_item_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_32"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_32_type, seq); + return seq; +} + +// _gather_31: with_item _loop0_32 +static asdl_seq * +_gather_31_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // with_item _loop0_32 + withitem_ty elem; + asdl_seq * seq; + if ( + (elem = with_item_rule(p)) + && + (seq = _loop0_32_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_33: 'as' target +static void * +_tmp_33_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'as' target + void *keyword; + expr_ty t; + if ( + (keyword = _PyPegen_expect_token(p, 531)) + && + (t = target_rule(p)) + ) + { + res = t; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_34: except_block +static asdl_seq * +_loop1_34_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // except_block + excepthandler_ty except_block_var; + while ( + (except_block_var = except_block_rule(p)) + ) + { + res = except_block_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_34"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_34_type, seq); + return seq; +} + +// _tmp_35: 'as' target +static void * +_tmp_35_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'as' target + void *keyword; + expr_ty z; + if ( + (keyword = _PyPegen_expect_token(p, 531)) + && + (z = target_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_36: 'from' expression +static void * +_tmp_36_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'from' expression + void *keyword; + expr_ty z; + if ( + (keyword = _PyPegen_expect_token(p, 514)) + && + (z = expression_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_37: '->' annotation +static void * +_tmp_37_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '->' annotation + void *literal; + expr_ty z; + if ( + (literal = _PyPegen_expect_token(p, 51)) + && + (z = annotation_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_38: ',' plain_names +static void * +_tmp_38_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' plain_names + void *literal; + asdl_seq* x; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (x = plain_names_rule(p)) + ) + { + res = x; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_39: ',' names_with_default +static void * +_tmp_39_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' names_with_default + void *literal; + asdl_seq* y; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (y = names_with_default_rule(p)) + ) + { + res = y; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_40: ',' star_etc? +static void * +_tmp_40_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_41: ',' names_with_default +static void * +_tmp_41_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' names_with_default + void *literal; + asdl_seq* y; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (y = names_with_default_rule(p)) + ) + { + res = y; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_42: ',' star_etc? +static void * +_tmp_42_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_43: ',' names_with_default +static void * +_tmp_43_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' names_with_default + void *literal; + asdl_seq* y; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (y = names_with_default_rule(p)) + ) + { + res = y; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_44: ',' star_etc? +static void * +_tmp_44_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_45: ',' star_etc? +static void * +_tmp_45_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_46: plain_names ',' +static void * +_tmp_46_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // plain_names ',' + void *literal; + asdl_seq* n; + if ( + (n = plain_names_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + ) + { + res = n; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_47: name_with_optional_default +static asdl_seq * +_loop0_47_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // name_with_optional_default + NameDefaultPair* name_with_optional_default_var; + while ( + (name_with_optional_default_var = name_with_optional_default_rule(p)) + ) + { + res = name_with_optional_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_47"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_47_type, seq); + return seq; +} + +// _tmp_48: ',' kwds +static void * +_tmp_48_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' kwds + arg_ty d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (d = kwds_rule(p)) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_49: name_with_optional_default +static asdl_seq * +_loop1_49_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // name_with_optional_default + NameDefaultPair* name_with_optional_default_var; + while ( + (name_with_optional_default_var = name_with_optional_default_rule(p)) + ) + { + res = name_with_optional_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_49"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_49_type, seq); + return seq; +} + +// _tmp_50: ',' kwds +static void * +_tmp_50_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' kwds + arg_ty d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (d = kwds_rule(p)) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_51: '=' expression +static void * +_tmp_51_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '=' expression + expr_ty e; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 22)) + && + (e = expression_rule(p)) + ) + { + res = e; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_53: ',' name_with_default +static asdl_seq * +_loop0_53_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' name_with_default + NameDefaultPair* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = name_with_default_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_53"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_53_type, seq); + return seq; +} + +// _gather_52: name_with_default _loop0_53 +static asdl_seq * +_gather_52_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // name_with_default _loop0_53 + NameDefaultPair* elem; + asdl_seq * seq; + if ( + (elem = name_with_default_rule(p)) + && + (seq = _loop0_53_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_55: ',' (plain_name !'=') +static asdl_seq * +_loop0_55_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' (plain_name !'=') + void *elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = _tmp_126_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_55"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_55_type, seq); + return seq; +} + +// _gather_54: (plain_name !'=') _loop0_55 +static asdl_seq * +_gather_54_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // (plain_name !'=') _loop0_55 + void *elem; + asdl_seq * seq; + if ( + (elem = _tmp_126_rule(p)) + && + (seq = _loop0_55_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_56: ':' annotation +static void * +_tmp_56_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ':' annotation + void *literal; + expr_ty z; + if ( + (literal = _PyPegen_expect_token(p, 11)) + && + (z = annotation_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_57: ('@' named_expression NEWLINE) +static asdl_seq * +_loop1_57_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('@' named_expression NEWLINE) + void *_tmp_127_var; + while ( + (_tmp_127_var = _tmp_127_rule(p)) + ) + { + res = _tmp_127_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_57"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_57_type, seq); + return seq; +} + +// _tmp_58: '(' arguments? ')' +static void * +_tmp_58_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '(' arguments? ')' + void *literal; + void *literal_1; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (z = arguments_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_60: ',' star_expression +static asdl_seq * +_loop0_60_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' star_expression + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = star_expression_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_60"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_60_type, seq); + return seq; +} + +// _gather_59: star_expression _loop0_60 +static asdl_seq * +_gather_59_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // star_expression _loop0_60 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = star_expression_rule(p)) + && + (seq = _loop0_60_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_61: (',' star_expression) +static asdl_seq * +_loop1_61_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // (',' star_expression) + void *_tmp_128_var; + while ( + (_tmp_128_var = _tmp_128_rule(p)) + ) + { + res = _tmp_128_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_61"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_61_type, seq); + return seq; +} + +// _loop0_63: ',' star_named_expression +static asdl_seq * +_loop0_63_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' star_named_expression + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = star_named_expression_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_63"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_63_type, seq); + return seq; +} + +// _gather_62: star_named_expression _loop0_63 +static asdl_seq * +_gather_62_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // star_named_expression _loop0_63 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = star_named_expression_rule(p)) + && + (seq = _loop0_63_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_64: (',' expression) +static asdl_seq * +_loop1_64_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // (',' expression) + void *_tmp_129_var; + while ( + (_tmp_129_var = _tmp_129_rule(p)) + ) + { + res = _tmp_129_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_64"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_64_type, seq); + return seq; +} + +// _tmp_65: ',' lambda_plain_names +static void * +_tmp_65_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_plain_names + void *literal; + asdl_seq* x; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (x = lambda_plain_names_rule(p)) + ) + { + res = x; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_66: ',' lambda_names_with_default +static void * +_tmp_66_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_names_with_default + void *literal; + asdl_seq* y; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (y = lambda_names_with_default_rule(p)) + ) + { + res = y; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_67: ',' lambda_star_etc? +static void * +_tmp_67_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = lambda_star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_68: ',' lambda_names_with_default +static void * +_tmp_68_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_names_with_default + void *literal; + asdl_seq* y; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (y = lambda_names_with_default_rule(p)) + ) + { + res = y; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_69: ',' lambda_star_etc? +static void * +_tmp_69_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = lambda_star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_70: ',' lambda_names_with_default +static void * +_tmp_70_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_names_with_default + void *literal; + asdl_seq* y; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (y = lambda_names_with_default_rule(p)) + ) + { + res = y; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_71: ',' lambda_star_etc? +static void * +_tmp_71_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = lambda_star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_72: ',' lambda_star_etc? +static void * +_tmp_72_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_star_etc? + void *literal; + void *z; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (z = lambda_star_etc_rule(p), 1) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_73: lambda_plain_names ',' +static void * +_tmp_73_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // lambda_plain_names ',' + void *literal; + asdl_seq* n; + if ( + (n = lambda_plain_names_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + ) + { + res = n; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_74: lambda_name_with_optional_default +static asdl_seq * +_loop0_74_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // lambda_name_with_optional_default + NameDefaultPair* lambda_name_with_optional_default_var; + while ( + (lambda_name_with_optional_default_var = lambda_name_with_optional_default_rule(p)) + ) + { + res = lambda_name_with_optional_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_74"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_74_type, seq); + return seq; +} + +// _tmp_75: ',' lambda_kwds +static void * +_tmp_75_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_kwds + arg_ty d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (d = lambda_kwds_rule(p)) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_76: lambda_name_with_optional_default +static asdl_seq * +_loop1_76_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // lambda_name_with_optional_default + NameDefaultPair* lambda_name_with_optional_default_var; + while ( + (lambda_name_with_optional_default_var = lambda_name_with_optional_default_rule(p)) + ) + { + res = lambda_name_with_optional_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_76"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_76_type, seq); + return seq; +} + +// _tmp_77: ',' lambda_kwds +static void * +_tmp_77_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' lambda_kwds + arg_ty d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (d = lambda_kwds_rule(p)) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_78: '=' expression +static void * +_tmp_78_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '=' expression + expr_ty e; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 22)) + && + (e = expression_rule(p)) + ) + { + res = e; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_80: ',' lambda_name_with_default +static asdl_seq * +_loop0_80_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' lambda_name_with_default + NameDefaultPair* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = lambda_name_with_default_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_80"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_80_type, seq); + return seq; +} + +// _gather_79: lambda_name_with_default _loop0_80 +static asdl_seq * +_gather_79_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // lambda_name_with_default _loop0_80 + NameDefaultPair* elem; + asdl_seq * seq; + if ( + (elem = lambda_name_with_default_rule(p)) + && + (seq = _loop0_80_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_82: ',' (lambda_plain_name !'=') +static asdl_seq * +_loop0_82_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' (lambda_plain_name !'=') + void *elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = _tmp_130_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_82"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_82_type, seq); + return seq; +} + +// _gather_81: (lambda_plain_name !'=') _loop0_82 +static asdl_seq * +_gather_81_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // (lambda_plain_name !'=') _loop0_82 + void *elem; + asdl_seq * seq; + if ( + (elem = _tmp_130_rule(p)) + && + (seq = _loop0_82_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_83: ('or' conjunction) +static asdl_seq * +_loop1_83_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('or' conjunction) + void *_tmp_131_var; + while ( + (_tmp_131_var = _tmp_131_rule(p)) + ) + { + res = _tmp_131_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_83"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_83_type, seq); + return seq; +} + +// _loop1_84: ('and' inversion) +static asdl_seq * +_loop1_84_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('and' inversion) + void *_tmp_132_var; + while ( + (_tmp_132_var = _tmp_132_rule(p)) + ) + { + res = _tmp_132_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_84"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_84_type, seq); + return seq; +} + +// _loop1_85: compare_op_bitwise_or_pair +static asdl_seq * +_loop1_85_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // compare_op_bitwise_or_pair + CmpopExprPair* compare_op_bitwise_or_pair_var; + while ( + (compare_op_bitwise_or_pair_var = compare_op_bitwise_or_pair_rule(p)) + ) + { + res = compare_op_bitwise_or_pair_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_85"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_85_type, seq); + return seq; +} + +// _loop0_87: ',' slice +static asdl_seq * +_loop0_87_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' slice + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = slice_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_87"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_87_type, seq); + return seq; +} + +// _gather_86: slice _loop0_87 +static asdl_seq * +_gather_86_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // slice _loop0_87 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = slice_rule(p)) + && + (seq = _loop0_87_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_88: ':' expression? +static void * +_tmp_88_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ':' expression? + void *d; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 11)) + && + (d = expression_rule(p), 1) + ) + { + res = d; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_89: tuple | group | genexp +static void * +_tmp_89_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // tuple + expr_ty tuple_var; + if ( + (tuple_var = tuple_rule(p)) + ) + { + res = tuple_var; + goto done; + } + p->mark = mark; + } + { // group + expr_ty group_var; + if ( + (group_var = group_rule(p)) + ) + { + res = group_var; + goto done; + } + p->mark = mark; + } + { // genexp + expr_ty genexp_var; + if ( + (genexp_var = genexp_rule(p)) + ) + { + res = genexp_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_90: list | listcomp +static void * +_tmp_90_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // list + expr_ty list_var; + if ( + (list_var = list_rule(p)) + ) + { + res = list_var; + goto done; + } + p->mark = mark; + } + { // listcomp + expr_ty listcomp_var; + if ( + (listcomp_var = listcomp_rule(p)) + ) + { + res = listcomp_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_91: dict | set | dictcomp | setcomp +static void * +_tmp_91_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // dict + expr_ty dict_var; + if ( + (dict_var = dict_rule(p)) + ) + { + res = dict_var; + goto done; + } + p->mark = mark; + } + { // set + expr_ty set_var; + if ( + (set_var = set_rule(p)) + ) + { + res = set_var; + goto done; + } + p->mark = mark; + } + { // dictcomp + expr_ty dictcomp_var; + if ( + (dictcomp_var = dictcomp_rule(p)) + ) + { + res = dictcomp_var; + goto done; + } + p->mark = mark; + } + { // setcomp + expr_ty setcomp_var; + if ( + (setcomp_var = setcomp_rule(p)) + ) + { + res = setcomp_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_92: STRING +static asdl_seq * +_loop1_92_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // STRING + expr_ty string_var; + while ( + (string_var = _PyPegen_string_token(p)) + ) + { + res = string_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_92"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_92_type, seq); + return seq; +} + +// _tmp_93: star_named_expression ',' star_named_expressions? +static void * +_tmp_93_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // star_named_expression ',' star_named_expressions? + void *literal; + expr_ty y; + void *z; + if ( + (y = star_named_expression_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (z = star_named_expressions_rule(p), 1) + ) + { + res = _PyPegen_seq_insert_in_front ( p , y , z ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_94: yield_expr | named_expression +static void * +_tmp_94_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // yield_expr + expr_ty yield_expr_var; + if ( + (yield_expr_var = yield_expr_rule(p)) + ) + { + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // named_expression + expr_ty named_expression_var; + if ( + (named_expression_var = named_expression_rule(p)) + ) + { + res = named_expression_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_96: ',' kvpair +static asdl_seq * +_loop0_96_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' kvpair + KeyValuePair* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = kvpair_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_96"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_96_type, seq); + return seq; +} + +// _gather_95: kvpair _loop0_96 +static asdl_seq * +_gather_95_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // kvpair _loop0_96 + KeyValuePair* elem; + asdl_seq * seq; + if ( + (elem = kvpair_rule(p)) + && + (seq = _loop0_96_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop1_97: (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) +static asdl_seq * +_loop1_97_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) + void *_tmp_133_var; + while ( + (_tmp_133_var = _tmp_133_rule(p)) + ) + { + res = _tmp_133_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_97"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_97_type, seq); + return seq; +} + +// _tmp_98: ',' args +static void * +_tmp_98_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' args + expr_ty c; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (c = args_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_99: ',' args +static void * +_tmp_99_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' args + expr_ty c; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (c = args_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_101: ',' kwarg_or_starred +static asdl_seq * +_loop0_101_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' kwarg_or_starred + KeywordOrStarred* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = kwarg_or_starred_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_101"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_101_type, seq); + return seq; +} + +// _gather_100: kwarg_or_starred _loop0_101 +static asdl_seq * +_gather_100_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // kwarg_or_starred _loop0_101 + KeywordOrStarred* elem; + asdl_seq * seq; + if ( + (elem = kwarg_or_starred_rule(p)) + && + (seq = _loop0_101_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_103: ',' kwarg_or_double_starred +static asdl_seq * +_loop0_103_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' kwarg_or_double_starred + KeywordOrStarred* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = kwarg_or_double_starred_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_103"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_103_type, seq); + return seq; +} + +// _gather_102: kwarg_or_double_starred _loop0_103 +static asdl_seq * +_gather_102_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // kwarg_or_double_starred _loop0_103 + KeywordOrStarred* elem; + asdl_seq * seq; + if ( + (elem = kwarg_or_double_starred_rule(p)) + && + (seq = _loop0_103_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_105: ',' kwarg_or_starred +static asdl_seq * +_loop0_105_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' kwarg_or_starred + KeywordOrStarred* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = kwarg_or_starred_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_105"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_105_type, seq); + return seq; +} + +// _gather_104: kwarg_or_starred _loop0_105 +static asdl_seq * +_gather_104_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // kwarg_or_starred _loop0_105 + KeywordOrStarred* elem; + asdl_seq * seq; + if ( + (elem = kwarg_or_starred_rule(p)) + && + (seq = _loop0_105_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_107: ',' kwarg_or_double_starred +static asdl_seq * +_loop0_107_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' kwarg_or_double_starred + KeywordOrStarred* elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = kwarg_or_double_starred_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_107"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_107_type, seq); + return seq; +} + +// _gather_106: kwarg_or_double_starred _loop0_107 +static asdl_seq * +_gather_106_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // kwarg_or_double_starred _loop0_107 + KeywordOrStarred* elem; + asdl_seq * seq; + if ( + (elem = kwarg_or_double_starred_rule(p)) + && + (seq = _loop0_107_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_108: (',' star_target) +static asdl_seq * +_loop0_108_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // (',' star_target) + void *_tmp_134_var; + while ( + (_tmp_134_var = _tmp_134_rule(p)) + ) + { + res = _tmp_134_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_108"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_108_type, seq); + return seq; +} + +// _loop0_110: ',' star_target +static asdl_seq * +_loop0_110_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' star_target + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = star_target_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_110"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_110_type, seq); + return seq; +} + +// _gather_109: star_target _loop0_110 +static asdl_seq * +_gather_109_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // star_target _loop0_110 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = star_target_rule(p)) + && + (seq = _loop0_110_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_111: !'*' star_target +static void * +_tmp_111_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // !'*' star_target + expr_ty star_target_var; + if ( + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 16) + && + (star_target_var = star_target_rule(p)) + ) + { + res = star_target_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_113: ',' del_target +static asdl_seq * +_loop0_113_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' del_target + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = del_target_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_113"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_113_type, seq); + return seq; +} + +// _gather_112: del_target _loop0_113 +static asdl_seq * +_gather_112_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // del_target _loop0_113 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = del_target_rule(p)) + && + (seq = _loop0_113_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_115: ',' target +static asdl_seq * +_loop0_115_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' target + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = target_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_115"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_115_type, seq); + return seq; +} + +// _gather_114: target _loop0_115 +static asdl_seq * +_gather_114_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // target _loop0_115 + expr_ty elem; + asdl_seq * seq; + if ( + (elem = target_rule(p)) + && + (seq = _loop0_115_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_116: args | expression for_if_clauses +static void * +_tmp_116_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // args + expr_ty args_var; + if ( + (args_var = args_rule(p)) + ) + { + res = args_var; + goto done; + } + p->mark = mark; + } + { // expression for_if_clauses + expr_ty expression_var; + asdl_seq* for_if_clauses_var; + if ( + (expression_var = expression_rule(p)) + && + (for_if_clauses_var = for_if_clauses_rule(p)) + ) + { + res = _PyPegen_dummy_name(p, expression_var, for_if_clauses_var); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_117: '=' annotated_rhs +static void * +_tmp_117_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '=' annotated_rhs + expr_ty annotated_rhs_var; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 22)) + && + (annotated_rhs_var = annotated_rhs_rule(p)) + ) + { + res = _PyPegen_dummy_name(p, literal, annotated_rhs_var); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_118: '=' | augassign +static void * +_tmp_118_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '=' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 22)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // augassign + AugOperator* augassign_var; + if ( + (augassign_var = augassign_rule(p)) + ) + { + res = augassign_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_119: yield_expr | star_expressions +static void * +_tmp_119_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // yield_expr + expr_ty yield_expr_var; + if ( + (yield_expr_var = yield_expr_rule(p)) + ) + { + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_120: '[' | '(' | '{' +static void * +_tmp_120_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '[' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 9)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // '(' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 7)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // '{' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 25)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_121: plain_names ',' +static void * +_tmp_121_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // plain_names ',' + void *literal; + asdl_seq* plain_names_var; + if ( + (plain_names_var = plain_names_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + ) + { + res = _PyPegen_dummy_name(p, plain_names_var, literal); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_122: slash_with_default | names_with_default +static void * +_tmp_122_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // slash_with_default + SlashWithDefault* slash_with_default_var; + if ( + (slash_with_default_var = slash_with_default_rule(p)) + ) + { + res = slash_with_default_var; + goto done; + } + p->mark = mark; + } + { // names_with_default + asdl_seq* names_with_default_var; + if ( + (names_with_default_var = names_with_default_rule(p)) + ) + { + res = names_with_default_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_123: star_targets '=' +static void * +_tmp_123_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // star_targets '=' + void *literal; + expr_ty z; + if ( + (z = star_targets_rule(p)) + && + (literal = _PyPegen_expect_token(p, 22)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_124: '.' | '...' +static void * +_tmp_124_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '.' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 23)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // '...' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 52)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_125: '.' | '...' +static void * +_tmp_125_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '.' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 23)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // '...' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 52)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_126: plain_name !'=' +static void * +_tmp_126_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // plain_name !'=' + arg_ty plain_name_var; + if ( + (plain_name_var = plain_name_rule(p)) + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) + ) + { + res = plain_name_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_127: '@' named_expression NEWLINE +static void * +_tmp_127_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '@' named_expression NEWLINE + expr_ty f; + void *literal; + void *newline_var; + if ( + (literal = _PyPegen_expect_token(p, 49)) + && + (f = named_expression_rule(p)) + && + (newline_var = _PyPegen_newline_token(p)) + ) + { + res = f; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_128: ',' star_expression +static void * +_tmp_128_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' star_expression + expr_ty c; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (c = star_expression_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_129: ',' expression +static void * +_tmp_129_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' expression + expr_ty c; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (c = expression_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_130: lambda_plain_name !'=' +static void * +_tmp_130_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // lambda_plain_name !'=' + arg_ty lambda_plain_name_var; + if ( + (lambda_plain_name_var = lambda_plain_name_rule(p)) + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) + ) + { + res = lambda_plain_name_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_131: 'or' conjunction +static void * +_tmp_131_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'or' conjunction + expr_ty c; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 532)) + && + (c = conjunction_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_132: 'and' inversion +static void * +_tmp_132_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'and' inversion + expr_ty c; + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 533)) + && + (c = inversion_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_133: ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* +static void * +_tmp_133_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* + expr_ty a; + expr_ty b; + asdl_seq * c; + void *keyword; + void *keyword_1; + void *y; + if ( + (y = _PyPegen_async_token(p), 1) + && + (keyword = _PyPegen_expect_token(p, 517)) + && + (a = star_targets_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 518)) + && + (b = disjunction_rule(p)) + && + (c = _loop0_135_rule(p)) + ) + { + res = _Py_comprehension ( a , b , c , y != NULL , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_134: ',' star_target +static void * +_tmp_134_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // ',' star_target + expr_ty c; + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 12)) + && + (c = star_target_rule(p)) + ) + { + res = c; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_135: ('if' disjunction) +static asdl_seq * +_loop0_135_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('if' disjunction) + void *_tmp_136_var; + while ( + (_tmp_136_var = _tmp_136_rule(p)) + ) + { + res = _tmp_136_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_135"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_135_type, seq); + return seq; +} + +// _tmp_136: 'if' disjunction +static void * +_tmp_136_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'if' disjunction + void *keyword; + expr_ty z; + if ( + (keyword = _PyPegen_expect_token(p, 510)) + && + (z = disjunction_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +void * +_PyPegen_parse(Parser *p) +{ + // Initialize keywords + p->keywords = reserved_keywords; + p->n_keyword_lists = n_keyword_lists; + + // Run parser + void *result = NULL; + if (p->start_rule == Py_file_input) { + result = file_rule(p); + } else if (p->start_rule == Py_single_input) { + result = interactive_rule(p); + } else if (p->start_rule == Py_eval_input) { + result = eval_rule(p); + } else if (p->start_rule == Py_fstring_input) { + result = fstring_rule(p); + } + + return result; +} + +// The end diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c new file mode 100644 index 0000000000000..41485a9669d68 --- /dev/null +++ b/Parser/pegen/parse_string.c @@ -0,0 +1,1387 @@ +#include + +#include "../tokenizer.h" +#include "pegen.h" +#include "parse_string.h" + +//// STRING HANDLING FUNCTIONS //// + +// These functions are ported directly from Python/ast.c with some modifications +// to account for the use of "Parser *p", the fact that don't have parser nodes +// to pass around and the usage of some specialized APIs present only in this +// file (like "_PyPegen_raise_syntax_error"). + +static int +warn_invalid_escape_sequence(Parser *p, unsigned char first_invalid_escape_char) +{ + PyObject *msg = + PyUnicode_FromFormat("invalid escape sequence \\%c", first_invalid_escape_char); + if (msg == NULL) { + return -1; + } + if (PyErr_WarnExplicitObject(PyExc_DeprecationWarning, msg, p->tok->filename, + p->tok->lineno, NULL, NULL) < 0) { + if (PyErr_ExceptionMatches(PyExc_DeprecationWarning)) { + /* Replace the DeprecationWarning exception with a SyntaxError + to get a more accurate error report */ + PyErr_Clear(); + RAISE_SYNTAX_ERROR("invalid escape sequence \\%c", first_invalid_escape_char); + } + Py_DECREF(msg); + return -1; + } + Py_DECREF(msg); + return 0; +} + +static PyObject * +decode_utf8(const char **sPtr, const char *end) +{ + const char *s, *t; + t = s = *sPtr; + while (s < end && (*s & 0x80)) { + s++; + } + *sPtr = s; + return PyUnicode_DecodeUTF8(t, s - t, NULL); +} + +static PyObject * +decode_unicode_with_escapes(Parser *parser, const char *s, size_t len) +{ + PyObject *v, *u; + char *buf; + char *p; + const char *end; + + /* check for integer overflow */ + if (len > SIZE_MAX / 6) { + return NULL; + } + /* "?" (2 bytes) may become "\U000000E4" (10 bytes), or 1:5 + "\?" (3 bytes) may become "\u005c\U000000E4" (16 bytes), or ~1:6 */ + u = PyBytes_FromStringAndSize((char *)NULL, len * 6); + if (u == NULL) { + return NULL; + } + p = buf = PyBytes_AsString(u); + end = s + len; + while (s < end) { + if (*s == '\\') { + *p++ = *s++; + if (s >= end || *s & 0x80) { + strcpy(p, "u005c"); + p += 5; + if (s >= end) { + break; + } + } + } + if (*s & 0x80) { + PyObject *w; + int kind; + void *data; + Py_ssize_t len, i; + w = decode_utf8(&s, end); + if (w == NULL) { + Py_DECREF(u); + return NULL; + } + kind = PyUnicode_KIND(w); + data = PyUnicode_DATA(w); + len = PyUnicode_GET_LENGTH(w); + for (i = 0; i < len; i++) { + Py_UCS4 chr = PyUnicode_READ(kind, data, i); + sprintf(p, "\\U%08x", chr); + p += 10; + } + /* Should be impossible to overflow */ + assert(p - buf <= PyBytes_GET_SIZE(u)); + Py_DECREF(w); + } + else { + *p++ = *s++; + } + } + len = p - buf; + s = buf; + + const char *first_invalid_escape; + v = _PyUnicode_DecodeUnicodeEscape(s, len, NULL, &first_invalid_escape); + + if (v != NULL && first_invalid_escape != NULL) { + if (warn_invalid_escape_sequence(parser, *first_invalid_escape) < 0) { + /* We have not decref u before because first_invalid_escape points + inside u. */ + Py_XDECREF(u); + Py_DECREF(v); + return NULL; + } + } + Py_XDECREF(u); + return v; +} + +static PyObject * +decode_bytes_with_escapes(Parser *p, const char *s, Py_ssize_t len) +{ + const char *first_invalid_escape; + PyObject *result = _PyBytes_DecodeEscape(s, len, NULL, &first_invalid_escape); + if (result == NULL) { + return NULL; + } + + if (first_invalid_escape != NULL) { + if (warn_invalid_escape_sequence(p, *first_invalid_escape) < 0) { + Py_DECREF(result); + return NULL; + } + } + return result; +} + +/* s must include the bracketing quote characters, and r, b, u, + &/or f prefixes (if any), and embedded escape sequences (if any). + _PyPegen_parsestr parses it, and sets *result to decoded Python string object. + If the string is an f-string, set *fstr and *fstrlen to the unparsed + string object. Return 0 if no errors occurred. */ +int +_PyPegen_parsestr(Parser *p, const char *s, int *bytesmode, int *rawmode, PyObject **result, + const char **fstr, Py_ssize_t *fstrlen) +{ + size_t len; + int quote = Py_CHARMASK(*s); + int fmode = 0; + *bytesmode = 0; + *rawmode = 0; + *result = NULL; + *fstr = NULL; + if (Py_ISALPHA(quote)) { + while (!*bytesmode || !*rawmode) { + if (quote == 'b' || quote == 'B') { + quote = *++s; + *bytesmode = 1; + } + else if (quote == 'u' || quote == 'U') { + quote = *++s; + } + else if (quote == 'r' || quote == 'R') { + quote = *++s; + *rawmode = 1; + } + else if (quote == 'f' || quote == 'F') { + quote = *++s; + fmode = 1; + } + else { + break; + } + } + } + + if (fmode && *bytesmode) { + PyErr_BadInternalCall(); + return -1; + } + if (quote != '\'' && quote != '\"') { + PyErr_BadInternalCall(); + return -1; + } + /* Skip the leading quote char. */ + s++; + len = strlen(s); + if (len > INT_MAX) { + PyErr_SetString(PyExc_OverflowError, "string to parse is too long"); + return -1; + } + if (s[--len] != quote) { + /* Last quote char must match the first. */ + PyErr_BadInternalCall(); + return -1; + } + if (len >= 4 && s[0] == quote && s[1] == quote) { + /* A triple quoted string. We've already skipped one quote at + the start and one at the end of the string. Now skip the + two at the start. */ + s += 2; + len -= 2; + /* And check that the last two match. */ + if (s[--len] != quote || s[--len] != quote) { + PyErr_BadInternalCall(); + return -1; + } + } + + if (fmode) { + /* Just return the bytes. The caller will parse the resulting + string. */ + *fstr = s; + *fstrlen = len; + return 0; + } + + /* Not an f-string. */ + /* Avoid invoking escape decoding routines if possible. */ + *rawmode = *rawmode || strchr(s, '\\') == NULL; + if (*bytesmode) { + /* Disallow non-ASCII characters. */ + const char *ch; + for (ch = s; *ch; ch++) { + if (Py_CHARMASK(*ch) >= 0x80) { + RAISE_SYNTAX_ERROR( + "bytes can only contain ASCII " + "literal characters."); + return -1; + } + } + if (*rawmode) { + *result = PyBytes_FromStringAndSize(s, len); + } + else { + *result = decode_bytes_with_escapes(p, s, len); + } + } + else { + if (*rawmode) { + *result = PyUnicode_DecodeUTF8Stateful(s, len, NULL, NULL); + } + else { + *result = decode_unicode_with_escapes(p, s, len); + } + } + return *result == NULL ? -1 : 0; +} + + + +// FSTRING STUFF + +static void fstring_shift_expr_locations(expr_ty n, int lineno, int col_offset); +static void fstring_shift_argument(expr_ty parent, arg_ty args, int lineno, int col_offset); + + +static inline void shift_expr(expr_ty parent, expr_ty n, int line, int col) { + if (parent->lineno < n->lineno) { + col = 0; + } + fstring_shift_expr_locations(n, line, col); +} + +static inline void shift_arg(expr_ty parent, arg_ty n, int line, int col) { + if (parent->lineno < n->lineno) { + col = 0; + } + fstring_shift_argument(parent, n, line, col); +} + +static void fstring_shift_seq_locations(expr_ty parent, asdl_seq *seq, int lineno, int col_offset) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) { + expr_ty expr = asdl_seq_GET(seq, i); + if (expr == NULL){ + continue; + } + shift_expr(parent, expr, lineno, col_offset); + } +} + +static void fstring_shift_slice_locations(expr_ty parent, expr_ty slice, int lineno, int col_offset) { + switch (slice->kind) { + case Slice_kind: + if (slice->v.Slice.lower) { + shift_expr(parent, slice->v.Slice.lower, lineno, col_offset); + } + if (slice->v.Slice.upper) { + shift_expr(parent, slice->v.Slice.upper, lineno, col_offset); + } + if (slice->v.Slice.step) { + shift_expr(parent, slice->v.Slice.step, lineno, col_offset); + } + break; + case Tuple_kind: + fstring_shift_seq_locations(parent, slice->v.Tuple.elts, lineno, col_offset); + break; + default: + break; + } +} + +static void fstring_shift_comprehension(expr_ty parent, comprehension_ty comp, int lineno, int col_offset) { + shift_expr(parent, comp->target, lineno, col_offset); + shift_expr(parent, comp->iter, lineno, col_offset); + fstring_shift_seq_locations(parent, comp->ifs, lineno, col_offset); +} + +static void fstring_shift_argument(expr_ty parent, arg_ty arg, int lineno, int col_offset) { + if (arg->annotation != NULL){ + shift_expr(parent, arg->annotation, lineno, col_offset); + } + arg->col_offset = arg->col_offset + col_offset; + arg->end_col_offset = arg->end_col_offset + col_offset; + arg->lineno = arg->lineno + lineno; + arg->end_lineno = arg->end_lineno + lineno; +} + +static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int lineno, int col_offset) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->posonlyargs); i < l; i++) { + arg_ty arg = asdl_seq_GET(args->posonlyargs, i); + shift_arg(parent, arg, lineno, col_offset); + } + + for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->args); i < l; i++) { + arg_ty arg = asdl_seq_GET(args->args, i); + shift_arg(parent, arg, lineno, col_offset); + } + + if (args->vararg != NULL) { + shift_arg(parent, args->vararg, lineno, col_offset); + } + + for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->kwonlyargs); i < l; i++) { + arg_ty arg = asdl_seq_GET(args->kwonlyargs, i); + shift_arg(parent, arg, lineno, col_offset); + } + + fstring_shift_seq_locations(parent, args->kw_defaults, lineno, col_offset); + + if (args->kwarg != NULL) { + shift_arg(parent, args->kwarg, lineno, col_offset); + } + + fstring_shift_seq_locations(parent, args->defaults, lineno, col_offset); +} + +static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offset) { + switch (n->kind) { + case BoolOp_kind: + fstring_shift_seq_locations(n, n->v.BoolOp.values, lineno, col_offset); + break; + case NamedExpr_kind: + shift_expr(n, n->v.NamedExpr.target, lineno, col_offset); + shift_expr(n, n->v.NamedExpr.value, lineno, col_offset); + break; + case BinOp_kind: + shift_expr(n, n->v.BinOp.left, lineno, col_offset); + shift_expr(n, n->v.BinOp.right, lineno, col_offset); + break; + case UnaryOp_kind: + shift_expr(n, n->v.UnaryOp.operand, lineno, col_offset); + break; + case Lambda_kind: + fstring_shift_arguments(n, n->v.Lambda.args, lineno, col_offset); + shift_expr(n, n->v.Lambda.body, lineno, col_offset); + break; + case IfExp_kind: + shift_expr(n, n->v.IfExp.test, lineno, col_offset); + shift_expr(n, n->v.IfExp.body, lineno, col_offset); + shift_expr(n, n->v.IfExp.orelse, lineno, col_offset); + break; + case Dict_kind: + fstring_shift_seq_locations(n, n->v.Dict.keys, lineno, col_offset); + fstring_shift_seq_locations(n, n->v.Dict.values, lineno, col_offset); + break; + case Set_kind: + fstring_shift_seq_locations(n, n->v.Set.elts, lineno, col_offset); + break; + case ListComp_kind: + shift_expr(n, n->v.ListComp.elt, lineno, col_offset); + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.ListComp.generators); i < l; i++) { + comprehension_ty comp = asdl_seq_GET(n->v.ListComp.generators, i); + fstring_shift_comprehension(n, comp, lineno, col_offset); + } + break; + case SetComp_kind: + shift_expr(n, n->v.SetComp.elt, lineno, col_offset); + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.SetComp.generators); i < l; i++) { + comprehension_ty comp = asdl_seq_GET(n->v.SetComp.generators, i); + fstring_shift_comprehension(n, comp, lineno, col_offset); + } + break; + case DictComp_kind: + shift_expr(n, n->v.DictComp.key, lineno, col_offset); + shift_expr(n, n->v.DictComp.value, lineno, col_offset); + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.DictComp.generators); i < l; i++) { + comprehension_ty comp = asdl_seq_GET(n->v.DictComp.generators, i); + fstring_shift_comprehension(n, comp, lineno, col_offset); + } + break; + case GeneratorExp_kind: + shift_expr(n, n->v.GeneratorExp.elt, lineno, col_offset); + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.GeneratorExp.generators); i < l; i++) { + comprehension_ty comp = asdl_seq_GET(n->v.GeneratorExp.generators, i); + fstring_shift_comprehension(n, comp, lineno, col_offset); + } + break; + case Await_kind: + shift_expr(n, n->v.Await.value, lineno, col_offset); + break; + case Yield_kind: + shift_expr(n, n->v.Yield.value, lineno, col_offset); + break; + case YieldFrom_kind: + shift_expr(n, n->v.YieldFrom.value, lineno, col_offset); + break; + case Compare_kind: + shift_expr(n, n->v.Compare.left, lineno, col_offset); + fstring_shift_seq_locations(n, n->v.Compare.comparators, lineno, col_offset); + break; + case Call_kind: + shift_expr(n, n->v.Call.func, lineno, col_offset); + fstring_shift_seq_locations(n, n->v.Call.args, lineno, col_offset); + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.Call.keywords); i < l; i++) { + keyword_ty keyword = asdl_seq_GET(n->v.Call.keywords, i); + shift_expr(n, keyword->value, lineno, col_offset); + } + break; + case Attribute_kind: + shift_expr(n, n->v.Attribute.value, lineno, col_offset); + break; + case Subscript_kind: + shift_expr(n, n->v.Subscript.value, lineno, col_offset); + fstring_shift_slice_locations(n, n->v.Subscript.slice, lineno, col_offset); + shift_expr(n, n->v.Subscript.slice, lineno, col_offset); + break; + case Starred_kind: + shift_expr(n, n->v.Starred.value, lineno, col_offset); + break; + case List_kind: + fstring_shift_seq_locations(n, n->v.List.elts, lineno, col_offset); + break; + case Tuple_kind: + fstring_shift_seq_locations(n, n->v.Tuple.elts, lineno, col_offset); + break; + default: + return; + } +} + +/* Shift locations for the given node and all its children by adding `lineno` + and `col_offset` to existing locations. Note that n is the already parsed + expression. */ +static void fstring_shift_expr_locations(expr_ty n, int lineno, int col_offset) +{ + n->col_offset = n->col_offset + col_offset; + + // The following is needed, in order for nodes spanning across multiple lines + // to be shifted correctly. An example of such a node is a Call node, the closing + // parenthesis of which is not on the same line as its name. + if (n->lineno == n->end_lineno) { + n->end_col_offset = n->end_col_offset + col_offset; + } + + fstring_shift_children_locations(n, lineno, col_offset); + n->lineno = n->lineno + lineno; + n->end_lineno = n->end_lineno + lineno; +} + +/* Fix locations for the given node and its children. + + `parent` is the enclosing node. + `n` is the node which locations are going to be fixed relative to parent. + `expr_str` is the child node's string representation, including braces. +*/ +static void +fstring_fix_expr_location(Token *parent, expr_ty n, char *expr_str) +{ + char *substr = NULL; + char *start; + int lines = 0; + int cols = 0; + + if (parent && parent->bytes) { + char *parent_str = PyBytes_AsString(parent->bytes); + if (!parent_str) { + return; + } + substr = strstr(parent_str, expr_str); + if (substr) { + // The following is needed, in order to correctly shift the column + // offset, in the case that (disregarding any whitespace) a newline + // immediately follows the opening curly brace of the fstring expression. + int newline_after_brace = 1; + start = substr + 1; + while (start && *start != '}' && *start != '\n') { + if (*start != ' ' && *start != '\t' && *start != '\f') { + newline_after_brace = 0; + break; + } + start++; + } + + // Account for the characters from the last newline character to our + // left until the beginning of substr. + if (!newline_after_brace) { + start = substr; + while (start > parent_str && *start != '\n') { + start--; + } + cols += (int)(substr - start); + } + /* adjust the start based on the number of newlines encountered + before the f-string expression */ + for (char* p = parent_str; p < substr; p++) { + if (*p == '\n') { + lines++; + } + } + } + } + fstring_shift_expr_locations(n, lines, cols); +} + + +/* Compile this expression in to an expr_ty. Add parens around the + expression, in order to allow leading spaces in the expression. */ +static expr_ty +fstring_compile_expr(Parser *p, const char *expr_start, const char *expr_end, + Token *t) +{ + expr_ty expr = NULL; + char *str; + Py_ssize_t len; + const char *s; + expr_ty result = NULL; + + assert(expr_end >= expr_start); + assert(*(expr_start-1) == '{'); + assert(*expr_end == '}' || *expr_end == '!' || *expr_end == ':' || + *expr_end == '='); + + /* If the substring is all whitespace, it's an error. We need to catch this + here, and not when we call PyParser_SimpleParseStringFlagsFilename, + because turning the expression '' in to '()' would go from being invalid + to valid. */ + for (s = expr_start; s != expr_end; s++) { + char c = *s; + /* The Python parser ignores only the following whitespace + characters (\r already is converted to \n). */ + if (!(c == ' ' || c == '\t' || c == '\n' || c == '\f')) { + break; + } + } + if (s == expr_end) { + RAISE_SYNTAX_ERROR("f-string: empty expression not allowed"); + return NULL; + } + + len = expr_end - expr_start; + /* Allocate 3 extra bytes: open paren, close paren, null byte. */ + str = PyMem_RawMalloc(len + 3); + if (str == NULL) { + PyErr_NoMemory(); + return NULL; + } + + str[0] = '('; + memcpy(str+1, expr_start, len); + str[len+1] = ')'; + str[len+2] = 0; + + struct tok_state* tok = PyTokenizer_FromString(str, 1); + if (tok == NULL) { + return NULL; + } + tok->filename = PyUnicode_FromString(""); + if (!tok->filename) { + PyTokenizer_Free(tok); + return NULL; + } + + Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, NULL, p->arena); + p2->starting_lineno = p->starting_lineno + p->tok->first_lineno - 1; + p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno + ? p->starting_col_offset + t->col_offset : 0; + + expr = _PyPegen_run_parser(p2); + + if (expr == NULL) { + goto exit; + } + + /* Reuse str to find the correct column offset. */ + str[0] = '{'; + str[len+1] = '}'; + fstring_fix_expr_location(t, expr, str); + + result = expr; + +exit: + _PyPegen_Parser_Free(p2); + PyTokenizer_Free(tok); + return result; +} + +/* Return -1 on error. + + Return 0 if we reached the end of the literal. + + Return 1 if we haven't reached the end of the literal, but we want + the caller to process the literal up to this point. Used for + doubled braces. +*/ +static int +fstring_find_literal(Parser *p, const char **str, const char *end, int raw, + PyObject **literal, int recurse_lvl) +{ + /* Get any literal string. It ends when we hit an un-doubled left + brace (which isn't part of a unicode name escape such as + "\N{EULER CONSTANT}"), or the end of the string. */ + + const char *s = *str; + const char *literal_start = s; + int result = 0; + + assert(*literal == NULL); + while (s < end) { + char ch = *s++; + if (!raw && ch == '\\' && s < end) { + ch = *s++; + if (ch == 'N') { + if (s < end && *s++ == '{') { + while (s < end && *s++ != '}') { + } + continue; + } + break; + } + if (ch == '{' && warn_invalid_escape_sequence(p, ch) < 0) { + return -1; + } + } + if (ch == '{' || ch == '}') { + /* Check for doubled braces, but only at the top level. If + we checked at every level, then f'{0:{3}}' would fail + with the two closing braces. */ + if (recurse_lvl == 0) { + if (s < end && *s == ch) { + /* We're going to tell the caller that the literal ends + here, but that they should continue scanning. But also + skip over the second brace when we resume scanning. */ + *str = s + 1; + result = 1; + goto done; + } + + /* Where a single '{' is the start of a new expression, a + single '}' is not allowed. */ + if (ch == '}') { + *str = s - 1; + RAISE_SYNTAX_ERROR("f-string: single '}' is not allowed"); + return -1; + } + } + /* We're either at a '{', which means we're starting another + expression; or a '}', which means we're at the end of this + f-string (for a nested format_spec). */ + s--; + break; + } + } + *str = s; + assert(s <= end); + assert(s == end || *s == '{' || *s == '}'); +done: + if (literal_start != s) { + if (raw) + *literal = PyUnicode_DecodeUTF8Stateful(literal_start, + s - literal_start, + NULL, NULL); + else + *literal = decode_unicode_with_escapes(p, literal_start, + s - literal_start); + if (!*literal) + return -1; + } + return result; +} + +/* Forward declaration because parsing is recursive. */ +static expr_ty +fstring_parse(Parser *p, const char **str, const char *end, int raw, int recurse_lvl, + Token *first_token, Token* t, Token *last_token); + +/* Parse the f-string at *str, ending at end. We know *str starts an + expression (so it must be a '{'). Returns the FormattedValue node, which + includes the expression, conversion character, format_spec expression, and + optionally the text of the expression (if = is used). + + Note that I don't do a perfect job here: I don't make sure that a + closing brace doesn't match an opening paren, for example. It + doesn't need to error on all invalid expressions, just correctly + find the end of all valid ones. Any errors inside the expression + will be caught when we parse it later. + + *expression is set to the expression. For an '=' "debug" expression, + *expr_text is set to the debug text (the original text of the expression, + including the '=' and any whitespace around it, as a string object). If + not a debug expression, *expr_text set to NULL. */ +static int +fstring_find_expr(Parser *p, const char **str, const char *end, int raw, int recurse_lvl, + PyObject **expr_text, expr_ty *expression, Token *first_token, + Token *t, Token *last_token) +{ + /* Return -1 on error, else 0. */ + + const char *expr_start; + const char *expr_end; + expr_ty simple_expression; + expr_ty format_spec = NULL; /* Optional format specifier. */ + int conversion = -1; /* The conversion char. Use default if not + specified, or !r if using = and no format + spec. */ + + /* 0 if we're not in a string, else the quote char we're trying to + match (single or double quote). */ + char quote_char = 0; + + /* If we're inside a string, 1=normal, 3=triple-quoted. */ + int string_type = 0; + + /* Keep track of nesting level for braces/parens/brackets in + expressions. */ + Py_ssize_t nested_depth = 0; + char parenstack[MAXLEVEL]; + + *expr_text = NULL; + + /* Can only nest one level deep. */ + if (recurse_lvl >= 2) { + RAISE_SYNTAX_ERROR("f-string: expressions nested too deeply"); + goto error; + } + + /* The first char must be a left brace, or we wouldn't have gotten + here. Skip over it. */ + assert(**str == '{'); + *str += 1; + + expr_start = *str; + for (; *str < end; (*str)++) { + char ch; + + /* Loop invariants. */ + assert(nested_depth >= 0); + assert(*str >= expr_start && *str < end); + if (quote_char) + assert(string_type == 1 || string_type == 3); + else + assert(string_type == 0); + + ch = **str; + /* Nowhere inside an expression is a backslash allowed. */ + if (ch == '\\') { + /* Error: can't include a backslash character, inside + parens or strings or not. */ + RAISE_SYNTAX_ERROR( + "f-string expression part " + "cannot include a backslash"); + goto error; + } + if (quote_char) { + /* We're inside a string. See if we're at the end. */ + /* This code needs to implement the same non-error logic + as tok_get from tokenizer.c, at the letter_quote + label. To actually share that code would be a + nightmare. But, it's unlikely to change and is small, + so duplicate it here. Note we don't need to catch all + of the errors, since they'll be caught when parsing the + expression. We just need to match the non-error + cases. Thus we can ignore \n in single-quoted strings, + for example. Or non-terminated strings. */ + if (ch == quote_char) { + /* Does this match the string_type (single or triple + quoted)? */ + if (string_type == 3) { + if (*str+2 < end && *(*str+1) == ch && *(*str+2) == ch) { + /* We're at the end of a triple quoted string. */ + *str += 2; + string_type = 0; + quote_char = 0; + continue; + } + } else { + /* We're at the end of a normal string. */ + quote_char = 0; + string_type = 0; + continue; + } + } + } else if (ch == '\'' || ch == '"') { + /* Is this a triple quoted string? */ + if (*str+2 < end && *(*str+1) == ch && *(*str+2) == ch) { + string_type = 3; + *str += 2; + } else { + /* Start of a normal string. */ + string_type = 1; + } + /* Start looking for the end of the string. */ + quote_char = ch; + } else if (ch == '[' || ch == '{' || ch == '(') { + if (nested_depth >= MAXLEVEL) { + RAISE_SYNTAX_ERROR("f-string: too many nested parenthesis"); + goto error; + } + parenstack[nested_depth] = ch; + nested_depth++; + } else if (ch == '#') { + /* Error: can't include a comment character, inside parens + or not. */ + RAISE_SYNTAX_ERROR("f-string expression part cannot include '#'"); + goto error; + } else if (nested_depth == 0 && + (ch == '!' || ch == ':' || ch == '}' || + ch == '=' || ch == '>' || ch == '<')) { + /* See if there's a next character. */ + if (*str+1 < end) { + char next = *(*str+1); + + /* For "!=". since '=' is not an allowed conversion character, + nothing is lost in this test. */ + if ((ch == '!' && next == '=') || /* != */ + (ch == '=' && next == '=') || /* == */ + (ch == '<' && next == '=') || /* <= */ + (ch == '>' && next == '=') /* >= */ + ) { + *str += 1; + continue; + } + /* Don't get out of the loop for these, if they're single + chars (not part of 2-char tokens). If by themselves, they + don't end an expression (unlike say '!'). */ + if (ch == '>' || ch == '<') { + continue; + } + } + + /* Normal way out of this loop. */ + break; + } else if (ch == ']' || ch == '}' || ch == ')') { + if (!nested_depth) { + RAISE_SYNTAX_ERROR("f-string: unmatched '%c'", ch); + goto error; + } + nested_depth--; + int opening = parenstack[nested_depth]; + if (!((opening == '(' && ch == ')') || + (opening == '[' && ch == ']') || + (opening == '{' && ch == '}'))) + { + RAISE_SYNTAX_ERROR( + "f-string: closing parenthesis '%c' " + "does not match opening parenthesis '%c'", + ch, opening); + goto error; + } + } else { + /* Just consume this char and loop around. */ + } + } + expr_end = *str; + /* If we leave this loop in a string or with mismatched parens, we + don't care. We'll get a syntax error when compiling the + expression. But, we can produce a better error message, so + let's just do that.*/ + if (quote_char) { + RAISE_SYNTAX_ERROR("f-string: unterminated string"); + goto error; + } + if (nested_depth) { + int opening = parenstack[nested_depth - 1]; + RAISE_SYNTAX_ERROR("f-string: unmatched '%c'", opening); + goto error; + } + + if (*str >= end) + goto unexpected_end_of_string; + + /* Compile the expression as soon as possible, so we show errors + related to the expression before errors related to the + conversion or format_spec. */ + simple_expression = fstring_compile_expr(p, expr_start, expr_end, t); + if (!simple_expression) + goto error; + + /* Check for =, which puts the text value of the expression in + expr_text. */ + if (**str == '=') { + *str += 1; + + /* Skip over ASCII whitespace. No need to test for end of string + here, since we know there's at least a trailing quote somewhere + ahead. */ + while (Py_ISSPACE(**str)) { + *str += 1; + } + + /* Set *expr_text to the text of the expression. */ + *expr_text = PyUnicode_FromStringAndSize(expr_start, *str-expr_start); + if (!*expr_text) { + goto error; + } + } + + /* Check for a conversion char, if present. */ + if (**str == '!') { + *str += 1; + if (*str >= end) + goto unexpected_end_of_string; + + conversion = **str; + *str += 1; + + /* Validate the conversion. */ + if (!(conversion == 's' || conversion == 'r' || conversion == 'a')) { + RAISE_SYNTAX_ERROR( + "f-string: invalid conversion character: " + "expected 's', 'r', or 'a'"); + goto error; + } + + } + + /* Check for the format spec, if present. */ + if (*str >= end) + goto unexpected_end_of_string; + if (**str == ':') { + *str += 1; + if (*str >= end) + goto unexpected_end_of_string; + + /* Parse the format spec. */ + format_spec = fstring_parse(p, str, end, raw, recurse_lvl+1, + first_token, t, last_token); + if (!format_spec) + goto error; + } + + if (*str >= end || **str != '}') + goto unexpected_end_of_string; + + /* We're at a right brace. Consume it. */ + assert(*str < end); + assert(**str == '}'); + *str += 1; + + /* If we're in = mode (detected by non-NULL expr_text), and have no format + spec and no explicit conversion, set the conversion to 'r'. */ + if (*expr_text && format_spec == NULL && conversion == -1) { + conversion = 'r'; + } + + /* And now create the FormattedValue node that represents this + entire expression with the conversion and format spec. */ + //TODO: Fix this + *expression = FormattedValue(simple_expression, conversion, + format_spec, first_token->lineno, + first_token->col_offset, last_token->end_lineno, + last_token->end_col_offset, p->arena); + if (!*expression) + goto error; + + return 0; + +unexpected_end_of_string: + RAISE_SYNTAX_ERROR("f-string: expecting '}'"); + /* Falls through to error. */ + +error: + Py_XDECREF(*expr_text); + return -1; + +} + +/* Return -1 on error. + + Return 0 if we have a literal (possible zero length) and an + expression (zero length if at the end of the string. + + Return 1 if we have a literal, but no expression, and we want the + caller to call us again. This is used to deal with doubled + braces. + + When called multiple times on the string 'a{{b{0}c', this function + will return: + + 1. the literal 'a{' with no expression, and a return value + of 1. Despite the fact that there's no expression, the return + value of 1 means we're not finished yet. + + 2. the literal 'b' and the expression '0', with a return value of + 0. The fact that there's an expression means we're not finished. + + 3. literal 'c' with no expression and a return value of 0. The + combination of the return value of 0 with no expression means + we're finished. +*/ +static int +fstring_find_literal_and_expr(Parser *p, const char **str, const char *end, int raw, + int recurse_lvl, PyObject **literal, + PyObject **expr_text, expr_ty *expression, + Token *first_token, Token *t, Token *last_token) +{ + int result; + + assert(*literal == NULL && *expression == NULL); + + /* Get any literal string. */ + result = fstring_find_literal(p, str, end, raw, literal, recurse_lvl); + if (result < 0) + goto error; + + assert(result == 0 || result == 1); + + if (result == 1) + /* We have a literal, but don't look at the expression. */ + return 1; + + if (*str >= end || **str == '}') + /* We're at the end of the string or the end of a nested + f-string: no expression. The top-level error case where we + expect to be at the end of the string but we're at a '}' is + handled later. */ + return 0; + + /* We must now be the start of an expression, on a '{'. */ + assert(**str == '{'); + + if (fstring_find_expr(p, str, end, raw, recurse_lvl, expr_text, + expression, first_token, t, last_token) < 0) + goto error; + + return 0; + +error: + Py_CLEAR(*literal); + return -1; +} + +#ifdef NDEBUG +#define ExprList_check_invariants(l) +#else +static void +ExprList_check_invariants(ExprList *l) +{ + /* Check our invariants. Make sure this object is "live", and + hasn't been deallocated. */ + assert(l->size >= 0); + assert(l->p != NULL); + if (l->size <= EXPRLIST_N_CACHED) + assert(l->data == l->p); +} +#endif + +static void +ExprList_Init(ExprList *l) +{ + l->allocated = EXPRLIST_N_CACHED; + l->size = 0; + + /* Until we start allocating dynamically, p points to data. */ + l->p = l->data; + + ExprList_check_invariants(l); +} + +static int +ExprList_Append(ExprList *l, expr_ty exp) +{ + ExprList_check_invariants(l); + if (l->size >= l->allocated) { + /* We need to alloc (or realloc) the memory. */ + Py_ssize_t new_size = l->allocated * 2; + + /* See if we've ever allocated anything dynamically. */ + if (l->p == l->data) { + Py_ssize_t i; + /* We're still using the cached data. Switch to + alloc-ing. */ + l->p = PyMem_RawMalloc(sizeof(expr_ty) * new_size); + if (!l->p) + return -1; + /* Copy the cached data into the new buffer. */ + for (i = 0; i < l->size; i++) + l->p[i] = l->data[i]; + } else { + /* Just realloc. */ + expr_ty *tmp = PyMem_RawRealloc(l->p, sizeof(expr_ty) * new_size); + if (!tmp) { + PyMem_RawFree(l->p); + l->p = NULL; + return -1; + } + l->p = tmp; + } + + l->allocated = new_size; + assert(l->allocated == 2 * l->size); + } + + l->p[l->size++] = exp; + + ExprList_check_invariants(l); + return 0; +} + +static void +ExprList_Dealloc(ExprList *l) +{ + ExprList_check_invariants(l); + + /* If there's been an error, or we've never dynamically allocated, + do nothing. */ + if (!l->p || l->p == l->data) { + /* Do nothing. */ + } else { + /* We have dynamically allocated. Free the memory. */ + PyMem_RawFree(l->p); + } + l->p = NULL; + l->size = -1; +} + +static asdl_seq * +ExprList_Finish(ExprList *l, PyArena *arena) +{ + asdl_seq *seq; + + ExprList_check_invariants(l); + + /* Allocate the asdl_seq and copy the expressions in to it. */ + seq = _Py_asdl_seq_new(l->size, arena); + if (seq) { + Py_ssize_t i; + for (i = 0; i < l->size; i++) + asdl_seq_SET(seq, i, l->p[i]); + } + ExprList_Dealloc(l); + return seq; +} + +#ifdef NDEBUG +#define FstringParser_check_invariants(state) +#else +static void +FstringParser_check_invariants(FstringParser *state) +{ + if (state->last_str) + assert(PyUnicode_CheckExact(state->last_str)); + ExprList_check_invariants(&state->expr_list); +} +#endif + +void +_PyPegen_FstringParser_Init(FstringParser *state) +{ + state->last_str = NULL; + state->fmode = 0; + ExprList_Init(&state->expr_list); + FstringParser_check_invariants(state); +} + +void +_PyPegen_FstringParser_Dealloc(FstringParser *state) +{ + FstringParser_check_invariants(state); + + Py_XDECREF(state->last_str); + ExprList_Dealloc(&state->expr_list); +} + +/* Make a Constant node, but decref the PyUnicode object being added. */ +static expr_ty +make_str_node_and_del(Parser *p, PyObject **str, Token* first_token, Token *last_token) +{ + PyObject *s = *str; + PyObject *kind = NULL; + *str = NULL; + assert(PyUnicode_CheckExact(s)); + if (PyArena_AddPyObject(p->arena, s) < 0) { + Py_DECREF(s); + return NULL; + } + const char* the_str = PyBytes_AsString(first_token->bytes); + if (the_str && the_str[0] == 'u') { + kind = _PyPegen_new_identifier(p, "u"); + } + + if (kind == NULL && PyErr_Occurred()) { + return NULL; + } + + return Constant(s, kind, first_token->lineno, first_token->col_offset, + last_token->end_lineno, last_token->end_col_offset, p->arena); + +} + + +/* Add a non-f-string (that is, a regular literal string). str is + decref'd. */ +int +_PyPegen_FstringParser_ConcatAndDel(FstringParser *state, PyObject *str) +{ + FstringParser_check_invariants(state); + + assert(PyUnicode_CheckExact(str)); + + if (PyUnicode_GET_LENGTH(str) == 0) { + Py_DECREF(str); + return 0; + } + + if (!state->last_str) { + /* We didn't have a string before, so just remember this one. */ + state->last_str = str; + } else { + /* Concatenate this with the previous string. */ + PyUnicode_AppendAndDel(&state->last_str, str); + if (!state->last_str) + return -1; + } + FstringParser_check_invariants(state); + return 0; +} + +/* Parse an f-string. The f-string is in *str to end, with no + 'f' or quotes. */ +int +_PyPegen_FstringParser_ConcatFstring(Parser *p, FstringParser *state, const char **str, + const char *end, int raw, int recurse_lvl, + Token *first_token, Token* t, Token *last_token) +{ + FstringParser_check_invariants(state); + state->fmode = 1; + + /* Parse the f-string. */ + while (1) { + PyObject *literal = NULL; + PyObject *expr_text = NULL; + expr_ty expression = NULL; + + /* If there's a zero length literal in front of the + expression, literal will be NULL. If we're at the end of + the f-string, expression will be NULL (unless result == 1, + see below). */ + int result = fstring_find_literal_and_expr(p, str, end, raw, recurse_lvl, + &literal, &expr_text, + &expression, first_token, t, last_token); + if (result < 0) + return -1; + + /* Add the literal, if any. */ + if (literal && _PyPegen_FstringParser_ConcatAndDel(state, literal) < 0) { + Py_XDECREF(expr_text); + return -1; + } + /* Add the expr_text, if any. */ + if (expr_text && _PyPegen_FstringParser_ConcatAndDel(state, expr_text) < 0) { + return -1; + } + + /* We've dealt with the literal and expr_text, their ownership has + been transferred to the state object. Don't look at them again. */ + + /* See if we should just loop around to get the next literal + and expression, while ignoring the expression this + time. This is used for un-doubling braces, as an + optimization. */ + if (result == 1) + continue; + + if (!expression) + /* We're done with this f-string. */ + break; + + /* We know we have an expression. Convert any existing string + to a Constant node. */ + if (!state->last_str) { + /* Do nothing. No previous literal. */ + } else { + /* Convert the existing last_str literal to a Constant node. */ + expr_ty str = make_str_node_and_del(p, &state->last_str, first_token, last_token); + if (!str || ExprList_Append(&state->expr_list, str) < 0) + return -1; + } + + if (ExprList_Append(&state->expr_list, expression) < 0) + return -1; + } + + /* If recurse_lvl is zero, then we must be at the end of the + string. Otherwise, we must be at a right brace. */ + + if (recurse_lvl == 0 && *str < end-1) { + RAISE_SYNTAX_ERROR("f-string: unexpected end of string"); + return -1; + } + if (recurse_lvl != 0 && **str != '}') { + RAISE_SYNTAX_ERROR("f-string: expecting '}'"); + return -1; + } + + FstringParser_check_invariants(state); + return 0; +} + +/* Convert the partial state reflected in last_str and expr_list to an + expr_ty. The expr_ty can be a Constant, or a JoinedStr. */ +expr_ty +_PyPegen_FstringParser_Finish(Parser *p, FstringParser *state, Token* first_token, + Token *last_token) +{ + asdl_seq *seq; + + FstringParser_check_invariants(state); + + /* If we're just a constant string with no expressions, return + that. */ + if (!state->fmode) { + assert(!state->expr_list.size); + if (!state->last_str) { + /* Create a zero length string. */ + state->last_str = PyUnicode_FromStringAndSize(NULL, 0); + if (!state->last_str) + goto error; + } + return make_str_node_and_del(p, &state->last_str, first_token, last_token); + } + + /* Create a Constant node out of last_str, if needed. It will be the + last node in our expression list. */ + if (state->last_str) { + expr_ty str = make_str_node_and_del(p, &state->last_str, first_token, last_token); + if (!str || ExprList_Append(&state->expr_list, str) < 0) + goto error; + } + /* This has already been freed. */ + assert(state->last_str == NULL); + + seq = ExprList_Finish(&state->expr_list, p->arena); + if (!seq) + goto error; + + return _Py_JoinedStr(seq, first_token->lineno, first_token->col_offset, + last_token->end_lineno, last_token->end_col_offset, p->arena); + +error: + _PyPegen_FstringParser_Dealloc(state); + return NULL; +} + +/* Given an f-string (with no 'f' or quotes) that's in *str and ends + at end, parse it into an expr_ty. Return NULL on error. Adjust + str to point past the parsed portion. */ +static expr_ty +fstring_parse(Parser *p, const char **str, const char *end, int raw, + int recurse_lvl, Token *first_token, Token* t, Token *last_token) +{ + FstringParser state; + + _PyPegen_FstringParser_Init(&state); + if (_PyPegen_FstringParser_ConcatFstring(p, &state, str, end, raw, recurse_lvl, + first_token, t, last_token) < 0) { + _PyPegen_FstringParser_Dealloc(&state); + return NULL; + } + + return _PyPegen_FstringParser_Finish(p, &state, t, t); +} diff --git a/Parser/pegen/parse_string.h b/Parser/pegen/parse_string.h new file mode 100644 index 0000000000000..4f2aa94fc19b0 --- /dev/null +++ b/Parser/pegen/parse_string.h @@ -0,0 +1,46 @@ +#ifndef STRINGS_H +#define STRINGS_H + +#include +#include +#include "pegen.h" + +#define EXPRLIST_N_CACHED 64 + +typedef struct { + /* Incrementally build an array of expr_ty, so be used in an + asdl_seq. Cache some small but reasonably sized number of + expr_ty's, and then after that start dynamically allocating, + doubling the number allocated each time. Note that the f-string + f'{0}a{1}' contains 3 expr_ty's: 2 FormattedValue's, and one + Constant for the literal 'a'. So you add expr_ty's about twice as + fast as you add expressions in an f-string. */ + + Py_ssize_t allocated; /* Number we've allocated. */ + Py_ssize_t size; /* Number we've used. */ + expr_ty *p; /* Pointer to the memory we're actually + using. Will point to 'data' until we + start dynamically allocating. */ + expr_ty data[EXPRLIST_N_CACHED]; +} ExprList; + +/* The FstringParser is designed to add a mix of strings and + f-strings, and concat them together as needed. Ultimately, it + generates an expr_ty. */ +typedef struct { + PyObject *last_str; + ExprList expr_list; + int fmode; +} FstringParser; + +void _PyPegen_FstringParser_Init(FstringParser *); +int _PyPegen_parsestr(Parser *, const char *, int *, int *, PyObject **, + const char **, Py_ssize_t *); +int _PyPegen_FstringParser_ConcatFstring(Parser *, FstringParser *, const char **, + const char *, int, int, Token *, Token *, + Token *); +int _PyPegen_FstringParser_ConcatAndDel(FstringParser *, PyObject *); +expr_ty _PyPegen_FstringParser_Finish(Parser *, FstringParser *, Token *, Token *); +void _PyPegen_FstringParser_Dealloc(FstringParser *); + +#endif diff --git a/Parser/pegen/peg_api.c b/Parser/pegen/peg_api.c new file mode 100644 index 0000000000000..7c6903cdd9334 --- /dev/null +++ b/Parser/pegen/peg_api.c @@ -0,0 +1,134 @@ +#include + +#include "../tokenizer.h" +#include "pegen.h" + +mod_ty +PyPegen_ASTFromString(const char *str, int mode, PyCompilerFlags *flags, PyArena *arena) +{ + PyObject *filename_ob = PyUnicode_FromString(""); + if (filename_ob == NULL) { + return NULL; + } + mod_ty result = PyPegen_ASTFromStringObject(str, filename_ob, mode, flags, arena); + Py_XDECREF(filename_ob); + return result; +} + +mod_ty +PyPegen_ASTFromStringObject(const char *str, PyObject* filename, int mode, PyCompilerFlags *flags, PyArena *arena) +{ + if (PySys_Audit("compile", "yO", str, filename) < 0) { + return NULL; + } + + int iflags = flags != NULL ? flags->cf_flags : PyCF_IGNORE_COOKIE; + mod_ty result = _PyPegen_run_parser_from_string(str, mode, filename, iflags, arena); + return result; +} + +mod_ty +PyPegen_ASTFromFile(const char *filename, int mode, PyArena *arena) +{ + PyObject *filename_ob = PyUnicode_FromString(filename); + if (filename_ob == NULL) { + return NULL; + } + + mod_ty result = _PyPegen_run_parser_from_file(filename, mode, filename_ob, arena); + Py_XDECREF(filename_ob); + return result; +} + +mod_ty +PyPegen_ASTFromFileObject(FILE *fp, PyObject *filename_ob, int mode, + const char *enc, const char *ps1, const char* ps2, + int *errcode, PyArena *arena) +{ + if (PySys_Audit("compile", "OO", Py_None, filename_ob) < 0) { + return NULL; + } + return _PyPegen_run_parser_from_file_pointer(fp, mode, filename_ob, enc, ps1, ps2, + errcode, arena); +} + +PyCodeObject * +PyPegen_CodeObjectFromString(const char *str, int mode, PyCompilerFlags *flags) +{ + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyCodeObject *result = NULL; + + PyObject *filename_ob = PyUnicode_FromString(""); + if (filename_ob == NULL) { + goto error; + } + + mod_ty res = PyPegen_ASTFromString(str, mode, flags, arena); + if (res == NULL) { + goto error; + } + + result = PyAST_CompileObject(res, filename_ob, NULL, -1, arena); + +error: + Py_XDECREF(filename_ob); + PyArena_Free(arena); + return result; +} + +PyCodeObject * +PyPegen_CodeObjectFromFile(const char *filename, int mode) +{ + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyCodeObject *result = NULL; + + PyObject *filename_ob = PyUnicode_FromString(filename); + if (filename_ob == NULL) { + goto error; + } + + mod_ty res = PyPegen_ASTFromFile(filename, mode, arena); + if (res == NULL) { + goto error; + } + + result = PyAST_CompileObject(res, filename_ob, NULL, -1, arena); + +error: + Py_XDECREF(filename_ob); + PyArena_Free(arena); + return result; +} + +PyCodeObject * +PyPegen_CodeObjectFromFileObject(FILE *fp, PyObject *filename_ob, int mode, + const char *ps1, const char *ps2, const char *enc, + int *errcode) +{ + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyCodeObject *result = NULL; + + mod_ty res = PyPegen_ASTFromFileObject(fp, filename_ob, mode, enc, ps1, ps2, + errcode, arena); + if (res == NULL) { + goto error; + } + + result = PyAST_CompileObject(res, filename_ob, NULL, -1, arena); + +error: + PyArena_Free(arena); + return result; +} diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c new file mode 100644 index 0000000000000..47b712f262c46 --- /dev/null +++ b/Parser/pegen/pegen.c @@ -0,0 +1,1865 @@ +#include +#include +#include "../tokenizer.h" + +#include "pegen.h" +#include "parse_string.h" + +static int +init_normalization(Parser *p) +{ + PyObject *m = PyImport_ImportModuleNoBlock("unicodedata"); + if (!m) + { + return 0; + } + p->normalize = PyObject_GetAttrString(m, "normalize"); + Py_DECREF(m); + if (!p->normalize) + { + return 0; + } + return 1; +} + +PyObject * +_PyPegen_new_identifier(Parser *p, char *n) +{ + PyObject *id = PyUnicode_DecodeUTF8(n, strlen(n), NULL); + if (!id) { + goto error; + } + /* PyUnicode_DecodeUTF8 should always return a ready string. */ + assert(PyUnicode_IS_READY(id)); + /* Check whether there are non-ASCII characters in the + identifier; if so, normalize to NFKC. */ + if (!PyUnicode_IS_ASCII(id)) + { + PyObject *id2; + if (!p->normalize && !init_normalization(p)) + { + Py_DECREF(id); + goto error; + } + PyObject *form = PyUnicode_InternFromString("NFKC"); + if (form == NULL) + { + Py_DECREF(id); + goto error; + } + PyObject *args[2] = {form, id}; + id2 = _PyObject_FastCall(p->normalize, args, 2); + Py_DECREF(id); + Py_DECREF(form); + if (!id2) { + goto error; + } + if (!PyUnicode_Check(id2)) + { + PyErr_Format(PyExc_TypeError, + "unicodedata.normalize() must return a string, not " + "%.200s", + _PyType_Name(Py_TYPE(id2))); + Py_DECREF(id2); + goto error; + } + id = id2; + } + PyUnicode_InternInPlace(&id); + if (PyArena_AddPyObject(p->arena, id) < 0) + { + Py_DECREF(id); + goto error; + } + return id; + +error: + p->error_indicator = 1; + return NULL; +} + +static PyObject * +_create_dummy_identifier(Parser *p) +{ + return _PyPegen_new_identifier(p, ""); +} + +static inline Py_ssize_t +byte_offset_to_character_offset(PyObject *line, int col_offset) +{ + const char *str = PyUnicode_AsUTF8(line); + PyObject *text = PyUnicode_DecodeUTF8(str, col_offset, NULL); + if (!text) { + return 0; + } + Py_ssize_t size = PyUnicode_GET_LENGTH(text); + Py_DECREF(text); + return size; +} + +const char * +_PyPegen_get_expr_name(expr_ty e) +{ + switch (e->kind) { + case Attribute_kind: + return "attribute"; + case Subscript_kind: + return "subscript"; + case Starred_kind: + return "starred"; + case Name_kind: + return "name"; + case List_kind: + return "list"; + case Tuple_kind: + return "tuple"; + case Lambda_kind: + return "lambda"; + case Call_kind: + return "function call"; + case BoolOp_kind: + case BinOp_kind: + case UnaryOp_kind: + return "operator"; + case GeneratorExp_kind: + return "generator expression"; + case Yield_kind: + case YieldFrom_kind: + return "yield expression"; + case Await_kind: + return "await expression"; + case ListComp_kind: + return "list comprehension"; + case SetComp_kind: + return "set comprehension"; + case DictComp_kind: + return "dict comprehension"; + case Dict_kind: + return "dict display"; + case Set_kind: + return "set display"; + case JoinedStr_kind: + case FormattedValue_kind: + return "f-string expression"; + case Constant_kind: { + PyObject *value = e->v.Constant.value; + if (value == Py_None) { + return "None"; + } + if (value == Py_False) { + return "False"; + } + if (value == Py_True) { + return "True"; + } + if (value == Py_Ellipsis) { + return "Ellipsis"; + } + return "literal"; + } + case Compare_kind: + return "comparison"; + case IfExp_kind: + return "conditional expression"; + case NamedExpr_kind: + return "named expression"; + default: + PyErr_Format(PyExc_SystemError, + "unexpected expression in assignment %d (line %d)", + e->kind, e->lineno); + return NULL; + } +} + +static void +raise_decode_error(Parser *p) +{ + const char *errtype = NULL; + if (PyErr_ExceptionMatches(PyExc_UnicodeError)) { + errtype = "unicode error"; + } + else if (PyErr_ExceptionMatches(PyExc_ValueError)) { + errtype = "value error"; + } + if (errtype) { + PyObject *type, *value, *tback, *errstr; + PyErr_Fetch(&type, &value, &tback); + errstr = PyObject_Str(value); + if (errstr) { + RAISE_SYNTAX_ERROR("(%s) %U", errtype, errstr); + Py_DECREF(errstr); + } + else { + PyErr_Clear(); + RAISE_SYNTAX_ERROR("(%s) unknown error", errtype); + } + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(tback); + } +} + +static void +raise_tokenizer_init_error(PyObject *filename) +{ + if (!(PyErr_ExceptionMatches(PyExc_LookupError) + || PyErr_ExceptionMatches(PyExc_ValueError) + || PyErr_ExceptionMatches(PyExc_UnicodeDecodeError))) { + return; + } + PyObject *type, *value, *tback, *errstr; + PyErr_Fetch(&type, &value, &tback); + errstr = PyObject_Str(value); + + Py_INCREF(Py_None); + PyObject *tmp = Py_BuildValue("(OiiN)", filename, 0, -1, Py_None); + if (!tmp) { + goto error; + } + + value = PyTuple_Pack(2, errstr, tmp); + Py_DECREF(tmp); + if (!value) { + goto error; + } + PyErr_SetObject(PyExc_SyntaxError, value); + +error: + Py_XDECREF(type); + Py_XDECREF(value); + Py_XDECREF(tback); +} + +static inline PyObject * +get_error_line(char *buffer) +{ + char *newline = strchr(buffer, '\n'); + if (newline) { + return PyUnicode_FromStringAndSize(buffer, newline - buffer); + } + else { + return PyUnicode_FromString(buffer); + } +} + +static int +tokenizer_error_with_col_offset(Parser *p, PyObject *errtype, const char *errmsg) +{ + PyObject *errstr = NULL; + PyObject *value = NULL; + int col_number = -1; + + errstr = PyUnicode_FromString(errmsg); + if (!errstr) { + return -1; + } + + PyObject *loc = NULL; + if (p->start_rule == Py_file_input) { + loc = PyErr_ProgramTextObject(p->tok->filename, p->tok->lineno); + } + if (!loc) { + loc = get_error_line(p->tok->buf); + } + + if (loc) { + col_number = p->tok->cur - p->tok->buf; + } + else { + Py_INCREF(Py_None); + loc = Py_None; + } + + PyObject *tmp = Py_BuildValue("(OiiN)", p->tok->filename, p->tok->lineno, + col_number, loc); + if (!tmp) { + goto error; + } + + value = PyTuple_Pack(2, errstr, tmp); + Py_DECREF(tmp); + if (!value) { + goto error; + } + PyErr_SetObject(errtype, value); + + Py_XDECREF(value); + Py_XDECREF(errstr); + return -1; + +error: + Py_XDECREF(errstr); + Py_XDECREF(loc); + return -1; +} + +static int +tokenizer_error(Parser *p) +{ + if (PyErr_Occurred()) { + return -1; + } + + const char *msg = NULL; + PyObject* errtype = PyExc_SyntaxError; + switch (p->tok->done) { + case E_TOKEN: + msg = "invalid token"; + break; + case E_IDENTIFIER: + msg = "invalid character in identifier"; + break; + case E_BADPREFIX: + return tokenizer_error_with_col_offset(p, + PyExc_SyntaxError, "invalid string prefix"); + case E_EOFS: + return tokenizer_error_with_col_offset(p, + PyExc_SyntaxError, "EOF while scanning triple-quoted string literal"); + case E_EOLS: + return tokenizer_error_with_col_offset(p, + PyExc_SyntaxError, "EOL while scanning string literal"); + case E_DEDENT: + return tokenizer_error_with_col_offset(p, + PyExc_IndentationError, "unindent does not match any outer indentation level"); + case E_INTR: + if (!PyErr_Occurred()) { + PyErr_SetNone(PyExc_KeyboardInterrupt); + } + return -1; + case E_NOMEM: + PyErr_NoMemory(); + return -1; + case E_TABSPACE: + errtype = PyExc_TabError; + msg = "inconsistent use of tabs and spaces in indentation"; + break; + case E_TOODEEP: + errtype = PyExc_IndentationError; + msg = "too many levels of indentation"; + break; + case E_DECODE: + raise_decode_error(p); + return -1; + case E_LINECONT: + msg = "unexpected character after line continuation character"; + break; + default: + msg = "unknown parsing error"; + } + + PyErr_Format(errtype, msg); + // There is no reliable column information for this error + PyErr_SyntaxLocationObject(p->tok->filename, p->tok->lineno, 0); + + return -1; +} + +void * +_PyPegen_raise_error(Parser *p, PyObject *errtype, const char *errmsg, ...) +{ + PyObject *value = NULL; + PyObject *errstr = NULL; + PyObject *loc = NULL; + PyObject *tmp = NULL; + Token *t = p->tokens[p->fill - 1]; + Py_ssize_t col_number = 0; + va_list va; + + va_start(va, errmsg); + errstr = PyUnicode_FromFormatV(errmsg, va); + va_end(va); + if (!errstr) { + goto error; + } + + if (p->start_rule == Py_file_input) { + loc = PyErr_ProgramTextObject(p->tok->filename, t->lineno); + } + + if (!loc) { + loc = get_error_line(p->tok->buf); + } + + if (loc) { + int col_offset = t->col_offset == -1 ? 0 : t->col_offset; + col_number = byte_offset_to_character_offset(loc, col_offset) + 1; + } + else { + Py_INCREF(Py_None); + loc = Py_None; + } + + + tmp = Py_BuildValue("(OiiN)", p->tok->filename, t->lineno, col_number, loc); + if (!tmp) { + goto error; + } + value = PyTuple_Pack(2, errstr, tmp); + Py_DECREF(tmp); + if (!value) { + goto error; + } + PyErr_SetObject(errtype, value); + + Py_DECREF(errstr); + Py_DECREF(value); + return NULL; + +error: + Py_XDECREF(errstr); + Py_XDECREF(loc); + return NULL; +} + +void *_PyPegen_arguments_parsing_error(Parser *p, expr_ty e) { + int kwarg_unpacking = 0; + for (Py_ssize_t i = 0, l = asdl_seq_LEN(e->v.Call.keywords); i < l; i++) { + keyword_ty keyword = asdl_seq_GET(e->v.Call.keywords, i); + if (!keyword->arg) { + kwarg_unpacking = 1; + } + } + + const char *msg = NULL; + if (kwarg_unpacking) { + msg = "positional argument follows keyword argument unpacking"; + } else { + msg = "positional argument follows keyword argument"; + } + + return RAISE_SYNTAX_ERROR(msg); +} + +#if 0 +static const char * +token_name(int type) +{ + if (0 <= type && type <= N_TOKENS) { + return _PyParser_TokenNames[type]; + } + return ""; +} +#endif + +// Here, mark is the start of the node, while p->mark is the end. +// If node==NULL, they should be the same. +int +_PyPegen_insert_memo(Parser *p, int mark, int type, void *node) +{ + // Insert in front + Memo *m = PyArena_Malloc(p->arena, sizeof(Memo)); + if (m == NULL) { + return -1; + } + m->type = type; + m->node = node; + m->mark = p->mark; + m->next = p->tokens[mark]->memo; + p->tokens[mark]->memo = m; + return 0; +} + +// Like _PyPegen_insert_memo(), but updates an existing node if found. +int +_PyPegen_update_memo(Parser *p, int mark, int type, void *node) +{ + for (Memo *m = p->tokens[mark]->memo; m != NULL; m = m->next) { + if (m->type == type) { + // Update existing node. + m->node = node; + m->mark = p->mark; + return 0; + } + } + // Insert new node. + return _PyPegen_insert_memo(p, mark, type, node); +} + +// Return dummy NAME. +void * +_PyPegen_dummy_name(Parser *p, ...) +{ + static void *cache = NULL; + + if (cache != NULL) { + return cache; + } + + PyObject *id = _create_dummy_identifier(p); + if (!id) { + return NULL; + } + cache = Name(id, Load, 1, 0, 1, 0, p->arena); + return cache; +} + +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) { + return NAME; + } + for (KeywordToken *k = p->keywords[name_len]; k->type != -1; k++) { + if (strncmp(k->str, name, name_len) == 0) { + return k->type; + } + } + return NAME; +} + +int +_PyPegen_fill_token(Parser *p) +{ + const char *start, *end; + int type = PyTokenizer_Get(p->tok, &start, &end); + if (type == ERRORTOKEN) { + return tokenizer_error(p); + } + if (type == ENDMARKER && p->start_rule == Py_single_input && p->parsing_started) { + type = NEWLINE; /* Add an extra newline */ + p->parsing_started = 0; + + if (p->tok->indent) { + p->tok->pendin = -p->tok->indent; + p->tok->indent = 0; + } + } + else { + p->parsing_started = 1; + } + + if (p->fill == p->size) { + int newsize = p->size * 2; + p->tokens = PyMem_Realloc(p->tokens, newsize * sizeof(Token *)); + if (p->tokens == NULL) { + PyErr_Format(PyExc_MemoryError, "Realloc tokens failed"); + return -1; + } + for (int i = p->size; i < newsize; i++) { + p->tokens[i] = PyMem_Malloc(sizeof(Token)); + memset(p->tokens[i], '\0', sizeof(Token)); + } + p->size = newsize; + } + + Token *t = p->tokens[p->fill]; + t->type = (type == NAME) ? _get_keyword_or_name_type(p, start, (int)(end - start)) : type; + t->bytes = PyBytes_FromStringAndSize(start, end - start); + if (t->bytes == NULL) { + return -1; + } + PyArena_AddPyObject(p->arena, t->bytes); + + int lineno = type == STRING ? p->tok->first_lineno : p->tok->lineno; + const char *line_start = type == STRING ? p->tok->multi_line_start : p->tok->line_start; + int end_lineno = p->tok->lineno; + int col_offset = -1, end_col_offset = -1; + if (start != NULL && start >= line_start) { + col_offset = start - line_start; + } + if (end != NULL && end >= p->tok->line_start) { + end_col_offset = end - p->tok->line_start; + } + + t->lineno = p->starting_lineno + lineno; + t->col_offset = p->tok->lineno == 1 ? p->starting_col_offset + col_offset : col_offset; + t->end_lineno = p->starting_lineno + end_lineno; + t->end_col_offset = p->tok->lineno == 1 ? p->starting_col_offset + end_col_offset : end_col_offset; + + // if (p->fill % 100 == 0) fprintf(stderr, "Filled at %d: %s \"%s\"\n", p->fill, + // token_name(type), PyBytes_AsString(t->bytes)); + p->fill += 1; + return 0; +} + +// Instrumentation to count the effectiveness of memoization. +// The array counts the number of tokens skipped by memoization, +// indexed by type. + +#define NSTATISTICS 2000 +static long memo_statistics[NSTATISTICS]; + +void +_PyPegen_clear_memo_statistics() +{ + for (int i = 0; i < NSTATISTICS; i++) { + memo_statistics[i] = 0; + } +} + +PyObject * +_PyPegen_get_memo_statistics() +{ + PyObject *ret = PyList_New(NSTATISTICS); + if (ret == NULL) { + return NULL; + } + for (int i = 0; i < NSTATISTICS; i++) { + PyObject *value = PyLong_FromLong(memo_statistics[i]); + if (value == NULL) { + Py_DECREF(ret); + return NULL; + } + // PyList_SetItem borrows a reference to value. + if (PyList_SetItem(ret, i, value) < 0) { + Py_DECREF(ret); + return NULL; + } + } + return ret; +} + +int // bool +_PyPegen_is_memoized(Parser *p, int type, void *pres) +{ + if (p->mark == p->fill) { + if (_PyPegen_fill_token(p) < 0) { + return -1; + } + } + + Token *t = p->tokens[p->mark]; + + for (Memo *m = t->memo; m != NULL; m = m->next) { + if (m->type == type) { + if (0 <= type && type < NSTATISTICS) { + long count = m->mark - p->mark; + // A memoized negative result counts for one. + if (count <= 0) { + count = 1; + } + memo_statistics[type] += count; + } + p->mark = m->mark; + *(void **)(pres) = m->node; + // fprintf(stderr, "%d < %d: memoized!\n", p->mark, p->fill); + return 1; + } + } + // fprintf(stderr, "%d < %d: not memoized\n", p->mark, p->fill); + return 0; +} + +int +_PyPegen_lookahead_with_string(int positive, void *(func)(Parser *, const char *), Parser *p, + const char *arg) +{ + int mark = p->mark; + void *res = func(p, arg); + p->mark = mark; + return (res != NULL) == positive; +} + +int +_PyPegen_lookahead_with_int(int positive, Token *(func)(Parser *, int), Parser *p, int arg) +{ + int mark = p->mark; + void *res = func(p, arg); + p->mark = mark; + return (res != NULL) == positive; +} + +int +_PyPegen_lookahead(int positive, void *(func)(Parser *), Parser *p) +{ + int mark = p->mark; + void *res = func(p); + p->mark = mark; + return (res != NULL) == positive; +} + +Token * +_PyPegen_expect_token(Parser *p, int type) +{ + if (p->mark == p->fill) { + if (_PyPegen_fill_token(p) < 0) { + return NULL; + } + } + Token *t = p->tokens[p->mark]; + if (t->type != type) { + // fprintf(stderr, "No %s at %d\n", token_name(type), p->mark); + return NULL; + } + p->mark += 1; + // fprintf(stderr, "Got %s at %d: %s\n", token_name(type), p->mark, + // PyBytes_AsString(t->bytes)); + + return t; +} + +Token * +_PyPegen_get_last_nonnwhitespace_token(Parser *p) +{ + assert(p->mark >= 0); + Token *token = NULL; + for (int m = p->mark - 1; m >= 0; m--) { + token = p->tokens[m]; + if (token->type != ENDMARKER && (token->type < NEWLINE || token->type > DEDENT)) { + break; + } + } + return token; +} + +void * +_PyPegen_async_token(Parser *p) +{ + return _PyPegen_expect_token(p, ASYNC); +} + +void * +_PyPegen_await_token(Parser *p) +{ + return _PyPegen_expect_token(p, AWAIT); +} + +void * +_PyPegen_endmarker_token(Parser *p) +{ + return _PyPegen_expect_token(p, ENDMARKER); +} + +expr_ty +_PyPegen_name_token(Parser *p) +{ + Token *t = _PyPegen_expect_token(p, NAME); + if (t == NULL) { + return NULL; + } + char* s = PyBytes_AsString(t->bytes); + if (!s) { + return NULL; + } + PyObject *id = _PyPegen_new_identifier(p, s); + if (id == NULL) { + return NULL; + } + return Name(id, Load, t->lineno, t->col_offset, t->end_lineno, t->end_col_offset, + p->arena); +} + +void * +_PyPegen_string_token(Parser *p) +{ + return _PyPegen_expect_token(p, STRING); +} + +void * +_PyPegen_newline_token(Parser *p) +{ + return _PyPegen_expect_token(p, NEWLINE); +} + +void * +_PyPegen_indent_token(Parser *p) +{ + return _PyPegen_expect_token(p, INDENT); +} + +void * +_PyPegen_dedent_token(Parser *p) +{ + return _PyPegen_expect_token(p, DEDENT); +} + +static PyObject * +parsenumber_raw(const char *s) +{ + const char *end; + long x; + double dx; + Py_complex compl; + int imflag; + + assert(s != NULL); + errno = 0; + end = s + strlen(s) - 1; + imflag = *end == 'j' || *end == 'J'; + if (s[0] == '0') { + x = (long)PyOS_strtoul(s, (char **)&end, 0); + if (x < 0 && errno == 0) { + return PyLong_FromString(s, (char **)0, 0); + } + } + else + x = PyOS_strtol(s, (char **)&end, 0); + if (*end == '\0') { + if (errno != 0) + return PyLong_FromString(s, (char **)0, 0); + return PyLong_FromLong(x); + } + /* XXX Huge floats may silently fail */ + if (imflag) { + compl.real = 0.; + compl.imag = PyOS_string_to_double(s, (char **)&end, NULL); + if (compl.imag == -1.0 && PyErr_Occurred()) + return NULL; + return PyComplex_FromCComplex(compl); + } + else { + dx = PyOS_string_to_double(s, NULL, NULL); + if (dx == -1.0 && PyErr_Occurred()) + return NULL; + return PyFloat_FromDouble(dx); + } +} + +static PyObject * +parsenumber(const char *s) +{ + char *dup, *end; + PyObject *res = NULL; + + assert(s != NULL); + + if (strchr(s, '_') == NULL) { + return parsenumber_raw(s); + } + /* Create a duplicate without underscores. */ + dup = PyMem_Malloc(strlen(s) + 1); + if (dup == NULL) { + return PyErr_NoMemory(); + } + end = dup; + for (; *s; s++) { + if (*s != '_') { + *end++ = *s; + } + } + *end = '\0'; + res = parsenumber_raw(dup); + PyMem_Free(dup); + return res; +} + +expr_ty +_PyPegen_number_token(Parser *p) +{ + Token *t = _PyPegen_expect_token(p, NUMBER); + if (t == NULL) { + return NULL; + } + + char *num_raw = PyBytes_AsString(t->bytes); + + if (num_raw == NULL) { + return NULL; + } + + PyObject *c = parsenumber(num_raw); + + if (c == NULL) { + return NULL; + } + + if (PyArena_AddPyObject(p->arena, c) < 0) { + Py_DECREF(c); + return NULL; + } + + return Constant(c, NULL, t->lineno, t->col_offset, t->end_lineno, t->end_col_offset, + p->arena); +} + +void +_PyPegen_Parser_Free(Parser *p) +{ + Py_XDECREF(p->normalize); + for (int i = 0; i < p->size; i++) { + PyMem_Free(p->tokens[i]); + } + PyMem_Free(p->tokens); + PyMem_Free(p); +} + +Parser * +_PyPegen_Parser_New(struct tok_state *tok, int start_rule, int *errcode, PyArena *arena) +{ + Parser *p = PyMem_Malloc(sizeof(Parser)); + if (p == NULL) { + PyErr_Format(PyExc_MemoryError, "Out of memory for Parser"); + return NULL; + } + assert(tok != NULL); + p->tok = tok; + p->keywords = NULL; + p->n_keyword_lists = -1; + p->tokens = PyMem_Malloc(sizeof(Token *)); + if (!p->tokens) { + PyMem_Free(p); + PyErr_Format(PyExc_MemoryError, "Out of memory for tokens"); + return NULL; + } + p->tokens[0] = PyMem_Malloc(sizeof(Token)); + memset(p->tokens[0], '\0', sizeof(Token)); + p->mark = 0; + p->fill = 0; + p->size = 1; + + p->errcode = errcode; + p->arena = arena; + p->start_rule = start_rule; + p->parsing_started = 0; + p->normalize = NULL; + p->error_indicator = 0; + + p->starting_lineno = 0; + p->starting_col_offset = 0; + + return p; +} + +void * +_PyPegen_run_parser(Parser *p) +{ + void *res = _PyPegen_parse(p); + if (res == NULL) { + if (PyErr_Occurred()) { + return NULL; + } + if (p->fill == 0) { + RAISE_SYNTAX_ERROR("error at start before reading any input"); + } + else if (p->tok->done == E_EOF) { + RAISE_SYNTAX_ERROR("unexpected EOF while parsing"); + } + else { + if (p->tokens[p->fill-1]->type == INDENT) { + RAISE_INDENTATION_ERROR("unexpected indent"); + } + else if (p->tokens[p->fill-1]->type == DEDENT) { + RAISE_INDENTATION_ERROR("unexpected unindent"); + } + else { + RAISE_SYNTAX_ERROR("invalid syntax"); + } + } + return NULL; + } + + return res; +} + +mod_ty +_PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filename_ob, + const char *enc, const char *ps1, const char *ps2, + int *errcode, PyArena *arena) +{ + struct tok_state *tok = PyTokenizer_FromFile(fp, enc, ps1, ps2); + if (tok == NULL) { + if (PyErr_Occurred()) { + raise_tokenizer_init_error(filename_ob); + return NULL; + } + return NULL; + } + // This transfers the ownership to the tokenizer + tok->filename = filename_ob; + Py_INCREF(filename_ob); + + // From here on we need to clean up even if there's an error + mod_ty result = NULL; + + Parser *p = _PyPegen_Parser_New(tok, start_rule, errcode, arena); + if (p == NULL) { + goto error; + } + + result = _PyPegen_run_parser(p); + _PyPegen_Parser_Free(p); + +error: + PyTokenizer_Free(tok); + return result; +} + +mod_ty +_PyPegen_run_parser_from_file(const char *filename, int start_rule, + PyObject *filename_ob, PyArena *arena) +{ + FILE *fp = fopen(filename, "rb"); + if (fp == NULL) { + PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename); + return NULL; + } + + mod_ty result = _PyPegen_run_parser_from_file_pointer(fp, start_rule, filename_ob, + NULL, NULL, NULL, NULL, arena); + + fclose(fp); + return result; +} + +mod_ty +_PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filename_ob, + int iflags, PyArena *arena) +{ + int exec_input = start_rule == Py_file_input; + + struct tok_state *tok; + if (iflags & PyCF_IGNORE_COOKIE) { + tok = PyTokenizer_FromUTF8(str, exec_input); + } else { + tok = PyTokenizer_FromString(str, exec_input); + } + if (tok == NULL) { + if (PyErr_Occurred()) { + raise_tokenizer_init_error(filename_ob); + } + return NULL; + } + // This transfers the ownership to the tokenizer + tok->filename = filename_ob; + Py_INCREF(filename_ob); + + // We need to clear up from here on + mod_ty result = NULL; + + Parser *p = _PyPegen_Parser_New(tok, start_rule, NULL, arena); + if (p == NULL) { + goto error; + } + + result = _PyPegen_run_parser(p); + _PyPegen_Parser_Free(p); + +error: + PyTokenizer_Free(tok); + return result; +} + +void * +_PyPegen_interactive_exit(Parser *p) +{ + if (p->errcode) { + *(p->errcode) = E_EOF; + } + return NULL; +} + +/* Creates a single-element asdl_seq* that contains a */ +asdl_seq * +_PyPegen_singleton_seq(Parser *p, void *a) +{ + assert(a != NULL); + asdl_seq *seq = _Py_asdl_seq_new(1, p->arena); + if (!seq) { + return NULL; + } + asdl_seq_SET(seq, 0, a); + return seq; +} + +/* Creates a copy of seq and prepends a to it */ +asdl_seq * +_PyPegen_seq_insert_in_front(Parser *p, void *a, asdl_seq *seq) +{ + assert(a != NULL); + if (!seq) { + return _PyPegen_singleton_seq(p, a); + } + + asdl_seq *new_seq = _Py_asdl_seq_new(asdl_seq_LEN(seq) + 1, p->arena); + if (!new_seq) { + return NULL; + } + + asdl_seq_SET(new_seq, 0, a); + for (int i = 1, l = asdl_seq_LEN(new_seq); i < l; i++) { + asdl_seq_SET(new_seq, i, asdl_seq_GET(seq, i - 1)); + } + return new_seq; +} + +static int +_get_flattened_seq_size(asdl_seq *seqs) +{ + int size = 0; + for (Py_ssize_t i = 0, l = asdl_seq_LEN(seqs); i < l; i++) { + asdl_seq *inner_seq = asdl_seq_GET(seqs, i); + size += asdl_seq_LEN(inner_seq); + } + return size; +} + +/* Flattens an asdl_seq* of asdl_seq*s */ +asdl_seq * +_PyPegen_seq_flatten(Parser *p, asdl_seq *seqs) +{ + int flattened_seq_size = _get_flattened_seq_size(seqs); + assert(flattened_seq_size > 0); + + asdl_seq *flattened_seq = _Py_asdl_seq_new(flattened_seq_size, p->arena); + if (!flattened_seq) { + return NULL; + } + + int flattened_seq_idx = 0; + for (Py_ssize_t i = 0, l = asdl_seq_LEN(seqs); i < l; i++) { + asdl_seq *inner_seq = asdl_seq_GET(seqs, i); + for (int j = 0, li = asdl_seq_LEN(inner_seq); j < li; j++) { + asdl_seq_SET(flattened_seq, flattened_seq_idx++, asdl_seq_GET(inner_seq, j)); + } + } + assert(flattened_seq_idx == flattened_seq_size); + + return flattened_seq; +} + +/* Creates a new name of the form . */ +expr_ty +_PyPegen_join_names_with_dot(Parser *p, expr_ty first_name, expr_ty second_name) +{ + assert(first_name != NULL && second_name != NULL); + PyObject *first_identifier = first_name->v.Name.id; + PyObject *second_identifier = second_name->v.Name.id; + + if (PyUnicode_READY(first_identifier) == -1) { + return NULL; + } + if (PyUnicode_READY(second_identifier) == -1) { + return NULL; + } + const char *first_str = PyUnicode_AsUTF8(first_identifier); + if (!first_str) { + return NULL; + } + const char *second_str = PyUnicode_AsUTF8(second_identifier); + if (!second_str) { + return NULL; + } + ssize_t len = strlen(first_str) + strlen(second_str) + 1; // +1 for the dot + + PyObject *str = PyBytes_FromStringAndSize(NULL, len); + if (!str) { + return NULL; + } + + char *s = PyBytes_AS_STRING(str); + if (!s) { + return NULL; + } + + strcpy(s, first_str); + s += strlen(first_str); + *s++ = '.'; + strcpy(s, second_str); + s += strlen(second_str); + *s = '\0'; + + PyObject *uni = PyUnicode_DecodeUTF8(PyBytes_AS_STRING(str), PyBytes_GET_SIZE(str), NULL); + Py_DECREF(str); + if (!uni) { + return NULL; + } + PyUnicode_InternInPlace(&uni); + if (PyArena_AddPyObject(p->arena, uni) < 0) { + Py_DECREF(uni); + return NULL; + } + + return _Py_Name(uni, Load, EXTRA_EXPR(first_name, second_name)); +} + +/* Counts the total number of dots in seq's tokens */ +int +_PyPegen_seq_count_dots(asdl_seq *seq) +{ + int number_of_dots = 0; + for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) { + Token *current_expr = asdl_seq_GET(seq, i); + switch (current_expr->type) { + case ELLIPSIS: + number_of_dots += 3; + break; + case DOT: + number_of_dots += 1; + break; + default: + assert(current_expr->type == ELLIPSIS || current_expr->type == DOT); + } + } + + return number_of_dots; +} + +/* Creates an alias with '*' as the identifier name */ +alias_ty +_PyPegen_alias_for_star(Parser *p) +{ + PyObject *str = PyUnicode_InternFromString("*"); + if (!str) { + return NULL; + } + if (PyArena_AddPyObject(p->arena, str) < 0) { + Py_DECREF(str); + return NULL; + } + return alias(str, NULL, p->arena); +} + +/* Creates a new asdl_seq* with the identifiers of all the names in seq */ +asdl_seq * +_PyPegen_map_names_to_ids(Parser *p, asdl_seq *seq) +{ + int len = asdl_seq_LEN(seq); + assert(len > 0); + + asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); + if (!new_seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + expr_ty e = asdl_seq_GET(seq, i); + asdl_seq_SET(new_seq, i, e->v.Name.id); + } + return new_seq; +} + +/* Constructs a CmpopExprPair */ +CmpopExprPair * +_PyPegen_cmpop_expr_pair(Parser *p, cmpop_ty cmpop, expr_ty expr) +{ + assert(expr != NULL); + CmpopExprPair *a = PyArena_Malloc(p->arena, sizeof(CmpopExprPair)); + if (!a) { + return NULL; + } + a->cmpop = cmpop; + a->expr = expr; + return a; +} + +asdl_int_seq * +_PyPegen_get_cmpops(Parser *p, asdl_seq *seq) +{ + int len = asdl_seq_LEN(seq); + assert(len > 0); + + asdl_int_seq *new_seq = _Py_asdl_int_seq_new(len, p->arena); + if (!new_seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + CmpopExprPair *pair = asdl_seq_GET(seq, i); + asdl_seq_SET(new_seq, i, pair->cmpop); + } + return new_seq; +} + +asdl_seq * +_PyPegen_get_exprs(Parser *p, asdl_seq *seq) +{ + int len = asdl_seq_LEN(seq); + assert(len > 0); + + asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); + if (!new_seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + CmpopExprPair *pair = asdl_seq_GET(seq, i); + asdl_seq_SET(new_seq, i, pair->expr); + } + return new_seq; +} + +/* Creates an asdl_seq* where all the elements have been changed to have ctx as context */ +static asdl_seq * +_set_seq_context(Parser *p, asdl_seq *seq, expr_context_ty ctx) +{ + int len = asdl_seq_LEN(seq); + if (len == 0) { + return NULL; + } + + asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); + if (!new_seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + expr_ty e = asdl_seq_GET(seq, i); + asdl_seq_SET(new_seq, i, _PyPegen_set_expr_context(p, e, ctx)); + } + return new_seq; +} + +static expr_ty +_set_name_context(Parser *p, expr_ty e, expr_context_ty ctx) +{ + return _Py_Name(e->v.Name.id, ctx, EXTRA_EXPR(e, e)); +} + +static expr_ty +_set_tuple_context(Parser *p, expr_ty e, expr_context_ty ctx) +{ + return _Py_Tuple(_set_seq_context(p, e->v.Tuple.elts, ctx), ctx, EXTRA_EXPR(e, e)); +} + +static expr_ty +_set_list_context(Parser *p, expr_ty e, expr_context_ty ctx) +{ + return _Py_List(_set_seq_context(p, e->v.List.elts, ctx), ctx, EXTRA_EXPR(e, e)); +} + +static expr_ty +_set_subscript_context(Parser *p, expr_ty e, expr_context_ty ctx) +{ + return _Py_Subscript(e->v.Subscript.value, e->v.Subscript.slice, ctx, EXTRA_EXPR(e, e)); +} + +static expr_ty +_set_attribute_context(Parser *p, expr_ty e, expr_context_ty ctx) +{ + return _Py_Attribute(e->v.Attribute.value, e->v.Attribute.attr, ctx, EXTRA_EXPR(e, e)); +} + +static expr_ty +_set_starred_context(Parser *p, expr_ty e, expr_context_ty ctx) +{ + return _Py_Starred(_PyPegen_set_expr_context(p, e->v.Starred.value, ctx), ctx, EXTRA_EXPR(e, e)); +} + +/* Creates an `expr_ty` equivalent to `expr` but with `ctx` as context */ +expr_ty +_PyPegen_set_expr_context(Parser *p, expr_ty expr, expr_context_ty ctx) +{ + assert(expr != NULL); + + expr_ty new = NULL; + switch (expr->kind) { + case Name_kind: + new = _set_name_context(p, expr, ctx); + break; + case Tuple_kind: + new = _set_tuple_context(p, expr, ctx); + break; + case List_kind: + new = _set_list_context(p, expr, ctx); + break; + case Subscript_kind: + new = _set_subscript_context(p, expr, ctx); + break; + case Attribute_kind: + new = _set_attribute_context(p, expr, ctx); + break; + case Starred_kind: + new = _set_starred_context(p, expr, ctx); + break; + default: + new = expr; + } + return new; +} + +/* Constructs a KeyValuePair that is used when parsing a dict's key value pairs */ +KeyValuePair * +_PyPegen_key_value_pair(Parser *p, expr_ty key, expr_ty value) +{ + KeyValuePair *a = PyArena_Malloc(p->arena, sizeof(KeyValuePair)); + if (!a) { + return NULL; + } + a->key = key; + a->value = value; + return a; +} + +/* Extracts all keys from an asdl_seq* of KeyValuePair*'s */ +asdl_seq * +_PyPegen_get_keys(Parser *p, asdl_seq *seq) +{ + int len = asdl_seq_LEN(seq); + asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); + if (!new_seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + KeyValuePair *pair = asdl_seq_GET(seq, i); + asdl_seq_SET(new_seq, i, pair->key); + } + return new_seq; +} + +/* Extracts all values from an asdl_seq* of KeyValuePair*'s */ +asdl_seq * +_PyPegen_get_values(Parser *p, asdl_seq *seq) +{ + int len = asdl_seq_LEN(seq); + asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); + if (!new_seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + KeyValuePair *pair = asdl_seq_GET(seq, i); + asdl_seq_SET(new_seq, i, pair->value); + } + return new_seq; +} + +/* Constructs a NameDefaultPair */ +NameDefaultPair * +_PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value) +{ + NameDefaultPair *a = PyArena_Malloc(p->arena, sizeof(NameDefaultPair)); + if (!a) { + return NULL; + } + a->arg = arg; + a->value = value; + return a; +} + +/* Constructs a SlashWithDefault */ +SlashWithDefault * +_PyPegen_slash_with_default(Parser *p, asdl_seq *plain_names, asdl_seq *names_with_defaults) +{ + SlashWithDefault *a = PyArena_Malloc(p->arena, sizeof(SlashWithDefault)); + if (!a) { + return NULL; + } + a->plain_names = plain_names; + a->names_with_defaults = names_with_defaults; + return a; +} + +/* Constructs a StarEtc */ +StarEtc * +_PyPegen_star_etc(Parser *p, arg_ty vararg, asdl_seq *kwonlyargs, arg_ty kwarg) +{ + StarEtc *a = PyArena_Malloc(p->arena, sizeof(StarEtc)); + if (!a) { + return NULL; + } + a->vararg = vararg; + a->kwonlyargs = kwonlyargs; + a->kwarg = kwarg; + return a; +} + +asdl_seq * +_PyPegen_join_sequences(Parser *p, asdl_seq *a, asdl_seq *b) +{ + int first_len = asdl_seq_LEN(a); + int second_len = asdl_seq_LEN(b); + asdl_seq *new_seq = _Py_asdl_seq_new(first_len + second_len, p->arena); + if (!new_seq) { + return NULL; + } + + int k = 0; + for (Py_ssize_t i = 0; i < first_len; i++) { + asdl_seq_SET(new_seq, k++, asdl_seq_GET(a, i)); + } + for (Py_ssize_t i = 0; i < second_len; i++) { + asdl_seq_SET(new_seq, k++, asdl_seq_GET(b, i)); + } + + return new_seq; +} + +static asdl_seq * +_get_names(Parser *p, asdl_seq *names_with_defaults) +{ + int len = asdl_seq_LEN(names_with_defaults); + asdl_seq *seq = _Py_asdl_seq_new(len, p->arena); + if (!seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + NameDefaultPair *pair = asdl_seq_GET(names_with_defaults, i); + asdl_seq_SET(seq, i, pair->arg); + } + return seq; +} + +static asdl_seq * +_get_defaults(Parser *p, asdl_seq *names_with_defaults) +{ + int len = asdl_seq_LEN(names_with_defaults); + asdl_seq *seq = _Py_asdl_seq_new(len, p->arena); + if (!seq) { + return NULL; + } + for (Py_ssize_t i = 0; i < len; i++) { + NameDefaultPair *pair = asdl_seq_GET(names_with_defaults, i); + asdl_seq_SET(seq, i, pair->value); + } + return seq; +} + +/* Constructs an arguments_ty object out of all the parsed constructs in the parameters rule */ +arguments_ty +_PyPegen_make_arguments(Parser *p, asdl_seq *slash_without_default, + SlashWithDefault *slash_with_default, asdl_seq *plain_names, + asdl_seq *names_with_default, StarEtc *star_etc) +{ + asdl_seq *posonlyargs; + if (slash_without_default != NULL) { + posonlyargs = slash_without_default; + } + else if (slash_with_default != NULL) { + asdl_seq *slash_with_default_names = + _get_names(p, slash_with_default->names_with_defaults); + if (!slash_with_default_names) { + return NULL; + } + posonlyargs = _PyPegen_join_sequences(p, slash_with_default->plain_names, slash_with_default_names); + if (!posonlyargs) { + return NULL; + } + } + else { + posonlyargs = _Py_asdl_seq_new(0, p->arena); + if (!posonlyargs) { + return NULL; + } + } + + asdl_seq *posargs; + if (plain_names != NULL && names_with_default != NULL) { + asdl_seq *names_with_default_names = _get_names(p, names_with_default); + if (!names_with_default_names) { + return NULL; + } + posargs = _PyPegen_join_sequences(p, plain_names, names_with_default_names); + if (!posargs) { + return NULL; + } + } + else if (plain_names == NULL && names_with_default != NULL) { + posargs = _get_names(p, names_with_default); + if (!posargs) { + return NULL; + } + } + else if (plain_names != NULL && names_with_default == NULL) { + posargs = plain_names; + } + else { + posargs = _Py_asdl_seq_new(0, p->arena); + if (!posargs) { + return NULL; + } + } + + asdl_seq *posdefaults; + if (slash_with_default != NULL && names_with_default != NULL) { + asdl_seq *slash_with_default_values = + _get_defaults(p, slash_with_default->names_with_defaults); + if (!slash_with_default_values) { + return NULL; + } + asdl_seq *names_with_default_values = _get_defaults(p, names_with_default); + if (!names_with_default_values) { + return NULL; + } + posdefaults = _PyPegen_join_sequences(p, slash_with_default_values, names_with_default_values); + if (!posdefaults) { + return NULL; + } + } + else if (slash_with_default == NULL && names_with_default != NULL) { + posdefaults = _get_defaults(p, names_with_default); + if (!posdefaults) { + return NULL; + } + } + else if (slash_with_default != NULL && names_with_default == NULL) { + posdefaults = _get_defaults(p, slash_with_default->names_with_defaults); + if (!posdefaults) { + return NULL; + } + } + else { + posdefaults = _Py_asdl_seq_new(0, p->arena); + if (!posdefaults) { + return NULL; + } + } + + arg_ty vararg = NULL; + if (star_etc != NULL && star_etc->vararg != NULL) { + vararg = star_etc->vararg; + } + + asdl_seq *kwonlyargs; + if (star_etc != NULL && star_etc->kwonlyargs != NULL) { + kwonlyargs = _get_names(p, star_etc->kwonlyargs); + if (!kwonlyargs) { + return NULL; + } + } + else { + kwonlyargs = _Py_asdl_seq_new(0, p->arena); + if (!kwonlyargs) { + return NULL; + } + } + + asdl_seq *kwdefaults; + if (star_etc != NULL && star_etc->kwonlyargs != NULL) { + kwdefaults = _get_defaults(p, star_etc->kwonlyargs); + if (!kwdefaults) { + return NULL; + } + } + else { + kwdefaults = _Py_asdl_seq_new(0, p->arena); + if (!kwdefaults) { + return NULL; + } + } + + arg_ty kwarg = NULL; + if (star_etc != NULL && star_etc->kwarg != NULL) { + kwarg = star_etc->kwarg; + } + + return _Py_arguments(posonlyargs, posargs, vararg, kwonlyargs, kwdefaults, kwarg, + posdefaults, p->arena); +} + +/* Constructs an empty arguments_ty object, that gets used when a function accepts no + * arguments. */ +arguments_ty +_PyPegen_empty_arguments(Parser *p) +{ + asdl_seq *posonlyargs = _Py_asdl_seq_new(0, p->arena); + if (!posonlyargs) { + return NULL; + } + asdl_seq *posargs = _Py_asdl_seq_new(0, p->arena); + if (!posargs) { + return NULL; + } + asdl_seq *posdefaults = _Py_asdl_seq_new(0, p->arena); + if (!posdefaults) { + return NULL; + } + asdl_seq *kwonlyargs = _Py_asdl_seq_new(0, p->arena); + if (!kwonlyargs) { + return NULL; + } + asdl_seq *kwdefaults = _Py_asdl_seq_new(0, p->arena); + if (!kwdefaults) { + return NULL; + } + + return _Py_arguments(posonlyargs, posargs, NULL, kwonlyargs, kwdefaults, NULL, kwdefaults, + p->arena); +} + +/* Encapsulates the value of an operator_ty into an AugOperator struct */ +AugOperator * +_PyPegen_augoperator(Parser *p, operator_ty kind) +{ + AugOperator *a = PyArena_Malloc(p->arena, sizeof(AugOperator)); + if (!a) { + return NULL; + } + a->kind = kind; + return a; +} + +/* Construct a FunctionDef equivalent to function_def, but with decorators */ +stmt_ty +_PyPegen_function_def_decorators(Parser *p, asdl_seq *decorators, stmt_ty function_def) +{ + assert(function_def != NULL); + if (function_def->kind == AsyncFunctionDef_kind) { + return _Py_AsyncFunctionDef( + function_def->v.FunctionDef.name, function_def->v.FunctionDef.args, + function_def->v.FunctionDef.body, decorators, function_def->v.FunctionDef.returns, + function_def->v.FunctionDef.type_comment, function_def->lineno, + function_def->col_offset, function_def->end_lineno, function_def->end_col_offset, + p->arena); + } + + return _Py_FunctionDef(function_def->v.FunctionDef.name, function_def->v.FunctionDef.args, + function_def->v.FunctionDef.body, decorators, + function_def->v.FunctionDef.returns, + function_def->v.FunctionDef.type_comment, function_def->lineno, + function_def->col_offset, function_def->end_lineno, + function_def->end_col_offset, p->arena); +} + +/* Construct a ClassDef equivalent to class_def, but with decorators */ +stmt_ty +_PyPegen_class_def_decorators(Parser *p, asdl_seq *decorators, stmt_ty class_def) +{ + assert(class_def != NULL); + return _Py_ClassDef(class_def->v.ClassDef.name, class_def->v.ClassDef.bases, + class_def->v.ClassDef.keywords, class_def->v.ClassDef.body, decorators, + class_def->lineno, class_def->col_offset, class_def->end_lineno, + class_def->end_col_offset, p->arena); +} + +/* Construct a KeywordOrStarred */ +KeywordOrStarred * +_PyPegen_keyword_or_starred(Parser *p, void *element, int is_keyword) +{ + KeywordOrStarred *a = PyArena_Malloc(p->arena, sizeof(KeywordOrStarred)); + if (!a) { + return NULL; + } + a->element = element; + a->is_keyword = is_keyword; + return a; +} + +/* Get the number of starred expressions in an asdl_seq* of KeywordOrStarred*s */ +static int +_seq_number_of_starred_exprs(asdl_seq *seq) +{ + int n = 0; + for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) { + KeywordOrStarred *k = asdl_seq_GET(seq, i); + if (!k->is_keyword) { + n++; + } + } + return n; +} + +/* Extract the starred expressions of an asdl_seq* of KeywordOrStarred*s */ +asdl_seq * +_PyPegen_seq_extract_starred_exprs(Parser *p, asdl_seq *kwargs) +{ + int new_len = _seq_number_of_starred_exprs(kwargs); + if (new_len == 0) { + return NULL; + } + asdl_seq *new_seq = _Py_asdl_seq_new(new_len, p->arena); + if (!new_seq) { + return NULL; + } + + int idx = 0; + for (Py_ssize_t i = 0, len = asdl_seq_LEN(kwargs); i < len; i++) { + KeywordOrStarred *k = asdl_seq_GET(kwargs, i); + if (!k->is_keyword) { + asdl_seq_SET(new_seq, idx++, k->element); + } + } + return new_seq; +} + +/* Return a new asdl_seq* with only the keywords in kwargs */ +asdl_seq * +_PyPegen_seq_delete_starred_exprs(Parser *p, asdl_seq *kwargs) +{ + int len = asdl_seq_LEN(kwargs); + int new_len = len - _seq_number_of_starred_exprs(kwargs); + if (new_len == 0) { + return NULL; + } + asdl_seq *new_seq = _Py_asdl_seq_new(new_len, p->arena); + if (!new_seq) { + return NULL; + } + + int idx = 0; + for (Py_ssize_t i = 0; i < len; i++) { + KeywordOrStarred *k = asdl_seq_GET(kwargs, i); + if (k->is_keyword) { + asdl_seq_SET(new_seq, idx++, k->element); + } + } + return new_seq; +} + +expr_ty +_PyPegen_concatenate_strings(Parser *p, asdl_seq *strings) +{ + int len = asdl_seq_LEN(strings); + assert(len > 0); + + Token *first = asdl_seq_GET(strings, 0); + Token *last = asdl_seq_GET(strings, len - 1); + + int bytesmode = 0; + PyObject *bytes_str = NULL; + + FstringParser state; + _PyPegen_FstringParser_Init(&state); + + for (Py_ssize_t i = 0; i < len; i++) { + Token *t = asdl_seq_GET(strings, i); + + int this_bytesmode; + int this_rawmode; + PyObject *s; + const char *fstr; + Py_ssize_t fstrlen = -1; + + char *this_str = PyBytes_AsString(t->bytes); + if (!this_str) { + goto error; + } + + if (_PyPegen_parsestr(p, this_str, &this_bytesmode, &this_rawmode, &s, &fstr, &fstrlen) != 0) { + goto error; + } + + /* Check that we are not mixing bytes with unicode. */ + if (i != 0 && bytesmode != this_bytesmode) { + RAISE_SYNTAX_ERROR("cannot mix bytes and nonbytes literals"); + Py_XDECREF(s); + goto error; + } + bytesmode = this_bytesmode; + + if (fstr != NULL) { + assert(s == NULL && !bytesmode); + + int result = _PyPegen_FstringParser_ConcatFstring(p, &state, &fstr, fstr + fstrlen, + this_rawmode, 0, first, t, last); + if (result < 0) { + goto error; + } + } + else { + /* String or byte string. */ + assert(s != NULL && fstr == NULL); + assert(bytesmode ? PyBytes_CheckExact(s) : PyUnicode_CheckExact(s)); + + if (bytesmode) { + if (i == 0) { + bytes_str = s; + } + else { + PyBytes_ConcatAndDel(&bytes_str, s); + if (!bytes_str) { + goto error; + } + } + } + else { + /* This is a regular string. Concatenate it. */ + if (_PyPegen_FstringParser_ConcatAndDel(&state, s) < 0) { + goto error; + } + } + } + } + + if (bytesmode) { + if (PyArena_AddPyObject(p->arena, bytes_str) < 0) { + goto error; + } + return Constant(bytes_str, NULL, first->lineno, first->col_offset, last->end_lineno, + last->end_col_offset, p->arena); + } + + return _PyPegen_FstringParser_Finish(p, &state, first, last); + +error: + Py_XDECREF(bytes_str); + _PyPegen_FstringParser_Dealloc(&state); + if (PyErr_Occurred()) { + raise_decode_error(p); + } + return NULL; +} diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h new file mode 100644 index 0000000000000..5acd9883f3fd8 --- /dev/null +++ b/Parser/pegen/pegen.h @@ -0,0 +1,179 @@ +#ifndef PEGEN_H +#define PEGEN_H + +#define PY_SSIZE_T_CLEAN +#include +#include +#include +#include + +typedef struct _memo { + int type; + void *node; + int mark; + struct _memo *next; +} Memo; + +typedef struct { + int type; + PyObject *bytes; + int lineno, col_offset, end_lineno, end_col_offset; + Memo *memo; +} Token; + +typedef struct { + char *str; + int type; +} KeywordToken; + +typedef struct { + struct tok_state *tok; + Token **tokens; + int mark; + int fill, size; + PyArena *arena; + KeywordToken **keywords; + int n_keyword_lists; + int start_rule; + int *errcode; + int parsing_started; + PyObject* normalize; + int starting_lineno; + int starting_col_offset; + int error_indicator; +} Parser; + +typedef struct { + cmpop_ty cmpop; + expr_ty expr; +} CmpopExprPair; + +typedef struct { + expr_ty key; + expr_ty value; +} KeyValuePair; + +typedef struct { + arg_ty arg; + expr_ty value; +} NameDefaultPair; + +typedef struct { + asdl_seq *plain_names; + asdl_seq *names_with_defaults; // asdl_seq* of NameDefaultsPair's +} SlashWithDefault; + +typedef struct { + arg_ty vararg; + asdl_seq *kwonlyargs; // asdl_seq* of NameDefaultsPair's + arg_ty kwarg; +} StarEtc; + +typedef struct { + operator_ty kind; +} AugOperator; + +typedef struct { + void *element; + int is_keyword; +} KeywordOrStarred; + +void _PyPegen_clear_memo_statistics(void); +PyObject *_PyPegen_get_memo_statistics(void); + +int _PyPegen_insert_memo(Parser *p, int mark, int type, void *node); +int _PyPegen_update_memo(Parser *p, int mark, int type, void *node); +int _PyPegen_is_memoized(Parser *p, int type, void *pres); + +int _PyPegen_lookahead_with_string(int, void *(func)(Parser *, const char *), Parser *, const char *); +int _PyPegen_lookahead_with_int(int, Token *(func)(Parser *, int), Parser *, int); +int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *); + +Token *_PyPegen_expect_token(Parser *p, int type); +Token *_PyPegen_get_last_nonnwhitespace_token(Parser *); +int _PyPegen_fill_token(Parser *p); +void *_PyPegen_async_token(Parser *p); +void *_PyPegen_await_token(Parser *p); +void *_PyPegen_endmarker_token(Parser *p); +expr_ty _PyPegen_name_token(Parser *p); +void *_PyPegen_newline_token(Parser *p); +void *_PyPegen_indent_token(Parser *p); +void *_PyPegen_dedent_token(Parser *p); +expr_ty _PyPegen_number_token(Parser *p); +void *_PyPegen_string_token(Parser *p); +const char *_PyPegen_get_expr_name(expr_ty); +void *_PyPegen_raise_error(Parser *p, PyObject *, const char *errmsg, ...); +void *_PyPegen_dummy_name(Parser *p, ...); + +#define UNUSED(expr) do { (void)(expr); } while (0) +#define EXTRA_EXPR(head, tail) head->lineno, head->col_offset, tail->end_lineno, tail->end_col_offset, p->arena +#define EXTRA start_lineno, start_col_offset, end_lineno, end_col_offset, p->arena +#define RAISE_SYNTAX_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_SyntaxError, msg, ##__VA_ARGS__) +#define RAISE_INDENTATION_ERROR(msg, ...) _PyPegen_raise_error(p, PyExc_IndentationError, msg, ##__VA_ARGS__) + +Py_LOCAL_INLINE(void *) +CHECK_CALL(Parser *p, void *result) +{ + if (result == NULL) { + assert(PyErr_Occurred()); + p->error_indicator = 1; + } + return result; +} + +/* This is needed for helper functions that are allowed to + return NULL without an error. Example: _PyPegen_seq_extract_starred_exprs */ +Py_LOCAL_INLINE(void *) +CHECK_CALL_NULL_ALLOWED(Parser *p, void *result) +{ + if (result == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + } + return result; +} + +#define CHECK(result) CHECK_CALL(p, result) +#define CHECK_NULL_ALLOWED(result) CHECK_CALL_NULL_ALLOWED(p, result) + +PyObject *_PyPegen_new_identifier(Parser *, char *); +Parser *_PyPegen_Parser_New(struct tok_state *, int, int *, PyArena *); +void _PyPegen_Parser_Free(Parser *); +mod_ty _PyPegen_run_parser_from_file_pointer(FILE *, int, PyObject *, const char *, + const char *, const char *, int *, PyArena *); +void *_PyPegen_run_parser(Parser *); +mod_ty _PyPegen_run_parser_from_file(const char *, int, PyObject *, PyArena *); +mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, int, PyArena *); +void *_PyPegen_interactive_exit(Parser *); +asdl_seq *_PyPegen_singleton_seq(Parser *, void *); +asdl_seq *_PyPegen_seq_insert_in_front(Parser *, void *, asdl_seq *); +asdl_seq *_PyPegen_seq_flatten(Parser *, asdl_seq *); +expr_ty _PyPegen_join_names_with_dot(Parser *, expr_ty, expr_ty); +int _PyPegen_seq_count_dots(asdl_seq *); +alias_ty _PyPegen_alias_for_star(Parser *); +asdl_seq *_PyPegen_map_names_to_ids(Parser *, asdl_seq *); +CmpopExprPair *_PyPegen_cmpop_expr_pair(Parser *, cmpop_ty, expr_ty); +asdl_int_seq *_PyPegen_get_cmpops(Parser *p, asdl_seq *); +asdl_seq *_PyPegen_get_exprs(Parser *, asdl_seq *); +expr_ty _PyPegen_set_expr_context(Parser *, expr_ty, expr_context_ty); +KeyValuePair *_PyPegen_key_value_pair(Parser *, expr_ty, expr_ty); +asdl_seq *_PyPegen_get_keys(Parser *, asdl_seq *); +asdl_seq *_PyPegen_get_values(Parser *, asdl_seq *); +NameDefaultPair *_PyPegen_name_default_pair(Parser *, arg_ty, expr_ty); +SlashWithDefault *_PyPegen_slash_with_default(Parser *, asdl_seq *, asdl_seq *); +StarEtc *_PyPegen_star_etc(Parser *, arg_ty, asdl_seq *, arg_ty); +arguments_ty _PyPegen_make_arguments(Parser *, asdl_seq *, SlashWithDefault *, + asdl_seq *, asdl_seq *, StarEtc *); +arguments_ty _PyPegen_empty_arguments(Parser *); +AugOperator *_PyPegen_augoperator(Parser*, operator_ty type); +stmt_ty _PyPegen_function_def_decorators(Parser *, asdl_seq *, stmt_ty); +stmt_ty _PyPegen_class_def_decorators(Parser *, asdl_seq *, stmt_ty); +KeywordOrStarred *_PyPegen_keyword_or_starred(Parser *, void *, int); +asdl_seq *_PyPegen_seq_extract_starred_exprs(Parser *, asdl_seq *); +asdl_seq *_PyPegen_seq_delete_starred_exprs(Parser *, asdl_seq *); +expr_ty _PyPegen_concatenate_strings(Parser *p, asdl_seq *); +asdl_seq *_PyPegen_join_sequences(Parser *, asdl_seq *, asdl_seq *); +void *_PyPegen_arguments_parsing_error(Parser *, expr_ty); + +void *_PyPegen_parse(Parser *); + +#endif diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 249f7e2304f92..8165aa74df1a0 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -485,6 +485,9 @@ static int test_init_from_config(void) config.install_signal_handlers = 0; + putenv("PYTHONOLDPARSER="); + config.use_peg = 0; + /* FIXME: test use_environment */ putenv("PYTHONHASHSEED=42"); diff --git a/Python/ast_opt.c b/Python/ast_opt.c index 1766321a11a5b..ff786d6f8d63e 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -563,7 +563,8 @@ astfold_expr(expr_ty node_, PyArena *ctx_, _PyASTOptimizeState *state) CALL(fold_tuple, expr_ty, node_); break; case Name_kind: - if (_PyUnicode_EqualToASCIIString(node_->v.Name.id, "__debug__")) { + if (node_->v.Name.ctx == Load && + _PyUnicode_EqualToASCIIString(node_->v.Name.id, "__debug__")) { return make_const(node_, PyBool_FromLong(!state->optimize), ctx_); } break; diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 22ee5969473f5..18883353575f3 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -816,7 +816,12 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, if (str == NULL) goto error; + int current_use_peg = PyInterpreterState_Get()->config.use_peg; + if (flags & PyCF_TYPE_COMMENTS || feature_version >= 0) { + PyInterpreterState_Get()->config.use_peg = 0; + } result = Py_CompileStringObject(str, filename, start[compile_mode], &cf, optimize); + PyInterpreterState_Get()->config.use_peg = current_use_peg; Py_XDECREF(source_copy); goto finally; diff --git a/Python/compile.c b/Python/compile.c index 54e6516b3ad01..3c21fbabf663f 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2152,6 +2152,55 @@ compiler_default_arguments(struct compiler *c, arguments_ty args) return funcflags; } +static int +forbidden_name(struct compiler *c, identifier name, expr_context_ty ctx) +{ + + if (ctx == Store && _PyUnicode_EqualToASCIIString(name, "__debug__")) { + compiler_error(c, "cannot assign to __debug__"); + return 1; + } + return 0; +} + +static int +compiler_check_debug_one_arg(struct compiler *c, arg_ty arg) +{ + if (arg != NULL) { + if (forbidden_name(c, arg->arg, Store)) + return 0; + } + return 1; +} + +static int +compiler_check_debug_args_seq(struct compiler *c, asdl_seq *args) +{ + if (args != NULL) { + for (int i = 0, n = asdl_seq_LEN(args); i < n; i++) { + if (!compiler_check_debug_one_arg(c, asdl_seq_GET(args, i))) + return 0; + } + } + return 1; +} + +static int +compiler_check_debug_args(struct compiler *c, arguments_ty args) +{ + if (!compiler_check_debug_args_seq(c, args->posonlyargs)) + return 0; + if (!compiler_check_debug_args_seq(c, args->args)) + return 0; + if (!compiler_check_debug_one_arg(c, args->vararg)) + return 0; + if (!compiler_check_debug_args_seq(c, args->kwonlyargs)) + return 0; + if (!compiler_check_debug_one_arg(c, args->kwarg)) + return 0; + return 1; +} + static int compiler_function(struct compiler *c, stmt_ty s, int is_async) { @@ -2189,6 +2238,9 @@ compiler_function(struct compiler *c, stmt_ty s, int is_async) scope_type = COMPILER_SCOPE_FUNCTION; } + if (!compiler_check_debug_args(c, args)) + return 0; + if (!compiler_decorators(c, decos)) return 0; @@ -2596,6 +2648,9 @@ compiler_lambda(struct compiler *c, expr_ty e) arguments_ty args = e->v.Lambda.args; assert(e->kind == Lambda_kind); + if (!compiler_check_debug_args(c, args)) + return 0; + if (!name) { name = PyUnicode_InternFromString(""); if (!name) @@ -3505,6 +3560,9 @@ compiler_nameop(struct compiler *c, identifier name, expr_context_ty ctx) !_PyUnicode_EqualToASCIIString(name, "True") && !_PyUnicode_EqualToASCIIString(name, "False")); + if (forbidden_name(c, name, ctx)) + return 0; + mangled = _Py_Mangle(c->u->u_private, name); if (!mangled) return 0; @@ -4056,6 +4114,9 @@ validate_keywords(struct compiler *c, asdl_seq *keywords) if (key->arg == NULL) { continue; } + if (forbidden_name(c, key->arg, Store)) { + return -1; + } for (Py_ssize_t j = i + 1; j < nkeywords; j++) { keyword_ty other = ((keyword_ty)asdl_seq_GET(keywords, j)); if (other->arg && !PyUnicode_Compare(key->arg, other->arg)) { @@ -5013,6 +5074,8 @@ compiler_visit_expr1(struct compiler *c, expr_ty e) ADDOP_NAME(c, LOAD_ATTR, e->v.Attribute.attr, names); break; case Store: + if (forbidden_name(c, e->v.Attribute.attr, e->v.Attribute.ctx)) + return 0; ADDOP_NAME(c, STORE_ATTR, e->v.Attribute.attr, names); break; case Del: @@ -5183,6 +5246,8 @@ compiler_annassign(struct compiler *c, stmt_ty s) } switch (targ->kind) { case Name_kind: + if (forbidden_name(c, targ->v.Name.id, Store)) + return 0; /* If we have a simple name in a module or class, store annotation. */ if (s->v.AnnAssign.simple && (c->u->u_scope_type == COMPILER_SCOPE_MODULE || @@ -5200,6 +5265,8 @@ compiler_annassign(struct compiler *c, stmt_ty s) } break; case Attribute_kind: + if (forbidden_name(c, targ->v.Attribute.attr, Store)) + return 0; if (!s->v.AnnAssign.value && !check_ann_expr(c, targ->v.Attribute.value)) { return 0; diff --git a/Python/importlib.h b/Python/importlib.h index 4bd8b62d809ee..59e0272b61dab 100644 --- a/Python/importlib.h +++ b/Python/importlib.h @@ -1594,50 +1594,51 @@ const unsigned char _Py_M__importlib_bootstrap[] = { 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,44,0,0,0,0,10,8,1,10,1,4,1, - 12,2,4,1,28,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,34,0,0,0,0,7,10,1, - 10,1,8,1,18,1,22,2,4,254,6,3,4,1,8,1, + 4,0,0,115,52,0,0,0,0,10,8,1,10,1,4,1, + 12,2,4,1,4,1,2,255,4,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, diff --git a/Python/importlib_external.h b/Python/importlib_external.h index 9618f9f0f6a8f..dd237428867ba 100644 --- a/Python/importlib_external.h +++ b/Python/importlib_external.h @@ -481,10 +481,11 @@ const unsigned char _Py_M__importlib_bootstrap_external[] = { 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,52,0,0,0,0, + 95,99,97,99,104,101,116,1,0,0,115,68,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,18,2,10,1,8, - 1,16,1,10,1,16,1,10,1,14,2,16,1,10,1,16, + 1,16,1,4,1,4,1,12,1,8,1,2,1,2,255,4, + 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,4,1,2,255,10, 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, diff --git a/Python/initconfig.c b/Python/initconfig.c index c313d91ac7309..7662d6192686d 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -68,6 +68,7 @@ static const char usage_3[] = "\ -X opt : set implementation-specific option. The following options are available:\n\ \n\ -X faulthandler: enable faulthandler\n\ + -X oldparser: enable the traditional LL(1) parser; also PYTHONOLDPARSER\n\ -X showrefcount: output the total reference count and number of used\n\ memory blocks when the program finishes or after each statement in the\n\ interactive interpreter. This only works on debug builds\n\ @@ -634,6 +635,7 @@ _PyConfig_InitCompatConfig(PyConfig *config) #ifdef MS_WINDOWS config->legacy_windows_stdio = -1; #endif + config->use_peg = 1; } @@ -791,6 +793,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2) COPY_ATTR(isolated); COPY_ATTR(use_environment); COPY_ATTR(dev_mode); + COPY_ATTR(use_peg); COPY_ATTR(install_signal_handlers); COPY_ATTR(use_hash_seed); COPY_ATTR(hash_seed); @@ -894,6 +897,7 @@ config_as_dict(const PyConfig *config) SET_ITEM_INT(isolated); SET_ITEM_INT(use_environment); SET_ITEM_INT(dev_mode); + SET_ITEM_INT(use_peg); SET_ITEM_INT(install_signal_handlers); SET_ITEM_INT(use_hash_seed); SET_ITEM_UINT(hash_seed); @@ -1428,6 +1432,11 @@ config_read_complex_options(PyConfig *config) config->import_time = 1; } + if (config_get_env(config, "PYTHONOLDPARSER") + || config_get_xoption(config, L"oldparser")) { + config->use_peg = 0; + } + PyStatus status; if (config->tracemalloc < 0) { status = config_init_tracemalloc(config); @@ -2507,6 +2516,7 @@ PyConfig_Read(PyConfig *config) assert(config->isolated >= 0); assert(config->use_environment >= 0); assert(config->dev_mode >= 0); + assert(config->use_peg >= 0); assert(config->install_signal_handlers >= 0); assert(config->use_hash_seed >= 0); assert(config->faulthandler >= 0); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 0a25ebc854ff5..6199f0c66104a 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -29,6 +29,8 @@ #include "ast.h" // PyAST_FromNodeObject() #include "marshal.h" // PyMarshal_ReadLongFromFile() +#include // PyPegen_ASTFrom* + #ifdef MS_WINDOWS # include "malloc.h" // alloca() #endif @@ -183,6 +185,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, PyArena *arena; const char *ps1 = "", *ps2 = "", *enc = NULL; int errcode = 0; + int use_peg = _PyInterpreterState_GET()->config.use_peg; _Py_IDENTIFIER(encoding); _Py_IDENTIFIER(__main__); @@ -235,9 +238,17 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, Py_XDECREF(oenc); return -1; } - mod = PyParser_ASTFromFileObject(fp, filename, enc, - Py_single_input, ps1, ps2, - flags, &errcode, arena); + + if (use_peg) { + mod = PyPegen_ASTFromFileObject(fp, filename, Py_single_input, + enc, ps1, ps2, &errcode, arena); + } + else { + mod = PyParser_ASTFromFileObject(fp, filename, enc, + Py_single_input, ps1, ps2, + flags, &errcode, arena); + } + Py_XDECREF(v); Py_XDECREF(w); Py_XDECREF(oenc); @@ -1019,6 +1030,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, mod_ty mod; PyArena *arena; PyObject *filename; + int use_peg = _PyInterpreterState_GET()->config.use_peg; filename = _PyUnicode_FromId(&PyId_string); /* borrowed */ if (filename == NULL) @@ -1028,7 +1040,13 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + if (use_peg) { + mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); + } + else { + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + } + if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); PyArena_Free(arena); @@ -1043,6 +1061,7 @@ PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globa mod_ty mod; PyArena *arena = NULL; PyObject *filename; + int use_peg = _PyInterpreterState_GET()->config.use_peg; filename = PyUnicode_DecodeFSDefault(filename_str); if (filename == NULL) @@ -1052,8 +1071,15 @@ PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globa if (arena == NULL) goto exit; - mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0, - flags, NULL, arena); + if (use_peg) { + mod = PyPegen_ASTFromFileObject(fp, filename, start, NULL, NULL, NULL, + NULL, arena); + } + else { + mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0, + flags, NULL, arena); + } + if (closeit) fclose(fp); if (mod == NULL) { @@ -1196,11 +1222,17 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, { PyCodeObject *co; mod_ty mod; + int use_peg = _PyInterpreterState_GET()->config.use_peg; PyArena *arena = PyArena_New(); if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + if (use_peg) { + mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); + } + else { + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + } if (mod == NULL) { PyArena_Free(arena); return NULL; @@ -1297,13 +1329,19 @@ _Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, Py { struct symtable *st; mod_ty mod; + int use_peg = _PyInterpreterState_GET()->config.use_peg; PyArena *arena; arena = PyArena_New(); if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + if (use_peg) { + mod = PyPegen_ASTFromStringObject(str, filename, start, flags, arena); + } + else { + mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + } if (mod == NULL) { PyArena_Free(arena); return NULL; diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 92ea5e7d637b9..cf3ddff44d19e 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2427,6 +2427,7 @@ static PyStructSequence_Field flags_fields[] = { {"inspect", "-i"}, {"interactive", "-i"}, {"optimize", "-O or -OO"}, + {"use_peg", "-p old or -p new"}, {"dont_write_bytecode", "-B"}, {"no_user_site", "-s"}, {"no_site", "-S"}, @@ -2447,7 +2448,7 @@ static PyStructSequence_Desc flags_desc = { "sys.flags", /* name */ flags__doc__, /* doc */ flags_fields, /* fields */ - 15 + 16 }; static PyObject* @@ -2470,6 +2471,7 @@ make_flags(PyThreadState *tstate) SetFlag(config->inspect); SetFlag(config->interactive); SetFlag(config->optimization_level); + SetFlag(config->use_peg); SetFlag(!config->write_bytecode); SetFlag(!config->user_site_directory); SetFlag(!config->site_import); diff --git a/Tools/README b/Tools/README index 6c5fb20818120..b6d0b18e5a5c2 100644 --- a/Tools/README +++ b/Tools/README @@ -23,6 +23,8 @@ msi Support for packaging Python as an MSI package on Windows. parser Un-parsing tool to generate code from an AST. +peg_generator PEG-based parser generator (pegen) used for new parser. + pynche A Tkinter-based color editor. scripts A number of useful single-file programs, e.g. tabnanny.py diff --git a/Tools/peg_generator/.clang-format b/Tools/peg_generator/.clang-format new file mode 100644 index 0000000000000..b2bb93dbd059b --- /dev/null +++ b/Tools/peg_generator/.clang-format @@ -0,0 +1,17 @@ +# A clang-format style that approximates Python's PEP 7 +BasedOnStyle: Google +AlwaysBreakAfterReturnType: All +AllowShortIfStatementsOnASingleLine: false +AlignAfterOpenBracket: Align +BreakBeforeBraces: Stroustrup +ColumnLimit: 95 +DerivePointerAlignment: false +IndentWidth: 4 +Language: Cpp +PointerAlignment: Right +ReflowComments: true +SpaceBeforeParens: ControlStatements +SpacesInParentheses: false +TabWidth: 4 +UseTab: Never +SortIncludes: false diff --git a/Tools/peg_generator/.gitignore b/Tools/peg_generator/.gitignore new file mode 100644 index 0000000000000..91c41f89e8cb5 --- /dev/null +++ b/Tools/peg_generator/.gitignore @@ -0,0 +1,3 @@ +peg_extension/parse.c +data/xxl.py + at data diff --git a/Tools/peg_generator/Makefile b/Tools/peg_generator/Makefile new file mode 100644 index 0000000000000..fb67a21b67b6e --- /dev/null +++ b/Tools/peg_generator/Makefile @@ -0,0 +1,116 @@ +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + PYTHON ?= ../../python +endif +ifeq ($(UNAME_S),Darwin) + PYTHON ?= ../../python.exe +endif + +CPYTHON ?= ../../Lib +MYPY ?= mypy + +GRAMMAR = ../../Grammar/python.gram +TESTFILE = data/cprog.py +TIMEFILE = data/xxl.py +TESTDIR = . +TESTFLAGS = --short + +data/xxl.py: + $(PYTHON) -m zipfile -e data/xxl.zip data + +build: peg_extension/parse.c + +peg_extension/parse.c: $(GRAMMAR) pegen/*.py peg_extension/peg_extension.c ../../Parser/pegen/pegen.c ../../Parser/pegen/parse_string.c ../../Parser/pegen/*.h pegen/grammar_parser.py + $(PYTHON) -m pegen -q -c $(GRAMMAR) -o peg_extension/parse.c --compile-extension + +clean: + -rm -f peg_extension/*.o peg_extension/*.so peg_extension/parse.c + -rm -f data/xxl.py + +dump: peg_extension/parse.c + cat -n $(TESTFILE) + $(PYTHON) -c "from peg_extension import parse; import ast; t = parse.parse_file('$(TESTFILE)', mode=1); print(ast.dump(t))" + +regen-metaparser: pegen/metagrammar.gram pegen/*.py + $(PYTHON) -m pegen -q -c pegen/metagrammar.gram -o pegen/grammar_parser.py + +# Note: These targets really depend on the generated shared object in peg_extension/parse.*.so but +# this has different names in different systems so we are abusing the implicit dependency on +# parse.c by the use of --compile-extension. + +.PHONY: test + +test: run + +run: peg_extension/parse.c + $(PYTHON) -c "from peg_extension import parse; t = parse.parse_file('$(TESTFILE)'); exec(t)" + +compile: peg_extension/parse.c + $(PYTHON) -c "from peg_extension import parse; t = parse.parse_file('$(TESTFILE)', mode=2)" + +parse: peg_extension/parse.c + $(PYTHON) -c "from peg_extension import parse; t = parse.parse_file('$(TESTFILE)', mode=1)" + +check: peg_extension/parse.c + $(PYTHON) -c "from peg_extension import parse; t = parse.parse_file('$(TESTFILE)', mode=0)" + +stats: peg_extension/parse.c data/xxl.py + $(PYTHON) -c "from peg_extension import parse; t = parse.parse_file('$(TIMEFILE)', mode=0); parse.dump_memo_stats()" >@data + $(PYTHON) scripts/joinstats.py @data + +time: time_compile + +time_compile: peg_extension/parse.c data/xxl.py + $(PYTHON) scripts/benchmark.py --parser=pegen --target=xxl compile + +time_parse: peg_extension/parse.c data/xxl.py + $(PYTHON) scripts/benchmark.py --parser=pegen --target=xxl parse + +time_check: peg_extension/parse.c data/xxl.py + $(PYTHON) scripts/benchmark.py --parser=pegen --target=xxl check + +time_stdlib: time_stdlib_compile + +time_stdlib_compile: data/xxl.py + $(PYTHON) scripts/benchmark.py --parser=cpython --target=xxl compile + +time_stdlib_parse: data/xxl.py + $(PYTHON) scripts/benchmark.py --parser=cpython --target=xxl parse + +test_local: + $(PYTHON) scripts/test_parse_directory.py \ + -g $(GRAMMAR) \ + -d $(TESTDIR) \ + $(TESTFLAGS) \ + --exclude "*/failset/*" \ + --exclude "*/failset/**" \ + --exclude "*/failset/**/*" + +test_global: $(CPYTHON) + $(PYTHON) scripts/test_parse_directory.py \ + -g $(GRAMMAR) \ + -d $(CPYTHON) \ + $(TESTFLAGS) \ + --exclude "*/test2to3/*" \ + --exclude "*/test2to3/**/*" \ + --exclude "*/bad*" \ + --exclude "*/lib2to3/tests/data/*" + +mypy: regen-metaparser + $(MYPY) # For list of files, see mypy.ini + +format-python: + black pegen scripts + +bench: + $(PYTHON) scripts/benchmark.py --parser=pegen --target=stdlib check + +format: format-python + +find_max_nesting: + $(PYTHON) scripts/find_max_nesting.py + +tags: TAGS + +TAGS: pegen/*.py test/test_pegen.py + etags pegen/*.py test/test_pegen.py diff --git a/Tools/peg_generator/data/cprog.py b/Tools/peg_generator/data/cprog.py new file mode 100644 index 0000000000000..07b96f0753a98 --- /dev/null +++ b/Tools/peg_generator/data/cprog.py @@ -0,0 +1,10 @@ +if 1: + print("Hello " + "world") + if 0: + print("then") + print("clause") + elif 1: + pass + elif 1: + pass + else: print("else-clause") diff --git a/Tools/peg_generator/data/xxl.zip b/Tools/peg_generator/data/xxl.zip new file mode 100644 index 0000000000000..5421408809b0d Binary files /dev/null and b/Tools/peg_generator/data/xxl.zip differ diff --git a/Tools/peg_generator/mypy.ini b/Tools/peg_generator/mypy.ini new file mode 100644 index 0000000000000..80d5c057ca1a9 --- /dev/null +++ b/Tools/peg_generator/mypy.ini @@ -0,0 +1,26 @@ +[mypy] +files = pegen, scripts + +follow_imports = error +no_implicit_optional = True +strict_optional = True + +#check_untyped_defs = True +disallow_untyped_calls = True +disallow_untyped_defs = True + +disallow_any_generics = true +disallow_any_unimported = True +disallow_incomplete_defs = True +disallow_subclassing_any = True + +warn_unused_configs = True +warn_unused_ignores = true +warn_redundant_casts = true +warn_no_return = True + +show_traceback = True +show_error_codes = True + +[mypy-pegen.grammar_parser] +strict_optional = False diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c new file mode 100644 index 0000000000000..d8d36a0a1a5b0 --- /dev/null +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -0,0 +1,153 @@ +#include "pegen.h" + +PyObject * +_build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *arena) +{ + PyObject *result = NULL; + + if (mode == 2) { + result = (PyObject *)PyAST_CompileObject(module, filename_ob, NULL, -1, arena); + } else if (mode == 1) { + result = PyAST_mod2obj(module); + } else { + result = Py_None; + Py_INCREF(result); + + } + + return result; +} + +static PyObject * +parse_file(PyObject *self, PyObject *args, PyObject *kwds) +{ + static char *keywords[] = {"file", "mode", NULL}; + const char *filename; + int mode = 2; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", keywords, &filename, &mode)) { + return NULL; + } + if (mode < 0 || mode > 2) { + return PyErr_Format(PyExc_ValueError, "Bad mode, must be 0 <= mode <= 2"); + } + + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyObject *result = NULL; + + PyObject *filename_ob = PyUnicode_FromString(filename); + if (filename_ob == NULL) { + goto error; + } + + mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, arena); + if (res == NULL) { + goto error; + } + + result = _build_return_object(res, mode, filename_ob, arena); + +error: + Py_XDECREF(filename_ob); + PyArena_Free(arena); + return result; +} + +static PyObject * +parse_string(PyObject *self, PyObject *args, PyObject *kwds) +{ + static char *keywords[] = {"str", "mode", NULL}; + const char *the_string; + int mode = 2; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|i", keywords, &the_string, &mode)) { + return NULL; + } + if (mode < 0 || mode > 2) { + return PyErr_Format(PyExc_ValueError, "Bad mode, must be 0 <= mode <= 2"); + } + + PyArena *arena = PyArena_New(); + if (arena == NULL) { + return NULL; + } + + PyObject *result = NULL; + + PyObject *filename_ob = PyUnicode_FromString(""); + if (filename_ob == NULL) { + goto error; + } + + mod_ty res = _PyPegen_run_parser_from_string(the_string, Py_file_input, filename_ob, + PyCF_IGNORE_COOKIE, arena); + if (res == NULL) { + goto error; + } + result = _build_return_object(res, mode, filename_ob, arena); + +error: + Py_XDECREF(filename_ob); + PyArena_Free(arena); + return result; +} + +static PyObject * +clear_memo_stats() +{ + _PyPegen_clear_memo_statistics(); + Py_RETURN_NONE; +} + +static PyObject * +get_memo_stats() +{ + return _PyPegen_get_memo_statistics(); +} + +// TODO: Write to Python's sys.stdout instead of C's stdout. +static PyObject * +dump_memo_stats() +{ + PyObject *list = _PyPegen_get_memo_statistics(); + if (list == NULL) { + return NULL; + } + Py_ssize_t len = PyList_Size(list); + for (Py_ssize_t i = 0; i < len; i++) { + PyObject *value = PyList_GetItem(list, i); // Borrowed reference. + long count = PyLong_AsLong(value); + if (count < 0) { + break; + } + if (count > 0) { + printf("%4ld %9ld\n", i, count); + } + } + Py_DECREF(list); + Py_RETURN_NONE; +} + +static PyMethodDef ParseMethods[] = { + {"parse_file", (PyCFunction)(void(*)(void))parse_file, METH_VARARGS|METH_KEYWORDS, "Parse a file."}, + {"parse_string", (PyCFunction)(void(*)(void))parse_string, METH_VARARGS|METH_KEYWORDS, "Parse a string."}, + {"clear_memo_stats", clear_memo_stats, METH_NOARGS}, + {"dump_memo_stats", dump_memo_stats, METH_NOARGS}, + {"get_memo_stats", get_memo_stats, METH_NOARGS}, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +static struct PyModuleDef parsemodule = { + PyModuleDef_HEAD_INIT, + .m_name = "parse", + .m_doc = "A parser.", + .m_methods = ParseMethods, +}; + +PyMODINIT_FUNC +PyInit_parse(void) +{ + return PyModule_Create(&parsemodule); +} diff --git a/Tools/peg_generator/pegen/__init__.py b/Tools/peg_generator/pegen/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/Tools/peg_generator/pegen/__main__.py b/Tools/peg_generator/pegen/__main__.py new file mode 100755 index 0000000000000..874b307ab5c18 --- /dev/null +++ b/Tools/peg_generator/pegen/__main__.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3.8 + +"""pegen -- PEG Generator. + +Search the web for PEG Parsers for reference. +""" + +import argparse +import sys +import time +import token +import traceback + +from typing import Final + +from pegen.build import build_parser_and_generator +from pegen.testutil import print_memstats + + +argparser = argparse.ArgumentParser( + prog="pegen", description="Experimental PEG-like parser generator" +) +argparser.add_argument("-q", "--quiet", action="store_true", help="Don't print the parsed grammar") +argparser.add_argument( + "-v", + "--verbose", + action="count", + default=0, + help="Print timing stats; repeat for more debug output", +) +argparser.add_argument( + "-c", "--cpython", action="store_true", help="Generate C code for inclusion into CPython" +) +argparser.add_argument( + "--compile-extension", + action="store_true", + help="Compile generated C code into an extension module", +) +argparser.add_argument( + "-o", + "--output", + metavar="OUT", + help="Where to write the generated parser (default parse.py or parse.c)", +) +argparser.add_argument("filename", help="Grammar description") +argparser.add_argument( + "--optimized", action="store_true", help="Compile the extension in optimized mode" +) +argparser.add_argument( + "--skip-actions", action="store_true", help="Suppress code emission for rule actions", +) + + +def main() -> None: + args = argparser.parse_args() + verbose = args.verbose + verbose_tokenizer = verbose >= 3 + verbose_parser = verbose == 2 or verbose >= 4 + t0 = time.time() + + output_file = args.output + if not output_file: + if args.cpython: + output_file = "parse.c" + else: + output_file = "parse.py" + + try: + grammar, parser, tokenizer, gen = build_parser_and_generator( + args.filename, + output_file, + args.compile_extension, + verbose_tokenizer, + verbose_parser, + args.verbose, + keep_asserts_in_extension=False if args.optimized else True, + skip_actions=args.skip_actions, + ) + except Exception as err: + if args.verbose: + raise # Show traceback + traceback.print_exception(err.__class__, err, None) + sys.stderr.write("For full traceback, use -v\n") + sys.exit(1) + + if not args.quiet: + if args.verbose: + print("Raw Grammar:") + for line in repr(grammar).splitlines(): + print(" ", line) + + print("Clean Grammar:") + for line in str(grammar).splitlines(): + print(" ", line) + + if args.verbose: + print("First Graph:") + for src, dsts in gen.first_graph.items(): + print(f" {src} -> {', '.join(dsts)}") + print("First SCCS:") + for scc in gen.first_sccs: + print(" ", scc, end="") + if len(scc) > 1: + print( + " # Indirectly left-recursive; leaders:", + {name for name in scc if grammar.rules[name].leader}, + ) + else: + name = next(iter(scc)) + if name in gen.first_graph[name]: + print(" # Left-recursive") + else: + print() + + t1 = time.time() + + if args.verbose: + dt = t1 - t0 + diag = tokenizer.diagnose() + nlines = diag.end[0] + if diag.type == token.ENDMARKER: + nlines -= 1 + print(f"Total time: {dt:.3f} sec; {nlines} lines", end="") + if dt: + print(f"; {nlines / dt:.0f} lines/sec") + else: + print() + print("Caches sizes:") + print(f" token array : {len(tokenizer._tokens):10}") + print(f" cache : {len(parser._cache):10}") + if not print_memstats(): + print("(Can't find psutil; install it for memory stats.)") + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py new file mode 100644 index 0000000000000..623b4aeb66069 --- /dev/null +++ b/Tools/peg_generator/pegen/build.py @@ -0,0 +1,169 @@ +import pathlib +import shutil +import tokenize + +from typing import Optional, Tuple + +import distutils.log +from distutils.core import Distribution, Extension +from distutils.command.clean import clean # type: ignore +from distutils.command.build_ext import build_ext # type: ignore + +from pegen.c_generator import CParserGenerator +from pegen.grammar import Grammar +from pegen.grammar_parser import GeneratedParser as GrammarParser +from pegen.parser import Parser +from pegen.parser_generator import ParserGenerator +from pegen.python_generator import PythonParserGenerator +from pegen.tokenizer import Tokenizer + +MOD_DIR = pathlib.Path(__file__).parent + + +def compile_c_extension( + generated_source_path: str, + build_dir: Optional[str] = None, + verbose: bool = False, + keep_asserts: bool = True, +) -> str: + """Compile the generated source for a parser generator into an extension module. + + The extension module will be generated in the same directory as the provided path + for the generated source, with the same basename (in addition to extension module + metadata). For example, for the source mydir/parser.c the generated extension + in a darwin system with python 3.8 will be mydir/parser.cpython-38-darwin.so. + + If *build_dir* is provided, that path will be used as the temporary build directory + of distutils (this is useful in case you want to use a temporary directory). + """ + if verbose: + distutils.log.set_verbosity(distutils.log.DEBUG) + + source_file_path = pathlib.Path(generated_source_path) + extension_name = source_file_path.stem + extra_compile_args = [] + if keep_asserts: + extra_compile_args.append("-UNDEBUG") + extension = [ + Extension( + extension_name, + sources=[ + str(MOD_DIR.parent.parent.parent / "Python" / "Python-ast.c"), + str(MOD_DIR.parent.parent.parent / "Python" / "asdl.c"), + str(MOD_DIR.parent.parent.parent / "Parser" / "tokenizer.c"), + str(MOD_DIR.parent.parent.parent / "Parser" / "pegen" / "pegen.c"), + str(MOD_DIR.parent.parent.parent / "Parser" / "pegen" / "parse_string.c"), + str(MOD_DIR.parent / "peg_extension" / "peg_extension.c"), + generated_source_path, + ], + include_dirs=[ + str(MOD_DIR.parent.parent.parent / "Include" / "internal"), + str(MOD_DIR.parent.parent.parent / "Parser"), + str(MOD_DIR.parent.parent.parent / "Parser" / "pegen"), + ], + extra_compile_args=extra_compile_args, + ) + ] + dist = Distribution({"name": extension_name, "ext_modules": extension}) + cmd = build_ext(dist) + cmd.inplace = True + if build_dir: + cmd.build_temp = build_dir + cmd.ensure_finalized() + cmd.run() + + extension_path = source_file_path.parent / cmd.get_ext_filename(extension_name) + shutil.move(cmd.get_ext_fullpath(extension_name), extension_path) + + cmd = clean(dist) + cmd.finalize_options() + cmd.run() + + return extension_path + + +def build_parser( + grammar_file: str, verbose_tokenizer: bool = False, verbose_parser: bool = False +) -> Tuple[Grammar, Parser, Tokenizer]: + with open(grammar_file) as file: + tokenizer = Tokenizer(tokenize.generate_tokens(file.readline), verbose=verbose_tokenizer) + parser = GrammarParser(tokenizer, verbose=verbose_parser) + grammar = parser.start() + + if not grammar: + raise parser.make_syntax_error(grammar_file) + + return grammar, parser, tokenizer + + +def build_generator( + tokenizer: Tokenizer, + grammar: Grammar, + grammar_file: str, + output_file: str, + compile_extension: bool = False, + verbose_c_extension: bool = False, + keep_asserts_in_extension: bool = True, + skip_actions: bool = False, +) -> ParserGenerator: + # TODO: Allow other extensions; pass the output type as an argument. + if not output_file.endswith((".c", ".py")): + raise RuntimeError("Your output file must either be a .c or .py file") + with open(output_file, "w") as file: + gen: ParserGenerator + if output_file.endswith(".c"): + gen = CParserGenerator(grammar, file, skip_actions=skip_actions) + elif output_file.endswith(".py"): + gen = PythonParserGenerator(grammar, file) # TODO: skip_actions + else: + assert False # Should have been checked above + gen.generate(grammar_file) + + if compile_extension and output_file.endswith(".c"): + compile_c_extension( + output_file, verbose=verbose_c_extension, keep_asserts=keep_asserts_in_extension + ) + + return gen + + +def build_parser_and_generator( + grammar_file: str, + output_file: str, + compile_extension: bool = False, + verbose_tokenizer: bool = False, + verbose_parser: bool = False, + verbose_c_extension: bool = False, + keep_asserts_in_extension: bool = True, + skip_actions: bool = False, +) -> Tuple[Grammar, Parser, Tokenizer, ParserGenerator]: + """Generate rules, parser, tokenizer, parser generator for a given grammar + + Args: + grammar_file (string): Path for the grammar file + output_file (string): Path for the output file + compile_extension (bool, optional): Whether to compile the C extension. + Defaults to False. + verbose_tokenizer (bool, optional): Whether to display additional output + when generating the tokenizer. Defaults to False. + verbose_parser (bool, optional): Whether to display additional output + when generating the parser. Defaults to False. + verbose_c_extension (bool, optional): Whether to display additional + output when compiling the C extension . Defaults to False. + keep_asserts_in_extension (bool, optional): Whether to keep the assert statements + when compiling the extension module. Defaults to True. + skip_actions (bool, optional): Whether to pretend no rule has any actions. + """ + grammar, parser, tokenizer = build_parser(grammar_file, verbose_tokenizer, verbose_parser) + gen = build_generator( + tokenizer, + grammar, + grammar_file, + output_file, + compile_extension, + verbose_c_extension, + keep_asserts_in_extension, + skip_actions=skip_actions, + ) + + return grammar, parser, tokenizer, gen diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py new file mode 100644 index 0000000000000..ce732a09f096b --- /dev/null +++ b/Tools/peg_generator/pegen/c_generator.py @@ -0,0 +1,605 @@ +import ast +import re +from typing import Any, cast, Dict, IO, Optional, List, Text, Tuple + +from pegen.grammar import ( + Cut, + GrammarVisitor, + Rhs, + Alt, + NamedItem, + NameLeaf, + StringLeaf, + Lookahead, + PositiveLookahead, + NegativeLookahead, + Opt, + Repeat0, + Repeat1, + Gather, + Group, + Rule, +) +from pegen import grammar +from pegen.parser_generator import dedupe, ParserGenerator +from pegen.tokenizer import exact_token_types + +EXTENSION_PREFIX = """\ +#include "pegen.h" + +""" + +EXTENSION_SUFFIX = """ +void * +_PyPegen_parse(Parser *p) +{ + // Initialize keywords + p->keywords = reserved_keywords; + p->n_keyword_lists = n_keyword_lists; + + return start_rule(p); +} +""" + + +class CCallMakerVisitor(GrammarVisitor): + def __init__(self, parser_generator: ParserGenerator): + self.gen = parser_generator + self.cache: Dict[Any, Any] = {} + self.keyword_cache: Dict[str, int] = {} + + def keyword_helper(self, keyword: str) -> Tuple[str, str]: + if keyword not in self.keyword_cache: + self.keyword_cache[keyword] = self.gen.keyword_type() + return "keyword", f"_PyPegen_expect_token(p, {self.keyword_cache[keyword]})" + + def visit_NameLeaf(self, node: NameLeaf) -> Tuple[str, str]: + name = node.value + if name in ("NAME", "NUMBER", "STRING"): + name = name.lower() + return f"{name}_var", f"_PyPegen_{name}_token(p)" + if name in ("NEWLINE", "DEDENT", "INDENT", "ENDMARKER", "ASYNC", "AWAIT"): + name = name.lower() + return f"{name}_var", f"_PyPegen_{name}_token(p)" + return f"{name}_var", f"{name}_rule(p)" + + def visit_StringLeaf(self, node: StringLeaf) -> Tuple[str, str]: + val = ast.literal_eval(node.value) + if re.match(r"[a-zA-Z_]\w*\Z", val): # This is a keyword + return self.keyword_helper(val) + else: + assert val in exact_token_types, f"{node.value} is not a known literal" + type = exact_token_types[val] + return "literal", f"_PyPegen_expect_token(p, {type})" + + def visit_Rhs(self, node: Rhs) -> Tuple[Optional[str], str]: + if node in self.cache: + return self.cache[node] + if len(node.alts) == 1 and len(node.alts[0].items) == 1: + self.cache[node] = self.visit(node.alts[0].items[0]) + else: + name = self.gen.name_node(node) + self.cache[node] = f"{name}_var", f"{name}_rule(p)" + return self.cache[node] + + def visit_NamedItem(self, node: NamedItem) -> Tuple[Optional[str], str]: + name, call = self.visit(node.item) + if node.name: + name = node.name + return name, call + + def lookahead_call_helper(self, node: Lookahead, positive: int) -> Tuple[None, str]: + name, call = self.visit(node.node) + func, args = call.split("(", 1) + assert args[-1] == ")" + args = args[:-1] + if not args.startswith("p,"): + return None, f"_PyPegen_lookahead({positive}, {func}, {args})" + elif args[2:].strip().isalnum(): + return None, f"_PyPegen_lookahead_with_int({positive}, {func}, {args})" + else: + return None, f"_PyPegen_lookahead_with_string({positive}, {func}, {args})" + + def visit_PositiveLookahead(self, node: PositiveLookahead) -> Tuple[None, str]: + return self.lookahead_call_helper(node, 1) + + def visit_NegativeLookahead(self, node: NegativeLookahead) -> Tuple[None, str]: + return self.lookahead_call_helper(node, 0) + + def visit_Opt(self, node: Opt) -> Tuple[str, str]: + name, call = self.visit(node.node) + return "opt_var", f"{call}, 1" # Using comma operator! + + def visit_Repeat0(self, node: Repeat0) -> Tuple[str, str]: + if node in self.cache: + return self.cache[node] + name = self.gen.name_loop(node.node, False) + self.cache[node] = f"{name}_var", f"{name}_rule(p)" + return self.cache[node] + + def visit_Repeat1(self, node: Repeat1) -> Tuple[str, str]: + if node in self.cache: + return self.cache[node] + name = self.gen.name_loop(node.node, True) + self.cache[node] = f"{name}_var", f"{name}_rule(p)" + return self.cache[node] + + def visit_Gather(self, node: Gather) -> Tuple[str, str]: + if node in self.cache: + return self.cache[node] + name = self.gen.name_gather(node) + self.cache[node] = f"{name}_var", f"{name}_rule(p)" + return self.cache[node] + + def visit_Group(self, node: Group) -> Tuple[Optional[str], str]: + return self.visit(node.rhs) + + def visit_Cut(self, node: Cut) -> Tuple[str, str]: + return "cut_var", "1" + + +class CParserGenerator(ParserGenerator, GrammarVisitor): + def __init__( + self, + grammar: grammar.Grammar, + file: Optional[IO[Text]], + debug: bool = False, + skip_actions: bool = False, + ): + super().__init__(grammar, file) + self.callmakervisitor: CCallMakerVisitor = CCallMakerVisitor(self) + self._varname_counter = 0 + self.debug = debug + self.skip_actions = skip_actions + + def unique_varname(self, name: str = "tmpvar") -> str: + new_var = name + "_" + str(self._varname_counter) + self._varname_counter += 1 + return new_var + + def call_with_errorcheck_return(self, call_text: str, returnval: str) -> None: + error_var = self.unique_varname() + self.print(f"int {error_var} = {call_text};") + self.print(f"if ({error_var}) {{") + with self.indent(): + self.print(f"return {returnval};") + self.print(f"}}") + + def call_with_errorcheck_goto(self, call_text: str, goto_target: str) -> None: + error_var = self.unique_varname() + self.print(f"int {error_var} = {call_text};") + self.print(f"if ({error_var}) {{") + with self.indent(): + self.print(f"goto {goto_target};") + self.print(f"}}") + + def out_of_memory_return( + self, expr: str, returnval: str, message: str = "Parser out of memory", cleanup_code=None + ) -> None: + self.print(f"if ({expr}) {{") + with self.indent(): + self.print(f'PyErr_Format(PyExc_MemoryError, "{message}");') + if cleanup_code is not None: + self.print(cleanup_code) + self.print(f"return {returnval};") + self.print(f"}}") + + def out_of_memory_goto( + self, expr: str, goto_target: str, message: str = "Parser out of memory" + ) -> None: + self.print(f"if ({expr}) {{") + with self.indent(): + self.print(f'PyErr_Format(PyExc_MemoryError, "{message}");') + self.print(f"goto {goto_target};") + self.print(f"}}") + + def generate(self, filename: str) -> None: + self.collect_todo() + self.print(f"// @generated by pegen.py from {filename}") + header = self.grammar.metas.get("header", EXTENSION_PREFIX) + if header: + self.print(header.rstrip("\n")) + subheader = self.grammar.metas.get("subheader", "") + if subheader: + self.print(subheader) + self._setup_keywords() + for i, (rulename, rule) in enumerate(self.todo.items(), 1000): + comment = " // Left-recursive" if rule.left_recursive else "" + self.print(f"#define {rulename}_type {i}{comment}") + self.print() + for rulename, rule in self.todo.items(): + if rule.is_loop() or rule.is_gather(): + type = "asdl_seq *" + elif rule.type: + type = rule.type + " " + else: + type = "void *" + self.print(f"static {type}{rulename}_rule(Parser *p);") + self.print() + while self.todo: + for rulename, rule in list(self.todo.items()): + del self.todo[rulename] + self.print() + if rule.left_recursive: + self.print("// Left-recursive") + self.visit(rule) + if self.skip_actions: + mode = 0 + else: + mode = int(self.rules["start"].type == "mod_ty") if "start" in self.rules else 1 + if mode == 1 and self.grammar.metas.get("bytecode"): + mode += 1 + modulename = self.grammar.metas.get("modulename", "parse") + trailer = self.grammar.metas.get("trailer", EXTENSION_SUFFIX) + keyword_cache = self.callmakervisitor.keyword_cache + if trailer: + self.print(trailer.rstrip("\n") % dict(mode=mode, modulename=modulename)) + + def _group_keywords_by_length(self) -> Dict[int, List[Tuple[str, int]]]: + groups: Dict[int, List[Tuple[str, int]]] = {} + for keyword_str, keyword_type in self.callmakervisitor.keyword_cache.items(): + length = len(keyword_str) + if length in groups: + groups[length].append((keyword_str, keyword_type)) + else: + groups[length] = [(keyword_str, keyword_type)] + return groups + + def _setup_keywords(self) -> None: + keyword_cache = self.callmakervisitor.keyword_cache + n_keyword_lists = ( + len(max(keyword_cache.keys(), key=len)) + 1 if len(keyword_cache) > 0 else 0 + ) + self.print(f"static const int n_keyword_lists = {n_keyword_lists};") + groups = self._group_keywords_by_length() + self.print("static KeywordToken *reserved_keywords[] = {") + with self.indent(): + 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,") + else: + self.print("(KeywordToken[]) {") + with self.indent(): + for keyword_str, keyword_type in groups[keywords_length]: + self.print(f'{{"{keyword_str}", {keyword_type}}},') + self.print("{NULL, -1},") + self.print("},") + self.print("};") + + def _set_up_token_start_metadata_extraction(self) -> None: + self.print("if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) {") + with self.indent(): + self.print("p->error_indicator = 1;") + self.print("return NULL;") + self.print("}") + self.print("int start_lineno = p->tokens[mark]->lineno;") + self.print("UNUSED(start_lineno); // Only used by EXTRA macro") + self.print("int start_col_offset = p->tokens[mark]->col_offset;") + self.print("UNUSED(start_col_offset); // Only used by EXTRA macro") + + def _set_up_token_end_metadata_extraction(self) -> None: + self.print("Token *token = _PyPegen_get_last_nonnwhitespace_token(p);") + self.print("if (token == NULL) {") + with self.indent(): + self.print("return NULL;") + self.print("}") + self.print(f"int end_lineno = token->end_lineno;") + self.print("UNUSED(end_lineno); // Only used by EXTRA macro") + self.print(f"int end_col_offset = token->end_col_offset;") + self.print("UNUSED(end_col_offset); // Only used by EXTRA macro") + + def _set_up_rule_memoization(self, node: Rule, result_type: str) -> None: + self.print("{") + with self.indent(): + self.print(f"{result_type} res = NULL;") + self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &res))") + with self.indent(): + self.print("return res;") + self.print("int mark = p->mark;") + self.print("int resmark = p->mark;") + self.print("while (1) {") + with self.indent(): + self.call_with_errorcheck_return( + f"_PyPegen_update_memo(p, mark, {node.name}_type, res)", "res" + ) + self.print("p->mark = mark;") + self.print(f"void *raw = {node.name}_raw(p);") + self.print("if (raw == NULL || p->mark <= resmark)") + with self.indent(): + self.print("break;") + self.print("resmark = p->mark;") + self.print("res = raw;") + self.print("}") + self.print("p->mark = resmark;") + self.print("return res;") + self.print("}") + self.print(f"static {result_type}") + self.print(f"{node.name}_raw(Parser *p)") + + def _should_memoize(self, node: Rule) -> bool: + return node.memo and not node.left_recursive + + def _handle_default_rule_body(self, node: Rule, rhs: Rhs, result_type: str) -> None: + memoize = self._should_memoize(node) + + with self.indent(): + self.print("if (p->error_indicator) {") + with self.indent(): + self.print("return NULL;") + self.print("}") + self.print(f"{result_type} res = NULL;") + if memoize: + self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &res))") + with self.indent(): + self.print("return res;") + self.print("int mark = p->mark;") + if any(alt.action and "EXTRA" in alt.action for alt in rhs.alts): + self._set_up_token_start_metadata_extraction() + self.visit( + rhs, + is_loop=False, + is_gather=node.is_gather(), + rulename=node.name if memoize else None, + ) + if self.debug: + self.print(f'fprintf(stderr, "Fail at %d: {node.name}\\n", p->mark);') + self.print("res = NULL;") + self.print(" done:") + with self.indent(): + if memoize: + self.print(f"_PyPegen_insert_memo(p, mark, {node.name}_type, res);") + self.print("return res;") + + def _handle_loop_rule_body(self, node: Rule, rhs: Rhs) -> None: + memoize = self._should_memoize(node) + is_repeat1 = node.name.startswith("_loop1") + + with self.indent(): + self.print("if (p->error_indicator) {") + with self.indent(): + self.print("return NULL;") + self.print("}") + self.print(f"void *res = NULL;") + if memoize: + self.print(f"if (_PyPegen_is_memoized(p, {node.name}_type, &res))") + with self.indent(): + self.print("return res;") + self.print("int mark = p->mark;") + self.print("int start_mark = p->mark;") + self.print("void **children = PyMem_Malloc(sizeof(void *));") + self.out_of_memory_return(f"!children", "NULL") + self.print("ssize_t children_capacity = 1;") + self.print("ssize_t n = 0;") + if any(alt.action and "EXTRA" in alt.action for alt in rhs.alts): + self._set_up_token_start_metadata_extraction() + self.visit( + rhs, + is_loop=True, + is_gather=node.is_gather(), + rulename=node.name if memoize else None, + ) + if is_repeat1: + self.print("if (n == 0) {") + with self.indent(): + self.print("PyMem_Free(children);") + self.print("return NULL;") + self.print("}") + self.print("asdl_seq *seq = _Py_asdl_seq_new(n, p->arena);") + self.out_of_memory_return( + f"!seq", + "NULL", + message=f"asdl_seq_new {node.name}", + cleanup_code="PyMem_Free(children);", + ) + self.print("for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]);") + self.print("PyMem_Free(children);") + if node.name: + self.print(f"_PyPegen_insert_memo(p, start_mark, {node.name}_type, seq);") + self.print("return seq;") + + def visit_Rule(self, node: Rule) -> None: + is_loop = node.is_loop() + is_gather = node.is_gather() + rhs = node.flatten() + if is_loop or is_gather: + result_type = "asdl_seq *" + elif node.type: + result_type = node.type + else: + result_type = "void *" + + for line in str(node).splitlines(): + self.print(f"// {line}") + if node.left_recursive and node.leader: + self.print(f"static {result_type} {node.name}_raw(Parser *);") + + self.print(f"static {result_type}") + self.print(f"{node.name}_rule(Parser *p)") + + if node.left_recursive and node.leader: + self._set_up_rule_memoization(node, result_type) + + self.print("{") + if is_loop: + self._handle_loop_rule_body(node, rhs) + else: + self._handle_default_rule_body(node, rhs, result_type) + self.print("}") + + def visit_NamedItem(self, node: NamedItem, names: List[str]) -> None: + name, call = self.callmakervisitor.visit(node) + if not name: + self.print(call) + else: + name = dedupe(name, names) + self.print(f"({name} = {call})") + + def visit_Rhs( + self, node: Rhs, is_loop: bool, is_gather: bool, rulename: Optional[str] + ) -> None: + if is_loop: + assert len(node.alts) == 1 + for alt in node.alts: + self.visit(alt, is_loop=is_loop, is_gather=is_gather, rulename=rulename) + + def join_conditions(self, keyword: str, node: Any, names: List[str]) -> None: + self.print(f"{keyword} (") + with self.indent(): + first = True + for item in node.items: + if first: + first = False + else: + self.print("&&") + self.visit(item, names=names) + self.print(")") + + def emit_action(self, node: Alt, cleanup_code=None) -> None: + self.print(f"res = {node.action};") + + self.print("if (res == NULL && PyErr_Occurred()) {") + with self.indent(): + self.print("p->error_indicator = 1;") + if cleanup_code: + self.print(cleanup_code) + self.print("return NULL;") + self.print("}") + + if self.debug: + self.print( + f'fprintf(stderr, "Hit with action [%d-%d]: %s\\n", mark, p->mark, "{node}");' + ) + + def emit_default_action(self, is_gather: bool, names: List[str], node: Alt) -> None: + if len(names) > 1: + if is_gather: + assert len(names) == 2 + self.print(f"res = _PyPegen_seq_insert_in_front(p, {names[0]}, {names[1]});") + else: + if self.debug: + self.print( + f'fprintf(stderr, "Hit without action [%d:%d]: %s\\n", mark, p->mark, "{node}");' + ) + self.print(f"res = _PyPegen_dummy_name(p, {', '.join(names)});") + else: + if self.debug: + self.print( + f'fprintf(stderr, "Hit with default action [%d:%d]: %s\\n", mark, p->mark, "{node}");' + ) + self.print(f"res = {names[0]};") + + def emit_dummy_action(self) -> None: + self.print(f"res = _PyPegen_dummy_name(p);") + + def handle_alt_normal(self, node: Alt, is_gather: bool, names: List[str]) -> None: + self.join_conditions(keyword="if", node=node, names=names) + self.print("{") + # We have parsed successfully all the conditions for the option. + with self.indent(): + # Prepare to emmit the rule action and do so + if node.action and "EXTRA" in node.action: + self._set_up_token_end_metadata_extraction() + if self.skip_actions: + self.emit_dummy_action() + elif node.action: + self.emit_action(node) + else: + self.emit_default_action(is_gather, names, node) + + # As the current option has parsed correctly, do not continue with the rest. + self.print(f"goto done;") + self.print("}") + + def handle_alt_loop( + self, node: Alt, is_gather: bool, rulename: Optional[str], names: List[str] + ) -> None: + # Condition of the main body of the alternative + self.join_conditions(keyword="while", node=node, names=names) + self.print("{") + # We have parsed successfully one item! + with self.indent(): + # Prepare to emit the rule action and do so + if node.action and "EXTRA" in node.action: + self._set_up_token_end_metadata_extraction() + if self.skip_actions: + self.emit_dummy_action() + elif node.action: + self.emit_action(node, cleanup_code="PyMem_Free(children);") + else: + self.emit_default_action(is_gather, names, node) + + # Add the result of rule to the temporary buffer of children. This buffer + # will populate later an asdl_seq with all elements to return. + self.print("if (n == children_capacity) {") + with self.indent(): + self.print("children_capacity *= 2;") + self.print("children = PyMem_Realloc(children, children_capacity*sizeof(void *));") + self.out_of_memory_return(f"!children", "NULL", message=f"realloc {rulename}") + self.print("}") + self.print(f"children[n++] = res;") + self.print("mark = p->mark;") + self.print("}") + + def visit_Alt( + self, node: Alt, is_loop: bool, is_gather: bool, rulename: Optional[str] + ) -> None: + self.print(f"{{ // {node}") + with self.indent(): + # Prepare variable declarations for the alternative + vars = self.collect_vars(node) + for v, var_type in sorted(item for item in vars.items() if item[0] is not None): + if not var_type: + var_type = "void *" + else: + var_type += " " + if v == "cut_var": + v += " = 0" # cut_var must be initialized + self.print(f"{var_type}{v};") + if v == "opt_var": + self.print("UNUSED(opt_var); // Silence compiler warnings") + + names: List[str] = [] + if is_loop: + self.handle_alt_loop(node, is_gather, rulename, names) + else: + self.handle_alt_normal(node, is_gather, names) + + self.print("p->mark = mark;") + if "cut_var" in names: + self.print("if (cut_var) return NULL;") + self.print("}") + + def collect_vars(self, node: Alt) -> Dict[str, Optional[str]]: + names: List[str] = [] + types = {} + for item in node.items: + name, type = self.add_var(item, names) + types[name] = type + return types + + def add_var(self, node: NamedItem, names: List[str]) -> Tuple[str, Optional[str]]: + name: str + call: str + name, call = self.callmakervisitor.visit(node.item) + type = None + if not name: + return name, type + if name.startswith("cut"): + return name, "int" + if name.endswith("_var"): + rulename = name[:-4] + rule = self.rules.get(rulename) + if rule is not None: + if rule.is_loop() or rule.is_gather(): + type = "asdl_seq *" + else: + type = rule.type + elif name.startswith("_loop") or name.startswith("_gather"): + type = "asdl_seq *" + elif name in ("name_var", "string_var", "number_var"): + type = "expr_ty" + if node.name: + name = node.name + name = dedupe(name, names) + return name, type diff --git a/Tools/peg_generator/pegen/first_sets.py b/Tools/peg_generator/pegen/first_sets.py new file mode 100755 index 0000000000000..da30eba99ce5a --- /dev/null +++ b/Tools/peg_generator/pegen/first_sets.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3.8 + +import argparse +import collections +import pprint +import sys +from typing import Optional, Set, Dict + +from pegen.build import build_parser +from pegen.grammar import ( + Alt, + Cut, + Gather, + Grammar, + GrammarVisitor, + Group, + Leaf, + Lookahead, + NamedItem, + NameLeaf, + NegativeLookahead, + Opt, + Repeat, + Repeat0, + Repeat1, + Rhs, + Rule, + StringLeaf, + PositiveLookahead, +) + +argparser = argparse.ArgumentParser( + prog="calculate_first_sets", description="Calculate the first sets of a grammar", +) +argparser.add_argument("grammar_file", help="The grammar file") + + +class FirstSetCalculator(GrammarVisitor): + def __init__(self, rules: Dict[str, Rule]) -> None: + self.rules = rules + for rule in rules.values(): + rule.nullable_visit(rules) + self.first_sets: Dict[str, Set[str]] = dict() + self.in_process: Set[str] = set() + + def calculate(self) -> Dict[str, Set[str]]: + for name, rule in self.rules.items(): + self.visit(rule) + return self.first_sets + + def visit_Alt(self, item: Alt) -> Set[str]: + result: Set[str] = set() + to_remove: Set[str] = set() + for other in item.items: + new_terminals = self.visit(other) + if isinstance(other.item, NegativeLookahead): + to_remove |= new_terminals + result |= new_terminals + if to_remove: + result -= to_remove + + # If the set of new terminals can start with the empty string, + # it means that the item is completelly nullable and we should + # also considering at least the next item in case the current + # one fails to parse. + + if "" in new_terminals: + continue + + if not isinstance(other.item, (Opt, NegativeLookahead, Repeat0)): + break + + # Do not allow the empty string to propagate. + result.discard("") + + return result + + def visit_Cut(self, item: Cut) -> Set[str]: + return set() + + def visit_Group(self, item: Group) -> Set[str]: + return self.visit(item.rhs) + + def visit_PositiveLookahead(self, item: Lookahead) -> Set[str]: + return self.visit(item.node) + + def visit_NegativeLookahead(self, item: NegativeLookahead) -> Set[str]: + return self.visit(item.node) + + def visit_NamedItem(self, item: NamedItem) -> Set[str]: + return self.visit(item.item) + + def visit_Opt(self, item: Opt) -> Set[str]: + return self.visit(item.node) + + def visit_Gather(self, item: Gather) -> Set[str]: + return self.visit(item.node) + + def visit_Repeat0(self, item: Repeat0) -> Set[str]: + return self.visit(item.node) + + def visit_Repeat1(self, item: Repeat1) -> Set[str]: + return self.visit(item.node) + + def visit_NameLeaf(self, item: NameLeaf) -> Set[str]: + if item.value not in self.rules: + return {item.value} + + if item.value not in self.first_sets: + self.first_sets[item.value] = self.visit(self.rules[item.value]) + return self.first_sets[item.value] + elif item.value in self.in_process: + return set() + + return self.first_sets[item.value] + + def visit_StringLeaf(self, item: StringLeaf) -> Set[str]: + return {item.value} + + def visit_Rhs(self, item: Rhs) -> Set[str]: + result: Set[str] = set() + for alt in item.alts: + result |= self.visit(alt) + return result + + def visit_Rule(self, item: Rule) -> Set[str]: + if item.name in self.in_process: + return set() + elif item.name not in self.first_sets: + self.in_process.add(item.name) + terminals = self.visit(item.rhs) + if item.nullable: + terminals.add("") + self.first_sets[item.name] = terminals + self.in_process.remove(item.name) + return self.first_sets[item.name] + + +def main() -> None: + args = argparser.parse_args() + + try: + grammar, parser, tokenizer = build_parser(args.grammar_file) + except Exception as err: + print("ERROR: Failed to parse grammar file", file=sys.stderr) + sys.exit(1) + + firs_sets = FirstSetCalculator(grammar.rules).calculate() + pprint.pprint(firs_sets) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/pegen/grammar.py b/Tools/peg_generator/pegen/grammar.py new file mode 100644 index 0000000000000..67039d5a032ab --- /dev/null +++ b/Tools/peg_generator/pegen/grammar.py @@ -0,0 +1,470 @@ +from __future__ import annotations + +from abc import abstractmethod +from typing import ( + AbstractSet, + Any, + Callable, + Dict, + Iterable, + Iterator, + List, + Optional, + Set, + Tuple, + TYPE_CHECKING, + TypeVar, + Union, +) + +from pegen.parser import memoize, Parser + +if TYPE_CHECKING: + from pegen.parser_generator import ParserGenerator + + +class GrammarError(Exception): + pass + + +class GrammarVisitor: + def visit(self, node: Any, *args: Any, **kwargs: Any) -> Any: + """Visit a node.""" + method = "visit_" + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + return visitor(node, *args, **kwargs) + + def generic_visit(self, node: Iterable[Any], *args: Any, **kwargs: Any) -> None: + """Called if no explicit visitor function exists for a node.""" + for value in node: + if isinstance(value, list): + for item in value: + self.visit(item, *args, **kwargs) + else: + self.visit(value, *args, **kwargs) + + +class Grammar: + def __init__(self, rules: Iterable[Rule], metas: Iterable[Tuple[str, Optional[str]]]): + self.rules = {rule.name: rule for rule in rules} + self.metas = dict(metas) + + def __str__(self) -> str: + return "\n".join(str(rule) for name, rule in self.rules.items()) + + def __repr__(self) -> str: + lines = ["Grammar("] + lines.append(" [") + for rule in self.rules.values(): + lines.append(f" {repr(rule)},") + lines.append(" ],") + lines.append(" {repr(list(self.metas.items()))}") + lines.append(")") + return "\n".join(lines) + + def __iter__(self) -> Iterator[Rule]: + yield from self.rules.values() + + +# Global flag whether we want actions in __str__() -- default off. +SIMPLE_STR = True + + +class Rule: + def __init__(self, name: str, type: Optional[str], rhs: Rhs, memo: Optional[object] = None): + self.name = name + self.type = type + self.rhs = rhs + self.memo = bool(memo) + self.visited = False + self.nullable = False + self.left_recursive = False + self.leader = False + + def is_loop(self) -> bool: + return self.name.startswith("_loop") + + def is_gather(self) -> bool: + return self.name.startswith("_gather") + + def __str__(self) -> str: + if SIMPLE_STR or self.type is None: + res = f"{self.name}: {self.rhs}" + else: + res = f"{self.name}[{self.type}]: {self.rhs}" + if len(res) < 88: + return res + lines = [res.split(":")[0] + ":"] + lines += [f" | {alt}" for alt in self.rhs.alts] + return "\n".join(lines) + + def __repr__(self) -> str: + return f"Rule({self.name!r}, {self.type!r}, {self.rhs!r})" + + def __iter__(self) -> Iterator[Rhs]: + yield self.rhs + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + if self.visited: + # A left-recursive rule is considered non-nullable. + return False + self.visited = True + self.nullable = self.rhs.nullable_visit(rules) + return self.nullable + + def initial_names(self) -> AbstractSet[str]: + return self.rhs.initial_names() + + def flatten(self) -> Rhs: + # If it's a single parenthesized group, flatten it. + rhs = self.rhs + if ( + not self.is_loop() + and len(rhs.alts) == 1 + and len(rhs.alts[0].items) == 1 + and isinstance(rhs.alts[0].items[0].item, Group) + ): + rhs = rhs.alts[0].items[0].item.rhs + return rhs + + def collect_todo(self, gen: ParserGenerator) -> None: + rhs = self.flatten() + rhs.collect_todo(gen) + + +class Leaf: + def __init__(self, value: str): + self.value = value + + def __str__(self) -> str: + return self.value + + def __iter__(self) -> Iterable[str]: + if False: + yield + + @abstractmethod + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + raise NotImplementedError + + @abstractmethod + def initial_names(self) -> AbstractSet[str]: + raise NotImplementedError + + +class NameLeaf(Leaf): + """The value is the name.""" + + def __str__(self) -> str: + if self.value == "ENDMARKER": + return "$" + return super().__str__() + + def __repr__(self) -> str: + return f"NameLeaf({self.value!r})" + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + if self.value in rules: + return rules[self.value].nullable_visit(rules) + # Token or unknown; never empty. + return False + + def initial_names(self) -> AbstractSet[str]: + return {self.value} + + +class StringLeaf(Leaf): + """The value is a string literal, including quotes.""" + + def __repr__(self) -> str: + return f"StringLeaf({self.value!r})" + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + # The string token '' is considered empty. + return not self.value + + def initial_names(self) -> AbstractSet[str]: + return set() + + +class Rhs: + def __init__(self, alts: List[Alt]): + self.alts = alts + self.memo: Optional[Tuple[Optional[str], str]] = None + + def __str__(self) -> str: + return " | ".join(str(alt) for alt in self.alts) + + def __repr__(self) -> str: + return f"Rhs({self.alts!r})" + + def __iter__(self) -> Iterator[List[Alt]]: + yield self.alts + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + for alt in self.alts: + if alt.nullable_visit(rules): + return True + return False + + def initial_names(self) -> AbstractSet[str]: + names: Set[str] = set() + for alt in self.alts: + names |= alt.initial_names() + return names + + def collect_todo(self, gen: ParserGenerator) -> None: + for alt in self.alts: + alt.collect_todo(gen) + + +class Alt: + def __init__(self, items: List[NamedItem], *, icut: int = -1, action: Optional[str] = None): + self.items = items + self.icut = icut + self.action = action + + def __str__(self) -> str: + core = " ".join(str(item) for item in self.items) + if not SIMPLE_STR and self.action: + return f"{core} {{ {self.action} }}" + else: + return core + + def __repr__(self) -> str: + args = [repr(self.items)] + if self.icut >= 0: + args.append(f"icut={self.icut}") + if self.action: + args.append(f"action={self.action!r}") + return f"Alt({', '.join(args)})" + + def __iter__(self) -> Iterator[List[NamedItem]]: + yield self.items + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + for item in self.items: + if not item.nullable_visit(rules): + return False + return True + + def initial_names(self) -> AbstractSet[str]: + names: Set[str] = set() + for item in self.items: + names |= item.initial_names() + if not item.nullable: + break + return names + + def collect_todo(self, gen: ParserGenerator) -> None: + for item in self.items: + item.collect_todo(gen) + + +class NamedItem: + def __init__(self, name: Optional[str], item: Item): + self.name = name + self.item = item + self.nullable = False + + def __str__(self) -> str: + if not SIMPLE_STR and self.name: + return f"{self.name}={self.item}" + else: + return str(self.item) + + def __repr__(self) -> str: + return f"NamedItem({self.name!r}, {self.item!r})" + + def __iter__(self) -> Iterator[Item]: + yield self.item + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + self.nullable = self.item.nullable_visit(rules) + return self.nullable + + def initial_names(self) -> AbstractSet[str]: + return self.item.initial_names() + + def collect_todo(self, gen: ParserGenerator) -> None: + gen.callmakervisitor.visit(self.item) + + +class Lookahead: + def __init__(self, node: Plain, sign: str): + self.node = node + self.sign = sign + + def __str__(self) -> str: + return f"{self.sign}{self.node}" + + def __iter__(self) -> Iterator[Plain]: + yield self.node + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return True + + def initial_names(self) -> AbstractSet[str]: + return set() + + +class PositiveLookahead(Lookahead): + def __init__(self, node: Plain): + super().__init__(node, "&") + + def __repr__(self) -> str: + return f"PositiveLookahead({self.node!r})" + + +class NegativeLookahead(Lookahead): + def __init__(self, node: Plain): + super().__init__(node, "!") + + def __repr__(self) -> str: + return f"NegativeLookahead({self.node!r})" + + +class Opt: + def __init__(self, node: Item): + self.node = node + + def __str__(self) -> str: + s = str(self.node) + # TODO: Decide whether to use [X] or X? based on type of X + if " " in s: + return f"[{s}]" + else: + return f"{s}?" + + def __repr__(self) -> str: + return f"Opt({self.node!r})" + + def __iter__(self) -> Iterator[Item]: + yield self.node + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return True + + def initial_names(self) -> AbstractSet[str]: + return self.node.initial_names() + + +class Repeat: + """Shared base class for x* and x+.""" + + def __init__(self, node: Plain): + self.node = node + self.memo: Optional[Tuple[Optional[str], str]] = None + + @abstractmethod + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + raise NotImplementedError + + def __iter__(self) -> Iterator[Plain]: + yield self.node + + def initial_names(self) -> AbstractSet[str]: + return self.node.initial_names() + + +class Repeat0(Repeat): + def __str__(self) -> str: + s = str(self.node) + # TODO: Decide whether to use (X)* or X* based on type of X + if " " in s: + return f"({s})*" + else: + return f"{s}*" + + def __repr__(self) -> str: + return f"Repeat0({self.node!r})" + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return True + + +class Repeat1(Repeat): + def __str__(self) -> str: + s = str(self.node) + # TODO: Decide whether to use (X)+ or X+ based on type of X + if " " in s: + return f"({s})+" + else: + return f"{s}+" + + def __repr__(self) -> str: + return f"Repeat1({self.node!r})" + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return False + + +class Gather(Repeat): + def __init__(self, separator: Plain, node: Plain): + self.separator = separator + self.node = node + + def __str__(self) -> str: + return f"{self.separator!s}.{self.node!s}+" + + def __repr__(self) -> str: + return f"Gather({self.separator!r}, {self.node!r})" + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return False + + +class Group: + def __init__(self, rhs: Rhs): + self.rhs = rhs + + def __str__(self) -> str: + return f"({self.rhs})" + + def __repr__(self) -> str: + return f"Group({self.rhs!r})" + + def __iter__(self) -> Iterator[Rhs]: + yield self.rhs + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return self.rhs.nullable_visit(rules) + + def initial_names(self) -> AbstractSet[str]: + return self.rhs.initial_names() + + +class Cut: + def __init__(self) -> None: + pass + + def __repr__(self) -> str: + return f"Cut()" + + def __str__(self) -> str: + return f"~" + + def __iter__(self) -> Iterator[Tuple[str, str]]: + if False: + yield + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Cut): + return NotImplemented + return True + + def nullable_visit(self, rules: Dict[str, Rule]) -> bool: + return True + + def initial_names(self) -> AbstractSet[str]: + return set() + + +Plain = Union[Leaf, Group] +Item = Union[Plain, Opt, Repeat, Lookahead, Rhs, Cut] +RuleName = Tuple[str, str] +MetaTuple = Tuple[str, Optional[str]] +MetaList = List[MetaTuple] +RuleList = List[Rule] +NamedItemList = List[NamedItem] +LookaheadOrCut = Union[Lookahead, Cut] diff --git a/Tools/peg_generator/pegen/grammar_parser.py b/Tools/peg_generator/pegen/grammar_parser.py new file mode 100644 index 0000000000000..0e206ee9cd5e4 --- /dev/null +++ b/Tools/peg_generator/pegen/grammar_parser.py @@ -0,0 +1,677 @@ +#!/usr/bin/env python3.8 +# @generated by pegen from pegen/metagrammar.gram + +import ast +import sys +import tokenize + +from typing import Any, Optional + +from pegen.parser import memoize, memoize_left_rec, logger, Parser +from ast import literal_eval + +from pegen.grammar import ( + Alt, + Cut, + Gather, + Group, + Item, + Lookahead, + LookaheadOrCut, + MetaTuple, + MetaList, + NameLeaf, + NamedItem, + NamedItemList, + NegativeLookahead, + Opt, + Plain, + PositiveLookahead, + Repeat0, + Repeat1, + Rhs, + Rule, + RuleList, + RuleName, + Grammar, + StringLeaf, +) + +class GeneratedParser(Parser): + + @memoize + def start(self) -> Optional[Grammar]: + # start: grammar $ + mark = self.mark() + cut = False + if ( + (grammar := self.grammar()) + and + (endmarker := self.expect('ENDMARKER')) + ): + return grammar + self.reset(mark) + if cut: return None + return None + + @memoize + def grammar(self) -> Optional[Grammar]: + # grammar: metas rules | rules + mark = self.mark() + cut = False + if ( + (metas := self.metas()) + and + (rules := self.rules()) + ): + return Grammar ( rules , metas ) + self.reset(mark) + if cut: return None + cut = False + if ( + (rules := self.rules()) + ): + return Grammar ( rules , [ ] ) + self.reset(mark) + if cut: return None + return None + + @memoize + def metas(self) -> Optional[MetaList]: + # metas: meta metas | meta + mark = self.mark() + cut = False + if ( + (meta := self.meta()) + and + (metas := self.metas()) + ): + return [ meta ] + metas + self.reset(mark) + if cut: return None + cut = False + if ( + (meta := self.meta()) + ): + return [ meta ] + self.reset(mark) + if cut: return None + return None + + @memoize + def meta(self) -> Optional[MetaTuple]: + # meta: "@" NAME NEWLINE | "@" NAME NAME NEWLINE | "@" NAME STRING NEWLINE + mark = self.mark() + cut = False + if ( + (literal := self.expect("@")) + and + (name := self.name()) + and + (newline := self.expect('NEWLINE')) + ): + return ( name . string , None ) + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect("@")) + and + (a := self.name()) + and + (b := self.name()) + and + (newline := self.expect('NEWLINE')) + ): + return ( a . string , b . string ) + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect("@")) + and + (name := self.name()) + and + (string := self.string()) + and + (newline := self.expect('NEWLINE')) + ): + return ( name . string , literal_eval ( string . string ) ) + self.reset(mark) + if cut: return None + return None + + @memoize + def rules(self) -> Optional[RuleList]: + # rules: rule rules | rule + mark = self.mark() + cut = False + if ( + (rule := self.rule()) + and + (rules := self.rules()) + ): + return [ rule ] + rules + self.reset(mark) + if cut: return None + cut = False + if ( + (rule := self.rule()) + ): + return [ rule ] + self.reset(mark) + if cut: return None + return None + + @memoize + def rule(self) -> Optional[Rule]: + # rule: rulename memoflag? ":" alts NEWLINE INDENT more_alts DEDENT | rulename memoflag? ":" NEWLINE INDENT more_alts DEDENT | rulename memoflag? ":" alts NEWLINE + mark = self.mark() + cut = False + if ( + (rulename := self.rulename()) + and + (opt := self.memoflag(),) + and + (literal := self.expect(":")) + and + (alts := self.alts()) + and + (newline := self.expect('NEWLINE')) + and + (indent := self.expect('INDENT')) + and + (more_alts := self.more_alts()) + and + (dedent := self.expect('DEDENT')) + ): + return Rule ( rulename [ 0 ] , rulename [ 1 ] , Rhs ( alts . alts + more_alts . alts ) , memo = opt ) + self.reset(mark) + if cut: return None + cut = False + if ( + (rulename := self.rulename()) + and + (opt := self.memoflag(),) + and + (literal := self.expect(":")) + and + (newline := self.expect('NEWLINE')) + and + (indent := self.expect('INDENT')) + and + (more_alts := self.more_alts()) + and + (dedent := self.expect('DEDENT')) + ): + return Rule ( rulename [ 0 ] , rulename [ 1 ] , more_alts , memo = opt ) + self.reset(mark) + if cut: return None + cut = False + if ( + (rulename := self.rulename()) + and + (opt := self.memoflag(),) + and + (literal := self.expect(":")) + and + (alts := self.alts()) + and + (newline := self.expect('NEWLINE')) + ): + return Rule ( rulename [ 0 ] , rulename [ 1 ] , alts , memo = opt ) + self.reset(mark) + if cut: return None + return None + + @memoize + def rulename(self) -> Optional[RuleName]: + # rulename: NAME '[' NAME '*' ']' | NAME '[' NAME ']' | NAME + mark = self.mark() + cut = False + if ( + (name := self.name()) + and + (literal := self.expect('[')) + and + (type := self.name()) + and + (literal_1 := self.expect('*')) + and + (literal_2 := self.expect(']')) + ): + return ( name . string , type . string + "*" ) + self.reset(mark) + if cut: return None + cut = False + if ( + (name := self.name()) + and + (literal := self.expect('[')) + and + (type := self.name()) + and + (literal_1 := self.expect(']')) + ): + return ( name . string , type . string ) + self.reset(mark) + if cut: return None + cut = False + if ( + (name := self.name()) + ): + return ( name . string , None ) + self.reset(mark) + if cut: return None + return None + + @memoize + def memoflag(self) -> Optional[str]: + # memoflag: '(' 'memo' ')' + mark = self.mark() + cut = False + if ( + (literal := self.expect('(')) + and + (literal_1 := self.expect('memo')) + and + (literal_2 := self.expect(')')) + ): + return "memo" + self.reset(mark) + if cut: return None + return None + + @memoize + def alts(self) -> Optional[Rhs]: + # alts: alt "|" alts | alt + mark = self.mark() + cut = False + if ( + (alt := self.alt()) + and + (literal := self.expect("|")) + and + (alts := self.alts()) + ): + return Rhs ( [ alt ] + alts . alts ) + self.reset(mark) + if cut: return None + cut = False + if ( + (alt := self.alt()) + ): + return Rhs ( [ alt ] ) + self.reset(mark) + if cut: return None + return None + + @memoize + def more_alts(self) -> Optional[Rhs]: + # more_alts: "|" alts NEWLINE more_alts | "|" alts NEWLINE + mark = self.mark() + cut = False + if ( + (literal := self.expect("|")) + and + (alts := self.alts()) + and + (newline := self.expect('NEWLINE')) + and + (more_alts := self.more_alts()) + ): + return Rhs ( alts . alts + more_alts . alts ) + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect("|")) + and + (alts := self.alts()) + and + (newline := self.expect('NEWLINE')) + ): + return Rhs ( alts . alts ) + self.reset(mark) + if cut: return None + return None + + @memoize + def alt(self) -> Optional[Alt]: + # alt: items '$' action | items '$' | items action | items + mark = self.mark() + cut = False + if ( + (items := self.items()) + and + (literal := self.expect('$')) + and + (action := self.action()) + ): + return Alt ( items + [ NamedItem ( None , NameLeaf ( 'ENDMARKER' ) ) ] , action = action ) + self.reset(mark) + if cut: return None + cut = False + if ( + (items := self.items()) + and + (literal := self.expect('$')) + ): + return Alt ( items + [ NamedItem ( None , NameLeaf ( 'ENDMARKER' ) ) ] , action = None ) + self.reset(mark) + if cut: return None + cut = False + if ( + (items := self.items()) + and + (action := self.action()) + ): + return Alt ( items , action = action ) + self.reset(mark) + if cut: return None + cut = False + if ( + (items := self.items()) + ): + return Alt ( items , action = None ) + self.reset(mark) + if cut: return None + return None + + @memoize + def items(self) -> Optional[NamedItemList]: + # items: named_item items | named_item + mark = self.mark() + cut = False + if ( + (named_item := self.named_item()) + and + (items := self.items()) + ): + return [ named_item ] + items + self.reset(mark) + if cut: return None + cut = False + if ( + (named_item := self.named_item()) + ): + return [ named_item ] + self.reset(mark) + if cut: return None + return None + + @memoize + def named_item(self) -> Optional[NamedItem]: + # named_item: NAME '=' ~ item | item | lookahead + mark = self.mark() + cut = False + if ( + (name := self.name()) + and + (literal := self.expect('=')) + and + (cut := True) + and + (item := self.item()) + ): + return NamedItem ( name . string , item ) + self.reset(mark) + if cut: return None + cut = False + if ( + (item := self.item()) + ): + return NamedItem ( None , item ) + self.reset(mark) + if cut: return None + cut = False + if ( + (it := self.lookahead()) + ): + return NamedItem ( None , it ) + self.reset(mark) + if cut: return None + return None + + @memoize + def lookahead(self) -> Optional[LookaheadOrCut]: + # lookahead: '&' ~ atom | '!' ~ atom | '~' + mark = self.mark() + cut = False + if ( + (literal := self.expect('&')) + and + (cut := True) + and + (atom := self.atom()) + ): + return PositiveLookahead ( atom ) + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect('!')) + and + (cut := True) + and + (atom := self.atom()) + ): + return NegativeLookahead ( atom ) + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect('~')) + ): + return Cut ( ) + self.reset(mark) + if cut: return None + return None + + @memoize + def item(self) -> Optional[Item]: + # item: '[' ~ alts ']' | atom '?' | atom '*' | atom '+' | atom '.' atom '+' | atom + mark = self.mark() + cut = False + if ( + (literal := self.expect('[')) + and + (cut := True) + and + (alts := self.alts()) + and + (literal_1 := self.expect(']')) + ): + return Opt ( alts ) + self.reset(mark) + if cut: return None + cut = False + if ( + (atom := self.atom()) + and + (literal := self.expect('?')) + ): + return Opt ( atom ) + self.reset(mark) + if cut: return None + cut = False + if ( + (atom := self.atom()) + and + (literal := self.expect('*')) + ): + return Repeat0 ( atom ) + self.reset(mark) + if cut: return None + cut = False + if ( + (atom := self.atom()) + and + (literal := self.expect('+')) + ): + return Repeat1 ( atom ) + self.reset(mark) + if cut: return None + cut = False + if ( + (sep := self.atom()) + and + (literal := self.expect('.')) + and + (node := self.atom()) + and + (literal_1 := self.expect('+')) + ): + return Gather ( sep , node ) + self.reset(mark) + if cut: return None + cut = False + if ( + (atom := self.atom()) + ): + return atom + self.reset(mark) + if cut: return None + return None + + @memoize + def atom(self) -> Optional[Plain]: + # atom: '(' ~ alts ')' | NAME | STRING + mark = self.mark() + cut = False + if ( + (literal := self.expect('(')) + and + (cut := True) + and + (alts := self.alts()) + and + (literal_1 := self.expect(')')) + ): + return Group ( alts ) + self.reset(mark) + if cut: return None + cut = False + if ( + (name := self.name()) + ): + return NameLeaf ( name . string ) + self.reset(mark) + if cut: return None + cut = False + if ( + (string := self.string()) + ): + return StringLeaf ( string . string ) + self.reset(mark) + if cut: return None + return None + + @memoize + def action(self) -> Optional[str]: + # action: "{" ~ target_atoms "}" + mark = self.mark() + cut = False + if ( + (literal := self.expect("{")) + and + (cut := True) + and + (target_atoms := self.target_atoms()) + and + (literal_1 := self.expect("}")) + ): + return target_atoms + self.reset(mark) + if cut: return None + return None + + @memoize + def target_atoms(self) -> Optional[str]: + # target_atoms: target_atom target_atoms | target_atom + mark = self.mark() + cut = False + if ( + (target_atom := self.target_atom()) + and + (target_atoms := self.target_atoms()) + ): + return target_atom + " " + target_atoms + self.reset(mark) + if cut: return None + cut = False + if ( + (target_atom := self.target_atom()) + ): + return target_atom + self.reset(mark) + if cut: return None + return None + + @memoize + def target_atom(self) -> Optional[str]: + # target_atom: "{" ~ target_atoms "}" | NAME | NUMBER | STRING | "?" | ":" | !"}" OP + mark = self.mark() + cut = False + if ( + (literal := self.expect("{")) + and + (cut := True) + and + (target_atoms := self.target_atoms()) + and + (literal_1 := self.expect("}")) + ): + return "{" + target_atoms + "}" + self.reset(mark) + if cut: return None + cut = False + if ( + (name := self.name()) + ): + return name . string + self.reset(mark) + if cut: return None + cut = False + if ( + (number := self.number()) + ): + return number . string + self.reset(mark) + if cut: return None + cut = False + if ( + (string := self.string()) + ): + return string . string + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect("?")) + ): + return "?" + self.reset(mark) + if cut: return None + cut = False + if ( + (literal := self.expect(":")) + ): + return ":" + self.reset(mark) + if cut: return None + cut = False + if ( + self.negative_lookahead(self.expect, "}") + and + (op := self.op()) + ): + return op . string + self.reset(mark) + if cut: return None + return None + + +if __name__ == '__main__': + from pegen.parser import simple_parser_main + simple_parser_main(GeneratedParser) diff --git a/Tools/peg_generator/pegen/grammar_visualizer.py b/Tools/peg_generator/pegen/grammar_visualizer.py new file mode 100644 index 0000000000000..b1d51d2cdb250 --- /dev/null +++ b/Tools/peg_generator/pegen/grammar_visualizer.py @@ -0,0 +1,65 @@ +import argparse +import sys + +from typing import Any, Iterator, Iterable, Callable + +from pegen.build import build_parser +from pegen.grammar import Grammar, Rule + +argparser = argparse.ArgumentParser( + prog="pegen", description="Pretty print the AST for a given PEG grammar" +) +argparser.add_argument("filename", help="Grammar description") + + +class ASTGrammarPrinter: + def children(self, node: Rule) -> Iterator[Any]: + for value in node: + if isinstance(value, list): + yield from value + else: + yield value + + def name(self, node: Rule) -> str: + if not list(self.children(node)): + return repr(node) + return node.__class__.__name__ + + def print_grammar_ast(self, grammar: Grammar, printer: Callable[..., None] = print) -> None: + for rule in grammar.rules.values(): + printer(self.print_nodes_recursively(rule)) + + def print_nodes_recursively(self, node: Rule, prefix: str = "", istail: bool = True) -> str: + + children = list(self.children(node)) + value = self.name(node) + + line = prefix + ("???" if istail else "???") + value + "\n" + sufix = " " if istail else "? " + + if not children: + return line + + *children, last = children + for child in children: + line += self.print_nodes_recursively(child, prefix + sufix, False) + line += self.print_nodes_recursively(last, prefix + sufix, True) + + return line + + +def main() -> None: + args = argparser.parse_args() + + try: + grammar, parser, tokenizer = build_parser(args.filename) + except Exception as err: + print("ERROR: Failed to parse grammar file", file=sys.stderr) + sys.exit(1) + + visitor = ASTGrammarPrinter() + visitor.print_grammar_ast(grammar) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/pegen/metagrammar.gram b/Tools/peg_generator/pegen/metagrammar.gram new file mode 100644 index 0000000000000..f0c5ac3ab390f --- /dev/null +++ b/Tools/peg_generator/pegen/metagrammar.gram @@ -0,0 +1,123 @@ + at subheader """\ +from ast import literal_eval + +from pegen.grammar import ( + Alt, + Cut, + Gather, + Group, + Item, + Lookahead, + LookaheadOrCut, + MetaTuple, + MetaList, + NameLeaf, + NamedItem, + NamedItemList, + NegativeLookahead, + Opt, + Plain, + PositiveLookahead, + Repeat0, + Repeat1, + Rhs, + Rule, + RuleList, + RuleName, + Grammar, + StringLeaf, +) +""" + +start[Grammar]: grammar ENDMARKER { grammar } + +grammar[Grammar]: + | metas rules { Grammar(rules, metas) } + | rules { Grammar(rules, []) } + +metas[MetaList]: + | meta metas { [meta] + metas } + | meta { [meta] } + +meta[MetaTuple]: + | "@" NAME NEWLINE { (name.string, None) } + | "@" a=NAME b=NAME NEWLINE { (a.string, b.string) } + | "@" NAME STRING NEWLINE { (name.string, literal_eval(string.string)) } + +rules[RuleList]: + | rule rules { [rule] + rules } + | rule { [rule] } + +rule[Rule]: + | rulename memoflag? ":" alts NEWLINE INDENT more_alts DEDENT { + Rule(rulename[0], rulename[1], Rhs(alts.alts + more_alts.alts), memo=opt) } + | rulename memoflag? ":" NEWLINE INDENT more_alts DEDENT { + Rule(rulename[0], rulename[1], more_alts, memo=opt) } + | rulename memoflag? ":" alts NEWLINE { Rule(rulename[0], rulename[1], alts, memo=opt) } + +rulename[RuleName]: + | NAME '[' type=NAME '*' ']' { (name.string, type.string+"*") } + | NAME '[' type=NAME ']' { (name.string, type.string) } + | NAME { (name.string, None) } + +# In the future this may return something more complicated +memoflag[str]: + | '(' 'memo' ')' { "memo" } + +alts[Rhs]: + | alt "|" alts { Rhs([alt] + alts.alts)} + | alt { Rhs([alt]) } + +more_alts[Rhs]: + | "|" alts NEWLINE more_alts { Rhs(alts.alts + more_alts.alts) } + | "|" alts NEWLINE { Rhs(alts.alts) } + +alt[Alt]: + | items '$' action { Alt(items + [NamedItem(None, NameLeaf('ENDMARKER'))], action=action) } + | items '$' { Alt(items + [NamedItem(None, NameLeaf('ENDMARKER'))], action=None) } + | items action { Alt(items, action=action) } + | items { Alt(items, action=None) } + +items[NamedItemList]: + | named_item items { [named_item] + items } + | named_item { [named_item] } + +named_item[NamedItem]: + | NAME '=' ~ item {NamedItem(name.string, item)} + | item {NamedItem(None, item)} + | it=lookahead {NamedItem(None, it)} + +lookahead[LookaheadOrCut]: + | '&' ~ atom {PositiveLookahead(atom)} + | '!' ~ atom {NegativeLookahead(atom)} + | '~' {Cut()} + +item[Item]: + | '[' ~ alts ']' {Opt(alts)} + | atom '?' {Opt(atom)} + | atom '*' {Repeat0(atom)} + | atom '+' {Repeat1(atom)} + | sep=atom '.' node=atom '+' {Gather(sep, node)} + | atom {atom} + +atom[Plain]: + | '(' ~ alts ')' {Group(alts)} + | NAME {NameLeaf(name.string) } + | STRING {StringLeaf(string.string)} + +# Mini-grammar for the actions + +action[str]: "{" ~ target_atoms "}" { target_atoms } + +target_atoms[str]: + | target_atom target_atoms { target_atom + " " + target_atoms } + | target_atom { target_atom } + +target_atom[str]: + | "{" ~ target_atoms "}" { "{" + target_atoms + "}" } + | NAME { name.string } + | NUMBER { number.string } + | STRING { string.string } + | "?" { "?" } + | ":" { ":" } + | !"}" OP { op.string } diff --git a/Tools/peg_generator/pegen/parser.py b/Tools/peg_generator/pegen/parser.py new file mode 100644 index 0000000000000..16d954dce89f7 --- /dev/null +++ b/Tools/peg_generator/pegen/parser.py @@ -0,0 +1,310 @@ +import argparse +import sys +import time +import token +import tokenize +import traceback + +from abc import abstractmethod +from typing import Any, Callable, cast, Dict, Optional, Tuple, Type, TypeVar + +from pegen.tokenizer import exact_token_types +from pegen.tokenizer import Mark +from pegen.tokenizer import Tokenizer + +T = TypeVar("T") +P = TypeVar("P", bound="Parser") +F = TypeVar("F", bound=Callable[..., Any]) + + +def logger(method: F) -> F: + """For non-memoized functions that we want to be logged. + + (In practice this is only non-leader left-recursive functions.) + """ + method_name = method.__name__ + + def logger_wrapper(self: P, *args: object) -> T: + if not self._verbose: + return method(self, *args) + argsr = ",".join(repr(arg) for arg in args) + fill = " " * self._level + print(f"{fill}{method_name}({argsr}) .... (looking at {self.showpeek()})") + self._level += 1 + tree = method(self, *args) + self._level -= 1 + print(f"{fill}... {method_name}({argsr}) --> {tree!s:.200}") + return tree + + logger_wrapper.__wrapped__ = method # type: ignore + return cast(F, logger_wrapper) + + +def memoize(method: F) -> F: + """Memoize a symbol method.""" + method_name = method.__name__ + + def memoize_wrapper(self: P, *args: object) -> T: + mark = self.mark() + key = mark, method_name, args + # Fast path: cache hit, and not verbose. + if key in self._cache and not self._verbose: + tree, endmark = self._cache[key] + self.reset(endmark) + return tree + # Slow path: no cache hit, or verbose. + verbose = self._verbose + argsr = ",".join(repr(arg) for arg in args) + fill = " " * self._level + if key not in self._cache: + if verbose: + print(f"{fill}{method_name}({argsr}) ... (looking at {self.showpeek()})") + self._level += 1 + tree = method(self, *args) + self._level -= 1 + if verbose: + print(f"{fill}... {method_name}({argsr}) -> {tree!s:.200}") + endmark = self.mark() + self._cache[key] = tree, endmark + else: + tree, endmark = self._cache[key] + if verbose: + print(f"{fill}{method_name}({argsr}) -> {tree!s:.200}") + self.reset(endmark) + return tree + + memoize_wrapper.__wrapped__ = method # type: ignore + return cast(F, memoize_wrapper) + + +def memoize_left_rec(method: Callable[[P], Optional[T]]) -> Callable[[P], Optional[T]]: + """Memoize a left-recursive symbol method.""" + method_name = method.__name__ + + def memoize_left_rec_wrapper(self: P) -> Optional[T]: + mark = self.mark() + key = mark, method_name, () + # Fast path: cache hit, and not verbose. + if key in self._cache and not self._verbose: + tree, endmark = self._cache[key] + self.reset(endmark) + return tree + # Slow path: no cache hit, or verbose. + verbose = self._verbose + fill = " " * self._level + if key not in self._cache: + if verbose: + print(f"{fill}{method_name} ... (looking at {self.showpeek()})") + self._level += 1 + + # For left-recursive rules we manipulate the cache and + # loop until the rule shows no progress, then pick the + # previous result. For an explanation why this works, see + # https://github.com/PhilippeSigaud/Pegged/wiki/Left-Recursion + # (But we use the memoization cache instead of a static + # variable; perhaps this is similar to a paper by Warth et al. + # (http://web.cs.ucla.edu/~todd/research/pub.php?id=pepm08). + + # Prime the cache with a failure. + self._cache[key] = None, mark + lastresult, lastmark = None, mark + depth = 0 + if verbose: + print(f"{fill}Recursive {method_name} at {mark} depth {depth}") + + while True: + self.reset(mark) + result = method(self) + endmark = self.mark() + depth += 1 + if verbose: + print( + f"{fill}Recursive {method_name} at {mark} depth {depth}: {result!s:.200} to {endmark}" + ) + if not result: + if verbose: + print(f"{fill}Fail with {lastresult!s:.200} to {lastmark}") + break + if endmark <= lastmark: + if verbose: + print(f"{fill}Bailing with {lastresult!s:.200} to {lastmark}") + break + self._cache[key] = lastresult, lastmark = result, endmark + + self.reset(lastmark) + tree = lastresult + + self._level -= 1 + if verbose: + print(f"{fill}{method_name}() -> {tree!s:.200} [cached]") + if tree: + endmark = self.mark() + else: + endmark = mark + self.reset(endmark) + self._cache[key] = tree, endmark + else: + tree, endmark = self._cache[key] + if verbose: + print(f"{fill}{method_name}() -> {tree!s:.200} [fresh]") + if tree: + self.reset(endmark) + return tree + + memoize_left_rec_wrapper.__wrapped__ = method # type: ignore + return memoize_left_rec_wrapper + + +class Parser: + """Parsing base class.""" + + def __init__(self, tokenizer: Tokenizer, *, verbose: bool = False): + self._tokenizer = tokenizer + self._verbose = verbose + self._level = 0 + self._cache: Dict[Tuple[Mark, str, Tuple[Any, ...]], Tuple[Any, Mark]] = {} + # Pass through common tokenizer methods. + # TODO: Rename to _mark and _reset. + self.mark = self._tokenizer.mark + self.reset = self._tokenizer.reset + + @abstractmethod + def start(self) -> Any: + pass + + def showpeek(self) -> str: + tok = self._tokenizer.peek() + return f"{tok.start[0]}.{tok.start[1]}: {token.tok_name[tok.type]}:{tok.string!r}" + + @memoize + def name(self) -> Optional[tokenize.TokenInfo]: + tok = self._tokenizer.peek() + if tok.type == token.NAME: + return self._tokenizer.getnext() + return None + + @memoize + def number(self) -> Optional[tokenize.TokenInfo]: + tok = self._tokenizer.peek() + if tok.type == token.NUMBER: + return self._tokenizer.getnext() + return None + + @memoize + def string(self) -> Optional[tokenize.TokenInfo]: + tok = self._tokenizer.peek() + if tok.type == token.STRING: + return self._tokenizer.getnext() + return None + + @memoize + def op(self) -> Optional[tokenize.TokenInfo]: + tok = self._tokenizer.peek() + if tok.type == token.OP: + return self._tokenizer.getnext() + return None + + @memoize + def expect(self, type: str) -> Optional[tokenize.TokenInfo]: + tok = self._tokenizer.peek() + if tok.string == type: + return self._tokenizer.getnext() + if type in exact_token_types: + if tok.type == exact_token_types[type]: + return self._tokenizer.getnext() + if type in token.__dict__: + if tok.type == token.__dict__[type]: + return self._tokenizer.getnext() + if tok.type == token.OP and tok.string == type: + return self._tokenizer.getnext() + return None + + def positive_lookahead(self, func: Callable[..., T], *args: object) -> T: + mark = self.mark() + ok = func(*args) + self.reset(mark) + return ok + + def negative_lookahead(self, func: Callable[..., object], *args: object) -> bool: + mark = self.mark() + ok = func(*args) + self.reset(mark) + return not ok + + def make_syntax_error(self, filename: str = "") -> SyntaxError: + tok = self._tokenizer.diagnose() + return SyntaxError( + "pegen parse failure", (filename, tok.start[0], 1 + tok.start[1], tok.line) + ) + + +def simple_parser_main(parser_class: Type[Parser]) -> None: + argparser = argparse.ArgumentParser() + argparser.add_argument( + "-v", + "--verbose", + action="count", + default=0, + help="Print timing stats; repeat for more debug output", + ) + argparser.add_argument( + "-q", "--quiet", action="store_true", help="Don't print the parsed program" + ) + argparser.add_argument("filename", help="Input file ('-' to use stdin)") + + args = argparser.parse_args() + verbose = args.verbose + verbose_tokenizer = verbose >= 3 + verbose_parser = verbose == 2 or verbose >= 4 + + t0 = time.time() + + filename = args.filename + if filename == "" or filename == "-": + filename = "" + file = sys.stdin + else: + file = open(args.filename) + try: + tokengen = tokenize.generate_tokens(file.readline) + tokenizer = Tokenizer(tokengen, verbose=verbose_tokenizer) + parser = parser_class(tokenizer, verbose=verbose_parser) + tree = parser.start() + try: + if file.isatty(): + endpos = 0 + else: + endpos = file.tell() + except IOError: + endpos = 0 + finally: + if file is not sys.stdin: + file.close() + + t1 = time.time() + + if not tree: + err = parser.make_syntax_error(filename) + traceback.print_exception(err.__class__, err, None) + sys.exit(1) + + if not args.quiet: + print(tree) + + if verbose: + dt = t1 - t0 + diag = tokenizer.diagnose() + nlines = diag.end[0] + if diag.type == token.ENDMARKER: + nlines -= 1 + print(f"Total time: {dt:.3f} sec; {nlines} lines", end="") + if endpos: + print(f" ({endpos} bytes)", end="") + if dt: + print(f"; {nlines / dt:.0f} lines/sec") + else: + print() + print("Caches sizes:") + print(f" token array : {len(tokenizer._tokens):10}") + print(f" cache : {len(parser._cache):10}") + ## print_memstats() diff --git a/Tools/peg_generator/pegen/parser_generator.py b/Tools/peg_generator/pegen/parser_generator.py new file mode 100644 index 0000000000000..7851a7c90f4d5 --- /dev/null +++ b/Tools/peg_generator/pegen/parser_generator.py @@ -0,0 +1,188 @@ +import contextlib +import token +from abc import abstractmethod + +from typing import AbstractSet, Dict, IO, Iterator, List, Optional, Set, Text, Tuple + +from pegen import sccutils +from pegen.grammar import ( + Grammar, + Rule, + Rhs, + Alt, + NamedItem, + Plain, + NameLeaf, + StringLeaf, + Gather, +) +from pegen.grammar import GrammarError, GrammarVisitor + + +class RuleCheckingVisitor(GrammarVisitor): + def __init__(self, rules: Dict[str, Rule]): + self.rules = rules + + def visit_NameLeaf(self, node: NameLeaf) -> None: + if node.value not in self.rules and node.value not in token.tok_name.values(): + # TODO: Add line/col info to (leaf) nodes + raise GrammarError(f"Dangling reference to rule {node.value!r}") + + +class ParserGenerator: + + callmakervisitor: GrammarVisitor + + def __init__(self, grammar: Grammar, file: Optional[IO[Text]]): + self.grammar = grammar + self.rules = grammar.rules + if "trailer" not in grammar.metas and "start" not in self.rules: + raise GrammarError("Grammar without a trailer must have a 'start' rule") + checker = RuleCheckingVisitor(self.rules) + for rule in self.rules.values(): + checker.visit(rule) + self.file = file + self.level = 0 + compute_nullables(self.rules) + self.first_graph, self.first_sccs = compute_left_recursives(self.rules) + self.todo = self.rules.copy() # Rules to generate + self.counter = 0 # For name_rule()/name_loop() + self.keyword_counter = 499 # For keyword_type() + + @abstractmethod + def generate(self, filename: str) -> None: + raise NotImplementedError + + @contextlib.contextmanager + def indent(self) -> Iterator[None]: + self.level += 1 + try: + yield + finally: + self.level -= 1 + + def print(self, *args: object) -> None: + if not args: + print(file=self.file) + else: + print(" " * self.level, end="", file=self.file) + print(*args, file=self.file) + + def printblock(self, lines: str) -> None: + for line in lines.splitlines(): + self.print(line) + + def collect_todo(self) -> None: + done: Set[str] = set() + while True: + alltodo = list(self.todo) + todo = [i for i in alltodo if i not in done] + if not todo: + break + for rulename in todo: + self.todo[rulename].collect_todo(self) + done = set(alltodo) + + def keyword_type(self) -> int: + self.keyword_counter += 1 + return self.keyword_counter + + def name_node(self, rhs: Rhs) -> str: + self.counter += 1 + name = f"_tmp_{self.counter}" # TODO: Pick a nicer name. + self.todo[name] = Rule(name, None, rhs) + return name + + def name_loop(self, node: Plain, is_repeat1: bool) -> str: + self.counter += 1 + if is_repeat1: + prefix = "_loop1_" + else: + prefix = "_loop0_" + name = f"{prefix}{self.counter}" # TODO: It's ugly to signal via the name. + self.todo[name] = Rule(name, None, Rhs([Alt([NamedItem(None, node)])])) + return name + + def name_gather(self, node: Gather) -> str: + self.counter += 1 + name = f"_gather_{self.counter}" + self.counter += 1 + extra_function_name = f"_loop0_{self.counter}" + extra_function_alt = Alt( + [NamedItem(None, node.separator), NamedItem("elem", node.node),], action="elem", + ) + self.todo[extra_function_name] = Rule( + extra_function_name, None, Rhs([extra_function_alt]), + ) + alt = Alt( + [NamedItem("elem", node.node), NamedItem("seq", NameLeaf(extra_function_name)),], + ) + self.todo[name] = Rule(name, None, Rhs([alt]),) + return name + + +def dedupe(name: str, names: List[str]) -> str: + origname = name + counter = 0 + while name in names: + counter += 1 + name = f"{origname}_{counter}" + names.append(name) + return name + + +def compute_nullables(rules: Dict[str, Rule]) -> None: + """Compute which rules in a grammar are nullable. + + Thanks to TatSu (tatsu/leftrec.py) for inspiration. + """ + for rule in rules.values(): + rule.nullable_visit(rules) + + +def compute_left_recursives( + rules: Dict[str, Rule] +) -> Tuple[Dict[str, AbstractSet[str]], List[AbstractSet[str]]]: + graph = make_first_graph(rules) + sccs = list(sccutils.strongly_connected_components(graph.keys(), graph)) + for scc in sccs: + if len(scc) > 1: + for name in scc: + rules[name].left_recursive = True + # Try to find a leader such that all cycles go through it. + leaders = set(scc) + for start in scc: + for cycle in sccutils.find_cycles_in_scc(graph, scc, start): + ## print("Cycle:", " -> ".join(cycle)) + leaders -= scc - set(cycle) + if not leaders: + raise ValueError( + f"SCC {scc} has no leadership candidate (no element is included in all cycles)" + ) + ## print("Leaders:", leaders) + leader = min(leaders) # Pick an arbitrary leader from the candidates. + rules[leader].leader = True + else: + name = min(scc) # The only element. + if name in graph[name]: + rules[name].left_recursive = True + rules[name].leader = True + return graph, sccs + + +def make_first_graph(rules: Dict[str, Rule]) -> Dict[str, AbstractSet[str]]: + """Compute the graph of left-invocations. + + There's an edge from A to B if A may invoke B at its initial + position. + + Note that this requires the nullable flags to have been computed. + """ + graph = {} + vertices: Set[str] = set() + for rulename, rhs in rules.items(): + graph[rulename] = names = rhs.initial_names() + vertices |= names + for vertex in vertices: + graph.setdefault(vertex, set()) + return graph diff --git a/Tools/peg_generator/pegen/python_generator.py b/Tools/peg_generator/pegen/python_generator.py new file mode 100644 index 0000000000000..b2891885f957e --- /dev/null +++ b/Tools/peg_generator/pegen/python_generator.py @@ -0,0 +1,224 @@ +from typing import Any, Dict, List, Optional, IO, Text, Tuple + +from pegen.grammar import ( + Cut, + GrammarVisitor, + NameLeaf, + StringLeaf, + Rhs, + NamedItem, + Lookahead, + PositiveLookahead, + NegativeLookahead, + Opt, + Repeat0, + Repeat1, + Gather, + Group, + Rule, + Alt, +) +from pegen import grammar +from pegen.parser_generator import dedupe, ParserGenerator + +MODULE_PREFIX = """\ +#!/usr/bin/env python3.8 +# @generated by pegen from {filename} + +import ast +import sys +import tokenize + +from typing import Any, Optional + +from pegen.parser import memoize, memoize_left_rec, logger, Parser + +""" +MODULE_SUFFIX = """ + +if __name__ == '__main__': + from pegen.parser import simple_parser_main + simple_parser_main(GeneratedParser) +""" + + +class PythonCallMakerVisitor(GrammarVisitor): + def __init__(self, parser_generator: ParserGenerator): + self.gen = parser_generator + self.cache: Dict[Any, Any] = {} + + def visit_NameLeaf(self, node: NameLeaf) -> Tuple[Optional[str], str]: + name = node.value + if name in ("NAME", "NUMBER", "STRING", "OP"): + name = name.lower() + return name, f"self.{name}()" + if name in ("NEWLINE", "DEDENT", "INDENT", "ENDMARKER", "ASYNC", "AWAIT"): + return name.lower(), f"self.expect({name!r})" + return name, f"self.{name}()" + + def visit_StringLeaf(self, node: StringLeaf) -> Tuple[str, str]: + return "literal", f"self.expect({node.value})" + + def visit_Rhs(self, node: Rhs) -> Tuple[Optional[str], str]: + if node in self.cache: + return self.cache[node] + if len(node.alts) == 1 and len(node.alts[0].items) == 1: + self.cache[node] = self.visit(node.alts[0].items[0]) + else: + name = self.gen.name_node(node) + self.cache[node] = name, f"self.{name}()" + return self.cache[node] + + def visit_NamedItem(self, node: NamedItem) -> Tuple[Optional[str], str]: + name, call = self.visit(node.item) + if node.name: + name = node.name + return name, call + + def lookahead_call_helper(self, node: Lookahead) -> Tuple[str, str]: + name, call = self.visit(node.node) + head, tail = call.split("(", 1) + assert tail[-1] == ")" + tail = tail[:-1] + return head, tail + + def visit_PositiveLookahead(self, node: PositiveLookahead) -> Tuple[None, str]: + head, tail = self.lookahead_call_helper(node) + return None, f"self.positive_lookahead({head}, {tail})" + + def visit_NegativeLookahead(self, node: NegativeLookahead) -> Tuple[None, str]: + head, tail = self.lookahead_call_helper(node) + return None, f"self.negative_lookahead({head}, {tail})" + + def visit_Opt(self, node: Opt) -> Tuple[str, str]: + name, call = self.visit(node.node) + return "opt", f"{call}," # Note trailing comma! + + def visit_Repeat0(self, node: Repeat0) -> Tuple[str, str]: + if node in self.cache: + return self.cache[node] + name = self.gen.name_loop(node.node, False) + self.cache[node] = name, f"self.{name}()," # Also a trailing comma! + return self.cache[node] + + def visit_Repeat1(self, node: Repeat1) -> Tuple[str, str]: + if node in self.cache: + return self.cache[node] + name = self.gen.name_loop(node.node, True) + self.cache[node] = name, f"self.{name}()" # But no trailing comma here! + return self.cache[node] + + def visit_Gather(self, node: Gather) -> Tuple[str, str]: + if node in self.cache: + return self.cache[node] + name = self.gen.name_gather(node) + self.cache[node] = name, f"self.{name}()" # No trailing comma here either! + return self.cache[node] + + def visit_Group(self, node: Group) -> Tuple[Optional[str], str]: + return self.visit(node.rhs) + + def visit_Cut(self, node: Cut) -> Tuple[str, str]: + return "cut", "True" + + +class PythonParserGenerator(ParserGenerator, GrammarVisitor): + def __init__(self, grammar: grammar.Grammar, file: Optional[IO[Text]]): + super().__init__(grammar, file) + self.callmakervisitor = PythonCallMakerVisitor(self) + + def generate(self, filename: str) -> None: + header = self.grammar.metas.get("header", MODULE_PREFIX) + if header is not None: + self.print(header.rstrip("\n").format(filename=filename)) + subheader = self.grammar.metas.get("subheader", "") + if subheader: + self.print(subheader.format(filename=filename)) + self.print("class GeneratedParser(Parser):") + while self.todo: + for rulename, rule in list(self.todo.items()): + del self.todo[rulename] + self.print() + with self.indent(): + self.visit(rule) + trailer = self.grammar.metas.get("trailer", MODULE_SUFFIX) + if trailer is not None: + self.print(trailer.rstrip("\n")) + + def visit_Rule(self, node: Rule) -> None: + is_loop = node.is_loop() + is_gather = node.is_gather() + rhs = node.flatten() + if node.left_recursive: + if node.leader: + self.print("@memoize_left_rec") + else: + # Non-leader rules in a cycle are not memoized, + # but they must still be logged. + self.print("@logger") + else: + self.print("@memoize") + node_type = node.type or "Any" + self.print(f"def {node.name}(self) -> Optional[{node_type}]:") + with self.indent(): + self.print(f"# {node.name}: {rhs}") + if node.nullable: + self.print(f"# nullable={node.nullable}") + self.print("mark = self.mark()") + if is_loop: + self.print("children = []") + self.visit(rhs, is_loop=is_loop, is_gather=is_gather) + if is_loop: + self.print("return children") + else: + self.print("return None") + + def visit_NamedItem(self, node: NamedItem, names: List[str]) -> None: + name, call = self.callmakervisitor.visit(node.item) + if node.name: + name = node.name + if not name: + self.print(call) + else: + if name != "cut": + name = dedupe(name, names) + self.print(f"({name} := {call})") + + def visit_Rhs(self, node: Rhs, is_loop: bool = False, is_gather: bool = False) -> None: + if is_loop: + assert len(node.alts) == 1 + for alt in node.alts: + self.visit(alt, is_loop=is_loop, is_gather=is_gather) + + def visit_Alt(self, node: Alt, is_loop: bool, is_gather: bool) -> None: + names: List[str] = [] + self.print("cut = False") # TODO: Only if needed. + if is_loop: + self.print("while (") + else: + self.print("if (") + with self.indent(): + first = True + for item in node.items: + if first: + first = False + else: + self.print("and") + self.visit(item, names=names) + self.print("):") + with self.indent(): + action = node.action + if not action: + if is_gather: + assert len(names) == 2 + action = f"[{names[0]}] + {names[1]}" + else: + action = f"[{', '.join(names)}]" + if is_loop: + self.print(f"children.append({action})") + self.print(f"mark = self.mark()") + else: + self.print(f"return {action}") + self.print("self.reset(mark)") + # Skip remaining alternatives if a cut was reached. + self.print("if cut: return None") # TODO: Only if needed. diff --git a/Tools/peg_generator/pegen/sccutils.py b/Tools/peg_generator/pegen/sccutils.py new file mode 100644 index 0000000000000..1f0586bb2f7d6 --- /dev/null +++ b/Tools/peg_generator/pegen/sccutils.py @@ -0,0 +1,128 @@ +# Adapted from mypy (mypy/build.py) under the MIT license. + +from typing import * + + +def strongly_connected_components( + vertices: AbstractSet[str], edges: Dict[str, AbstractSet[str]] +) -> Iterator[AbstractSet[str]]: + """Compute Strongly Connected Components of a directed graph. + + Args: + vertices: the labels for the vertices + edges: for each vertex, gives the target vertices of its outgoing edges + + Returns: + An iterator yielding strongly connected components, each + represented as a set of vertices. Each input vertex will occur + exactly once; vertices not part of a SCC are returned as + singleton sets. + + From http://code.activestate.com/recipes/578507/. + """ + identified: Set[str] = set() + stack: List[str] = [] + index: Dict[str, int] = {} + boundaries: List[int] = [] + + def dfs(v: str) -> Iterator[Set[str]]: + index[v] = len(stack) + stack.append(v) + boundaries.append(index[v]) + + for w in edges[v]: + if w not in index: + yield from dfs(w) + elif w not in identified: + while index[w] < boundaries[-1]: + boundaries.pop() + + if boundaries[-1] == index[v]: + boundaries.pop() + scc = set(stack[index[v] :]) + del stack[index[v] :] + identified.update(scc) + yield scc + + for v in vertices: + if v not in index: + yield from dfs(v) + + +def topsort( + data: Dict[AbstractSet[str], Set[AbstractSet[str]]] +) -> Iterable[AbstractSet[AbstractSet[str]]]: + """Topological sort. + + Args: + data: A map from SCCs (represented as frozen sets of strings) to + sets of SCCs, its dependencies. NOTE: This data structure + is modified in place -- for normalization purposes, + self-dependencies are removed and entries representing + orphans are added. + + Returns: + An iterator yielding sets of SCCs that have an equivalent + ordering. NOTE: The algorithm doesn't care about the internal + structure of SCCs. + + Example: + Suppose the input has the following structure: + + {A: {B, C}, B: {D}, C: {D}} + + This is normalized to: + + {A: {B, C}, B: {D}, C: {D}, D: {}} + + The algorithm will yield the following values: + + {D} + {B, C} + {A} + + From http://code.activestate.com/recipes/577413/. + """ + # TODO: Use a faster algorithm? + for k, v in data.items(): + v.discard(k) # Ignore self dependencies. + for item in set.union(*data.values()) - set(data.keys()): + data[item] = set() + while True: + ready = {item for item, dep in data.items() if not dep} + if not ready: + break + yield ready + data = {item: (dep - ready) for item, dep in data.items() if item not in ready} + assert not data, "A cyclic dependency exists amongst %r" % data + + +def find_cycles_in_scc( + graph: Dict[str, AbstractSet[str]], scc: AbstractSet[str], start: str +) -> Iterable[List[str]]: + """Find cycles in SCC emanating from start. + + Yields lists of the form ['A', 'B', 'C', 'A'], which means there's + a path from A -> B -> C -> A. The first item is always the start + argument, but the last item may be another element, e.g. ['A', + 'B', 'C', 'B'] means there's a path from A to B and there's a + cycle from B to C and back. + """ + # Basic input checks. + assert start in scc, (start, scc) + assert scc <= graph.keys(), scc - graph.keys() + + # Reduce the graph to nodes in the SCC. + graph = {src: {dst for dst in dsts if dst in scc} for src, dsts in graph.items() if src in scc} + assert start in graph + + # Recursive helper that yields cycles. + def dfs(node: str, path: List[str]) -> Iterator[List[str]]: + if node in path: + yield path + [node] + return + path = path + [node] # TODO: Make this not quadratic. + for child in graph[node]: + yield from dfs(child, path) + + yield from dfs(start, []) diff --git a/Tools/peg_generator/pegen/testutil.py b/Tools/peg_generator/pegen/testutil.py new file mode 100644 index 0000000000000..3616effe6b4f9 --- /dev/null +++ b/Tools/peg_generator/pegen/testutil.py @@ -0,0 +1,126 @@ +import importlib.util +import io +import os +import pathlib +import sys +import textwrap +import tokenize + +from typing import Any, cast, Dict, IO, Type, Final + +from pegen.build import compile_c_extension +from pegen.c_generator import CParserGenerator +from pegen.grammar import Grammar +from pegen.grammar_parser import GeneratedParser as GrammarParser +from pegen.parser import Parser +from pegen.python_generator import PythonParserGenerator +from pegen.tokenizer import Tokenizer + + +def generate_parser(grammar: Grammar) -> Type[Parser]: + # Generate a parser. + out = io.StringIO() + genr = PythonParserGenerator(grammar, out) + genr.generate("") + + # Load the generated parser class. + ns: Dict[str, Any] = {} + exec(out.getvalue(), ns) + return ns["GeneratedParser"] + + +def run_parser(file: IO[bytes], parser_class: Type[Parser], *, verbose: bool = False) -> Any: + # Run a parser on a file (stream). + tokenizer = Tokenizer(tokenize.generate_tokens(file.readline)) # type: ignore # typeshed issue #3515 + parser = parser_class(tokenizer, verbose=verbose) + result = parser.start() + if result is None: + raise parser.make_syntax_error() + return result + + +def parse_string( + source: str, parser_class: Type[Parser], *, dedent: bool = True, verbose: bool = False +) -> Any: + # Run the parser on a string. + if dedent: + source = textwrap.dedent(source) + file = io.StringIO(source) + return run_parser(file, parser_class, verbose=verbose) # type: ignore # typeshed issue #3515 + + +def make_parser(source: str) -> Type[Parser]: + # Combine parse_string() and generate_parser(). + grammar = parse_string(source, GrammarParser) + return generate_parser(grammar) + + +def import_file(full_name: str, path: str) -> Any: + """Import a python module from a path""" + + spec = importlib.util.spec_from_file_location(full_name, path) + mod = importlib.util.module_from_spec(spec) + + # We assume this is not None and has an exec_module() method. + # See https://docs.python.org/3/reference/import.html?highlight=exec_module#loading + loader = cast(Any, spec.loader) + loader.exec_module(mod) + return mod + + +def generate_c_parser_source(grammar: Grammar) -> str: + out = io.StringIO() + genr = CParserGenerator(grammar, out) + genr.generate("") + return out.getvalue() + + +def generate_parser_c_extension( + grammar: Grammar, path: pathlib.PurePath, debug: bool = False +) -> Any: + """Generate a parser c extension for the given grammar in the given path + + Returns a module object with a parse_string() method. + TODO: express that using a Protocol. + """ + # Make sure that the working directory is empty: reusing non-empty temporary + # directories when generating extensions can lead to segmentation faults. + # Check issue #95 (https://github.com/gvanrossum/pegen/issues/95) for more + # context. + assert not os.listdir(path) + source = path / "parse.c" + with open(source, "w") as file: + genr = CParserGenerator(grammar, file, debug=debug) + genr.generate("parse.c") + extension_path = compile_c_extension(str(source), build_dir=str(path / "build")) + extension = import_file("parse", extension_path) + return extension + + +def print_memstats() -> bool: + MiB: Final = 2 ** 20 + try: + import psutil # type: ignore + except ImportError: + return False + print("Memory stats:") + process = psutil.Process() + meminfo = process.memory_info() + res = {} + res["rss"] = meminfo.rss / MiB + res["vms"] = meminfo.vms / MiB + if sys.platform == "win32": + res["maxrss"] = meminfo.peak_wset / MiB + else: + # See https://stackoverflow.com/questions/938733/total-memory-used-by-python-process + import resource # Since it doesn't exist on Windows. + + rusage = resource.getrusage(resource.RUSAGE_SELF) + if sys.platform == "darwin": + factor = 1 + else: + factor = 1024 # Linux + res["maxrss"] = rusage.ru_maxrss * factor / MiB + for key, value in res.items(): + print(f" {key:12.12s}: {value:10.0f} MiB") + return True diff --git a/Tools/peg_generator/pegen/tokenizer.py b/Tools/peg_generator/pegen/tokenizer.py new file mode 100644 index 0000000000000..61a28efc84b62 --- /dev/null +++ b/Tools/peg_generator/pegen/tokenizer.py @@ -0,0 +1,86 @@ +import token +import tokenize +from typing import List, Iterator + +Mark = int # NewType('Mark', int) + +exact_token_types = token.EXACT_TOKEN_TYPES # type: ignore + + +def shorttok(tok: tokenize.TokenInfo) -> str: + return "%-25.25s" % f"{tok.start[0]}.{tok.start[1]}: {token.tok_name[tok.type]}:{tok.string!r}" + + +class Tokenizer: + """Caching wrapper for the tokenize module. + + This is pretty tied to Python's syntax. + """ + + _tokens: List[tokenize.TokenInfo] + + def __init__(self, tokengen: Iterator[tokenize.TokenInfo], *, verbose: bool = False): + self._tokengen = tokengen + self._tokens = [] + self._index = 0 + self._verbose = verbose + if verbose: + self.report(False, False) + + def getnext(self) -> tokenize.TokenInfo: + """Return the next token and updates the index.""" + cached = True + while self._index == len(self._tokens): + tok = next(self._tokengen) + if tok.type in (tokenize.NL, tokenize.COMMENT): + continue + if tok.type == token.ERRORTOKEN and tok.string.isspace(): + continue + self._tokens.append(tok) + cached = False + tok = self._tokens[self._index] + self._index += 1 + if self._verbose: + self.report(cached, False) + return tok + + def peek(self) -> tokenize.TokenInfo: + """Return the next token *without* updating the index.""" + while self._index == len(self._tokens): + tok = next(self._tokengen) + if tok.type in (tokenize.NL, tokenize.COMMENT): + continue + if tok.type == token.ERRORTOKEN and tok.string.isspace(): + continue + self._tokens.append(tok) + return self._tokens[self._index] + + def diagnose(self) -> tokenize.TokenInfo: + if not self._tokens: + self.getnext() + return self._tokens[-1] + + def mark(self) -> Mark: + return self._index + + def reset(self, index: Mark) -> None: + if index == self._index: + return + assert 0 <= index <= len(self._tokens), (index, len(self._tokens)) + old_index = self._index + self._index = index + if self._verbose: + self.report(True, index < old_index) + + def report(self, cached: bool, back: bool) -> None: + if back: + fill = "-" * self._index + "-" + elif cached: + fill = "-" * self._index + ">" + else: + fill = "-" * self._index + "*" + if self._index == 0: + print(f"{fill} (Bof)") + else: + tok = self._tokens[self._index - 1] + print(f"{fill} {shorttok(tok)}") diff --git a/Tools/peg_generator/pyproject.toml b/Tools/peg_generator/pyproject.toml new file mode 100644 index 0000000000000..f69c5b5e82faf --- /dev/null +++ b/Tools/peg_generator/pyproject.toml @@ -0,0 +1,9 @@ +[tool.black] +line-length = 99 +target_version = ['py38'] +exclude = ''' +( + /pegen/grammar_parser.py # generated file + | /test/test_data/ # test files +) +''' diff --git a/Tools/peg_generator/requirements.pip b/Tools/peg_generator/requirements.pip new file mode 100644 index 0000000000000..190b3488f7bc1 --- /dev/null +++ b/Tools/peg_generator/requirements.pip @@ -0,0 +1,2 @@ +memory-profiler==0.57.0 +psutil==5.7.0 diff --git a/Tools/peg_generator/scripts/__init__.py b/Tools/peg_generator/scripts/__init__.py new file mode 100644 index 0000000000000..1e423f483844b --- /dev/null +++ b/Tools/peg_generator/scripts/__init__.py @@ -0,0 +1 @@ +# This exists to let mypy find modules here diff --git a/Tools/peg_generator/scripts/ast_timings.py b/Tools/peg_generator/scripts/ast_timings.py new file mode 100644 index 0000000000000..7ebd46fdac685 --- /dev/null +++ b/Tools/peg_generator/scripts/ast_timings.py @@ -0,0 +1,28 @@ +import ast +import sys +import time +import token +import tokenize + +from pegen.testutil import print_memstats + + +def main() -> None: + t0 = time.time() + for filename in sys.argv[1:]: + print(filename, end="\r") + try: + with open(filename) as file: + source = file.read() + tree = ast.parse(source, filename) + except Exception as err: + print(f"{filename}: {err.__class__.__name__}: {err}", file=sys.stderr) + tok = None + t1 = time.time() + dt = t1 - t0 + print(f"Parsed in {dt:.3f} secs", file=sys.stderr) + print_memstats() + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/benchmark.py b/Tools/peg_generator/scripts/benchmark.py new file mode 100644 index 0000000000000..bc751156e8972 --- /dev/null +++ b/Tools/peg_generator/scripts/benchmark.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python3.9 + +import argparse +import ast +import sys +import os +import resource +from time import time + +import memory_profiler + +sys.path.insert(0, os.getcwd()) +from peg_extension import parse +from pegen.build import build_parser_and_generator +from scripts.test_parse_directory import parse_directory + +argparser = argparse.ArgumentParser( + prog="benchmark", description="Reproduce the various pegen benchmarks" +) +argparser.add_argument( + "--parser", + action="store", + choices=["pegen", "cpython"], + default="pegen", + help="Which parser to benchmark (default is pegen)", +) +argparser.add_argument( + "--target", + action="store", + choices=["xxl", "stdlib"], + default="xxl", + help="Which target to use for the benchmark (default is xxl.py)", +) + +subcommands = argparser.add_subparsers(title="Benchmarks", dest="subcommand") +command_compile = subcommands.add_parser( + "compile", help="Benchmark parsing and compiling to bytecode" +) +command_parse = subcommands.add_parser("parse", help="Benchmark parsing and generating an ast.AST") +command_check = subcommands.add_parser( + "check", help="Benchmark parsing and throwing the tree away" +) + + +def benchmark(func): + def wrapper(*args): + times = list() + for _ in range(3): + start = time() + result = func(*args) + end = time() + times.append(end - start) + memory = memory_profiler.memory_usage((func, args)) + print(f"{func.__name__}") + print(f"\tTime: {sum(times)/3:.3f} seconds on an average of 3 runs") + print(f"\tMemory: {max(memory)} MiB on an average of 3 runs") + return result + + return wrapper + + + at benchmark +def time_compile(source, parser): + if parser == "cpython": + return compile(source, os.path.join("data", "xxl.py"), "exec") + else: + return parse.parse_string(source, mode=2) + + + at benchmark +def time_parse(source, parser): + if parser == "cpython": + return ast.parse(source, os.path.join("data", "xxl.py"), "exec") + else: + return parse.parse_string(source, mode=1) + + + at benchmark +def time_check(source): + return parse.parse_string(source, mode=0) + + +def run_benchmark_xxl(subcommand, parser, source): + if subcommand == "compile": + time_compile(source, parser) + elif subcommand == "parse": + time_parse(source, parser) + elif subcommand == "check": + time_check(source) + + +def run_benchmark_stdlib(subcommand, parser): + modes = {"compile": 2, "parse": 1, "check": 0} + extension = None + if parser == "pegen": + extension = build_parser_and_generator( + "../../Grammar/python.gram", + "peg_extension/parse.c", + compile_extension=True, + skip_actions=False, + ) + for _ in range(3): + parse_directory( + "../../Lib", + "../../Grammar/python.gram", + verbose=False, + excluded_files=[ + "*/bad*", + "*/lib2to3/tests/data/*", + ], + skip_actions=False, + tree_arg=0, + short=True, + extension=extension, + mode=modes[subcommand], + parser=parser, + ) + + +def main(): + args = argparser.parse_args() + subcommand = args.subcommand + parser = args.parser + target = args.target + + if subcommand is None: + argparser.error("A benchmark to run is required") + if subcommand == "check" and parser == "cpython": + argparser.error("Cannot use check target with the CPython parser") + + if target == "xxl": + with open(os.path.join("data", "xxl.py"), "r") as f: + source = f.read() + run_benchmark_xxl(subcommand, parser, source) + elif target == "stdlib": + run_benchmark_stdlib(subcommand, parser) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/download_pypi_packages.py b/Tools/peg_generator/scripts/download_pypi_packages.py new file mode 100755 index 0000000000000..9874202d379ee --- /dev/null +++ b/Tools/peg_generator/scripts/download_pypi_packages.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3.8 + +import argparse +import os +import json + +from typing import Dict, Any +from urllib.request import urlretrieve + +argparser = argparse.ArgumentParser( + prog="download_pypi_packages", description="Helper program to download PyPI packages", +) +argparser.add_argument( + "-n", "--number", type=int, default=100, help="Number of packages to download" +) +argparser.add_argument( + "-a", "--all", action="store_true", help="Download all packages listed in the json file" +) + + +def load_json(filename: str) -> Dict[Any, Any]: + with open(os.path.join("data", f"{filename}.json"), "r") as f: + j = json.loads(f.read()) + return j + + +def remove_json(filename: str) -> None: + path = os.path.join("data", f"{filename}.json") + os.remove(path) + + +def download_package_json(package_name: str) -> None: + url = f"https://pypi.org/pypi/{package_name}/json" + urlretrieve(url, os.path.join("data", f"{package_name}.json")) + + +def download_package_code(name: str, package_json: Dict[Any, Any]) -> None: + source_index = -1 + for idx, url_info in enumerate(package_json["urls"]): + if url_info["python_version"] == "source": + source_index = idx + break + filename = package_json["urls"][source_index]["filename"] + url = package_json["urls"][source_index]["url"] + urlretrieve(url, os.path.join("data", "pypi", filename)) + + +def main() -> None: + args = argparser.parse_args() + number_packages = args.number + all_packages = args.all + + top_pypi_packages = load_json("top-pypi-packages-365-days") + if all_packages: + top_pypi_packages = top_pypi_packages["rows"] + elif number_packages >= 0 and number_packages <= 4000: + top_pypi_packages = top_pypi_packages["rows"][:number_packages] + else: + raise AssertionError("Unknown value for NUMBER_OF_PACKAGES") + + try: + os.mkdir(os.path.join("data", "pypi")) + except FileExistsError: + pass + + for package in top_pypi_packages: + package_name = package["project"] + + print(f"Downloading JSON Data for {package_name}... ", end="") + download_package_json(package_name) + print("Done") + + package_json = load_json(package_name) + try: + print(f"Dowloading and compressing package {package_name} ... ", end="") + download_package_code(package_name, package_json) + print("Done") + except (IndexError, KeyError): + print(f"Could not locate source for {package_name}") + continue + finally: + remove_json(package_name) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/find_max_nesting.py b/Tools/peg_generator/scripts/find_max_nesting.py new file mode 100755 index 0000000000000..a2c41a821342a --- /dev/null +++ b/Tools/peg_generator/scripts/find_max_nesting.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3.8 +"""Find the maximum amount of nesting for an expression that can be parsed +without causing a parse error. + +Starting at the INITIAL_NESTING_DEPTH, an expression containing n parenthesis +around a 0 is generated then tested with both the C and Python parsers. We +continue incrementing the number of parenthesis by 10 until both parsers have +failed. As soon as a single parser fails, we stop testing that parser. + +The grammar file, initial nesting size, and amount by which the nested size is +incremented on each success can be controlled by changing the GRAMMAR_FILE, +INITIAL_NESTING_DEPTH, or NESTED_INCR_AMT variables. + +Usage: python -m scripts.find_max_nesting +""" +import os +import sys +from tempfile import TemporaryDirectory +from pathlib import Path +from typing import Any + +from _peg_parser import parse_string + +GRAMMAR_FILE = "data/python.gram" +INITIAL_NESTING_DEPTH = 10 +NESTED_INCR_AMT = 10 + + +FAIL = "\033[91m" +ENDC = "\033[0m" + + +def check_nested_expr(nesting_depth: int) -> bool: + expr = f"{'(' * nesting_depth}0{')' * nesting_depth}" + + try: + parse_string(expr) + print(f"Nesting depth of {nesting_depth} is successful") + return True + except Exception as err: + print(f"{FAIL}(Failed with nesting depth of {nesting_depth}{ENDC}") + print(f"{FAIL}\t{err}{ENDC}") + return False + + +def main() -> None: + print(f"Testing {GRAMMAR_FILE} starting at nesting depth of {INITIAL_NESTING_DEPTH}...") + + nesting_depth = INITIAL_NESTING_DEPTH + succeeded = True + while succeeded: + expr = f"{'(' * nesting_depth}0{')' * nesting_depth}" + if succeeded: + succeeded = check_nested_expr(nesting_depth) + nesting_depth += NESTED_INCR_AMT + + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/grammar_grapher.py b/Tools/peg_generator/scripts/grammar_grapher.py new file mode 100755 index 0000000000000..3aa25466c70d4 --- /dev/null +++ b/Tools/peg_generator/scripts/grammar_grapher.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3.8 + +""" Convert a grammar into a dot-file suitable for use with GraphViz + + For example: + Generate the GraphViz file: + # scripts/grammar_grapher.py data/python.gram > python.gv + + Then generate the graph... + + # twopi python.gv -Tpng > python_twopi.png + + or + + # dot python.gv -Tpng > python_dot.png + + NOTE: The _dot_ and _twopi_ tools seem to produce the most useful results. + The _circo_ tool is the worst of the bunch. Don't even bother. +""" + +import argparse +import sys + +from typing import Any, List + +sys.path.insert(0, ".") + +from pegen.build import build_parser +from pegen.grammar import ( + Alt, + Cut, + Grammar, + Group, + Leaf, + Lookahead, + Rule, + NameLeaf, + NamedItem, + Opt, + Repeat, + Rhs, +) + +argparser = argparse.ArgumentParser(prog="graph_grammar", description="Graph a grammar tree",) +argparser.add_argument("grammar_file", help="The grammar file to graph") + + +def references_for_item(item: Any) -> List[Any]: + if isinstance(item, Alt): + return [_ref for _item in item.items for _ref in references_for_item(_item)] + elif isinstance(item, Cut): + return [] + elif isinstance(item, Group): + return references_for_item(item.rhs) + elif isinstance(item, Lookahead): + return references_for_item(item.node) + elif isinstance(item, NamedItem): + return references_for_item(item.item) + + # NOTE NameLeaf must be before Leaf + elif isinstance(item, NameLeaf): + if item.value == "ENDMARKER": + return [] + return [item.value] + elif isinstance(item, Leaf): + return [] + + elif isinstance(item, Opt): + return references_for_item(item.node) + elif isinstance(item, Repeat): + return references_for_item(item.node) + elif isinstance(item, Rhs): + return [_ref for alt in item.alts for _ref in references_for_item(alt)] + elif isinstance(item, Rule): + return references_for_item(item.rhs) + else: + raise RuntimeError(f"Unknown item: {type(item)}") + + +def main() -> None: + args = argparser.parse_args() + + try: + grammar, parser, tokenizer = build_parser(args.grammar_file) + except Exception as err: + print("ERROR: Failed to parse grammar file", file=sys.stderr) + sys.exit(1) + + references = {} + for name, rule in grammar.rules.items(): + references[name] = set(references_for_item(rule)) + + # Flatten the start node if has only a single reference + root_node = "start" + if start := references["start"]: + if len(start) == 1: + root_node = list(start)[0] + del references["start"] + + print("digraph g1 {") + print('\toverlap="scale";') # Force twopi to scale the graph to avoid overlaps + print(f'\troot="{root_node}";') + print(f"\t{root_node} [color=green, shape=circle]") + for name, refs in references.items(): + if refs: # Ignore empty sets + print(f"\t{name} -> {','.join(refs)};") + print("}") + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/joinstats.py b/Tools/peg_generator/scripts/joinstats.py new file mode 100644 index 0000000000000..b2d762b3d4286 --- /dev/null +++ b/Tools/peg_generator/scripts/joinstats.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python3.8 + +"""Produce a report about the most-memoable types. + +Reads a list of statistics from stdin. Each line must be two numbers, +being a type and a count. We then read some other files and produce a +list sorted by most frequent type. + +There should also be something to recognize left-recursive rules. +""" + +import os +import re +import sys + +from typing import Dict + +reporoot = os.path.dirname(os.path.dirname(__file__)) +parse_c = os.path.join(reporoot, "peg_extension", "parse.c") + + +class TypeMapper: + """State used to map types to names.""" + + def __init__(self, filename: str) -> None: + self.table: Dict[int, str] = {} + with open(filename) as f: + for line in f: + match = re.match(r"#define (\w+)_type (\d+)", line) + if match: + name, type = match.groups() + if "left" in line.lower(): + name += " // Left-recursive" + self.table[int(type)] = name + + def lookup(self, type: int) -> str: + return self.table.get(type, str(type)) + + +def main() -> None: + mapper = TypeMapper(parse_c) + table = [] + filename = sys.argv[1] + with open(filename) as f: + for lineno, line in enumerate(f, 1): + line = line.strip() + if not line or line.startswith("#"): + continue + parts = line.split() + # Extra fields ignored + if len(parts) < 2: + print(f"{lineno}: bad input ({line!r})") + continue + try: + type, count = map(int, parts[:2]) + except ValueError as err: + print(f"{lineno}: non-integer input ({line!r})") + continue + table.append((type, count)) + table.sort(key=lambda values: -values[1]) + for type, count in table: + print(f"{type:4d} {count:9d} {mapper.lookup(type)}") + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/show_parse.py b/Tools/peg_generator/scripts/show_parse.py new file mode 100755 index 0000000000000..f5f92fdaf755d --- /dev/null +++ b/Tools/peg_generator/scripts/show_parse.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3.8 + +"""Show the parse tree for a given program, nicely formatted. + +Example: + +$ scripts/show_parse.py a+b +Module( + body=[ + Expr( + value=BinOp( + left=Name(id="a", ctx=Load()), op=Add(), right=Name(id="b", ctx=Load()) + ) + ) + ], + type_ignores=[], +) +$ + +Use -v to show line numbers and column offsets. + +The formatting is done using black. You can also import this module +and call one of its functions. +""" + +import argparse +import ast +import difflib +import os +import sys +import tempfile + +from typing import List + +parser = argparse.ArgumentParser() +parser.add_argument( + "-d", "--diff", action="store_true", help="show diff between grammar and ast (requires -g)" +) +parser.add_argument("-g", "--grammar-file", help="grammar to use (default: use the ast module)") +parser.add_argument( + "-m", + "--multiline", + action="store_true", + help="concatenate program arguments using newline instead of space", +) +parser.add_argument("-v", "--verbose", action="store_true", help="show line/column numbers") +parser.add_argument("program", nargs="+", help="program to parse (will be concatenated)") + + +def format_tree(tree: ast.AST, verbose: bool = False) -> str: + with tempfile.NamedTemporaryFile("w+") as tf: + tf.write(ast.dump(tree, include_attributes=verbose)) + tf.write("\n") + tf.flush() + cmd = f"black -q {tf.name}" + sts = os.system(cmd) + if sts: + raise RuntimeError(f"Command {cmd!r} failed with status 0x{sts:x}") + tf.seek(0) + return tf.read() + + +def diff_trees(a: ast.AST, b: ast.AST, verbose: bool = False) -> List[str]: + sa = format_tree(a, verbose) + sb = format_tree(b, verbose) + la = sa.splitlines() + lb = sb.splitlines() + return list(difflib.unified_diff(la, lb, "a", "b", lineterm="")) + + +def show_parse(source: str, verbose: bool = False) -> str: + tree = ast.parse(source) + return format_tree(tree, verbose).rstrip("\n") + + +def print_parse(source: str, verbose: bool = False) -> None: + print(show_parse(source, verbose)) + + +def main() -> None: + args = parser.parse_args() + if args.diff and not args.grammar_file: + parser.error("-d/--diff requires -g/--grammar-file") + if args.multiline: + sep = "\n" + else: + sep = " " + program = sep.join(args.program) + if args.grammar_file: + sys.path.insert(0, os.curdir) + from pegen.build import build_parser_and_generator + + build_parser_and_generator(args.grammar_file, "peg_parser/parse.c", compile_extension=True) + from pegen.parse import parse_string # type: ignore[import] + + tree = parse_string(program, mode=1) + + if args.diff: + a = tree + b = ast.parse(program) + diff = diff_trees(a, b, args.verbose) + if diff: + for line in diff: + print(line) + else: + print("# Trees are the same") + else: + print(f"# Parsed using {args.grammar_file}") + print(format_tree(tree, args.verbose)) + else: + tree = ast.parse(program) + print("# Parse using ast.parse()") + print(format_tree(tree, args.verbose)) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/test_parse_directory.py b/Tools/peg_generator/scripts/test_parse_directory.py new file mode 100755 index 0000000000000..06a38fca67a86 --- /dev/null +++ b/Tools/peg_generator/scripts/test_parse_directory.py @@ -0,0 +1,289 @@ +#!/usr/bin/env python3.8 + +import argparse +import ast +import os +import sys +import tempfile +import time +import traceback +from glob import glob +from pathlib import PurePath + +from typing import List, Optional, Any + +sys.path.insert(0, os.getcwd()) +from pegen.build import build_parser_and_generator +from pegen.testutil import print_memstats +from scripts import show_parse + +SUCCESS = "\033[92m" +FAIL = "\033[91m" +ENDC = "\033[0m" + +argparser = argparse.ArgumentParser( + prog="test_parse_directory", + description="Helper program to test directories or files for pegen", +) +argparser.add_argument("-d", "--directory", help="Directory path containing files to test") +argparser.add_argument("-g", "--grammar-file", help="Grammar file path") +argparser.add_argument( + "-e", "--exclude", action="append", default=[], help="Glob(s) for matching files to exclude" +) +argparser.add_argument( + "-s", "--short", action="store_true", help="Only show errors, in a more Emacs-friendly format" +) +argparser.add_argument( + "-v", "--verbose", action="store_true", help="Display detailed errors for failures" +) +argparser.add_argument( + "--skip-actions", action="store_true", help="Suppress code emission for rule actions", +) +argparser.add_argument( + "-t", "--tree", action="count", help="Compare parse tree to official AST", default=0 +) + + +def report_status( + succeeded: bool, + file: str, + verbose: bool, + error: Optional[Exception] = None, + short: bool = False, +) -> None: + if short and succeeded: + return + + if succeeded is True: + status = "OK" + COLOR = SUCCESS + else: + status = "Fail" + COLOR = FAIL + + if short: + lineno = 0 + offset = 0 + if isinstance(error, SyntaxError): + lineno = error.lineno or 1 + offset = error.offset or 1 + message = error.args[0] + else: + message = f"{error.__class__.__name__}: {error}" + print(f"{file}:{lineno}:{offset}: {message}") + else: + print(f"{COLOR}{file:60} {status}{ENDC}") + + if error and verbose: + print(f" {str(error.__class__.__name__)}: {error}") + + +def compare_trees( + actual_tree: ast.AST, file: str, verbose: bool, include_attributes: bool = False, +) -> int: + with open(file) as f: + expected_tree = ast.parse(f.read()) + + expected_text = ast.dump(expected_tree, include_attributes=include_attributes) + actual_text = ast.dump(actual_tree, include_attributes=include_attributes) + if actual_text == expected_text: + if verbose: + print("Tree for {file}:") + print(show_parse.format_tree(actual_tree, include_attributes)) + return 0 + + print(f"Diffing ASTs for {file} ...") + + expected = show_parse.format_tree(expected_tree, include_attributes) + actual = show_parse.format_tree(actual_tree, include_attributes) + + if verbose: + print("Expected for {file}:") + print(expected) + print("Actual for {file}:") + print(actual) + print(f"Diff for {file}:") + + diff = show_parse.diff_trees(expected_tree, actual_tree, include_attributes) + for line in diff: + print(line) + + return 1 + + +def parse_directory( + directory: str, + grammar_file: str, + verbose: bool, + excluded_files: List[str], + skip_actions: bool, + tree_arg: int, + short: bool, + extension: Any, + mode: int, + parser: str, +) -> int: + if parser == "cpython" and (tree_arg or mode == 0): + print("Cannot specify tree argument or mode=0 with the cpython parser.", file=sys.stderr) + return 1 + + if not directory: + print("You must specify a directory of files to test.", file=sys.stderr) + return 1 + + if grammar_file: + if not os.path.exists(grammar_file): + print(f"The specified grammar file, {grammar_file}, does not exist.", file=sys.stderr) + return 1 + + try: + if not extension and parser == "pegen": + build_parser_and_generator( + grammar_file, + "peg_extension/parse.c", + compile_extension=True, + skip_actions=skip_actions, + ) + except Exception as err: + print( + f"{FAIL}The following error occurred when generating the parser. Please check your grammar file.\n{ENDC}", + file=sys.stderr, + ) + traceback.print_exception(err.__class__, err, None) + + return 1 + + else: + print("A grammar file was not provided - attempting to use existing file...\n") + + if parser == "pegen": + try: + from peg_extension import parse # type: ignore + except: + print( + "An existing parser was not found. Please run `make` or specify a grammar file with the `-g` flag.", + file=sys.stderr, + ) + return 1 + + # For a given directory, traverse files and attempt to parse each one + # - Output success/failure for each file + errors = 0 + files = [] + trees = {} # Trees to compare (after everything else is done) + + t0 = time.time() + for file in sorted(glob(f"{directory}/**/*.py", recursive=True)): + # Only attempt to parse Python files and files that are not excluded + should_exclude_file = False + for pattern in excluded_files: + if PurePath(file).match(pattern): + should_exclude_file = True + break + + if not should_exclude_file: + try: + if tree_arg: + mode = 1 + if parser == "cpython": + with open(file, "r") as f: + source = f.read() + if mode == 2: + compile(source, file, "exec") + elif mode == 1: + ast.parse(source, file, "exec") + else: + tree = parse.parse_file(file, mode=mode) + if tree_arg: + trees[file] = tree + if not short: + report_status(succeeded=True, file=file, verbose=verbose) + except Exception as error: + try: + ast.parse(file) + except Exception: + if not short: + print(f"File {file} cannot be parsed by either pegen or the ast module.") + else: + report_status( + succeeded=False, file=file, verbose=verbose, error=error, short=short + ) + errors += 1 + files.append(file) + t1 = time.time() + + total_seconds = t1 - t0 + total_files = len(files) + + total_bytes = 0 + total_lines = 0 + for file in files: + # Count lines and bytes separately + with open(file, "rb") as f: + total_lines += sum(1 for _ in f) + total_bytes += f.tell() + + print( + f"Checked {total_files:,} files, {total_lines:,} lines,", + f"{total_bytes:,} bytes in {total_seconds:,.3f} seconds.", + ) + if total_seconds > 0: + print( + f"That's {total_lines / total_seconds :,.0f} lines/sec,", + f"or {total_bytes / total_seconds :,.0f} bytes/sec.", + ) + + if parser == "pegen": + # Dump memo stats to @data. + with open("@data", "w") as datafile: + for i, count in enumerate(parse.get_memo_stats()): + if count: + datafile.write(f"{i:4d} {count:9d}\n") + + if short: + print_memstats() + + if errors: + print(f"Encountered {errors} failures.", file=sys.stderr) + + # Compare trees (the dict is empty unless -t is given) + compare_trees_errors = 0 + for file, tree in trees.items(): + if not short: + print("Comparing ASTs for", file) + if compare_trees(tree, file, verbose, tree_arg >= 2) == 1: + compare_trees_errors += 1 + + if errors or compare_trees_errors: + return 1 + + return 0 + + +def main() -> None: + args = argparser.parse_args() + directory = args.directory + grammar_file = args.grammar_file + verbose = args.verbose + excluded_files = args.exclude + skip_actions = args.skip_actions + tree = args.tree + short = args.short + sys.exit( + parse_directory( + directory, + grammar_file, + verbose, + excluded_files, + skip_actions, + tree, + short, + None, + 0, + "pegen", + ) + ) + + +if __name__ == "__main__": + main() diff --git a/Tools/peg_generator/scripts/test_pypi_packages.py b/Tools/peg_generator/scripts/test_pypi_packages.py new file mode 100755 index 0000000000000..90490330fef1d --- /dev/null +++ b/Tools/peg_generator/scripts/test_pypi_packages.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python3.8 + +import argparse +import os +import glob +import tarfile +import zipfile +import shutil +import sys + +from typing import Generator, Any + +sys.path.insert(0, ".") +from pegen import build +from scripts import test_parse_directory + +argparser = argparse.ArgumentParser( + prog="test_pypi_packages", description="Helper program to test parsing PyPI packages", +) +argparser.add_argument( + "-t", "--tree", action="count", help="Compare parse tree to official AST", default=0 +) + + +def get_packages() -> Generator[str, None, None]: + all_packages = ( + glob.glob("./data/pypi/*.tar.gz") + + glob.glob("./data/pypi/*.zip") + + glob.glob("./data/pypi/*.tgz") + ) + for package in all_packages: + yield package + + +def extract_files(filename: str) -> None: + savedir = os.path.join("data", "pypi") + if tarfile.is_tarfile(filename): + tarfile.open(filename).extractall(savedir) + elif zipfile.is_zipfile(filename): + zipfile.ZipFile(filename).extractall(savedir) + else: + raise ValueError(f"Could not identify type of compressed file {filename}") + + +def find_dirname(package_name: str) -> str: + for name in os.listdir(os.path.join("data", "pypi")): + full_path = os.path.join("data", "pypi", name) + if os.path.isdir(full_path) and name in package_name: + return full_path + assert False # This is to fix mypy, should never be reached + + +def run_tests(dirname: str, tree: int, extension: Any) -> int: + return test_parse_directory.parse_directory( + dirname, + "data/python.gram", + verbose=False, + excluded_files=[ + "*/failset/*", + "*/failset/**", + "*/failset/**/*", + "*/test2to3/*", + "*/test2to3/**/*", + "*/bad*", + "*/lib2to3/tests/data/*", + ], + skip_actions=False, + tree_arg=tree, + short=True, + extension=extension, + ) + + +def main() -> None: + args = argparser.parse_args() + tree = args.tree + + extension = build.build_parser_and_generator( + "data/python.gram", "peg_parser/parse.c", compile_extension=True + ) + for package in get_packages(): + print(f"Extracting files from {package}... ", end="") + try: + extract_files(package) + print("Done") + except ValueError as e: + print(e) + continue + + print(f"Trying to parse all python files ... ") + dirname = find_dirname(package) + status = run_tests(dirname, tree, extension) + if status == 0: + print("Done") + shutil.rmtree(dirname) + else: + print(f"Failed to parse {dirname}") + + +if __name__ == "__main__": + main() diff --git a/Tools/scripts/run_tests.py b/Tools/scripts/run_tests.py index 3c1c3bd060bff..bcfa5e943b347 100644 --- a/Tools/scripts/run_tests.py +++ b/Tools/scripts/run_tests.py @@ -25,8 +25,10 @@ def main(regrtest_args): '-u', # Unbuffered stdout and stderr '-W', 'default', # Warnings set to 'default' '-bb', # Warnings about bytes/bytearray - '-E', # Ignore environment variables ] + if 'PYTHONOLDPARSER' not in os.environ: + args.append('-E') # Ignore environment variables + # Allow user-specified interpreter options to override our defaults. args.extend(test.support.args_from_interpreter_flags()) From webhook-mailer at python.org Wed Apr 22 19:06:09 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 22 Apr 2020 23:06:09 -0000 Subject: [Python-checkins] PEP 617: Only run the CI with the new parser (GH-19664) Message-ID: https://github.com/python/cpython/commit/3f8a58b7ef2a7ab4135c12232149467954ad0c33 commit: 3f8a58b7ef2a7ab4135c12232149467954ad0c33 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T00:06:03+01:00 summary: PEP 617: Only run the CI with the new parser (GH-19664) files: M .github/workflows/build.yml M .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9e9c53da23fd..50d1561518bd8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,6 @@ on: - '**/*.rst' pull_request: branches: - - pegen - master - 3.8 - 3.7 @@ -51,22 +50,6 @@ jobs: build_macos: name: 'macOS' runs-on: macos-latest - env: - PYTHONOLDPARSER: old - steps: - - uses: actions/checkout at v1 - - name: Configure CPython - run: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-dev - - name: Build CPython - run: make -j4 - - name: Display build info - run: make pythoninfo - - name: Tests - run: make buildbottest TESTOPTS="-j4 -uall,-cpu" - - build_macos_pegen: - name: 'macOS - Pegen' - runs-on: macos-latest steps: - uses: actions/checkout at v1 - name: Configure CPython @@ -81,34 +64,6 @@ jobs: build_ubuntu: name: 'Ubuntu' runs-on: ubuntu-latest - env: - OPENSSL_VER: 1.1.1f - PYTHONOLDPARSER: old - steps: - - uses: actions/checkout at v1 - - name: Install Dependencies - run: sudo ./.github/workflows/posix-deps-apt.sh - - name: 'Restore OpenSSL build' - id: cache-openssl - uses: actions/cache at v1 - with: - path: ./multissl/openssl/${{ env.OPENSSL_VER }} - key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} - - name: Install OpenSSL - if: steps.cache-openssl.outputs.cache-hit != 'true' - run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux - - name: Configure CPython - run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER - - name: Build CPython - run: make -j4 - - name: Display build info - run: make pythoninfo - - name: Tests - run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" - - build_ubuntu_pegen: - name: 'Ubuntu - Pegen' - runs-on: ubuntu-latest env: OPENSSL_VER: 1.1.1f steps: diff --git a/.travis.yml b/.travis.yml index 80d7a16318adf..3c2fb4bdc7875 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,6 @@ env: branches: only: - master - - pegen - /^\d\.\d+$/ - buildbot-custom From webhook-mailer at python.org Wed Apr 22 19:13:53 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 22 Apr 2020 23:13:53 -0000 Subject: [Python-checkins] bpo-40334: Fix errors in parse_string.c with old compilers (GH-19666) Message-ID: https://github.com/python/cpython/commit/458004bf7914f96b20bb76bc3584718cf83f652e commit: 458004bf7914f96b20bb76bc3584718cf83f652e branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T00:13:47+01:00 summary: bpo-40334: Fix errors in parse_string.c with old compilers (GH-19666) files: M Parser/pegen/parse_string.c diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c index 41485a9669d68..14364a6d54abd 100644 --- a/Parser/pegen/parse_string.c +++ b/Parser/pegen/parse_string.c @@ -275,7 +275,8 @@ static inline void shift_arg(expr_ty parent, arg_ty n, int line, int col) { } static void fstring_shift_seq_locations(expr_ty parent, asdl_seq *seq, int lineno, int col_offset) { - for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) { + Py_ssize_t i; + for (i = 0; i < asdl_seq_LEN(seq); i++) { expr_ty expr = asdl_seq_GET(seq, i); if (expr == NULL){ continue; @@ -322,12 +323,13 @@ static void fstring_shift_argument(expr_ty parent, arg_ty arg, int lineno, int c } static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int lineno, int col_offset) { - for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->posonlyargs); i < l; i++) { + Py_ssize_t i; + for (i = 0; i < asdl_seq_LEN(args->posonlyargs); i++) { arg_ty arg = asdl_seq_GET(args->posonlyargs, i); shift_arg(parent, arg, lineno, col_offset); } - for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->args); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(args->args); i++) { arg_ty arg = asdl_seq_GET(args->args, i); shift_arg(parent, arg, lineno, col_offset); } @@ -336,7 +338,7 @@ static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int linen shift_arg(parent, args->vararg, lineno, col_offset); } - for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->kwonlyargs); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(args->kwonlyargs); i++) { arg_ty arg = asdl_seq_GET(args->kwonlyargs, i); shift_arg(parent, arg, lineno, col_offset); } @@ -351,6 +353,7 @@ static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int linen } static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offset) { + Py_ssize_t i; switch (n->kind) { case BoolOp_kind: fstring_shift_seq_locations(n, n->v.BoolOp.values, lineno, col_offset); @@ -384,14 +387,14 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs break; case ListComp_kind: shift_expr(n, n->v.ListComp.elt, lineno, col_offset); - for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.ListComp.generators); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(n->v.ListComp.generators); i++) { comprehension_ty comp = asdl_seq_GET(n->v.ListComp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } break; case SetComp_kind: shift_expr(n, n->v.SetComp.elt, lineno, col_offset); - for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.SetComp.generators); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(n->v.SetComp.generators); i++) { comprehension_ty comp = asdl_seq_GET(n->v.SetComp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } @@ -399,14 +402,14 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs case DictComp_kind: shift_expr(n, n->v.DictComp.key, lineno, col_offset); shift_expr(n, n->v.DictComp.value, lineno, col_offset); - for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.DictComp.generators); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(n->v.DictComp.generators); i++) { comprehension_ty comp = asdl_seq_GET(n->v.DictComp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } break; case GeneratorExp_kind: shift_expr(n, n->v.GeneratorExp.elt, lineno, col_offset); - for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.GeneratorExp.generators); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(n->v.GeneratorExp.generators); i++) { comprehension_ty comp = asdl_seq_GET(n->v.GeneratorExp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } @@ -427,7 +430,7 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs case Call_kind: shift_expr(n, n->v.Call.func, lineno, col_offset); fstring_shift_seq_locations(n, n->v.Call.args, lineno, col_offset); - for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.Call.keywords); i < l; i++) { + for (i = 0; i < asdl_seq_LEN(n->v.Call.keywords); i++) { keyword_ty keyword = asdl_seq_GET(n->v.Call.keywords, i); shift_expr(n, keyword->value, lineno, col_offset); } @@ -518,7 +521,8 @@ fstring_fix_expr_location(Token *parent, expr_ty n, char *expr_str) } /* adjust the start based on the number of newlines encountered before the f-string expression */ - for (char* p = parent_str; p < substr; p++) { + char *p; + for (p = parent_str; p < substr; p++) { if (*p == '\n') { lines++; } From webhook-mailer at python.org Wed Apr 22 19:47:36 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 22 Apr 2020 23:47:36 -0000 Subject: [Python-checkins] Add @pablogsal as code owner for pegen-related files (GH-19665) Message-ID: https://github.com/python/cpython/commit/ce0eacb19cdc7e35b62839649003edd6196dd70f commit: ce0eacb19cdc7e35b62839649003edd6196dd70f branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T00:47:32+01:00 summary: Add @pablogsal as code owner for pegen-related files (GH-19665) files: M .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9354cc85d2883..4d80698eff39c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -74,6 +74,8 @@ Include/pytime.h @pganssle @abalkin # Parser/Pgen /Parser/pgen/ @pablogsal +/Parser/pegen/ @pablogsal +/Tools/peg_generator/ @pablogsal # SQLite 3 **/*sqlite* @berkerpeksag From webhook-mailer at python.org Wed Apr 22 20:38:16 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 23 Apr 2020 00:38:16 -0000 Subject: [Python-checkins] bpo-40334: Fix builds outside the source directory and regenerate autoconf files (GH-19667) Message-ID: https://github.com/python/cpython/commit/a25f3c4c8f7d4878918ce1d3d67db40ae255ccc6 commit: a25f3c4c8f7d4878918ce1d3d67db40ae255ccc6 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T01:38:11+01:00 summary: bpo-40334: Fix builds outside the source directory and regenerate autoconf files (GH-19667) files: M Makefile.pre.in M aclocal.m4 M configure M configure.ac diff --git a/Makefile.pre.in b/Makefile.pre.in index b34fa64ff4bdf..29d7e34468251 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -822,6 +822,7 @@ regen-grammar: regen-token .PHONY: regen-pegen regen-pegen: + @$(MKDIR_P) -p $(srcdir)/Parser/pegen PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -c -q $(srcdir)/Grammar/python.gram \ -o $(srcdir)/Parser/pegen/parse.new.c $(UPDATE_FILE) $(srcdir)/Parser/pegen/parse.c $(srcdir)/Parser/pegen/parse.new.c diff --git a/aclocal.m4 b/aclocal.m4 index f98db73656d30..b5f9cb0e8da44 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- -# Copyright (C) 1996-2014 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -12,9 +12,9 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29.1) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 11 (pkg-config-0.29.1) + dnl Copyright ? 2004 Scott James Remnant . dnl Copyright ? 2012-2015 Dan Nicholson dnl @@ -288,5 +288,73 @@ AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + m4_include([m4/ax_c_float_words_bigendian.m4]) m4_include([m4/ax_check_openssl.m4]) diff --git a/configure b/configure index d3e8149bec08b..29d5f4ce66735 100755 --- a/configure +++ b/configure @@ -16746,7 +16746,7 @@ do done -SRCDIRS="Parser Objects Python Modules Modules/_io Programs" +SRCDIRS="Parser Parser/pegen Objects Python Modules Modules/_io Programs" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for build directories" >&5 $as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do diff --git a/configure.ac b/configure.ac index 6bc8499f7ffe6..240ddeb9b3d22 100644 --- a/configure.ac +++ b/configure.ac @@ -5397,7 +5397,7 @@ do done AC_SUBST(SRCDIRS) -SRCDIRS="Parser Objects Python Modules Modules/_io Programs" +SRCDIRS="Parser Parser/pegen Objects Python Modules Modules/_io Programs" AC_MSG_CHECKING(for build directories) for dir in $SRCDIRS; do if test ! -d $dir; then From webhook-mailer at python.org Wed Apr 22 21:03:28 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 23 Apr 2020 01:03:28 -0000 Subject: [Python-checkins] bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670) Message-ID: https://github.com/python/cpython/commit/1def7754b7a41fe57efafaf5eff24cfa15353444 commit: 1def7754b7a41fe57efafaf5eff24cfa15353444 branch: master author: Victor Stinner committer: GitHub date: 2020-04-23T03:03:24+02:00 summary: bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670) * Rename PyConfig.use_peg to _use_peg_parser * Document PyConfig._use_peg_parser and mark it a deprecated * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated in the documentation. * Add use_old_parser() and skip_if_new_parser() to test.support * Remove sys.flags.use_peg: use_old_parser() uses _testinternalcapi.get_configs() instead. * Enhance test_embed tests * subprocess._args_from_interpreter_flags() copies -X oldparser files: M Doc/c-api/init_config.rst M Doc/using/cmdline.rst M Include/cpython/initconfig.h M Lib/subprocess.py M Lib/test/support/__init__.py M Lib/test/test_codeop.py M Lib/test/test_compile.py M Lib/test/test_embed.py M Lib/test/test_eof.py M Lib/test/test_exceptions.py M Lib/test/test_flufl.py M Lib/test/test_fstring.py M Lib/test/test_parser.py M Lib/test/test_peg_parser.py M Lib/test/test_positional_only_arg.py M Lib/test/test_string_literals.py M Lib/test/test_syntax.py M Lib/test/test_sys.py M Lib/test/test_traceback.py M Lib/test/test_type_comments.py M Lib/test/test_unparse.py M Programs/_testembed.c M Python/bltinmodule.c M Python/initconfig.c M Python/pythonrun.c M Python/sysmodule.c diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index a226814de805c..49507c8bad3ed 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -686,6 +686,16 @@ PyConfig :data:`sys._xoptions`. + .. c:member:: int _use_peg_parser + + Enable PEG parser? Default: 1. + + Set to 0 by :option:`-X oldparser <-X>` and :envvar:`PYTHONOLDPARSER`. + + See also :pep:`617`. + + .. deprecated-removed:: 3.9 3.10 + If ``parse_argv`` is non-zero, ``argv`` arguments are parsed the same way the regular Python parses command line arguments, and Python arguments are stripped from ``argv``: see :ref:`Command Line Arguments diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index a815436b3a8ee..b0911956a9eb8 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -427,7 +427,7 @@ Miscellaneous options * ``-X faulthandler`` to enable :mod:`faulthandler`; * ``-X oldparser``: enable the traditional LL(1) parser. See also - :envvar:`PYTHONOLDPARSER`. + :envvar:`PYTHONOLDPARSER` and :pep:`617`. * ``-X showrefcount`` to output the total reference count and number of used memory blocks when the program finishes or after each statement in the interactive interpreter. This only works on debug builds. @@ -480,6 +480,9 @@ Miscellaneous options The ``-X showalloccount`` option has been removed. + .. deprecated-removed:: 3.9 3.10 + The ``-X oldparser`` option. + Options you shouldn't use ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -578,8 +581,11 @@ conflict. .. envvar:: PYTHONOLDPARSER - If this is set it is equivalent to specifying the :option:`-X` - ``oldparser`` option. + If this is set to a non-empty string, enable the traditional LL(1) parser. + + See also the :option:`-X` ``oldparser`` option and :pep:`617`. + + .. deprecated-removed:: 3.9 3.10 .. envvar:: PYTHONINSPECT diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h index 653959656f216..8326c235702bd 100644 --- a/Include/cpython/initconfig.h +++ b/Include/cpython/initconfig.h @@ -149,7 +149,7 @@ typedef struct { /* Enable PEG parser? 1 by default, set to 0 by -X oldparser and PYTHONOLDPARSER */ - int use_peg; + int _use_peg_parser; /* Enable tracemalloc? Set by -X tracemalloc=N and PYTHONTRACEMALLOC. -1 means unset */ diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 86fdf27f9b03b..13600c28cf711 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -326,7 +326,7 @@ def _args_from_interpreter_flags(): if dev_mode: args.extend(('-X', 'dev')) for opt in ('faulthandler', 'tracemalloc', 'importtime', - 'showrefcount', 'utf8'): + 'showrefcount', 'utf8', 'oldparser'): if opt in xoptions: value = xoptions[opt] if value is True: diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 9f43b4071c044..4fe247aeb9d37 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3454,3 +3454,13 @@ def wait_process(pid, *, exitcode, timeout=None): # sanity check: it should not fail in practice if pid2 != pid: raise AssertionError(f"pid {pid2} != pid {pid}") + + +def use_old_parser(): + import _testinternalcapi + config = _testinternalcapi.get_configs() + return (config['config']['_use_peg_parser'] == 0) + + +def skip_if_new_parser(msg): + return unittest.skipIf(not use_old_parser(), msg) diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index f1d74b1fb763e..8c3e447200d40 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -4,12 +4,12 @@ """ import sys import unittest -from test.support import is_jython +from test import support from codeop import compile_command, PyCF_DONT_IMPLY_DEDENT import io -if is_jython: +if support.is_jython: def unify_callables(d): for n,v in d.items(): @@ -21,7 +21,7 @@ class CodeopTests(unittest.TestCase): def assertValid(self, str, symbol='single'): '''succeed iff str is a valid piece of code''' - if is_jython: + if support.is_jython: code = compile_command(str, "", symbol) self.assertTrue(code) if symbol == "single": @@ -60,7 +60,7 @@ def test_valid(self): av = self.assertValid # special case - if not is_jython: + if not support.is_jython: self.assertEqual(compile_command(""), compile("pass", "", 'single', PyCF_DONT_IMPLY_DEDENT)) @@ -122,7 +122,7 @@ def test_valid(self): av("def f():\n pass\n#foo\n") av("@a.b.c\ndef f():\n pass\n") - @unittest.skipIf(sys.flags.use_peg, "Pegen does not support PyCF_DONT_INPLY_DEDENT yet") + @support.skip_if_new_parser("Pegen does not support PyCF_DONT_INPLY_DEDENT yet") def test_incomplete(self): ai = self.assertIncomplete diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 6535316dbea24..a507ac0914918 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -501,7 +501,7 @@ def test_single_statement(self): self.compile_single("if x:\n f(x)\nelse:\n g(x)") self.compile_single("class T:\n pass") - @unittest.skipIf(sys.flags.use_peg, 'Pegen does not disallow multiline single stmts') + @support.skip_if_new_parser('Pegen does not disallow multiline single stmts') def test_bad_single_statement(self): self.assertInvalidSingle('1\n2') self.assertInvalidSingle('def f(): pass') diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 24ebc5ca9ba25..0bdfae1b7e387 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -347,7 +347,7 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'isolated': 0, 'use_environment': 1, 'dev_mode': 0, - 'use_peg': 1, + '_use_peg_parser': 1, 'install_signal_handlers': 1, 'use_hash_seed': 0, @@ -729,7 +729,7 @@ def test_init_from_config(self): 'import_time': 1, 'show_ref_count': 1, 'malloc_stats': 1, - 'use_peg': 0, + '_use_peg_parser': 0, 'stdio_encoding': 'iso8859-1', 'stdio_errors': 'replace', @@ -792,6 +792,7 @@ def test_init_compat_env(self): 'user_site_directory': 0, 'faulthandler': 1, 'warnoptions': ['EnvVar'], + '_use_peg_parser': 0, } self.check_all_configs("test_init_compat_env", config, preconfig, api=API_COMPAT) @@ -819,6 +820,7 @@ def test_init_python_env(self): 'user_site_directory': 0, 'faulthandler': 1, 'warnoptions': ['EnvVar'], + '_use_peg_parser': 0, } self.check_all_configs("test_init_python_env", config, preconfig, api=API_PYTHON) diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index bb1300c7c24d4..f8065788cec1d 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -26,7 +26,7 @@ def test_EOFS(self): else: raise support.TestFailed - @unittest.skipIf(sys.flags.use_peg, "TODO for PEG -- fails with new parser") + @support.skip_if_new_parser("TODO for PEG -- fails with new parser") def test_line_continuation_EOF(self): """A continuation at the end of input must be an error; bpo2180.""" expect = 'unexpected EOF while parsing (, line 1)' diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index c234c2b739c5e..a207fb48632f9 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -178,7 +178,7 @@ def ckmsg(src, msg, exception=SyntaxError): s = '''if True:\n print()\n\texec "mixed tabs and spaces"''' ckmsg(s, "inconsistent use of tabs and spaces in indentation", TabError) - @unittest.skipIf(sys.flags.use_peg, "Pegen column offsets might be different") + @support.skip_if_new_parser("Pegen column offsets might be different") def testSyntaxErrorOffset(self): def check(src, lineno, offset, encoding='utf-8'): with self.assertRaises(SyntaxError) as cm: diff --git a/Lib/test/test_flufl.py b/Lib/test/test_flufl.py index 297a8aa90c96c..35ab934ab373d 100644 --- a/Lib/test/test_flufl.py +++ b/Lib/test/test_flufl.py @@ -1,9 +1,10 @@ import __future__ import unittest import sys +from test import support - at unittest.skipIf(sys.flags.use_peg, "Not supported by pegen yet") + at support.skip_if_new_parser("Not supported by pegen yet") class FLUFLTests(unittest.TestCase): def test_barry_as_bdfl(self): diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 802b08341e2b5..8cafbe863c288 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -12,6 +12,7 @@ import decimal import sys import unittest +from test import support a_global = 'global variable' @@ -206,7 +207,7 @@ def test_ast_line_numbers_nested(self): call = binop.right.values[1].value self.assertEqual(type(call), ast.Call) self.assertEqual(call.lineno, 3) - if not sys.flags.use_peg: + if support.use_old_parser(): self.assertEqual(call.col_offset, 11) def test_ast_line_numbers_duplicate_expression(self): diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 124a2790bf2bd..0ee994f3b7505 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -900,7 +900,7 @@ def test_deeply_nested_list(self): st = parser.expr(e) st.compile() - @unittest.skipIf(sys.flags.use_peg, "Pegen does not trigger memory error with this many parenthesis") + @support.skip_if_new_parser("Pegen does not trigger memory error with this many parenthesis") def test_trigger_memory_error(self): e = self._nested_expression(100) rc, out, err = assert_python_failure('-Xoldparser', '-c', e) diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py index 5aa6c0d8f4814..ea4afa6e17973 100644 --- a/Lib/test/test_peg_parser.py +++ b/Lib/test/test_peg_parser.py @@ -6,6 +6,7 @@ from pathlib import PurePath from typing import Any, Union, Iterable, Tuple from textwrap import dedent +from test import support TEST_CASES = [ @@ -720,7 +721,7 @@ def test_incorrect_ast_generation_with_specialized_errors(self) -> None: f"Actual error message does not match expexted for {source}" ) - @unittest.skipIf(sys.flags.use_peg, "This tests nothing for now, since compile uses pegen as well") + @support.skip_if_new_parser("This tests nothing for now, since compile uses pegen as well") @unittest.expectedFailure def test_correct_but_known_to_fail_ast_generation_on_source_files(self) -> None: for source in GOOD_BUT_FAIL_SOURCES: diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py index 332690051ed4d..4d5fb6bc6112c 100644 --- a/Lib/test/test_positional_only_arg.py +++ b/Lib/test/test_positional_only_arg.py @@ -5,7 +5,7 @@ import unittest import sys -from test.support import check_syntax_error +from test.support import check_syntax_error, use_old_parser def global_pos_only_f(a, b, /): @@ -24,7 +24,7 @@ def assertRaisesSyntaxError(self, codestr, regex="invalid syntax"): compile(codestr + "\n", "", "single") def test_invalid_syntax_errors(self): - if not sys.flags.use_peg: + if use_old_parser(): check_syntax_error(self, "def f(a, b = 5, /, c): pass", "non-default argument follows default argument") check_syntax_error(self, "def f(a = 5, b, /, c): pass", "non-default argument follows default argument") check_syntax_error(self, "def f(a = 5, b=1, /, c, *, d=2): pass", "non-default argument follows default argument") @@ -47,7 +47,7 @@ def test_invalid_syntax_errors(self): check_syntax_error(self, "def f(a, *, c, /, d, e): pass") def test_invalid_syntax_errors_async(self): - if not sys.flags.use_peg: + if use_old_parser(): check_syntax_error(self, "async def f(a, b = 5, /, c): pass", "non-default argument follows default argument") check_syntax_error(self, "async def f(a = 5, b, /, c): pass", "non-default argument follows default argument") check_syntax_error(self, "async def f(a = 5, b=1, /, c, d=2): pass", "non-default argument follows default argument") @@ -236,7 +236,7 @@ def test_lambdas(self): self.assertEqual(x(1, 2), 3) def test_invalid_syntax_lambda(self): - if not sys.flags.use_peg: + if use_old_parser(): check_syntax_error(self, "lambda a, b = 5, /, c: None", "non-default argument follows default argument") check_syntax_error(self, "lambda a = 5, b, /, c: None", "non-default argument follows default argument") check_syntax_error(self, "lambda a = 5, b, /: None", "non-default argument follows default argument") diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py index 382c532df5e1e..5a2fb8b372f8c 100644 --- a/Lib/test/test_string_literals.py +++ b/Lib/test/test_string_literals.py @@ -33,6 +33,7 @@ import tempfile import unittest import warnings +from test.support import check_syntax_warning, use_old_parser TEMPLATE = r"""# coding: %s @@ -63,8 +64,6 @@ def byte(i): class TestLiterals(unittest.TestCase): - from test.support import check_syntax_warning - def setUp(self): self.save_path = sys.path[:] self.tmpdir = tempfile.mkdtemp() @@ -119,7 +118,7 @@ def test_eval_str_invalid_escape(self): eval("'''\n\\z'''") self.assertEqual(len(w), 1) self.assertEqual(w[0].filename, '') - if not sys.flags.use_peg: + if use_old_parser(): self.assertEqual(w[0].lineno, 1) with warnings.catch_warnings(record=True) as w: @@ -129,7 +128,7 @@ def test_eval_str_invalid_escape(self): exc = cm.exception self.assertEqual(w, []) self.assertEqual(exc.filename, '') - if not sys.flags.use_peg: + if use_old_parser(): self.assertEqual(exc.lineno, 1) def test_eval_str_raw(self): @@ -170,7 +169,7 @@ def test_eval_bytes_invalid_escape(self): eval("b'''\n\\z'''") self.assertEqual(len(w), 1) self.assertEqual(w[0].filename, '') - if not sys.flags.use_peg: + if use_old_parser(): self.assertEqual(w[0].lineno, 1) with warnings.catch_warnings(record=True) as w: @@ -180,7 +179,7 @@ def test_eval_bytes_invalid_escape(self): exc = cm.exception self.assertEqual(w, []) self.assertEqual(exc.filename, '') - if not sys.flags.use_peg: + if use_old_parser(): self.assertEqual(exc.lineno, 1) def test_eval_bytes_raw(self): diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 4798f22b2bb82..aff8dd72b78d4 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -678,8 +678,8 @@ def _check_error(self, code, errtext, def test_assign_call(self): self._check_error("f() = 1", "assign") - @unittest.skipIf(sys.flags.use_peg, "Pegen does not produce a specialized error " - "message yet") + @support.skip_if_new_parser("Pegen does not produce a specialized error " + "message yet") def test_assign_del(self): self._check_error("del f()", "delete") diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index bd4ea4794426c..91a645b460ec0 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -545,7 +545,7 @@ def __hash__(self): def test_sys_flags(self): self.assertTrue(sys.flags) attrs = ("debug", - "inspect", "interactive", "optimize", "use_peg", + "inspect", "interactive", "optimize", "dont_write_bytecode", "no_user_site", "no_site", "ignore_environment", "verbose", "bytes_warning", "quiet", "hash_randomization", "isolated", "dev_mode", "utf8_mode") diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 45f55e1f8ab6c..7361d091cfbbe 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -656,8 +656,7 @@ def outer_raise(): self.assertIn('inner_raise() # Marker', blocks[2]) self.check_zero_div(blocks[2]) - @unittest.skipIf(sys.flags.use_peg, - "Pegen is arguably better here, so no need to fix this") + @support.skip_if_new_parser("Pegen is arguably better here, so no need to fix this") def test_syntax_error_offset_at_eol(self): # See #10186. def e(): diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index 80506e4b12d03..ce3b7985e62b2 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -1,6 +1,7 @@ import ast import sys import unittest +from test import support funcdef = """\ @@ -218,7 +219,7 @@ def favk( """ - at unittest.skipIf(sys.flags.use_peg, "Pegen does not support type comments yet") + at support.skip_if_new_parser("Pegen does not support type comments yet") class TypeCommentTests(unittest.TestCase): lowest = 4 # Lowest minor version supported diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index f5441ed54eebf..3bacd672d4462 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -328,7 +328,7 @@ def test_constant_tuples(self): ast.Constant(value=(1, 2, 3), kind=None), "(1, 2, 3)" ) - @unittest.skipIf(sys.flags.use_peg, "Pegen does not support type annotation yet") + @test.support.skip_if_new_parser("Pegen does not support type annotation yet") def test_function_type(self): for function_type in ( "() -> int", diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 8165aa74df1a0..2cf0d71b470bf 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -485,8 +485,8 @@ static int test_init_from_config(void) config.install_signal_handlers = 0; - putenv("PYTHONOLDPARSER="); - config.use_peg = 0; + putenv("PYTHONOLDPARSER=1"); + config._use_peg_parser = 0; /* FIXME: test use_environment */ @@ -665,6 +665,7 @@ static void set_most_env_vars(void) putenv("PYTHONNOUSERSITE=1"); putenv("PYTHONFAULTHANDLER=1"); putenv("PYTHONIOENCODING=iso8859-1:replace"); + putenv("PYTHONOLDPARSER=1"); } diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 18883353575f3..ce3561e4c0898 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -816,12 +816,12 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, if (str == NULL) goto error; - int current_use_peg = PyInterpreterState_Get()->config.use_peg; + int current_use_peg = PyInterpreterState_Get()->config._use_peg_parser; if (flags & PyCF_TYPE_COMMENTS || feature_version >= 0) { - PyInterpreterState_Get()->config.use_peg = 0; + PyInterpreterState_Get()->config._use_peg_parser = 0; } result = Py_CompileStringObject(str, filename, start[compile_mode], &cf, optimize); - PyInterpreterState_Get()->config.use_peg = current_use_peg; + PyInterpreterState_Get()->config._use_peg_parser = current_use_peg; Py_XDECREF(source_copy); goto finally; diff --git a/Python/initconfig.c b/Python/initconfig.c index 7662d6192686d..58cca562f336d 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -635,7 +635,7 @@ _PyConfig_InitCompatConfig(PyConfig *config) #ifdef MS_WINDOWS config->legacy_windows_stdio = -1; #endif - config->use_peg = 1; + config->_use_peg_parser = 1; } @@ -793,7 +793,7 @@ _PyConfig_Copy(PyConfig *config, const PyConfig *config2) COPY_ATTR(isolated); COPY_ATTR(use_environment); COPY_ATTR(dev_mode); - COPY_ATTR(use_peg); + COPY_ATTR(_use_peg_parser); COPY_ATTR(install_signal_handlers); COPY_ATTR(use_hash_seed); COPY_ATTR(hash_seed); @@ -897,7 +897,7 @@ config_as_dict(const PyConfig *config) SET_ITEM_INT(isolated); SET_ITEM_INT(use_environment); SET_ITEM_INT(dev_mode); - SET_ITEM_INT(use_peg); + SET_ITEM_INT(_use_peg_parser); SET_ITEM_INT(install_signal_handlers); SET_ITEM_INT(use_hash_seed); SET_ITEM_UINT(hash_seed); @@ -1434,7 +1434,7 @@ config_read_complex_options(PyConfig *config) if (config_get_env(config, "PYTHONOLDPARSER") || config_get_xoption(config, L"oldparser")) { - config->use_peg = 0; + config->_use_peg_parser = 0; } PyStatus status; @@ -2516,7 +2516,7 @@ PyConfig_Read(PyConfig *config) assert(config->isolated >= 0); assert(config->use_environment >= 0); assert(config->dev_mode >= 0); - assert(config->use_peg >= 0); + assert(config->_use_peg_parser >= 0); assert(config->install_signal_handlers >= 0); assert(config->use_hash_seed >= 0); assert(config->faulthandler >= 0); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 6199f0c66104a..e3fd3b24271ef 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -185,7 +185,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, PyArena *arena; const char *ps1 = "", *ps2 = "", *enc = NULL; int errcode = 0; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; _Py_IDENTIFIER(encoding); _Py_IDENTIFIER(__main__); @@ -1030,7 +1030,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, mod_ty mod; PyArena *arena; PyObject *filename; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; filename = _PyUnicode_FromId(&PyId_string); /* borrowed */ if (filename == NULL) @@ -1061,7 +1061,7 @@ PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globa mod_ty mod; PyArena *arena = NULL; PyObject *filename; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; filename = PyUnicode_DecodeFSDefault(filename_str); if (filename == NULL) @@ -1222,7 +1222,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, { PyCodeObject *co; mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; PyArena *arena = PyArena_New(); if (arena == NULL) return NULL; @@ -1329,7 +1329,7 @@ _Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, Py { struct symtable *st; mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; PyArena *arena; arena = PyArena_New(); diff --git a/Python/sysmodule.c b/Python/sysmodule.c index cf3ddff44d19e..92ea5e7d637b9 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -2427,7 +2427,6 @@ static PyStructSequence_Field flags_fields[] = { {"inspect", "-i"}, {"interactive", "-i"}, {"optimize", "-O or -OO"}, - {"use_peg", "-p old or -p new"}, {"dont_write_bytecode", "-B"}, {"no_user_site", "-s"}, {"no_site", "-S"}, @@ -2448,7 +2447,7 @@ static PyStructSequence_Desc flags_desc = { "sys.flags", /* name */ flags__doc__, /* doc */ flags_fields, /* fields */ - 16 + 15 }; static PyObject* @@ -2471,7 +2470,6 @@ make_flags(PyThreadState *tstate) SetFlag(config->inspect); SetFlag(config->interactive); SetFlag(config->optimization_level); - SetFlag(config->use_peg); SetFlag(!config->write_bytecode); SetFlag(!config->user_site_directory); SetFlag(!config->site_import); From webhook-mailer at python.org Wed Apr 22 22:24:30 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 23 Apr 2020 02:24:30 -0000 Subject: [Python-checkins] Compile extensions in test_peg_generator with C99 (GH-19668) Message-ID: https://github.com/python/cpython/commit/0b7829e089f9f93e1387f240ae03d42ac7cd77c7 commit: 0b7829e089f9f93e1387f240ae03d42ac7cd77c7 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T03:24:25+01:00 summary: Compile extensions in test_peg_generator with C99 (GH-19668) files: M Parser/pegen/parse_string.c M Tools/peg_generator/pegen/build.py diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c index 14364a6d54abd..41485a9669d68 100644 --- a/Parser/pegen/parse_string.c +++ b/Parser/pegen/parse_string.c @@ -275,8 +275,7 @@ static inline void shift_arg(expr_ty parent, arg_ty n, int line, int col) { } static void fstring_shift_seq_locations(expr_ty parent, asdl_seq *seq, int lineno, int col_offset) { - Py_ssize_t i; - for (i = 0; i < asdl_seq_LEN(seq); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(seq); i < l; i++) { expr_ty expr = asdl_seq_GET(seq, i); if (expr == NULL){ continue; @@ -323,13 +322,12 @@ static void fstring_shift_argument(expr_ty parent, arg_ty arg, int lineno, int c } static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int lineno, int col_offset) { - Py_ssize_t i; - for (i = 0; i < asdl_seq_LEN(args->posonlyargs); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->posonlyargs); i < l; i++) { arg_ty arg = asdl_seq_GET(args->posonlyargs, i); shift_arg(parent, arg, lineno, col_offset); } - for (i = 0; i < asdl_seq_LEN(args->args); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->args); i < l; i++) { arg_ty arg = asdl_seq_GET(args->args, i); shift_arg(parent, arg, lineno, col_offset); } @@ -338,7 +336,7 @@ static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int linen shift_arg(parent, args->vararg, lineno, col_offset); } - for (i = 0; i < asdl_seq_LEN(args->kwonlyargs); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(args->kwonlyargs); i < l; i++) { arg_ty arg = asdl_seq_GET(args->kwonlyargs, i); shift_arg(parent, arg, lineno, col_offset); } @@ -353,7 +351,6 @@ static void fstring_shift_arguments(expr_ty parent, arguments_ty args, int linen } static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offset) { - Py_ssize_t i; switch (n->kind) { case BoolOp_kind: fstring_shift_seq_locations(n, n->v.BoolOp.values, lineno, col_offset); @@ -387,14 +384,14 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs break; case ListComp_kind: shift_expr(n, n->v.ListComp.elt, lineno, col_offset); - for (i = 0; i < asdl_seq_LEN(n->v.ListComp.generators); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.ListComp.generators); i < l; i++) { comprehension_ty comp = asdl_seq_GET(n->v.ListComp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } break; case SetComp_kind: shift_expr(n, n->v.SetComp.elt, lineno, col_offset); - for (i = 0; i < asdl_seq_LEN(n->v.SetComp.generators); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.SetComp.generators); i < l; i++) { comprehension_ty comp = asdl_seq_GET(n->v.SetComp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } @@ -402,14 +399,14 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs case DictComp_kind: shift_expr(n, n->v.DictComp.key, lineno, col_offset); shift_expr(n, n->v.DictComp.value, lineno, col_offset); - for (i = 0; i < asdl_seq_LEN(n->v.DictComp.generators); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.DictComp.generators); i < l; i++) { comprehension_ty comp = asdl_seq_GET(n->v.DictComp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } break; case GeneratorExp_kind: shift_expr(n, n->v.GeneratorExp.elt, lineno, col_offset); - for (i = 0; i < asdl_seq_LEN(n->v.GeneratorExp.generators); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.GeneratorExp.generators); i < l; i++) { comprehension_ty comp = asdl_seq_GET(n->v.GeneratorExp.generators, i); fstring_shift_comprehension(n, comp, lineno, col_offset); } @@ -430,7 +427,7 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs case Call_kind: shift_expr(n, n->v.Call.func, lineno, col_offset); fstring_shift_seq_locations(n, n->v.Call.args, lineno, col_offset); - for (i = 0; i < asdl_seq_LEN(n->v.Call.keywords); i++) { + for (Py_ssize_t i = 0, l = asdl_seq_LEN(n->v.Call.keywords); i < l; i++) { keyword_ty keyword = asdl_seq_GET(n->v.Call.keywords, i); shift_expr(n, keyword->value, lineno, col_offset); } @@ -521,8 +518,7 @@ fstring_fix_expr_location(Token *parent, expr_ty n, char *expr_str) } /* adjust the start based on the number of newlines encountered before the f-string expression */ - char *p; - for (p = parent_str; p < substr; p++) { + for (char* p = parent_str; p < substr; p++) { if (*p == '\n') { lines++; } diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index 623b4aeb66069..c66dc7ed4b13e 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -1,6 +1,7 @@ import pathlib import shutil import tokenize +import sys from typing import Optional, Tuple @@ -42,6 +43,8 @@ def compile_c_extension( source_file_path = pathlib.Path(generated_source_path) extension_name = source_file_path.stem extra_compile_args = [] + if not sys.platform.startswith('win'): + extra_compile_args.append("-std=c99") if keep_asserts: extra_compile_args.append("-UNDEBUG") extension = [ From webhook-mailer at python.org Wed Apr 22 22:43:12 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 23 Apr 2020 02:43:12 -0000 Subject: [Python-checkins] bpo-40334: Don't downcast from Py_ssize_t to int (GH-19671) Message-ID: https://github.com/python/cpython/commit/ee40e4b8563e6e1bc2bfb267da5ffc9a2293318d commit: ee40e4b8563e6e1bc2bfb267da5ffc9a2293318d branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T03:43:08+01:00 summary: bpo-40334: Don't downcast from Py_ssize_t to int (GH-19671) files: M Parser/pegen/pegen.c M Python/compile.c diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 47b712f262c46..44198ab67b8ee 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -247,7 +247,7 @@ tokenizer_error_with_col_offset(Parser *p, PyObject *errtype, const char *errmsg { PyObject *errstr = NULL; PyObject *value = NULL; - int col_number = -1; + size_t col_number = -1; errstr = PyUnicode_FromString(errmsg); if (!errstr) { @@ -552,8 +552,8 @@ _PyPegen_fill_token(Parser *p) int lineno = type == STRING ? p->tok->first_lineno : p->tok->lineno; const char *line_start = type == STRING ? p->tok->multi_line_start : p->tok->line_start; - int end_lineno = p->tok->lineno; - int col_offset = -1, end_col_offset = -1; + size_t end_lineno = p->tok->lineno; + size_t col_offset = -1, end_col_offset = -1; if (start != NULL && start >= line_start) { col_offset = start - line_start; } @@ -1066,16 +1066,16 @@ _PyPegen_seq_insert_in_front(Parser *p, void *a, asdl_seq *seq) } asdl_seq_SET(new_seq, 0, a); - for (int i = 1, l = asdl_seq_LEN(new_seq); i < l; i++) { + for (Py_ssize_t i = 1, l = asdl_seq_LEN(new_seq); i < l; i++) { asdl_seq_SET(new_seq, i, asdl_seq_GET(seq, i - 1)); } return new_seq; } -static int +static Py_ssize_t _get_flattened_seq_size(asdl_seq *seqs) { - int size = 0; + Py_ssize_t size = 0; for (Py_ssize_t i = 0, l = asdl_seq_LEN(seqs); i < l; i++) { asdl_seq *inner_seq = asdl_seq_GET(seqs, i); size += asdl_seq_LEN(inner_seq); @@ -1087,7 +1087,7 @@ _get_flattened_seq_size(asdl_seq *seqs) asdl_seq * _PyPegen_seq_flatten(Parser *p, asdl_seq *seqs) { - int flattened_seq_size = _get_flattened_seq_size(seqs); + Py_ssize_t flattened_seq_size = _get_flattened_seq_size(seqs); assert(flattened_seq_size > 0); asdl_seq *flattened_seq = _Py_asdl_seq_new(flattened_seq_size, p->arena); @@ -1098,7 +1098,7 @@ _PyPegen_seq_flatten(Parser *p, asdl_seq *seqs) int flattened_seq_idx = 0; for (Py_ssize_t i = 0, l = asdl_seq_LEN(seqs); i < l; i++) { asdl_seq *inner_seq = asdl_seq_GET(seqs, i); - for (int j = 0, li = asdl_seq_LEN(inner_seq); j < li; j++) { + for (Py_ssize_t j = 0, li = asdl_seq_LEN(inner_seq); j < li; j++) { asdl_seq_SET(flattened_seq, flattened_seq_idx++, asdl_seq_GET(inner_seq, j)); } } @@ -1203,7 +1203,7 @@ _PyPegen_alias_for_star(Parser *p) asdl_seq * _PyPegen_map_names_to_ids(Parser *p, asdl_seq *seq) { - int len = asdl_seq_LEN(seq); + Py_ssize_t len = asdl_seq_LEN(seq); assert(len > 0); asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); @@ -1234,7 +1234,7 @@ _PyPegen_cmpop_expr_pair(Parser *p, cmpop_ty cmpop, expr_ty expr) asdl_int_seq * _PyPegen_get_cmpops(Parser *p, asdl_seq *seq) { - int len = asdl_seq_LEN(seq); + Py_ssize_t len = asdl_seq_LEN(seq); assert(len > 0); asdl_int_seq *new_seq = _Py_asdl_int_seq_new(len, p->arena); @@ -1251,7 +1251,7 @@ _PyPegen_get_cmpops(Parser *p, asdl_seq *seq) asdl_seq * _PyPegen_get_exprs(Parser *p, asdl_seq *seq) { - int len = asdl_seq_LEN(seq); + Py_ssize_t len = asdl_seq_LEN(seq); assert(len > 0); asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); @@ -1269,7 +1269,7 @@ _PyPegen_get_exprs(Parser *p, asdl_seq *seq) static asdl_seq * _set_seq_context(Parser *p, asdl_seq *seq, expr_context_ty ctx) { - int len = asdl_seq_LEN(seq); + Py_ssize_t len = asdl_seq_LEN(seq); if (len == 0) { return NULL; } @@ -1370,7 +1370,7 @@ _PyPegen_key_value_pair(Parser *p, expr_ty key, expr_ty value) asdl_seq * _PyPegen_get_keys(Parser *p, asdl_seq *seq) { - int len = asdl_seq_LEN(seq); + Py_ssize_t len = asdl_seq_LEN(seq); asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); if (!new_seq) { return NULL; @@ -1386,7 +1386,7 @@ _PyPegen_get_keys(Parser *p, asdl_seq *seq) asdl_seq * _PyPegen_get_values(Parser *p, asdl_seq *seq) { - int len = asdl_seq_LEN(seq); + Py_ssize_t len = asdl_seq_LEN(seq); asdl_seq *new_seq = _Py_asdl_seq_new(len, p->arena); if (!new_seq) { return NULL; @@ -1441,8 +1441,8 @@ _PyPegen_star_etc(Parser *p, arg_ty vararg, asdl_seq *kwonlyargs, arg_ty kwarg) asdl_seq * _PyPegen_join_sequences(Parser *p, asdl_seq *a, asdl_seq *b) { - int first_len = asdl_seq_LEN(a); - int second_len = asdl_seq_LEN(b); + Py_ssize_t first_len = asdl_seq_LEN(a); + Py_ssize_t second_len = asdl_seq_LEN(b); asdl_seq *new_seq = _Py_asdl_seq_new(first_len + second_len, p->arena); if (!new_seq) { return NULL; @@ -1462,7 +1462,7 @@ _PyPegen_join_sequences(Parser *p, asdl_seq *a, asdl_seq *b) static asdl_seq * _get_names(Parser *p, asdl_seq *names_with_defaults) { - int len = asdl_seq_LEN(names_with_defaults); + Py_ssize_t len = asdl_seq_LEN(names_with_defaults); asdl_seq *seq = _Py_asdl_seq_new(len, p->arena); if (!seq) { return NULL; @@ -1477,7 +1477,7 @@ _get_names(Parser *p, asdl_seq *names_with_defaults) static asdl_seq * _get_defaults(Parser *p, asdl_seq *names_with_defaults) { - int len = asdl_seq_LEN(names_with_defaults); + Py_ssize_t len = asdl_seq_LEN(names_with_defaults); asdl_seq *seq = _Py_asdl_seq_new(len, p->arena); if (!seq) { return NULL; @@ -1750,8 +1750,8 @@ _PyPegen_seq_extract_starred_exprs(Parser *p, asdl_seq *kwargs) asdl_seq * _PyPegen_seq_delete_starred_exprs(Parser *p, asdl_seq *kwargs) { - int len = asdl_seq_LEN(kwargs); - int new_len = len - _seq_number_of_starred_exprs(kwargs); + Py_ssize_t len = asdl_seq_LEN(kwargs); + Py_ssize_t new_len = len - _seq_number_of_starred_exprs(kwargs); if (new_len == 0) { return NULL; } @@ -1773,7 +1773,7 @@ _PyPegen_seq_delete_starred_exprs(Parser *p, asdl_seq *kwargs) expr_ty _PyPegen_concatenate_strings(Parser *p, asdl_seq *strings) { - int len = asdl_seq_LEN(strings); + Py_ssize_t len = asdl_seq_LEN(strings); assert(len > 0); Token *first = asdl_seq_GET(strings, 0); diff --git a/Python/compile.c b/Python/compile.c index 3c21fbabf663f..4a587c00fd402 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2177,7 +2177,7 @@ static int compiler_check_debug_args_seq(struct compiler *c, asdl_seq *args) { if (args != NULL) { - for (int i = 0, n = asdl_seq_LEN(args); i < n; i++) { + for (Py_ssize_t i = 0, n = asdl_seq_LEN(args); i < n; i++) { if (!compiler_check_debug_one_arg(c, asdl_seq_GET(args, i))) return 0; } From webhook-mailer at python.org Thu Apr 23 07:42:18 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 23 Apr 2020 11:42:18 -0000 Subject: [Python-checkins] bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672) Message-ID: https://github.com/python/cpython/commit/1df5a9e88c8df1495a2e689d71b34bf0c7d008ea commit: 1df5a9e88c8df1495a2e689d71b34bf0c7d008ea branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T12:42:13+01:00 summary: bpo-40334: Fix build errors and warnings in test_peg_generator (GH-19672) files: M Parser/pegen/pegen.c M Parser/pegen/pegen.h M Tools/peg_generator/pegen/build.py M Tools/peg_generator/pegen/c_generator.py diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 44198ab67b8ee..0b70c950d887d 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -640,6 +640,16 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres) return 0; } + +int +_PyPegen_lookahead_with_name(int positive, expr_ty (func)(Parser *), Parser *p) +{ + int mark = p->mark; + void *res = func(p); + p->mark = mark; + return (res != NULL) == positive; +} + int _PyPegen_lookahead_with_string(int positive, void *(func)(Parser *, const char *), Parser *p, const char *arg) @@ -663,7 +673,7 @@ int _PyPegen_lookahead(int positive, void *(func)(Parser *), Parser *p) { int mark = p->mark; - void *res = func(p); + void *res = (void*)func(p); p->mark = mark; return (res != NULL) == positive; } diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index 5acd9883f3fd8..a20ec4a0e4274 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -85,6 +85,7 @@ int _PyPegen_insert_memo(Parser *p, int mark, int type, void *node); int _PyPegen_update_memo(Parser *p, int mark, int type, void *node); int _PyPegen_is_memoized(Parser *p, int type, void *pres); +int _PyPegen_lookahead_with_name(int, expr_ty (func)(Parser *), Parser *); int _PyPegen_lookahead_with_string(int, void *(func)(Parser *, const char *), Parser *, const char *); int _PyPegen_lookahead_with_int(int, Token *(func)(Parser *, int), Parser *, int); int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *); diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index c66dc7ed4b13e..bd792d66074ff 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -9,6 +9,7 @@ from distutils.core import Distribution, Extension from distutils.command.clean import clean # type: ignore from distutils.command.build_ext import build_ext # type: ignore +from distutils.tests.support import fixup_build_ext from pegen.c_generator import CParserGenerator from pegen.grammar import Grammar @@ -69,6 +70,7 @@ def compile_c_extension( ] dist = Distribution({"name": extension_name, "ext_modules": extension}) cmd = build_ext(dist) + fixup_build_ext(cmd) cmd.inplace = True if build_dir: cmd.build_temp = build_dir diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index ce732a09f096b..5b9d80453ca6b 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -93,7 +93,9 @@ def lookahead_call_helper(self, node: Lookahead, positive: int) -> Tuple[None, s func, args = call.split("(", 1) assert args[-1] == ")" args = args[:-1] - if not args.startswith("p,"): + if "name_token" in call: + return None, f"_PyPegen_lookahead_with_name({positive}, {func}, {args})" + elif not args.startswith("p,"): return None, f"_PyPegen_lookahead({positive}, {func}, {args})" elif args[2:].strip().isalnum(): return None, f"_PyPegen_lookahead_with_int({positive}, {func}, {args})" From webhook-mailer at python.org Thu Apr 23 08:22:36 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Thu, 23 Apr 2020 12:22:36 -0000 Subject: [Python-checkins] bpo-40334: Suppress all output in test_peg_generator (GH-19675) Message-ID: https://github.com/python/cpython/commit/8d1cbfffea7a5dbf7a3c60b066a2c2120ef08cd0 commit: 8d1cbfffea7a5dbf7a3c60b066a2c2120ef08cd0 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-23T13:22:16+01:00 summary: bpo-40334: Suppress all output in test_peg_generator (GH-19675) files: M Lib/test/test_peg_generator/test_c_parser.py M Lib/test/test_peg_generator/test_pegen.py diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index f2f699c83df01..6682c907cda2a 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -295,7 +295,6 @@ def test_syntax_error_for_string(self) -> None: expr: NAME """ grammar = parse_string(grammar_source, GrammarParser) - print(list(Path(self.tmp_path).iterdir())) extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) for text in ("a b 42 b a", "? ? 42 ? ?"): try: diff --git a/Lib/test/test_peg_generator/test_pegen.py b/Lib/test/test_peg_generator/test_pegen.py index 581c7acd337e4..0a2a6d4ae1601 100644 --- a/Lib/test/test_peg_generator/test_pegen.py +++ b/Lib/test/test_peg_generator/test_pegen.py @@ -81,7 +81,6 @@ def test_repeat_with_separator_rules(self) -> None: """ rules = parse_string(grammar, GrammarParser).rules self.assertEqual(str(rules["start"]), "start: ','.thing+ NEWLINE") - print(repr(rules["start"])) self.assertTrue(repr(rules["start"]).startswith( "Rule('start', None, Rhs([Alt([NamedItem(None, Gather(StringLeaf(\"','\"), NameLeaf('thing'" )) @@ -511,7 +510,7 @@ def test_cut(self) -> None: expr: NUMBER """ parser_class = make_parser(grammar) - node = parse_string("(1)", parser_class, verbose=True) + node = parse_string("(1)", parser_class) self.assertEqual(node, [ TokenInfo(OP, string="(", start=(1, 0), end=(1, 1), line="(1)"), [TokenInfo(NUMBER, string="1", start=(1, 1), end=(1, 2), line="(1)")], @@ -695,8 +694,6 @@ def test_deep_nested_rule(self) -> None: printer.print_grammar_ast(rules, printer=lines.append) output = "\n".join(lines) - print() - print(output) expected_output = textwrap.dedent( """\ ???Rule From webhook-mailer at python.org Thu Apr 23 08:49:33 2020 From: webhook-mailer at python.org (Florian Bruhin) Date: Thu, 23 Apr 2020 12:49:33 -0000 Subject: [Python-checkins] gdbinit: Use proper define syntax (GH-19557) Message-ID: https://github.com/python/cpython/commit/1221135289306333d11db25ab20cbbd21ceec630 commit: 1221135289306333d11db25ab20cbbd21ceec630 branch: master author: Florian Bruhin committer: GitHub date: 2020-04-23T05:49:26-07:00 summary: gdbinit: Use proper define syntax (GH-19557) Using `def` rather than `define` results in: Ambiguous command "def pu": define, define-prefix. Automerge-Triggered-By: @csabella files: M Misc/gdbinit diff --git a/Misc/gdbinit b/Misc/gdbinit index 45e79fcf6f468..e8f62ba647642 100644 --- a/Misc/gdbinit +++ b/Misc/gdbinit @@ -160,7 +160,7 @@ document pystackv Print the entire Python call stack - verbose mode end -def pu +define pu set $uni = $arg0 set $i = 0 while (*$uni && $i++<100) From webhook-mailer at python.org Thu Apr 23 08:55:36 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 23 Apr 2020 12:55:36 -0000 Subject: [Python-checkins] gdbinit: Use proper define syntax (GH-19557) Message-ID: https://github.com/python/cpython/commit/714aa832a599a04cb37667d89cb48459661ae6da commit: 714aa832a599a04cb37667d89cb48459661ae6da branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-23T05:55:29-07:00 summary: gdbinit: Use proper define syntax (GH-19557) Using `def` rather than `define` results in: Ambiguous command "def pu": define, define-prefix. Automerge-Triggered-By: @csabella (cherry picked from commit 1221135289306333d11db25ab20cbbd21ceec630) Co-authored-by: Florian Bruhin files: M Misc/gdbinit diff --git a/Misc/gdbinit b/Misc/gdbinit index 45e79fcf6f468..e8f62ba647642 100644 --- a/Misc/gdbinit +++ b/Misc/gdbinit @@ -160,7 +160,7 @@ document pystackv Print the entire Python call stack - verbose mode end -def pu +define pu set $uni = $arg0 set $i = 0 while (*$uni && $i++<100) From webhook-mailer at python.org Thu Apr 23 09:53:35 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 23 Apr 2020 13:53:35 -0000 Subject: [Python-checkins] bpo-40370: Use the same compile and link args as the interpreter used in test_peg_generator (GH-19674) Message-ID: https://github.com/python/cpython/commit/9e6a1312c1cd04ab37cddd8f3bb9baa7e9a38bc0 commit: 9e6a1312c1cd04ab37cddd8f3bb9baa7e9a38bc0 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-23T14:46:22+01:00 summary: bpo-40370: Use the same compile and link args as the interpreter used in test_peg_generator (GH-19674) files: M Lib/test/test_peg_generator/test_c_parser.py M Tools/peg_generator/pegen/build.py diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index 6682c907cda2a..ceda6d43d1750 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -8,6 +8,7 @@ from test import test_tools from test.test_peg_generator.ast_dump import ast_dump +from test import support from pathlib import PurePath, Path from typing import Sequence @@ -23,6 +24,9 @@ class TestCParser(unittest.TestCase): def setUp(self): + cmd = support.missing_compiler_executable() + if cmd is not None: + self.skipTest('The %r command is not found' % cmd) self.tmp_path = tempfile.mkdtemp() def tearDown(self): diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index bd792d66074ff..6ead94796f745 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -2,6 +2,7 @@ import shutil import tokenize import sys +import sysconfig from typing import Optional, Tuple @@ -22,6 +23,14 @@ MOD_DIR = pathlib.Path(__file__).parent +def get_extra_flags(compiler_flags, compiler_py_flags_nodist): + flags = sysconfig.get_config_var(compiler_flags) + py_flags_nodist = sysconfig.get_config_var(compiler_py_flags_nodist) + if flags is None or py_flags_nodist is None: + return [] + return f'{flags} {py_flags_nodist}'.split() + + def compile_c_extension( generated_source_path: str, build_dir: Optional[str] = None, @@ -43,9 +52,8 @@ def compile_c_extension( source_file_path = pathlib.Path(generated_source_path) extension_name = source_file_path.stem - extra_compile_args = [] - if not sys.platform.startswith('win'): - extra_compile_args.append("-std=c99") + extra_compile_args = get_extra_flags('CFLAGS', 'PY_CFLAGS_NODIST') + extra_link_args = get_extra_flags('LDFLAGS', 'PY_LDFLAGS_NODIST') if keep_asserts: extra_compile_args.append("-UNDEBUG") extension = [ @@ -66,6 +74,7 @@ def compile_c_extension( str(MOD_DIR.parent.parent.parent / "Parser" / "pegen"), ], extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, ) ] dist = Distribution({"name": extension_name, "ext_modules": extension}) From webhook-mailer at python.org Thu Apr 23 11:36:15 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Thu, 23 Apr 2020 15:36:15 -0000 Subject: [Python-checkins] bpo-40334: Improve various PEG-Parser related stuff (GH-19669) Message-ID: https://github.com/python/cpython/commit/ebebb6429c224c713e1c63a0b05d4840f52c7415 commit: ebebb6429c224c713e1c63a0b05d4840f52c7415 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-23T16:36:06+01:00 summary: bpo-40334: Improve various PEG-Parser related stuff (GH-19669) The changes in this commit are all related to @vstinner's original review comments of the initial PEP 617 implementation PR. files: A Include/internal/pegen_interface.h D Include/pegen_interface.h M Makefile.pre.in M Modules/_peg_parser.c M PCbuild/pythoncore.vcxproj M Parser/pegen/peg_api.c M Parser/pegen/pegen.c M Python/pythonrun.c diff --git a/Include/pegen_interface.h b/Include/internal/pegen_interface.h similarity index 94% rename from Include/pegen_interface.h rename to Include/internal/pegen_interface.h index bf5b29634ac33..d8621c1a88927 100644 --- a/Include/pegen_interface.h +++ b/Include/internal/pegen_interface.h @@ -1,10 +1,13 @@ -#ifndef Py_LIMITED_API #ifndef Py_PEGENINTERFACE #define Py_PEGENINTERFACE #ifdef __cplusplus extern "C" { #endif +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + #include "Python.h" #include "Python-ast.h" @@ -29,4 +32,3 @@ PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromFileObject(FILE *, PyObject *fi } #endif #endif /* !Py_PEGENINTERFACE*/ -#endif /* !Py_LIMITED_API */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 29d7e34468251..3e4b20bb60e1f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -304,7 +304,7 @@ PEGEN_OBJS= \ PEGEN_HEADERS= \ - $(srcdir)/Include/pegen_interface.h \ + $(srcdir)/Include/internal/pegen_interface.h \ $(srcdir)/Parser/pegen/pegen.h \ $(srcdir)/Parser/pegen/parse_string.h diff --git a/Modules/_peg_parser.c b/Modules/_peg_parser.c index 0a84edcfc0082..cb5f9aa63aea3 100644 --- a/Modules/_peg_parser.c +++ b/Modules/_peg_parser.c @@ -1,5 +1,5 @@ #include -#include +#include "pegen_interface.h" PyObject * _Py_parse_file(PyObject *self, PyObject *args, PyObject *kwds) diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index d795c4d5a7d00..3484f44e961ea 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -161,6 +161,7 @@ + @@ -213,7 +214,6 @@ - diff --git a/Parser/pegen/peg_api.c b/Parser/pegen/peg_api.c index 7c6903cdd9334..c42aa680c8602 100644 --- a/Parser/pegen/peg_api.c +++ b/Parser/pegen/peg_api.c @@ -1,4 +1,4 @@ -#include +#include "pegen_interface.h" #include "../tokenizer.h" #include "pegen.h" diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 0b70c950d887d..a51c8aae8b4c5 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -8,6 +8,9 @@ static int init_normalization(Parser *p) { + if (p->normalize) { + return 1; + } PyObject *m = PyImport_ImportModuleNoBlock("unicodedata"); if (!m) { @@ -36,7 +39,7 @@ _PyPegen_new_identifier(Parser *p, char *n) if (!PyUnicode_IS_ASCII(id)) { PyObject *id2; - if (!p->normalize && !init_normalization(p)) + if (!init_normalization(p)) { Py_DECREF(id); goto error; @@ -88,6 +91,9 @@ static inline Py_ssize_t byte_offset_to_character_offset(PyObject *line, int col_offset) { const char *str = PyUnicode_AsUTF8(line); + if (!str) { + return 0; + } PyObject *text = PyUnicode_DecodeUTF8(str, col_offset, NULL); if (!text) { return 0; @@ -171,9 +177,10 @@ _PyPegen_get_expr_name(expr_ty e) } } -static void +static int raise_decode_error(Parser *p) { + assert(PyErr_Occurred()); const char *errtype = NULL; if (PyErr_ExceptionMatches(PyExc_UnicodeError)) { errtype = "unicode error"; @@ -197,6 +204,8 @@ raise_decode_error(Parser *p) Py_XDECREF(value); Py_XDECREF(tback); } + + return -1; } static void @@ -207,27 +216,33 @@ raise_tokenizer_init_error(PyObject *filename) || PyErr_ExceptionMatches(PyExc_UnicodeDecodeError))) { return; } - PyObject *type, *value, *tback, *errstr; + PyObject *errstr = NULL; + PyObject *tuple = NULL; + PyObject *type, *value, *tback; PyErr_Fetch(&type, &value, &tback); errstr = PyObject_Str(value); + if (!errstr) { + goto error; + } - Py_INCREF(Py_None); - PyObject *tmp = Py_BuildValue("(OiiN)", filename, 0, -1, Py_None); + PyObject *tmp = Py_BuildValue("(OiiO)", filename, 0, -1, Py_None); if (!tmp) { goto error; } - value = PyTuple_Pack(2, errstr, tmp); + tuple = PyTuple_Pack(2, errstr, tmp); Py_DECREF(tmp); if (!value) { goto error; } - PyErr_SetObject(PyExc_SyntaxError, value); + PyErr_SetObject(PyExc_SyntaxError, tuple); error: Py_XDECREF(type); Py_XDECREF(value); Py_XDECREF(tback); + Py_XDECREF(errstr); + Py_XDECREF(tuple); } static inline PyObject * @@ -337,9 +352,6 @@ tokenizer_error(Parser *p) errtype = PyExc_IndentationError; msg = "too many levels of indentation"; break; - case E_DECODE: - raise_decode_error(p); - return -1; case E_LINECONT: msg = "unexpected character after line continuation character"; break; @@ -513,7 +525,12 @@ _PyPegen_fill_token(Parser *p) const char *start, *end; int type = PyTokenizer_Get(p->tok, &start, &end); if (type == ERRORTOKEN) { - return tokenizer_error(p); + if (p->tok->done == E_DECODE) { + return raise_decode_error(p); + } + else { + return tokenizer_error(p); + } } if (type == ENDMARKER && p->start_rule == Py_single_input && p->parsing_started) { type = NEWLINE; /* Add an extra newline */ @@ -530,13 +547,21 @@ _PyPegen_fill_token(Parser *p) if (p->fill == p->size) { int newsize = p->size * 2; - p->tokens = PyMem_Realloc(p->tokens, newsize * sizeof(Token *)); - if (p->tokens == NULL) { - PyErr_Format(PyExc_MemoryError, "Realloc tokens failed"); + Token **new_tokens = PyMem_Realloc(p->tokens, newsize * sizeof(Token *)); + if (new_tokens == NULL) { + PyErr_NoMemory(); return -1; } + else { + p->tokens = new_tokens; + } for (int i = p->size; i < newsize; i++) { p->tokens[i] = PyMem_Malloc(sizeof(Token)); + if (p->tokens[i] == NULL) { + p->size = i; // Needed, in order to cleanup correctly after parser fails + PyErr_NoMemory(); + return -1; + } memset(p->tokens[i], '\0', sizeof(Token)); } p->size = newsize; @@ -566,8 +591,6 @@ _PyPegen_fill_token(Parser *p) t->end_lineno = p->starting_lineno + end_lineno; t->end_col_offset = p->tok->lineno == 1 ? p->starting_col_offset + end_col_offset : end_col_offset; - // if (p->fill % 100 == 0) fprintf(stderr, "Filled at %d: %s \"%s\"\n", p->fill, - // token_name(type), PyBytes_AsString(t->bytes)); p->fill += 1; return 0; } @@ -614,6 +637,7 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres) { if (p->mark == p->fill) { if (_PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; return -1; } } @@ -632,11 +656,9 @@ _PyPegen_is_memoized(Parser *p, int type, void *pres) } p->mark = m->mark; *(void **)(pres) = m->node; - // fprintf(stderr, "%d < %d: memoized!\n", p->mark, p->fill); return 1; } } - // fprintf(stderr, "%d < %d: not memoized\n", p->mark, p->fill); return 0; } @@ -683,18 +705,15 @@ _PyPegen_expect_token(Parser *p, int type) { if (p->mark == p->fill) { if (_PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; return NULL; } } Token *t = p->tokens[p->mark]; if (t->type != type) { - // fprintf(stderr, "No %s at %d\n", token_name(type), p->mark); return NULL; } p->mark += 1; - // fprintf(stderr, "Got %s at %d: %s\n", token_name(type), p->mark, - // PyBytes_AsString(t->bytes)); - return t; } @@ -888,8 +907,7 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int *errcode, PyArena { Parser *p = PyMem_Malloc(sizeof(Parser)); if (p == NULL) { - PyErr_Format(PyExc_MemoryError, "Out of memory for Parser"); - return NULL; + return (Parser *) PyErr_NoMemory(); } assert(tok != NULL); p->tok = tok; @@ -898,10 +916,14 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int *errcode, PyArena p->tokens = PyMem_Malloc(sizeof(Token *)); if (!p->tokens) { PyMem_Free(p); - PyErr_Format(PyExc_MemoryError, "Out of memory for tokens"); - return NULL; + return (Parser *) PyErr_NoMemory(); } p->tokens[0] = PyMem_Malloc(sizeof(Token)); + if (!p->tokens) { + PyMem_Free(p->tokens); + PyMem_Free(p); + return (Parser *) PyErr_NoMemory(); + } memset(p->tokens[0], '\0', sizeof(Token)); p->mark = 0; p->fill = 0; @@ -1187,7 +1209,7 @@ _PyPegen_seq_count_dots(asdl_seq *seq) number_of_dots += 1; break; default: - assert(current_expr->type == ELLIPSIS || current_expr->type == DOT); + Py_UNREACHABLE(); } } diff --git a/Python/pythonrun.c b/Python/pythonrun.c index e3fd3b24271ef..3a2fe966c08ba 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -29,7 +29,7 @@ #include "ast.h" // PyAST_FromNodeObject() #include "marshal.h" // PyMarshal_ReadLongFromFile() -#include // PyPegen_ASTFrom* +#include "pegen_interface.h" // PyPegen_ASTFrom* #ifdef MS_WINDOWS # include "malloc.h" // alloca() From webhook-mailer at python.org Thu Apr 23 11:53:27 2020 From: webhook-mailer at python.org (Florian Bruhin) Date: Thu, 23 Apr 2020 15:53:27 -0000 Subject: [Python-checkins] [3.7] gdbinit: Use proper define syntax (GH-19557) (GH-19678) Message-ID: https://github.com/python/cpython/commit/e1072d60dbbbfdb41000880da912760c8b60b1f4 commit: e1072d60dbbbfdb41000880da912760c8b60b1f4 branch: 3.7 author: Florian Bruhin committer: GitHub date: 2020-04-23T08:53:23-07:00 summary: [3.7] gdbinit: Use proper define syntax (GH-19557) (GH-19678) Using `def` rather than `define` results in: Ambiguous command "def pu": define, define-prefix. Automerge-Triggered-By: @csabella. (cherry picked from commit 1221135289306333d11db25ab20cbbd21ceec630) Co-authored-by: Florian Bruhin files: M Misc/gdbinit diff --git a/Misc/gdbinit b/Misc/gdbinit index bb10bdba799aa..a21b28e176170 100644 --- a/Misc/gdbinit +++ b/Misc/gdbinit @@ -149,7 +149,7 @@ define pystackv end # generally useful macro to print a Unicode string -def pu +define pu set $uni = $arg0 set $i = 0 while (*$uni && $i++<100) From webhook-mailer at python.org Thu Apr 23 12:26:10 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Thu, 23 Apr 2020 16:26:10 -0000 Subject: [Python-checkins] Update ga_new to use _PyArg_CheckPositional and _PyArg_NoKwnames (GH-19679) Message-ID: https://github.com/python/cpython/commit/02e4484f19304a0a5f484f06a3fa441c6fb6073a commit: 02e4484f19304a0a5f484f06a3fa441c6fb6073a branch: master author: Dong-hee Na committer: GitHub date: 2020-04-24T01:25:53+09:00 summary: Update ga_new to use _PyArg_CheckPositional and _PyArg_NoKwnames (GH-19679) files: M Objects/genericaliasobject.c diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index b8ad4d7014b0c..a56bdda38177f 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -438,12 +438,10 @@ static PyGetSetDef ga_properties[] = { static PyObject * ga_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { - if (kwds != NULL && PyDict_GET_SIZE(kwds) != 0) { - PyErr_SetString(PyExc_TypeError, "GenericAlias does not support keyword arguments"); + if (!_PyArg_NoKwnames("GenericAlias", kwds)) { return NULL; } - if (PyTuple_GET_SIZE(args) != 2) { - PyErr_SetString(PyExc_TypeError, "GenericAlias expects 2 positional arguments"); + if (!_PyArg_CheckPositional("GenericAlias", PyTuple_GET_SIZE(args), 2, 2)) { return NULL; } PyObject *origin = PyTuple_GET_ITEM(args, 0); From webhook-mailer at python.org Thu Apr 23 13:04:00 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 23 Apr 2020 17:04:00 -0000 Subject: [Python-checkins] bpo-39983: Add test.support.print_warning() (GH-19683) Message-ID: https://github.com/python/cpython/commit/d663d34685e18588748569468c672763f4c73b3e commit: d663d34685e18588748569468c672763f4c73b3e branch: master author: Victor Stinner committer: GitHub date: 2020-04-23T19:03:52+02:00 summary: bpo-39983: Add test.support.print_warning() (GH-19683) Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning(). files: M Doc/library/test.rst M Lib/test/_test_multiprocessing.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/utils.py M Lib/test/support/__init__.py M Lib/test/test_support.py diff --git a/Doc/library/test.rst b/Doc/library/test.rst index c33465d758d57..0573c275981c7 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -825,6 +825,15 @@ The :mod:`test.support` module defines the following functions: target of the "as" clause, if there is one. +.. function:: print_warning(msg) + + Print a warning into :data:`sys.__stderr__`. Format the message as: + ``f"Warning -- {msg}"``. If *msg* is made of multiple lines, add + ``"Warning -- "`` prefix to each line. + + .. versionadded:: 3.9 + + .. function:: wait_process(pid, *, exitcode, timeout=None) Wait until process *pid* completes and check that the process exit code is diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d633e02d016fc..376f5e33466a4 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5341,10 +5341,9 @@ def wait_proc_exit(self): dt = time.monotonic() - start_time if dt >= 5.0: test.support.environment_altered = True - print("Warning -- multiprocessing.Manager still has %s active " - "children after %s seconds" - % (multiprocessing.active_children(), dt), - file=sys.stderr) + support.print_warning(f"multiprocessing.Manager still has " + f"{multiprocessing.active_children()} " + f"active children after {dt} seconds") break def run_worker(self, worker, obj): @@ -5544,15 +5543,13 @@ def tearDownClass(cls): processes = set(multiprocessing.process._dangling) - set(cls.dangling[0]) if processes: test.support.environment_altered = True - print('Warning -- Dangling processes: %s' % processes, - file=sys.stderr) + support.print_warning(f'Dangling processes: {processes}') processes = None threads = set(threading._dangling) - set(cls.dangling[1]) if threads: test.support.environment_altered = True - print('Warning -- Dangling threads: %s' % threads, - file=sys.stderr) + support.print_warning(f'Dangling threads: {threads}') threads = None @@ -5620,10 +5617,9 @@ def tearDownClass(cls): dt = time.monotonic() - start_time if dt >= 5.0: test.support.environment_altered = True - print("Warning -- multiprocessing.Manager still has %s active " - "children after %s seconds" - % (multiprocessing.active_children(), dt), - file=sys.stderr) + support.print_warning(f"multiprocessing.Manager still has " + f"{multiprocessing.active_children()} " + f"active children after {dt} seconds") break gc.collect() # do garbage collection @@ -5632,9 +5628,9 @@ def tearDownClass(cls): # ensure that all processes which hold a reference to a # managed object have been joined. test.support.environment_altered = True - print('Warning -- Shared objects which still exist at manager ' - 'shutdown:') - print(cls.manager._debug_info()) + support.print_warning('Shared objects which still exist ' + 'at manager shutdown:') + support.print_warning(cls.manager._debug_info()) cls.manager.shutdown() cls.manager.join() cls.manager = None @@ -5731,16 +5727,14 @@ def tearDownModule(): if processes: need_sleep = True test.support.environment_altered = True - print('Warning -- Dangling processes: %s' % processes, - file=sys.stderr) + support.print_warning(f'Dangling processes: {processes}') processes = None threads = set(threading._dangling) - set(dangling[1]) if threads: need_sleep = True test.support.environment_altered = True - print('Warning -- Dangling threads: %s' % threads, - file=sys.stderr) + support.print_warning(f'Dangling threads: {threads}') threads = None # Sleep 500 ms to give time to child processes to complete. diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 558f2099c66f5..9338b28047954 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -327,7 +327,7 @@ def cleanup_test_droppings(test_name, verbose): f"directory nor file") if verbose: - print_warning("%r left behind %s %r" % (test_name, kind, name)) + print_warning(f"{test_name} left behind {kind} {name!r}") support.environment_altered = True try: diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index 40faed832c11b..0368694b2adcb 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -62,7 +62,7 @@ def printlist(x, width=70, indent=4, file=None): def print_warning(msg): - print(f"Warning -- {msg}", file=sys.stderr, flush=True) + support.print_warning(msg) orig_unraisablehook = None diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 4fe247aeb9d37..f3868c1041542 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2250,6 +2250,12 @@ def run_doctest(module, verbosity=None, optionflags=0): #======================================================================= # Support for saving and restoring the imported modules. +def print_warning(msg): + # bpo-39983: Print into sys.__stderr__ to display the warning even + # when sys.stderr is captured temporarily by a test + for line in msg.splitlines(): + print(f"Warning -- {line}", file=sys.__stderr__, flush=True) + def modules_setup(): return sys.modules.copy(), @@ -2305,14 +2311,12 @@ def threading_cleanup(*original_values): # Display a warning at the first iteration environment_altered = True dangling_threads = values[1] - print("Warning -- threading_cleanup() failed to cleanup " - "%s threads (count: %s, dangling: %s)" - % (values[0] - original_values[0], - values[0], len(dangling_threads)), - file=sys.stderr) + print_warning(f"threading_cleanup() failed to cleanup " + f"{values[0] - original_values[0]} threads " + f"(count: {values[0]}, " + f"dangling: {len(dangling_threads)})") for thread in dangling_threads: - print(f"Dangling thread: {thread!r}", file=sys.stderr) - sys.stderr.flush() + print_warning(f"Dangling thread: {thread!r}") # Don't hold references to threads dangling_threads = None @@ -2409,8 +2413,7 @@ def reap_children(): if pid == 0: break - print("Warning -- reap_children() reaped child process %s" - % pid, file=sys.stderr) + print_warning(f"reap_children() reaped child process {pid}") environment_altered = True diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 99a4cad2bb887..dee1db7d6d7c8 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -430,8 +430,12 @@ def test_reap_children(self): if time.monotonic() > deadline: self.fail("timeout") - with contextlib.redirect_stderr(stderr): + old_stderr = sys.__stderr__ + try: + sys.__stderr__ = stderr support.reap_children() + finally: + sys.__stderr__ = old_stderr # Use environment_altered to check if reap_children() found # the child process @@ -629,6 +633,24 @@ def test_fd_count(self): os.close(fd) self.assertEqual(more - start, 1) + def check_print_warning(self, msg, expected): + stderr = io.StringIO() + + old_stderr = sys.__stderr__ + try: + sys.__stderr__ = stderr + support.print_warning(msg) + finally: + sys.__stderr__ = old_stderr + + self.assertEqual(stderr.getvalue(), expected) + + def test_print_warning(self): + self.check_print_warning("msg", + "Warning -- msg\n") + self.check_print_warning("a\nb", + 'Warning -- a\nWarning -- b\n') + # XXX -follows a list of untested API # make_legacy_pyc # is_resource_enabled From webhook-mailer at python.org Thu Apr 23 14:26:55 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Thu, 23 Apr 2020 18:26:55 -0000 Subject: [Python-checkins] bpo-40336: Refactor typing._SpecialForm (GH-19620) Message-ID: https://github.com/python/cpython/commit/40ded947f82683f0ed08144599a83d3a1ce719eb commit: 40ded947f82683f0ed08144599a83d3a1ce719eb branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-23T21:26:48+03:00 summary: bpo-40336: Refactor typing._SpecialForm (GH-19620) files: M Lib/typing.py diff --git a/Lib/typing.py b/Lib/typing.py index 9383fb8ff3a23..0dcf291950f7d 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -141,8 +141,9 @@ def _type_check(arg, msg, is_argument=True): if (isinstance(arg, _GenericAlias) and arg.__origin__ in invalid_generic_forms): raise TypeError(f"{arg} is not valid as type argument") - if (isinstance(arg, _SpecialForm) and arg not in (Any, NoReturn) or - arg in (Generic, Protocol)): + if arg in (Any, NoReturn): + return arg + if isinstance(arg, _SpecialForm) or arg in (Generic, Protocol): raise TypeError(f"Plain {arg} is not valid as type argument") if isinstance(arg, (type, TypeVar, ForwardRef)): return arg @@ -299,41 +300,18 @@ def __deepcopy__(self, memo): return self -class _SpecialForm(_Final, _Immutable, _root=True): - """Internal indicator of special typing constructs. - See _doc instance attribute for specific docs. - """ - - __slots__ = ('_name', '_doc') - - def __new__(cls, *args, **kwds): - """Constructor. - - This only exists to give a better error message in case - someone tries to subclass a special typing object (not a good idea). - """ - if (len(args) == 3 and - isinstance(args[0], str) and - isinstance(args[1], tuple)): - # Close enough. - raise TypeError(f"Cannot subclass {cls!r}") - return super().__new__(cls) - - def __init__(self, name, doc): - self._name = name - self._doc = doc - - @property - def __doc__(self): - return self._doc +# Internal indicator of special typing constructs. +# See __doc__ instance attribute for specific docs. +class _SpecialForm(_Final, _root=True): + __slots__ = ('_name', '__doc__', '_getitem') - def __eq__(self, other): - if not isinstance(other, _SpecialForm): - return NotImplemented - return self._name == other._name + def __init__(self, getitem): + self._getitem = getitem + self._name = getitem.__name__ + self.__doc__ = getitem.__doc__ - def __hash__(self): - return hash((self._name,)) + def __mro_entries__(self, bases): + raise TypeError(f"Cannot subclass {self!r}") def __repr__(self): return 'typing.' + self._name @@ -352,31 +330,10 @@ def __subclasscheck__(self, cls): @_tp_cache def __getitem__(self, parameters): - if self._name in ('ClassVar', 'Final'): - item = _type_check(parameters, f'{self._name} accepts only single type.') - return _GenericAlias(self, (item,)) - if self._name == 'Union': - if parameters == (): - raise TypeError("Cannot take a Union of no types.") - if not isinstance(parameters, tuple): - parameters = (parameters,) - msg = "Union[arg, ...]: each arg must be a type." - parameters = tuple(_type_check(p, msg) for p in parameters) - parameters = _remove_dups_flatten(parameters) - if len(parameters) == 1: - return parameters[0] - return _GenericAlias(self, parameters) - if self._name == 'Optional': - arg = _type_check(parameters, "Optional[t] requires a single type.") - return Union[arg, type(None)] - if self._name == 'Literal': - # There is no '_type_check' call because arguments to Literal[...] are - # values, not types. - return _GenericAlias(self, parameters) - raise TypeError(f"{self} is not subscriptable") - - -Any = _SpecialForm('Any', doc= + return self._getitem(self, parameters) + + at _SpecialForm +def Any(self, parameters): """Special type indicating an unconstrained type. - Any is compatible with every type. @@ -386,9 +343,11 @@ def __getitem__(self, parameters): Note that all the above statements are true from the point of view of static type checkers. At runtime, Any should not be used with instance or class checks. - """) + """ + raise TypeError(f"{self} is not subscriptable") -NoReturn = _SpecialForm('NoReturn', doc= + at _SpecialForm +def NoReturn(self, parameters): """Special type indicating functions that never return. Example:: @@ -399,9 +358,11 @@ def stop() -> NoReturn: This type is invalid in other positions, e.g., ``List[NoReturn]`` will fail in static type checkers. - """) + """ + raise TypeError(f"{self} is not subscriptable") -ClassVar = _SpecialForm('ClassVar', doc= + at _SpecialForm +def ClassVar(self, parameters): """Special type construct to mark class variables. An annotation wrapped in ClassVar indicates that a given @@ -416,9 +377,12 @@ class Starship: Note that ClassVar is not a class itself, and should not be used with isinstance() or issubclass(). - """) + """ + item = _type_check(parameters, f'{self} accepts only single type.') + return _GenericAlias(self, (item,)) -Final = _SpecialForm('Final', doc= + at _SpecialForm +def Final(self, parameters): """Special typing construct to indicate final names to type checkers. A final name cannot be re-assigned or overridden in a subclass. @@ -434,9 +398,12 @@ class FastConnector(Connection): TIMEOUT = 1 # Error reported by type checker There is no runtime checking of these properties. - """) + """ + item = _type_check(parameters, f'{self} accepts only single type.') + return _GenericAlias(self, (item,)) -Union = _SpecialForm('Union', doc= + at _SpecialForm +def Union(self, parameters): """Union type; Union[X, Y] means either X or Y. To define a union, use e.g. Union[int, str]. Details: @@ -461,15 +428,29 @@ class FastConnector(Connection): - You cannot subclass or instantiate a union. - You can use Optional[X] as a shorthand for Union[X, None]. - """) - -Optional = _SpecialForm('Optional', doc= + """ + if parameters == (): + raise TypeError("Cannot take a Union of no types.") + if not isinstance(parameters, tuple): + parameters = (parameters,) + msg = "Union[arg, ...]: each arg must be a type." + parameters = tuple(_type_check(p, msg) for p in parameters) + parameters = _remove_dups_flatten(parameters) + if len(parameters) == 1: + return parameters[0] + return _GenericAlias(self, parameters) + + at _SpecialForm +def Optional(self, parameters): """Optional type. Optional[X] is equivalent to Union[X, None]. - """) + """ + arg = _type_check(parameters, f"{self} requires a single type.") + return Union[arg, type(None)] -Literal = _SpecialForm('Literal', doc= + at _SpecialForm +def Literal(self, parameters): """Special typing form to define literal types (a.k.a. value types). This form can be used to indicate to type checkers that the corresponding @@ -486,10 +467,13 @@ def open_helper(file: str, mode: MODE) -> str: open_helper('/some/path', 'r') # Passes type check open_helper('/other/path', 'typo') # Error in type checker - Literal[...] cannot be subclassed. At runtime, an arbitrary value - is allowed as type argument to Literal[...], but type checkers may - impose restrictions. - """) + Literal[...] cannot be subclassed. At runtime, an arbitrary value + is allowed as type argument to Literal[...], but type checkers may + impose restrictions. + """ + # There is no '_type_check' call because arguments to Literal[...] are + # values, not types. + return _GenericAlias(self, parameters) class ForwardRef(_Final, _root=True): From webhook-mailer at python.org Thu Apr 23 17:55:14 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 23 Apr 2020 21:55:14 -0000 Subject: [Python-checkins] bpo-39983: Add test.support.print_warning() (GH-19683) (GH-19687) Message-ID: https://github.com/python/cpython/commit/3340b2a61b458e7087c8c5fea063b1b45e1a4a07 commit: 3340b2a61b458e7087c8c5fea063b1b45e1a4a07 branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-23T23:55:07+02:00 summary: bpo-39983: Add test.support.print_warning() (GH-19683) (GH-19687) Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning(). (cherry picked from commit d663d34685e18588748569468c672763f4c73b3e) files: M Lib/test/_test_multiprocessing.py M Lib/test/libregrtest/runtest.py M Lib/test/libregrtest/utils.py M Lib/test/support/__init__.py M Lib/test/test_support.py diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d5336e4d7be30..5943dd83cc143 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5310,10 +5310,9 @@ def wait_proc_exit(self): dt = time.monotonic() - start_time if dt >= 5.0: test.support.environment_altered = True - print("Warning -- multiprocessing.Manager still has %s active " - "children after %s seconds" - % (multiprocessing.active_children(), dt), - file=sys.stderr) + support.print_warning(f"multiprocessing.Manager still has " + f"{multiprocessing.active_children()} " + f"active children after {dt} seconds") break def run_worker(self, worker, obj): @@ -5513,15 +5512,13 @@ def tearDownClass(cls): processes = set(multiprocessing.process._dangling) - set(cls.dangling[0]) if processes: test.support.environment_altered = True - print('Warning -- Dangling processes: %s' % processes, - file=sys.stderr) + support.print_warning(f'Dangling processes: {processes}') processes = None threads = set(threading._dangling) - set(cls.dangling[1]) if threads: test.support.environment_altered = True - print('Warning -- Dangling threads: %s' % threads, - file=sys.stderr) + support.print_warning(f'Dangling threads: {threads}') threads = None @@ -5589,10 +5586,9 @@ def tearDownClass(cls): dt = time.monotonic() - start_time if dt >= 5.0: test.support.environment_altered = True - print("Warning -- multiprocessing.Manager still has %s active " - "children after %s seconds" - % (multiprocessing.active_children(), dt), - file=sys.stderr) + support.print_warning(f"multiprocessing.Manager still has " + f"{multiprocessing.active_children()} " + f"active children after {dt} seconds") break gc.collect() # do garbage collection @@ -5601,9 +5597,9 @@ def tearDownClass(cls): # ensure that all processes which hold a reference to a # managed object have been joined. test.support.environment_altered = True - print('Warning -- Shared objects which still exist at manager ' - 'shutdown:') - print(cls.manager._debug_info()) + support.print_warning('Shared objects which still exist ' + 'at manager shutdown:') + support.print_warning(cls.manager._debug_info()) cls.manager.shutdown() cls.manager.join() cls.manager = None @@ -5700,16 +5696,14 @@ def tearDownModule(): if processes: need_sleep = True test.support.environment_altered = True - print('Warning -- Dangling processes: %s' % processes, - file=sys.stderr) + support.print_warning(f'Dangling processes: {processes}') processes = None threads = set(threading._dangling) - set(dangling[1]) if threads: need_sleep = True test.support.environment_altered = True - print('Warning -- Dangling threads: %s' % threads, - file=sys.stderr) + support.print_warning(f'Dangling threads: {threads}') threads = None # Sleep 500 ms to give time to child processes to complete. diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index 558f2099c66f5..9338b28047954 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -327,7 +327,7 @@ def cleanup_test_droppings(test_name, verbose): f"directory nor file") if verbose: - print_warning("%r left behind %s %r" % (test_name, kind, name)) + print_warning(f"{test_name} left behind {kind} {name!r}") support.environment_altered = True try: diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index 98a60f7a747d9..0467c8f8f56b6 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -2,6 +2,7 @@ import os.path import sys import textwrap +from test import support def format_duration(seconds): @@ -61,4 +62,4 @@ def printlist(x, width=70, indent=4, file=None): def print_warning(msg): - print(f"Warning -- {msg}", file=sys.stderr, flush=True) + support.print_warning(msg) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index a42c6f771b3d3..400eebc521454 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -2201,6 +2201,12 @@ def run_doctest(module, verbosity=None, optionflags=0): #======================================================================= # Support for saving and restoring the imported modules. +def print_warning(msg): + # bpo-39983: Print into sys.__stderr__ to display the warning even + # when sys.stderr is captured temporarily by a test + for line in msg.splitlines(): + print(f"Warning -- {line}", file=sys.__stderr__, flush=True) + def modules_setup(): return sys.modules.copy(), @@ -2256,14 +2262,12 @@ def threading_cleanup(*original_values): # Display a warning at the first iteration environment_altered = True dangling_threads = values[1] - print("Warning -- threading_cleanup() failed to cleanup " - "%s threads (count: %s, dangling: %s)" - % (values[0] - original_values[0], - values[0], len(dangling_threads)), - file=sys.stderr) + print_warning(f"threading_cleanup() failed to cleanup " + f"{values[0] - original_values[0]} threads " + f"(count: {values[0]}, " + f"dangling: {len(dangling_threads)})") for thread in dangling_threads: - print(f"Dangling thread: {thread!r}", file=sys.stderr) - sys.stderr.flush() + print_warning(f"Dangling thread: {thread!r}") # Don't hold references to threads dangling_threads = None @@ -2356,8 +2360,7 @@ def reap_children(): if pid == 0: break - print("Warning -- reap_children() reaped child process %s" - % pid, file=sys.stderr) + print_warning(f"reap_children() reaped child process {pid}") environment_altered = True diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index e3ce670b8437f..80e652d7005fc 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -433,8 +433,12 @@ def test_reap_children(self): if time.monotonic() > deadline: self.fail("timeout") - with contextlib.redirect_stderr(stderr): + old_stderr = sys.__stderr__ + try: + sys.__stderr__ = stderr support.reap_children() + finally: + sys.__stderr__ = old_stderr # Use environment_altered to check if reap_children() found # the child process @@ -633,6 +637,24 @@ def test_fd_count(self): os.close(fd) self.assertEqual(more - start, 1) + def check_print_warning(self, msg, expected): + stderr = io.StringIO() + + old_stderr = sys.__stderr__ + try: + sys.__stderr__ = stderr + support.print_warning(msg) + finally: + sys.__stderr__ = old_stderr + + self.assertEqual(stderr.getvalue(), expected) + + def test_print_warning(self): + self.check_print_warning("msg", + "Warning -- msg\n") + self.check_print_warning("a\nb", + 'Warning -- a\nWarning -- b\n') + # XXX -follows a list of untested API # make_legacy_pyc # is_resource_enabled From webhook-mailer at python.org Thu Apr 23 18:20:05 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 23 Apr 2020 22:20:05 -0000 Subject: [Python-checkins] bpo-39932: Fix multiprocessing test_heap() (GH-19690) Message-ID: https://github.com/python/cpython/commit/857d573257ab150d6bea666354312a5fd284b171 commit: 857d573257ab150d6bea666354312a5fd284b171 branch: 3.7 author: Victor Stinner committer: GitHub date: 2020-04-24T00:20:00+02:00 summary: bpo-39932: Fix multiprocessing test_heap() (GH-19690) bpo-32759, bpo-39932: Fix multiprocessing test_heap(): a new Heap object is now created for each test run. Partial backport of commit e4679cd644aa19f9d9df9beb1326625cf2b02c15 by Antoine Pitrou. files: A Misc/NEWS.d/next/Tests/2020-04-23-23-46-08.bpo-39932.6G8rRN.rst M Lib/test/_test_multiprocessing.py diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 30ea23da69499..a889ad3ae3918 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -3424,6 +3424,16 @@ class _TestHeap(BaseTestCase): ALLOWED_TYPES = ('processes',) + def setUp(self): + super().setUp() + # Make pristine heap for these tests + self.old_heap = multiprocessing.heap.BufferWrapper._heap + multiprocessing.heap.BufferWrapper._heap = multiprocessing.heap.Heap() + + def tearDown(self): + multiprocessing.heap.BufferWrapper._heap = self.old_heap + super().tearDown() + def test_heap(self): iterations = 5000 maxblocks = 50 diff --git a/Misc/NEWS.d/next/Tests/2020-04-23-23-46-08.bpo-39932.6G8rRN.rst b/Misc/NEWS.d/next/Tests/2020-04-23-23-46-08.bpo-39932.6G8rRN.rst new file mode 100644 index 0000000000000..c50be579834ab --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-23-23-46-08.bpo-39932.6G8rRN.rst @@ -0,0 +1,2 @@ +Fix multiprocessing test_heap(): a new Heap object is now created for each test +run. From webhook-mailer at python.org Thu Apr 23 18:43:03 2020 From: webhook-mailer at python.org (Guido van Rossum) Date: Thu, 23 Apr 2020 22:43:03 -0000 Subject: [Python-checkins] bpo-40334: Use old compiler when compile mode is func_type (GH-19692) Message-ID: https://github.com/python/cpython/commit/bc28805570ae3e8835a5d502ae9ab15c52449f77 commit: bc28805570ae3e8835a5d502ae9ab15c52449f77 branch: master author: Guido van Rossum committer: GitHub date: 2020-04-23T15:42:56-07:00 summary: bpo-40334: Use old compiler when compile mode is func_type (GH-19692) This is invoked by mypy, using ast.parse(source, "", "func_type"). Since the new grammar doesn't yet support the func_type_input start symbol we must use the old compiler in this case to prevent a crash. https://bugs.python.org/issue40334 files: M Python/bltinmodule.c diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index ce3561e4c0898..14c3e96fb51ab 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -817,7 +817,7 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, goto error; int current_use_peg = PyInterpreterState_Get()->config._use_peg_parser; - if (flags & PyCF_TYPE_COMMENTS || feature_version >= 0) { + if (flags & PyCF_TYPE_COMMENTS || feature_version >= 0 || compile_mode == 3) { PyInterpreterState_Get()->config._use_peg_parser = 0; } result = Py_CompileStringObject(str, filename, start[compile_mode], &cf, optimize); From webhook-mailer at python.org Thu Apr 23 18:44:13 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 23 Apr 2020 22:44:13 -0000 Subject: [Python-checkins] [3.7] bpo-38546: Backport multiprocessing tests fixes from master (GH-19689) Message-ID: https://github.com/python/cpython/commit/fd32a0e2ee445dd7156323d216627112e66b0a69 commit: fd32a0e2ee445dd7156323d216627112e66b0a69 branch: 3.7 author: Victor Stinner committer: GitHub date: 2020-04-24T00:44:08+02:00 summary: [3.7] bpo-38546: Backport multiprocessing tests fixes from master (GH-19689) * bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527) multiprocessing tests now call explicitly _run_finalizers() to remove immediately temporary directories created by multiprocessing.util.get_temp_dir(). (cherry picked from commit 039fb49c185570ab7b02f13fbdc51c859cfd831e) Co-authored-by: Victor Stinner (cherry picked from commit 632cb36084dc9d13f1cdb31a0e7e3ba80745a51a) * bpo-37421: multiprocessing tests now stop ForkServer (GH-14601) multiprocessing tests now stop the ForkServer instance if it's running: close the "alive" file descriptor to ask the server to stop and then remove its UNIX address. (cherry picked from commit 8fbeb14312b4c1320d31ad86e69749515879d1c3) Co-authored-by: Victor Stinner (cherry picked from commit 229f6e85f8b4d57a2e742e0d3fc361c5bd15f1cb) * bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) (GH-17647) Multiprocessing and concurrent.futures tests now stop the resource tracker process when tests complete. Add ResourceTracker._stop() method to multiprocessing.resource_tracker. Add _cleanup_tests() helper function to multiprocessing.util: share code between multiprocessing and concurrent.futures tests. (cherry picked from commit 9707e8e22d80ca97bf7a9812816701cecde6d226) (cherry picked from commit 35acb3597208e10a101140474adec86859d57f61) * Remove NEWS about resource tracker Python 3.7 multiprocessing does not have resource tracker. Co-authored-by: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> files: A Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst A Misc/NEWS.d/next/Tests/2019-07-05-14-47-55.bpo-37421.n8o2to.rst M Lib/multiprocessing/forkserver.py M Lib/multiprocessing/util.py M Lib/test/_test_multiprocessing.py M Lib/test/test_concurrent_futures.py diff --git a/Lib/multiprocessing/forkserver.py b/Lib/multiprocessing/forkserver.py index ffd1735848c45..ee5f76780bd0c 100644 --- a/Lib/multiprocessing/forkserver.py +++ b/Lib/multiprocessing/forkserver.py @@ -39,6 +39,25 @@ def __init__(self): self._lock = threading.Lock() self._preload_modules = ['__main__'] + def _stop(self): + # Method used by unit tests to stop the server + with self._lock: + self._stop_unlocked() + + def _stop_unlocked(self): + if self._forkserver_pid is None: + return + + # close the "alive" file descriptor asks the server to stop + os.close(self._forkserver_alive_fd) + self._forkserver_alive_fd = None + + os.waitpid(self._forkserver_pid, 0) + self._forkserver_pid = None + + os.unlink(self._forkserver_address) + self._forkserver_address = None + def set_forkserver_preload(self, modules_names): '''Set list of module names to try to load in forkserver process.''' if not all(type(mod) is str for mod in self._preload_modules): diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index f5331abe821fb..327fe42d6efdb 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -456,3 +456,24 @@ def spawnv_passfds(path, args, passfds): finally: os.close(errpipe_read) os.close(errpipe_write) + + +def _cleanup_tests(): + """Cleanup multiprocessing resources when multiprocessing tests + completed.""" + + from test import support + + # cleanup multiprocessing + process._cleanup() + + # Stop the ForkServer process if it's running + from multiprocessing import forkserver + forkserver._forkserver._stop() + + # bpo-37421: Explicitly call _run_finalizers() to remove immediately + # temporary directories created by multiprocessing.util.get_temp_dir(). + _run_finalizers() + support.gc_collect() + + support.reap_children() diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index a889ad3ae3918..23b9835a53775 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5059,8 +5059,8 @@ def tearDownModule(): # Sleep 500 ms to give time to child processes to complete. if need_sleep: time.sleep(0.5) - multiprocessing.process._cleanup() - test.support.gc_collect() + + multiprocessing.util._cleanup_tests() remote_globs['setUpModule'] = setUpModule remote_globs['tearDownModule'] = tearDownModule diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index b42670e16a6c9..a261bfeb4d373 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -26,6 +26,7 @@ BrokenExecutor) from concurrent.futures.process import BrokenProcessPool from multiprocessing import get_context +import multiprocessing.util def create_future(state=PENDING, exception=None, result=None): @@ -1253,6 +1254,7 @@ def test_main(): test.support.run_unittest(__name__) finally: test.support.reap_children() + multiprocessing.util._cleanup_tests() if __name__ == "__main__": test_main() diff --git a/Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst b/Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst new file mode 100644 index 0000000000000..c379b504ba8a4 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-07-01-19-57-26.bpo-37421.NFH1f0.rst @@ -0,0 +1,2 @@ +multiprocessing tests now explicitly call ``_run_finalizers()`` to +immediately remove temporary directories created by tests. diff --git a/Misc/NEWS.d/next/Tests/2019-07-05-14-47-55.bpo-37421.n8o2to.rst b/Misc/NEWS.d/next/Tests/2019-07-05-14-47-55.bpo-37421.n8o2to.rst new file mode 100644 index 0000000000000..136faa22d47a6 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-07-05-14-47-55.bpo-37421.n8o2to.rst @@ -0,0 +1,3 @@ +multiprocessing tests now stop the ForkServer instance if it's running: close +the "alive" file descriptor to ask the server to stop and then remove its UNIX +address. From webhook-mailer at python.org Thu Apr 23 19:30:49 2020 From: webhook-mailer at python.org (Guido van Rossum) Date: Thu, 23 Apr 2020 23:30:49 -0000 Subject: [Python-checkins] Fix broken mkdir -p call in regen-pegen (#19695) Message-ID: https://github.com/python/cpython/commit/3e89251ba87333cdf0b41a90a7f5c83d1e2280fa commit: 3e89251ba87333cdf0b41a90a7f5c83d1e2280fa branch: master author: Guido van Rossum committer: GitHub date: 2020-04-23T16:30:42-07:00 summary: Fix broken mkdir -p call in regen-pegen (#19695) We should use `$(MKDIR_P) `, not `$(MKDIR_P) -p `. files: M Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in index 3e4b20bb60e1f..400654718eb07 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -822,7 +822,7 @@ regen-grammar: regen-token .PHONY: regen-pegen regen-pegen: - @$(MKDIR_P) -p $(srcdir)/Parser/pegen + @$(MKDIR_P) $(srcdir)/Parser/pegen PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -c -q $(srcdir)/Grammar/python.gram \ -o $(srcdir)/Parser/pegen/parse.new.c $(UPDATE_FILE) $(srcdir)/Parser/pegen/parse.c $(srcdir)/Parser/pegen/parse.new.c From webhook-mailer at python.org Thu Apr 23 19:53:37 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Thu, 23 Apr 2020 23:53:37 -0000 Subject: [Python-checkins] bpo-40334: Allow to run make regen-pegen without distutils (GH-19684) Message-ID: https://github.com/python/cpython/commit/50f28dea32c45e1a49b3bd07c874b4fa837a5e88 commit: 50f28dea32c45e1a49b3bd07c874b4fa837a5e88 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-24T00:53:29+01:00 summary: bpo-40334: Allow to run make regen-pegen without distutils (GH-19684) files: M Tools/peg_generator/pegen/__main__.py M Tools/peg_generator/pegen/build.py diff --git a/Tools/peg_generator/pegen/__main__.py b/Tools/peg_generator/pegen/__main__.py index 874b307ab5c18..6696d135a8b69 100755 --- a/Tools/peg_generator/pegen/__main__.py +++ b/Tools/peg_generator/pegen/__main__.py @@ -11,11 +11,6 @@ import token import traceback -from typing import Final - -from pegen.build import build_parser_and_generator -from pegen.testutil import print_memstats - argparser = argparse.ArgumentParser( prog="pegen", description="Experimental PEG-like parser generator" @@ -52,6 +47,9 @@ def main() -> None: + from pegen.build import build_parser_and_generator + from pegen.testutil import print_memstats + args = argparser.parse_args() verbose = args.verbose verbose_tokenizer = verbose >= 3 @@ -133,4 +131,7 @@ def main() -> None: if __name__ == "__main__": + if sys.version_info < (3, 8): + print("ERROR: using pegen requires at least Python 3.8!", file=sys.stderr) + sys.exit(1) main() diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index 6ead94796f745..0ecb37051033c 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -6,12 +6,6 @@ from typing import Optional, Tuple -import distutils.log -from distutils.core import Distribution, Extension -from distutils.command.clean import clean # type: ignore -from distutils.command.build_ext import build_ext # type: ignore -from distutils.tests.support import fixup_build_ext - from pegen.c_generator import CParserGenerator from pegen.grammar import Grammar from pegen.grammar_parser import GeneratedParser as GrammarParser @@ -47,6 +41,12 @@ def compile_c_extension( If *build_dir* is provided, that path will be used as the temporary build directory of distutils (this is useful in case you want to use a temporary directory). """ + import distutils.log + from distutils.core import Distribution, Extension + from distutils.command.clean import clean # type: ignore + from distutils.command.build_ext import build_ext # type: ignore + from distutils.tests.support import fixup_build_ext + if verbose: distutils.log.set_verbosity(distutils.log.DEBUG) From webhook-mailer at python.org Thu Apr 23 20:13:37 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Fri, 24 Apr 2020 00:13:37 -0000 Subject: [Python-checkins] Use Py_ssize_t instead of ssize_t (GH-19685) Message-ID: https://github.com/python/cpython/commit/9f27dd3e16e2832fa8c375bfc4493de75b39d53f commit: 9f27dd3e16e2832fa8c375bfc4493de75b39d53f branch: master author: Pablo Galindo committer: GitHub date: 2020-04-24T01:13:33+01:00 summary: Use Py_ssize_t instead of ssize_t (GH-19685) files: M Parser/pegen/pegen.c diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index a51c8aae8b4c5..c8f5c95b473e2 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -1161,7 +1161,7 @@ _PyPegen_join_names_with_dot(Parser *p, expr_ty first_name, expr_ty second_name) if (!second_str) { return NULL; } - ssize_t len = strlen(first_str) + strlen(second_str) + 1; // +1 for the dot + Py_ssize_t len = strlen(first_str) + strlen(second_str) + 1; // +1 for the dot PyObject *str = PyBytes_FromStringAndSize(NULL, len); if (!str) { From webhook-mailer at python.org Thu Apr 23 20:43:23 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 24 Apr 2020 00:43:23 -0000 Subject: [Python-checkins] bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) Message-ID: https://github.com/python/cpython/commit/25104949a5a60ff86c10691e184ce2ecb500159b commit: 25104949a5a60ff86c10691e184ce2ecb500159b branch: master author: Victor Stinner committer: GitHub date: 2020-04-24T02:43:18+02:00 summary: bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) If _PyCode_InitOpcache() fails in _PyEval_EvalFrameDefault(), use "goto exit_eval_frame;" rather than "return NULL;" to exit the function in a consistent state. For example, tstate->frame is now reset properly. files: M Python/ceval.c diff --git a/Python/ceval.c b/Python/ceval.c index 59765d850ba1d..c610419f24f58 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1297,7 +1297,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) co->co_opcache_flag++; if (co->co_opcache_flag == OPCACHE_MIN_RUNS) { if (_PyCode_InitOpcache(co) < 0) { - return NULL; + goto exit_eval_frame; } #if OPCACHE_STATS opcache_code_objects_extra_mem += From webhook-mailer at python.org Thu Apr 23 21:07:28 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 24 Apr 2020 01:07:28 -0000 Subject: [Python-checkins] bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) (GH-19698) Message-ID: https://github.com/python/cpython/commit/d9df63deab78f70061a5a24c1f92e6d389fc45f7 commit: d9df63deab78f70061a5a24c1f92e6d389fc45f7 branch: 3.8 author: Victor Stinner committer: GitHub date: 2020-04-24T03:07:20+02:00 summary: bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) (GH-19698) If _PyCode_InitOpcache() fails in _PyEval_EvalFrameDefault(), use "goto exit_eval_frame;" rather than "return NULL;" to exit the function in a consistent state. For example, tstate->frame is now reset properly. (cherry picked from commit 25104949a5a60ff86c10691e184ce2ecb500159b) files: M Python/ceval.c diff --git a/Python/ceval.c b/Python/ceval.c index 2db6e6bf8ebdb..1873e37cf608e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1159,7 +1159,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag) co->co_opcache_flag++; if (co->co_opcache_flag == OPCACHE_MIN_RUNS) { if (_PyCode_InitOpcache(co) < 0) { - return NULL; + goto exit_eval_frame; } #if OPCACHE_STATS opcache_code_objects_extra_mem += From webhook-mailer at python.org Fri Apr 24 05:33:15 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Fri, 24 Apr 2020 09:33:15 -0000 Subject: [Python-checkins] Expand the implementation comments (GH-19699) Message-ID: https://github.com/python/cpython/commit/4cc4d6048efcec43fe866fac96e0c2e57a87b308 commit: 4cc4d6048efcec43fe866fac96e0c2e57a87b308 branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-24T02:33:07-07:00 summary: Expand the implementation comments (GH-19699) files: M Lib/collections/__init__.py diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index bb9a605a994f4..c4bff592dc0e7 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -711,6 +711,13 @@ def __repr__(self): # # To strip negative and zero counts, add-in an empty counter: # c += Counter() + # + # Rich comparison operators for multiset subset and superset tests + # are deliberately omitted due to semantic conflicts with the + # existing inherited dict equality method. Subset and superset + # semantics ignore zero counts and require that p?q ? p?q ? p=q; + # however, that would not be the case for p=Counter(a=1, b=0) + # and q=Counter(a=1) where the dictionaries are not equal. def __add__(self, other): '''Add counts from two counters. From webhook-mailer at python.org Fri Apr 24 06:00:56 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 24 Apr 2020 10:00:56 -0000 Subject: [Python-checkins] bpo-38061: os.closerange() uses closefrom() on FreeBSD (GH-19696) Message-ID: https://github.com/python/cpython/commit/162c567d164b5742c0d1f3f8bd8c8bab9c117cd0 commit: 162c567d164b5742c0d1f3f8bd8c8bab9c117cd0 branch: master author: Victor Stinner committer: GitHub date: 2020-04-24T12:00:51+02:00 summary: bpo-38061: os.closerange() uses closefrom() on FreeBSD (GH-19696) On FreeBSD, os.closerange(fd_low, fd_high) now calls closefrom(fd_low) if fd_high is greater than or equal to sysconf(_SC_OPEN_MAX). Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) and Kubilay Kocak (koobs): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 files: A Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst M Modules/posixmodule.c diff --git a/Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst b/Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst new file mode 100644 index 0000000000000..e55d5d50bd7e2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst @@ -0,0 +1,6 @@ +On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls ``closefrom(fd_low)`` +if *fd_high* is greater than or equal to ``sysconf(_SC_OPEN_MAX)``. + +Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) +and Kubilay Kocak (koobs): +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 3386be0fbc85a..3d3f6ac969926 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8687,10 +8687,13 @@ _fdwalk_close_func(void *lohi, int fd) int lo = ((int *)lohi)[0]; int hi = ((int *)lohi)[1]; - if (fd >= hi) + if (fd >= hi) { return 1; - else if (fd >= lo) - close(fd); + } + else if (fd >= lo) { + /* Ignore errors */ + (void)close(fd); + } return 0; } #endif /* HAVE_FDWALK */ @@ -8711,8 +8714,6 @@ os_closerange_impl(PyObject *module, int fd_low, int fd_high) { #ifdef HAVE_FDWALK int lohi[2]; -#else - int i; #endif Py_BEGIN_ALLOW_THREADS _Py_BEGIN_SUPPRESS_IPH @@ -8721,8 +8722,20 @@ os_closerange_impl(PyObject *module, int fd_low, int fd_high) lohi[1] = fd_high; fdwalk(_fdwalk_close_func, lohi); #else - for (i = Py_MAX(fd_low, 0); i < fd_high; i++) - close(i); + fd_low = Py_MAX(fd_low, 0); +#ifdef __FreeBSD__ + if (fd_high >= sysconf(_SC_OPEN_MAX)) { + /* Any errors encountered while closing file descriptors are ignored */ + closefrom(fd_low); + } + else +#endif + { + for (int i = fd_low; i < fd_high; i++) { + /* Ignore errors */ + (void)close(i); + } + } #endif _Py_END_SUPPRESS_IPH Py_END_ALLOW_THREADS From webhook-mailer at python.org Fri Apr 24 06:04:46 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Fri, 24 Apr 2020 10:04:46 -0000 Subject: [Python-checkins] Expand the implementation comments (GH-19699) (GH-19701) Message-ID: https://github.com/python/cpython/commit/c7b55e929b35ccab552f9efd49eed4a168e97e2f commit: c7b55e929b35ccab552f9efd49eed4a168e97e2f branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-24T03:04:41-07:00 summary: Expand the implementation comments (GH-19699) (GH-19701) files: M Lib/collections/__init__.py diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index cadf1c72f08d4..a78a47c55a8fc 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -695,6 +695,13 @@ def __repr__(self): # # To strip negative and zero counts, add-in an empty counter: # c += Counter() + # + # Rich comparison operators for multiset subset and superset tests + # are deliberately omitted due to semantic conflicts with the + # existing inherited dict equality method. Subset and superset + # semantics ignore zero counts and require that p?q ? p?q ? p=q; + # however, that would not be the case for p=Counter(a=1, b=0) + # and q=Counter(a=1) where the dictionaries are not equal. def __add__(self, other): '''Add counts from two counters. From webhook-mailer at python.org Fri Apr 24 06:07:03 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 24 Apr 2020 10:07:03 -0000 Subject: [Python-checkins] bpo-38061: subprocess uses closefrom() on FreeBSD (GH-19697) Message-ID: https://github.com/python/cpython/commit/e6f8abd500751a834b6fff4f107ecbd29f2184fe commit: e6f8abd500751a834b6fff4f107ecbd29f2184fe branch: master author: Victor Stinner committer: GitHub date: 2020-04-24T12:06:58+02:00 summary: bpo-38061: subprocess uses closefrom() on FreeBSD (GH-19697) Optimize the subprocess module on FreeBSD using closefrom(). A single close(fd) syscall is cheap, but when sysconf(_SC_OPEN_MAX) is high, the loop calling close(fd) on each file descriptor can take several milliseconds. The workaround on FreeBSD to improve performance was to load and mount the fdescfs kernel module, but this is not enabled by default. Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) and Kubilay Kocak (koobs): https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 files: A Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst M Doc/whatsnew/3.9.rst M Modules/_posixsubprocess.c diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index ee851706055a3..325121df13981 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -471,6 +471,10 @@ Optimizations until the main thread handles signals. (Contributed by Victor Stinner in :issue:`40010`.) +* Optimize the :mod:`subprocess` module on FreeBSD using ``closefrom()``. + (Contributed by Ed Maste, Conrad Meyer, Kyle Evans, Kubilay Kocak and Victor + Stinner in :issue:`38061`.) + Build and C API Changes ======================= diff --git a/Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst b/Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst new file mode 100644 index 0000000000000..603d80b88b074 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst @@ -0,0 +1,11 @@ +Optimize the :mod:`subprocess` module on FreeBSD using ``closefrom()``. +A single ``close(fd)`` syscall is cheap, but when ``sysconf(_SC_OPEN_MAX)`` is +high, the loop calling ``close(fd)`` on each file descriptor can take several +milliseconds. + +The workaround on FreeBSD to improve performance was to load and mount the +fdescfs kernel module, but this is not enabled by default. + +Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) and +Kubilay Kocak (koobs): +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274 diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index 7d5a7fe17c075..60dd78d92a4f5 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -264,9 +264,15 @@ _close_fds_by_brute_force(long start_fd, PyObject *py_fds_to_keep) start_fd = keep_fd + 1; } if (start_fd <= end_fd) { +#if defined(__FreeBSD__) + /* Any errors encountered while closing file descriptors are ignored */ + closefrom(start_fd); +#else for (fd_num = start_fd; fd_num < end_fd; ++fd_num) { - close(fd_num); + /* Ignore errors */ + (void)close(fd_num); } +#endif } } From webhook-mailer at python.org Fri Apr 24 09:51:16 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Fri, 24 Apr 2020 13:51:16 -0000 Subject: [Python-checkins] bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694) Message-ID: https://github.com/python/cpython/commit/24ffe705c30e36c82940d75fd1454256634d0b3c commit: 24ffe705c30e36c82940d75fd1454256634d0b3c branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-24T14:51:09+01:00 summary: bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694) Previously every test was building an extension module and loading it into sys.modules. The tearDown function was thus not able to clean up correctly, resulting in memory leaks. With this commit, every test function now builds the extension module and runs the actual test code in a new process (using assert_python_ok), so that sys.modules stays intact and no memory gets leaked. files: M Lib/test/test_peg_generator/test_c_parser.py M Tools/peg_generator/pegen/build.py M Tools/peg_generator/pegen/testutil.py diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index ceda6d43d1750..8eb66d5279581 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -1,19 +1,14 @@ -import ast -import contextlib -import traceback -import tempfile -import shutil +import textwrap import unittest -import sys +from distutils.tests.support import TempdirManager +from pathlib import Path from test import test_tools -from test.test_peg_generator.ast_dump import ast_dump from test import support -from pathlib import PurePath, Path -from typing import Sequence +from test.support.script_helper import assert_python_ok -test_tools.skip_if_missing('peg_generator') -with test_tools.imports_under_tool('peg_generator'): +test_tools.skip_if_missing("peg_generator") +with test_tools.imports_under_tool("peg_generator"): from pegen.grammar_parser import GeneratedParser as GrammarParser from pegen.testutil import ( parse_string, @@ -22,44 +17,72 @@ ) -class TestCParser(unittest.TestCase): - def setUp(self): - cmd = support.missing_compiler_executable() - if cmd is not None: - self.skipTest('The %r command is not found' % cmd) - self.tmp_path = tempfile.mkdtemp() +TEST_TEMPLATE = """ +tmp_dir = {extension_path!r} - def tearDown(self): - with contextlib.suppress(PermissionError): - shutil.rmtree(self.tmp_path) +import ast +import traceback +import sys +import unittest +from test.test_peg_generator.ast_dump import ast_dump + +sys.path.insert(0, tmp_dir) +import parse + +class Tests(unittest.TestCase): def check_input_strings_for_grammar( self, - source: str, - tmp_path: PurePath, - valid_cases: Sequence[str] = (), - invalid_cases: Sequence[str] = (), - ) -> None: - grammar = parse_string(source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(tmp_path)) - + valid_cases = (), + invalid_cases = (), + ): if valid_cases: for case in valid_cases: - extension.parse_string(case, mode=0) + parse.parse_string(case, mode=0) if invalid_cases: for case in invalid_cases: with self.assertRaises(SyntaxError): - extension.parse_string(case, mode=0) - - def verify_ast_generation(self, source: str, stmt: str, tmp_path: PurePath) -> None: - grammar = parse_string(source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(tmp_path)) + parse.parse_string(case, mode=0) + def verify_ast_generation(self, stmt): expected_ast = ast.parse(stmt) - actual_ast = extension.parse_string(stmt, mode=1) + actual_ast = parse.parse_string(stmt, mode=1) self.assertEqual(ast_dump(expected_ast), ast_dump(actual_ast)) + def test_parse(self): + {test_source} + +unittest.main() +""" + + +class TestCParser(TempdirManager, unittest.TestCase): + def setUp(self): + cmd = support.missing_compiler_executable() + if cmd is not None: + self.skipTest("The %r command is not found" % cmd) + super(TestCParser, self).setUp() + self.tmp_path = self.mkdtemp() + change_cwd = support.change_cwd(self.tmp_path) + change_cwd.__enter__() + self.addCleanup(change_cwd.__exit__, None, None, None) + + def tearDown(self): + super(TestCParser, self).tearDown() + + def build_extension(self, grammar_source): + grammar = parse_string(grammar_source, GrammarParser) + generate_parser_c_extension(grammar, Path(self.tmp_path)) + + def run_test(self, grammar_source, test_source): + self.build_extension(grammar_source) + test_source = textwrap.indent(textwrap.dedent(test_source), 8 * " ") + assert_python_ok( + "-c", + TEST_TEMPLATE.format(extension_path=self.tmp_path, test_source=test_source), + ) + def test_c_parser(self) -> None: grammar_source = """ start[mod_ty]: a=stmt* $ { Module(a, NULL, p->arena) } @@ -81,9 +104,7 @@ def test_c_parser(self) -> None: | s=STRING { s } ) """ - grammar = parse_string(grammar_source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) - + test_source = """ expressions = [ "4+5", "4-5", @@ -97,30 +118,38 @@ def test_c_parser(self) -> None: ] for expr in expressions: - the_ast = extension.parse_string(expr, mode=1) + the_ast = parse.parse_string(expr, mode=1) expected_ast = ast.parse(expr) self.assertEqual(ast_dump(the_ast), ast_dump(expected_ast)) + """ + self.run_test(grammar_source, test_source) def test_lookahead(self) -> None: - grammar = """ + grammar_source = """ start: NAME &NAME expr NEWLINE? ENDMARKER expr: NAME | NUMBER """ + test_source = """ valid_cases = ["foo bar"] invalid_cases = ["foo 34"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + self.check_input_strings_for_grammar(valid_cases, invalid_cases) + """ + self.run_test(grammar_source, test_source) def test_negative_lookahead(self) -> None: - grammar = """ + grammar_source = """ start: NAME !NAME expr NEWLINE? ENDMARKER expr: NAME | NUMBER """ + test_source = """ valid_cases = ["foo 34"] invalid_cases = ["foo bar"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + self.check_input_strings_for_grammar(valid_cases, invalid_cases) + """ + self.run_test(grammar_source, test_source) def test_cut(self) -> None: - grammar = """ + grammar_source = """ start: X ~ Y Z | X Q S X: 'x' Y: 'y' @@ -128,57 +157,75 @@ def test_cut(self) -> None: Q: 'q' S: 's' """ + test_source = """ valid_cases = ["x y z"] invalid_cases = ["x q s"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + self.check_input_strings_for_grammar(valid_cases, invalid_cases) + """ + self.run_test(grammar_source, test_source) def test_gather(self) -> None: - grammar = """ + grammar_source = """ start: ';'.pass_stmt+ NEWLINE pass_stmt: 'pass' """ + test_source = """ valid_cases = ["pass", "pass; pass"] invalid_cases = ["pass;", "pass; pass;"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + self.check_input_strings_for_grammar(valid_cases, invalid_cases) + """ + self.run_test(grammar_source, test_source) def test_left_recursion(self) -> None: - grammar = """ + grammar_source = """ start: expr NEWLINE expr: ('-' term | expr '+' term | term) term: NUMBER """ + test_source = """ valid_cases = ["-34", "34", "34 + 12", "1 + 1 + 2 + 3"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases) + self.check_input_strings_for_grammar(valid_cases) + """ + self.run_test(grammar_source, test_source) def test_advanced_left_recursive(self) -> None: - grammar = """ + grammar_source = """ start: NUMBER | sign start sign: ['-'] """ + test_source = """ valid_cases = ["23", "-34"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases) + self.check_input_strings_for_grammar(valid_cases) + """ + self.run_test(grammar_source, test_source) def test_mutually_left_recursive(self) -> None: - grammar = """ + grammar_source = """ start: foo 'E' foo: bar 'A' | 'B' bar: foo 'C' | 'D' """ + test_source = """ valid_cases = ["B E", "D A C A E"] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases) + self.check_input_strings_for_grammar(valid_cases) + """ + self.run_test(grammar_source, test_source) def test_nasty_mutually_left_recursive(self) -> None: - grammar = """ + grammar_source = """ start: target '=' target: maybe '+' | NAME maybe: maybe '-' | target """ + test_source = """ valid_cases = ["x ="] invalid_cases = ["x - + ="] - self.check_input_strings_for_grammar(grammar, self.tmp_path, valid_cases, invalid_cases) + self.check_input_strings_for_grammar(valid_cases, invalid_cases) + """ + self.run_test(grammar_source, test_source) def test_return_stmt_noexpr_action(self) -> None: - grammar = """ + grammar_source = """ start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } statements[asdl_seq*]: a=statement+ { a } statement[stmt_ty]: simple_stmt @@ -186,19 +233,25 @@ def test_return_stmt_noexpr_action(self) -> None: small_stmt[stmt_ty]: return_stmt return_stmt[stmt_ty]: a='return' NEWLINE { _Py_Return(NULL, EXTRA) } """ + test_source = """ stmt = "return" - self.verify_ast_generation(grammar, stmt, self.tmp_path) + self.verify_ast_generation(stmt) + """ + self.run_test(grammar_source, test_source) def test_gather_action_ast(self) -> None: - grammar = """ + grammar_source = """ start[mod_ty]: a=';'.pass_stmt+ NEWLINE ENDMARKER { Module(a, NULL, p->arena) } pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA)} """ + test_source = """ stmt = "pass; pass" - self.verify_ast_generation(grammar, stmt, self.tmp_path) + self.verify_ast_generation(stmt) + """ + self.run_test(grammar_source, test_source) def test_pass_stmt_action(self) -> None: - grammar = """ + grammar_source = """ start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } statements[asdl_seq*]: a=statement+ { a } statement[stmt_ty]: simple_stmt @@ -206,11 +259,14 @@ def test_pass_stmt_action(self) -> None: small_stmt[stmt_ty]: pass_stmt pass_stmt[stmt_ty]: a='pass' NEWLINE { _Py_Pass(EXTRA) } """ + test_source = """ stmt = "pass" - self.verify_ast_generation(grammar, stmt, self.tmp_path) + self.verify_ast_generation(stmt) + """ + self.run_test(grammar_source, test_source) def test_if_stmt_action(self) -> None: - grammar = """ + grammar_source = """ start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) } statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) } | simple_stmt @@ -230,11 +286,14 @@ def test_if_stmt_action(self) -> None: full_expression: NAME """ + test_source = """ stmt = "pass" - self.verify_ast_generation(grammar, stmt, self.tmp_path) + self.verify_ast_generation(stmt) + """ + self.run_test(grammar_source, test_source) def test_same_name_different_types(self) -> None: - source = """ + grammar_source = """ start[mod_ty]: a=import_from+ NEWLINE ENDMARKER { Module(a, NULL, p->arena)} import_from[stmt_ty]: ( a='from' !'import' c=simple_name 'import' d=import_as_names_from { _Py_ImportFrom(c->v.Name.id, d, 0, EXTRA) } @@ -245,13 +304,13 @@ def test_same_name_different_types(self) -> None: import_as_names_from[asdl_seq*]: a=','.import_as_name_from+ { a } import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _Py_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, p->arena) } """ - grammar = parse_string(source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) - + test_source = """ for stmt in ("from a import b as c", "from . import a as b"): expected_ast = ast.parse(stmt) - actual_ast = extension.parse_string(stmt, mode=1) + actual_ast = parse.parse_string(stmt, mode=1) self.assertEqual(ast_dump(expected_ast), ast_dump(actual_ast)) + """ + self.run_test(grammar_source, test_source) def test_with_stmt_with_paren(self) -> None: grammar_source = """ @@ -269,14 +328,15 @@ def test_with_stmt_with_paren(self) -> None: block[stmt_ty]: a=pass_stmt NEWLINE { a } | NEWLINE INDENT a=pass_stmt DEDENT { a } pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA) } """ - stmt = "with (\n a as b,\n c as d\n): pass" - grammar = parse_string(grammar_source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) - the_ast = extension.parse_string(stmt, mode=1) + test_source = """ + stmt = "with (\\n a as b,\\n c as d\\n): pass" + the_ast = parse.parse_string(stmt, mode=1) self.assertTrue(ast_dump(the_ast).startswith( "Module(body=[With(items=[withitem(context_expr=Name(id='a', ctx=Load()), optional_vars=Name(id='b', ctx=Store())), " "withitem(context_expr=Name(id='c', ctx=Load()), optional_vars=Name(id='d', ctx=Store()))]" )) + """ + self.run_test(grammar_source, test_source) def test_ternary_operator(self) -> None: grammar_source = """ @@ -290,23 +350,27 @@ def test_ternary_operator(self) -> None: { _Py_comprehension(_Py_Name(((expr_ty) a)->v.Name.id, Store, EXTRA), b, c, (y == NULL) ? 0 : 1, p->arena) })+ { a } ) """ + test_source = """ stmt = "[i for i in a if b]" - self.verify_ast_generation(grammar_source, stmt, self.tmp_path) + self.verify_ast_generation(stmt) + """ + self.run_test(grammar_source, test_source) def test_syntax_error_for_string(self) -> None: grammar_source = """ start: expr+ NEWLINE? ENDMARKER expr: NAME """ - grammar = parse_string(grammar_source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) + test_source = """ for text in ("a b 42 b a", "? ? 42 ? ?"): try: - extension.parse_string(text, mode=0) + parse.parse_string(text, mode=0) except SyntaxError as e: tb = traceback.format_exc() self.assertTrue('File "", line 1' in tb) self.assertTrue(f"SyntaxError: invalid syntax" in tb) + """ + self.run_test(grammar_source, test_source) def test_headers_and_trailer(self) -> None: grammar_source = """ @@ -323,14 +387,14 @@ def test_headers_and_trailer(self) -> None: self.assertTrue("SOME SUBHEADER" in parser_source) self.assertTrue("SOME TRAILER" in parser_source) - def test_error_in_rules(self) -> None: grammar_source = """ start: expr+ NEWLINE? ENDMARKER expr: NAME {PyTuple_New(-1)} """ - grammar = parse_string(grammar_source, GrammarParser) - extension = generate_parser_c_extension(grammar, Path(self.tmp_path)) # PyTuple_New raises SystemError if an invalid argument was passed. + test_source = """ with self.assertRaises(SystemError): - extension.parse_string("a", mode=0) + parse.parse_string("a", mode=0) + """ + self.run_test(grammar_source, test_source) diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index 0ecb37051033c..0f5d73ee5feb5 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -83,6 +83,7 @@ def compile_c_extension( cmd.inplace = True if build_dir: cmd.build_temp = build_dir + cmd.build_lib = build_dir cmd.ensure_finalized() cmd.run() diff --git a/Tools/peg_generator/pegen/testutil.py b/Tools/peg_generator/pegen/testutil.py index 3616effe6b4f9..5a91862be1273 100644 --- a/Tools/peg_generator/pegen/testutil.py +++ b/Tools/peg_generator/pegen/testutil.py @@ -92,9 +92,7 @@ def generate_parser_c_extension( with open(source, "w") as file: genr = CParserGenerator(grammar, file, debug=debug) genr.generate("parse.c") - extension_path = compile_c_extension(str(source), build_dir=str(path / "build")) - extension = import_file("parse", extension_path) - return extension + compile_c_extension(str(source), build_dir=str(path)) def print_memstats() -> bool: From webhook-mailer at python.org Fri Apr 24 14:19:55 2020 From: webhook-mailer at python.org (Carl Meyer) Date: Fri, 24 Apr 2020 18:19:55 -0000 Subject: [Python-checkins] bpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663) Message-ID: https://github.com/python/cpython/commit/503de7149d03bdcc671dcbbb5b64f761bb192b4d commit: 503de7149d03bdcc671dcbbb5b64f761bb192b4d branch: master author: Carl Meyer committer: GitHub date: 2020-04-24T11:19:46-07:00 summary: bpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663) Deprecate lib2to3 module in light of PEP 617. We anticipate removal in the 3.12 timeframe. files: A Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst M Doc/library/2to3.rst M Lib/lib2to3/__init__.py M Lib/test/test___all__.py diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst index eb4c9185f48bf..1d7bd26287290 100644 --- a/Doc/library/2to3.rst +++ b/Doc/library/2to3.rst @@ -9,9 +9,7 @@ of *fixers* to transform it into valid Python 3.x code. The standard library contains a rich set of fixers that will handle almost all code. 2to3 supporting library :mod:`lib2to3` is, however, a flexible and generic library, so it is -possible to write your own fixers for 2to3. :mod:`lib2to3` could also be -adapted to custom applications in which Python code needs to be edited -automatically. +possible to write your own fixers for 2to3. .. _2to3-using: @@ -466,9 +464,17 @@ and off individually. They are described here in more detail. -------------- +.. deprecated:: 3.10 + Python 3.9 will switch to a PEG parser (see :pep:`617`), and Python 3.10 may + include new language syntax that is not parsable by lib2to3's LL(1) parser. + The ``lib2to3`` module may be removed from the standard library in a future + Python version. Consider third-party alternatives such as `LibCST`_ or + `parso`_. + .. note:: The :mod:`lib2to3` API should be considered unstable and may change drastically in the future. -.. XXX What is the public interface anyway? +.. _LibCST: https://libcst.readthedocs.io/ +.. _parso: https://parso.readthedocs.io/ diff --git a/Lib/lib2to3/__init__.py b/Lib/lib2to3/__init__.py index ea30561d83979..4224dffef4295 100644 --- a/Lib/lib2to3/__init__.py +++ b/Lib/lib2to3/__init__.py @@ -1 +1,8 @@ -#empty +import warnings + + +warnings.warn( + "lib2to3 package is deprecated and may not be able to parse Python 3.10+", + PendingDeprecationWarning, + stacklevel=2, +) diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index c077881511b8c..0ba243ee4e74e 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -17,6 +17,7 @@ def check_all(self, modname): names = {} with support.check_warnings( (".* (module|package)", DeprecationWarning), + (".* (module|package)", PendingDeprecationWarning), ("", ResourceWarning), quiet=True): try: diff --git a/Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst b/Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst new file mode 100644 index 0000000000000..290dd453bd4ad --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst @@ -0,0 +1 @@ +The :mod:`lib2to3` module is pending deprecation due to :pep:`617`. \ No newline at end of file From webhook-mailer at python.org Fri Apr 24 19:39:12 2020 From: webhook-mailer at python.org (Cajetan Rodrigues) Date: Fri, 24 Apr 2020 23:39:12 -0000 Subject: [Python-checkins] bpo-40340: Separate examples more clearly in the programming FAQ (GH-19688) Message-ID: https://github.com/python/cpython/commit/5aafa548794d23b6d4cafb4fd88289cd0ba2a2a8 commit: 5aafa548794d23b6d4cafb4fd88289cd0ba2a2a8 branch: master author: Cajetan Rodrigues committer: GitHub date: 2020-04-24T19:39:04-04:00 summary: bpo-40340: Separate examples more clearly in the programming FAQ (GH-19688) files: M Doc/faq/programming.rst diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 70b11d6e93056..68f9ce811a641 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -851,10 +851,11 @@ For integers, use the built-in :func:`int` type constructor, e.g. ``int('144') e.g. ``float('144') == 144.0``. By default, these interpret the number as decimal, so that ``int('0144') == -144`` and ``int('0x144')`` raises :exc:`ValueError`. ``int(string, base)`` takes -the base to convert from as a second optional argument, so ``int('0x144', 16) == -324``. If the base is specified as 0, the number is interpreted using Python's -rules: a leading '0o' indicates octal, and '0x' indicates a hex number. +144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. ``int(string, +base)`` takes the base to convert from as a second optional argument, so ``int( +'0x144', 16) == 324``. If the base is specified as 0, the number is interpreted +using Python's rules: a leading '0o' indicates octal, and '0x' indicates a hex +number. Do not use the built-in function :func:`eval` if all you need is to convert strings to numbers. :func:`eval` will be significantly slower and it presents a From webhook-mailer at python.org Fri Apr 24 20:20:04 2020 From: webhook-mailer at python.org (Guido van Rossum) Date: Sat, 25 Apr 2020 00:20:04 -0000 Subject: [Python-checkins] bpo-40334: Add What's New sections for PEP 617 and PEP 585 (GH-19704) Message-ID: https://github.com/python/cpython/commit/0e80b561d442769631d66f1cc8813ac30f97378e commit: 0e80b561d442769631d66f1cc8813ac30f97378e branch: master author: Guido van Rossum committer: GitHub date: 2020-04-24T17:19:56-07:00 summary: bpo-40334: Add What's New sections for PEP 617 and PEP 585 (GH-19704) files: M Doc/whatsnew/3.9.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 325121df13981..728e6001daabf 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -115,6 +115,49 @@ to easily remove an unneeded prefix or a suffix from a string. Corresponding added. See :pep:`616` for a full description. (Contributed by Dennis Sweeney in :issue:`18939`.) +PEP 585: Builtin Generic Types +------------------------------ + +In type annotations you can now use built-in collection types such as +``list`` and ``dict`` as generic types instead of importing the +corresponding capitalized types (e.g. ``List`` or ``Dict``) from +``typing``. Some other types in the standard library are also now generic, +for example ``queue.Queue``. + +Example: + +.. code-block:: python + + def greet_all(names: list[str]) -> None: + for name in names: + print("Hello", name) + +See :pep:`585` for more details. (Contributed by Guido van Rossum, +Ethan Smith, and Batuhan Ta?kaya in :issue:`39481`.) + +PEP 617: New Parser +------------------- + +Python 3.9 uses a new parser, based on `PEG +`_ instead +of `LL(1) `_. The new +parser's performance is roughly comparable to that of the old parser, +but the PEG formalism is more flexible than LL(1) when it comes to +designing new language features. We'll start using this flexibility +in Python 3.10 and later. + +The :mod:`ast` module uses the new parser and produces the same AST as +the old parser. + +In Python 3.10, the old parser will be deleted and so will all +functionality that depends on it (primarily the :mod:`parser` module, +which has long been deprecated). In Python 3.9 *only*, you can switch +back to the LL(1) parser using a command line switch (``-X +oldparser``) or an environment variable (``PYTHONOLDPARSER=1``). + +See :pep:`617` for more details. (Contributed by Guido van Rossum, +Pablo Galindo and Lysandros Nikolau in :issue:`40334`.) + Other Language Changes ====================== From webhook-mailer at python.org Sat Apr 25 00:34:07 2020 From: webhook-mailer at python.org (Ammar Askar) Date: Sat, 25 Apr 2020 04:34:07 -0000 Subject: [Python-checkins] closes bpo-40385: Remove Tools/scripts/checkpyc.py (GH-19709) Message-ID: https://github.com/python/cpython/commit/f82807746d26b4c047f7f3115065f20bb63fb5ff commit: f82807746d26b4c047f7f3115065f20bb63fb5ff branch: master author: Ammar Askar committer: GitHub date: 2020-04-24T23:33:59-05:00 summary: closes bpo-40385: Remove Tools/scripts/checkpyc.py (GH-19709) This is one of the few files that has intimate knowledge of the pyc file format. Since it lacks tests it tends to become outdated fairly quickly. At present it has been broken since the introduction of PEP 552. files: A Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst D Tools/scripts/checkpyc.py M Tools/scripts/README diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst new file mode 100644 index 0000000000000..07d48fd17779e --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst @@ -0,0 +1,2 @@ +Removed the checkpyc.py tool. Please see compileall without force mode as a +potential alternative. diff --git a/Tools/scripts/README b/Tools/scripts/README index bee5b0bd9b200..7fc51a10ee902 100644 --- a/Tools/scripts/README +++ b/Tools/scripts/README @@ -7,7 +7,6 @@ abitype.py Converts a C file to use the PEP 384 type definition A analyze_dxp.py Analyzes the result of sys.getdxp() byext.py Print lines/words/chars stats of files by extension byteyears.py Print product of a file's size and age -checkpyc.py Check presence and validity of ".pyc" files cleanfuture.py Fix redundant Python __future__ statements combinerefs.py A helper for analyzing PYTHONDUMPREFS output copytime.py Copy one file's atime and mtime to another diff --git a/Tools/scripts/checkpyc.py b/Tools/scripts/checkpyc.py deleted file mode 100755 index bbaa3d1328fe5..0000000000000 --- a/Tools/scripts/checkpyc.py +++ /dev/null @@ -1,69 +0,0 @@ -#! /usr/bin/env python3 -# Check that all ".pyc" files exist and are up-to-date -# Uses module 'os' - -import sys -import os -from stat import ST_MTIME -import importlib.util - -# PEP 3147 compatibility (PYC Repository Directories) -cache_from_source = (importlib.util.cache_from_source if sys.implementation.cache_tag - else lambda path: path + 'c') - - -def main(): - if len(sys.argv) > 1: - verbose = (sys.argv[1] == '-v') - silent = (sys.argv[1] == '-s') - else: - verbose = silent = False - MAGIC = importlib.util.MAGIC_NUMBER - if not silent: - print('Using MAGIC word', repr(MAGIC)) - for dirname in sys.path: - try: - names = os.listdir(dirname) - except OSError: - print('Cannot list directory', repr(dirname)) - continue - if not silent: - print('Checking ', repr(dirname), '...') - for name in sorted(names): - if name.endswith('.py'): - name = os.path.join(dirname, name) - try: - st = os.stat(name) - except OSError: - print('Cannot stat', repr(name)) - continue - if verbose: - print('Check', repr(name), '...') - name_c = cache_from_source(name) - try: - with open(name_c, 'rb') as f: - magic_str = f.read(4) - mtime_str = f.read(4) - except IOError: - print('Cannot open', repr(name_c)) - continue - if magic_str != MAGIC: - print('Bad MAGIC word in ".pyc" file', end=' ') - print(repr(name_c)) - continue - mtime = get_long(mtime_str) - if mtime in {0, -1}: - print('Bad ".pyc" file', repr(name_c)) - elif mtime != st[ST_MTIME]: - print('Out-of-date ".pyc" file', end=' ') - print(repr(name_c)) - - -def get_long(s): - if len(s) != 4: - return -1 - return s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24) - - -if __name__ == '__main__': - main() From webhook-mailer at python.org Sat Apr 25 01:28:03 2020 From: webhook-mailer at python.org (Cajetan Rodrigues) Date: Sat, 25 Apr 2020 05:28:03 -0000 Subject: [Python-checkins] bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) Message-ID: https://github.com/python/cpython/commit/d4f3923d5901ef1ccdbe6ad6c5a753af90832a0f commit: d4f3923d5901ef1ccdbe6ad6c5a753af90832a0f branch: master author: Cajetan Rodrigues committer: GitHub date: 2020-04-25T07:27:53+02:00 summary: bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) files: M Doc/extending/extending.rst diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 5b32a2cdc5506..25dc2934d29ef 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -395,18 +395,26 @@ optionally followed by an import of the module:: } /* Add a built-in module, before Py_Initialize */ - PyImport_AppendInittab("spam", PyInit_spam); + if (PyImport_AppendInittab("spam", PyInit_spam) == -1) { + fprintf(stderr, "Error: could not extend in-built modules table\n"); + exit(1); + } /* Pass argv[0] to the Python interpreter */ Py_SetProgramName(program); - /* Initialize the Python interpreter. Required. */ + /* Initialize the Python interpreter. Required. + If this step fails, it will be a fatal error. */ Py_Initialize(); /* Optionally import the module; alternatively, import can be deferred until the embedded script imports it. */ - PyImport_ImportModule("spam"); + pmodule = PyImport_ImportModule("spam"); + if (!pmodule) { + PyErr_Print(); + fprintf(stderr, "Error: could not import module 'spam'\n"); + } ... From webhook-mailer at python.org Sat Apr 25 01:45:56 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Sat, 25 Apr 2020 05:45:56 -0000 Subject: [Python-checkins] bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) (GH-19710) Message-ID: https://github.com/python/cpython/commit/882a7f44da08c6fb210bd9a17f80903cbca84034 commit: 882a7f44da08c6fb210bd9a17f80903cbca84034 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-25T07:45:48+02:00 summary: bpo-40279: Add some error-handling to the module initialisation docs example (GH-19705) (GH-19710) (cherry picked from commit d4f3923d5901ef1ccdbe6ad6c5a753af90832a0f) Co-authored-by: Cajetan Rodrigues files: M Doc/extending/extending.rst diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index 5b32a2cdc5506..25dc2934d29ef 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -395,18 +395,26 @@ optionally followed by an import of the module:: } /* Add a built-in module, before Py_Initialize */ - PyImport_AppendInittab("spam", PyInit_spam); + if (PyImport_AppendInittab("spam", PyInit_spam) == -1) { + fprintf(stderr, "Error: could not extend in-built modules table\n"); + exit(1); + } /* Pass argv[0] to the Python interpreter */ Py_SetProgramName(program); - /* Initialize the Python interpreter. Required. */ + /* Initialize the Python interpreter. Required. + If this step fails, it will be a fatal error. */ Py_Initialize(); /* Optionally import the module; alternatively, import can be deferred until the embedded script imports it. */ - PyImport_ImportModule("spam"); + pmodule = PyImport_ImportModule("spam"); + if (!pmodule) { + PyErr_Print(); + fprintf(stderr, "Error: could not import module 'spam'\n"); + } ... From webhook-mailer at python.org Sat Apr 25 03:04:15 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 25 Apr 2020 07:04:15 -0000 Subject: [Python-checkins] bpo-40275: Avoid importing asyncio in test.support (GH-19600) Message-ID: https://github.com/python/cpython/commit/3c8a5b459d68b4337776ada1e04f5b33f90a2275 commit: 3c8a5b459d68b4337776ada1e04f5b33f90a2275 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-25T10:04:10+03:00 summary: bpo-40275: Avoid importing asyncio in test.support (GH-19600) * Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used). * Import asyncio.events lazily in test.support. files: A Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst M Lib/test/support/__init__.py M Lib/unittest/__init__.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f3868c1041542..2b3a4147246ee 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -3,7 +3,6 @@ if __name__ != 'test.support': raise ImportError('support must be imported from the test package') -import asyncio.events import collections.abc import contextlib import errno @@ -3260,6 +3259,7 @@ def __gt__(self, other): def maybe_get_event_loop_policy(): """Return the global event loop policy if one is set, else return None.""" + import asyncio.events return asyncio.events._event_loop_policy # Helpers for testing hashing. diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py index ace3a6fb1dd97..348dc471f4c3d 100644 --- a/Lib/unittest/__init__.py +++ b/Lib/unittest/__init__.py @@ -57,7 +57,6 @@ def testMultiply(self): __unittest = True from .result import TestResult -from .async_case import IsolatedAsyncioTestCase from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip, skipIf, skipUnless, expectedFailure) from .suite import BaseTestSuite, TestSuite @@ -66,6 +65,7 @@ def testMultiply(self): from .main import TestProgram, main from .runner import TextTestRunner, TextTestResult from .signals import installHandler, registerResult, removeResult, removeHandler +# IsolatedAsyncioTestCase will be imported lazily. # deprecated _TextTestResult = TextTestResult @@ -78,3 +78,18 @@ def load_tests(loader, tests, pattern): # top level directory cached on loader instance this_dir = os.path.dirname(__file__) return loader.discover(start_dir=this_dir, pattern=pattern) + + +# Lazy import of IsolatedAsyncioTestCase from .async_case +# It imports asyncio, which is relatively heavy, but most tests +# do not need it. + +def __dir__(): + return globals().keys() | {'IsolatedAsyncioTestCase'} + +def __getattr__(name): + if name == 'IsolatedAsyncioTestCase': + global IsolatedAsyncioTestCase + from .async_case import IsolatedAsyncioTestCase + return IsolatedAsyncioTestCase + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst b/Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst new file mode 100644 index 0000000000000..2093589f528b0 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst @@ -0,0 +1,2 @@ +The :mod:`asyncio` package is now imported lazily in :mod:`unittest` only +when the :class:`~unittest.IsolatedAsyncioTestCase` class is used. From webhook-mailer at python.org Sat Apr 25 03:06:34 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 25 Apr 2020 07:06:34 -0000 Subject: [Python-checkins] bpo-40275: Avoid importing socket in test.support (GH-19603) Message-ID: https://github.com/python/cpython/commit/16994912c93e8e5db7365d48b75d67d3f70dd7b2 commit: 16994912c93e8e5db7365d48b75d67d3f70dd7b2 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-25T10:06:29+03:00 summary: bpo-40275: Avoid importing socket in test.support (GH-19603) * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess. files: A Lib/test/support/socket_helper.py M Doc/library/test.rst M Lib/test/_test_multiprocessing.py M Lib/test/eintrdata/eintr_tester.py M Lib/test/ssl_servers.py M Lib/test/support/__init__.py M Lib/test/test_asynchat.py M Lib/test/test_asyncio/test_base_events.py M Lib/test/test_asyncio/test_events.py M Lib/test/test_asyncio/test_proactor_events.py M Lib/test/test_asyncio/test_sendfile.py M Lib/test/test_asyncio/test_server.py M Lib/test/test_asyncio/test_sock_lowlevel.py M Lib/test/test_asyncio/test_streams.py M Lib/test/test_asyncio/test_unix_events.py M Lib/test/test_asyncore.py M Lib/test/test_ftplib.py M Lib/test/test_httplib.py M Lib/test/test_imaplib.py M Lib/test/test_largefile.py M Lib/test/test_logging.py M Lib/test/test_nntplib.py M Lib/test/test_os.py M Lib/test/test_poplib.py M Lib/test/test_robotparser.py M Lib/test/test_selectors.py M Lib/test/test_smtpd.py M Lib/test/test_smtplib.py M Lib/test/test_socket.py M Lib/test/test_socketserver.py M Lib/test/test_ssl.py M Lib/test/test_stat.py M Lib/test/test_support.py M Lib/test/test_telnetlib.py M Lib/test/test_timeout.py M Lib/test/test_wsgiref.py M Lib/test/test_xmlrpc.py diff --git a/Doc/library/test.rst b/Doc/library/test.rst index 0573c275981c7..1e6b1116212ef 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -348,11 +348,6 @@ The :mod:`test.support` module defines the following constants: :data:`SHORT_TIMEOUT`. -.. data:: IPV6_ENABLED - - Set to ``True`` if IPV6 is enabled on this host, ``False`` otherwise. - - .. data:: SAVEDCWD Set to :func:`os.getcwd`. @@ -901,12 +896,6 @@ The :mod:`test.support` module defines the following functions: A decorator for running tests that require support for xattr. -.. decorator:: skip_unless_bind_unix_socket - - A decorator for running tests that require a functional bind() for Unix - sockets. - - .. decorator:: anticipate_failure(condition) A decorator to conditionally mark tests with @@ -1157,31 +1146,6 @@ The :mod:`test.support` module defines the following functions: is raised. -.. function:: bind_port(sock, host=HOST) - - Bind the socket to a free port and return the port number. Relies on - ephemeral ports in order to ensure we are using an unbound port. This is - important as many tests may be running simultaneously, especially in a - buildbot environment. This method raises an exception if the - ``sock.family`` is :const:`~socket.AF_INET` and ``sock.type`` is - :const:`~socket.SOCK_STREAM`, and the socket has - :const:`~socket.SO_REUSEADDR` or :const:`~socket.SO_REUSEPORT` set on it. - Tests should never set these socket options for TCP/IP sockets. - The only case for setting these options is testing multicasting via - multiple UDP sockets. - - Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is - available (i.e. on Windows), it will be set on the socket. This will - prevent anyone else from binding to our host/port for the duration of the - test. - - -.. function:: bind_unix_socket(sock, addr) - - Bind a unix socket, raising :exc:`unittest.SkipTest` if - :exc:`PermissionError` is raised. - - .. function:: catch_threading_exception() Context manager catching :class:`threading.Thread` exception using @@ -1243,29 +1207,6 @@ The :mod:`test.support` module defines the following functions: .. versionadded:: 3.8 -.. function:: find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM) - - Returns an unused port that should be suitable for binding. This is - achieved by creating a temporary socket with the same family and type as - the ``sock`` parameter (default is :const:`~socket.AF_INET`, - :const:`~socket.SOCK_STREAM`), - and binding it to the specified host address (defaults to ``0.0.0.0``) - with the port set to 0, eliciting an unused ephemeral port from the OS. - The temporary socket is then closed and deleted, and the ephemeral port is - returned. - - Either this method or :func:`bind_port` should be used for any tests - where a server socket needs to be bound to a particular port for the - duration of the test. - Which one to use depends on whether the calling code is creating a Python - socket, or if an unused port needs to be provided in a constructor - or passed to an external program (i.e. the ``-accept`` argument to - openssl's s_server mode). Always prefer :func:`bind_port` over - :func:`find_unused_port` where possible. Using a hard coded port is - discouraged since it can make multiple instances of the test impossible to - run simultaneously, which is a problem for buildbots. - - .. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern) Generic implementation of the :mod:`unittest` ``load_tests`` protocol for @@ -1481,6 +1422,77 @@ The :mod:`test.support` module defines the following classes: it will be raised in :meth:`!__fspath__`. +:mod:`test.support.socket_helper` --- Utilities for socket tests +================================================================ + +.. module:: test.support.socket_helper + :synopsis: Support for socket tests. + + +The :mod:`test.support.socket_helper` module provides support for socket tests. + +.. versionadded:: 3.9 + + +.. data:: IPV6_ENABLED + + Set to ``True`` if IPv6 is enabled on this host, ``False`` otherwise. + + +.. function:: find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM) + + Returns an unused port that should be suitable for binding. This is + achieved by creating a temporary socket with the same family and type as + the ``sock`` parameter (default is :const:`~socket.AF_INET`, + :const:`~socket.SOCK_STREAM`), + and binding it to the specified host address (defaults to ``0.0.0.0``) + with the port set to 0, eliciting an unused ephemeral port from the OS. + The temporary socket is then closed and deleted, and the ephemeral port is + returned. + + Either this method or :func:`bind_port` should be used for any tests + where a server socket needs to be bound to a particular port for the + duration of the test. + Which one to use depends on whether the calling code is creating a Python + socket, or if an unused port needs to be provided in a constructor + or passed to an external program (i.e. the ``-accept`` argument to + openssl's s_server mode). Always prefer :func:`bind_port` over + :func:`find_unused_port` where possible. Using a hard coded port is + discouraged since it can make multiple instances of the test impossible to + run simultaneously, which is a problem for buildbots. + + +.. function:: bind_port(sock, host=HOST) + + Bind the socket to a free port and return the port number. Relies on + ephemeral ports in order to ensure we are using an unbound port. This is + important as many tests may be running simultaneously, especially in a + buildbot environment. This method raises an exception if the + ``sock.family`` is :const:`~socket.AF_INET` and ``sock.type`` is + :const:`~socket.SOCK_STREAM`, and the socket has + :const:`~socket.SO_REUSEADDR` or :const:`~socket.SO_REUSEPORT` set on it. + Tests should never set these socket options for TCP/IP sockets. + The only case for setting these options is testing multicasting via + multiple UDP sockets. + + Additionally, if the :const:`~socket.SO_EXCLUSIVEADDRUSE` socket option is + available (i.e. on Windows), it will be set on the socket. This will + prevent anyone else from binding to our host/port for the duration of the + test. + + +.. function:: bind_unix_socket(sock, addr) + + Bind a unix socket, raising :exc:`unittest.SkipTest` if + :exc:`PermissionError` is raised. + + +.. decorator:: skip_unless_bind_unix_socket + + A decorator for running tests that require a functional ``bind()`` for Unix + sockets. + + :mod:`test.support.script_helper` --- Utilities for the Python execution tests ============================================================================== diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 376f5e33466a4..083ad536a051c 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -26,6 +26,7 @@ import test.support import test.support.script_helper from test import support +from test.support import socket_helper # Skip tests if _multiprocessing wasn't built. @@ -2928,7 +2929,7 @@ def test_remote(self): authkey = os.urandom(32) manager = QueueManager( - address=(test.support.HOST, 0), authkey=authkey, serializer=SERIALIZER + address=(socket_helper.HOST, 0), authkey=authkey, serializer=SERIALIZER ) manager.start() self.addCleanup(manager.shutdown) @@ -2965,7 +2966,7 @@ def _putter(cls, address, authkey): def test_rapid_restart(self): authkey = os.urandom(32) manager = QueueManager( - address=(test.support.HOST, 0), authkey=authkey, serializer=SERIALIZER) + address=(socket_helper.HOST, 0), authkey=authkey, serializer=SERIALIZER) try: srvr = manager.get_server() addr = srvr.address @@ -3455,7 +3456,7 @@ def _listener(cls, conn, families): new_conn.close() l.close() - l = socket.create_server((test.support.HOST, 0)) + l = socket.create_server((socket_helper.HOST, 0)) conn.send(l.getsockname()) new_conn, addr = l.accept() conn.send(new_conn) @@ -4593,7 +4594,7 @@ def _child_test_wait_socket(cls, address, slow): def test_wait_socket(self, slow=False): from multiprocessing.connection import wait - l = socket.create_server((test.support.HOST, 0)) + l = socket.create_server((socket_helper.HOST, 0)) addr = l.getsockname() readers = [] procs = [] diff --git a/Lib/test/eintrdata/eintr_tester.py b/Lib/test/eintrdata/eintr_tester.py index 4e0e30596f5a0..606f31b091096 100644 --- a/Lib/test/eintrdata/eintr_tester.py +++ b/Lib/test/eintrdata/eintr_tester.py @@ -22,6 +22,7 @@ import unittest from test import support +from test.support import socket_helper @contextlib.contextmanager def kill_on_error(proc): @@ -283,14 +284,14 @@ def test_sendmsg(self): self._test_send(lambda sock, data: sock.sendmsg([data])) def test_accept(self): - sock = socket.create_server((support.HOST, 0)) + sock = socket.create_server((socket_helper.HOST, 0)) self.addCleanup(sock.close) port = sock.getsockname()[1] code = '\n'.join(( 'import socket, time', '', - 'host = %r' % support.HOST, + 'host = %r' % socket_helper.HOST, 'port = %s' % port, 'sleep_time = %r' % self.sleep_time, '', diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py index 2e7e2359f565b..a4bd7455d47e7 100644 --- a/Lib/test/ssl_servers.py +++ b/Lib/test/ssl_servers.py @@ -9,10 +9,11 @@ SimpleHTTPRequestHandler, BaseHTTPRequestHandler) from test import support +from test.support import socket_helper here = os.path.dirname(__file__) -HOST = support.HOST +HOST = socket_helper.HOST CERTFILE = os.path.join(here, 'keycert.pem') # This one's based on HTTPServer, which is based on socketserver diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 2b3a4147246ee..15cf45da18e2c 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -16,12 +16,10 @@ import importlib.util import locale import logging.handlers -import nntplib import os import platform import re import shutil -import socket import stat import struct import subprocess @@ -33,16 +31,10 @@ import time import types import unittest -import urllib.error import warnings from .testresult import get_test_runner -try: - import multiprocessing.process -except ImportError: - multiprocessing = None - try: import zlib except ImportError: @@ -98,14 +90,13 @@ "bigmemtest", "bigaddrspacetest", "cpython_only", "get_attribute", "requires_IEEE_754", "skip_unless_xattr", "requires_zlib", "anticipate_failure", "load_package_tests", "detect_api_mismatch", - "check__all__", "skip_unless_bind_unix_socket", "skip_if_buggy_ucrt_strfptime", + "check__all__", "skip_if_buggy_ucrt_strfptime", "ignore_warnings", # sys "is_jython", "is_android", "check_impl_detail", "unix_shell", "setswitchinterval", # network - "HOST", "IPV6_ENABLED", "find_unused_port", "bind_port", "open_urlresource", - "bind_unix_socket", + "open_urlresource", # processes 'temp_umask', "reap_children", # logging @@ -727,135 +718,6 @@ def wrapper(*args, **kwargs): return decorator -HOST = "localhost" -HOSTv4 = "127.0.0.1" -HOSTv6 = "::1" - - -def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM): - """Returns an unused port that should be suitable for binding. This is - achieved by creating a temporary socket with the same family and type as - the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to - the specified host address (defaults to 0.0.0.0) with the port set to 0, - eliciting an unused ephemeral port from the OS. The temporary socket is - then closed and deleted, and the ephemeral port is returned. - - Either this method or bind_port() should be used for any tests where a - server socket needs to be bound to a particular port for the duration of - the test. Which one to use depends on whether the calling code is creating - a python socket, or if an unused port needs to be provided in a constructor - or passed to an external program (i.e. the -accept argument to openssl's - s_server mode). Always prefer bind_port() over find_unused_port() where - possible. Hard coded ports should *NEVER* be used. As soon as a server - socket is bound to a hard coded port, the ability to run multiple instances - of the test simultaneously on the same host is compromised, which makes the - test a ticking time bomb in a buildbot environment. On Unix buildbots, this - may simply manifest as a failed test, which can be recovered from without - intervention in most cases, but on Windows, the entire python process can - completely and utterly wedge, requiring someone to log in to the buildbot - and manually kill the affected process. - - (This is easy to reproduce on Windows, unfortunately, and can be traced to - the SO_REUSEADDR socket option having different semantics on Windows versus - Unix/Linux. On Unix, you can't have two AF_INET SOCK_STREAM sockets bind, - listen and then accept connections on identical host/ports. An EADDRINUSE - OSError will be raised at some point (depending on the platform and - the order bind and listen were called on each socket). - - However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE - will ever be raised when attempting to bind two identical host/ports. When - accept() is called on each socket, the second caller's process will steal - the port from the first caller, leaving them both in an awkwardly wedged - state where they'll no longer respond to any signals or graceful kills, and - must be forcibly killed via OpenProcess()/TerminateProcess(). - - The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option - instead of SO_REUSEADDR, which effectively affords the same semantics as - SO_REUSEADDR on Unix. Given the propensity of Unix developers in the Open - Source world compared to Windows ones, this is a common mistake. A quick - look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when - openssl.exe is called with the 's_server' option, for example. See - http://bugs.python.org/issue2550 for more info. The following site also - has a very thorough description about the implications of both REUSEADDR - and EXCLUSIVEADDRUSE on Windows: - http://msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspx) - - XXX: although this approach is a vast improvement on previous attempts to - elicit unused ports, it rests heavily on the assumption that the ephemeral - port returned to us by the OS won't immediately be dished back out to some - other process when we close and delete our temporary socket but before our - calling code has a chance to bind the returned port. We can deal with this - issue if/when we come across it. - """ - - with socket.socket(family, socktype) as tempsock: - port = bind_port(tempsock) - del tempsock - return port - -def bind_port(sock, host=HOST): - """Bind the socket to a free port and return the port number. Relies on - ephemeral ports in order to ensure we are using an unbound port. This is - important as many tests may be running simultaneously, especially in a - buildbot environment. This method raises an exception if the sock.family - is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR - or SO_REUSEPORT set on it. Tests should *never* set these socket options - for TCP/IP sockets. The only case for setting these options is testing - multicasting via multiple UDP sockets. - - Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e. - on Windows), it will be set on the socket. This will prevent anyone else - from bind()'ing to our host/port for the duration of the test. - """ - - if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: - if hasattr(socket, 'SO_REUSEADDR'): - if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: - raise TestFailed("tests should never set the SO_REUSEADDR " \ - "socket option on TCP/IP sockets!") - if hasattr(socket, 'SO_REUSEPORT'): - try: - if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: - raise TestFailed("tests should never set the SO_REUSEPORT " \ - "socket option on TCP/IP sockets!") - except OSError: - # Python's socket module was compiled using modern headers - # thus defining SO_REUSEPORT but this process is running - # under an older kernel that does not support SO_REUSEPORT. - pass - if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'): - sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1) - - sock.bind((host, 0)) - port = sock.getsockname()[1] - return port - -def bind_unix_socket(sock, addr): - """Bind a unix socket, raising SkipTest if PermissionError is raised.""" - assert sock.family == socket.AF_UNIX - try: - sock.bind(addr) - except PermissionError: - sock.close() - raise unittest.SkipTest('cannot bind AF_UNIX sockets') - -def _is_ipv6_enabled(): - """Check whether IPv6 is enabled on this host.""" - if socket.has_ipv6: - sock = None - try: - sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) - sock.bind((HOSTv6, 0)) - return True - except OSError: - pass - finally: - if sock: - sock.close() - return False - -IPV6_ENABLED = _is_ipv6_enabled() - def system_must_validate_cert(f): """Skip the test on TLS certificate validation failures.""" @functools.wraps(f) @@ -1563,31 +1425,13 @@ def __exit__(self, type_=None, value=None, traceback=None): ioerror_peer_reset = TransientResource(OSError, errno=errno.ECONNRESET) -def get_socket_conn_refused_errs(): - """ - Get the different socket error numbers ('errno') which can be received - when a connection is refused. - """ - errors = [errno.ECONNREFUSED] - if hasattr(errno, 'ENETUNREACH'): - # On Solaris, ENETUNREACH is returned sometimes instead of ECONNREFUSED - errors.append(errno.ENETUNREACH) - if hasattr(errno, 'EADDRNOTAVAIL'): - # bpo-31910: socket.create_connection() fails randomly - # with EADDRNOTAVAIL on Travis CI - errors.append(errno.EADDRNOTAVAIL) - if hasattr(errno, 'EHOSTUNREACH'): - # bpo-37583: The destination host cannot be reached - errors.append(errno.EHOSTUNREACH) - if not IPV6_ENABLED: - errors.append(errno.EAFNOSUPPORT) - return errors - - @contextlib.contextmanager def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()): """Return a context manager that raises ResourceDenied when various issues with the Internet connection manifest themselves as exceptions.""" + import socket + import nntplib + import urllib.error if timeout is _NOT_SET: timeout = INTERNET_TIMEOUT @@ -2754,28 +2598,6 @@ def skip_if_pgo_task(test): msg = "Not run for (non-extended) PGO task" return test if ok else unittest.skip(msg)(test) -_bind_nix_socket_error = None -def skip_unless_bind_unix_socket(test): - """Decorator for tests requiring a functional bind() for unix sockets.""" - if not hasattr(socket, 'AF_UNIX'): - return unittest.skip('No UNIX Sockets')(test) - global _bind_nix_socket_error - if _bind_nix_socket_error is None: - path = TESTFN + "can_bind_unix_socket" - with socket.socket(socket.AF_UNIX) as sock: - try: - sock.bind(path) - _bind_nix_socket_error = False - except OSError as e: - _bind_nix_socket_error = e - finally: - unlink(path) - if _bind_nix_socket_error: - msg = 'Requires a functional unix bind(): %s' % _bind_nix_socket_error - return unittest.skip(msg)(test) - else: - return test - def fs_is_case_insensitive(directory): """Detects if the file system for the specified directory is case-insensitive.""" diff --git a/Lib/test/support/socket_helper.py b/Lib/test/support/socket_helper.py new file mode 100644 index 0000000000000..5f4a7f19a3223 --- /dev/null +++ b/Lib/test/support/socket_helper.py @@ -0,0 +1,177 @@ +import errno +import socket +import unittest + +HOST = "localhost" +HOSTv4 = "127.0.0.1" +HOSTv6 = "::1" + + +def find_unused_port(family=socket.AF_INET, socktype=socket.SOCK_STREAM): + """Returns an unused port that should be suitable for binding. This is + achieved by creating a temporary socket with the same family and type as + the 'sock' parameter (default is AF_INET, SOCK_STREAM), and binding it to + the specified host address (defaults to 0.0.0.0) with the port set to 0, + eliciting an unused ephemeral port from the OS. The temporary socket is + then closed and deleted, and the ephemeral port is returned. + + Either this method or bind_port() should be used for any tests where a + server socket needs to be bound to a particular port for the duration of + the test. Which one to use depends on whether the calling code is creating + a python socket, or if an unused port needs to be provided in a constructor + or passed to an external program (i.e. the -accept argument to openssl's + s_server mode). Always prefer bind_port() over find_unused_port() where + possible. Hard coded ports should *NEVER* be used. As soon as a server + socket is bound to a hard coded port, the ability to run multiple instances + of the test simultaneously on the same host is compromised, which makes the + test a ticking time bomb in a buildbot environment. On Unix buildbots, this + may simply manifest as a failed test, which can be recovered from without + intervention in most cases, but on Windows, the entire python process can + completely and utterly wedge, requiring someone to log in to the buildbot + and manually kill the affected process. + + (This is easy to reproduce on Windows, unfortunately, and can be traced to + the SO_REUSEADDR socket option having different semantics on Windows versus + Unix/Linux. On Unix, you can't have two AF_INET SOCK_STREAM sockets bind, + listen and then accept connections on identical host/ports. An EADDRINUSE + OSError will be raised at some point (depending on the platform and + the order bind and listen were called on each socket). + + However, on Windows, if SO_REUSEADDR is set on the sockets, no EADDRINUSE + will ever be raised when attempting to bind two identical host/ports. When + accept() is called on each socket, the second caller's process will steal + the port from the first caller, leaving them both in an awkwardly wedged + state where they'll no longer respond to any signals or graceful kills, and + must be forcibly killed via OpenProcess()/TerminateProcess(). + + The solution on Windows is to use the SO_EXCLUSIVEADDRUSE socket option + instead of SO_REUSEADDR, which effectively affords the same semantics as + SO_REUSEADDR on Unix. Given the propensity of Unix developers in the Open + Source world compared to Windows ones, this is a common mistake. A quick + look over OpenSSL's 0.9.8g source shows that they use SO_REUSEADDR when + openssl.exe is called with the 's_server' option, for example. See + http://bugs.python.org/issue2550 for more info. The following site also + has a very thorough description about the implications of both REUSEADDR + and EXCLUSIVEADDRUSE on Windows: + http://msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspx) + + XXX: although this approach is a vast improvement on previous attempts to + elicit unused ports, it rests heavily on the assumption that the ephemeral + port returned to us by the OS won't immediately be dished back out to some + other process when we close and delete our temporary socket but before our + calling code has a chance to bind the returned port. We can deal with this + issue if/when we come across it. + """ + + with socket.socket(family, socktype) as tempsock: + port = bind_port(tempsock) + del tempsock + return port + +def bind_port(sock, host=HOST): + """Bind the socket to a free port and return the port number. Relies on + ephemeral ports in order to ensure we are using an unbound port. This is + important as many tests may be running simultaneously, especially in a + buildbot environment. This method raises an exception if the sock.family + is AF_INET and sock.type is SOCK_STREAM, *and* the socket has SO_REUSEADDR + or SO_REUSEPORT set on it. Tests should *never* set these socket options + for TCP/IP sockets. The only case for setting these options is testing + multicasting via multiple UDP sockets. + + Additionally, if the SO_EXCLUSIVEADDRUSE socket option is available (i.e. + on Windows), it will be set on the socket. This will prevent anyone else + from bind()'ing to our host/port for the duration of the test. + """ + + if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: + if hasattr(socket, 'SO_REUSEADDR'): + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: + raise TestFailed("tests should never set the SO_REUSEADDR " \ + "socket option on TCP/IP sockets!") + if hasattr(socket, 'SO_REUSEPORT'): + try: + if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: + raise TestFailed("tests should never set the SO_REUSEPORT " \ + "socket option on TCP/IP sockets!") + except OSError: + # Python's socket module was compiled using modern headers + # thus defining SO_REUSEPORT but this process is running + # under an older kernel that does not support SO_REUSEPORT. + pass + if hasattr(socket, 'SO_EXCLUSIVEADDRUSE'): + sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1) + + sock.bind((host, 0)) + port = sock.getsockname()[1] + return port + +def bind_unix_socket(sock, addr): + """Bind a unix socket, raising SkipTest if PermissionError is raised.""" + assert sock.family == socket.AF_UNIX + try: + sock.bind(addr) + except PermissionError: + sock.close() + raise unittest.SkipTest('cannot bind AF_UNIX sockets') + +def _is_ipv6_enabled(): + """Check whether IPv6 is enabled on this host.""" + if socket.has_ipv6: + sock = None + try: + sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) + sock.bind((HOSTv6, 0)) + return True + except OSError: + pass + finally: + if sock: + sock.close() + return False + +IPV6_ENABLED = _is_ipv6_enabled() + + +_bind_nix_socket_error = None +def skip_unless_bind_unix_socket(test): + """Decorator for tests requiring a functional bind() for unix sockets.""" + if not hasattr(socket, 'AF_UNIX'): + return unittest.skip('No UNIX Sockets')(test) + global _bind_nix_socket_error + if _bind_nix_socket_error is None: + from test.support import TESTFN, unlink + path = TESTFN + "can_bind_unix_socket" + with socket.socket(socket.AF_UNIX) as sock: + try: + sock.bind(path) + _bind_nix_socket_error = False + except OSError as e: + _bind_nix_socket_error = e + finally: + unlink(path) + if _bind_nix_socket_error: + msg = 'Requires a functional unix bind(): %s' % _bind_nix_socket_error + return unittest.skip(msg)(test) + else: + return test + + +def get_socket_conn_refused_errs(): + """ + Get the different socket error numbers ('errno') which can be received + when a connection is refused. + """ + errors = [errno.ECONNREFUSED] + if hasattr(errno, 'ENETUNREACH'): + # On Solaris, ENETUNREACH is returned sometimes instead of ECONNREFUSED + errors.append(errno.ENETUNREACH) + if hasattr(errno, 'EADDRNOTAVAIL'): + # bpo-31910: socket.create_connection() fails randomly + # with EADDRNOTAVAIL on Travis CI + errors.append(errno.EADDRNOTAVAIL) + if hasattr(errno, 'EHOSTUNREACH'): + # bpo-37583: The destination host cannot be reached + errors.append(errno.EHOSTUNREACH) + if not IPV6_ENABLED: + errors.append(errno.EAFNOSUPPORT) + return errors diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index ce8505777a2ef..004d368d76312 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -1,6 +1,7 @@ # test asynchat from test import support +from test.support import socket_helper import asynchat import asyncore @@ -12,7 +13,7 @@ import unittest import unittest.mock -HOST = support.HOST +HOST = socket_helper.HOST SERVER_QUIT = b'QUIT\n' @@ -25,7 +26,7 @@ def __init__(self, event): threading.Thread.__init__(self) self.event = event self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.port = support.bind_port(self.sock) + self.port = socket_helper.bind_port(self.sock) # This will be set if the client wants us to wait before echoing # data back. self.start_resend_event = None diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index fc832d3467131..4adcbf46cc9eb 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -17,6 +17,7 @@ from test.test_asyncio import utils as test_utils from test import support from test.support.script_helper import assert_python_ok +from test.support import socket_helper MOCK_ANY = mock.ANY @@ -91,7 +92,7 @@ def test_ipaddr_info(self): self.assertIsNone( base_events._ipaddr_info('1.2.3.4', 1, UNSPEC, 0, 0)) - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: # IPv4 address with family IPv6. self.assertIsNone( base_events._ipaddr_info('1.2.3.4', 1, INET6, STREAM, TCP)) @@ -1156,7 +1157,7 @@ def test_create_server_stream_bittype(self): srv.close() self.loop.run_until_complete(srv.wait_closed()) - @unittest.skipUnless(support.IPV6_ENABLED, 'no IPv6 support') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'no IPv6 support') def test_create_server_ipv6(self): async def main(): with self.assertWarns(DeprecationWarning): @@ -1288,7 +1289,7 @@ def _test_create_connection_ip_addr(self, m_socket, allow_inet_pton): t.close() test_utils.run_briefly(self.loop) # allow transport to close - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: sock.family = socket.AF_INET6 coro = self.loop.create_connection(asyncio.Protocol, '::1', 80) t, p = self.loop.run_until_complete(coro) @@ -1307,7 +1308,7 @@ def _test_create_connection_ip_addr(self, m_socket, allow_inet_pton): t.close() test_utils.run_briefly(self.loop) # allow transport to close - @unittest.skipUnless(support.IPV6_ENABLED, 'no IPv6 support') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'no IPv6 support') @unittest.skipIf(sys.platform.startswith('aix'), "bpo-25545: IPv6 scope id and getaddrinfo() behave differently on AIX") @patch_socket @@ -1639,7 +1640,7 @@ def test_create_datagram_endpoint_socket_err(self, m_socket): self.assertRaises( OSError, self.loop.run_until_complete, coro) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 not supported or enabled') def test_create_datagram_endpoint_no_matching_family(self): coro = self.loop.create_datagram_endpoint( asyncio.DatagramProtocol, @@ -1700,7 +1701,7 @@ def test_create_datagram_endpoint_sock_unix(self): self.loop.run_until_complete(protocol.done) self.assertEqual('CLOSED', protocol.state) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_create_datagram_endpoint_existing_sock_unix(self): with test_utils.unix_socket_path() as path: sock = socket.socket(socket.AF_UNIX, type=socket.SOCK_DGRAM) @@ -2015,7 +2016,7 @@ def prepare(self): sock = self.make_socket() proto = self.MyProto(self.loop) server = self.run_loop(self.loop.create_server( - lambda: proto, support.HOST, 0, family=socket.AF_INET)) + lambda: proto, socket_helper.HOST, 0, family=socket.AF_INET)) addr = server.sockets[0].getsockname() for _ in range(10): diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 1f71c1f0979e0..aa4daca0e4e03 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -32,6 +32,7 @@ from asyncio import selector_events from test.test_asyncio import utils as test_utils from test import support +from test.support import socket_helper from test.support import ALWAYS_EQ, LARGEST, SMALLEST @@ -517,7 +518,7 @@ def test_create_connection(self): lambda: MyProto(loop=self.loop), *httpd.address) self._basetest_create_connection(conn_fut) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_create_unix_connection(self): # Issue #20682: On Mac OS X Tiger, getsockname() returns a # zero-length address for UNIX socket. @@ -619,7 +620,7 @@ def test_create_ssl_connection(self): self._test_create_ssl_connection(httpd, create_connection, peername=httpd.address) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket @unittest.skipIf(ssl is None, 'No ssl module') def test_create_ssl_unix_connection(self): # Issue #20682: On Mac OS X Tiger, getsockname() returns a @@ -638,7 +639,7 @@ def test_create_ssl_unix_connection(self): def test_create_connection_local_addr(self): with test_utils.run_test_server() as httpd: - port = support.find_unused_port() + port = socket_helper.find_unused_port() f = self.loop.create_connection( lambda: MyProto(loop=self.loop), *httpd.address, local_addr=(httpd.address[0], port)) @@ -843,7 +844,7 @@ def _make_unix_server(self, factory, **kwargs): return server, path - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_create_unix_server(self): proto = MyProto(loop=self.loop) server, path = self._make_unix_server(lambda: proto) @@ -935,7 +936,7 @@ def test_create_server_ssl(self): # stop serving server.close() - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket @unittest.skipIf(ssl is None, 'No ssl module') def test_create_unix_server_ssl(self): proto = MyProto(loop=self.loop) @@ -995,7 +996,7 @@ def test_create_server_ssl_verify_failed(self): self.assertIsNone(proto.transport) server.close() - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket @unittest.skipIf(ssl is None, 'No ssl module') def test_create_unix_server_ssl_verify_failed(self): proto = MyProto(loop=self.loop) @@ -1055,7 +1056,7 @@ def test_create_server_ssl_match_failed(self): self.assertIsNone(proto.transport) server.close() - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket @unittest.skipIf(ssl is None, 'No ssl module') def test_create_unix_server_ssl_verified(self): proto = MyProto(loop=self.loop) @@ -1148,7 +1149,7 @@ def test_create_server_addr_in_use(self): server.close() - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 not supported or enabled') def test_create_server_dual_stack(self): f_proto = self.loop.create_future() @@ -1160,7 +1161,7 @@ def connection_made(self, transport): try_count = 0 while True: try: - port = support.find_unused_port() + port = socket_helper.find_unused_port() f = self.loop.create_server(TestMyProto, host=None, port=port) server = self.loop.run_until_complete(f) except OSError as ex: diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 007039a7cdf5d..b5d1df93efd65 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -13,6 +13,7 @@ from asyncio.proactor_events import _ProactorDuplexPipeTransport from asyncio.proactor_events import _ProactorDatagramTransport from test import support +from test.support import socket_helper from test.test_asyncio import utils as test_utils @@ -950,7 +951,7 @@ def run_loop(self, coro): def prepare(self): sock = self.make_socket() proto = self.MyProto(self.loop) - port = support.find_unused_port() + port = socket_helper.find_unused_port() srv_sock = self.make_socket(cleanup=False) srv_sock.bind(('127.0.0.1', port)) server = self.run_loop(self.loop.create_server( diff --git a/Lib/test/test_asyncio/test_sendfile.py b/Lib/test/test_asyncio/test_sendfile.py index 3b7f784c5ee3a..dbce199a9b8e1 100644 --- a/Lib/test/test_asyncio/test_sendfile.py +++ b/Lib/test/test_asyncio/test_sendfile.py @@ -10,6 +10,7 @@ from asyncio import constants from unittest import mock from test import support +from test.support import socket_helper from test.test_asyncio import utils as test_utils try: @@ -163,9 +164,9 @@ def reduce_send_buffer_size(self, sock, transport=None): def prepare_socksendfile(self): proto = MyProto(self.loop) - port = support.find_unused_port() + port = socket_helper.find_unused_port() srv_sock = self.make_socket(cleanup=False) - srv_sock.bind((support.HOST, port)) + srv_sock.bind((socket_helper.HOST, port)) server = self.run_loop(self.loop.create_server( lambda: proto, sock=srv_sock)) self.reduce_receive_buffer_size(srv_sock) @@ -240,7 +241,7 @@ class SendfileMixin(SendfileBase): # Note: sendfile via SSL transport is equal to sendfile fallback def prepare_sendfile(self, *, is_ssl=False, close_after=0): - port = support.find_unused_port() + port = socket_helper.find_unused_port() srv_proto = MySendfileProto(loop=self.loop, close_after=close_after) if is_ssl: @@ -252,17 +253,17 @@ def prepare_sendfile(self, *, is_ssl=False, close_after=0): srv_ctx = None cli_ctx = None srv_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - srv_sock.bind((support.HOST, port)) + srv_sock.bind((socket_helper.HOST, port)) server = self.run_loop(self.loop.create_server( lambda: srv_proto, sock=srv_sock, ssl=srv_ctx)) self.reduce_receive_buffer_size(srv_sock) if is_ssl: - server_hostname = support.HOST + server_hostname = socket_helper.HOST else: server_hostname = None cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - cli_sock.connect((support.HOST, port)) + cli_sock.connect((socket_helper.HOST, port)) cli_proto = MySendfileProto(loop=self.loop) tr, pr = self.run_loop(self.loop.create_connection( diff --git a/Lib/test/test_asyncio/test_server.py b/Lib/test/test_asyncio/test_server.py index d47ccc027677b..006ead29562cf 100644 --- a/Lib/test/test_asyncio/test_server.py +++ b/Lib/test/test_asyncio/test_server.py @@ -4,6 +4,7 @@ import unittest from test import support +from test.support import socket_helper from test.test_asyncio import utils as test_utils from test.test_asyncio import functional as func_tests @@ -47,7 +48,7 @@ async def main(srv): with self.assertWarns(DeprecationWarning): srv = self.loop.run_until_complete(asyncio.start_server( - serve, support.HOSTv4, 0, loop=self.loop, start_serving=False)) + serve, socket_helper.HOSTv4, 0, loop=self.loop, start_serving=False)) self.assertFalse(srv.is_serving()) @@ -73,7 +74,7 @@ class SelectorStartServerTests(BaseStartServer, unittest.TestCase): def new_loop(self): return asyncio.SelectorEventLoop() - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_start_unix_server_1(self): HELLO_MSG = b'1' * 1024 * 5 + b'\n' started = threading.Event() diff --git a/Lib/test/test_asyncio/test_sock_lowlevel.py b/Lib/test/test_asyncio/test_sock_lowlevel.py index 89c2af9f5ec08..2f2d5a454973b 100644 --- a/Lib/test/test_asyncio/test_sock_lowlevel.py +++ b/Lib/test/test_asyncio/test_sock_lowlevel.py @@ -5,6 +5,7 @@ from itertools import cycle, islice from test.test_asyncio import utils as test_utils from test import support +from test.support import socket_helper class MyProto(asyncio.Protocol): @@ -225,7 +226,7 @@ def test_huge_content_recvinto(self): self.loop.run_until_complete( self._basetest_huge_content_recvinto(httpd.address)) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_unix_sock_client_ops(self): with test_utils.run_test_unix_server() as httpd: sock = socket.socket(socket.AF_UNIX) diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index 12bd536911dbb..1e9d115661d08 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -9,7 +9,7 @@ import threading import unittest from unittest import mock -from test import support +from test.support import socket_helper try: import ssl except ImportError: @@ -66,7 +66,7 @@ def test_open_connection(self): loop=self.loop) self._basetest_open_connection(conn_fut) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_open_unix_connection(self): with test_utils.run_test_unix_server() as httpd: conn_fut = asyncio.open_unix_connection(httpd.address, @@ -99,7 +99,7 @@ def test_open_connection_no_loop_ssl(self): self._basetest_open_connection_no_loop_ssl(conn_fut) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket @unittest.skipIf(ssl is None, 'No ssl module') def test_open_unix_connection_no_loop_ssl(self): with test_utils.run_test_unix_server(use_ssl=True) as httpd: @@ -130,7 +130,7 @@ def test_open_connection_error(self): loop=self.loop) self._basetest_open_connection_error(conn_fut) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_open_unix_connection_error(self): with test_utils.run_test_unix_server() as httpd: conn_fut = asyncio.open_unix_connection(httpd.address, @@ -653,7 +653,7 @@ async def client(addr): self.assertEqual(messages, []) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_start_unix_server(self): class MyServer: diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index 5487b7afef832..10bd46dea1991 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -15,6 +15,7 @@ import unittest from unittest import mock from test import support +from test.support import socket_helper if sys.platform == 'win32': raise unittest.SkipTest('UNIX only') @@ -273,7 +274,7 @@ def setUp(self): self.loop = asyncio.SelectorEventLoop() self.set_event_loop(self.loop) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_create_unix_server_existing_path_sock(self): with test_utils.unix_socket_path() as path: sock = socket.socket(socket.AF_UNIX) @@ -286,7 +287,7 @@ def test_create_unix_server_existing_path_sock(self): srv.close() self.loop.run_until_complete(srv.wait_closed()) - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_create_unix_server_pathlib(self): with test_utils.unix_socket_path() as path: path = pathlib.Path(path) @@ -344,7 +345,7 @@ def test_create_unix_server_path_dgram(self): @unittest.skipUnless(hasattr(socket, 'SOCK_NONBLOCK'), 'no socket.SOCK_NONBLOCK (linux only)') - @support.skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_create_unix_server_path_stream_bittype(self): sock = socket.socket( socket.AF_UNIX, socket.SOCK_STREAM | socket.SOCK_NONBLOCK) @@ -497,12 +498,12 @@ def run_loop(self, coro): def prepare(self): sock = self.make_socket() proto = self.MyProto(self.loop) - port = support.find_unused_port() + port = socket_helper.find_unused_port() srv_sock = self.make_socket(cleanup=False) - srv_sock.bind((support.HOST, port)) + srv_sock.bind((socket_helper.HOST, port)) server = self.run_loop(self.loop.create_server( lambda: proto, sock=srv_sock)) - self.run_loop(self.loop.sock_connect(sock, (support.HOST, port))) + self.run_loop(self.loop.sock_connect(sock, (socket_helper.HOST, port))) self.run_loop(proto._ready) def cleanup(): diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index 6c84ac47a65dc..3c3abe4191788 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -10,6 +10,7 @@ import threading from test import support +from test.support import socket_helper from io import BytesIO if support.PGO: @@ -91,7 +92,7 @@ def bind_af_aware(sock, addr): if HAS_UNIX_SOCKETS and sock.family == socket.AF_UNIX: # Make sure the path doesn't exist. support.unlink(addr) - support.bind_unix_socket(sock, addr) + socket_helper.bind_unix_socket(sock, addr) else: sock.bind(addr) @@ -327,7 +328,7 @@ def test_send(self): evt = threading.Event() sock = socket.socket() sock.settimeout(3) - port = support.bind_port(sock) + port = socket_helper.bind_port(sock) cap = BytesIO() args = (evt, cap, sock) @@ -341,7 +342,7 @@ def test_send(self): data = b"Suppose there isn't a 16-ton weight?" d = dispatcherwithsend_noread() d.create_socket() - d.connect((support.HOST, port)) + d.connect((socket_helper.HOST, port)) # give time for socket to connect time.sleep(0.1) @@ -791,12 +792,12 @@ def test_quick_connect(self): class TestAPI_UseIPv4Sockets(BaseTestAPI): family = socket.AF_INET - addr = (support.HOST, 0) + addr = (socket_helper.HOST, 0) - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 support required') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 support required') class TestAPI_UseIPv6Sockets(BaseTestAPI): family = socket.AF_INET6 - addr = (support.HOSTv6, 0) + addr = (socket_helper.HOSTv6, 0) @unittest.skipUnless(HAS_UNIX_SOCKETS, 'Unix sockets required') class TestAPI_UseUnixSockets(BaseTestAPI): diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index cf30a3df35f12..e424076d7d317 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -19,7 +19,8 @@ from unittest import TestCase, skipUnless from test import support -from test.support import HOST, HOSTv6 +from test.support import socket_helper +from test.support.socket_helper import HOST, HOSTv6 TIMEOUT = support.LOOPBACK_TIMEOUT DEFAULT_ENCODING = 'utf-8' @@ -751,7 +752,7 @@ def is_client_connected(): def test_source_address(self): self.client.quit() - port = support.find_unused_port() + port = socket_helper.find_unused_port() try: self.client.connect(self.server.host, self.server.port, source_address=(HOST, port)) @@ -763,7 +764,7 @@ def test_source_address(self): raise def test_source_address_passive_connection(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() self.client.source_address = (HOST, port) try: with self.client.transfercmd('list') as sock: @@ -816,7 +817,7 @@ def test_encoding_param(self): self.assertEqual(DEFAULT_ENCODING, client.encoding) - at skipUnless(support.IPV6_ENABLED, "IPv6 not enabled") + at skipUnless(socket_helper.IPV6_ENABLED, "IPv6 not enabled") class TestIPv6Environment(TestCase): def setUp(self): @@ -1007,7 +1008,7 @@ def setUp(self): self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(20) - self.port = support.bind_port(self.sock) + self.port = socket_helper.bind_port(self.sock) self.server_thread = threading.Thread(target=self.server) self.server_thread.daemon = True self.server_thread.start() diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 77d43359f3026..6b7a9dedf1a2a 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -13,6 +13,7 @@ TestCase = unittest.TestCase from test import support +from test.support import socket_helper here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' @@ -42,7 +43,7 @@ trailers = "X-Dummy: foo\r\nX-Dumm2: bar\r\n" chunked_end = "\r\n" -HOST = support.HOST +HOST = socket_helper.HOST class FakeSocket: def __init__(self, text, fileclass=io.BytesIO, host=None, port=None): @@ -1463,8 +1464,8 @@ def test_client_constants(self): class SourceAddressTest(TestCase): def setUp(self): self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.port = support.bind_port(self.serv) - self.source_port = support.find_unused_port() + self.port = socket_helper.bind_port(self.serv) + self.source_port = socket_helper.find_unused_port() self.serv.listen() self.conn = None @@ -1496,7 +1497,7 @@ class TimeoutTest(TestCase): def setUp(self): self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - TimeoutTest.PORT = support.bind_port(self.serv) + TimeoutTest.PORT = socket_helper.bind_port(self.serv) self.serv.listen() def tearDown(self): diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 91aa77126a28c..764566695170a 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -1,4 +1,5 @@ from test import support +from test.support import socket_helper from contextlib import contextmanager import imaplib @@ -82,7 +83,7 @@ def test_imap4_host_default_value(self): pass # This is the exception that should be raised. - expected_errnos = support.get_socket_conn_refused_errs() + expected_errnos = socket_helper.get_socket_conn_refused_errs() with self.assertRaises(OSError) as cm: imaplib.IMAP4() self.assertIn(cm.exception.errno, expected_errnos) @@ -210,7 +211,7 @@ def handle_error(self, request, client_address): raise self.addCleanup(self._cleanup) - self.server = self.server_class((support.HOST, 0), imap_handler) + self.server = self.server_class((socket_helper.HOST, 0), imap_handler) self.thread = threading.Thread( name=self._testMethodName+'-server', target=self.server.serve_forever, @@ -600,7 +601,7 @@ def reap_server(self, server, thread): @contextmanager def reaped_server(self, hdlr): - server, thread = self.make_server((support.HOST, 0), hdlr) + server, thread = self.make_server((socket_helper.HOST, 0), hdlr) try: yield server finally: diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index c254b047e1ec5..a99b4ba89acbf 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -8,8 +8,9 @@ import socket import shutil import threading -from test.support import TESTFN, requires, unlink, bigmemtest, find_unused_port +from test.support import TESTFN, requires, unlink, bigmemtest from test.support import SHORT_TIMEOUT +from test.support import socket_helper import io # C implementation of io import _pyio as pyio # Python implementation of io @@ -219,7 +220,7 @@ def run(sock): # bit more tolerance. @skip_no_disk_space(TESTFN, size * 2.5) def test_it(self): - port = find_unused_port() + port = socket_helper.find_unused_port() with socket.create_server(("", port)) as sock: self.tcp_server(sock) with socket.create_connection(("127.0.0.1", port)) as client: diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 99e74ebff6087..241ed2c91de13 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -43,6 +43,7 @@ import tempfile from test.support.script_helper import assert_python_ok, assert_python_failure from test import support +from test.support import socket_helper import textwrap import threading import time @@ -1053,10 +1054,10 @@ class SMTPHandlerTest(BaseTest): def test_basic(self): sockmap = {} - server = TestSMTPServer((support.HOST, 0), self.process_message, 0.001, + server = TestSMTPServer((socket_helper.HOST, 0), self.process_message, 0.001, sockmap) server.start() - addr = (support.HOST, server.port) + addr = (socket_helper.HOST, server.port) h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log', timeout=self.TIMEOUT) self.assertEqual(h.toaddrs, ['you']) @@ -1921,7 +1922,7 @@ def tearDown(self): SysLogHandlerTest.tearDown(self) support.unlink(self.address) - at unittest.skipUnless(support.IPV6_ENABLED, + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 support required for this test.') class IPv6SysLogHandlerTest(SysLogHandlerTest): diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index fdd76f9e9b355..2a5a0b97eea63 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -10,6 +10,7 @@ import threading from test import support +from test.support import socket_helper from nntplib import NNTP, GroupInfo import nntplib from unittest.mock import patch @@ -1555,14 +1556,14 @@ def nntp_class(*pos, **kw): class LocalServerTests(unittest.TestCase): def setUp(self): sock = socket.socket() - port = support.bind_port(sock) + port = socket_helper.bind_port(sock) sock.listen() self.background = threading.Thread( target=self.run_server, args=(sock,)) self.background.start() self.addCleanup(self.background.join) - self.nntp = NNTP(support.HOST, port, usenetrc=False).__enter__() + self.nntp = NNTP(socket_helper.HOST, port, usenetrc=False).__enter__() self.addCleanup(self.nntp.__exit__, None, None, None) def run_server(self, sock): diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 74aef47243428..362ba9e1042cb 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -30,6 +30,7 @@ import uuid import warnings from test import support +from test.support import socket_helper from platform import win32_is_iot try: @@ -3171,7 +3172,7 @@ def tearDownClass(cls): support.unlink(support.TESTFN) def setUp(self): - self.server = SendfileTestServer((support.HOST, 0)) + self.server = SendfileTestServer((socket_helper.HOST, 0)) self.server.start() self.client = socket.socket() self.client.connect((self.server.host, self.server.port)) diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py index 7f06d1950e1e1..d4877b1fbbc6b 100644 --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -13,8 +13,9 @@ from unittest import TestCase, skipUnless from test import support as test_support +from test.support import socket_helper -HOST = test_support.HOST +HOST = socket_helper.HOST PORT = 0 SUPPORTS_SSL = False @@ -480,7 +481,7 @@ def setUp(self): self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(60) # Safety net. Look issue 11812 - self.port = test_support.bind_port(self.sock) + self.port = socket_helper.bind_port(self.sock) self.thread = threading.Thread(target=self.server, args=(self.evt, self.sock)) self.thread.daemon = True self.thread.start() diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py index f28d8be5f3c4e..9d4764ece2fd2 100644 --- a/Lib/test/test_robotparser.py +++ b/Lib/test/test_robotparser.py @@ -4,6 +4,7 @@ import unittest import urllib.robotparser from test import support +from test.support import socket_helper from http.server import BaseHTTPRequestHandler, HTTPServer @@ -312,7 +313,7 @@ def setUp(self): # clear _opener global variable self.addCleanup(urllib.request.urlcleanup) - self.server = HTTPServer((support.HOST, 0), RobotHandler) + self.server = HTTPServer((socket_helper.HOST, 0), RobotHandler) self.t = threading.Thread( name='HTTPServer serving', @@ -332,7 +333,7 @@ def tearDown(self): @support.reap_threads def testPasswordProtectedSite(self): addr = self.server.server_address - url = 'http://' + support.HOST + ':' + str(addr[1]) + url = 'http://' + socket_helper.HOST + ':' + str(addr[1]) robots_url = url + "/robots.txt" parser = urllib.robotparser.RobotFileParser() parser.set_url(url) diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py index c449155c4b49f..2274c39a79a53 100644 --- a/Lib/test/test_selectors.py +++ b/Lib/test/test_selectors.py @@ -6,6 +6,7 @@ import socket import sys from test import support +from test.support import socket_helper from time import sleep import unittest import unittest.mock @@ -22,7 +23,7 @@ else: def socketpair(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0): with socket.socket(family, type, proto) as l: - l.bind((support.HOST, 0)) + l.bind((socket_helper.HOST, 0)) l.listen() c = socket.socket(family, type, proto) try: diff --git a/Lib/test/test_smtpd.py b/Lib/test/test_smtpd.py index a9f7d5a3b8bc1..3be7739743940 100644 --- a/Lib/test/test_smtpd.py +++ b/Lib/test/test_smtpd.py @@ -1,6 +1,7 @@ import unittest import textwrap from test import support, mock_socket +from test.support import socket_helper import socket import io import smtpd @@ -38,7 +39,7 @@ def setUp(self): smtpd.socket = asyncore.socket = mock_socket def test_process_message_unimplemented(self): - server = smtpd.SMTPServer((support.HOST, 0), ('b', 0), + server = smtpd.SMTPServer((socket_helper.HOST, 0), ('b', 0), decode_data=True) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr, decode_data=True) @@ -57,7 +58,7 @@ def test_decode_data_and_enable_SMTPUTF8_raises(self): self.assertRaises( ValueError, smtpd.SMTPServer, - (support.HOST, 0), + (socket_helper.HOST, 0), ('b', 0), enable_SMTPUTF8=True, decode_data=True) @@ -87,7 +88,7 @@ def write_line(line): write_line(b'.') def test_process_message_with_decode_data_true(self): - server = smtpd.DebuggingServer((support.HOST, 0), ('b', 0), + server = smtpd.DebuggingServer((socket_helper.HOST, 0), ('b', 0), decode_data=True) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr, decode_data=True) @@ -104,7 +105,7 @@ def test_process_message_with_decode_data_true(self): """)) def test_process_message_with_decode_data_false(self): - server = smtpd.DebuggingServer((support.HOST, 0), ('b', 0)) + server = smtpd.DebuggingServer((socket_helper.HOST, 0), ('b', 0)) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr) with support.captured_stdout() as s: @@ -120,7 +121,7 @@ def test_process_message_with_decode_data_false(self): """)) def test_process_message_with_enable_SMTPUTF8_true(self): - server = smtpd.DebuggingServer((support.HOST, 0), ('b', 0), + server = smtpd.DebuggingServer((socket_helper.HOST, 0), ('b', 0), enable_SMTPUTF8=True) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr, enable_SMTPUTF8=True) @@ -137,7 +138,7 @@ def test_process_message_with_enable_SMTPUTF8_true(self): """)) def test_process_SMTPUTF8_message_with_enable_SMTPUTF8_true(self): - server = smtpd.DebuggingServer((support.HOST, 0), ('b', 0), + server = smtpd.DebuggingServer((socket_helper.HOST, 0), ('b', 0), enable_SMTPUTF8=True) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr, enable_SMTPUTF8=True) @@ -168,13 +169,13 @@ def tearDown(self): asyncore.close_all() asyncore.socket = smtpd.socket = socket - @unittest.skipUnless(support.IPV6_ENABLED, "IPv6 not enabled") + @unittest.skipUnless(socket_helper.IPV6_ENABLED, "IPv6 not enabled") def test_socket_uses_IPv6(self): - server = smtpd.SMTPServer((support.HOSTv6, 0), (support.HOSTv4, 0)) + server = smtpd.SMTPServer((socket_helper.HOSTv6, 0), (socket_helper.HOSTv4, 0)) self.assertEqual(server.socket.family, socket.AF_INET6) def test_socket_uses_IPv4(self): - server = smtpd.SMTPServer((support.HOSTv4, 0), (support.HOSTv6, 0)) + server = smtpd.SMTPServer((socket_helper.HOSTv4, 0), (socket_helper.HOSTv6, 0)) self.assertEqual(server.socket.family, socket.AF_INET) @@ -197,7 +198,7 @@ def write_line(self, channel, line): channel.handle_read() def test_params_rejected(self): - server = DummyServer((support.HOST, 0), ('b', 0)) + server = DummyServer((socket_helper.HOST, 0), ('b', 0)) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr) self.write_line(channel, b'EHLO example') @@ -206,7 +207,7 @@ def test_params_rejected(self): self.assertEqual(channel.socket.last, self.error_response) def test_nothing_accepted(self): - server = DummyServer((support.HOST, 0), ('b', 0)) + server = DummyServer((socket_helper.HOST, 0), ('b', 0)) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr) self.write_line(channel, b'EHLO example') @@ -234,7 +235,7 @@ def write_line(self, channel, line): channel.handle_read() def test_with_decode_data_true(self): - server = DummyServer((support.HOST, 0), ('b', 0), decode_data=True) + server = DummyServer((socket_helper.HOST, 0), ('b', 0), decode_data=True) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr, decode_data=True) self.write_line(channel, b'EHLO example') @@ -250,7 +251,7 @@ def test_with_decode_data_true(self): self.assertEqual(channel.socket.last, b'250 OK\r\n') def test_with_decode_data_false(self): - server = DummyServer((support.HOST, 0), ('b', 0)) + server = DummyServer((socket_helper.HOST, 0), ('b', 0)) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr) self.write_line(channel, b'EHLO example') @@ -271,7 +272,7 @@ def test_with_decode_data_false(self): self.assertEqual(channel.socket.last, b'250 OK\r\n') def test_with_enable_smtputf8_true(self): - server = DummyServer((support.HOST, 0), ('b', 0), enable_SMTPUTF8=True) + server = DummyServer((socket_helper.HOST, 0), ('b', 0), enable_SMTPUTF8=True) conn, addr = server.accept() channel = smtpd.SMTPChannel(server, conn, addr, enable_SMTPUTF8=True) self.write_line(channel, b'EHLO example') @@ -286,7 +287,7 @@ def setUp(self): smtpd.socket = asyncore.socket = mock_socket self.old_debugstream = smtpd.DEBUGSTREAM self.debug = smtpd.DEBUGSTREAM = io.StringIO() - self.server = DummyServer((support.HOST, 0), ('b', 0), + self.server = DummyServer((socket_helper.HOST, 0), ('b', 0), decode_data=True) conn, addr = self.server.accept() self.channel = smtpd.SMTPChannel(self.server, conn, addr, @@ -304,7 +305,7 @@ def write_line(self, line): def test_broken_connect(self): self.assertRaises( DummyDispatcherBroken, BrokenDummyServer, - (support.HOST, 0), ('b', 0), decode_data=True) + (socket_helper.HOST, 0), ('b', 0), decode_data=True) def test_decode_data_and_enable_SMTPUTF8_raises(self): self.assertRaises( @@ -758,13 +759,13 @@ def test_attribute_deprecations(self): with support.check_warnings(('', DeprecationWarning)): self.channel._SMTPChannel__addr = 'spam' - at unittest.skipUnless(support.IPV6_ENABLED, "IPv6 not enabled") + at unittest.skipUnless(socket_helper.IPV6_ENABLED, "IPv6 not enabled") class SMTPDChannelIPv6Test(SMTPDChannelTest): def setUp(self): smtpd.socket = asyncore.socket = mock_socket self.old_debugstream = smtpd.DEBUGSTREAM self.debug = smtpd.DEBUGSTREAM = io.StringIO() - self.server = DummyServer((support.HOSTv6, 0), ('b', 0), + self.server = DummyServer((socket_helper.HOSTv6, 0), ('b', 0), decode_data=True) conn, addr = self.server.accept() self.channel = smtpd.SMTPChannel(self.server, conn, addr, @@ -776,7 +777,7 @@ def setUp(self): smtpd.socket = asyncore.socket = mock_socket self.old_debugstream = smtpd.DEBUGSTREAM self.debug = smtpd.DEBUGSTREAM = io.StringIO() - self.server = DummyServer((support.HOST, 0), ('b', 0), + self.server = DummyServer((socket_helper.HOST, 0), ('b', 0), decode_data=True) conn, addr = self.server.accept() # Set DATA size limit to 32 bytes for easy testing @@ -831,7 +832,7 @@ def setUp(self): smtpd.socket = asyncore.socket = mock_socket self.old_debugstream = smtpd.DEBUGSTREAM self.debug = smtpd.DEBUGSTREAM = io.StringIO() - self.server = DummyServer((support.HOST, 0), ('b', 0)) + self.server = DummyServer((socket_helper.HOST, 0), ('b', 0)) conn, addr = self.server.accept() self.channel = smtpd.SMTPChannel(self.server, conn, addr) @@ -873,7 +874,7 @@ def setUp(self): smtpd.socket = asyncore.socket = mock_socket self.old_debugstream = smtpd.DEBUGSTREAM self.debug = smtpd.DEBUGSTREAM = io.StringIO() - self.server = DummyServer((support.HOST, 0), ('b', 0), + self.server = DummyServer((socket_helper.HOST, 0), ('b', 0), decode_data=True) conn, addr = self.server.accept() # Set decode_data to True @@ -916,7 +917,7 @@ def setUp(self): smtpd.socket = asyncore.socket = mock_socket self.old_debugstream = smtpd.DEBUGSTREAM self.debug = smtpd.DEBUGSTREAM = io.StringIO() - self.server = DummyServer((support.HOST, 0), ('b', 0), + self.server = DummyServer((socket_helper.HOST, 0), ('b', 0), enable_SMTPUTF8=True) conn, addr = self.server.accept() self.channel = smtpd.SMTPChannel(self.server, conn, addr, diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 067c01c10c1b3..d1ffb368a4f6f 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -20,11 +20,12 @@ import unittest from test import support, mock_socket -from test.support import HOST +from test.support import socket_helper from test.support import threading_setup, threading_cleanup, join_thread from test.support import requires_hashdigest from unittest.mock import Mock +HOST = socket_helper.HOST if sys.platform == 'darwin': # select.poll returns a select.POLLHUP at the end of the tests @@ -271,7 +272,7 @@ def testBasic(self): def testSourceAddress(self): # connect - src_port = support.find_unused_port() + src_port = socket_helper.find_unused_port() try: smtp = smtplib.SMTP(self.host, self.port, local_hostname='localhost', timeout=support.LOOPBACK_TIMEOUT, @@ -711,7 +712,7 @@ def setUp(self): self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(15) - self.port = support.bind_port(self.sock) + self.port = socket_helper.bind_port(self.sock) servargs = (self.evt, self.respdata, self.sock) self.thread = threading.Thread(target=server, args=servargs) self.thread.start() diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 6e4e4fe4c3532..a70e28219ed23 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 socket_helper import errno import io @@ -34,7 +35,7 @@ except ImportError: fcntl = None -HOST = support.HOST +HOST = socket_helper.HOST # test unicode string and carriage return MSG = 'Michael Gilfix was here\u1234\r\n'.encode('utf-8') @@ -161,7 +162,7 @@ class SocketTCPTest(unittest.TestCase): def setUp(self): self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.port = support.bind_port(self.serv) + self.port = socket_helper.bind_port(self.serv) self.serv.listen() def tearDown(self): @@ -172,7 +173,7 @@ class SocketUDPTest(unittest.TestCase): def setUp(self): self.serv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - self.port = support.bind_port(self.serv) + self.port = socket_helper.bind_port(self.serv) def tearDown(self): self.serv.close() @@ -182,7 +183,7 @@ class SocketUDPLITETest(SocketUDPTest): def setUp(self): self.serv = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) - self.port = support.bind_port(self.serv) + self.port = socket_helper.bind_port(self.serv) class ThreadSafeCleanupTestCase(unittest.TestCase): """Subclass of unittest.TestCase with thread-safe cleanup methods. @@ -265,7 +266,7 @@ def setUp(self): self.serv = socket.socket(socket.PF_RDS, socket.SOCK_SEQPACKET, 0) self.addCleanup(self.serv.close) try: - self.port = support.bind_port(self.serv) + self.port = socket_helper.bind_port(self.serv) except OSError: self.skipTest('unable to bind RDS socket') @@ -682,7 +683,7 @@ def setUp(self): def bindSock(self, sock): path = tempfile.mktemp(dir=self.dir_path) - support.bind_unix_socket(sock, path) + socket_helper.bind_unix_socket(sock, path) self.addCleanup(support.unlink, path) class UnixStreamBase(UnixSocketTestBase): @@ -702,7 +703,7 @@ def setUp(self): self.port = self.serv_addr[1] def bindSock(self, sock): - support.bind_port(sock, host=self.host) + socket_helper.bind_port(sock, host=self.host) class TCPTestBase(InetTestBase): """Base class for TCP-over-IPv4 tests.""" @@ -733,7 +734,7 @@ def newSocket(self): class Inet6TestBase(InetTestBase): """Base class for IPv6 socket tests.""" - host = support.HOSTv6 + host = socket_helper.HOSTv6 class UDP6TestBase(Inet6TestBase): """Base class for UDP-over-IPv6 tests.""" @@ -966,12 +967,12 @@ def testHostnameRes(self): self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names))) def test_host_resolution(self): - for addr in [support.HOSTv4, '10.0.0.1', '255.255.255.255']: + for addr in [socket_helper.HOSTv4, '10.0.0.1', '255.255.255.255']: self.assertEqual(socket.gethostbyname(addr), addr) - # we don't test support.HOSTv6 because there's a chance it doesn't have + # we don't test socket_helper.HOSTv6 because there's a chance it doesn't have # a matching name entry (e.g. 'ip6-localhost') - for host in [support.HOSTv4]: + for host in [socket_helper.HOSTv4]: self.assertIn(host, socket.gethostbyaddr(host)[2]) def test_host_resolution_bad_address(self): @@ -1334,7 +1335,7 @@ def testStringToIPv6(self): def testSockName(self): # Testing getsockname() - port = support.find_unused_port() + port = socket_helper.find_unused_port() sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.addCleanup(sock.close) sock.bind(("0.0.0.0", port)) @@ -1400,7 +1401,7 @@ def testNewAttributes(self): def test_getsockaddrarg(self): sock = socket.socket() self.addCleanup(sock.close) - port = support.find_unused_port() + port = socket_helper.find_unused_port() big_port = port + 65536 neg_port = port - 65536 self.assertRaises(OverflowError, sock.bind, (HOST, big_port)) @@ -1408,7 +1409,7 @@ def test_getsockaddrarg(self): # Since find_unused_port() is inherently subject to race conditions, we # call it a couple times if necessary. for i in itertools.count(): - port = support.find_unused_port() + port = socket_helper.find_unused_port() try: sock.bind((HOST, port)) except OSError as e: @@ -1461,7 +1462,7 @@ def testGetaddrinfo(self): socket.getaddrinfo('localhost', 80) socket.getaddrinfo('127.0.0.1', 80) socket.getaddrinfo(None, 80) - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: socket.getaddrinfo('::1', 80) # port can be a string service name such as "http", a numeric # port number or None @@ -1674,14 +1675,14 @@ def test_listen_backlog_overflow(self): srv.bind((HOST, 0)) self.assertRaises(OverflowError, srv.listen, _testcapi.INT_MAX + 1) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') def test_flowinfo(self): self.assertRaises(OverflowError, socket.getnameinfo, - (support.HOSTv6, 0, 0xffffffff), 0) + (socket_helper.HOSTv6, 0, 0xffffffff), 0) with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as s: - self.assertRaises(OverflowError, s.bind, (support.HOSTv6, 0, -10)) + self.assertRaises(OverflowError, s.bind, (socket_helper.HOSTv6, 0, -10)) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') def test_getaddrinfo_ipv6_basic(self): ((*_, sockaddr),) = socket.getaddrinfo( 'ff02::1de:c0:face:8D', # Note capital letter `D`. @@ -1691,7 +1692,7 @@ def test_getaddrinfo_ipv6_basic(self): ) self.assertEqual(sockaddr, ('ff02::1de:c0:face:8d', 1234, 0, 0)) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipIf(sys.platform == 'win32', 'does not work on Windows') @unittest.skipIf(AIX, 'Symbolic scope id does not work') def test_getaddrinfo_ipv6_scopeid_symbolic(self): @@ -1706,7 +1707,7 @@ def test_getaddrinfo_ipv6_scopeid_symbolic(self): # Note missing interface name part in IPv6 address self.assertEqual(sockaddr, ('ff02::1de:c0:face:8d', 1234, 0, ifindex)) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless( sys.platform == 'win32', 'Numeric scope id does not work or undocumented') @@ -1723,7 +1724,7 @@ def test_getaddrinfo_ipv6_scopeid_numeric(self): # Note missing interface name part in IPv6 address self.assertEqual(sockaddr, ('ff02::1de:c0:face:8d', 1234, 0, ifindex)) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipIf(sys.platform == 'win32', 'does not work on Windows') @unittest.skipIf(AIX, 'Symbolic scope id does not work') def test_getnameinfo_ipv6_scopeid_symbolic(self): @@ -1733,7 +1734,7 @@ def test_getnameinfo_ipv6_scopeid_symbolic(self): nameinfo = socket.getnameinfo(sockaddr, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV) self.assertEqual(nameinfo, ('ff02::1de:c0:face:8d%' + test_interface, '1234')) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless( sys.platform == 'win32', 'Numeric scope id does not work or undocumented') def test_getnameinfo_ipv6_scopeid_numeric(self): @@ -1826,19 +1827,19 @@ def _test_socket_fileno(self, s, family, stype): def test_socket_fileno(self): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.addCleanup(s.close) - s.bind((support.HOST, 0)) + s.bind((socket_helper.HOST, 0)) self._test_socket_fileno(s, socket.AF_INET, socket.SOCK_STREAM) if hasattr(socket, "SOCK_DGRAM"): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.addCleanup(s.close) - s.bind((support.HOST, 0)) + s.bind((socket_helper.HOST, 0)) self._test_socket_fileno(s, socket.AF_INET, socket.SOCK_DGRAM) - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) self.addCleanup(s.close) - s.bind((support.HOSTv6, 0, 0, 0)) + s.bind((socket_helper.HOSTv6, 0, 0, 0)) self._test_socket_fileno(s, socket.AF_INET6, socket.SOCK_STREAM) if hasattr(socket, "AF_UNIX"): @@ -2214,12 +2215,12 @@ def testUnbound(self): def testBindSock(self): with socket.socket(socket.AF_QIPCRTR, socket.SOCK_DGRAM) as s: - support.bind_port(s, host=s.getsockname()[0]) + socket_helper.bind_port(s, host=s.getsockname()[0]) self.assertNotEqual(s.getsockname()[1], 0) def testInvalidBindSock(self): with socket.socket(socket.AF_QIPCRTR, socket.SOCK_DGRAM) as s: - self.assertRaises(OSError, support.bind_port, s, host=-2) + self.assertRaises(OSError, socket_helper.bind_port, s, host=-2) def testAutoBindSock(self): with socket.socket(socket.AF_QIPCRTR, socket.SOCK_DGRAM) as s: @@ -4094,25 +4095,25 @@ def checkRecvmsgAddress(self, addr1, addr2): self.assertEqual(addr1[:-1], addr2[:-1]) @requireAttrs(socket.socket, "sendmsg") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @requireSocket("AF_INET6", "SOCK_DGRAM") class SendmsgUDP6Test(SendmsgConnectionlessTests, SendrecvmsgUDP6TestBase): pass @requireAttrs(socket.socket, "recvmsg") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @requireSocket("AF_INET6", "SOCK_DGRAM") class RecvmsgUDP6Test(RecvmsgTests, SendrecvmsgUDP6TestBase): pass @requireAttrs(socket.socket, "recvmsg_into") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @requireSocket("AF_INET6", "SOCK_DGRAM") class RecvmsgIntoUDP6Test(RecvmsgIntoTests, SendrecvmsgUDP6TestBase): pass @requireAttrs(socket.socket, "recvmsg") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @requireAttrs(socket, "IPPROTO_IPV6") @requireSocket("AF_INET6", "SOCK_DGRAM") class RecvmsgRFC3542AncillaryUDP6Test(RFC3542AncillaryTest, @@ -4120,7 +4121,7 @@ class RecvmsgRFC3542AncillaryUDP6Test(RFC3542AncillaryTest, pass @requireAttrs(socket.socket, "recvmsg_into") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @requireAttrs(socket, "IPPROTO_IPV6") @requireSocket("AF_INET6", "SOCK_DGRAM") class RecvmsgIntoRFC3542AncillaryUDP6Test(RecvmsgIntoMixin, @@ -4167,7 +4168,7 @@ def checkRecvmsgAddress(self, addr1, addr2): self.assertEqual(addr1[:-1], addr2[:-1]) @requireAttrs(socket.socket, "sendmsg") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless(HAVE_SOCKET_UDPLITE, 'UDPLITE sockets required for this test.') @requireSocket("AF_INET6", "SOCK_DGRAM") @@ -4175,7 +4176,7 @@ class SendmsgUDPLITE6Test(SendmsgConnectionlessTests, SendrecvmsgUDPLITE6TestBas pass @requireAttrs(socket.socket, "recvmsg") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless(HAVE_SOCKET_UDPLITE, 'UDPLITE sockets required for this test.') @requireSocket("AF_INET6", "SOCK_DGRAM") @@ -4183,7 +4184,7 @@ class RecvmsgUDPLITE6Test(RecvmsgTests, SendrecvmsgUDPLITE6TestBase): pass @requireAttrs(socket.socket, "recvmsg_into") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless(HAVE_SOCKET_UDPLITE, 'UDPLITE sockets required for this test.') @requireSocket("AF_INET6", "SOCK_DGRAM") @@ -4191,7 +4192,7 @@ class RecvmsgIntoUDPLITE6Test(RecvmsgIntoTests, SendrecvmsgUDPLITE6TestBase): pass @requireAttrs(socket.socket, "recvmsg") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless(HAVE_SOCKET_UDPLITE, 'UDPLITE sockets required for this test.') @requireAttrs(socket, "IPPROTO_IPV6") @@ -4201,7 +4202,7 @@ class RecvmsgRFC3542AncillaryUDPLITE6Test(RFC3542AncillaryTest, pass @requireAttrs(socket.socket, "recvmsg_into") - at unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test.') + at unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test.') @unittest.skipUnless(HAVE_SOCKET_UDPLITE, 'UDPLITE sockets required for this test.') @requireAttrs(socket, "IPPROTO_IPV6") @@ -4999,7 +5000,7 @@ def mocked_socket_module(self): socket.socket = old_socket def test_connect(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.addCleanup(cli.close) with self.assertRaises(OSError) as cm: @@ -5009,7 +5010,7 @@ def test_connect(self): def test_create_connection(self): # Issue #9792: errors raised by create_connection() should have # a proper errno attribute. - port = support.find_unused_port() + port = socket_helper.find_unused_port() with self.assertRaises(OSError) as cm: socket.create_connection((HOST, port)) @@ -5027,7 +5028,7 @@ def test_create_connection(self): # On Solaris, ENETUNREACH is returned in this circumstance instead # of ECONNREFUSED. So, if that errno exists, add it to our list of # expected errnos. - expected_errnos = support.get_socket_conn_refused_errs() + expected_errnos = socket_helper.get_socket_conn_refused_errs() self.assertIn(cm.exception.errno, expected_errnos) def test_create_connection_timeout(self): @@ -5039,7 +5040,7 @@ def test_create_connection_timeout(self): except socket.timeout: pass except OSError as exc: - if support.IPV6_ENABLED or exc.errno != errno.EAFNOSUPPORT: + if socket_helper.IPV6_ENABLED or exc.errno != errno.EAFNOSUPPORT: raise else: self.fail('socket.timeout not raised') @@ -5052,7 +5053,7 @@ def __init__(self, methodName='runTest'): ThreadableTest.__init__(self) def clientSetUp(self): - self.source_port = support.find_unused_port() + self.source_port = socket_helper.find_unused_port() def clientTearDown(self): self.cli.close() @@ -5338,7 +5339,7 @@ def encoded(self, path): def bind(self, sock, path): # Bind the socket try: - support.bind_unix_socket(sock, path) + socket_helper.bind_unix_socket(sock, path) except OSError as e: if str(e) == "AF_UNIX path too long": self.skipTest( @@ -6328,11 +6329,11 @@ def test_new_tcp_flags(self): class CreateServerTest(unittest.TestCase): def test_address(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() with socket.create_server(("127.0.0.1", port)) as sock: self.assertEqual(sock.getsockname()[0], "127.0.0.1") self.assertEqual(sock.getsockname()[1], port) - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: with socket.create_server(("::1", port), family=socket.AF_INET6) as sock: self.assertEqual(sock.getsockname()[0], "::1") @@ -6342,7 +6343,7 @@ def test_family_and_type(self): with socket.create_server(("127.0.0.1", 0)) as sock: self.assertEqual(sock.family, socket.AF_INET) self.assertEqual(sock.type, socket.SOCK_STREAM) - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: with socket.create_server(("::1", 0), family=socket.AF_INET6) as s: self.assertEqual(s.family, socket.AF_INET6) self.assertEqual(sock.type, socket.SOCK_STREAM) @@ -6362,14 +6363,14 @@ def test_reuse_port(self): @unittest.skipIf(not hasattr(_socket, 'IPPROTO_IPV6') or not hasattr(_socket, 'IPV6_V6ONLY'), "IPV6_V6ONLY option not supported") - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test') def test_ipv6_only_default(self): with socket.create_server(("::1", 0), family=socket.AF_INET6) as sock: assert sock.getsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY) @unittest.skipIf(not socket.has_dualstack_ipv6(), "dualstack_ipv6 not supported") - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test') def test_dualstack_ipv6_family(self): with socket.create_server(("::1", 0), family=socket.AF_INET6, dualstack_ipv6=True) as sock: @@ -6411,14 +6412,14 @@ def echo_client(self, addr, family): self.assertEqual(sock.recv(1024), b'foo') def test_tcp4(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() with socket.create_server(("", port)) as sock: self.echo_server(sock) self.echo_client(("127.0.0.1", port), socket.AF_INET) - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test') def test_tcp6(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() with socket.create_server(("", port), family=socket.AF_INET6) as sock: self.echo_server(sock) @@ -6428,9 +6429,9 @@ def test_tcp6(self): @unittest.skipIf(not socket.has_dualstack_ipv6(), "dualstack_ipv6 not supported") - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test') def test_dual_stack_client_v4(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() with socket.create_server(("", port), family=socket.AF_INET6, dualstack_ipv6=True) as sock: self.echo_server(sock) @@ -6438,9 +6439,9 @@ def test_dual_stack_client_v4(self): @unittest.skipIf(not socket.has_dualstack_ipv6(), "dualstack_ipv6 not supported") - @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 required for this test') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'IPv6 required for this test') def test_dual_stack_client_v6(self): - port = support.find_unused_port() + port = socket_helper.find_unused_port() with socket.create_server(("", port), family=socket.AF_INET6, dualstack_ipv6=True) as sock: self.echo_server(sock) diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index f818df0b22f6a..c663cc95889c9 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -15,12 +15,13 @@ import test.support from test.support import reap_children, reap_threads, verbose +from test.support import socket_helper test.support.requires("network") TEST_STR = b"hello world\n" -HOST = test.support.HOST +HOST = socket_helper.HOST HAVE_UNIX_SOCKETS = hasattr(socket, "AF_UNIX") requires_unix_sockets = unittest.skipUnless(HAVE_UNIX_SOCKETS, diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 4184665b2b158..dafdb6c08092b 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -4,6 +4,7 @@ import unittest import unittest.mock from test import support +from test.support import socket_helper import socket import select import time @@ -33,7 +34,7 @@ Py_DEBUG_WIN32 = Py_DEBUG and sys.platform == 'win32' PROTOCOLS = sorted(ssl._PROTOCOL_NAMES) -HOST = support.HOST +HOST = socket_helper.HOST IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL') IS_OPENSSL_1_1_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0) IS_OPENSSL_1_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 1) @@ -762,7 +763,7 @@ def fail(cert, hostname): fail(cert, 'example.net') # -- IPv6 matching -- - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: cert = {'subject': ((('commonName', 'example.com'),),), 'subjectAltName': ( ('DNS', 'example.com'), @@ -845,7 +846,7 @@ def fail(cert, hostname): ssl._inet_paton(invalid) for ipaddr in ['127.0.0.1', '192.168.0.1']: self.assertTrue(ssl._inet_paton(ipaddr)) - if support.IPV6_ENABLED: + if socket_helper.IPV6_ENABLED: for ipaddr in ['::1', '2001:db8:85a3::8a2e:370:7334']: self.assertTrue(ssl._inet_paton(ipaddr)) @@ -1073,7 +1074,7 @@ def local_february_name(): def test_connect_ex_error(self): server = socket.socket(socket.AF_INET) self.addCleanup(server.close) - port = support.bind_port(server) # Reserve port but don't listen + port = socket_helper.bind_port(server) # Reserve port but don't listen s = test_wrap_socket(socket.socket(socket.AF_INET), cert_reqs=ssl.CERT_REQUIRED) self.addCleanup(s.close) @@ -2256,7 +2257,7 @@ def test_timeout_connect_ex(self): self.skipTest("REMOTE_HOST responded too quickly") self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK)) - @unittest.skipUnless(support.IPV6_ENABLED, 'Needs IPv6') + @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6') def test_get_server_certificate_ipv6(self): with support.transient_internet('ipv6.google.com'): _test_get_server_certificate(self, 'ipv6.google.com', 443) @@ -2511,7 +2512,7 @@ def __init__(self, certificate=None, ssl_version=None, self.connectionchatty = connectionchatty self.starttls_server = starttls_server self.sock = socket.socket() - self.port = support.bind_port(self.sock) + self.port = socket_helper.bind_port(self.sock) self.flag = None self.active = False self.selected_npn_protocols = [] @@ -2624,7 +2625,7 @@ def handle_error(self): def __init__(self, certfile): self.certfile = certfile sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.port = support.bind_port(sock, '') + self.port = socket_helper.bind_port(sock, '') asyncore.dispatcher.__init__(self, sock) self.listen(5) @@ -3144,7 +3145,7 @@ def test_rude_shutdown(self): listener_gone = threading.Event() s = socket.socket() - port = support.bind_port(s, HOST) + port = socket_helper.bind_port(s, HOST) # `listener` runs in a thread. It sits in an accept() until # the main thread connects. Then it rudely closes the socket, @@ -3640,7 +3641,7 @@ def test_handshake_timeout(self): # Issue #5103: SSL handshake must respect the socket timeout server = socket.socket(socket.AF_INET) host = "127.0.0.1" - port = support.bind_port(server) + port = socket_helper.bind_port(server) started = threading.Event() finish = False @@ -3694,7 +3695,7 @@ def test_server_accept(self): context.load_cert_chain(SIGNED_CERTFILE) server = socket.socket(socket.AF_INET) host = "127.0.0.1" - port = support.bind_port(server) + port = socket_helper.bind_port(server) server = context.wrap_socket(server, server_side=True) self.assertTrue(server.server_side) diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py index be01db2ed5574..d9e4ffde658db 100644 --- a/Lib/test/test_stat.py +++ b/Lib/test/test_stat.py @@ -2,8 +2,8 @@ import os import socket import sys -from test.support import (TESTFN, import_fresh_module, - skip_unless_bind_unix_socket) +from test.support import socket_helper +from test.support import TESTFN, import_fresh_module c_stat = import_fresh_module('stat', fresh=['_stat']) py_stat = import_fresh_module('stat', blocked=['_stat']) @@ -193,7 +193,7 @@ def test_devices(self): self.assertS_IS("BLK", st_mode) break - @skip_unless_bind_unix_socket + @socket_helper.skip_unless_bind_unix_socket def test_socket(self): with socket.socket(socket.AF_UNIX) as s: s.bind(TESTFN) diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index dee1db7d6d7c8..606e57003ed71 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -14,6 +14,7 @@ import unittest from test import support from test.support import script_helper +from test.support import socket_helper TESTFN = support.TESTFN @@ -91,17 +92,17 @@ def test_forget(self): support.rmtree('__pycache__') def test_HOST(self): - s = socket.create_server((support.HOST, 0)) + s = socket.create_server((socket_helper.HOST, 0)) s.close() def test_find_unused_port(self): - port = support.find_unused_port() - s = socket.create_server((support.HOST, port)) + port = socket_helper.find_unused_port() + s = socket.create_server((socket_helper.HOST, port)) s.close() def test_bind_port(self): s = socket.socket() - support.bind_port(s) + socket_helper.bind_port(s) s.listen() s.close() diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py index 414c328b79f95..7633901c96c84 100644 --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -5,9 +5,10 @@ import contextlib from test import support +from test.support import socket_helper import unittest -HOST = support.HOST +HOST = socket_helper.HOST def server(evt, serv): serv.listen() @@ -26,7 +27,7 @@ def setUp(self): self.evt = threading.Event() self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(60) # Safety net. Look issue 11812 - self.port = support.bind_port(self.sock) + self.port = socket_helper.bind_port(self.sock) self.thread = threading.Thread(target=server, args=(self.evt,self.sock)) self.thread.setDaemon(True) self.thread.start() diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py index ff41b13a6c839..c0952c75e9913 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -3,6 +3,7 @@ import functools import unittest from test import support +from test.support import socket_helper # This requires the 'network' resource as given on the regrtest command line. skip_expected = not support.is_resource_enabled('network') @@ -110,7 +111,7 @@ class TimeoutTestCase(unittest.TestCase): # solution. fuzz = 2.0 - localhost = support.HOST + localhost = socket_helper.HOST def setUp(self): raise NotImplementedError() @@ -240,14 +241,14 @@ def testRecvTimeout(self): def testAcceptTimeout(self): # Test accept() timeout - support.bind_port(self.sock, self.localhost) + socket_helper.bind_port(self.sock, self.localhost) self.sock.listen() self._sock_operation(1, 1.5, 'accept') def testSend(self): # Test send() timeout with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv: - support.bind_port(serv, self.localhost) + socket_helper.bind_port(serv, self.localhost) serv.listen() self.sock.connect(serv.getsockname()) # Send a lot of data in order to bypass buffering in the TCP stack. @@ -256,7 +257,7 @@ def testSend(self): def testSendto(self): # Test sendto() timeout with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv: - support.bind_port(serv, self.localhost) + socket_helper.bind_port(serv, self.localhost) serv.listen() self.sock.connect(serv.getsockname()) # The address argument is ignored since we already connected. @@ -266,7 +267,7 @@ def testSendto(self): def testSendall(self): # Test sendall() timeout with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as serv: - support.bind_port(serv, self.localhost) + socket_helper.bind_port(serv, self.localhost) serv.listen() self.sock.connect(serv.getsockname()) # Send a lot of data in order to bypass buffering in the TCP stack. @@ -285,7 +286,7 @@ def tearDown(self): def testRecvfromTimeout(self): # Test recvfrom() timeout # Prevent "Address already in use" socket exceptions - support.bind_port(self.sock, self.localhost) + socket_helper.bind_port(self.sock, self.localhost) self._sock_operation(1, 1.5, 'recvfrom', 1024) diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index 6af45145a7927..4bf5d39e619f6 100644 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -1,5 +1,6 @@ from unittest import mock from test import support +from test.support import socket_helper from test.test_httpservers import NoLogRequestHandler from unittest import TestCase from wsgiref.util import setup_testing_defaults @@ -263,7 +264,7 @@ def app(environ, start_response): class WsgiHandler(NoLogRequestHandler, WSGIRequestHandler): pass - server = make_server(support.HOST, 0, app, handler_class=WsgiHandler) + server = make_server(socket_helper.HOST, 0, app, handler_class=WsgiHandler) self.addCleanup(server.server_close) interrupted = threading.Event() diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index e5c3496ec548e..f68af527eae85 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -15,6 +15,7 @@ import io import contextlib from test import support +from test.support import socket_helper from test.support import ALWAYS_EQ, LARGEST, SMALLEST try: @@ -334,7 +335,7 @@ def run_server(): server.handle_request() # First request and attempt at second server.handle_request() # Retried second request - server = http.server.HTTPServer((support.HOST, 0), RequestHandler) + server = http.server.HTTPServer((socket_helper.HOST, 0), RequestHandler) self.addCleanup(server.server_close) thread = threading.Thread(target=run_server) thread.start() From webhook-mailer at python.org Sat Apr 25 04:35:27 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sat, 25 Apr 2020 08:35:27 -0000 Subject: [Python-checkins] bpo-40275: Avoid importing logging in test.support (GH-19601) Message-ID: https://github.com/python/cpython/commit/515fce4fc4bb0d2db97b17df275cf90640017f56 commit: 515fce4fc4bb0d2db97b17df275cf90640017f56 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-25T11:35:18+03:00 summary: bpo-40275: Avoid importing logging in test.support (GH-19601) Import logging lazily in assertLogs() in unittest. Move TestHandler from test.support to logging_helper. files: A Lib/test/support/logging_helper.py A Lib/unittest/_log.py A Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst M Doc/library/test.rst M Lib/test/support/__init__.py M Lib/test/test_logging.py M Lib/unittest/case.py diff --git a/Doc/library/test.rst b/Doc/library/test.rst index 1e6b1116212ef..c2aaecc183e77 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -1410,11 +1410,6 @@ The :mod:`test.support` module defines the following classes: Run *test* and return the result. -.. class:: TestHandler(logging.handlers.BufferingHandler) - - Class for logging support. - - .. class:: FakePath(path) Simple :term:`path-like object`. It implements the :meth:`__fspath__` diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 15cf45da18e2c..f48decc704cb8 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -15,7 +15,6 @@ import importlib import importlib.util import locale -import logging.handlers import os import platform import re @@ -99,8 +98,6 @@ "open_urlresource", # processes 'temp_umask', "reap_children", - # logging - "TestHandler", # threads "threading_setup", "threading_cleanup", "reap_threads", "start_threads", # miscellaneous @@ -2368,37 +2365,6 @@ def optim_args_from_interpreter_flags(): optimization settings in sys.flags.""" return subprocess._optim_args_from_interpreter_flags() -#============================================================ -# Support for assertions about logging. -#============================================================ - -class TestHandler(logging.handlers.BufferingHandler): - def __init__(self, matcher): - # BufferingHandler takes a "capacity" argument - # so as to know when to flush. As we're overriding - # shouldFlush anyway, we can set a capacity of zero. - # You can call flush() manually to clear out the - # buffer. - logging.handlers.BufferingHandler.__init__(self, 0) - self.matcher = matcher - - def shouldFlush(self): - return False - - def emit(self, record): - self.format(record) - self.buffer.append(record.__dict__) - - def matches(self, **kwargs): - """ - Look for a saved dict whose keys/values match the supplied arguments. - """ - result = False - for d in self.buffer: - if self.matcher.matches(d, **kwargs): - result = True - break - return result class Matcher(object): diff --git a/Lib/test/support/logging_helper.py b/Lib/test/support/logging_helper.py new file mode 100644 index 0000000000000..12fcca4f0f08d --- /dev/null +++ b/Lib/test/support/logging_helper.py @@ -0,0 +1,29 @@ +import logging.handlers + +class TestHandler(logging.handlers.BufferingHandler): + def __init__(self, matcher): + # BufferingHandler takes a "capacity" argument + # so as to know when to flush. As we're overriding + # shouldFlush anyway, we can set a capacity of zero. + # You can call flush() manually to clear out the + # buffer. + logging.handlers.BufferingHandler.__init__(self, 0) + self.matcher = matcher + + def shouldFlush(self): + return False + + def emit(self, record): + self.format(record) + self.buffer.append(record.__dict__) + + def matches(self, **kwargs): + """ + Look for a saved dict whose keys/values match the supplied arguments. + """ + result = False + for d in self.buffer: + if self.matcher.matches(d, **kwargs): + result = True + break + return result diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 241ed2c91de13..e1d0eb8145fe2 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -44,6 +44,7 @@ from test.support.script_helper import assert_python_ok, assert_python_failure from test import support from test.support import socket_helper +from test.support.logging_helper import TestHandler import textwrap import threading import time @@ -3524,7 +3525,7 @@ def test_formatting(self): @unittest.skipUnless(hasattr(logging.handlers, 'QueueListener'), 'logging.handlers.QueueListener required for this test') def test_queue_listener(self): - handler = support.TestHandler(support.Matcher()) + handler = TestHandler(support.Matcher()) listener = logging.handlers.QueueListener(self.queue, handler) listener.start() try: @@ -3540,7 +3541,7 @@ def test_queue_listener(self): # Now test with respect_handler_level set - handler = support.TestHandler(support.Matcher()) + handler = TestHandler(support.Matcher()) handler.setLevel(logging.CRITICAL) listener = logging.handlers.QueueListener(self.queue, handler, respect_handler_level=True) diff --git a/Lib/unittest/_log.py b/Lib/unittest/_log.py new file mode 100644 index 0000000000000..94e7e758bd9a0 --- /dev/null +++ b/Lib/unittest/_log.py @@ -0,0 +1,69 @@ +import logging +import collections + +from .case import _BaseTestCaseContext + + +_LoggingWatcher = collections.namedtuple("_LoggingWatcher", + ["records", "output"]) + +class _CapturingHandler(logging.Handler): + """ + A logging handler capturing all (raw and formatted) logging output. + """ + + def __init__(self): + logging.Handler.__init__(self) + self.watcher = _LoggingWatcher([], []) + + def flush(self): + pass + + def emit(self, record): + self.watcher.records.append(record) + msg = self.format(record) + self.watcher.output.append(msg) + + +class _AssertLogsContext(_BaseTestCaseContext): + """A context manager used to implement TestCase.assertLogs().""" + + LOGGING_FORMAT = "%(levelname)s:%(name)s:%(message)s" + + def __init__(self, test_case, logger_name, level): + _BaseTestCaseContext.__init__(self, test_case) + self.logger_name = logger_name + if level: + self.level = logging._nameToLevel.get(level, level) + else: + self.level = logging.INFO + self.msg = None + + def __enter__(self): + if isinstance(self.logger_name, logging.Logger): + logger = self.logger = self.logger_name + else: + logger = self.logger = logging.getLogger(self.logger_name) + formatter = logging.Formatter(self.LOGGING_FORMAT) + handler = _CapturingHandler() + handler.setFormatter(formatter) + self.watcher = handler.watcher + self.old_handlers = logger.handlers[:] + self.old_level = logger.level + self.old_propagate = logger.propagate + logger.handlers = [handler] + logger.setLevel(self.level) + logger.propagate = False + return handler.watcher + + def __exit__(self, exc_type, exc_value, tb): + self.logger.handlers = self.old_handlers + self.logger.propagate = self.old_propagate + self.logger.setLevel(self.old_level) + if exc_type is not None: + # let unexpected exceptions pass through + return False + if len(self.watcher.records) == 0: + self._raiseFailure( + "no logs of level {} or higher triggered on {}" + .format(logging.getLevelName(self.level), self.logger.name)) diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index d0ee561a3ae93..f8bc865ee8203 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -3,7 +3,6 @@ import sys import functools import difflib -import logging import pprint import re import warnings @@ -297,73 +296,6 @@ def __exit__(self, exc_type, exc_value, tb): -_LoggingWatcher = collections.namedtuple("_LoggingWatcher", - ["records", "output"]) - - -class _CapturingHandler(logging.Handler): - """ - A logging handler capturing all (raw and formatted) logging output. - """ - - def __init__(self): - logging.Handler.__init__(self) - self.watcher = _LoggingWatcher([], []) - - def flush(self): - pass - - def emit(self, record): - self.watcher.records.append(record) - msg = self.format(record) - self.watcher.output.append(msg) - - - -class _AssertLogsContext(_BaseTestCaseContext): - """A context manager used to implement TestCase.assertLogs().""" - - LOGGING_FORMAT = "%(levelname)s:%(name)s:%(message)s" - - def __init__(self, test_case, logger_name, level): - _BaseTestCaseContext.__init__(self, test_case) - self.logger_name = logger_name - if level: - self.level = logging._nameToLevel.get(level, level) - else: - self.level = logging.INFO - self.msg = None - - def __enter__(self): - if isinstance(self.logger_name, logging.Logger): - logger = self.logger = self.logger_name - else: - logger = self.logger = logging.getLogger(self.logger_name) - formatter = logging.Formatter(self.LOGGING_FORMAT) - handler = _CapturingHandler() - handler.setFormatter(formatter) - self.watcher = handler.watcher - self.old_handlers = logger.handlers[:] - self.old_level = logger.level - self.old_propagate = logger.propagate - logger.handlers = [handler] - logger.setLevel(self.level) - logger.propagate = False - return handler.watcher - - def __exit__(self, exc_type, exc_value, tb): - self.logger.handlers = self.old_handlers - self.logger.propagate = self.old_propagate - self.logger.setLevel(self.old_level) - if exc_type is not None: - # let unexpected exceptions pass through - return False - if len(self.watcher.records) == 0: - self._raiseFailure( - "no logs of level {} or higher triggered on {}" - .format(logging.getLevelName(self.level), self.logger.name)) - - class _OrderedChainMap(collections.ChainMap): def __iter__(self): seen = set() @@ -854,6 +786,8 @@ def assertLogs(self, logger=None, level=None): self.assertEqual(cm.output, ['INFO:foo:first message', 'ERROR:foo.bar:second message']) """ + # Lazy import to avoid importing logging if it is not needed. + from ._log import _AssertLogsContext return _AssertLogsContext(self, logger, level) def _getAssertEqualityFunc(self, first, second): diff --git a/Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst b/Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst new file mode 100644 index 0000000000000..09e0a97f3ed98 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst @@ -0,0 +1,2 @@ +The :mod:`logging` package is now imported lazily in :mod:`unittest` only +when the :meth:`~unittest.TestCase.assertLogs` assertion is used. From webhook-mailer at python.org Sat Apr 25 21:57:18 2020 From: webhook-mailer at python.org (Heshy Roskes) Date: Sun, 26 Apr 2020 01:57:18 -0000 Subject: [Python-checkins] Fix typo in object.__format__ docs (GH-19504) Message-ID: https://github.com/python/cpython/commit/ef33712baa2d15878b35a02fbd6ab301c999a5fe commit: ef33712baa2d15878b35a02fbd6ab301c999a5fe branch: master author: Heshy Roskes committer: GitHub date: 2020-04-25T21:57:09-04:00 summary: Fix typo in object.__format__ docs (GH-19504) files: M Doc/reference/datamodel.rst diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index 1c2706362b718..c5a7f046992dd 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1350,7 +1350,7 @@ Basic customization .. versionchanged:: 3.7 ``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather - than ``format(str(self), '')``. + than ``format(str(x), '')``. .. _richcmpfuncs: From webhook-mailer at python.org Sun Apr 26 13:49:18 2020 From: webhook-mailer at python.org (Nickolena Fisher) Date: Sun, 26 Apr 2020 17:49:18 -0000 Subject: [Python-checkins] Fix typo in Lib/typing.py (GH-19717) Message-ID: https://github.com/python/cpython/commit/cfaf4c09ab959a9e6d8fc446ba7595f132d770ac commit: cfaf4c09ab959a9e6d8fc446ba7595f132d770ac branch: master author: Nickolena Fisher committer: GitHub date: 2020-04-26T10:49:11-07:00 summary: Fix typo in Lib/typing.py (GH-19717) files: M Lib/typing.py diff --git a/Lib/typing.py b/Lib/typing.py index 0dcf291950f7d..1b13aed22a38c 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -975,7 +975,7 @@ def _no_init(self, *args, **kwargs): def _allow_reckless_class_cheks(): - """Allow instnance and class checks for special stdlib modules. + """Allow instance and class checks for special stdlib modules. The abc and functools modules indiscriminately call isinstance() and issubclass() on the whole MRO of a user class, which may contain protocols. From webhook-mailer at python.org Sun Apr 26 14:21:16 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Sun, 26 Apr 2020 18:21:16 -0000 Subject: [Python-checkins] bpo-40396: Support GenericAlias in the typing functions. (GH-19718) Message-ID: https://github.com/python/cpython/commit/68b352a6982f51e19bf9b9f4ae61b34f5864d131 commit: 68b352a6982f51e19bf9b9f4ae61b34f5864d131 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-26T21:21:08+03:00 summary: bpo-40396: Support GenericAlias in the typing functions. (GH-19718) files: A Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.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 b3a671732167e..46e0ea559ddb4 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -22,7 +22,7 @@ from typing import NamedTuple, TypedDict from typing import IO, TextIO, BinaryIO from typing import Pattern, Match -from typing import Annotated +from typing import Annotated, ForwardRef import abc import typing import weakref @@ -1756,11 +1756,17 @@ def test_extended_generic_rules_repr(self): def test_generic_forward_ref(self): def foobar(x: List[List['CC']]): ... + def foobar2(x: list[list[ForwardRef('CC')]]): ... class CC: ... self.assertEqual( get_type_hints(foobar, globals(), locals()), {'x': List[List[CC]]} ) + self.assertEqual( + get_type_hints(foobar2, globals(), locals()), + {'x': list[list[CC]]} + ) + T = TypeVar('T') AT = Tuple[T, ...] def barfoo(x: AT): ... @@ -2446,6 +2452,12 @@ def foo(a: Tuple['T']): self.assertEqual(get_type_hints(foo, globals(), locals()), {'a': Tuple[T]}) + def foo(a: tuple[ForwardRef('T')]): + pass + + self.assertEqual(get_type_hints(foo, globals(), locals()), + {'a': tuple[T]}) + def test_forward_recursion_actually(self): def namespace1(): a = typing.ForwardRef('A') @@ -2909,6 +2921,18 @@ def foobar(x: List['X']): ... get_type_hints(foobar, globals(), locals(), include_extras=True), {'x': List[Annotated[int, (1, 10)]]} ) + + def foobar(x: list[ForwardRef('X')]): ... + X = Annotated[int, (1, 10)] + self.assertEqual( + get_type_hints(foobar, globals(), locals()), + {'x': list[int]} + ) + self.assertEqual( + get_type_hints(foobar, globals(), locals(), include_extras=True), + {'x': list[Annotated[int, (1, 10)]]} + ) + BA = Tuple[Annotated[T, (1, 0)], ...] def barfoo(x: BA): ... self.assertEqual(get_type_hints(barfoo, globals(), locals())['x'], Tuple[T, ...]) @@ -2916,12 +2940,22 @@ def barfoo(x: BA): ... get_type_hints(barfoo, globals(), locals(), include_extras=True)['x'], BA ) + + BA = tuple[Annotated[T, (1, 0)], ...] + def barfoo(x: BA): ... + self.assertEqual(get_type_hints(barfoo, globals(), locals())['x'], tuple[T, ...]) + self.assertIs( + get_type_hints(barfoo, globals(), locals(), include_extras=True)['x'], + BA + ) + def barfoo2(x: typing.Callable[..., Annotated[List[T], "const"]], y: typing.Union[int, Annotated[T, "mutable"]]): ... self.assertEqual( get_type_hints(barfoo2, globals(), locals()), {'x': typing.Callable[..., List[T]], 'y': typing.Union[int, T]} ) + BA2 = typing.Callable[..., List[T]] def barfoo3(x: BA2): ... self.assertIs( @@ -2972,6 +3006,9 @@ class C(Generic[T]): pass self.assertIs(get_origin(Generic[T]), Generic) self.assertIs(get_origin(List[Tuple[T, T]][int]), list) self.assertIs(get_origin(Annotated[T, 'thing']), Annotated) + self.assertIs(get_origin(List), list) + self.assertIs(get_origin(list[int]), list) + self.assertIs(get_origin(list), None) def test_get_args(self): T = TypeVar('T') @@ -2993,6 +3030,9 @@ class C(Generic[T]): pass self.assertEqual(get_args(Tuple[int, ...]), (int, ...)) self.assertEqual(get_args(Tuple[()]), ((),)) self.assertEqual(get_args(Annotated[T, 'one', 2, ['three']]), (T, 'one', 2, ['three'])) + self.assertEqual(get_args(List), (typing.T,)) + self.assertEqual(get_args(list[int]), (int,)) + self.assertEqual(get_args(list), ()) class CollectionsAbcTests(BaseTestCase): diff --git a/Lib/typing.py b/Lib/typing.py index 1b13aed22a38c..1aefcb8a8a27d 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -191,7 +191,7 @@ def _subs_tvars(tp, tvars, subs): """Substitute type variables 'tvars' with substitutions 'subs'. These two must have the same length. """ - if not isinstance(tp, _GenericAlias): + if not isinstance(tp, (_GenericAlias, GenericAlias)): return tp new_args = list(tp.__args__) for a, arg in enumerate(tp.__args__): @@ -203,7 +203,10 @@ def _subs_tvars(tp, tvars, subs): new_args[a] = _subs_tvars(arg, tvars, subs) if tp.__origin__ is Union: return Union[tuple(new_args)] - return tp.copy_with(tuple(new_args)) + if isinstance(tp, GenericAlias): + return GenericAlias(tp.__origin__, tuple(new_args)) + else: + return tp.copy_with(tuple(new_args)) def _check_generic(cls, parameters): @@ -278,6 +281,11 @@ def _eval_type(t, globalns, localns): res = t.copy_with(ev_args) res._special = t._special return res + if isinstance(t, GenericAlias): + ev_args = tuple(_eval_type(a, globalns, localns) for a in t.__args__) + if ev_args == t.__args__: + return t + return GenericAlias(t.__origin__, ev_args) return t @@ -1368,6 +1376,11 @@ def _strip_annotations(t): res = t.copy_with(stripped_args) res._special = t._special return res + if isinstance(t, GenericAlias): + stripped_args = tuple(_strip_annotations(a) for a in t.__args__) + if stripped_args == t.__args__: + return t + return GenericAlias(t.__origin__, stripped_args) return t @@ -1387,7 +1400,7 @@ def get_origin(tp): """ if isinstance(tp, _AnnotatedAlias): return Annotated - if isinstance(tp, _GenericAlias): + if isinstance(tp, (_GenericAlias, GenericAlias)): return tp.__origin__ if tp is Generic: return Generic @@ -1407,9 +1420,9 @@ def get_args(tp): """ if isinstance(tp, _AnnotatedAlias): return (tp.__origin__,) + tp.__metadata__ - if isinstance(tp, _GenericAlias): + if isinstance(tp, (_GenericAlias, GenericAlias)): res = tp.__args__ - if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis: + if tp.__origin__ is collections.abc.Callable and res[0] is not Ellipsis: res = (list(res[:-1]), res[-1]) return res return () diff --git a/Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rst b/Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rst new file mode 100644 index 0000000000000..f4273ff19663e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rst @@ -0,0 +1,3 @@ +Functions :func:`typing.get_origin`, :func:`typing.get_args` and +:func:`typing.get_type_hints` support now generic aliases like +``list[int]``. From webhook-mailer at python.org Sun Apr 26 21:11:35 2020 From: webhook-mailer at python.org (Raymond Hettinger) Date: Mon, 27 Apr 2020 01:11:35 -0000 Subject: [Python-checkins] bpo-40387: Improve queue join() example. (GH-19724) Message-ID: https://github.com/python/cpython/commit/88499f15f547ccf7b15d37b0eaf51cc40bad5c39 commit: 88499f15f547ccf7b15d37b0eaf51cc40bad5c39 branch: master author: Raymond Hettinger committer: GitHub date: 2020-04-26T18:11:27-07:00 summary: bpo-40387: Improve queue join() example. (GH-19724) files: M Doc/library/queue.rst diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 2eeab5e262664..0ec5900bef5bb 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -190,32 +190,28 @@ fully processed by daemon consumer threads. Example of how to wait for enqueued tasks to be completed:: + import threading, queue + + q = queue.Queue() + def worker(): while True: item = q.get() - if item is None: - break - do_work(item) + print(f'Working on {item}') + print(f'Finished {item}') q.task_done() - q = queue.Queue() - threads = [] - for i in range(num_worker_threads): - t = threading.Thread(target=worker) - t.start() - threads.append(t) + # turn-on the worker thread + threading.Thread(target=worker, daemon=True).start() - for item in source(): + # send thirty task requests to the worker + for item in range(30): q.put(item) + print('All task requests sent\n', end='') # block until all tasks are done q.join() - - # stop workers - for i in range(num_worker_threads): - q.put(None) - for t in threads: - t.join() + print('All work completed') SimpleQueue Objects From webhook-mailer at python.org Sun Apr 26 21:23:21 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 27 Apr 2020 01:23:21 -0000 Subject: [Python-checkins] bpo-40387: Improve queue join() example. (GH-19724) (GH-19726) Message-ID: https://github.com/python/cpython/commit/179f22c3b786ce9baa3445923f8f9708dfa5d5b7 commit: 179f22c3b786ce9baa3445923f8f9708dfa5d5b7 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-26T18:23:14-07:00 summary: bpo-40387: Improve queue join() example. (GH-19724) (GH-19726) files: M Doc/library/queue.rst diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst index 2eeab5e262664..0ec5900bef5bb 100644 --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -190,32 +190,28 @@ fully processed by daemon consumer threads. Example of how to wait for enqueued tasks to be completed:: + import threading, queue + + q = queue.Queue() + def worker(): while True: item = q.get() - if item is None: - break - do_work(item) + print(f'Working on {item}') + print(f'Finished {item}') q.task_done() - q = queue.Queue() - threads = [] - for i in range(num_worker_threads): - t = threading.Thread(target=worker) - t.start() - threads.append(t) + # turn-on the worker thread + threading.Thread(target=worker, daemon=True).start() - for item in source(): + # send thirty task requests to the worker + for item in range(30): q.put(item) + print('All task requests sent\n', end='') # block until all tasks are done q.join() - - # stop workers - for i in range(num_worker_threads): - q.put(None) - for t in threads: - t.join() + print('All work completed') SimpleQueue Objects From webhook-mailer at python.org Sun Apr 26 22:08:24 2020 From: webhook-mailer at python.org (Ammar Askar) Date: Mon, 27 Apr 2020 02:08:24 -0000 Subject: [Python-checkins] bpo-40401: Remove duplicate pyhash.h include from pythoncore.vcxproj (GH-19725) Message-ID: https://github.com/python/cpython/commit/a494caa14bfa412af77792007c34274902fabb7b commit: a494caa14bfa412af77792007c34274902fabb7b branch: master author: Ammar Askar committer: GitHub date: 2020-04-26T21:08:17-05:00 summary: bpo-40401: Remove duplicate pyhash.h include from pythoncore.vcxproj (GH-19725) files: M PCbuild/pythoncore.vcxproj diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index 3484f44e961ea..d20e749b051a5 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -215,7 +215,6 @@ - From webhook-mailer at python.org Sun Apr 26 22:31:53 2020 From: webhook-mailer at python.org (Brad Solomon) Date: Mon, 27 Apr 2020 02:31:53 -0000 Subject: [Python-checkins] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) Message-ID: https://github.com/python/cpython/commit/b54e46cb57ebac5c525a9a6be241412cd57bc935 commit: b54e46cb57ebac5c525a9a6be241412cd57bc935 branch: master author: Brad Solomon committer: GitHub date: 2020-04-26T21:31:44-05:00 summary: bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs. Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvar#c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`. Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link. files: A Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst M Doc/c-api/intro.rst M Doc/c-api/module.rst diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index 5a99631bbbdcf..e89a788de0d50 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -187,6 +187,39 @@ complete listing. .. versionchanged:: 3.8 MSVC support was added. +.. c:macro:: PyDoc_STRVAR(name, str) + + Creates a variable with name ``name`` that can be used in docstrings. + If Python is built without docstrings, the value will be empty. + + Use :c:macro:`PyDoc_STRVAR` for docstrings to support building + Python without docstrings, as specified in :pep:`7`. + + Example:: + + PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element."); + + static PyMethodDef deque_methods[] = { + // ... + {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, + // ... + } + +.. c:macro:: PyDoc_STR(str) + + Creates a docstring for the given input string or an empty string + if docstrings are disabled. + + Use :c:macro:`PyDoc_STR` in specifying docstrings to support + building Python without docstrings, as specified in :pep:`7`. + + Example:: + + static PyMethodDef pysqlite_row_methods[] = { + {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, + PyDoc_STR("Returns the keys of the row.")}, + {NULL, NULL} + }; .. _api-objects: diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index cf1df2807361b..8a415dfa30a35 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -153,7 +153,7 @@ or request "multi-phase initialization" by returning the definition struct itsel .. c:member:: const char *m_doc Docstring for the module; usually a docstring variable created with - :c:func:`PyDoc_STRVAR` is used. + :c:macro:`PyDoc_STRVAR` is used. .. c:member:: Py_ssize_t m_size diff --git a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst new file mode 100644 index 0000000000000..a678fe5052673 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst @@ -0,0 +1 @@ +Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. From webhook-mailer at python.org Sun Apr 26 22:45:14 2020 From: webhook-mailer at python.org (Zachary Ware) Date: Mon, 27 Apr 2020 02:45:14 -0000 Subject: [Python-checkins] [3.8] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) (GH-19727) Message-ID: https://github.com/python/cpython/commit/ca5649c4c1ab260c8ceb8a57ec703c06e2707986 commit: ca5649c4c1ab260c8ceb8a57ec703c06e2707986 branch: 3.8 author: Zachary Ware committer: GitHub date: 2020-04-26T21:45:05-05:00 summary: [3.8] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) (GH-19727) Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs. Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvarGH-c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`. Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link. (cherry picked from commit b54e46c) Authored-by: Brad Solomon files: A Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst M Doc/c-api/intro.rst M Doc/c-api/module.rst diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index d08d4f97a308e..718f40eb6c247 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -174,6 +174,39 @@ complete listing. .. versionchanged:: 3.8 MSVC support was added. +.. c:macro:: PyDoc_STRVAR(name, str) + + Creates a variable with name ``name`` that can be used in docstrings. + If Python is built without docstrings, the value will be empty. + + Use :c:macro:`PyDoc_STRVAR` for docstrings to support building + Python without docstrings, as specified in :pep:`7`. + + Example:: + + PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element."); + + static PyMethodDef deque_methods[] = { + // ... + {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, + // ... + } + +.. c:macro:: PyDoc_STR(str) + + Creates a docstring for the given input string or an empty string + if docstrings are disabled. + + Use :c:macro:`PyDoc_STR` in specifying docstrings to support + building Python without docstrings, as specified in :pep:`7`. + + Example:: + + static PyMethodDef pysqlite_row_methods[] = { + {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, + PyDoc_STR("Returns the keys of the row.")}, + {NULL, NULL} + }; .. _api-objects: diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index 57902a9c7f838..d2b8f4c12503e 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -153,7 +153,7 @@ or request "multi-phase initialization" by returning the definition struct itsel .. c:member:: const char *m_doc Docstring for the module; usually a docstring variable created with - :c:func:`PyDoc_STRVAR` is used. + :c:macro:`PyDoc_STRVAR` is used. .. c:member:: Py_ssize_t m_size diff --git a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst new file mode 100644 index 0000000000000..a678fe5052673 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst @@ -0,0 +1 @@ +Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. From webhook-mailer at python.org Sun Apr 26 22:46:14 2020 From: webhook-mailer at python.org (Zachary Ware) Date: Mon, 27 Apr 2020 02:46:14 -0000 Subject: [Python-checkins] [3.7] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) (GH-19728) Message-ID: https://github.com/python/cpython/commit/70ba81459eeb5818848f86b65cdf78feb86f9612 commit: 70ba81459eeb5818848f86b65cdf78feb86f9612 branch: 3.7 author: Zachary Ware committer: GitHub date: 2020-04-26T21:46:06-05:00 summary: [3.7] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) (GH-19728) Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs. Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvarGH-c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`. Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link.. (cherry picked from commit b54e46cb57ebac5c525a9a6be241412cd57bc935) Co-authored-by: Brad Solomon files: A Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst M Doc/c-api/intro.rst M Doc/c-api/module.rst diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index e4aad1f6e0134..7c76ed878da96 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -162,6 +162,39 @@ complete listing. .. versionadded:: 3.4 +.. c:macro:: PyDoc_STRVAR(name, str) + + Creates a variable with name ``name`` that can be used in docstrings. + If Python is built without docstrings, the value will be empty. + + Use :c:macro:`PyDoc_STRVAR` for docstrings to support building + Python without docstrings, as specified in :pep:`7`. + + Example:: + + PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element."); + + static PyMethodDef deque_methods[] = { + // ... + {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, + // ... + } + +.. c:macro:: PyDoc_STR(str) + + Creates a docstring for the given input string or an empty string + if docstrings are disabled. + + Use :c:macro:`PyDoc_STR` in specifying docstrings to support + building Python without docstrings, as specified in :pep:`7`. + + Example:: + + static PyMethodDef pysqlite_row_methods[] = { + {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, + PyDoc_STR("Returns the keys of the row.")}, + {NULL, NULL} + }; .. _api-objects: diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst index a06e791e38f2e..c85bf17ca3d51 100644 --- a/Doc/c-api/module.rst +++ b/Doc/c-api/module.rst @@ -153,7 +153,7 @@ or request "multi-phase initialization" by returning the definition struct itsel .. c:member:: const char *m_doc Docstring for the module; usually a docstring variable created with - :c:func:`PyDoc_STRVAR` is used. + :c:macro:`PyDoc_STRVAR` is used. .. c:member:: Py_ssize_t m_size diff --git a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst new file mode 100644 index 0000000000000..a678fe5052673 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst @@ -0,0 +1 @@ +Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. From webhook-mailer at python.org Sun Apr 26 23:24:01 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Mon, 27 Apr 2020 03:24:01 -0000 Subject: [Python-checkins] bpo-40348: Fix typos in the programming FAQ (GH-19729) Message-ID: https://github.com/python/cpython/commit/caf1aadf3d020f742ba3d7fcf678ca700224914b commit: caf1aadf3d020f742ba3d7fcf678ca700224914b branch: master author: Zackery Spytz committer: GitHub date: 2020-04-26T20:23:52-07:00 summary: bpo-40348: Fix typos in the programming FAQ (GH-19729) files: M Doc/faq/programming.rst diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 68f9ce811a641..61ffc5dbdaa77 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1495,8 +1495,8 @@ to uppercase:: Here the ``UpperOut`` class redefines the ``write()`` method to convert the argument string to uppercase before calling the underlying -``self.__outfile.write()`` method. All other methods are delegated to the -underlying ``self.__outfile`` object. The delegation is accomplished via the +``self._outfile.write()`` method. All other methods are delegated to the +underlying ``self._outfile`` object. The delegation is accomplished via the ``__getattr__`` method; consult :ref:`the language reference ` for more information about controlling attribute access. From webhook-mailer at python.org Sun Apr 26 23:29:11 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 27 Apr 2020 03:29:11 -0000 Subject: [Python-checkins] bpo-40348: Fix typos in the programming FAQ (GH-19729) Message-ID: https://github.com/python/cpython/commit/25def5f2187154ccb6d75751f395a949f4726b1c commit: 25def5f2187154ccb6d75751f395a949f4726b1c branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-26T20:29:03-07:00 summary: bpo-40348: Fix typos in the programming FAQ (GH-19729) (cherry picked from commit caf1aadf3d020f742ba3d7fcf678ca700224914b) Co-authored-by: Zackery Spytz files: M Doc/faq/programming.rst diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 270f57d8b8093..604c8ff521e89 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1501,8 +1501,8 @@ to uppercase:: Here the ``UpperOut`` class redefines the ``write()`` method to convert the argument string to uppercase before calling the underlying -``self.__outfile.write()`` method. All other methods are delegated to the -underlying ``self.__outfile`` object. The delegation is accomplished via the +``self._outfile.write()`` method. All other methods are delegated to the +underlying ``self._outfile`` object. The delegation is accomplished via the ``__getattr__`` method; consult :ref:`the language reference ` for more information about controlling attribute access. From webhook-mailer at python.org Sun Apr 26 23:29:38 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Mon, 27 Apr 2020 03:29:38 -0000 Subject: [Python-checkins] bpo-40348: Fix typos in the programming FAQ (GH-19729) Message-ID: https://github.com/python/cpython/commit/9412f4d1ad28d48d8bb4725f05fd8f8d0daf8cd2 commit: 9412f4d1ad28d48d8bb4725f05fd8f8d0daf8cd2 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-26T20:29:30-07:00 summary: bpo-40348: Fix typos in the programming FAQ (GH-19729) (cherry picked from commit caf1aadf3d020f742ba3d7fcf678ca700224914b) Co-authored-by: Zackery Spytz files: M Doc/faq/programming.rst diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index 70b11d6e93056..6cc1b52ed7b98 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1494,8 +1494,8 @@ to uppercase:: Here the ``UpperOut`` class redefines the ``write()`` method to convert the argument string to uppercase before calling the underlying -``self.__outfile.write()`` method. All other methods are delegated to the -underlying ``self.__outfile`` object. The delegation is accomplished via the +``self._outfile.write()`` method. All other methods are delegated to the +underlying ``self._outfile`` object. The delegation is accomplished via the ``__getattr__`` method; consult :ref:`the language reference ` for more information about controlling attribute access. From webhook-mailer at python.org Mon Apr 27 03:27:30 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Mon, 27 Apr 2020 07:27:30 -0000 Subject: [Python-checkins] bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) Message-ID: https://github.com/python/cpython/commit/6292be7adf247589bbf03524f8883cb4cb61f3e9 commit: 6292be7adf247589bbf03524f8883cb4cb61f3e9 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-27T10:27:21+03:00 summary: bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) files: A Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.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 46e0ea559ddb4..f191d3bb9e90c 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3007,6 +3007,8 @@ class C(Generic[T]): pass self.assertIs(get_origin(List[Tuple[T, T]][int]), list) self.assertIs(get_origin(Annotated[T, 'thing']), Annotated) self.assertIs(get_origin(List), list) + self.assertIs(get_origin(Tuple), tuple) + self.assertIs(get_origin(Callable), collections.abc.Callable) self.assertIs(get_origin(list[int]), list) self.assertIs(get_origin(list), None) @@ -3024,13 +3026,16 @@ class C(Generic[T]): pass (int, Tuple[str, int])) self.assertEqual(get_args(typing.Dict[int, Tuple[T, T]][Optional[int]]), (int, Tuple[Optional[int], Optional[int]])) - self.assertEqual(get_args(Callable[[], T][int]), ([], int,)) + self.assertEqual(get_args(Callable[[], T][int]), ([], int)) + self.assertEqual(get_args(Callable[..., int]), (..., int)) self.assertEqual(get_args(Union[int, Callable[[Tuple[T, ...]], str]]), (int, Callable[[Tuple[T, ...]], str])) self.assertEqual(get_args(Tuple[int, ...]), (int, ...)) self.assertEqual(get_args(Tuple[()]), ((),)) self.assertEqual(get_args(Annotated[T, 'one', 2, ['three']]), (T, 'one', 2, ['three'])) - self.assertEqual(get_args(List), (typing.T,)) + self.assertEqual(get_args(List), ()) + self.assertEqual(get_args(Tuple), ()) + self.assertEqual(get_args(Callable), ()) self.assertEqual(get_args(list[int]), (int,)) self.assertEqual(get_args(list), ()) diff --git a/Lib/typing.py b/Lib/typing.py index 1aefcb8a8a27d..c82989861927d 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -1420,11 +1420,13 @@ def get_args(tp): """ if isinstance(tp, _AnnotatedAlias): return (tp.__origin__,) + tp.__metadata__ - if isinstance(tp, (_GenericAlias, GenericAlias)): + if isinstance(tp, _GenericAlias) and not tp._special: res = tp.__args__ if tp.__origin__ is collections.abc.Callable and res[0] is not Ellipsis: res = (list(res[:-1]), res[-1]) return res + if isinstance(tp, GenericAlias): + return tp.__args__ return () diff --git a/Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rst b/Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rst new file mode 100644 index 0000000000000..a56da0c109592 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rst @@ -0,0 +1,2 @@ +:func:`typing.get_args` now always returns an empty tuple for special +generic aliases. From webhook-mailer at python.org Mon Apr 27 06:18:27 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 27 Apr 2020 10:18:27 -0000 Subject: [Python-checkins] Add files in tests/test_peg_generator to the install target lists (GH-19723) Message-ID: https://github.com/python/cpython/commit/4044c843a5c6788b228d9aa38f51676f43b2ae94 commit: 4044c843a5c6788b228d9aa38f51676f43b2ae94 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-27T11:18:04+01:00 summary: Add files in tests/test_peg_generator to the install target lists (GH-19723) Update the "Makefile.pre.in" template and the "PCbuild/lib.pyproj" with the files in "Lib/test/test/test_peg_generator" so they get correctly installed along the rest of the standard library. files: M Makefile.pre.in M PCbuild/lib.pyproj diff --git a/Makefile.pre.in b/Makefile.pre.in index 400654718eb07..18fa97bec33d0 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1426,6 +1426,7 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \ ctypes ctypes/test ctypes/macholib \ idlelib idlelib/Icons idlelib/idle_test \ distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ + test/test_peg_generator \ test/test_tools test/test_warnings test/test_warnings/data \ turtledemo \ multiprocessing multiprocessing/dummy \ diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj index 0237b8cc85593..ee01d109f162d 100644 --- a/PCbuild/lib.pyproj +++ b/PCbuild/lib.pyproj @@ -1207,6 +1207,12 @@ + + + + + + @@ -1787,6 +1793,7 @@ + From webhook-mailer at python.org Mon Apr 27 08:22:27 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 27 Apr 2020 12:22:27 -0000 Subject: [Python-checkins] bpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types (GH-19414) Message-ID: https://github.com/python/cpython/commit/0169d3003be3d072751dd14a5c84748ab63a249f commit: 0169d3003be3d072751dd14a5c84748ab63a249f branch: master author: Pablo Galindo committer: GitHub date: 2020-04-27T14:22:19+02:00 summary: bpo-40217: Ensure Py_VISIT(Py_TYPE(self)) is always called for PyType_FromSpec types (GH-19414) files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a107715808fff..6a9bd701dfb17 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1021,6 +1021,38 @@ type_call(PyTypeObject *type, PyObject *args, PyObject *kwds) return obj; } +PyObject * +PyType_FromSpec_Alloc(PyTypeObject *type, Py_ssize_t nitems) +{ + PyObject *obj; + const size_t size = _Py_SIZE_ROUND_UP( + _PyObject_VAR_SIZE(type, nitems+1) + sizeof(traverseproc), + SIZEOF_VOID_P); + /* note that we need to add one, for the sentinel and space for the + provided tp-traverse: See bpo-40217 for more details */ + + if (PyType_IS_GC(type)) + obj = _PyObject_GC_Malloc(size); + else + obj = (PyObject *)PyObject_MALLOC(size); + + if (obj == NULL) + return PyErr_NoMemory(); + + obj = obj; + + memset(obj, '\0', size); + + if (type->tp_itemsize == 0) + (void)PyObject_INIT(obj, type); + else + (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); + + if (PyType_IS_GC(type)) + _PyObject_GC_TRACK(obj); + return obj; +} + PyObject * PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) { @@ -2853,6 +2885,36 @@ static const short slotoffsets[] = { #include "typeslots.inc" }; +static int +PyType_FromSpec_tp_traverse(PyObject *self, visitproc visit, void *arg) +{ + PyTypeObject *parent = Py_TYPE(self); + + // Only a instance of a type that is directly created by + // PyType_FromSpec (not subclasses) must visit its parent. + if (parent->tp_traverse == PyType_FromSpec_tp_traverse) { + Py_VISIT(parent); + } + + // Search for the original type that was created using PyType_FromSpec + PyTypeObject *base; + base = parent; + while (base->tp_traverse != PyType_FromSpec_tp_traverse) { + base = base->tp_base; + assert(base); + } + + // Extract the user defined traverse function that we placed at the end + // of the type and call it. + size_t size = Py_SIZE(base); + size_t _offset = _PyObject_VAR_SIZE(&PyType_Type, size+1); + traverseproc fun = *(traverseproc*)((char*)base + _offset); + if (fun == NULL) { + return 0; + } + return fun(self, visit, arg); +} + PyObject * PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) { @@ -2886,7 +2948,7 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) } } - res = (PyHeapTypeObject*)PyType_GenericAlloc(&PyType_Type, nmembers); + res = (PyHeapTypeObject*)PyType_FromSpec_Alloc(&PyType_Type, nmembers); if (res == NULL) return NULL; res_start = (char*)res; @@ -2991,6 +3053,26 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) memcpy(PyHeapType_GET_MEMBERS(res), slot->pfunc, len); type->tp_members = PyHeapType_GET_MEMBERS(res); } + else if (slot->slot == Py_tp_traverse) { + + /* Types created by PyType_FromSpec own a strong reference to their + * type, but this was added in Python 3.8. The tp_traverse function + * needs to call Py_VISIT on the type but all existing traverse + * functions cannot be updated (especially the ones from existing user + * functions) so we need to provide a tp_traverse that manually calls + * Py_VISIT(Py_TYPE(self)) and then call the provided tp_traverse. In + * this way, user functions do not need to be updated, preserve + * backwards compatibility. + * + * We store the user-provided traverse function at the end of the type + * (we have allocated space for it) so we can call it from our + * PyType_FromSpec_tp_traverse wrapper. */ + + type->tp_traverse = PyType_FromSpec_tp_traverse; + size_t _offset = _PyObject_VAR_SIZE(&PyType_Type, nmembers+1); + traverseproc *user_traverse = (traverseproc*)((char*)type + _offset); + *user_traverse = slot->pfunc; + } else { /* Copy other slots directly */ *(void**)(res_start + slotoffsets[slot->slot]) = slot->pfunc; From webhook-mailer at python.org Mon Apr 27 10:24:39 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 27 Apr 2020 14:24:39 -0000 Subject: [Python-checkins] bpo-40217: Clean code in PyType_FromSpec_Alloc and add NEWS entry (GH-19733) Message-ID: https://github.com/python/cpython/commit/91a5ae18351027867e99c96db5ea235d9c42e47a commit: 91a5ae18351027867e99c96db5ea235d9c42e47a branch: master author: Pablo Galindo committer: GitHub date: 2020-04-27T15:24:31+01:00 summary: bpo-40217: Clean code in PyType_FromSpec_Alloc and add NEWS entry (GH-19733) files: A Misc/NEWS.d/next/C API/2020-04-27-14-00-38.bpo-40217.sgn6c8.rst M Objects/typeobject.c diff --git a/Misc/NEWS.d/next/C API/2020-04-27-14-00-38.bpo-40217.sgn6c8.rst b/Misc/NEWS.d/next/C API/2020-04-27-14-00-38.bpo-40217.sgn6c8.rst new file mode 100644 index 0000000000000..72df4a7b56d40 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-27-14-00-38.bpo-40217.sgn6c8.rst @@ -0,0 +1,5 @@ +Ensure that instances of types created with +:c:func:`PyType_FromSpecWithBases` will visit its class object when +traversing references in the garbage collector (implemented as an extension +of the provided :c:member:`~PyTypeObject.tp_traverse`). Patch by Pablo +Galindo. diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 6a9bd701dfb17..bf95dd604e58e 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1031,25 +1031,29 @@ PyType_FromSpec_Alloc(PyTypeObject *type, Py_ssize_t nitems) /* note that we need to add one, for the sentinel and space for the provided tp-traverse: See bpo-40217 for more details */ - if (PyType_IS_GC(type)) + if (PyType_IS_GC(type)) { obj = _PyObject_GC_Malloc(size); - else + } + else { obj = (PyObject *)PyObject_MALLOC(size); + } - if (obj == NULL) + if (obj == NULL) { return PyErr_NoMemory(); - - obj = obj; + } memset(obj, '\0', size); - if (type->tp_itemsize == 0) + if (type->tp_itemsize == 0) { (void)PyObject_INIT(obj, type); - else + } + else { (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); + } - if (PyType_IS_GC(type)) + if (PyType_IS_GC(type)) { _PyObject_GC_TRACK(obj); + } return obj; } @@ -3066,7 +3070,11 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases) * * We store the user-provided traverse function at the end of the type * (we have allocated space for it) so we can call it from our - * PyType_FromSpec_tp_traverse wrapper. */ + * PyType_FromSpec_tp_traverse wrapper. + * + * Check bpo-40217 for more information and rationale about this issue. + * + * */ type->tp_traverse = PyType_FromSpec_tp_traverse; size_t _offset = _PyObject_VAR_SIZE(&PyType_Type, nmembers+1); From webhook-mailer at python.org Mon Apr 27 10:53:02 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Mon, 27 Apr 2020 14:53:02 -0000 Subject: [Python-checkins] bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712) Message-ID: https://github.com/python/cpython/commit/c5c42815ecb560bbf34db99b0e15fe9b604be889 commit: c5c42815ecb560bbf34db99b0e15fe9b604be889 branch: master author: Dong-hee Na committer: GitHub date: 2020-04-27T23:52:55+09:00 summary: bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712) files: A Misc/NEWS.d/next/Library/2020-04-25-23-14-11.bpo-40375.5GuK2A.rst M Doc/library/imaplib.rst M Doc/whatsnew/3.9.rst M Lib/imaplib.py M Lib/test/test_imaplib.py diff --git a/Doc/library/imaplib.rst b/Doc/library/imaplib.rst index 5b8ca7ce68fd9..7c5b075016159 100644 --- a/Doc/library/imaplib.rst +++ b/Doc/library/imaplib.rst @@ -582,6 +582,15 @@ An :class:`IMAP4` instance has the following methods: Unsubscribe from old mailbox. +.. method:: IMAP4.unselect() + + :meth:`imaplib.IMAP4.unselect` frees server's resources associated with the + selected mailbox and returns the server to the authenticated + state. This command performs the same actions as :meth:`imaplib.IMAP4.close`, except + that no messages are permanently removed from the currently + selected mailbox. + + .. versionadded:: 3.9 .. method:: IMAP4.xatom(name[, ...]) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 728e6001daabf..0b15ec73641bd 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -320,6 +320,13 @@ with this change. The overridden methods of :class:`~imaplib.IMAP4_SSL` and :class:`~imaplib.IMAP4_stream` were applied to this change. (Contributed by Dong-hee Na in :issue:`38615`.) +:meth:`imaplib.IMAP4.unselect` is added. +:meth:`imaplib.IMAP4.unselect` frees server's resources associated with the +selected mailbox and returns the server to the authenticated +state. This command performs the same actions as :meth:`imaplib.IMAP4.close`, except +that no messages are permanently removed from the currently +selected mailbox. (Contributed by Dong-hee Na in :issue:`40375`.) + importlib --------- diff --git a/Lib/imaplib.py b/Lib/imaplib.py index abfdd737779a0..d9720f20c3902 100644 --- a/Lib/imaplib.py +++ b/Lib/imaplib.py @@ -98,6 +98,7 @@ 'THREAD': ('SELECTED',), 'UID': ('SELECTED',), 'UNSUBSCRIBE': ('AUTH', 'SELECTED'), + 'UNSELECT': ('SELECTED',), } # Patterns to match server responses @@ -902,6 +903,22 @@ def unsubscribe(self, mailbox): return self._simple_command('UNSUBSCRIBE', mailbox) + def unselect(self): + """Free server's resources associated with the selected mailbox + and returns the server to the authenticated state. + This command performs the same actions as CLOSE, except + that no messages are permanently removed from the currently + selected mailbox. + + (typ, [data]) = .unselect() + """ + try: + typ, data = self._simple_command('UNSELECT') + finally: + self.state = 'AUTH' + return typ, data + + def xatom(self, name, *args): """Allow simple extension commands notified by server in CAPABILITY response. diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 764566695170a..69ee63b18c373 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -116,6 +116,7 @@ class SimpleIMAPHandler(socketserver.StreamRequestHandler): def setup(self): super().setup() + self.server.is_selected = False self.server.logged = None def _send(self, message): @@ -190,6 +191,18 @@ def cmd_LOGIN(self, tag, args): self.server.logged = args[0] self._send_tagged(tag, 'OK', 'LOGIN completed') + def cmd_SELECT(self, tag, args): + self.server.is_selected = True + self._send_line(b'* 2 EXISTS') + self._send_tagged(tag, 'OK', '[READ-WRITE] SELECT completed.') + + def cmd_UNSELECT(self, tag, args): + if self.server.is_selected: + self.server.is_selected = False + self._send_tagged(tag, 'OK', 'Returned to authenticated state. (Success)') + else: + self._send_tagged(tag, 'BAD', 'No mailbox selected') + class NewIMAPTestsMixin(): client = None @@ -511,6 +524,18 @@ def cmd_LSUB(self, tag, args): self.assertEqual(typ, 'OK') self.assertEqual(data[0], b'() "." directoryA') + def test_unselect(self): + client, _ = self._setup(SimpleIMAPHandler) + client.login('user', 'pass') + typ, data = client.select() + self.assertEqual(typ, 'OK') + self.assertEqual(data[0], b'2') + + typ, data = client.unselect() + self.assertEqual(typ, 'OK') + self.assertEqual(data[0], b'Returned to authenticated state. (Success)') + self.assertEqual(client.state, 'AUTH') + class NewIMAPTests(NewIMAPTestsMixin, unittest.TestCase): imap_class = imaplib.IMAP4 diff --git a/Misc/NEWS.d/next/Library/2020-04-25-23-14-11.bpo-40375.5GuK2A.rst b/Misc/NEWS.d/next/Library/2020-04-25-23-14-11.bpo-40375.5GuK2A.rst new file mode 100644 index 0000000000000..eb58e00bcf7d4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-25-23-14-11.bpo-40375.5GuK2A.rst @@ -0,0 +1 @@ +:meth:`imaplib.IMAP4.unselect` is added. Patch by Dong-hee Na. From webhook-mailer at python.org Mon Apr 27 12:11:21 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 27 Apr 2020 16:11:21 -0000 Subject: [Python-checkins] bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735) Message-ID: https://github.com/python/cpython/commit/9adccc1384568f4d46e37f698cb3e3a4f6ca0252 commit: 9adccc1384568f4d46e37f698cb3e3a4f6ca0252 branch: master author: Victor Stinner committer: GitHub date: 2020-04-27T09:11:10-07:00 summary: bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735) Add a new close() method to multiprocessing.SimpleQueue to explicitly close the queue. Automerge-Triggered-By: @pitrou files: A Misc/NEWS.d/next/Library/2020-04-27-17-19-09.bpo-30966._5lDx-.rst M Doc/library/multiprocessing.rst M Doc/whatsnew/3.9.rst M Lib/multiprocessing/queues.py M Lib/test/_test_multiprocessing.py diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index ec9521f1fb4a0..50b90031ab5a5 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -878,6 +878,16 @@ For an example of the usage of queues for interprocess communication see It is a simplified :class:`Queue` type, very close to a locked :class:`Pipe`. + .. method:: close() + + Close the queue: release internal resources. + + A queue must not be used anymore after it is closed. For example, + :meth:`get`, :meth:`put` and :meth:`empty` methods must no longer be + called. + + .. versionadded:: 3.9 + .. method:: empty() Return ``True`` if the queue is empty, ``False`` otherwise. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 0b15ec73641bd..13cd09b0b8be5 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -376,6 +376,14 @@ nntplib if the given timeout for their constructor is zero to prevent the creation of a non-blocking socket. (Contributed by Dong-hee Na in :issue:`39259`.) +multiprocessing +--------------- + +The :class:`multiprocessing.SimpleQueue` class has a new +:meth:`~multiprocessing.SimpleQueue.close` method to explicitly close the +queue. +(Contributed by Victor Stinner in :issue:`30966`.) + os -- diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index c0a284d10c807..a2901814876d6 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -346,6 +346,10 @@ def __init__(self, *, ctx): else: self._wlock = ctx.Lock() + def close(self): + self._reader.close() + self._writer.close() + def empty(self): return not self._poll() diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 083ad536a051c..dd894f21f7afc 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -5244,6 +5244,20 @@ def test_empty(self): proc.join() + def test_close(self): + queue = multiprocessing.SimpleQueue() + queue.close() + # closing a queue twice should not fail + queue.close() + + # Test specific to CPython since it tests private attributes + @test.support.cpython_only + def test_closed(self): + queue = multiprocessing.SimpleQueue() + queue.close() + self.assertTrue(queue._reader.closed) + self.assertTrue(queue._writer.closed) + class TestPoolNotLeakOnFailure(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2020-04-27-17-19-09.bpo-30966._5lDx-.rst b/Misc/NEWS.d/next/Library/2020-04-27-17-19-09.bpo-30966._5lDx-.rst new file mode 100644 index 0000000000000..14e9e11538763 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-27-17-19-09.bpo-30966._5lDx-.rst @@ -0,0 +1,2 @@ +Add a new :meth:`~multiprocessing.SimpleQueue.close` method to the +:class:`~multiprocessing.SimpleQueue` class to explicitly close the queue. From webhook-mailer at python.org Mon Apr 27 13:02:16 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 27 Apr 2020 17:02:16 -0000 Subject: [Python-checkins] bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721) Message-ID: https://github.com/python/cpython/commit/2b74c835a7280840a853e3a9aaeb83758b13a458 commit: 2b74c835a7280840a853e3a9aaeb83758b13a458 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-27T18:02:07+01:00 summary: bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721) This commit also allows to pass flags to the new parser in all interfaces and fixes a bug in the parser generator that was causing to inline rules with actions, making them disappear. files: M Grammar/python.gram M Include/internal/pegen_interface.h M Lib/test/test_flufl.py M Modules/_peg_parser.c M Parser/pegen/parse.c M Parser/pegen/parse_string.c M Parser/pegen/peg_api.c M Parser/pegen/pegen.c M Parser/pegen/pegen.h M Python/pythonrun.c M Tools/peg_generator/peg_extension/peg_extension.c M Tools/peg_generator/pegen/c_generator.py diff --git a/Grammar/python.gram b/Grammar/python.gram index 40ca3dc8d12a5..0ff2dcca884f1 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -323,7 +323,8 @@ compare_op_bitwise_or_pair[CmpopExprPair*]: | isnot_bitwise_or | is_bitwise_or eq_bitwise_or[CmpopExprPair*]: '==' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Eq, a) } -noteq_bitwise_or[CmpopExprPair*]: '!=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, NotEq, a) } +noteq_bitwise_or[CmpopExprPair*]: + | (tok='!=' {_PyPegen_check_barry_as_flufl(p) ? NULL : tok}) a=bitwise_or {_PyPegen_cmpop_expr_pair(p, NotEq, a) } lte_bitwise_or[CmpopExprPair*]: '<=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, LtE, a) } lt_bitwise_or[CmpopExprPair*]: '<' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Lt, a) } gte_bitwise_or[CmpopExprPair*]: '>=' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, GtE, a) } diff --git a/Include/internal/pegen_interface.h b/Include/internal/pegen_interface.h index d8621c1a88927..adff7315681e3 100644 --- a/Include/internal/pegen_interface.h +++ b/Include/internal/pegen_interface.h @@ -11,21 +11,24 @@ extern "C" { #include "Python.h" #include "Python-ast.h" -PyAPI_FUNC(mod_ty) PyPegen_ASTFromFile(const char *filename, int mode, PyArena *arena); +PyAPI_FUNC(mod_ty) PyPegen_ASTFromFile(const char *filename, int mode, PyCompilerFlags*, PyArena *arena); PyAPI_FUNC(mod_ty) PyPegen_ASTFromString(const char *str, int mode, PyCompilerFlags *flags, PyArena *arena); PyAPI_FUNC(mod_ty) PyPegen_ASTFromStringObject(const char *str, PyObject* filename, int mode, PyCompilerFlags *flags, PyArena *arena); PyAPI_FUNC(mod_ty) PyPegen_ASTFromFileObject(FILE *fp, PyObject *filename_ob, int mode, const char *enc, const char *ps1, - const char *ps2, int *errcode, PyArena *arena); -PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromFile(const char *filename, int mode); + const char *ps2, PyCompilerFlags *flags, + int *errcode, PyArena *arena); +PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromFile(const char *filename, int mode, PyCompilerFlags *flags); PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromString(const char *str, int mode, PyCompilerFlags *flags); PyAPI_FUNC(PyCodeObject *) PyPegen_CodeObjectFromFileObject(FILE *, PyObject *filename_ob, - int mode, const char *enc, + int mode, const char *ps1, const char *ps2, + PyCompilerFlags *flags, + const char *enc, int *errcode); #ifdef __cplusplus diff --git a/Lib/test/test_flufl.py b/Lib/test/test_flufl.py index 35ab934ab373d..b71442804c72b 100644 --- a/Lib/test/test_flufl.py +++ b/Lib/test/test_flufl.py @@ -4,7 +4,6 @@ from test import support - at support.skip_if_new_parser("Not supported by pegen yet") class FLUFLTests(unittest.TestCase): def test_barry_as_bdfl(self): @@ -16,10 +15,13 @@ def test_barry_as_bdfl(self): __future__.CO_FUTURE_BARRY_AS_BDFL) self.assertRegex(str(cm.exception), "with Barry as BDFL, use '<>' instead of '!='") - self.assertEqual(cm.exception.text, '2 != 3\n') + self.assertIn('2 != 3', cm.exception.text) self.assertEqual(cm.exception.filename, '') - self.assertEqual(cm.exception.lineno, 2) - self.assertEqual(cm.exception.offset, 4) + + self.assertTrue(cm.exception.lineno, 2) + # The old parser reports the end of the token and the new + # parser reports the start of the token + self.assertEqual(cm.exception.offset, 4 if support.use_old_parser() else 3) def test_guido_as_bdfl(self): code = '2 {0} 3' @@ -27,10 +29,12 @@ def test_guido_as_bdfl(self): with self.assertRaises(SyntaxError) as cm: compile(code.format('<>'), '', 'exec') self.assertRegex(str(cm.exception), "invalid syntax") - self.assertEqual(cm.exception.text, '2 <> 3\n') + self.assertIn('2 <> 3', cm.exception.text) self.assertEqual(cm.exception.filename, '') self.assertEqual(cm.exception.lineno, 1) - self.assertEqual(cm.exception.offset, 4) + # The old parser reports the end of the token and the new + # parser reports the start of the token + self.assertEqual(cm.exception.offset, 4 if support.use_old_parser() else 3) if __name__ == '__main__': diff --git a/Modules/_peg_parser.c b/Modules/_peg_parser.c index cb5f9aa63aea3..e1ec36e07bd57 100644 --- a/Modules/_peg_parser.c +++ b/Modules/_peg_parser.c @@ -28,9 +28,10 @@ _Py_parse_file(PyObject *self, PyObject *args, PyObject *kwds) return NULL; } + PyCompilerFlags flags = _PyCompilerFlags_INIT; PyObject *result = NULL; - mod_ty res = PyPegen_ASTFromFile(filename, mode, arena); + mod_ty res = PyPegen_ASTFromFile(filename, mode, &flags, arena); if (res == NULL) { goto error; } diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index 25607eaf73cdc..b26f7327bd273 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -297,37 +297,37 @@ static KeywordToken *reserved_keywords[] = { #define _loop1_83_type 1226 #define _loop1_84_type 1227 #define _loop1_85_type 1228 -#define _loop0_87_type 1229 -#define _gather_86_type 1230 -#define _tmp_88_type 1231 +#define _tmp_86_type 1229 +#define _loop0_88_type 1230 +#define _gather_87_type 1231 #define _tmp_89_type 1232 #define _tmp_90_type 1233 #define _tmp_91_type 1234 -#define _loop1_92_type 1235 -#define _tmp_93_type 1236 +#define _tmp_92_type 1235 +#define _loop1_93_type 1236 #define _tmp_94_type 1237 -#define _loop0_96_type 1238 -#define _gather_95_type 1239 -#define _loop1_97_type 1240 -#define _tmp_98_type 1241 +#define _tmp_95_type 1238 +#define _loop0_97_type 1239 +#define _gather_96_type 1240 +#define _loop1_98_type 1241 #define _tmp_99_type 1242 -#define _loop0_101_type 1243 -#define _gather_100_type 1244 -#define _loop0_103_type 1245 -#define _gather_102_type 1246 -#define _loop0_105_type 1247 -#define _gather_104_type 1248 -#define _loop0_107_type 1249 -#define _gather_106_type 1250 -#define _loop0_108_type 1251 -#define _loop0_110_type 1252 -#define _gather_109_type 1253 -#define _tmp_111_type 1254 -#define _loop0_113_type 1255 -#define _gather_112_type 1256 -#define _loop0_115_type 1257 -#define _gather_114_type 1258 -#define _tmp_116_type 1259 +#define _tmp_100_type 1243 +#define _loop0_102_type 1244 +#define _gather_101_type 1245 +#define _loop0_104_type 1246 +#define _gather_103_type 1247 +#define _loop0_106_type 1248 +#define _gather_105_type 1249 +#define _loop0_108_type 1250 +#define _gather_107_type 1251 +#define _loop0_109_type 1252 +#define _loop0_111_type 1253 +#define _gather_110_type 1254 +#define _tmp_112_type 1255 +#define _loop0_114_type 1256 +#define _gather_113_type 1257 +#define _loop0_116_type 1258 +#define _gather_115_type 1259 #define _tmp_117_type 1260 #define _tmp_118_type 1261 #define _tmp_119_type 1262 @@ -346,8 +346,9 @@ static KeywordToken *reserved_keywords[] = { #define _tmp_132_type 1275 #define _tmp_133_type 1276 #define _tmp_134_type 1277 -#define _loop0_135_type 1278 -#define _tmp_136_type 1279 +#define _tmp_135_type 1278 +#define _loop0_136_type 1279 +#define _tmp_137_type 1280 static mod_ty file_rule(Parser *p); static mod_ty interactive_rule(Parser *p); @@ -578,37 +579,37 @@ static asdl_seq *_gather_81_rule(Parser *p); static asdl_seq *_loop1_83_rule(Parser *p); static asdl_seq *_loop1_84_rule(Parser *p); static asdl_seq *_loop1_85_rule(Parser *p); -static asdl_seq *_loop0_87_rule(Parser *p); -static asdl_seq *_gather_86_rule(Parser *p); -static void *_tmp_88_rule(Parser *p); +static void *_tmp_86_rule(Parser *p); +static asdl_seq *_loop0_88_rule(Parser *p); +static asdl_seq *_gather_87_rule(Parser *p); static void *_tmp_89_rule(Parser *p); static void *_tmp_90_rule(Parser *p); static void *_tmp_91_rule(Parser *p); -static asdl_seq *_loop1_92_rule(Parser *p); -static void *_tmp_93_rule(Parser *p); +static void *_tmp_92_rule(Parser *p); +static asdl_seq *_loop1_93_rule(Parser *p); static void *_tmp_94_rule(Parser *p); -static asdl_seq *_loop0_96_rule(Parser *p); -static asdl_seq *_gather_95_rule(Parser *p); -static asdl_seq *_loop1_97_rule(Parser *p); -static void *_tmp_98_rule(Parser *p); +static void *_tmp_95_rule(Parser *p); +static asdl_seq *_loop0_97_rule(Parser *p); +static asdl_seq *_gather_96_rule(Parser *p); +static asdl_seq *_loop1_98_rule(Parser *p); static void *_tmp_99_rule(Parser *p); -static asdl_seq *_loop0_101_rule(Parser *p); -static asdl_seq *_gather_100_rule(Parser *p); -static asdl_seq *_loop0_103_rule(Parser *p); -static asdl_seq *_gather_102_rule(Parser *p); -static asdl_seq *_loop0_105_rule(Parser *p); -static asdl_seq *_gather_104_rule(Parser *p); -static asdl_seq *_loop0_107_rule(Parser *p); -static asdl_seq *_gather_106_rule(Parser *p); +static void *_tmp_100_rule(Parser *p); +static asdl_seq *_loop0_102_rule(Parser *p); +static asdl_seq *_gather_101_rule(Parser *p); +static asdl_seq *_loop0_104_rule(Parser *p); +static asdl_seq *_gather_103_rule(Parser *p); +static asdl_seq *_loop0_106_rule(Parser *p); +static asdl_seq *_gather_105_rule(Parser *p); static asdl_seq *_loop0_108_rule(Parser *p); -static asdl_seq *_loop0_110_rule(Parser *p); -static asdl_seq *_gather_109_rule(Parser *p); -static void *_tmp_111_rule(Parser *p); -static asdl_seq *_loop0_113_rule(Parser *p); -static asdl_seq *_gather_112_rule(Parser *p); -static asdl_seq *_loop0_115_rule(Parser *p); -static asdl_seq *_gather_114_rule(Parser *p); -static void *_tmp_116_rule(Parser *p); +static asdl_seq *_gather_107_rule(Parser *p); +static asdl_seq *_loop0_109_rule(Parser *p); +static asdl_seq *_loop0_111_rule(Parser *p); +static asdl_seq *_gather_110_rule(Parser *p); +static void *_tmp_112_rule(Parser *p); +static asdl_seq *_loop0_114_rule(Parser *p); +static asdl_seq *_gather_113_rule(Parser *p); +static asdl_seq *_loop0_116_rule(Parser *p); +static asdl_seq *_gather_115_rule(Parser *p); static void *_tmp_117_rule(Parser *p); static void *_tmp_118_rule(Parser *p); static void *_tmp_119_rule(Parser *p); @@ -627,8 +628,9 @@ static void *_tmp_131_rule(Parser *p); static void *_tmp_132_rule(Parser *p); static void *_tmp_133_rule(Parser *p); static void *_tmp_134_rule(Parser *p); -static asdl_seq *_loop0_135_rule(Parser *p); -static void *_tmp_136_rule(Parser *p); +static void *_tmp_135_rule(Parser *p); +static asdl_seq *_loop0_136_rule(Parser *p); +static void *_tmp_137_rule(Parser *p); // file: statements? $ @@ -5557,7 +5559,7 @@ eq_bitwise_or_rule(Parser *p) return res; } -// noteq_bitwise_or: '!=' bitwise_or +// noteq_bitwise_or: ('!=') bitwise_or static CmpopExprPair* noteq_bitwise_or_rule(Parser *p) { @@ -5566,11 +5568,11 @@ noteq_bitwise_or_rule(Parser *p) } CmpopExprPair* res = NULL; int mark = p->mark; - { // '!=' bitwise_or + { // ('!=') bitwise_or + void *_tmp_86_var; expr_ty a; - void *literal; if ( - (literal = _PyPegen_expect_token(p, 28)) + (_tmp_86_var = _tmp_86_rule(p)) && (a = bitwise_or_rule(p)) ) @@ -7012,7 +7014,7 @@ slices_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_86_rule(p)) + (a = _gather_87_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -7068,7 +7070,7 @@ slice_rule(Parser *p) && (b = expression_rule(p), 1) && - (c = _tmp_88_rule(p), 1) + (c = _tmp_89_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -7256,40 +7258,40 @@ atom_rule(Parser *p) p->mark = mark; } { // &'(' (tuple | group | genexp) - void *_tmp_89_var; + void *_tmp_90_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7) && - (_tmp_89_var = _tmp_89_rule(p)) + (_tmp_90_var = _tmp_90_rule(p)) ) { - res = _tmp_89_var; + res = _tmp_90_var; goto done; } p->mark = mark; } { // &'[' (list | listcomp) - void *_tmp_90_var; + void *_tmp_91_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9) && - (_tmp_90_var = _tmp_90_rule(p)) + (_tmp_91_var = _tmp_91_rule(p)) ) { - res = _tmp_90_var; + res = _tmp_91_var; goto done; } p->mark = mark; } { // &'{' (dict | set | dictcomp | setcomp) - void *_tmp_91_var; + void *_tmp_92_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25) && - (_tmp_91_var = _tmp_91_rule(p)) + (_tmp_92_var = _tmp_92_rule(p)) ) { - res = _tmp_91_var; + res = _tmp_92_var; goto done; } p->mark = mark; @@ -7336,7 +7338,7 @@ strings_rule(Parser *p) { // STRING+ asdl_seq * a; if ( - (a = _loop1_92_rule(p)) + (a = _loop1_93_rule(p)) ) { res = _PyPegen_concatenate_strings ( p , a ); @@ -7494,7 +7496,7 @@ tuple_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 7)) && - (a = _tmp_93_rule(p), 1) + (a = _tmp_94_rule(p), 1) && (literal_1 = _PyPegen_expect_token(p, 8)) ) @@ -7537,7 +7539,7 @@ group_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 7)) && - (a = _tmp_94_rule(p)) + (a = _tmp_95_rule(p)) && (literal_1 = _PyPegen_expect_token(p, 8)) ) @@ -7856,7 +7858,7 @@ kvpairs_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_95_rule(p)) + (a = _gather_96_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -7940,7 +7942,7 @@ for_if_clauses_rule(Parser *p) { // ((ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*))+ asdl_seq * a; if ( - (a = _loop1_97_rule(p)) + (a = _loop1_98_rule(p)) ) { res = a; @@ -8106,7 +8108,7 @@ args_rule(Parser *p) if ( (a = starred_expression_rule(p)) && - (b = _tmp_98_rule(p), 1) + (b = _tmp_99_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8155,7 +8157,7 @@ args_rule(Parser *p) if ( (a = named_expression_rule(p)) && - (b = _tmp_99_rule(p), 1) + (b = _tmp_100_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8197,11 +8199,11 @@ kwargs_rule(Parser *p) asdl_seq * b; void *literal; if ( - (a = _gather_100_rule(p)) + (a = _gather_101_rule(p)) && (literal = _PyPegen_expect_token(p, 12)) && - (b = _gather_102_rule(p)) + (b = _gather_103_rule(p)) ) { res = _PyPegen_join_sequences ( p , a , b ); @@ -8214,23 +8216,23 @@ kwargs_rule(Parser *p) p->mark = mark; } { // ','.kwarg_or_starred+ - asdl_seq * _gather_104_var; + asdl_seq * _gather_105_var; if ( - (_gather_104_var = _gather_104_rule(p)) + (_gather_105_var = _gather_105_rule(p)) ) { - res = _gather_104_var; + res = _gather_105_var; goto done; } p->mark = mark; } { // ','.kwarg_or_double_starred+ - asdl_seq * _gather_106_var; + asdl_seq * _gather_107_var; if ( - (_gather_106_var = _gather_106_rule(p)) + (_gather_107_var = _gather_107_rule(p)) ) { - res = _gather_106_var; + res = _gather_107_var; goto done; } p->mark = mark; @@ -8473,7 +8475,7 @@ star_targets_rule(Parser *p) if ( (a = star_target_rule(p)) && - (b = _loop0_108_rule(p)) + (b = _loop0_109_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8514,7 +8516,7 @@ star_targets_seq_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_109_rule(p)) + (a = _gather_110_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8562,7 +8564,7 @@ star_target_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 16)) && - (a = _tmp_111_rule(p)) + (a = _tmp_112_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8951,7 +8953,7 @@ del_targets_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_112_rule(p)) + (a = _gather_113_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -9204,7 +9206,7 @@ targets_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_114_rule(p)) + (a = _gather_115_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -9732,7 +9734,7 @@ incorrect_arguments_rule(Parser *p) && (literal = _PyPegen_expect_token(p, 12)) && - (opt_var = _tmp_116_rule(p), 1) + (opt_var = _tmp_117_rule(p), 1) ) { res = RAISE_SYNTAX_ERROR ( "Generator expression must be parenthesized" ); @@ -9867,7 +9869,7 @@ invalid_assignment_rule(Parser *p) && (expression_var_1 = expression_rule(p)) && - (opt_var = _tmp_117_rule(p), 1) + (opt_var = _tmp_118_rule(p), 1) ) { res = RAISE_SYNTAX_ERROR ( "illegal target for annotation" ); @@ -9880,15 +9882,15 @@ invalid_assignment_rule(Parser *p) p->mark = mark; } { // expression ('=' | augassign) (yield_expr | star_expressions) - void *_tmp_118_var; void *_tmp_119_var; + void *_tmp_120_var; expr_ty a; if ( (a = expression_rule(p)) && - (_tmp_118_var = _tmp_118_rule(p)) - && (_tmp_119_var = _tmp_119_rule(p)) + && + (_tmp_120_var = _tmp_120_rule(p)) ) { res = RAISE_SYNTAX_ERROR ( "cannot assign to %s" , _PyPegen_get_expr_name ( a ) ); @@ -9946,12 +9948,12 @@ invalid_comprehension_rule(Parser *p) void * res = NULL; int mark = p->mark; { // ('[' | '(' | '{') '*' expression for_if_clauses - void *_tmp_120_var; + void *_tmp_121_var; expr_ty expression_var; asdl_seq* for_if_clauses_var; void *literal; if ( - (_tmp_120_var = _tmp_120_rule(p)) + (_tmp_121_var = _tmp_121_rule(p)) && (literal = _PyPegen_expect_token(p, 16)) && @@ -9985,15 +9987,15 @@ invalid_parameters_rule(Parser *p) void * res = NULL; int mark = p->mark; { // [plain_names ','] (slash_with_default | names_with_default) ',' plain_names - void *_tmp_122_var; + void *_tmp_123_var; void *literal; void *opt_var; UNUSED(opt_var); // Silence compiler warnings asdl_seq* plain_names_var; if ( - (opt_var = _tmp_121_rule(p), 1) + (opt_var = _tmp_122_rule(p), 1) && - (_tmp_122_var = _tmp_122_rule(p)) + (_tmp_123_var = _tmp_123_rule(p)) && (literal = _PyPegen_expect_token(p, 12)) && @@ -10520,12 +10522,12 @@ _loop1_13_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (star_targets '=') - void *_tmp_123_var; + void *_tmp_124_var; while ( - (_tmp_123_var = _tmp_123_rule(p)) + (_tmp_124_var = _tmp_124_rule(p)) ) { - res = _tmp_123_var; + res = _tmp_124_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -10847,12 +10849,12 @@ _loop0_21_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('.' | '...') - void *_tmp_124_var; + void *_tmp_125_var; while ( - (_tmp_124_var = _tmp_124_rule(p)) + (_tmp_125_var = _tmp_125_rule(p)) ) { - res = _tmp_124_var; + res = _tmp_125_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -10896,12 +10898,12 @@ _loop1_22_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('.' | '...') - void *_tmp_125_var; + void *_tmp_126_var; while ( - (_tmp_125_var = _tmp_125_rule(p)) + (_tmp_126_var = _tmp_126_rule(p)) ) { - res = _tmp_125_var; + res = _tmp_126_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12110,7 +12112,7 @@ _loop0_55_rule(Parser *p) while ( (literal = _PyPegen_expect_token(p, 12)) && - (elem = _tmp_126_rule(p)) + (elem = _tmp_127_rule(p)) ) { res = elem; @@ -12157,7 +12159,7 @@ _gather_54_rule(Parser *p) void *elem; asdl_seq * seq; if ( - (elem = _tmp_126_rule(p)) + (elem = _tmp_127_rule(p)) && (seq = _loop0_55_rule(p)) ) @@ -12222,12 +12224,12 @@ _loop1_57_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('@' named_expression NEWLINE) - void *_tmp_127_var; + void *_tmp_128_var; while ( - (_tmp_127_var = _tmp_127_rule(p)) + (_tmp_128_var = _tmp_128_rule(p)) ) { - res = _tmp_127_var; + res = _tmp_128_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12395,12 +12397,12 @@ _loop1_61_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' star_expression) - void *_tmp_128_var; + void *_tmp_129_var; while ( - (_tmp_128_var = _tmp_128_rule(p)) + (_tmp_129_var = _tmp_129_rule(p)) ) { - res = _tmp_128_var; + res = _tmp_129_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12533,12 +12535,12 @@ _loop1_64_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' expression) - void *_tmp_129_var; + void *_tmp_130_var; while ( - (_tmp_129_var = _tmp_129_rule(p)) + (_tmp_130_var = _tmp_130_rule(p)) ) { - res = _tmp_129_var; + res = _tmp_130_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13162,7 +13164,7 @@ _loop0_82_rule(Parser *p) while ( (literal = _PyPegen_expect_token(p, 12)) && - (elem = _tmp_130_rule(p)) + (elem = _tmp_131_rule(p)) ) { res = elem; @@ -13209,7 +13211,7 @@ _gather_81_rule(Parser *p) void *elem; asdl_seq * seq; if ( - (elem = _tmp_130_rule(p)) + (elem = _tmp_131_rule(p)) && (seq = _loop0_82_rule(p)) ) @@ -13242,12 +13244,12 @@ _loop1_83_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('or' conjunction) - void *_tmp_131_var; + void *_tmp_132_var; while ( - (_tmp_131_var = _tmp_131_rule(p)) + (_tmp_132_var = _tmp_132_rule(p)) ) { - res = _tmp_131_var; + res = _tmp_132_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13295,12 +13297,12 @@ _loop1_84_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('and' inversion) - void *_tmp_132_var; + void *_tmp_133_var; while ( - (_tmp_132_var = _tmp_132_rule(p)) + (_tmp_133_var = _tmp_133_rule(p)) ) { - res = _tmp_132_var; + res = _tmp_133_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13383,9 +13385,38 @@ _loop1_85_rule(Parser *p) return seq; } -// _loop0_87: ',' slice +// _tmp_86: '!=' +static void * +_tmp_86_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '!=' + void *tok; + if ( + (tok = _PyPegen_expect_token(p, 28)) + ) + { + res = _PyPegen_check_barry_as_flufl ( p ) ? NULL : tok; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_88: ',' slice static asdl_seq * -_loop0_87_rule(Parser *p) +_loop0_88_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13430,32 +13461,32 @@ _loop0_87_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_87"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_88"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_87_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_88_type, seq); return seq; } -// _gather_86: slice _loop0_87 +// _gather_87: slice _loop0_88 static asdl_seq * -_gather_86_rule(Parser *p) +_gather_87_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // slice _loop0_87 + { // slice _loop0_88 expr_ty elem; asdl_seq * seq; if ( (elem = slice_rule(p)) && - (seq = _loop0_87_rule(p)) + (seq = _loop0_88_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13468,9 +13499,9 @@ _gather_86_rule(Parser *p) return res; } -// _tmp_88: ':' expression? +// _tmp_89: ':' expression? static void * -_tmp_88_rule(Parser *p) +_tmp_89_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13500,9 +13531,9 @@ _tmp_88_rule(Parser *p) return res; } -// _tmp_89: tuple | group | genexp +// _tmp_90: tuple | group | genexp static void * -_tmp_89_rule(Parser *p) +_tmp_90_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13547,9 +13578,9 @@ _tmp_89_rule(Parser *p) return res; } -// _tmp_90: list | listcomp +// _tmp_91: list | listcomp static void * -_tmp_90_rule(Parser *p) +_tmp_91_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13583,9 +13614,9 @@ _tmp_90_rule(Parser *p) return res; } -// _tmp_91: dict | set | dictcomp | setcomp +// _tmp_92: dict | set | dictcomp | setcomp static void * -_tmp_91_rule(Parser *p) +_tmp_92_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13641,9 +13672,9 @@ _tmp_91_rule(Parser *p) return res; } -// _loop1_92: STRING +// _loop1_93: STRING static asdl_seq * -_loop1_92_rule(Parser *p) +_loop1_93_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13684,19 +13715,19 @@ _loop1_92_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_92"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_93"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_92_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_93_type, seq); return seq; } -// _tmp_93: star_named_expression ',' star_named_expressions? +// _tmp_94: star_named_expression ',' star_named_expressions? static void * -_tmp_93_rule(Parser *p) +_tmp_94_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13729,9 +13760,9 @@ _tmp_93_rule(Parser *p) return res; } -// _tmp_94: yield_expr | named_expression +// _tmp_95: yield_expr | named_expression static void * -_tmp_94_rule(Parser *p) +_tmp_95_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13765,9 +13796,9 @@ _tmp_94_rule(Parser *p) return res; } -// _loop0_96: ',' kvpair +// _loop0_97: ',' kvpair static asdl_seq * -_loop0_96_rule(Parser *p) +_loop0_97_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13812,32 +13843,32 @@ _loop0_96_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_96"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_97"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_96_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_97_type, seq); return seq; } -// _gather_95: kvpair _loop0_96 +// _gather_96: kvpair _loop0_97 static asdl_seq * -_gather_95_rule(Parser *p) +_gather_96_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kvpair _loop0_96 + { // kvpair _loop0_97 KeyValuePair* elem; asdl_seq * seq; if ( (elem = kvpair_rule(p)) && - (seq = _loop0_96_rule(p)) + (seq = _loop0_97_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13850,9 +13881,9 @@ _gather_95_rule(Parser *p) return res; } -// _loop1_97: (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) +// _loop1_98: (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) static asdl_seq * -_loop1_97_rule(Parser *p) +_loop1_98_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13868,12 +13899,12 @@ _loop1_97_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) - void *_tmp_133_var; + void *_tmp_134_var; while ( - (_tmp_133_var = _tmp_133_rule(p)) + (_tmp_134_var = _tmp_134_rule(p)) ) { - res = _tmp_133_var; + res = _tmp_134_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13893,19 +13924,19 @@ _loop1_97_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_97"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_98"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_97_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_98_type, seq); return seq; } -// _tmp_98: ',' args +// _tmp_99: ',' args static void * -_tmp_98_rule(Parser *p) +_tmp_99_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13935,9 +13966,9 @@ _tmp_98_rule(Parser *p) return res; } -// _tmp_99: ',' args +// _tmp_100: ',' args static void * -_tmp_99_rule(Parser *p) +_tmp_100_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13967,9 +13998,9 @@ _tmp_99_rule(Parser *p) return res; } -// _loop0_101: ',' kwarg_or_starred +// _loop0_102: ',' kwarg_or_starred static asdl_seq * -_loop0_101_rule(Parser *p) +_loop0_102_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14014,32 +14045,32 @@ _loop0_101_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_101"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_102"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_101_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_102_type, seq); return seq; } -// _gather_100: kwarg_or_starred _loop0_101 +// _gather_101: kwarg_or_starred _loop0_102 static asdl_seq * -_gather_100_rule(Parser *p) +_gather_101_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_starred _loop0_101 + { // kwarg_or_starred _loop0_102 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_starred_rule(p)) && - (seq = _loop0_101_rule(p)) + (seq = _loop0_102_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14052,9 +14083,9 @@ _gather_100_rule(Parser *p) return res; } -// _loop0_103: ',' kwarg_or_double_starred +// _loop0_104: ',' kwarg_or_double_starred static asdl_seq * -_loop0_103_rule(Parser *p) +_loop0_104_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14099,32 +14130,32 @@ _loop0_103_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_103"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_104"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_103_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_104_type, seq); return seq; } -// _gather_102: kwarg_or_double_starred _loop0_103 +// _gather_103: kwarg_or_double_starred _loop0_104 static asdl_seq * -_gather_102_rule(Parser *p) +_gather_103_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_double_starred _loop0_103 + { // kwarg_or_double_starred _loop0_104 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_double_starred_rule(p)) && - (seq = _loop0_103_rule(p)) + (seq = _loop0_104_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14137,9 +14168,9 @@ _gather_102_rule(Parser *p) return res; } -// _loop0_105: ',' kwarg_or_starred +// _loop0_106: ',' kwarg_or_starred static asdl_seq * -_loop0_105_rule(Parser *p) +_loop0_106_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14184,32 +14215,32 @@ _loop0_105_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_105"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_106"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_105_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_106_type, seq); return seq; } -// _gather_104: kwarg_or_starred _loop0_105 +// _gather_105: kwarg_or_starred _loop0_106 static asdl_seq * -_gather_104_rule(Parser *p) +_gather_105_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_starred _loop0_105 + { // kwarg_or_starred _loop0_106 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_starred_rule(p)) && - (seq = _loop0_105_rule(p)) + (seq = _loop0_106_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14222,9 +14253,9 @@ _gather_104_rule(Parser *p) return res; } -// _loop0_107: ',' kwarg_or_double_starred +// _loop0_108: ',' kwarg_or_double_starred static asdl_seq * -_loop0_107_rule(Parser *p) +_loop0_108_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14269,32 +14300,32 @@ _loop0_107_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_107"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_108"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_107_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_108_type, seq); return seq; } -// _gather_106: kwarg_or_double_starred _loop0_107 +// _gather_107: kwarg_or_double_starred _loop0_108 static asdl_seq * -_gather_106_rule(Parser *p) +_gather_107_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_double_starred _loop0_107 + { // kwarg_or_double_starred _loop0_108 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_double_starred_rule(p)) && - (seq = _loop0_107_rule(p)) + (seq = _loop0_108_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14307,9 +14338,9 @@ _gather_106_rule(Parser *p) return res; } -// _loop0_108: (',' star_target) +// _loop0_109: (',' star_target) static asdl_seq * -_loop0_108_rule(Parser *p) +_loop0_109_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14325,12 +14356,12 @@ _loop0_108_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' star_target) - void *_tmp_134_var; + void *_tmp_135_var; while ( - (_tmp_134_var = _tmp_134_rule(p)) + (_tmp_135_var = _tmp_135_rule(p)) ) { - res = _tmp_134_var; + res = _tmp_135_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -14346,19 +14377,19 @@ _loop0_108_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_108"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_109"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_108_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_109_type, seq); return seq; } -// _loop0_110: ',' star_target +// _loop0_111: ',' star_target static asdl_seq * -_loop0_110_rule(Parser *p) +_loop0_111_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14403,32 +14434,32 @@ _loop0_110_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_110"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_111"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_110_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_111_type, seq); return seq; } -// _gather_109: star_target _loop0_110 +// _gather_110: star_target _loop0_111 static asdl_seq * -_gather_109_rule(Parser *p) +_gather_110_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_target _loop0_110 + { // star_target _loop0_111 expr_ty elem; asdl_seq * seq; if ( (elem = star_target_rule(p)) && - (seq = _loop0_110_rule(p)) + (seq = _loop0_111_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14441,9 +14472,9 @@ _gather_109_rule(Parser *p) return res; } -// _tmp_111: !'*' star_target +// _tmp_112: !'*' star_target static void * -_tmp_111_rule(Parser *p) +_tmp_112_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14468,9 +14499,9 @@ _tmp_111_rule(Parser *p) return res; } -// _loop0_113: ',' del_target +// _loop0_114: ',' del_target static asdl_seq * -_loop0_113_rule(Parser *p) +_loop0_114_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14515,32 +14546,32 @@ _loop0_113_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_113"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_114"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_113_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_114_type, seq); return seq; } -// _gather_112: del_target _loop0_113 +// _gather_113: del_target _loop0_114 static asdl_seq * -_gather_112_rule(Parser *p) +_gather_113_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // del_target _loop0_113 + { // del_target _loop0_114 expr_ty elem; asdl_seq * seq; if ( (elem = del_target_rule(p)) && - (seq = _loop0_113_rule(p)) + (seq = _loop0_114_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14553,9 +14584,9 @@ _gather_112_rule(Parser *p) return res; } -// _loop0_115: ',' target +// _loop0_116: ',' target static asdl_seq * -_loop0_115_rule(Parser *p) +_loop0_116_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14600,32 +14631,32 @@ _loop0_115_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_115"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_116"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_115_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_116_type, seq); return seq; } -// _gather_114: target _loop0_115 +// _gather_115: target _loop0_116 static asdl_seq * -_gather_114_rule(Parser *p) +_gather_115_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // target _loop0_115 + { // target _loop0_116 expr_ty elem; asdl_seq * seq; if ( (elem = target_rule(p)) && - (seq = _loop0_115_rule(p)) + (seq = _loop0_116_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14638,9 +14669,9 @@ _gather_114_rule(Parser *p) return res; } -// _tmp_116: args | expression for_if_clauses +// _tmp_117: args | expression for_if_clauses static void * -_tmp_116_rule(Parser *p) +_tmp_117_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14677,9 +14708,9 @@ _tmp_116_rule(Parser *p) return res; } -// _tmp_117: '=' annotated_rhs +// _tmp_118: '=' annotated_rhs static void * -_tmp_117_rule(Parser *p) +_tmp_118_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14705,9 +14736,9 @@ _tmp_117_rule(Parser *p) return res; } -// _tmp_118: '=' | augassign +// _tmp_119: '=' | augassign static void * -_tmp_118_rule(Parser *p) +_tmp_119_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14741,9 +14772,9 @@ _tmp_118_rule(Parser *p) return res; } -// _tmp_119: yield_expr | star_expressions +// _tmp_120: yield_expr | star_expressions static void * -_tmp_119_rule(Parser *p) +_tmp_120_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14777,9 +14808,9 @@ _tmp_119_rule(Parser *p) return res; } -// _tmp_120: '[' | '(' | '{' +// _tmp_121: '[' | '(' | '{' static void * -_tmp_120_rule(Parser *p) +_tmp_121_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14824,9 +14855,9 @@ _tmp_120_rule(Parser *p) return res; } -// _tmp_121: plain_names ',' +// _tmp_122: plain_names ',' static void * -_tmp_121_rule(Parser *p) +_tmp_122_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14852,9 +14883,9 @@ _tmp_121_rule(Parser *p) return res; } -// _tmp_122: slash_with_default | names_with_default +// _tmp_123: slash_with_default | names_with_default static void * -_tmp_122_rule(Parser *p) +_tmp_123_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14888,9 +14919,9 @@ _tmp_122_rule(Parser *p) return res; } -// _tmp_123: star_targets '=' +// _tmp_124: star_targets '=' static void * -_tmp_123_rule(Parser *p) +_tmp_124_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14920,9 +14951,9 @@ _tmp_123_rule(Parser *p) return res; } -// _tmp_124: '.' | '...' +// _tmp_125: '.' | '...' static void * -_tmp_124_rule(Parser *p) +_tmp_125_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14956,9 +14987,9 @@ _tmp_124_rule(Parser *p) return res; } -// _tmp_125: '.' | '...' +// _tmp_126: '.' | '...' static void * -_tmp_125_rule(Parser *p) +_tmp_126_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14992,9 +15023,9 @@ _tmp_125_rule(Parser *p) return res; } -// _tmp_126: plain_name !'=' +// _tmp_127: plain_name !'=' static void * -_tmp_126_rule(Parser *p) +_tmp_127_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15019,9 +15050,9 @@ _tmp_126_rule(Parser *p) return res; } -// _tmp_127: '@' named_expression NEWLINE +// _tmp_128: '@' named_expression NEWLINE static void * -_tmp_127_rule(Parser *p) +_tmp_128_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15054,9 +15085,9 @@ _tmp_127_rule(Parser *p) return res; } -// _tmp_128: ',' star_expression +// _tmp_129: ',' star_expression static void * -_tmp_128_rule(Parser *p) +_tmp_129_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15086,9 +15117,9 @@ _tmp_128_rule(Parser *p) return res; } -// _tmp_129: ',' expression +// _tmp_130: ',' expression static void * -_tmp_129_rule(Parser *p) +_tmp_130_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15118,9 +15149,9 @@ _tmp_129_rule(Parser *p) return res; } -// _tmp_130: lambda_plain_name !'=' +// _tmp_131: lambda_plain_name !'=' static void * -_tmp_130_rule(Parser *p) +_tmp_131_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15145,9 +15176,9 @@ _tmp_130_rule(Parser *p) return res; } -// _tmp_131: 'or' conjunction +// _tmp_132: 'or' conjunction static void * -_tmp_131_rule(Parser *p) +_tmp_132_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15177,9 +15208,9 @@ _tmp_131_rule(Parser *p) return res; } -// _tmp_132: 'and' inversion +// _tmp_133: 'and' inversion static void * -_tmp_132_rule(Parser *p) +_tmp_133_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15209,9 +15240,9 @@ _tmp_132_rule(Parser *p) return res; } -// _tmp_133: ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* +// _tmp_134: ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* static void * -_tmp_133_rule(Parser *p) +_tmp_134_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15236,7 +15267,7 @@ _tmp_133_rule(Parser *p) && (b = disjunction_rule(p)) && - (c = _loop0_135_rule(p)) + (c = _loop0_136_rule(p)) ) { res = _Py_comprehension ( a , b , c , y != NULL , p -> arena ); @@ -15253,9 +15284,9 @@ _tmp_133_rule(Parser *p) return res; } -// _tmp_134: ',' star_target +// _tmp_135: ',' star_target static void * -_tmp_134_rule(Parser *p) +_tmp_135_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15285,9 +15316,9 @@ _tmp_134_rule(Parser *p) return res; } -// _loop0_135: ('if' disjunction) +// _loop0_136: ('if' disjunction) static asdl_seq * -_loop0_135_rule(Parser *p) +_loop0_136_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15303,12 +15334,12 @@ _loop0_135_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('if' disjunction) - void *_tmp_136_var; + void *_tmp_137_var; while ( - (_tmp_136_var = _tmp_136_rule(p)) + (_tmp_137_var = _tmp_137_rule(p)) ) { - res = _tmp_136_var; + res = _tmp_137_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -15324,19 +15355,19 @@ _loop0_135_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_135"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_136"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_135_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_136_type, seq); return seq; } -// _tmp_136: 'if' disjunction +// _tmp_137: 'if' disjunction static void * -_tmp_136_rule(Parser *p) +_tmp_137_rule(Parser *p) { if (p->error_indicator) { return NULL; diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c index 41485a9669d68..9a78a28d24196 100644 --- a/Parser/pegen/parse_string.c +++ b/Parser/pegen/parse_string.c @@ -586,7 +586,7 @@ fstring_compile_expr(Parser *p, const char *expr_start, const char *expr_end, return NULL; } - Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, NULL, p->arena); + Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, p->flags, NULL, p->arena); p2->starting_lineno = p->starting_lineno + p->tok->first_lineno - 1; p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno ? p->starting_col_offset + t->col_offset : 0; diff --git a/Parser/pegen/peg_api.c b/Parser/pegen/peg_api.c index c42aa680c8602..31ac2e1399265 100644 --- a/Parser/pegen/peg_api.c +++ b/Parser/pegen/peg_api.c @@ -22,20 +22,19 @@ PyPegen_ASTFromStringObject(const char *str, PyObject* filename, int mode, PyCom return NULL; } - int iflags = flags != NULL ? flags->cf_flags : PyCF_IGNORE_COOKIE; - mod_ty result = _PyPegen_run_parser_from_string(str, mode, filename, iflags, arena); + mod_ty result = _PyPegen_run_parser_from_string(str, mode, filename, flags, arena); return result; } mod_ty -PyPegen_ASTFromFile(const char *filename, int mode, PyArena *arena) +PyPegen_ASTFromFile(const char *filename, int mode, PyCompilerFlags *flags, PyArena *arena) { PyObject *filename_ob = PyUnicode_FromString(filename); if (filename_ob == NULL) { return NULL; } - mod_ty result = _PyPegen_run_parser_from_file(filename, mode, filename_ob, arena); + mod_ty result = _PyPegen_run_parser_from_file(filename, mode, filename_ob, flags, arena); Py_XDECREF(filename_ob); return result; } @@ -43,13 +42,13 @@ PyPegen_ASTFromFile(const char *filename, int mode, PyArena *arena) mod_ty PyPegen_ASTFromFileObject(FILE *fp, PyObject *filename_ob, int mode, const char *enc, const char *ps1, const char* ps2, - int *errcode, PyArena *arena) + PyCompilerFlags *flags, int *errcode, PyArena *arena) { if (PySys_Audit("compile", "OO", Py_None, filename_ob) < 0) { return NULL; } return _PyPegen_run_parser_from_file_pointer(fp, mode, filename_ob, enc, ps1, ps2, - errcode, arena); + flags, errcode, arena); } PyCodeObject * @@ -81,7 +80,7 @@ PyPegen_CodeObjectFromString(const char *str, int mode, PyCompilerFlags *flags) } PyCodeObject * -PyPegen_CodeObjectFromFile(const char *filename, int mode) +PyPegen_CodeObjectFromFile(const char *filename, int mode, PyCompilerFlags* flags) { PyArena *arena = PyArena_New(); if (arena == NULL) { @@ -95,7 +94,7 @@ PyPegen_CodeObjectFromFile(const char *filename, int mode) goto error; } - mod_ty res = PyPegen_ASTFromFile(filename, mode, arena); + mod_ty res = PyPegen_ASTFromFile(filename, mode, flags, arena); if (res == NULL) { goto error; } @@ -110,8 +109,8 @@ PyPegen_CodeObjectFromFile(const char *filename, int mode) PyCodeObject * PyPegen_CodeObjectFromFileObject(FILE *fp, PyObject *filename_ob, int mode, - const char *ps1, const char *ps2, const char *enc, - int *errcode) + const char *ps1, const char *ps2, + PyCompilerFlags *flags, const char *enc, int *errcode) { PyArena *arena = PyArena_New(); if (arena == NULL) { @@ -121,7 +120,7 @@ PyPegen_CodeObjectFromFileObject(FILE *fp, PyObject *filename_ob, int mode, PyCodeObject *result = NULL; mod_ty res = PyPegen_ASTFromFileObject(fp, filename_ob, mode, enc, ps1, ps2, - errcode, arena); + flags, errcode, arena); if (res == NULL) { goto error; } diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index c8f5c95b473e2..081da8238c35c 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -25,6 +25,24 @@ init_normalization(Parser *p) return 1; } +/* Checks if the NOTEQUAL token is valid given the current parser flags +0 indicates success and nonzero indicates failure (an exception may be set) */ +int +_PyPegen_check_barry_as_flufl(Parser *p) { + Token *t = p->tokens[p->fill - 1]; + assert(t->bytes != NULL); + assert(t->type == NOTEQUAL); + + char* tok_str = PyBytes_AS_STRING(t->bytes); + if (p->flags & PyPARSE_BARRY_AS_BDFL && strcmp(tok_str, "<>")){ + RAISE_SYNTAX_ERROR("with Barry as BDFL, use '<>' instead of '!='"); + return -1; + } else if (!(p->flags & PyPARSE_BARRY_AS_BDFL)) { + return strcmp(tok_str, "!="); + } + return 0; +} + PyObject * _PyPegen_new_identifier(Parser *p, char *n) { @@ -401,7 +419,6 @@ _PyPegen_raise_error(Parser *p, PyObject *errtype, const char *errmsg, ...) loc = Py_None; } - tmp = Py_BuildValue("(OiiN)", p->tok->filename, t->lineno, col_number, loc); if (!tmp) { goto error; @@ -902,8 +919,31 @@ _PyPegen_Parser_Free(Parser *p) PyMem_Free(p); } +static int +compute_parser_flags(PyCompilerFlags *flags) +{ + int parser_flags = 0; + if (!flags) { + return 0; + } + if (flags->cf_flags & PyCF_DONT_IMPLY_DEDENT) { + parser_flags |= PyPARSE_DONT_IMPLY_DEDENT; + } + if (flags->cf_flags & PyCF_IGNORE_COOKIE) { + parser_flags |= PyPARSE_IGNORE_COOKIE; + } + if (flags->cf_flags & CO_FUTURE_BARRY_AS_BDFL) { + parser_flags |= PyPARSE_BARRY_AS_BDFL; + } + if (flags->cf_flags & PyCF_TYPE_COMMENTS) { + parser_flags |= PyPARSE_TYPE_COMMENTS; + } + return parser_flags; +} + Parser * -_PyPegen_Parser_New(struct tok_state *tok, int start_rule, int *errcode, PyArena *arena) +_PyPegen_Parser_New(struct tok_state *tok, int start_rule, int flags, + int *errcode, PyArena *arena) { Parser *p = PyMem_Malloc(sizeof(Parser)); if (p == NULL) { @@ -938,6 +978,7 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int *errcode, PyArena p->starting_lineno = 0; p->starting_col_offset = 0; + p->flags = flags; return p; } @@ -976,7 +1017,7 @@ _PyPegen_run_parser(Parser *p) mod_ty _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filename_ob, const char *enc, const char *ps1, const char *ps2, - int *errcode, PyArena *arena) + PyCompilerFlags *flags, int *errcode, PyArena *arena) { struct tok_state *tok = PyTokenizer_FromFile(fp, enc, ps1, ps2); if (tok == NULL) { @@ -993,7 +1034,8 @@ _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filena // From here on we need to clean up even if there's an error mod_ty result = NULL; - Parser *p = _PyPegen_Parser_New(tok, start_rule, errcode, arena); + int parser_flags = compute_parser_flags(flags); + Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, errcode, arena); if (p == NULL) { goto error; } @@ -1008,7 +1050,7 @@ _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filena mod_ty _PyPegen_run_parser_from_file(const char *filename, int start_rule, - PyObject *filename_ob, PyArena *arena) + PyObject *filename_ob, PyCompilerFlags *flags, PyArena *arena) { FILE *fp = fopen(filename, "rb"); if (fp == NULL) { @@ -1017,7 +1059,7 @@ _PyPegen_run_parser_from_file(const char *filename, int start_rule, } mod_ty result = _PyPegen_run_parser_from_file_pointer(fp, start_rule, filename_ob, - NULL, NULL, NULL, NULL, arena); + NULL, NULL, NULL, flags, NULL, arena); fclose(fp); return result; @@ -1025,12 +1067,12 @@ _PyPegen_run_parser_from_file(const char *filename, int start_rule, mod_ty _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filename_ob, - int iflags, PyArena *arena) + PyCompilerFlags *flags, PyArena *arena) { int exec_input = start_rule == Py_file_input; struct tok_state *tok; - if (iflags & PyCF_IGNORE_COOKIE) { + if (flags == NULL || flags->cf_flags & PyCF_IGNORE_COOKIE) { tok = PyTokenizer_FromUTF8(str, exec_input); } else { tok = PyTokenizer_FromString(str, exec_input); @@ -1048,7 +1090,8 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen // We need to clear up from here on mod_ty result = NULL; - Parser *p = _PyPegen_Parser_New(tok, start_rule, NULL, arena); + int parser_flags = compute_parser_flags(flags); + Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, NULL, arena); if (p == NULL) { goto error; } diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index a20ec4a0e4274..0ac9b317efe59 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -7,6 +7,23 @@ #include #include +#if 0 +#define PyPARSE_YIELD_IS_KEYWORD 0x0001 +#endif + +#define PyPARSE_DONT_IMPLY_DEDENT 0x0002 + +#if 0 +#define PyPARSE_WITH_IS_KEYWORD 0x0003 +#define PyPARSE_PRINT_IS_FUNCTION 0x0004 +#define PyPARSE_UNICODE_LITERALS 0x0008 +#endif + +#define PyPARSE_IGNORE_COOKIE 0x0010 +#define PyPARSE_BARRY_AS_BDFL 0x0020 +#define PyPARSE_TYPE_COMMENTS 0x0040 +#define PyPARSE_ASYNC_HACKS 0x0080 + typedef struct _memo { int type; void *node; @@ -41,6 +58,7 @@ typedef struct { int starting_lineno; int starting_col_offset; int error_indicator; + int flags; } Parser; typedef struct { @@ -137,13 +155,13 @@ CHECK_CALL_NULL_ALLOWED(Parser *p, void *result) #define CHECK_NULL_ALLOWED(result) CHECK_CALL_NULL_ALLOWED(p, result) PyObject *_PyPegen_new_identifier(Parser *, char *); -Parser *_PyPegen_Parser_New(struct tok_state *, int, int *, PyArena *); +Parser *_PyPegen_Parser_New(struct tok_state *, int, int, int *, PyArena *); void _PyPegen_Parser_Free(Parser *); mod_ty _PyPegen_run_parser_from_file_pointer(FILE *, int, PyObject *, const char *, - const char *, const char *, int *, PyArena *); + const char *, const char *, PyCompilerFlags *, int *, PyArena *); void *_PyPegen_run_parser(Parser *); -mod_ty _PyPegen_run_parser_from_file(const char *, int, PyObject *, PyArena *); -mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, int, PyArena *); +mod_ty _PyPegen_run_parser_from_file(const char *, int, PyObject *, PyCompilerFlags *, PyArena *); +mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, PyCompilerFlags *, PyArena *); void *_PyPegen_interactive_exit(Parser *); asdl_seq *_PyPegen_singleton_seq(Parser *, void *); asdl_seq *_PyPegen_seq_insert_in_front(Parser *, void *, asdl_seq *); @@ -174,6 +192,7 @@ asdl_seq *_PyPegen_seq_delete_starred_exprs(Parser *, asdl_seq *); expr_ty _PyPegen_concatenate_strings(Parser *p, asdl_seq *); asdl_seq *_PyPegen_join_sequences(Parser *, asdl_seq *, asdl_seq *); void *_PyPegen_arguments_parsing_error(Parser *, expr_ty); +int _PyPegen_check_barry_as_flufl(Parser *); void *_PyPegen_parse(Parser *); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 3a2fe966c08ba..79147e430a1ad 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -241,7 +241,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, if (use_peg) { mod = PyPegen_ASTFromFileObject(fp, filename, Py_single_input, - enc, ps1, ps2, &errcode, arena); + enc, ps1, ps2, flags, &errcode, arena); } else { mod = PyParser_ASTFromFileObject(fp, filename, enc, @@ -1073,7 +1073,7 @@ PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globa if (use_peg) { mod = PyPegen_ASTFromFileObject(fp, filename, start, NULL, NULL, NULL, - NULL, arena); + flags, NULL, arena); } else { mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, 0, 0, diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index d8d36a0a1a5b0..fb552eed3ba01 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -12,7 +12,6 @@ _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *ar } else { result = Py_None; Py_INCREF(result); - } return result; @@ -43,7 +42,8 @@ parse_file(PyObject *self, PyObject *args, PyObject *kwds) goto error; } - mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, arena); + PyCompilerFlags flags = _PyCompilerFlags_INIT; + mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, &flags, arena); if (res == NULL) { goto error; } @@ -81,8 +81,9 @@ parse_string(PyObject *self, PyObject *args, PyObject *kwds) goto error; } + PyCompilerFlags flags = _PyCompilerFlags_INIT; mod_ty res = _PyPegen_run_parser_from_string(the_string, Py_file_input, filename_ob, - PyCF_IGNORE_COOKIE, arena); + &flags, arena); if (res == NULL) { goto error; } diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index 5b9d80453ca6b..6c4b8f1e7df85 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -73,9 +73,17 @@ def visit_StringLeaf(self, node: StringLeaf) -> Tuple[str, str]: return "literal", f"_PyPegen_expect_token(p, {type})" def visit_Rhs(self, node: Rhs) -> Tuple[Optional[str], str]: + def can_we_inline(node): + if len(node.alts) != 1 or len(node.alts[0].items) != 1: + return False + # If the alternative has an action we cannot inline + if getattr(node.alts[0], "action", None) is not None: + return False + return True + if node in self.cache: return self.cache[node] - if len(node.alts) == 1 and len(node.alts[0].items) == 1: + if can_we_inline(node): self.cache[node] = self.visit(node.alts[0].items[0]) else: name = self.gen.name_node(node) From webhook-mailer at python.org Mon Apr 27 13:36:05 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Mon, 27 Apr 2020 17:36:05 -0000 Subject: [Python-checkins] bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736) Message-ID: https://github.com/python/cpython/commit/b94dbd7ac34dc0c79512656eb17f6f07e09fca7a commit: b94dbd7ac34dc0c79512656eb17f6f07e09fca7a branch: master author: Pablo Galindo committer: GitHub date: 2020-04-27T18:35:58+01:00 summary: bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736) files: M Lib/test/test_codeop.py M Parser/pegen/pegen.c diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index 8c3e447200d40..1f27830ae50b8 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -122,7 +122,6 @@ def test_valid(self): av("def f():\n pass\n#foo\n") av("@a.b.c\ndef f():\n pass\n") - @support.skip_if_new_parser("Pegen does not support PyCF_DONT_INPLY_DEDENT yet") def test_incomplete(self): ai = self.assertIncomplete diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 081da8238c35c..d75267b2e2778 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -553,7 +553,7 @@ _PyPegen_fill_token(Parser *p) type = NEWLINE; /* Add an extra newline */ p->parsing_started = 0; - if (p->tok->indent) { + if (p->tok->indent && !(p->flags & PyPARSE_DONT_IMPLY_DEDENT)) { p->tok->pendin = -p->tok->indent; p->tok->indent = 0; } From webhook-mailer at python.org Mon Apr 27 14:53:45 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 27 Apr 2020 18:53:45 -0000 Subject: [Python-checkins] bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738) Message-ID: https://github.com/python/cpython/commit/1a275013d1ecc2e3778d64fda86174b2f13d6969 commit: 1a275013d1ecc2e3778d64fda86174b2f13d6969 branch: master author: Victor Stinner committer: GitHub date: 2020-04-27T20:53:37+02:00 summary: bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738) Process.shutdown(wait=True) of concurrent.futures now closes explicitly the result queue. files: A Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst M Lib/concurrent/futures/process.py diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 36355ae8756db..8e9b69a8f08b4 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -728,6 +728,8 @@ def shutdown(self, wait=True, *, cancel_futures=False): # objects that use file descriptors. self._executor_manager_thread = None self._call_queue = None + if self._result_queue is not None and wait: + self._result_queue.close() self._result_queue = None self._processes = None diff --git a/Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst b/Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst new file mode 100644 index 0000000000000..85b7934ba661e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-27-20-27-39.bpo-30966.Xmtlqu.rst @@ -0,0 +1,2 @@ +``Process.shutdown(wait=True)`` of :mod:`concurrent.futures` now closes +explicitly the result queue. From webhook-mailer at python.org Mon Apr 27 15:36:59 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Mon, 27 Apr 2020 19:36:59 -0000 Subject: [Python-checkins] bpo-39995: Split test_concurrent_futures.test_crash() into sub-tests (GH-19739) Message-ID: https://github.com/python/cpython/commit/5d1f32d33ba24d0aa87235ae40207bb57778388b commit: 5d1f32d33ba24d0aa87235ae40207bb57778388b branch: master author: Victor Stinner committer: GitHub date: 2020-04-27T21:36:51+02:00 summary: bpo-39995: Split test_concurrent_futures.test_crash() into sub-tests (GH-19739) Now only test_error_during_result_unpickle_in_result_handler() captures and ignores sys.stderr in the test process. Tools like test.bisect_cmd don't support subTest() but only work with the granularity of one method. Remove unused ExecutorDeadlockTest._sleep_id() method. files: M Lib/test/test_concurrent_futures.py diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index a8c5bb6aa1a3a..40597ffee7378 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -1006,11 +1006,6 @@ def test_idle_process_reuse_multiple(self): ProcessPoolForkserverMixin, ProcessPoolSpawnMixin)) -def hide_process_stderr(): - import io - sys.stderr = io.StringIO() - - def _crash(delay=None): """Induces a segfault.""" if delay: @@ -1027,13 +1022,18 @@ def _exit(): def _raise_error(Err): """Function that raises an Exception in process.""" - hide_process_stderr() + raise Err() + + +def _raise_error_ignore_stderr(Err): + """Function that raises an Exception in process and ignores stderr.""" + import io + sys.stderr = io.StringIO() raise Err() def _return_instance(cls): """Function that returns a instance of cls.""" - hide_process_stderr() return cls() @@ -1072,17 +1072,12 @@ class ErrorAtUnpickle(object): """Bad object that triggers an error at unpickling time.""" def __reduce__(self): from pickle import UnpicklingError - return _raise_error, (UnpicklingError, ) + return _raise_error_ignore_stderr, (UnpicklingError, ) class ExecutorDeadlockTest: TIMEOUT = support.SHORT_TIMEOUT - @classmethod - def _sleep_id(cls, x, delay): - time.sleep(delay) - return x - def _fail_on_deadlock(self, executor): # If we did not recover before TIMEOUT seconds, consider that the # executor is in a deadlock state and forcefully clean all its @@ -1102,57 +1097,84 @@ def _fail_on_deadlock(self, executor): self.fail(f"Executor deadlock:\n\n{tb}") - def test_crash(self): - # extensive testing for deadlock caused by crashes in a pool. + def _check_crash(self, error, func, *args, ignore_stderr=False): + # test for deadlock caused by crashes in a pool self.executor.shutdown(wait=True) - crash_cases = [ - # Check problem occurring while pickling a task in - # the task_handler thread - (id, (ErrorAtPickle(),), PicklingError, "error at task pickle"), - # Check problem occurring while unpickling a task on workers - (id, (ExitAtUnpickle(),), BrokenProcessPool, - "exit at task unpickle"), - (id, (ErrorAtUnpickle(),), BrokenProcessPool, - "error at task unpickle"), - (id, (CrashAtUnpickle(),), BrokenProcessPool, - "crash at task unpickle"), - # Check problem occurring during func execution on workers - (_crash, (), BrokenProcessPool, - "crash during func execution on worker"), - (_exit, (), SystemExit, - "exit during func execution on worker"), - (_raise_error, (RuntimeError, ), RuntimeError, - "error during func execution on worker"), - # Check problem occurring while pickling a task result - # on workers - (_return_instance, (CrashAtPickle,), BrokenProcessPool, - "crash during result pickle on worker"), - (_return_instance, (ExitAtPickle,), SystemExit, - "exit during result pickle on worker"), - (_return_instance, (ErrorAtPickle,), PicklingError, - "error during result pickle on worker"), - # Check problem occurring while unpickling a task in - # the result_handler thread - (_return_instance, (ErrorAtUnpickle,), BrokenProcessPool, - "error during result unpickle in result_handler"), - (_return_instance, (ExitAtUnpickle,), BrokenProcessPool, - "exit during result unpickle in result_handler") - ] - for func, args, error, name in crash_cases: - with self.subTest(name): - # The captured_stderr reduces the noise in the test report - with support.captured_stderr(): - executor = self.executor_type( - max_workers=2, mp_context=get_context(self.ctx)) - res = executor.submit(func, *args) - with self.assertRaises(error): - try: - res.result(timeout=self.TIMEOUT) - except futures.TimeoutError: - # If we did not recover before TIMEOUT seconds, - # consider that the executor is in a deadlock state - self._fail_on_deadlock(executor) - executor.shutdown(wait=True) + + executor = self.executor_type( + max_workers=2, mp_context=get_context(self.ctx)) + res = executor.submit(func, *args) + + if ignore_stderr: + cm = support.captured_stderr() + else: + cm = contextlib.nullcontext() + + try: + with self.assertRaises(error): + with cm: + res.result(timeout=self.TIMEOUT) + except futures.TimeoutError: + # If we did not recover before TIMEOUT seconds, + # consider that the executor is in a deadlock state + self._fail_on_deadlock(executor) + executor.shutdown(wait=True) + + def test_error_at_task_pickle(self): + # Check problem occurring while pickling a task in + # the task_handler thread + self._check_crash(PicklingError, id, ErrorAtPickle()) + + def test_exit_at_task_unpickle(self): + # Check problem occurring while unpickling a task on workers + self._check_crash(BrokenProcessPool, id, ExitAtUnpickle()) + + def test_error_at_task_unpickle(self): + # Check problem occurring while unpickling a task on workers + self._check_crash(BrokenProcessPool, id, ErrorAtUnpickle()) + + def test_crash_at_task_unpickle(self): + # Check problem occurring while unpickling a task on workers + self._check_crash(BrokenProcessPool, id, CrashAtUnpickle()) + + def test_crash_during_func_exec_on_worker(self): + # Check problem occurring during func execution on workers + self._check_crash(BrokenProcessPool, _crash) + + def test_exit_during_func_exec_on_worker(self): + # Check problem occurring during func execution on workers + self._check_crash(SystemExit, _exit) + + def test_error_during_func_exec_on_worker(self): + # Check problem occurring during func execution on workers + self._check_crash(RuntimeError, _raise_error, RuntimeError) + + def test_crash_during_result_pickle_on_worker(self): + # Check problem occurring while pickling a task result + # on workers + self._check_crash(BrokenProcessPool, _return_instance, CrashAtPickle) + + def test_exit_during_result_pickle_on_worker(self): + # Check problem occurring while pickling a task result + # on workers + self._check_crash(SystemExit, _return_instance, ExitAtPickle) + + def test_error_during_result_pickle_on_worker(self): + # Check problem occurring while pickling a task result + # on workers + self._check_crash(PicklingError, _return_instance, ErrorAtPickle) + + def test_error_during_result_unpickle_in_result_handler(self): + # Check problem occurring while unpickling a task in + # the result_handler thread + self._check_crash(BrokenProcessPool, + _return_instance, ErrorAtUnpickle, + ignore_stderr=True) + + def test_exit_during_result_unpickle_in_result_handler(self): + # Check problem occurring while unpickling a task in + # the result_handler thread + self._check_crash(BrokenProcessPool, _return_instance, ExitAtUnpickle) def test_shutdown_deadlock(self): # Test that the pool calling shutdown do not cause deadlock From webhook-mailer at python.org Mon Apr 27 20:23:40 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Tue, 28 Apr 2020 00:23:40 -0000 Subject: [Python-checkins] bpo-40334: Catch E_EOF error, when the tokenizer returns ERRORTOKEN (GH-19743) Message-ID: https://github.com/python/cpython/commit/d55133f49fe678fbf047a647aa8bb8b520410e8d commit: d55133f49fe678fbf047a647aa8bb8b520410e8d branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-28T01:23:35+01:00 summary: bpo-40334: Catch E_EOF error, when the tokenizer returns ERRORTOKEN (GH-19743) An E_EOF error was only being caught after the parser exited before this commit. There are some cases though, where the tokenizer returns ERRORTOKEN *and* has set an E_EOF error (like when EOF directly follows a line continuation character) which weren't correctly handled before. files: M Lib/test/test_eof.py M Parser/pegen/pegen.c diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index f8065788cec1d..9ef8eb1187486 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -26,7 +26,6 @@ def test_EOFS(self): else: raise support.TestFailed - @support.skip_if_new_parser("TODO for PEG -- fails with new parser") def test_line_continuation_EOF(self): """A continuation at the end of input must be an error; bpo2180.""" expect = 'unexpected EOF while parsing (, line 1)' @@ -37,7 +36,6 @@ def test_line_continuation_EOF(self): exec('\\') self.assertEqual(str(excinfo.exception), expect) - @unittest.skip("TODO for PEG -- fails even with old parser now") @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.""" diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index d75267b2e2778..6f78d8c86520e 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -344,13 +344,16 @@ tokenizer_error(Parser *p) break; case E_BADPREFIX: return tokenizer_error_with_col_offset(p, - PyExc_SyntaxError, "invalid string prefix"); + errtype, "invalid string prefix"); case E_EOFS: return tokenizer_error_with_col_offset(p, - PyExc_SyntaxError, "EOF while scanning triple-quoted string literal"); + errtype, "EOF while scanning triple-quoted string literal"); case E_EOLS: return tokenizer_error_with_col_offset(p, - PyExc_SyntaxError, "EOL while scanning string literal"); + errtype, "EOL while scanning string literal"); + case E_EOF: + return tokenizer_error_with_col_offset(p, + errtype, "unexpected EOF while parsing"); case E_DEDENT: return tokenizer_error_with_col_offset(p, PyExc_IndentationError, "unindent does not match any outer indentation level"); From webhook-mailer at python.org Mon Apr 27 20:24:55 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Tue, 28 Apr 2020 00:24:55 -0000 Subject: [Python-checkins] bpo-40334: Don't skip test_parser:test_trigget_memory_error (GH-19744) Message-ID: https://github.com/python/cpython/commit/3d53d8756f0403eec6a4e12f183103d651bed6c5 commit: 3d53d8756f0403eec6a4e12f183103d651bed6c5 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-28T01:24:50+01:00 summary: bpo-40334: Don't skip test_parser:test_trigget_memory_error (GH-19744) This test has been changed to always use the old parser, so no need for it to be skipped. files: M Lib/test/test_parser.py diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 0ee994f3b7505..fd33d6529b144 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -900,7 +900,6 @@ def test_deeply_nested_list(self): st = parser.expr(e) st.compile() - @support.skip_if_new_parser("Pegen does not trigger memory error with this many parenthesis") def test_trigger_memory_error(self): e = self._nested_expression(100) rc, out, err = assert_python_failure('-Xoldparser', '-c', e) From webhook-mailer at python.org Tue Apr 28 08:12:06 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Tue, 28 Apr 2020 12:12:06 -0000 Subject: [Python-checkins] bpo-40334: Refactor peg_generator to receive a Tokens file when building c code (GH-19745) Message-ID: https://github.com/python/cpython/commit/5b9f4988c94f47fa35e84f154a7b5aa17bc04722 commit: 5b9f4988c94f47fa35e84f154a7b5aa17bc04722 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-28T13:11:55+01:00 summary: bpo-40334: Refactor peg_generator to receive a Tokens file when building c code (GH-19745) files: M Makefile.pre.in M PCbuild/regen.vcxproj M Tools/peg_generator/Makefile M Tools/peg_generator/pegen/__main__.py M Tools/peg_generator/pegen/build.py M Tools/peg_generator/pegen/c_generator.py M Tools/peg_generator/pegen/testutil.py M Tools/peg_generator/scripts/test_parse_directory.py diff --git a/Makefile.pre.in b/Makefile.pre.in index 18fa97bec33d0..200fd319ebb06 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -823,7 +823,9 @@ regen-grammar: regen-token .PHONY: regen-pegen regen-pegen: @$(MKDIR_P) $(srcdir)/Parser/pegen - PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -c -q $(srcdir)/Grammar/python.gram \ + PYTHONPATH=$(srcdir)/Tools/peg_generator $(PYTHON_FOR_REGEN) -m pegen -q c \ + $(srcdir)/Grammar/python.gram \ + $(srcdir)/Grammar/Tokens \ -o $(srcdir)/Parser/pegen/parse.new.c $(UPDATE_FILE) $(srcdir)/Parser/pegen/parse.c $(srcdir)/Parser/pegen/parse.new.c diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 9fe8d6d0c3e11..285a8a1b9e49c 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -168,7 +168,7 @@ - + diff --git a/Tools/peg_generator/Makefile b/Tools/peg_generator/Makefile index fb67a21b67b6e..a37cbfcaa8551 100644 --- a/Tools/peg_generator/Makefile +++ b/Tools/peg_generator/Makefile @@ -10,6 +10,7 @@ CPYTHON ?= ../../Lib MYPY ?= mypy GRAMMAR = ../../Grammar/python.gram +TOKENS = ../../Grammar/Tokens TESTFILE = data/cprog.py TIMEFILE = data/xxl.py TESTDIR = . @@ -20,8 +21,8 @@ data/xxl.py: build: peg_extension/parse.c -peg_extension/parse.c: $(GRAMMAR) pegen/*.py peg_extension/peg_extension.c ../../Parser/pegen/pegen.c ../../Parser/pegen/parse_string.c ../../Parser/pegen/*.h pegen/grammar_parser.py - $(PYTHON) -m pegen -q -c $(GRAMMAR) -o peg_extension/parse.c --compile-extension +peg_extension/parse.c: $(GRAMMAR) $(TOKENS) pegen/*.py peg_extension/peg_extension.c ../../Parser/pegen/pegen.c ../../Parser/pegen/parse_string.c ../../Parser/pegen/*.h pegen/grammar_parser.py + $(PYTHON) -m pegen -q c $(GRAMMAR) $(TOKENS) -o peg_extension/parse.c --compile-extension clean: -rm -f peg_extension/*.o peg_extension/*.so peg_extension/parse.c @@ -79,7 +80,8 @@ time_stdlib_parse: data/xxl.py test_local: $(PYTHON) scripts/test_parse_directory.py \ - -g $(GRAMMAR) \ + --grammar-file $(GRAMMAR) \ + --tokens-file $(TOKENS) \ -d $(TESTDIR) \ $(TESTFLAGS) \ --exclude "*/failset/*" \ @@ -88,7 +90,8 @@ test_local: test_global: $(CPYTHON) $(PYTHON) scripts/test_parse_directory.py \ - -g $(GRAMMAR) \ + --grammar-file $(GRAMMAR) \ + --tokens-file $(TOKENS) \ -d $(CPYTHON) \ $(TESTFLAGS) \ --exclude "*/test2to3/*" \ diff --git a/Tools/peg_generator/pegen/__main__.py b/Tools/peg_generator/pegen/__main__.py index 6696d135a8b69..1dcbaad1c3887 100755 --- a/Tools/peg_generator/pegen/__main__.py +++ b/Tools/peg_generator/pegen/__main__.py @@ -11,6 +11,64 @@ import token import traceback +from typing import Tuple + +from pegen.build import Grammar, Parser, Tokenizer, ParserGenerator + + +def generate_c_code( + args: argparse.Namespace, +) -> Tuple[Grammar, Parser, Tokenizer, ParserGenerator]: + from pegen.build import build_c_parser_and_generator + + verbose = args.verbose + verbose_tokenizer = verbose >= 3 + verbose_parser = verbose == 2 or verbose >= 4 + try: + grammar, parser, tokenizer, gen = build_c_parser_and_generator( + args.grammar_filename, + args.tokens_filename, + args.output, + args.compile_extension, + verbose_tokenizer, + verbose_parser, + args.verbose, + keep_asserts_in_extension=False if args.optimized else True, + skip_actions=args.skip_actions, + ) + return grammar, parser, tokenizer, gen + except Exception as err: + if args.verbose: + raise # Show traceback + traceback.print_exception(err.__class__, err, None) + sys.stderr.write("For full traceback, use -v\n") + sys.exit(1) + + +def generate_python_code( + args: argparse.Namespace, +) -> Tuple[Grammar, Parser, Tokenizer, ParserGenerator]: + from pegen.build import build_python_parser_and_generator + + verbose = args.verbose + verbose_tokenizer = verbose >= 3 + verbose_parser = verbose == 2 or verbose >= 4 + try: + grammar, parser, tokenizer, gen = build_python_parser_and_generator( + args.grammar_filename, + args.output, + verbose_tokenizer, + verbose_parser, + skip_actions=args.skip_actions, + ) + return grammar, parser, tokenizer, gen + except Exception as err: + if args.verbose: + raise # Show traceback + traceback.print_exception(err.__class__, err, None) + sys.stderr.write("For full traceback, use -v\n") + sys.exit(1) + argparser = argparse.ArgumentParser( prog="pegen", description="Experimental PEG-like parser generator" @@ -23,63 +81,52 @@ default=0, help="Print timing stats; repeat for more debug output", ) -argparser.add_argument( - "-c", "--cpython", action="store_true", help="Generate C code for inclusion into CPython" +subparsers = argparser.add_subparsers(help="target language for the generated code") + +c_parser = subparsers.add_parser("c", help="Generate C code for inclusion into CPython") +c_parser.set_defaults(func=generate_c_code) +c_parser.add_argument("grammar_filename", help="Grammar description") +c_parser.add_argument("tokens_filename", help="Tokens description") +c_parser.add_argument( + "-o", "--output", metavar="OUT", default="parse.c", help="Where to write the generated parser" ) -argparser.add_argument( +c_parser.add_argument( "--compile-extension", action="store_true", help="Compile generated C code into an extension module", ) -argparser.add_argument( +c_parser.add_argument( + "--optimized", action="store_true", help="Compile the extension in optimized mode" +) +c_parser.add_argument( + "--skip-actions", action="store_true", help="Suppress code emission for rule actions", +) + +python_parser = subparsers.add_parser("python", help="Generate Python code") +python_parser.set_defaults(func=generate_python_code) +python_parser.add_argument("grammar_filename", help="Grammar description") +python_parser.add_argument( "-o", "--output", metavar="OUT", - help="Where to write the generated parser (default parse.py or parse.c)", + default="parse.py", + help="Where to write the generated parser", ) -argparser.add_argument("filename", help="Grammar description") -argparser.add_argument( - "--optimized", action="store_true", help="Compile the extension in optimized mode" -) -argparser.add_argument( +python_parser.add_argument( "--skip-actions", action="store_true", help="Suppress code emission for rule actions", ) def main() -> None: - from pegen.build import build_parser_and_generator from pegen.testutil import print_memstats args = argparser.parse_args() - verbose = args.verbose - verbose_tokenizer = verbose >= 3 - verbose_parser = verbose == 2 or verbose >= 4 - t0 = time.time() - - output_file = args.output - if not output_file: - if args.cpython: - output_file = "parse.c" - else: - output_file = "parse.py" + if "func" not in args: + argparser.error("Must specify the target language mode ('c' or 'python')") - try: - grammar, parser, tokenizer, gen = build_parser_and_generator( - args.filename, - output_file, - args.compile_extension, - verbose_tokenizer, - verbose_parser, - args.verbose, - keep_asserts_in_extension=False if args.optimized else True, - skip_actions=args.skip_actions, - ) - except Exception as err: - if args.verbose: - raise # Show traceback - traceback.print_exception(err.__class__, err, None) - sys.stderr.write("For full traceback, use -v\n") - sys.exit(1) + t0 = time.time() + grammar, parser, tokenizer, gen = args.func(args) + t1 = time.time() if not args.quiet: if args.verbose: @@ -110,8 +157,6 @@ def main() -> None: else: print() - t1 = time.time() - if args.verbose: dt = t1 - t0 diag = tokenizer.diagnose() diff --git a/Tools/peg_generator/pegen/build.py b/Tools/peg_generator/pegen/build.py index 0f5d73ee5feb5..94248ffd9431c 100644 --- a/Tools/peg_generator/pegen/build.py +++ b/Tools/peg_generator/pegen/build.py @@ -3,8 +3,9 @@ import tokenize import sys import sysconfig +import itertools -from typing import Optional, Tuple +from typing import Optional, Tuple, List, IO, Iterator, Set, Dict from pegen.c_generator import CParserGenerator from pegen.grammar import Grammar @@ -17,12 +18,12 @@ MOD_DIR = pathlib.Path(__file__).parent -def get_extra_flags(compiler_flags, compiler_py_flags_nodist): +def get_extra_flags(compiler_flags: str, compiler_py_flags_nodist: str) -> List[str]: flags = sysconfig.get_config_var(compiler_flags) py_flags_nodist = sysconfig.get_config_var(compiler_py_flags_nodist) if flags is None or py_flags_nodist is None: return [] - return f'{flags} {py_flags_nodist}'.split() + return f"{flags} {py_flags_nodist}".split() def compile_c_extension( @@ -45,15 +46,15 @@ def compile_c_extension( from distutils.core import Distribution, Extension from distutils.command.clean import clean # type: ignore from distutils.command.build_ext import build_ext # type: ignore - from distutils.tests.support import fixup_build_ext + from distutils.tests.support import fixup_build_ext # type: ignore if verbose: distutils.log.set_verbosity(distutils.log.DEBUG) source_file_path = pathlib.Path(generated_source_path) extension_name = source_file_path.stem - extra_compile_args = get_extra_flags('CFLAGS', 'PY_CFLAGS_NODIST') - extra_link_args = get_extra_flags('LDFLAGS', 'PY_LDFLAGS_NODIST') + extra_compile_args = get_extra_flags("CFLAGS", "PY_CFLAGS_NODIST") + extra_link_args = get_extra_flags("LDFLAGS", "PY_LDFLAGS_NODIST") if keep_asserts: extra_compile_args.append("-UNDEBUG") extension = [ @@ -111,39 +112,69 @@ def build_parser( return grammar, parser, tokenizer -def build_generator( - tokenizer: Tokenizer, +def generate_token_definitions(tokens: IO[str]) -> Tuple[Dict[str, int], Set[str]]: + exact_tokens = {} + non_exact_tokens = set() + numbers = itertools.count(0) + + for line in tokens: + line = line.strip() + + if not line or line.startswith("#"): + continue + + pieces = line.split() + index = next(numbers) + + if len(pieces) == 1: + (token,) = pieces + non_exact_tokens.add(token) + elif len(pieces) == 2: + _, op = pieces + exact_tokens[op.strip("'")] = index + else: + raise ValueError(f"Unexpected line found in Tokens file: {line}") + + return exact_tokens, non_exact_tokens + + +def build_c_generator( grammar: Grammar, grammar_file: str, + tokens_file: str, output_file: str, compile_extension: bool = False, verbose_c_extension: bool = False, keep_asserts_in_extension: bool = True, skip_actions: bool = False, ) -> ParserGenerator: - # TODO: Allow other extensions; pass the output type as an argument. - if not output_file.endswith((".c", ".py")): - raise RuntimeError("Your output file must either be a .c or .py file") + with open(tokens_file, "r") as tok_file: + exact_tok, non_exact_tok = generate_token_definitions(tok_file) with open(output_file, "w") as file: - gen: ParserGenerator - if output_file.endswith(".c"): - gen = CParserGenerator(grammar, file, skip_actions=skip_actions) - elif output_file.endswith(".py"): - gen = PythonParserGenerator(grammar, file) # TODO: skip_actions - else: - assert False # Should have been checked above + gen: ParserGenerator = CParserGenerator( + grammar, exact_tok, non_exact_tok, file, skip_actions=skip_actions + ) gen.generate(grammar_file) - if compile_extension and output_file.endswith(".c"): + if compile_extension: compile_c_extension( output_file, verbose=verbose_c_extension, keep_asserts=keep_asserts_in_extension ) + return gen + +def build_python_generator( + grammar: Grammar, grammar_file: str, output_file: str, skip_actions: bool = False, +) -> ParserGenerator: + with open(output_file, "w") as file: + gen: ParserGenerator = PythonParserGenerator(grammar, file) # TODO: skip_actions + gen.generate(grammar_file) return gen -def build_parser_and_generator( +def build_c_parser_and_generator( grammar_file: str, + tokens_file: str, output_file: str, compile_extension: bool = False, verbose_tokenizer: bool = False, @@ -152,10 +183,11 @@ def build_parser_and_generator( keep_asserts_in_extension: bool = True, skip_actions: bool = False, ) -> Tuple[Grammar, Parser, Tokenizer, ParserGenerator]: - """Generate rules, parser, tokenizer, parser generator for a given grammar + """Generate rules, C parser, tokenizer, parser generator for a given grammar Args: grammar_file (string): Path for the grammar file + tokens_file (string): Path for the tokens file output_file (string): Path for the output file compile_extension (bool, optional): Whether to compile the C extension. Defaults to False. @@ -170,10 +202,10 @@ def build_parser_and_generator( skip_actions (bool, optional): Whether to pretend no rule has any actions. """ grammar, parser, tokenizer = build_parser(grammar_file, verbose_tokenizer, verbose_parser) - gen = build_generator( - tokenizer, + gen = build_c_generator( grammar, grammar_file, + tokens_file, output_file, compile_extension, verbose_c_extension, @@ -182,3 +214,26 @@ def build_parser_and_generator( ) return grammar, parser, tokenizer, gen + + +def build_python_parser_and_generator( + grammar_file: str, + output_file: str, + verbose_tokenizer: bool = False, + verbose_parser: bool = False, + skip_actions: bool = False, +) -> Tuple[Grammar, Parser, Tokenizer, ParserGenerator]: + """Generate rules, python parser, tokenizer, parser generator for a given grammar + + Args: + grammar_file (string): Path for the grammar file + output_file (string): Path for the output file + verbose_tokenizer (bool, optional): Whether to display additional output + when generating the tokenizer. Defaults to False. + verbose_parser (bool, optional): Whether to display additional output + when generating the parser. Defaults to False. + skip_actions (bool, optional): Whether to pretend no rule has any actions. + """ + grammar, parser, tokenizer = build_parser(grammar_file, verbose_tokenizer, verbose_parser) + gen = build_python_generator(grammar, grammar_file, output_file, skip_actions=skip_actions,) + return grammar, parser, tokenizer, gen diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index 6c4b8f1e7df85..a01c3097c365b 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -1,6 +1,6 @@ import ast import re -from typing import Any, cast, Dict, IO, Optional, List, Text, Tuple +from typing import Any, cast, Dict, IO, Optional, List, Text, Tuple, Set from pegen.grammar import ( Cut, @@ -22,7 +22,6 @@ ) from pegen import grammar from pegen.parser_generator import dedupe, ParserGenerator -from pegen.tokenizer import exact_token_types EXTENSION_PREFIX = """\ #include "pegen.h" @@ -43,8 +42,15 @@ class CCallMakerVisitor(GrammarVisitor): - def __init__(self, parser_generator: ParserGenerator): + def __init__( + self, + parser_generator: ParserGenerator, + exact_tokens: Dict[str, int], + non_exact_tokens: Set[str], + ): self.gen = parser_generator + self.exact_tokens = exact_tokens + self.non_exact_tokens = non_exact_tokens self.cache: Dict[Any, Any] = {} self.keyword_cache: Dict[str, int] = {} @@ -55,10 +61,7 @@ def keyword_helper(self, keyword: str) -> Tuple[str, str]: def visit_NameLeaf(self, node: NameLeaf) -> Tuple[str, str]: name = node.value - if name in ("NAME", "NUMBER", "STRING"): - name = name.lower() - return f"{name}_var", f"_PyPegen_{name}_token(p)" - if name in ("NEWLINE", "DEDENT", "INDENT", "ENDMARKER", "ASYNC", "AWAIT"): + if name in self.non_exact_tokens: name = name.lower() return f"{name}_var", f"_PyPegen_{name}_token(p)" return f"{name}_var", f"{name}_rule(p)" @@ -68,12 +71,12 @@ def visit_StringLeaf(self, node: StringLeaf) -> Tuple[str, str]: if re.match(r"[a-zA-Z_]\w*\Z", val): # This is a keyword return self.keyword_helper(val) else: - assert val in exact_token_types, f"{node.value} is not a known literal" - type = exact_token_types[val] + assert val in self.exact_tokens, f"{node.value} is not a known literal" + type = self.exact_tokens[val] return "literal", f"_PyPegen_expect_token(p, {type})" def visit_Rhs(self, node: Rhs) -> Tuple[Optional[str], str]: - def can_we_inline(node): + def can_we_inline(node: Rhs) -> int: if len(node.alts) != 1 or len(node.alts[0].items) != 1: return False # If the alternative has an action we cannot inline @@ -152,12 +155,16 @@ class CParserGenerator(ParserGenerator, GrammarVisitor): def __init__( self, grammar: grammar.Grammar, + exact_tokens: Dict[str, int], + non_exact_tokens: Set[str], file: Optional[IO[Text]], debug: bool = False, skip_actions: bool = False, ): super().__init__(grammar, file) - self.callmakervisitor: CCallMakerVisitor = CCallMakerVisitor(self) + self.callmakervisitor: CCallMakerVisitor = CCallMakerVisitor( + self, exact_tokens, non_exact_tokens + ) self._varname_counter = 0 self.debug = debug self.skip_actions = skip_actions @@ -184,7 +191,11 @@ def call_with_errorcheck_goto(self, call_text: str, goto_target: str) -> None: self.print(f"}}") def out_of_memory_return( - self, expr: str, returnval: str, message: str = "Parser out of memory", cleanup_code=None + self, + expr: str, + returnval: str, + message: str = "Parser out of memory", + cleanup_code: Optional[str] = None, ) -> None: self.print(f"if ({expr}) {{") with self.indent(): @@ -465,7 +476,7 @@ def join_conditions(self, keyword: str, node: Any, names: List[str]) -> None: self.visit(item, names=names) self.print(")") - def emit_action(self, node: Alt, cleanup_code=None) -> None: + def emit_action(self, node: Alt, cleanup_code: Optional[str] = None) -> None: self.print(f"res = {node.action};") self.print("if (res == NULL && PyErr_Occurred()) {") diff --git a/Tools/peg_generator/pegen/testutil.py b/Tools/peg_generator/pegen/testutil.py index 5a91862be1273..1f79d8f702fb1 100644 --- a/Tools/peg_generator/pegen/testutil.py +++ b/Tools/peg_generator/pegen/testutil.py @@ -5,6 +5,7 @@ import sys import textwrap import tokenize +import token from typing import Any, cast, Dict, IO, Type, Final @@ -16,6 +17,11 @@ from pegen.python_generator import PythonParserGenerator from pegen.tokenizer import Tokenizer +EXACT_TOKENS = token.EXACT_TOKEN_TYPES # type: ignore +NON_EXACT_TOKENS = { + name for index, name in token.tok_name.items() if index not in EXACT_TOKENS.values() +} + def generate_parser(grammar: Grammar) -> Type[Parser]: # Generate a parser. @@ -70,7 +76,7 @@ def import_file(full_name: str, path: str) -> Any: def generate_c_parser_source(grammar: Grammar) -> str: out = io.StringIO() - genr = CParserGenerator(grammar, out) + genr = CParserGenerator(grammar, EXACT_TOKENS, NON_EXACT_TOKENS, out) genr.generate("") return out.getvalue() @@ -90,7 +96,7 @@ def generate_parser_c_extension( assert not os.listdir(path) source = path / "parse.c" with open(source, "w") as file: - genr = CParserGenerator(grammar, file, debug=debug) + genr = CParserGenerator(grammar, EXACT_TOKENS, NON_EXACT_TOKENS, file, debug=debug) genr.generate("parse.c") compile_c_extension(str(source), build_dir=str(path)) diff --git a/Tools/peg_generator/scripts/test_parse_directory.py b/Tools/peg_generator/scripts/test_parse_directory.py index 06a38fca67a86..6511a2d932f74 100755 --- a/Tools/peg_generator/scripts/test_parse_directory.py +++ b/Tools/peg_generator/scripts/test_parse_directory.py @@ -13,7 +13,7 @@ from typing import List, Optional, Any sys.path.insert(0, os.getcwd()) -from pegen.build import build_parser_and_generator +from pegen.build import build_c_parser_and_generator from pegen.testutil import print_memstats from scripts import show_parse @@ -26,7 +26,8 @@ description="Helper program to test directories or files for pegen", ) argparser.add_argument("-d", "--directory", help="Directory path containing files to test") -argparser.add_argument("-g", "--grammar-file", help="Grammar file path") +argparser.add_argument("--grammar-file", help="Grammar file path") +argparser.add_argument("--tokens-file", help="Tokens file path") argparser.add_argument( "-e", "--exclude", action="append", default=[], help="Glob(s) for matching files to exclude" ) @@ -114,6 +115,7 @@ def compare_trees( def parse_directory( directory: str, grammar_file: str, + tokens_file: str, verbose: bool, excluded_files: List[str], skip_actions: bool, @@ -131,15 +133,16 @@ def parse_directory( print("You must specify a directory of files to test.", file=sys.stderr) return 1 - if grammar_file: + if grammar_file and tokens_file: if not os.path.exists(grammar_file): print(f"The specified grammar file, {grammar_file}, does not exist.", file=sys.stderr) return 1 try: if not extension and parser == "pegen": - build_parser_and_generator( + build_c_parser_and_generator( grammar_file, + tokens_file, "peg_extension/parse.c", compile_extension=True, skip_actions=skip_actions, @@ -154,7 +157,9 @@ def parse_directory( return 1 else: - print("A grammar file was not provided - attempting to use existing file...\n") + print( + "A grammar file or a tokens file was not provided - attempting to use existing parser from stdlib...\n" + ) if parser == "pegen": try: @@ -264,6 +269,7 @@ def main() -> None: args = argparser.parse_args() directory = args.directory grammar_file = args.grammar_file + tokens_file = args.tokens_file verbose = args.verbose excluded_files = args.exclude skip_actions = args.skip_actions @@ -273,6 +279,7 @@ def main() -> None: parse_directory( directory, grammar_file, + tokens_file, verbose, excluded_files, skip_actions, From webhook-mailer at python.org Tue Apr 28 10:32:53 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 28 Apr 2020 14:32:53 -0000 Subject: [Python-checkins] bpo-40421: Add pyframe.h header file (GH-19755) Message-ID: https://github.com/python/cpython/commit/7c59d7c9860cdbaf4a9c26c9142aebd3259d046e commit: 7c59d7c9860cdbaf4a9c26c9142aebd3259d046e branch: master author: Victor Stinner committer: GitHub date: 2020-04-28T16:32:48+02:00 summary: bpo-40421: Add pyframe.h header file (GH-19755) Add a new separated pyframe.h header file of the PyFrame public C API: it is included by Python.h. Add PyFrame_GetLineNumber() to the limited C API. Replace "struct _frame" with "PyFrameObject" in header files. PyFrameObject is now defined as struct _frame by pyframe.h which is included early enough in Python.h. files: A Include/pyframe.h M Doc/c-api/reflection.rst M Doc/whatsnew/3.9.rst M Include/Python.h M Include/ceval.h M Include/cpython/ceval.h M Include/cpython/frameobject.h M Include/cpython/pystate.h M Include/cpython/traceback.h M Include/frameobject.h M Include/genobject.h M Include/internal/pycore_ceval.h M Include/internal/pycore_traceback.h M Include/pystate.h M Include/traceback.h M Makefile.pre.in M Objects/frameobject.c M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index 4d3d25e6621b2..498219fd9aa84 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -35,6 +35,8 @@ Reflection Return the line number that *frame* is currently executing. + *frame* must not be ``NULL``. + .. c:function:: const char* PyEval_GetFuncName(PyObject *func) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 13cd09b0b8be5..8b8aa9a514c68 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -537,6 +537,9 @@ Optimizations Build and C API Changes ======================= +* Add :c:func:`PyFrame_GetLineNumber` to the limited C API. + (Contributed by Victor Stinner in :issue:`40421`.) + * New :c:func:`PyThreadState_GetInterpreter` and :c:func:`PyInterpreterState_Get` functions to get the interpreter. New :c:func:`PyThreadState_GetFrame` function to get the current frame of a diff --git a/Include/Python.h b/Include/Python.h index 7fdb9df7065de..868e31bfa4e38 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -114,6 +114,7 @@ #include "classobject.h" #include "fileobject.h" #include "pycapsule.h" +#include "pyframe.h" #include "traceback.h" #include "sliceobject.h" #include "cellobject.h" diff --git a/Include/ceval.h b/Include/ceval.h index a70c421c18d02..df5253900eea7 100644 --- a/Include/ceval.h +++ b/Include/ceval.h @@ -28,12 +28,10 @@ Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallFunction( Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallMethod( PyObject *obj, const char *name, const char *format, ...); -struct _frame; /* Avoid including frameobject.h */ - PyAPI_FUNC(PyObject *) PyEval_GetBuiltins(void); PyAPI_FUNC(PyObject *) PyEval_GetGlobals(void); PyAPI_FUNC(PyObject *) PyEval_GetLocals(void); -PyAPI_FUNC(struct _frame *) PyEval_GetFrame(void); +PyAPI_FUNC(PyFrameObject *) PyEval_GetFrame(void); PyAPI_FUNC(int) Py_AddPendingCall(int (*func)(void *), void *arg); PyAPI_FUNC(int) Py_MakePendingCalls(void); @@ -80,8 +78,8 @@ PyAPI_FUNC(void) Py_LeaveRecursiveCall(void); PyAPI_FUNC(const char *) PyEval_GetFuncName(PyObject *); PyAPI_FUNC(const char *) PyEval_GetFuncDesc(PyObject *); -PyAPI_FUNC(PyObject *) PyEval_EvalFrame(struct _frame *); -PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(struct _frame *f, int exc); +PyAPI_FUNC(PyObject *) PyEval_EvalFrame(PyFrameObject *); +PyAPI_FUNC(PyObject *) PyEval_EvalFrameEx(PyFrameObject *f, int exc); /* Interface for threads. diff --git a/Include/cpython/ceval.h b/Include/cpython/ceval.h index 020f78712ff50..e1922a677bd38 100644 --- a/Include/cpython/ceval.h +++ b/Include/cpython/ceval.h @@ -23,7 +23,7 @@ PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *); flag was set, else return 0. */ PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); -PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _frame *f, int exc); +PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int exc); PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds); PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void); diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h index 4ced96746aa39..e819cefd13cbe 100644 --- a/Include/cpython/frameobject.h +++ b/Include/cpython/frameobject.h @@ -14,7 +14,7 @@ typedef struct { int b_level; /* value stack level to pop to */ } PyTryBlock; -typedef struct _frame { +struct _frame { PyObject_VAR_HEAD struct _frame *f_back; /* previous frame, or NULL */ PyCodeObject *f_code; /* code segment */ @@ -44,7 +44,7 @@ typedef struct _frame { char f_executing; /* whether the frame is still executing */ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ -} PyFrameObject; +}; /* Standard object interface */ @@ -79,9 +79,6 @@ PyAPI_FUNC(int) PyFrame_ClearFreeList(void); PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out); -/* Return the line of code the frame is currently executing. */ -PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); - #ifdef __cplusplus } #endif diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index 9b28f66fdba58..f292da1d3c6c5 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -16,7 +16,7 @@ PyAPI_FUNC(PyObject *) _PyInterpreterState_GetMainModule(PyInterpreterState *); /* State unique per thread */ /* Py_tracefunc return -1 when raising an exception, or 0 for success. */ -typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *); +typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *); /* The following values are used for 'what' for tracefunc functions * @@ -56,7 +56,7 @@ struct _ts { PyInterpreterState *interp; /* Borrowed reference to the current frame (it can be NULL) */ - struct _frame *frame; + PyFrameObject *frame; int recursion_depth; char overflowed; /* The stack has overflowed. Allow 50 more calls to handle the runtime error. */ @@ -184,7 +184,7 @@ PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); /* Frame evaluation API */ -typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _frame *, int); +typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, PyFrameObject *, int); PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc( PyInterpreterState *interp); diff --git a/Include/cpython/traceback.h b/Include/cpython/traceback.h index 746097daaf940..837470c3ba2bc 100644 --- a/Include/cpython/traceback.h +++ b/Include/cpython/traceback.h @@ -9,7 +9,7 @@ extern "C" { typedef struct _traceback { PyObject_HEAD struct _traceback *tb_next; - struct _frame *tb_frame; + PyFrameObject *tb_frame; int tb_lasti; int tb_lineno; } PyTracebackObject; diff --git a/Include/frameobject.h b/Include/frameobject.h index 1460e2210e317..c118af1201a4c 100644 --- a/Include/frameobject.h +++ b/Include/frameobject.h @@ -6,9 +6,7 @@ extern "C" { #endif -/* There are currently no frame related APIs in the stable ABI - * (they're all in the full CPython-specific API) - */ +#include "pyframe.h" #ifndef Py_LIMITED_API # define Py_CPYTHON_FRAMEOBJECT_H diff --git a/Include/genobject.h b/Include/genobject.h index b87a6485631c0..a7393a9a83592 100644 --- a/Include/genobject.h +++ b/Include/genobject.h @@ -10,14 +10,12 @@ extern "C" { #include "pystate.h" /* _PyErr_StackItem */ -struct _frame; /* Avoid including frameobject.h */ - /* _PyGenObject_HEAD defines the initial segment of generator and coroutine objects. */ #define _PyGenObject_HEAD(prefix) \ PyObject_HEAD \ /* Note: gi_frame can be NULL if the generator is "finished" */ \ - struct _frame *prefix##_frame; \ + PyFrameObject *prefix##_frame; \ /* True if generator is being executed. */ \ char prefix##_running; \ /* The code object backing the generator */ \ @@ -40,8 +38,8 @@ PyAPI_DATA(PyTypeObject) PyGen_Type; #define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type) #define PyGen_CheckExact(op) Py_IS_TYPE(op, &PyGen_Type) -PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *); -PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(struct _frame *, +PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *); +PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *, PyObject *name, PyObject *qualname); PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *); PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **); @@ -60,7 +58,7 @@ PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type; #define PyCoro_CheckExact(op) Py_IS_TYPE(op, &PyCoro_Type) PyObject *_PyCoro_GetAwaitableIter(PyObject *o); -PyAPI_FUNC(PyObject *) PyCoro_New(struct _frame *, +PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *, PyObject *name, PyObject *qualname); /* Asynchronous Generators */ @@ -86,7 +84,7 @@ PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type; PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type; -PyAPI_FUNC(PyObject *) PyAsyncGen_New(struct _frame *, +PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, PyObject *name, PyObject *qualname); #define PyAsyncGen_CheckExact(op) Py_IS_TYPE(op, &PyAsyncGen_Type) diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 050dd59ed15f0..2df796deade3a 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -11,7 +11,6 @@ extern "C" { /* Forward declarations */ struct pyruntimestate; struct _ceval_runtime_state; -struct _frame; #include "pycore_interp.h" /* PyInterpreterState.eval_frame */ @@ -36,7 +35,7 @@ PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth( void _PyEval_Fini(void); static inline PyObject* -_PyEval_EvalFrame(PyThreadState *tstate, struct _frame *f, int throwflag) +_PyEval_EvalFrame(PyThreadState *tstate, PyFrameObject *f, int throwflag) { return tstate->interp->eval_frame(tstate, f, throwflag); } diff --git a/Include/internal/pycore_traceback.h b/Include/internal/pycore_traceback.h index 99443d7ba2706..1f092411a72ba 100644 --- a/Include/internal/pycore_traceback.h +++ b/Include/internal/pycore_traceback.h @@ -89,7 +89,7 @@ PyAPI_FUNC(void) _Py_DumpHexadecimal( PyAPI_FUNC(PyObject*) _PyTraceBack_FromFrame( PyObject *tb_next, - struct _frame *frame); + PyFrameObject *frame); #ifdef __cplusplus } diff --git a/Include/pyframe.h b/Include/pyframe.h new file mode 100644 index 0000000000000..d3404cde4a1fb --- /dev/null +++ b/Include/pyframe.h @@ -0,0 +1,20 @@ +/* Limited C API of PyFrame API + * + * Include "frameobject.h" to get the PyFrameObject structure. + */ + +#ifndef Py_PYFRAME_H +#define Py_PYFRAME_H +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _frame PyFrameObject; + +/* Return the line of code the frame is currently executing. */ +PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_PYFRAME_H */ diff --git a/Include/pystate.h b/Include/pystate.h index 65b0a24e87f86..34cad02c3a930 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -13,7 +13,6 @@ removed (with effort). */ /* Forward declarations for PyFrameObject, PyThreadState and PyInterpreterState */ -struct _frame; struct _ts; struct _is; @@ -88,7 +87,7 @@ PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *); #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000 /* New in 3.9 */ PyAPI_FUNC(PyInterpreterState*) PyThreadState_GetInterpreter(PyThreadState *tstate); -PyAPI_FUNC(struct _frame*) PyThreadState_GetFrame(PyThreadState *tstate); +PyAPI_FUNC(PyFrameObject*) PyThreadState_GetFrame(PyThreadState *tstate); PyAPI_FUNC(uint64_t) PyThreadState_GetID(PyThreadState *tstate); #endif diff --git a/Include/traceback.h b/Include/traceback.h index 0efbae8a76a2f..781e5a6eec4ed 100644 --- a/Include/traceback.h +++ b/Include/traceback.h @@ -4,11 +4,9 @@ extern "C" { #endif -struct _frame; - /* Traceback interface */ -PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); +PyAPI_FUNC(int) PyTraceBack_Here(PyFrameObject *); PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); /* Reveal traceback type so we can typecheck traceback objects */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 200fd319ebb06..5db381f90f98c 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1047,6 +1047,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/pydtrace.h \ $(srcdir)/Include/pyerrors.h \ $(srcdir)/Include/pyfpe.h \ + $(srcdir)/Include/pyframe.h \ $(srcdir)/Include/pyhash.h \ $(srcdir)/Include/pylifecycle.h \ $(srcdir)/Include/pymacconfig.h \ diff --git a/Objects/frameobject.c b/Objects/frameobject.c index bdd7862b3c9d2..d0a15e77512c6 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -34,10 +34,13 @@ frame_getlocals(PyFrameObject *f, void *closure) int PyFrame_GetLineNumber(PyFrameObject *f) { - if (f->f_trace) + assert(f != NULL); + if (f->f_trace) { return f->f_lineno; - else + } + else { return PyCode_Addr2Line(f->f_code, f->f_lasti); + } } static PyObject * diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index d20e749b051a5..f54f155413038 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -110,6 +110,8 @@ + + @@ -165,8 +167,8 @@ - + @@ -214,7 +216,6 @@ - @@ -223,20 +224,20 @@ + + - - + - - - + + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 8c02622fd552d..c8758dab3b348 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -249,6 +249,9 @@ Include + + Include + Include From webhook-mailer at python.org Tue Apr 28 11:07:17 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 28 Apr 2020 15:07:17 -0000 Subject: [Python-checkins] bpo-40421: Add Include/cpython/code.h header file (GH-19756) Message-ID: https://github.com/python/cpython/commit/b8f704d2190125a7750b50cd9b67267b9c20fd43 commit: b8f704d2190125a7750b50cd9b67267b9c20fd43 branch: master author: Victor Stinner committer: GitHub date: 2020-04-28T17:07:12+02:00 summary: bpo-40421: Add Include/cpython/code.h header file (GH-19756) bpo-35134, bpo-40421: Add Include/cpython/code.h header file. code.h now defines PyCodeObject type in the limited C API. It is now included by Python.h. Give a name to the PyCodeObject structure: it is now called "struct PyCodeObject". So it becomes possible to define PyCodeObject as "struct PyCodeObject" in the limited C API without defining the structure. files: A Include/cpython/code.h M Include/Python.h M Include/code.h M Include/compile.h M Makefile.pre.in M PCbuild/pythoncore.vcxproj M PCbuild/pythoncore.vcxproj.filters diff --git a/Include/Python.h b/Include/Python.h index 868e31bfa4e38..dcd0a57ac1f03 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -114,6 +114,7 @@ #include "classobject.h" #include "fileobject.h" #include "pycapsule.h" +#include "code.h" #include "pyframe.h" #include "traceback.h" #include "sliceobject.h" diff --git a/Include/code.h b/Include/code.h index b268a6aedff8d..b9e23eb816529 100644 --- a/Include/code.h +++ b/Include/code.h @@ -1,180 +1,20 @@ /* Definitions for bytecode */ -#ifndef Py_LIMITED_API #ifndef Py_CODE_H #define Py_CODE_H #ifdef __cplusplus extern "C" { #endif -typedef uint16_t _Py_CODEUNIT; - -#ifdef WORDS_BIGENDIAN -# define _Py_OPCODE(word) ((word) >> 8) -# define _Py_OPARG(word) ((word) & 255) -#else -# define _Py_OPCODE(word) ((word) & 255) -# define _Py_OPARG(word) ((word) >> 8) -#endif - -typedef struct _PyOpcache _PyOpcache; - -/* Bytecode object */ -typedef struct { - PyObject_HEAD - int co_argcount; /* #arguments, except *args */ - int co_posonlyargcount; /* #positional only arguments */ - int co_kwonlyargcount; /* #keyword only arguments */ - int co_nlocals; /* #local variables */ - int co_stacksize; /* #entries needed for evaluation stack */ - int co_flags; /* CO_..., see below */ - int co_firstlineno; /* first source line number */ - PyObject *co_code; /* instruction opcodes */ - PyObject *co_consts; /* list (constants used) */ - PyObject *co_names; /* list of strings (names used) */ - PyObject *co_varnames; /* tuple of strings (local variable names) */ - PyObject *co_freevars; /* tuple of strings (free variable names) */ - PyObject *co_cellvars; /* tuple of strings (cell variable names) */ - /* The rest aren't used in either hash or comparisons, except for co_name, - used in both. This is done to preserve the name and line number - for tracebacks and debuggers; otherwise, constant de-duplication - would collapse identical functions/lambdas defined on different lines. - */ - Py_ssize_t *co_cell2arg; /* Maps cell vars which are arguments. */ - PyObject *co_filename; /* unicode (where it was loaded from) */ - PyObject *co_name; /* unicode (name, for reference) */ - PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See - Objects/lnotab_notes.txt for details. */ - void *co_zombieframe; /* for optimization only (see frameobject.c) */ - PyObject *co_weakreflist; /* to support weakrefs to code objects */ - /* Scratch space for extra data relating to the code object. - Type is a void* to keep the format private in codeobject.c to force - people to go through the proper APIs. */ - void *co_extra; - - /* Per opcodes just-in-time cache - * - * To reduce cache size, we use indirect mapping from opcode index to - * cache object: - * cache = co_opcache[co_opcache_map[next_instr - first_instr] - 1] - */ - - // co_opcache_map is indexed by (next_instr - first_instr). - // * 0 means there is no cache for this opcode. - // * n > 0 means there is cache in co_opcache[n-1]. - unsigned char *co_opcache_map; - _PyOpcache *co_opcache; - int co_opcache_flag; // used to determine when create a cache. - unsigned char co_opcache_size; // length of co_opcache. -} PyCodeObject; - -/* Masks for co_flags above */ -#define CO_OPTIMIZED 0x0001 -#define CO_NEWLOCALS 0x0002 -#define CO_VARARGS 0x0004 -#define CO_VARKEYWORDS 0x0008 -#define CO_NESTED 0x0010 -#define CO_GENERATOR 0x0020 -/* The CO_NOFREE flag is set if there are no free or cell variables. - This information is redundant, but it allows a single flag test - to determine whether there is any extra work to be done when the - call frame it setup. -*/ -#define CO_NOFREE 0x0040 - -/* The CO_COROUTINE flag is set for coroutine functions (defined with - ``async def`` keywords) */ -#define CO_COROUTINE 0x0080 -#define CO_ITERABLE_COROUTINE 0x0100 -#define CO_ASYNC_GENERATOR 0x0200 - -/* bpo-39562: These constant values are changed in Python 3.9 - to prevent collision with compiler flags. CO_FUTURE_ and PyCF_ - constants must be kept unique. PyCF_ constants can use bits from - 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */ -#define CO_FUTURE_DIVISION 0x20000 -#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */ -#define CO_FUTURE_WITH_STATEMENT 0x80000 -#define CO_FUTURE_PRINT_FUNCTION 0x100000 -#define CO_FUTURE_UNICODE_LITERALS 0x200000 - -#define CO_FUTURE_BARRY_AS_BDFL 0x400000 -#define CO_FUTURE_GENERATOR_STOP 0x800000 -#define CO_FUTURE_ANNOTATIONS 0x1000000 - -/* This value is found in the co_cell2arg array when the associated cell - variable does not correspond to an argument. */ -#define CO_CELL_NOT_AN_ARG (-1) - -/* This should be defined if a future statement modifies the syntax. - For example, when a keyword is added. -*/ -#define PY_PARSER_REQUIRES_FUTURE_KEYWORD - -#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ - -PyAPI_DATA(PyTypeObject) PyCode_Type; - -#define PyCode_Check(op) Py_IS_TYPE(op, &PyCode_Type) -#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars)) - -/* Public interface */ -PyAPI_FUNC(PyCodeObject *) PyCode_New( - int, int, int, int, int, PyObject *, PyObject *, - PyObject *, PyObject *, PyObject *, PyObject *, - PyObject *, PyObject *, int, PyObject *); - -PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs( - int, int, int, int, int, int, PyObject *, PyObject *, - PyObject *, PyObject *, PyObject *, PyObject *, - PyObject *, PyObject *, int, PyObject *); - /* same as struct above */ - -/* Creates a new empty code object with the specified source location. */ -PyAPI_FUNC(PyCodeObject *) -PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); - -/* Return the line number associated with the specified bytecode index - in this code object. If you just need the line number of a frame, - use PyFrame_GetLineNumber() instead. */ -PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); - -/* for internal use only */ -typedef struct _addr_pair { - int ap_lower; - int ap_upper; -} PyAddrPair; - -#ifndef Py_LIMITED_API -/* Update *bounds to describe the first and one-past-the-last instructions in the - same line as lasti. Return the number of that line. -*/ -PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, - int lasti, PyAddrPair *bounds); - -/* Create a comparable key used to compare constants taking in account the - * object type. It is used to make sure types are not coerced (e.g., float and - * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms - * - * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) - * depending on the type and the value. The type is the first item to not - * compare bytes and str which can raise a BytesWarning exception. */ -PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); -#endif - -PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, - PyObject *names, PyObject *lnotab); - +typedef struct PyCodeObject PyCodeObject; #ifndef Py_LIMITED_API -PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index, - void **extra); -PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index, - void *extra); +# define Py_CPYTHON_CODE_H +# include "cpython/code.h" +# undef Py_CPYTHON_CODE_H #endif #ifdef __cplusplus } #endif #endif /* !Py_CODE_H */ -#endif /* Py_LIMITED_API */ diff --git a/Include/compile.h b/Include/compile.h index dbba85bb5f653..12417ce805464 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -2,7 +2,6 @@ #define Py_COMPILE_H #ifndef Py_LIMITED_API -#include "code.h" #ifdef __cplusplus extern "C" { diff --git a/Include/cpython/code.h b/Include/cpython/code.h new file mode 100644 index 0000000000000..cda28ac6ee934 --- /dev/null +++ b/Include/cpython/code.h @@ -0,0 +1,165 @@ +#ifndef Py_CPYTHON_CODE_H +# error "this header file must not be included directly" +#endif + +typedef uint16_t _Py_CODEUNIT; + +#ifdef WORDS_BIGENDIAN +# define _Py_OPCODE(word) ((word) >> 8) +# define _Py_OPARG(word) ((word) & 255) +#else +# define _Py_OPCODE(word) ((word) & 255) +# define _Py_OPARG(word) ((word) >> 8) +#endif + +typedef struct _PyOpcache _PyOpcache; + +/* Bytecode object */ +struct PyCodeObject { + PyObject_HEAD + int co_argcount; /* #arguments, except *args */ + int co_posonlyargcount; /* #positional only arguments */ + int co_kwonlyargcount; /* #keyword only arguments */ + int co_nlocals; /* #local variables */ + int co_stacksize; /* #entries needed for evaluation stack */ + int co_flags; /* CO_..., see below */ + int co_firstlineno; /* first source line number */ + PyObject *co_code; /* instruction opcodes */ + PyObject *co_consts; /* list (constants used) */ + PyObject *co_names; /* list of strings (names used) */ + PyObject *co_varnames; /* tuple of strings (local variable names) */ + PyObject *co_freevars; /* tuple of strings (free variable names) */ + PyObject *co_cellvars; /* tuple of strings (cell variable names) */ + /* The rest aren't used in either hash or comparisons, except for co_name, + used in both. This is done to preserve the name and line number + for tracebacks and debuggers; otherwise, constant de-duplication + would collapse identical functions/lambdas defined on different lines. + */ + Py_ssize_t *co_cell2arg; /* Maps cell vars which are arguments. */ + PyObject *co_filename; /* unicode (where it was loaded from) */ + PyObject *co_name; /* unicode (name, for reference) */ + PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See + Objects/lnotab_notes.txt for details. */ + void *co_zombieframe; /* for optimization only (see frameobject.c) */ + PyObject *co_weakreflist; /* to support weakrefs to code objects */ + /* Scratch space for extra data relating to the code object. + Type is a void* to keep the format private in codeobject.c to force + people to go through the proper APIs. */ + void *co_extra; + + /* Per opcodes just-in-time cache + * + * To reduce cache size, we use indirect mapping from opcode index to + * cache object: + * cache = co_opcache[co_opcache_map[next_instr - first_instr] - 1] + */ + + // co_opcache_map is indexed by (next_instr - first_instr). + // * 0 means there is no cache for this opcode. + // * n > 0 means there is cache in co_opcache[n-1]. + unsigned char *co_opcache_map; + _PyOpcache *co_opcache; + int co_opcache_flag; // used to determine when create a cache. + unsigned char co_opcache_size; // length of co_opcache. +}; + +/* Masks for co_flags above */ +#define CO_OPTIMIZED 0x0001 +#define CO_NEWLOCALS 0x0002 +#define CO_VARARGS 0x0004 +#define CO_VARKEYWORDS 0x0008 +#define CO_NESTED 0x0010 +#define CO_GENERATOR 0x0020 +/* The CO_NOFREE flag is set if there are no free or cell variables. + This information is redundant, but it allows a single flag test + to determine whether there is any extra work to be done when the + call frame it setup. +*/ +#define CO_NOFREE 0x0040 + +/* The CO_COROUTINE flag is set for coroutine functions (defined with + ``async def`` keywords) */ +#define CO_COROUTINE 0x0080 +#define CO_ITERABLE_COROUTINE 0x0100 +#define CO_ASYNC_GENERATOR 0x0200 + +/* bpo-39562: These constant values are changed in Python 3.9 + to prevent collision with compiler flags. CO_FUTURE_ and PyCF_ + constants must be kept unique. PyCF_ constants can use bits from + 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */ +#define CO_FUTURE_DIVISION 0x20000 +#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */ +#define CO_FUTURE_WITH_STATEMENT 0x80000 +#define CO_FUTURE_PRINT_FUNCTION 0x100000 +#define CO_FUTURE_UNICODE_LITERALS 0x200000 + +#define CO_FUTURE_BARRY_AS_BDFL 0x400000 +#define CO_FUTURE_GENERATOR_STOP 0x800000 +#define CO_FUTURE_ANNOTATIONS 0x1000000 + +/* This value is found in the co_cell2arg array when the associated cell + variable does not correspond to an argument. */ +#define CO_CELL_NOT_AN_ARG (-1) + +/* This should be defined if a future statement modifies the syntax. + For example, when a keyword is added. +*/ +#define PY_PARSER_REQUIRES_FUTURE_KEYWORD + +#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */ + +PyAPI_DATA(PyTypeObject) PyCode_Type; + +#define PyCode_Check(op) Py_IS_TYPE(op, &PyCode_Type) +#define PyCode_GetNumFree(op) (PyTuple_GET_SIZE((op)->co_freevars)) + +/* Public interface */ +PyAPI_FUNC(PyCodeObject *) PyCode_New( + int, int, int, int, int, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, int, PyObject *); + +PyAPI_FUNC(PyCodeObject *) PyCode_NewWithPosOnlyArgs( + int, int, int, int, int, int, PyObject *, PyObject *, + PyObject *, PyObject *, PyObject *, PyObject *, + PyObject *, PyObject *, int, PyObject *); + /* same as struct above */ + +/* Creates a new empty code object with the specified source location. */ +PyAPI_FUNC(PyCodeObject *) +PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); + +/* Return the line number associated with the specified bytecode index + in this code object. If you just need the line number of a frame, + use PyFrame_GetLineNumber() instead. */ +PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); + +/* for internal use only */ +typedef struct _addr_pair { + int ap_lower; + int ap_upper; +} PyAddrPair; + +/* Update *bounds to describe the first and one-past-the-last instructions in the + same line as lasti. Return the number of that line. +*/ +PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, + int lasti, PyAddrPair *bounds); + +/* Create a comparable key used to compare constants taking in account the + * object type. It is used to make sure types are not coerced (e.g., float and + * complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms + * + * Return (type(obj), obj, ...): a tuple with variable size (at least 2 items) + * depending on the type and the value. The type is the first item to not + * compare bytes and str which can raise a BytesWarning exception. */ +PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj); + +PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, + PyObject *names, PyObject *lnotab); + + +PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index, + void **extra); +PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index, + void *extra); diff --git a/Makefile.pre.in b/Makefile.pre.in index 5db381f90f98c..fa7fb1fcc167f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1086,6 +1086,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/cpython/bytearrayobject.h \ $(srcdir)/Include/cpython/bytesobject.h \ $(srcdir)/Include/cpython/ceval.h \ + $(srcdir)/Include/cpython/code.h \ $(srcdir)/Include/cpython/dictobject.h \ $(srcdir)/Include/cpython/fileobject.h \ $(srcdir)/Include/cpython/fileutils.h \ diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index f54f155413038..21b51bf5e6ddc 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -131,6 +131,7 @@ + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index c8758dab3b348..f5c76fa34eb94 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -90,6 +90,9 @@ Include + + Include + Include From webhook-mailer at python.org Tue Apr 28 13:01:40 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 28 Apr 2020 17:01:40 -0000 Subject: [Python-checkins] bpo-40421: Add PyFrame_GetCode() function (GH-19757) Message-ID: https://github.com/python/cpython/commit/a42ca74fa30227e2f89a619332557cf093a937d5 commit: a42ca74fa30227e2f89a619332557cf093a937d5 branch: master author: Victor Stinner committer: GitHub date: 2020-04-28T19:01:31+02:00 summary: bpo-40421: Add PyFrame_GetCode() function (GH-19757) PyFrame_GetCode(frame): return a borrowed reference to the frame code. Replace frame->f_code with PyFrame_GetCode(frame) in most code, except in frameobject.c, genobject.c and ceval.c. Also add PyFrame_GetLineNumber() to the limited C API. files: A Misc/NEWS.d/next/C API/2020-04-28-15-47-58.bpo-40421.ZIzOV0.rst M Doc/c-api/init.rst M Doc/c-api/reflection.rst M Doc/whatsnew/3.9.rst M Include/pyframe.h M Modules/_lsprof.c M Modules/_tracemalloc.c M Objects/frameobject.c M Objects/typeobject.c M Python/_warnings.c M Python/import.c M Python/traceback.c diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 435808f537b88..afde3db30385b 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -1074,8 +1074,10 @@ All of the following functions must be called after :c:func:`Py_Initialize`. .. c:function:: PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate) - Get the current frame of the Python thread state *tstate*. It can be - ``NULL`` if no frame is currently executing. + Get a borrowed reference to the current frame of the Python thread state + *tstate*. + + Return ``NULL`` if no frame is currently executing. See also :c:func:`PyEval_GetFrame`. diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index 498219fd9aa84..b313ea302598e 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -31,6 +31,15 @@ Reflection See also :c:func:`PyThreadState_GetFrame`. +.. c:function:: int PyFrame_GetCode(PyFrameObject *frame) + + Return a borrowed reference to the *frame* code. + + *frame* must not be ``NULL``. + + .. versionadded:: 3.9 + + .. c:function:: int PyFrame_GetLineNumber(PyFrameObject *frame) Return the line number that *frame* is currently executing. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 8b8aa9a514c68..e3751fa168011 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -537,6 +537,10 @@ Optimizations Build and C API Changes ======================= +* New :c:func:`PyFrame_GetCode` function: return a borrowed reference to the + frame code. + (Contributed by Victor Stinner in :issue:`40421`.) + * Add :c:func:`PyFrame_GetLineNumber` to the limited C API. (Contributed by Victor Stinner in :issue:`40421`.) diff --git a/Include/pyframe.h b/Include/pyframe.h index d3404cde4a1fb..3816224201c7e 100644 --- a/Include/pyframe.h +++ b/Include/pyframe.h @@ -14,6 +14,8 @@ typedef struct _frame PyFrameObject; /* Return the line of code the frame is currently executing. */ PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); +PyAPI_FUNC(PyCodeObject *) PyFrame_GetCode(PyFrameObject *frame); + #ifdef __cplusplus } #endif diff --git a/Misc/NEWS.d/next/C API/2020-04-28-15-47-58.bpo-40421.ZIzOV0.rst b/Misc/NEWS.d/next/C API/2020-04-28-15-47-58.bpo-40421.ZIzOV0.rst new file mode 100644 index 0000000000000..11cf87872d513 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-28-15-47-58.bpo-40421.ZIzOV0.rst @@ -0,0 +1,2 @@ +New :c:func:`PyFrame_GetCode` function: return a borrowed reference to the +frame code. diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 7115fee1f2eb1..39cf6e126d635 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -1,5 +1,4 @@ #include "Python.h" -#include "frameobject.h" #include "rotatingtree.h" /************************************************************/ @@ -388,14 +387,16 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what, /* the 'frame' of a called function is about to start its execution */ case PyTrace_CALL: - ptrace_enter_call(self, (void *)frame->f_code, - (PyObject *)frame->f_code); + { + PyCodeObject *code = PyFrame_GetCode(frame); + ptrace_enter_call(self, (void *)code, (PyObject *)code); break; + } /* the 'frame' of a called function is about to finish (either normally or with an exception) */ case PyTrace_RETURN: - ptrace_leave_call(self, (void *)frame->f_code); + ptrace_leave_call(self, (void *)PyFrame_GetCode(frame)); break; /* case PyTrace_EXCEPTION: diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index dbae107c2da20..3593baee51201 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -346,7 +346,7 @@ tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame) lineno = 0; frame->lineno = (unsigned int)lineno; - code = pyframe->f_code; + code = PyFrame_GetCode(pyframe); if (code == NULL) { #ifdef TRACE_DEBUG tracemalloc_error("failed to get the code object of the frame"); diff --git a/Objects/frameobject.c b/Objects/frameobject.c index d0a15e77512c6..92206c5f52108 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1222,3 +1222,10 @@ _PyFrame_DebugMallocStats(FILE *out) numfree, sizeof(PyFrameObject)); } + +PyCodeObject * +PyFrame_GetCode(PyFrameObject *frame) +{ + assert(frame != NULL); + return frame->f_code; +} diff --git a/Objects/typeobject.c b/Objects/typeobject.c index bf95dd604e58e..9d97f389401d4 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -8033,13 +8033,13 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) PyFrameObject *f; PyCodeObject *co; Py_ssize_t i, n; - f = _PyThreadState_GET()->frame; + f = PyThreadState_GetFrame(_PyThreadState_GET()); if (f == NULL) { PyErr_SetString(PyExc_RuntimeError, "super(): no current frame"); return -1; } - co = f->f_code; + co = PyFrame_GetCode(f); if (co == NULL) { PyErr_SetString(PyExc_RuntimeError, "super(): no code object"); diff --git a/Python/_warnings.c b/Python/_warnings.c index f4ef0bb4b1214..91c611c257305 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -762,7 +762,6 @@ is_internal_frame(PyFrameObject *frame) { static PyObject *importlib_string = NULL; static PyObject *bootstrap_string = NULL; - PyObject *filename; int contains; if (importlib_string == NULL) { @@ -780,14 +779,23 @@ is_internal_frame(PyFrameObject *frame) Py_INCREF(bootstrap_string); } - if (frame == NULL || frame->f_code == NULL || - frame->f_code->co_filename == NULL) { + if (frame == NULL) { + return 0; + } + + PyCodeObject *code = PyFrame_GetCode(frame); + if (code == NULL) { + return 0; + } + + PyObject *filename = code->co_filename; + if (filename == NULL) { return 0; } - filename = frame->f_code->co_filename; if (!PyUnicode_Check(filename)) { return 0; } + contains = PyUnicode_Contains(filename, importlib_string); if (contains < 0) { return 0; @@ -846,7 +854,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, } else { globals = f->f_globals; - *filename = f->f_code->co_filename; + *filename = PyFrame_GetCode(f)->co_filename; Py_INCREF(*filename); *lineno = PyFrame_GetLineNumber(f); } diff --git a/Python/import.c b/Python/import.c index a8743458dd5c9..9142ebba40dfe 100644 --- a/Python/import.c +++ b/Python/import.c @@ -15,7 +15,6 @@ #include "errcode.h" #include "marshal.h" #include "code.h" -#include "frameobject.h" #include "importdl.h" #include "pydtrace.h" @@ -1536,7 +1535,7 @@ remove_importlib_frames(PyThreadState *tstate) PyTracebackObject *traceback = (PyTracebackObject *)tb; PyObject *next = (PyObject *) traceback->tb_next; PyFrameObject *frame = traceback->tb_frame; - PyCodeObject *code = frame->f_code; + PyCodeObject *code = PyFrame_GetCode(frame); int now_in_importlib; assert(PyTraceBack_Check(tb)); diff --git a/Python/traceback.c b/Python/traceback.c index 85e9124bb6a68..1ea6cbada964f 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -560,24 +560,23 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit) tb = tb->tb_next; } while (tb != NULL && err == 0) { + PyCodeObject *code = PyFrame_GetCode(tb->tb_frame); if (last_file == NULL || - tb->tb_frame->f_code->co_filename != last_file || + code->co_filename != last_file || last_line == -1 || tb->tb_lineno != last_line || - last_name == NULL || tb->tb_frame->f_code->co_name != last_name) { + last_name == NULL || code->co_name != last_name) { if (cnt > TB_RECURSIVE_CUTOFF) { err = tb_print_line_repeated(f, cnt); } - last_file = tb->tb_frame->f_code->co_filename; + last_file = code->co_filename; last_line = tb->tb_lineno; - last_name = tb->tb_frame->f_code->co_name; + last_name = code->co_name; cnt = 0; } cnt++; if (err == 0 && cnt <= TB_RECURSIVE_CUTOFF) { - err = tb_displayline(f, - tb->tb_frame->f_code->co_filename, - tb->tb_lineno, - tb->tb_frame->f_code->co_name); + err = tb_displayline(f, code->co_filename, tb->tb_lineno, + code->co_name); if (err == 0) { err = PyErr_CheckSignals(); } @@ -756,7 +755,7 @@ dump_frame(int fd, PyFrameObject *frame) PyCodeObject *code; int lineno; - code = frame->f_code; + code = PyFrame_GetCode(frame); PUTS(fd, " File "); if (code != NULL && code->co_filename != NULL && PyUnicode_Check(code->co_filename)) From webhook-mailer at python.org Tue Apr 28 13:21:04 2020 From: webhook-mailer at python.org (Ethan Onstott) Date: Tue, 28 Apr 2020 17:21:04 -0000 Subject: [Python-checkins] bpo-40025: Require _generate_next_value_ to be defined before members (GH-19098) Message-ID: https://github.com/python/cpython/commit/d9a43e20facdf4ad10186f820601c6580e1baa80 commit: d9a43e20facdf4ad10186f820601c6580e1baa80 branch: master author: Ethan Onstott committer: GitHub date: 2020-04-28T10:20:55-07:00 summary: bpo-40025: Require _generate_next_value_ to be defined before members (GH-19098) require `_generate_next_value_` to be defined before members files: A Misc/NEWS.d/next/Library/2020-03-21-05-26-38.bpo-40025.DTLtyq.rst M Doc/library/enum.rst M Lib/enum.py M Lib/test/test_enum.py M Misc/ACKS diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index eaf29cfde2344..4b4f5eb1944cc 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -273,6 +273,10 @@ overridden:: the next :class:`int` in sequence with the last :class:`int` provided, but the way it does this is an implementation detail and may change. +.. note:: + + The :meth:`_generate_next_value_` method must be defined before any members. + Iteration --------- diff --git a/Lib/enum.py b/Lib/enum.py index 0be1b60cd6d8a..49b552ba0ecf6 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -60,6 +60,7 @@ def __init__(self): self._member_names = [] self._last_values = [] self._ignore = [] + self._auto_called = False def __setitem__(self, key, value): """Changes anything not dundered or not a descriptor. @@ -77,6 +78,9 @@ def __setitem__(self, key, value): ): raise ValueError('_names_ are reserved for future Enum use') if key == '_generate_next_value_': + # check if members already defined as auto() + if self._auto_called: + raise TypeError("_generate_next_value_ must be defined before members") setattr(self, '_generate_next_value', value) elif key == '_ignore_': if isinstance(value, str): @@ -100,6 +104,7 @@ def __setitem__(self, key, value): # enum overwriting a descriptor? raise TypeError('%r already defined as: %r' % (key, self[key])) if isinstance(value, auto): + self._auto_called = True if value.value == _auto_null: value.value = self._generate_next_value(key, 1, len(self._member_names), self._last_values[:]) value = value.value diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index ec1cfeab12d7b..1df0313da0a7e 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -1751,6 +1751,16 @@ class Color(Enum): self.assertEqual(Color.blue.value, 2) self.assertEqual(Color.green.value, 3) + def test_auto_order(self): + with self.assertRaises(TypeError): + class Color(Enum): + red = auto() + green = auto() + blue = auto() + def _generate_next_value_(name, start, count, last): + return name + + def test_duplicate_auto(self): class Dupes(Enum): first = primero = auto() diff --git a/Misc/ACKS b/Misc/ACKS index 69865febeeae1..d4ffc366769ac 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -1240,6 +1240,7 @@ Bryan Olson Grant Olson Furkan Onder Koray Oner +Ethan Onstott Piet van Oostrum Tomas Oppelstrup Jason Orendorff diff --git a/Misc/NEWS.d/next/Library/2020-03-21-05-26-38.bpo-40025.DTLtyq.rst b/Misc/NEWS.d/next/Library/2020-03-21-05-26-38.bpo-40025.DTLtyq.rst new file mode 100644 index 0000000000000..7b699de4e0726 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-21-05-26-38.bpo-40025.DTLtyq.rst @@ -0,0 +1 @@ +Raise TypeError when _generate_next_value_ is defined after members. Patch by Ethan Onstott. \ No newline at end of file From webhook-mailer at python.org Tue Apr 28 15:22:39 2020 From: webhook-mailer at python.org (Karthikeyan Singaravelan) Date: Tue, 28 Apr 2020 19:22:39 -0000 Subject: [Python-checkins] bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock" (GH-19734) Message-ID: https://github.com/python/cpython/commit/521c8d6806adf0305c158d280ec00cca48e8ab22 commit: 521c8d6806adf0305c158d280ec00cca48e8ab22 branch: master author: Karthikeyan Singaravelan committer: GitHub date: 2020-04-28T20:22:31+01:00 summary: bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock" (GH-19734) * Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)" This reverts commit 72b1004657e60c900e4cd031b2635b587f4b280e. files: A Misc/NEWS.d/next/Library/2020-04-27-14-48-43.bpo-39966.N5yXUe.rst M Lib/unittest/mock.py M Lib/unittest/test/testmock/testmock.py diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index c0178f1164707..b495a5f6ccc01 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -2012,12 +2012,6 @@ def __aiter__(): def _set_return_value(mock, method, name): - # If _mock_wraps is present then attach it so that wrapped object - # is used for return value is used when called. - if mock._mock_wraps is not None: - method._mock_wraps = getattr(mock._mock_wraps, name) - return - fixed = _return_values.get(name, DEFAULT) if fixed is not DEFAULT: method.return_value = fixed diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py index 9b9e066cc545d..ce674e713e99c 100644 --- a/Lib/unittest/test/testmock/testmock.py +++ b/Lib/unittest/test/testmock/testmock.py @@ -716,12 +716,16 @@ def method(self): pass def test_magic_method_wraps_dict(self): + # bpo-25597: MagicMock with wrap doesn't call wrapped object's + # method for magic methods with default values. data = {'foo': 'bar'} wrapped_dict = MagicMock(wraps=data) self.assertEqual(wrapped_dict.get('foo'), 'bar') - self.assertEqual(wrapped_dict['foo'], 'bar') - self.assertTrue('foo' in wrapped_dict) + # Accessing key gives a MagicMock + self.assertIsInstance(wrapped_dict['foo'], MagicMock) + # __contains__ method has a default value of False + self.assertFalse('foo' in wrapped_dict) # return_value is non-sentinel and takes precedence over wrapped value. wrapped_dict.get.return_value = 'return_value' @@ -732,14 +736,13 @@ def test_magic_method_wraps_dict(self): self.assertEqual(wrapped_dict.get('foo'), 'bar') self.assertEqual(wrapped_dict.get('baz'), None) - with self.assertRaises(KeyError): - wrapped_dict['baz'] + self.assertIsInstance(wrapped_dict['baz'], MagicMock) self.assertFalse('bar' in wrapped_dict) data['baz'] = 'spam' self.assertEqual(wrapped_dict.get('baz'), 'spam') - self.assertEqual(wrapped_dict['baz'], 'spam') - self.assertTrue('baz' in wrapped_dict) + self.assertIsInstance(wrapped_dict['baz'], MagicMock) + self.assertFalse('bar' in wrapped_dict) del data['baz'] self.assertEqual(wrapped_dict.get('baz'), None) @@ -759,6 +762,7 @@ def __custom_method__(self): klass = MagicMock(wraps=Foo) obj = klass() self.assertEqual(obj.__getitem__(2), 2) + self.assertEqual(obj[2], 2) self.assertEqual(obj.__custom_method__(), "foo") diff --git a/Misc/NEWS.d/next/Library/2020-04-27-14-48-43.bpo-39966.N5yXUe.rst b/Misc/NEWS.d/next/Library/2020-04-27-14-48-43.bpo-39966.N5yXUe.rst new file mode 100644 index 0000000000000..614b452056e53 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-27-14-48-43.bpo-39966.N5yXUe.rst @@ -0,0 +1,2 @@ +Revert bpo-25597. :class:`unittest.mock.MagicMock` with wraps' set uses +default return values for magic methods. From webhook-mailer at python.org Tue Apr 28 18:57:02 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 28 Apr 2020 22:57:02 -0000 Subject: [Python-checkins] bpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772) Message-ID: https://github.com/python/cpython/commit/6d86a2331e6b64a2ae80c1a21f81baa5a71ac594 commit: 6d86a2331e6b64a2ae80c1a21f81baa5a71ac594 branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T00:56:58+02:00 summary: bpo-40429: PyFrame_GetCode() result cannot be NULL (GH-19772) Add frame_nslots() to factorize duplicate code. files: M Doc/c-api/reflection.rst M Modules/_tracemalloc.c M Objects/frameobject.c M Objects/genobject.c M Objects/typeobject.c M Python/_warnings.c M Python/ceval.c diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index b313ea302598e..594c1ec7943f7 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -34,6 +34,7 @@ Reflection .. c:function:: int PyFrame_GetCode(PyFrameObject *frame) Return a borrowed reference to the *frame* code. + The frame code cannot be ``NULL``. *frame* must not be ``NULL``. diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 3593baee51201..b2a000302164e 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -347,13 +347,6 @@ tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame) frame->lineno = (unsigned int)lineno; code = PyFrame_GetCode(pyframe); - if (code == NULL) { -#ifdef TRACE_DEBUG - tracemalloc_error("failed to get the code object of the frame"); -#endif - return; - } - if (code->co_filename == NULL) { #ifdef TRACE_DEBUG tracemalloc_error("failed to get the filename of the code object"); diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 92206c5f52108..6b3559ee9625e 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -665,12 +665,18 @@ frame_dealloc(PyFrameObject *f) Py_TRASHCAN_SAFE_END(f) } +static inline Py_ssize_t +frame_nslots(PyFrameObject *frame) +{ + PyCodeObject *code = frame->f_code; + return (code->co_nlocals + + PyTuple_GET_SIZE(code->co_cellvars) + + PyTuple_GET_SIZE(code->co_freevars)); +} + static int frame_traverse(PyFrameObject *f, visitproc visit, void *arg) { - PyObject **fastlocals, **p; - Py_ssize_t i, slots; - Py_VISIT(f->f_back); Py_VISIT(f->f_code); Py_VISIT(f->f_builtins); @@ -679,15 +685,16 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg) Py_VISIT(f->f_trace); /* locals */ - slots = f->f_code->co_nlocals + PyTuple_GET_SIZE(f->f_code->co_cellvars) + PyTuple_GET_SIZE(f->f_code->co_freevars); - fastlocals = f->f_localsplus; - for (i = slots; --i >= 0; ++fastlocals) + PyObject **fastlocals = f->f_localsplus; + for (Py_ssize_t i = frame_nslots(f); --i >= 0; ++fastlocals) { Py_VISIT(*fastlocals); + } /* stack */ if (f->f_stacktop != NULL) { - for (p = f->f_valuestack; p < f->f_stacktop; p++) + for (PyObject **p = f->f_valuestack; p < f->f_stacktop; p++) { Py_VISIT(*p); + } } return 0; } @@ -695,30 +702,28 @@ frame_traverse(PyFrameObject *f, visitproc visit, void *arg) static int frame_tp_clear(PyFrameObject *f) { - PyObject **fastlocals, **p, **oldtop; - Py_ssize_t i, slots; - /* Before anything else, make sure that this frame is clearly marked * as being defunct! Else, e.g., a generator reachable from this * frame may also point to this frame, believe itself to still be * active, and try cleaning up this frame again. */ - oldtop = f->f_stacktop; + PyObject **oldtop = f->f_stacktop; f->f_stacktop = NULL; f->f_executing = 0; Py_CLEAR(f->f_trace); /* locals */ - slots = f->f_code->co_nlocals + PyTuple_GET_SIZE(f->f_code->co_cellvars) + PyTuple_GET_SIZE(f->f_code->co_freevars); - fastlocals = f->f_localsplus; - for (i = slots; --i >= 0; ++fastlocals) + PyObject **fastlocals = f->f_localsplus; + for (Py_ssize_t i = frame_nslots(f); --i >= 0; ++fastlocals) { Py_CLEAR(*fastlocals); + } /* stack */ if (oldtop != NULL) { - for (p = f->f_valuestack; p < oldtop; p++) + for (PyObject **p = f->f_valuestack; p < oldtop; p++) { Py_CLEAR(*p); + } } return 0; } @@ -747,10 +752,10 @@ frame_sizeof(PyFrameObject *f, PyObject *Py_UNUSED(ignored)) { Py_ssize_t res, extras, ncells, nfrees; - ncells = PyTuple_GET_SIZE(f->f_code->co_cellvars); - nfrees = PyTuple_GET_SIZE(f->f_code->co_freevars); - extras = f->f_code->co_stacksize + f->f_code->co_nlocals + - ncells + nfrees; + PyCodeObject *code = f->f_code; + ncells = PyTuple_GET_SIZE(code->co_cellvars); + nfrees = PyTuple_GET_SIZE(code->co_freevars); + extras = code->co_stacksize + code->co_nlocals + ncells + nfrees; /* subtract one as it is already included in PyFrameObject */ res = sizeof(PyFrameObject) + (extras-1) * sizeof(PyObject *); @@ -764,9 +769,10 @@ static PyObject * frame_repr(PyFrameObject *f) { int lineno = PyFrame_GetLineNumber(f); + PyCodeObject *code = f->f_code; return PyUnicode_FromFormat( "", - f, f->f_code->co_filename, lineno, f->f_code->co_name); + f, code->co_filename, lineno, code->co_name); } static PyMethodDef frame_methods[] = { @@ -940,6 +946,8 @@ _PyFrame_New_NoTrack(PyThreadState *tstate, PyCodeObject *code, f->f_trace_opcodes = 0; f->f_trace_lines = 1; + assert(f->f_code != NULL); + return f; } @@ -1227,5 +1235,7 @@ PyCodeObject * PyFrame_GetCode(PyFrameObject *frame) { assert(frame != NULL); - return frame->f_code; + PyCodeObject *code = frame->f_code; + assert(code != NULL); + return code; } diff --git a/Objects/genobject.c b/Objects/genobject.c index 66c6ccba0c490..071def8a25aae 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1117,11 +1117,11 @@ compute_cr_origin(int origin_depth) } frame = PyEval_GetFrame(); for (int i = 0; i < frame_count; ++i) { - PyObject *frameinfo = Py_BuildValue( - "OiO", - frame->f_code->co_filename, - PyFrame_GetLineNumber(frame), - frame->f_code->co_name); + PyCodeObject *code = frame->f_code; + PyObject *frameinfo = Py_BuildValue("OiO", + code->co_filename, + PyFrame_GetLineNumber(frame), + code->co_name); if (!frameinfo) { Py_DECREF(cr_origin); return NULL; diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 9d97f389401d4..f65f05386cbe7 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -8040,11 +8040,6 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) return -1; } co = PyFrame_GetCode(f); - if (co == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "super(): no code object"); - return -1; - } if (co->co_argcount == 0) { PyErr_SetString(PyExc_RuntimeError, "super(): no arguments"); diff --git a/Python/_warnings.c b/Python/_warnings.c index 91c611c257305..7a620dc54310c 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -784,10 +784,6 @@ is_internal_frame(PyFrameObject *frame) } PyCodeObject *code = PyFrame_GetCode(frame); - if (code == NULL) { - return 0; - } - PyObject *filename = code->co_filename; if (filename == NULL) { return 0; diff --git a/Python/ceval.c b/Python/ceval.c index c610419f24f58..e15d7e0b4603d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5580,9 +5580,10 @@ dtrace_function_entry(PyFrameObject *f) const char *funcname; int lineno; - filename = PyUnicode_AsUTF8(f->f_code->co_filename); - funcname = PyUnicode_AsUTF8(f->f_code->co_name); - lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); + PyCodeObject *code = f->f_code; + filename = PyUnicode_AsUTF8(code->co_filename); + funcname = PyUnicode_AsUTF8(code->co_name); + lineno = PyCode_Addr2Line(code, f->f_lasti); PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno); } @@ -5594,9 +5595,10 @@ dtrace_function_return(PyFrameObject *f) const char *funcname; int lineno; - filename = PyUnicode_AsUTF8(f->f_code->co_filename); - funcname = PyUnicode_AsUTF8(f->f_code->co_name); - lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); + PyCodeObject *code = f->f_code; + filename = PyUnicode_AsUTF8(code->co_filename); + funcname = PyUnicode_AsUTF8(code->co_name); + lineno = PyCode_Addr2Line(code, f->f_lasti); PyDTrace_FUNCTION_RETURN(filename, funcname, lineno); } From webhook-mailer at python.org Tue Apr 28 19:11:37 2020 From: webhook-mailer at python.org (Eric Snow) Date: Tue, 28 Apr 2020 23:11:37 -0000 Subject: [Python-checkins] bpo-32604: Add support for a "default" arg in channel_recv(). (GH-19770) Message-ID: https://github.com/python/cpython/commit/5e8c691594d68925213d36296ce7c4b3e90bcb1d commit: 5e8c691594d68925213d36296ce7c4b3e90bcb1d branch: master author: Eric Snow committer: GitHub date: 2020-04-28T16:11:32-07:00 summary: bpo-32604: Add support for a "default" arg in channel_recv(). (GH-19770) This allows the caller to avoid creation of an exception when the channel is empty (just like `dict.get()` works). `ChannelEmptyError` is still raised if no default is provided. Automerge-Triggered-By: @ericsnowcurrently files: M Lib/test/test__xxsubinterpreters.py M Modules/_xxsubinterpretersmodule.c diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index 30f8f98acc9dd..8a368dc113972 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -1302,6 +1302,27 @@ def test_recv_empty(self): with self.assertRaises(interpreters.ChannelEmptyError): interpreters.channel_recv(cid) + def test_recv_default(self): + default = object() + cid = interpreters.channel_create() + obj1 = interpreters.channel_recv(cid, default) + interpreters.channel_send(cid, None) + interpreters.channel_send(cid, 1) + interpreters.channel_send(cid, b'spam') + interpreters.channel_send(cid, b'eggs') + obj2 = interpreters.channel_recv(cid, default) + obj3 = interpreters.channel_recv(cid, default) + obj4 = interpreters.channel_recv(cid) + obj5 = interpreters.channel_recv(cid, default) + obj6 = interpreters.channel_recv(cid, default) + + self.assertIs(obj1, default) + self.assertIs(obj2, None) + self.assertEqual(obj3, 1) + self.assertEqual(obj4, b'spam') + self.assertEqual(obj5, b'eggs') + self.assertIs(obj6, default) + def test_run_string_arg_unresolved(self): cid = interpreters.channel_create() interp = interpreters.create() diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index fa35e14c55401..2ee8d07d0671f 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -1350,19 +1350,16 @@ _channel_recv(_channels *channels, int64_t id) _PyCrossInterpreterData *data = _channel_next(chan, PyInterpreterState_GetID(interp)); PyThread_release_lock(mutex); if (data == NULL) { - if (!PyErr_Occurred()) { - PyErr_Format(ChannelEmptyError, "channel %" PRId64 " is empty", id); - } return NULL; } // Convert the data back to an object. PyObject *obj = _PyCrossInterpreterData_NewObject(data); + _PyCrossInterpreterData_Release(data); + PyMem_Free(data); if (obj == NULL) { return NULL; } - _PyCrossInterpreterData_Release(data); - PyMem_Free(data); return obj; } @@ -2351,20 +2348,37 @@ Add the object's data to the channel's queue."); static PyObject * channel_recv(PyObject *self, PyObject *args, PyObject *kwds) { - static char *kwlist[] = {"cid", NULL}; + static char *kwlist[] = {"cid", "default", NULL}; int64_t cid; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&:channel_recv", kwlist, - channel_id_converter, &cid)) { + PyObject *dflt = NULL; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O&|O:channel_recv", kwlist, + channel_id_converter, &cid, &dflt)) { return NULL; } + Py_XINCREF(dflt); - return _channel_recv(&_globals.channels, cid); + PyObject *obj = _channel_recv(&_globals.channels, cid); + if (obj != NULL) { + Py_XDECREF(dflt); + return obj; + } else if (PyErr_Occurred()) { + Py_XDECREF(dflt); + return NULL; + } else if (dflt != NULL) { + return dflt; + } else { + PyErr_Format(ChannelEmptyError, "channel %" PRId64 " is empty", cid); + return NULL; + } } PyDoc_STRVAR(channel_recv_doc, -"channel_recv(cid) -> obj\n\ +"channel_recv(cid, [default]) -> obj\n\ +\n\ +Return a new object from the data at the front of the channel's queue.\n\ \n\ -Return a new object from the data at the from of the channel's queue."); +If there is nothing to receive then raise ChannelEmptyError, unless\n\ +a default value is provided. In that case return it."); static PyObject * channel_close(PyObject *self, PyObject *args, PyObject *kwds) From webhook-mailer at python.org Tue Apr 28 19:28:21 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Tue, 28 Apr 2020 23:28:21 -0000 Subject: [Python-checkins] bpo-40429: PyFrame_GetCode() now returns a strong reference (GH-19773) Message-ID: https://github.com/python/cpython/commit/8852ad4208e34825f74e24945edb5bcf055d94fe commit: 8852ad4208e34825f74e24945edb5bcf055d94fe branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T01:28:13+02:00 summary: bpo-40429: PyFrame_GetCode() now returns a strong reference (GH-19773) files: M Doc/c-api/reflection.rst M Doc/whatsnew/3.9.rst M Modules/_lsprof.c M Modules/_tracemalloc.c M Objects/frameobject.c M Objects/typeobject.c M Python/_warnings.c M Python/import.c M Python/traceback.c diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index 594c1ec7943f7..21d9878609127 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -33,10 +33,11 @@ Reflection .. c:function:: int PyFrame_GetCode(PyFrameObject *frame) - Return a borrowed reference to the *frame* code. - The frame code cannot be ``NULL``. + Get the *frame* code. - *frame* must not be ``NULL``. + Return a strong reference. + + *frame* must not be ``NULL``. The result (frame code) cannot be ``NULL``. .. versionadded:: 3.9 diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index e3751fa168011..cb3afd593571a 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -537,8 +537,7 @@ Optimizations Build and C API Changes ======================= -* New :c:func:`PyFrame_GetCode` function: return a borrowed reference to the - frame code. +* New :c:func:`PyFrame_GetCode` function: get a frame code. (Contributed by Victor Stinner in :issue:`40421`.) * Add :c:func:`PyFrame_GetLineNumber` to the limited C API. diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c index 39cf6e126d635..5e53d839640d9 100644 --- a/Modules/_lsprof.c +++ b/Modules/_lsprof.c @@ -390,14 +390,19 @@ profiler_callback(PyObject *self, PyFrameObject *frame, int what, { PyCodeObject *code = PyFrame_GetCode(frame); ptrace_enter_call(self, (void *)code, (PyObject *)code); + Py_DECREF(code); break; } /* the 'frame' of a called function is about to finish (either normally or with an exception) */ case PyTrace_RETURN: - ptrace_leave_call(self, (void *)PyFrame_GetCode(frame)); + { + PyCodeObject *code = PyFrame_GetCode(frame); + ptrace_leave_call(self, (void *)code); + Py_DECREF(code); break; + } /* case PyTrace_EXCEPTION: If the exception results in the function exiting, a diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index b2a000302164e..24628a907f28a 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -335,26 +335,24 @@ hashtable_compare_traceback(_Py_hashtable_t *ht, const void *pkey, static void tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame) { - PyCodeObject *code; - PyObject *filename; - _Py_hashtable_entry_t *entry; - int lineno; - frame->filename = unknown_filename; - lineno = PyFrame_GetLineNumber(pyframe); - if (lineno < 0) + int lineno = PyFrame_GetLineNumber(pyframe); + if (lineno < 0) { lineno = 0; + } frame->lineno = (unsigned int)lineno; - code = PyFrame_GetCode(pyframe); - if (code->co_filename == NULL) { + PyCodeObject *code = PyFrame_GetCode(pyframe); + PyObject *filename = code->co_filename; + Py_DECREF(code); + + if (filename == NULL) { #ifdef TRACE_DEBUG tracemalloc_error("failed to get the filename of the code object"); #endif return; } - filename = code->co_filename; assert(filename != NULL); if (filename == NULL) return; @@ -375,6 +373,7 @@ tracemalloc_get_frame(PyFrameObject *pyframe, frame_t *frame) } /* intern the filename */ + _Py_hashtable_entry_t *entry; entry = _Py_HASHTABLE_GET_ENTRY(tracemalloc_filenames, filename); if (entry != NULL) { _Py_HASHTABLE_ENTRY_READ_KEY(tracemalloc_filenames, entry, filename); diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 6b3559ee9625e..533186bc046f0 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1237,5 +1237,6 @@ PyFrame_GetCode(PyFrameObject *frame) assert(frame != NULL); PyCodeObject *code = frame->f_code; assert(code != NULL); + Py_INCREF(code); return code; } diff --git a/Objects/typeobject.c b/Objects/typeobject.c index f65f05386cbe7..8f9ab5c0bae62 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -8031,7 +8031,6 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) /* Call super(), without args -- fill in from __class__ and first local variable on the stack. */ PyFrameObject *f; - PyCodeObject *co; Py_ssize_t i, n; f = PyThreadState_GetFrame(_PyThreadState_GET()); if (f == NULL) { @@ -8039,7 +8038,8 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) "super(): no current frame"); return -1; } - co = PyFrame_GetCode(f); + PyCodeObject *co = PyFrame_GetCode(f); + Py_DECREF(co); // use a borrowed reference if (co->co_argcount == 0) { PyErr_SetString(PyExc_RuntimeError, "super(): no arguments"); diff --git a/Python/_warnings.c b/Python/_warnings.c index 7a620dc54310c..7c15ce0ef89c3 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -785,6 +785,8 @@ is_internal_frame(PyFrameObject *frame) PyCodeObject *code = PyFrame_GetCode(frame); PyObject *filename = code->co_filename; + Py_DECREF(code); + if (filename == NULL) { return 0; } @@ -850,7 +852,9 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, } else { globals = f->f_globals; - *filename = PyFrame_GetCode(f)->co_filename; + PyCodeObject *code = PyFrame_GetCode(f); + *filename = code->co_filename; + Py_DECREF(code); Py_INCREF(*filename); *lineno = PyFrame_GetLineNumber(f); } diff --git a/Python/import.c b/Python/import.c index 9142ebba40dfe..8c94e0ec54655 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1557,6 +1557,7 @@ remove_importlib_frames(PyThreadState *tstate) else { prev_link = (PyObject **) &traceback->tb_next; } + Py_DECREF(code); tb = next; } done: diff --git a/Python/traceback.c b/Python/traceback.c index 1ea6cbada964f..438a2c4fce7ca 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -581,6 +581,7 @@ tb_printinternal(PyTracebackObject *tb, PyObject *f, long limit) err = PyErr_CheckSignals(); } } + Py_DECREF(code); tb = tb->tb_next; } if (err == 0 && cnt > TB_RECURSIVE_CUTOFF) { @@ -752,12 +753,9 @@ _Py_DumpASCII(int fd, PyObject *text) static void dump_frame(int fd, PyFrameObject *frame) { - PyCodeObject *code; - int lineno; - - code = PyFrame_GetCode(frame); + PyCodeObject *code = PyFrame_GetCode(frame); PUTS(fd, " File "); - if (code != NULL && code->co_filename != NULL + if (code->co_filename != NULL && PyUnicode_Check(code->co_filename)) { PUTS(fd, "\""); @@ -768,7 +766,7 @@ dump_frame(int fd, PyFrameObject *frame) } /* PyFrame_GetLineNumber() was introduced in Python 2.7.0 and 3.2.0 */ - lineno = PyCode_Addr2Line(code, frame->f_lasti); + int lineno = PyCode_Addr2Line(code, frame->f_lasti); PUTS(fd, ", line "); if (lineno >= 0) { _Py_DumpDecimal(fd, (unsigned long)lineno); @@ -778,7 +776,7 @@ dump_frame(int fd, PyFrameObject *frame) } PUTS(fd, " in "); - if (code != NULL && code->co_name != NULL + if (code->co_name != NULL && PyUnicode_Check(code->co_name)) { _Py_DumpASCII(fd, code->co_name); } @@ -787,6 +785,7 @@ dump_frame(int fd, PyFrameObject *frame) } PUTS(fd, "\n"); + Py_DECREF(code); } static void From webhook-mailer at python.org Tue Apr 28 20:18:50 2020 From: webhook-mailer at python.org (Lewis Gaul) Date: Wed, 29 Apr 2020 00:18:50 -0000 Subject: [Python-checkins] bpo-38880: List interpreters associated with a channel end (GH-17323) Message-ID: https://github.com/python/cpython/commit/f7bbf58aa9299e9dd00b7a1bdd1113b4dcb6dfdf commit: f7bbf58aa9299e9dd00b7a1bdd1113b4dcb6dfdf branch: master author: Lewis Gaul committer: GitHub date: 2020-04-28T17:18:42-07:00 summary: bpo-38880: List interpreters associated with a channel end (GH-17323) This PR adds the functionality requested by https://github.com/ericsnowcurrently/multi-core-python/issues/52. Automerge-Triggered-By: @ericsnowcurrently files: A Misc/NEWS.d/next/Core and Builtins/2019-11-22-14-34-47.bpo-38880.evcCPa.rst M Lib/test/test__xxsubinterpreters.py M Misc/ACKS M Modules/_xxsubinterpretersmodule.c diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index 8a368dc113972..44f4d3fa0f4c9 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -1207,6 +1207,185 @@ def test_ids_global(self): self.assertEqual(cid2, int(cid1) + 1) + def test_channel_list_interpreters_none(self): + """Test listing interpreters for a channel with no associations.""" + # Test for channel with no associated interpreters. + cid = interpreters.channel_create() + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(send_interps, []) + self.assertEqual(recv_interps, []) + + def test_channel_list_interpreters_basic(self): + """Test basic listing channel interpreters.""" + interp0 = interpreters.get_main() + cid = interpreters.channel_create() + interpreters.channel_send(cid, "send") + # Test for a channel that has one end associated to an interpreter. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(send_interps, [interp0]) + self.assertEqual(recv_interps, []) + + interp1 = interpreters.create() + _run_output(interp1, dedent(f""" + import _xxsubinterpreters as _interpreters + obj = _interpreters.channel_recv({cid}) + """)) + # Test for channel that has boths ends associated to an interpreter. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(send_interps, [interp0]) + self.assertEqual(recv_interps, [interp1]) + + def test_channel_list_interpreters_multiple(self): + """Test listing interpreters for a channel with many associations.""" + interp0 = interpreters.get_main() + interp1 = interpreters.create() + interp2 = interpreters.create() + interp3 = interpreters.create() + cid = interpreters.channel_create() + + interpreters.channel_send(cid, "send") + _run_output(interp1, dedent(f""" + import _xxsubinterpreters as _interpreters + _interpreters.channel_send({cid}, "send") + """)) + _run_output(interp2, dedent(f""" + import _xxsubinterpreters as _interpreters + obj = _interpreters.channel_recv({cid}) + """)) + _run_output(interp3, dedent(f""" + import _xxsubinterpreters as _interpreters + obj = _interpreters.channel_recv({cid}) + """)) + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(set(send_interps), {interp0, interp1}) + self.assertEqual(set(recv_interps), {interp2, interp3}) + + def test_channel_list_interpreters_destroyed(self): + """Test listing channel interpreters with a destroyed interpreter.""" + interp0 = interpreters.get_main() + interp1 = interpreters.create() + cid = interpreters.channel_create() + interpreters.channel_send(cid, "send") + _run_output(interp1, dedent(f""" + import _xxsubinterpreters as _interpreters + obj = _interpreters.channel_recv({cid}) + """)) + # Should be one interpreter associated with each end. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(send_interps, [interp0]) + self.assertEqual(recv_interps, [interp1]) + + interpreters.destroy(interp1) + # Destroyed interpreter should not be listed. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(send_interps, [interp0]) + self.assertEqual(recv_interps, []) + + def test_channel_list_interpreters_released(self): + """Test listing channel interpreters with a released channel.""" + # Set up one channel with main interpreter on the send end and two + # subinterpreters on the receive end. + interp0 = interpreters.get_main() + interp1 = interpreters.create() + interp2 = interpreters.create() + cid = interpreters.channel_create() + interpreters.channel_send(cid, "data") + _run_output(interp1, dedent(f""" + import _xxsubinterpreters as _interpreters + obj = _interpreters.channel_recv({cid}) + """)) + interpreters.channel_send(cid, "data") + _run_output(interp2, dedent(f""" + import _xxsubinterpreters as _interpreters + obj = _interpreters.channel_recv({cid}) + """)) + # Check the setup. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(len(send_interps), 1) + self.assertEqual(len(recv_interps), 2) + + # Release the main interpreter from the send end. + interpreters.channel_release(cid, send=True) + # Send end should have no associated interpreters. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(len(send_interps), 0) + self.assertEqual(len(recv_interps), 2) + + # Release one of the subinterpreters from the receive end. + _run_output(interp2, dedent(f""" + import _xxsubinterpreters as _interpreters + _interpreters.channel_release({cid}) + """)) + # Receive end should have the released interpreter removed. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(len(send_interps), 0) + self.assertEqual(recv_interps, [interp1]) + + def test_channel_list_interpreters_closed(self): + """Test listing channel interpreters with a closed channel.""" + interp0 = interpreters.get_main() + interp1 = interpreters.create() + cid = interpreters.channel_create() + # Put something in the channel so that it's not empty. + interpreters.channel_send(cid, "send") + + # Check initial state. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(len(send_interps), 1) + self.assertEqual(len(recv_interps), 0) + + # Force close the channel. + interpreters.channel_close(cid, force=True) + # Both ends should raise an error. + with self.assertRaises(interpreters.ChannelClosedError): + interpreters.channel_list_interpreters(cid, send=True) + with self.assertRaises(interpreters.ChannelClosedError): + interpreters.channel_list_interpreters(cid, send=False) + + def test_channel_list_interpreters_closed_send_end(self): + """Test listing channel interpreters with a channel's send end closed.""" + interp0 = interpreters.get_main() + interp1 = interpreters.create() + cid = interpreters.channel_create() + # Put something in the channel so that it's not empty. + interpreters.channel_send(cid, "send") + + # Check initial state. + send_interps = interpreters.channel_list_interpreters(cid, send=True) + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(len(send_interps), 1) + self.assertEqual(len(recv_interps), 0) + + # Close the send end of the channel. + interpreters.channel_close(cid, send=True) + # Send end should raise an error. + with self.assertRaises(interpreters.ChannelClosedError): + interpreters.channel_list_interpreters(cid, send=True) + # Receive end should not be closed (since channel is not empty). + recv_interps = interpreters.channel_list_interpreters(cid, send=False) + self.assertEqual(len(recv_interps), 0) + + # Close the receive end of the channel from a subinterpreter. + _run_output(interp1, dedent(f""" + import _xxsubinterpreters as _interpreters + _interpreters.channel_close({cid}, force=True) + """)) + # Both ends should raise an error. + with self.assertRaises(interpreters.ChannelClosedError): + interpreters.channel_list_interpreters(cid, send=True) + with self.assertRaises(interpreters.ChannelClosedError): + interpreters.channel_list_interpreters(cid, send=False) + #################### def test_send_recv_main(self): @@ -1540,6 +1719,23 @@ def test_close_used_multiple_times_by_single_user(self): with self.assertRaises(interpreters.ChannelClosedError): interpreters.channel_recv(cid) + def test_channel_list_interpreters_invalid_channel(self): + cid = interpreters.channel_create() + # Test for invalid channel ID. + with self.assertRaises(interpreters.ChannelNotFoundError): + interpreters.channel_list_interpreters(1000, send=True) + + interpreters.channel_close(cid) + # Test for a channel that has been closed. + with self.assertRaises(interpreters.ChannelClosedError): + interpreters.channel_list_interpreters(cid, send=True) + + def test_channel_list_interpreters_invalid_args(self): + # Tests for invalid arguments passed to the API. + cid = interpreters.channel_create() + with self.assertRaises(TypeError): + interpreters.channel_list_interpreters(cid) + class ChannelReleaseTests(TestBase): diff --git a/Misc/ACKS b/Misc/ACKS index d4ffc366769ac..89f37e584ef8b 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -456,6 +456,7 @@ Rodolpho Eckhardt Ulrich Eckhardt David Edelsohn John Edmonds +Benjamin Edwards Grant Edwards Zvi Effron John Ehresman @@ -570,6 +571,7 @@ Jake Garver Dan Gass Tim Gates Andrew Gaul +Lewis Gaul Matthieu Gautier Stephen M. Gava Xavier de Gaye diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-11-22-14-34-47.bpo-38880.evcCPa.rst b/Misc/NEWS.d/next/Core and Builtins/2019-11-22-14-34-47.bpo-38880.evcCPa.rst new file mode 100644 index 0000000000000..07a7f5ec22aa1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-11-22-14-34-47.bpo-38880.evcCPa.rst @@ -0,0 +1 @@ +Added the ability to list interpreters associated with channel ends in the internal subinterpreters module. diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index 2ee8d07d0671f..e618930e09d12 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -538,7 +538,7 @@ _channelend_find(_channelend *first, int64_t interp, _channelend **pprev) typedef struct _channelassociations { // Note that the list entries are never removed for interpreter - // for which the channel is closed. This should be a problem in + // for which the channel is closed. This should not be a problem in // practice. Also, a channel isn't automatically closed when an // interpreter is destroyed. int64_t numsendopen; @@ -1179,11 +1179,6 @@ _channels_list_all(_channels *channels, int64_t *count) { int64_t *cids = NULL; PyThread_acquire_lock(channels->mutex, WAIT_LOCK); - int64_t numopen = channels->numopen; - if (numopen >= PY_SSIZE_T_MAX) { - PyErr_SetString(PyExc_RuntimeError, "too many channels open"); - goto done; - } int64_t *ids = PyMem_NEW(int64_t, (Py_ssize_t)(channels->numopen)); if (ids == NULL) { goto done; @@ -1392,6 +1387,24 @@ _channel_close(_channels *channels, int64_t id, int end, int force) return _channels_close(channels, id, NULL, end, force); } +static int +_channel_is_associated(_channels *channels, int64_t cid, int64_t interp, + int send) +{ + _PyChannelState *chan = _channels_lookup(channels, cid, NULL); + if (chan == NULL) { + return -1; + } else if (send && chan->closing != NULL) { + PyErr_Format(ChannelClosedError, "channel %" PRId64 " closed", cid); + return -1; + } + + _channelend *end = _channelend_find(send ? chan->ends->send : chan->ends->recv, + interp, NULL); + + return (end != NULL && end->open); +} + /* ChannelID class */ static PyTypeObject ChannelIDtype; @@ -2323,6 +2336,68 @@ PyDoc_STRVAR(channel_list_all_doc, \n\ Return the list of all IDs for active channels."); +static PyObject * +channel_list_interpreters(PyObject *self, PyObject *args, PyObject *kwds) +{ + static char *kwlist[] = {"cid", "send", NULL}; + int64_t cid; /* Channel ID */ + int send = 0; /* Send or receive end? */ + int64_t id; + PyObject *ids, *id_obj; + PyInterpreterState *interp; + + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "O&$p:channel_list_interpreters", + kwlist, channel_id_converter, &cid, &send)) { + return NULL; + } + + ids = PyList_New(0); + if (ids == NULL) { + goto except; + } + + interp = PyInterpreterState_Head(); + while (interp != NULL) { + id = PyInterpreterState_GetID(interp); + assert(id >= 0); + int res = _channel_is_associated(&_globals.channels, cid, id, send); + if (res < 0) { + goto except; + } + if (res) { + id_obj = _PyInterpreterState_GetIDObject(interp); + if (id_obj == NULL) { + goto except; + } + res = PyList_Insert(ids, 0, id_obj); + Py_DECREF(id_obj); + if (res < 0) { + goto except; + } + } + interp = PyInterpreterState_Next(interp); + } + + goto finally; + +except: + Py_XDECREF(ids); + ids = NULL; + +finally: + return ids; +} + +PyDoc_STRVAR(channel_list_interpreters_doc, +"channel_list_interpreters(cid, *, send) -> [id]\n\ +\n\ +Return the list of all interpreter IDs associated with an end of the channel.\n\ +\n\ +The 'send' argument should be a boolean indicating whether to use the send or\n\ +receive end."); + + static PyObject * channel_send(PyObject *self, PyObject *args, PyObject *kwds) { @@ -2493,6 +2568,8 @@ static PyMethodDef module_functions[] = { METH_VARARGS | METH_KEYWORDS, channel_destroy_doc}, {"channel_list_all", channel_list_all, METH_NOARGS, channel_list_all_doc}, + {"channel_list_interpreters", (PyCFunction)(void(*)(void))channel_list_interpreters, + METH_VARARGS | METH_KEYWORDS, channel_list_interpreters_doc}, {"channel_send", (PyCFunction)(void(*)(void))channel_send, METH_VARARGS | METH_KEYWORDS, channel_send_doc}, {"channel_recv", (PyCFunction)(void(*)(void))channel_recv, From webhook-mailer at python.org Tue Apr 28 20:28:31 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 00:28:31 -0000 Subject: [Python-checkins] bpo-40429: Refactor super_init() (GH-19776) Message-ID: https://github.com/python/cpython/commit/cc0dc7e484c9626857e9a8b4c40eee37473702ed commit: cc0dc7e484c9626857e9a8b4c40eee37473702ed branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T02:28:23+02:00 summary: bpo-40429: Refactor super_init() (GH-19776) Add super_init_without_args() sub-function. Hold a strong reference to the frame code object while calling super_init_without_args(). files: M Objects/typeobject.c diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 8f9ab5c0bae62..7ba51e39616ca 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -8014,6 +8014,83 @@ super_descr_get(PyObject *self, PyObject *obj, PyObject *type) } } +static int +super_init_without_args(PyFrameObject *f, PyCodeObject *co, + PyTypeObject **type_p, PyObject **obj_p) +{ + if (co->co_argcount == 0) { + PyErr_SetString(PyExc_RuntimeError, + "super(): no arguments"); + return -1; + } + + PyObject *obj = f->f_localsplus[0]; + Py_ssize_t i, n; + if (obj == NULL && co->co_cell2arg) { + /* The first argument might be a cell. */ + n = PyTuple_GET_SIZE(co->co_cellvars); + for (i = 0; i < n; i++) { + if (co->co_cell2arg[i] == 0) { + PyObject *cell = f->f_localsplus[co->co_nlocals + i]; + assert(PyCell_Check(cell)); + obj = PyCell_GET(cell); + break; + } + } + } + if (obj == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "super(): arg[0] deleted"); + return -1; + } + + if (co->co_freevars == NULL) { + n = 0; + } + else { + assert(PyTuple_Check(co->co_freevars)); + n = PyTuple_GET_SIZE(co->co_freevars); + } + + PyTypeObject *type = NULL; + for (i = 0; i < n; i++) { + PyObject *name = PyTuple_GET_ITEM(co->co_freevars, i); + assert(PyUnicode_Check(name)); + if (_PyUnicode_EqualToASCIIId(name, &PyId___class__)) { + Py_ssize_t index = co->co_nlocals + + PyTuple_GET_SIZE(co->co_cellvars) + i; + PyObject *cell = f->f_localsplus[index]; + if (cell == NULL || !PyCell_Check(cell)) { + PyErr_SetString(PyExc_RuntimeError, + "super(): bad __class__ cell"); + return -1; + } + type = (PyTypeObject *) PyCell_GET(cell); + if (type == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "super(): empty __class__ cell"); + return -1; + } + if (!PyType_Check(type)) { + PyErr_Format(PyExc_RuntimeError, + "super(): __class__ is not a type (%s)", + Py_TYPE(type)->tp_name); + return -1; + } + break; + } + } + if (type == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "super(): __class__ cell not found"); + return -1; + } + + *type_p = type; + *obj_p = obj; + return 0; +} + static int super_init(PyObject *self, PyObject *args, PyObject *kwds) { @@ -8030,75 +8107,19 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) if (type == NULL) { /* Call super(), without args -- fill in from __class__ and first local variable on the stack. */ - PyFrameObject *f; - Py_ssize_t i, n; - f = PyThreadState_GetFrame(_PyThreadState_GET()); + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *f = PyThreadState_GetFrame(tstate); if (f == NULL) { PyErr_SetString(PyExc_RuntimeError, "super(): no current frame"); return -1; } - PyCodeObject *co = PyFrame_GetCode(f); - Py_DECREF(co); // use a borrowed reference - if (co->co_argcount == 0) { - PyErr_SetString(PyExc_RuntimeError, - "super(): no arguments"); - return -1; - } - obj = f->f_localsplus[0]; - if (obj == NULL && co->co_cell2arg) { - /* The first argument might be a cell. */ - n = PyTuple_GET_SIZE(co->co_cellvars); - for (i = 0; i < n; i++) { - if (co->co_cell2arg[i] == 0) { - PyObject *cell = f->f_localsplus[co->co_nlocals + i]; - assert(PyCell_Check(cell)); - obj = PyCell_GET(cell); - break; - } - } - } - if (obj == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "super(): arg[0] deleted"); - return -1; - } - if (co->co_freevars == NULL) - n = 0; - else { - assert(PyTuple_Check(co->co_freevars)); - n = PyTuple_GET_SIZE(co->co_freevars); - } - for (i = 0; i < n; i++) { - PyObject *name = PyTuple_GET_ITEM(co->co_freevars, i); - assert(PyUnicode_Check(name)); - if (_PyUnicode_EqualToASCIIId(name, &PyId___class__)) { - Py_ssize_t index = co->co_nlocals + - PyTuple_GET_SIZE(co->co_cellvars) + i; - PyObject *cell = f->f_localsplus[index]; - if (cell == NULL || !PyCell_Check(cell)) { - PyErr_SetString(PyExc_RuntimeError, - "super(): bad __class__ cell"); - return -1; - } - type = (PyTypeObject *) PyCell_GET(cell); - if (type == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "super(): empty __class__ cell"); - return -1; - } - if (!PyType_Check(type)) { - PyErr_Format(PyExc_RuntimeError, - "super(): __class__ is not a type (%s)", - Py_TYPE(type)->tp_name); - return -1; - } - break; - } - } - if (type == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "super(): __class__ cell not found"); + + PyCodeObject *code = PyFrame_GetCode(f); + int res = super_init_without_args(f, code, &type, &obj); + Py_DECREF(code); + + if (res < 0) { return -1; } } From webhook-mailer at python.org Tue Apr 28 20:29:25 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 00:29:25 -0000 Subject: [Python-checkins] bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) Message-ID: https://github.com/python/cpython/commit/ae00a5a88534fd45939f86c12e038da9fa6f9ed6 commit: ae00a5a88534fd45939f86c12e038da9fa6f9ed6 branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T02:29:20+02:00 summary: bpo-40428: Remove PyTuple_ClearFreeList() function (GH-19769) Remove the following function from the C API: * PyAsyncGen_ClearFreeLists() * PyContext_ClearFreeList() * PyDict_ClearFreeList() * PyFloat_ClearFreeList() * PyFrame_ClearFreeList() * PyList_ClearFreeList() * PySet_ClearFreeList() * PyTuple_ClearFreeList() Make these functions private, move them to the internal C API and change their return type to void. Call explicitly PyGC_Collect() to free all free lists. Note: PySet_ClearFreeList() did nothing. files: A Misc/NEWS.d/next/C API/2020-04-28-23-17-27.bpo-40428.rmtpru.rst M Doc/whatsnew/3.9.rst M Include/context.h M Include/cpython/dictobject.h M Include/cpython/frameobject.h M Include/cpython/listobject.h M Include/floatobject.h M Include/genobject.h M Include/internal/pycore_gc.h M Include/setobject.h M Include/tupleobject.h M Modules/gcmodule.c M Objects/dictobject.c M Objects/floatobject.c M Objects/frameobject.c M Objects/genobject.c M Objects/listobject.c M Objects/setobject.c M Objects/tupleobject.c M PC/python3.def M Python/context.c diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index cb3afd593571a..e26bd473e6189 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -672,6 +672,19 @@ Build and C API Changes the garbage collector respectively. (Contributed by Pablo Galindo in :issue:`40241`.) +* Remove the following functions from the C API. Call :c:func:`PyGC_Collect` + explicitly to free all free lists. + (Contributed by Victor Stinner in :issue:`40428`.) + + * ``PyAsyncGen_ClearFreeLists()`` + * ``PyContext_ClearFreeList()`` + * ``PyDict_ClearFreeList()`` + * ``PyFloat_ClearFreeList()`` + * ``PyFrame_ClearFreeList()`` + * ``PyList_ClearFreeList()`` + * ``PySet_ClearFreeList()`` + * ``PyTuple_ClearFreeList()`` + Deprecated ========== diff --git a/Include/context.h b/Include/context.h index 619746d501efd..4e5007089dd94 100644 --- a/Include/context.h +++ b/Include/context.h @@ -73,9 +73,6 @@ PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token); PyAPI_FUNC(PyObject *) _PyContext_NewHamtForTests(void); -PyAPI_FUNC(int) PyContext_ClearFreeList(void); - - #endif /* !Py_LIMITED_API */ #ifdef __cplusplus diff --git a/Include/cpython/dictobject.h b/Include/cpython/dictobject.h index 64c012a012b79..e33a0d156fead 100644 --- a/Include/cpython/dictobject.h +++ b/Include/cpython/dictobject.h @@ -62,8 +62,6 @@ PyObject *_PyDict_Pop_KnownHash(PyObject *, PyObject *, Py_hash_t, PyObject *); PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *); #define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL) -PyAPI_FUNC(int) PyDict_ClearFreeList(void); - /* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0, the first occurrence of a key wins, if override is 1, the last occurrence of a key wins, if override is 2, a KeyError with conflicting key as diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h index e819cefd13cbe..e32efac594718 100644 --- a/Include/cpython/frameobject.h +++ b/Include/cpython/frameobject.h @@ -75,8 +75,6 @@ PyAPI_FUNC(void) PyFrame_LocalsToFast(PyFrameObject *, int); PyAPI_FUNC(int) PyFrame_FastToLocalsWithError(PyFrameObject *f); PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); -PyAPI_FUNC(int) PyFrame_ClearFreeList(void); - PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out); #ifdef __cplusplus diff --git a/Include/cpython/listobject.h b/Include/cpython/listobject.h index 4b6f2f7741c1a..74fe3301a7ab7 100644 --- a/Include/cpython/listobject.h +++ b/Include/cpython/listobject.h @@ -26,7 +26,6 @@ typedef struct { } PyListObject; PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *); -PyAPI_FUNC(int) PyList_ClearFreeList(void); PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out); /* Macro, trading safety for speed */ diff --git a/Include/floatobject.h b/Include/floatobject.h index 917dfcc26445c..e994aa8f29da4 100644 --- a/Include/floatobject.h +++ b/Include/floatobject.h @@ -100,9 +100,6 @@ PyAPI_FUNC(double) _PyFloat_Unpack2(const unsigned char *p, int le); PyAPI_FUNC(double) _PyFloat_Unpack4(const unsigned char *p, int le); PyAPI_FUNC(double) _PyFloat_Unpack8(const unsigned char *p, int le); -/* free list api */ -PyAPI_FUNC(int) PyFloat_ClearFreeList(void); - PyAPI_FUNC(void) _PyFloat_DebugMallocStats(FILE* out); /* Format the object based on the format_spec, as defined in PEP 3101 diff --git a/Include/genobject.h b/Include/genobject.h index a7393a9a83592..8ffd15646f084 100644 --- a/Include/genobject.h +++ b/Include/genobject.h @@ -91,8 +91,6 @@ PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *, PyObject *_PyAsyncGenValueWrapperNew(PyObject *); -int PyAsyncGen_ClearFreeLists(void); - #endif #undef _PyGenObject_HEAD diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h index 62b8800e24998..0511eea779a7e 100644 --- a/Include/internal/pycore_gc.h +++ b/Include/internal/pycore_gc.h @@ -163,6 +163,16 @@ struct _gc_runtime_state { PyAPI_FUNC(void) _PyGC_InitState(struct _gc_runtime_state *); + +// Functions to clear types free lists +extern void _PyFrame_ClearFreeList(void); +extern void _PyTuple_ClearFreeList(void); +extern void _PyFloat_ClearFreeList(void); +extern void _PyList_ClearFreeList(void); +extern void _PyDict_ClearFreeList(void); +extern void _PyAsyncGen_ClearFreeLists(void); +extern void _PyContext_ClearFreeList(void); + #ifdef __cplusplus } #endif diff --git a/Include/setobject.h b/Include/setobject.h index 05a097eba7f7d..119619ebe7299 100644 --- a/Include/setobject.h +++ b/Include/setobject.h @@ -70,7 +70,6 @@ PyAPI_DATA(PyObject *) _PySet_Dummy; PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash); PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable); -PyAPI_FUNC(int) PySet_ClearFreeList(void); #endif /* Section excluded by Py_LIMITED_API */ diff --git a/Include/tupleobject.h b/Include/tupleobject.h index d3504b0501f9e..e796a320192c2 100644 --- a/Include/tupleobject.h +++ b/Include/tupleobject.h @@ -34,8 +34,6 @@ PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *); PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t); PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...); -PyAPI_FUNC(int) PyTuple_ClearFreeList(void); - #ifndef Py_LIMITED_API # define Py_CPYTHON_TUPLEOBJECT_H # include "cpython/tupleobject.h" diff --git a/Misc/NEWS.d/next/C API/2020-04-28-23-17-27.bpo-40428.rmtpru.rst b/Misc/NEWS.d/next/C API/2020-04-28-23-17-27.bpo-40428.rmtpru.rst new file mode 100644 index 0000000000000..f8710efb6c329 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-28-23-17-27.bpo-40428.rmtpru.rst @@ -0,0 +1,11 @@ +Remove the following functions from the C API. Call :c:func:`PyGC_Collect` +explicitly to free all free lists. + +* ``PyAsyncGen_ClearFreeLists()`` +* ``PyContext_ClearFreeList()`` +* ``PyDict_ClearFreeList()`` +* ``PyFloat_ClearFreeList()`` +* ``PyFrame_ClearFreeList()`` +* ``PyList_ClearFreeList()`` +* ``PySet_ClearFreeList()`` +* ``PyTuple_ClearFreeList()`` diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 5727820f09bbb..56dcb101e0005 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -30,7 +30,6 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "frameobject.h" // PyFrame_ClearFreeList #include "pydtrace.h" #include "pytime.h" // _PyTime_GetMonotonicClock() @@ -1026,14 +1025,13 @@ delete_garbage(PyThreadState *tstate, GCState *gcstate, static void clear_freelists(void) { - (void)PyFrame_ClearFreeList(); - (void)PyTuple_ClearFreeList(); - (void)PyFloat_ClearFreeList(); - (void)PyList_ClearFreeList(); - (void)PyDict_ClearFreeList(); - (void)PySet_ClearFreeList(); - (void)PyAsyncGen_ClearFreeLists(); - (void)PyContext_ClearFreeList(); + _PyFrame_ClearFreeList(); + _PyTuple_ClearFreeList(); + _PyFloat_ClearFreeList(); + _PyList_ClearFreeList(); + _PyDict_ClearFreeList(); + _PyAsyncGen_ClearFreeLists(); + _PyContext_ClearFreeList(); } // Show stats for objects in each generations diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 8f9d4e7b73140..9c35f3c3f14d0 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -257,20 +257,17 @@ static int numfreekeys = 0; #include "clinic/dictobject.c.h" -int -PyDict_ClearFreeList(void) +void +_PyDict_ClearFreeList(void) { - PyDictObject *op; - int ret = numfree + numfreekeys; while (numfree) { - op = free_list[--numfree]; + PyDictObject *op = free_list[--numfree]; assert(PyDict_CheckExact(op)); PyObject_GC_Del(op); } while (numfreekeys) { PyObject_FREE(keys_free_list[--numfreekeys]); } - return ret; } /* Print summary info about the state of the optimized allocator */ @@ -285,7 +282,7 @@ _PyDict_DebugMallocStats(FILE *out) void _PyDict_Fini(void) { - PyDict_ClearFreeList(); + _PyDict_ClearFreeList(); } #define DK_SIZE(dk) ((dk)->dk_size) diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 04f968e56b142..faa02f2f05795 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -1998,25 +1998,22 @@ _PyFloat_Init(void) return 1; } -int -PyFloat_ClearFreeList(void) +void +_PyFloat_ClearFreeList(void) { PyFloatObject *f = free_list, *next; - int i = numfree; - while (f) { + for (; f; f = next) { next = (PyFloatObject*) Py_TYPE(f); PyObject_FREE(f); - f = next; } free_list = NULL; numfree = 0; - return i; } void _PyFloat_Fini(void) { - (void)PyFloat_ClearFreeList(); + _PyFloat_ClearFreeList(); } /* Print summary info about the state of the optimized allocator */ diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 533186bc046f0..6d288b5b059d7 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1200,11 +1200,9 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear) } /* Clear out the free list */ -int -PyFrame_ClearFreeList(void) +void +_PyFrame_ClearFreeList(void) { - int freelist_size = numfree; - while (free_list != NULL) { PyFrameObject *f = free_list; free_list = free_list->f_back; @@ -1212,13 +1210,12 @@ PyFrame_ClearFreeList(void) --numfree; } assert(numfree == 0); - return freelist_size; } void _PyFrame_Fini(void) { - (void)PyFrame_ClearFreeList(); + _PyFrame_ClearFreeList(); } /* Print summary info about the state of the optimized allocator */ diff --git a/Objects/genobject.c b/Objects/genobject.c index 071def8a25aae..6e36690b65148 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1429,11 +1429,9 @@ PyAsyncGen_New(PyFrameObject *f, PyObject *name, PyObject *qualname) } -int -PyAsyncGen_ClearFreeLists(void) +void +_PyAsyncGen_ClearFreeLists(void) { - int ret = ag_value_freelist_free + ag_asend_freelist_free; - while (ag_value_freelist_free) { _PyAsyncGenWrappedValue *o; o = ag_value_freelist[--ag_value_freelist_free]; @@ -1447,14 +1445,12 @@ PyAsyncGen_ClearFreeLists(void) assert(Py_IS_TYPE(o, &_PyAsyncGenASend_Type)); PyObject_GC_Del(o); } - - return ret; } void _PyAsyncGen_Fini(void) { - PyAsyncGen_ClearFreeLists(); + _PyAsyncGen_ClearFreeLists(); } diff --git a/Objects/listobject.c b/Objects/listobject.c index 7d2f006617ba5..904bea317c9da 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -103,23 +103,20 @@ list_preallocate_exact(PyListObject *self, Py_ssize_t size) static PyListObject *free_list[PyList_MAXFREELIST]; static int numfree = 0; -int -PyList_ClearFreeList(void) +void +_PyList_ClearFreeList(void) { - PyListObject *op; - int ret = numfree; while (numfree) { - op = free_list[--numfree]; + PyListObject *op = free_list[--numfree]; assert(PyList_CheckExact(op)); PyObject_GC_Del(op); } - return ret; } void _PyList_Fini(void) { - PyList_ClearFreeList(); + _PyList_ClearFreeList(); } /* Print summary info about the state of the optimized allocator */ diff --git a/Objects/setobject.c b/Objects/setobject.c index 8452546008bd1..bbe013bcfac74 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -2384,12 +2384,6 @@ PySet_Add(PyObject *anyset, PyObject *key) return set_add_key((PySetObject *)anyset, key); } -int -PySet_ClearFreeList(void) -{ - return 0; -} - void _PySet_Fini(void) { diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index b65b8abc2806d..f8648d24f1c87 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -955,26 +955,22 @@ _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize) return 0; } -int -PyTuple_ClearFreeList(void) +void +_PyTuple_ClearFreeList(void) { - int freelist_size = 0; #if PyTuple_MAXSAVESIZE > 0 - int i; - for (i = 1; i < PyTuple_MAXSAVESIZE; i++) { - PyTupleObject *p, *q; - p = free_list[i]; - freelist_size += numfree[i]; + for (Py_ssize_t i = 1; i < PyTuple_MAXSAVESIZE; i++) { + PyTupleObject *p = free_list[i]; free_list[i] = NULL; numfree[i] = 0; while (p) { - q = p; + PyTupleObject *q = p; p = (PyTupleObject *)(p->ob_item[0]); PyObject_GC_Del(q); } } + // the empty tuple singleton is only cleared by _PyTuple_Fini() #endif - return freelist_size; } void @@ -985,7 +981,7 @@ _PyTuple_Fini(void) * rely on the fact that an empty tuple is a singleton. */ Py_CLEAR(free_list[0]); - (void)PyTuple_ClearFreeList(); + _PyTuple_ClearFreeList(); #endif } diff --git a/PC/python3.def b/PC/python3.def index 083384e30f648..1521ac738c0b3 100644 --- a/PC/python3.def +++ b/PC/python3.def @@ -35,7 +35,6 @@ EXPORTS PyBytes_Size=python39.PyBytes_Size PyBytes_Type=python39.PyBytes_Type DATA PyCFunction_Call=python39.PyCFunction_Call - PyCFunction_ClearFreeList=python39.PyCFunction_ClearFreeList PyCFunction_GetFlags=python39.PyCFunction_GetFlags PyCFunction_GetFunction=python39.PyCFunction_GetFunction PyCFunction_GetSelf=python39.PyCFunction_GetSelf @@ -584,7 +583,6 @@ EXPORTS PyTraceBack_Print=python39.PyTraceBack_Print PyTraceBack_Type=python39.PyTraceBack_Type DATA PyTupleIter_Type=python39.PyTupleIter_Type DATA - PyTuple_ClearFreeList=python39.PyTuple_ClearFreeList PyTuple_GetItem=python39.PyTuple_GetItem PyTuple_GetSlice=python39.PyTuple_GetSlice PyTuple_New=python39.PyTuple_New diff --git a/Python/context.c b/Python/context.c index f0217f280180a..bacc7010c458e 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1270,18 +1270,15 @@ get_token_missing(void) /////////////////////////// -int -PyContext_ClearFreeList(void) +void +_PyContext_ClearFreeList(void) { - int size = ctx_freelist_len; - while (ctx_freelist_len) { + for (; ctx_freelist_len; ctx_freelist_len--) { PyContext *ctx = ctx_freelist; ctx_freelist = (PyContext *)ctx->ctx_weakreflist; ctx->ctx_weakreflist = NULL; PyObject_GC_Del(ctx); - ctx_freelist_len--; } - return size; } @@ -1289,8 +1286,8 @@ void _PyContext_Fini(void) { Py_CLEAR(_token_missing); - (void)PyContext_ClearFreeList(); - (void)_PyHamt_Fini(); + _PyContext_ClearFreeList(); + _PyHamt_Fini(); } From webhook-mailer at python.org Tue Apr 28 20:43:55 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Wed, 29 Apr 2020 00:43:55 -0000 Subject: [Python-checkins] bpo-40334: Fix shifting of nested f-strings in the new parser (GH-19771) Message-ID: https://github.com/python/cpython/commit/37af21b667a9f41437b5b8e451497d7725016df5 commit: 37af21b667a9f41437b5b8e451497d7725016df5 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-29T01:43:50+01:00 summary: bpo-40334: Fix shifting of nested f-strings in the new parser (GH-19771) `JoinedStr`s and `FormattedValue also needs to be shifted, in order to correctly compute the location information of nested f-strings. files: M Lib/test/test_fstring.py M Parser/pegen/parse_string.c diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 8cafbe863c288..4c240f34a3543 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -207,8 +207,7 @@ def test_ast_line_numbers_nested(self): call = binop.right.values[1].value self.assertEqual(type(call), ast.Call) self.assertEqual(call.lineno, 3) - if support.use_old_parser(): - self.assertEqual(call.col_offset, 11) + self.assertEqual(call.col_offset, 11) def test_ast_line_numbers_duplicate_expression(self): """Duplicate expression diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c index 9a78a28d24196..834239e23fa87 100644 --- a/Parser/pegen/parse_string.c +++ b/Parser/pegen/parse_string.c @@ -449,6 +449,15 @@ static void fstring_shift_children_locations(expr_ty n, int lineno, int col_offs case Tuple_kind: fstring_shift_seq_locations(n, n->v.Tuple.elts, lineno, col_offset); break; + case JoinedStr_kind: + fstring_shift_seq_locations(n, n->v.JoinedStr.values, lineno, col_offset); + break; + case FormattedValue_kind: + shift_expr(n, n->v.FormattedValue.value, lineno, col_offset); + if (n->v.FormattedValue.format_spec) { + shift_expr(n, n->v.FormattedValue.format_spec, lineno, col_offset); + } + break; default: return; } From webhook-mailer at python.org Tue Apr 28 21:01:50 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 01:01:50 -0000 Subject: [Python-checkins] bpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781) Message-ID: https://github.com/python/cpython/commit/4386b9045e5fe1151e65c2816264b5710000eb9f commit: 4386b9045e5fe1151e65c2816264b5710000eb9f branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T03:01:43+02:00 summary: bpo-40429: PyThreadState_GetFrame() returns a strong ref (GH-19781) The PyThreadState_GetFrame() function now returns a strong reference to the frame. files: A Misc/NEWS.d/next/C API/2020-04-29-01-39-41.bpo-40429.VQfvta.rst M Doc/c-api/init.rst M Modules/_tracemalloc.c M Modules/_xxsubinterpretersmodule.c M Objects/typeobject.c M Python/errors.c M Python/pystate.c diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index afde3db30385b..68fed2acc447e 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -1074,10 +1074,10 @@ All of the following functions must be called after :c:func:`Py_Initialize`. .. c:function:: PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate) - Get a borrowed reference to the current frame of the Python thread state - *tstate*. + Get the current frame of the Python thread state *tstate*. - Return ``NULL`` if no frame is currently executing. + Return a strong reference. Return ``NULL`` if no frame is currently + executing. See also :c:func:`PyEval_GetFrame`. diff --git a/Misc/NEWS.d/next/C API/2020-04-29-01-39-41.bpo-40429.VQfvta.rst b/Misc/NEWS.d/next/C API/2020-04-29-01-39-41.bpo-40429.VQfvta.rst new file mode 100644 index 0000000000000..e02aaf9003225 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-29-01-39-41.bpo-40429.VQfvta.rst @@ -0,0 +1,2 @@ +The :c:func:`PyThreadState_GetFrame` function now returns a strong reference +to the frame. diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 24628a907f28a..6f28f7f5757fa 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -425,10 +425,7 @@ traceback_hash(traceback_t *traceback) static void traceback_get_frames(traceback_t *traceback) { - PyThreadState *tstate; - PyFrameObject *pyframe; - - tstate = PyGILState_GetThisThreadState(); + PyThreadState *tstate = PyGILState_GetThisThreadState(); if (tstate == NULL) { #ifdef TRACE_DEBUG tracemalloc_error("failed to get the current thread state"); @@ -436,7 +433,8 @@ traceback_get_frames(traceback_t *traceback) return; } - pyframe = PyThreadState_GetFrame(tstate); + PyFrameObject *pyframe = PyThreadState_GetFrame(tstate); + Py_XDECREF(pyframe); // use a borrowed reference for (; pyframe != NULL; pyframe = pyframe->f_back) { if (traceback->nframe < _Py_tracemalloc_config.max_nframe) { tracemalloc_get_frame(pyframe, &traceback->frames[traceback->nframe]); diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c index e618930e09d12..15e80559ec6f6 100644 --- a/Modules/_xxsubinterpretersmodule.c +++ b/Modules/_xxsubinterpretersmodule.c @@ -1840,14 +1840,17 @@ _is_running(PyInterpreterState *interp) "interpreter has more than one thread"); return -1; } + + assert(!PyErr_Occurred()); PyFrameObject *frame = PyThreadState_GetFrame(tstate); if (frame == NULL) { - if (PyErr_Occurred() != NULL) { - return -1; - } return 0; } - return (int)(frame->f_executing); + + int executing = (int)(frame->f_executing); + Py_DECREF(frame); + + return executing; } static int diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 7ba51e39616ca..c2ddc162ac82c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -8108,15 +8108,16 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds) /* Call super(), without args -- fill in from __class__ and first local variable on the stack. */ PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *f = PyThreadState_GetFrame(tstate); - if (f == NULL) { + PyFrameObject *frame = PyThreadState_GetFrame(tstate); + if (frame == NULL) { PyErr_SetString(PyExc_RuntimeError, "super(): no current frame"); return -1; } - PyCodeObject *code = PyFrame_GetCode(f); - int res = super_init_without_args(f, code, &type, &obj); + PyCodeObject *code = PyFrame_GetCode(frame); + int res = super_init_without_args(frame, code, &type, &obj); + Py_DECREF(frame); Py_DECREF(code); if (res < 0) { diff --git a/Python/errors.c b/Python/errors.c index db007709d263e..9e53d050416ff 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -1372,7 +1372,7 @@ _PyErr_WriteUnraisableMsg(const char *err_msg_str, PyObject *obj) } if (exc_tb == NULL) { - struct _frame *frame = tstate->frame; + PyFrameObject *frame = tstate->frame; if (frame != NULL) { exc_tb = _PyTraceBack_FromFrame(NULL, frame); if (exc_tb == NULL) { diff --git a/Python/pystate.c b/Python/pystate.c index d6f58822b64ae..dd95750027241 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1042,11 +1042,13 @@ PyThreadState_GetInterpreter(PyThreadState *tstate) } -struct _frame* +PyFrameObject* PyThreadState_GetFrame(PyThreadState *tstate) { assert(tstate != NULL); - return tstate->frame; + PyFrameObject *frame = tstate->frame; + Py_XINCREF(frame); + return frame; } @@ -1165,7 +1167,7 @@ _PyThread_CurrentFrames(void) for (i = runtime->interpreters.head; i != NULL; i = i->next) { PyThreadState *t; for (t = i->tstate_head; t != NULL; t = t->next) { - struct _frame *frame = t->frame; + PyFrameObject *frame = t->frame; if (frame == NULL) { continue; } From webhook-mailer at python.org Tue Apr 28 21:04:10 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 29 Apr 2020 01:04:10 -0000 Subject: [Python-checkins] bpo-40334: Explicitly cast to int in pegen.c to fix a compiler warning (GH-19779) Message-ID: https://github.com/python/cpython/commit/2208134918ee673451e4fc525bbeab71142d794a commit: 2208134918ee673451e4fc525bbeab71142d794a branch: master author: Pablo Galindo committer: GitHub date: 2020-04-29T02:04:06+01:00 summary: bpo-40334: Explicitly cast to int in pegen.c to fix a compiler warning (GH-19779) files: M Parser/pegen/pegen.c diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 6f78d8c86520e..ef95aacb7f084 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -597,13 +597,13 @@ _PyPegen_fill_token(Parser *p) int lineno = type == STRING ? p->tok->first_lineno : p->tok->lineno; const char *line_start = type == STRING ? p->tok->multi_line_start : p->tok->line_start; - size_t end_lineno = p->tok->lineno; - size_t col_offset = -1, end_col_offset = -1; + int end_lineno = p->tok->lineno; + int col_offset = -1, end_col_offset = -1; if (start != NULL && start >= line_start) { - col_offset = start - line_start; + col_offset = (int)(start - line_start); } if (end != NULL && end >= p->tok->line_start) { - end_col_offset = end - p->tok->line_start; + end_col_offset = (int)(end - p->tok->line_start); } t->lineno = p->starting_lineno + lineno; From webhook-mailer at python.org Tue Apr 28 21:11:37 2020 From: webhook-mailer at python.org (Hai Shi) Date: Wed, 29 Apr 2020 01:11:37 -0000 Subject: [Python-checkins] bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716) Message-ID: https://github.com/python/cpython/commit/66abe98a816de84f89e2de4aa78cf09056227c25 commit: 66abe98a816de84f89e2de4aa78cf09056227c25 branch: master author: Hai Shi committer: GitHub date: 2020-04-29T03:11:29+02:00 summary: bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716) Add a new test.support.hashlib_helper submodule. files: A Lib/test/support/hashlib_helper.py M Lib/test/support/__init__.py M Lib/test/test_hashlib.py M Lib/test/test_hmac.py M Lib/test/test_imaplib.py M Lib/test/test_poplib.py M Lib/test/test_smtplib.py M Lib/test/test_tarfile.py M Lib/test/test_urllib2_localnet.py diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index f48decc704cb8..ee5882f237cfc 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -11,7 +11,6 @@ import functools import gc import glob -import hashlib import importlib import importlib.util import locale @@ -59,11 +58,6 @@ except ImportError: resource = None -try: - import _hashlib -except ImportError: - _hashlib = None - __all__ = [ # globals "PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast", @@ -81,7 +75,7 @@ "create_empty_file", "can_symlink", "fs_is_case_insensitive", # unittest "is_resource_enabled", "requires", "requires_freebsd_version", - "requires_linux_version", "requires_mac_ver", "requires_hashdigest", + "requires_linux_version", "requires_mac_ver", "check_syntax_error", "check_syntax_warning", "TransientResource", "time_out", "socket_peer_reset", "ioerror_peer_reset", "transient_internet", "BasicTestRunner", "run_unittest", "run_doctest", @@ -685,36 +679,6 @@ def wrapper(*args, **kw): return decorator -def requires_hashdigest(digestname, openssl=None, usedforsecurity=True): - """Decorator raising SkipTest if a hashing algorithm is not available - - The hashing algorithm could be missing or blocked by a strict crypto - policy. - - If 'openssl' is True, then the decorator checks that OpenSSL provides - the algorithm. Otherwise the check falls back to built-in - implementations. The usedforsecurity flag is passed to the constructor. - - ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS - ValueError: unsupported hash type md4 - """ - def decorator(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - try: - if openssl and _hashlib is not None: - _hashlib.new(digestname, usedforsecurity=usedforsecurity) - else: - hashlib.new(digestname, usedforsecurity=usedforsecurity) - except ValueError: - raise unittest.SkipTest( - f"hash digest '{digestname}' is not available." - ) - return func(*args, **kwargs) - return wrapper - return decorator - - def system_must_validate_cert(f): """Skip the test on TLS certificate validation failures.""" @functools.wraps(f) diff --git a/Lib/test/support/hashlib_helper.py b/Lib/test/support/hashlib_helper.py new file mode 100644 index 0000000000000..a28132a565a0b --- /dev/null +++ b/Lib/test/support/hashlib_helper.py @@ -0,0 +1,38 @@ +import functools +import hashlib +import unittest + +try: + import _hashlib +except ImportError: + _hashlib = None + + +def requires_hashdigest(digestname, openssl=None, usedforsecurity=True): + """Decorator raising SkipTest if a hashing algorithm is not available + + The hashing algorithm could be missing or blocked by a strict crypto + policy. + + If 'openssl' is True, then the decorator checks that OpenSSL provides + the algorithm. Otherwise the check falls back to built-in + implementations. The usedforsecurity flag is passed to the constructor. + + ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS + ValueError: unsupported hash type md4 + """ + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + if openssl and _hashlib is not None: + _hashlib.new(digestname, usedforsecurity=usedforsecurity) + else: + hashlib.new(digestname, usedforsecurity=usedforsecurity) + except ValueError: + raise unittest.SkipTest( + f"hash digest '{digestname}' is not available." + ) + return func(*args, **kwargs) + return wrapper + return decorator diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 0e30b2fb11f29..33b687e0b4086 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -19,7 +19,6 @@ import warnings from test import support from test.support import _4G, bigmemtest, import_fresh_module -from test.support import requires_hashdigest from http.client import HTTPException # Were we compiled --with-pydebug or with #define Py_DEBUG? diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index 23c108f6e3c27..08086f0e78c83 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -6,7 +6,7 @@ import unittest.mock import warnings -from test.support import requires_hashdigest +from test.support import hashlib_helper def ignore_warning(func): @@ -21,7 +21,7 @@ def wrapper(*args, **kwargs): class TestVectorsTestCase(unittest.TestCase): - @requires_hashdigest('md5', openssl=True) + @hashlib_helper.requires_hashdigest('md5', openssl=True) def test_md5_vectors(self): # Test the HMAC module against test vectors from the RFC. @@ -79,7 +79,7 @@ def md5test(key, data, digest): b"and Larger Than One Block-Size Data"), "6f630fad67cda0ee1fb1f562db3aa53e") - @requires_hashdigest('sha1', openssl=True) + @hashlib_helper.requires_hashdigest('sha1', openssl=True) def test_sha_vectors(self): def shatest(key, data, digest): h = hmac.HMAC(key, data, digestmod=hashlib.sha1) @@ -272,23 +272,23 @@ def hmactest(key, data, hexdigests): '134676fb6de0446065c97440fa8c6a58', }) - @requires_hashdigest('sha224', openssl=True) + @hashlib_helper.requires_hashdigest('sha224', openssl=True) def test_sha224_rfc4231(self): self._rfc4231_test_cases(hashlib.sha224, 'sha224', 28, 64) - @requires_hashdigest('sha256', openssl=True) + @hashlib_helper.requires_hashdigest('sha256', openssl=True) def test_sha256_rfc4231(self): self._rfc4231_test_cases(hashlib.sha256, 'sha256', 32, 64) - @requires_hashdigest('sha384', openssl=True) + @hashlib_helper.requires_hashdigest('sha384', openssl=True) def test_sha384_rfc4231(self): self._rfc4231_test_cases(hashlib.sha384, 'sha384', 48, 128) - @requires_hashdigest('sha512', openssl=True) + @hashlib_helper.requires_hashdigest('sha512', openssl=True) def test_sha512_rfc4231(self): self._rfc4231_test_cases(hashlib.sha512, 'sha512', 64, 128) - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_legacy_block_size_warnings(self): class MockCrazyHash(object): """Ain't no block_size attribute here.""" @@ -329,7 +329,7 @@ class ConstructorTestCase(unittest.TestCase): "6c845b47f52b3b47f6590c502db7825aad757bf4fadc8fa972f7cd2e76a5bdeb" ) - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_normal(self): # Standard constructor call. try: @@ -337,21 +337,21 @@ def test_normal(self): except Exception: self.fail("Standard constructor call raised exception.") - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_with_str_key(self): # Pass a key of type str, which is an error, because it expects a key # of type bytes with self.assertRaises(TypeError): h = hmac.HMAC("key", digestmod='sha256') - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_dot_new_with_str_key(self): # Pass a key of type str, which is an error, because it expects a key # of type bytes with self.assertRaises(TypeError): h = hmac.new("key", digestmod='sha256') - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_withtext(self): # Constructor call with text. try: @@ -360,7 +360,7 @@ def test_withtext(self): self.fail("Constructor call with text argument raised exception.") self.assertEqual(h.hexdigest(), self.expected) - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_with_bytearray(self): try: h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!"), @@ -369,7 +369,7 @@ def test_with_bytearray(self): self.fail("Constructor call with bytearray arguments raised exception.") self.assertEqual(h.hexdigest(), self.expected) - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_with_memoryview_msg(self): try: h = hmac.HMAC(b"key", memoryview(b"hash this!"), digestmod="sha256") @@ -377,7 +377,7 @@ def test_with_memoryview_msg(self): self.fail("Constructor call with memoryview msg raised exception.") self.assertEqual(h.hexdigest(), self.expected) - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_withmodule(self): # Constructor call with text and digest module. try: @@ -388,7 +388,7 @@ def test_withmodule(self): class SanityTestCase(unittest.TestCase): - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_exercise_all_methods(self): # Exercising all methods once. # This must not raise any exceptions @@ -404,7 +404,7 @@ def test_exercise_all_methods(self): class CopyTestCase(unittest.TestCase): - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_attributes(self): # Testing if attributes are of same type. h1 = hmac.HMAC(b"key", digestmod="sha256") @@ -416,7 +416,7 @@ def test_attributes(self): self.assertEqual(type(h1.outer), type(h2.outer), "Types of outer don't match.") - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_realcopy(self): # Testing if the copy method created a real copy. h1 = hmac.HMAC(b"key", digestmod="sha256") @@ -428,7 +428,7 @@ def test_realcopy(self): self.assertTrue(id(h1.outer) != id(h2.outer), "No real copy of the attribute 'outer'.") - @requires_hashdigest('sha256') + @hashlib_helper.requires_hashdigest('sha256') def test_equality(self): # Testing if the copy has the same digests. h1 = hmac.HMAC(b"key", digestmod="sha256") diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 69ee63b18c373..ce601565cf1a6 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -11,8 +11,8 @@ import socket from test.support import (reap_threads, verbose, transient_internet, - run_with_tz, run_with_locale, cpython_only, - requires_hashdigest) + run_with_tz, run_with_locale, cpython_only) +from test.support import hashlib_helper import unittest from unittest import mock from datetime import datetime, timezone, timedelta @@ -385,7 +385,7 @@ def cmd_AUTHENTICATE(self, tag, args): self.assertEqual(code, 'OK') self.assertEqual(server.response, b'ZmFrZQ==\r\n') # b64 encoded 'fake' - @requires_hashdigest('md5') + @hashlib_helper.requires_hashdigest('md5') def test_login_cram_md5_bytes(self): class AuthHandler(SimpleIMAPHandler): capabilities = 'LOGINDISABLED AUTH=CRAM-MD5' @@ -403,7 +403,7 @@ def cmd_AUTHENTICATE(self, tag, args): ret, _ = client.login_cram_md5("tim", b"tanstaaftanstaaf") self.assertEqual(ret, "OK") - @requires_hashdigest('md5') + @hashlib_helper.requires_hashdigest('md5') def test_login_cram_md5_plain_text(self): class AuthHandler(SimpleIMAPHandler): capabilities = 'LOGINDISABLED AUTH=CRAM-MD5' @@ -849,7 +849,7 @@ def cmd_AUTHENTICATE(self, tag, args): b'ZmFrZQ==\r\n') # b64 encoded 'fake' @reap_threads - @requires_hashdigest('md5') + @hashlib_helper.requires_hashdigest('md5') def test_login_cram_md5(self): class AuthHandler(SimpleIMAPHandler): diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py index d4877b1fbbc6b..b670afcf4e62e 100644 --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -13,6 +13,7 @@ from unittest import TestCase, skipUnless from test import support as test_support +from test.support import hashlib_helper from test.support import socket_helper HOST = socket_helper.HOST @@ -311,11 +312,11 @@ def test_noop(self): def test_rpop(self): self.assertOK(self.client.rpop('foo')) - @test_support.requires_hashdigest('md5') + @hashlib_helper.requires_hashdigest('md5') def test_apop_normal(self): self.assertOK(self.client.apop('foo', 'dummypassword')) - @test_support.requires_hashdigest('md5') + @hashlib_helper.requires_hashdigest('md5') def test_apop_REDOS(self): # Replace welcome with very long evil welcome. # NB The upper bound on welcome length is currently 2048. diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index d1ffb368a4f6f..c1bd2e291255b 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -20,9 +20,9 @@ import unittest from test import support, mock_socket +from test.support import hashlib_helper from test.support import socket_helper from test.support import threading_setup, threading_cleanup, join_thread -from test.support import requires_hashdigest from unittest.mock import Mock HOST = socket_helper.HOST @@ -1058,7 +1058,7 @@ def testAUTH_LOGIN(self): self.assertEqual(resp, (235, b'Authentication Succeeded')) smtp.close() - @requires_hashdigest('md5') + @hashlib_helper.requires_hashdigest('md5') def testAUTH_CRAM_MD5(self): self.serv.add_feature("AUTH CRAM-MD5") smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index 99196f6043191..25e9e93604476 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -11,7 +11,7 @@ import tarfile from test import support -from test.support import script_helper, requires_hashdigest +from test.support import script_helper # Check for our compression modules. try: diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index 8cfb214c9af9a..421b9f7de2e21 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -9,6 +9,7 @@ import hashlib from test import support +from test.support import hashlib_helper try: import ssl @@ -322,7 +323,7 @@ class ProxyAuthTests(unittest.TestCase): PASSWD = "test123" REALM = "TestRealm" - @support.requires_hashdigest("md5") + @hashlib_helper.requires_hashdigest("md5") def setUp(self): super(ProxyAuthTests, self).setUp() # Ignore proxy bypass settings in the environment. From webhook-mailer at python.org Tue Apr 28 21:28:51 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 01:28:51 -0000 Subject: [Python-checkins] bpo-40421: Add PyFrame_GetBack() function (GH-19765) Message-ID: https://github.com/python/cpython/commit/703647732359200c54f1d2e695cc3a06b9a96c9a commit: 703647732359200c54f1d2e695cc3a06b9a96c9a branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T03:28:46+02:00 summary: bpo-40421: Add PyFrame_GetBack() function (GH-19765) New PyFrame_GetBack() function: get the frame next outer frame. Replace frame->f_back with PyFrame_GetBack(frame) in most code but frameobject.c, ceval.c and genobject.c. files: A Misc/NEWS.d/next/C API/2020-04-28-19-29-36.bpo-40421.3uIIaB.rst M Doc/c-api/reflection.rst M Doc/whatsnew/3.9.rst M Include/cpython/frameobject.h M Modules/_tracemalloc.c M Objects/frameobject.c M Python/_warnings.c M Python/sysmodule.c M Python/traceback.c diff --git a/Doc/c-api/reflection.rst b/Doc/c-api/reflection.rst index 21d9878609127..9207d86012c8b 100644 --- a/Doc/c-api/reflection.rst +++ b/Doc/c-api/reflection.rst @@ -31,6 +31,17 @@ Reflection See also :c:func:`PyThreadState_GetFrame`. +.. c:function:: int PyFrame_GetBack(PyFrameObject *frame) + + Get the *frame* next outer frame. + + Return a strong reference, or ``NULL`` if *frame* has no outer frame. + + *frame* must not be ``NULL``. + + .. versionadded:: 3.9 + + .. c:function:: int PyFrame_GetCode(PyFrameObject *frame) Get the *frame* code. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index e26bd473e6189..0edb11419c43c 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -538,6 +538,7 @@ Build and C API Changes ======================= * New :c:func:`PyFrame_GetCode` function: get a frame code. + New :c:func:`PyFrame_GetBack` function: get the frame next outer frame. (Contributed by Victor Stinner in :issue:`40421`.) * Add :c:func:`PyFrame_GetLineNumber` to the limited C API. diff --git a/Include/cpython/frameobject.h b/Include/cpython/frameobject.h index e32efac594718..36a51baae8784 100644 --- a/Include/cpython/frameobject.h +++ b/Include/cpython/frameobject.h @@ -77,6 +77,8 @@ PyAPI_FUNC(void) PyFrame_FastToLocals(PyFrameObject *); PyAPI_FUNC(void) _PyFrame_DebugMallocStats(FILE *out); +PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame); + #ifdef __cplusplus } #endif diff --git a/Misc/NEWS.d/next/C API/2020-04-28-19-29-36.bpo-40421.3uIIaB.rst b/Misc/NEWS.d/next/C API/2020-04-28-19-29-36.bpo-40421.3uIIaB.rst new file mode 100644 index 0000000000000..aadfb339b1711 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2020-04-28-19-29-36.bpo-40421.3uIIaB.rst @@ -0,0 +1 @@ +New :c:func:`PyFrame_GetBack` function: get the frame next outer frame. diff --git a/Modules/_tracemalloc.c b/Modules/_tracemalloc.c index 6f28f7f5757fa..ea7e0127366ab 100644 --- a/Modules/_tracemalloc.c +++ b/Modules/_tracemalloc.c @@ -3,7 +3,7 @@ #include "pycore_pymem.h" // _Py_tracemalloc_config #include "pycore_traceback.h" #include "hashtable.h" -#include "frameobject.h" +#include "frameobject.h" // PyFrame_GetBack() #include "clinic/_tracemalloc.c.h" /*[clinic input] @@ -434,15 +434,19 @@ traceback_get_frames(traceback_t *traceback) } PyFrameObject *pyframe = PyThreadState_GetFrame(tstate); - Py_XDECREF(pyframe); // use a borrowed reference - for (; pyframe != NULL; pyframe = pyframe->f_back) { + for (; pyframe != NULL;) { if (traceback->nframe < _Py_tracemalloc_config.max_nframe) { tracemalloc_get_frame(pyframe, &traceback->frames[traceback->nframe]); assert(traceback->frames[traceback->nframe].filename != NULL); traceback->nframe++; } - if (traceback->total_nframe < UINT16_MAX) + if (traceback->total_nframe < UINT16_MAX) { traceback->total_nframe++; + } + + PyFrameObject *back = PyFrame_GetBack(pyframe); + Py_DECREF(pyframe); + pyframe = back; } } diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 6d288b5b059d7..451c895a77c6b 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -1237,3 +1237,13 @@ PyFrame_GetCode(PyFrameObject *frame) Py_INCREF(code); return code; } + + +PyFrameObject* +PyFrame_GetBack(PyFrameObject *frame) +{ + assert(frame != NULL); + PyFrameObject *back = frame->f_back; + Py_XINCREF(back); + return back; +} diff --git a/Python/_warnings.c b/Python/_warnings.c index 7c15ce0ef89c3..4d65bb30c8e5c 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -3,7 +3,7 @@ #include "pycore_interp.h" // PyInterpreterState.warnings #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "frameobject.h" +#include "frameobject.h" // PyFrame_GetBack() #include "clinic/_warnings.c.h" #define MODULE_NAME "_warnings" @@ -815,7 +815,9 @@ static PyFrameObject * next_external_frame(PyFrameObject *frame) { do { - frame = frame->f_back; + PyFrameObject *back = PyFrame_GetBack(frame); + Py_DECREF(frame); + frame = back; } while (frame != NULL && is_internal_frame(frame)); return frame; @@ -831,12 +833,15 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, PyObject *globals; /* Setup globals, filename and lineno. */ - PyFrameObject *f = _PyThreadState_GET()->frame; + PyThreadState *tstate = _PyThreadState_GET(); + PyFrameObject *f = PyThreadState_GetFrame(tstate); // Stack level comparisons to Python code is off by one as there is no // warnings-related stack level to avoid. if (stack_level <= 0 || is_internal_frame(f)) { while (--stack_level > 0 && f != NULL) { - f = f->f_back; + PyFrameObject *back = PyFrame_GetBack(f); + Py_DECREF(f); + f = back; } } else { @@ -857,6 +862,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, Py_DECREF(code); Py_INCREF(*filename); *lineno = PyFrame_GetLineNumber(f); + Py_DECREF(f); } *module = NULL; @@ -868,7 +874,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, if (*registry == NULL) { int rc; - if (PyErr_Occurred()) { + if (_PyErr_Occurred(tstate)) { goto handle_error; } *registry = PyDict_New(); @@ -887,7 +893,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, if (*module == Py_None || (*module != NULL && PyUnicode_Check(*module))) { Py_INCREF(*module); } - else if (PyErr_Occurred()) { + else if (_PyErr_Occurred(tstate)) { goto handle_error; } else { diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 92ea5e7d637b9..914beb7e127fe 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -16,7 +16,7 @@ Data members: #include "Python.h" #include "code.h" -#include "frameobject.h" +#include "frameobject.h" // PyFrame_GetBack() #include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() #include "pycore_initconfig.h" #include "pycore_object.h" @@ -1787,14 +1787,17 @@ sys__getframe_impl(PyObject *module, int depth) /*[clinic end generated code: output=d438776c04d59804 input=c1be8a6464b11ee5]*/ { PyThreadState *tstate = _PyThreadState_GET(); - PyFrameObject *f = tstate->frame; + PyFrameObject *f = PyThreadState_GetFrame(tstate); if (_PySys_Audit(tstate, "sys._getframe", "O", f) < 0) { + Py_DECREF(f); return NULL; } while (depth > 0 && f != NULL) { - f = f->f_back; + PyFrameObject *back = PyFrame_GetBack(f); + Py_DECREF(f); + f = back; --depth; } if (f == NULL) { @@ -1802,7 +1805,6 @@ sys__getframe_impl(PyObject *module, int depth) "call stack is not deep enough"); return NULL; } - Py_INCREF(f); return (PyObject*)f; } diff --git a/Python/traceback.c b/Python/traceback.c index 438a2c4fce7ca..99b63af11f8be 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -4,7 +4,7 @@ #include "Python.h" #include "code.h" -#include "frameobject.h" +#include "frameobject.h" // PyFrame_GetBack() #include "structmember.h" // PyMemberDef #include "osdefs.h" // SEP #ifdef HAVE_FCNTL_H @@ -798,22 +798,31 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header) PUTS(fd, "Stack (most recent call first):\n"); } - frame = tstate->frame; + frame = PyThreadState_GetFrame(tstate); if (frame == NULL) { PUTS(fd, "\n"); return; } depth = 0; - while (frame != NULL) { + while (1) { if (MAX_FRAME_DEPTH <= depth) { + Py_DECREF(frame); PUTS(fd, " ...\n"); break; } - if (!PyFrame_Check(frame)) + if (!PyFrame_Check(frame)) { + Py_DECREF(frame); break; + } dump_frame(fd, frame); - frame = frame->f_back; + PyFrameObject *back = PyFrame_GetBack(frame); + Py_DECREF(frame); + + if (back == NULL) { + break; + } + frame = back; depth++; } } From webhook-mailer at python.org Tue Apr 28 21:32:15 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 01:32:15 -0000 Subject: [Python-checkins] bpo-39995: Fix concurrent.futures _ThreadWakeup (GH-19760) Message-ID: https://github.com/python/cpython/commit/a4dfe8ede5a37576e17035dccfe109ba7752237e commit: a4dfe8ede5a37576e17035dccfe109ba7752237e branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T03:32:06+02:00 summary: bpo-39995: Fix concurrent.futures _ThreadWakeup (GH-19760) Fix a race condition in concurrent.futures._ThreadWakeup: access to _ThreadWakeup is now protected with the shutdown lock. files: A Misc/NEWS.d/next/Library/2020-04-28-18-25-27.bpo-39995.WmA3Gk.rst M Lib/concurrent/futures/process.py diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 8e9b69a8f08b4..a76e2c9cf231a 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -90,6 +90,7 @@ def _python_exit(): _global_shutdown = True items = list(_threads_wakeups.items()) for _, thread_wakeup in items: + # call not protected by ProcessPoolExecutor._shutdown_lock thread_wakeup.wakeup() for t, _ in items: t.join() @@ -157,8 +158,10 @@ def __init__(self, work_id, fn, args, kwargs): class _SafeQueue(Queue): """Safe Queue set exception to the future object linked to a job""" - def __init__(self, max_size=0, *, ctx, pending_work_items, thread_wakeup): + def __init__(self, max_size=0, *, ctx, pending_work_items, shutdown_lock, + thread_wakeup): self.pending_work_items = pending_work_items + self.shutdown_lock = shutdown_lock self.thread_wakeup = thread_wakeup super().__init__(max_size, ctx=ctx) @@ -167,7 +170,8 @@ def _on_queue_feeder_error(self, e, obj): tb = traceback.format_exception(type(e), e, e.__traceback__) e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb))) work_item = self.pending_work_items.pop(obj.work_id, None) - self.thread_wakeup.wakeup() + with self.shutdown_lock: + self.thread_wakeup.wakeup() # work_item can be None if another process terminated. In this # case, the executor_manager_thread fails all work_items # with BrokenProcessPool @@ -268,6 +272,7 @@ def __init__(self, executor): # A _ThreadWakeup to allow waking up the queue_manager_thread from the # main Thread and avoid deadlocks caused by permanently locked queues. self.thread_wakeup = executor._executor_manager_thread_wakeup + self.shutdown_lock = executor._shutdown_lock # A weakref.ref to the ProcessPoolExecutor that owns this thread. Used # to determine if the ProcessPoolExecutor has been garbage collected @@ -275,10 +280,13 @@ def __init__(self, executor): # When the executor gets garbage collected, the weakref callback # will wake up the queue management thread so that it can terminate # if there is no pending work item. - def weakref_cb(_, thread_wakeup=self.thread_wakeup): + def weakref_cb(_, + thread_wakeup=self.thread_wakeup, + shutdown_lock=self.shutdown_lock): mp.util.debug('Executor collected: triggering callback for' ' QueueManager wakeup') - thread_wakeup.wakeup() + with shutdown_lock: + thread_wakeup.wakeup() self.executor_reference = weakref.ref(executor, weakref_cb) @@ -363,6 +371,7 @@ def wait_result_broken_or_wakeup(self): # submitted, from the executor being shutdown/gc-ed, or from the # shutdown of the python interpreter. result_reader = self.result_queue._reader + assert not self.thread_wakeup._closed wakeup_reader = self.thread_wakeup._reader readers = [result_reader, wakeup_reader] worker_sentinels = [p.sentinel for p in self.processes.values()] @@ -380,7 +389,9 @@ def wait_result_broken_or_wakeup(self): elif wakeup_reader in ready: is_broken = False - self.thread_wakeup.clear() + + with self.shutdown_lock: + self.thread_wakeup.clear() return result_item, is_broken, cause @@ -500,7 +511,8 @@ def join_executor_internals(self): # Release the queue's resources as soon as possible. self.call_queue.close() self.call_queue.join_thread() - self.thread_wakeup.close() + with self.shutdown_lock: + self.thread_wakeup.close() # If .join() is not called on the created processes then # some ctx.Queue methods may deadlock on Mac OS X. for p in self.processes.values(): @@ -619,6 +631,8 @@ def __init__(self, max_workers=None, mp_context=None, # _result_queue to send wakeup signals to the executor_manager_thread # as it could result in a deadlock if a worker process dies with the # _result_queue write lock still acquired. + # + # _shutdown_lock must be locked to access _ThreadWakeup. self._executor_manager_thread_wakeup = _ThreadWakeup() # Create communication channels for the executor @@ -629,6 +643,7 @@ def __init__(self, max_workers=None, mp_context=None, self._call_queue = _SafeQueue( max_size=queue_size, ctx=self._mp_context, pending_work_items=self._pending_work_items, + shutdown_lock=self._shutdown_lock, thread_wakeup=self._executor_manager_thread_wakeup) # Killed worker processes can produce spurious "broken pipe" # tracebacks in the queue's own worker thread. But we detect killed @@ -718,12 +733,12 @@ def shutdown(self, wait=True, *, cancel_futures=False): with self._shutdown_lock: self._cancel_pending_futures = cancel_futures self._shutdown_thread = True + if self._executor_manager_thread_wakeup is not None: + # Wake up queue management thread + self._executor_manager_thread_wakeup.wakeup() - if self._executor_manager_thread: - # Wake up queue management thread - self._executor_manager_thread_wakeup.wakeup() - if wait: - self._executor_manager_thread.join() + if self._executor_manager_thread is not None and wait: + self._executor_manager_thread.join() # To reduce the risk of opening too many files, remove references to # objects that use file descriptors. self._executor_manager_thread = None @@ -732,8 +747,6 @@ def shutdown(self, wait=True, *, cancel_futures=False): self._result_queue.close() self._result_queue = None self._processes = None - - if self._executor_manager_thread_wakeup: - self._executor_manager_thread_wakeup = None + self._executor_manager_thread_wakeup = None shutdown.__doc__ = _base.Executor.shutdown.__doc__ diff --git a/Misc/NEWS.d/next/Library/2020-04-28-18-25-27.bpo-39995.WmA3Gk.rst b/Misc/NEWS.d/next/Library/2020-04-28-18-25-27.bpo-39995.WmA3Gk.rst new file mode 100644 index 0000000000000..24aff65736337 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-28-18-25-27.bpo-39995.WmA3Gk.rst @@ -0,0 +1,2 @@ +Fix a race condition in concurrent.futures._ThreadWakeup: access to +_ThreadWakeup is now protected with the shutdown lock. From webhook-mailer at python.org Tue Apr 28 21:42:31 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Wed, 29 Apr 2020 01:42:31 -0000 Subject: [Python-checkins] bpo-40334: Disallow invalid single statements in the new parser (GH-19774) Message-ID: https://github.com/python/cpython/commit/6d6508765514c7c10719478a0430f5e47c9a96ac commit: 6d6508765514c7c10719478a0430f5e47c9a96ac branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-29T02:42:27+01:00 summary: bpo-40334: Disallow invalid single statements in the new parser (GH-19774) After parsing is done in single statement mode, the tokenizer buffer has to be checked for additional lines and a `SyntaxError` must be raised, in case there are any. Co-authored-by: Pablo Galindo files: M Lib/test/test_compile.py M Parser/pegen/pegen.c diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index a507ac0914918..566ca27fca893 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -501,7 +501,6 @@ def test_single_statement(self): self.compile_single("if x:\n f(x)\nelse:\n g(x)") self.compile_single("class T:\n pass") - @support.skip_if_new_parser('Pegen does not disallow multiline single stmts') def test_bad_single_statement(self): self.assertInvalidSingle('1\n2') self.assertInvalidSingle('def f(): pass') diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index ef95aacb7f084..39da2709991b9 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -911,6 +911,52 @@ _PyPegen_number_token(Parser *p) p->arena); } +static int // bool +newline_in_string(Parser *p, const char *cur) +{ + for (char c = *cur; cur >= p->tok->buf; c = *--cur) { + if (c == '\'' || c == '"') { + return 1; + } + } + return 0; +} + +/* Check that the source for a single input statement really is a single + statement by looking at what is left in the buffer after parsing. + Trailing whitespace and comments are OK. */ +static int // bool +bad_single_statement(Parser *p) +{ + const char *cur = strchr(p->tok->buf, '\n'); + + /* Newlines are allowed if preceded by a line continuation character + or if they appear inside a string. */ + if (!cur || *(cur - 1) == '\\' || newline_in_string(p, cur)) { + return 0; + } + char c = *cur; + + for (;;) { + while (c == ' ' || c == '\t' || c == '\n' || c == '\014') { + c = *++cur; + } + + if (!c) { + return 0; + } + + if (c != '#') { + return 1; + } + + /* Suck up comment. */ + while (c && c != '\n') { + c = *++cur; + } + } +} + void _PyPegen_Parser_Free(Parser *p) { @@ -1014,6 +1060,11 @@ _PyPegen_run_parser(Parser *p) return NULL; } + if (p->start_rule == Py_single_input && bad_single_statement(p)) { + p->tok->done = E_BADSINGLE; // This is not necessary for now, but might be in the future + return RAISE_SYNTAX_ERROR("multiple statements found while compiling a single statement"); + } + return res; } From webhook-mailer at python.org Tue Apr 28 22:42:00 2020 From: webhook-mailer at python.org (Zackery Spytz) Date: Wed, 29 Apr 2020 02:42:00 -0000 Subject: [Python-checkins] bpo-40428: Remove references to Py*_ClearFreeList in the docs (GH-19783) Message-ID: https://github.com/python/cpython/commit/bb4a585d903e7fe0a46ded8c2ee3f47435ad6a66 commit: bb4a585d903e7fe0a46ded8c2ee3f47435ad6a66 branch: master author: Zackery Spytz committer: GitHub date: 2020-04-29T04:41:56+02:00 summary: bpo-40428: Remove references to Py*_ClearFreeList in the docs (GH-19783) They were removed from the C API in commit ae00a5a88534fd45939f86c12e038da9fa6f9ed6. files: M Doc/c-api/contextvars.rst M Doc/c-api/dict.rst M Doc/c-api/float.rst M Doc/c-api/list.rst M Doc/c-api/method.rst M Doc/c-api/set.rst M Doc/c-api/tuple.rst diff --git a/Doc/c-api/contextvars.rst b/Doc/c-api/contextvars.rst index 38256a3b0f2a0..9c088814314a8 100644 --- a/Doc/c-api/contextvars.rst +++ b/Doc/c-api/contextvars.rst @@ -101,11 +101,6 @@ Context object management functions: current context for the current thread. Returns ``0`` on success, and ``-1`` on error. -.. c:function:: int PyContext_ClearFreeList() - - Clear the context variable free list. Return the total number of - freed items. This function always succeeds. - Context variable functions: diff --git a/Doc/c-api/dict.rst b/Doc/c-api/dict.rst index e48c11d336b8c..2fb29cdd61778 100644 --- a/Doc/c-api/dict.rst +++ b/Doc/c-api/dict.rst @@ -232,10 +232,3 @@ Dictionary Objects for key, value in seq2: if override or key not in a: a[key] = value - - -.. c:function:: int PyDict_ClearFreeList() - - Clear the free list. Return the total number of freed items. - - .. versionadded:: 3.3 diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index bfc28a79ecfdc..b29937dbecdcf 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -76,8 +76,3 @@ Floating Point Objects .. c:function:: double PyFloat_GetMin() Return the minimum normalized positive float *DBL_MIN* as C :c:type:`double`. - -.. c:function:: int PyFloat_ClearFreeList() - - Clear the float free list. Return the number of items that could not - be freed. diff --git a/Doc/c-api/list.rst b/Doc/c-api/list.rst index b247cdfba0187..0bc0785f200d4 100644 --- a/Doc/c-api/list.rst +++ b/Doc/c-api/list.rst @@ -142,10 +142,3 @@ List Objects Return a new tuple object containing the contents of *list*; equivalent to ``tuple(list)``. - - -.. c:function:: int PyList_ClearFreeList() - - Clear the free list. Return the total number of freed items. - - .. versionadded:: 3.3 diff --git a/Doc/c-api/method.rst b/Doc/c-api/method.rst index b1862d796c9f4..0a5341cbbdf15 100644 --- a/Doc/c-api/method.rst +++ b/Doc/c-api/method.rst @@ -92,9 +92,3 @@ no longer available. .. c:function:: PyObject* PyMethod_GET_SELF(PyObject *meth) Macro version of :c:func:`PyMethod_Self` which avoids error checking. - - -.. c:function:: int PyMethod_ClearFreeList() - - Clear the free list. Return the total number of freed items. - diff --git a/Doc/c-api/set.rst b/Doc/c-api/set.rst index 54819e8fd6cbd..879f394d966cd 100644 --- a/Doc/c-api/set.rst +++ b/Doc/c-api/set.rst @@ -157,10 +157,3 @@ subtypes but not for instances of :class:`frozenset` or its subtypes. .. c:function:: int PySet_Clear(PyObject *set) Empty an existing set of all elements. - - -.. c:function:: int PySet_ClearFreeList() - - Clear the free list. Return the total number of freed items. - - .. versionadded:: 3.3 diff --git a/Doc/c-api/tuple.rst b/Doc/c-api/tuple.rst index 62bc9a565071d..c14cb2d38fd54 100644 --- a/Doc/c-api/tuple.rst +++ b/Doc/c-api/tuple.rst @@ -111,11 +111,6 @@ Tuple Objects raises :exc:`MemoryError` or :exc:`SystemError`. -.. c:function:: int PyTuple_ClearFreeList() - - Clear the free list. Return the total number of freed items. - - Struct Sequence Objects ----------------------- From webhook-mailer at python.org Tue Apr 28 23:11:26 2020 From: webhook-mailer at python.org (Kyle Stanley) Date: Wed, 29 Apr 2020 03:11:26 -0000 Subject: [Python-checkins] [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) (#19784) Message-ID: https://github.com/python/cpython/commit/cc011b5190b63f0be561ddec38fc4cd9e60cbf6a commit: cc011b5190b63f0be561ddec38fc4cd9e60cbf6a branch: 3.8 author: Kyle Stanley committer: GitHub date: 2020-04-28T23:11:18-04:00 summary: [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) (#19784) [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) * Addresses a syntax typo that mistakenly used a undefined string prefix due to a missing space. (cherry picked from commit 49f70db83e2c62ad06805927f53f6c3e8f4b798e) Co-authored-by: Miro Hron?ok files: M Lib/turtledemo/__main__.py diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index 17fe9a75e1c5e..12be5098dad27 100644 --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -272,7 +272,7 @@ def configGUI(self, start, stop, clear, txt="", color="blue"): self.stop_btn.config(state=stop, bg="#d00" if stop == NORMAL else "#fca") self.clear_btn.config(state=clear, - bg="#d00" if clear == NORMAL else"#fca") + bg="#d00" if clear == NORMAL else "#fca") self.output_lbl.config(text=txt, fg=color) def makeLoadDemoMenu(self, master): From webhook-mailer at python.org Wed Apr 29 03:36:27 2020 From: webhook-mailer at python.org (Serhiy Storchaka) Date: Wed, 29 Apr 2020 07:36:27 -0000 Subject: [Python-checkins] bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711) Message-ID: https://github.com/python/cpython/commit/bfb1cf44658934cbcd9707fb717d6770c78fbeb3 commit: bfb1cf44658934cbcd9707fb717d6770c78fbeb3 branch: master author: Serhiy Storchaka committer: GitHub date: 2020-04-29T10:36:20+03:00 summary: bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711) files: M Doc/library/test.rst M Lib/test/support/__init__.py M Lib/test/support/socket_helper.py M Lib/test/test_httplib.py M Lib/test/test_imaplib.py M Lib/test/test_nntplib.py M Lib/test/test_robotparser.py M Lib/test/test_site.py M Lib/test/test_smtpnet.py M Lib/test/test_socket.py M Lib/test/test_ssl.py M Lib/test/test_timeout.py M Lib/test/test_urllib2.py M Lib/test/test_urllib2net.py M Lib/test/test_urllibnet.py diff --git a/Doc/library/test.rst b/Doc/library/test.rst index c2aaecc183e77..f7e6eba018161 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -314,7 +314,7 @@ The :mod:`test.support` module defines the following constants: Usually, a timeout using :data:`INTERNET_TIMEOUT` should not mark a test as failed, but skip the test instead: see - :func:`~test.support.transient_internet`. + :func:`~test.support.socket_helper.transient_internet`. Its default value is 1 minute. @@ -759,12 +759,6 @@ The :mod:`test.support` module defines the following functions: A context manager that temporarily sets the process umask. -.. function:: transient_internet(resource_name, *, timeout=30.0, errnos=()) - - A context manager that raises :exc:`ResourceDenied` when various issues - with the internet connection manifest themselves as exceptions. - - .. function:: disable_faulthandler() A context manager that replaces ``sys.stderr`` with ``sys.__stderr__``. @@ -1488,6 +1482,13 @@ The :mod:`test.support.socket_helper` module provides support for socket tests. sockets. +.. function:: transient_internet(resource_name, *, timeout=30.0, errnos=()) + + A context manager that raises :exc:`~test.support.ResourceDenied` when + various issues with the internet connection manifest themselves as + exceptions. + + :mod:`test.support.script_helper` --- Utilities for the Python execution tests ============================================================================== diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index ee5882f237cfc..bd2157496fe00 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -78,7 +78,7 @@ "requires_linux_version", "requires_mac_ver", "check_syntax_error", "check_syntax_warning", "TransientResource", "time_out", "socket_peer_reset", "ioerror_peer_reset", - "transient_internet", "BasicTestRunner", "run_unittest", "run_doctest", + "BasicTestRunner", "run_unittest", "run_doctest", "skip_unless_symlink", "requires_gzip", "requires_bz2", "requires_lzma", "bigmemtest", "bigaddrspacetest", "cpython_only", "get_attribute", "requires_IEEE_754", "skip_unless_xattr", "requires_zlib", @@ -144,8 +144,6 @@ # option. LONG_TIMEOUT = 5 * 60.0 -_NOT_SET = object() - class Error(Exception): """Base class for regression test exceptions.""" @@ -1386,90 +1384,6 @@ def __exit__(self, type_=None, value=None, traceback=None): ioerror_peer_reset = TransientResource(OSError, errno=errno.ECONNRESET) - at contextlib.contextmanager -def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()): - """Return a context manager that raises ResourceDenied when various issues - with the Internet connection manifest themselves as exceptions.""" - import socket - import nntplib - import urllib.error - if timeout is _NOT_SET: - timeout = INTERNET_TIMEOUT - - default_errnos = [ - ('ECONNREFUSED', 111), - ('ECONNRESET', 104), - ('EHOSTUNREACH', 113), - ('ENETUNREACH', 101), - ('ETIMEDOUT', 110), - # socket.create_connection() fails randomly with - # EADDRNOTAVAIL on Travis CI. - ('EADDRNOTAVAIL', 99), - ] - default_gai_errnos = [ - ('EAI_AGAIN', -3), - ('EAI_FAIL', -4), - ('EAI_NONAME', -2), - ('EAI_NODATA', -5), - # Encountered when trying to resolve IPv6-only hostnames - ('WSANO_DATA', 11004), - ] - - denied = ResourceDenied("Resource %r is not available" % resource_name) - captured_errnos = errnos - gai_errnos = [] - if not captured_errnos: - captured_errnos = [getattr(errno, name, num) - for (name, num) in default_errnos] - gai_errnos = [getattr(socket, name, num) - for (name, num) in default_gai_errnos] - - def filter_error(err): - n = getattr(err, 'errno', None) - if (isinstance(err, socket.timeout) or - (isinstance(err, socket.gaierror) and n in gai_errnos) or - (isinstance(err, urllib.error.HTTPError) and - 500 <= err.code <= 599) or - (isinstance(err, urllib.error.URLError) and - (("ConnectionRefusedError" in err.reason) or - ("TimeoutError" in err.reason) or - ("EOFError" in err.reason))) or - n in captured_errnos): - if not verbose: - sys.stderr.write(denied.args[0] + "\n") - raise denied from err - - old_timeout = socket.getdefaulttimeout() - try: - if timeout is not None: - socket.setdefaulttimeout(timeout) - yield - except nntplib.NNTPTemporaryError as err: - if verbose: - sys.stderr.write(denied.args[0] + "\n") - raise denied from err - except OSError as err: - # urllib can wrap original socket errors multiple times (!), we must - # unwrap to get at the original error. - while True: - a = err.args - if len(a) >= 1 and isinstance(a[0], OSError): - err = a[0] - # The error can also be wrapped as args[1]: - # except socket.error as msg: - # raise OSError('socket error', msg).with_traceback(sys.exc_info()[2]) - elif len(a) >= 2 and isinstance(a[1], OSError): - err = a[1] - else: - break - filter_error(err) - raise - # XXX should we catch generic exceptions and look for their - # __cause__ or __context__? - finally: - socket.setdefaulttimeout(old_timeout) - - @contextlib.contextmanager def captured_output(stream_name): """Return a context manager used by captured_stdout/stdin/stderr diff --git a/Lib/test/support/socket_helper.py b/Lib/test/support/socket_helper.py index 5f4a7f19a3223..b09c248cfccdf 100644 --- a/Lib/test/support/socket_helper.py +++ b/Lib/test/support/socket_helper.py @@ -1,7 +1,11 @@ +import contextlib import errno import socket import unittest +from .. import support + + HOST = "localhost" HOSTv4 = "127.0.0.1" HOSTv6 = "::1" @@ -175,3 +179,88 @@ def get_socket_conn_refused_errs(): if not IPV6_ENABLED: errors.append(errno.EAFNOSUPPORT) return errors + + +_NOT_SET = object() + + at contextlib.contextmanager +def transient_internet(resource_name, *, timeout=_NOT_SET, errnos=()): + """Return a context manager that raises ResourceDenied when various issues + with the Internet connection manifest themselves as exceptions.""" + import nntplib + import urllib.error + if timeout is _NOT_SET: + timeout = support.INTERNET_TIMEOUT + + default_errnos = [ + ('ECONNREFUSED', 111), + ('ECONNRESET', 104), + ('EHOSTUNREACH', 113), + ('ENETUNREACH', 101), + ('ETIMEDOUT', 110), + # socket.create_connection() fails randomly with + # EADDRNOTAVAIL on Travis CI. + ('EADDRNOTAVAIL', 99), + ] + default_gai_errnos = [ + ('EAI_AGAIN', -3), + ('EAI_FAIL', -4), + ('EAI_NONAME', -2), + ('EAI_NODATA', -5), + # Encountered when trying to resolve IPv6-only hostnames + ('WSANO_DATA', 11004), + ] + + denied = support.ResourceDenied("Resource %r is not available" % resource_name) + captured_errnos = errnos + gai_errnos = [] + if not captured_errnos: + captured_errnos = [getattr(errno, name, num) + for (name, num) in default_errnos] + gai_errnos = [getattr(socket, name, num) + for (name, num) in default_gai_errnos] + + def filter_error(err): + n = getattr(err, 'errno', None) + if (isinstance(err, socket.timeout) or + (isinstance(err, socket.gaierror) and n in gai_errnos) or + (isinstance(err, urllib.error.HTTPError) and + 500 <= err.code <= 599) or + (isinstance(err, urllib.error.URLError) and + (("ConnectionRefusedError" in err.reason) or + ("TimeoutError" in err.reason) or + ("EOFError" in err.reason))) or + n in captured_errnos): + if not support.verbose: + sys.stderr.write(denied.args[0] + "\n") + raise denied from err + + old_timeout = socket.getdefaulttimeout() + try: + if timeout is not None: + socket.setdefaulttimeout(timeout) + yield + except nntplib.NNTPTemporaryError as err: + if support.verbose: + sys.stderr.write(denied.args[0] + "\n") + raise denied from err + except OSError as err: + # urllib can wrap original socket errors multiple times (!), we must + # unwrap to get at the original error. + while True: + a = err.args + if len(a) >= 1 and isinstance(a[0], OSError): + err = a[0] + # The error can also be wrapped as args[1]: + # except socket.error as msg: + # raise OSError('socket error', msg).with_traceback(sys.exc_info()[2]) + elif len(a) >= 2 and isinstance(a[1], OSError): + err = a[1] + else: + break + filter_error(err) + raise + # XXX should we catch generic exceptions and look for their + # __cause__ or __context__? + finally: + socket.setdefaulttimeout(old_timeout) diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 6b7a9dedf1a2a..e95487bcd45db 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -1629,7 +1629,7 @@ def test_networked(self): # Default settings: requires a valid cert from a trusted CA import ssl support.requires('network') - with support.transient_internet('self-signed.pythontest.net'): + with socket_helper.transient_internet('self-signed.pythontest.net'): h = client.HTTPSConnection('self-signed.pythontest.net', 443) with self.assertRaises(ssl.SSLError) as exc_info: h.request('GET', '/') @@ -1639,7 +1639,7 @@ def test_networked_noverification(self): # Switch off cert verification import ssl support.requires('network') - with support.transient_internet('self-signed.pythontest.net'): + with socket_helper.transient_internet('self-signed.pythontest.net'): context = ssl._create_unverified_context() h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context) @@ -1653,7 +1653,7 @@ def test_networked_noverification(self): def test_networked_trusted_by_default_cert(self): # Default settings: requires a valid cert from a trusted CA support.requires('network') - with support.transient_internet('www.python.org'): + with socket_helper.transient_internet('www.python.org'): h = client.HTTPSConnection('www.python.org', 443) h.request('GET', '/') resp = h.getresponse() @@ -1667,7 +1667,7 @@ def test_networked_good_cert(self): import ssl support.requires('network') selfsigned_pythontestdotnet = 'self-signed.pythontest.net' - with support.transient_internet(selfsigned_pythontestdotnet): + with socket_helper.transient_internet(selfsigned_pythontestdotnet): context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) self.assertEqual(context.verify_mode, ssl.CERT_REQUIRED) self.assertEqual(context.check_hostname, True) @@ -1699,7 +1699,7 @@ def test_networked_bad_cert(self): # We feed a "CA" cert that is unrelated to the server's cert import ssl support.requires('network') - with support.transient_internet('self-signed.pythontest.net'): + with socket_helper.transient_internet('self-signed.pythontest.net'): context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) context.load_verify_locations(CERT_localhost) h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context) diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index ce601565cf1a6..d1e3550868059 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -10,7 +10,7 @@ import threading import socket -from test.support import (reap_threads, verbose, transient_internet, +from test.support import (reap_threads, verbose, run_with_tz, run_with_locale, cpython_only) from test.support import hashlib_helper import unittest @@ -968,16 +968,16 @@ class RemoteIMAPTest(unittest.TestCase): imap_class = imaplib.IMAP4 def setUp(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.server = self.imap_class(self.host, self.port) def tearDown(self): if self.server is not None: - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.server.logout() def test_logincapa(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): for cap in self.server.capabilities: self.assertIsInstance(cap, str) self.assertIn('LOGINDISABLED', self.server.capabilities) @@ -986,7 +986,7 @@ def test_logincapa(self): self.assertEqual(rs[0], 'OK') def test_logout(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): rs = self.server.logout() self.server = None self.assertEqual(rs[0], 'BYE', rs) @@ -999,7 +999,7 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest): def setUp(self): super().setUp() - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): rs = self.server.starttls() self.assertEqual(rs[0], 'OK') @@ -1039,24 +1039,24 @@ def check_logincapa(self, server): server.logout() def test_logincapa(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): _server = self.imap_class(self.host, self.port) self.check_logincapa(_server) def test_logout(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): _server = self.imap_class(self.host, self.port) rs = _server.logout() self.assertEqual(rs[0], 'BYE', rs) def test_ssl_context_certfile_exclusive(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.assertRaises( ValueError, self.imap_class, self.host, self.port, certfile=CERTFILE, ssl_context=self.create_ssl_context()) def test_ssl_context_keyfile_exclusive(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.assertRaises( ValueError, self.imap_class, self.host, self.port, keyfile=CERTFILE, ssl_context=self.create_ssl_context()) diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 2a5a0b97eea63..8d296818e64f1 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -246,7 +246,7 @@ def wrap_methods(cls): def wrap_meth(meth): @functools.wraps(meth) def wrapped(self): - with support.transient_internet(self.NNTP_HOST): + with socket_helper.transient_internet(self.NNTP_HOST): meth(self) return wrapped for name in dir(cls): @@ -315,7 +315,7 @@ class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase): @classmethod def setUpClass(cls): support.requires("network") - with support.transient_internet(cls.NNTP_HOST): + with socket_helper.transient_internet(cls.NNTP_HOST): try: cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=support.INTERNET_TIMEOUT, diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py index 9d4764ece2fd2..a3112b8fdf473 100644 --- a/Lib/test/test_robotparser.py +++ b/Lib/test/test_robotparser.py @@ -349,7 +349,7 @@ class NetworkTestCase(unittest.TestCase): @classmethod def setUpClass(cls): support.requires('network') - with support.transient_internet(cls.base_url): + with socket_helper.transient_internet(cls.base_url): cls.parser = urllib.robotparser.RobotFileParser(cls.robots_txt) cls.parser.read() diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index 12e357cd9ba69..957e7a41d5466 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -7,6 +7,7 @@ import unittest import test.support from test import support +from test.support import socket_helper from test.support import (captured_stderr, TESTFN, EnvironmentVarGuard, change_cwd) import builtins @@ -509,7 +510,7 @@ def test_license_exists_at_url(self): url = license._Printer__data.split()[1] req = urllib.request.Request(url, method='HEAD') try: - with test.support.transient_internet(url): + with socket_helper.transient_internet(url): with urllib.request.urlopen(req) as data: code = data.getcode() except urllib.error.HTTPError as e: diff --git a/Lib/test/test_smtpnet.py b/Lib/test/test_smtpnet.py index b69cd9de62724..74a00a9d7cc58 100644 --- a/Lib/test/test_smtpnet.py +++ b/Lib/test/test_smtpnet.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import socket_helper import smtplib import socket @@ -28,7 +29,7 @@ def test_connect_starttls(self): context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) context.check_hostname = False context.verify_mode = ssl.CERT_NONE - with support.transient_internet(self.testServer): + with socket_helper.transient_internet(self.testServer): server = smtplib.SMTP(self.testServer, self.remotePort) try: server.starttls(context=context) @@ -47,14 +48,14 @@ class SmtpSSLTest(unittest.TestCase): def test_connect(self): support.get_attribute(smtplib, 'SMTP_SSL') - with support.transient_internet(self.testServer): + with socket_helper.transient_internet(self.testServer): server = smtplib.SMTP_SSL(self.testServer, self.remotePort) server.ehlo() server.quit() def test_connect_default_port(self): support.get_attribute(smtplib, 'SMTP_SSL') - with support.transient_internet(self.testServer): + with socket_helper.transient_internet(self.testServer): server = smtplib.SMTP_SSL(self.testServer) server.ehlo() server.quit() @@ -64,20 +65,20 @@ def test_connect_using_sslcontext(self): context.check_hostname = False context.verify_mode = ssl.CERT_NONE support.get_attribute(smtplib, 'SMTP_SSL') - with support.transient_internet(self.testServer): + with socket_helper.transient_internet(self.testServer): server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) server.ehlo() server.quit() def test_connect_using_sslcontext_verified(self): - with support.transient_internet(self.testServer): + with socket_helper.transient_internet(self.testServer): can_verify = check_ssl_verifiy(self.testServer, self.remotePort) if not can_verify: self.skipTest("SSL certificate can't be verified") support.get_attribute(smtplib, 'SMTP_SSL') context = ssl.create_default_context() - with support.transient_internet(self.testServer): + with socket_helper.transient_internet(self.testServer): server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) server.ehlo() server.quit() diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index a70e28219ed23..87ae2e127a236 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1533,7 +1533,7 @@ def test_getnameinfo(self): def test_idna(self): # Check for internet access before running test # (issue #12804, issue #25138). - with support.transient_internet('python.org'): + with socket_helper.transient_internet('python.org'): socket.gethostbyname('python.org') # these should all be successful diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index dafdb6c08092b..5d496c6687614 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2246,7 +2246,7 @@ class NetworkedTests(unittest.TestCase): def test_timeout_connect_ex(self): # Issue #12065: on a timeout, connect_ex() should return the original # errno (mimicking the behaviour of non-SSL sockets). - with support.transient_internet(REMOTE_HOST): + with socket_helper.transient_internet(REMOTE_HOST): s = test_wrap_socket(socket.socket(socket.AF_INET), cert_reqs=ssl.CERT_REQUIRED, do_handshake_on_connect=False) @@ -2259,7 +2259,7 @@ def test_timeout_connect_ex(self): @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6') def test_get_server_certificate_ipv6(self): - with support.transient_internet('ipv6.google.com'): + with socket_helper.transient_internet('ipv6.google.com'): _test_get_server_certificate(self, 'ipv6.google.com', 443) _test_get_server_certificate_fail(self, 'ipv6.google.com', 443) diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py index c0952c75e9913..ac803f5d63823 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -20,7 +20,7 @@ def resolve_address(host, port): We must perform name resolution before timeout tests, otherwise it will be performed by connect(). """ - with support.transient_internet(host): + with socket_helper.transient_internet(host): return socket.getaddrinfo(host, port, socket.AF_INET, socket.SOCK_STREAM)[0][4] @@ -230,12 +230,12 @@ def testConnectTimeout(self): # All that hard work just to test if connect times out in 0.001s ;-) self.addr_remote = blackhole - with support.transient_internet(self.addr_remote[0]): + with socket_helper.transient_internet(self.addr_remote[0]): self._sock_operation(1, 0.001, 'connect', self.addr_remote) def testRecvTimeout(self): # Test recv() timeout - with support.transient_internet(self.addr_remote[0]): + with socket_helper.transient_internet(self.addr_remote[0]): self.sock.connect(self.addr_remote) self._sock_operation(1, 1.5, 'recv', 1024) diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index e69ac3e2136a2..cbfa9ba60c2c8 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import socket_helper from test import test_urllib import os @@ -1776,7 +1777,7 @@ class MyOtherHTTPHandler(urllib.request.HTTPHandler): @unittest.skipUnless(support.is_resource_enabled('network'), 'test requires network access') def test_issue16464(self): - with support.transient_internet("http://www.example.com/"): + with socket_helper.transient_internet("http://www.example.com/"): opener = urllib.request.build_opener() request = urllib.request.Request("http://www.example.com/") self.assertEqual(None, request.data) diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py index b3a5e8974df32..ba4c500e8ec3e 100644 --- a/Lib/test/test_urllib2net.py +++ b/Lib/test/test_urllib2net.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import socket_helper from test.test_urllib2 import sanepathname2url import os @@ -86,7 +87,7 @@ def test_close(self): # calling .close() on urllib2's response objects should close the # underlying socket url = support.TEST_HTTP_URL - with support.transient_internet(url): + with socket_helper.transient_internet(url): response = _urlopen_with_retry(url) sock = response.fp self.assertFalse(sock.closed) @@ -159,7 +160,7 @@ def test_file(self): def test_urlwithfrag(self): urlwith_frag = "http://www.pythontest.net/index.html#frag" - with support.transient_internet(urlwith_frag): + with socket_helper.transient_internet(urlwith_frag): req = urllib.request.Request(urlwith_frag) res = urllib.request.urlopen(req) self.assertEqual(res.geturl(), @@ -167,7 +168,7 @@ def test_urlwithfrag(self): def test_redirect_url_withfrag(self): redirect_url_with_frag = "http://www.pythontest.net/redir/with_frag/" - with support.transient_internet(redirect_url_with_frag): + with socket_helper.transient_internet(redirect_url_with_frag): req = urllib.request.Request(redirect_url_with_frag) res = urllib.request.urlopen(req) self.assertEqual(res.geturl(), @@ -175,7 +176,7 @@ def test_redirect_url_withfrag(self): def test_custom_headers(self): url = support.TEST_HTTP_URL - with support.transient_internet(url): + with socket_helper.transient_internet(url): opener = urllib.request.build_opener() request = urllib.request.Request(url) self.assertFalse(request.header_items()) @@ -193,7 +194,7 @@ def test_sites_no_connection_close(self): URL = 'http://www.imdb.com' # mangles Connection:close - with support.transient_internet(URL): + with socket_helper.transient_internet(URL): try: with urllib.request.urlopen(URL) as res: pass @@ -223,7 +224,7 @@ def _test_urls(self, urls, handlers, retry=True): else: req = expected_err = None - with support.transient_internet(url): + with socket_helper.transient_internet(url): try: f = urlopen(url, req, support.INTERNET_TIMEOUT) # urllib.error.URLError is a subclass of OSError @@ -265,7 +266,7 @@ def setUp(self): def test_http_basic(self): self.assertIsNone(socket.getdefaulttimeout()) url = support.TEST_HTTP_URL - with support.transient_internet(url, timeout=None): + with socket_helper.transient_internet(url, timeout=None): u = _urlopen_with_retry(url) self.addCleanup(u.close) self.assertIsNone(u.fp.raw._sock.gettimeout()) @@ -273,7 +274,7 @@ def test_http_basic(self): def test_http_default_timeout(self): self.assertIsNone(socket.getdefaulttimeout()) url = support.TEST_HTTP_URL - with support.transient_internet(url): + with socket_helper.transient_internet(url): socket.setdefaulttimeout(60) try: u = _urlopen_with_retry(url) @@ -285,7 +286,7 @@ def test_http_default_timeout(self): def test_http_no_timeout(self): self.assertIsNone(socket.getdefaulttimeout()) url = support.TEST_HTTP_URL - with support.transient_internet(url): + with socket_helper.transient_internet(url): socket.setdefaulttimeout(60) try: u = _urlopen_with_retry(url, timeout=None) @@ -296,7 +297,7 @@ def test_http_no_timeout(self): def test_http_timeout(self): url = support.TEST_HTTP_URL - with support.transient_internet(url): + with socket_helper.transient_internet(url): u = _urlopen_with_retry(url, timeout=120) self.addCleanup(u.close) self.assertEqual(u.fp.raw._sock.gettimeout(), 120) @@ -306,7 +307,7 @@ def test_http_timeout(self): @skip_ftp_test_on_travis def test_ftp_basic(self): self.assertIsNone(socket.getdefaulttimeout()) - with support.transient_internet(self.FTP_HOST, timeout=None): + with socket_helper.transient_internet(self.FTP_HOST, timeout=None): u = _urlopen_with_retry(self.FTP_HOST) self.addCleanup(u.close) self.assertIsNone(u.fp.fp.raw._sock.gettimeout()) @@ -314,7 +315,7 @@ def test_ftp_basic(self): @skip_ftp_test_on_travis def test_ftp_default_timeout(self): self.assertIsNone(socket.getdefaulttimeout()) - with support.transient_internet(self.FTP_HOST): + with socket_helper.transient_internet(self.FTP_HOST): socket.setdefaulttimeout(60) try: u = _urlopen_with_retry(self.FTP_HOST) @@ -326,7 +327,7 @@ def test_ftp_default_timeout(self): @skip_ftp_test_on_travis def test_ftp_no_timeout(self): self.assertIsNone(socket.getdefaulttimeout()) - with support.transient_internet(self.FTP_HOST): + with socket_helper.transient_internet(self.FTP_HOST): socket.setdefaulttimeout(60) try: u = _urlopen_with_retry(self.FTP_HOST, timeout=None) @@ -337,7 +338,7 @@ def test_ftp_no_timeout(self): @skip_ftp_test_on_travis def test_ftp_timeout(self): - with support.transient_internet(self.FTP_HOST): + with socket_helper.transient_internet(self.FTP_HOST): u = _urlopen_with_retry(self.FTP_HOST, timeout=60) self.addCleanup(u.close) self.assertEqual(u.fp.fp.raw._sock.gettimeout(), 60) diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index 422d529a70074..28680aa6b2405 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -1,5 +1,6 @@ import unittest from test import support +from test.support import socket_helper import contextlib import socket @@ -27,7 +28,7 @@ def testURLread(self): self.addCleanup(urllib.request.urlcleanup) domain = urllib.parse.urlparse(support.TEST_HTTP_URL).netloc - with support.transient_internet(domain): + with socket_helper.transient_internet(domain): f = urllib.request.urlopen(support.TEST_HTTP_URL) f.read() @@ -56,7 +57,7 @@ def setUp(self): @contextlib.contextmanager def urlopen(self, *args, **kwargs): resource = args[0] - with support.transient_internet(resource): + with socket_helper.transient_internet(resource): r = urllib.request.urlopen(*args, **kwargs) try: yield r @@ -98,7 +99,7 @@ def test_geturl(self): def test_getcode(self): # test getcode() with the fancy opener to get 404 error codes URL = self.url + "XXXinvalidXXX" - with support.transient_internet(URL): + with socket_helper.transient_internet(URL): with self.assertWarns(DeprecationWarning): open_url = urllib.request.FancyURLopener().open(URL) try: @@ -156,7 +157,7 @@ def setUp(self): @contextlib.contextmanager def urlretrieve(self, *args, **kwargs): resource = args[0] - with support.transient_internet(resource): + with socket_helper.transient_internet(resource): file_location, info = urllib.request.urlretrieve(*args, **kwargs) try: yield file_location, info From webhook-mailer at python.org Wed Apr 29 05:09:26 2020 From: webhook-mailer at python.org (Anthony Shaw) Date: Wed, 29 Apr 2020 09:09:26 -0000 Subject: [Python-checkins] bpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785) Message-ID: https://github.com/python/cpython/commit/9b64ef3ac7b434065dbff0048b9103999e4b491a commit: 9b64ef3ac7b434065dbff0048b9103999e4b491a branch: master author: Anthony Shaw committer: GitHub date: 2020-04-29T10:09:09+01:00 summary: bpo-40432 Fix MSBuild project for Pegen grammars (#GH-9785) * Update the source path of the pegen target within the Windows regen project. Change the path to Windows path formats. * Use the more reliable SetEnv task for Cpp Projects in MSBuild. files: M PCbuild/regen.vcxproj diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj index 285a8a1b9e49c..c97536f7dd96d 100644 --- a/PCbuild/regen.vcxproj +++ b/PCbuild/regen.vcxproj @@ -168,7 +168,8 @@ - + + From webhook-mailer at python.org Wed Apr 29 05:42:32 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 29 Apr 2020 09:42:32 -0000 Subject: [Python-checkins] [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) (GH-19784) Message-ID: https://github.com/python/cpython/commit/adb1f853482e75e81ae0ae7307318a1051ca46b5 commit: adb1f853482e75e81ae0ae7307318a1051ca46b5 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-29T02:42:05-07:00 summary: [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) (GH-19784) [3.8] bpo-40431: Fix syntax typo in turtledemo (GH-19777) * Addresses a syntax typo that mistakenly used a undefined string prefix due to a missing space. (cherry picked from commit 49f70db83e2c62ad06805927f53f6c3e8f4b798e) Co-authored-by: Miro Hron?ok (cherry picked from commit cc011b5190b63f0be561ddec38fc4cd9e60cbf6a) Co-authored-by: Kyle Stanley files: M Lib/turtledemo/__main__.py diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index 17fe9a75e1c5e..12be5098dad27 100644 --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -272,7 +272,7 @@ def configGUI(self, start, stop, clear, txt="", color="blue"): self.stop_btn.config(state=stop, bg="#d00" if stop == NORMAL else "#fca") self.clear_btn.config(state=clear, - bg="#d00" if clear == NORMAL else"#fca") + bg="#d00" if clear == NORMAL else "#fca") self.output_lbl.config(text=txt, fg=color) def makeLoadDemoMenu(self, master): From webhook-mailer at python.org Wed Apr 29 05:42:32 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 29 Apr 2020 09:42:32 -0000 Subject: [Python-checkins] bpo-40334: refactor and cleanup for the PEG generators (GH-19775) Message-ID: https://github.com/python/cpython/commit/4db245ee9ddbe6c53d375de59a35ff59dea2a8e0 commit: 4db245ee9ddbe6c53d375de59a35ff59dea2a8e0 branch: master author: Pablo Galindo committer: GitHub date: 2020-04-29T10:42:21+01:00 summary: bpo-40334: refactor and cleanup for the PEG generators (GH-19775) files: M Parser/pegen/parse.c M Parser/pegen/pegen.c M Parser/pegen/pegen.h M Tools/peg_generator/Makefile M Tools/peg_generator/pegen/c_generator.py M Tools/peg_generator/pegen/parser_generator.py M Tools/peg_generator/pegen/python_generator.py diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index b26f7327bd273..76dd6d31da05a 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -648,7 +648,7 @@ file_rule(Parser *p) if ( (a = statements_rule(p), 1) && - (endmarker_var = _PyPegen_endmarker_token(p)) + (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) ) { res = Module ( a , NULL , p -> arena ); @@ -712,7 +712,7 @@ eval_rule(Parser *p) && (_loop0_1_var = _loop0_1_rule(p)) && - (endmarker_var = _PyPegen_endmarker_token(p)) + (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) ) { res = Expression ( a , p -> arena ); @@ -846,7 +846,7 @@ statement_newline_rule(Parser *p) if ( (a = compound_stmt_rule(p)) && - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { res = _PyPegen_singleton_seq ( p , a ); @@ -872,7 +872,7 @@ statement_newline_rule(Parser *p) { // NEWLINE void *newline_var; if ( - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -895,7 +895,7 @@ statement_newline_rule(Parser *p) { // $ void *endmarker_var; if ( - (endmarker_var = _PyPegen_endmarker_token(p)) + (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) ) { res = _PyPegen_interactive_exit ( p ); @@ -929,7 +929,7 @@ simple_stmt_rule(Parser *p) && _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 13) && - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { res = _PyPegen_singleton_seq ( p , a ); @@ -951,7 +951,7 @@ simple_stmt_rule(Parser *p) && (opt_var = _PyPegen_expect_token(p, 13), 1) && - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { res = a; @@ -2684,7 +2684,7 @@ for_stmt_rule(Parser *p) void *literal; expr_ty t; if ( - (is_async = _PyPegen_async_token(p), 1) + (is_async = _PyPegen_expect_token(p, ASYNC), 1) && (keyword = _PyPegen_expect_token(p, 517)) && @@ -2751,7 +2751,7 @@ with_stmt_rule(Parser *p) void *literal_1; void *literal_2; if ( - (is_async = _PyPegen_async_token(p), 1) + (is_async = _PyPegen_expect_token(p, ASYNC), 1) && (keyword = _PyPegen_expect_token(p, 519)) && @@ -2790,7 +2790,7 @@ with_stmt_rule(Parser *p) void *keyword; void *literal; if ( - (is_async = _PyPegen_async_token(p), 1) + (is_async = _PyPegen_expect_token(p, ASYNC), 1) && (keyword = _PyPegen_expect_token(p, 519)) && @@ -3263,7 +3263,7 @@ function_def_raw_rule(Parser *p) expr_ty n; void *params; if ( - (is_async = _PyPegen_async_token(p), 1) + (is_async = _PyPegen_expect_token(p, ASYNC), 1) && (keyword = _PyPegen_expect_token(p, 522)) && @@ -4002,13 +4002,13 @@ block_rule(Parser *p) void *indent_var; void *newline_var; if ( - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) && - (indent_var = _PyPegen_indent_token(p)) + (indent_var = _PyPegen_expect_token(p, INDENT)) && (a = statements_rule(p)) && - (dedent_var = _PyPegen_dedent_token(p)) + (dedent_var = _PyPegen_expect_token(p, DEDENT)) ) { res = a; @@ -6754,7 +6754,7 @@ await_primary_rule(Parser *p) expr_ty a; void *await_var; if ( - (await_var = _PyPegen_await_token(p)) + (await_var = _PyPegen_expect_token(p, AWAIT)) && (a = primary_rule(p)) ) @@ -9919,9 +9919,9 @@ invalid_block_rule(Parser *p) { // NEWLINE !INDENT void *newline_var; if ( - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) && - _PyPegen_lookahead(0, _PyPegen_indent_token, p) + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, INDENT) ) { res = RAISE_INDENTATION_ERROR ( "expected an indented block" ); @@ -10036,7 +10036,7 @@ _loop0_1_rule(Parser *p) { // NEWLINE void *newline_var; while ( - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { res = newline_var; @@ -10273,7 +10273,7 @@ _tmp_6_rule(Parser *p) { // ASYNC void *async_var; if ( - (async_var = _PyPegen_async_token(p)) + (async_var = _PyPegen_expect_token(p, ASYNC)) ) { res = async_var; @@ -10345,7 +10345,7 @@ _tmp_8_rule(Parser *p) { // ASYNC void *async_var; if ( - (async_var = _PyPegen_async_token(p)) + (async_var = _PyPegen_expect_token(p, ASYNC)) ) { res = async_var; @@ -10381,7 +10381,7 @@ _tmp_9_rule(Parser *p) { // ASYNC void *async_var; if ( - (async_var = _PyPegen_async_token(p)) + (async_var = _PyPegen_expect_token(p, ASYNC)) ) { res = async_var; @@ -15068,7 +15068,7 @@ _tmp_128_rule(Parser *p) && (f = named_expression_rule(p)) && - (newline_var = _PyPegen_newline_token(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { res = f; @@ -15257,7 +15257,7 @@ _tmp_134_rule(Parser *p) void *keyword_1; void *y; if ( - (y = _PyPegen_async_token(p), 1) + (y = _PyPegen_expect_token(p, ASYNC), 1) && (keyword = _PyPegen_expect_token(p, 517)) && diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 39da2709991b9..942447b0f8fd1 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -692,16 +692,6 @@ _PyPegen_lookahead_with_name(int positive, expr_ty (func)(Parser *), Parser *p) return (res != NULL) == positive; } -int -_PyPegen_lookahead_with_string(int positive, void *(func)(Parser *, const char *), Parser *p, - const char *arg) -{ - int mark = p->mark; - void *res = func(p, arg); - p->mark = mark; - return (res != NULL) == positive; -} - int _PyPegen_lookahead_with_int(int positive, Token *(func)(Parser *, int), Parser *p, int arg) { @@ -751,24 +741,6 @@ _PyPegen_get_last_nonnwhitespace_token(Parser *p) return token; } -void * -_PyPegen_async_token(Parser *p) -{ - return _PyPegen_expect_token(p, ASYNC); -} - -void * -_PyPegen_await_token(Parser *p) -{ - return _PyPegen_expect_token(p, AWAIT); -} - -void * -_PyPegen_endmarker_token(Parser *p) -{ - return _PyPegen_expect_token(p, ENDMARKER); -} - expr_ty _PyPegen_name_token(Parser *p) { @@ -794,24 +766,6 @@ _PyPegen_string_token(Parser *p) return _PyPegen_expect_token(p, STRING); } -void * -_PyPegen_newline_token(Parser *p) -{ - return _PyPegen_expect_token(p, NEWLINE); -} - -void * -_PyPegen_indent_token(Parser *p) -{ - return _PyPegen_expect_token(p, INDENT); -} - -void * -_PyPegen_dedent_token(Parser *p) -{ - return _PyPegen_expect_token(p, DEDENT); -} - static PyObject * parsenumber_raw(const char *s) { diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index 0ac9b317efe59..99ec0f44e6518 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -104,7 +104,6 @@ int _PyPegen_update_memo(Parser *p, int mark, int type, void *node); int _PyPegen_is_memoized(Parser *p, int type, void *pres); int _PyPegen_lookahead_with_name(int, expr_ty (func)(Parser *), Parser *); -int _PyPegen_lookahead_with_string(int, void *(func)(Parser *, const char *), Parser *, const char *); int _PyPegen_lookahead_with_int(int, Token *(func)(Parser *, int), Parser *, int); int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *); diff --git a/Tools/peg_generator/Makefile b/Tools/peg_generator/Makefile index a37cbfcaa8551..c1219b9263851 100644 --- a/Tools/peg_generator/Makefile +++ b/Tools/peg_generator/Makefile @@ -33,7 +33,7 @@ dump: peg_extension/parse.c $(PYTHON) -c "from peg_extension import parse; import ast; t = parse.parse_file('$(TESTFILE)', mode=1); print(ast.dump(t))" regen-metaparser: pegen/metagrammar.gram pegen/*.py - $(PYTHON) -m pegen -q -c pegen/metagrammar.gram -o pegen/grammar_parser.py + $(PYTHON) -m pegen -q python pegen/metagrammar.gram -o pegen/grammar_parser.py # Note: These targets really depend on the generated shared object in peg_extension/parse.*.so but # this has different names in different systems so we are abusing the implicit dependency on diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py index a01c3097c365b..a59da2ffae8e1 100644 --- a/Tools/peg_generator/pegen/c_generator.py +++ b/Tools/peg_generator/pegen/c_generator.py @@ -1,33 +1,36 @@ import ast +from dataclasses import dataclass, field import re -from typing import Any, cast, Dict, IO, Optional, List, Text, Tuple, Set +from typing import IO, Any, Dict, List, Optional, Set, Text, Tuple +from enum import Enum +from pegen import grammar from pegen.grammar import ( + Alt, Cut, + Gather, GrammarVisitor, - Rhs, - Alt, + Group, + Lookahead, NamedItem, NameLeaf, - StringLeaf, - Lookahead, - PositiveLookahead, NegativeLookahead, Opt, + PositiveLookahead, Repeat0, Repeat1, - Gather, - Group, + Rhs, Rule, + StringLeaf, ) -from pegen import grammar -from pegen.parser_generator import dedupe, ParserGenerator +from pegen.parser_generator import ParserGenerator EXTENSION_PREFIX = """\ #include "pegen.h" """ + EXTENSION_SUFFIX = """ void * _PyPegen_parse(Parser *p) @@ -41,6 +44,43 @@ """ +class NodeTypes(Enum): + NAME_TOKEN = 0 + NUMBER_TOKEN = 1 + STRING_TOKEN = 2 + GENERIC_TOKEN = 3 + KEYWORD = 4 + CUT_OPERATOR = 5 + + +BASE_NODETYPES = { + "NAME": NodeTypes.NAME_TOKEN, + "NUMBER": NodeTypes.NUMBER_TOKEN, + "STRING": NodeTypes.STRING_TOKEN, +} + + + at dataclass +class FunctionCall: + function: str + arguments: Optional[List[Any]] = None + assigned_variable: Optional[str] = None + nodetype: Optional[NodeTypes] = None + force_true: bool = False + metadata: Dict[str, Any] = field(default_factory=dict) + + def __str__(self) -> str: + parts = [] + parts.append(self.function) + if self.arguments: + parts.append(f"({', '.join(map(str, self.arguments))})") + if self.force_true: + parts.append(", 1") + if self.assigned_variable: + parts = ["(", self.assigned_variable, " = ", *parts, ")"] + return "".join(parts) + + class CCallMakerVisitor(GrammarVisitor): def __init__( self, @@ -54,28 +94,57 @@ def __init__( self.cache: Dict[Any, Any] = {} self.keyword_cache: Dict[str, int] = {} - def keyword_helper(self, keyword: str) -> Tuple[str, str]: + def keyword_helper(self, keyword: str) -> FunctionCall: if keyword not in self.keyword_cache: self.keyword_cache[keyword] = self.gen.keyword_type() - return "keyword", f"_PyPegen_expect_token(p, {self.keyword_cache[keyword]})" + return FunctionCall( + assigned_variable="keyword", + function="_PyPegen_expect_token", + arguments=["p", self.keyword_cache[keyword]], + nodetype=NodeTypes.KEYWORD, + ) - def visit_NameLeaf(self, node: NameLeaf) -> Tuple[str, str]: + def visit_NameLeaf(self, node: NameLeaf) -> FunctionCall: name = node.value if name in self.non_exact_tokens: - name = name.lower() - return f"{name}_var", f"_PyPegen_{name}_token(p)" - return f"{name}_var", f"{name}_rule(p)" + if name in BASE_NODETYPES: + return FunctionCall( + assigned_variable=f"{name.lower()}_var", + function=f"_PyPegen_{name.lower()}_token", + arguments=["p"], + nodetype=BASE_NODETYPES[name], + metadata={"rulename": name.lower()}, + ) + return FunctionCall( + assigned_variable=f"{name.lower()}_var", + function=f"_PyPegen_expect_token", + arguments=["p", name], + nodetype=NodeTypes.GENERIC_TOKEN, + metadata={"rulename": name.lower()}, + ) + + return FunctionCall( + assigned_variable=f"{name}_var", + function=f"{name}_rule", + arguments=["p"], + metadata={"rulename": name.lower()}, + ) - def visit_StringLeaf(self, node: StringLeaf) -> Tuple[str, str]: + def visit_StringLeaf(self, node: StringLeaf) -> FunctionCall: val = ast.literal_eval(node.value) if re.match(r"[a-zA-Z_]\w*\Z", val): # This is a keyword return self.keyword_helper(val) else: assert val in self.exact_tokens, f"{node.value} is not a known literal" type = self.exact_tokens[val] - return "literal", f"_PyPegen_expect_token(p, {type})" + return FunctionCall( + assigned_variable="literal", + function=f"_PyPegen_expect_token", + arguments=["p", type], + nodetype=NodeTypes.GENERIC_TOKEN, + ) - def visit_Rhs(self, node: Rhs) -> Tuple[Optional[str], str]: + def visit_Rhs(self, node: Rhs) -> FunctionCall: def can_we_inline(node: Rhs) -> int: if len(node.alts) != 1 or len(node.alts[0].items) != 1: return False @@ -90,65 +159,96 @@ def can_we_inline(node: Rhs) -> int: self.cache[node] = self.visit(node.alts[0].items[0]) else: name = self.gen.name_node(node) - self.cache[node] = f"{name}_var", f"{name}_rule(p)" + self.cache[node] = FunctionCall( + assigned_variable=f"{name}_var", + function=f"{name}_rule", + arguments=["p"], + metadata={"rulename": name}, + ) return self.cache[node] - def visit_NamedItem(self, node: NamedItem) -> Tuple[Optional[str], str]: - name, call = self.visit(node.item) + def visit_NamedItem(self, node: NamedItem) -> FunctionCall: + call = self.visit(node.item) if node.name: - name = node.name - return name, call - - def lookahead_call_helper(self, node: Lookahead, positive: int) -> Tuple[None, str]: - name, call = self.visit(node.node) - func, args = call.split("(", 1) - assert args[-1] == ")" - args = args[:-1] - if "name_token" in call: - return None, f"_PyPegen_lookahead_with_name({positive}, {func}, {args})" - elif not args.startswith("p,"): - return None, f"_PyPegen_lookahead({positive}, {func}, {args})" - elif args[2:].strip().isalnum(): - return None, f"_PyPegen_lookahead_with_int({positive}, {func}, {args})" + call.assigned_variable = node.name + return call + + def lookahead_call_helper(self, node: Lookahead, positive: int) -> FunctionCall: + call = self.visit(node.node) + if call.nodetype == NodeTypes.NAME_TOKEN: + return FunctionCall( + function=f"_PyPegen_lookahead_with_name", + arguments=[positive, call.function, *call.arguments], + ) + elif call.nodetype in {NodeTypes.GENERIC_TOKEN, NodeTypes.KEYWORD}: + return FunctionCall( + function=f"_PyPegen_lookahead_with_int", + arguments=[positive, call.function, *call.arguments], + ) else: - return None, f"_PyPegen_lookahead_with_string({positive}, {func}, {args})" + return FunctionCall( + function=f"_PyPegen_lookahead", + arguments=[positive, call.function, *call.arguments], + ) - def visit_PositiveLookahead(self, node: PositiveLookahead) -> Tuple[None, str]: + def visit_PositiveLookahead(self, node: PositiveLookahead) -> FunctionCall: return self.lookahead_call_helper(node, 1) - def visit_NegativeLookahead(self, node: NegativeLookahead) -> Tuple[None, str]: + def visit_NegativeLookahead(self, node: NegativeLookahead) -> FunctionCall: return self.lookahead_call_helper(node, 0) - def visit_Opt(self, node: Opt) -> Tuple[str, str]: - name, call = self.visit(node.node) - return "opt_var", f"{call}, 1" # Using comma operator! + def visit_Opt(self, node: Opt) -> FunctionCall: + call = self.visit(node.node) + return FunctionCall( + assigned_variable="opt_var", + function=call.function, + arguments=call.arguments, + force_true=True, + ) - def visit_Repeat0(self, node: Repeat0) -> Tuple[str, str]: + def visit_Repeat0(self, node: Repeat0) -> FunctionCall: if node in self.cache: return self.cache[node] name = self.gen.name_loop(node.node, False) - self.cache[node] = f"{name}_var", f"{name}_rule(p)" + self.cache[node] = FunctionCall( + assigned_variable=f"{name}_var", + function=f"{name}_rule", + arguments=["p"], + metadata={"rulename": name}, + ) return self.cache[node] - def visit_Repeat1(self, node: Repeat1) -> Tuple[str, str]: + def visit_Repeat1(self, node: Repeat1) -> FunctionCall: if node in self.cache: return self.cache[node] name = self.gen.name_loop(node.node, True) - self.cache[node] = f"{name}_var", f"{name}_rule(p)" + self.cache[node] = FunctionCall( + assigned_variable=f"{name}_var", + function=f"{name}_rule", + arguments=["p"], + metadata={"rulename": name}, + ) return self.cache[node] - def visit_Gather(self, node: Gather) -> Tuple[str, str]: + def visit_Gather(self, node: Gather) -> FunctionCall: if node in self.cache: return self.cache[node] name = self.gen.name_gather(node) - self.cache[node] = f"{name}_var", f"{name}_rule(p)" + self.cache[node] = FunctionCall( + assigned_variable=f"{name}_var", + function=f"{name}_rule", + arguments=["p"], + metadata={"rulename": name}, + ) return self.cache[node] - def visit_Group(self, node: Group) -> Tuple[Optional[str], str]: + def visit_Group(self, node: Group) -> FunctionCall: return self.visit(node.rhs) - def visit_Cut(self, node: Cut) -> Tuple[str, str]: - return "cut_var", "1" + def visit_Cut(self, node: Cut) -> FunctionCall: + return FunctionCall( + assigned_variable="cut_var", function="1", nodetype=NodeTypes.CUT_OPERATOR + ) class CParserGenerator(ParserGenerator, GrammarVisitor): @@ -252,7 +352,6 @@ def generate(self, filename: str) -> None: mode += 1 modulename = self.grammar.metas.get("modulename", "parse") trailer = self.grammar.metas.get("trailer", EXTENSION_SUFFIX) - keyword_cache = self.callmakervisitor.keyword_cache if trailer: self.print(trailer.rstrip("\n") % dict(mode=mode, modulename=modulename)) @@ -448,13 +547,11 @@ def visit_Rule(self, node: Rule) -> None: self._handle_default_rule_body(node, rhs, result_type) self.print("}") - def visit_NamedItem(self, node: NamedItem, names: List[str]) -> None: - name, call = self.callmakervisitor.visit(node) - if not name: - self.print(call) - else: - name = dedupe(name, names) - self.print(f"({name} = {call})") + def visit_NamedItem(self, node: NamedItem) -> None: + call = self.callmakervisitor.visit(node) + if call.assigned_variable: + call.assigned_variable = self.dedupe(call.assigned_variable) + self.print(call) def visit_Rhs( self, node: Rhs, is_loop: bool, is_gather: bool, rulename: Optional[str] @@ -464,7 +561,7 @@ def visit_Rhs( for alt in node.alts: self.visit(alt, is_loop=is_loop, is_gather=is_gather, rulename=rulename) - def join_conditions(self, keyword: str, node: Any, names: List[str]) -> None: + def join_conditions(self, keyword: str, node: Any) -> None: self.print(f"{keyword} (") with self.indent(): first = True @@ -473,7 +570,7 @@ def join_conditions(self, keyword: str, node: Any, names: List[str]) -> None: first = False else: self.print("&&") - self.visit(item, names=names) + self.visit(item) self.print(")") def emit_action(self, node: Alt, cleanup_code: Optional[str] = None) -> None: @@ -492,29 +589,34 @@ def emit_action(self, node: Alt, cleanup_code: Optional[str] = None) -> None: f'fprintf(stderr, "Hit with action [%d-%d]: %s\\n", mark, p->mark, "{node}");' ) - def emit_default_action(self, is_gather: bool, names: List[str], node: Alt) -> None: - if len(names) > 1: + def emit_default_action(self, is_gather: bool, node: Alt) -> None: + if len(self.local_variable_names) > 1: if is_gather: - assert len(names) == 2 - self.print(f"res = _PyPegen_seq_insert_in_front(p, {names[0]}, {names[1]});") + assert len(self.local_variable_names) == 2 + self.print( + f"res = _PyPegen_seq_insert_in_front(p, " + f"{self.local_variable_names[0]}, {self.local_variable_names[1]});" + ) else: if self.debug: self.print( f'fprintf(stderr, "Hit without action [%d:%d]: %s\\n", mark, p->mark, "{node}");' ) - self.print(f"res = _PyPegen_dummy_name(p, {', '.join(names)});") + self.print( + f"res = _PyPegen_dummy_name(p, {', '.join(self.local_variable_names)});" + ) else: if self.debug: self.print( f'fprintf(stderr, "Hit with default action [%d:%d]: %s\\n", mark, p->mark, "{node}");' ) - self.print(f"res = {names[0]};") + self.print(f"res = {self.local_variable_names[0]};") def emit_dummy_action(self) -> None: self.print(f"res = _PyPegen_dummy_name(p);") - def handle_alt_normal(self, node: Alt, is_gather: bool, names: List[str]) -> None: - self.join_conditions(keyword="if", node=node, names=names) + def handle_alt_normal(self, node: Alt, is_gather: bool) -> None: + self.join_conditions(keyword="if", node=node) self.print("{") # We have parsed successfully all the conditions for the option. with self.indent(): @@ -526,17 +628,15 @@ def handle_alt_normal(self, node: Alt, is_gather: bool, names: List[str]) -> Non elif node.action: self.emit_action(node) else: - self.emit_default_action(is_gather, names, node) + self.emit_default_action(is_gather, node) # As the current option has parsed correctly, do not continue with the rest. self.print(f"goto done;") self.print("}") - def handle_alt_loop( - self, node: Alt, is_gather: bool, rulename: Optional[str], names: List[str] - ) -> None: + def handle_alt_loop(self, node: Alt, is_gather: bool, rulename: Optional[str]) -> None: # Condition of the main body of the alternative - self.join_conditions(keyword="while", node=node, names=names) + self.join_conditions(keyword="while", node=node) self.print("{") # We have parsed successfully one item! with self.indent(): @@ -548,7 +648,7 @@ def handle_alt_loop( elif node.action: self.emit_action(node, cleanup_code="PyMem_Free(children);") else: - self.emit_default_action(is_gather, names, node) + self.emit_default_action(is_gather, node) # Add the result of rule to the temporary buffer of children. This buffer # will populate later an asdl_seq with all elements to return. @@ -580,47 +680,45 @@ def visit_Alt( if v == "opt_var": self.print("UNUSED(opt_var); // Silence compiler warnings") - names: List[str] = [] - if is_loop: - self.handle_alt_loop(node, is_gather, rulename, names) - else: - self.handle_alt_normal(node, is_gather, names) + with self.local_variable_context(): + if is_loop: + self.handle_alt_loop(node, is_gather, rulename) + else: + self.handle_alt_normal(node, is_gather) self.print("p->mark = mark;") - if "cut_var" in names: + if "cut_var" in vars: self.print("if (cut_var) return NULL;") self.print("}") - def collect_vars(self, node: Alt) -> Dict[str, Optional[str]]: - names: List[str] = [] + def collect_vars(self, node: Alt) -> Dict[Optional[str], Optional[str]]: types = {} - for item in node.items: - name, type = self.add_var(item, names) - types[name] = type + with self.local_variable_context(): + for item in node.items: + name, type = self.add_var(item) + types[name] = type return types - def add_var(self, node: NamedItem, names: List[str]) -> Tuple[str, Optional[str]]: - name: str - call: str - name, call = self.callmakervisitor.visit(node.item) - type = None - if not name: - return name, type - if name.startswith("cut"): - return name, "int" - if name.endswith("_var"): - rulename = name[:-4] - rule = self.rules.get(rulename) - if rule is not None: - if rule.is_loop() or rule.is_gather(): - type = "asdl_seq *" - else: - type = rule.type - elif name.startswith("_loop") or name.startswith("_gather"): + def add_var(self, node: NamedItem) -> Tuple[Optional[str], Optional[str]]: + call = self.callmakervisitor.visit(node.item) + if not call.assigned_variable: + return None, None + if call.nodetype == NodeTypes.CUT_OPERATOR: + return call.assigned_variable, "int" + + name = call.assigned_variable + rulename = call.metadata.get("rulename") + + type: Optional[str] = None + + assert self.all_rules is not None + if rulename and rulename in self.all_rules: + rule = self.all_rules.get(rulename) + if rule.is_loop() or rule.is_gather(): type = "asdl_seq *" - elif name in ("name_var", "string_var", "number_var"): - type = "expr_ty" - if node.name: - name = node.name - name = dedupe(name, names) - return name, type + else: + type = rule.type + elif call.nodetype in BASE_NODETYPES.values(): + type = "expr_ty" + + return self.dedupe(node.name if node.name else call.assigned_variable), type diff --git a/Tools/peg_generator/pegen/parser_generator.py b/Tools/peg_generator/pegen/parser_generator.py index 7851a7c90f4d5..3f6cdbe409d56 100644 --- a/Tools/peg_generator/pegen/parser_generator.py +++ b/Tools/peg_generator/pegen/parser_generator.py @@ -13,7 +13,6 @@ NamedItem, Plain, NameLeaf, - StringLeaf, Gather, ) from pegen.grammar import GrammarError, GrammarVisitor @@ -48,6 +47,18 @@ def __init__(self, grammar: Grammar, file: Optional[IO[Text]]): self.todo = self.rules.copy() # Rules to generate self.counter = 0 # For name_rule()/name_loop() self.keyword_counter = 499 # For keyword_type() + self.all_rules: Optional[Dict[str, Rule]] = None # Rules + temporal rules + self._local_variable_stack: List[List[str]] = [] + + @contextlib.contextmanager + def local_variable_context(self) -> Iterator[None]: + self._local_variable_stack.append([]) + yield + self._local_variable_stack.pop() + + @property + def local_variable_names(self) -> List[str]: + return self._local_variable_stack[-1] @abstractmethod def generate(self, filename: str) -> None: @@ -82,6 +93,7 @@ def collect_todo(self) -> None: for rulename in todo: self.todo[rulename].collect_todo(self) done = set(alltodo) + self.all_rules = self.todo.copy() def keyword_type(self) -> int: self.keyword_counter += 1 @@ -109,26 +121,23 @@ def name_gather(self, node: Gather) -> str: self.counter += 1 extra_function_name = f"_loop0_{self.counter}" extra_function_alt = Alt( - [NamedItem(None, node.separator), NamedItem("elem", node.node),], action="elem", + [NamedItem(None, node.separator), NamedItem("elem", node.node)], action="elem", ) self.todo[extra_function_name] = Rule( extra_function_name, None, Rhs([extra_function_alt]), ) - alt = Alt( - [NamedItem("elem", node.node), NamedItem("seq", NameLeaf(extra_function_name)),], - ) + alt = Alt([NamedItem("elem", node.node), NamedItem("seq", NameLeaf(extra_function_name))],) self.todo[name] = Rule(name, None, Rhs([alt]),) return name - -def dedupe(name: str, names: List[str]) -> str: - origname = name - counter = 0 - while name in names: - counter += 1 - name = f"{origname}_{counter}" - names.append(name) - return name + def dedupe(self, name: str) -> str: + origname = name + counter = 0 + while name in self.local_variable_names: + counter += 1 + name = f"{origname}_{counter}" + self.local_variable_names.append(name) + return name def compute_nullables(rules: Dict[str, Rule]) -> None: @@ -153,13 +162,13 @@ def compute_left_recursives( leaders = set(scc) for start in scc: for cycle in sccutils.find_cycles_in_scc(graph, scc, start): - ## print("Cycle:", " -> ".join(cycle)) + # print("Cycle:", " -> ".join(cycle)) leaders -= scc - set(cycle) if not leaders: raise ValueError( f"SCC {scc} has no leadership candidate (no element is included in all cycles)" ) - ## print("Leaders:", leaders) + # print("Leaders:", leaders) leader = min(leaders) # Pick an arbitrary leader from the candidates. rules[leader].leader = True else: diff --git a/Tools/peg_generator/pegen/python_generator.py b/Tools/peg_generator/pegen/python_generator.py index b2891885f957e..bde27890c15a6 100644 --- a/Tools/peg_generator/pegen/python_generator.py +++ b/Tools/peg_generator/pegen/python_generator.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Optional, IO, Text, Tuple +from typing import Any, Dict, Optional, IO, Text, Tuple from pegen.grammar import ( Cut, @@ -19,7 +19,7 @@ Alt, ) from pegen import grammar -from pegen.parser_generator import dedupe, ParserGenerator +from pegen.parser_generator import ParserGenerator MODULE_PREFIX = """\ #!/usr/bin/env python3.8 @@ -173,7 +173,7 @@ def visit_Rule(self, node: Rule) -> None: else: self.print("return None") - def visit_NamedItem(self, node: NamedItem, names: List[str]) -> None: + def visit_NamedItem(self, node: NamedItem) -> None: name, call = self.callmakervisitor.visit(node.item) if node.name: name = node.name @@ -181,7 +181,7 @@ def visit_NamedItem(self, node: NamedItem, names: List[str]) -> None: self.print(call) else: if name != "cut": - name = dedupe(name, names) + name = self.dedupe(name) self.print(f"({name} := {call})") def visit_Rhs(self, node: Rhs, is_loop: bool = False, is_gather: bool = False) -> None: @@ -191,34 +191,36 @@ def visit_Rhs(self, node: Rhs, is_loop: bool = False, is_gather: bool = False) - self.visit(alt, is_loop=is_loop, is_gather=is_gather) def visit_Alt(self, node: Alt, is_loop: bool, is_gather: bool) -> None: - names: List[str] = [] - self.print("cut = False") # TODO: Only if needed. - if is_loop: - self.print("while (") - else: - self.print("if (") - with self.indent(): - first = True - for item in node.items: - if first: - first = False - else: - self.print("and") - self.visit(item, names=names) - self.print("):") - with self.indent(): - action = node.action - if not action: - if is_gather: - assert len(names) == 2 - action = f"[{names[0]}] + {names[1]}" - else: - action = f"[{', '.join(names)}]" + with self.local_variable_context(): + self.print("cut = False") # TODO: Only if needed. if is_loop: - self.print(f"children.append({action})") - self.print(f"mark = self.mark()") + self.print("while (") else: - self.print(f"return {action}") - self.print("self.reset(mark)") - # Skip remaining alternatives if a cut was reached. - self.print("if cut: return None") # TODO: Only if needed. + self.print("if (") + with self.indent(): + first = True + for item in node.items: + if first: + first = False + else: + self.print("and") + self.visit(item) + self.print("):") + with self.indent(): + action = node.action + if not action: + if is_gather: + assert len(self.local_variable_names) == 2 + action = ( + f"[{self.local_variable_names[0]}] + {self.local_variable_names[1]}" + ) + else: + action = f"[{', '.join(self.local_variable_names)}]" + if is_loop: + self.print(f"children.append({action})") + self.print(f"mark = self.mark()") + else: + self.print(f"return {action}") + self.print("self.reset(mark)") + # Skip remaining alternatives if a cut was reached. + self.print("if cut: return None") # TODO: Only if needed. From webhook-mailer at python.org Wed Apr 29 07:32:41 2020 From: webhook-mailer at python.org (Pablo Galindo) Date: Wed, 29 Apr 2020 11:32:41 -0000 Subject: [Python-checkins] Add missing sys import to socket_helper.py (GH-19791) Message-ID: https://github.com/python/cpython/commit/5089bcd33f5a10769cea7fd532b5d890859bf01d commit: 5089bcd33f5a10769cea7fd532b5d890859bf01d branch: master author: Pablo Galindo committer: GitHub date: 2020-04-29T12:32:31+01:00 summary: Add missing sys import to socket_helper.py (GH-19791) files: M Lib/test/support/socket_helper.py diff --git a/Lib/test/support/socket_helper.py b/Lib/test/support/socket_helper.py index b09c248cfccdf..0ac8445562926 100644 --- a/Lib/test/support/socket_helper.py +++ b/Lib/test/support/socket_helper.py @@ -2,6 +2,7 @@ import errno import socket import unittest +import sys from .. import support From webhook-mailer at python.org Wed Apr 29 10:56:35 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 14:56:35 -0000 Subject: [Python-checkins] bpo-40428: Cleanup free list part of C API Changes doc (GH-19793) Message-ID: https://github.com/python/cpython/commit/9a8c1315c3041fdb85d091bb8dc92f0d9dcb1529 commit: 9a8c1315c3041fdb85d091bb8dc92f0d9dcb1529 branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T16:56:30+02:00 summary: bpo-40428: Cleanup free list part of C API Changes doc (GH-19793) files: M Doc/whatsnew/3.9.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 0edb11419c43c..f4edc6225c16d 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -570,14 +570,6 @@ Build and C API Changes ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API). (Contributed by Victor Stinner in :issue:`38835`.) -* Remove ``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()`` - functions: the free lists of bound method objects have been removed. - (Contributed by Inada Naoki and Victor Stinner in :issue:`37340`.) - -* Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free list has been - removed in Python 3.3. - (Contributed by Victor Stinner in :issue:`38896`.) - * The ``tp_print`` slot of :ref:`PyTypeObject ` has been removed. It was used for printing objects to files in Python 2.7 and before. Since Python 3.0, it has been ignored and unused. @@ -674,8 +666,9 @@ Build and C API Changes :issue:`40241`.) * Remove the following functions from the C API. Call :c:func:`PyGC_Collect` - explicitly to free all free lists. - (Contributed by Victor Stinner in :issue:`40428`.) + explicitly to clear all free lists. + (Contributed by Inada Naoki and Victor Stinner in :issue:`37340`, + :issue:`38896` and :issue:`40428`.) * ``PyAsyncGen_ClearFreeLists()`` * ``PyContext_ClearFreeList()`` @@ -683,8 +676,13 @@ Build and C API Changes * ``PyFloat_ClearFreeList()`` * ``PyFrame_ClearFreeList()`` * ``PyList_ClearFreeList()`` - * ``PySet_ClearFreeList()`` + * ``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: + the free lists of bound method objects have been removed. + * ``PySet_ClearFreeList()``: the set free list has been removed + in Python 3.4. * ``PyTuple_ClearFreeList()`` + * ``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in + Python 3.3. Deprecated From webhook-mailer at python.org Wed Apr 29 11:11:52 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 15:11:52 -0000 Subject: [Python-checkins] bpo-40436: Fix code parsing gdb version (GH-19792) Message-ID: https://github.com/python/cpython/commit/ec9bea4a3766bd815148a27f61eb24e7dd459ac7 commit: ec9bea4a3766bd815148a27f61eb24e7dd459ac7 branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T17:11:48+02:00 summary: bpo-40436: Fix code parsing gdb version (GH-19792) test_gdb and test.pythoninfo now check gdb command exit code. files: A Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst M Lib/test/pythoninfo.py M Lib/test/test_gdb.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index cc230dd2297a0..cc0bbc5fe3e77 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -376,6 +376,9 @@ def collect_gdb(info_add): stderr=subprocess.PIPE, universal_newlines=True) version = proc.communicate()[0] + if proc.returncode: + # ignore gdb failure: test_gdb will log the error + return except OSError: return diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index fb1480145a7e1..210cd0d3787a8 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -17,12 +17,18 @@ def get_gdb_version(): try: - proc = subprocess.Popen(["gdb", "-nx", "--version"], + cmd = ["gdb", "-nx", "--version"] + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) with proc: - version = proc.communicate()[0] + version, stderr = proc.communicate() + + if proc.returncode: + raise Exception(f"Command {' '.join(cmd)!r} failed " + f"with exit code {proc.returncode}: " + f"stdout={version!r} stderr={stderr!r}") except OSError: # This is what "no gdb" looks like. There may, however, be other # errors that manifest this way too. diff --git a/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst new file mode 100644 index 0000000000000..0aee2c3aa2b4d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst @@ -0,0 +1 @@ +test_gdb and test.pythoninfo now check gdb command exit code. From webhook-mailer at python.org Wed Apr 29 11:30:10 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 29 Apr 2020 15:30:10 -0000 Subject: [Python-checkins] bpo-40436: Fix code parsing gdb version (GH-19792) Message-ID: https://github.com/python/cpython/commit/d9e904919197a22b95946f11ba5f24b796088c06 commit: d9e904919197a22b95946f11ba5f24b796088c06 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-29T08:30:01-07:00 summary: bpo-40436: Fix code parsing gdb version (GH-19792) test_gdb and test.pythoninfo now check gdb command exit code. (cherry picked from commit ec9bea4a3766bd815148a27f61eb24e7dd459ac7) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst M Lib/test/pythoninfo.py M Lib/test/test_gdb.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 797b3af7d3085..9f3e79fb784db 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -371,6 +371,9 @@ def collect_gdb(info_add): stderr=subprocess.PIPE, universal_newlines=True) version = proc.communicate()[0] + if proc.returncode: + # ignore gdb failure: test_gdb will log the error + return except OSError: return diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index bd9a5cbe9c0a8..f043c9256e02f 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -17,12 +17,18 @@ def get_gdb_version(): try: - proc = subprocess.Popen(["gdb", "-nx", "--version"], + cmd = ["gdb", "-nx", "--version"] + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) with proc: - version = proc.communicate()[0] + version, stderr = proc.communicate() + + if proc.returncode: + raise Exception(f"Command {' '.join(cmd)!r} failed " + f"with exit code {proc.returncode}: " + f"stdout={version!r} stderr={stderr!r}") except OSError: # This is what "no gdb" looks like. There may, however, be other # errors that manifest this way too. diff --git a/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst new file mode 100644 index 0000000000000..0aee2c3aa2b4d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst @@ -0,0 +1 @@ +test_gdb and test.pythoninfo now check gdb command exit code. From webhook-mailer at python.org Wed Apr 29 11:30:58 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Wed, 29 Apr 2020 15:30:58 -0000 Subject: [Python-checkins] bpo-40436: Fix code parsing gdb version (GH-19792) Message-ID: https://github.com/python/cpython/commit/beba1a808000d5fc445cb28eab96bdb4cdb7c959 commit: beba1a808000d5fc445cb28eab96bdb4cdb7c959 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-29T08:30:46-07:00 summary: bpo-40436: Fix code parsing gdb version (GH-19792) test_gdb and test.pythoninfo now check gdb command exit code. (cherry picked from commit ec9bea4a3766bd815148a27f61eb24e7dd459ac7) Co-authored-by: Victor Stinner files: A Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst M Lib/test/pythoninfo.py M Lib/test/test_gdb.py diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 9a9d26dca490c..d16ad67cdc154 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -340,6 +340,9 @@ def collect_gdb(info_add): stderr=subprocess.PIPE, universal_newlines=True) version = proc.communicate()[0] + if proc.returncode: + # ignore gdb failure: test_gdb will log the error + return except OSError: return diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py index 0131e4d0b0f72..fe603be2bbcd9 100644 --- a/Lib/test/test_gdb.py +++ b/Lib/test/test_gdb.py @@ -18,12 +18,18 @@ def get_gdb_version(): try: - proc = subprocess.Popen(["gdb", "-nx", "--version"], + cmd = ["gdb", "-nx", "--version"] + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) with proc: - version = proc.communicate()[0] + version, stderr = proc.communicate() + + if proc.returncode: + raise Exception(f"Command {' '.join(cmd)!r} failed " + f"with exit code {proc.returncode}: " + f"stdout={version!r} stderr={stderr!r}") except OSError: # This is what "no gdb" looks like. There may, however, be other # errors that manifest this way too. diff --git a/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst new file mode 100644 index 0000000000000..0aee2c3aa2b4d --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst @@ -0,0 +1 @@ +test_gdb and test.pythoninfo now check gdb command exit code. From webhook-mailer at python.org Wed Apr 29 11:49:50 2020 From: webhook-mailer at python.org (Mark Shannon) Date: Wed, 29 Apr 2020 15:49:50 -0000 Subject: [Python-checkins] bpo-40228: More robust frame.setlineno. (GH-19437) Message-ID: https://github.com/python/cpython/commit/57697245e1deafdedf68e5f21ad8890be591efc0 commit: 57697245e1deafdedf68e5f21ad8890be591efc0 branch: master author: Mark Shannon committer: GitHub date: 2020-04-29T16:49:45+01:00 summary: bpo-40228: More robust frame.setlineno. (GH-19437) More robust frame.setlineno. Makes no assumptions about source->bytecode translation. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-08-17-02-35.bpo-40228.bRaaJ-.rst M Lib/test/test_sys_settrace.py M Objects/frameobject.c diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index bead57c44b47e..482e918acac57 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -948,8 +948,8 @@ def test_jump_in_nested_finally_3(output): output.append(11) output.append(12) - @jump_test(5, 11, [2, 4, 12]) - def test_jump_over_return_try_finally_in_finally_block(output): + @jump_test(5, 11, [2, 4], (ValueError, 'unreachable')) + def test_no_jump_over_return_try_finally_in_finally_block(output): try: output.append(2) finally: @@ -963,8 +963,8 @@ def test_jump_over_return_try_finally_in_finally_block(output): pass output.append(12) - @jump_test(3, 4, [1, 4]) - def test_jump_infinite_while_loop(output): + @jump_test(3, 4, [1], (ValueError, 'unreachable')) + def test_no_jump_infinite_while_loop(output): output.append(1) while True: output.append(3) @@ -1357,16 +1357,16 @@ def test_no_jump_between_except_blocks_2(output): output.append(7) output.append(8) - @jump_test(1, 5, [], (ValueError, "into a 'finally'")) - def test_no_jump_into_finally_block(output): + @jump_test(1, 5, [5]) + def test_jump_into_finally_block(output): output.append(1) try: output.append(3) finally: output.append(5) - @jump_test(3, 6, [2, 5, 6], (ValueError, "into a 'finally'")) - def test_no_jump_into_finally_block_from_try_block(output): + @jump_test(3, 6, [2, 6, 7]) + def test_jump_into_finally_block_from_try_block(output): try: output.append(2) output.append(3) @@ -1375,8 +1375,8 @@ def test_no_jump_into_finally_block_from_try_block(output): output.append(6) output.append(7) - @jump_test(5, 1, [1, 3], (ValueError, "out of a 'finally'")) - def test_no_jump_out_of_finally_block(output): + @jump_test(5, 1, [1, 3, 1, 3, 5]) + def test_jump_out_of_finally_block(output): output.append(1) try: output.append(3) @@ -1441,23 +1441,23 @@ def test_no_jump_out_of_qualified_except_block(output): output.append(6) output.append(7) - @jump_test(3, 5, [1, 2, -2], (ValueError, 'into')) - def test_no_jump_between_with_blocks(output): + @jump_test(3, 5, [1, 2, 5, -2]) + def test_jump_between_with_blocks(output): output.append(1) with tracecontext(output, 2): output.append(3) with tracecontext(output, 4): output.append(5) - @async_jump_test(3, 5, [1, 2, -2], (ValueError, 'into')) - async def test_no_jump_between_async_with_blocks(output): + @async_jump_test(3, 5, [1, 2, 5, -2]) + async def test_jump_between_async_with_blocks(output): output.append(1) async with asynctracecontext(output, 2): output.append(3) async with asynctracecontext(output, 4): output.append(5) - @jump_test(5, 7, [2, 4], (ValueError, 'finally')) + @jump_test(5, 7, [2, 4], (ValueError, "unreachable")) def test_no_jump_over_return_out_of_finally_block(output): try: output.append(2) @@ -1551,9 +1551,8 @@ def test_no_jump_from_exception_event(output): output.append(1) 1 / 0 - @jump_test(3, 2, [2], event='return', error=(ValueError, - "can't jump from a 'yield' statement")) - def test_no_jump_from_yield(output): + @jump_test(3, 2, [2, 5], event='return') + def test_jump_from_yield(output): def gen(): output.append(2) yield 3 diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-08-17-02-35.bpo-40228.bRaaJ-.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-08-17-02-35.bpo-40228.bRaaJ-.rst new file mode 100644 index 0000000000000..2a08cfd253925 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-08-17-02-35.bpo-40228.bRaaJ-.rst @@ -0,0 +1 @@ +Setting frame.f_lineno is now robust w.r.t. changes in the source-to-bytecode compiler diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 451c895a77c6b..4f5054d32bb01 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -69,263 +69,223 @@ get_arg(const _Py_CODEUNIT *codestr, Py_ssize_t i) return oparg; } -typedef struct _codetracker { - unsigned char *code; - Py_ssize_t code_len; - unsigned char *lnotab; - Py_ssize_t lnotab_len; - int start_line; - int offset; - int line; - int addr; - int line_addr; -} codetracker; - -/* Reset the mutable parts of the tracker */ -static void -reset(codetracker *tracker) -{ - tracker->offset = 0; - tracker->addr = 0; - tracker->line_addr = 0; - tracker->line = tracker->start_line; -} +typedef enum kind { + With = 1, + Loop = 2, + Try = 3, + Except = 4, +} Kind; -/* Initialise the tracker */ -static void -init_codetracker(codetracker *tracker, PyCodeObject *code_obj) +#define BITS_PER_BLOCK 3 + +static inline int64_t +push_block(int64_t stack, Kind kind) { - PyBytes_AsStringAndSize(code_obj->co_code, - (char **)&tracker->code, &tracker->code_len); - PyBytes_AsStringAndSize(code_obj->co_lnotab, - (char **)&tracker->lnotab, &tracker->lnotab_len); - tracker->start_line = code_obj->co_firstlineno; - reset(tracker); + assert(stack < ((int64_t)1)<<(BITS_PER_BLOCK*CO_MAXBLOCKS)); + return (stack << BITS_PER_BLOCK) | kind; } -static void -advance_tracker(codetracker *tracker) +static inline int64_t +pop_block(int64_t stack) { - tracker->addr += sizeof(_Py_CODEUNIT); - if (tracker->offset >= tracker->lnotab_len) { - return; - } - while (tracker->offset < tracker->lnotab_len && - tracker->addr >= tracker->line_addr + tracker->lnotab[tracker->offset]) { - tracker->line_addr += tracker->lnotab[tracker->offset]; - tracker->line += (signed char)tracker->lnotab[tracker->offset+1]; - tracker->offset += 2; - } + assert(stack > 0); + return stack >> BITS_PER_BLOCK; } - -static void -retreat_tracker(codetracker *tracker) +static inline Kind +top_block(int64_t stack) { - tracker->addr -= sizeof(_Py_CODEUNIT); - while (tracker->addr < tracker->line_addr) { - tracker->offset -= 2; - tracker->line_addr -= tracker->lnotab[tracker->offset]; - tracker->line -= (signed char)tracker->lnotab[tracker->offset+1]; - } + return stack & ((1< tracker->addr) { - advance_tracker(tracker); - if (tracker->addr >= tracker->code_len) { - return -1; - } - } - while (addr < tracker->addr) { - retreat_tracker(tracker); - if (tracker->addr < 0) { - return -1; - } + const _Py_CODEUNIT *code = + (const _Py_CODEUNIT *)PyBytes_AS_STRING(code_obj->co_code); + int64_t *blocks = PyMem_New(int64_t, len+1); + int i, j, opcode; + + if (blocks == NULL) { + PyErr_NoMemory(); + return NULL; } - return 0; -} + memset(blocks, -1, (len+1)*sizeof(int64_t)); + blocks[0] = 0; + int todo = 1; + while (todo) { + todo = 0; + for (i = 0; i < len; i++) { + int64_t block_stack = blocks[i]; + int64_t except_stack; + if (block_stack == -1) { + continue; + } + opcode = _Py_OPCODE(code[i]); + switch (opcode) { + 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: + j = get_arg(code, i) / sizeof(_Py_CODEUNIT); + assert(j < len); + if (blocks[j] == -1 && j < i) { + todo = 1; + } + assert(blocks[j] == -1 || blocks[j] == block_stack); + blocks[j] = block_stack; + blocks[i+1] = block_stack; + break; + case JUMP_ABSOLUTE: + j = get_arg(code, i) / sizeof(_Py_CODEUNIT); + assert(j < len); + if (blocks[j] == -1 && j < i) { + todo = 1; + } + assert(blocks[j] == -1 || blocks[j] == block_stack); + blocks[j] = block_stack; + break; + case SETUP_FINALLY: + j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + assert(j < len); + except_stack = push_block(block_stack, Except); + assert(blocks[j] == -1 || blocks[j] == except_stack); + blocks[j] = except_stack; + block_stack = push_block(block_stack, Try); + blocks[i+1] = block_stack; + break; + case SETUP_WITH: + case SETUP_ASYNC_WITH: + j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + assert(j < len); + except_stack = push_block(block_stack, Except); + assert(blocks[j] == -1 || blocks[j] == except_stack); + blocks[j] = except_stack; + block_stack = push_block(block_stack, With); + blocks[i+1] = block_stack; + break; + case JUMP_FORWARD: + j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + assert(j < len); + assert(blocks[j] == -1 || blocks[j] == block_stack); + blocks[j] = block_stack; + break; + case GET_ITER: + case GET_AITER: + block_stack = push_block(block_stack, Loop); + blocks[i+1] = block_stack; + break; + case FOR_ITER: + blocks[i+1] = block_stack; + block_stack = pop_block(block_stack); + j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + assert(j < len); + assert(blocks[j] == -1 || blocks[j] == block_stack); + blocks[j] = block_stack; + break; + case POP_BLOCK: + case POP_EXCEPT: + block_stack = pop_block(block_stack); + blocks[i+1] = block_stack; + break; + case END_ASYNC_FOR: + block_stack = pop_block(pop_block(block_stack)); + blocks[i+1] = block_stack; + break; + case RETURN_VALUE: + case RAISE_VARARGS: + case RERAISE: + /* End of block */ + break; + default: + blocks[i+1] = block_stack; -static int -first_line_not_before(codetracker *tracker, int line) -{ - int result = INT_MAX; - reset(tracker); - while (tracker->addr < tracker->code_len) { - if (tracker->line == line) { - return line; - } - if (tracker->line > line && tracker->line < result) { - result = tracker->line; + } } - advance_tracker(tracker); } - if (result == INT_MAX) { - return -1; - } - return result; + return blocks; } static int -move_to_nearest_start_of_line(codetracker *tracker, int line) +compatible_block_stack(int64_t from_stack, int64_t to_stack) { - if (line > tracker->line) { - while (line != tracker->line) { - advance_tracker(tracker); - if (tracker->addr >= tracker->code_len) { - return -1; - } - } + if (to_stack < 0) { + return 0; } - else { - while (line != tracker->line) { - retreat_tracker(tracker); - if (tracker->addr < 0) { - return -1; - } - } - while (tracker->addr > tracker->line_addr) { - retreat_tracker(tracker); - } + while(from_stack > to_stack) { + from_stack = pop_block(from_stack); } - return 0; -} - -typedef struct _blockitem -{ - unsigned char kind; - int end_addr; - int start_line; -} blockitem; - -typedef struct _blockstack -{ - blockitem stack[CO_MAXBLOCKS]; - int depth; -} blockstack; - - -static void -init_blockstack(blockstack *blocks) -{ - blocks->depth = 0; -} - -static void -push_block(blockstack *blocks, unsigned char kind, - int end_addr, int start_line) -{ - assert(blocks->depth < CO_MAXBLOCKS); - blocks->stack[blocks->depth].kind = kind; - blocks->stack[blocks->depth].end_addr = end_addr; - blocks->stack[blocks->depth].start_line = start_line; - blocks->depth++; -} - -static unsigned char -pop_block(blockstack *blocks) -{ - assert(blocks->depth > 0); - blocks->depth--; - return blocks->stack[blocks->depth].kind; -} - -static blockitem * -top_block(blockstack *blocks) -{ - assert(blocks->depth > 0); - return &blocks->stack[blocks->depth-1]; -} - -static inline int -is_try_except(unsigned char op, int target_op) -{ - return op == SETUP_FINALLY && (target_op == DUP_TOP || target_op == POP_TOP); -} - -static inline int -is_async_for(unsigned char op, int target_op) -{ - return op == SETUP_FINALLY && target_op == END_ASYNC_FOR; + return from_stack == to_stack; } -static inline int -is_try_finally(unsigned char op, int target_op) +static const char * +explain_incompatible_block_stack(int64_t to_stack) { - return op == SETUP_FINALLY && !is_try_except(op, target_op) && !is_async_for(op, target_op); + Kind target_kind = top_block(to_stack); + switch(target_kind) { + case Except: + return "can't jump into an 'except' block as there's no exception"; + case Try: + return "can't jump into the body of a try statement"; + case With: + return "can't jump into the body of a with statement"; + case Loop: + return "can't jump into the body of a for loop"; + default: + Py_UNREACHABLE(); + } } -/* Kind for finding except blocks in the jump to line code */ -#define TRY_EXCEPT 250 - -static int -block_stack_for_line(codetracker *tracker, int line, blockstack *blocks) +static int * +marklines(PyCodeObject *code, int len) { - if (line < tracker->start_line) { - return -1; + int *linestarts = PyMem_New(int, len); + if (linestarts == NULL) { + return NULL; } - init_blockstack(blocks); - reset(tracker); - while (tracker->addr < tracker->code_len) { - if (tracker->line == line) { - return 0; + Py_ssize_t size = PyBytes_GET_SIZE(code->co_lnotab) / 2; + unsigned char *p = (unsigned char*)PyBytes_AS_STRING(code->co_lnotab); + int line = code->co_firstlineno; + int addr = 0; + int index = 0; + while (--size >= 0) { + addr += *p++; + if (index*2 < addr) { + linestarts[index++] = line; } - if (blocks->depth > 0 && tracker->addr == top_block(blocks)->end_addr) { - unsigned char kind = pop_block(blocks); - assert(kind != SETUP_FINALLY); - if (kind == TRY_EXCEPT) { - push_block(blocks, POP_EXCEPT, -1, tracker->line); - } - if (kind == SETUP_WITH || kind == SETUP_ASYNC_WITH) { - push_block(blocks, WITH_EXCEPT_START, -1, tracker->line); - } - } - unsigned char op = tracker->code[tracker->addr]; - if (op == SETUP_FINALLY || op == SETUP_ASYNC_WITH || op == SETUP_WITH || op == FOR_ITER) { - unsigned int oparg = get_arg((const _Py_CODEUNIT *)tracker->code, - tracker->addr / sizeof(_Py_CODEUNIT)); - int target_addr = tracker->addr + oparg + sizeof(_Py_CODEUNIT); - int target_op = tracker->code[target_addr]; - if (is_async_for(op, target_op)) { - push_block(blocks, FOR_ITER, target_addr, tracker->line); - } - else if (op == FOR_ITER) { - push_block(blocks, FOR_ITER, target_addr-sizeof(_Py_CODEUNIT), tracker->line); - } - else if (is_try_except(op, target_op)) { - push_block(blocks, TRY_EXCEPT, target_addr-sizeof(_Py_CODEUNIT), tracker->line); - } - else if (is_try_finally(op, target_op)) { - int addr = tracker->addr; - // Skip over duplicate 'finally' blocks if line is after body. - move_to_addr(tracker, target_addr); - if (tracker->line > line) { - // Target is in body, rewind to start. - move_to_addr(tracker, addr); - push_block(blocks, op, target_addr, tracker->line); - } - else { - // Now in finally block. - push_block(blocks, RERAISE, -1, tracker->line); - } - } - else { - push_block(blocks, op, target_addr, tracker->line); + while (index*2 < addr) { + linestarts[index++] = -1; + if (index >= len) { + break; } } - else if (op == RERAISE) { - assert(blocks->depth > 0); - unsigned char kind = top_block(blocks)->kind; - if (kind == RERAISE || kind == WITH_EXCEPT_START || kind == POP_EXCEPT) { - pop_block(blocks); - } + line += (signed char)*p; + p++; + } + if (index < len) { + linestarts[index++] = line; + } + while (index < len) { + linestarts[index++] = -1; + } + assert(index == len); + return linestarts; +} +static int +first_line_not_before(int *lines, int len, int line) +{ + int result = INT_MAX; + for (int i = 0; i < len; i++) { + if (lines[i] < result && lines[i] >= line) { + result = lines[i]; } - advance_tracker(tracker); } - return -1; + if (result == INT_MAX) { + return -1; + } + return result; } static void @@ -412,131 +372,110 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore return -1; } - - codetracker tracker; - init_codetracker(&tracker, f->f_code); - move_to_addr(&tracker, f->f_lasti); - int current_line = tracker.line; - assert(current_line >= 0); int new_lineno; - { - /* Fail if the line falls outside the code block and - select first line with actual code. */ - int overflow; - long l_new_lineno = PyLong_AsLongAndOverflow(p_new_lineno, &overflow); - if (overflow + /* Fail if the line falls outside the code block and + select first line with actual code. */ + int overflow; + long l_new_lineno = PyLong_AsLongAndOverflow(p_new_lineno, &overflow); + if (overflow #if SIZEOF_LONG > SIZEOF_INT - || l_new_lineno > INT_MAX - || l_new_lineno < INT_MIN + || l_new_lineno > INT_MAX + || l_new_lineno < INT_MIN #endif - ) { - PyErr_SetString(PyExc_ValueError, - "lineno out of range"); - return -1; - } - new_lineno = (int)l_new_lineno; - - if (new_lineno < f->f_code->co_firstlineno) { - PyErr_Format(PyExc_ValueError, - "line %d comes before the current code block", - new_lineno); - return -1; - } + ) { + PyErr_SetString(PyExc_ValueError, + "lineno out of range"); + return -1; + } + new_lineno = (int)l_new_lineno; - new_lineno = first_line_not_before(&tracker, new_lineno); - if (new_lineno < 0) { - PyErr_Format(PyExc_ValueError, - "line %d comes after the current code block", - (int)l_new_lineno); - return -1; - } + if (new_lineno < f->f_code->co_firstlineno) { + PyErr_Format(PyExc_ValueError, + "line %d comes before the current code block", + new_lineno); + return -1; } - if (tracker.code[f->f_lasti] == YIELD_VALUE || tracker.code[f->f_lasti] == YIELD_FROM) { - PyErr_SetString(PyExc_ValueError, - "can't jump from a 'yield' statement"); + int len = PyBytes_GET_SIZE(f->f_code->co_code)/sizeof(_Py_CODEUNIT); + int *lines = marklines(f->f_code, len); + if (lines == NULL) { return -1; } - /* Find block stack for current line and target line. */ - blockstack current_stack, new_stack; - block_stack_for_line(&tracker, new_lineno, &new_stack); - block_stack_for_line(&tracker, current_line, ¤t_stack); + new_lineno = first_line_not_before(lines, len, new_lineno); + if (new_lineno < 0) { + PyErr_Format(PyExc_ValueError, + "line %d comes after the current code block", + (int)l_new_lineno); + PyMem_Free(lines); + return -1; + } - /* The trace function is called with a 'return' trace event after the - * execution of a yield statement. */ - if (tracker.code[tracker.addr] == DUP_TOP || tracker.code[tracker.addr] == POP_TOP) { - PyErr_SetString(PyExc_ValueError, - "can't jump to 'except' line as there's no exception"); + int64_t *blocks = markblocks(f->f_code, len); + if (blocks == NULL) { + PyMem_Free(lines); return -1; } - /* Validate change of block stack. */ - if (new_stack.depth > 0) { - blockitem *current_block_at_new_depth = &(current_stack.stack[new_stack.depth-1]); - if (new_stack.depth > current_stack.depth || - top_block(&new_stack)->start_line != current_block_at_new_depth->start_line) { - unsigned char target_kind = top_block(&new_stack)->kind; - const char *msg; - if (target_kind == POP_EXCEPT) { - msg = "can't jump into an 'except' block as there's no exception"; - } - else if (target_kind == RERAISE) { - msg = "can't jump into a 'finally' block"; + int64_t target_block_stack = -1; + int64_t best_block_stack = -1; + int best_addr = -1; + int64_t start_block_stack = blocks[f->f_lasti/sizeof(_Py_CODEUNIT)]; + const char *msg = "cannot find bytecode for specified line"; + for (int i = 0; i < len; i++) { + if (lines[i] == new_lineno) { + target_block_stack = blocks[i]; + if (compatible_block_stack(start_block_stack, target_block_stack)) { + msg = NULL; + if (target_block_stack > best_block_stack) { + best_block_stack = target_block_stack; + best_addr = i*sizeof(_Py_CODEUNIT); + } } - else { - msg = "can't jump into the middle of a block"; + else if (msg) { + if (target_block_stack >= 0) { + msg = explain_incompatible_block_stack(target_block_stack); + } + else { + msg = "code may be unreachable."; + } } - PyErr_SetString(PyExc_ValueError, msg); - return -1; } } - - /* Check for illegal jumps out of finally or except blocks. */ - for (int depth = new_stack.depth; depth < current_stack.depth; depth++) { - switch(current_stack.stack[depth].kind) { - case RERAISE: - PyErr_SetString(PyExc_ValueError, - "can't jump out of a 'finally' block"); - return -1; - case POP_EXCEPT: - PyErr_SetString(PyExc_ValueError, - "can't jump out of an 'except' block"); - return -1; - } + PyMem_Free(blocks); + PyMem_Free(lines); + if (msg != NULL) { + PyErr_SetString(PyExc_ValueError, msg); + return -1; } /* Unwind block stack. */ - while (current_stack.depth > new_stack.depth) { - unsigned char kind = pop_block(¤t_stack); + while (start_block_stack > best_block_stack) { + Kind kind = top_block(start_block_stack); switch(kind) { - case FOR_ITER: + case Loop: frame_stack_pop(f); break; - case SETUP_FINALLY: - case TRY_EXCEPT: + case Try: frame_block_unwind(f); break; - case SETUP_WITH: - case SETUP_ASYNC_WITH: + case With: frame_block_unwind(f); // Pop the exit function frame_stack_pop(f); break; - default: - PyErr_SetString(PyExc_SystemError, - "unexpected block kind"); + case Except: + PyErr_SetString(PyExc_ValueError, + "can't jump out of an 'except' block"); return -1; } + start_block_stack = pop_block(start_block_stack); } - move_to_addr(&tracker, f->f_lasti); - move_to_nearest_start_of_line(&tracker, new_lineno); - /* Finally set the new f_lineno and f_lasti and return OK. */ f->f_lineno = new_lineno; - f->f_lasti = tracker.addr; + f->f_lasti = best_addr; return 0; } From webhook-mailer at python.org Wed Apr 29 11:57:33 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 15:57:33 -0000 Subject: [Python-checkins] What's New in Python 3.9: Reorganize C API Changes (GH-19794) Message-ID: https://github.com/python/cpython/commit/e5963ee32035d279c12ef32e87205d4c3e5e4a0e commit: e5963ee32035d279c12ef32e87205d4c3e5e4a0e branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T17:57:25+02:00 summary: What's New in Python 3.9: Reorganize C API Changes (GH-19794) Move Build Changes and C API Changes to the end of the document. Most Python users don't build Python themselves and don't use the C API. Other changes: * Add Build Changes section * Add sub-sections to the C API Changes * Sort modules in Improved Modules section: move nntplib after multiprocessing files: M Doc/whatsnew/3.9.rst diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index f4edc6225c16d..cefaf5715d414 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -369,13 +369,6 @@ Add :func:`math.ulp`: return the value of the least significant bit of a float. (Contributed by Victor Stinner in :issue:`39310`.) -nntplib -------- - -:class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise a :class:`ValueError` -if the given timeout for their constructor is zero to prevent the creation of -a non-blocking socket. (Contributed by Dong-hee Na in :issue:`39259`.) - multiprocessing --------------- @@ -384,6 +377,13 @@ The :class:`multiprocessing.SimpleQueue` class has a new queue. (Contributed by Victor Stinner in :issue:`30966`.) +nntplib +------- + +:class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise a :class:`ValueError` +if the given timeout for their constructor is zero to prevent the creation of +a non-blocking socket. (Contributed by Dong-hee Na in :issue:`39259`.) + os -- @@ -534,157 +534,6 @@ Optimizations Stinner in :issue:`38061`.) -Build and C API Changes -======================= - -* New :c:func:`PyFrame_GetCode` function: get a frame code. - New :c:func:`PyFrame_GetBack` function: get the frame next outer frame. - (Contributed by Victor Stinner in :issue:`40421`.) - -* Add :c:func:`PyFrame_GetLineNumber` to the limited C API. - (Contributed by Victor Stinner in :issue:`40421`.) - -* New :c:func:`PyThreadState_GetInterpreter` and - :c:func:`PyInterpreterState_Get` functions to get the interpreter. - New :c:func:`PyThreadState_GetFrame` function to get the current frame of a - Python thread state. - New :c:func:`PyThreadState_GetID` function: get the unique identifier of a - Python thread state. - (Contributed by Victor Stinner in :issue:`39947`.) - -* Add ``--with-platlibdir`` option to the ``configure`` script: name of the - platform-specific library directory, stored in the new :attr:`sys.platlibdir` - attribute. See :attr:`sys.platlibdir` attribute for more information. - (Contributed by Jan Mat?jek, Mat?j Cepl, Charalampos Stratakis and Victor Stinner in :issue:`1294959`.) - -* Add a new public :c:func:`PyObject_CallNoArgs` function to the C API, which - calls a callable Python object without any arguments. It is the most efficient - way to call a callable Python object without any argument. - (Contributed by Victor Stinner in :issue:`37194`.) - -* The global variable :c:data:`PyStructSequence_UnnamedField` is now a constant - and refers to a constant string. - (Contributed by Serhiy Storchaka in :issue:`38650`.) - -* Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of - ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API). - (Contributed by Victor Stinner in :issue:`38835`.) - -* The ``tp_print`` slot of :ref:`PyTypeObject ` has been removed. - It was used for printing objects to files in Python 2.7 and before. Since - Python 3.0, it has been ignored and unused. - (Contributed by Jeroen Demeyer in :issue:`36974`.) - -* On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` - functions are now required to build Python. - (Contributed by Victor Stinner in :issue:`39395`.) - -* The ``COUNT_ALLOCS`` special build macro has been removed. - (Contributed by Victor Stinner in :issue:`39489`.) - -* Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined): - - * Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` - as regular functions for the limited API. Previously, there were defined as - macros, but these macros didn't compile with the limited C API which cannot - access ``PyThreadState.recursion_depth`` field (the structure is opaque in - the limited C API). - - * Exclude the following functions from the limited C API: - - * ``_Py_CheckRecursionLimit`` - * ``_Py_NewReference()`` - * ``_Py_ForgetReference()`` - * ``_PyTraceMalloc_NewReference()`` - * ``_Py_GetRefTotal()`` - * The trashcan mechanism which never worked in the limited C API. - * ``PyTrash_UNWIND_LEVEL`` - * ``Py_TRASHCAN_BEGIN_CONDITION`` - * ``Py_TRASHCAN_BEGIN`` - * ``Py_TRASHCAN_END`` - * ``Py_TRASHCAN_SAFE_BEGIN`` - * ``Py_TRASHCAN_SAFE_END`` - - * The following static inline functions or macros become regular "opaque" - function to hide implementation details: - - * ``_Py_NewReference()`` - * ``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become aliases to - :c:func:`PyObject_Init` and :c:func:`PyObject_InitVar` in the limited C - API, but are overriden with static inline function otherwise. Thanks to - that, it was possible to exclude ``_Py_NewReference()`` from the limited - C API. - - * Move following functions and definitions to the internal C API: - - * ``_PyDebug_PrintTotalRefs()`` - * ``_Py_PrintReferences()`` - * ``_Py_PrintReferenceAddresses()`` - * ``_Py_tracemalloc_config`` - * ``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build) - - (Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.) - -* ``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory - *tstate* parameter (``PyThreadState*``). - (Contributed by Victor Stinner in :issue:`38500`.) - -* Extension modules: :c:member:`~PyModuleDef.m_traverse`, - :c:member:`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` - functions of :c:type:`PyModuleDef` are no longer called if the module state - was requested but is not allocated yet. This is the case immediately after - the module is created and before the module is executed - (:c:data:`Py_mod_exec` function). More precisely, these functions are not called - if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module state (as - returned by :c:func:`PyModule_GetState`) is ``NULL``. - - Extension modules without module state (``m_size <= 0``) are not affected. - -* If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function is - now scheduled to be called from the subinterpreter, rather than being called - from the main interpreter. Each subinterpreter now has its own list of - scheduled calls. - (Contributed by Victor Stinner in :issue:`39984`.) - -* Remove ``_PyRuntime.getframe`` hook and remove ``_PyThreadState_GetFrame`` - macro which was an alias to ``_PyRuntime.getframe``. They were only exposed - by the internal C API. Remove also ``PyThreadFrameGetter`` type. - (Contributed by Victor Stinner in :issue:`39946`.) - -* The :c:func:`PyModule_AddType` function is added to help adding a type to a module. - (Contributed by Dong-hee Na in :issue:`40024`.) - -* The Windows registry is no longer used to initialize :data:`sys.path` when - the ``-E`` option is used. This is significant when embedding Python on - Windows. - (Contributed by Zackery Spytz in :issue:`8901`.) - -* Add the functions :c:func:`PyObject_GC_IsTracked` and - :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if - Python objects are being currently tracked or have been already finalized by - the garbage collector respectively. (Contributed by Pablo Galindo in - :issue:`40241`.) - -* Remove the following functions from the C API. Call :c:func:`PyGC_Collect` - explicitly to clear all free lists. - (Contributed by Inada Naoki and Victor Stinner in :issue:`37340`, - :issue:`38896` and :issue:`40428`.) - - * ``PyAsyncGen_ClearFreeLists()`` - * ``PyContext_ClearFreeList()`` - * ``PyDict_ClearFreeList()`` - * ``PyFloat_ClearFreeList()`` - * ``PyFrame_ClearFreeList()`` - * ``PyList_ClearFreeList()`` - * ``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: - the free lists of bound method objects have been removed. - * ``PySet_ClearFreeList()``: the set free list has been removed - in Python 3.4. - * ``PyTuple_ClearFreeList()`` - * ``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in - Python 3.3. - - Deprecated ========== @@ -729,7 +578,7 @@ Deprecated deprecated and will be removed in version 3.11. (Contributed by Yury Selivanov and Kyle Stanley in :issue:`34790`.) -* binhex4 and hexbin4 standards are now deprecated. The :`binhex` module +* binhex4 and hexbin4 standards are now deprecated. The :mod:`binhex` module and the following :mod:`binascii` functions are now deprecated: * :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx` @@ -934,3 +783,168 @@ CPython bytecode changes :keyword:`assert` statement. Previously, the assert statement would not work correctly if the :exc:`AssertionError` exception was being shadowed. (Contributed by Zackery Spytz in :issue:`34880`.) + + +Build Changes +============= + +* Add ``--with-platlibdir`` option to the ``configure`` script: name of the + platform-specific library directory, stored in the new :attr:`sys.platlibdir` + attribute. See :attr:`sys.platlibdir` attribute for more information. + (Contributed by Jan Mat?jek, Mat?j Cepl, Charalampos Stratakis + and Victor Stinner in :issue:`1294959`.) + +* The ``COUNT_ALLOCS`` special build macro has been removed. + (Contributed by Victor Stinner in :issue:`39489`.) + +* On non-Windows platforms, the :c:func:`setenv` and :c:func:`unsetenv` + functions are now required to build Python. + (Contributed by Victor Stinner in :issue:`39395`.) + + +C API Changes +============= + +New Features +------------ + +* Add :c:func:`PyFrame_GetCode` function: get a frame code. + Add :c:func:`PyFrame_GetBack` function: get the frame next outer frame. + (Contributed by Victor Stinner in :issue:`40421`.) + +* Add :c:func:`PyFrame_GetLineNumber` to the limited C API. + (Contributed by Victor Stinner in :issue:`40421`.) + +* Add :c:func:`PyThreadState_GetInterpreter` and + :c:func:`PyInterpreterState_Get` functions to get the interpreter. + Add :c:func:`PyThreadState_GetFrame` function to get the current frame of a + Python thread state. + Add :c:func:`PyThreadState_GetID` function: get the unique identifier of a + Python thread state. + (Contributed by Victor Stinner in :issue:`39947`.) + +* Add a new public :c:func:`PyObject_CallNoArgs` function to the C API, which + calls a callable Python object without any arguments. It is the most efficient + way to call a callable Python object without any argument. + (Contributed by Victor Stinner in :issue:`37194`.) + +* Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined): + + * Provide :c:func:`Py_EnterRecursiveCall` and :c:func:`Py_LeaveRecursiveCall` + as regular functions for the limited API. Previously, there were defined as + macros, but these macros didn't compile with the limited C API which cannot + access ``PyThreadState.recursion_depth`` field (the structure is opaque in + the limited C API). + + * ``PyObject_INIT()`` and ``PyObject_INIT_VAR()`` become regular "opaque" + function to hide implementation details. + + (Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.) + +* The :c:func:`PyModule_AddType` function is added to help adding a type + to a module. + (Contributed by Dong-hee Na in :issue:`40024`.) + +* Add the functions :c:func:`PyObject_GC_IsTracked` and + :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if + Python objects are being currently tracked or have been already finalized by + the garbage collector respectively. (Contributed by Pablo Galindo in + :issue:`40241`.) + + +Porting to Python 3.9 +--------------------- + +* ``PyInterpreterState.eval_frame`` (:pep:`523`) now requires a new mandatory + *tstate* parameter (``PyThreadState*``). + (Contributed by Victor Stinner in :issue:`38500`.) + +* Extension modules: :c:member:`~PyModuleDef.m_traverse`, + :c:member:`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free` + functions of :c:type:`PyModuleDef` are no longer called if the module state + was requested but is not allocated yet. This is the case immediately after + the module is created and before the module is executed + (:c:data:`Py_mod_exec` function). More precisely, these functions are not called + if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module state (as + returned by :c:func:`PyModule_GetState`) is ``NULL``. + + Extension modules without module state (``m_size <= 0``) are not affected. + +* If :c:func:`Py_AddPendingCall` is called in a subinterpreter, the function is + now scheduled to be called from the subinterpreter, rather than being called + from the main interpreter. Each subinterpreter now has its own list of + scheduled calls. + (Contributed by Victor Stinner in :issue:`39984`.) + +* The Windows registry is no longer used to initialize :data:`sys.path` when + the ``-E`` option is used (if :c:member:`PyConfig.use_environment` is set to + ``0``). This is significant when embedding Python on Windows. + (Contributed by Zackery Spytz in :issue:`8901`.) + +* The global variable :c:data:`PyStructSequence_UnnamedField` is now a constant + and refers to a constant string. + (Contributed by Serhiy Storchaka in :issue:`38650`.) + + +Removed +------- + +* Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()`` macros of + ``pyfpe.h`` from the limited C API. + (Contributed by Victor Stinner in :issue:`38835`.) + +* The ``tp_print`` slot of :ref:`PyTypeObject ` has been removed. + It was used for printing objects to files in Python 2.7 and before. Since + Python 3.0, it has been ignored and unused. + (Contributed by Jeroen Demeyer in :issue:`36974`.) + +* Changes in the limited C API (if ``Py_LIMITED_API`` macro is defined): + + * Exclude the following functions from the limited C API: + + * ``_Py_CheckRecursionLimit`` + * ``_Py_NewReference()`` + * ``_Py_ForgetReference()`` + * ``_PyTraceMalloc_NewReference()`` + * ``_Py_GetRefTotal()`` + * The trashcan mechanism which never worked in the limited C API. + * ``PyTrash_UNWIND_LEVEL`` + * ``Py_TRASHCAN_BEGIN_CONDITION`` + * ``Py_TRASHCAN_BEGIN`` + * ``Py_TRASHCAN_END`` + * ``Py_TRASHCAN_SAFE_BEGIN`` + * ``Py_TRASHCAN_SAFE_END`` + + * Move following functions and definitions to the internal C API: + + * ``_PyDebug_PrintTotalRefs()`` + * ``_Py_PrintReferences()`` + * ``_Py_PrintReferenceAddresses()`` + * ``_Py_tracemalloc_config`` + * ``_Py_AddToAllObjects()`` (specific to ``Py_TRACE_REFS`` build) + + (Contributed by Victor Stinner in :issue:`38644` and :issue:`39542`.) + +* Remove ``_PyRuntime.getframe`` hook and remove ``_PyThreadState_GetFrame`` + macro which was an alias to ``_PyRuntime.getframe``. They were only exposed + by the internal C API. Remove also ``PyThreadFrameGetter`` type. + (Contributed by Victor Stinner in :issue:`39946`.) + +* Remove the following functions from the C API. Call :c:func:`PyGC_Collect` + explicitly to clear all free lists. + (Contributed by Inada Naoki and Victor Stinner in :issue:`37340`, + :issue:`38896` and :issue:`40428`.) + + * ``PyAsyncGen_ClearFreeLists()`` + * ``PyContext_ClearFreeList()`` + * ``PyDict_ClearFreeList()`` + * ``PyFloat_ClearFreeList()`` + * ``PyFrame_ClearFreeList()`` + * ``PyList_ClearFreeList()`` + * ``PyMethod_ClearFreeList()`` and ``PyCFunction_ClearFreeList()``: + the free lists of bound method objects have been removed. + * ``PySet_ClearFreeList()``: the set free list has been removed + in Python 3.4. + * ``PyTuple_ClearFreeList()`` + * ``PyUnicode_ClearFreeList()``: the Unicode free list has been removed in + Python 3.3. From webhook-mailer at python.org Wed Apr 29 12:04:27 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 16:04:27 -0000 Subject: [Python-checkins] bpo-9216: Expose OpenSSL FIPS_mode() as _hashlib.get_fips_mode() (GH-19703) Message-ID: https://github.com/python/cpython/commit/e3dfb9b967c560f4d094092dcae4a16fc9634681 commit: e3dfb9b967c560f4d094092dcae4a16fc9634681 branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T09:04:22-07:00 summary: bpo-9216: Expose OpenSSL FIPS_mode() as _hashlib.get_fips_mode() (GH-19703) test.pythoninfo logs OpenSSL FIPS_mode() and Linux /proc/sys/crypto/fips_enabled in a new "fips" section. Co-Authored-By: Petr Viktorin files: M Lib/test/pythoninfo.py M Lib/test/test_hashlib.py M Modules/_hashopenssl.c M Modules/clinic/_hashopenssl.c.h diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index cc0bbc5fe3e77..cc228fb3b54c9 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -720,6 +720,25 @@ def collect_windows(info_add): pass +def collect_fips(info_add): + try: + import _hashlib + except ImportError: + _hashlib = None + + if _hashlib is not None: + call_func(info_add, 'fips.openssl_fips_mode', _hashlib, 'get_fips_mode') + + try: + with open("/proc/sys/crypto/fips_enabled", encoding="utf-8") as fp: + line = fp.readline().rstrip() + + if line: + info_add('fips.linux_crypto_fips_enabled', line) + except OSError: + pass + + def collect_info(info): error = False info_add = info.add @@ -735,6 +754,7 @@ def collect_info(info): collect_datetime, collect_decimal, collect_expat, + collect_fips, collect_gdb, collect_gdbm, collect_get_config, diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 33b687e0b4086..31d8e5567639c 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -856,6 +856,11 @@ def hash_in_chunks(chunk_size): self.assertEqual(expected_hash, hasher.hexdigest()) + @unittest.skipUnless(hasattr(c_hashlib, 'get_fips_mode'), + 'need _hashlib.get_fips_mode') + def test_get_fips_mode(self): + self.assertIsInstance(c_hashlib.get_fips_mode(), int) + class KDFTests(unittest.TestCase): diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index 0919cd3f47caa..91834e5330f4b 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -25,6 +25,8 @@ #include #include "openssl/err.h" +#include // FIPS_mode() + #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) /* OpenSSL < 1.1.0 */ #define EVP_MD_CTX_new EVP_MD_CTX_create @@ -1096,12 +1098,53 @@ generate_hash_name_list(void) return state.set; } +/* LibreSSL doesn't support FIPS: + https://marc.info/?l=openbsd-misc&m=139819485423701&w=2 + + Ted Unangst wrote: "I figured I should mention our current libressl policy + wrt FIPS mode. It's gone and it's not coming back." */ +#ifndef LIBRESSL_VERSION_NUMBER +/*[clinic input] +_hashlib.get_fips_mode -> int + +Determine the OpenSSL FIPS mode of operation. + +Effectively any non-zero return value indicates FIPS mode; +values other than 1 may have additional significance. + +See OpenSSL documentation for the FIPS_mode() function for details. +[clinic start generated code]*/ + +static int +_hashlib_get_fips_mode_impl(PyObject *module) +/*[clinic end generated code: output=87eece1bab4d3fa9 input=c2799c3132a36d6c]*/ + +{ + ERR_clear_error(); + int result = FIPS_mode(); + if (result == 0) { + // "If the library was built without support of the FIPS Object Module, + // then the function will return 0 with an error code of + // CRYPTO_R_FIPS_MODE_NOT_SUPPORTED (0x0f06d065)." + // But 0 is also a valid result value. + unsigned long errcode = ERR_peek_last_error(); + if (errcode) { + _setException(PyExc_ValueError); + return -1; + } + } + return result; +} +#endif // !LIBRESSL_VERSION_NUMBER + + /* List of functions exported by this module */ static struct PyMethodDef EVP_functions[] = { EVP_NEW_METHODDEF PBKDF2_HMAC_METHODDEF _HASHLIB_SCRYPT_METHODDEF + _HASHLIB_GET_FIPS_MODE_METHODDEF _HASHLIB_HMAC_DIGEST_METHODDEF _HASHLIB_OPENSSL_MD5_METHODDEF _HASHLIB_OPENSSL_SHA1_METHODDEF diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index de53e7e196c20..275784dcdcd0e 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -725,7 +725,48 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, return return_value; } +#if !defined(LIBRESSL_VERSION_NUMBER) + +PyDoc_STRVAR(_hashlib_get_fips_mode__doc__, +"get_fips_mode($module, /)\n" +"--\n" +"\n" +"Determine the OpenSSL FIPS mode of operation.\n" +"\n" +"Effectively any non-zero return value indicates FIPS mode;\n" +"values other than 1 may have additional significance.\n" +"\n" +"See OpenSSL documentation for the FIPS_mode() function for details."); + +#define _HASHLIB_GET_FIPS_MODE_METHODDEF \ + {"get_fips_mode", (PyCFunction)_hashlib_get_fips_mode, METH_NOARGS, _hashlib_get_fips_mode__doc__}, + +static int +_hashlib_get_fips_mode_impl(PyObject *module); + +static PyObject * +_hashlib_get_fips_mode(PyObject *module, PyObject *Py_UNUSED(ignored)) +{ + PyObject *return_value = NULL; + int _return_value; + + _return_value = _hashlib_get_fips_mode_impl(module); + if ((_return_value == -1) && PyErr_Occurred()) { + goto exit; + } + return_value = PyLong_FromLong((long)_return_value); + +exit: + return return_value; +} + +#endif /* !defined(LIBRESSL_VERSION_NUMBER) */ + #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=acb22ccddb7043c7 input=a9049054013a1b77]*/ + +#ifndef _HASHLIB_GET_FIPS_MODE_METHODDEF + #define _HASHLIB_GET_FIPS_MODE_METHODDEF +#endif /* !defined(_HASHLIB_GET_FIPS_MODE_METHODDEF) */ +/*[clinic end generated code: output=b0703dd5a043394d input=a9049054013a1b77]*/ From webhook-mailer at python.org Wed Apr 29 12:49:05 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 16:49:05 -0000 Subject: [Python-checkins] bpo-40286: Remove C implementation of Random.randbytes() (GH-19797) Message-ID: https://github.com/python/cpython/commit/2d8757758d0d75882fef0fe0e3c74c4756b3e81e commit: 2d8757758d0d75882fef0fe0e3c74c4756b3e81e branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T18:49:00+02:00 summary: bpo-40286: Remove C implementation of Random.randbytes() (GH-19797) Remove _random.Random.randbytes(): the C implementation of randbytes(). Implement the method in Python to ease subclassing: randbytes() now directly reuses getrandbits(). files: A Misc/NEWS.d/next/Library/2020-04-29-18-02-16.bpo-40286.txbQNx.rst M Lib/random.py M Modules/_randommodule.c M Modules/clinic/_randommodule.c.h diff --git a/Lib/random.py b/Lib/random.py index f1df18d5c187b..80fe447db6c86 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -192,6 +192,12 @@ def setstate(self, state): ## ---- Methods below this point do not need to be overridden when ## ---- subclassing for the purpose of using a different core generator. +## -------------------- bytes methods --------------------- + + def randbytes(self, n): + """Generate n random bytes.""" + return self.getrandbits(n * 8).to_bytes(n, 'little') + ## -------------------- pickle support ------------------- # Issue 17489: Since __reduce__ was defined to fix #759889 this is no diff --git a/Misc/NEWS.d/next/Library/2020-04-29-18-02-16.bpo-40286.txbQNx.rst b/Misc/NEWS.d/next/Library/2020-04-29-18-02-16.bpo-40286.txbQNx.rst new file mode 100644 index 0000000000000..ab9bfa65e07c2 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-29-18-02-16.bpo-40286.txbQNx.rst @@ -0,0 +1,3 @@ +Remove ``_random.Random.randbytes()``: the C implementation of +``randbytes()``. Implement the method in Python to ease subclassing: +``randbytes()`` now directly reuses ``getrandbits()``. diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 0fc2d07bb50e4..3589173edcb62 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -513,50 +513,6 @@ _random_Random_getrandbits_impl(RandomObject *self, int k) return result; } -/*[clinic input] - -_random.Random.randbytes - - self: self(type="RandomObject *") - n: Py_ssize_t - / - -Generate n random bytes. -[clinic start generated code]*/ - -static PyObject * -_random_Random_randbytes_impl(RandomObject *self, Py_ssize_t n) -/*[clinic end generated code: output=67a28548079a17ea input=7ba658a24150d233]*/ -{ - if (n < 0) { - PyErr_SetString(PyExc_ValueError, - "number of bytes must be non-negative"); - return NULL; - } - - PyObject *bytes = PyBytes_FromStringAndSize(NULL, n); - if (bytes == NULL) { - return NULL; - } - uint8_t *ptr = (uint8_t *)PyBytes_AS_STRING(bytes); - - for (; n; ptr += 4, n -= 4) { - uint32_t word = genrand_uint32(self); -#if PY_BIG_ENDIAN - /* Convert to little endian */ - word = _Py_bswap32(word); -#endif - if (n < 4) { - /* Drop least significant bits */ - memcpy(ptr, (uint8_t *)&word + (4 - n), n); - break; - } - memcpy(ptr, &word, 4); - } - - return bytes; -} - static PyObject * random_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -586,7 +542,6 @@ static PyMethodDef random_methods[] = { _RANDOM_RANDOM_GETSTATE_METHODDEF _RANDOM_RANDOM_SETSTATE_METHODDEF _RANDOM_RANDOM_GETRANDBITS_METHODDEF - _RANDOM_RANDOM_RANDBYTES_METHODDEF {NULL, NULL} /* sentinel */ }; diff --git a/Modules/clinic/_randommodule.c.h b/Modules/clinic/_randommodule.c.h index dda78f6013cfe..a467811d93b27 100644 --- a/Modules/clinic/_randommodule.c.h +++ b/Modules/clinic/_randommodule.c.h @@ -114,45 +114,4 @@ _random_Random_getrandbits(RandomObject *self, PyObject *arg) exit: return return_value; } - -PyDoc_STRVAR(_random_Random_randbytes__doc__, -"randbytes($self, n, /)\n" -"--\n" -"\n" -"Generate n random bytes."); - -#define _RANDOM_RANDOM_RANDBYTES_METHODDEF \ - {"randbytes", (PyCFunction)_random_Random_randbytes, METH_O, _random_Random_randbytes__doc__}, - -static PyObject * -_random_Random_randbytes_impl(RandomObject *self, Py_ssize_t n); - -static PyObject * -_random_Random_randbytes(RandomObject *self, PyObject *arg) -{ - PyObject *return_value = NULL; - Py_ssize_t n; - - if (PyFloat_Check(arg)) { - PyErr_SetString(PyExc_TypeError, - "integer argument expected, got float" ); - goto exit; - } - { - Py_ssize_t ival = -1; - PyObject *iobj = PyNumber_Index(arg); - if (iobj != NULL) { - ival = PyLong_AsSsize_t(iobj); - Py_DECREF(iobj); - } - if (ival == -1 && PyErr_Occurred()) { - goto exit; - } - n = ival; - } - return_value = _random_Random_randbytes_impl(self, n); - -exit: - return return_value; -} -/*[clinic end generated code: output=e515c651860c4001 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a7feb0c9c8d1b627 input=a9049054013a1b77]*/ From webhook-mailer at python.org Wed Apr 29 13:34:35 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Wed, 29 Apr 2020 17:34:35 -0000 Subject: [Python-checkins] bpo-40328: Add tool for generating cjk mapping headers (GH-19602) Message-ID: https://github.com/python/cpython/commit/113feb3ec2b08948a381175d33b6ff308d24fceb commit: 113feb3ec2b08948a381175d33b6ff308d24fceb branch: master author: Dong-hee Na committer: GitHub date: 2020-04-30T02:34:24+09:00 summary: bpo-40328: Add tool for generating cjk mapping headers (GH-19602) files: A Misc/NEWS.d/next/Core and Builtins/2020-04-19-22-23-32.bpo-40328.gWJ53f.rst A Tools/unicode/genmap_japanese.py A Tools/unicode/genmap_korean.py A Tools/unicode/genmap_schinese.py A Tools/unicode/genmap_support.py A Tools/unicode/python-mappings/GB2312.TXT A Tools/unicode/python-mappings/diff/jisx0213-2000-std.txt.diff A Tools/unicode/python-mappings/diff/jisx0213-2004-std.txt.diff A Tools/unicode/python-mappings/gb-18030-2000.xml A Tools/unicode/python-mappings/jisx0213-2004-std.txt M Modules/cjkcodecs/README M Modules/cjkcodecs/mappings_cn.h M Modules/cjkcodecs/mappings_jisx0213_pair.h M Modules/cjkcodecs/mappings_jp.h M Modules/cjkcodecs/mappings_kr.h diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-19-22-23-32.bpo-40328.gWJ53f.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-19-22-23-32.bpo-40328.gWJ53f.rst new file mode 100644 index 0000000000000..ede446e0d500d --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-19-22-23-32.bpo-40328.gWJ53f.rst @@ -0,0 +1 @@ +Add tools for generating mappings headers for CJKCodecs. diff --git a/Modules/cjkcodecs/README b/Modules/cjkcodecs/README index 8f08f2dd41699..165ae7aded6a0 100644 --- a/Modules/cjkcodecs/README +++ b/Modules/cjkcodecs/README @@ -1,8 +1,6 @@ To generate or modify mapping headers ------------------------------------- -Mapping headers are imported from CJKCodecs as pre-generated form. -If you need to tweak or add something on it, please look at tools/ -subdirectory of CJKCodecs' distribution. +Mapping headers are generated from Tools/unicode/genmap_*.py diff --git a/Modules/cjkcodecs/mappings_cn.h b/Modules/cjkcodecs/mappings_cn.h index 1f8c299d24239..87ca0de784a80 100644 --- a/Modules/cjkcodecs/mappings_cn.h +++ b/Modules/cjkcodecs/mappings_cn.h @@ -1,3 +1,4 @@ +// AUTO-GENERATED FILE FROM genmap_schinese.py: DO NOT EDIT static const ucs2_t __gb2312_decmap[7482] = { 12288,12289,12290,12539,713,711,168,12291,12293,8213,65374,8214,8230,8216, 8217,8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303, diff --git a/Modules/cjkcodecs/mappings_jisx0213_pair.h b/Modules/cjkcodecs/mappings_jisx0213_pair.h index 729e4bcbe66f1..c96f20142b7ae 100644 --- a/Modules/cjkcodecs/mappings_jisx0213_pair.h +++ b/Modules/cjkcodecs/mappings_jisx0213_pair.h @@ -1,3 +1,4 @@ +// AUTO-GENERATED FILE FROM genmap_japanese.py: DO NOT EDIT #define JISX0213_ENCPAIRS 46 #ifdef EXTERN_JISX0213_PAIR static const struct widedbcs_index *jisx0213_pair_decmap; diff --git a/Modules/cjkcodecs/mappings_jp.h b/Modules/cjkcodecs/mappings_jp.h index c6dae3daa7df2..409aeae25c964 100644 --- a/Modules/cjkcodecs/mappings_jp.h +++ b/Modules/cjkcodecs/mappings_jp.h @@ -1,3 +1,4 @@ +// AUTO-GENERATED FILE FROM genmap_japanese.py: DO NOT EDIT static const ucs2_t __jisx0208_decmap[6956] = { 12288,12289,12290,65292,65294,12539,65306,65307,65311,65281,12443,12444,180, 65344,168,65342,65507,65343,12541,12542,12445,12446,12291,20189,12293,12294, diff --git a/Modules/cjkcodecs/mappings_kr.h b/Modules/cjkcodecs/mappings_kr.h index 7e6fdd2701bdd..bb59acccc1ee9 100644 --- a/Modules/cjkcodecs/mappings_kr.h +++ b/Modules/cjkcodecs/mappings_kr.h @@ -1,3 +1,4 @@ +// AUTO-GENERATED FILE FROM genmap_korean.py: DO NOT EDIT static const ucs2_t __ksx1001_decmap[8264] = { 12288,12289,12290,183,8229,8230,168,12291,173,8213,8741,65340,8764,8216,8217, 8220,8221,12308,12309,12296,12297,12298,12299,12300,12301,12302,12303,12304, @@ -3249,3 +3250,4 @@ __cp949_encmap+31959,0,255},{__cp949_encmap+32215,0,255},{__cp949_encmap+32471 __cp949_encmap+32891,0,11},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{__cp949_encmap+ 32903,1,230}, }; + diff --git a/Tools/unicode/genmap_japanese.py b/Tools/unicode/genmap_japanese.py new file mode 100644 index 0000000000000..21de37b62bced --- /dev/null +++ b/Tools/unicode/genmap_japanese.py @@ -0,0 +1,251 @@ +# +# genmap_ja_codecs.py: Japanese Codecs Map Generator +# +# Original Author: Hye-Shik Chang +# Modified Author: Dong-hee Na +# +import os + +from genmap_support import * + +JISX0208_C1 = (0x21, 0x74) +JISX0208_C2 = (0x21, 0x7e) +JISX0212_C1 = (0x22, 0x6d) +JISX0212_C2 = (0x21, 0x7e) +JISX0213_C1 = (0x21, 0x7e) +JISX0213_C2 = (0x21, 0x7e) +CP932P0_C1 = (0x81, 0x81) # patches between shift-jis and cp932 +CP932P0_C2 = (0x5f, 0xca) +CP932P1_C1 = (0x87, 0x87) # CP932 P1 +CP932P1_C2 = (0x40, 0x9c) +CP932P2_C1 = (0xed, 0xfc) # CP932 P2 +CP932P2_C2 = (0x40, 0xfc) + +MAPPINGS_JIS0208 = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0208.TXT' +MAPPINGS_JIS0212 = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/JIS0212.TXT' +MAPPINGS_CP932 = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP932.TXT' +MAPPINGS_JISX0213_2004 = 'http://wakaba-web.hp.infoseek.co.jp/table/jisx0213-2004-std.txt' + + +def loadmap_jisx0213(fo): + decmap3, decmap4 = {}, {} # maps to BMP for level 3 and 4 + decmap3_2, decmap4_2 = {}, {} # maps to U+2xxxx for level 3 and 4 + decmap3_pair = {} # maps to BMP-pair for level 3 + for line in fo: + line = line.split('#', 1)[0].strip() + if not line or len(line.split()) < 2: + continue + + row = line.split() + loc = eval('0x' + row[0][2:]) + level = eval(row[0][0]) + m = None + if len(row[1].split('+')) == 2: # single unicode + uni = eval('0x' + row[1][2:]) + if level == 3: + if uni < 0x10000: + m = decmap3 + elif 0x20000 <= uni < 0x30000: + uni -= 0x20000 + m = decmap3_2 + elif level == 4: + if uni < 0x10000: + m = decmap4 + elif 0x20000 <= uni < 0x30000: + uni -= 0x20000 + m = decmap4_2 + m.setdefault((loc >> 8), {}) + m[(loc >> 8)][(loc & 0xff)] = uni + else: # pair + uniprefix = eval('0x' + row[1][2:6]) # body + uni = eval('0x' + row[1][7:11]) # modifier + if level != 3: + raise ValueError("invalid map") + decmap3_pair.setdefault(uniprefix, {}) + m = decmap3_pair[uniprefix] + + if m is None: + raise ValueError("invalid map") + m.setdefault((loc >> 8), {}) + m[(loc >> 8)][(loc & 0xff)] = uni + + return decmap3, decmap4, decmap3_2, decmap4_2, decmap3_pair + + +def main(): + jisx0208file = open_mapping_file('python-mappings/JIS0208.TXT', MAPPINGS_JIS0208) + jisx0212file = open_mapping_file('python-mappings/JIS0212.TXT', MAPPINGS_JIS0212) + cp932file = open_mapping_file('python-mappings/CP932.TXT', MAPPINGS_CP932) + jisx0213file = open_mapping_file('python-mappings/jisx0213-2004-std.txt', MAPPINGS_JISX0213_2004) + + print("Loading Mapping File...") + + sjisdecmap = loadmap(jisx0208file, natcol=0, unicol=2) + jisx0208decmap = loadmap(jisx0208file, natcol=1, unicol=2) + jisx0212decmap = loadmap(jisx0212file) + cp932decmap = loadmap(cp932file) + jis3decmap, jis4decmap, jis3_2_decmap, jis4_2_decmap, jis3_pairdecmap = loadmap_jisx0213(jisx0213file) + + if jis3decmap[0x21][0x24] != 0xff0c: + raise SystemExit('Please adjust your JIS X 0213 map using jisx0213-2000-std.txt.diff') + + sjisencmap, cp932encmap = {}, {} + jisx0208_0212encmap = {} + for c1, m in sjisdecmap.items(): + for c2, code in m.items(): + sjisencmap.setdefault(code >> 8, {}) + sjisencmap[code >> 8][code & 0xff] = c1 << 8 | c2 + for c1, m in cp932decmap.items(): + for c2, code in m.items(): + cp932encmap.setdefault(code >> 8, {}) + if (code & 0xff) not in cp932encmap[code >> 8]: + cp932encmap[code >> 8][code & 0xff] = c1 << 8 | c2 + for c1, m in cp932encmap.copy().items(): + for c2, code in m.copy().items(): + if c1 in sjisencmap and c2 in sjisencmap[c1] and sjisencmap[c1][c2] == code: + del cp932encmap[c1][c2] + if not cp932encmap[c1]: + del cp932encmap[c1] + + jisx0213pairdecmap = {} + jisx0213pairencmap = [] + for unibody, m1 in jis3_pairdecmap.items(): + for c1, m2 in m1.items(): + for c2, modifier in m2.items(): + jisx0213pairencmap.append((unibody, modifier, c1 << 8 | c2)) + jisx0213pairdecmap.setdefault(c1, {}) + jisx0213pairdecmap[c1][c2] = unibody << 16 | modifier + + # Twinmap for both of JIS X 0208 (MSB unset) and JIS X 0212 (MSB set) + for c1, m in jisx0208decmap.items(): + for c2, code in m.items(): + jisx0208_0212encmap.setdefault(code >> 8, {}) + jisx0208_0212encmap[code >> 8][code & 0xff] = c1 << 8 | c2 + + for c1, m in jisx0212decmap.items(): + for c2, code in m.items(): + jisx0208_0212encmap.setdefault(code >> 8, {}) + if (code & 0xff) in jisx0208_0212encmap[code >> 8]: + print("OOPS!!!", (code)) + jisx0208_0212encmap[code >> 8][code & 0xff] = 0x8000 | c1 << 8 | c2 + + jisx0213bmpencmap = {} + for c1, m in jis3decmap.copy().items(): + for c2, code in m.copy().items(): + if c1 in jisx0208decmap and c2 in jisx0208decmap[c1]: + if code in jis3_pairdecmap: + jisx0213bmpencmap[code >> 8][code & 0xff] = (0,) # pair + jisx0213pairencmap.append((code, 0, c1 << 8 | c2)) + elif jisx0208decmap[c1][c2] == code: + del jis3decmap[c1][c2] + if not jis3decmap[c1]: + del jis3decmap[c1] + else: + raise ValueError("Difference between JIS X 0208 and JIS X 0213 Plane 1 is found.") + else: + jisx0213bmpencmap.setdefault(code >> 8, {}) + if code not in jis3_pairdecmap: + jisx0213bmpencmap[code >> 8][code & 0xff] = c1 << 8 | c2 + else: + jisx0213bmpencmap[code >> 8][code & 0xff] = (0,) # pair + jisx0213pairencmap.append((code, 0, c1 << 8 | c2)) + + for c1, m in jis4decmap.items(): + for c2, code in m.items(): + jisx0213bmpencmap.setdefault(code >> 8, {}) + jisx0213bmpencmap[code >> 8][code & 0xff] = 0x8000 | c1 << 8 | c2 + + jisx0213empencmap = {} + for c1, m in jis3_2_decmap.items(): + for c2, code in m.items(): + jisx0213empencmap.setdefault(code >> 8, {}) + jisx0213empencmap[code >> 8][code & 0xff] = c1 << 8 | c2 + for c1, m in jis4_2_decmap.items(): + for c2, code in m.items(): + jisx0213empencmap.setdefault(code >> 8, {}) + jisx0213empencmap[code >> 8][code & 0xff] = 0x8000 | c1 << 8 | c2 + + with open("mappings_jp.h", "w") as fp: + print_autogen(fp, os.path.basename(__file__)) + print("Generating JIS X 0208 decode map...") + writer = DecodeMapWriter(fp, "jisx0208", jisx0208decmap) + writer.update_decode_map(JISX0208_C1, JISX0208_C2) + writer.generate() + + print("Generating JIS X 0212 decode map...") + writer = DecodeMapWriter(fp, "jisx0212", jisx0212decmap) + writer.update_decode_map(JISX0212_C1, JISX0212_C2) + writer.generate() + + print("Generating JIS X 0208 && JIS X 0212 encode map...") + writer = EncodeMapWriter(fp, "jisxcommon", jisx0208_0212encmap) + writer.generate() + + print("Generating CP932 Extension decode map...") + writer = DecodeMapWriter(fp, "cp932ext", cp932decmap) + writer.update_decode_map(CP932P0_C1, CP932P0_C2) + writer.update_decode_map(CP932P1_C1, CP932P1_C2) + writer.update_decode_map(CP932P2_C1, CP932P2_C2) + writer.generate() + + print("Generating CP932 Extension encode map...") + writer = EncodeMapWriter(fp, "cp932ext", cp932encmap) + writer.generate() + + print("Generating JIS X 0213 Plane 1 BMP decode map...") + writer = DecodeMapWriter(fp, "jisx0213_1_bmp", jis3decmap) + writer.update_decode_map(JISX0213_C1, JISX0213_C2) + writer.generate() + + print("Generating JIS X 0213 Plane 2 BMP decode map...") + writer = DecodeMapWriter(fp, "jisx0213_2_bmp", jis4decmap) + writer.update_decode_map(JISX0213_C1, JISX0213_C2) + writer.generate() + + print("Generating JIS X 0213 BMP encode map...") + writer = EncodeMapWriter(fp, "jisx0213_bmp", jisx0213bmpencmap) + writer.generate() + + print("Generating JIS X 0213 Plane 1 EMP decode map...") + writer = DecodeMapWriter(fp, "jisx0213_1_emp", jis3_2_decmap) + writer.update_decode_map(JISX0213_C1, JISX0213_C2) + writer.generate() + + print("Generating JIS X 0213 Plane 2 EMP decode map...") + writer = DecodeMapWriter(fp, "jisx0213_2_emp", jis4_2_decmap) + writer.update_decode_map(JISX0213_C1, JISX0213_C2) + writer.generate() + + print("Generating JIS X 0213 EMP encode map...") + writer = EncodeMapWriter(fp, "jisx0213_emp", jisx0213empencmap) + writer.generate() + + with open('mappings_jisx0213_pair.h', 'w') as fp: + print_autogen(fp, os.path.basename(__file__)) + fp.write(f"#define JISX0213_ENCPAIRS {len(jisx0213pairencmap)}\n") + fp.write("""\ +#ifdef EXTERN_JISX0213_PAIR +static const struct widedbcs_index *jisx0213_pair_decmap; +static const struct pair_encodemap *jisx0213_pair_encmap; +#else +""") + + print("Generating JIS X 0213 unicode-pair decode map...") + writer = DecodeMapWriter(fp, "jisx0213_pair", jisx0213pairdecmap) + writer.update_decode_map(JISX0213_C1, JISX0213_C2) + writer.generate(wide=True) + + print("Generating JIS X 0213 unicode-pair encode map...") + jisx0213pairencmap.sort() + fp.write("static const struct pair_encodemap jisx0213_pair_encmap[JISX0213_ENCPAIRS] = {\n") + filler = BufferedFiller() + for body, modifier, jis in jisx0213pairencmap: + filler.write('{', '0x%04x%04x,' % (body, modifier), '0x%04x' % jis, '},') + filler.printout(fp) + fp.write("};\n") + fp.write("#endif\n") + + print("Done!") + +if __name__ == '__main__': + main() diff --git a/Tools/unicode/genmap_korean.py b/Tools/unicode/genmap_korean.py new file mode 100644 index 0000000000000..4b94a6c43e538 --- /dev/null +++ b/Tools/unicode/genmap_korean.py @@ -0,0 +1,62 @@ +# +# genmap_korean.py: Korean Codecs Map Generator +# +# Original Author: Hye-Shik Chang +# Modified Author: Dong-hee Na +# +import os + +from genmap_support import * + + +KSX1001_C1 = (0x21, 0x7e) +KSX1001_C2 = (0x21, 0x7e) +UHCL1_C1 = (0x81, 0xa0) +UHCL1_C2 = (0x41, 0xfe) +UHCL2_C1 = (0xa1, 0xfe) +UHCL2_C2 = (0x41, 0xa0) +MAPPINGS_CP949 = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP949.TXT' + + +def main(): + mapfile = open_mapping_file('python-mappings/CP949.TXT', MAPPINGS_CP949) + print("Loading Mapping File...") + decmap = loadmap(mapfile) + uhcdecmap, ksx1001decmap, cp949encmap = {}, {}, {} + for c1, c2map in decmap.items(): + for c2, code in c2map.items(): + if c1 >= 0xa1 and c2 >= 0xa1: + ksx1001decmap.setdefault(c1 & 0x7f, {}) + ksx1001decmap[c1 & 0x7f][c2 & 0x7f] = c2map[c2] + cp949encmap.setdefault(code >> 8, {}) + cp949encmap[code >> 8][code & 0xFF] = (c1 << 8 | c2) & 0x7f7f + else: + # uhc + uhcdecmap.setdefault(c1, {}) + uhcdecmap[c1][c2] = c2map[c2] + cp949encmap.setdefault(code >> 8, {}) # MSB set + cp949encmap[code >> 8][code & 0xFF] = (c1 << 8 | c2) + + with open('mappings_kr.h', 'w') as fp: + print_autogen(fp, os.path.basename(__file__)) + + print("Generating KS X 1001 decode map...") + writer = DecodeMapWriter(fp, "ksx1001", ksx1001decmap) + writer.update_decode_map(KSX1001_C1, KSX1001_C2) + writer.generate() + + print("Generating UHC decode map...") + writer = DecodeMapWriter(fp, "cp949ext", uhcdecmap) + writer.update_decode_map(UHCL1_C1, UHCL1_C2) + writer.update_decode_map(UHCL2_C1, UHCL2_C2) + writer.generate() + + print("Generating CP949 (includes KS X 1001) encode map...") + writer = EncodeMapWriter(fp, "cp949", cp949encmap) + writer.generate() + + print("Done!") + + +if __name__ == '__main__': + main() diff --git a/Tools/unicode/genmap_schinese.py b/Tools/unicode/genmap_schinese.py new file mode 100644 index 0000000000000..647c0333ed272 --- /dev/null +++ b/Tools/unicode/genmap_schinese.py @@ -0,0 +1,149 @@ +# +# genmap_schinese.py: Simplified Chinese Codecs Map Generator +# +# Original Author: Hye-Shik Chang +# Modified Author: Dong-hee Na +# +import os +import re + +from genmap_support import * + + +GB2312_C1 = (0x21, 0x7e) +GB2312_C2 = (0x21, 0x7e) +GBKL1_C1 = (0x81, 0xa8) +GBKL1_C2 = (0x40, 0xfe) +GBKL2_C1 = (0xa9, 0xfe) +GBKL2_C2 = (0x40, 0xa0) +GB18030EXTP1_C1 = (0xa1, 0xa9) +GB18030EXTP1_C2 = (0x40, 0xfe) +GB18030EXTP2_C1 = (0xaa, 0xaf) +GB18030EXTP2_C2 = (0xa1, 0xfe) +GB18030EXTP3_C1 = (0xd7, 0xd7) +GB18030EXTP3_C2 = (0xfa, 0xfe) +GB18030EXTP4_C1 = (0xf8, 0xfd) +GB18030EXTP4_C2 = (0xa1, 0xfe) +GB18030EXTP5_C1 = (0xfe, 0xfe) +GB18030EXTP5_C2 = (0x50, 0xfe) + +MAPPINGS_GB2312 = 'http://people.freebsd.org/~perky/i18n/GB2312.TXT' +MAPPINGS_CP936 = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT' +MAPPINGS_GB18030 = 'http://oss.software.ibm.com/cvs/icu/~checkout~/charset/data/xml/gb-18030-2000.xml' + +re_gb18030ass = re.compile('') + + +def parse_gb18030map(fo): + m, gbuni = {}, {} + for i in range(65536): + if i < 0xd800 or i > 0xdfff: # exclude unicode surrogate area + gbuni[i] = None + for uni, native in re_gb18030ass.findall(fo.read()): + uni = eval('0x'+uni) + native = [eval('0x'+u) for u in native.split()] + if len(native) <= 2: + del gbuni[uni] + if len(native) == 2: # we can decode algorithmically for 1 or 4 bytes + m.setdefault(native[0], {}) + m[native[0]][native[1]] = uni + gbuni = [k for k in gbuni.keys()] + gbuni.sort() + return m, gbuni + +def main(): + print("Loading Mapping File...") + gb2312map = open_mapping_file('python-mappings/GB2312.TXT', MAPPINGS_GB2312) + cp936map = open_mapping_file('python-mappings/CP936.TXT', MAPPINGS_CP936) + gb18030map = open_mapping_file('python-mappings/gb-18030-2000.xml', MAPPINGS_GB18030) + + gb18030decmap, gb18030unilinear = parse_gb18030map(gb18030map) + gbkdecmap = loadmap(cp936map) + gb2312decmap = loadmap(gb2312map) + difmap = {} + for c1, m in gbkdecmap.items(): + for c2, code in m.items(): + del gb18030decmap[c1][c2] + if not gb18030decmap[c1]: + del gb18030decmap[c1] + for c1, m in gb2312decmap.items(): + for c2, code in m.items(): + gbkc1, gbkc2 = c1 | 0x80, c2 | 0x80 + if gbkdecmap[gbkc1][gbkc2] == code: + del gbkdecmap[gbkc1][gbkc2] + if not gbkdecmap[gbkc1]: + del gbkdecmap[gbkc1] + + gb2312_gbkencmap, gb18030encmap = {}, {} + for c1, m in gbkdecmap.items(): + for c2, code in m.items(): + gb2312_gbkencmap.setdefault(code >> 8, {}) + gb2312_gbkencmap[code >> 8][code & 0xff] = c1 << 8 | c2 # MSB set + for c1, m in gb2312decmap.items(): + for c2, code in m.items(): + gb2312_gbkencmap.setdefault(code >> 8, {}) + gb2312_gbkencmap[code >> 8][code & 0xff] = c1 << 8 | c2 # MSB unset + for c1, m in gb18030decmap.items(): + for c2, code in m.items(): + gb18030encmap.setdefault(code >> 8, {}) + gb18030encmap[code >> 8][code & 0xff] = c1 << 8 | c2 + + with open('mappings_cn.h', 'w') as fp: + print_autogen(fp, os.path.basename(__file__)) + + print("Generating GB2312 decode map...") + writer = DecodeMapWriter(fp, "gb2312", gb2312decmap) + writer.update_decode_map(GB2312_C1, GB2312_C2) + writer.generate() + + print("Generating GBK decode map...") + writer = DecodeMapWriter(fp, "gbkext", gbkdecmap) + writer.update_decode_map(GBKL1_C1, GBKL1_C2) + writer.update_decode_map(GBKL2_C1, GBKL2_C2) + writer.generate() + + print("Generating GB2312 && GBK encode map...") + writer = EncodeMapWriter(fp, "gbcommon", gb2312_gbkencmap) + writer.generate() + + print("Generating GB18030 extension decode map...") + writer = DecodeMapWriter(fp, "gb18030ext", gb18030decmap) + for i in range(1, 6): + writer.update_decode_map(eval("GB18030EXTP%d_C1" % i), eval("GB18030EXTP%d_C2" % i)) + + writer.generate() + + print("Generating GB18030 extension encode map...") + writer = EncodeMapWriter(fp, "gb18030ext", gb18030encmap) + writer.generate() + + print("Generating GB18030 Unicode BMP Mapping Ranges...") + ranges = [[-1, -1, -1]] + gblinnum = 0 + fp.write(""" +static const struct _gb18030_to_unibmp_ranges { + Py_UCS4 first, last; + DBCHAR base; +} gb18030_to_unibmp_ranges[] = { +""") + + for uni in gb18030unilinear: + if uni == ranges[-1][1] + 1: + ranges[-1][1] = uni + else: + ranges.append([uni, uni, gblinnum]) + gblinnum += 1 + + filler = BufferedFiller() + for first, last, base in ranges[1:]: + filler.write('{', str(first), ',', str(last), ',', str(base), '},') + + filler.write('{', '0,', '0,', str( + ranges[-1][2] + ranges[-1][1] - ranges[-1][0] + 1), '}', '};') + filler.printout(fp) + + print("Done!") + + +if __name__ == '__main__': + main() diff --git a/Tools/unicode/genmap_support.py b/Tools/unicode/genmap_support.py new file mode 100644 index 0000000000000..5e1d9ee77b000 --- /dev/null +++ b/Tools/unicode/genmap_support.py @@ -0,0 +1,198 @@ +# +# genmap_support.py: Multibyte Codec Map Generator +# +# Original Author: Hye-Shik Chang +# Modified Author: Dong-hee Na +# + + +class BufferedFiller: + def __init__(self, column=78): + self.column = column + self.buffered = [] + self.cline = [] + self.clen = 0 + self.count = 0 + + def write(self, *data): + for s in data: + if len(s) > self.column: + raise ValueError("token is too long") + if len(s) + self.clen > self.column: + self.flush() + self.clen += len(s) + self.cline.append(s) + self.count += 1 + + def flush(self): + if not self.cline: + return + self.buffered.append(''.join(self.cline)) + self.clen = 0 + del self.cline[:] + + def printout(self, fp): + self.flush() + for l in self.buffered: + fp.write(f'{l}\n') + del self.buffered[:] + + def __len__(self): + return self.count + + +class DecodeMapWriter: + filler_class = BufferedFiller + + def __init__(self, fp, prefix, decode_map): + self.fp = fp + self.prefix = prefix + self.decode_map = decode_map + self.filler = self.filler_class() + + def update_decode_map(self, c1range, c2range, onlymask=(), wide=0): + c2values = range(c2range[0], c2range[1] + 1) + + for c1 in range(c1range[0], c1range[1] + 1): + if c1 not in self.decode_map or (onlymask and c1 not in onlymask): + continue + c2map = self.decode_map[c1] + rc2values = [n for n in c2values if n in c2map] + if not rc2values: + continue + + c2map[self.prefix] = True + c2map['min'] = rc2values[0] + c2map['max'] = rc2values[-1] + c2map['midx'] = len(self.filler) + + for v in range(rc2values[0], rc2values[-1] + 1): + if v in c2map: + self.filler.write('%d,' % c2map[v]) + else: + self.filler.write('U,') + + def generate(self, wide=False): + if not wide: + self.fp.write(f"static const ucs2_t __{self.prefix}_decmap[{len(self.filler)}] = {{\n") + else: + self.fp.write(f"static const Py_UCS4 __{self.prefix}_decmap[{len(self.filler)}] = {{\n") + + self.filler.printout(self.fp) + self.fp.write("};\n\n") + + if not wide: + self.fp.write(f"static const struct dbcs_index {self.prefix}_decmap[256] = {{\n") + else: + self.fp.write(f"static const struct widedbcs_index {self.prefix}_decmap[256] = {{\n") + + for i in range(256): + if i in self.decode_map and self.prefix in self.decode_map[i]: + m = self.decode_map + prefix = self.prefix + else: + self.filler.write("{", "0,", "0,", "0", "},") + continue + + self.filler.write("{", "__%s_decmap" % prefix, "+", "%d" % m[i]['midx'], + ",", "%d," % m[i]['min'], "%d" % m[i]['max'], "},") + self.filler.printout(self.fp) + self.fp.write("};\n\n") + + +class EncodeMapWriter: + filler_class = BufferedFiller + elemtype = 'DBCHAR' + indextype = 'struct unim_index' + + def __init__(self, fp, prefix, encode_map): + self.fp = fp + self.prefix = prefix + self.encode_map = encode_map + self.filler = self.filler_class() + + def generate(self): + self.buildmap() + self.printmap() + + def buildmap(self): + for c1 in range(0, 256): + if c1 not in self.encode_map: + continue + c2map = self.encode_map[c1] + rc2values = [k for k in c2map.keys()] + rc2values.sort() + if not rc2values: + continue + + c2map[self.prefix] = True + c2map['min'] = rc2values[0] + c2map['max'] = rc2values[-1] + c2map['midx'] = len(self.filler) + + for v in range(rc2values[0], rc2values[-1] + 1): + if v not in c2map: + self.write_nochar() + elif isinstance(c2map[v], int): + self.write_char(c2map[v]) + elif isinstance(c2map[v], tuple): + self.write_multic(c2map[v]) + else: + raise ValueError + + def write_nochar(self): + self.filler.write('N,') + + def write_multic(self, point): + self.filler.write('M,') + + def write_char(self, point): + self.filler.write(str(point) + ',') + + def printmap(self): + self.fp.write(f"static const {self.elemtype} __{self.prefix}_encmap[{len(self.filler)}] = {{\n") + self.filler.printout(self.fp) + self.fp.write("};\n\n") + self.fp.write(f"static const {self.indextype} {self.prefix}_encmap[256] = {{\n") + + for i in range(256): + if i in self.encode_map and self.prefix in self.encode_map[i]: + self.filler.write("{", "__%s_encmap" % self.prefix, "+", + "%d" % self.encode_map[i]['midx'], ",", + "%d," % self.encode_map[i]['min'], + "%d" % self.encode_map[i]['max'], "},") + else: + self.filler.write("{", "0,", "0,", "0", "},") + continue + self.filler.printout(self.fp) + self.fp.write("};\n\n") + + +def open_mapping_file(path, source): + try: + f = open(path) + except IOError: + raise SystemExit(f'{source} is needed') + return f + + +def print_autogen(fo, source): + fo.write(f'// AUTO-GENERATED FILE FROM {source}: DO NOT EDIT\n') + + +def loadmap(fo, natcol=0, unicol=1, sbcs=0): + print("Loading from", fo) + fo.seek(0, 0) + decmap = {} + for line in fo: + line = line.split('#', 1)[0].strip() + if not line or len(line.split()) < 2: + continue + + row = [eval(e) for e in line.split()] + loc, uni = row[natcol], row[unicol] + if loc >= 0x100 or sbcs: + decmap.setdefault((loc >> 8), {}) + decmap[(loc >> 8)][(loc & 0xff)] = uni + + return decmap diff --git a/Tools/unicode/python-mappings/GB2312.TXT b/Tools/unicode/python-mappings/GB2312.TXT new file mode 100644 index 0000000000000..334b4cdb94863 --- /dev/null +++ b/Tools/unicode/python-mappings/GB2312.TXT @@ -0,0 +1,7515 @@ +# +# Name: GB2312-80 to Unicode table (complete, hex format) +# Unicode version: 3.0 +# Table version: 1.0 +# Table format: Format A +# Date: 1999 October 8 +# +# Copyright (c) 1991-1999 Unicode, Inc. All Rights reserved. +# +# This file is provided as-is by Unicode, Inc. (The Unicode Consortium). +# No claims are made as to fitness for any particular purpose. No +# warranties of any kind are expressed or implied. The recipient +# agrees to determine applicability of information provided. If this +# file has been provided on optical media by Unicode, Inc., the sole +# remedy for any claim will be exchange of defective media within 90 +# days of receipt. +# +# Unicode, Inc. hereby grants the right to freely use the information +# supplied in this file in the creation of products supporting the +# Unicode Standard, and to make copies of this file in any form for +# internal or external distribution as long as this notice remains +# attached. +# +# General notes: +# +# +# This table contains one set of mappings from GB2312-80 into Unicode. +# Note that these data are *possible* mappings only and may not be the +# same as those used by actual products, nor may they be the best suited +# for all uses. For more information on the mappings between various code +# pages incorporating the repertoire of GB2312-80 and Unicode, consult the +# VENDORS mapping data. Normative information on the mapping between +# GB2312-80 and Unicode may be found in the Unihan.txt file in the +# latest Unicode Character Database. +# +# If you have carefully considered the fact that the mappings in +# this table are only one possible set of mappings between GB2312-80 and +# Unicode and have no normative status, but still feel that you +# have located an error in the table that requires fixing, you may +# report any such error to errata at unicode.org. +# +# +# Format: Three tab-separated columns +# Column #1 is the GB2312 code (in hex as 0xXXXX) +# Column #2 is the Unicode (in hex as 0xXXXX) +# Column #3 the Unicode name (follows a comment sign, '#') +# The official names for Unicode characters U+4E00 +# to U+9FA5, inclusive, is "CJK UNIFIED IDEOGRAPH-XXXX", +# where XXXX is the code point. Including all these +# names in this file increases its size substantially +# and needlessly. The token "" is used for the +# name of these characters. If necessary, it can be +# expanded algorithmically by a parser or editor. +# +# The entries are in GB2312 order +# +# The following algorithms can be used to change the hex form +# of GB2312 to other standard forms: +# +# To change hex to EUC form, add 0x8080 +# To change hex to kuten form, first subtract 0x2020. Then +# the high and low bytes correspond to the ku and ten of +# the kuten form. For example, 0x2121 -> 0x0101 -> 0101; +# 0x777E -> 0x575E -> 8794 +# +# Version history +# 1.0 version updates 0.0d2 version by correcting mapping for 0x212C +# from U+2225 to U+2016. +# +# +0x2121 0x3000 # IDEOGRAPHIC SPACE +0x2122 0x3001 # IDEOGRAPHIC COMMA +0x2123 0x3002 # IDEOGRAPHIC FULL STOP +0x2124 0x30FB # KATAKANA MIDDLE DOT +0x2125 0x02C9 # MODIFIER LETTER MACRON (Mandarin Chinese first tone) +0x2126 0x02C7 # CARON (Mandarin Chinese third tone) +0x2127 0x00A8 # DIAERESIS +0x2128 0x3003 # DITTO MARK +0x2129 0x3005 # IDEOGRAPHIC ITERATION MARK +0x212A 0x2015 # HORIZONTAL BAR +0x212B 0xFF5E # FULLWIDTH TILDE +0x212C 0x2016 # DOUBLE VERTICAL LINE +0x212D 0x2026 # HORIZONTAL ELLIPSIS +0x212E 0x2018 # LEFT SINGLE QUOTATION MARK +0x212F 0x2019 # RIGHT SINGLE QUOTATION MARK +0x2130 0x201C # LEFT DOUBLE QUOTATION MARK +0x2131 0x201D # RIGHT DOUBLE QUOTATION MARK +0x2132 0x3014 # LEFT TORTOISE SHELL BRACKET +0x2133 0x3015 # RIGHT TORTOISE SHELL BRACKET +0x2134 0x3008 # LEFT ANGLE BRACKET +0x2135 0x3009 # RIGHT ANGLE BRACKET +0x2136 0x300A # LEFT DOUBLE ANGLE BRACKET +0x2137 0x300B # RIGHT DOUBLE ANGLE BRACKET +0x2138 0x300C # LEFT CORNER BRACKET +0x2139 0x300D # RIGHT CORNER BRACKET +0x213A 0x300E # LEFT WHITE CORNER BRACKET +0x213B 0x300F # RIGHT WHITE CORNER BRACKET +0x213C 0x3016 # LEFT WHITE LENTICULAR BRACKET +0x213D 0x3017 # RIGHT WHITE LENTICULAR BRACKET +0x213E 0x3010 # LEFT BLACK LENTICULAR BRACKET +0x213F 0x3011 # RIGHT BLACK LENTICULAR BRACKET +0x2140 0x00B1 # PLUS-MINUS SIGN +0x2141 0x00D7 # MULTIPLICATION SIGN +0x2142 0x00F7 # DIVISION SIGN +0x2143 0x2236 # RATIO +0x2144 0x2227 # LOGICAL AND +0x2145 0x2228 # LOGICAL OR +0x2146 0x2211 # N-ARY SUMMATION +0x2147 0x220F # N-ARY PRODUCT +0x2148 0x222A # UNION +0x2149 0x2229 # INTERSECTION +0x214A 0x2208 # ELEMENT OF +0x214B 0x2237 # PROPORTION +0x214C 0x221A # SQUARE ROOT +0x214D 0x22A5 # UP TACK +0x214E 0x2225 # PARALLEL TO +0x214F 0x2220 # ANGLE +0x2150 0x2312 # ARC +0x2151 0x2299 # CIRCLED DOT OPERATOR +0x2152 0x222B # INTEGRAL +0x2153 0x222E # CONTOUR INTEGRAL +0x2154 0x2261 # IDENTICAL TO +0x2155 0x224C # ALL EQUAL TO +0x2156 0x2248 # ALMOST EQUAL TO +0x2157 0x223D # REVERSED TILDE +0x2158 0x221D # PROPORTIONAL TO +0x2159 0x2260 # NOT EQUAL TO +0x215A 0x226E # NOT LESS-THAN +0x215B 0x226F # NOT GREATER-THAN +0x215C 0x2264 # LESS-THAN OR EQUAL TO +0x215D 0x2265 # GREATER-THAN OR EQUAL TO +0x215E 0x221E # INFINITY +0x215F 0x2235 # BECAUSE +0x2160 0x2234 # THEREFORE +0x2161 0x2642 # MALE SIGN +0x2162 0x2640 # FEMALE SIGN +0x2163 0x00B0 # DEGREE SIGN +0x2164 0x2032 # PRIME +0x2165 0x2033 # DOUBLE PRIME +0x2166 0x2103 # DEGREE CELSIUS +0x2167 0xFF04 # FULLWIDTH DOLLAR SIGN +0x2168 0x00A4 # CURRENCY SIGN +0x2169 0xFFE0 # FULLWIDTH CENT SIGN +0x216A 0xFFE1 # FULLWIDTH POUND SIGN +0x216B 0x2030 # PER MILLE SIGN +0x216C 0x00A7 # SECTION SIGN +0x216D 0x2116 # NUMERO SIGN +0x216E 0x2606 # WHITE STAR +0x216F 0x2605 # BLACK STAR +0x2170 0x25CB # WHITE CIRCLE +0x2171 0x25CF # BLACK CIRCLE +0x2172 0x25CE # BULLSEYE +0x2173 0x25C7 # WHITE DIAMOND +0x2174 0x25C6 # BLACK DIAMOND +0x2175 0x25A1 # WHITE SQUARE +0x2176 0x25A0 # BLACK SQUARE +0x2177 0x25B3 # WHITE UP-POINTING TRIANGLE +0x2178 0x25B2 # BLACK UP-POINTING TRIANGLE +0x2179 0x203B # REFERENCE MARK +0x217A 0x2192 # RIGHTWARDS ARROW +0x217B 0x2190 # LEFTWARDS ARROW +0x217C 0x2191 # UPWARDS ARROW +0x217D 0x2193 # DOWNWARDS ARROW +0x217E 0x3013 # GETA MARK +0x2231 0x2488 # DIGIT ONE FULL STOP +0x2232 0x2489 # DIGIT TWO FULL STOP +0x2233 0x248A # DIGIT THREE FULL STOP +0x2234 0x248B # DIGIT FOUR FULL STOP +0x2235 0x248C # DIGIT FIVE FULL STOP +0x2236 0x248D # DIGIT SIX FULL STOP +0x2237 0x248E # DIGIT SEVEN FULL STOP +0x2238 0x248F # DIGIT EIGHT FULL STOP +0x2239 0x2490 # DIGIT NINE FULL STOP +0x223A 0x2491 # NUMBER TEN FULL STOP +0x223B 0x2492 # NUMBER ELEVEN FULL STOP +0x223C 0x2493 # NUMBER TWELVE FULL STOP +0x223D 0x2494 # NUMBER THIRTEEN FULL STOP +0x223E 0x2495 # NUMBER FOURTEEN FULL STOP +0x223F 0x2496 # NUMBER FIFTEEN FULL STOP +0x2240 0x2497 # NUMBER SIXTEEN FULL STOP +0x2241 0x2498 # NUMBER SEVENTEEN FULL STOP +0x2242 0x2499 # NUMBER EIGHTEEN FULL STOP +0x2243 0x249A # NUMBER NINETEEN FULL STOP +0x2244 0x249B # NUMBER TWENTY FULL STOP +0x2245 0x2474 # PARENTHESIZED DIGIT ONE +0x2246 0x2475 # PARENTHESIZED DIGIT TWO +0x2247 0x2476 # PARENTHESIZED DIGIT THREE +0x2248 0x2477 # PARENTHESIZED DIGIT FOUR +0x2249 0x2478 # PARENTHESIZED DIGIT FIVE +0x224A 0x2479 # PARENTHESIZED DIGIT SIX +0x224B 0x247A # PARENTHESIZED DIGIT SEVEN +0x224C 0x247B # PARENTHESIZED DIGIT EIGHT +0x224D 0x247C # PARENTHESIZED DIGIT NINE +0x224E 0x247D # PARENTHESIZED NUMBER TEN +0x224F 0x247E # PARENTHESIZED NUMBER ELEVEN +0x2250 0x247F # PARENTHESIZED NUMBER TWELVE +0x2251 0x2480 # PARENTHESIZED NUMBER THIRTEEN +0x2252 0x2481 # PARENTHESIZED NUMBER FOURTEEN +0x2253 0x2482 # PARENTHESIZED NUMBER FIFTEEN +0x2254 0x2483 # PARENTHESIZED NUMBER SIXTEEN +0x2255 0x2484 # PARENTHESIZED NUMBER SEVENTEEN +0x2256 0x2485 # PARENTHESIZED NUMBER EIGHTEEN +0x2257 0x2486 # PARENTHESIZED NUMBER NINETEEN +0x2258 0x2487 # PARENTHESIZED NUMBER TWENTY +0x2259 0x2460 # CIRCLED DIGIT ONE +0x225A 0x2461 # CIRCLED DIGIT TWO +0x225B 0x2462 # CIRCLED DIGIT THREE +0x225C 0x2463 # CIRCLED DIGIT FOUR +0x225D 0x2464 # CIRCLED DIGIT FIVE +0x225E 0x2465 # CIRCLED DIGIT SIX +0x225F 0x2466 # CIRCLED DIGIT SEVEN +0x2260 0x2467 # CIRCLED DIGIT EIGHT +0x2261 0x2468 # CIRCLED DIGIT NINE +0x2262 0x2469 # CIRCLED NUMBER TEN +0x2265 0x3220 # PARENTHESIZED IDEOGRAPH ONE +0x2266 0x3221 # PARENTHESIZED IDEOGRAPH TWO +0x2267 0x3222 # PARENTHESIZED IDEOGRAPH THREE +0x2268 0x3223 # PARENTHESIZED IDEOGRAPH FOUR +0x2269 0x3224 # PARENTHESIZED IDEOGRAPH FIVE +0x226A 0x3225 # PARENTHESIZED IDEOGRAPH SIX +0x226B 0x3226 # PARENTHESIZED IDEOGRAPH SEVEN +0x226C 0x3227 # PARENTHESIZED IDEOGRAPH EIGHT +0x226D 0x3228 # PARENTHESIZED IDEOGRAPH NINE +0x226E 0x3229 # PARENTHESIZED IDEOGRAPH TEN +0x2271 0x2160 # ROMAN NUMERAL ONE +0x2272 0x2161 # ROMAN NUMERAL TWO +0x2273 0x2162 # ROMAN NUMERAL THREE +0x2274 0x2163 # ROMAN NUMERAL FOUR +0x2275 0x2164 # ROMAN NUMERAL FIVE +0x2276 0x2165 # ROMAN NUMERAL SIX +0x2277 0x2166 # ROMAN NUMERAL SEVEN +0x2278 0x2167 # ROMAN NUMERAL EIGHT +0x2279 0x2168 # ROMAN NUMERAL NINE +0x227A 0x2169 # ROMAN NUMERAL TEN +0x227B 0x216A # ROMAN NUMERAL ELEVEN +0x227C 0x216B # ROMAN NUMERAL TWELVE +0x2321 0xFF01 # FULLWIDTH EXCLAMATION MARK +0x2322 0xFF02 # FULLWIDTH QUOTATION MARK +0x2323 0xFF03 # FULLWIDTH NUMBER SIGN +0x2324 0xFFE5 # FULLWIDTH YEN SIGN +0x2325 0xFF05 # FULLWIDTH PERCENT SIGN +0x2326 0xFF06 # FULLWIDTH AMPERSAND +0x2327 0xFF07 # FULLWIDTH APOSTROPHE +0x2328 0xFF08 # FULLWIDTH LEFT PARENTHESIS +0x2329 0xFF09 # FULLWIDTH RIGHT PARENTHESIS +0x232A 0xFF0A # FULLWIDTH ASTERISK +0x232B 0xFF0B # FULLWIDTH PLUS SIGN +0x232C 0xFF0C # FULLWIDTH COMMA +0x232D 0xFF0D # FULLWIDTH HYPHEN-MINUS +0x232E 0xFF0E # FULLWIDTH FULL STOP +0x232F 0xFF0F # FULLWIDTH SOLIDUS +0x2330 0xFF10 # FULLWIDTH DIGIT ZERO +0x2331 0xFF11 # FULLWIDTH DIGIT ONE +0x2332 0xFF12 # FULLWIDTH DIGIT TWO +0x2333 0xFF13 # FULLWIDTH DIGIT THREE +0x2334 0xFF14 # FULLWIDTH DIGIT FOUR +0x2335 0xFF15 # FULLWIDTH DIGIT FIVE +0x2336 0xFF16 # FULLWIDTH DIGIT SIX +0x2337 0xFF17 # FULLWIDTH DIGIT SEVEN +0x2338 0xFF18 # FULLWIDTH DIGIT EIGHT +0x2339 0xFF19 # FULLWIDTH DIGIT NINE +0x233A 0xFF1A # FULLWIDTH COLON +0x233B 0xFF1B # FULLWIDTH SEMICOLON +0x233C 0xFF1C # FULLWIDTH LESS-THAN SIGN +0x233D 0xFF1D # FULLWIDTH EQUALS SIGN +0x233E 0xFF1E # FULLWIDTH GREATER-THAN SIGN +0x233F 0xFF1F # FULLWIDTH QUESTION MARK +0x2340 0xFF20 # FULLWIDTH COMMERCIAL AT +0x2341 0xFF21 # FULLWIDTH LATIN CAPITAL LETTER A +0x2342 0xFF22 # FULLWIDTH LATIN CAPITAL LETTER B +0x2343 0xFF23 # FULLWIDTH LATIN CAPITAL LETTER C +0x2344 0xFF24 # FULLWIDTH LATIN CAPITAL LETTER D +0x2345 0xFF25 # FULLWIDTH LATIN CAPITAL LETTER E +0x2346 0xFF26 # FULLWIDTH LATIN CAPITAL LETTER F +0x2347 0xFF27 # FULLWIDTH LATIN CAPITAL LETTER G +0x2348 0xFF28 # FULLWIDTH LATIN CAPITAL LETTER H +0x2349 0xFF29 # FULLWIDTH LATIN CAPITAL LETTER I +0x234A 0xFF2A # FULLWIDTH LATIN CAPITAL LETTER J +0x234B 0xFF2B # FULLWIDTH LATIN CAPITAL LETTER K +0x234C 0xFF2C # FULLWIDTH LATIN CAPITAL LETTER L +0x234D 0xFF2D # FULLWIDTH LATIN CAPITAL LETTER M +0x234E 0xFF2E # FULLWIDTH LATIN CAPITAL LETTER N +0x234F 0xFF2F # FULLWIDTH LATIN CAPITAL LETTER O +0x2350 0xFF30 # FULLWIDTH LATIN CAPITAL LETTER P +0x2351 0xFF31 # FULLWIDTH LATIN CAPITAL LETTER Q +0x2352 0xFF32 # FULLWIDTH LATIN CAPITAL LETTER R +0x2353 0xFF33 # FULLWIDTH LATIN CAPITAL LETTER S +0x2354 0xFF34 # FULLWIDTH LATIN CAPITAL LETTER T +0x2355 0xFF35 # FULLWIDTH LATIN CAPITAL LETTER U +0x2356 0xFF36 # FULLWIDTH LATIN CAPITAL LETTER V +0x2357 0xFF37 # FULLWIDTH LATIN CAPITAL LETTER W +0x2358 0xFF38 # FULLWIDTH LATIN CAPITAL LETTER X +0x2359 0xFF39 # FULLWIDTH LATIN CAPITAL LETTER Y +0x235A 0xFF3A # FULLWIDTH LATIN CAPITAL LETTER Z +0x235B 0xFF3B # FULLWIDTH LEFT SQUARE BRACKET +0x235C 0xFF3C # FULLWIDTH REVERSE SOLIDUS +0x235D 0xFF3D # FULLWIDTH RIGHT SQUARE BRACKET +0x235E 0xFF3E # FULLWIDTH CIRCUMFLEX ACCENT +0x235F 0xFF3F # FULLWIDTH LOW LINE +0x2360 0xFF40 # FULLWIDTH GRAVE ACCENT +0x2361 0xFF41 # FULLWIDTH LATIN SMALL LETTER A +0x2362 0xFF42 # FULLWIDTH LATIN SMALL LETTER B +0x2363 0xFF43 # FULLWIDTH LATIN SMALL LETTER C +0x2364 0xFF44 # FULLWIDTH LATIN SMALL LETTER D +0x2365 0xFF45 # FULLWIDTH LATIN SMALL LETTER E +0x2366 0xFF46 # FULLWIDTH LATIN SMALL LETTER F +0x2367 0xFF47 # FULLWIDTH LATIN SMALL LETTER G +0x2368 0xFF48 # FULLWIDTH LATIN SMALL LETTER H +0x2369 0xFF49 # FULLWIDTH LATIN SMALL LETTER I +0x236A 0xFF4A # FULLWIDTH LATIN SMALL LETTER J +0x236B 0xFF4B # FULLWIDTH LATIN SMALL LETTER K +0x236C 0xFF4C # FULLWIDTH LATIN SMALL LETTER L +0x236D 0xFF4D # FULLWIDTH LATIN SMALL LETTER M +0x236E 0xFF4E # FULLWIDTH LATIN SMALL LETTER N +0x236F 0xFF4F # FULLWIDTH LATIN SMALL LETTER O +0x2370 0xFF50 # FULLWIDTH LATIN SMALL LETTER P +0x2371 0xFF51 # FULLWIDTH LATIN SMALL LETTER Q +0x2372 0xFF52 # FULLWIDTH LATIN SMALL LETTER R +0x2373 0xFF53 # FULLWIDTH LATIN SMALL LETTER S +0x2374 0xFF54 # FULLWIDTH LATIN SMALL LETTER T +0x2375 0xFF55 # FULLWIDTH LATIN SMALL LETTER U +0x2376 0xFF56 # FULLWIDTH LATIN SMALL LETTER V +0x2377 0xFF57 # FULLWIDTH LATIN SMALL LETTER W +0x2378 0xFF58 # FULLWIDTH LATIN SMALL LETTER X +0x2379 0xFF59 # FULLWIDTH LATIN SMALL LETTER Y +0x237A 0xFF5A # FULLWIDTH LATIN SMALL LETTER Z +0x237B 0xFF5B # FULLWIDTH LEFT CURLY BRACKET +0x237C 0xFF5C # FULLWIDTH VERTICAL LINE +0x237D 0xFF5D # FULLWIDTH RIGHT CURLY BRACKET +0x237E 0xFFE3 # FULLWIDTH MACRON +0x2421 0x3041 # HIRAGANA LETTER SMALL A +0x2422 0x3042 # HIRAGANA LETTER A +0x2423 0x3043 # HIRAGANA LETTER SMALL I +0x2424 0x3044 # HIRAGANA LETTER I +0x2425 0x3045 # HIRAGANA LETTER SMALL U +0x2426 0x3046 # HIRAGANA LETTER U +0x2427 0x3047 # HIRAGANA LETTER SMALL E +0x2428 0x3048 # HIRAGANA LETTER E +0x2429 0x3049 # HIRAGANA LETTER SMALL O +0x242A 0x304A # HIRAGANA LETTER O +0x242B 0x304B # HIRAGANA LETTER KA +0x242C 0x304C # HIRAGANA LETTER GA +0x242D 0x304D # HIRAGANA LETTER KI +0x242E 0x304E # HIRAGANA LETTER GI +0x242F 0x304F # HIRAGANA LETTER KU +0x2430 0x3050 # HIRAGANA LETTER GU +0x2431 0x3051 # HIRAGANA LETTER KE +0x2432 0x3052 # HIRAGANA LETTER GE +0x2433 0x3053 # HIRAGANA LETTER KO +0x2434 0x3054 # HIRAGANA LETTER GO +0x2435 0x3055 # HIRAGANA LETTER SA +0x2436 0x3056 # HIRAGANA LETTER ZA +0x2437 0x3057 # HIRAGANA LETTER SI +0x2438 0x3058 # HIRAGANA LETTER ZI +0x2439 0x3059 # HIRAGANA LETTER SU +0x243A 0x305A # HIRAGANA LETTER ZU +0x243B 0x305B # HIRAGANA LETTER SE +0x243C 0x305C # HIRAGANA LETTER ZE +0x243D 0x305D # HIRAGANA LETTER SO +0x243E 0x305E # HIRAGANA LETTER ZO +0x243F 0x305F # HIRAGANA LETTER TA +0x2440 0x3060 # HIRAGANA LETTER DA +0x2441 0x3061 # HIRAGANA LETTER TI +0x2442 0x3062 # HIRAGANA LETTER DI +0x2443 0x3063 # HIRAGANA LETTER SMALL TU +0x2444 0x3064 # HIRAGANA LETTER TU +0x2445 0x3065 # HIRAGANA LETTER DU +0x2446 0x3066 # HIRAGANA LETTER TE +0x2447 0x3067 # HIRAGANA LETTER DE +0x2448 0x3068 # HIRAGANA LETTER TO +0x2449 0x3069 # HIRAGANA LETTER DO +0x244A 0x306A # HIRAGANA LETTER NA +0x244B 0x306B # HIRAGANA LETTER NI +0x244C 0x306C # HIRAGANA LETTER NU +0x244D 0x306D # HIRAGANA LETTER NE +0x244E 0x306E # HIRAGANA LETTER NO +0x244F 0x306F # HIRAGANA LETTER HA +0x2450 0x3070 # HIRAGANA LETTER BA +0x2451 0x3071 # HIRAGANA LETTER PA +0x2452 0x3072 # HIRAGANA LETTER HI +0x2453 0x3073 # HIRAGANA LETTER BI +0x2454 0x3074 # HIRAGANA LETTER PI +0x2455 0x3075 # HIRAGANA LETTER HU +0x2456 0x3076 # HIRAGANA LETTER BU +0x2457 0x3077 # HIRAGANA LETTER PU +0x2458 0x3078 # HIRAGANA LETTER HE +0x2459 0x3079 # HIRAGANA LETTER BE +0x245A 0x307A # HIRAGANA LETTER PE +0x245B 0x307B # HIRAGANA LETTER HO +0x245C 0x307C # HIRAGANA LETTER BO +0x245D 0x307D # HIRAGANA LETTER PO +0x245E 0x307E # HIRAGANA LETTER MA +0x245F 0x307F # HIRAGANA LETTER MI +0x2460 0x3080 # HIRAGANA LETTER MU +0x2461 0x3081 # HIRAGANA LETTER ME +0x2462 0x3082 # HIRAGANA LETTER MO +0x2463 0x3083 # HIRAGANA LETTER SMALL YA +0x2464 0x3084 # HIRAGANA LETTER YA +0x2465 0x3085 # HIRAGANA LETTER SMALL YU +0x2466 0x3086 # HIRAGANA LETTER YU +0x2467 0x3087 # HIRAGANA LETTER SMALL YO +0x2468 0x3088 # HIRAGANA LETTER YO +0x2469 0x3089 # HIRAGANA LETTER RA +0x246A 0x308A # HIRAGANA LETTER RI +0x246B 0x308B # HIRAGANA LETTER RU +0x246C 0x308C # HIRAGANA LETTER RE +0x246D 0x308D # HIRAGANA LETTER RO +0x246E 0x308E # HIRAGANA LETTER SMALL WA +0x246F 0x308F # HIRAGANA LETTER WA +0x2470 0x3090 # HIRAGANA LETTER WI +0x2471 0x3091 # HIRAGANA LETTER WE +0x2472 0x3092 # HIRAGANA LETTER WO +0x2473 0x3093 # HIRAGANA LETTER N +0x2521 0x30A1 # KATAKANA LETTER SMALL A +0x2522 0x30A2 # KATAKANA LETTER A +0x2523 0x30A3 # KATAKANA LETTER SMALL I +0x2524 0x30A4 # KATAKANA LETTER I +0x2525 0x30A5 # KATAKANA LETTER SMALL U +0x2526 0x30A6 # KATAKANA LETTER U +0x2527 0x30A7 # KATAKANA LETTER SMALL E +0x2528 0x30A8 # KATAKANA LETTER E +0x2529 0x30A9 # KATAKANA LETTER SMALL O +0x252A 0x30AA # KATAKANA LETTER O +0x252B 0x30AB # KATAKANA LETTER KA +0x252C 0x30AC # KATAKANA LETTER GA +0x252D 0x30AD # KATAKANA LETTER KI +0x252E 0x30AE # KATAKANA LETTER GI +0x252F 0x30AF # KATAKANA LETTER KU +0x2530 0x30B0 # KATAKANA LETTER GU +0x2531 0x30B1 # KATAKANA LETTER KE +0x2532 0x30B2 # KATAKANA LETTER GE +0x2533 0x30B3 # KATAKANA LETTER KO +0x2534 0x30B4 # KATAKANA LETTER GO +0x2535 0x30B5 # KATAKANA LETTER SA +0x2536 0x30B6 # KATAKANA LETTER ZA +0x2537 0x30B7 # KATAKANA LETTER SI +0x2538 0x30B8 # KATAKANA LETTER ZI +0x2539 0x30B9 # KATAKANA LETTER SU +0x253A 0x30BA # KATAKANA LETTER ZU +0x253B 0x30BB # KATAKANA LETTER SE +0x253C 0x30BC # KATAKANA LETTER ZE +0x253D 0x30BD # KATAKANA LETTER SO +0x253E 0x30BE # KATAKANA LETTER ZO +0x253F 0x30BF # KATAKANA LETTER TA +0x2540 0x30C0 # KATAKANA LETTER DA +0x2541 0x30C1 # KATAKANA LETTER TI +0x2542 0x30C2 # KATAKANA LETTER DI +0x2543 0x30C3 # KATAKANA LETTER SMALL TU +0x2544 0x30C4 # KATAKANA LETTER TU +0x2545 0x30C5 # KATAKANA LETTER DU +0x2546 0x30C6 # KATAKANA LETTER TE +0x2547 0x30C7 # KATAKANA LETTER DE +0x2548 0x30C8 # KATAKANA LETTER TO +0x2549 0x30C9 # KATAKANA LETTER DO +0x254A 0x30CA # KATAKANA LETTER NA +0x254B 0x30CB # KATAKANA LETTER NI +0x254C 0x30CC # KATAKANA LETTER NU +0x254D 0x30CD # KATAKANA LETTER NE +0x254E 0x30CE # KATAKANA LETTER NO +0x254F 0x30CF # KATAKANA LETTER HA +0x2550 0x30D0 # KATAKANA LETTER BA +0x2551 0x30D1 # KATAKANA LETTER PA +0x2552 0x30D2 # KATAKANA LETTER HI +0x2553 0x30D3 # KATAKANA LETTER BI +0x2554 0x30D4 # KATAKANA LETTER PI +0x2555 0x30D5 # KATAKANA LETTER HU +0x2556 0x30D6 # KATAKANA LETTER BU +0x2557 0x30D7 # KATAKANA LETTER PU +0x2558 0x30D8 # KATAKANA LETTER HE +0x2559 0x30D9 # KATAKANA LETTER BE +0x255A 0x30DA # KATAKANA LETTER PE +0x255B 0x30DB # KATAKANA LETTER HO +0x255C 0x30DC # KATAKANA LETTER BO +0x255D 0x30DD # KATAKANA LETTER PO +0x255E 0x30DE # KATAKANA LETTER MA +0x255F 0x30DF # KATAKANA LETTER MI +0x2560 0x30E0 # KATAKANA LETTER MU +0x2561 0x30E1 # KATAKANA LETTER ME +0x2562 0x30E2 # KATAKANA LETTER MO +0x2563 0x30E3 # KATAKANA LETTER SMALL YA +0x2564 0x30E4 # KATAKANA LETTER YA +0x2565 0x30E5 # KATAKANA LETTER SMALL YU +0x2566 0x30E6 # KATAKANA LETTER YU +0x2567 0x30E7 # KATAKANA LETTER SMALL YO +0x2568 0x30E8 # KATAKANA LETTER YO +0x2569 0x30E9 # KATAKANA LETTER RA +0x256A 0x30EA # KATAKANA LETTER RI +0x256B 0x30EB # KATAKANA LETTER RU +0x256C 0x30EC # KATAKANA LETTER RE +0x256D 0x30ED # KATAKANA LETTER RO +0x256E 0x30EE # KATAKANA LETTER SMALL WA +0x256F 0x30EF # KATAKANA LETTER WA +0x2570 0x30F0 # KATAKANA LETTER WI +0x2571 0x30F1 # KATAKANA LETTER WE +0x2572 0x30F2 # KATAKANA LETTER WO +0x2573 0x30F3 # KATAKANA LETTER N +0x2574 0x30F4 # KATAKANA LETTER VU +0x2575 0x30F5 # KATAKANA LETTER SMALL KA +0x2576 0x30F6 # KATAKANA LETTER SMALL KE +0x2621 0x0391 # GREEK CAPITAL LETTER ALPHA +0x2622 0x0392 # GREEK CAPITAL LETTER BETA +0x2623 0x0393 # GREEK CAPITAL LETTER GAMMA +0x2624 0x0394 # GREEK CAPITAL LETTER DELTA +0x2625 0x0395 # GREEK CAPITAL LETTER EPSILON +0x2626 0x0396 # GREEK CAPITAL LETTER ZETA +0x2627 0x0397 # GREEK CAPITAL LETTER ETA +0x2628 0x0398 # GREEK CAPITAL LETTER THETA +0x2629 0x0399 # GREEK CAPITAL LETTER IOTA +0x262A 0x039A # GREEK CAPITAL LETTER KAPPA +0x262B 0x039B # GREEK CAPITAL LETTER LAMDA +0x262C 0x039C # GREEK CAPITAL LETTER MU +0x262D 0x039D # GREEK CAPITAL LETTER NU +0x262E 0x039E # GREEK CAPITAL LETTER XI +0x262F 0x039F # GREEK CAPITAL LETTER OMICRON +0x2630 0x03A0 # GREEK CAPITAL LETTER PI +0x2631 0x03A1 # GREEK CAPITAL LETTER RHO +0x2632 0x03A3 # GREEK CAPITAL LETTER SIGMA +0x2633 0x03A4 # GREEK CAPITAL LETTER TAU +0x2634 0x03A5 # GREEK CAPITAL LETTER UPSILON +0x2635 0x03A6 # GREEK CAPITAL LETTER PHI +0x2636 0x03A7 # GREEK CAPITAL LETTER CHI +0x2637 0x03A8 # GREEK CAPITAL LETTER PSI +0x2638 0x03A9 # GREEK CAPITAL LETTER OMEGA +0x2641 0x03B1 # GREEK SMALL LETTER ALPHA +0x2642 0x03B2 # GREEK SMALL LETTER BETA +0x2643 0x03B3 # GREEK SMALL LETTER GAMMA +0x2644 0x03B4 # GREEK SMALL LETTER DELTA +0x2645 0x03B5 # GREEK SMALL LETTER EPSILON +0x2646 0x03B6 # GREEK SMALL LETTER ZETA +0x2647 0x03B7 # GREEK SMALL LETTER ETA +0x2648 0x03B8 # GREEK SMALL LETTER THETA +0x2649 0x03B9 # GREEK SMALL LETTER IOTA +0x264A 0x03BA # GREEK SMALL LETTER KAPPA +0x264B 0x03BB # GREEK SMALL LETTER LAMDA +0x264C 0x03BC # GREEK SMALL LETTER MU +0x264D 0x03BD # GREEK SMALL LETTER NU +0x264E 0x03BE # GREEK SMALL LETTER XI +0x264F 0x03BF # GREEK SMALL LETTER OMICRON +0x2650 0x03C0 # GREEK SMALL LETTER PI +0x2651 0x03C1 # GREEK SMALL LETTER RHO +0x2652 0x03C3 # GREEK SMALL LETTER SIGMA +0x2653 0x03C4 # GREEK SMALL LETTER TAU +0x2654 0x03C5 # GREEK SMALL LETTER UPSILON +0x2655 0x03C6 # GREEK SMALL LETTER PHI +0x2656 0x03C7 # GREEK SMALL LETTER CHI +0x2657 0x03C8 # GREEK SMALL LETTER PSI +0x2658 0x03C9 # GREEK SMALL LETTER OMEGA +0x2721 0x0410 # CYRILLIC CAPITAL LETTER A +0x2722 0x0411 # CYRILLIC CAPITAL LETTER BE +0x2723 0x0412 # CYRILLIC CAPITAL LETTER VE +0x2724 0x0413 # CYRILLIC CAPITAL LETTER GHE +0x2725 0x0414 # CYRILLIC CAPITAL LETTER DE +0x2726 0x0415 # CYRILLIC CAPITAL LETTER IE +0x2727 0x0401 # CYRILLIC CAPITAL LETTER IO +0x2728 0x0416 # CYRILLIC CAPITAL LETTER ZHE +0x2729 0x0417 # CYRILLIC CAPITAL LETTER ZE +0x272A 0x0418 # CYRILLIC CAPITAL LETTER I +0x272B 0x0419 # CYRILLIC CAPITAL LETTER SHORT I +0x272C 0x041A # CYRILLIC CAPITAL LETTER KA +0x272D 0x041B # CYRILLIC CAPITAL LETTER EL +0x272E 0x041C # CYRILLIC CAPITAL LETTER EM +0x272F 0x041D # CYRILLIC CAPITAL LETTER EN +0x2730 0x041E # CYRILLIC CAPITAL LETTER O +0x2731 0x041F # CYRILLIC CAPITAL LETTER PE +0x2732 0x0420 # CYRILLIC CAPITAL LETTER ER +0x2733 0x0421 # CYRILLIC CAPITAL LETTER ES +0x2734 0x0422 # CYRILLIC CAPITAL LETTER TE +0x2735 0x0423 # CYRILLIC CAPITAL LETTER U +0x2736 0x0424 # CYRILLIC CAPITAL LETTER EF +0x2737 0x0425 # CYRILLIC CAPITAL LETTER HA +0x2738 0x0426 # CYRILLIC CAPITAL LETTER TSE +0x2739 0x0427 # CYRILLIC CAPITAL LETTER CHE +0x273A 0x0428 # CYRILLIC CAPITAL LETTER SHA +0x273B 0x0429 # CYRILLIC CAPITAL LETTER SHCHA +0x273C 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN +0x273D 0x042B # CYRILLIC CAPITAL LETTER YERU +0x273E 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN +0x273F 0x042D # CYRILLIC CAPITAL LETTER E +0x2740 0x042E # CYRILLIC CAPITAL LETTER YU +0x2741 0x042F # CYRILLIC CAPITAL LETTER YA +0x2751 0x0430 # CYRILLIC SMALL LETTER A +0x2752 0x0431 # CYRILLIC SMALL LETTER BE +0x2753 0x0432 # CYRILLIC SMALL LETTER VE +0x2754 0x0433 # CYRILLIC SMALL LETTER GHE +0x2755 0x0434 # CYRILLIC SMALL LETTER DE +0x2756 0x0435 # CYRILLIC SMALL LETTER IE +0x2757 0x0451 # CYRILLIC SMALL LETTER IO +0x2758 0x0436 # CYRILLIC SMALL LETTER ZHE +0x2759 0x0437 # CYRILLIC SMALL LETTER ZE +0x275A 0x0438 # CYRILLIC SMALL LETTER I +0x275B 0x0439 # CYRILLIC SMALL LETTER SHORT I +0x275C 0x043A # CYRILLIC SMALL LETTER KA +0x275D 0x043B # CYRILLIC SMALL LETTER EL +0x275E 0x043C # CYRILLIC SMALL LETTER EM +0x275F 0x043D # CYRILLIC SMALL LETTER EN +0x2760 0x043E # CYRILLIC SMALL LETTER O +0x2761 0x043F # CYRILLIC SMALL LETTER PE +0x2762 0x0440 # CYRILLIC SMALL LETTER ER +0x2763 0x0441 # CYRILLIC SMALL LETTER ES +0x2764 0x0442 # CYRILLIC SMALL LETTER TE +0x2765 0x0443 # CYRILLIC SMALL LETTER U +0x2766 0x0444 # CYRILLIC SMALL LETTER EF +0x2767 0x0445 # CYRILLIC SMALL LETTER HA +0x2768 0x0446 # CYRILLIC SMALL LETTER TSE +0x2769 0x0447 # CYRILLIC SMALL LETTER CHE +0x276A 0x0448 # CYRILLIC SMALL LETTER SHA +0x276B 0x0449 # CYRILLIC SMALL LETTER SHCHA +0x276C 0x044A # CYRILLIC SMALL LETTER HARD SIGN +0x276D 0x044B # CYRILLIC SMALL LETTER YERU +0x276E 0x044C # CYRILLIC SMALL LETTER SOFT SIGN +0x276F 0x044D # CYRILLIC SMALL LETTER E +0x2770 0x044E # CYRILLIC SMALL LETTER YU +0x2771 0x044F # CYRILLIC SMALL LETTER YA +0x2821 0x0101 # LATIN SMALL LETTER A WITH MACRON +0x2822 0x00E1 # LATIN SMALL LETTER A WITH ACUTE +0x2823 0x01CE # LATIN SMALL LETTER A WITH CARON +0x2824 0x00E0 # LATIN SMALL LETTER A WITH GRAVE +0x2825 0x0113 # LATIN SMALL LETTER E WITH MACRON +0x2826 0x00E9 # LATIN SMALL LETTER E WITH ACUTE +0x2827 0x011B # LATIN SMALL LETTER E WITH CARON +0x2828 0x00E8 # LATIN SMALL LETTER E WITH GRAVE +0x2829 0x012B # LATIN SMALL LETTER I WITH MACRON +0x282A 0x00ED # LATIN SMALL LETTER I WITH ACUTE +0x282B 0x01D0 # LATIN SMALL LETTER I WITH CARON +0x282C 0x00EC # LATIN SMALL LETTER I WITH GRAVE +0x282D 0x014D # LATIN SMALL LETTER O WITH MACRON +0x282E 0x00F3 # LATIN SMALL LETTER O WITH ACUTE +0x282F 0x01D2 # LATIN SMALL LETTER O WITH CARON +0x2830 0x00F2 # LATIN SMALL LETTER O WITH GRAVE +0x2831 0x016B # LATIN SMALL LETTER U WITH MACRON +0x2832 0x00FA # LATIN SMALL LETTER U WITH ACUTE +0x2833 0x01D4 # LATIN SMALL LETTER U WITH CARON +0x2834 0x00F9 # LATIN SMALL LETTER U WITH GRAVE +0x2835 0x01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON +0x2836 0x01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE +0x2837 0x01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON +0x2838 0x01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE +0x2839 0x00FC # LATIN SMALL LETTER U WITH DIAERESIS +0x283A 0x00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX +0x2845 0x3105 # BOPOMOFO LETTER B +0x2846 0x3106 # BOPOMOFO LETTER P +0x2847 0x3107 # BOPOMOFO LETTER M +0x2848 0x3108 # BOPOMOFO LETTER F +0x2849 0x3109 # BOPOMOFO LETTER D +0x284A 0x310A # BOPOMOFO LETTER T +0x284B 0x310B # BOPOMOFO LETTER N +0x284C 0x310C # BOPOMOFO LETTER L +0x284D 0x310D # BOPOMOFO LETTER G +0x284E 0x310E # BOPOMOFO LETTER K +0x284F 0x310F # BOPOMOFO LETTER H +0x2850 0x3110 # BOPOMOFO LETTER J +0x2851 0x3111 # BOPOMOFO LETTER Q +0x2852 0x3112 # BOPOMOFO LETTER X +0x2853 0x3113 # BOPOMOFO LETTER ZH +0x2854 0x3114 # BOPOMOFO LETTER CH +0x2855 0x3115 # BOPOMOFO LETTER SH +0x2856 0x3116 # BOPOMOFO LETTER R +0x2857 0x3117 # BOPOMOFO LETTER Z +0x2858 0x3118 # BOPOMOFO LETTER C +0x2859 0x3119 # BOPOMOFO LETTER S +0x285A 0x311A # BOPOMOFO LETTER A +0x285B 0x311B # BOPOMOFO LETTER O +0x285C 0x311C # BOPOMOFO LETTER E +0x285D 0x311D # BOPOMOFO LETTER EH +0x285E 0x311E # BOPOMOFO LETTER AI +0x285F 0x311F # BOPOMOFO LETTER EI +0x2860 0x3120 # BOPOMOFO LETTER AU +0x2861 0x3121 # BOPOMOFO LETTER OU +0x2862 0x3122 # BOPOMOFO LETTER AN +0x2863 0x3123 # BOPOMOFO LETTER EN +0x2864 0x3124 # BOPOMOFO LETTER ANG +0x2865 0x3125 # BOPOMOFO LETTER ENG +0x2866 0x3126 # BOPOMOFO LETTER ER +0x2867 0x3127 # BOPOMOFO LETTER I +0x2868 0x3128 # BOPOMOFO LETTER U +0x2869 0x3129 # BOPOMOFO LETTER IU +0x2924 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL +0x2925 0x2501 # BOX DRAWINGS HEAVY HORIZONTAL +0x2926 0x2502 # BOX DRAWINGS LIGHT VERTICAL +0x2927 0x2503 # BOX DRAWINGS HEAVY VERTICAL +0x2928 0x2504 # BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL +0x2929 0x2505 # BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL +0x292A 0x2506 # BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL +0x292B 0x2507 # BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL +0x292C 0x2508 # BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL +0x292D 0x2509 # BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL +0x292E 0x250A # BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL +0x292F 0x250B # BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL +0x2930 0x250C # BOX DRAWINGS LIGHT DOWN AND RIGHT +0x2931 0x250D # BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY +0x2932 0x250E # BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT +0x2933 0x250F # BOX DRAWINGS HEAVY DOWN AND RIGHT +0x2934 0x2510 # BOX DRAWINGS LIGHT DOWN AND LEFT +0x2935 0x2511 # BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY +0x2936 0x2512 # BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT +0x2937 0x2513 # BOX DRAWINGS HEAVY DOWN AND LEFT +0x2938 0x2514 # BOX DRAWINGS LIGHT UP AND RIGHT +0x2939 0x2515 # BOX DRAWINGS UP LIGHT AND RIGHT HEAVY +0x293A 0x2516 # BOX DRAWINGS UP HEAVY AND RIGHT LIGHT +0x293B 0x2517 # BOX DRAWINGS HEAVY UP AND RIGHT +0x293C 0x2518 # BOX DRAWINGS LIGHT UP AND LEFT +0x293D 0x2519 # BOX DRAWINGS UP LIGHT AND LEFT HEAVY +0x293E 0x251A # BOX DRAWINGS UP HEAVY AND LEFT LIGHT +0x293F 0x251B # BOX DRAWINGS HEAVY UP AND LEFT +0x2940 0x251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT +0x2941 0x251D # BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY +0x2942 0x251E # BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT +0x2943 0x251F # BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT +0x2944 0x2520 # BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT +0x2945 0x2521 # BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY +0x2946 0x2522 # BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY +0x2947 0x2523 # BOX DRAWINGS HEAVY VERTICAL AND RIGHT +0x2948 0x2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT +0x2949 0x2525 # BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY +0x294A 0x2526 # BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT +0x294B 0x2527 # BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT +0x294C 0x2528 # BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT +0x294D 0x2529 # BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY +0x294E 0x252A # BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY +0x294F 0x252B # BOX DRAWINGS HEAVY VERTICAL AND LEFT +0x2950 0x252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL +0x2951 0x252D # BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT +0x2952 0x252E # BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT +0x2953 0x252F # BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY +0x2954 0x2530 # BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT +0x2955 0x2531 # BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY +0x2956 0x2532 # BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY +0x2957 0x2533 # BOX DRAWINGS HEAVY DOWN AND HORIZONTAL +0x2958 0x2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL +0x2959 0x2535 # BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT +0x295A 0x2536 # BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT +0x295B 0x2537 # BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY +0x295C 0x2538 # BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT +0x295D 0x2539 # BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY +0x295E 0x253A # BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY +0x295F 0x253B # BOX DRAWINGS HEAVY UP AND HORIZONTAL +0x2960 0x253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL +0x2961 0x253D # BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT +0x2962 0x253E # BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT +0x2963 0x253F # BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY +0x2964 0x2540 # BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT +0x2965 0x2541 # BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT +0x2966 0x2542 # BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT +0x2967 0x2543 # BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT +0x2968 0x2544 # BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT +0x2969 0x2545 # BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT +0x296A 0x2546 # BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT +0x296B 0x2547 # BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY +0x296C 0x2548 # BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY +0x296D 0x2549 # BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY +0x296E 0x254A # BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY +0x296F 0x254B # BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL +0x3021 0x554A # +0x3022 0x963F # +0x3023 0x57C3 # +0x3024 0x6328 # +0x3025 0x54CE # +0x3026 0x5509 # +0x3027 0x54C0 # +0x3028 0x7691 # +0x3029 0x764C # +0x302A 0x853C # +0x302B 0x77EE # +0x302C 0x827E # +0x302D 0x788D # +0x302E 0x7231 # +0x302F 0x9698 # +0x3030 0x978D # +0x3031 0x6C28 # +0x3032 0x5B89 # +0x3033 0x4FFA # +0x3034 0x6309 # +0x3035 0x6697 # +0x3036 0x5CB8 # +0x3037 0x80FA # +0x3038 0x6848 # +0x3039 0x80AE # +0x303A 0x6602 # +0x303B 0x76CE # +0x303C 0x51F9 # +0x303D 0x6556 # +0x303E 0x71AC # +0x303F 0x7FF1 # +0x3040 0x8884 # +0x3041 0x50B2 # +0x3042 0x5965 # +0x3043 0x61CA # +0x3044 0x6FB3 # +0x3045 0x82AD # +0x3046 0x634C # +0x3047 0x6252 # +0x3048 0x53ED # +0x3049 0x5427 # +0x304A 0x7B06 # +0x304B 0x516B # +0x304C 0x75A4 # +0x304D 0x5DF4 # +0x304E 0x62D4 # +0x304F 0x8DCB # +0x3050 0x9776 # +0x3051 0x628A # +0x3052 0x8019 # +0x3053 0x575D # +0x3054 0x9738 # +0x3055 0x7F62 # +0x3056 0x7238 # +0x3057 0x767D # +0x3058 0x67CF # +0x3059 0x767E # +0x305A 0x6446 # +0x305B 0x4F70 # +0x305C 0x8D25 # +0x305D 0x62DC # +0x305E 0x7A17 # +0x305F 0x6591 # +0x3060 0x73ED # +0x3061 0x642C # +0x3062 0x6273 # +0x3063 0x822C # +0x3064 0x9881 # +0x3065 0x677F # +0x3066 0x7248 # +0x3067 0x626E # +0x3068 0x62CC # +0x3069 0x4F34 # +0x306A 0x74E3 # +0x306B 0x534A # +0x306C 0x529E # +0x306D 0x7ECA # +0x306E 0x90A6 # +0x306F 0x5E2E # +0x3070 0x6886 # +0x3071 0x699C # +0x3072 0x8180 # +0x3073 0x7ED1 # +0x3074 0x68D2 # +0x3075 0x78C5 # +0x3076 0x868C # +0x3077 0x9551 # +0x3078 0x508D # +0x3079 0x8C24 # +0x307A 0x82DE # +0x307B 0x80DE # +0x307C 0x5305 # +0x307D 0x8912 # +0x307E 0x5265 # +0x3121 0x8584 # +0x3122 0x96F9 # +0x3123 0x4FDD # +0x3124 0x5821 # +0x3125 0x9971 # +0x3126 0x5B9D # +0x3127 0x62B1 # +0x3128 0x62A5 # +0x3129 0x66B4 # +0x312A 0x8C79 # +0x312B 0x9C8D # +0x312C 0x7206 # +0x312D 0x676F # +0x312E 0x7891 # +0x312F 0x60B2 # +0x3130 0x5351 # +0x3131 0x5317 # +0x3132 0x8F88 # +0x3133 0x80CC # +0x3134 0x8D1D # +0x3135 0x94A1 # +0x3136 0x500D # +0x3137 0x72C8 # +0x3138 0x5907 # +0x3139 0x60EB # +0x313A 0x7119 # +0x313B 0x88AB # +0x313C 0x5954 # +0x313D 0x82EF # +0x313E 0x672C # +0x313F 0x7B28 # +0x3140 0x5D29 # +0x3141 0x7EF7 # +0x3142 0x752D # +0x3143 0x6CF5 # +0x3144 0x8E66 # +0x3145 0x8FF8 # +0x3146 0x903C # +0x3147 0x9F3B # +0x3148 0x6BD4 # +0x3149 0x9119 # +0x314A 0x7B14 # +0x314B 0x5F7C # +0x314C 0x78A7 # +0x314D 0x84D6 # +0x314E 0x853D # +0x314F 0x6BD5 # +0x3150 0x6BD9 # +0x3151 0x6BD6 # +0x3152 0x5E01 # +0x3153 0x5E87 # +0x3154 0x75F9 # +0x3155 0x95ED # +0x3156 0x655D # +0x3157 0x5F0A # +0x3158 0x5FC5 # +0x3159 0x8F9F # +0x315A 0x58C1 # +0x315B 0x81C2 # +0x315C 0x907F # +0x315D 0x965B # +0x315E 0x97AD # +0x315F 0x8FB9 # +0x3160 0x7F16 # +0x3161 0x8D2C # +0x3162 0x6241 # +0x3163 0x4FBF # +0x3164 0x53D8 # +0x3165 0x535E # +0x3166 0x8FA8 # +0x3167 0x8FA9 # +0x3168 0x8FAB # +0x3169 0x904D # +0x316A 0x6807 # +0x316B 0x5F6A # +0x316C 0x8198 # +0x316D 0x8868 # +0x316E 0x9CD6 # +0x316F 0x618B # +0x3170 0x522B # +0x3171 0x762A # +0x3172 0x5F6C # +0x3173 0x658C # +0x3174 0x6FD2 # +0x3175 0x6EE8 # +0x3176 0x5BBE # +0x3177 0x6448 # +0x3178 0x5175 # +0x3179 0x51B0 # +0x317A 0x67C4 # +0x317B 0x4E19 # +0x317C 0x79C9 # +0x317D 0x997C # +0x317E 0x70B3 # +0x3221 0x75C5 # +0x3222 0x5E76 # +0x3223 0x73BB # +0x3224 0x83E0 # +0x3225 0x64AD # +0x3226 0x62E8 # +0x3227 0x94B5 # +0x3228 0x6CE2 # +0x3229 0x535A # +0x322A 0x52C3 # +0x322B 0x640F # +0x322C 0x94C2 # +0x322D 0x7B94 # +0x322E 0x4F2F # +0x322F 0x5E1B # +0x3230 0x8236 # +0x3231 0x8116 # +0x3232 0x818A # +0x3233 0x6E24 # +0x3234 0x6CCA # +0x3235 0x9A73 # +0x3236 0x6355 # +0x3237 0x535C # +0x3238 0x54FA # +0x3239 0x8865 # +0x323A 0x57E0 # +0x323B 0x4E0D # +0x323C 0x5E03 # +0x323D 0x6B65 # +0x323E 0x7C3F # +0x323F 0x90E8 # +0x3240 0x6016 # +0x3241 0x64E6 # +0x3242 0x731C # +0x3243 0x88C1 # +0x3244 0x6750 # +0x3245 0x624D # +0x3246 0x8D22 # +0x3247 0x776C # +0x3248 0x8E29 # +0x3249 0x91C7 # +0x324A 0x5F69 # +0x324B 0x83DC # +0x324C 0x8521 # +0x324D 0x9910 # +0x324E 0x53C2 # +0x324F 0x8695 # +0x3250 0x6B8B # +0x3251 0x60ED # +0x3252 0x60E8 # +0x3253 0x707F # +0x3254 0x82CD # +0x3255 0x8231 # +0x3256 0x4ED3 # +0x3257 0x6CA7 # +0x3258 0x85CF # +0x3259 0x64CD # +0x325A 0x7CD9 # +0x325B 0x69FD # +0x325C 0x66F9 # +0x325D 0x8349 # +0x325E 0x5395 # +0x325F 0x7B56 # +0x3260 0x4FA7 # +0x3261 0x518C # +0x3262 0x6D4B # +0x3263 0x5C42 # +0x3264 0x8E6D # +0x3265 0x63D2 # +0x3266 0x53C9 # +0x3267 0x832C # +0x3268 0x8336 # +0x3269 0x67E5 # +0x326A 0x78B4 # +0x326B 0x643D # +0x326C 0x5BDF # +0x326D 0x5C94 # +0x326E 0x5DEE # +0x326F 0x8BE7 # +0x3270 0x62C6 # +0x3271 0x67F4 # +0x3272 0x8C7A # +0x3273 0x6400 # +0x3274 0x63BA # +0x3275 0x8749 # +0x3276 0x998B # +0x3277 0x8C17 # +0x3278 0x7F20 # +0x3279 0x94F2 # +0x327A 0x4EA7 # +0x327B 0x9610 # +0x327C 0x98A4 # +0x327D 0x660C # +0x327E 0x7316 # +0x3321 0x573A # +0x3322 0x5C1D # +0x3323 0x5E38 # +0x3324 0x957F # +0x3325 0x507F # +0x3326 0x80A0 # +0x3327 0x5382 # +0x3328 0x655E # +0x3329 0x7545 # +0x332A 0x5531 # +0x332B 0x5021 # +0x332C 0x8D85 # +0x332D 0x6284 # +0x332E 0x949E # +0x332F 0x671D # +0x3330 0x5632 # +0x3331 0x6F6E # +0x3332 0x5DE2 # +0x3333 0x5435 # +0x3334 0x7092 # +0x3335 0x8F66 # +0x3336 0x626F # +0x3337 0x64A4 # +0x3338 0x63A3 # +0x3339 0x5F7B # +0x333A 0x6F88 # +0x333B 0x90F4 # +0x333C 0x81E3 # +0x333D 0x8FB0 # +0x333E 0x5C18 # +0x333F 0x6668 # +0x3340 0x5FF1 # +0x3341 0x6C89 # +0x3342 0x9648 # +0x3343 0x8D81 # +0x3344 0x886C # +0x3345 0x6491 # +0x3346 0x79F0 # +0x3347 0x57CE # +0x3348 0x6A59 # +0x3349 0x6210 # +0x334A 0x5448 # +0x334B 0x4E58 # +0x334C 0x7A0B # +0x334D 0x60E9 # +0x334E 0x6F84 # +0x334F 0x8BDA # +0x3350 0x627F # +0x3351 0x901E # +0x3352 0x9A8B # +0x3353 0x79E4 # +0x3354 0x5403 # +0x3355 0x75F4 # +0x3356 0x6301 # +0x3357 0x5319 # +0x3358 0x6C60 # +0x3359 0x8FDF # +0x335A 0x5F1B # +0x335B 0x9A70 # +0x335C 0x803B # +0x335D 0x9F7F # +0x335E 0x4F88 # +0x335F 0x5C3A # +0x3360 0x8D64 # +0x3361 0x7FC5 # +0x3362 0x65A5 # +0x3363 0x70BD # +0x3364 0x5145 # +0x3365 0x51B2 # +0x3366 0x866B # +0x3367 0x5D07 # +0x3368 0x5BA0 # +0x3369 0x62BD # +0x336A 0x916C # +0x336B 0x7574 # +0x336C 0x8E0C # +0x336D 0x7A20 # +0x336E 0x6101 # +0x336F 0x7B79 # +0x3370 0x4EC7 # +0x3371 0x7EF8 # +0x3372 0x7785 # +0x3373 0x4E11 # +0x3374 0x81ED # +0x3375 0x521D # +0x3376 0x51FA # +0x3377 0x6A71 # +0x3378 0x53A8 # +0x3379 0x8E87 # +0x337A 0x9504 # +0x337B 0x96CF # +0x337C 0x6EC1 # +0x337D 0x9664 # +0x337E 0x695A # +0x3421 0x7840 # +0x3422 0x50A8 # +0x3423 0x77D7 # +0x3424 0x6410 # +0x3425 0x89E6 # +0x3426 0x5904 # +0x3427 0x63E3 # +0x3428 0x5DDD # +0x3429 0x7A7F # +0x342A 0x693D # +0x342B 0x4F20 # +0x342C 0x8239 # +0x342D 0x5598 # +0x342E 0x4E32 # +0x342F 0x75AE # +0x3430 0x7A97 # +0x3431 0x5E62 # +0x3432 0x5E8A # +0x3433 0x95EF # +0x3434 0x521B # +0x3435 0x5439 # +0x3436 0x708A # +0x3437 0x6376 # +0x3438 0x9524 # +0x3439 0x5782 # +0x343A 0x6625 # +0x343B 0x693F # +0x343C 0x9187 # +0x343D 0x5507 # +0x343E 0x6DF3 # +0x343F 0x7EAF # +0x3440 0x8822 # +0x3441 0x6233 # +0x3442 0x7EF0 # +0x3443 0x75B5 # +0x3444 0x8328 # +0x3445 0x78C1 # +0x3446 0x96CC # +0x3447 0x8F9E # +0x3448 0x6148 # +0x3449 0x74F7 # +0x344A 0x8BCD # +0x344B 0x6B64 # +0x344C 0x523A # +0x344D 0x8D50 # +0x344E 0x6B21 # +0x344F 0x806A # +0x3450 0x8471 # +0x3451 0x56F1 # +0x3452 0x5306 # +0x3453 0x4ECE # +0x3454 0x4E1B # +0x3455 0x51D1 # +0x3456 0x7C97 # +0x3457 0x918B # +0x3458 0x7C07 # +0x3459 0x4FC3 # +0x345A 0x8E7F # +0x345B 0x7BE1 # +0x345C 0x7A9C # +0x345D 0x6467 # +0x345E 0x5D14 # +0x345F 0x50AC # +0x3460 0x8106 # +0x3461 0x7601 # +0x3462 0x7CB9 # +0x3463 0x6DEC # +0x3464 0x7FE0 # +0x3465 0x6751 # +0x3466 0x5B58 # +0x3467 0x5BF8 # +0x3468 0x78CB # +0x3469 0x64AE # +0x346A 0x6413 # +0x346B 0x63AA # +0x346C 0x632B # +0x346D 0x9519 # +0x346E 0x642D # +0x346F 0x8FBE # +0x3470 0x7B54 # +0x3471 0x7629 # +0x3472 0x6253 # +0x3473 0x5927 # +0x3474 0x5446 # +0x3475 0x6B79 # +0x3476 0x50A3 # +0x3477 0x6234 # +0x3478 0x5E26 # +0x3479 0x6B86 # +0x347A 0x4EE3 # +0x347B 0x8D37 # +0x347C 0x888B # +0x347D 0x5F85 # +0x347E 0x902E # +0x3521 0x6020 # +0x3522 0x803D # +0x3523 0x62C5 # +0x3524 0x4E39 # +0x3525 0x5355 # +0x3526 0x90F8 # +0x3527 0x63B8 # +0x3528 0x80C6 # +0x3529 0x65E6 # +0x352A 0x6C2E # +0x352B 0x4F46 # +0x352C 0x60EE # +0x352D 0x6DE1 # +0x352E 0x8BDE # +0x352F 0x5F39 # +0x3530 0x86CB # +0x3531 0x5F53 # +0x3532 0x6321 # +0x3533 0x515A # +0x3534 0x8361 # +0x3535 0x6863 # +0x3536 0x5200 # +0x3537 0x6363 # +0x3538 0x8E48 # +0x3539 0x5012 # +0x353A 0x5C9B # +0x353B 0x7977 # +0x353C 0x5BFC # +0x353D 0x5230 # +0x353E 0x7A3B # +0x353F 0x60BC # +0x3540 0x9053 # +0x3541 0x76D7 # +0x3542 0x5FB7 # +0x3543 0x5F97 # +0x3544 0x7684 # +0x3545 0x8E6C # +0x3546 0x706F # +0x3547 0x767B # +0x3548 0x7B49 # +0x3549 0x77AA # +0x354A 0x51F3 # +0x354B 0x9093 # +0x354C 0x5824 # +0x354D 0x4F4E # +0x354E 0x6EF4 # +0x354F 0x8FEA # +0x3550 0x654C # +0x3551 0x7B1B # +0x3552 0x72C4 # +0x3553 0x6DA4 # +0x3554 0x7FDF # +0x3555 0x5AE1 # +0x3556 0x62B5 # +0x3557 0x5E95 # +0x3558 0x5730 # +0x3559 0x8482 # +0x355A 0x7B2C # +0x355B 0x5E1D # +0x355C 0x5F1F # +0x355D 0x9012 # +0x355E 0x7F14 # +0x355F 0x98A0 # +0x3560 0x6382 # +0x3561 0x6EC7 # +0x3562 0x7898 # +0x3563 0x70B9 # +0x3564 0x5178 # +0x3565 0x975B # +0x3566 0x57AB # +0x3567 0x7535 # +0x3568 0x4F43 # +0x3569 0x7538 # +0x356A 0x5E97 # +0x356B 0x60E6 # +0x356C 0x5960 # +0x356D 0x6DC0 # +0x356E 0x6BBF # +0x356F 0x7889 # +0x3570 0x53FC # +0x3571 0x96D5 # +0x3572 0x51CB # +0x3573 0x5201 # +0x3574 0x6389 # +0x3575 0x540A # +0x3576 0x9493 # +0x3577 0x8C03 # +0x3578 0x8DCC # +0x3579 0x7239 # +0x357A 0x789F # +0x357B 0x8776 # +0x357C 0x8FED # +0x357D 0x8C0D # +0x357E 0x53E0 # +0x3621 0x4E01 # +0x3622 0x76EF # +0x3623 0x53EE # +0x3624 0x9489 # +0x3625 0x9876 # +0x3626 0x9F0E # +0x3627 0x952D # +0x3628 0x5B9A # +0x3629 0x8BA2 # +0x362A 0x4E22 # +0x362B 0x4E1C # +0x362C 0x51AC # +0x362D 0x8463 # +0x362E 0x61C2 # +0x362F 0x52A8 # +0x3630 0x680B # +0x3631 0x4F97 # +0x3632 0x606B # +0x3633 0x51BB # +0x3634 0x6D1E # +0x3635 0x515C # +0x3636 0x6296 # +0x3637 0x6597 # +0x3638 0x9661 # +0x3639 0x8C46 # +0x363A 0x9017 # +0x363B 0x75D8 # +0x363C 0x90FD # +0x363D 0x7763 # +0x363E 0x6BD2 # +0x363F 0x728A # +0x3640 0x72EC # +0x3641 0x8BFB # +0x3642 0x5835 # +0x3643 0x7779 # +0x3644 0x8D4C # +0x3645 0x675C # +0x3646 0x9540 # +0x3647 0x809A # +0x3648 0x5EA6 # +0x3649 0x6E21 # +0x364A 0x5992 # +0x364B 0x7AEF # +0x364C 0x77ED # +0x364D 0x953B # +0x364E 0x6BB5 # +0x364F 0x65AD # +0x3650 0x7F0E # +0x3651 0x5806 # +0x3652 0x5151 # +0x3653 0x961F # +0x3654 0x5BF9 # +0x3655 0x58A9 # +0x3656 0x5428 # +0x3657 0x8E72 # +0x3658 0x6566 # +0x3659 0x987F # +0x365A 0x56E4 # +0x365B 0x949D # +0x365C 0x76FE # +0x365D 0x9041 # +0x365E 0x6387 # +0x365F 0x54C6 # +0x3660 0x591A # +0x3661 0x593A # +0x3662 0x579B # +0x3663 0x8EB2 # +0x3664 0x6735 # +0x3665 0x8DFA # +0x3666 0x8235 # +0x3667 0x5241 # +0x3668 0x60F0 # +0x3669 0x5815 # +0x366A 0x86FE # +0x366B 0x5CE8 # +0x366C 0x9E45 # +0x366D 0x4FC4 # +0x366E 0x989D # +0x366F 0x8BB9 # +0x3670 0x5A25 # +0x3671 0x6076 # +0x3672 0x5384 # +0x3673 0x627C # +0x3674 0x904F # +0x3675 0x9102 # +0x3676 0x997F # +0x3677 0x6069 # +0x3678 0x800C # +0x3679 0x513F # +0x367A 0x8033 # +0x367B 0x5C14 # +0x367C 0x9975 # +0x367D 0x6D31 # +0x367E 0x4E8C # +0x3721 0x8D30 # +0x3722 0x53D1 # +0x3723 0x7F5A # +0x3724 0x7B4F # +0x3725 0x4F10 # +0x3726 0x4E4F # +0x3727 0x9600 # +0x3728 0x6CD5 # +0x3729 0x73D0 # +0x372A 0x85E9 # +0x372B 0x5E06 # +0x372C 0x756A # +0x372D 0x7FFB # +0x372E 0x6A0A # +0x372F 0x77FE # +0x3730 0x9492 # +0x3731 0x7E41 # +0x3732 0x51E1 # +0x3733 0x70E6 # +0x3734 0x53CD # +0x3735 0x8FD4 # +0x3736 0x8303 # +0x3737 0x8D29 # +0x3738 0x72AF # +0x3739 0x996D # +0x373A 0x6CDB # +0x373B 0x574A # +0x373C 0x82B3 # +0x373D 0x65B9 # +0x373E 0x80AA # +0x373F 0x623F # +0x3740 0x9632 # +0x3741 0x59A8 # +0x3742 0x4EFF # +0x3743 0x8BBF # +0x3744 0x7EBA # +0x3745 0x653E # +0x3746 0x83F2 # +0x3747 0x975E # +0x3748 0x5561 # +0x3749 0x98DE # +0x374A 0x80A5 # +0x374B 0x532A # +0x374C 0x8BFD # +0x374D 0x5420 # +0x374E 0x80BA # +0x374F 0x5E9F # +0x3750 0x6CB8 # +0x3751 0x8D39 # +0x3752 0x82AC # +0x3753 0x915A # +0x3754 0x5429 # +0x3755 0x6C1B # +0x3756 0x5206 # +0x3757 0x7EB7 # +0x3758 0x575F # +0x3759 0x711A # +0x375A 0x6C7E # +0x375B 0x7C89 # +0x375C 0x594B # +0x375D 0x4EFD # +0x375E 0x5FFF # +0x375F 0x6124 # +0x3760 0x7CAA # +0x3761 0x4E30 # +0x3762 0x5C01 # +0x3763 0x67AB # +0x3764 0x8702 # +0x3765 0x5CF0 # +0x3766 0x950B # +0x3767 0x98CE # +0x3768 0x75AF # +0x3769 0x70FD # +0x376A 0x9022 # +0x376B 0x51AF # +0x376C 0x7F1D # +0x376D 0x8BBD # +0x376E 0x5949 # +0x376F 0x51E4 # +0x3770 0x4F5B # +0x3771 0x5426 # +0x3772 0x592B # +0x3773 0x6577 # +0x3774 0x80A4 # +0x3775 0x5B75 # +0x3776 0x6276 # +0x3777 0x62C2 # +0x3778 0x8F90 # +0x3779 0x5E45 # +0x377A 0x6C1F # +0x377B 0x7B26 # +0x377C 0x4F0F # +0x377D 0x4FD8 # +0x377E 0x670D # +0x3821 0x6D6E # +0x3822 0x6DAA # +0x3823 0x798F # +0x3824 0x88B1 # +0x3825 0x5F17 # +0x3826 0x752B # +0x3827 0x629A # +0x3828 0x8F85 # +0x3829 0x4FEF # +0x382A 0x91DC # +0x382B 0x65A7 # +0x382C 0x812F # +0x382D 0x8151 # +0x382E 0x5E9C # +0x382F 0x8150 # +0x3830 0x8D74 # +0x3831 0x526F # +0x3832 0x8986 # +0x3833 0x8D4B # +0x3834 0x590D # +0x3835 0x5085 # +0x3836 0x4ED8 # +0x3837 0x961C # +0x3838 0x7236 # +0x3839 0x8179 # +0x383A 0x8D1F # +0x383B 0x5BCC # +0x383C 0x8BA3 # +0x383D 0x9644 # +0x383E 0x5987 # +0x383F 0x7F1A # +0x3840 0x5490 # +0x3841 0x5676 # +0x3842 0x560E # +0x3843 0x8BE5 # +0x3844 0x6539 # +0x3845 0x6982 # +0x3846 0x9499 # +0x3847 0x76D6 # +0x3848 0x6E89 # +0x3849 0x5E72 # +0x384A 0x7518 # +0x384B 0x6746 # +0x384C 0x67D1 # +0x384D 0x7AFF # +0x384E 0x809D # +0x384F 0x8D76 # +0x3850 0x611F # +0x3851 0x79C6 # +0x3852 0x6562 # +0x3853 0x8D63 # +0x3854 0x5188 # +0x3855 0x521A # +0x3856 0x94A2 # +0x3857 0x7F38 # +0x3858 0x809B # +0x3859 0x7EB2 # +0x385A 0x5C97 # +0x385B 0x6E2F # +0x385C 0x6760 # +0x385D 0x7BD9 # +0x385E 0x768B # +0x385F 0x9AD8 # +0x3860 0x818F # +0x3861 0x7F94 # +0x3862 0x7CD5 # +0x3863 0x641E # +0x3864 0x9550 # +0x3865 0x7A3F # +0x3866 0x544A # +0x3867 0x54E5 # +0x3868 0x6B4C # +0x3869 0x6401 # +0x386A 0x6208 # +0x386B 0x9E3D # +0x386C 0x80F3 # +0x386D 0x7599 # +0x386E 0x5272 # +0x386F 0x9769 # +0x3870 0x845B # +0x3871 0x683C # +0x3872 0x86E4 # +0x3873 0x9601 # +0x3874 0x9694 # +0x3875 0x94EC # +0x3876 0x4E2A # +0x3877 0x5404 # +0x3878 0x7ED9 # +0x3879 0x6839 # +0x387A 0x8DDF # +0x387B 0x8015 # +0x387C 0x66F4 # +0x387D 0x5E9A # +0x387E 0x7FB9 # +0x3921 0x57C2 # +0x3922 0x803F # +0x3923 0x6897 # +0x3924 0x5DE5 # +0x3925 0x653B # +0x3926 0x529F # +0x3927 0x606D # +0x3928 0x9F9A # +0x3929 0x4F9B # +0x392A 0x8EAC # +0x392B 0x516C # +0x392C 0x5BAB # +0x392D 0x5F13 # +0x392E 0x5DE9 # +0x392F 0x6C5E # +0x3930 0x62F1 # +0x3931 0x8D21 # +0x3932 0x5171 # +0x3933 0x94A9 # +0x3934 0x52FE # +0x3935 0x6C9F # +0x3936 0x82DF # +0x3937 0x72D7 # +0x3938 0x57A2 # +0x3939 0x6784 # +0x393A 0x8D2D # +0x393B 0x591F # +0x393C 0x8F9C # +0x393D 0x83C7 # +0x393E 0x5495 # +0x393F 0x7B8D # +0x3940 0x4F30 # +0x3941 0x6CBD # +0x3942 0x5B64 # +0x3943 0x59D1 # +0x3944 0x9F13 # +0x3945 0x53E4 # +0x3946 0x86CA # +0x3947 0x9AA8 # +0x3948 0x8C37 # +0x3949 0x80A1 # +0x394A 0x6545 # +0x394B 0x987E # +0x394C 0x56FA # +0x394D 0x96C7 # +0x394E 0x522E # +0x394F 0x74DC # +0x3950 0x5250 # +0x3951 0x5BE1 # +0x3952 0x6302 # +0x3953 0x8902 # +0x3954 0x4E56 # +0x3955 0x62D0 # +0x3956 0x602A # +0x3957 0x68FA # +0x3958 0x5173 # +0x3959 0x5B98 # +0x395A 0x51A0 # +0x395B 0x89C2 # +0x395C 0x7BA1 # +0x395D 0x9986 # +0x395E 0x7F50 # +0x395F 0x60EF # +0x3960 0x704C # +0x3961 0x8D2F # +0x3962 0x5149 # +0x3963 0x5E7F # +0x3964 0x901B # +0x3965 0x7470 # +0x3966 0x89C4 # +0x3967 0x572D # +0x3968 0x7845 # +0x3969 0x5F52 # +0x396A 0x9F9F # +0x396B 0x95FA # +0x396C 0x8F68 # +0x396D 0x9B3C # +0x396E 0x8BE1 # +0x396F 0x7678 # +0x3970 0x6842 # +0x3971 0x67DC # +0x3972 0x8DEA # +0x3973 0x8D35 # +0x3974 0x523D # +0x3975 0x8F8A # +0x3976 0x6EDA # +0x3977 0x68CD # +0x3978 0x9505 # +0x3979 0x90ED # +0x397A 0x56FD # +0x397B 0x679C # +0x397C 0x88F9 # +0x397D 0x8FC7 # +0x397E 0x54C8 # +0x3A21 0x9AB8 # +0x3A22 0x5B69 # +0x3A23 0x6D77 # +0x3A24 0x6C26 # +0x3A25 0x4EA5 # +0x3A26 0x5BB3 # +0x3A27 0x9A87 # +0x3A28 0x9163 # +0x3A29 0x61A8 # +0x3A2A 0x90AF # +0x3A2B 0x97E9 # +0x3A2C 0x542B # +0x3A2D 0x6DB5 # +0x3A2E 0x5BD2 # +0x3A2F 0x51FD # +0x3A30 0x558A # +0x3A31 0x7F55 # +0x3A32 0x7FF0 # +0x3A33 0x64BC # +0x3A34 0x634D # +0x3A35 0x65F1 # +0x3A36 0x61BE # +0x3A37 0x608D # +0x3A38 0x710A # +0x3A39 0x6C57 # +0x3A3A 0x6C49 # +0x3A3B 0x592F # +0x3A3C 0x676D # +0x3A3D 0x822A # +0x3A3E 0x58D5 # +0x3A3F 0x568E # +0x3A40 0x8C6A # +0x3A41 0x6BEB # +0x3A42 0x90DD # +0x3A43 0x597D # +0x3A44 0x8017 # +0x3A45 0x53F7 # +0x3A46 0x6D69 # +0x3A47 0x5475 # +0x3A48 0x559D # +0x3A49 0x8377 # +0x3A4A 0x83CF # +0x3A4B 0x6838 # +0x3A4C 0x79BE # +0x3A4D 0x548C # +0x3A4E 0x4F55 # +0x3A4F 0x5408 # +0x3A50 0x76D2 # +0x3A51 0x8C89 # +0x3A52 0x9602 # +0x3A53 0x6CB3 # +0x3A54 0x6DB8 # +0x3A55 0x8D6B # +0x3A56 0x8910 # +0x3A57 0x9E64 # +0x3A58 0x8D3A # +0x3A59 0x563F # +0x3A5A 0x9ED1 # +0x3A5B 0x75D5 # +0x3A5C 0x5F88 # +0x3A5D 0x72E0 # +0x3A5E 0x6068 # +0x3A5F 0x54FC # +0x3A60 0x4EA8 # +0x3A61 0x6A2A # +0x3A62 0x8861 # +0x3A63 0x6052 # +0x3A64 0x8F70 # +0x3A65 0x54C4 # +0x3A66 0x70D8 # +0x3A67 0x8679 # +0x3A68 0x9E3F # +0x3A69 0x6D2A # +0x3A6A 0x5B8F # +0x3A6B 0x5F18 # +0x3A6C 0x7EA2 # +0x3A6D 0x5589 # +0x3A6E 0x4FAF # +0x3A6F 0x7334 # +0x3A70 0x543C # +0x3A71 0x539A # +0x3A72 0x5019 # +0x3A73 0x540E # +0x3A74 0x547C # +0x3A75 0x4E4E # +0x3A76 0x5FFD # +0x3A77 0x745A # +0x3A78 0x58F6 # +0x3A79 0x846B # +0x3A7A 0x80E1 # +0x3A7B 0x8774 # +0x3A7C 0x72D0 # +0x3A7D 0x7CCA # +0x3A7E 0x6E56 # +0x3B21 0x5F27 # +0x3B22 0x864E # +0x3B23 0x552C # +0x3B24 0x62A4 # +0x3B25 0x4E92 # +0x3B26 0x6CAA # +0x3B27 0x6237 # +0x3B28 0x82B1 # +0x3B29 0x54D7 # +0x3B2A 0x534E # +0x3B2B 0x733E # +0x3B2C 0x6ED1 # +0x3B2D 0x753B # +0x3B2E 0x5212 # +0x3B2F 0x5316 # +0x3B30 0x8BDD # +0x3B31 0x69D0 # +0x3B32 0x5F8A # +0x3B33 0x6000 # +0x3B34 0x6DEE # +0x3B35 0x574F # +0x3B36 0x6B22 # +0x3B37 0x73AF # +0x3B38 0x6853 # +0x3B39 0x8FD8 # +0x3B3A 0x7F13 # +0x3B3B 0x6362 # +0x3B3C 0x60A3 # +0x3B3D 0x5524 # +0x3B3E 0x75EA # +0x3B3F 0x8C62 # +0x3B40 0x7115 # +0x3B41 0x6DA3 # +0x3B42 0x5BA6 # +0x3B43 0x5E7B # +0x3B44 0x8352 # +0x3B45 0x614C # +0x3B46 0x9EC4 # +0x3B47 0x78FA # +0x3B48 0x8757 # +0x3B49 0x7C27 # +0x3B4A 0x7687 # +0x3B4B 0x51F0 # +0x3B4C 0x60F6 # +0x3B4D 0x714C # +0x3B4E 0x6643 # +0x3B4F 0x5E4C # +0x3B50 0x604D # +0x3B51 0x8C0E # +0x3B52 0x7070 # +0x3B53 0x6325 # +0x3B54 0x8F89 # +0x3B55 0x5FBD # +0x3B56 0x6062 # +0x3B57 0x86D4 # +0x3B58 0x56DE # +0x3B59 0x6BC1 # +0x3B5A 0x6094 # +0x3B5B 0x6167 # +0x3B5C 0x5349 # +0x3B5D 0x60E0 # +0x3B5E 0x6666 # +0x3B5F 0x8D3F # +0x3B60 0x79FD # +0x3B61 0x4F1A # +0x3B62 0x70E9 # +0x3B63 0x6C47 # +0x3B64 0x8BB3 # +0x3B65 0x8BF2 # +0x3B66 0x7ED8 # +0x3B67 0x8364 # +0x3B68 0x660F # +0x3B69 0x5A5A # +0x3B6A 0x9B42 # +0x3B6B 0x6D51 # +0x3B6C 0x6DF7 # +0x3B6D 0x8C41 # +0x3B6E 0x6D3B # +0x3B6F 0x4F19 # +0x3B70 0x706B # +0x3B71 0x83B7 # +0x3B72 0x6216 # +0x3B73 0x60D1 # +0x3B74 0x970D # +0x3B75 0x8D27 # +0x3B76 0x7978 # +0x3B77 0x51FB # +0x3B78 0x573E # +0x3B79 0x57FA # +0x3B7A 0x673A # +0x3B7B 0x7578 # +0x3B7C 0x7A3D # +0x3B7D 0x79EF # +0x3B7E 0x7B95 # +0x3C21 0x808C # +0x3C22 0x9965 # +0x3C23 0x8FF9 # +0x3C24 0x6FC0 # +0x3C25 0x8BA5 # +0x3C26 0x9E21 # +0x3C27 0x59EC # +0x3C28 0x7EE9 # +0x3C29 0x7F09 # +0x3C2A 0x5409 # +0x3C2B 0x6781 # +0x3C2C 0x68D8 # +0x3C2D 0x8F91 # +0x3C2E 0x7C4D # +0x3C2F 0x96C6 # +0x3C30 0x53CA # +0x3C31 0x6025 # +0x3C32 0x75BE # +0x3C33 0x6C72 # +0x3C34 0x5373 # +0x3C35 0x5AC9 # +0x3C36 0x7EA7 # +0x3C37 0x6324 # +0x3C38 0x51E0 # +0x3C39 0x810A # +0x3C3A 0x5DF1 # +0x3C3B 0x84DF # +0x3C3C 0x6280 # +0x3C3D 0x5180 # +0x3C3E 0x5B63 # +0x3C3F 0x4F0E # +0x3C40 0x796D # +0x3C41 0x5242 # +0x3C42 0x60B8 # +0x3C43 0x6D4E # +0x3C44 0x5BC4 # +0x3C45 0x5BC2 # +0x3C46 0x8BA1 # +0x3C47 0x8BB0 # +0x3C48 0x65E2 # +0x3C49 0x5FCC # +0x3C4A 0x9645 # +0x3C4B 0x5993 # +0x3C4C 0x7EE7 # +0x3C4D 0x7EAA # +0x3C4E 0x5609 # +0x3C4F 0x67B7 # +0x3C50 0x5939 # +0x3C51 0x4F73 # +0x3C52 0x5BB6 # +0x3C53 0x52A0 # +0x3C54 0x835A # +0x3C55 0x988A # +0x3C56 0x8D3E # +0x3C57 0x7532 # +0x3C58 0x94BE # +0x3C59 0x5047 # +0x3C5A 0x7A3C # +0x3C5B 0x4EF7 # +0x3C5C 0x67B6 # +0x3C5D 0x9A7E # +0x3C5E 0x5AC1 # +0x3C5F 0x6B7C # +0x3C60 0x76D1 # +0x3C61 0x575A # +0x3C62 0x5C16 # +0x3C63 0x7B3A # +0x3C64 0x95F4 # +0x3C65 0x714E # +0x3C66 0x517C # +0x3C67 0x80A9 # +0x3C68 0x8270 # +0x3C69 0x5978 # +0x3C6A 0x7F04 # +0x3C6B 0x8327 # +0x3C6C 0x68C0 # +0x3C6D 0x67EC # +0x3C6E 0x78B1 # +0x3C6F 0x7877 # +0x3C70 0x62E3 # +0x3C71 0x6361 # +0x3C72 0x7B80 # +0x3C73 0x4FED # +0x3C74 0x526A # +0x3C75 0x51CF # +0x3C76 0x8350 # +0x3C77 0x69DB # +0x3C78 0x9274 # +0x3C79 0x8DF5 # +0x3C7A 0x8D31 # +0x3C7B 0x89C1 # +0x3C7C 0x952E # +0x3C7D 0x7BAD # +0x3C7E 0x4EF6 # +0x3D21 0x5065 # +0x3D22 0x8230 # +0x3D23 0x5251 # +0x3D24 0x996F # +0x3D25 0x6E10 # +0x3D26 0x6E85 # +0x3D27 0x6DA7 # +0x3D28 0x5EFA # +0x3D29 0x50F5 # +0x3D2A 0x59DC # +0x3D2B 0x5C06 # +0x3D2C 0x6D46 # +0x3D2D 0x6C5F # +0x3D2E 0x7586 # +0x3D2F 0x848B # +0x3D30 0x6868 # +0x3D31 0x5956 # +0x3D32 0x8BB2 # +0x3D33 0x5320 # +0x3D34 0x9171 # +0x3D35 0x964D # +0x3D36 0x8549 # +0x3D37 0x6912 # +0x3D38 0x7901 # +0x3D39 0x7126 # +0x3D3A 0x80F6 # +0x3D3B 0x4EA4 # +0x3D3C 0x90CA # +0x3D3D 0x6D47 # +0x3D3E 0x9A84 # +0x3D3F 0x5A07 # +0x3D40 0x56BC # +0x3D41 0x6405 # +0x3D42 0x94F0 # +0x3D43 0x77EB # +0x3D44 0x4FA5 # +0x3D45 0x811A # +0x3D46 0x72E1 # +0x3D47 0x89D2 # +0x3D48 0x997A # +0x3D49 0x7F34 # +0x3D4A 0x7EDE # +0x3D4B 0x527F # +0x3D4C 0x6559 # +0x3D4D 0x9175 # +0x3D4E 0x8F7F # +0x3D4F 0x8F83 # +0x3D50 0x53EB # +0x3D51 0x7A96 # +0x3D52 0x63ED # +0x3D53 0x63A5 # +0x3D54 0x7686 # +0x3D55 0x79F8 # +0x3D56 0x8857 # +0x3D57 0x9636 # +0x3D58 0x622A # +0x3D59 0x52AB # +0x3D5A 0x8282 # +0x3D5B 0x6854 # +0x3D5C 0x6770 # +0x3D5D 0x6377 # +0x3D5E 0x776B # +0x3D5F 0x7AED # +0x3D60 0x6D01 # +0x3D61 0x7ED3 # +0x3D62 0x89E3 # +0x3D63 0x59D0 # +0x3D64 0x6212 # +0x3D65 0x85C9 # +0x3D66 0x82A5 # +0x3D67 0x754C # +0x3D68 0x501F # +0x3D69 0x4ECB # +0x3D6A 0x75A5 # +0x3D6B 0x8BEB # +0x3D6C 0x5C4A # +0x3D6D 0x5DFE # +0x3D6E 0x7B4B # +0x3D6F 0x65A4 # +0x3D70 0x91D1 # +0x3D71 0x4ECA # +0x3D72 0x6D25 # +0x3D73 0x895F # +0x3D74 0x7D27 # +0x3D75 0x9526 # +0x3D76 0x4EC5 # +0x3D77 0x8C28 # +0x3D78 0x8FDB # +0x3D79 0x9773 # +0x3D7A 0x664B # +0x3D7B 0x7981 # +0x3D7C 0x8FD1 # +0x3D7D 0x70EC # +0x3D7E 0x6D78 # +0x3E21 0x5C3D # +0x3E22 0x52B2 # +0x3E23 0x8346 # +0x3E24 0x5162 # +0x3E25 0x830E # +0x3E26 0x775B # +0x3E27 0x6676 # +0x3E28 0x9CB8 # +0x3E29 0x4EAC # +0x3E2A 0x60CA # +0x3E2B 0x7CBE # +0x3E2C 0x7CB3 # +0x3E2D 0x7ECF # +0x3E2E 0x4E95 # +0x3E2F 0x8B66 # +0x3E30 0x666F # +0x3E31 0x9888 # +0x3E32 0x9759 # +0x3E33 0x5883 # +0x3E34 0x656C # +0x3E35 0x955C # +0x3E36 0x5F84 # +0x3E37 0x75C9 # +0x3E38 0x9756 # +0x3E39 0x7ADF # +0x3E3A 0x7ADE # +0x3E3B 0x51C0 # +0x3E3C 0x70AF # +0x3E3D 0x7A98 # +0x3E3E 0x63EA # +0x3E3F 0x7A76 # +0x3E40 0x7EA0 # +0x3E41 0x7396 # +0x3E42 0x97ED # +0x3E43 0x4E45 # +0x3E44 0x7078 # +0x3E45 0x4E5D # +0x3E46 0x9152 # +0x3E47 0x53A9 # +0x3E48 0x6551 # +0x3E49 0x65E7 # +0x3E4A 0x81FC # +0x3E4B 0x8205 # +0x3E4C 0x548E # +0x3E4D 0x5C31 # +0x3E4E 0x759A # +0x3E4F 0x97A0 # +0x3E50 0x62D8 # +0x3E51 0x72D9 # +0x3E52 0x75BD # +0x3E53 0x5C45 # +0x3E54 0x9A79 # +0x3E55 0x83CA # +0x3E56 0x5C40 # +0x3E57 0x5480 # +0x3E58 0x77E9 # +0x3E59 0x4E3E # +0x3E5A 0x6CAE # +0x3E5B 0x805A # +0x3E5C 0x62D2 # +0x3E5D 0x636E # +0x3E5E 0x5DE8 # +0x3E5F 0x5177 # +0x3E60 0x8DDD # +0x3E61 0x8E1E # +0x3E62 0x952F # +0x3E63 0x4FF1 # +0x3E64 0x53E5 # +0x3E65 0x60E7 # +0x3E66 0x70AC # +0x3E67 0x5267 # +0x3E68 0x6350 # +0x3E69 0x9E43 # +0x3E6A 0x5A1F # +0x3E6B 0x5026 # +0x3E6C 0x7737 # +0x3E6D 0x5377 # +0x3E6E 0x7EE2 # +0x3E6F 0x6485 # +0x3E70 0x652B # +0x3E71 0x6289 # +0x3E72 0x6398 # +0x3E73 0x5014 # +0x3E74 0x7235 # +0x3E75 0x89C9 # +0x3E76 0x51B3 # +0x3E77 0x8BC0 # +0x3E78 0x7EDD # +0x3E79 0x5747 # +0x3E7A 0x83CC # +0x3E7B 0x94A7 # +0x3E7C 0x519B # +0x3E7D 0x541B # +0x3E7E 0x5CFB # +0x3F21 0x4FCA # +0x3F22 0x7AE3 # +0x3F23 0x6D5A # +0x3F24 0x90E1 # +0x3F25 0x9A8F # +0x3F26 0x5580 # +0x3F27 0x5496 # +0x3F28 0x5361 # +0x3F29 0x54AF # +0x3F2A 0x5F00 # +0x3F2B 0x63E9 # +0x3F2C 0x6977 # +0x3F2D 0x51EF # +0x3F2E 0x6168 # +0x3F2F 0x520A # +0x3F30 0x582A # +0x3F31 0x52D8 # +0x3F32 0x574E # +0x3F33 0x780D # +0x3F34 0x770B # +0x3F35 0x5EB7 # +0x3F36 0x6177 # +0x3F37 0x7CE0 # +0x3F38 0x625B # +0x3F39 0x6297 # +0x3F3A 0x4EA2 # +0x3F3B 0x7095 # +0x3F3C 0x8003 # +0x3F3D 0x62F7 # +0x3F3E 0x70E4 # +0x3F3F 0x9760 # +0x3F40 0x5777 # +0x3F41 0x82DB # +0x3F42 0x67EF # +0x3F43 0x68F5 # +0x3F44 0x78D5 # +0x3F45 0x9897 # +0x3F46 0x79D1 # +0x3F47 0x58F3 # +0x3F48 0x54B3 # +0x3F49 0x53EF # +0x3F4A 0x6E34 # +0x3F4B 0x514B # +0x3F4C 0x523B # +0x3F4D 0x5BA2 # +0x3F4E 0x8BFE # +0x3F4F 0x80AF # +0x3F50 0x5543 # +0x3F51 0x57A6 # +0x3F52 0x6073 # +0x3F53 0x5751 # +0x3F54 0x542D # +0x3F55 0x7A7A # +0x3F56 0x6050 # +0x3F57 0x5B54 # +0x3F58 0x63A7 # +0x3F59 0x62A0 # +0x3F5A 0x53E3 # +0x3F5B 0x6263 # +0x3F5C 0x5BC7 # +0x3F5D 0x67AF # +0x3F5E 0x54ED # +0x3F5F 0x7A9F # +0x3F60 0x82E6 # +0x3F61 0x9177 # +0x3F62 0x5E93 # +0x3F63 0x88E4 # +0x3F64 0x5938 # +0x3F65 0x57AE # +0x3F66 0x630E # +0x3F67 0x8DE8 # +0x3F68 0x80EF # +0x3F69 0x5757 # +0x3F6A 0x7B77 # +0x3F6B 0x4FA9 # +0x3F6C 0x5FEB # +0x3F6D 0x5BBD # +0x3F6E 0x6B3E # +0x3F6F 0x5321 # +0x3F70 0x7B50 # +0x3F71 0x72C2 # +0x3F72 0x6846 # +0x3F73 0x77FF # +0x3F74 0x7736 # +0x3F75 0x65F7 # +0x3F76 0x51B5 # +0x3F77 0x4E8F # +0x3F78 0x76D4 # +0x3F79 0x5CBF # +0x3F7A 0x7AA5 # +0x3F7B 0x8475 # +0x3F7C 0x594E # +0x3F7D 0x9B41 # +0x3F7E 0x5080 # +0x4021 0x9988 # +0x4022 0x6127 # +0x4023 0x6E83 # +0x4024 0x5764 # +0x4025 0x6606 # +0x4026 0x6346 # +0x4027 0x56F0 # +0x4028 0x62EC # +0x4029 0x6269 # +0x402A 0x5ED3 # +0x402B 0x9614 # +0x402C 0x5783 # +0x402D 0x62C9 # +0x402E 0x5587 # +0x402F 0x8721 # +0x4030 0x814A # +0x4031 0x8FA3 # +0x4032 0x5566 # +0x4033 0x83B1 # +0x4034 0x6765 # +0x4035 0x8D56 # +0x4036 0x84DD # +0x4037 0x5A6A # +0x4038 0x680F # +0x4039 0x62E6 # +0x403A 0x7BEE # +0x403B 0x9611 # +0x403C 0x5170 # +0x403D 0x6F9C # +0x403E 0x8C30 # +0x403F 0x63FD # +0x4040 0x89C8 # +0x4041 0x61D2 # +0x4042 0x7F06 # +0x4043 0x70C2 # +0x4044 0x6EE5 # +0x4045 0x7405 # +0x4046 0x6994 # +0x4047 0x72FC # +0x4048 0x5ECA # +0x4049 0x90CE # +0x404A 0x6717 # +0x404B 0x6D6A # +0x404C 0x635E # +0x404D 0x52B3 # +0x404E 0x7262 # +0x404F 0x8001 # +0x4050 0x4F6C # +0x4051 0x59E5 # +0x4052 0x916A # +0x4053 0x70D9 # +0x4054 0x6D9D # +0x4055 0x52D2 # +0x4056 0x4E50 # +0x4057 0x96F7 # +0x4058 0x956D # +0x4059 0x857E # +0x405A 0x78CA # +0x405B 0x7D2F # +0x405C 0x5121 # +0x405D 0x5792 # +0x405E 0x64C2 # +0x405F 0x808B # +0x4060 0x7C7B # +0x4061 0x6CEA # +0x4062 0x68F1 # +0x4063 0x695E # +0x4064 0x51B7 # +0x4065 0x5398 # +0x4066 0x68A8 # +0x4067 0x7281 # +0x4068 0x9ECE # +0x4069 0x7BF1 # +0x406A 0x72F8 # +0x406B 0x79BB # +0x406C 0x6F13 # +0x406D 0x7406 # +0x406E 0x674E # +0x406F 0x91CC # +0x4070 0x9CA4 # +0x4071 0x793C # +0x4072 0x8389 # +0x4073 0x8354 # +0x4074 0x540F # +0x4075 0x6817 # +0x4076 0x4E3D # +0x4077 0x5389 # +0x4078 0x52B1 # +0x4079 0x783E # +0x407A 0x5386 # +0x407B 0x5229 # +0x407C 0x5088 # +0x407D 0x4F8B # +0x407E 0x4FD0 # +0x4121 0x75E2 # +0x4122 0x7ACB # +0x4123 0x7C92 # +0x4124 0x6CA5 # +0x4125 0x96B6 # +0x4126 0x529B # +0x4127 0x7483 # +0x4128 0x54E9 # +0x4129 0x4FE9 # +0x412A 0x8054 # +0x412B 0x83B2 # +0x412C 0x8FDE # +0x412D 0x9570 # +0x412E 0x5EC9 # +0x412F 0x601C # +0x4130 0x6D9F # +0x4131 0x5E18 # +0x4132 0x655B # +0x4133 0x8138 # +0x4134 0x94FE # +0x4135 0x604B # +0x4136 0x70BC # +0x4137 0x7EC3 # +0x4138 0x7CAE # +0x4139 0x51C9 # +0x413A 0x6881 # +0x413B 0x7CB1 # +0x413C 0x826F # +0x413D 0x4E24 # +0x413E 0x8F86 # +0x413F 0x91CF # +0x4140 0x667E # +0x4141 0x4EAE # +0x4142 0x8C05 # +0x4143 0x64A9 # +0x4144 0x804A # +0x4145 0x50DA # +0x4146 0x7597 # +0x4147 0x71CE # +0x4148 0x5BE5 # +0x4149 0x8FBD # +0x414A 0x6F66 # +0x414B 0x4E86 # +0x414C 0x6482 # +0x414D 0x9563 # +0x414E 0x5ED6 # +0x414F 0x6599 # +0x4150 0x5217 # +0x4151 0x88C2 # +0x4152 0x70C8 # +0x4153 0x52A3 # +0x4154 0x730E # +0x4155 0x7433 # +0x4156 0x6797 # +0x4157 0x78F7 # +0x4158 0x9716 # +0x4159 0x4E34 # +0x415A 0x90BB # +0x415B 0x9CDE # +0x415C 0x6DCB # +0x415D 0x51DB # +0x415E 0x8D41 # +0x415F 0x541D # +0x4160 0x62CE # +0x4161 0x73B2 # +0x4162 0x83F1 # +0x4163 0x96F6 # +0x4164 0x9F84 # +0x4165 0x94C3 # +0x4166 0x4F36 # +0x4167 0x7F9A # +0x4168 0x51CC # +0x4169 0x7075 # +0x416A 0x9675 # +0x416B 0x5CAD # +0x416C 0x9886 # +0x416D 0x53E6 # +0x416E 0x4EE4 # +0x416F 0x6E9C # +0x4170 0x7409 # +0x4171 0x69B4 # +0x4172 0x786B # +0x4173 0x998F # +0x4174 0x7559 # +0x4175 0x5218 # +0x4176 0x7624 # +0x4177 0x6D41 # +0x4178 0x67F3 # +0x4179 0x516D # +0x417A 0x9F99 # +0x417B 0x804B # +0x417C 0x5499 # +0x417D 0x7B3C # +0x417E 0x7ABF # +0x4221 0x9686 # +0x4222 0x5784 # +0x4223 0x62E2 # +0x4224 0x9647 # +0x4225 0x697C # +0x4226 0x5A04 # +0x4227 0x6402 # +0x4228 0x7BD3 # +0x4229 0x6F0F # +0x422A 0x964B # +0x422B 0x82A6 # +0x422C 0x5362 # +0x422D 0x9885 # +0x422E 0x5E90 # +0x422F 0x7089 # +0x4230 0x63B3 # +0x4231 0x5364 # +0x4232 0x864F # +0x4233 0x9C81 # +0x4234 0x9E93 # +0x4235 0x788C # +0x4236 0x9732 # +0x4237 0x8DEF # +0x4238 0x8D42 # +0x4239 0x9E7F # +0x423A 0x6F5E # +0x423B 0x7984 # +0x423C 0x5F55 # +0x423D 0x9646 # +0x423E 0x622E # +0x423F 0x9A74 # +0x4240 0x5415 # +0x4241 0x94DD # +0x4242 0x4FA3 # +0x4243 0x65C5 # +0x4244 0x5C65 # +0x4245 0x5C61 # +0x4246 0x7F15 # +0x4247 0x8651 # +0x4248 0x6C2F # +0x4249 0x5F8B # +0x424A 0x7387 # +0x424B 0x6EE4 # +0x424C 0x7EFF # +0x424D 0x5CE6 # +0x424E 0x631B # +0x424F 0x5B6A # +0x4250 0x6EE6 # +0x4251 0x5375 # +0x4252 0x4E71 # +0x4253 0x63A0 # +0x4254 0x7565 # +0x4255 0x62A1 # +0x4256 0x8F6E # +0x4257 0x4F26 # +0x4258 0x4ED1 # +0x4259 0x6CA6 # +0x425A 0x7EB6 # +0x425B 0x8BBA # +0x425C 0x841D # +0x425D 0x87BA # +0x425E 0x7F57 # +0x425F 0x903B # +0x4260 0x9523 # +0x4261 0x7BA9 # +0x4262 0x9AA1 # +0x4263 0x88F8 # +0x4264 0x843D # +0x4265 0x6D1B # +0x4266 0x9A86 # +0x4267 0x7EDC # +0x4268 0x5988 # +0x4269 0x9EBB # +0x426A 0x739B # +0x426B 0x7801 # +0x426C 0x8682 # +0x426D 0x9A6C # +0x426E 0x9A82 # +0x426F 0x561B # +0x4270 0x5417 # +0x4271 0x57CB # +0x4272 0x4E70 # +0x4273 0x9EA6 # +0x4274 0x5356 # +0x4275 0x8FC8 # +0x4276 0x8109 # +0x4277 0x7792 # +0x4278 0x9992 # +0x4279 0x86EE # +0x427A 0x6EE1 # +0x427B 0x8513 # +0x427C 0x66FC # +0x427D 0x6162 # +0x427E 0x6F2B # +0x4321 0x8C29 # +0x4322 0x8292 # +0x4323 0x832B # +0x4324 0x76F2 # +0x4325 0x6C13 # +0x4326 0x5FD9 # +0x4327 0x83BD # +0x4328 0x732B # +0x4329 0x8305 # +0x432A 0x951A # +0x432B 0x6BDB # +0x432C 0x77DB # +0x432D 0x94C6 # +0x432E 0x536F # +0x432F 0x8302 # +0x4330 0x5192 # +0x4331 0x5E3D # +0x4332 0x8C8C # +0x4333 0x8D38 # +0x4334 0x4E48 # +0x4335 0x73AB # +0x4336 0x679A # +0x4337 0x6885 # +0x4338 0x9176 # +0x4339 0x9709 # +0x433A 0x7164 # +0x433B 0x6CA1 # +0x433C 0x7709 # +0x433D 0x5A92 # +0x433E 0x9541 # +0x433F 0x6BCF # +0x4340 0x7F8E # +0x4341 0x6627 # +0x4342 0x5BD0 # +0x4343 0x59B9 # +0x4344 0x5A9A # +0x4345 0x95E8 # +0x4346 0x95F7 # +0x4347 0x4EEC # +0x4348 0x840C # +0x4349 0x8499 # +0x434A 0x6AAC # +0x434B 0x76DF # +0x434C 0x9530 # +0x434D 0x731B # +0x434E 0x68A6 # +0x434F 0x5B5F # +0x4350 0x772F # +0x4351 0x919A # +0x4352 0x9761 # +0x4353 0x7CDC # +0x4354 0x8FF7 # +0x4355 0x8C1C # +0x4356 0x5F25 # +0x4357 0x7C73 # +0x4358 0x79D8 # +0x4359 0x89C5 # +0x435A 0x6CCC # +0x435B 0x871C # +0x435C 0x5BC6 # +0x435D 0x5E42 # +0x435E 0x68C9 # +0x435F 0x7720 # +0x4360 0x7EF5 # +0x4361 0x5195 # +0x4362 0x514D # +0x4363 0x52C9 # +0x4364 0x5A29 # +0x4365 0x7F05 # +0x4366 0x9762 # +0x4367 0x82D7 # +0x4368 0x63CF # +0x4369 0x7784 # +0x436A 0x85D0 # +0x436B 0x79D2 # +0x436C 0x6E3A # +0x436D 0x5E99 # +0x436E 0x5999 # +0x436F 0x8511 # +0x4370 0x706D # +0x4371 0x6C11 # +0x4372 0x62BF # +0x4373 0x76BF # +0x4374 0x654F # +0x4375 0x60AF # +0x4376 0x95FD # +0x4377 0x660E # +0x4378 0x879F # +0x4379 0x9E23 # +0x437A 0x94ED # +0x437B 0x540D # +0x437C 0x547D # +0x437D 0x8C2C # +0x437E 0x6478 # +0x4421 0x6479 # +0x4422 0x8611 # +0x4423 0x6A21 # +0x4424 0x819C # +0x4425 0x78E8 # +0x4426 0x6469 # +0x4427 0x9B54 # +0x4428 0x62B9 # +0x4429 0x672B # +0x442A 0x83AB # +0x442B 0x58A8 # +0x442C 0x9ED8 # +0x442D 0x6CAB # +0x442E 0x6F20 # +0x442F 0x5BDE # +0x4430 0x964C # +0x4431 0x8C0B # +0x4432 0x725F # +0x4433 0x67D0 # +0x4434 0x62C7 # +0x4435 0x7261 # +0x4436 0x4EA9 # +0x4437 0x59C6 # +0x4438 0x6BCD # +0x4439 0x5893 # +0x443A 0x66AE # +0x443B 0x5E55 # +0x443C 0x52DF # +0x443D 0x6155 # +0x443E 0x6728 # +0x443F 0x76EE # +0x4440 0x7766 # +0x4441 0x7267 # +0x4442 0x7A46 # +0x4443 0x62FF # +0x4444 0x54EA # +0x4445 0x5450 # +0x4446 0x94A0 # +0x4447 0x90A3 # +0x4448 0x5A1C # +0x4449 0x7EB3 # +0x444A 0x6C16 # +0x444B 0x4E43 # +0x444C 0x5976 # +0x444D 0x8010 # +0x444E 0x5948 # +0x444F 0x5357 # +0x4450 0x7537 # +0x4451 0x96BE # +0x4452 0x56CA # +0x4453 0x6320 # +0x4454 0x8111 # +0x4455 0x607C # +0x4456 0x95F9 # +0x4457 0x6DD6 # +0x4458 0x5462 # +0x4459 0x9981 # +0x445A 0x5185 # +0x445B 0x5AE9 # +0x445C 0x80FD # +0x445D 0x59AE # +0x445E 0x9713 # +0x445F 0x502A # +0x4460 0x6CE5 # +0x4461 0x5C3C # +0x4462 0x62DF # +0x4463 0x4F60 # +0x4464 0x533F # +0x4465 0x817B # +0x4466 0x9006 # +0x4467 0x6EBA # +0x4468 0x852B # +0x4469 0x62C8 # +0x446A 0x5E74 # +0x446B 0x78BE # +0x446C 0x64B5 # +0x446D 0x637B # +0x446E 0x5FF5 # +0x446F 0x5A18 # +0x4470 0x917F # +0x4471 0x9E1F # +0x4472 0x5C3F # +0x4473 0x634F # +0x4474 0x8042 # +0x4475 0x5B7D # +0x4476 0x556E # +0x4477 0x954A # +0x4478 0x954D # +0x4479 0x6D85 # +0x447A 0x60A8 # +0x447B 0x67E0 # +0x447C 0x72DE # +0x447D 0x51DD # +0x447E 0x5B81 # +0x4521 0x62E7 # +0x4522 0x6CDE # +0x4523 0x725B # +0x4524 0x626D # +0x4525 0x94AE # +0x4526 0x7EBD # +0x4527 0x8113 # +0x4528 0x6D53 # +0x4529 0x519C # +0x452A 0x5F04 # +0x452B 0x5974 # +0x452C 0x52AA # +0x452D 0x6012 # +0x452E 0x5973 # +0x452F 0x6696 # +0x4530 0x8650 # +0x4531 0x759F # +0x4532 0x632A # +0x4533 0x61E6 # +0x4534 0x7CEF # +0x4535 0x8BFA # +0x4536 0x54E6 # +0x4537 0x6B27 # +0x4538 0x9E25 # +0x4539 0x6BB4 # +0x453A 0x85D5 # +0x453B 0x5455 # +0x453C 0x5076 # +0x453D 0x6CA4 # +0x453E 0x556A # +0x453F 0x8DB4 # +0x4540 0x722C # +0x4541 0x5E15 # +0x4542 0x6015 # +0x4543 0x7436 # +0x4544 0x62CD # +0x4545 0x6392 # +0x4546 0x724C # +0x4547 0x5F98 # +0x4548 0x6E43 # +0x4549 0x6D3E # +0x454A 0x6500 # +0x454B 0x6F58 # +0x454C 0x76D8 # +0x454D 0x78D0 # +0x454E 0x76FC # +0x454F 0x7554 # +0x4550 0x5224 # +0x4551 0x53DB # +0x4552 0x4E53 # +0x4553 0x5E9E # +0x4554 0x65C1 # +0x4555 0x802A # +0x4556 0x80D6 # +0x4557 0x629B # +0x4558 0x5486 # +0x4559 0x5228 # +0x455A 0x70AE # +0x455B 0x888D # +0x455C 0x8DD1 # +0x455D 0x6CE1 # +0x455E 0x5478 # +0x455F 0x80DA # +0x4560 0x57F9 # +0x4561 0x88F4 # +0x4562 0x8D54 # +0x4563 0x966A # +0x4564 0x914D # +0x4565 0x4F69 # +0x4566 0x6C9B # +0x4567 0x55B7 # +0x4568 0x76C6 # +0x4569 0x7830 # +0x456A 0x62A8 # +0x456B 0x70F9 # +0x456C 0x6F8E # +0x456D 0x5F6D # +0x456E 0x84EC # +0x456F 0x68DA # +0x4570 0x787C # +0x4571 0x7BF7 # +0x4572 0x81A8 # +0x4573 0x670B # +0x4574 0x9E4F # +0x4575 0x6367 # +0x4576 0x78B0 # +0x4577 0x576F # +0x4578 0x7812 # +0x4579 0x9739 # +0x457A 0x6279 # +0x457B 0x62AB # +0x457C 0x5288 # +0x457D 0x7435 # +0x457E 0x6BD7 # +0x4621 0x5564 # +0x4622 0x813E # +0x4623 0x75B2 # +0x4624 0x76AE # +0x4625 0x5339 # +0x4626 0x75DE # +0x4627 0x50FB # +0x4628 0x5C41 # +0x4629 0x8B6C # +0x462A 0x7BC7 # +0x462B 0x504F # +0x462C 0x7247 # +0x462D 0x9A97 # +0x462E 0x98D8 # +0x462F 0x6F02 # +0x4630 0x74E2 # +0x4631 0x7968 # +0x4632 0x6487 # +0x4633 0x77A5 # +0x4634 0x62FC # +0x4635 0x9891 # +0x4636 0x8D2B # +0x4637 0x54C1 # +0x4638 0x8058 # +0x4639 0x4E52 # +0x463A 0x576A # +0x463B 0x82F9 # +0x463C 0x840D # +0x463D 0x5E73 # +0x463E 0x51ED # +0x463F 0x74F6 # +0x4640 0x8BC4 # +0x4641 0x5C4F # +0x4642 0x5761 # +0x4643 0x6CFC # +0x4644 0x9887 # +0x4645 0x5A46 # +0x4646 0x7834 # +0x4647 0x9B44 # +0x4648 0x8FEB # +0x4649 0x7C95 # +0x464A 0x5256 # +0x464B 0x6251 # +0x464C 0x94FA # +0x464D 0x4EC6 # +0x464E 0x8386 # +0x464F 0x8461 # +0x4650 0x83E9 # +0x4651 0x84B2 # +0x4652 0x57D4 # +0x4653 0x6734 # +0x4654 0x5703 # +0x4655 0x666E # +0x4656 0x6D66 # +0x4657 0x8C31 # +0x4658 0x66DD # +0x4659 0x7011 # +0x465A 0x671F # +0x465B 0x6B3A # +0x465C 0x6816 # +0x465D 0x621A # +0x465E 0x59BB # +0x465F 0x4E03 # +0x4660 0x51C4 # +0x4661 0x6F06 # +0x4662 0x67D2 # +0x4663 0x6C8F # +0x4664 0x5176 # +0x4665 0x68CB # +0x4666 0x5947 # +0x4667 0x6B67 # +0x4668 0x7566 # +0x4669 0x5D0E # +0x466A 0x8110 # +0x466B 0x9F50 # +0x466C 0x65D7 # +0x466D 0x7948 # +0x466E 0x7941 # +0x466F 0x9A91 # +0x4670 0x8D77 # +0x4671 0x5C82 # +0x4672 0x4E5E # +0x4673 0x4F01 # +0x4674 0x542F # +0x4675 0x5951 # +0x4676 0x780C # +0x4677 0x5668 # +0x4678 0x6C14 # +0x4679 0x8FC4 # +0x467A 0x5F03 # +0x467B 0x6C7D # +0x467C 0x6CE3 # +0x467D 0x8BAB # +0x467E 0x6390 # +0x4721 0x6070 # +0x4722 0x6D3D # +0x4723 0x7275 # +0x4724 0x6266 # +0x4725 0x948E # +0x4726 0x94C5 # +0x4727 0x5343 # +0x4728 0x8FC1 # +0x4729 0x7B7E # +0x472A 0x4EDF # +0x472B 0x8C26 # +0x472C 0x4E7E # +0x472D 0x9ED4 # +0x472E 0x94B1 # +0x472F 0x94B3 # +0x4730 0x524D # +0x4731 0x6F5C # +0x4732 0x9063 # +0x4733 0x6D45 # +0x4734 0x8C34 # +0x4735 0x5811 # +0x4736 0x5D4C # +0x4737 0x6B20 # +0x4738 0x6B49 # +0x4739 0x67AA # +0x473A 0x545B # +0x473B 0x8154 # +0x473C 0x7F8C # +0x473D 0x5899 # +0x473E 0x8537 # +0x473F 0x5F3A # +0x4740 0x62A2 # +0x4741 0x6A47 # +0x4742 0x9539 # +0x4743 0x6572 # +0x4744 0x6084 # +0x4745 0x6865 # +0x4746 0x77A7 # +0x4747 0x4E54 # +0x4748 0x4FA8 # +0x4749 0x5DE7 # +0x474A 0x9798 # +0x474B 0x64AC # +0x474C 0x7FD8 # +0x474D 0x5CED # +0x474E 0x4FCF # +0x474F 0x7A8D # +0x4750 0x5207 # +0x4751 0x8304 # +0x4752 0x4E14 # +0x4753 0x602F # +0x4754 0x7A83 # +0x4755 0x94A6 # +0x4756 0x4FB5 # +0x4757 0x4EB2 # +0x4758 0x79E6 # +0x4759 0x7434 # +0x475A 0x52E4 # +0x475B 0x82B9 # +0x475C 0x64D2 # +0x475D 0x79BD # +0x475E 0x5BDD # +0x475F 0x6C81 # +0x4760 0x9752 # +0x4761 0x8F7B # +0x4762 0x6C22 # +0x4763 0x503E # +0x4764 0x537F # +0x4765 0x6E05 # +0x4766 0x64CE # +0x4767 0x6674 # +0x4768 0x6C30 # +0x4769 0x60C5 # +0x476A 0x9877 # +0x476B 0x8BF7 # +0x476C 0x5E86 # +0x476D 0x743C # +0x476E 0x7A77 # +0x476F 0x79CB # +0x4770 0x4E18 # +0x4771 0x90B1 # +0x4772 0x7403 # +0x4773 0x6C42 # +0x4774 0x56DA # +0x4775 0x914B # +0x4776 0x6CC5 # +0x4777 0x8D8B # +0x4778 0x533A # +0x4779 0x86C6 # +0x477A 0x66F2 # +0x477B 0x8EAF # +0x477C 0x5C48 # +0x477D 0x9A71 # +0x477E 0x6E20 # +0x4821 0x53D6 # +0x4822 0x5A36 # +0x4823 0x9F8B # +0x4824 0x8DA3 # +0x4825 0x53BB # +0x4826 0x5708 # +0x4827 0x98A7 # +0x4828 0x6743 # +0x4829 0x919B # +0x482A 0x6CC9 # +0x482B 0x5168 # +0x482C 0x75CA # +0x482D 0x62F3 # +0x482E 0x72AC # +0x482F 0x5238 # +0x4830 0x529D # +0x4831 0x7F3A # +0x4832 0x7094 # +0x4833 0x7638 # +0x4834 0x5374 # +0x4835 0x9E4A # +0x4836 0x69B7 # +0x4837 0x786E # +0x4838 0x96C0 # +0x4839 0x88D9 # +0x483A 0x7FA4 # +0x483B 0x7136 # +0x483C 0x71C3 # +0x483D 0x5189 # +0x483E 0x67D3 # +0x483F 0x74E4 # +0x4840 0x58E4 # +0x4841 0x6518 # +0x4842 0x56B7 # +0x4843 0x8BA9 # +0x4844 0x9976 # +0x4845 0x6270 # +0x4846 0x7ED5 # +0x4847 0x60F9 # +0x4848 0x70ED # +0x4849 0x58EC # +0x484A 0x4EC1 # +0x484B 0x4EBA # +0x484C 0x5FCD # +0x484D 0x97E7 # +0x484E 0x4EFB # +0x484F 0x8BA4 # +0x4850 0x5203 # +0x4851 0x598A # +0x4852 0x7EAB # +0x4853 0x6254 # +0x4854 0x4ECD # +0x4855 0x65E5 # +0x4856 0x620E # +0x4857 0x8338 # +0x4858 0x84C9 # +0x4859 0x8363 # +0x485A 0x878D # +0x485B 0x7194 # +0x485C 0x6EB6 # +0x485D 0x5BB9 # +0x485E 0x7ED2 # +0x485F 0x5197 # +0x4860 0x63C9 # +0x4861 0x67D4 # +0x4862 0x8089 # +0x4863 0x8339 # +0x4864 0x8815 # +0x4865 0x5112 # +0x4866 0x5B7A # +0x4867 0x5982 # +0x4868 0x8FB1 # +0x4869 0x4E73 # +0x486A 0x6C5D # +0x486B 0x5165 # +0x486C 0x8925 # +0x486D 0x8F6F # +0x486E 0x962E # +0x486F 0x854A # +0x4870 0x745E # +0x4871 0x9510 # +0x4872 0x95F0 # +0x4873 0x6DA6 # +0x4874 0x82E5 # +0x4875 0x5F31 # +0x4876 0x6492 # +0x4877 0x6D12 # +0x4878 0x8428 # +0x4879 0x816E # +0x487A 0x9CC3 # +0x487B 0x585E # +0x487C 0x8D5B # +0x487D 0x4E09 # +0x487E 0x53C1 # +0x4921 0x4F1E # +0x4922 0x6563 # +0x4923 0x6851 # +0x4924 0x55D3 # +0x4925 0x4E27 # +0x4926 0x6414 # +0x4927 0x9A9A # +0x4928 0x626B # +0x4929 0x5AC2 # +0x492A 0x745F # +0x492B 0x8272 # +0x492C 0x6DA9 # +0x492D 0x68EE # +0x492E 0x50E7 # +0x492F 0x838E # +0x4930 0x7802 # +0x4931 0x6740 # +0x4932 0x5239 # +0x4933 0x6C99 # +0x4934 0x7EB1 # +0x4935 0x50BB # +0x4936 0x5565 # +0x4937 0x715E # +0x4938 0x7B5B # +0x4939 0x6652 # +0x493A 0x73CA # +0x493B 0x82EB # +0x493C 0x6749 # +0x493D 0x5C71 # +0x493E 0x5220 # +0x493F 0x717D # +0x4940 0x886B # +0x4941 0x95EA # +0x4942 0x9655 # +0x4943 0x64C5 # +0x4944 0x8D61 # +0x4945 0x81B3 # +0x4946 0x5584 # +0x4947 0x6C55 # +0x4948 0x6247 # +0x4949 0x7F2E # +0x494A 0x5892 # +0x494B 0x4F24 # +0x494C 0x5546 # +0x494D 0x8D4F # +0x494E 0x664C # +0x494F 0x4E0A # +0x4950 0x5C1A # +0x4951 0x88F3 # +0x4952 0x68A2 # +0x4953 0x634E # +0x4954 0x7A0D # +0x4955 0x70E7 # +0x4956 0x828D # +0x4957 0x52FA # +0x4958 0x97F6 # +0x4959 0x5C11 # +0x495A 0x54E8 # +0x495B 0x90B5 # +0x495C 0x7ECD # +0x495D 0x5962 # +0x495E 0x8D4A # +0x495F 0x86C7 # +0x4960 0x820C # +0x4961 0x820D # +0x4962 0x8D66 # +0x4963 0x6444 # +0x4964 0x5C04 # +0x4965 0x6151 # +0x4966 0x6D89 # +0x4967 0x793E # +0x4968 0x8BBE # +0x4969 0x7837 # +0x496A 0x7533 # +0x496B 0x547B # +0x496C 0x4F38 # +0x496D 0x8EAB # +0x496E 0x6DF1 # +0x496F 0x5A20 # +0x4970 0x7EC5 # +0x4971 0x795E # +0x4972 0x6C88 # +0x4973 0x5BA1 # +0x4974 0x5A76 # +0x4975 0x751A # +0x4976 0x80BE # +0x4977 0x614E # +0x4978 0x6E17 # +0x4979 0x58F0 # +0x497A 0x751F # +0x497B 0x7525 # +0x497C 0x7272 # +0x497D 0x5347 # +0x497E 0x7EF3 # +0x4A21 0x7701 # +0x4A22 0x76DB # +0x4A23 0x5269 # +0x4A24 0x80DC # +0x4A25 0x5723 # +0x4A26 0x5E08 # +0x4A27 0x5931 # +0x4A28 0x72EE # +0x4A29 0x65BD # +0x4A2A 0x6E7F # +0x4A2B 0x8BD7 # +0x4A2C 0x5C38 # +0x4A2D 0x8671 # +0x4A2E 0x5341 # +0x4A2F 0x77F3 # +0x4A30 0x62FE # +0x4A31 0x65F6 # +0x4A32 0x4EC0 # +0x4A33 0x98DF # +0x4A34 0x8680 # +0x4A35 0x5B9E # +0x4A36 0x8BC6 # +0x4A37 0x53F2 # +0x4A38 0x77E2 # +0x4A39 0x4F7F # +0x4A3A 0x5C4E # +0x4A3B 0x9A76 # +0x4A3C 0x59CB # +0x4A3D 0x5F0F # +0x4A3E 0x793A # +0x4A3F 0x58EB # +0x4A40 0x4E16 # +0x4A41 0x67FF # +0x4A42 0x4E8B # +0x4A43 0x62ED # +0x4A44 0x8A93 # +0x4A45 0x901D # +0x4A46 0x52BF # +0x4A47 0x662F # +0x4A48 0x55DC # +0x4A49 0x566C # +0x4A4A 0x9002 # +0x4A4B 0x4ED5 # +0x4A4C 0x4F8D # +0x4A4D 0x91CA # +0x4A4E 0x9970 # +0x4A4F 0x6C0F # +0x4A50 0x5E02 # +0x4A51 0x6043 # +0x4A52 0x5BA4 # +0x4A53 0x89C6 # +0x4A54 0x8BD5 # +0x4A55 0x6536 # +0x4A56 0x624B # +0x4A57 0x9996 # +0x4A58 0x5B88 # +0x4A59 0x5BFF # +0x4A5A 0x6388 # +0x4A5B 0x552E # +0x4A5C 0x53D7 # +0x4A5D 0x7626 # +0x4A5E 0x517D # +0x4A5F 0x852C # +0x4A60 0x67A2 # +0x4A61 0x68B3 # +0x4A62 0x6B8A # +0x4A63 0x6292 # +0x4A64 0x8F93 # +0x4A65 0x53D4 # +0x4A66 0x8212 # +0x4A67 0x6DD1 # +0x4A68 0x758F # +0x4A69 0x4E66 # +0x4A6A 0x8D4E # +0x4A6B 0x5B70 # +0x4A6C 0x719F # +0x4A6D 0x85AF # +0x4A6E 0x6691 # +0x4A6F 0x66D9 # +0x4A70 0x7F72 # +0x4A71 0x8700 # +0x4A72 0x9ECD # +0x4A73 0x9F20 # +0x4A74 0x5C5E # +0x4A75 0x672F # +0x4A76 0x8FF0 # +0x4A77 0x6811 # +0x4A78 0x675F # +0x4A79 0x620D # +0x4A7A 0x7AD6 # +0x4A7B 0x5885 # +0x4A7C 0x5EB6 # +0x4A7D 0x6570 # +0x4A7E 0x6F31 # +0x4B21 0x6055 # +0x4B22 0x5237 # +0x4B23 0x800D # +0x4B24 0x6454 # +0x4B25 0x8870 # +0x4B26 0x7529 # +0x4B27 0x5E05 # +0x4B28 0x6813 # +0x4B29 0x62F4 # +0x4B2A 0x971C # +0x4B2B 0x53CC # +0x4B2C 0x723D # +0x4B2D 0x8C01 # +0x4B2E 0x6C34 # +0x4B2F 0x7761 # +0x4B30 0x7A0E # +0x4B31 0x542E # +0x4B32 0x77AC # +0x4B33 0x987A # +0x4B34 0x821C # +0x4B35 0x8BF4 # +0x4B36 0x7855 # +0x4B37 0x6714 # +0x4B38 0x70C1 # +0x4B39 0x65AF # +0x4B3A 0x6495 # +0x4B3B 0x5636 # +0x4B3C 0x601D # +0x4B3D 0x79C1 # +0x4B3E 0x53F8 # +0x4B3F 0x4E1D # +0x4B40 0x6B7B # +0x4B41 0x8086 # +0x4B42 0x5BFA # +0x4B43 0x55E3 # +0x4B44 0x56DB # +0x4B45 0x4F3A # +0x4B46 0x4F3C # +0x4B47 0x9972 # +0x4B48 0x5DF3 # +0x4B49 0x677E # +0x4B4A 0x8038 # +0x4B4B 0x6002 # +0x4B4C 0x9882 # +0x4B4D 0x9001 # +0x4B4E 0x5B8B # +0x4B4F 0x8BBC # +0x4B50 0x8BF5 # +0x4B51 0x641C # +0x4B52 0x8258 # +0x4B53 0x64DE # +0x4B54 0x55FD # +0x4B55 0x82CF # +0x4B56 0x9165 # +0x4B57 0x4FD7 # +0x4B58 0x7D20 # +0x4B59 0x901F # +0x4B5A 0x7C9F # +0x4B5B 0x50F3 # +0x4B5C 0x5851 # +0x4B5D 0x6EAF # +0x4B5E 0x5BBF # +0x4B5F 0x8BC9 # +0x4B60 0x8083 # +0x4B61 0x9178 # +0x4B62 0x849C # +0x4B63 0x7B97 # +0x4B64 0x867D # +0x4B65 0x968B # +0x4B66 0x968F # +0x4B67 0x7EE5 # +0x4B68 0x9AD3 # +0x4B69 0x788E # +0x4B6A 0x5C81 # +0x4B6B 0x7A57 # +0x4B6C 0x9042 # +0x4B6D 0x96A7 # +0x4B6E 0x795F # +0x4B6F 0x5B59 # +0x4B70 0x635F # +0x4B71 0x7B0B # +0x4B72 0x84D1 # +0x4B73 0x68AD # +0x4B74 0x5506 # +0x4B75 0x7F29 # +0x4B76 0x7410 # +0x4B77 0x7D22 # +0x4B78 0x9501 # +0x4B79 0x6240 # +0x4B7A 0x584C # +0x4B7B 0x4ED6 # +0x4B7C 0x5B83 # +0x4B7D 0x5979 # +0x4B7E 0x5854 # +0x4C21 0x736D # +0x4C22 0x631E # +0x4C23 0x8E4B # +0x4C24 0x8E0F # +0x4C25 0x80CE # +0x4C26 0x82D4 # +0x4C27 0x62AC # +0x4C28 0x53F0 # +0x4C29 0x6CF0 # +0x4C2A 0x915E # +0x4C2B 0x592A # +0x4C2C 0x6001 # +0x4C2D 0x6C70 # +0x4C2E 0x574D # +0x4C2F 0x644A # +0x4C30 0x8D2A # +0x4C31 0x762B # +0x4C32 0x6EE9 # +0x4C33 0x575B # +0x4C34 0x6A80 # +0x4C35 0x75F0 # +0x4C36 0x6F6D # +0x4C37 0x8C2D # +0x4C38 0x8C08 # +0x4C39 0x5766 # +0x4C3A 0x6BEF # +0x4C3B 0x8892 # +0x4C3C 0x78B3 # +0x4C3D 0x63A2 # +0x4C3E 0x53F9 # +0x4C3F 0x70AD # +0x4C40 0x6C64 # +0x4C41 0x5858 # +0x4C42 0x642A # +0x4C43 0x5802 # +0x4C44 0x68E0 # +0x4C45 0x819B # +0x4C46 0x5510 # +0x4C47 0x7CD6 # +0x4C48 0x5018 # +0x4C49 0x8EBA # +0x4C4A 0x6DCC # +0x4C4B 0x8D9F # +0x4C4C 0x70EB # +0x4C4D 0x638F # +0x4C4E 0x6D9B # +0x4C4F 0x6ED4 # +0x4C50 0x7EE6 # +0x4C51 0x8404 # +0x4C52 0x6843 # +0x4C53 0x9003 # +0x4C54 0x6DD8 # +0x4C55 0x9676 # +0x4C56 0x8BA8 # +0x4C57 0x5957 # +0x4C58 0x7279 # +0x4C59 0x85E4 # +0x4C5A 0x817E # +0x4C5B 0x75BC # +0x4C5C 0x8A8A # +0x4C5D 0x68AF # +0x4C5E 0x5254 # +0x4C5F 0x8E22 # +0x4C60 0x9511 # +0x4C61 0x63D0 # +0x4C62 0x9898 # +0x4C63 0x8E44 # +0x4C64 0x557C # +0x4C65 0x4F53 # +0x4C66 0x66FF # +0x4C67 0x568F # +0x4C68 0x60D5 # +0x4C69 0x6D95 # +0x4C6A 0x5243 # +0x4C6B 0x5C49 # +0x4C6C 0x5929 # +0x4C6D 0x6DFB # +0x4C6E 0x586B # +0x4C6F 0x7530 # +0x4C70 0x751C # +0x4C71 0x606C # +0x4C72 0x8214 # +0x4C73 0x8146 # +0x4C74 0x6311 # +0x4C75 0x6761 # +0x4C76 0x8FE2 # +0x4C77 0x773A # +0x4C78 0x8DF3 # +0x4C79 0x8D34 # +0x4C7A 0x94C1 # +0x4C7B 0x5E16 # +0x4C7C 0x5385 # +0x4C7D 0x542C # +0x4C7E 0x70C3 # +0x4D21 0x6C40 # +0x4D22 0x5EF7 # +0x4D23 0x505C # +0x4D24 0x4EAD # +0x4D25 0x5EAD # +0x4D26 0x633A # +0x4D27 0x8247 # +0x4D28 0x901A # +0x4D29 0x6850 # +0x4D2A 0x916E # +0x4D2B 0x77B3 # +0x4D2C 0x540C # +0x4D2D 0x94DC # +0x4D2E 0x5F64 # +0x4D2F 0x7AE5 # +0x4D30 0x6876 # +0x4D31 0x6345 # +0x4D32 0x7B52 # +0x4D33 0x7EDF # +0x4D34 0x75DB # +0x4D35 0x5077 # +0x4D36 0x6295 # +0x4D37 0x5934 # +0x4D38 0x900F # +0x4D39 0x51F8 # +0x4D3A 0x79C3 # +0x4D3B 0x7A81 # +0x4D3C 0x56FE # +0x4D3D 0x5F92 # +0x4D3E 0x9014 # +0x4D3F 0x6D82 # +0x4D40 0x5C60 # +0x4D41 0x571F # +0x4D42 0x5410 # +0x4D43 0x5154 # +0x4D44 0x6E4D # +0x4D45 0x56E2 # +0x4D46 0x63A8 # +0x4D47 0x9893 # +0x4D48 0x817F # +0x4D49 0x8715 # +0x4D4A 0x892A # +0x4D4B 0x9000 # +0x4D4C 0x541E # +0x4D4D 0x5C6F # +0x4D4E 0x81C0 # +0x4D4F 0x62D6 # +0x4D50 0x6258 # +0x4D51 0x8131 # +0x4D52 0x9E35 # +0x4D53 0x9640 # +0x4D54 0x9A6E # +0x4D55 0x9A7C # +0x4D56 0x692D # +0x4D57 0x59A5 # +0x4D58 0x62D3 # +0x4D59 0x553E # +0x4D5A 0x6316 # +0x4D5B 0x54C7 # +0x4D5C 0x86D9 # +0x4D5D 0x6D3C # +0x4D5E 0x5A03 # +0x4D5F 0x74E6 # +0x4D60 0x889C # +0x4D61 0x6B6A # +0x4D62 0x5916 # +0x4D63 0x8C4C # +0x4D64 0x5F2F # +0x4D65 0x6E7E # +0x4D66 0x73A9 # +0x4D67 0x987D # +0x4D68 0x4E38 # +0x4D69 0x70F7 # +0x4D6A 0x5B8C # +0x4D6B 0x7897 # +0x4D6C 0x633D # +0x4D6D 0x665A # +0x4D6E 0x7696 # +0x4D6F 0x60CB # +0x4D70 0x5B9B # +0x4D71 0x5A49 # +0x4D72 0x4E07 # +0x4D73 0x8155 # +0x4D74 0x6C6A # +0x4D75 0x738B # +0x4D76 0x4EA1 # +0x4D77 0x6789 # +0x4D78 0x7F51 # +0x4D79 0x5F80 # +0x4D7A 0x65FA # +0x4D7B 0x671B # +0x4D7C 0x5FD8 # +0x4D7D 0x5984 # +0x4D7E 0x5A01 # +0x4E21 0x5DCD # +0x4E22 0x5FAE # +0x4E23 0x5371 # +0x4E24 0x97E6 # +0x4E25 0x8FDD # +0x4E26 0x6845 # +0x4E27 0x56F4 # +0x4E28 0x552F # +0x4E29 0x60DF # +0x4E2A 0x4E3A # +0x4E2B 0x6F4D # +0x4E2C 0x7EF4 # +0x4E2D 0x82C7 # +0x4E2E 0x840E # +0x4E2F 0x59D4 # +0x4E30 0x4F1F # +0x4E31 0x4F2A # +0x4E32 0x5C3E # +0x4E33 0x7EAC # +0x4E34 0x672A # +0x4E35 0x851A # +0x4E36 0x5473 # +0x4E37 0x754F # +0x4E38 0x80C3 # +0x4E39 0x5582 # +0x4E3A 0x9B4F # +0x4E3B 0x4F4D # +0x4E3C 0x6E2D # +0x4E3D 0x8C13 # +0x4E3E 0x5C09 # +0x4E3F 0x6170 # +0x4E40 0x536B # +0x4E41 0x761F # +0x4E42 0x6E29 # +0x4E43 0x868A # +0x4E44 0x6587 # +0x4E45 0x95FB # +0x4E46 0x7EB9 # +0x4E47 0x543B # +0x4E48 0x7A33 # +0x4E49 0x7D0A # +0x4E4A 0x95EE # +0x4E4B 0x55E1 # +0x4E4C 0x7FC1 # +0x4E4D 0x74EE # +0x4E4E 0x631D # +0x4E4F 0x8717 # +0x4E50 0x6DA1 # +0x4E51 0x7A9D # +0x4E52 0x6211 # +0x4E53 0x65A1 # +0x4E54 0x5367 # +0x4E55 0x63E1 # +0x4E56 0x6C83 # +0x4E57 0x5DEB # +0x4E58 0x545C # +0x4E59 0x94A8 # +0x4E5A 0x4E4C # +0x4E5B 0x6C61 # +0x4E5C 0x8BEC # +0x4E5D 0x5C4B # +0x4E5E 0x65E0 # +0x4E5F 0x829C # +0x4E60 0x68A7 # +0x4E61 0x543E # +0x4E62 0x5434 # +0x4E63 0x6BCB # +0x4E64 0x6B66 # +0x4E65 0x4E94 # +0x4E66 0x6342 # +0x4E67 0x5348 # +0x4E68 0x821E # +0x4E69 0x4F0D # +0x4E6A 0x4FAE # +0x4E6B 0x575E # +0x4E6C 0x620A # +0x4E6D 0x96FE # +0x4E6E 0x6664 # +0x4E6F 0x7269 # +0x4E70 0x52FF # +0x4E71 0x52A1 # +0x4E72 0x609F # +0x4E73 0x8BEF # +0x4E74 0x6614 # +0x4E75 0x7199 # +0x4E76 0x6790 # +0x4E77 0x897F # +0x4E78 0x7852 # +0x4E79 0x77FD # +0x4E7A 0x6670 # +0x4E7B 0x563B # +0x4E7C 0x5438 # +0x4E7D 0x9521 # +0x4E7E 0x727A # +0x4F21 0x7A00 # +0x4F22 0x606F # +0x4F23 0x5E0C # +0x4F24 0x6089 # +0x4F25 0x819D # +0x4F26 0x5915 # +0x4F27 0x60DC # +0x4F28 0x7184 # +0x4F29 0x70EF # +0x4F2A 0x6EAA # +0x4F2B 0x6C50 # +0x4F2C 0x7280 # +0x4F2D 0x6A84 # +0x4F2E 0x88AD # +0x4F2F 0x5E2D # +0x4F30 0x4E60 # +0x4F31 0x5AB3 # +0x4F32 0x559C # +0x4F33 0x94E3 # +0x4F34 0x6D17 # +0x4F35 0x7CFB # +0x4F36 0x9699 # +0x4F37 0x620F # +0x4F38 0x7EC6 # +0x4F39 0x778E # +0x4F3A 0x867E # +0x4F3B 0x5323 # +0x4F3C 0x971E # +0x4F3D 0x8F96 # +0x4F3E 0x6687 # +0x4F3F 0x5CE1 # +0x4F40 0x4FA0 # +0x4F41 0x72ED # +0x4F42 0x4E0B # +0x4F43 0x53A6 # +0x4F44 0x590F # +0x4F45 0x5413 # +0x4F46 0x6380 # +0x4F47 0x9528 # +0x4F48 0x5148 # +0x4F49 0x4ED9 # +0x4F4A 0x9C9C # +0x4F4B 0x7EA4 # +0x4F4C 0x54B8 # +0x4F4D 0x8D24 # +0x4F4E 0x8854 # +0x4F4F 0x8237 # +0x4F50 0x95F2 # +0x4F51 0x6D8E # +0x4F52 0x5F26 # +0x4F53 0x5ACC # +0x4F54 0x663E # +0x4F55 0x9669 # +0x4F56 0x73B0 # +0x4F57 0x732E # +0x4F58 0x53BF # +0x4F59 0x817A # +0x4F5A 0x9985 # +0x4F5B 0x7FA1 # +0x4F5C 0x5BAA # +0x4F5D 0x9677 # +0x4F5E 0x9650 # +0x4F5F 0x7EBF # +0x4F60 0x76F8 # +0x4F61 0x53A2 # +0x4F62 0x9576 # +0x4F63 0x9999 # +0x4F64 0x7BB1 # +0x4F65 0x8944 # +0x4F66 0x6E58 # +0x4F67 0x4E61 # +0x4F68 0x7FD4 # +0x4F69 0x7965 # +0x4F6A 0x8BE6 # +0x4F6B 0x60F3 # +0x4F6C 0x54CD # +0x4F6D 0x4EAB # +0x4F6E 0x9879 # +0x4F6F 0x5DF7 # +0x4F70 0x6A61 # +0x4F71 0x50CF # +0x4F72 0x5411 # +0x4F73 0x8C61 # +0x4F74 0x8427 # +0x4F75 0x785D # +0x4F76 0x9704 # +0x4F77 0x524A # +0x4F78 0x54EE # +0x4F79 0x56A3 # +0x4F7A 0x9500 # +0x4F7B 0x6D88 # +0x4F7C 0x5BB5 # +0x4F7D 0x6DC6 # +0x4F7E 0x6653 # +0x5021 0x5C0F # +0x5022 0x5B5D # +0x5023 0x6821 # +0x5024 0x8096 # +0x5025 0x5578 # +0x5026 0x7B11 # +0x5027 0x6548 # +0x5028 0x6954 # +0x5029 0x4E9B # +0x502A 0x6B47 # +0x502B 0x874E # +0x502C 0x978B # +0x502D 0x534F # +0x502E 0x631F # +0x502F 0x643A # +0x5030 0x90AA # +0x5031 0x659C # +0x5032 0x80C1 # +0x5033 0x8C10 # +0x5034 0x5199 # +0x5035 0x68B0 # +0x5036 0x5378 # +0x5037 0x87F9 # +0x5038 0x61C8 # +0x5039 0x6CC4 # +0x503A 0x6CFB # +0x503B 0x8C22 # +0x503C 0x5C51 # +0x503D 0x85AA # +0x503E 0x82AF # +0x503F 0x950C # +0x5040 0x6B23 # +0x5041 0x8F9B # +0x5042 0x65B0 # +0x5043 0x5FFB # +0x5044 0x5FC3 # +0x5045 0x4FE1 # +0x5046 0x8845 # +0x5047 0x661F # +0x5048 0x8165 # +0x5049 0x7329 # +0x504A 0x60FA # +0x504B 0x5174 # +0x504C 0x5211 # +0x504D 0x578B # +0x504E 0x5F62 # +0x504F 0x90A2 # +0x5050 0x884C # +0x5051 0x9192 # +0x5052 0x5E78 # +0x5053 0x674F # +0x5054 0x6027 # +0x5055 0x59D3 # +0x5056 0x5144 # +0x5057 0x51F6 # +0x5058 0x80F8 # +0x5059 0x5308 # +0x505A 0x6C79 # +0x505B 0x96C4 # +0x505C 0x718A # +0x505D 0x4F11 # +0x505E 0x4FEE # +0x505F 0x7F9E # +0x5060 0x673D # +0x5061 0x55C5 # +0x5062 0x9508 # +0x5063 0x79C0 # +0x5064 0x8896 # +0x5065 0x7EE3 # +0x5066 0x589F # +0x5067 0x620C # +0x5068 0x9700 # +0x5069 0x865A # +0x506A 0x5618 # +0x506B 0x987B # +0x506C 0x5F90 # +0x506D 0x8BB8 # +0x506E 0x84C4 # +0x506F 0x9157 # +0x5070 0x53D9 # +0x5071 0x65ED # +0x5072 0x5E8F # +0x5073 0x755C # +0x5074 0x6064 # +0x5075 0x7D6E # +0x5076 0x5A7F # +0x5077 0x7EEA # +0x5078 0x7EED # +0x5079 0x8F69 # +0x507A 0x55A7 # +0x507B 0x5BA3 # +0x507C 0x60AC # +0x507D 0x65CB # +0x507E 0x7384 # +0x5121 0x9009 # +0x5122 0x7663 # +0x5123 0x7729 # +0x5124 0x7EDA # +0x5125 0x9774 # +0x5126 0x859B # +0x5127 0x5B66 # +0x5128 0x7A74 # +0x5129 0x96EA # +0x512A 0x8840 # +0x512B 0x52CB # +0x512C 0x718F # +0x512D 0x5FAA # +0x512E 0x65EC # +0x512F 0x8BE2 # +0x5130 0x5BFB # +0x5131 0x9A6F # +0x5132 0x5DE1 # +0x5133 0x6B89 # +0x5134 0x6C5B # +0x5135 0x8BAD # +0x5136 0x8BAF # +0x5137 0x900A # +0x5138 0x8FC5 # +0x5139 0x538B # +0x513A 0x62BC # +0x513B 0x9E26 # +0x513C 0x9E2D # +0x513D 0x5440 # +0x513E 0x4E2B # +0x513F 0x82BD # +0x5140 0x7259 # +0x5141 0x869C # +0x5142 0x5D16 # +0x5143 0x8859 # +0x5144 0x6DAF # +0x5145 0x96C5 # +0x5146 0x54D1 # +0x5147 0x4E9A # +0x5148 0x8BB6 # +0x5149 0x7109 # +0x514A 0x54BD # +0x514B 0x9609 # +0x514C 0x70DF # +0x514D 0x6DF9 # +0x514E 0x76D0 # +0x514F 0x4E25 # +0x5150 0x7814 # +0x5151 0x8712 # +0x5152 0x5CA9 # +0x5153 0x5EF6 # +0x5154 0x8A00 # +0x5155 0x989C # +0x5156 0x960E # +0x5157 0x708E # +0x5158 0x6CBF # +0x5159 0x5944 # +0x515A 0x63A9 # +0x515B 0x773C # +0x515C 0x884D # +0x515D 0x6F14 # +0x515E 0x8273 # +0x515F 0x5830 # +0x5160 0x71D5 # +0x5161 0x538C # +0x5162 0x781A # +0x5163 0x96C1 # +0x5164 0x5501 # +0x5165 0x5F66 # +0x5166 0x7130 # +0x5167 0x5BB4 # +0x5168 0x8C1A # +0x5169 0x9A8C # +0x516A 0x6B83 # +0x516B 0x592E # +0x516C 0x9E2F # +0x516D 0x79E7 # +0x516E 0x6768 # +0x516F 0x626C # +0x5170 0x4F6F # +0x5171 0x75A1 # +0x5172 0x7F8A # +0x5173 0x6D0B # +0x5174 0x9633 # +0x5175 0x6C27 # +0x5176 0x4EF0 # +0x5177 0x75D2 # +0x5178 0x517B # +0x5179 0x6837 # +0x517A 0x6F3E # +0x517B 0x9080 # +0x517C 0x8170 # +0x517D 0x5996 # +0x517E 0x7476 # +0x5221 0x6447 # +0x5222 0x5C27 # +0x5223 0x9065 # +0x5224 0x7A91 # +0x5225 0x8C23 # +0x5226 0x59DA # +0x5227 0x54AC # +0x5228 0x8200 # +0x5229 0x836F # +0x522A 0x8981 # +0x522B 0x8000 # +0x522C 0x6930 # +0x522D 0x564E # +0x522E 0x8036 # +0x522F 0x7237 # +0x5230 0x91CE # +0x5231 0x51B6 # +0x5232 0x4E5F # +0x5233 0x9875 # +0x5234 0x6396 # +0x5235 0x4E1A # +0x5236 0x53F6 # +0x5237 0x66F3 # +0x5238 0x814B # +0x5239 0x591C # +0x523A 0x6DB2 # +0x523B 0x4E00 # +0x523C 0x58F9 # +0x523D 0x533B # +0x523E 0x63D6 # +0x523F 0x94F1 # +0x5240 0x4F9D # +0x5241 0x4F0A # +0x5242 0x8863 # +0x5243 0x9890 # +0x5244 0x5937 # +0x5245 0x9057 # +0x5246 0x79FB # +0x5247 0x4EEA # +0x5248 0x80F0 # +0x5249 0x7591 # +0x524A 0x6C82 # +0x524B 0x5B9C # +0x524C 0x59E8 # +0x524D 0x5F5D # +0x524E 0x6905 # +0x524F 0x8681 # +0x5250 0x501A # +0x5251 0x5DF2 # +0x5252 0x4E59 # +0x5253 0x77E3 # +0x5254 0x4EE5 # +0x5255 0x827A # +0x5256 0x6291 # +0x5257 0x6613 # +0x5258 0x9091 # +0x5259 0x5C79 # +0x525A 0x4EBF # +0x525B 0x5F79 # +0x525C 0x81C6 # +0x525D 0x9038 # +0x525E 0x8084 # +0x525F 0x75AB # +0x5260 0x4EA6 # +0x5261 0x88D4 # +0x5262 0x610F # +0x5263 0x6BC5 # +0x5264 0x5FC6 # +0x5265 0x4E49 # +0x5266 0x76CA # +0x5267 0x6EA2 # +0x5268 0x8BE3 # +0x5269 0x8BAE # +0x526A 0x8C0A # +0x526B 0x8BD1 # +0x526C 0x5F02 # +0x526D 0x7FFC # +0x526E 0x7FCC # +0x526F 0x7ECE # +0x5270 0x8335 # +0x5271 0x836B # +0x5272 0x56E0 # +0x5273 0x6BB7 # +0x5274 0x97F3 # +0x5275 0x9634 # +0x5276 0x59FB # +0x5277 0x541F # +0x5278 0x94F6 # +0x5279 0x6DEB # +0x527A 0x5BC5 # +0x527B 0x996E # +0x527C 0x5C39 # +0x527D 0x5F15 # +0x527E 0x9690 # +0x5321 0x5370 # +0x5322 0x82F1 # +0x5323 0x6A31 # +0x5324 0x5A74 # +0x5325 0x9E70 # +0x5326 0x5E94 # +0x5327 0x7F28 # +0x5328 0x83B9 # +0x5329 0x8424 # +0x532A 0x8425 # +0x532B 0x8367 # +0x532C 0x8747 # +0x532D 0x8FCE # +0x532E 0x8D62 # +0x532F 0x76C8 # +0x5330 0x5F71 # +0x5331 0x9896 # +0x5332 0x786C # +0x5333 0x6620 # +0x5334 0x54DF # +0x5335 0x62E5 # +0x5336 0x4F63 # +0x5337 0x81C3 # +0x5338 0x75C8 # +0x5339 0x5EB8 # +0x533A 0x96CD # +0x533B 0x8E0A # +0x533C 0x86F9 # +0x533D 0x548F # +0x533E 0x6CF3 # +0x533F 0x6D8C # +0x5340 0x6C38 # +0x5341 0x607F # +0x5342 0x52C7 # +0x5343 0x7528 # +0x5344 0x5E7D # +0x5345 0x4F18 # +0x5346 0x60A0 # +0x5347 0x5FE7 # +0x5348 0x5C24 # +0x5349 0x7531 # +0x534A 0x90AE # +0x534B 0x94C0 # +0x534C 0x72B9 # +0x534D 0x6CB9 # +0x534E 0x6E38 # +0x534F 0x9149 # +0x5350 0x6709 # +0x5351 0x53CB # +0x5352 0x53F3 # +0x5353 0x4F51 # +0x5354 0x91C9 # +0x5355 0x8BF1 # +0x5356 0x53C8 # +0x5357 0x5E7C # +0x5358 0x8FC2 # +0x5359 0x6DE4 # +0x535A 0x4E8E # +0x535B 0x76C2 # +0x535C 0x6986 # +0x535D 0x865E # +0x535E 0x611A # +0x535F 0x8206 # +0x5360 0x4F59 # +0x5361 0x4FDE # +0x5362 0x903E # +0x5363 0x9C7C # +0x5364 0x6109 # +0x5365 0x6E1D # +0x5366 0x6E14 # +0x5367 0x9685 # +0x5368 0x4E88 # +0x5369 0x5A31 # +0x536A 0x96E8 # +0x536B 0x4E0E # +0x536C 0x5C7F # +0x536D 0x79B9 # +0x536E 0x5B87 # +0x536F 0x8BED # +0x5370 0x7FBD # +0x5371 0x7389 # +0x5372 0x57DF # +0x5373 0x828B # +0x5374 0x90C1 # +0x5375 0x5401 # +0x5376 0x9047 # +0x5377 0x55BB # +0x5378 0x5CEA # +0x5379 0x5FA1 # +0x537A 0x6108 # +0x537B 0x6B32 # +0x537C 0x72F1 # +0x537D 0x80B2 # +0x537E 0x8A89 # +0x5421 0x6D74 # +0x5422 0x5BD3 # +0x5423 0x88D5 # +0x5424 0x9884 # +0x5425 0x8C6B # +0x5426 0x9A6D # +0x5427 0x9E33 # +0x5428 0x6E0A # +0x5429 0x51A4 # +0x542A 0x5143 # +0x542B 0x57A3 # +0x542C 0x8881 # +0x542D 0x539F # +0x542E 0x63F4 # +0x542F 0x8F95 # +0x5430 0x56ED # +0x5431 0x5458 # +0x5432 0x5706 # +0x5433 0x733F # +0x5434 0x6E90 # +0x5435 0x7F18 # +0x5436 0x8FDC # +0x5437 0x82D1 # +0x5438 0x613F # +0x5439 0x6028 # +0x543A 0x9662 # +0x543B 0x66F0 # +0x543C 0x7EA6 # +0x543D 0x8D8A # +0x543E 0x8DC3 # +0x543F 0x94A5 # +0x5440 0x5CB3 # +0x5441 0x7CA4 # +0x5442 0x6708 # +0x5443 0x60A6 # +0x5444 0x9605 # +0x5445 0x8018 # +0x5446 0x4E91 # +0x5447 0x90E7 # +0x5448 0x5300 # +0x5449 0x9668 # +0x544A 0x5141 # +0x544B 0x8FD0 # +0x544C 0x8574 # +0x544D 0x915D # +0x544E 0x6655 # +0x544F 0x97F5 # +0x5450 0x5B55 # +0x5451 0x531D # +0x5452 0x7838 # +0x5453 0x6742 # +0x5454 0x683D # +0x5455 0x54C9 # +0x5456 0x707E # +0x5457 0x5BB0 # +0x5458 0x8F7D # +0x5459 0x518D # +0x545A 0x5728 # +0x545B 0x54B1 # +0x545C 0x6512 # +0x545D 0x6682 # +0x545E 0x8D5E # +0x545F 0x8D43 # +0x5460 0x810F # +0x5461 0x846C # +0x5462 0x906D # +0x5463 0x7CDF # +0x5464 0x51FF # +0x5465 0x85FB # +0x5466 0x67A3 # +0x5467 0x65E9 # +0x5468 0x6FA1 # +0x5469 0x86A4 # +0x546A 0x8E81 # +0x546B 0x566A # +0x546C 0x9020 # +0x546D 0x7682 # +0x546E 0x7076 # +0x546F 0x71E5 # +0x5470 0x8D23 # +0x5471 0x62E9 # +0x5472 0x5219 # +0x5473 0x6CFD # +0x5474 0x8D3C # +0x5475 0x600E # +0x5476 0x589E # +0x5477 0x618E # +0x5478 0x66FE # +0x5479 0x8D60 # +0x547A 0x624E # +0x547B 0x55B3 # +0x547C 0x6E23 # +0x547D 0x672D # +0x547E 0x8F67 # +0x5521 0x94E1 # +0x5522 0x95F8 # +0x5523 0x7728 # +0x5524 0x6805 # +0x5525 0x69A8 # +0x5526 0x548B # +0x5527 0x4E4D # +0x5528 0x70B8 # +0x5529 0x8BC8 # +0x552A 0x6458 # +0x552B 0x658B # +0x552C 0x5B85 # +0x552D 0x7A84 # +0x552E 0x503A # +0x552F 0x5BE8 # +0x5530 0x77BB # +0x5531 0x6BE1 # +0x5532 0x8A79 # +0x5533 0x7C98 # +0x5534 0x6CBE # +0x5535 0x76CF # +0x5536 0x65A9 # +0x5537 0x8F97 # +0x5538 0x5D2D # +0x5539 0x5C55 # +0x553A 0x8638 # +0x553B 0x6808 # +0x553C 0x5360 # +0x553D 0x6218 # +0x553E 0x7AD9 # +0x553F 0x6E5B # +0x5540 0x7EFD # +0x5541 0x6A1F # +0x5542 0x7AE0 # +0x5543 0x5F70 # +0x5544 0x6F33 # +0x5545 0x5F20 # +0x5546 0x638C # +0x5547 0x6DA8 # +0x5548 0x6756 # +0x5549 0x4E08 # +0x554A 0x5E10 # +0x554B 0x8D26 # +0x554C 0x4ED7 # +0x554D 0x80C0 # +0x554E 0x7634 # +0x554F 0x969C # +0x5550 0x62DB # +0x5551 0x662D # +0x5552 0x627E # +0x5553 0x6CBC # +0x5554 0x8D75 # +0x5555 0x7167 # +0x5556 0x7F69 # +0x5557 0x5146 # +0x5558 0x8087 # +0x5559 0x53EC # +0x555A 0x906E # +0x555B 0x6298 # +0x555C 0x54F2 # +0x555D 0x86F0 # +0x555E 0x8F99 # +0x555F 0x8005 # +0x5560 0x9517 # +0x5561 0x8517 # +0x5562 0x8FD9 # +0x5563 0x6D59 # +0x5564 0x73CD # +0x5565 0x659F # +0x5566 0x771F # +0x5567 0x7504 # +0x5568 0x7827 # +0x5569 0x81FB # +0x556A 0x8D1E # +0x556B 0x9488 # +0x556C 0x4FA6 # +0x556D 0x6795 # +0x556E 0x75B9 # +0x556F 0x8BCA # +0x5570 0x9707 # +0x5571 0x632F # +0x5572 0x9547 # +0x5573 0x9635 # +0x5574 0x84B8 # +0x5575 0x6323 # +0x5576 0x7741 # +0x5577 0x5F81 # +0x5578 0x72F0 # +0x5579 0x4E89 # +0x557A 0x6014 # +0x557B 0x6574 # +0x557C 0x62EF # +0x557D 0x6B63 # +0x557E 0x653F # +0x5621 0x5E27 # +0x5622 0x75C7 # +0x5623 0x90D1 # +0x5624 0x8BC1 # +0x5625 0x829D # +0x5626 0x679D # +0x5627 0x652F # +0x5628 0x5431 # +0x5629 0x8718 # +0x562A 0x77E5 # +0x562B 0x80A2 # +0x562C 0x8102 # +0x562D 0x6C41 # +0x562E 0x4E4B # +0x562F 0x7EC7 # +0x5630 0x804C # +0x5631 0x76F4 # +0x5632 0x690D # +0x5633 0x6B96 # +0x5634 0x6267 # +0x5635 0x503C # +0x5636 0x4F84 # +0x5637 0x5740 # +0x5638 0x6307 # +0x5639 0x6B62 # +0x563A 0x8DBE # +0x563B 0x53EA # +0x563C 0x65E8 # +0x563D 0x7EB8 # +0x563E 0x5FD7 # +0x563F 0x631A # +0x5640 0x63B7 # +0x5641 0x81F3 # +0x5642 0x81F4 # +0x5643 0x7F6E # +0x5644 0x5E1C # +0x5645 0x5CD9 # +0x5646 0x5236 # +0x5647 0x667A # +0x5648 0x79E9 # +0x5649 0x7A1A # +0x564A 0x8D28 # +0x564B 0x7099 # +0x564C 0x75D4 # +0x564D 0x6EDE # +0x564E 0x6CBB # +0x564F 0x7A92 # +0x5650 0x4E2D # +0x5651 0x76C5 # +0x5652 0x5FE0 # +0x5653 0x949F # +0x5654 0x8877 # +0x5655 0x7EC8 # +0x5656 0x79CD # +0x5657 0x80BF # +0x5658 0x91CD # +0x5659 0x4EF2 # +0x565A 0x4F17 # +0x565B 0x821F # +0x565C 0x5468 # +0x565D 0x5DDE # +0x565E 0x6D32 # +0x565F 0x8BCC # +0x5660 0x7CA5 # +0x5661 0x8F74 # +0x5662 0x8098 # +0x5663 0x5E1A # +0x5664 0x5492 # +0x5665 0x76B1 # +0x5666 0x5B99 # +0x5667 0x663C # +0x5668 0x9AA4 # +0x5669 0x73E0 # +0x566A 0x682A # +0x566B 0x86DB # +0x566C 0x6731 # +0x566D 0x732A # +0x566E 0x8BF8 # +0x566F 0x8BDB # +0x5670 0x9010 # +0x5671 0x7AF9 # +0x5672 0x70DB # +0x5673 0x716E # +0x5674 0x62C4 # +0x5675 0x77A9 # +0x5676 0x5631 # +0x5677 0x4E3B # +0x5678 0x8457 # +0x5679 0x67F1 # +0x567A 0x52A9 # +0x567B 0x86C0 # +0x567C 0x8D2E # +0x567D 0x94F8 # +0x567E 0x7B51 # +0x5721 0x4F4F # +0x5722 0x6CE8 # +0x5723 0x795D # +0x5724 0x9A7B # +0x5725 0x6293 # +0x5726 0x722A # +0x5727 0x62FD # +0x5728 0x4E13 # +0x5729 0x7816 # +0x572A 0x8F6C # +0x572B 0x64B0 # +0x572C 0x8D5A # +0x572D 0x7BC6 # +0x572E 0x6869 # +0x572F 0x5E84 # +0x5730 0x88C5 # +0x5731 0x5986 # +0x5732 0x649E # +0x5733 0x58EE # +0x5734 0x72B6 # +0x5735 0x690E # +0x5736 0x9525 # +0x5737 0x8FFD # +0x5738 0x8D58 # +0x5739 0x5760 # +0x573A 0x7F00 # +0x573B 0x8C06 # +0x573C 0x51C6 # +0x573D 0x6349 # +0x573E 0x62D9 # +0x573F 0x5353 # +0x5740 0x684C # +0x5741 0x7422 # +0x5742 0x8301 # +0x5743 0x914C # +0x5744 0x5544 # +0x5745 0x7740 # +0x5746 0x707C # +0x5747 0x6D4A # +0x5748 0x5179 # +0x5749 0x54A8 # +0x574A 0x8D44 # +0x574B 0x59FF # +0x574C 0x6ECB # +0x574D 0x6DC4 # +0x574E 0x5B5C # +0x574F 0x7D2B # +0x5750 0x4ED4 # +0x5751 0x7C7D # +0x5752 0x6ED3 # +0x5753 0x5B50 # +0x5754 0x81EA # +0x5755 0x6E0D # +0x5756 0x5B57 # +0x5757 0x9B03 # +0x5758 0x68D5 # +0x5759 0x8E2A # +0x575A 0x5B97 # +0x575B 0x7EFC # +0x575C 0x603B # +0x575D 0x7EB5 # +0x575E 0x90B9 # +0x575F 0x8D70 # +0x5760 0x594F # +0x5761 0x63CD # +0x5762 0x79DF # +0x5763 0x8DB3 # +0x5764 0x5352 # +0x5765 0x65CF # +0x5766 0x7956 # +0x5767 0x8BC5 # +0x5768 0x963B # +0x5769 0x7EC4 # +0x576A 0x94BB # +0x576B 0x7E82 # +0x576C 0x5634 # +0x576D 0x9189 # +0x576E 0x6700 # +0x576F 0x7F6A # +0x5770 0x5C0A # +0x5771 0x9075 # +0x5772 0x6628 # +0x5773 0x5DE6 # +0x5774 0x4F50 # +0x5775 0x67DE # +0x5776 0x505A # +0x5777 0x4F5C # +0x5778 0x5750 # +0x5779 0x5EA7 # +0x5821 0x4E8D # +0x5822 0x4E0C # +0x5823 0x5140 # +0x5824 0x4E10 # +0x5825 0x5EFF # +0x5826 0x5345 # +0x5827 0x4E15 # +0x5828 0x4E98 # +0x5829 0x4E1E # +0x582A 0x9B32 # +0x582B 0x5B6C # +0x582C 0x5669 # +0x582D 0x4E28 # +0x582E 0x79BA # +0x582F 0x4E3F # +0x5830 0x5315 # +0x5831 0x4E47 # +0x5832 0x592D # +0x5833 0x723B # +0x5834 0x536E # +0x5835 0x6C10 # +0x5836 0x56DF # +0x5837 0x80E4 # +0x5838 0x9997 # +0x5839 0x6BD3 # +0x583A 0x777E # +0x583B 0x9F17 # +0x583C 0x4E36 # +0x583D 0x4E9F # +0x583E 0x9F10 # +0x583F 0x4E5C # +0x5840 0x4E69 # +0x5841 0x4E93 # +0x5842 0x8288 # +0x5843 0x5B5B # +0x5844 0x556C # +0x5845 0x560F # +0x5846 0x4EC4 # +0x5847 0x538D # +0x5848 0x539D # +0x5849 0x53A3 # +0x584A 0x53A5 # +0x584B 0x53AE # +0x584C 0x9765 # +0x584D 0x8D5D # +0x584E 0x531A # +0x584F 0x53F5 # +0x5850 0x5326 # +0x5851 0x532E # +0x5852 0x533E # +0x5853 0x8D5C # +0x5854 0x5366 # +0x5855 0x5363 # +0x5856 0x5202 # +0x5857 0x5208 # +0x5858 0x520E # +0x5859 0x522D # +0x585A 0x5233 # +0x585B 0x523F # +0x585C 0x5240 # +0x585D 0x524C # +0x585E 0x525E # +0x585F 0x5261 # +0x5860 0x525C # +0x5861 0x84AF # +0x5862 0x527D # +0x5863 0x5282 # +0x5864 0x5281 # +0x5865 0x5290 # +0x5866 0x5293 # +0x5867 0x5182 # +0x5868 0x7F54 # +0x5869 0x4EBB # +0x586A 0x4EC3 # +0x586B 0x4EC9 # +0x586C 0x4EC2 # +0x586D 0x4EE8 # +0x586E 0x4EE1 # +0x586F 0x4EEB # +0x5870 0x4EDE # +0x5871 0x4F1B # +0x5872 0x4EF3 # +0x5873 0x4F22 # +0x5874 0x4F64 # +0x5875 0x4EF5 # +0x5876 0x4F25 # +0x5877 0x4F27 # +0x5878 0x4F09 # +0x5879 0x4F2B # +0x587A 0x4F5E # +0x587B 0x4F67 # +0x587C 0x6538 # +0x587D 0x4F5A # +0x587E 0x4F5D # +0x5921 0x4F5F # +0x5922 0x4F57 # +0x5923 0x4F32 # +0x5924 0x4F3D # +0x5925 0x4F76 # +0x5926 0x4F74 # +0x5927 0x4F91 # +0x5928 0x4F89 # +0x5929 0x4F83 # +0x592A 0x4F8F # +0x592B 0x4F7E # +0x592C 0x4F7B # +0x592D 0x4FAA # +0x592E 0x4F7C # +0x592F 0x4FAC # +0x5930 0x4F94 # +0x5931 0x4FE6 # +0x5932 0x4FE8 # +0x5933 0x4FEA # +0x5934 0x4FC5 # +0x5935 0x4FDA # +0x5936 0x4FE3 # +0x5937 0x4FDC # +0x5938 0x4FD1 # +0x5939 0x4FDF # +0x593A 0x4FF8 # +0x593B 0x5029 # +0x593C 0x504C # +0x593D 0x4FF3 # +0x593E 0x502C # +0x593F 0x500F # +0x5940 0x502E # +0x5941 0x502D # +0x5942 0x4FFE # +0x5943 0x501C # +0x5944 0x500C # +0x5945 0x5025 # +0x5946 0x5028 # +0x5947 0x507E # +0x5948 0x5043 # +0x5949 0x5055 # +0x594A 0x5048 # +0x594B 0x504E # +0x594C 0x506C # +0x594D 0x507B # +0x594E 0x50A5 # +0x594F 0x50A7 # +0x5950 0x50A9 # +0x5951 0x50BA # +0x5952 0x50D6 # +0x5953 0x5106 # +0x5954 0x50ED # +0x5955 0x50EC # +0x5956 0x50E6 # +0x5957 0x50EE # +0x5958 0x5107 # +0x5959 0x510B # +0x595A 0x4EDD # +0x595B 0x6C3D # +0x595C 0x4F58 # +0x595D 0x4F65 # +0x595E 0x4FCE # +0x595F 0x9FA0 # +0x5960 0x6C46 # +0x5961 0x7C74 # +0x5962 0x516E # +0x5963 0x5DFD # +0x5964 0x9EC9 # +0x5965 0x9998 # +0x5966 0x5181 # +0x5967 0x5914 # +0x5968 0x52F9 # +0x5969 0x530D # +0x596A 0x8A07 # +0x596B 0x5310 # +0x596C 0x51EB # +0x596D 0x5919 # +0x596E 0x5155 # +0x596F 0x4EA0 # +0x5970 0x5156 # +0x5971 0x4EB3 # +0x5972 0x886E # +0x5973 0x88A4 # +0x5974 0x4EB5 # +0x5975 0x8114 # +0x5976 0x88D2 # +0x5977 0x7980 # +0x5978 0x5B34 # +0x5979 0x8803 # +0x597A 0x7FB8 # +0x597B 0x51AB # +0x597C 0x51B1 # +0x597D 0x51BD # +0x597E 0x51BC # +0x5A21 0x51C7 # +0x5A22 0x5196 # +0x5A23 0x51A2 # +0x5A24 0x51A5 # +0x5A25 0x8BA0 # +0x5A26 0x8BA6 # +0x5A27 0x8BA7 # +0x5A28 0x8BAA # +0x5A29 0x8BB4 # +0x5A2A 0x8BB5 # +0x5A2B 0x8BB7 # +0x5A2C 0x8BC2 # +0x5A2D 0x8BC3 # +0x5A2E 0x8BCB # +0x5A2F 0x8BCF # +0x5A30 0x8BCE # +0x5A31 0x8BD2 # +0x5A32 0x8BD3 # +0x5A33 0x8BD4 # +0x5A34 0x8BD6 # +0x5A35 0x8BD8 # +0x5A36 0x8BD9 # +0x5A37 0x8BDC # +0x5A38 0x8BDF # +0x5A39 0x8BE0 # +0x5A3A 0x8BE4 # +0x5A3B 0x8BE8 # +0x5A3C 0x8BE9 # +0x5A3D 0x8BEE # +0x5A3E 0x8BF0 # +0x5A3F 0x8BF3 # +0x5A40 0x8BF6 # +0x5A41 0x8BF9 # +0x5A42 0x8BFC # +0x5A43 0x8BFF # +0x5A44 0x8C00 # +0x5A45 0x8C02 # +0x5A46 0x8C04 # +0x5A47 0x8C07 # +0x5A48 0x8C0C # +0x5A49 0x8C0F # +0x5A4A 0x8C11 # +0x5A4B 0x8C12 # +0x5A4C 0x8C14 # +0x5A4D 0x8C15 # +0x5A4E 0x8C16 # +0x5A4F 0x8C19 # +0x5A50 0x8C1B # +0x5A51 0x8C18 # +0x5A52 0x8C1D # +0x5A53 0x8C1F # +0x5A54 0x8C20 # +0x5A55 0x8C21 # +0x5A56 0x8C25 # +0x5A57 0x8C27 # +0x5A58 0x8C2A # +0x5A59 0x8C2B # +0x5A5A 0x8C2E # +0x5A5B 0x8C2F # +0x5A5C 0x8C32 # +0x5A5D 0x8C33 # +0x5A5E 0x8C35 # +0x5A5F 0x8C36 # +0x5A60 0x5369 # +0x5A61 0x537A # +0x5A62 0x961D # +0x5A63 0x9622 # +0x5A64 0x9621 # +0x5A65 0x9631 # +0x5A66 0x962A # +0x5A67 0x963D # +0x5A68 0x963C # +0x5A69 0x9642 # +0x5A6A 0x9649 # +0x5A6B 0x9654 # +0x5A6C 0x965F # +0x5A6D 0x9667 # +0x5A6E 0x966C # +0x5A6F 0x9672 # +0x5A70 0x9674 # +0x5A71 0x9688 # +0x5A72 0x968D # +0x5A73 0x9697 # +0x5A74 0x96B0 # +0x5A75 0x9097 # +0x5A76 0x909B # +0x5A77 0x909D # +0x5A78 0x9099 # +0x5A79 0x90AC # +0x5A7A 0x90A1 # +0x5A7B 0x90B4 # +0x5A7C 0x90B3 # +0x5A7D 0x90B6 # +0x5A7E 0x90BA # +0x5B21 0x90B8 # +0x5B22 0x90B0 # +0x5B23 0x90CF # +0x5B24 0x90C5 # +0x5B25 0x90BE # +0x5B26 0x90D0 # +0x5B27 0x90C4 # +0x5B28 0x90C7 # +0x5B29 0x90D3 # +0x5B2A 0x90E6 # +0x5B2B 0x90E2 # +0x5B2C 0x90DC # +0x5B2D 0x90D7 # +0x5B2E 0x90DB # +0x5B2F 0x90EB # +0x5B30 0x90EF # +0x5B31 0x90FE # +0x5B32 0x9104 # +0x5B33 0x9122 # +0x5B34 0x911E # +0x5B35 0x9123 # +0x5B36 0x9131 # +0x5B37 0x912F # +0x5B38 0x9139 # +0x5B39 0x9143 # +0x5B3A 0x9146 # +0x5B3B 0x520D # +0x5B3C 0x5942 # +0x5B3D 0x52A2 # +0x5B3E 0x52AC # +0x5B3F 0x52AD # +0x5B40 0x52BE # +0x5B41 0x54FF # +0x5B42 0x52D0 # +0x5B43 0x52D6 # +0x5B44 0x52F0 # +0x5B45 0x53DF # +0x5B46 0x71EE # +0x5B47 0x77CD # +0x5B48 0x5EF4 # +0x5B49 0x51F5 # +0x5B4A 0x51FC # +0x5B4B 0x9B2F # +0x5B4C 0x53B6 # +0x5B4D 0x5F01 # +0x5B4E 0x755A # +0x5B4F 0x5DEF # +0x5B50 0x574C # +0x5B51 0x57A9 # +0x5B52 0x57A1 # +0x5B53 0x587E # +0x5B54 0x58BC # +0x5B55 0x58C5 # +0x5B56 0x58D1 # +0x5B57 0x5729 # +0x5B58 0x572C # +0x5B59 0x572A # +0x5B5A 0x5733 # +0x5B5B 0x5739 # +0x5B5C 0x572E # +0x5B5D 0x572F # +0x5B5E 0x575C # +0x5B5F 0x573B # +0x5B60 0x5742 # +0x5B61 0x5769 # +0x5B62 0x5785 # +0x5B63 0x576B # +0x5B64 0x5786 # +0x5B65 0x577C # +0x5B66 0x577B # +0x5B67 0x5768 # +0x5B68 0x576D # +0x5B69 0x5776 # +0x5B6A 0x5773 # +0x5B6B 0x57AD # +0x5B6C 0x57A4 # +0x5B6D 0x578C # +0x5B6E 0x57B2 # +0x5B6F 0x57CF # +0x5B70 0x57A7 # +0x5B71 0x57B4 # +0x5B72 0x5793 # +0x5B73 0x57A0 # +0x5B74 0x57D5 # +0x5B75 0x57D8 # +0x5B76 0x57DA # +0x5B77 0x57D9 # +0x5B78 0x57D2 # +0x5B79 0x57B8 # +0x5B7A 0x57F4 # +0x5B7B 0x57EF # +0x5B7C 0x57F8 # +0x5B7D 0x57E4 # +0x5B7E 0x57DD # +0x5C21 0x580B # +0x5C22 0x580D # +0x5C23 0x57FD # +0x5C24 0x57ED # +0x5C25 0x5800 # +0x5C26 0x581E # +0x5C27 0x5819 # +0x5C28 0x5844 # +0x5C29 0x5820 # +0x5C2A 0x5865 # +0x5C2B 0x586C # +0x5C2C 0x5881 # +0x5C2D 0x5889 # +0x5C2E 0x589A # +0x5C2F 0x5880 # +0x5C30 0x99A8 # +0x5C31 0x9F19 # +0x5C32 0x61FF # +0x5C33 0x8279 # +0x5C34 0x827D # +0x5C35 0x827F # +0x5C36 0x828F # +0x5C37 0x828A # +0x5C38 0x82A8 # +0x5C39 0x8284 # +0x5C3A 0x828E # +0x5C3B 0x8291 # +0x5C3C 0x8297 # +0x5C3D 0x8299 # +0x5C3E 0x82AB # +0x5C3F 0x82B8 # +0x5C40 0x82BE # +0x5C41 0x82B0 # +0x5C42 0x82C8 # +0x5C43 0x82CA # +0x5C44 0x82E3 # +0x5C45 0x8298 # +0x5C46 0x82B7 # +0x5C47 0x82AE # +0x5C48 0x82CB # +0x5C49 0x82CC # +0x5C4A 0x82C1 # +0x5C4B 0x82A9 # +0x5C4C 0x82B4 # +0x5C4D 0x82A1 # +0x5C4E 0x82AA # +0x5C4F 0x829F # +0x5C50 0x82C4 # +0x5C51 0x82CE # +0x5C52 0x82A4 # +0x5C53 0x82E1 # +0x5C54 0x8309 # +0x5C55 0x82F7 # +0x5C56 0x82E4 # +0x5C57 0x830F # +0x5C58 0x8307 # +0x5C59 0x82DC # +0x5C5A 0x82F4 # +0x5C5B 0x82D2 # +0x5C5C 0x82D8 # +0x5C5D 0x830C # +0x5C5E 0x82FB # +0x5C5F 0x82D3 # +0x5C60 0x8311 # +0x5C61 0x831A # +0x5C62 0x8306 # +0x5C63 0x8314 # +0x5C64 0x8315 # +0x5C65 0x82E0 # +0x5C66 0x82D5 # +0x5C67 0x831C # +0x5C68 0x8351 # +0x5C69 0x835B # +0x5C6A 0x835C # +0x5C6B 0x8308 # +0x5C6C 0x8392 # +0x5C6D 0x833C # +0x5C6E 0x8334 # +0x5C6F 0x8331 # +0x5C70 0x839B # +0x5C71 0x835E # +0x5C72 0x832F # +0x5C73 0x834F # +0x5C74 0x8347 # +0x5C75 0x8343 # +0x5C76 0x835F # +0x5C77 0x8340 # +0x5C78 0x8317 # +0x5C79 0x8360 # +0x5C7A 0x832D # +0x5C7B 0x833A # +0x5C7C 0x8333 # +0x5C7D 0x8366 # +0x5C7E 0x8365 # +0x5D21 0x8368 # +0x5D22 0x831B # +0x5D23 0x8369 # +0x5D24 0x836C # +0x5D25 0x836A # +0x5D26 0x836D # +0x5D27 0x836E # +0x5D28 0x83B0 # +0x5D29 0x8378 # +0x5D2A 0x83B3 # +0x5D2B 0x83B4 # +0x5D2C 0x83A0 # +0x5D2D 0x83AA # +0x5D2E 0x8393 # +0x5D2F 0x839C # +0x5D30 0x8385 # +0x5D31 0x837C # +0x5D32 0x83B6 # +0x5D33 0x83A9 # +0x5D34 0x837D # +0x5D35 0x83B8 # +0x5D36 0x837B # +0x5D37 0x8398 # +0x5D38 0x839E # +0x5D39 0x83A8 # +0x5D3A 0x83BA # +0x5D3B 0x83BC # +0x5D3C 0x83C1 # +0x5D3D 0x8401 # +0x5D3E 0x83E5 # +0x5D3F 0x83D8 # +0x5D40 0x5807 # +0x5D41 0x8418 # +0x5D42 0x840B # +0x5D43 0x83DD # +0x5D44 0x83FD # +0x5D45 0x83D6 # +0x5D46 0x841C # +0x5D47 0x8438 # +0x5D48 0x8411 # +0x5D49 0x8406 # +0x5D4A 0x83D4 # +0x5D4B 0x83DF # +0x5D4C 0x840F # +0x5D4D 0x8403 # +0x5D4E 0x83F8 # +0x5D4F 0x83F9 # +0x5D50 0x83EA # +0x5D51 0x83C5 # +0x5D52 0x83C0 # +0x5D53 0x8426 # +0x5D54 0x83F0 # +0x5D55 0x83E1 # +0x5D56 0x845C # +0x5D57 0x8451 # +0x5D58 0x845A # +0x5D59 0x8459 # +0x5D5A 0x8473 # +0x5D5B 0x8487 # +0x5D5C 0x8488 # +0x5D5D 0x847A # +0x5D5E 0x8489 # +0x5D5F 0x8478 # +0x5D60 0x843C # +0x5D61 0x8446 # +0x5D62 0x8469 # +0x5D63 0x8476 # +0x5D64 0x848C # +0x5D65 0x848E # +0x5D66 0x8431 # +0x5D67 0x846D # +0x5D68 0x84C1 # +0x5D69 0x84CD # +0x5D6A 0x84D0 # +0x5D6B 0x84E6 # +0x5D6C 0x84BD # +0x5D6D 0x84D3 # +0x5D6E 0x84CA # +0x5D6F 0x84BF # +0x5D70 0x84BA # +0x5D71 0x84E0 # +0x5D72 0x84A1 # +0x5D73 0x84B9 # +0x5D74 0x84B4 # +0x5D75 0x8497 # +0x5D76 0x84E5 # +0x5D77 0x84E3 # +0x5D78 0x850C # +0x5D79 0x750D # +0x5D7A 0x8538 # +0x5D7B 0x84F0 # +0x5D7C 0x8539 # +0x5D7D 0x851F # +0x5D7E 0x853A # +0x5E21 0x8556 # +0x5E22 0x853B # +0x5E23 0x84FF # +0x5E24 0x84FC # +0x5E25 0x8559 # +0x5E26 0x8548 # +0x5E27 0x8568 # +0x5E28 0x8564 # +0x5E29 0x855E # +0x5E2A 0x857A # +0x5E2B 0x77A2 # +0x5E2C 0x8543 # +0x5E2D 0x8572 # +0x5E2E 0x857B # +0x5E2F 0x85A4 # +0x5E30 0x85A8 # +0x5E31 0x8587 # +0x5E32 0x858F # +0x5E33 0x8579 # +0x5E34 0x85AE # +0x5E35 0x859C # +0x5E36 0x8585 # +0x5E37 0x85B9 # +0x5E38 0x85B7 # +0x5E39 0x85B0 # +0x5E3A 0x85D3 # +0x5E3B 0x85C1 # +0x5E3C 0x85DC # +0x5E3D 0x85FF # +0x5E3E 0x8627 # +0x5E3F 0x8605 # +0x5E40 0x8629 # +0x5E41 0x8616 # +0x5E42 0x863C # +0x5E43 0x5EFE # +0x5E44 0x5F08 # +0x5E45 0x593C # +0x5E46 0x5941 # +0x5E47 0x8037 # +0x5E48 0x5955 # +0x5E49 0x595A # +0x5E4A 0x5958 # +0x5E4B 0x530F # +0x5E4C 0x5C22 # +0x5E4D 0x5C25 # +0x5E4E 0x5C2C # +0x5E4F 0x5C34 # +0x5E50 0x624C # +0x5E51 0x626A # +0x5E52 0x629F # +0x5E53 0x62BB # +0x5E54 0x62CA # +0x5E55 0x62DA # +0x5E56 0x62D7 # +0x5E57 0x62EE # +0x5E58 0x6322 # +0x5E59 0x62F6 # +0x5E5A 0x6339 # +0x5E5B 0x634B # +0x5E5C 0x6343 # +0x5E5D 0x63AD # +0x5E5E 0x63F6 # +0x5E5F 0x6371 # +0x5E60 0x637A # +0x5E61 0x638E # +0x5E62 0x63B4 # +0x5E63 0x636D # +0x5E64 0x63AC # +0x5E65 0x638A # +0x5E66 0x6369 # +0x5E67 0x63AE # +0x5E68 0x63BC # +0x5E69 0x63F2 # +0x5E6A 0x63F8 # +0x5E6B 0x63E0 # +0x5E6C 0x63FF # +0x5E6D 0x63C4 # +0x5E6E 0x63DE # +0x5E6F 0x63CE # +0x5E70 0x6452 # +0x5E71 0x63C6 # +0x5E72 0x63BE # +0x5E73 0x6445 # +0x5E74 0x6441 # +0x5E75 0x640B # +0x5E76 0x641B # +0x5E77 0x6420 # +0x5E78 0x640C # +0x5E79 0x6426 # +0x5E7A 0x6421 # +0x5E7B 0x645E # +0x5E7C 0x6484 # +0x5E7D 0x646D # +0x5E7E 0x6496 # +0x5F21 0x647A # +0x5F22 0x64B7 # +0x5F23 0x64B8 # +0x5F24 0x6499 # +0x5F25 0x64BA # +0x5F26 0x64C0 # +0x5F27 0x64D0 # +0x5F28 0x64D7 # +0x5F29 0x64E4 # +0x5F2A 0x64E2 # +0x5F2B 0x6509 # +0x5F2C 0x6525 # +0x5F2D 0x652E # +0x5F2E 0x5F0B # +0x5F2F 0x5FD2 # +0x5F30 0x7519 # +0x5F31 0x5F11 # +0x5F32 0x535F # +0x5F33 0x53F1 # +0x5F34 0x53FD # +0x5F35 0x53E9 # +0x5F36 0x53E8 # +0x5F37 0x53FB # +0x5F38 0x5412 # +0x5F39 0x5416 # +0x5F3A 0x5406 # +0x5F3B 0x544B # +0x5F3C 0x5452 # +0x5F3D 0x5453 # +0x5F3E 0x5454 # +0x5F3F 0x5456 # +0x5F40 0x5443 # +0x5F41 0x5421 # +0x5F42 0x5457 # +0x5F43 0x5459 # +0x5F44 0x5423 # +0x5F45 0x5432 # +0x5F46 0x5482 # +0x5F47 0x5494 # +0x5F48 0x5477 # +0x5F49 0x5471 # +0x5F4A 0x5464 # +0x5F4B 0x549A # +0x5F4C 0x549B # +0x5F4D 0x5484 # +0x5F4E 0x5476 # +0x5F4F 0x5466 # +0x5F50 0x549D # +0x5F51 0x54D0 # +0x5F52 0x54AD # +0x5F53 0x54C2 # +0x5F54 0x54B4 # +0x5F55 0x54D2 # +0x5F56 0x54A7 # +0x5F57 0x54A6 # +0x5F58 0x54D3 # +0x5F59 0x54D4 # +0x5F5A 0x5472 # +0x5F5B 0x54A3 # +0x5F5C 0x54D5 # +0x5F5D 0x54BB # +0x5F5E 0x54BF # +0x5F5F 0x54CC # +0x5F60 0x54D9 # +0x5F61 0x54DA # +0x5F62 0x54DC # +0x5F63 0x54A9 # +0x5F64 0x54AA # +0x5F65 0x54A4 # +0x5F66 0x54DD # +0x5F67 0x54CF # +0x5F68 0x54DE # +0x5F69 0x551B # +0x5F6A 0x54E7 # +0x5F6B 0x5520 # +0x5F6C 0x54FD # +0x5F6D 0x5514 # +0x5F6E 0x54F3 # +0x5F6F 0x5522 # +0x5F70 0x5523 # +0x5F71 0x550F # +0x5F72 0x5511 # +0x5F73 0x5527 # +0x5F74 0x552A # +0x5F75 0x5567 # +0x5F76 0x558F # +0x5F77 0x55B5 # +0x5F78 0x5549 # +0x5F79 0x556D # +0x5F7A 0x5541 # +0x5F7B 0x5555 # +0x5F7C 0x553F # +0x5F7D 0x5550 # +0x5F7E 0x553C # +0x6021 0x5537 # +0x6022 0x5556 # +0x6023 0x5575 # +0x6024 0x5576 # +0x6025 0x5577 # +0x6026 0x5533 # +0x6027 0x5530 # +0x6028 0x555C # +0x6029 0x558B # +0x602A 0x55D2 # +0x602B 0x5583 # +0x602C 0x55B1 # +0x602D 0x55B9 # +0x602E 0x5588 # +0x602F 0x5581 # +0x6030 0x559F # +0x6031 0x557E # +0x6032 0x55D6 # +0x6033 0x5591 # +0x6034 0x557B # +0x6035 0x55DF # +0x6036 0x55BD # +0x6037 0x55BE # +0x6038 0x5594 # +0x6039 0x5599 # +0x603A 0x55EA # +0x603B 0x55F7 # +0x603C 0x55C9 # +0x603D 0x561F # +0x603E 0x55D1 # +0x603F 0x55EB # +0x6040 0x55EC # +0x6041 0x55D4 # +0x6042 0x55E6 # +0x6043 0x55DD # +0x6044 0x55C4 # +0x6045 0x55EF # +0x6046 0x55E5 # +0x6047 0x55F2 # +0x6048 0x55F3 # +0x6049 0x55CC # +0x604A 0x55CD # +0x604B 0x55E8 # +0x604C 0x55F5 # +0x604D 0x55E4 # +0x604E 0x8F94 # +0x604F 0x561E # +0x6050 0x5608 # +0x6051 0x560C # +0x6052 0x5601 # +0x6053 0x5624 # +0x6054 0x5623 # +0x6055 0x55FE # +0x6056 0x5600 # +0x6057 0x5627 # +0x6058 0x562D # +0x6059 0x5658 # +0x605A 0x5639 # +0x605B 0x5657 # +0x605C 0x562C # +0x605D 0x564D # +0x605E 0x5662 # +0x605F 0x5659 # +0x6060 0x565C # +0x6061 0x564C # +0x6062 0x5654 # +0x6063 0x5686 # +0x6064 0x5664 # +0x6065 0x5671 # +0x6066 0x566B # +0x6067 0x567B # +0x6068 0x567C # +0x6069 0x5685 # +0x606A 0x5693 # +0x606B 0x56AF # +0x606C 0x56D4 # +0x606D 0x56D7 # +0x606E 0x56DD # +0x606F 0x56E1 # +0x6070 0x56F5 # +0x6071 0x56EB # +0x6072 0x56F9 # +0x6073 0x56FF # +0x6074 0x5704 # +0x6075 0x570A # +0x6076 0x5709 # +0x6077 0x571C # +0x6078 0x5E0F # +0x6079 0x5E19 # +0x607A 0x5E14 # +0x607B 0x5E11 # +0x607C 0x5E31 # +0x607D 0x5E3B # +0x607E 0x5E3C # +0x6121 0x5E37 # +0x6122 0x5E44 # +0x6123 0x5E54 # +0x6124 0x5E5B # +0x6125 0x5E5E # +0x6126 0x5E61 # +0x6127 0x5C8C # +0x6128 0x5C7A # +0x6129 0x5C8D # +0x612A 0x5C90 # +0x612B 0x5C96 # +0x612C 0x5C88 # +0x612D 0x5C98 # +0x612E 0x5C99 # +0x612F 0x5C91 # +0x6130 0x5C9A # +0x6131 0x5C9C # +0x6132 0x5CB5 # +0x6133 0x5CA2 # +0x6134 0x5CBD # +0x6135 0x5CAC # +0x6136 0x5CAB # +0x6137 0x5CB1 # +0x6138 0x5CA3 # +0x6139 0x5CC1 # +0x613A 0x5CB7 # +0x613B 0x5CC4 # +0x613C 0x5CD2 # +0x613D 0x5CE4 # +0x613E 0x5CCB # +0x613F 0x5CE5 # +0x6140 0x5D02 # +0x6141 0x5D03 # +0x6142 0x5D27 # +0x6143 0x5D26 # +0x6144 0x5D2E # +0x6145 0x5D24 # +0x6146 0x5D1E # +0x6147 0x5D06 # +0x6148 0x5D1B # +0x6149 0x5D58 # +0x614A 0x5D3E # +0x614B 0x5D34 # +0x614C 0x5D3D # +0x614D 0x5D6C # +0x614E 0x5D5B # +0x614F 0x5D6F # +0x6150 0x5D5D # +0x6151 0x5D6B # +0x6152 0x5D4B # +0x6153 0x5D4A # +0x6154 0x5D69 # +0x6155 0x5D74 # +0x6156 0x5D82 # +0x6157 0x5D99 # +0x6158 0x5D9D # +0x6159 0x8C73 # +0x615A 0x5DB7 # +0x615B 0x5DC5 # +0x615C 0x5F73 # +0x615D 0x5F77 # +0x615E 0x5F82 # +0x615F 0x5F87 # +0x6160 0x5F89 # +0x6161 0x5F8C # +0x6162 0x5F95 # +0x6163 0x5F99 # +0x6164 0x5F9C # +0x6165 0x5FA8 # +0x6166 0x5FAD # +0x6167 0x5FB5 # +0x6168 0x5FBC # +0x6169 0x8862 # +0x616A 0x5F61 # +0x616B 0x72AD # +0x616C 0x72B0 # +0x616D 0x72B4 # +0x616E 0x72B7 # +0x616F 0x72B8 # +0x6170 0x72C3 # +0x6171 0x72C1 # +0x6172 0x72CE # +0x6173 0x72CD # +0x6174 0x72D2 # +0x6175 0x72E8 # +0x6176 0x72EF # +0x6177 0x72E9 # +0x6178 0x72F2 # +0x6179 0x72F4 # +0x617A 0x72F7 # +0x617B 0x7301 # +0x617C 0x72F3 # +0x617D 0x7303 # +0x617E 0x72FA # +0x6221 0x72FB # +0x6222 0x7317 # +0x6223 0x7313 # +0x6224 0x7321 # +0x6225 0x730A # +0x6226 0x731E # +0x6227 0x731D # +0x6228 0x7315 # +0x6229 0x7322 # +0x622A 0x7339 # +0x622B 0x7325 # +0x622C 0x732C # +0x622D 0x7338 # +0x622E 0x7331 # +0x622F 0x7350 # +0x6230 0x734D # +0x6231 0x7357 # +0x6232 0x7360 # +0x6233 0x736C # +0x6234 0x736F # +0x6235 0x737E # +0x6236 0x821B # +0x6237 0x5925 # +0x6238 0x98E7 # +0x6239 0x5924 # +0x623A 0x5902 # +0x623B 0x9963 # +0x623C 0x9967 # +0x623D 0x9968 # +0x623E 0x9969 # +0x623F 0x996A # +0x6240 0x996B # +0x6241 0x996C # +0x6242 0x9974 # +0x6243 0x9977 # +0x6244 0x997D # +0x6245 0x9980 # +0x6246 0x9984 # +0x6247 0x9987 # +0x6248 0x998A # +0x6249 0x998D # +0x624A 0x9990 # +0x624B 0x9991 # +0x624C 0x9993 # +0x624D 0x9994 # +0x624E 0x9995 # +0x624F 0x5E80 # +0x6250 0x5E91 # +0x6251 0x5E8B # +0x6252 0x5E96 # +0x6253 0x5EA5 # +0x6254 0x5EA0 # +0x6255 0x5EB9 # +0x6256 0x5EB5 # +0x6257 0x5EBE # +0x6258 0x5EB3 # +0x6259 0x8D53 # +0x625A 0x5ED2 # +0x625B 0x5ED1 # +0x625C 0x5EDB # +0x625D 0x5EE8 # +0x625E 0x5EEA # +0x625F 0x81BA # +0x6260 0x5FC4 # +0x6261 0x5FC9 # +0x6262 0x5FD6 # +0x6263 0x5FCF # +0x6264 0x6003 # +0x6265 0x5FEE # +0x6266 0x6004 # +0x6267 0x5FE1 # +0x6268 0x5FE4 # +0x6269 0x5FFE # +0x626A 0x6005 # +0x626B 0x6006 # +0x626C 0x5FEA # +0x626D 0x5FED # +0x626E 0x5FF8 # +0x626F 0x6019 # +0x6270 0x6035 # +0x6271 0x6026 # +0x6272 0x601B # +0x6273 0x600F # +0x6274 0x600D # +0x6275 0x6029 # +0x6276 0x602B # +0x6277 0x600A # +0x6278 0x603F # +0x6279 0x6021 # +0x627A 0x6078 # +0x627B 0x6079 # +0x627C 0x607B # +0x627D 0x607A # +0x627E 0x6042 # +0x6321 0x606A # +0x6322 0x607D # +0x6323 0x6096 # +0x6324 0x609A # +0x6325 0x60AD # +0x6326 0x609D # +0x6327 0x6083 # +0x6328 0x6092 # +0x6329 0x608C # +0x632A 0x609B # +0x632B 0x60EC # +0x632C 0x60BB # +0x632D 0x60B1 # +0x632E 0x60DD # +0x632F 0x60D8 # +0x6330 0x60C6 # +0x6331 0x60DA # +0x6332 0x60B4 # +0x6333 0x6120 # +0x6334 0x6126 # +0x6335 0x6115 # +0x6336 0x6123 # +0x6337 0x60F4 # +0x6338 0x6100 # +0x6339 0x610E # +0x633A 0x612B # +0x633B 0x614A # +0x633C 0x6175 # +0x633D 0x61AC # +0x633E 0x6194 # +0x633F 0x61A7 # +0x6340 0x61B7 # +0x6341 0x61D4 # +0x6342 0x61F5 # +0x6343 0x5FDD # +0x6344 0x96B3 # +0x6345 0x95E9 # +0x6346 0x95EB # +0x6347 0x95F1 # +0x6348 0x95F3 # +0x6349 0x95F5 # +0x634A 0x95F6 # +0x634B 0x95FC # +0x634C 0x95FE # +0x634D 0x9603 # +0x634E 0x9604 # +0x634F 0x9606 # +0x6350 0x9608 # +0x6351 0x960A # +0x6352 0x960B # +0x6353 0x960C # +0x6354 0x960D # +0x6355 0x960F # +0x6356 0x9612 # +0x6357 0x9615 # +0x6358 0x9616 # +0x6359 0x9617 # +0x635A 0x9619 # +0x635B 0x961A # +0x635C 0x4E2C # +0x635D 0x723F # +0x635E 0x6215 # +0x635F 0x6C35 # +0x6360 0x6C54 # +0x6361 0x6C5C # +0x6362 0x6C4A # +0x6363 0x6CA3 # +0x6364 0x6C85 # +0x6365 0x6C90 # +0x6366 0x6C94 # +0x6367 0x6C8C # +0x6368 0x6C68 # +0x6369 0x6C69 # +0x636A 0x6C74 # +0x636B 0x6C76 # +0x636C 0x6C86 # +0x636D 0x6CA9 # +0x636E 0x6CD0 # +0x636F 0x6CD4 # +0x6370 0x6CAD # +0x6371 0x6CF7 # +0x6372 0x6CF8 # +0x6373 0x6CF1 # +0x6374 0x6CD7 # +0x6375 0x6CB2 # +0x6376 0x6CE0 # +0x6377 0x6CD6 # +0x6378 0x6CFA # +0x6379 0x6CEB # +0x637A 0x6CEE # +0x637B 0x6CB1 # +0x637C 0x6CD3 # +0x637D 0x6CEF # +0x637E 0x6CFE # +0x6421 0x6D39 # +0x6422 0x6D27 # +0x6423 0x6D0C # +0x6424 0x6D43 # +0x6425 0x6D48 # +0x6426 0x6D07 # +0x6427 0x6D04 # +0x6428 0x6D19 # +0x6429 0x6D0E # +0x642A 0x6D2B # +0x642B 0x6D4D # +0x642C 0x6D2E # +0x642D 0x6D35 # +0x642E 0x6D1A # +0x642F 0x6D4F # +0x6430 0x6D52 # +0x6431 0x6D54 # +0x6432 0x6D33 # +0x6433 0x6D91 # +0x6434 0x6D6F # +0x6435 0x6D9E # +0x6436 0x6DA0 # +0x6437 0x6D5E # +0x6438 0x6D93 # +0x6439 0x6D94 # +0x643A 0x6D5C # +0x643B 0x6D60 # +0x643C 0x6D7C # +0x643D 0x6D63 # +0x643E 0x6E1A # +0x643F 0x6DC7 # +0x6440 0x6DC5 # +0x6441 0x6DDE # +0x6442 0x6E0E # +0x6443 0x6DBF # +0x6444 0x6DE0 # +0x6445 0x6E11 # +0x6446 0x6DE6 # +0x6447 0x6DDD # +0x6448 0x6DD9 # +0x6449 0x6E16 # +0x644A 0x6DAB # +0x644B 0x6E0C # +0x644C 0x6DAE # +0x644D 0x6E2B # +0x644E 0x6E6E # +0x644F 0x6E4E # +0x6450 0x6E6B # +0x6451 0x6EB2 # +0x6452 0x6E5F # +0x6453 0x6E86 # +0x6454 0x6E53 # +0x6455 0x6E54 # +0x6456 0x6E32 # +0x6457 0x6E25 # +0x6458 0x6E44 # +0x6459 0x6EDF # +0x645A 0x6EB1 # +0x645B 0x6E98 # +0x645C 0x6EE0 # +0x645D 0x6F2D # +0x645E 0x6EE2 # +0x645F 0x6EA5 # +0x6460 0x6EA7 # +0x6461 0x6EBD # +0x6462 0x6EBB # +0x6463 0x6EB7 # +0x6464 0x6ED7 # +0x6465 0x6EB4 # +0x6466 0x6ECF # +0x6467 0x6E8F # +0x6468 0x6EC2 # +0x6469 0x6E9F # +0x646A 0x6F62 # +0x646B 0x6F46 # +0x646C 0x6F47 # +0x646D 0x6F24 # +0x646E 0x6F15 # +0x646F 0x6EF9 # +0x6470 0x6F2F # +0x6471 0x6F36 # +0x6472 0x6F4B # +0x6473 0x6F74 # +0x6474 0x6F2A # +0x6475 0x6F09 # +0x6476 0x6F29 # +0x6477 0x6F89 # +0x6478 0x6F8D # +0x6479 0x6F8C # +0x647A 0x6F78 # +0x647B 0x6F72 # +0x647C 0x6F7C # +0x647D 0x6F7A # +0x647E 0x6FD1 # +0x6521 0x6FC9 # +0x6522 0x6FA7 # +0x6523 0x6FB9 # +0x6524 0x6FB6 # +0x6525 0x6FC2 # +0x6526 0x6FE1 # +0x6527 0x6FEE # +0x6528 0x6FDE # +0x6529 0x6FE0 # +0x652A 0x6FEF # +0x652B 0x701A # +0x652C 0x7023 # +0x652D 0x701B # +0x652E 0x7039 # +0x652F 0x7035 # +0x6530 0x704F # +0x6531 0x705E # +0x6532 0x5B80 # +0x6533 0x5B84 # +0x6534 0x5B95 # +0x6535 0x5B93 # +0x6536 0x5BA5 # +0x6537 0x5BB8 # +0x6538 0x752F # +0x6539 0x9A9E # +0x653A 0x6434 # +0x653B 0x5BE4 # +0x653C 0x5BEE # +0x653D 0x8930 # +0x653E 0x5BF0 # +0x653F 0x8E47 # +0x6540 0x8B07 # +0x6541 0x8FB6 # +0x6542 0x8FD3 # +0x6543 0x8FD5 # +0x6544 0x8FE5 # +0x6545 0x8FEE # +0x6546 0x8FE4 # +0x6547 0x8FE9 # +0x6548 0x8FE6 # +0x6549 0x8FF3 # +0x654A 0x8FE8 # +0x654B 0x9005 # +0x654C 0x9004 # +0x654D 0x900B # +0x654E 0x9026 # +0x654F 0x9011 # +0x6550 0x900D # +0x6551 0x9016 # +0x6552 0x9021 # +0x6553 0x9035 # +0x6554 0x9036 # +0x6555 0x902D # +0x6556 0x902F # +0x6557 0x9044 # +0x6558 0x9051 # +0x6559 0x9052 # +0x655A 0x9050 # +0x655B 0x9068 # +0x655C 0x9058 # +0x655D 0x9062 # +0x655E 0x905B # +0x655F 0x66B9 # +0x6560 0x9074 # +0x6561 0x907D # +0x6562 0x9082 # +0x6563 0x9088 # +0x6564 0x9083 # +0x6565 0x908B # +0x6566 0x5F50 # +0x6567 0x5F57 # +0x6568 0x5F56 # +0x6569 0x5F58 # +0x656A 0x5C3B # +0x656B 0x54AB # +0x656C 0x5C50 # +0x656D 0x5C59 # +0x656E 0x5B71 # +0x656F 0x5C63 # +0x6570 0x5C66 # +0x6571 0x7FBC # +0x6572 0x5F2A # +0x6573 0x5F29 # +0x6574 0x5F2D # +0x6575 0x8274 # +0x6576 0x5F3C # +0x6577 0x9B3B # +0x6578 0x5C6E # +0x6579 0x5981 # +0x657A 0x5983 # +0x657B 0x598D # +0x657C 0x59A9 # +0x657D 0x59AA # +0x657E 0x59A3 # +0x6621 0x5997 # +0x6622 0x59CA # +0x6623 0x59AB # +0x6624 0x599E # +0x6625 0x59A4 # +0x6626 0x59D2 # +0x6627 0x59B2 # +0x6628 0x59AF # +0x6629 0x59D7 # +0x662A 0x59BE # +0x662B 0x5A05 # +0x662C 0x5A06 # +0x662D 0x59DD # +0x662E 0x5A08 # +0x662F 0x59E3 # +0x6630 0x59D8 # +0x6631 0x59F9 # +0x6632 0x5A0C # +0x6633 0x5A09 # +0x6634 0x5A32 # +0x6635 0x5A34 # +0x6636 0x5A11 # +0x6637 0x5A23 # +0x6638 0x5A13 # +0x6639 0x5A40 # +0x663A 0x5A67 # +0x663B 0x5A4A # +0x663C 0x5A55 # +0x663D 0x5A3C # +0x663E 0x5A62 # +0x663F 0x5A75 # +0x6640 0x80EC # +0x6641 0x5AAA # +0x6642 0x5A9B # +0x6643 0x5A77 # +0x6644 0x5A7A # +0x6645 0x5ABE # +0x6646 0x5AEB # +0x6647 0x5AB2 # +0x6648 0x5AD2 # +0x6649 0x5AD4 # +0x664A 0x5AB8 # +0x664B 0x5AE0 # +0x664C 0x5AE3 # +0x664D 0x5AF1 # +0x664E 0x5AD6 # +0x664F 0x5AE6 # +0x6650 0x5AD8 # +0x6651 0x5ADC # +0x6652 0x5B09 # +0x6653 0x5B17 # +0x6654 0x5B16 # +0x6655 0x5B32 # +0x6656 0x5B37 # +0x6657 0x5B40 # +0x6658 0x5C15 # +0x6659 0x5C1C # +0x665A 0x5B5A # +0x665B 0x5B65 # +0x665C 0x5B73 # +0x665D 0x5B51 # +0x665E 0x5B53 # +0x665F 0x5B62 # +0x6660 0x9A75 # +0x6661 0x9A77 # +0x6662 0x9A78 # +0x6663 0x9A7A # +0x6664 0x9A7F # +0x6665 0x9A7D # +0x6666 0x9A80 # +0x6667 0x9A81 # +0x6668 0x9A85 # +0x6669 0x9A88 # +0x666A 0x9A8A # +0x666B 0x9A90 # +0x666C 0x9A92 # +0x666D 0x9A93 # +0x666E 0x9A96 # +0x666F 0x9A98 # +0x6670 0x9A9B # +0x6671 0x9A9C # +0x6672 0x9A9D # +0x6673 0x9A9F # +0x6674 0x9AA0 # +0x6675 0x9AA2 # +0x6676 0x9AA3 # +0x6677 0x9AA5 # +0x6678 0x9AA7 # +0x6679 0x7E9F # +0x667A 0x7EA1 # +0x667B 0x7EA3 # +0x667C 0x7EA5 # +0x667D 0x7EA8 # +0x667E 0x7EA9 # +0x6721 0x7EAD # +0x6722 0x7EB0 # +0x6723 0x7EBE # +0x6724 0x7EC0 # +0x6725 0x7EC1 # +0x6726 0x7EC2 # +0x6727 0x7EC9 # +0x6728 0x7ECB # +0x6729 0x7ECC # +0x672A 0x7ED0 # +0x672B 0x7ED4 # +0x672C 0x7ED7 # +0x672D 0x7EDB # +0x672E 0x7EE0 # +0x672F 0x7EE1 # +0x6730 0x7EE8 # +0x6731 0x7EEB # +0x6732 0x7EEE # +0x6733 0x7EEF # +0x6734 0x7EF1 # +0x6735 0x7EF2 # +0x6736 0x7F0D # +0x6737 0x7EF6 # +0x6738 0x7EFA # +0x6739 0x7EFB # +0x673A 0x7EFE # +0x673B 0x7F01 # +0x673C 0x7F02 # +0x673D 0x7F03 # +0x673E 0x7F07 # +0x673F 0x7F08 # +0x6740 0x7F0B # +0x6741 0x7F0C # +0x6742 0x7F0F # +0x6743 0x7F11 # +0x6744 0x7F12 # +0x6745 0x7F17 # +0x6746 0x7F19 # +0x6747 0x7F1C # +0x6748 0x7F1B # +0x6749 0x7F1F # +0x674A 0x7F21 # +0x674B 0x7F22 # +0x674C 0x7F23 # +0x674D 0x7F24 # +0x674E 0x7F25 # +0x674F 0x7F26 # +0x6750 0x7F27 # +0x6751 0x7F2A # +0x6752 0x7F2B # +0x6753 0x7F2C # +0x6754 0x7F2D # +0x6755 0x7F2F # +0x6756 0x7F30 # +0x6757 0x7F31 # +0x6758 0x7F32 # +0x6759 0x7F33 # +0x675A 0x7F35 # +0x675B 0x5E7A # +0x675C 0x757F # +0x675D 0x5DDB # +0x675E 0x753E # +0x675F 0x9095 # +0x6760 0x738E # +0x6761 0x7391 # +0x6762 0x73AE # +0x6763 0x73A2 # +0x6764 0x739F # +0x6765 0x73CF # +0x6766 0x73C2 # +0x6767 0x73D1 # +0x6768 0x73B7 # +0x6769 0x73B3 # +0x676A 0x73C0 # +0x676B 0x73C9 # +0x676C 0x73C8 # +0x676D 0x73E5 # +0x676E 0x73D9 # +0x676F 0x987C # +0x6770 0x740A # +0x6771 0x73E9 # +0x6772 0x73E7 # +0x6773 0x73DE # +0x6774 0x73BA # +0x6775 0x73F2 # +0x6776 0x740F # +0x6777 0x742A # +0x6778 0x745B # +0x6779 0x7426 # +0x677A 0x7425 # +0x677B 0x7428 # +0x677C 0x7430 # +0x677D 0x742E # +0x677E 0x742C # +0x6821 0x741B # +0x6822 0x741A # +0x6823 0x7441 # +0x6824 0x745C # +0x6825 0x7457 # +0x6826 0x7455 # +0x6827 0x7459 # +0x6828 0x7477 # +0x6829 0x746D # +0x682A 0x747E # +0x682B 0x749C # +0x682C 0x748E # +0x682D 0x7480 # +0x682E 0x7481 # +0x682F 0x7487 # +0x6830 0x748B # +0x6831 0x749E # +0x6832 0x74A8 # +0x6833 0x74A9 # +0x6834 0x7490 # +0x6835 0x74A7 # +0x6836 0x74D2 # +0x6837 0x74BA # +0x6838 0x97EA # +0x6839 0x97EB # +0x683A 0x97EC # +0x683B 0x674C # +0x683C 0x6753 # +0x683D 0x675E # +0x683E 0x6748 # +0x683F 0x6769 # +0x6840 0x67A5 # +0x6841 0x6787 # +0x6842 0x676A # +0x6843 0x6773 # +0x6844 0x6798 # +0x6845 0x67A7 # +0x6846 0x6775 # +0x6847 0x67A8 # +0x6848 0x679E # +0x6849 0x67AD # +0x684A 0x678B # +0x684B 0x6777 # +0x684C 0x677C # +0x684D 0x67F0 # +0x684E 0x6809 # +0x684F 0x67D8 # +0x6850 0x680A # +0x6851 0x67E9 # +0x6852 0x67B0 # +0x6853 0x680C # +0x6854 0x67D9 # +0x6855 0x67B5 # +0x6856 0x67DA # +0x6857 0x67B3 # +0x6858 0x67DD # +0x6859 0x6800 # +0x685A 0x67C3 # +0x685B 0x67B8 # +0x685C 0x67E2 # +0x685D 0x680E # +0x685E 0x67C1 # +0x685F 0x67FD # +0x6860 0x6832 # +0x6861 0x6833 # +0x6862 0x6860 # +0x6863 0x6861 # +0x6864 0x684E # +0x6865 0x6862 # +0x6866 0x6844 # +0x6867 0x6864 # +0x6868 0x6883 # +0x6869 0x681D # +0x686A 0x6855 # +0x686B 0x6866 # +0x686C 0x6841 # +0x686D 0x6867 # +0x686E 0x6840 # +0x686F 0x683E # +0x6870 0x684A # +0x6871 0x6849 # +0x6872 0x6829 # +0x6873 0x68B5 # +0x6874 0x688F # +0x6875 0x6874 # +0x6876 0x6877 # +0x6877 0x6893 # +0x6878 0x686B # +0x6879 0x68C2 # +0x687A 0x696E # +0x687B 0x68FC # +0x687C 0x691F # +0x687D 0x6920 # +0x687E 0x68F9 # +0x6921 0x6924 # +0x6922 0x68F0 # +0x6923 0x690B # +0x6924 0x6901 # +0x6925 0x6957 # +0x6926 0x68E3 # +0x6927 0x6910 # +0x6928 0x6971 # +0x6929 0x6939 # +0x692A 0x6960 # +0x692B 0x6942 # +0x692C 0x695D # +0x692D 0x6984 # +0x692E 0x696B # +0x692F 0x6980 # +0x6930 0x6998 # +0x6931 0x6978 # +0x6932 0x6934 # +0x6933 0x69CC # +0x6934 0x6987 # +0x6935 0x6988 # +0x6936 0x69CE # +0x6937 0x6989 # +0x6938 0x6966 # +0x6939 0x6963 # +0x693A 0x6979 # +0x693B 0x699B # +0x693C 0x69A7 # +0x693D 0x69BB # +0x693E 0x69AB # +0x693F 0x69AD # +0x6940 0x69D4 # +0x6941 0x69B1 # +0x6942 0x69C1 # +0x6943 0x69CA # +0x6944 0x69DF # +0x6945 0x6995 # +0x6946 0x69E0 # +0x6947 0x698D # +0x6948 0x69FF # +0x6949 0x6A2F # +0x694A 0x69ED # +0x694B 0x6A17 # +0x694C 0x6A18 # +0x694D 0x6A65 # +0x694E 0x69F2 # +0x694F 0x6A44 # +0x6950 0x6A3E # +0x6951 0x6AA0 # +0x6952 0x6A50 # +0x6953 0x6A5B # +0x6954 0x6A35 # +0x6955 0x6A8E # +0x6956 0x6A79 # +0x6957 0x6A3D # +0x6958 0x6A28 # +0x6959 0x6A58 # +0x695A 0x6A7C # +0x695B 0x6A91 # +0x695C 0x6A90 # +0x695D 0x6AA9 # +0x695E 0x6A97 # +0x695F 0x6AAB # +0x6960 0x7337 # +0x6961 0x7352 # +0x6962 0x6B81 # +0x6963 0x6B82 # +0x6964 0x6B87 # +0x6965 0x6B84 # +0x6966 0x6B92 # +0x6967 0x6B93 # +0x6968 0x6B8D # +0x6969 0x6B9A # +0x696A 0x6B9B # +0x696B 0x6BA1 # +0x696C 0x6BAA # +0x696D 0x8F6B # +0x696E 0x8F6D # +0x696F 0x8F71 # +0x6970 0x8F72 # +0x6971 0x8F73 # +0x6972 0x8F75 # +0x6973 0x8F76 # +0x6974 0x8F78 # +0x6975 0x8F77 # +0x6976 0x8F79 # +0x6977 0x8F7A # +0x6978 0x8F7C # +0x6979 0x8F7E # +0x697A 0x8F81 # +0x697B 0x8F82 # +0x697C 0x8F84 # +0x697D 0x8F87 # +0x697E 0x8F8B # +0x6A21 0x8F8D # +0x6A22 0x8F8E # +0x6A23 0x8F8F # +0x6A24 0x8F98 # +0x6A25 0x8F9A # +0x6A26 0x8ECE # +0x6A27 0x620B # +0x6A28 0x6217 # +0x6A29 0x621B # +0x6A2A 0x621F # +0x6A2B 0x6222 # +0x6A2C 0x6221 # +0x6A2D 0x6225 # +0x6A2E 0x6224 # +0x6A2F 0x622C # +0x6A30 0x81E7 # +0x6A31 0x74EF # +0x6A32 0x74F4 # +0x6A33 0x74FF # +0x6A34 0x750F # +0x6A35 0x7511 # +0x6A36 0x7513 # +0x6A37 0x6534 # +0x6A38 0x65EE # +0x6A39 0x65EF # +0x6A3A 0x65F0 # +0x6A3B 0x660A # +0x6A3C 0x6619 # +0x6A3D 0x6772 # +0x6A3E 0x6603 # +0x6A3F 0x6615 # +0x6A40 0x6600 # +0x6A41 0x7085 # +0x6A42 0x66F7 # +0x6A43 0x661D # +0x6A44 0x6634 # +0x6A45 0x6631 # +0x6A46 0x6636 # +0x6A47 0x6635 # +0x6A48 0x8006 # +0x6A49 0x665F # +0x6A4A 0x6654 # +0x6A4B 0x6641 # +0x6A4C 0x664F # +0x6A4D 0x6656 # +0x6A4E 0x6661 # +0x6A4F 0x6657 # +0x6A50 0x6677 # +0x6A51 0x6684 # +0x6A52 0x668C # +0x6A53 0x66A7 # +0x6A54 0x669D # +0x6A55 0x66BE # +0x6A56 0x66DB # +0x6A57 0x66DC # +0x6A58 0x66E6 # +0x6A59 0x66E9 # +0x6A5A 0x8D32 # +0x6A5B 0x8D33 # +0x6A5C 0x8D36 # +0x6A5D 0x8D3B # +0x6A5E 0x8D3D # +0x6A5F 0x8D40 # +0x6A60 0x8D45 # +0x6A61 0x8D46 # +0x6A62 0x8D48 # +0x6A63 0x8D49 # +0x6A64 0x8D47 # +0x6A65 0x8D4D # +0x6A66 0x8D55 # +0x6A67 0x8D59 # +0x6A68 0x89C7 # +0x6A69 0x89CA # +0x6A6A 0x89CB # +0x6A6B 0x89CC # +0x6A6C 0x89CE # +0x6A6D 0x89CF # +0x6A6E 0x89D0 # +0x6A6F 0x89D1 # +0x6A70 0x726E # +0x6A71 0x729F # +0x6A72 0x725D # +0x6A73 0x7266 # +0x6A74 0x726F # +0x6A75 0x727E # +0x6A76 0x727F # +0x6A77 0x7284 # +0x6A78 0x728B # +0x6A79 0x728D # +0x6A7A 0x728F # +0x6A7B 0x7292 # +0x6A7C 0x6308 # +0x6A7D 0x6332 # +0x6A7E 0x63B0 # +0x6B21 0x643F # +0x6B22 0x64D8 # +0x6B23 0x8004 # +0x6B24 0x6BEA # +0x6B25 0x6BF3 # +0x6B26 0x6BFD # +0x6B27 0x6BF5 # +0x6B28 0x6BF9 # +0x6B29 0x6C05 # +0x6B2A 0x6C07 # +0x6B2B 0x6C06 # +0x6B2C 0x6C0D # +0x6B2D 0x6C15 # +0x6B2E 0x6C18 # +0x6B2F 0x6C19 # +0x6B30 0x6C1A # +0x6B31 0x6C21 # +0x6B32 0x6C29 # +0x6B33 0x6C24 # +0x6B34 0x6C2A # +0x6B35 0x6C32 # +0x6B36 0x6535 # +0x6B37 0x6555 # +0x6B38 0x656B # +0x6B39 0x724D # +0x6B3A 0x7252 # +0x6B3B 0x7256 # +0x6B3C 0x7230 # +0x6B3D 0x8662 # +0x6B3E 0x5216 # +0x6B3F 0x809F # +0x6B40 0x809C # +0x6B41 0x8093 # +0x6B42 0x80BC # +0x6B43 0x670A # +0x6B44 0x80BD # +0x6B45 0x80B1 # +0x6B46 0x80AB # +0x6B47 0x80AD # +0x6B48 0x80B4 # +0x6B49 0x80B7 # +0x6B4A 0x80E7 # +0x6B4B 0x80E8 # +0x6B4C 0x80E9 # +0x6B4D 0x80EA # +0x6B4E 0x80DB # +0x6B4F 0x80C2 # +0x6B50 0x80C4 # +0x6B51 0x80D9 # +0x6B52 0x80CD # +0x6B53 0x80D7 # +0x6B54 0x6710 # +0x6B55 0x80DD # +0x6B56 0x80EB # +0x6B57 0x80F1 # +0x6B58 0x80F4 # +0x6B59 0x80ED # +0x6B5A 0x810D # +0x6B5B 0x810E # +0x6B5C 0x80F2 # +0x6B5D 0x80FC # +0x6B5E 0x6715 # +0x6B5F 0x8112 # +0x6B60 0x8C5A # +0x6B61 0x8136 # +0x6B62 0x811E # +0x6B63 0x812C # +0x6B64 0x8118 # +0x6B65 0x8132 # +0x6B66 0x8148 # +0x6B67 0x814C # +0x6B68 0x8153 # +0x6B69 0x8174 # +0x6B6A 0x8159 # +0x6B6B 0x815A # +0x6B6C 0x8171 # +0x6B6D 0x8160 # +0x6B6E 0x8169 # +0x6B6F 0x817C # +0x6B70 0x817D # +0x6B71 0x816D # +0x6B72 0x8167 # +0x6B73 0x584D # +0x6B74 0x5AB5 # +0x6B75 0x8188 # +0x6B76 0x8182 # +0x6B77 0x8191 # +0x6B78 0x6ED5 # +0x6B79 0x81A3 # +0x6B7A 0x81AA # +0x6B7B 0x81CC # +0x6B7C 0x6726 # +0x6B7D 0x81CA # +0x6B7E 0x81BB # +0x6C21 0x81C1 # +0x6C22 0x81A6 # +0x6C23 0x6B24 # +0x6C24 0x6B37 # +0x6C25 0x6B39 # +0x6C26 0x6B43 # +0x6C27 0x6B46 # +0x6C28 0x6B59 # +0x6C29 0x98D1 # +0x6C2A 0x98D2 # +0x6C2B 0x98D3 # +0x6C2C 0x98D5 # +0x6C2D 0x98D9 # +0x6C2E 0x98DA # +0x6C2F 0x6BB3 # +0x6C30 0x5F40 # +0x6C31 0x6BC2 # +0x6C32 0x89F3 # +0x6C33 0x6590 # +0x6C34 0x9F51 # +0x6C35 0x6593 # +0x6C36 0x65BC # +0x6C37 0x65C6 # +0x6C38 0x65C4 # +0x6C39 0x65C3 # +0x6C3A 0x65CC # +0x6C3B 0x65CE # +0x6C3C 0x65D2 # +0x6C3D 0x65D6 # +0x6C3E 0x7080 # +0x6C3F 0x709C # +0x6C40 0x7096 # +0x6C41 0x709D # +0x6C42 0x70BB # +0x6C43 0x70C0 # +0x6C44 0x70B7 # +0x6C45 0x70AB # +0x6C46 0x70B1 # +0x6C47 0x70E8 # +0x6C48 0x70CA # +0x6C49 0x7110 # +0x6C4A 0x7113 # +0x6C4B 0x7116 # +0x6C4C 0x712F # +0x6C4D 0x7131 # +0x6C4E 0x7173 # +0x6C4F 0x715C # +0x6C50 0x7168 # +0x6C51 0x7145 # +0x6C52 0x7172 # +0x6C53 0x714A # +0x6C54 0x7178 # +0x6C55 0x717A # +0x6C56 0x7198 # +0x6C57 0x71B3 # +0x6C58 0x71B5 # +0x6C59 0x71A8 # +0x6C5A 0x71A0 # +0x6C5B 0x71E0 # +0x6C5C 0x71D4 # +0x6C5D 0x71E7 # +0x6C5E 0x71F9 # +0x6C5F 0x721D # +0x6C60 0x7228 # +0x6C61 0x706C # +0x6C62 0x7118 # +0x6C63 0x7166 # +0x6C64 0x71B9 # +0x6C65 0x623E # +0x6C66 0x623D # +0x6C67 0x6243 # +0x6C68 0x6248 # +0x6C69 0x6249 # +0x6C6A 0x793B # +0x6C6B 0x7940 # +0x6C6C 0x7946 # +0x6C6D 0x7949 # +0x6C6E 0x795B # +0x6C6F 0x795C # +0x6C70 0x7953 # +0x6C71 0x795A # +0x6C72 0x7962 # +0x6C73 0x7957 # +0x6C74 0x7960 # +0x6C75 0x796F # +0x6C76 0x7967 # +0x6C77 0x797A # +0x6C78 0x7985 # +0x6C79 0x798A # +0x6C7A 0x799A # +0x6C7B 0x79A7 # +0x6C7C 0x79B3 # +0x6C7D 0x5FD1 # +0x6C7E 0x5FD0 # +0x6D21 0x603C # +0x6D22 0x605D # +0x6D23 0x605A # +0x6D24 0x6067 # +0x6D25 0x6041 # +0x6D26 0x6059 # +0x6D27 0x6063 # +0x6D28 0x60AB # +0x6D29 0x6106 # +0x6D2A 0x610D # +0x6D2B 0x615D # +0x6D2C 0x61A9 # +0x6D2D 0x619D # +0x6D2E 0x61CB # +0x6D2F 0x61D1 # +0x6D30 0x6206 # +0x6D31 0x8080 # +0x6D32 0x807F # +0x6D33 0x6C93 # +0x6D34 0x6CF6 # +0x6D35 0x6DFC # +0x6D36 0x77F6 # +0x6D37 0x77F8 # +0x6D38 0x7800 # +0x6D39 0x7809 # +0x6D3A 0x7817 # +0x6D3B 0x7818 # +0x6D3C 0x7811 # +0x6D3D 0x65AB # +0x6D3E 0x782D # +0x6D3F 0x781C # +0x6D40 0x781D # +0x6D41 0x7839 # +0x6D42 0x783A # +0x6D43 0x783B # +0x6D44 0x781F # +0x6D45 0x783C # +0x6D46 0x7825 # +0x6D47 0x782C # +0x6D48 0x7823 # +0x6D49 0x7829 # +0x6D4A 0x784E # +0x6D4B 0x786D # +0x6D4C 0x7856 # +0x6D4D 0x7857 # +0x6D4E 0x7826 # +0x6D4F 0x7850 # +0x6D50 0x7847 # +0x6D51 0x784C # +0x6D52 0x786A # +0x6D53 0x789B # +0x6D54 0x7893 # +0x6D55 0x789A # +0x6D56 0x7887 # +0x6D57 0x789C # +0x6D58 0x78A1 # +0x6D59 0x78A3 # +0x6D5A 0x78B2 # +0x6D5B 0x78B9 # +0x6D5C 0x78A5 # +0x6D5D 0x78D4 # +0x6D5E 0x78D9 # +0x6D5F 0x78C9 # +0x6D60 0x78EC # +0x6D61 0x78F2 # +0x6D62 0x7905 # +0x6D63 0x78F4 # +0x6D64 0x7913 # +0x6D65 0x7924 # +0x6D66 0x791E # +0x6D67 0x7934 # +0x6D68 0x9F9B # +0x6D69 0x9EF9 # +0x6D6A 0x9EFB # +0x6D6B 0x9EFC # +0x6D6C 0x76F1 # +0x6D6D 0x7704 # +0x6D6E 0x770D # +0x6D6F 0x76F9 # +0x6D70 0x7707 # +0x6D71 0x7708 # +0x6D72 0x771A # +0x6D73 0x7722 # +0x6D74 0x7719 # +0x6D75 0x772D # +0x6D76 0x7726 # +0x6D77 0x7735 # +0x6D78 0x7738 # +0x6D79 0x7750 # +0x6D7A 0x7751 # +0x6D7B 0x7747 # +0x6D7C 0x7743 # +0x6D7D 0x775A # +0x6D7E 0x7768 # +0x6E21 0x7762 # +0x6E22 0x7765 # +0x6E23 0x777F # +0x6E24 0x778D # +0x6E25 0x777D # +0x6E26 0x7780 # +0x6E27 0x778C # +0x6E28 0x7791 # +0x6E29 0x779F # +0x6E2A 0x77A0 # +0x6E2B 0x77B0 # +0x6E2C 0x77B5 # +0x6E2D 0x77BD # +0x6E2E 0x753A # +0x6E2F 0x7540 # +0x6E30 0x754E # +0x6E31 0x754B # +0x6E32 0x7548 # +0x6E33 0x755B # +0x6E34 0x7572 # +0x6E35 0x7579 # +0x6E36 0x7583 # +0x6E37 0x7F58 # +0x6E38 0x7F61 # +0x6E39 0x7F5F # +0x6E3A 0x8A48 # +0x6E3B 0x7F68 # +0x6E3C 0x7F74 # +0x6E3D 0x7F71 # +0x6E3E 0x7F79 # +0x6E3F 0x7F81 # +0x6E40 0x7F7E # +0x6E41 0x76CD # +0x6E42 0x76E5 # +0x6E43 0x8832 # +0x6E44 0x9485 # +0x6E45 0x9486 # +0x6E46 0x9487 # +0x6E47 0x948B # +0x6E48 0x948A # +0x6E49 0x948C # +0x6E4A 0x948D # +0x6E4B 0x948F # +0x6E4C 0x9490 # +0x6E4D 0x9494 # +0x6E4E 0x9497 # +0x6E4F 0x9495 # +0x6E50 0x949A # +0x6E51 0x949B # +0x6E52 0x949C # +0x6E53 0x94A3 # +0x6E54 0x94A4 # +0x6E55 0x94AB # +0x6E56 0x94AA # +0x6E57 0x94AD # +0x6E58 0x94AC # +0x6E59 0x94AF # +0x6E5A 0x94B0 # +0x6E5B 0x94B2 # +0x6E5C 0x94B4 # +0x6E5D 0x94B6 # +0x6E5E 0x94B7 # +0x6E5F 0x94B8 # +0x6E60 0x94B9 # +0x6E61 0x94BA # +0x6E62 0x94BC # +0x6E63 0x94BD # +0x6E64 0x94BF # +0x6E65 0x94C4 # +0x6E66 0x94C8 # +0x6E67 0x94C9 # +0x6E68 0x94CA # +0x6E69 0x94CB # +0x6E6A 0x94CC # +0x6E6B 0x94CD # +0x6E6C 0x94CE # +0x6E6D 0x94D0 # +0x6E6E 0x94D1 # +0x6E6F 0x94D2 # +0x6E70 0x94D5 # +0x6E71 0x94D6 # +0x6E72 0x94D7 # +0x6E73 0x94D9 # +0x6E74 0x94D8 # +0x6E75 0x94DB # +0x6E76 0x94DE # +0x6E77 0x94DF # +0x6E78 0x94E0 # +0x6E79 0x94E2 # +0x6E7A 0x94E4 # +0x6E7B 0x94E5 # +0x6E7C 0x94E7 # +0x6E7D 0x94E8 # +0x6E7E 0x94EA # +0x6F21 0x94E9 # +0x6F22 0x94EB # +0x6F23 0x94EE # +0x6F24 0x94EF # +0x6F25 0x94F3 # +0x6F26 0x94F4 # +0x6F27 0x94F5 # +0x6F28 0x94F7 # +0x6F29 0x94F9 # +0x6F2A 0x94FC # +0x6F2B 0x94FD # +0x6F2C 0x94FF # +0x6F2D 0x9503 # +0x6F2E 0x9502 # +0x6F2F 0x9506 # +0x6F30 0x9507 # +0x6F31 0x9509 # +0x6F32 0x950A # +0x6F33 0x950D # +0x6F34 0x950E # +0x6F35 0x950F # +0x6F36 0x9512 # +0x6F37 0x9513 # +0x6F38 0x9514 # +0x6F39 0x9515 # +0x6F3A 0x9516 # +0x6F3B 0x9518 # +0x6F3C 0x951B # +0x6F3D 0x951D # +0x6F3E 0x951E # +0x6F3F 0x951F # +0x6F40 0x9522 # +0x6F41 0x952A # +0x6F42 0x952B # +0x6F43 0x9529 # +0x6F44 0x952C # +0x6F45 0x9531 # +0x6F46 0x9532 # +0x6F47 0x9534 # +0x6F48 0x9536 # +0x6F49 0x9537 # +0x6F4A 0x9538 # +0x6F4B 0x953C # +0x6F4C 0x953E # +0x6F4D 0x953F # +0x6F4E 0x9542 # +0x6F4F 0x9535 # +0x6F50 0x9544 # +0x6F51 0x9545 # +0x6F52 0x9546 # +0x6F53 0x9549 # +0x6F54 0x954C # +0x6F55 0x954E # +0x6F56 0x954F # +0x6F57 0x9552 # +0x6F58 0x9553 # +0x6F59 0x9554 # +0x6F5A 0x9556 # +0x6F5B 0x9557 # +0x6F5C 0x9558 # +0x6F5D 0x9559 # +0x6F5E 0x955B # +0x6F5F 0x955E # +0x6F60 0x955F # +0x6F61 0x955D # +0x6F62 0x9561 # +0x6F63 0x9562 # +0x6F64 0x9564 # +0x6F65 0x9565 # +0x6F66 0x9566 # +0x6F67 0x9567 # +0x6F68 0x9568 # +0x6F69 0x9569 # +0x6F6A 0x956A # +0x6F6B 0x956B # +0x6F6C 0x956C # +0x6F6D 0x956F # +0x6F6E 0x9571 # +0x6F6F 0x9572 # +0x6F70 0x9573 # +0x6F71 0x953A # +0x6F72 0x77E7 # +0x6F73 0x77EC # +0x6F74 0x96C9 # +0x6F75 0x79D5 # +0x6F76 0x79ED # +0x6F77 0x79E3 # +0x6F78 0x79EB # +0x6F79 0x7A06 # +0x6F7A 0x5D47 # +0x6F7B 0x7A03 # +0x6F7C 0x7A02 # +0x6F7D 0x7A1E # +0x6F7E 0x7A14 # +0x7021 0x7A39 # +0x7022 0x7A37 # +0x7023 0x7A51 # +0x7024 0x9ECF # +0x7025 0x99A5 # +0x7026 0x7A70 # +0x7027 0x7688 # +0x7028 0x768E # +0x7029 0x7693 # +0x702A 0x7699 # +0x702B 0x76A4 # +0x702C 0x74DE # +0x702D 0x74E0 # +0x702E 0x752C # +0x702F 0x9E20 # +0x7030 0x9E22 # +0x7031 0x9E28 # +0x7032 0x9E29 # +0x7033 0x9E2A # +0x7034 0x9E2B # +0x7035 0x9E2C # +0x7036 0x9E32 # +0x7037 0x9E31 # +0x7038 0x9E36 # +0x7039 0x9E38 # +0x703A 0x9E37 # +0x703B 0x9E39 # +0x703C 0x9E3A # +0x703D 0x9E3E # +0x703E 0x9E41 # +0x703F 0x9E42 # +0x7040 0x9E44 # +0x7041 0x9E46 # +0x7042 0x9E47 # +0x7043 0x9E48 # +0x7044 0x9E49 # +0x7045 0x9E4B # +0x7046 0x9E4C # +0x7047 0x9E4E # +0x7048 0x9E51 # +0x7049 0x9E55 # +0x704A 0x9E57 # +0x704B 0x9E5A # +0x704C 0x9E5B # +0x704D 0x9E5C # +0x704E 0x9E5E # +0x704F 0x9E63 # +0x7050 0x9E66 # +0x7051 0x9E67 # +0x7052 0x9E68 # +0x7053 0x9E69 # +0x7054 0x9E6A # +0x7055 0x9E6B # +0x7056 0x9E6C # +0x7057 0x9E71 # +0x7058 0x9E6D # +0x7059 0x9E73 # +0x705A 0x7592 # +0x705B 0x7594 # +0x705C 0x7596 # +0x705D 0x75A0 # +0x705E 0x759D # +0x705F 0x75AC # +0x7060 0x75A3 # +0x7061 0x75B3 # +0x7062 0x75B4 # +0x7063 0x75B8 # +0x7064 0x75C4 # +0x7065 0x75B1 # +0x7066 0x75B0 # +0x7067 0x75C3 # +0x7068 0x75C2 # +0x7069 0x75D6 # +0x706A 0x75CD # +0x706B 0x75E3 # +0x706C 0x75E8 # +0x706D 0x75E6 # +0x706E 0x75E4 # +0x706F 0x75EB # +0x7070 0x75E7 # +0x7071 0x7603 # +0x7072 0x75F1 # +0x7073 0x75FC # +0x7074 0x75FF # +0x7075 0x7610 # +0x7076 0x7600 # +0x7077 0x7605 # +0x7078 0x760C # +0x7079 0x7617 # +0x707A 0x760A # +0x707B 0x7625 # +0x707C 0x7618 # +0x707D 0x7615 # +0x707E 0x7619 # +0x7121 0x761B # +0x7122 0x763C # +0x7123 0x7622 # +0x7124 0x7620 # +0x7125 0x7640 # +0x7126 0x762D # +0x7127 0x7630 # +0x7128 0x763F # +0x7129 0x7635 # +0x712A 0x7643 # +0x712B 0x763E # +0x712C 0x7633 # +0x712D 0x764D # +0x712E 0x765E # +0x712F 0x7654 # +0x7130 0x765C # +0x7131 0x7656 # +0x7132 0x766B # +0x7133 0x766F # +0x7134 0x7FCA # +0x7135 0x7AE6 # +0x7136 0x7A78 # +0x7137 0x7A79 # +0x7138 0x7A80 # +0x7139 0x7A86 # +0x713A 0x7A88 # +0x713B 0x7A95 # +0x713C 0x7AA6 # +0x713D 0x7AA0 # +0x713E 0x7AAC # +0x713F 0x7AA8 # +0x7140 0x7AAD # +0x7141 0x7AB3 # +0x7142 0x8864 # +0x7143 0x8869 # +0x7144 0x8872 # +0x7145 0x887D # +0x7146 0x887F # +0x7147 0x8882 # +0x7148 0x88A2 # +0x7149 0x88C6 # +0x714A 0x88B7 # +0x714B 0x88BC # +0x714C 0x88C9 # +0x714D 0x88E2 # +0x714E 0x88CE # +0x714F 0x88E3 # +0x7150 0x88E5 # +0x7151 0x88F1 # +0x7152 0x891A # +0x7153 0x88FC # +0x7154 0x88E8 # +0x7155 0x88FE # +0x7156 0x88F0 # +0x7157 0x8921 # +0x7158 0x8919 # +0x7159 0x8913 # +0x715A 0x891B # +0x715B 0x890A # +0x715C 0x8934 # +0x715D 0x892B # +0x715E 0x8936 # +0x715F 0x8941 # +0x7160 0x8966 # +0x7161 0x897B # +0x7162 0x758B # +0x7163 0x80E5 # +0x7164 0x76B2 # +0x7165 0x76B4 # +0x7166 0x77DC # +0x7167 0x8012 # +0x7168 0x8014 # +0x7169 0x8016 # +0x716A 0x801C # +0x716B 0x8020 # +0x716C 0x8022 # +0x716D 0x8025 # +0x716E 0x8026 # +0x716F 0x8027 # +0x7170 0x8029 # +0x7171 0x8028 # +0x7172 0x8031 # +0x7173 0x800B # +0x7174 0x8035 # +0x7175 0x8043 # +0x7176 0x8046 # +0x7177 0x804D # +0x7178 0x8052 # +0x7179 0x8069 # +0x717A 0x8071 # +0x717B 0x8983 # +0x717C 0x9878 # +0x717D 0x9880 # +0x717E 0x9883 # +0x7221 0x9889 # +0x7222 0x988C # +0x7223 0x988D # +0x7224 0x988F # +0x7225 0x9894 # +0x7226 0x989A # +0x7227 0x989B # +0x7228 0x989E # +0x7229 0x989F # +0x722A 0x98A1 # +0x722B 0x98A2 # +0x722C 0x98A5 # +0x722D 0x98A6 # +0x722E 0x864D # +0x722F 0x8654 # +0x7230 0x866C # +0x7231 0x866E # +0x7232 0x867F # +0x7233 0x867A # +0x7234 0x867C # +0x7235 0x867B # +0x7236 0x86A8 # +0x7237 0x868D # +0x7238 0x868B # +0x7239 0x86AC # +0x723A 0x869D # +0x723B 0x86A7 # +0x723C 0x86A3 # +0x723D 0x86AA # +0x723E 0x8693 # +0x723F 0x86A9 # +0x7240 0x86B6 # +0x7241 0x86C4 # +0x7242 0x86B5 # +0x7243 0x86CE # +0x7244 0x86B0 # +0x7245 0x86BA # +0x7246 0x86B1 # +0x7247 0x86AF # +0x7248 0x86C9 # +0x7249 0x86CF # +0x724A 0x86B4 # +0x724B 0x86E9 # +0x724C 0x86F1 # +0x724D 0x86F2 # +0x724E 0x86ED # +0x724F 0x86F3 # +0x7250 0x86D0 # +0x7251 0x8713 # +0x7252 0x86DE # +0x7253 0x86F4 # +0x7254 0x86DF # +0x7255 0x86D8 # +0x7256 0x86D1 # +0x7257 0x8703 # +0x7258 0x8707 # +0x7259 0x86F8 # +0x725A 0x8708 # +0x725B 0x870A # +0x725C 0x870D # +0x725D 0x8709 # +0x725E 0x8723 # +0x725F 0x873B # +0x7260 0x871E # +0x7261 0x8725 # +0x7262 0x872E # +0x7263 0x871A # +0x7264 0x873E # +0x7265 0x8748 # +0x7266 0x8734 # +0x7267 0x8731 # +0x7268 0x8729 # +0x7269 0x8737 # +0x726A 0x873F # +0x726B 0x8782 # +0x726C 0x8722 # +0x726D 0x877D # +0x726E 0x877E # +0x726F 0x877B # +0x7270 0x8760 # +0x7271 0x8770 # +0x7272 0x874C # +0x7273 0x876E # +0x7274 0x878B # +0x7275 0x8753 # +0x7276 0x8763 # +0x7277 0x877C # +0x7278 0x8764 # +0x7279 0x8759 # +0x727A 0x8765 # +0x727B 0x8793 # +0x727C 0x87AF # +0x727D 0x87A8 # +0x727E 0x87D2 # +0x7321 0x87C6 # +0x7322 0x8788 # +0x7323 0x8785 # +0x7324 0x87AD # +0x7325 0x8797 # +0x7326 0x8783 # +0x7327 0x87AB # +0x7328 0x87E5 # +0x7329 0x87AC # +0x732A 0x87B5 # +0x732B 0x87B3 # +0x732C 0x87CB # +0x732D 0x87D3 # +0x732E 0x87BD # +0x732F 0x87D1 # +0x7330 0x87C0 # +0x7331 0x87CA # +0x7332 0x87DB # +0x7333 0x87EA # +0x7334 0x87E0 # +0x7335 0x87EE # +0x7336 0x8816 # +0x7337 0x8813 # +0x7338 0x87FE # +0x7339 0x880A # +0x733A 0x881B # +0x733B 0x8821 # +0x733C 0x8839 # +0x733D 0x883C # +0x733E 0x7F36 # +0x733F 0x7F42 # +0x7340 0x7F44 # +0x7341 0x7F45 # +0x7342 0x8210 # +0x7343 0x7AFA # +0x7344 0x7AFD # +0x7345 0x7B08 # +0x7346 0x7B03 # +0x7347 0x7B04 # +0x7348 0x7B15 # +0x7349 0x7B0A # +0x734A 0x7B2B # +0x734B 0x7B0F # +0x734C 0x7B47 # +0x734D 0x7B38 # +0x734E 0x7B2A # +0x734F 0x7B19 # +0x7350 0x7B2E # +0x7351 0x7B31 # +0x7352 0x7B20 # +0x7353 0x7B25 # +0x7354 0x7B24 # +0x7355 0x7B33 # +0x7356 0x7B3E # +0x7357 0x7B1E # +0x7358 0x7B58 # +0x7359 0x7B5A # +0x735A 0x7B45 # +0x735B 0x7B75 # +0x735C 0x7B4C # +0x735D 0x7B5D # +0x735E 0x7B60 # +0x735F 0x7B6E # +0x7360 0x7B7B # +0x7361 0x7B62 # +0x7362 0x7B72 # +0x7363 0x7B71 # +0x7364 0x7B90 # +0x7365 0x7BA6 # +0x7366 0x7BA7 # +0x7367 0x7BB8 # +0x7368 0x7BAC # +0x7369 0x7B9D # +0x736A 0x7BA8 # +0x736B 0x7B85 # +0x736C 0x7BAA # +0x736D 0x7B9C # +0x736E 0x7BA2 # +0x736F 0x7BAB # +0x7370 0x7BB4 # +0x7371 0x7BD1 # +0x7372 0x7BC1 # +0x7373 0x7BCC # +0x7374 0x7BDD # +0x7375 0x7BDA # +0x7376 0x7BE5 # +0x7377 0x7BE6 # +0x7378 0x7BEA # +0x7379 0x7C0C # +0x737A 0x7BFE # +0x737B 0x7BFC # +0x737C 0x7C0F # +0x737D 0x7C16 # +0x737E 0x7C0B # +0x7421 0x7C1F # +0x7422 0x7C2A # +0x7423 0x7C26 # +0x7424 0x7C38 # +0x7425 0x7C41 # +0x7426 0x7C40 # +0x7427 0x81FE # +0x7428 0x8201 # +0x7429 0x8202 # +0x742A 0x8204 # +0x742B 0x81EC # +0x742C 0x8844 # +0x742D 0x8221 # +0x742E 0x8222 # +0x742F 0x8223 # +0x7430 0x822D # +0x7431 0x822F # +0x7432 0x8228 # +0x7433 0x822B # +0x7434 0x8238 # +0x7435 0x823B # +0x7436 0x8233 # +0x7437 0x8234 # +0x7438 0x823E # +0x7439 0x8244 # +0x743A 0x8249 # +0x743B 0x824B # +0x743C 0x824F # +0x743D 0x825A # +0x743E 0x825F # +0x743F 0x8268 # +0x7440 0x887E # +0x7441 0x8885 # +0x7442 0x8888 # +0x7443 0x88D8 # +0x7444 0x88DF # +0x7445 0x895E # +0x7446 0x7F9D # +0x7447 0x7F9F # +0x7448 0x7FA7 # +0x7449 0x7FAF # +0x744A 0x7FB0 # +0x744B 0x7FB2 # +0x744C 0x7C7C # +0x744D 0x6549 # +0x744E 0x7C91 # +0x744F 0x7C9D # +0x7450 0x7C9C # +0x7451 0x7C9E # +0x7452 0x7CA2 # +0x7453 0x7CB2 # +0x7454 0x7CBC # +0x7455 0x7CBD # +0x7456 0x7CC1 # +0x7457 0x7CC7 # +0x7458 0x7CCC # +0x7459 0x7CCD # +0x745A 0x7CC8 # +0x745B 0x7CC5 # +0x745C 0x7CD7 # +0x745D 0x7CE8 # +0x745E 0x826E # +0x745F 0x66A8 # +0x7460 0x7FBF # +0x7461 0x7FCE # +0x7462 0x7FD5 # +0x7463 0x7FE5 # +0x7464 0x7FE1 # +0x7465 0x7FE6 # +0x7466 0x7FE9 # +0x7467 0x7FEE # +0x7468 0x7FF3 # +0x7469 0x7CF8 # +0x746A 0x7D77 # +0x746B 0x7DA6 # +0x746C 0x7DAE # +0x746D 0x7E47 # +0x746E 0x7E9B # +0x746F 0x9EB8 # +0x7470 0x9EB4 # +0x7471 0x8D73 # +0x7472 0x8D84 # +0x7473 0x8D94 # +0x7474 0x8D91 # +0x7475 0x8DB1 # +0x7476 0x8D67 # +0x7477 0x8D6D # +0x7478 0x8C47 # +0x7479 0x8C49 # +0x747A 0x914A # +0x747B 0x9150 # +0x747C 0x914E # +0x747D 0x914F # +0x747E 0x9164 # +0x7521 0x9162 # +0x7522 0x9161 # +0x7523 0x9170 # +0x7524 0x9169 # +0x7525 0x916F # +0x7526 0x917D # +0x7527 0x917E # +0x7528 0x9172 # +0x7529 0x9174 # +0x752A 0x9179 # +0x752B 0x918C # +0x752C 0x9185 # +0x752D 0x9190 # +0x752E 0x918D # +0x752F 0x9191 # +0x7530 0x91A2 # +0x7531 0x91A3 # +0x7532 0x91AA # +0x7533 0x91AD # +0x7534 0x91AE # +0x7535 0x91AF # +0x7536 0x91B5 # +0x7537 0x91B4 # +0x7538 0x91BA # +0x7539 0x8C55 # +0x753A 0x9E7E # +0x753B 0x8DB8 # +0x753C 0x8DEB # +0x753D 0x8E05 # +0x753E 0x8E59 # +0x753F 0x8E69 # +0x7540 0x8DB5 # +0x7541 0x8DBF # +0x7542 0x8DBC # +0x7543 0x8DBA # +0x7544 0x8DC4 # +0x7545 0x8DD6 # +0x7546 0x8DD7 # +0x7547 0x8DDA # +0x7548 0x8DDE # +0x7549 0x8DCE # +0x754A 0x8DCF # +0x754B 0x8DDB # +0x754C 0x8DC6 # +0x754D 0x8DEC # +0x754E 0x8DF7 # +0x754F 0x8DF8 # +0x7550 0x8DE3 # +0x7551 0x8DF9 # +0x7552 0x8DFB # +0x7553 0x8DE4 # +0x7554 0x8E09 # +0x7555 0x8DFD # +0x7556 0x8E14 # +0x7557 0x8E1D # +0x7558 0x8E1F # +0x7559 0x8E2C # +0x755A 0x8E2E # +0x755B 0x8E23 # +0x755C 0x8E2F # +0x755D 0x8E3A # +0x755E 0x8E40 # +0x755F 0x8E39 # +0x7560 0x8E35 # +0x7561 0x8E3D # +0x7562 0x8E31 # +0x7563 0x8E49 # +0x7564 0x8E41 # +0x7565 0x8E42 # +0x7566 0x8E51 # +0x7567 0x8E52 # +0x7568 0x8E4A # +0x7569 0x8E70 # +0x756A 0x8E76 # +0x756B 0x8E7C # +0x756C 0x8E6F # +0x756D 0x8E74 # +0x756E 0x8E85 # +0x756F 0x8E8F # +0x7570 0x8E94 # +0x7571 0x8E90 # +0x7572 0x8E9C # +0x7573 0x8E9E # +0x7574 0x8C78 # +0x7575 0x8C82 # +0x7576 0x8C8A # +0x7577 0x8C85 # +0x7578 0x8C98 # +0x7579 0x8C94 # +0x757A 0x659B # +0x757B 0x89D6 # +0x757C 0x89DE # +0x757D 0x89DA # +0x757E 0x89DC # +0x7621 0x89E5 # +0x7622 0x89EB # +0x7623 0x89EF # +0x7624 0x8A3E # +0x7625 0x8B26 # +0x7626 0x9753 # +0x7627 0x96E9 # +0x7628 0x96F3 # +0x7629 0x96EF # +0x762A 0x9706 # +0x762B 0x9701 # +0x762C 0x9708 # +0x762D 0x970F # +0x762E 0x970E # +0x762F 0x972A # +0x7630 0x972D # +0x7631 0x9730 # +0x7632 0x973E # +0x7633 0x9F80 # +0x7634 0x9F83 # +0x7635 0x9F85 # +0x7636 0x9F86 # +0x7637 0x9F87 # +0x7638 0x9F88 # +0x7639 0x9F89 # +0x763A 0x9F8A # +0x763B 0x9F8C # +0x763C 0x9EFE # +0x763D 0x9F0B # +0x763E 0x9F0D # +0x763F 0x96B9 # +0x7640 0x96BC # +0x7641 0x96BD # +0x7642 0x96CE # +0x7643 0x96D2 # +0x7644 0x77BF # +0x7645 0x96E0 # +0x7646 0x928E # +0x7647 0x92AE # +0x7648 0x92C8 # +0x7649 0x933E # +0x764A 0x936A # +0x764B 0x93CA # +0x764C 0x938F # +0x764D 0x943E # +0x764E 0x946B # +0x764F 0x9C7F # +0x7650 0x9C82 # +0x7651 0x9C85 # +0x7652 0x9C86 # +0x7653 0x9C87 # +0x7654 0x9C88 # +0x7655 0x7A23 # +0x7656 0x9C8B # +0x7657 0x9C8E # +0x7658 0x9C90 # +0x7659 0x9C91 # +0x765A 0x9C92 # +0x765B 0x9C94 # +0x765C 0x9C95 # +0x765D 0x9C9A # +0x765E 0x9C9B # +0x765F 0x9C9E # +0x7660 0x9C9F # +0x7661 0x9CA0 # +0x7662 0x9CA1 # +0x7663 0x9CA2 # +0x7664 0x9CA3 # +0x7665 0x9CA5 # +0x7666 0x9CA6 # +0x7667 0x9CA7 # +0x7668 0x9CA8 # +0x7669 0x9CA9 # +0x766A 0x9CAB # +0x766B 0x9CAD # +0x766C 0x9CAE # +0x766D 0x9CB0 # +0x766E 0x9CB1 # +0x766F 0x9CB2 # +0x7670 0x9CB3 # +0x7671 0x9CB4 # +0x7672 0x9CB5 # +0x7673 0x9CB6 # +0x7674 0x9CB7 # +0x7675 0x9CBA # +0x7676 0x9CBB # +0x7677 0x9CBC # +0x7678 0x9CBD # +0x7679 0x9CC4 # +0x767A 0x9CC5 # +0x767B 0x9CC6 # +0x767C 0x9CC7 # +0x767D 0x9CCA # +0x767E 0x9CCB # +0x7721 0x9CCC # +0x7722 0x9CCD # +0x7723 0x9CCE # +0x7724 0x9CCF # +0x7725 0x9CD0 # +0x7726 0x9CD3 # +0x7727 0x9CD4 # +0x7728 0x9CD5 # +0x7729 0x9CD7 # +0x772A 0x9CD8 # +0x772B 0x9CD9 # +0x772C 0x9CDC # +0x772D 0x9CDD # +0x772E 0x9CDF # +0x772F 0x9CE2 # +0x7730 0x977C # +0x7731 0x9785 # +0x7732 0x9791 # +0x7733 0x9792 # +0x7734 0x9794 # +0x7735 0x97AF # +0x7736 0x97AB # +0x7737 0x97A3 # +0x7738 0x97B2 # +0x7739 0x97B4 # +0x773A 0x9AB1 # +0x773B 0x9AB0 # +0x773C 0x9AB7 # +0x773D 0x9E58 # +0x773E 0x9AB6 # +0x773F 0x9ABA # +0x7740 0x9ABC # +0x7741 0x9AC1 # +0x7742 0x9AC0 # +0x7743 0x9AC5 # +0x7744 0x9AC2 # +0x7745 0x9ACB # +0x7746 0x9ACC # +0x7747 0x9AD1 # +0x7748 0x9B45 # +0x7749 0x9B43 # +0x774A 0x9B47 # +0x774B 0x9B49 # +0x774C 0x9B48 # +0x774D 0x9B4D # +0x774E 0x9B51 # +0x774F 0x98E8 # +0x7750 0x990D # +0x7751 0x992E # +0x7752 0x9955 # +0x7753 0x9954 # +0x7754 0x9ADF # +0x7755 0x9AE1 # +0x7756 0x9AE6 # +0x7757 0x9AEF # +0x7758 0x9AEB # +0x7759 0x9AFB # +0x775A 0x9AED # +0x775B 0x9AF9 # +0x775C 0x9B08 # +0x775D 0x9B0F # +0x775E 0x9B13 # +0x775F 0x9B1F # +0x7760 0x9B23 # +0x7761 0x9EBD # +0x7762 0x9EBE # +0x7763 0x7E3B # +0x7764 0x9E82 # +0x7765 0x9E87 # +0x7766 0x9E88 # +0x7767 0x9E8B # +0x7768 0x9E92 # +0x7769 0x93D6 # +0x776A 0x9E9D # +0x776B 0x9E9F # +0x776C 0x9EDB # +0x776D 0x9EDC # +0x776E 0x9EDD # +0x776F 0x9EE0 # +0x7770 0x9EDF # +0x7771 0x9EE2 # +0x7772 0x9EE9 # +0x7773 0x9EE7 # +0x7774 0x9EE5 # +0x7775 0x9EEA # +0x7776 0x9EEF # +0x7777 0x9F22 # +0x7778 0x9F2C # +0x7779 0x9F2F # +0x777A 0x9F39 # +0x777B 0x9F37 # +0x777C 0x9F3D # +0x777D 0x9F3E # +0x777E 0x9F44 # diff --git a/Tools/unicode/python-mappings/diff/jisx0213-2000-std.txt.diff b/Tools/unicode/python-mappings/diff/jisx0213-2000-std.txt.diff new file mode 100644 index 0000000000000..e4171d5ee1c24 --- /dev/null +++ b/Tools/unicode/python-mappings/diff/jisx0213-2000-std.txt.diff @@ -0,0 +1,271 @@ +--- jisx0213-2000-std.txt.orig Tue Apr 16 23:32:38 2002 ++++ jisx0213-2000-std.txt Wed Jun 16 14:49:05 2004 +@@ -23,21 +23,21 @@ + 3-2121 U+3000 # IDEOGRAPHIC SPACE + 3-2122 U+3001 # IDEOGRAPHIC COMMA + 3-2123 U+3002 # IDEOGRAPHIC FULL STOP +-3-2124 U+002C # COMMA Fullwidth: U+FF0C +-3-2125 U+002E # FULL STOP Fullwidth: U+FF0E ++3-2124 U+FF0C # COMMA Fullwidth: U+FF0C ++3-2125 U+FF0E # FULL STOP Fullwidth: U+FF0E + 3-2126 U+30FB # KATAKANA MIDDLE DOT +-3-2127 U+003A # COLON Fullwidth: U+FF1A +-3-2128 U+003B # SEMICOLON Fullwidth: U+FF1B +-3-2129 U+003F # QUESTION MARK Fullwidth: U+FF1F +-3-212A U+0021 # EXCLAMATION MARK Fullwidth: U+FF01 ++3-2127 U+FF1A # COLON Fullwidth: U+FF1A ++3-2128 U+FF1B # SEMICOLON Fullwidth: U+FF1B ++3-2129 U+FF1F # QUESTION MARK Fullwidth: U+FF1F ++3-212A U+FF01 # EXCLAMATION MARK Fullwidth: U+FF01 + 3-212B U+309B # KATAKANA-HIRAGANA VOICED SOUND MARK + 3-212C U+309C # KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + 3-212D U+00B4 # ACUTE ACCENT +-3-212E U+0060 # GRAVE ACCENT Fullwidth: U+FF40 ++3-212E U+FF40 # GRAVE ACCENT Fullwidth: U+FF40 + 3-212F U+00A8 # DIAERESIS +-3-2130 U+005E # CIRCUMFLEX ACCENT Fullwidth: U+FF3E +-3-2131 U+203E # OVERLINE Windows: U+FFE3 +-3-2132 U+005F # LOW LINE Fullwidth: U+FF3F ++3-2130 U+FF3E # CIRCUMFLEX ACCENT Fullwidth: U+FF3E ++3-2131 U+FFE3 # OVERLINE Windows: U+FFE3 ++3-2132 U+FF3F # LOW LINE Fullwidth: U+FF3F + 3-2133 U+30FD # KATAKANA ITERATION MARK + 3-2134 U+30FE # KATAKANA VOICED ITERATION MARK + 3-2135 U+309D # HIRAGANA ITERATION MARK +@@ -48,27 +48,27 @@ + 3-213A U+3006 # IDEOGRAPHIC CLOSING MARK + 3-213B U+3007 # IDEOGRAPHIC NUMBER ZERO + 3-213C U+30FC # KATAKANA-HIRAGANA PROLONGED SOUND MARK +-3-213D U+2014 # EM DASH Windows: U+2015 ++3-213D U+2015 # EM DASH Windows: U+2015 + 3-213E U+2010 # HYPHEN +-3-213F U+002F # SOLIDUS Fullwidth: U+FF0F ++3-213F U+FF0F # SOLIDUS Fullwidth: U+FF0F + 3-2140 U+005C # REVERSE SOLIDUS Fullwidth: U+FF3C + 3-2141 U+301C # WAVE DASH Windows: U+FF5E + 3-2142 U+2016 # DOUBLE VERTICAL LINE Windows: U+2225 +-3-2143 U+007C # VERTICAL LINE Fullwidth: U+FF5C ++3-2143 U+FF5C # VERTICAL LINE Fullwidth: U+FF5C + 3-2144 U+2026 # HORIZONTAL ELLIPSIS + 3-2145 U+2025 # TWO DOT LEADER + 3-2146 U+2018 # LEFT SINGLE QUOTATION MARK + 3-2147 U+2019 # RIGHT SINGLE QUOTATION MARK + 3-2148 U+201C # LEFT DOUBLE QUOTATION MARK + 3-2149 U+201D # RIGHT DOUBLE QUOTATION MARK +-3-214A U+0028 # LEFT PARENTHESIS Fullwidth: U+FF08 +-3-214B U+0029 # RIGHT PARENTHESIS Fullwidth: U+FF09 ++3-214A U+FF08 # LEFT PARENTHESIS Fullwidth: U+FF08 ++3-214B U+FF09 # RIGHT PARENTHESIS Fullwidth: U+FF09 + 3-214C U+3014 # LEFT TORTOISE SHELL BRACKET + 3-214D U+3015 # RIGHT TORTOISE SHELL BRACKET +-3-214E U+005B # LEFT SQUARE BRACKET Fullwidth: U+FF3B +-3-214F U+005D # RIGHT SQUARE BRACKET Fullwidth: U+FF3D +-3-2150 U+007B # LEFT CURLY BRACKET Fullwidth: U+FF5B +-3-2151 U+007D # RIGHT CURLY BRACKET Fullwidth: U+FF5D ++3-214E U+FF3B # LEFT SQUARE BRACKET Fullwidth: U+FF3B ++3-214F U+FF3D # RIGHT SQUARE BRACKET Fullwidth: U+FF3D ++3-2150 U+FF5B # LEFT CURLY BRACKET Fullwidth: U+FF5B ++3-2151 U+FF5D # RIGHT CURLY BRACKET Fullwidth: U+FF5D + 3-2152 U+3008 # LEFT ANGLE BRACKET + 3-2153 U+3009 # RIGHT ANGLE BRACKET + 3-2154 U+300A # LEFT DOUBLE ANGLE BRACKET +@@ -79,15 +79,15 @@ + 3-2159 U+300F # RIGHT WHITE CORNER BRACKET + 3-215A U+3010 # LEFT BLACK LENTICULAR BRACKET + 3-215B U+3011 # RIGHT BLACK LENTICULAR BRACKET +-3-215C U+002B # PLUS SIGN Fullwidth: U+FF0B ++3-215C U+FF0B # PLUS SIGN Fullwidth: U+FF0B + 3-215D U+2212 # MINUS SIGN Windows: U+FF0D + 3-215E U+00B1 # PLUS-MINUS SIGN + 3-215F U+00D7 # MULTIPLICATION SIGN + 3-2160 U+00F7 # DIVISION SIGN +-3-2161 U+003D # EQUALS SIGN Fullwidth: U+FF1D ++3-2161 U+FF1D # EQUALS SIGN Fullwidth: U+FF1D + 3-2162 U+2260 # NOT EQUAL TO +-3-2163 U+003C # LESS-THAN SIGN Fullwidth: U+FF1C +-3-2164 U+003E # GREATER-THAN SIGN Fullwidth: U+FF1E ++3-2163 U+FF1C # LESS-THAN SIGN Fullwidth: U+FF1C ++3-2164 U+FF1E # GREATER-THAN SIGN Fullwidth: U+FF1E + 3-2165 U+2266 # LESS-THAN OVER EQUAL TO + 3-2166 U+2267 # GREATER-THAN OVER EQUAL TO + 3-2167 U+221E # INFINITY +@@ -98,15 +98,15 @@ + 3-216C U+2032 # PRIME + 3-216D U+2033 # DOUBLE PRIME + 3-216E U+2103 # DEGREE CELSIUS +-3-216F U+00A5 # YEN SIGN Windows: U+FFE5 +-3-2170 U+0024 # DOLLAR SIGN Fullwidth: U+FF04 ++3-216F U+FFE5 # YEN SIGN Windows: U+FFE5 ++3-2170 U+FF04 # DOLLAR SIGN Fullwidth: U+FF04 + 3-2171 U+00A2 # CENT SIGN Windows: U+FFE0 + 3-2172 U+00A3 # POUND SIGN Windows: U+FFE1 +-3-2173 U+0025 # PERCENT SIGN Fullwidth: U+FF05 +-3-2174 U+0023 # NUMBER SIGN Fullwidth: U+FF03 +-3-2175 U+0026 # AMPERSAND Fullwidth: U+FF06 +-3-2176 U+002A # ASTERISK Fullwidth: U+FF0A +-3-2177 U+0040 # COMMERCIAL AT Fullwidth: U+FF20 ++3-2173 U+FF05 # PERCENT SIGN Fullwidth: U+FF05 ++3-2174 U+FF03 # NUMBER SIGN Fullwidth: U+FF03 ++3-2175 U+FF06 # AMPERSAND Fullwidth: U+FF06 ++3-2176 U+FF0A # ASTERISK Fullwidth: U+FF0A ++3-2177 U+FF20 # COMMERCIAL AT Fullwidth: U+FF20 + 3-2178 U+00A7 # SECTION SIGN + 3-2179 U+2606 # WHITE STAR + 3-217A U+2605 # BLACK STAR +@@ -128,9 +128,9 @@ + 3-222C U+2191 # UPWARDS ARROW + 3-222D U+2193 # DOWNWARDS ARROW + 3-222E U+3013 # GETA MARK +-3-222F U+0027 # APOSTROPHE Fullwidth: U+FF07 +-3-2230 U+0022 # QUOTATION MARK [2000] Fullwidth: U+FF02 +-3-2231 U+002D # HYPHEN-MINUS [2000] Fullwidth: U+FF0D ++3-222F U+FF07 # APOSTROPHE Fullwidth: U+FF07 ++3-2230 U+FF02 # QUOTATION MARK [2000] Fullwidth: U+FF02 ++3-2231 U+FF0D # HYPHEN-MINUS [2000] Fullwidth: U+FF0D + 3-2232 U+007E # TILDE [2000] Fullwidth: U+FF5E + 3-2233 U+3033 # VERTICAL KANA REPEAT MARK UPPER HALF [2000] + 3-2234 U+3034 # VERTICAL KANA REPEAT WITH VOICED SOUND MARK UPPER HALF [2000] +@@ -223,16 +223,16 @@ + 3-232D U+21E9 # DOWNWARDS WHITE ARROW [2000] + 3-232E U+2934 # ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS [2000] [Unicode3.2] + 3-232F U+2935 # ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS [2000] [Unicode3.2] +-3-2330 U+0030 # DIGIT ZERO Fullwidth: U+FF10 +-3-2331 U+0031 # DIGIT ONE Fullwidth: U+FF11 +-3-2332 U+0032 # DIGIT TWO Fullwidth: U+FF12 +-3-2333 U+0033 # DIGIT THREE Fullwidth: U+FF13 +-3-2334 U+0034 # DIGIT FOUR Fullwidth: U+FF14 +-3-2335 U+0035 # DIGIT FIVE Fullwidth: U+FF15 +-3-2336 U+0036 # DIGIT SIX Fullwidth: U+FF16 +-3-2337 U+0037 # DIGIT SEVEN Fullwidth: U+FF17 +-3-2338 U+0038 # DIGIT EIGHT Fullwidth: U+FF18 +-3-2339 U+0039 # DIGIT NINE Fullwidth: U+FF19 ++3-2330 U+FF10 # DIGIT ZERO Fullwidth: U+FF10 ++3-2331 U+FF11 # DIGIT ONE Fullwidth: U+FF11 ++3-2332 U+FF12 # DIGIT TWO Fullwidth: U+FF12 ++3-2333 U+FF13 # DIGIT THREE Fullwidth: U+FF13 ++3-2334 U+FF14 # DIGIT FOUR Fullwidth: U+FF14 ++3-2335 U+FF15 # DIGIT FIVE Fullwidth: U+FF15 ++3-2336 U+FF16 # DIGIT SIX Fullwidth: U+FF16 ++3-2337 U+FF17 # DIGIT SEVEN Fullwidth: U+FF17 ++3-2338 U+FF18 # DIGIT EIGHT Fullwidth: U+FF18 ++3-2339 U+FF19 # DIGIT NINE Fullwidth: U+FF19 + 3-233A U+29BF # CIRCLED BULLET [2000] [Unicode3.2] + 3-233B U+25C9 # FISHEYE [2000] + 3-233C U+303D # PART ALTERNATION MARK [2000] [Unicode3.2] +@@ -240,64 +240,64 @@ + 3-233E U+FE45 # SESAME DOT [2000] [Unicode3.2] + 3-233F U+25E6 # WHITE BULLET [2000] + 3-2340 U+2022 # BULLET [2000] +-3-2341 U+0041 # LATIN CAPITAL LETTER A Fullwidth: U+FF21 +-3-2342 U+0042 # LATIN CAPITAL LETTER B Fullwidth: U+FF22 +-3-2343 U+0043 # LATIN CAPITAL LETTER C Fullwidth: U+FF23 +-3-2344 U+0044 # LATIN CAPITAL LETTER D Fullwidth: U+FF24 +-3-2345 U+0045 # LATIN CAPITAL LETTER E Fullwidth: U+FF25 +-3-2346 U+0046 # LATIN CAPITAL LETTER F Fullwidth: U+FF26 +-3-2347 U+0047 # LATIN CAPITAL LETTER G Fullwidth: U+FF27 +-3-2348 U+0048 # LATIN CAPITAL LETTER H Fullwidth: U+FF28 +-3-2349 U+0049 # LATIN CAPITAL LETTER I Fullwidth: U+FF29 +-3-234A U+004A # LATIN CAPITAL LETTER J Fullwidth: U+FF2A +-3-234B U+004B # LATIN CAPITAL LETTER K Fullwidth: U+FF2B +-3-234C U+004C # LATIN CAPITAL LETTER L Fullwidth: U+FF2C +-3-234D U+004D # LATIN CAPITAL LETTER M Fullwidth: U+FF2D +-3-234E U+004E # LATIN CAPITAL LETTER N Fullwidth: U+FF2E +-3-234F U+004F # LATIN CAPITAL LETTER O Fullwidth: U+FF2F +-3-2350 U+0050 # LATIN CAPITAL LETTER P Fullwidth: U+FF30 +-3-2351 U+0051 # LATIN CAPITAL LETTER Q Fullwidth: U+FF31 +-3-2352 U+0052 # LATIN CAPITAL LETTER R Fullwidth: U+FF32 +-3-2353 U+0053 # LATIN CAPITAL LETTER S Fullwidth: U+FF33 +-3-2354 U+0054 # LATIN CAPITAL LETTER T Fullwidth: U+FF34 +-3-2355 U+0055 # LATIN CAPITAL LETTER U Fullwidth: U+FF35 +-3-2356 U+0056 # LATIN CAPITAL LETTER V Fullwidth: U+FF36 +-3-2357 U+0057 # LATIN CAPITAL LETTER W Fullwidth: U+FF37 +-3-2358 U+0058 # LATIN CAPITAL LETTER X Fullwidth: U+FF38 +-3-2359 U+0059 # LATIN CAPITAL LETTER Y Fullwidth: U+FF39 +-3-235A U+005A # LATIN CAPITAL LETTER Z Fullwidth: U+FF3A ++3-2341 U+FF21 # LATIN CAPITAL LETTER A Fullwidth: U+FF21 ++3-2342 U+FF22 # LATIN CAPITAL LETTER B Fullwidth: U+FF22 ++3-2343 U+FF23 # LATIN CAPITAL LETTER C Fullwidth: U+FF23 ++3-2344 U+FF24 # LATIN CAPITAL LETTER D Fullwidth: U+FF24 ++3-2345 U+FF25 # LATIN CAPITAL LETTER E Fullwidth: U+FF25 ++3-2346 U+FF26 # LATIN CAPITAL LETTER F Fullwidth: U+FF26 ++3-2347 U+FF27 # LATIN CAPITAL LETTER G Fullwidth: U+FF27 ++3-2348 U+FF28 # LATIN CAPITAL LETTER H Fullwidth: U+FF28 ++3-2349 U+FF29 # LATIN CAPITAL LETTER I Fullwidth: U+FF29 ++3-234A U+FF2A # LATIN CAPITAL LETTER J Fullwidth: U+FF2A ++3-234B U+FF2B # LATIN CAPITAL LETTER K Fullwidth: U+FF2B ++3-234C U+FF2C # LATIN CAPITAL LETTER L Fullwidth: U+FF2C ++3-234D U+FF2D # LATIN CAPITAL LETTER M Fullwidth: U+FF2D ++3-234E U+FF2E # LATIN CAPITAL LETTER N Fullwidth: U+FF2E ++3-234F U+FF2F # LATIN CAPITAL LETTER O Fullwidth: U+FF2F ++3-2350 U+FF30 # LATIN CAPITAL LETTER P Fullwidth: U+FF30 ++3-2351 U+FF31 # LATIN CAPITAL LETTER Q Fullwidth: U+FF31 ++3-2352 U+FF32 # LATIN CAPITAL LETTER R Fullwidth: U+FF32 ++3-2353 U+FF33 # LATIN CAPITAL LETTER S Fullwidth: U+FF33 ++3-2354 U+FF34 # LATIN CAPITAL LETTER T Fullwidth: U+FF34 ++3-2355 U+FF35 # LATIN CAPITAL LETTER U Fullwidth: U+FF35 ++3-2356 U+FF36 # LATIN CAPITAL LETTER V Fullwidth: U+FF36 ++3-2357 U+FF37 # LATIN CAPITAL LETTER W Fullwidth: U+FF37 ++3-2358 U+FF38 # LATIN CAPITAL LETTER X Fullwidth: U+FF38 ++3-2359 U+FF39 # LATIN CAPITAL LETTER Y Fullwidth: U+FF39 ++3-235A U+FF3A # LATIN CAPITAL LETTER Z Fullwidth: U+FF3A + 3-235B U+2213 # MINUS-OR-PLUS SIGN [2000] + 3-235C U+2135 # ALEF SYMBOL [2000] + 3-235D U+210F # PLANCK CONSTANT OVER TWO PI [2000] + 3-235E U+33CB # SQUARE HP [2000] + 3-235F U+2113 # SCRIPT SMALL L [2000] + 3-2360 U+2127 # INVERTED OHM SIGN [2000] +-3-2361 U+0061 # LATIN SMALL LETTER A Fullwidth: U+FF41 +-3-2362 U+0062 # LATIN SMALL LETTER B Fullwidth: U+FF42 +-3-2363 U+0063 # LATIN SMALL LETTER C Fullwidth: U+FF43 +-3-2364 U+0064 # LATIN SMALL LETTER D Fullwidth: U+FF44 +-3-2365 U+0065 # LATIN SMALL LETTER E Fullwidth: U+FF45 +-3-2366 U+0066 # LATIN SMALL LETTER F Fullwidth: U+FF46 +-3-2367 U+0067 # LATIN SMALL LETTER G Fullwidth: U+FF47 +-3-2368 U+0068 # LATIN SMALL LETTER H Fullwidth: U+FF48 +-3-2369 U+0069 # LATIN SMALL LETTER I Fullwidth: U+FF49 +-3-236A U+006A # LATIN SMALL LETTER J Fullwidth: U+FF4A +-3-236B U+006B # LATIN SMALL LETTER K Fullwidth: U+FF4B +-3-236C U+006C # LATIN SMALL LETTER L Fullwidth: U+FF4C +-3-236D U+006D # LATIN SMALL LETTER M Fullwidth: U+FF4D +-3-236E U+006E # LATIN SMALL LETTER N Fullwidth: U+FF4E +-3-236F U+006F # LATIN SMALL LETTER O Fullwidth: U+FF4F +-3-2370 U+0070 # LATIN SMALL LETTER P Fullwidth: U+FF50 +-3-2371 U+0071 # LATIN SMALL LETTER Q Fullwidth: U+FF51 +-3-2372 U+0072 # LATIN SMALL LETTER R Fullwidth: U+FF52 +-3-2373 U+0073 # LATIN SMALL LETTER S Fullwidth: U+FF53 +-3-2374 U+0074 # LATIN SMALL LETTER T Fullwidth: U+FF54 +-3-2375 U+0075 # LATIN SMALL LETTER U Fullwidth: U+FF55 +-3-2376 U+0076 # LATIN SMALL LETTER V Fullwidth: U+FF56 +-3-2377 U+0077 # LATIN SMALL LETTER W Fullwidth: U+FF57 +-3-2378 U+0078 # LATIN SMALL LETTER X Fullwidth: U+FF58 +-3-2379 U+0079 # LATIN SMALL LETTER Y Fullwidth: U+FF59 +-3-237A U+007A # LATIN SMALL LETTER Z Fullwidth: U+FF5A ++3-2361 U+FF41 # LATIN SMALL LETTER A Fullwidth: U+FF41 ++3-2362 U+FF42 # LATIN SMALL LETTER B Fullwidth: U+FF42 ++3-2363 U+FF43 # LATIN SMALL LETTER C Fullwidth: U+FF43 ++3-2364 U+FF44 # LATIN SMALL LETTER D Fullwidth: U+FF44 ++3-2365 U+FF45 # LATIN SMALL LETTER E Fullwidth: U+FF45 ++3-2366 U+FF46 # LATIN SMALL LETTER F Fullwidth: U+FF46 ++3-2367 U+FF47 # LATIN SMALL LETTER G Fullwidth: U+FF47 ++3-2368 U+FF48 # LATIN SMALL LETTER H Fullwidth: U+FF48 ++3-2369 U+FF49 # LATIN SMALL LETTER I Fullwidth: U+FF49 ++3-236A U+FF4A # LATIN SMALL LETTER J Fullwidth: U+FF4A ++3-236B U+FF4B # LATIN SMALL LETTER K Fullwidth: U+FF4B ++3-236C U+FF4C # LATIN SMALL LETTER L Fullwidth: U+FF4C ++3-236D U+FF4D # LATIN SMALL LETTER M Fullwidth: U+FF4D ++3-236E U+FF4E # LATIN SMALL LETTER N Fullwidth: U+FF4E ++3-236F U+FF4F # LATIN SMALL LETTER O Fullwidth: U+FF4F ++3-2370 U+FF50 # LATIN SMALL LETTER P Fullwidth: U+FF50 ++3-2371 U+FF51 # LATIN SMALL LETTER Q Fullwidth: U+FF51 ++3-2372 U+FF52 # LATIN SMALL LETTER R Fullwidth: U+FF52 ++3-2373 U+FF53 # LATIN SMALL LETTER S Fullwidth: U+FF53 ++3-2374 U+FF54 # LATIN SMALL LETTER T Fullwidth: U+FF54 ++3-2375 U+FF55 # LATIN SMALL LETTER U Fullwidth: U+FF55 ++3-2376 U+FF56 # LATIN SMALL LETTER V Fullwidth: U+FF56 ++3-2377 U+FF57 # LATIN SMALL LETTER W Fullwidth: U+FF57 ++3-2378 U+FF58 # LATIN SMALL LETTER X Fullwidth: U+FF58 ++3-2379 U+FF59 # LATIN SMALL LETTER Y Fullwidth: U+FF59 ++3-237A U+FF5A # LATIN SMALL LETTER Z Fullwidth: U+FF5A + 3-237B U+30A0 # KATAKANA-HIRAGANA DOUBLE HYPHEN [2000] [Unicode3.2] + 3-237C U+2013 # EN DASH [2000] + 3-237D U+29FA # DOUBLE PLUS [2000] [Unicode3.2] diff --git a/Tools/unicode/python-mappings/diff/jisx0213-2004-std.txt.diff b/Tools/unicode/python-mappings/diff/jisx0213-2004-std.txt.diff new file mode 100644 index 0000000000000..f862a49e8b138 --- /dev/null +++ b/Tools/unicode/python-mappings/diff/jisx0213-2004-std.txt.diff @@ -0,0 +1,351 @@ +--- jisx0213-2000-std.txt.orig Tue Apr 16 23:32:38 2002 ++++ jisx0213-2004-std.txt Thu Jul 8 11:51:54 2004 +@@ -1,6 +1,6 @@ +-## JIS X 0213:2000 vs Unicode mapping table ++## JIS X 0213:2004 vs Unicode mapping table + ## +-## Date: 16 Apr 2002 13:09:49 GMT ++## Date: 7 Jul 2004 13:09:49 GMT + ## License: + ## Copyright (C) 2001 earthian at tama.or.jp, All Rights Reserved. + ## Copyright (C) 2001 I'O, All Rights Reserved. +@@ -23,21 +23,21 @@ + 3-2121 U+3000 # IDEOGRAPHIC SPACE + 3-2122 U+3001 # IDEOGRAPHIC COMMA + 3-2123 U+3002 # IDEOGRAPHIC FULL STOP +-3-2124 U+002C # COMMA Fullwidth: U+FF0C +-3-2125 U+002E # FULL STOP Fullwidth: U+FF0E ++3-2124 U+FF0C # COMMA Fullwidth: U+FF0C ++3-2125 U+FF0E # FULL STOP Fullwidth: U+FF0E + 3-2126 U+30FB # KATAKANA MIDDLE DOT +-3-2127 U+003A # COLON Fullwidth: U+FF1A +-3-2128 U+003B # SEMICOLON Fullwidth: U+FF1B +-3-2129 U+003F # QUESTION MARK Fullwidth: U+FF1F +-3-212A U+0021 # EXCLAMATION MARK Fullwidth: U+FF01 ++3-2127 U+FF1A # COLON Fullwidth: U+FF1A ++3-2128 U+FF1B # SEMICOLON Fullwidth: U+FF1B ++3-2129 U+FF1F # QUESTION MARK Fullwidth: U+FF1F ++3-212A U+FF01 # EXCLAMATION MARK Fullwidth: U+FF01 + 3-212B U+309B # KATAKANA-HIRAGANA VOICED SOUND MARK + 3-212C U+309C # KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + 3-212D U+00B4 # ACUTE ACCENT +-3-212E U+0060 # GRAVE ACCENT Fullwidth: U+FF40 ++3-212E U+FF40 # GRAVE ACCENT Fullwidth: U+FF40 + 3-212F U+00A8 # DIAERESIS +-3-2130 U+005E # CIRCUMFLEX ACCENT Fullwidth: U+FF3E +-3-2131 U+203E # OVERLINE Windows: U+FFE3 +-3-2132 U+005F # LOW LINE Fullwidth: U+FF3F ++3-2130 U+FF3E # CIRCUMFLEX ACCENT Fullwidth: U+FF3E ++3-2131 U+FFE3 # OVERLINE Windows: U+FFE3 ++3-2132 U+FF3F # LOW LINE Fullwidth: U+FF3F + 3-2133 U+30FD # KATAKANA ITERATION MARK + 3-2134 U+30FE # KATAKANA VOICED ITERATION MARK + 3-2135 U+309D # HIRAGANA ITERATION MARK +@@ -48,27 +48,27 @@ + 3-213A U+3006 # IDEOGRAPHIC CLOSING MARK + 3-213B U+3007 # IDEOGRAPHIC NUMBER ZERO + 3-213C U+30FC # KATAKANA-HIRAGANA PROLONGED SOUND MARK +-3-213D U+2014 # EM DASH Windows: U+2015 ++3-213D U+2015 # EM DASH Windows: U+2015 + 3-213E U+2010 # HYPHEN +-3-213F U+002F # SOLIDUS Fullwidth: U+FF0F ++3-213F U+FF0F # SOLIDUS Fullwidth: U+FF0F + 3-2140 U+005C # REVERSE SOLIDUS Fullwidth: U+FF3C + 3-2141 U+301C # WAVE DASH Windows: U+FF5E + 3-2142 U+2016 # DOUBLE VERTICAL LINE Windows: U+2225 +-3-2143 U+007C # VERTICAL LINE Fullwidth: U+FF5C ++3-2143 U+FF5C # VERTICAL LINE Fullwidth: U+FF5C + 3-2144 U+2026 # HORIZONTAL ELLIPSIS + 3-2145 U+2025 # TWO DOT LEADER + 3-2146 U+2018 # LEFT SINGLE QUOTATION MARK + 3-2147 U+2019 # RIGHT SINGLE QUOTATION MARK + 3-2148 U+201C # LEFT DOUBLE QUOTATION MARK + 3-2149 U+201D # RIGHT DOUBLE QUOTATION MARK +-3-214A U+0028 # LEFT PARENTHESIS Fullwidth: U+FF08 +-3-214B U+0029 # RIGHT PARENTHESIS Fullwidth: U+FF09 ++3-214A U+FF08 # LEFT PARENTHESIS Fullwidth: U+FF08 ++3-214B U+FF09 # RIGHT PARENTHESIS Fullwidth: U+FF09 + 3-214C U+3014 # LEFT TORTOISE SHELL BRACKET + 3-214D U+3015 # RIGHT TORTOISE SHELL BRACKET +-3-214E U+005B # LEFT SQUARE BRACKET Fullwidth: U+FF3B +-3-214F U+005D # RIGHT SQUARE BRACKET Fullwidth: U+FF3D +-3-2150 U+007B # LEFT CURLY BRACKET Fullwidth: U+FF5B +-3-2151 U+007D # RIGHT CURLY BRACKET Fullwidth: U+FF5D ++3-214E U+FF3B # LEFT SQUARE BRACKET Fullwidth: U+FF3B ++3-214F U+FF3D # RIGHT SQUARE BRACKET Fullwidth: U+FF3D ++3-2150 U+FF5B # LEFT CURLY BRACKET Fullwidth: U+FF5B ++3-2151 U+FF5D # RIGHT CURLY BRACKET Fullwidth: U+FF5D + 3-2152 U+3008 # LEFT ANGLE BRACKET + 3-2153 U+3009 # RIGHT ANGLE BRACKET + 3-2154 U+300A # LEFT DOUBLE ANGLE BRACKET +@@ -79,15 +79,15 @@ + 3-2159 U+300F # RIGHT WHITE CORNER BRACKET + 3-215A U+3010 # LEFT BLACK LENTICULAR BRACKET + 3-215B U+3011 # RIGHT BLACK LENTICULAR BRACKET +-3-215C U+002B # PLUS SIGN Fullwidth: U+FF0B ++3-215C U+FF0B # PLUS SIGN Fullwidth: U+FF0B + 3-215D U+2212 # MINUS SIGN Windows: U+FF0D + 3-215E U+00B1 # PLUS-MINUS SIGN + 3-215F U+00D7 # MULTIPLICATION SIGN + 3-2160 U+00F7 # DIVISION SIGN +-3-2161 U+003D # EQUALS SIGN Fullwidth: U+FF1D ++3-2161 U+FF1D # EQUALS SIGN Fullwidth: U+FF1D + 3-2162 U+2260 # NOT EQUAL TO +-3-2163 U+003C # LESS-THAN SIGN Fullwidth: U+FF1C +-3-2164 U+003E # GREATER-THAN SIGN Fullwidth: U+FF1E ++3-2163 U+FF1C # LESS-THAN SIGN Fullwidth: U+FF1C ++3-2164 U+FF1E # GREATER-THAN SIGN Fullwidth: U+FF1E + 3-2165 U+2266 # LESS-THAN OVER EQUAL TO + 3-2166 U+2267 # GREATER-THAN OVER EQUAL TO + 3-2167 U+221E # INFINITY +@@ -98,15 +98,15 @@ + 3-216C U+2032 # PRIME + 3-216D U+2033 # DOUBLE PRIME + 3-216E U+2103 # DEGREE CELSIUS +-3-216F U+00A5 # YEN SIGN Windows: U+FFE5 +-3-2170 U+0024 # DOLLAR SIGN Fullwidth: U+FF04 ++3-216F U+FFE5 # YEN SIGN Windows: U+FFE5 ++3-2170 U+FF04 # DOLLAR SIGN Fullwidth: U+FF04 + 3-2171 U+00A2 # CENT SIGN Windows: U+FFE0 + 3-2172 U+00A3 # POUND SIGN Windows: U+FFE1 +-3-2173 U+0025 # PERCENT SIGN Fullwidth: U+FF05 +-3-2174 U+0023 # NUMBER SIGN Fullwidth: U+FF03 +-3-2175 U+0026 # AMPERSAND Fullwidth: U+FF06 +-3-2176 U+002A # ASTERISK Fullwidth: U+FF0A +-3-2177 U+0040 # COMMERCIAL AT Fullwidth: U+FF20 ++3-2173 U+FF05 # PERCENT SIGN Fullwidth: U+FF05 ++3-2174 U+FF03 # NUMBER SIGN Fullwidth: U+FF03 ++3-2175 U+FF06 # AMPERSAND Fullwidth: U+FF06 ++3-2176 U+FF0A # ASTERISK Fullwidth: U+FF0A ++3-2177 U+FF20 # COMMERCIAL AT Fullwidth: U+FF20 + 3-2178 U+00A7 # SECTION SIGN + 3-2179 U+2606 # WHITE STAR + 3-217A U+2605 # BLACK STAR +@@ -128,9 +128,9 @@ + 3-222C U+2191 # UPWARDS ARROW + 3-222D U+2193 # DOWNWARDS ARROW + 3-222E U+3013 # GETA MARK +-3-222F U+0027 # APOSTROPHE Fullwidth: U+FF07 +-3-2230 U+0022 # QUOTATION MARK [2000] Fullwidth: U+FF02 +-3-2231 U+002D # HYPHEN-MINUS [2000] Fullwidth: U+FF0D ++3-222F U+FF07 # APOSTROPHE Fullwidth: U+FF07 ++3-2230 U+FF02 # QUOTATION MARK [2000] Fullwidth: U+FF02 ++3-2231 U+FF0D # HYPHEN-MINUS [2000] Fullwidth: U+FF0D + 3-2232 U+007E # TILDE [2000] Fullwidth: U+FF5E + 3-2233 U+3033 # VERTICAL KANA REPEAT MARK UPPER HALF [2000] + 3-2234 U+3034 # VERTICAL KANA REPEAT WITH VOICED SOUND MARK UPPER HALF [2000] +@@ -223,16 +223,16 @@ + 3-232D U+21E9 # DOWNWARDS WHITE ARROW [2000] + 3-232E U+2934 # ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS [2000] [Unicode3.2] + 3-232F U+2935 # ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS [2000] [Unicode3.2] +-3-2330 U+0030 # DIGIT ZERO Fullwidth: U+FF10 +-3-2331 U+0031 # DIGIT ONE Fullwidth: U+FF11 +-3-2332 U+0032 # DIGIT TWO Fullwidth: U+FF12 +-3-2333 U+0033 # DIGIT THREE Fullwidth: U+FF13 +-3-2334 U+0034 # DIGIT FOUR Fullwidth: U+FF14 +-3-2335 U+0035 # DIGIT FIVE Fullwidth: U+FF15 +-3-2336 U+0036 # DIGIT SIX Fullwidth: U+FF16 +-3-2337 U+0037 # DIGIT SEVEN Fullwidth: U+FF17 +-3-2338 U+0038 # DIGIT EIGHT Fullwidth: U+FF18 +-3-2339 U+0039 # DIGIT NINE Fullwidth: U+FF19 ++3-2330 U+FF10 # DIGIT ZERO Fullwidth: U+FF10 ++3-2331 U+FF11 # DIGIT ONE Fullwidth: U+FF11 ++3-2332 U+FF12 # DIGIT TWO Fullwidth: U+FF12 ++3-2333 U+FF13 # DIGIT THREE Fullwidth: U+FF13 ++3-2334 U+FF14 # DIGIT FOUR Fullwidth: U+FF14 ++3-2335 U+FF15 # DIGIT FIVE Fullwidth: U+FF15 ++3-2336 U+FF16 # DIGIT SIX Fullwidth: U+FF16 ++3-2337 U+FF17 # DIGIT SEVEN Fullwidth: U+FF17 ++3-2338 U+FF18 # DIGIT EIGHT Fullwidth: U+FF18 ++3-2339 U+FF19 # DIGIT NINE Fullwidth: U+FF19 + 3-233A U+29BF # CIRCLED BULLET [2000] [Unicode3.2] + 3-233B U+25C9 # FISHEYE [2000] + 3-233C U+303D # PART ALTERNATION MARK [2000] [Unicode3.2] +@@ -240,64 +240,64 @@ + 3-233E U+FE45 # SESAME DOT [2000] [Unicode3.2] + 3-233F U+25E6 # WHITE BULLET [2000] + 3-2340 U+2022 # BULLET [2000] +-3-2341 U+0041 # LATIN CAPITAL LETTER A Fullwidth: U+FF21 +-3-2342 U+0042 # LATIN CAPITAL LETTER B Fullwidth: U+FF22 +-3-2343 U+0043 # LATIN CAPITAL LETTER C Fullwidth: U+FF23 +-3-2344 U+0044 # LATIN CAPITAL LETTER D Fullwidth: U+FF24 +-3-2345 U+0045 # LATIN CAPITAL LETTER E Fullwidth: U+FF25 +-3-2346 U+0046 # LATIN CAPITAL LETTER F Fullwidth: U+FF26 +-3-2347 U+0047 # LATIN CAPITAL LETTER G Fullwidth: U+FF27 +-3-2348 U+0048 # LATIN CAPITAL LETTER H Fullwidth: U+FF28 +-3-2349 U+0049 # LATIN CAPITAL LETTER I Fullwidth: U+FF29 +-3-234A U+004A # LATIN CAPITAL LETTER J Fullwidth: U+FF2A +-3-234B U+004B # LATIN CAPITAL LETTER K Fullwidth: U+FF2B +-3-234C U+004C # LATIN CAPITAL LETTER L Fullwidth: U+FF2C +-3-234D U+004D # LATIN CAPITAL LETTER M Fullwidth: U+FF2D +-3-234E U+004E # LATIN CAPITAL LETTER N Fullwidth: U+FF2E +-3-234F U+004F # LATIN CAPITAL LETTER O Fullwidth: U+FF2F +-3-2350 U+0050 # LATIN CAPITAL LETTER P Fullwidth: U+FF30 +-3-2351 U+0051 # LATIN CAPITAL LETTER Q Fullwidth: U+FF31 +-3-2352 U+0052 # LATIN CAPITAL LETTER R Fullwidth: U+FF32 +-3-2353 U+0053 # LATIN CAPITAL LETTER S Fullwidth: U+FF33 +-3-2354 U+0054 # LATIN CAPITAL LETTER T Fullwidth: U+FF34 +-3-2355 U+0055 # LATIN CAPITAL LETTER U Fullwidth: U+FF35 +-3-2356 U+0056 # LATIN CAPITAL LETTER V Fullwidth: U+FF36 +-3-2357 U+0057 # LATIN CAPITAL LETTER W Fullwidth: U+FF37 +-3-2358 U+0058 # LATIN CAPITAL LETTER X Fullwidth: U+FF38 +-3-2359 U+0059 # LATIN CAPITAL LETTER Y Fullwidth: U+FF39 +-3-235A U+005A # LATIN CAPITAL LETTER Z Fullwidth: U+FF3A ++3-2341 U+FF21 # LATIN CAPITAL LETTER A Fullwidth: U+FF21 ++3-2342 U+FF22 # LATIN CAPITAL LETTER B Fullwidth: U+FF22 ++3-2343 U+FF23 # LATIN CAPITAL LETTER C Fullwidth: U+FF23 ++3-2344 U+FF24 # LATIN CAPITAL LETTER D Fullwidth: U+FF24 ++3-2345 U+FF25 # LATIN CAPITAL LETTER E Fullwidth: U+FF25 ++3-2346 U+FF26 # LATIN CAPITAL LETTER F Fullwidth: U+FF26 ++3-2347 U+FF27 # LATIN CAPITAL LETTER G Fullwidth: U+FF27 ++3-2348 U+FF28 # LATIN CAPITAL LETTER H Fullwidth: U+FF28 ++3-2349 U+FF29 # LATIN CAPITAL LETTER I Fullwidth: U+FF29 ++3-234A U+FF2A # LATIN CAPITAL LETTER J Fullwidth: U+FF2A ++3-234B U+FF2B # LATIN CAPITAL LETTER K Fullwidth: U+FF2B ++3-234C U+FF2C # LATIN CAPITAL LETTER L Fullwidth: U+FF2C ++3-234D U+FF2D # LATIN CAPITAL LETTER M Fullwidth: U+FF2D ++3-234E U+FF2E # LATIN CAPITAL LETTER N Fullwidth: U+FF2E ++3-234F U+FF2F # LATIN CAPITAL LETTER O Fullwidth: U+FF2F ++3-2350 U+FF30 # LATIN CAPITAL LETTER P Fullwidth: U+FF30 ++3-2351 U+FF31 # LATIN CAPITAL LETTER Q Fullwidth: U+FF31 ++3-2352 U+FF32 # LATIN CAPITAL LETTER R Fullwidth: U+FF32 ++3-2353 U+FF33 # LATIN CAPITAL LETTER S Fullwidth: U+FF33 ++3-2354 U+FF34 # LATIN CAPITAL LETTER T Fullwidth: U+FF34 ++3-2355 U+FF35 # LATIN CAPITAL LETTER U Fullwidth: U+FF35 ++3-2356 U+FF36 # LATIN CAPITAL LETTER V Fullwidth: U+FF36 ++3-2357 U+FF37 # LATIN CAPITAL LETTER W Fullwidth: U+FF37 ++3-2358 U+FF38 # LATIN CAPITAL LETTER X Fullwidth: U+FF38 ++3-2359 U+FF39 # LATIN CAPITAL LETTER Y Fullwidth: U+FF39 ++3-235A U+FF3A # LATIN CAPITAL LETTER Z Fullwidth: U+FF3A + 3-235B U+2213 # MINUS-OR-PLUS SIGN [2000] + 3-235C U+2135 # ALEF SYMBOL [2000] + 3-235D U+210F # PLANCK CONSTANT OVER TWO PI [2000] + 3-235E U+33CB # SQUARE HP [2000] + 3-235F U+2113 # SCRIPT SMALL L [2000] + 3-2360 U+2127 # INVERTED OHM SIGN [2000] +-3-2361 U+0061 # LATIN SMALL LETTER A Fullwidth: U+FF41 +-3-2362 U+0062 # LATIN SMALL LETTER B Fullwidth: U+FF42 +-3-2363 U+0063 # LATIN SMALL LETTER C Fullwidth: U+FF43 +-3-2364 U+0064 # LATIN SMALL LETTER D Fullwidth: U+FF44 +-3-2365 U+0065 # LATIN SMALL LETTER E Fullwidth: U+FF45 +-3-2366 U+0066 # LATIN SMALL LETTER F Fullwidth: U+FF46 +-3-2367 U+0067 # LATIN SMALL LETTER G Fullwidth: U+FF47 +-3-2368 U+0068 # LATIN SMALL LETTER H Fullwidth: U+FF48 +-3-2369 U+0069 # LATIN SMALL LETTER I Fullwidth: U+FF49 +-3-236A U+006A # LATIN SMALL LETTER J Fullwidth: U+FF4A +-3-236B U+006B # LATIN SMALL LETTER K Fullwidth: U+FF4B +-3-236C U+006C # LATIN SMALL LETTER L Fullwidth: U+FF4C +-3-236D U+006D # LATIN SMALL LETTER M Fullwidth: U+FF4D +-3-236E U+006E # LATIN SMALL LETTER N Fullwidth: U+FF4E +-3-236F U+006F # LATIN SMALL LETTER O Fullwidth: U+FF4F +-3-2370 U+0070 # LATIN SMALL LETTER P Fullwidth: U+FF50 +-3-2371 U+0071 # LATIN SMALL LETTER Q Fullwidth: U+FF51 +-3-2372 U+0072 # LATIN SMALL LETTER R Fullwidth: U+FF52 +-3-2373 U+0073 # LATIN SMALL LETTER S Fullwidth: U+FF53 +-3-2374 U+0074 # LATIN SMALL LETTER T Fullwidth: U+FF54 +-3-2375 U+0075 # LATIN SMALL LETTER U Fullwidth: U+FF55 +-3-2376 U+0076 # LATIN SMALL LETTER V Fullwidth: U+FF56 +-3-2377 U+0077 # LATIN SMALL LETTER W Fullwidth: U+FF57 +-3-2378 U+0078 # LATIN SMALL LETTER X Fullwidth: U+FF58 +-3-2379 U+0079 # LATIN SMALL LETTER Y Fullwidth: U+FF59 +-3-237A U+007A # LATIN SMALL LETTER Z Fullwidth: U+FF5A ++3-2361 U+FF41 # LATIN SMALL LETTER A Fullwidth: U+FF41 ++3-2362 U+FF42 # LATIN SMALL LETTER B Fullwidth: U+FF42 ++3-2363 U+FF43 # LATIN SMALL LETTER C Fullwidth: U+FF43 ++3-2364 U+FF44 # LATIN SMALL LETTER D Fullwidth: U+FF44 ++3-2365 U+FF45 # LATIN SMALL LETTER E Fullwidth: U+FF45 ++3-2366 U+FF46 # LATIN SMALL LETTER F Fullwidth: U+FF46 ++3-2367 U+FF47 # LATIN SMALL LETTER G Fullwidth: U+FF47 ++3-2368 U+FF48 # LATIN SMALL LETTER H Fullwidth: U+FF48 ++3-2369 U+FF49 # LATIN SMALL LETTER I Fullwidth: U+FF49 ++3-236A U+FF4A # LATIN SMALL LETTER J Fullwidth: U+FF4A ++3-236B U+FF4B # LATIN SMALL LETTER K Fullwidth: U+FF4B ++3-236C U+FF4C # LATIN SMALL LETTER L Fullwidth: U+FF4C ++3-236D U+FF4D # LATIN SMALL LETTER M Fullwidth: U+FF4D ++3-236E U+FF4E # LATIN SMALL LETTER N Fullwidth: U+FF4E ++3-236F U+FF4F # LATIN SMALL LETTER O Fullwidth: U+FF4F ++3-2370 U+FF50 # LATIN SMALL LETTER P Fullwidth: U+FF50 ++3-2371 U+FF51 # LATIN SMALL LETTER Q Fullwidth: U+FF51 ++3-2372 U+FF52 # LATIN SMALL LETTER R Fullwidth: U+FF52 ++3-2373 U+FF53 # LATIN SMALL LETTER S Fullwidth: U+FF53 ++3-2374 U+FF54 # LATIN SMALL LETTER T Fullwidth: U+FF54 ++3-2375 U+FF55 # LATIN SMALL LETTER U Fullwidth: U+FF55 ++3-2376 U+FF56 # LATIN SMALL LETTER V Fullwidth: U+FF56 ++3-2377 U+FF57 # LATIN SMALL LETTER W Fullwidth: U+FF57 ++3-2378 U+FF58 # LATIN SMALL LETTER X Fullwidth: U+FF58 ++3-2379 U+FF59 # LATIN SMALL LETTER Y Fullwidth: U+FF59 ++3-237A U+FF5A # LATIN SMALL LETTER Z Fullwidth: U+FF5A + 3-237B U+30A0 # KATAKANA-HIRAGANA DOUBLE HYPHEN [2000] [Unicode3.2] + 3-237C U+2013 # EN DASH [2000] + 3-237D U+29FA # DOUBLE PLUS [2000] [Unicode3.2] +@@ -1242,7 +1242,7 @@ + 3-2D7C # Windows: U+222A + 3-2D7D U+2756 # BLACK DIAMOND MINUS WHITE X [2000] + 3-2D7E U+261E # WHITE RIGHT POINTING INDEX [2000] +-3-2E21 # ++3-2E21 U+4FF1 # [2004] + 3-2E22 U+2000B # [2000] [Unicode3.1] Private: U+F780 + 3-2E23 U+3402 # [2000] + 3-2E24 U+4E28 # [2000] +@@ -1429,7 +1429,7 @@ + 3-2F7B U+218BD # [2000] [Unicode3.1] Private: U+F78F + 3-2F7C U+5B19 # [2000] + 3-2F7D U+5B25 # [2000] +-3-2F7E # ++3-2F7E U+525D # [2004] + 3-3021 U+4E9C # + 3-3022 U+5516 # + 3-3023 U+5A03 # +@@ -4395,7 +4395,7 @@ + 3-4F51 U+6E7E # + 3-4F52 U+7897 # + 3-4F53 U+8155 # +-3-4F54 # ++3-4F54 U+20B9F # [2004] + 3-4F55 U+5B41 # [2000] + 3-4F56 U+5B56 # [2000] + 3-4F57 U+5B7D # [2000] +@@ -4437,7 +4437,7 @@ + 3-4F7B U+5DA7 # [2000] + 3-4F7C U+5DB8 # [2000] + 3-4F7D U+5DCB # [2000] +-3-4F7E # ++3-4F7E U+541E # [2004] + 3-5021 U+5F0C # + 3-5022 U+4E10 # + 3-5023 U+4E15 # +@@ -7828,7 +7828,7 @@ + 3-7424 U+7464 # [1983] + 3-7425 U+51DC # [1990] + 3-7426 U+7199 # [1990] +-3-7427 # ++3-7427 U+5653 # [2004] + 3-7428 U+5DE2 # [2000] + 3-7429 U+5E14 # [2000] + 3-742A U+5E18 # [2000] +@@ -8851,11 +8851,11 @@ + 3-7E77 U+9F94 # [2000] + 3-7E78 U+9F97 # [2000] + 3-7E79 U+9FA2 # [2000] +-3-7E7A # +-3-7E7B # +-3-7E7C # +-3-7E7D # +-3-7E7E # ++3-7E7A U+59F8 # [2004] ++3-7E7B U+5C5B # [2004] ++3-7E7C U+5E77 # [2004] ++3-7E7D U+7626 # [2004] ++3-7E7E U+7E6B # [2004] + 4-2121 U+20089 # [2000] [Unicode3.1] Private: U+F7D1 + 4-2122 U+4E02 # [2000] + 4-2123 U+4E0F # [2000] +@@ -11138,7 +11138,7 @@ + 4-7D38 U+9B10 # [2000] + 4-7D39 U+9B12 # [2000] + 4-7D3A U+9B16 # [2000] +-4-7D3B U+9B1D # [2000] ++4-7D3B U+9B1C # [2000] + 4-7D3C U+9B2B # [2000] + 4-7D3D U+9B33 # [2000] + 4-7D3E U+9B3D # [2000] diff --git a/Tools/unicode/python-mappings/gb-18030-2000.xml b/Tools/unicode/python-mappings/gb-18030-2000.xml new file mode 100644 index 0000000000000..ef86d83e87456 --- /dev/null +++ b/Tools/unicode/python-mappings/gb-18030-2000.xml @@ -0,0 +1,30917 @@ + + + + + + 0x80 appears to be a valid (and unassigned) single-byte code, added to the validity. + + + New mapping data, changing all four-byte mappings to the BMP. + Removed mappings to single surrogates. + + + Original table. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tools/unicode/python-mappings/jisx0213-2004-std.txt b/Tools/unicode/python-mappings/jisx0213-2004-std.txt new file mode 100644 index 0000000000000..a302fa19ff9bd --- /dev/null +++ b/Tools/unicode/python-mappings/jisx0213-2004-std.txt @@ -0,0 +1,11294 @@ +## JIS X 0213:2004 vs Unicode mapping table +## +## Date: 7 Jul 2004 13:09:49 GMT +## License: +## Copyright (C) 2001 earthian at tama.or.jp, All Rights Reserved. +## Copyright (C) 2001 I'O, All Rights Reserved. +## You can use, modify, distribute this table freely. +## Note: +## 3-XXXX JIS X 0213:2000 plane 1 (GL encoding) +## 4-XXXX JIS X 0213:2000 plane 2 (GL encoding) +## [1983] JIS codepoint defined by JIS X 0208-1983 +## [1990] JIS codepoint defined by JIS X 0208-1990 +## [2000] JIS codepoint defined by JIS X 0213:2000 +## [Unicode3.1] UCS codepoint defined by Unicode 3.1 +## [Unicode3.2] UCS codepoint defined by Unicode 3.2 +## Fullwidth UCS fullwidth form (U+Fxxx) +## Windows Windows (CP932) mapping +## Private UCS private area mapping +## Some 0213 character can't represent by one UCS character. +## In this table, such characters are described as 'U+xxxx+xxxx'. +## +## JIS Unicode Name Note +3-2121 U+3000 # IDEOGRAPHIC SPACE +3-2122 U+3001 # IDEOGRAPHIC COMMA +3-2123 U+3002 # IDEOGRAPHIC FULL STOP +3-2124 U+FF0C # COMMA Fullwidth: U+FF0C +3-2125 U+FF0E # FULL STOP Fullwidth: U+FF0E +3-2126 U+30FB # KATAKANA MIDDLE DOT +3-2127 U+FF1A # COLON Fullwidth: U+FF1A +3-2128 U+FF1B # SEMICOLON Fullwidth: U+FF1B +3-2129 U+FF1F # QUESTION MARK Fullwidth: U+FF1F +3-212A U+FF01 # EXCLAMATION MARK Fullwidth: U+FF01 +3-212B U+309B # KATAKANA-HIRAGANA VOICED SOUND MARK +3-212C U+309C # KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK +3-212D U+00B4 # ACUTE ACCENT +3-212E U+FF40 # GRAVE ACCENT Fullwidth: U+FF40 +3-212F U+00A8 # DIAERESIS +3-2130 U+FF3E # CIRCUMFLEX ACCENT Fullwidth: U+FF3E +3-2131 U+FFE3 # OVERLINE Windows: U+FFE3 +3-2132 U+FF3F # LOW LINE Fullwidth: U+FF3F +3-2133 U+30FD # KATAKANA ITERATION MARK +3-2134 U+30FE # KATAKANA VOICED ITERATION MARK +3-2135 U+309D # HIRAGANA ITERATION MARK +3-2136 U+309E # HIRAGANA VOICED ITERATION MARK +3-2137 U+3003 # DITTO MARK +3-2138 U+4EDD # +3-2139 U+3005 # IDEOGRAPHIC ITERATION MARK +3-213A U+3006 # IDEOGRAPHIC CLOSING MARK +3-213B U+3007 # IDEOGRAPHIC NUMBER ZERO +3-213C U+30FC # KATAKANA-HIRAGANA PROLONGED SOUND MARK +3-213D U+2015 # EM DASH Windows: U+2015 +3-213E U+2010 # HYPHEN +3-213F U+FF0F # SOLIDUS Fullwidth: U+FF0F +3-2140 U+005C # REVERSE SOLIDUS Fullwidth: U+FF3C +3-2141 U+301C # WAVE DASH Windows: U+FF5E +3-2142 U+2016 # DOUBLE VERTICAL LINE Windows: U+2225 +3-2143 U+FF5C # VERTICAL LINE Fullwidth: U+FF5C +3-2144 U+2026 # HORIZONTAL ELLIPSIS +3-2145 U+2025 # TWO DOT LEADER +3-2146 U+2018 # LEFT SINGLE QUOTATION MARK +3-2147 U+2019 # RIGHT SINGLE QUOTATION MARK +3-2148 U+201C # LEFT DOUBLE QUOTATION MARK +3-2149 U+201D # RIGHT DOUBLE QUOTATION MARK +3-214A U+FF08 # LEFT PARENTHESIS Fullwidth: U+FF08 +3-214B U+FF09 # RIGHT PARENTHESIS Fullwidth: U+FF09 +3-214C U+3014 # LEFT TORTOISE SHELL BRACKET +3-214D U+3015 # RIGHT TORTOISE SHELL BRACKET +3-214E U+FF3B # LEFT SQUARE BRACKET Fullwidth: U+FF3B +3-214F U+FF3D # RIGHT SQUARE BRACKET Fullwidth: U+FF3D +3-2150 U+FF5B # LEFT CURLY BRACKET Fullwidth: U+FF5B +3-2151 U+FF5D # RIGHT CURLY BRACKET Fullwidth: U+FF5D +3-2152 U+3008 # LEFT ANGLE BRACKET +3-2153 U+3009 # RIGHT ANGLE BRACKET +3-2154 U+300A # LEFT DOUBLE ANGLE BRACKET +3-2155 U+300B # RIGHT DOUBLE ANGLE BRACKET +3-2156 U+300C # LEFT CORNER BRACKET +3-2157 U+300D # RIGHT CORNER BRACKET +3-2158 U+300E # LEFT WHITE CORNER BRACKET +3-2159 U+300F # RIGHT WHITE CORNER BRACKET +3-215A U+3010 # LEFT BLACK LENTICULAR BRACKET +3-215B U+3011 # RIGHT BLACK LENTICULAR BRACKET +3-215C U+FF0B # PLUS SIGN Fullwidth: U+FF0B +3-215D U+2212 # MINUS SIGN Windows: U+FF0D +3-215E U+00B1 # PLUS-MINUS SIGN +3-215F U+00D7 # MULTIPLICATION SIGN +3-2160 U+00F7 # DIVISION SIGN +3-2161 U+FF1D # EQUALS SIGN Fullwidth: U+FF1D +3-2162 U+2260 # NOT EQUAL TO +3-2163 U+FF1C # LESS-THAN SIGN Fullwidth: U+FF1C +3-2164 U+FF1E # GREATER-THAN SIGN Fullwidth: U+FF1E +3-2165 U+2266 # LESS-THAN OVER EQUAL TO +3-2166 U+2267 # GREATER-THAN OVER EQUAL TO +3-2167 U+221E # INFINITY +3-2168 U+2234 # THEREFORE +3-2169 U+2642 # MALE SIGN +3-216A U+2640 # FEMALE SIGN +3-216B U+00B0 # DEGREE SIGN +3-216C U+2032 # PRIME +3-216D U+2033 # DOUBLE PRIME +3-216E U+2103 # DEGREE CELSIUS +3-216F U+FFE5 # YEN SIGN Windows: U+FFE5 +3-2170 U+FF04 # DOLLAR SIGN Fullwidth: U+FF04 +3-2171 U+00A2 # CENT SIGN Windows: U+FFE0 +3-2172 U+00A3 # POUND SIGN Windows: U+FFE1 +3-2173 U+FF05 # PERCENT SIGN Fullwidth: U+FF05 +3-2174 U+FF03 # NUMBER SIGN Fullwidth: U+FF03 +3-2175 U+FF06 # AMPERSAND Fullwidth: U+FF06 +3-2176 U+FF0A # ASTERISK Fullwidth: U+FF0A +3-2177 U+FF20 # COMMERCIAL AT Fullwidth: U+FF20 +3-2178 U+00A7 # SECTION SIGN +3-2179 U+2606 # WHITE STAR +3-217A U+2605 # BLACK STAR +3-217B U+25CB # WHITE CIRCLE +3-217C U+25CF # BLACK CIRCLE +3-217D U+25CE # BULLSEYE +3-217E U+25C7 # WHITE DIAMOND +3-2221 U+25C6 # BLACK DIAMOND +3-2222 U+25A1 # WHITE SQUARE +3-2223 U+25A0 # BLACK SQUARE +3-2224 U+25B3 # WHITE UP-POINTING TRIANGLE +3-2225 U+25B2 # BLACK UP-POINTING TRIANGLE +3-2226 U+25BD # WHITE DOWN-POINTING TRIANGLE +3-2227 U+25BC # BLACK DOWN-POINTING TRIANGLE +3-2228 U+203B # REFERENCE MARK +3-2229 U+3012 # POSTAL MARK +3-222A U+2192 # RIGHTWARDS ARROW +3-222B U+2190 # LEFTWARDS ARROW +3-222C U+2191 # UPWARDS ARROW +3-222D U+2193 # DOWNWARDS ARROW +3-222E U+3013 # GETA MARK +3-222F U+FF07 # APOSTROPHE Fullwidth: U+FF07 +3-2230 U+FF02 # QUOTATION MARK [2000] Fullwidth: U+FF02 +3-2231 U+FF0D # HYPHEN-MINUS [2000] Fullwidth: U+FF0D +3-2232 U+007E # TILDE [2000] Fullwidth: U+FF5E +3-2233 U+3033 # VERTICAL KANA REPEAT MARK UPPER HALF [2000] +3-2234 U+3034 # VERTICAL KANA REPEAT WITH VOICED SOUND MARK UPPER HALF [2000] +3-2235 U+3035 # VERTICAL KANA REPEAT MARK LOWER HALF [2000] +3-2236 U+303B # VERTICAL IDEOGRAPHIC ITERATION MARK [2000] [Unicode3.2] +3-2237 U+303C # MASU MARK [2000] [Unicode3.2] +3-2238 U+30FF # KATAKANA DIGRAPH KOTO [2000] [Unicode3.2] +3-2239 U+309F # HIRAGANA DIGRAPH YORI [2000] [Unicode3.2] +3-223A U+2208 # ELEMENT OF [1983] +3-223B U+220B # CONTAINS AS MEMBER [1983] +3-223C U+2286 # SUBSET OF OR EQUAL TO [1983] +3-223D U+2287 # SUPERSET OF OR EQUAL TO [1983] +3-223E U+2282 # SUBSET OF [1983] +3-223F U+2283 # SUPERSET OF [1983] +3-2240 U+222A # UNION [1983] +3-2241 U+2229 # INTERSECTION [1983] +3-2242 U+2284 # NOT A SUBSET OF [2000] +3-2243 U+2285 # NOT A SUPERSET OF [2000] +3-2244 U+228A # SUBSET OF WITH NOT EQUAL TO [2000] +3-2245 U+228B # SUPERSET OF WITH NOT EQUAL TO [2000] +3-2246 U+2209 # NOT AN ELEMENT OF [2000] +3-2247 U+2205 # EMPTY SET [2000] +3-2248 U+2305 # PROJECTIVE [2000] +3-2249 U+2306 # PERSPECTIVE [2000] +3-224A U+2227 # LOGICAL AND [1983] +3-224B U+2228 # LOGICAL OR [1983] +3-224C U+00AC # NOT SIGN [1983] Windows: U+FFE2 +3-224D U+21D2 # RIGHTWARDS DOUBLE ARROW [1983] +3-224E U+21D4 # LEFT RIGHT DOUBLE ARROW [1983] +3-224F U+2200 # FOR ALL [1983] +3-2250 U+2203 # THERE EXISTS [1983] +3-2251 U+2295 # CIRCLED PLUS [2000] +3-2252 U+2296 # CIRCLED MINUS [2000] +3-2253 U+2297 # CIRCLED TIMES [2000] +3-2254 U+2225 # PARALLEL TO [2000] +3-2255 U+2226 # NOT PARALLEL TO [2000] +3-2256 U+2985 # LEFT WHITE PARENTHESIS [2000] [Unicode3.2] +3-2257 U+2986 # RIGHT WHITE PARENTHESIS [2000] [Unicode3.2] +3-2258 U+3018 # LEFT WHITE TORTOISE SHELL BRACKET [2000] +3-2259 U+3019 # RIGHT WHITE TORTOISE SHELL BRACKET [2000] +3-225A U+3016 # LEFT WHITE LENTICULAR BRACKET [2000] +3-225B U+3017 # RIGHT WHITE LENTICULAR BRACKET [2000] +3-225C U+2220 # ANGLE [1983] +3-225D U+22A5 # UP TACK [1983] +3-225E U+2312 # ARC [1983] +3-225F U+2202 # PARTIAL DIFFERENTIAL [1983] +3-2260 U+2207 # NABLA [1983] +3-2261 U+2261 # IDENTICAL TO [1983] +3-2262 U+2252 # APPROXIMATELY EQUAL TO OR THE IMAGE OF [1983] +3-2263 U+226A # MUCH LESS-THAN [1983] +3-2264 U+226B # MUCH GREATER-THAN [1983] +3-2265 U+221A # SQUARE ROOT [1983] +3-2266 U+223D # REVERSED TILDE [1983] +3-2267 U+221D # PROPORTIONAL TO [1983] +3-2268 U+2235 # BECAUSE [1983] +3-2269 U+222B # INTEGRAL [1983] +3-226A U+222C # DOUBLE INTEGRAL [1983] +3-226B U+2262 # NOT IDENTICAL TO [2000] +3-226C U+2243 # ASYMPTOTICALLY EQUAL TO [2000] +3-226D U+2245 # APPROXIMATELY EQUAL TO [2000] +3-226E U+2248 # ALMOST EQUAL TO [2000] +3-226F U+2276 # LESS-THAN OR GREATER-THAN [2000] +3-2270 U+2277 # GREATER-THAN OR LESS-THAN [2000] +3-2271 U+2194 # LEFT RIGHT ARROW [2000] +3-2272 U+212B # ANGSTROM SIGN [1983] +3-2273 U+2030 # PER MILLE SIGN [1983] +3-2274 U+266F # MUSIC SHARP SIGN [1983] +3-2275 U+266D # MUSIC FLAT SIGN [1983] +3-2276 U+266A # EIGHTH NOTE [1983] +3-2277 U+2020 # DAGGER [1983] +3-2278 U+2021 # DOUBLE DAGGER [1983] +3-2279 U+00B6 # PILCROW SIGN [1983] +3-227A U+266E # MUSIC NATURAL SIGN [2000] +3-227B U+266B # BEAMED EIGHTH NOTES [2000] +3-227C U+266C # BEAMED SIXTEENTH NOTES [2000] +3-227D U+2669 # QUARTER NOTE [2000] +3-227E U+25EF # LARGE CIRCLE [1983] +3-2321 U+25B7 # WHITE RIGHT-POINTING TRIANGLE [2000] +3-2322 U+25B6 # BLACK RIGHT-POINTING TRIANGLE [2000] +3-2323 U+25C1 # WHITE LEFT-POINTING TRIANGLE [2000] +3-2324 U+25C0 # BLACK LEFT-POINTING TRIANGLE [2000] +3-2325 U+2197 # NORTH EAST ARROW [2000] +3-2326 U+2198 # SOUTH EAST ARROW [2000] +3-2327 U+2196 # NORTH WEST ARROW [2000] +3-2328 U+2199 # SOUTH WEST ARROW [2000] +3-2329 U+21C4 # RIGHTWARDS ARROW OVER LEFTWARDS ARROW [2000] +3-232A U+21E8 # RIGHTWARDS WHITE ARROW [2000] +3-232B U+21E6 # LEFTWARDS WHITE ARROW [2000] +3-232C U+21E7 # UPWARDS WHITE ARROW [2000] +3-232D U+21E9 # DOWNWARDS WHITE ARROW [2000] +3-232E U+2934 # ARROW POINTING RIGHTWARDS THEN CURVING UPWARDS [2000] [Unicode3.2] +3-232F U+2935 # ARROW POINTING RIGHTWARDS THEN CURVING DOWNWARDS [2000] [Unicode3.2] +3-2330 U+FF10 # DIGIT ZERO Fullwidth: U+FF10 +3-2331 U+FF11 # DIGIT ONE Fullwidth: U+FF11 +3-2332 U+FF12 # DIGIT TWO Fullwidth: U+FF12 +3-2333 U+FF13 # DIGIT THREE Fullwidth: U+FF13 +3-2334 U+FF14 # DIGIT FOUR Fullwidth: U+FF14 +3-2335 U+FF15 # DIGIT FIVE Fullwidth: U+FF15 +3-2336 U+FF16 # DIGIT SIX Fullwidth: U+FF16 +3-2337 U+FF17 # DIGIT SEVEN Fullwidth: U+FF17 +3-2338 U+FF18 # DIGIT EIGHT Fullwidth: U+FF18 +3-2339 U+FF19 # DIGIT NINE Fullwidth: U+FF19 +3-233A U+29BF # CIRCLED BULLET [2000] [Unicode3.2] +3-233B U+25C9 # FISHEYE [2000] +3-233C U+303D # PART ALTERNATION MARK [2000] [Unicode3.2] +3-233D U+FE46 # WHITE SESAME DOT [2000] [Unicode3.2] +3-233E U+FE45 # SESAME DOT [2000] [Unicode3.2] +3-233F U+25E6 # WHITE BULLET [2000] +3-2340 U+2022 # BULLET [2000] +3-2341 U+FF21 # LATIN CAPITAL LETTER A Fullwidth: U+FF21 +3-2342 U+FF22 # LATIN CAPITAL LETTER B Fullwidth: U+FF22 +3-2343 U+FF23 # LATIN CAPITAL LETTER C Fullwidth: U+FF23 +3-2344 U+FF24 # LATIN CAPITAL LETTER D Fullwidth: U+FF24 +3-2345 U+FF25 # LATIN CAPITAL LETTER E Fullwidth: U+FF25 +3-2346 U+FF26 # LATIN CAPITAL LETTER F Fullwidth: U+FF26 +3-2347 U+FF27 # LATIN CAPITAL LETTER G Fullwidth: U+FF27 +3-2348 U+FF28 # LATIN CAPITAL LETTER H Fullwidth: U+FF28 +3-2349 U+FF29 # LATIN CAPITAL LETTER I Fullwidth: U+FF29 +3-234A U+FF2A # LATIN CAPITAL LETTER J Fullwidth: U+FF2A +3-234B U+FF2B # LATIN CAPITAL LETTER K Fullwidth: U+FF2B +3-234C U+FF2C # LATIN CAPITAL LETTER L Fullwidth: U+FF2C +3-234D U+FF2D # LATIN CAPITAL LETTER M Fullwidth: U+FF2D +3-234E U+FF2E # LATIN CAPITAL LETTER N Fullwidth: U+FF2E +3-234F U+FF2F # LATIN CAPITAL LETTER O Fullwidth: U+FF2F +3-2350 U+FF30 # LATIN CAPITAL LETTER P Fullwidth: U+FF30 +3-2351 U+FF31 # LATIN CAPITAL LETTER Q Fullwidth: U+FF31 +3-2352 U+FF32 # LATIN CAPITAL LETTER R Fullwidth: U+FF32 +3-2353 U+FF33 # LATIN CAPITAL LETTER S Fullwidth: U+FF33 +3-2354 U+FF34 # LATIN CAPITAL LETTER T Fullwidth: U+FF34 +3-2355 U+FF35 # LATIN CAPITAL LETTER U Fullwidth: U+FF35 +3-2356 U+FF36 # LATIN CAPITAL LETTER V Fullwidth: U+FF36 +3-2357 U+FF37 # LATIN CAPITAL LETTER W Fullwidth: U+FF37 +3-2358 U+FF38 # LATIN CAPITAL LETTER X Fullwidth: U+FF38 +3-2359 U+FF39 # LATIN CAPITAL LETTER Y Fullwidth: U+FF39 +3-235A U+FF3A # LATIN CAPITAL LETTER Z Fullwidth: U+FF3A +3-235B U+2213 # MINUS-OR-PLUS SIGN [2000] +3-235C U+2135 # ALEF SYMBOL [2000] +3-235D U+210F # PLANCK CONSTANT OVER TWO PI [2000] +3-235E U+33CB # SQUARE HP [2000] +3-235F U+2113 # SCRIPT SMALL L [2000] +3-2360 U+2127 # INVERTED OHM SIGN [2000] +3-2361 U+FF41 # LATIN SMALL LETTER A Fullwidth: U+FF41 +3-2362 U+FF42 # LATIN SMALL LETTER B Fullwidth: U+FF42 +3-2363 U+FF43 # LATIN SMALL LETTER C Fullwidth: U+FF43 +3-2364 U+FF44 # LATIN SMALL LETTER D Fullwidth: U+FF44 +3-2365 U+FF45 # LATIN SMALL LETTER E Fullwidth: U+FF45 +3-2366 U+FF46 # LATIN SMALL LETTER F Fullwidth: U+FF46 +3-2367 U+FF47 # LATIN SMALL LETTER G Fullwidth: U+FF47 +3-2368 U+FF48 # LATIN SMALL LETTER H Fullwidth: U+FF48 +3-2369 U+FF49 # LATIN SMALL LETTER I Fullwidth: U+FF49 +3-236A U+FF4A # LATIN SMALL LETTER J Fullwidth: U+FF4A +3-236B U+FF4B # LATIN SMALL LETTER K Fullwidth: U+FF4B +3-236C U+FF4C # LATIN SMALL LETTER L Fullwidth: U+FF4C +3-236D U+FF4D # LATIN SMALL LETTER M Fullwidth: U+FF4D +3-236E U+FF4E # LATIN SMALL LETTER N Fullwidth: U+FF4E +3-236F U+FF4F # LATIN SMALL LETTER O Fullwidth: U+FF4F +3-2370 U+FF50 # LATIN SMALL LETTER P Fullwidth: U+FF50 +3-2371 U+FF51 # LATIN SMALL LETTER Q Fullwidth: U+FF51 +3-2372 U+FF52 # LATIN SMALL LETTER R Fullwidth: U+FF52 +3-2373 U+FF53 # LATIN SMALL LETTER S Fullwidth: U+FF53 +3-2374 U+FF54 # LATIN SMALL LETTER T Fullwidth: U+FF54 +3-2375 U+FF55 # LATIN SMALL LETTER U Fullwidth: U+FF55 +3-2376 U+FF56 # LATIN SMALL LETTER V Fullwidth: U+FF56 +3-2377 U+FF57 # LATIN SMALL LETTER W Fullwidth: U+FF57 +3-2378 U+FF58 # LATIN SMALL LETTER X Fullwidth: U+FF58 +3-2379 U+FF59 # LATIN SMALL LETTER Y Fullwidth: U+FF59 +3-237A U+FF5A # LATIN SMALL LETTER Z Fullwidth: U+FF5A +3-237B U+30A0 # KATAKANA-HIRAGANA DOUBLE HYPHEN [2000] [Unicode3.2] +3-237C U+2013 # EN DASH [2000] +3-237D U+29FA # DOUBLE PLUS [2000] [Unicode3.2] +3-237E U+29FB # TRIPLE PLUS [2000] [Unicode3.2] +3-2421 U+3041 # HIRAGANA LETTER SMALL A +3-2422 U+3042 # HIRAGANA LETTER A +3-2423 U+3043 # HIRAGANA LETTER SMALL I +3-2424 U+3044 # HIRAGANA LETTER I +3-2425 U+3045 # HIRAGANA LETTER SMALL U +3-2426 U+3046 # HIRAGANA LETTER U +3-2427 U+3047 # HIRAGANA LETTER SMALL E +3-2428 U+3048 # HIRAGANA LETTER E +3-2429 U+3049 # HIRAGANA LETTER SMALL O +3-242A U+304A # HIRAGANA LETTER O +3-242B U+304B # HIRAGANA LETTER KA +3-242C U+304C # HIRAGANA LETTER GA +3-242D U+304D # HIRAGANA LETTER KI +3-242E U+304E # HIRAGANA LETTER GI +3-242F U+304F # HIRAGANA LETTER KU +3-2430 U+3050 # HIRAGANA LETTER GU +3-2431 U+3051 # HIRAGANA LETTER KE +3-2432 U+3052 # HIRAGANA LETTER GE +3-2433 U+3053 # HIRAGANA LETTER KO +3-2434 U+3054 # HIRAGANA LETTER GO +3-2435 U+3055 # HIRAGANA LETTER SA +3-2436 U+3056 # HIRAGANA LETTER ZA +3-2437 U+3057 # HIRAGANA LETTER SI +3-2438 U+3058 # HIRAGANA LETTER ZI +3-2439 U+3059 # HIRAGANA LETTER SU +3-243A U+305A # HIRAGANA LETTER ZU +3-243B U+305B # HIRAGANA LETTER SE +3-243C U+305C # HIRAGANA LETTER ZE +3-243D U+305D # HIRAGANA LETTER SO +3-243E U+305E # HIRAGANA LETTER ZO +3-243F U+305F # HIRAGANA LETTER TA +3-2440 U+3060 # HIRAGANA LETTER DA +3-2441 U+3061 # HIRAGANA LETTER TI +3-2442 U+3062 # HIRAGANA LETTER DI +3-2443 U+3063 # HIRAGANA LETTER SMALL TU +3-2444 U+3064 # HIRAGANA LETTER TU +3-2445 U+3065 # HIRAGANA LETTER DU +3-2446 U+3066 # HIRAGANA LETTER TE +3-2447 U+3067 # HIRAGANA LETTER DE +3-2448 U+3068 # HIRAGANA LETTER TO +3-2449 U+3069 # HIRAGANA LETTER DO +3-244A U+306A # HIRAGANA LETTER NA +3-244B U+306B # HIRAGANA LETTER NI +3-244C U+306C # HIRAGANA LETTER NU +3-244D U+306D # HIRAGANA LETTER NE +3-244E U+306E # HIRAGANA LETTER NO +3-244F U+306F # HIRAGANA LETTER HA +3-2450 U+3070 # HIRAGANA LETTER BA +3-2451 U+3071 # HIRAGANA LETTER PA +3-2452 U+3072 # HIRAGANA LETTER HI +3-2453 U+3073 # HIRAGANA LETTER BI +3-2454 U+3074 # HIRAGANA LETTER PI +3-2455 U+3075 # HIRAGANA LETTER HU +3-2456 U+3076 # HIRAGANA LETTER BU +3-2457 U+3077 # HIRAGANA LETTER PU +3-2458 U+3078 # HIRAGANA LETTER HE +3-2459 U+3079 # HIRAGANA LETTER BE +3-245A U+307A # HIRAGANA LETTER PE +3-245B U+307B # HIRAGANA LETTER HO +3-245C U+307C # HIRAGANA LETTER BO +3-245D U+307D # HIRAGANA LETTER PO +3-245E U+307E # HIRAGANA LETTER MA +3-245F U+307F # HIRAGANA LETTER MI +3-2460 U+3080 # HIRAGANA LETTER MU +3-2461 U+3081 # HIRAGANA LETTER ME +3-2462 U+3082 # HIRAGANA LETTER MO +3-2463 U+3083 # HIRAGANA LETTER SMALL YA +3-2464 U+3084 # HIRAGANA LETTER YA +3-2465 U+3085 # HIRAGANA LETTER SMALL YU +3-2466 U+3086 # HIRAGANA LETTER YU +3-2467 U+3087 # HIRAGANA LETTER SMALL YO +3-2468 U+3088 # HIRAGANA LETTER YO +3-2469 U+3089 # HIRAGANA LETTER RA +3-246A U+308A # HIRAGANA LETTER RI +3-246B U+308B # HIRAGANA LETTER RU +3-246C U+308C # HIRAGANA LETTER RE +3-246D U+308D # HIRAGANA LETTER RO +3-246E U+308E # HIRAGANA LETTER SMALL WA +3-246F U+308F # HIRAGANA LETTER WA +3-2470 U+3090 # HIRAGANA LETTER WI +3-2471 U+3091 # HIRAGANA LETTER WE +3-2472 U+3092 # HIRAGANA LETTER WO +3-2473 U+3093 # HIRAGANA LETTER N +3-2474 U+3094 # HIRAGANA LETTER VU [2000] +3-2475 U+3095 # HIRAGANA LETTER SMALL KA [2000] [Unicode3.2] +3-2476 U+3096 # HIRAGANA LETTER SMALL KE [2000] [Unicode3.2] +3-2477 U+304B+309A # [2000] Private: U+F711 +3-2478 U+304D+309A # [2000] Private: U+F712 +3-2479 U+304F+309A # [2000] Private: U+F713 +3-247A U+3051+309A # [2000] Private: U+F714 +3-247B U+3053+309A # [2000] Private: U+F715 +3-247C # +3-247D # +3-247E # +3-2521 U+30A1 # KATAKANA LETTER SMALL A +3-2522 U+30A2 # KATAKANA LETTER A +3-2523 U+30A3 # KATAKANA LETTER SMALL I +3-2524 U+30A4 # KATAKANA LETTER I +3-2525 U+30A5 # KATAKANA LETTER SMALL U +3-2526 U+30A6 # KATAKANA LETTER U +3-2527 U+30A7 # KATAKANA LETTER SMALL E +3-2528 U+30A8 # KATAKANA LETTER E +3-2529 U+30A9 # KATAKANA LETTER SMALL O +3-252A U+30AA # KATAKANA LETTER O +3-252B U+30AB # KATAKANA LETTER KA +3-252C U+30AC # KATAKANA LETTER GA +3-252D U+30AD # KATAKANA LETTER KI +3-252E U+30AE # KATAKANA LETTER GI +3-252F U+30AF # KATAKANA LETTER KU +3-2530 U+30B0 # KATAKANA LETTER GU +3-2531 U+30B1 # KATAKANA LETTER KE +3-2532 U+30B2 # KATAKANA LETTER GE +3-2533 U+30B3 # KATAKANA LETTER KO +3-2534 U+30B4 # KATAKANA LETTER GO +3-2535 U+30B5 # KATAKANA LETTER SA +3-2536 U+30B6 # KATAKANA LETTER ZA +3-2537 U+30B7 # KATAKANA LETTER SI +3-2538 U+30B8 # KATAKANA LETTER ZI +3-2539 U+30B9 # KATAKANA LETTER SU +3-253A U+30BA # KATAKANA LETTER ZU +3-253B U+30BB # KATAKANA LETTER SE +3-253C U+30BC # KATAKANA LETTER ZE +3-253D U+30BD # KATAKANA LETTER SO +3-253E U+30BE # KATAKANA LETTER ZO +3-253F U+30BF # KATAKANA LETTER TA +3-2540 U+30C0 # KATAKANA LETTER DA +3-2541 U+30C1 # KATAKANA LETTER TI +3-2542 U+30C2 # KATAKANA LETTER DI +3-2543 U+30C3 # KATAKANA LETTER SMALL TU +3-2544 U+30C4 # KATAKANA LETTER TU +3-2545 U+30C5 # KATAKANA LETTER DU +3-2546 U+30C6 # KATAKANA LETTER TE +3-2547 U+30C7 # KATAKANA LETTER DE +3-2548 U+30C8 # KATAKANA LETTER TO +3-2549 U+30C9 # KATAKANA LETTER DO +3-254A U+30CA # KATAKANA LETTER NA +3-254B U+30CB # KATAKANA LETTER NI +3-254C U+30CC # KATAKANA LETTER NU +3-254D U+30CD # KATAKANA LETTER NE +3-254E U+30CE # KATAKANA LETTER NO +3-254F U+30CF # KATAKANA LETTER HA +3-2550 U+30D0 # KATAKANA LETTER BA +3-2551 U+30D1 # KATAKANA LETTER PA +3-2552 U+30D2 # KATAKANA LETTER HI +3-2553 U+30D3 # KATAKANA LETTER BI +3-2554 U+30D4 # KATAKANA LETTER PI +3-2555 U+30D5 # KATAKANA LETTER HU +3-2556 U+30D6 # KATAKANA LETTER BU +3-2557 U+30D7 # KATAKANA LETTER PU +3-2558 U+30D8 # KATAKANA LETTER HE +3-2559 U+30D9 # KATAKANA LETTER BE +3-255A U+30DA # KATAKANA LETTER PE +3-255B U+30DB # KATAKANA LETTER HO +3-255C U+30DC # KATAKANA LETTER BO +3-255D U+30DD # KATAKANA LETTER PO +3-255E U+30DE # KATAKANA LETTER MA +3-255F U+30DF # KATAKANA LETTER MI +3-2560 U+30E0 # KATAKANA LETTER MU +3-2561 U+30E1 # KATAKANA LETTER ME +3-2562 U+30E2 # KATAKANA LETTER MO +3-2563 U+30E3 # KATAKANA LETTER SMALL YA +3-2564 U+30E4 # KATAKANA LETTER YA +3-2565 U+30E5 # KATAKANA LETTER SMALL YU +3-2566 U+30E6 # KATAKANA LETTER YU +3-2567 U+30E7 # KATAKANA LETTER SMALL YO +3-2568 U+30E8 # KATAKANA LETTER YO +3-2569 U+30E9 # KATAKANA LETTER RA +3-256A U+30EA # KATAKANA LETTER RI +3-256B U+30EB # KATAKANA LETTER RU +3-256C U+30EC # KATAKANA LETTER RE +3-256D U+30ED # KATAKANA LETTER RO +3-256E U+30EE # KATAKANA LETTER SMALL WA +3-256F U+30EF # KATAKANA LETTER WA +3-2570 U+30F0 # KATAKANA LETTER WI +3-2571 U+30F1 # KATAKANA LETTER WE +3-2572 U+30F2 # KATAKANA LETTER WO +3-2573 U+30F3 # KATAKANA LETTER N +3-2574 U+30F4 # KATAKANA LETTER VU +3-2575 U+30F5 # KATAKANA LETTER SMALL KA +3-2576 U+30F6 # KATAKANA LETTER SMALL KE +3-2577 U+30AB+309A # [2000] Private: U+F716 +3-2578 U+30AD+309A # [2000] Private: U+F717 +3-2579 U+30AF+309A # [2000] Private: U+F718 +3-257A U+30B1+309A # [2000] Private: U+F719 +3-257B U+30B3+309A # [2000] Private: U+F71A +3-257C U+30BB+309A # [2000] Private: U+F71B +3-257D U+30C4+309A # [2000] Private: U+F71C +3-257E U+30C8+309A # [2000] Private: U+F71D +3-2621 U+0391 # GREEK CAPITAL LETTER ALPHA +3-2622 U+0392 # GREEK CAPITAL LETTER BETA +3-2623 U+0393 # GREEK CAPITAL LETTER GAMMA +3-2624 U+0394 # GREEK CAPITAL LETTER DELTA +3-2625 U+0395 # GREEK CAPITAL LETTER EPSILON +3-2626 U+0396 # GREEK CAPITAL LETTER ZETA +3-2627 U+0397 # GREEK CAPITAL LETTER ETA +3-2628 U+0398 # GREEK CAPITAL LETTER THETA +3-2629 U+0399 # GREEK CAPITAL LETTER IOTA +3-262A U+039A # GREEK CAPITAL LETTER KAPPA +3-262B U+039B # GREEK CAPITAL LETTER LAMDA +3-262C U+039C # GREEK CAPITAL LETTER MU +3-262D U+039D # GREEK CAPITAL LETTER NU +3-262E U+039E # GREEK CAPITAL LETTER XI +3-262F U+039F # GREEK CAPITAL LETTER OMICRON +3-2630 U+03A0 # GREEK CAPITAL LETTER PI +3-2631 U+03A1 # GREEK CAPITAL LETTER RHO +3-2632 U+03A3 # GREEK CAPITAL LETTER SIGMA +3-2633 U+03A4 # GREEK CAPITAL LETTER TAU +3-2634 U+03A5 # GREEK CAPITAL LETTER UPSILON +3-2635 U+03A6 # GREEK CAPITAL LETTER PHI +3-2636 U+03A7 # GREEK CAPITAL LETTER CHI +3-2637 U+03A8 # GREEK CAPITAL LETTER PSI +3-2638 U+03A9 # GREEK CAPITAL LETTER OMEGA +3-2639 U+2664 # WHITE SPADE SUIT [2000] +3-263A U+2660 # BLACK SPADE SUIT [2000] +3-263B U+2662 # WHITE DIAMOND SUIT [2000] +3-263C U+2666 # BLACK DIAMOND SUIT [2000] +3-263D U+2661 # WHITE HEART SUIT [2000] +3-263E U+2665 # BLACK HEART SUIT [2000] +3-263F U+2667 # WHITE CLUB SUIT [2000] +3-2640 U+2663 # BLACK CLUB SUIT [2000] +3-2641 U+03B1 # GREEK SMALL LETTER ALPHA +3-2642 U+03B2 # GREEK SMALL LETTER BETA +3-2643 U+03B3 # GREEK SMALL LETTER GAMMA +3-2644 U+03B4 # GREEK SMALL LETTER DELTA +3-2645 U+03B5 # GREEK SMALL LETTER EPSILON +3-2646 U+03B6 # GREEK SMALL LETTER ZETA +3-2647 U+03B7 # GREEK SMALL LETTER ETA +3-2648 U+03B8 # GREEK SMALL LETTER THETA +3-2649 U+03B9 # GREEK SMALL LETTER IOTA +3-264A U+03BA # GREEK SMALL LETTER KAPPA +3-264B U+03BB # GREEK SMALL LETTER LAMDA +3-264C U+03BC # GREEK SMALL LETTER MU +3-264D U+03BD # GREEK SMALL LETTER NU +3-264E U+03BE # GREEK SMALL LETTER XI +3-264F U+03BF # GREEK SMALL LETTER OMICRON +3-2650 U+03C0 # GREEK SMALL LETTER PI +3-2651 U+03C1 # GREEK SMALL LETTER RHO +3-2652 U+03C3 # GREEK SMALL LETTER SIGMA +3-2653 U+03C4 # GREEK SMALL LETTER TAU +3-2654 U+03C5 # GREEK SMALL LETTER UPSILON +3-2655 U+03C6 # GREEK SMALL LETTER PHI +3-2656 U+03C7 # GREEK SMALL LETTER CHI +3-2657 U+03C8 # GREEK SMALL LETTER PSI +3-2658 U+03C9 # GREEK SMALL LETTER OMEGA +3-2659 U+03C2 # GREEK SMALL LETTER FINAL SIGMA [2000] +3-265A U+24F5 # DOUBLE CIRCLED DIGIT ONE [2000] [Unicode3.2] +3-265B U+24F6 # DOUBLE CIRCLED DIGIT TWO [2000] [Unicode3.2] +3-265C U+24F7 # DOUBLE CIRCLED DIGIT THREE [2000] [Unicode3.2] +3-265D U+24F8 # DOUBLE CIRCLED DIGIT FOUR [2000] [Unicode3.2] +3-265E U+24F9 # DOUBLE CIRCLED DIGIT FIVE [2000] [Unicode3.2] +3-265F U+24FA # DOUBLE CIRCLED DIGIT SIX [2000] [Unicode3.2] +3-2660 U+24FB # DOUBLE CIRCLED DIGIT SEVEN [2000] [Unicode3.2] +3-2661 U+24FC # DOUBLE CIRCLED DIGIT EIGHT [2000] [Unicode3.2] +3-2662 U+24FD # DOUBLE CIRCLED DIGIT NINE [2000] [Unicode3.2] +3-2663 U+24FE # DOUBLE CIRCLED NUMBER TEN [2000] [Unicode3.2] +3-2664 U+2616 # WHITE SHOGI PIECE [2000] [Unicode3.2] +3-2665 U+2617 # BLACK SHOGI PIECE [2000] [Unicode3.2] +3-2666 U+3020 # POSTAL MARK FACE [2000] +3-2667 U+260E # BLACK TELEPHONE [2000] +3-2668 U+2600 # BLACK SUN WITH RAYS [2000] +3-2669 U+2601 # CLOUD [2000] +3-266A U+2602 # UMBRELLA [2000] +3-266B U+2603 # SNOWMAN [2000] +3-266C U+2668 # HOT SPRINGS [2000] +3-266D U+25B1 # WHITE PARALLELOGRAM [2000] +3-266E U+31F0 # KATAKANA LETTER SMALL KU [2000] [Unicode3.2] +3-266F U+31F1 # KATAKANA LETTER SMALL SI [2000] [Unicode3.2] +3-2670 U+31F2 # KATAKANA LETTER SMALL SU [2000] [Unicode3.2] +3-2671 U+31F3 # KATAKANA LETTER SMALL TO [2000] [Unicode3.2] +3-2672 U+31F4 # KATAKANA LETTER SMALL NU [2000] [Unicode3.2] +3-2673 U+31F5 # KATAKANA LETTER SMALL HA [2000] [Unicode3.2] +3-2674 U+31F6 # KATAKANA LETTER SMALL HI [2000] [Unicode3.2] +3-2675 U+31F7 # KATAKANA LETTER SMALL HU [2000] [Unicode3.2] +3-2676 U+31F8 # KATAKANA LETTER SMALL HE [2000] [Unicode3.2] +3-2677 U+31F9 # KATAKANA LETTER SMALL HO [2000] [Unicode3.2] +3-2678 U+31F7+309A # [2000] Private: U+F734 +3-2679 U+31FA # KATAKANA LETTER SMALL MU [2000] [Unicode3.2] +3-267A U+31FB # KATAKANA LETTER SMALL RA [2000] [Unicode3.2] +3-267B U+31FC # KATAKANA LETTER SMALL RI [2000] [Unicode3.2] +3-267C U+31FD # KATAKANA LETTER SMALL RU [2000] [Unicode3.2] +3-267D U+31FE # KATAKANA LETTER SMALL RE [2000] [Unicode3.2] +3-267E U+31FF # KATAKANA LETTER SMALL RO [2000] [Unicode3.2] +3-2721 U+0410 # CYRILLIC CAPITAL LETTER A +3-2722 U+0411 # CYRILLIC CAPITAL LETTER BE +3-2723 U+0412 # CYRILLIC CAPITAL LETTER VE +3-2724 U+0413 # CYRILLIC CAPITAL LETTER GHE +3-2725 U+0414 # CYRILLIC CAPITAL LETTER DE +3-2726 U+0415 # CYRILLIC CAPITAL LETTER IE +3-2727 U+0401 # CYRILLIC CAPITAL LETTER IO +3-2728 U+0416 # CYRILLIC CAPITAL LETTER ZHE +3-2729 U+0417 # CYRILLIC CAPITAL LETTER ZE +3-272A U+0418 # CYRILLIC CAPITAL LETTER I +3-272B U+0419 # CYRILLIC CAPITAL LETTER SHORT I +3-272C U+041A # CYRILLIC CAPITAL LETTER KA +3-272D U+041B # CYRILLIC CAPITAL LETTER EL +3-272E U+041C # CYRILLIC CAPITAL LETTER EM +3-272F U+041D # CYRILLIC CAPITAL LETTER EN +3-2730 U+041E # CYRILLIC CAPITAL LETTER O +3-2731 U+041F # CYRILLIC CAPITAL LETTER PE +3-2732 U+0420 # CYRILLIC CAPITAL LETTER ER +3-2733 U+0421 # CYRILLIC CAPITAL LETTER ES +3-2734 U+0422 # CYRILLIC CAPITAL LETTER TE +3-2735 U+0423 # CYRILLIC CAPITAL LETTER U +3-2736 U+0424 # CYRILLIC CAPITAL LETTER EF +3-2737 U+0425 # CYRILLIC CAPITAL LETTER HA +3-2738 U+0426 # CYRILLIC CAPITAL LETTER TSE +3-2739 U+0427 # CYRILLIC CAPITAL LETTER CHE +3-273A U+0428 # CYRILLIC CAPITAL LETTER SHA +3-273B U+0429 # CYRILLIC CAPITAL LETTER SHCHA +3-273C U+042A # CYRILLIC CAPITAL LETTER HARD SIGN +3-273D U+042B # CYRILLIC CAPITAL LETTER YERU +3-273E U+042C # CYRILLIC CAPITAL LETTER SOFT SIGN +3-273F U+042D # CYRILLIC CAPITAL LETTER E +3-2740 U+042E # CYRILLIC CAPITAL LETTER YU +3-2741 U+042F # CYRILLIC CAPITAL LETTER YA +3-2742 U+23BE # DENTISTRY SYMBOL LIGHT VERTICAL AND TOP RIGHT [2000] [Unicode3.2] +3-2743 U+23BF # DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM RIGHT [2000] [Unicode3.2] +3-2744 U+23C0 # DENTISTRY SYMBOL LIGHT VERTICAL WITH CIRCLE [2000] [Unicode3.2] +3-2745 U+23C1 # DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH CIRCLE [2000] [Unicode3.2] +3-2746 U+23C2 # DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH CIRCLE [2000] [Unicode3.2] +3-2747 U+23C3 # DENTISTRY SYMBOL LIGHT VERTICAL WITH TRIANGLE [2000] [Unicode3.2] +3-2748 U+23C4 # DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH TRIANGLE [2000] [Unicode3.2] +3-2749 U+23C5 # DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH TRIANGLE [2000] [Unicode3.2] +3-274A U+23C6 # DENTISTRY SYMBOL LIGHT VERTICAL AND WAVE [2000] [Unicode3.2] +3-274B U+23C7 # DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL WITH WAVE [2000] [Unicode3.2] +3-274C U+23C8 # DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL WITH WAVE [2000] [Unicode3.2] +3-274D U+23C9 # DENTISTRY SYMBOL LIGHT DOWN AND HORIZONTAL [2000] [Unicode3.2] +3-274E U+23CA # DENTISTRY SYMBOL LIGHT UP AND HORIZONTAL [2000] [Unicode3.2] +3-274F U+23CB # DENTISTRY SYMBOL LIGHT VERTICAL AND TOP LEFT [2000] [Unicode3.2] +3-2750 U+23CC # DENTISTRY SYMBOL LIGHT VERTICAL AND BOTTOM LEFT [2000] [Unicode3.2] +3-2751 U+0430 # CYRILLIC SMALL LETTER A +3-2752 U+0431 # CYRILLIC SMALL LETTER BE +3-2753 U+0432 # CYRILLIC SMALL LETTER VE +3-2754 U+0433 # CYRILLIC SMALL LETTER GHE +3-2755 U+0434 # CYRILLIC SMALL LETTER DE +3-2756 U+0435 # CYRILLIC SMALL LETTER IE +3-2757 U+0451 # CYRILLIC SMALL LETTER IO +3-2758 U+0436 # CYRILLIC SMALL LETTER ZHE +3-2759 U+0437 # CYRILLIC SMALL LETTER ZE +3-275A U+0438 # CYRILLIC SMALL LETTER I +3-275B U+0439 # CYRILLIC SMALL LETTER SHORT I +3-275C U+043A # CYRILLIC SMALL LETTER KA +3-275D U+043B # CYRILLIC SMALL LETTER EL +3-275E U+043C # CYRILLIC SMALL LETTER EM +3-275F U+043D # CYRILLIC SMALL LETTER EN +3-2760 U+043E # CYRILLIC SMALL LETTER O +3-2761 U+043F # CYRILLIC SMALL LETTER PE +3-2762 U+0440 # CYRILLIC SMALL LETTER ER +3-2763 U+0441 # CYRILLIC SMALL LETTER ES +3-2764 U+0442 # CYRILLIC SMALL LETTER TE +3-2765 U+0443 # CYRILLIC SMALL LETTER U +3-2766 U+0444 # CYRILLIC SMALL LETTER EF +3-2767 U+0445 # CYRILLIC SMALL LETTER HA +3-2768 U+0446 # CYRILLIC SMALL LETTER TSE +3-2769 U+0447 # CYRILLIC SMALL LETTER CHE +3-276A U+0448 # CYRILLIC SMALL LETTER SHA +3-276B U+0449 # CYRILLIC SMALL LETTER SHCHA +3-276C U+044A # CYRILLIC SMALL LETTER HARD SIGN +3-276D U+044B # CYRILLIC SMALL LETTER YERU +3-276E U+044C # CYRILLIC SMALL LETTER SOFT SIGN +3-276F U+044D # CYRILLIC SMALL LETTER E +3-2770 U+044E # CYRILLIC SMALL LETTER YU +3-2771 U+044F # CYRILLIC SMALL LETTER YA +3-2772 U+30F7 # KATAKANA LETTER VA [2000] +3-2773 U+30F8 # KATAKANA LETTER VI [2000] +3-2774 U+30F9 # KATAKANA LETTER VE [2000] +3-2775 U+30FA # KATAKANA LETTER VO [2000] +3-2776 U+22DA # LESS-THAN EQUAL TO OR GREATER-THAN [2000] +3-2777 U+22DB # GREATER-THAN EQUAL TO OR LESS-THAN [2000] +3-2778 U+2153 # VULGAR FRACTION ONE THIRD [2000] +3-2779 U+2154 # VULGAR FRACTION TWO THIRDS [2000] +3-277A U+2155 # VULGAR FRACTION ONE FIFTH [2000] +3-277B U+2713 # CHECK MARK [2000] +3-277C U+2318 # PLACE OF INTEREST SIGN [2000] +3-277D U+2423 # OPEN BOX [2000] +3-277E U+23CE # RETURN SYMBOL [2000] [Unicode3.2] +3-2821 U+2500 # BOX DRAWINGS LIGHT HORIZONTAL [1983] +3-2822 U+2502 # BOX DRAWINGS LIGHT VERTICAL [1983] +3-2823 U+250C # BOX DRAWINGS LIGHT DOWN AND RIGHT [1983] +3-2824 U+2510 # BOX DRAWINGS LIGHT DOWN AND LEFT [1983] +3-2825 U+2518 # BOX DRAWINGS LIGHT UP AND LEFT [1983] +3-2826 U+2514 # BOX DRAWINGS LIGHT UP AND RIGHT [1983] +3-2827 U+251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT [1983] +3-2828 U+252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL [1983] +3-2829 U+2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT [1983] +3-282A U+2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL [1983] +3-282B U+253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL [1983] +3-282C U+2501 # BOX DRAWINGS HEAVY HORIZONTAL [1983] +3-282D U+2503 # BOX DRAWINGS HEAVY VERTICAL [1983] +3-282E U+250F # BOX DRAWINGS HEAVY DOWN AND RIGHT [1983] +3-282F U+2513 # BOX DRAWINGS HEAVY DOWN AND LEFT [1983] +3-2830 U+251B # BOX DRAWINGS HEAVY UP AND LEFT [1983] +3-2831 U+2517 # BOX DRAWINGS HEAVY UP AND RIGHT [1983] +3-2832 U+2523 # BOX DRAWINGS HEAVY VERTICAL AND RIGHT [1983] +3-2833 U+2533 # BOX DRAWINGS HEAVY DOWN AND HORIZONTAL [1983] +3-2834 U+252B # BOX DRAWINGS HEAVY VERTICAL AND LEFT [1983] +3-2835 U+253B # BOX DRAWINGS HEAVY UP AND HORIZONTAL [1983] +3-2836 U+254B # BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL [1983] +3-2837 U+2520 # BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT [1983] +3-2838 U+252F # BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY [1983] +3-2839 U+2528 # BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT [1983] +3-283A U+2537 # BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY [1983] +3-283B U+253F # BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY [1983] +3-283C U+251D # BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY [1983] +3-283D U+2530 # BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT [1983] +3-283E U+2525 # BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY [1983] +3-283F U+2538 # BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT [1983] +3-2840 U+2542 # BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT [1983] +3-2841 U+3251 # CIRCLED NUMBER TWENTY ONE [2000] [Unicode3.2] +3-2842 U+3252 # CIRCLED NUMBER TWENTY TWO [2000] [Unicode3.2] +3-2843 U+3253 # CIRCLED NUMBER TWENTY THREE [2000] [Unicode3.2] +3-2844 U+3254 # CIRCLED NUMBER TWENTY FOUR [2000] [Unicode3.2] +3-2845 U+3255 # CIRCLED NUMBER TWENTY FIVE [2000] [Unicode3.2] +3-2846 U+3256 # CIRCLED NUMBER TWENTY SIX [2000] [Unicode3.2] +3-2847 U+3257 # CIRCLED NUMBER TWENTY SEVEN [2000] [Unicode3.2] +3-2848 U+3258 # CIRCLED NUMBER TWENTY EIGHT [2000] [Unicode3.2] +3-2849 U+3259 # CIRCLED NUMBER TWENTY NINE [2000] [Unicode3.2] +3-284A U+325A # CIRCLED NUMBER THIRTY [2000] [Unicode3.2] +3-284B U+325B # CIRCLED NUMBER THIRTY ONE [2000] [Unicode3.2] +3-284C U+325C # CIRCLED NUMBER THIRTY TWO [2000] [Unicode3.2] +3-284D U+325D # CIRCLED NUMBER THIRTY THREE [2000] [Unicode3.2] +3-284E U+325E # CIRCLED NUMBER THIRTY FOUR [2000] [Unicode3.2] +3-284F U+325F # CIRCLED NUMBER THIRTY FIVE [2000] [Unicode3.2] +3-2850 U+32B1 # CIRCLED NUMBER THIRTY SIX [2000] [Unicode3.2] +3-2851 U+32B2 # CIRCLED NUMBER THIRTY SEVEN [2000] [Unicode3.2] +3-2852 U+32B3 # CIRCLED NUMBER THIRTY EIGHT [2000] [Unicode3.2] +3-2853 U+32B4 # CIRCLED NUMBER THIRTY NINE [2000] [Unicode3.2] +3-2854 U+32B5 # CIRCLED NUMBER FORTY [2000] [Unicode3.2] +3-2855 U+32B6 # CIRCLED NUMBER FORTY ONE [2000] [Unicode3.2] +3-2856 U+32B7 # CIRCLED NUMBER FORTY TWO [2000] [Unicode3.2] +3-2857 U+32B8 # CIRCLED NUMBER FORTY THREE [2000] [Unicode3.2] +3-2858 U+32B9 # CIRCLED NUMBER FORTY FOUR [2000] [Unicode3.2] +3-2859 U+32BA # CIRCLED NUMBER FORTY FIVE [2000] [Unicode3.2] +3-285A U+32BB # CIRCLED NUMBER FORTY SIX [2000] [Unicode3.2] +3-285B U+32BC # CIRCLED NUMBER FORTY SEVEN [2000] [Unicode3.2] +3-285C U+32BD # CIRCLED NUMBER FORTY EIGHT [2000] [Unicode3.2] +3-285D U+32BE # CIRCLED NUMBER FORTY NINE [2000] [Unicode3.2] +3-285E U+32BF # CIRCLED NUMBER FIFTY [2000] [Unicode3.2] +3-285F # +3-2860 # +3-2861 # +3-2862 # +3-2863 # +3-2864 # +3-2865 # +3-2866 # +3-2867 U+25D0 # CIRCLE WITH LEFT HALF BLACK [2000] +3-2868 U+25D1 # CIRCLE WITH RIGHT HALF BLACK [2000] +3-2869 U+25D2 # CIRCLE WITH LOWER HALF BLACK [2000] +3-286A U+25D3 # CIRCLE WITH UPPER HALF BLACK [2000] +3-286B U+203C # DOUBLE EXCLAMATION MARK [2000] +3-286C U+2047 # DOUBLE QUESTION MARK [2000] [Unicode3.2] +3-286D U+2048 # QUESTION EXCLAMATION MARK [2000] +3-286E U+2049 # EXCLAMATION QUESTION MARK [2000] +3-286F U+01CD # LATIN CAPITAL LETTER A WITH CARON [2000] +3-2870 U+01CE # LATIN SMALL LETTER A WITH CARON [2000] +3-2871 U+01D0 # LATIN SMALL LETTER I WITH CARON [2000] +3-2872 U+1E3E # LATIN CAPITAL LETTER M WITH ACUTE [2000] +3-2873 U+1E3F # LATIN SMALL LETTER M WITH ACUTE [2000] +3-2874 U+01F8 # LATIN CAPITAL LETTER N WITH GRAVE [2000] +3-2875 U+01F9 # LATIN SMALL LETTER N WITH GRAVE [2000] +3-2876 U+01D1 # LATIN CAPITAL LETTER O WITH CARON [2000] +3-2877 U+01D2 # LATIN SMALL LETTER O WITH CARON [2000] +3-2878 U+01D4 # LATIN SMALL LETTER U WITH CARON [2000] +3-2879 U+01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON [2000] +3-287A U+01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE [2000] +3-287B U+01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON [2000] +3-287C U+01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE [2000] +3-287D # +3-287E # +3-2921 U+20AC # EURO SIGN [2000] +3-2922 U+00A0 # NO-BREAK SPACE [2000] +3-2923 U+00A1 # INVERTED EXCLAMATION MARK [2000] +3-2924 U+00A4 # CURRENCY SIGN [2000] +3-2925 U+00A6 # BROKEN BAR [2000] +3-2926 U+00A9 # COPYRIGHT SIGN [2000] +3-2927 U+00AA # FEMININE ORDINAL INDICATOR [2000] +3-2928 U+00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK [2000] +3-2929 U+00AD # SOFT HYPHEN [2000] +3-292A U+00AE # REGISTERED SIGN [2000] +3-292B U+00AF # MACRON [2000] +3-292C U+00B2 # SUPERSCRIPT TWO [2000] +3-292D U+00B3 # SUPERSCRIPT THREE [2000] +3-292E U+00B7 # MIDDLE DOT [2000] +3-292F U+00B8 # CEDILLA [2000] +3-2930 U+00B9 # SUPERSCRIPT ONE [2000] +3-2931 U+00BA # MASCULINE ORDINAL INDICATOR [2000] +3-2932 U+00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK [2000] +3-2933 U+00BC # VULGAR FRACTION ONE QUARTER [2000] +3-2934 U+00BD # VULGAR FRACTION ONE HALF [2000] +3-2935 U+00BE # VULGAR FRACTION THREE QUARTERS [2000] +3-2936 U+00BF # INVERTED QUESTION MARK [2000] +3-2937 U+00C0 # LATIN CAPITAL LETTER A WITH GRAVE [2000] +3-2938 U+00C1 # LATIN CAPITAL LETTER A WITH ACUTE [2000] +3-2939 U+00C2 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX [2000] +3-293A U+00C3 # LATIN CAPITAL LETTER A WITH TILDE [2000] +3-293B U+00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS [2000] +3-293C U+00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE [2000] +3-293D U+00C6 # LATIN CAPITAL LETTER AE [2000] +3-293E U+00C7 # LATIN CAPITAL LETTER C WITH CEDILLA [2000] +3-293F U+00C8 # LATIN CAPITAL LETTER E WITH GRAVE [2000] +3-2940 U+00C9 # LATIN CAPITAL LETTER E WITH ACUTE [2000] +3-2941 U+00CA # LATIN CAPITAL LETTER E WITH CIRCUMFLEX [2000] +3-2942 U+00CB # LATIN CAPITAL LETTER E WITH DIAERESIS [2000] +3-2943 U+00CC # LATIN CAPITAL LETTER I WITH GRAVE [2000] +3-2944 U+00CD # LATIN CAPITAL LETTER I WITH ACUTE [2000] +3-2945 U+00CE # LATIN CAPITAL LETTER I WITH CIRCUMFLEX [2000] +3-2946 U+00CF # LATIN CAPITAL LETTER I WITH DIAERESIS [2000] +3-2947 U+00D0 # LATIN CAPITAL LETTER ETH [2000] +3-2948 U+00D1 # LATIN CAPITAL LETTER N WITH TILDE [2000] +3-2949 U+00D2 # LATIN CAPITAL LETTER O WITH GRAVE [2000] +3-294A U+00D3 # LATIN CAPITAL LETTER O WITH ACUTE [2000] +3-294B U+00D4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX [2000] +3-294C U+00D5 # LATIN CAPITAL LETTER O WITH TILDE [2000] +3-294D U+00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS [2000] +3-294E U+00D8 # LATIN CAPITAL LETTER O WITH STROKE [2000] +3-294F U+00D9 # LATIN CAPITAL LETTER U WITH GRAVE [2000] +3-2950 U+00DA # LATIN CAPITAL LETTER U WITH ACUTE [2000] +3-2951 U+00DB # LATIN CAPITAL LETTER U WITH CIRCUMFLEX [2000] +3-2952 U+00DC # LATIN CAPITAL LETTER U WITH DIAERESIS [2000] +3-2953 U+00DD # LATIN CAPITAL LETTER Y WITH ACUTE [2000] +3-2954 U+00DE # LATIN CAPITAL LETTER THORN [2000] +3-2955 U+00DF # LATIN SMALL LETTER SHARP S [2000] +3-2956 U+00E0 # LATIN SMALL LETTER A WITH GRAVE [2000] +3-2957 U+00E1 # LATIN SMALL LETTER A WITH ACUTE [2000] +3-2958 U+00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX [2000] +3-2959 U+00E3 # LATIN SMALL LETTER A WITH TILDE [2000] +3-295A U+00E4 # LATIN SMALL LETTER A WITH DIAERESIS [2000] +3-295B U+00E5 # LATIN SMALL LETTER A WITH RING ABOVE [2000] +3-295C U+00E6 # LATIN SMALL LETTER AE [2000] +3-295D U+00E7 # LATIN SMALL LETTER C WITH CEDILLA [2000] +3-295E U+00E8 # LATIN SMALL LETTER E WITH GRAVE [2000] +3-295F U+00E9 # LATIN SMALL LETTER E WITH ACUTE [2000] +3-2960 U+00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX [2000] +3-2961 U+00EB # LATIN SMALL LETTER E WITH DIAERESIS [2000] +3-2962 U+00EC # LATIN SMALL LETTER I WITH GRAVE [2000] +3-2963 U+00ED # LATIN SMALL LETTER I WITH ACUTE [2000] +3-2964 U+00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX [2000] +3-2965 U+00EF # LATIN SMALL LETTER I WITH DIAERESIS [2000] +3-2966 U+00F0 # LATIN SMALL LETTER ETH [2000] +3-2967 U+00F1 # LATIN SMALL LETTER N WITH TILDE [2000] +3-2968 U+00F2 # LATIN SMALL LETTER O WITH GRAVE [2000] +3-2969 U+00F3 # LATIN SMALL LETTER O WITH ACUTE [2000] +3-296A U+00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX [2000] +3-296B U+00F5 # LATIN SMALL LETTER O WITH TILDE [2000] +3-296C U+00F6 # LATIN SMALL LETTER O WITH DIAERESIS [2000] +3-296D U+00F8 # LATIN SMALL LETTER O WITH STROKE [2000] +3-296E U+00F9 # LATIN SMALL LETTER U WITH GRAVE [2000] +3-296F U+00FA # LATIN SMALL LETTER U WITH ACUTE [2000] +3-2970 U+00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX [2000] +3-2971 U+00FC # LATIN SMALL LETTER U WITH DIAERESIS [2000] +3-2972 U+00FD # LATIN SMALL LETTER Y WITH ACUTE [2000] +3-2973 U+00FE # LATIN SMALL LETTER THORN [2000] +3-2974 U+00FF # LATIN SMALL LETTER Y WITH DIAERESIS [2000] +3-2975 U+0100 # LATIN CAPITAL LETTER A WITH MACRON [2000] +3-2976 U+012A # LATIN CAPITAL LETTER I WITH MACRON [2000] +3-2977 U+016A # LATIN CAPITAL LETTER U WITH MACRON [2000] +3-2978 U+0112 # LATIN CAPITAL LETTER E WITH MACRON [2000] +3-2979 U+014C # LATIN CAPITAL LETTER O WITH MACRON [2000] +3-297A U+0101 # LATIN SMALL LETTER A WITH MACRON [2000] +3-297B U+012B # LATIN SMALL LETTER I WITH MACRON [2000] +3-297C U+016B # LATIN SMALL LETTER U WITH MACRON [2000] +3-297D U+0113 # LATIN SMALL LETTER E WITH MACRON [2000] +3-297E U+014D # LATIN SMALL LETTER O WITH MACRON [2000] +3-2A21 U+0104 # LATIN CAPITAL LETTER A WITH OGONEK [2000] +3-2A22 U+02D8 # BREVE [2000] +3-2A23 U+0141 # LATIN CAPITAL LETTER L WITH STROKE [2000] +3-2A24 U+013D # LATIN CAPITAL LETTER L WITH CARON [2000] +3-2A25 U+015A # LATIN CAPITAL LETTER S WITH ACUTE [2000] +3-2A26 U+0160 # LATIN CAPITAL LETTER S WITH CARON [2000] +3-2A27 U+015E # LATIN CAPITAL LETTER S WITH CEDILLA [2000] +3-2A28 U+0164 # LATIN CAPITAL LETTER T WITH CARON [2000] +3-2A29 U+0179 # LATIN CAPITAL LETTER Z WITH ACUTE [2000] +3-2A2A U+017D # LATIN CAPITAL LETTER Z WITH CARON [2000] +3-2A2B U+017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE [2000] +3-2A2C U+0105 # LATIN SMALL LETTER A WITH OGONEK [2000] +3-2A2D U+02DB # OGONEK [2000] +3-2A2E U+0142 # LATIN SMALL LETTER L WITH STROKE [2000] +3-2A2F U+013E # LATIN SMALL LETTER L WITH CARON [2000] +3-2A30 U+015B # LATIN SMALL LETTER S WITH ACUTE [2000] +3-2A31 U+02C7 # CARON [2000] +3-2A32 U+0161 # LATIN SMALL LETTER S WITH CARON [2000] +3-2A33 U+015F # LATIN SMALL LETTER S WITH CEDILLA [2000] +3-2A34 U+0165 # LATIN SMALL LETTER T WITH CARON [2000] +3-2A35 U+017A # LATIN SMALL LETTER Z WITH ACUTE [2000] +3-2A36 U+02DD # DOUBLE ACUTE ACCENT [2000] +3-2A37 U+017E # LATIN SMALL LETTER Z WITH CARON [2000] +3-2A38 U+017C # LATIN SMALL LETTER Z WITH DOT ABOVE [2000] +3-2A39 U+0154 # LATIN CAPITAL LETTER R WITH ACUTE [2000] +3-2A3A U+0102 # LATIN CAPITAL LETTER A WITH BREVE [2000] +3-2A3B U+0139 # LATIN CAPITAL LETTER L WITH ACUTE [2000] +3-2A3C U+0106 # LATIN CAPITAL LETTER C WITH ACUTE [2000] +3-2A3D U+010C # LATIN CAPITAL LETTER C WITH CARON [2000] +3-2A3E U+0118 # LATIN CAPITAL LETTER E WITH OGONEK [2000] +3-2A3F U+011A # LATIN CAPITAL LETTER E WITH CARON [2000] +3-2A40 U+010E # LATIN CAPITAL LETTER D WITH CARON [2000] +3-2A41 U+0143 # LATIN CAPITAL LETTER N WITH ACUTE [2000] +3-2A42 U+0147 # LATIN CAPITAL LETTER N WITH CARON [2000] +3-2A43 U+0150 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE [2000] +3-2A44 U+0158 # LATIN CAPITAL LETTER R WITH CARON [2000] +3-2A45 U+016E # LATIN CAPITAL LETTER U WITH RING ABOVE [2000] +3-2A46 U+0170 # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE [2000] +3-2A47 U+0162 # LATIN CAPITAL LETTER T WITH CEDILLA [2000] +3-2A48 U+0155 # LATIN SMALL LETTER R WITH ACUTE [2000] +3-2A49 U+0103 # LATIN SMALL LETTER A WITH BREVE [2000] +3-2A4A U+013A # LATIN SMALL LETTER L WITH ACUTE [2000] +3-2A4B U+0107 # LATIN SMALL LETTER C WITH ACUTE [2000] +3-2A4C U+010D # LATIN SMALL LETTER C WITH CARON [2000] +3-2A4D U+0119 # LATIN SMALL LETTER E WITH OGONEK [2000] +3-2A4E U+011B # LATIN SMALL LETTER E WITH CARON [2000] +3-2A4F U+010F # LATIN SMALL LETTER D WITH CARON [2000] +3-2A50 U+0111 # LATIN SMALL LETTER D WITH STROKE [2000] +3-2A51 U+0144 # LATIN SMALL LETTER N WITH ACUTE [2000] +3-2A52 U+0148 # LATIN SMALL LETTER N WITH CARON [2000] +3-2A53 U+0151 # LATIN SMALL LETTER O WITH DOUBLE ACUTE [2000] +3-2A54 U+0159 # LATIN SMALL LETTER R WITH CARON [2000] +3-2A55 U+016F # LATIN SMALL LETTER U WITH RING ABOVE [2000] +3-2A56 U+0171 # LATIN SMALL LETTER U WITH DOUBLE ACUTE [2000] +3-2A57 U+0163 # LATIN SMALL LETTER T WITH CEDILLA [2000] +3-2A58 U+02D9 # DOT ABOVE [2000] +3-2A59 U+0108 # LATIN CAPITAL LETTER C WITH CIRCUMFLEX [2000] +3-2A5A U+011C # LATIN CAPITAL LETTER G WITH CIRCUMFLEX [2000] +3-2A5B U+0124 # LATIN CAPITAL LETTER H WITH CIRCUMFLEX [2000] +3-2A5C U+0134 # LATIN CAPITAL LETTER J WITH CIRCUMFLEX [2000] +3-2A5D U+015C # LATIN CAPITAL LETTER S WITH CIRCUMFLEX [2000] +3-2A5E U+016C # LATIN CAPITAL LETTER U WITH BREVE [2000] +3-2A5F U+0109 # LATIN SMALL LETTER C WITH CIRCUMFLEX [2000] +3-2A60 U+011D # LATIN SMALL LETTER G WITH CIRCUMFLEX [2000] +3-2A61 U+0125 # LATIN SMALL LETTER H WITH CIRCUMFLEX [2000] +3-2A62 U+0135 # LATIN SMALL LETTER J WITH CIRCUMFLEX [2000] +3-2A63 U+015D # LATIN SMALL LETTER S WITH CIRCUMFLEX [2000] +3-2A64 U+016D # LATIN SMALL LETTER U WITH BREVE [2000] +3-2A65 U+0271 # LATIN SMALL LETTER M WITH HOOK [2000] +3-2A66 U+028B # LATIN SMALL LETTER V WITH HOOK [2000] +3-2A67 U+027E # LATIN SMALL LETTER R WITH FISHHOOK [2000] +3-2A68 U+0283 # LATIN SMALL LETTER ESH [2000] +3-2A69 U+0292 # LATIN SMALL LETTER EZH [2000] +3-2A6A U+026C # LATIN SMALL LETTER L WITH BELT [2000] +3-2A6B U+026E # LATIN SMALL LETTER LEZH [2000] +3-2A6C U+0279 # LATIN SMALL LETTER TURNED R [2000] +3-2A6D U+0288 # LATIN SMALL LETTER T WITH RETROFLEX HOOK [2000] +3-2A6E U+0256 # LATIN SMALL LETTER D WITH TAIL [2000] +3-2A6F U+0273 # LATIN SMALL LETTER N WITH RETROFLEX HOOK [2000] +3-2A70 U+027D # LATIN SMALL LETTER R WITH TAIL [2000] +3-2A71 U+0282 # LATIN SMALL LETTER S WITH HOOK [2000] +3-2A72 U+0290 # LATIN SMALL LETTER Z WITH RETROFLEX HOOK [2000] +3-2A73 U+027B # LATIN SMALL LETTER TURNED R WITH HOOK [2000] +3-2A74 U+026D # LATIN SMALL LETTER L WITH RETROFLEX HOOK [2000] +3-2A75 U+025F # LATIN SMALL LETTER DOTLESS J WITH STROKE [2000] +3-2A76 U+0272 # LATIN SMALL LETTER N WITH LEFT HOOK [2000] +3-2A77 U+029D # LATIN SMALL LETTER J WITH CROSSED-TAIL [2000] +3-2A78 U+028E # LATIN SMALL LETTER TURNED Y [2000] +3-2A79 U+0261 # LATIN SMALL LETTER SCRIPT G [2000] +3-2A7A U+014B # LATIN SMALL LETTER ENG [2000] +3-2A7B U+0270 # LATIN SMALL LETTER TURNED M WITH LONG LEG [2000] +3-2A7C U+0281 # LATIN LETTER SMALL CAPITAL INVERTED R [2000] +3-2A7D U+0127 # LATIN SMALL LETTER H WITH STROKE [2000] +3-2A7E U+0295 # LATIN LETTER PHARYNGEAL VOICED FRICATIVE [2000] +3-2B21 U+0294 # LATIN LETTER GLOTTAL STOP [2000] +3-2B22 U+0266 # LATIN SMALL LETTER H WITH HOOK [2000] +3-2B23 U+0298 # LATIN LETTER BILABIAL CLICK [2000] +3-2B24 U+01C2 # LATIN LETTER ALVEOLAR CLICK [2000] +3-2B25 U+0253 # LATIN SMALL LETTER B WITH HOOK [2000] +3-2B26 U+0257 # LATIN SMALL LETTER D WITH HOOK [2000] +3-2B27 U+0284 # LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK [2000] +3-2B28 U+0260 # LATIN SMALL LETTER G WITH HOOK [2000] +3-2B29 U+0193 # LATIN CAPITAL LETTER G WITH HOOK [2000] +3-2B2A U+0153 # LATIN SMALL LIGATURE OE [2000] +3-2B2B U+0152 # LATIN CAPITAL LIGATURE OE [2000] +3-2B2C U+0268 # LATIN SMALL LETTER I WITH STROKE [2000] +3-2B2D U+0289 # LATIN SMALL LETTER U BAR [2000] +3-2B2E U+0258 # LATIN SMALL LETTER REVERSED E [2000] +3-2B2F U+0275 # LATIN SMALL LETTER BARRED O [2000] +3-2B30 U+0259 # LATIN SMALL LETTER SCHWA [2000] +3-2B31 U+025C # LATIN SMALL LETTER REVERSED OPEN E [2000] +3-2B32 U+025E # LATIN SMALL LETTER CLOSED REVERSED OPEN E [2000] +3-2B33 U+0250 # LATIN SMALL LETTER TURNED A [2000] +3-2B34 U+026F # LATIN SMALL LETTER TURNED M [2000] +3-2B35 U+028A # LATIN SMALL LETTER UPSILON [2000] +3-2B36 U+0264 # LATIN SMALL LETTER RAMS HORN [2000] +3-2B37 U+028C # LATIN SMALL LETTER TURNED V [2000] +3-2B38 U+0254 # LATIN SMALL LETTER OPEN O [2000] +3-2B39 U+0251 # LATIN SMALL LETTER ALPHA [2000] +3-2B3A U+0252 # LATIN SMALL LETTER TURNED ALPHA [2000] +3-2B3B U+028D # LATIN SMALL LETTER TURNED W [2000] +3-2B3C U+0265 # LATIN SMALL LETTER TURNED H [2000] +3-2B3D U+02A2 # LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE [2000] +3-2B3E U+02A1 # LATIN LETTER GLOTTAL STOP WITH STROKE [2000] +3-2B3F U+0255 # LATIN SMALL LETTER C WITH CURL [2000] +3-2B40 U+0291 # LATIN SMALL LETTER Z WITH CURL [2000] +3-2B41 U+027A # LATIN SMALL LETTER TURNED R WITH LONG LEG [2000] +3-2B42 U+0267 # LATIN SMALL LETTER HENG WITH HOOK [2000] +3-2B43 U+025A # LATIN SMALL LETTER SCHWA WITH HOOK [2000] +3-2B44 U+00E6+0300 # [2000] Private: U+F76A +3-2B45 U+01FD # LATIN SMALL LETTER AE WITH ACUTE [2000] +3-2B46 U+1F70 # GREEK SMALL LETTER ALPHA WITH VARIA [2000] +3-2B47 U+1F71 # GREEK SMALL LETTER ALPHA WITH OXIA [2000] +3-2B48 U+0254+0300 # [2000] Private: U+F76B +3-2B49 U+0254+0301 # [2000] Private: U+F76C +3-2B4A U+028C+0300 # [2000] Private: U+F76D +3-2B4B U+028C+0301 # [2000] Private: U+F76E +3-2B4C U+0259+0300 # [2000] Private: U+F76F +3-2B4D U+0259+0301 # [2000] Private: U+F770 +3-2B4E U+025A+0300 # [2000] Private: U+F771 +3-2B4F U+025A+0301 # [2000] Private: U+F772 +3-2B50 U+1F72 # GREEK SMALL LETTER EPSILON WITH VARIA [2000] +3-2B51 U+1F73 # GREEK SMALL LETTER EPSILON WITH OXIA [2000] +3-2B52 U+0361 # COMBINING DOUBLE INVERTED BREVE [2000] +3-2B53 U+02C8 # MODIFIER LETTER VERTICAL LINE [2000] +3-2B54 U+02CC # MODIFIER LETTER LOW VERTICAL LINE [2000] +3-2B55 U+02D0 # MODIFIER LETTER TRIANGULAR COLON [2000] +3-2B56 U+02D1 # MODIFIER LETTER HALF TRIANGULAR COLON [2000] +3-2B57 U+0306 # COMBINING BREVE [2000] +3-2B58 U+203F # UNDERTIE [2000] +3-2B59 U+030B # COMBINING DOUBLE ACUTE ACCENT [2000] +3-2B5A U+0301 # COMBINING ACUTE ACCENT [2000] +3-2B5B U+0304 # COMBINING MACRON [2000] +3-2B5C U+0300 # COMBINING GRAVE ACCENT [2000] +3-2B5D U+030F # COMBINING DOUBLE GRAVE ACCENT [2000] +3-2B5E U+030C # COMBINING CARON [2000] +3-2B5F U+0302 # COMBINING CIRCUMFLEX ACCENT [2000] +3-2B60 U+02E5 # MODIFIER LETTER EXTRA-HIGH TONE BAR [2000] +3-2B61 U+02E6 # MODIFIER LETTER HIGH TONE BAR [2000] +3-2B62 U+02E7 # MODIFIER LETTER MID TONE BAR [2000] +3-2B63 U+02E8 # MODIFIER LETTER LOW TONE BAR [2000] +3-2B64 U+02E9 # MODIFIER LETTER EXTRA-LOW TONE BAR [2000] +3-2B65 U+02E9+02E5 # [2000] Private: U+F773 +3-2B66 U+02E5+02E9 # [2000] Private: U+F774 +3-2B67 U+0325 # COMBINING RING BELOW [2000] +3-2B68 U+032C # COMBINING CARON BELOW [2000] +3-2B69 U+0339 # COMBINING RIGHT HALF RING BELOW [2000] +3-2B6A U+031C # COMBINING LEFT HALF RING BELOW [2000] +3-2B6B U+031F # COMBINING PLUS SIGN BELOW [2000] +3-2B6C U+0320 # COMBINING MINUS SIGN BELOW [2000] +3-2B6D U+0308 # COMBINING DIAERESIS [2000] +3-2B6E U+033D # COMBINING X ABOVE [2000] +3-2B6F U+0329 # COMBINING VERTICAL LINE BELOW [2000] +3-2B70 U+032F # COMBINING INVERTED BREVE BELOW [2000] +3-2B71 U+02DE # MODIFIER LETTER RHOTIC HOOK [2000] +3-2B72 U+0324 # COMBINING DIAERESIS BELOW [2000] +3-2B73 U+0330 # COMBINING TILDE BELOW [2000] +3-2B74 U+033C # COMBINING SEAGULL BELOW [2000] +3-2B75 U+0334 # COMBINING TILDE OVERLAY [2000] +3-2B76 U+031D # COMBINING UP TACK BELOW [2000] +3-2B77 U+031E # COMBINING DOWN TACK BELOW [2000] +3-2B78 U+0318 # COMBINING LEFT TACK BELOW [2000] +3-2B79 U+0319 # COMBINING RIGHT TACK BELOW [2000] +3-2B7A U+032A # COMBINING BRIDGE BELOW [2000] +3-2B7B U+033A # COMBINING INVERTED BRIDGE BELOW [2000] +3-2B7C U+033B # COMBINING SQUARE BELOW [2000] +3-2B7D U+0303 # COMBINING TILDE [2000] +3-2B7E U+031A # COMBINING LEFT ANGLE ABOVE [2000] +3-2C21 U+2776 # DINGBAT NEGATIVE CIRCLED DIGIT ONE [2000] +3-2C22 U+2777 # DINGBAT NEGATIVE CIRCLED DIGIT TWO [2000] +3-2C23 U+2778 # DINGBAT NEGATIVE CIRCLED DIGIT THREE [2000] +3-2C24 U+2779 # DINGBAT NEGATIVE CIRCLED DIGIT FOUR [2000] +3-2C25 U+277A # DINGBAT NEGATIVE CIRCLED DIGIT FIVE [2000] +3-2C26 U+277B # DINGBAT NEGATIVE CIRCLED DIGIT SIX [2000] +3-2C27 U+277C # DINGBAT NEGATIVE CIRCLED DIGIT SEVEN [2000] +3-2C28 U+277D # DINGBAT NEGATIVE CIRCLED DIGIT EIGHT [2000] +3-2C29 U+277E # DINGBAT NEGATIVE CIRCLED DIGIT NINE [2000] +3-2C2A U+277F # DINGBAT NEGATIVE CIRCLED NUMBER TEN [2000] +3-2C2B U+24EB # NEGATIVE CIRCLED NUMBER ELEVEN [2000] [Unicode3.2] +3-2C2C U+24EC # NEGATIVE CIRCLED NUMBER TWELVE [2000] [Unicode3.2] +3-2C2D U+24ED # NEGATIVE CIRCLED NUMBER THIRTEEN [2000] [Unicode3.2] +3-2C2E U+24EE # NEGATIVE CIRCLED NUMBER FOURTEEN [2000] [Unicode3.2] +3-2C2F U+24EF # NEGATIVE CIRCLED NUMBER FIFTEEN [2000] [Unicode3.2] +3-2C30 U+24F0 # NEGATIVE CIRCLED NUMBER SIXTEEN [2000] [Unicode3.2] +3-2C31 U+24F1 # NEGATIVE CIRCLED NUMBER SEVENTEEN [2000] [Unicode3.2] +3-2C32 U+24F2 # NEGATIVE CIRCLED NUMBER EIGHTEEN [2000] [Unicode3.2] +3-2C33 U+24F3 # NEGATIVE CIRCLED NUMBER NINETEEN [2000] [Unicode3.2] +3-2C34 U+24F4 # NEGATIVE CIRCLED NUMBER TWENTY [2000] [Unicode3.2] +3-2C35 U+2170 # SMALL ROMAN NUMERAL ONE [2000] +3-2C36 U+2171 # SMALL ROMAN NUMERAL TWO [2000] +3-2C37 U+2172 # SMALL ROMAN NUMERAL THREE [2000] +3-2C38 U+2173 # SMALL ROMAN NUMERAL FOUR [2000] +3-2C39 U+2174 # SMALL ROMAN NUMERAL FIVE [2000] +3-2C3A U+2175 # SMALL ROMAN NUMERAL SIX [2000] +3-2C3B U+2176 # SMALL ROMAN NUMERAL SEVEN [2000] +3-2C3C U+2177 # SMALL ROMAN NUMERAL EIGHT [2000] +3-2C3D U+2178 # SMALL ROMAN NUMERAL NINE [2000] +3-2C3E U+2179 # SMALL ROMAN NUMERAL TEN [2000] +3-2C3F U+217A # SMALL ROMAN NUMERAL ELEVEN [2000] +3-2C40 U+217B # SMALL ROMAN NUMERAL TWELVE [2000] +3-2C41 U+24D0 # CIRCLED LATIN SMALL LETTER A [2000] +3-2C42 U+24D1 # CIRCLED LATIN SMALL LETTER B [2000] +3-2C43 U+24D2 # CIRCLED LATIN SMALL LETTER C [2000] +3-2C44 U+24D3 # CIRCLED LATIN SMALL LETTER D [2000] +3-2C45 U+24D4 # CIRCLED LATIN SMALL LETTER E [2000] +3-2C46 U+24D5 # CIRCLED LATIN SMALL LETTER F [2000] +3-2C47 U+24D6 # CIRCLED LATIN SMALL LETTER G [2000] +3-2C48 U+24D7 # CIRCLED LATIN SMALL LETTER H [2000] +3-2C49 U+24D8 # CIRCLED LATIN SMALL LETTER I [2000] +3-2C4A U+24D9 # CIRCLED LATIN SMALL LETTER J [2000] +3-2C4B U+24DA # CIRCLED LATIN SMALL LETTER K [2000] +3-2C4C U+24DB # CIRCLED LATIN SMALL LETTER L [2000] +3-2C4D U+24DC # CIRCLED LATIN SMALL LETTER M [2000] +3-2C4E U+24DD # CIRCLED LATIN SMALL LETTER N [2000] +3-2C4F U+24DE # CIRCLED LATIN SMALL LETTER O [2000] +3-2C50 U+24DF # CIRCLED LATIN SMALL LETTER P [2000] +3-2C51 U+24E0 # CIRCLED LATIN SMALL LETTER Q [2000] +3-2C52 U+24E1 # CIRCLED LATIN SMALL LETTER R [2000] +3-2C53 U+24E2 # CIRCLED LATIN SMALL LETTER S [2000] +3-2C54 U+24E3 # CIRCLED LATIN SMALL LETTER T [2000] +3-2C55 U+24E4 # CIRCLED LATIN SMALL LETTER U [2000] +3-2C56 U+24E5 # CIRCLED LATIN SMALL LETTER V [2000] +3-2C57 U+24E6 # CIRCLED LATIN SMALL LETTER W [2000] +3-2C58 U+24E7 # CIRCLED LATIN SMALL LETTER X [2000] +3-2C59 U+24E8 # CIRCLED LATIN SMALL LETTER Y [2000] +3-2C5A U+24E9 # CIRCLED LATIN SMALL LETTER Z [2000] +3-2C5B U+32D0 # CIRCLED KATAKANA A [2000] +3-2C5C U+32D1 # CIRCLED KATAKANA I [2000] +3-2C5D U+32D2 # CIRCLED KATAKANA U [2000] +3-2C5E U+32D3 # CIRCLED KATAKANA E [2000] +3-2C5F U+32D4 # CIRCLED KATAKANA O [2000] +3-2C60 U+32D5 # CIRCLED KATAKANA KA [2000] +3-2C61 U+32D6 # CIRCLED KATAKANA KI [2000] +3-2C62 U+32D7 # CIRCLED KATAKANA KU [2000] +3-2C63 U+32D8 # CIRCLED KATAKANA KE [2000] +3-2C64 U+32D9 # CIRCLED KATAKANA KO [2000] +3-2C65 U+32DA # CIRCLED KATAKANA SA [2000] +3-2C66 U+32DB # CIRCLED KATAKANA SI [2000] +3-2C67 U+32DC # CIRCLED KATAKANA SU [2000] +3-2C68 U+32DD # CIRCLED KATAKANA SE [2000] +3-2C69 U+32DE # CIRCLED KATAKANA SO [2000] +3-2C6A U+32DF # CIRCLED KATAKANA TA [2000] +3-2C6B U+32E0 # CIRCLED KATAKANA TI [2000] +3-2C6C U+32E1 # CIRCLED KATAKANA TU [2000] +3-2C6D U+32E2 # CIRCLED KATAKANA TE [2000] +3-2C6E U+32E3 # CIRCLED KATAKANA TO [2000] +3-2C6F U+32FA # CIRCLED KATAKANA RO [2000] +3-2C70 U+32E9 # CIRCLED KATAKANA HA [2000] +3-2C71 U+32E5 # CIRCLED KATAKANA NI [2000] +3-2C72 U+32ED # CIRCLED KATAKANA HO [2000] +3-2C73 U+32EC # CIRCLED KATAKANA HE [2000] +3-2C74 # +3-2C75 # +3-2C76 # +3-2C77 # +3-2C78 # +3-2C79 # +3-2C7A # +3-2C7B # +3-2C7C # +3-2C7D U+2051 # TWO ASTERISKS ALIGNED VERTICALLY [2000] [Unicode3.2] +3-2C7E U+2042 # ASTERISM [2000] +3-2D21 U+2460 # CIRCLED DIGIT ONE [2000] +3-2D22 U+2461 # CIRCLED DIGIT TWO [2000] +3-2D23 U+2462 # CIRCLED DIGIT THREE [2000] +3-2D24 U+2463 # CIRCLED DIGIT FOUR [2000] +3-2D25 U+2464 # CIRCLED DIGIT FIVE [2000] +3-2D26 U+2465 # CIRCLED DIGIT SIX [2000] +3-2D27 U+2466 # CIRCLED DIGIT SEVEN [2000] +3-2D28 U+2467 # CIRCLED DIGIT EIGHT [2000] +3-2D29 U+2468 # CIRCLED DIGIT NINE [2000] +3-2D2A U+2469 # CIRCLED NUMBER TEN [2000] +3-2D2B U+246A # CIRCLED NUMBER ELEVEN [2000] +3-2D2C U+246B # CIRCLED NUMBER TWELVE [2000] +3-2D2D U+246C # CIRCLED NUMBER THIRTEEN [2000] +3-2D2E U+246D # CIRCLED NUMBER FOURTEEN [2000] +3-2D2F U+246E # CIRCLED NUMBER FIFTEEN [2000] +3-2D30 U+246F # CIRCLED NUMBER SIXTEEN [2000] +3-2D31 U+2470 # CIRCLED NUMBER SEVENTEEN [2000] +3-2D32 U+2471 # CIRCLED NUMBER EIGHTEEN [2000] +3-2D33 U+2472 # CIRCLED NUMBER NINETEEN [2000] +3-2D34 U+2473 # CIRCLED NUMBER TWENTY [2000] +3-2D35 U+2160 # ROMAN NUMERAL ONE [2000] +3-2D36 U+2161 # ROMAN NUMERAL TWO [2000] +3-2D37 U+2162 # ROMAN NUMERAL THREE [2000] +3-2D38 U+2163 # ROMAN NUMERAL FOUR [2000] +3-2D39 U+2164 # ROMAN NUMERAL FIVE [2000] +3-2D3A U+2165 # ROMAN NUMERAL SIX [2000] +3-2D3B U+2166 # ROMAN NUMERAL SEVEN [2000] +3-2D3C U+2167 # ROMAN NUMERAL EIGHT [2000] +3-2D3D U+2168 # ROMAN NUMERAL NINE [2000] +3-2D3E U+2169 # ROMAN NUMERAL TEN [2000] +3-2D3F U+216A # ROMAN NUMERAL ELEVEN [2000] +3-2D40 U+3349 # SQUARE MIRI [2000] +3-2D41 U+3314 # SQUARE KIRO [2000] +3-2D42 U+3322 # SQUARE SENTI [2000] +3-2D43 U+334D # SQUARE MEETORU [2000] +3-2D44 U+3318 # SQUARE GURAMU [2000] +3-2D45 U+3327 # SQUARE TON [2000] +3-2D46 U+3303 # SQUARE AARU [2000] +3-2D47 U+3336 # SQUARE HEKUTAARU [2000] +3-2D48 U+3351 # SQUARE RITTORU [2000] +3-2D49 U+3357 # SQUARE WATTO [2000] +3-2D4A U+330D # SQUARE KARORII [2000] +3-2D4B U+3326 # SQUARE DORU [2000] +3-2D4C U+3323 # SQUARE SENTO [2000] +3-2D4D U+332B # SQUARE PAASENTO [2000] +3-2D4E U+334A # SQUARE MIRIBAARU [2000] +3-2D4F U+333B # SQUARE PEEZI [2000] +3-2D50 U+339C # SQUARE MM [2000] +3-2D51 U+339D # SQUARE CM [2000] +3-2D52 U+339E # SQUARE KM [2000] +3-2D53 U+338E # SQUARE MG [2000] +3-2D54 U+338F # SQUARE KG [2000] +3-2D55 U+33C4 # SQUARE CC [2000] +3-2D56 U+33A1 # SQUARE M SQUARED [2000] +3-2D57 U+216B # ROMAN NUMERAL TWELVE [2000] +3-2D58 # +3-2D59 # +3-2D5A # +3-2D5B # +3-2D5C # +3-2D5D # +3-2D5E # +3-2D5F U+337B # SQUARE ERA NAME HEISEI [2000] +3-2D60 U+301D # REVERSED DOUBLE PRIME QUOTATION MARK [2000] +3-2D61 U+301F # LOW DOUBLE PRIME QUOTATION MARK [2000] +3-2D62 U+2116 # NUMERO SIGN [2000] +3-2D63 U+33CD # SQUARE KK [2000] +3-2D64 U+2121 # TELEPHONE SIGN [2000] +3-2D65 U+32A4 # CIRCLED IDEOGRAPH HIGH [2000] +3-2D66 U+32A5 # CIRCLED IDEOGRAPH CENTRE [2000] +3-2D67 U+32A6 # CIRCLED IDEOGRAPH LOW [2000] +3-2D68 U+32A7 # CIRCLED IDEOGRAPH LEFT [2000] +3-2D69 U+32A8 # CIRCLED IDEOGRAPH RIGHT [2000] +3-2D6A U+3231 # PARENTHESIZED IDEOGRAPH STOCK [2000] +3-2D6B U+3232 # PARENTHESIZED IDEOGRAPH HAVE [2000] +3-2D6C U+3239 # PARENTHESIZED IDEOGRAPH REPRESENT [2000] +3-2D6D U+337E # SQUARE ERA NAME MEIZI [2000] +3-2D6E U+337D # SQUARE ERA NAME TAISYOU [2000] +3-2D6F U+337C # SQUARE ERA NAME SYOUWA [2000] +3-2D70 # Windows: U+2252 +3-2D71 # Windows: U+2261 +3-2D72 # Windows: U+222B +3-2D73 U+222E # CONTOUR INTEGRAL [2000] +3-2D74 # Windows: U+2211 +3-2D75 # Windows: U+221A +3-2D76 # Windows: U+22A5 +3-2D77 # Windows: U+2220 +3-2D78 U+221F # RIGHT ANGLE [2000] +3-2D79 U+22BF # RIGHT TRIANGLE [2000] +3-2D7A # Windows: U+2235 +3-2D7B # Windows: U+2229 +3-2D7C # Windows: U+222A +3-2D7D U+2756 # BLACK DIAMOND MINUS WHITE X [2000] +3-2D7E U+261E # WHITE RIGHT POINTING INDEX [2000] +3-2E21 U+4FF1 # [2004] +3-2E22 U+2000B # [2000] [Unicode3.1] Private: U+F780 +3-2E23 U+3402 # [2000] +3-2E24 U+4E28 # [2000] +3-2E25 U+4E2F # [2000] +3-2E26 U+4E30 # [2000] +3-2E27 U+4E8D # [2000] +3-2E28 U+4EE1 # [2000] +3-2E29 U+4EFD # [2000] +3-2E2A U+4EFF # [2000] +3-2E2B U+4F03 # [2000] +3-2E2C U+4F0B # [2000] +3-2E2D U+4F60 # [2000] +3-2E2E U+4F48 # [2000] +3-2E2F U+4F49 # [2000] +3-2E30 U+4F56 # [2000] +3-2E31 U+4F5F # [2000] +3-2E32 U+4F6A # [2000] +3-2E33 U+4F6C # [2000] +3-2E34 U+4F7E # [2000] +3-2E35 U+4F8A # [2000] +3-2E36 U+4F94 # [2000] +3-2E37 U+4F97 # [2000] +3-2E38 U+FA30 # CJK COMPATIBILITY IDEOGRAPH-FA30 [2000] [Unicode3.2] +3-2E39 U+4FC9 # [2000] +3-2E3A U+4FE0 # [2000] +3-2E3B U+5001 # [2000] +3-2E3C U+5002 # [2000] +3-2E3D U+500E # [2000] +3-2E3E U+5018 # [2000] +3-2E3F U+5027 # [2000] +3-2E40 U+502E # [2000] +3-2E41 U+5040 # [2000] +3-2E42 U+503B # [2000] +3-2E43 U+5041 # [2000] +3-2E44 U+5094 # [2000] +3-2E45 U+50CC # [2000] +3-2E46 U+50F2 # [2000] +3-2E47 U+50D0 # [2000] +3-2E48 U+50E6 # [2000] +3-2E49 U+FA31 # CJK COMPATIBILITY IDEOGRAPH-FA31 [2000] [Unicode3.2] +3-2E4A U+5106 # [2000] +3-2E4B U+5103 # [2000] +3-2E4C U+510B # [2000] +3-2E4D U+511E # [2000] +3-2E4E U+5135 # [2000] +3-2E4F U+514A # [2000] +3-2E50 U+FA32 # CJK COMPATIBILITY IDEOGRAPH-FA32 [2000] [Unicode3.2] +3-2E51 U+5155 # [2000] +3-2E52 U+5157 # [2000] +3-2E53 U+34B5 # [2000] +3-2E54 U+519D # [2000] +3-2E55 U+51C3 # [2000] +3-2E56 U+51CA # [2000] +3-2E57 U+51DE # [2000] +3-2E58 U+51E2 # [2000] +3-2E59 U+51EE # [2000] +3-2E5A U+5201 # [2000] +3-2E5B U+34DB # [2000] +3-2E5C U+5213 # [2000] +3-2E5D U+5215 # [2000] +3-2E5E U+5249 # [2000] +3-2E5F U+5257 # [2000] +3-2E60 U+5261 # [2000] +3-2E61 U+5293 # [2000] +3-2E62 U+52C8 # [2000] +3-2E63 U+FA33 # CJK COMPATIBILITY IDEOGRAPH-FA33 [2000] [Unicode3.2] +3-2E64 U+52CC # [2000] +3-2E65 U+52D0 # [2000] +3-2E66 U+52D6 # [2000] +3-2E67 U+52DB # [2000] +3-2E68 U+FA34 # CJK COMPATIBILITY IDEOGRAPH-FA34 [2000] [Unicode3.2] +3-2E69 U+52F0 # [2000] +3-2E6A U+52FB # [2000] +3-2E6B U+5300 # [2000] +3-2E6C U+5307 # [2000] +3-2E6D U+531C # [2000] +3-2E6E U+FA35 # CJK COMPATIBILITY IDEOGRAPH-FA35 [2000] [Unicode3.2] +3-2E6F U+5361 # [2000] +3-2E70 U+5363 # [2000] +3-2E71 U+537D # [2000] +3-2E72 U+5393 # [2000] +3-2E73 U+539D # [2000] +3-2E74 U+53B2 # [2000] +3-2E75 U+5412 # [2000] +3-2E76 U+5427 # [2000] +3-2E77 U+544D # [2000] +3-2E78 U+549C # [2000] +3-2E79 U+546B # [2000] +3-2E7A U+5474 # [2000] +3-2E7B U+547F # [2000] +3-2E7C U+5488 # [2000] +3-2E7D U+5496 # [2000] +3-2E7E U+54A1 # [2000] +3-2F21 U+54A9 # [2000] +3-2F22 U+54C6 # [2000] +3-2F23 U+54FF # [2000] +3-2F24 U+550E # [2000] +3-2F25 U+552B # [2000] +3-2F26 U+5535 # [2000] +3-2F27 U+5550 # [2000] +3-2F28 U+555E # [2000] +3-2F29 U+5581 # [2000] +3-2F2A U+5586 # [2000] +3-2F2B U+558E # [2000] +3-2F2C U+FA36 # CJK COMPATIBILITY IDEOGRAPH-FA36 [2000] [Unicode3.2] +3-2F2D U+55AD # [2000] +3-2F2E U+55CE # [2000] +3-2F2F U+FA37 # CJK COMPATIBILITY IDEOGRAPH-FA37 [2000] [Unicode3.2] +3-2F30 U+5608 # [2000] +3-2F31 U+560E # [2000] +3-2F32 U+563B # [2000] +3-2F33 U+5649 # [2000] +3-2F34 U+5676 # [2000] +3-2F35 U+5666 # [2000] +3-2F36 U+FA38 # CJK COMPATIBILITY IDEOGRAPH-FA38 [2000] [Unicode3.2] +3-2F37 U+566F # [2000] +3-2F38 U+5671 # [2000] +3-2F39 U+5672 # [2000] +3-2F3A U+5699 # [2000] +3-2F3B U+569E # [2000] +3-2F3C U+56A9 # [2000] +3-2F3D U+56AC # [2000] +3-2F3E U+56B3 # [2000] +3-2F3F U+56C9 # [2000] +3-2F40 U+56CA # [2000] +3-2F41 U+570A # [2000] +3-2F42 U+2123D # [2000] [Unicode3.1] Private: U+F78A +3-2F43 U+5721 # [2000] +3-2F44 U+572F # [2000] +3-2F45 U+5733 # [2000] +3-2F46 U+5734 # [2000] +3-2F47 U+5770 # [2000] +3-2F48 U+5777 # [2000] +3-2F49 U+577C # [2000] +3-2F4A U+579C # [2000] +3-2F4B U+FA0F # CJK COMPATIBILITY IDEOGRAPH-FA0F [2000] +3-2F4C U+2131B # [2000] [Unicode3.1] Private: U+F78B +3-2F4D U+57B8 # [2000] +3-2F4E U+57C7 # [2000] +3-2F4F U+57C8 # [2000] +3-2F50 U+57CF # [2000] +3-2F51 U+57E4 # [2000] +3-2F52 U+57ED # [2000] +3-2F53 U+57F5 # [2000] +3-2F54 U+57F6 # [2000] +3-2F55 U+57FF # [2000] +3-2F56 U+5809 # [2000] +3-2F57 U+FA10 # CJK COMPATIBILITY IDEOGRAPH-FA10 [2000] +3-2F58 U+5861 # [2000] +3-2F59 U+5864 # [2000] +3-2F5A U+FA39 # CJK COMPATIBILITY IDEOGRAPH-FA39 [2000] [Unicode3.2] +3-2F5B U+587C # [2000] +3-2F5C U+5889 # [2000] +3-2F5D U+589E # [2000] +3-2F5E U+FA3A # CJK COMPATIBILITY IDEOGRAPH-FA3A [2000] [Unicode3.2] +3-2F5F U+58A9 # [2000] +3-2F60 U+2146E # [2000] [Unicode3.1] Private: U+F78E +3-2F61 U+58D2 # [2000] +3-2F62 U+58CE # [2000] +3-2F63 U+58D4 # [2000] +3-2F64 U+58DA # [2000] +3-2F65 U+58E0 # [2000] +3-2F66 U+58E9 # [2000] +3-2F67 U+590C # [2000] +3-2F68 U+8641 # [2000] +3-2F69 U+595D # [2000] +3-2F6A U+596D # [2000] +3-2F6B U+598B # [2000] +3-2F6C U+5992 # [2000] +3-2F6D U+59A4 # [2000] +3-2F6E U+59C3 # [2000] +3-2F6F U+59D2 # [2000] +3-2F70 U+59DD # [2000] +3-2F71 U+5A13 # [2000] +3-2F72 U+5A23 # [2000] +3-2F73 U+5A67 # [2000] +3-2F74 U+5A6D # [2000] +3-2F75 U+5A77 # [2000] +3-2F76 U+5A7E # [2000] +3-2F77 U+5A84 # [2000] +3-2F78 U+5A9E # [2000] +3-2F79 U+5AA7 # [2000] +3-2F7A U+5AC4 # [2000] +3-2F7B U+218BD # [2000] [Unicode3.1] Private: U+F78F +3-2F7C U+5B19 # [2000] +3-2F7D U+5B25 # [2000] +3-2F7E U+525D # [2004] +3-3021 U+4E9C # +3-3022 U+5516 # +3-3023 U+5A03 # +3-3024 U+963F # +3-3025 U+54C0 # +3-3026 U+611B # +3-3027 U+6328 # +3-3028 U+59F6 # +3-3029 U+9022 # +3-302A U+8475 # +3-302B U+831C # +3-302C U+7A50 # +3-302D U+60AA # +3-302E U+63E1 # +3-302F U+6E25 # +3-3030 U+65ED # +3-3031 U+8466 # +3-3032 U+82A6 # +3-3033 U+9BF5 # +3-3034 U+6893 # +3-3035 U+5727 # +3-3036 U+65A1 # +3-3037 U+6271 # +3-3038 U+5B9B # +3-3039 U+59D0 # +3-303A U+867B # +3-303B U+98F4 # +3-303C U+7D62 # +3-303D U+7DBE # +3-303E U+9B8E # +3-303F U+6216 # +3-3040 U+7C9F # +3-3041 U+88B7 # +3-3042 U+5B89 # +3-3043 U+5EB5 # +3-3044 U+6309 # +3-3045 U+6697 # +3-3046 U+6848 # +3-3047 U+95C7 # +3-3048 U+978D # +3-3049 U+674F # +3-304A U+4EE5 # +3-304B U+4F0A # +3-304C U+4F4D # +3-304D U+4F9D # +3-304E U+5049 # +3-304F U+56F2 # +3-3050 U+5937 # +3-3051 U+59D4 # +3-3052 U+5A01 # +3-3053 U+5C09 # +3-3054 U+60DF # +3-3055 U+610F # +3-3056 U+6170 # +3-3057 U+6613 # +3-3058 U+6905 # +3-3059 U+70BA # +3-305A U+754F # +3-305B U+7570 # +3-305C U+79FB # +3-305D U+7DAD # +3-305E U+7DEF # +3-305F U+80C3 # +3-3060 U+840E # +3-3061 U+8863 # +3-3062 U+8B02 # +3-3063 U+9055 # +3-3064 U+907A # +3-3065 U+533B # +3-3066 U+4E95 # +3-3067 U+4EA5 # +3-3068 U+57DF # +3-3069 U+80B2 # +3-306A U+90C1 # +3-306B U+78EF # +3-306C U+4E00 # +3-306D U+58F1 # +3-306E U+6EA2 # +3-306F U+9038 # +3-3070 U+7A32 # +3-3071 U+8328 # +3-3072 U+828B # +3-3073 U+9C2F # +3-3074 U+5141 # +3-3075 U+5370 # +3-3076 U+54BD # +3-3077 U+54E1 # +3-3078 U+56E0 # +3-3079 U+59FB # +3-307A U+5F15 # +3-307B U+98F2 # +3-307C U+6DEB # +3-307D U+80E4 # +3-307E U+852D # +3-3121 U+9662 # +3-3122 U+9670 # +3-3123 U+96A0 # +3-3124 U+97FB # +3-3125 U+540B # +3-3126 U+53F3 # +3-3127 U+5B87 # +3-3128 U+70CF # +3-3129 U+7FBD # +3-312A U+8FC2 # +3-312B U+96E8 # +3-312C U+536F # +3-312D U+9D5C # +3-312E U+7ABA # +3-312F U+4E11 # +3-3130 U+7893 # +3-3131 U+81FC # +3-3132 U+6E26 # +3-3133 U+5618 # +3-3134 U+5504 # +3-3135 U+6B1D # +3-3136 U+851A # +3-3137 U+9C3B # +3-3138 U+59E5 # +3-3139 U+53A9 # +3-313A U+6D66 # +3-313B U+74DC # +3-313C U+958F # +3-313D U+5642 # +3-313E U+4E91 # +3-313F U+904B # +3-3140 U+96F2 # +3-3141 U+834F # +3-3142 U+990C # +3-3143 U+53E1 # +3-3144 U+55B6 # +3-3145 U+5B30 # +3-3146 U+5F71 # +3-3147 U+6620 # +3-3148 U+66F3 # +3-3149 U+6804 # +3-314A U+6C38 # +3-314B U+6CF3 # +3-314C U+6D29 # +3-314D U+745B # +3-314E U+76C8 # +3-314F U+7A4E # +3-3150 U+9834 # +3-3151 U+82F1 # +3-3152 U+885B # +3-3153 U+8A60 # +3-3154 U+92ED # +3-3155 U+6DB2 # +3-3156 U+75AB # +3-3157 U+76CA # +3-3158 U+99C5 # +3-3159 U+60A6 # +3-315A U+8B01 # +3-315B U+8D8A # +3-315C U+95B2 # +3-315D U+698E # +3-315E U+53AD # +3-315F U+5186 # +3-3160 U+5712 # +3-3161 U+5830 # +3-3162 U+5944 # +3-3163 U+5BB4 # +3-3164 U+5EF6 # +3-3165 U+6028 # +3-3166 U+63A9 # +3-3167 U+63F4 # +3-3168 U+6CBF # +3-3169 U+6F14 # +3-316A U+708E # +3-316B U+7114 # +3-316C U+7159 # +3-316D U+71D5 # +3-316E U+733F # +3-316F U+7E01 # +3-3170 U+8276 # +3-3171 U+82D1 # +3-3172 U+8597 # +3-3173 U+9060 # +3-3174 U+925B # +3-3175 U+9D1B # +3-3176 U+5869 # +3-3177 U+65BC # +3-3178 U+6C5A # +3-3179 U+7525 # +3-317A U+51F9 # +3-317B U+592E # +3-317C U+5965 # +3-317D U+5F80 # +3-317E U+5FDC # +3-3221 U+62BC # +3-3222 U+65FA # +3-3223 U+6A2A # +3-3224 U+6B27 # +3-3225 U+6BB4 # +3-3226 U+738B # +3-3227 U+7FC1 # +3-3228 U+8956 # +3-3229 U+9D2C # +3-322A U+9D0E # +3-322B U+9EC4 # +3-322C U+5CA1 # +3-322D U+6C96 # +3-322E U+837B # +3-322F U+5104 # +3-3230 U+5C4B # +3-3231 U+61B6 # +3-3232 U+81C6 # +3-3233 U+6876 # +3-3234 U+7261 # +3-3235 U+4E59 # +3-3236 U+4FFA # +3-3237 U+5378 # +3-3238 U+6069 # +3-3239 U+6E29 # +3-323A U+7A4F # +3-323B U+97F3 # +3-323C U+4E0B # +3-323D U+5316 # +3-323E U+4EEE # +3-323F U+4F55 # +3-3240 U+4F3D # +3-3241 U+4FA1 # +3-3242 U+4F73 # +3-3243 U+52A0 # +3-3244 U+53EF # +3-3245 U+5609 # +3-3246 U+590F # +3-3247 U+5AC1 # +3-3248 U+5BB6 # +3-3249 U+5BE1 # +3-324A U+79D1 # +3-324B U+6687 # +3-324C U+679C # +3-324D U+67B6 # +3-324E U+6B4C # +3-324F U+6CB3 # +3-3250 U+706B # +3-3251 U+73C2 # +3-3252 U+798D # +3-3253 U+79BE # +3-3254 U+7A3C # +3-3255 U+7B87 # +3-3256 U+82B1 # +3-3257 U+82DB # +3-3258 U+8304 # +3-3259 U+8377 # +3-325A U+83EF # +3-325B U+83D3 # +3-325C U+8766 # +3-325D U+8AB2 # +3-325E U+5629 # +3-325F U+8CA8 # +3-3260 U+8FE6 # +3-3261 U+904E # +3-3262 U+971E # +3-3263 U+868A # +3-3264 U+4FC4 # +3-3265 U+5CE8 # +3-3266 U+6211 # +3-3267 U+7259 # +3-3268 U+753B # +3-3269 U+81E5 # +3-326A U+82BD # +3-326B U+86FE # +3-326C U+8CC0 # +3-326D U+96C5 # +3-326E U+9913 # +3-326F U+99D5 # +3-3270 U+4ECB # +3-3271 U+4F1A # +3-3272 U+89E3 # +3-3273 U+56DE # +3-3274 U+584A # +3-3275 U+58CA # +3-3276 U+5EFB # +3-3277 U+5FEB # +3-3278 U+602A # +3-3279 U+6094 # +3-327A U+6062 # +3-327B U+61D0 # +3-327C U+6212 # +3-327D U+62D0 # +3-327E U+6539 # +3-3321 U+9B41 # +3-3322 U+6666 # +3-3323 U+68B0 # +3-3324 U+6D77 # +3-3325 U+7070 # +3-3326 U+754C # +3-3327 U+7686 # +3-3328 U+7D75 # +3-3329 U+82A5 # +3-332A U+87F9 # +3-332B U+958B # +3-332C U+968E # +3-332D U+8C9D # +3-332E U+51F1 # +3-332F U+52BE # +3-3330 U+5916 # +3-3331 U+54B3 # +3-3332 U+5BB3 # +3-3333 U+5D16 # +3-3334 U+6168 # +3-3335 U+6982 # +3-3336 U+6DAF # +3-3337 U+788D # +3-3338 U+84CB # +3-3339 U+8857 # +3-333A U+8A72 # +3-333B U+93A7 # +3-333C U+9AB8 # +3-333D U+6D6C # +3-333E U+99A8 # +3-333F U+86D9 # +3-3340 U+57A3 # +3-3341 U+67FF # +3-3342 U+86CE # +3-3343 U+920E # +3-3344 U+5283 # +3-3345 U+5687 # +3-3346 U+5404 # +3-3347 U+5ED3 # +3-3348 U+62E1 # +3-3349 U+64B9 # +3-334A U+683C # +3-334B U+6838 # +3-334C U+6BBB # +3-334D U+7372 # +3-334E U+78BA # +3-334F U+7A6B # +3-3350 U+899A # +3-3351 U+89D2 # +3-3352 U+8D6B # +3-3353 U+8F03 # +3-3354 U+90ED # +3-3355 U+95A3 # +3-3356 U+9694 # +3-3357 U+9769 # +3-3358 U+5B66 # +3-3359 U+5CB3 # +3-335A U+697D # +3-335B U+984D # +3-335C U+984E # +3-335D U+639B # +3-335E U+7B20 # +3-335F U+6A2B # +3-3360 U+6A7F # +3-3361 U+68B6 # +3-3362 U+9C0D # +3-3363 U+6F5F # +3-3364 U+5272 # +3-3365 U+559D # +3-3366 U+6070 # +3-3367 U+62EC # +3-3368 U+6D3B # +3-3369 U+6E07 # +3-336A U+6ED1 # +3-336B U+845B # +3-336C U+8910 # +3-336D U+8F44 # +3-336E U+4E14 # +3-336F U+9C39 # +3-3370 U+53F6 # +3-3371 U+691B # +3-3372 U+6A3A # +3-3373 U+9784 # +3-3374 U+682A # +3-3375 U+515C # +3-3376 U+7AC3 # +3-3377 U+84B2 # +3-3378 U+91DC # +3-3379 U+938C # +3-337A U+565B # +3-337B U+9D28 # +3-337C U+6822 # +3-337D U+8305 # +3-337E U+8431 # +3-3421 U+7CA5 # +3-3422 U+5208 # +3-3423 U+82C5 # +3-3424 U+74E6 # +3-3425 U+4E7E # +3-3426 U+4F83 # +3-3427 U+51A0 # +3-3428 U+5BD2 # +3-3429 U+520A # +3-342A U+52D8 # +3-342B U+52E7 # +3-342C U+5DFB # +3-342D U+559A # +3-342E U+582A # +3-342F U+59E6 # +3-3430 U+5B8C # +3-3431 U+5B98 # +3-3432 U+5BDB # +3-3433 U+5E72 # +3-3434 U+5E79 # +3-3435 U+60A3 # +3-3436 U+611F # +3-3437 U+6163 # +3-3438 U+61BE # +3-3439 U+63DB # +3-343A U+6562 # +3-343B U+67D1 # +3-343C U+6853 # +3-343D U+68FA # +3-343E U+6B3E # +3-343F U+6B53 # +3-3440 U+6C57 # +3-3441 U+6F22 # +3-3442 U+6F97 # +3-3443 U+6F45 # +3-3444 U+74B0 # +3-3445 U+7518 # +3-3446 U+76E3 # +3-3447 U+770B # +3-3448 U+7AFF # +3-3449 U+7BA1 # +3-344A U+7C21 # +3-344B U+7DE9 # +3-344C U+7F36 # +3-344D U+7FF0 # +3-344E U+809D # +3-344F U+8266 # +3-3450 U+839E # +3-3451 U+89B3 # +3-3452 U+8ACC # +3-3453 U+8CAB # +3-3454 U+9084 # +3-3455 U+9451 # +3-3456 U+9593 # +3-3457 U+9591 # +3-3458 U+95A2 # +3-3459 U+9665 # +3-345A U+97D3 # +3-345B U+9928 # +3-345C U+8218 # +3-345D U+4E38 # +3-345E U+542B # +3-345F U+5CB8 # +3-3460 U+5DCC # +3-3461 U+73A9 # +3-3462 U+764C # +3-3463 U+773C # +3-3464 U+5CA9 # +3-3465 U+7FEB # +3-3466 U+8D0B # +3-3467 U+96C1 # +3-3468 U+9811 # +3-3469 U+9854 # +3-346A U+9858 # +3-346B U+4F01 # +3-346C U+4F0E # +3-346D U+5371 # +3-346E U+559C # +3-346F U+5668 # +3-3470 U+57FA # +3-3471 U+5947 # +3-3472 U+5B09 # +3-3473 U+5BC4 # +3-3474 U+5C90 # +3-3475 U+5E0C # +3-3476 U+5E7E # +3-3477 U+5FCC # +3-3478 U+63EE # +3-3479 U+673A # +3-347A U+65D7 # +3-347B U+65E2 # +3-347C U+671F # +3-347D U+68CB # +3-347E U+68C4 # +3-3521 U+6A5F # +3-3522 U+5E30 # +3-3523 U+6BC5 # +3-3524 U+6C17 # +3-3525 U+6C7D # +3-3526 U+757F # +3-3527 U+7948 # +3-3528 U+5B63 # +3-3529 U+7A00 # +3-352A U+7D00 # +3-352B U+5FBD # +3-352C U+898F # +3-352D U+8A18 # +3-352E U+8CB4 # +3-352F U+8D77 # +3-3530 U+8ECC # +3-3531 U+8F1D # +3-3532 U+98E2 # +3-3533 U+9A0E # +3-3534 U+9B3C # +3-3535 U+4E80 # +3-3536 U+507D # +3-3537 U+5100 # +3-3538 U+5993 # +3-3539 U+5B9C # +3-353A U+622F # +3-353B U+6280 # +3-353C U+64EC # +3-353D U+6B3A # +3-353E U+72A0 # +3-353F U+7591 # +3-3540 U+7947 # +3-3541 U+7FA9 # +3-3542 U+87FB # +3-3543 U+8ABC # +3-3544 U+8B70 # +3-3545 U+63AC # +3-3546 U+83CA # +3-3547 U+97A0 # +3-3548 U+5409 # +3-3549 U+5403 # +3-354A U+55AB # +3-354B U+6854 # +3-354C U+6A58 # +3-354D U+8A70 # +3-354E U+7827 # +3-354F U+6775 # +3-3550 U+9ECD # +3-3551 U+5374 # +3-3552 U+5BA2 # +3-3553 U+811A # +3-3554 U+8650 # +3-3555 U+9006 # +3-3556 U+4E18 # +3-3557 U+4E45 # +3-3558 U+4EC7 # +3-3559 U+4F11 # +3-355A U+53CA # +3-355B U+5438 # +3-355C U+5BAE # +3-355D U+5F13 # +3-355E U+6025 # +3-355F U+6551 # +3-3560 U+673D # +3-3561 U+6C42 # +3-3562 U+6C72 # +3-3563 U+6CE3 # +3-3564 U+7078 # +3-3565 U+7403 # +3-3566 U+7A76 # +3-3567 U+7AAE # +3-3568 U+7B08 # +3-3569 U+7D1A # +3-356A U+7CFE # +3-356B U+7D66 # +3-356C U+65E7 # +3-356D U+725B # +3-356E U+53BB # +3-356F U+5C45 # +3-3570 U+5DE8 # +3-3571 U+62D2 # +3-3572 U+62E0 # +3-3573 U+6319 # +3-3574 U+6E20 # +3-3575 U+865A # +3-3576 U+8A31 # +3-3577 U+8DDD # +3-3578 U+92F8 # +3-3579 U+6F01 # +3-357A U+79A6 # +3-357B U+9B5A # +3-357C U+4EA8 # +3-357D U+4EAB # +3-357E U+4EAC # +3-3621 U+4F9B # +3-3622 U+4FA0 # +3-3623 U+50D1 # +3-3624 U+5147 # +3-3625 U+7AF6 # +3-3626 U+5171 # +3-3627 U+51F6 # +3-3628 U+5354 # +3-3629 U+5321 # +3-362A U+537F # +3-362B U+53EB # +3-362C U+55AC # +3-362D U+5883 # +3-362E U+5CE1 # +3-362F U+5F37 # +3-3630 U+5F4A # +3-3631 U+602F # +3-3632 U+6050 # +3-3633 U+606D # +3-3634 U+631F # +3-3635 U+6559 # +3-3636 U+6A4B # +3-3637 U+6CC1 # +3-3638 U+72C2 # +3-3639 U+72ED # +3-363A U+77EF # +3-363B U+80F8 # +3-363C U+8105 # +3-363D U+8208 # +3-363E U+854E # +3-363F U+90F7 # +3-3640 U+93E1 # +3-3641 U+97FF # +3-3642 U+9957 # +3-3643 U+9A5A # +3-3644 U+4EF0 # +3-3645 U+51DD # +3-3646 U+5C2D # +3-3647 U+6681 # +3-3648 U+696D # +3-3649 U+5C40 # +3-364A U+66F2 # +3-364B U+6975 # +3-364C U+7389 # +3-364D U+6850 # +3-364E U+7C81 # +3-364F U+50C5 # +3-3650 U+52E4 # +3-3651 U+5747 # +3-3652 U+5DFE # +3-3653 U+9326 # +3-3654 U+65A4 # +3-3655 U+6B23 # +3-3656 U+6B3D # +3-3657 U+7434 # +3-3658 U+7981 # +3-3659 U+79BD # +3-365A U+7B4B # +3-365B U+7DCA # +3-365C U+82B9 # +3-365D U+83CC # +3-365E U+887F # +3-365F U+895F # +3-3660 U+8B39 # +3-3661 U+8FD1 # +3-3662 U+91D1 # +3-3663 U+541F # +3-3664 U+9280 # +3-3665 U+4E5D # +3-3666 U+5036 # +3-3667 U+53E5 # +3-3668 U+533A # +3-3669 U+72D7 # +3-366A U+7396 # +3-366B U+77E9 # +3-366C U+82E6 # +3-366D U+8EAF # +3-366E U+99C6 # +3-366F U+99C8 # +3-3670 U+99D2 # +3-3671 U+5177 # +3-3672 U+611A # +3-3673 U+865E # +3-3674 U+55B0 # +3-3675 U+7A7A # +3-3676 U+5076 # +3-3677 U+5BD3 # +3-3678 U+9047 # +3-3679 U+9685 # +3-367A U+4E32 # +3-367B U+6ADB # +3-367C U+91E7 # +3-367D U+5C51 # +3-367E U+5C48 # +3-3721 U+6398 # +3-3722 U+7A9F # +3-3723 U+6C93 # +3-3724 U+9774 # +3-3725 U+8F61 # +3-3726 U+7AAA # +3-3727 U+718A # +3-3728 U+9688 # +3-3729 U+7C82 # +3-372A U+6817 # +3-372B U+7E70 # +3-372C U+6851 # +3-372D U+936C # +3-372E U+52F2 # +3-372F U+541B # +3-3730 U+85AB # +3-3731 U+8A13 # +3-3732 U+7FA4 # +3-3733 U+8ECD # +3-3734 U+90E1 # +3-3735 U+5366 # +3-3736 U+8888 # +3-3737 U+7941 # +3-3738 U+4FC2 # +3-3739 U+50BE # +3-373A U+5211 # +3-373B U+5144 # +3-373C U+5553 # +3-373D U+572D # +3-373E U+73EA # +3-373F U+578B # +3-3740 U+5951 # +3-3741 U+5F62 # +3-3742 U+5F84 # +3-3743 U+6075 # +3-3744 U+6176 # +3-3745 U+6167 # +3-3746 U+61A9 # +3-3747 U+63B2 # +3-3748 U+643A # +3-3749 U+656C # +3-374A U+666F # +3-374B U+6842 # +3-374C U+6E13 # +3-374D U+7566 # +3-374E U+7A3D # +3-374F U+7CFB # +3-3750 U+7D4C # +3-3751 U+7D99 # +3-3752 U+7E4B # +3-3753 U+7F6B # +3-3754 U+830E # +3-3755 U+834A # +3-3756 U+86CD # +3-3757 U+8A08 # +3-3758 U+8A63 # +3-3759 U+8B66 # +3-375A U+8EFD # +3-375B U+981A # +3-375C U+9D8F # +3-375D U+82B8 # +3-375E U+8FCE # +3-375F U+9BE8 # +3-3760 U+5287 # +3-3761 U+621F # +3-3762 U+6483 # +3-3763 U+6FC0 # +3-3764 U+9699 # +3-3765 U+6841 # +3-3766 U+5091 # +3-3767 U+6B20 # +3-3768 U+6C7A # +3-3769 U+6F54 # +3-376A U+7A74 # +3-376B U+7D50 # +3-376C U+8840 # +3-376D U+8A23 # +3-376E U+6708 # +3-376F U+4EF6 # +3-3770 U+5039 # +3-3771 U+5026 # +3-3772 U+5065 # +3-3773 U+517C # +3-3774 U+5238 # +3-3775 U+5263 # +3-3776 U+55A7 # +3-3777 U+570F # +3-3778 U+5805 # +3-3779 U+5ACC # +3-377A U+5EFA # +3-377B U+61B2 # +3-377C U+61F8 # +3-377D U+62F3 # +3-377E U+6372 # +3-3821 U+691C # +3-3822 U+6A29 # +3-3823 U+727D # +3-3824 U+72AC # +3-3825 U+732E # +3-3826 U+7814 # +3-3827 U+786F # +3-3828 U+7D79 # +3-3829 U+770C # +3-382A U+80A9 # +3-382B U+898B # +3-382C U+8B19 # +3-382D U+8CE2 # +3-382E U+8ED2 # +3-382F U+9063 # +3-3830 U+9375 # +3-3831 U+967A # +3-3832 U+9855 # +3-3833 U+9A13 # +3-3834 U+9E78 # +3-3835 U+5143 # +3-3836 U+539F # +3-3837 U+53B3 # +3-3838 U+5E7B # +3-3839 U+5F26 # +3-383A U+6E1B # +3-383B U+6E90 # +3-383C U+7384 # +3-383D U+73FE # +3-383E U+7D43 # +3-383F U+8237 # +3-3840 U+8A00 # +3-3841 U+8AFA # +3-3842 U+9650 # +3-3843 U+4E4E # +3-3844 U+500B # +3-3845 U+53E4 # +3-3846 U+547C # +3-3847 U+56FA # +3-3848 U+59D1 # +3-3849 U+5B64 # +3-384A U+5DF1 # +3-384B U+5EAB # +3-384C U+5F27 # +3-384D U+6238 # +3-384E U+6545 # +3-384F U+67AF # +3-3850 U+6E56 # +3-3851 U+72D0 # +3-3852 U+7CCA # +3-3853 U+88B4 # +3-3854 U+80A1 # +3-3855 U+80E1 # +3-3856 U+83F0 # +3-3857 U+864E # +3-3858 U+8A87 # +3-3859 U+8DE8 # +3-385A U+9237 # +3-385B U+96C7 # +3-385C U+9867 # +3-385D U+9F13 # +3-385E U+4E94 # +3-385F U+4E92 # +3-3860 U+4F0D # +3-3861 U+5348 # +3-3862 U+5449 # +3-3863 U+543E # +3-3864 U+5A2F # +3-3865 U+5F8C # +3-3866 U+5FA1 # +3-3867 U+609F # +3-3868 U+68A7 # +3-3869 U+6A8E # +3-386A U+745A # +3-386B U+7881 # +3-386C U+8A9E # +3-386D U+8AA4 # +3-386E U+8B77 # +3-386F U+9190 # +3-3870 U+4E5E # +3-3871 U+9BC9 # +3-3872 U+4EA4 # +3-3873 U+4F7C # +3-3874 U+4FAF # +3-3875 U+5019 # +3-3876 U+5016 # +3-3877 U+5149 # +3-3878 U+516C # +3-3879 U+529F # +3-387A U+52B9 # +3-387B U+52FE # +3-387C U+539A # +3-387D U+53E3 # +3-387E U+5411 # +3-3921 U+540E # +3-3922 U+5589 # +3-3923 U+5751 # +3-3924 U+57A2 # +3-3925 U+597D # +3-3926 U+5B54 # +3-3927 U+5B5D # +3-3928 U+5B8F # +3-3929 U+5DE5 # +3-392A U+5DE7 # +3-392B U+5DF7 # +3-392C U+5E78 # +3-392D U+5E83 # +3-392E U+5E9A # +3-392F U+5EB7 # +3-3930 U+5F18 # +3-3931 U+6052 # +3-3932 U+614C # +3-3933 U+6297 # +3-3934 U+62D8 # +3-3935 U+63A7 # +3-3936 U+653B # +3-3937 U+6602 # +3-3938 U+6643 # +3-3939 U+66F4 # +3-393A U+676D # +3-393B U+6821 # +3-393C U+6897 # +3-393D U+69CB # +3-393E U+6C5F # +3-393F U+6D2A # +3-3940 U+6D69 # +3-3941 U+6E2F # +3-3942 U+6E9D # +3-3943 U+7532 # +3-3944 U+7687 # +3-3945 U+786C # +3-3946 U+7A3F # +3-3947 U+7CE0 # +3-3948 U+7D05 # +3-3949 U+7D18 # +3-394A U+7D5E # +3-394B U+7DB1 # +3-394C U+8015 # +3-394D U+8003 # +3-394E U+80AF # +3-394F U+80B1 # +3-3950 U+8154 # +3-3951 U+818F # +3-3952 U+822A # +3-3953 U+8352 # +3-3954 U+884C # +3-3955 U+8861 # +3-3956 U+8B1B # +3-3957 U+8CA2 # +3-3958 U+8CFC # +3-3959 U+90CA # +3-395A U+9175 # +3-395B U+9271 # +3-395C U+783F # +3-395D U+92FC # +3-395E U+95A4 # +3-395F U+964D # +3-3960 U+9805 # +3-3961 U+9999 # +3-3962 U+9AD8 # +3-3963 U+9D3B # +3-3964 U+525B # +3-3965 U+52AB # +3-3966 U+53F7 # +3-3967 U+5408 # +3-3968 U+58D5 # +3-3969 U+62F7 # +3-396A U+6FE0 # +3-396B U+8C6A # +3-396C U+8F5F # +3-396D U+9EB9 # +3-396E U+514B # +3-396F U+523B # +3-3970 U+544A # +3-3971 U+56FD # +3-3972 U+7A40 # +3-3973 U+9177 # +3-3974 U+9D60 # +3-3975 U+9ED2 # +3-3976 U+7344 # +3-3977 U+6F09 # +3-3978 U+8170 # +3-3979 U+7511 # +3-397A U+5FFD # +3-397B U+60DA # +3-397C U+9AA8 # +3-397D U+72DB # +3-397E U+8FBC # +3-3A21 U+6B64 # +3-3A22 U+9803 # +3-3A23 U+4ECA # +3-3A24 U+56F0 # +3-3A25 U+5764 # +3-3A26 U+58BE # +3-3A27 U+5A5A # +3-3A28 U+6068 # +3-3A29 U+61C7 # +3-3A2A U+660F # +3-3A2B U+6606 # +3-3A2C U+6839 # +3-3A2D U+68B1 # +3-3A2E U+6DF7 # +3-3A2F U+75D5 # +3-3A30 U+7D3A # +3-3A31 U+826E # +3-3A32 U+9B42 # +3-3A33 U+4E9B # +3-3A34 U+4F50 # +3-3A35 U+53C9 # +3-3A36 U+5506 # +3-3A37 U+5D6F # +3-3A38 U+5DE6 # +3-3A39 U+5DEE # +3-3A3A U+67FB # +3-3A3B U+6C99 # +3-3A3C U+7473 # +3-3A3D U+7802 # +3-3A3E U+8A50 # +3-3A3F U+9396 # +3-3A40 U+88DF # +3-3A41 U+5750 # +3-3A42 U+5EA7 # +3-3A43 U+632B # +3-3A44 U+50B5 # +3-3A45 U+50AC # +3-3A46 U+518D # +3-3A47 U+6700 # +3-3A48 U+54C9 # +3-3A49 U+585E # +3-3A4A U+59BB # +3-3A4B U+5BB0 # +3-3A4C U+5F69 # +3-3A4D U+624D # +3-3A4E U+63A1 # +3-3A4F U+683D # +3-3A50 U+6B73 # +3-3A51 U+6E08 # +3-3A52 U+707D # +3-3A53 U+91C7 # +3-3A54 U+7280 # +3-3A55 U+7815 # +3-3A56 U+7826 # +3-3A57 U+796D # +3-3A58 U+658E # +3-3A59 U+7D30 # +3-3A5A U+83DC # +3-3A5B U+88C1 # +3-3A5C U+8F09 # +3-3A5D U+969B # +3-3A5E U+5264 # +3-3A5F U+5728 # +3-3A60 U+6750 # +3-3A61 U+7F6A # +3-3A62 U+8CA1 # +3-3A63 U+51B4 # +3-3A64 U+5742 # +3-3A65 U+962A # +3-3A66 U+583A # +3-3A67 U+698A # +3-3A68 U+80B4 # +3-3A69 U+54B2 # +3-3A6A U+5D0E # +3-3A6B U+57FC # +3-3A6C U+7895 # +3-3A6D U+9DFA # +3-3A6E U+4F5C # +3-3A6F U+524A # +3-3A70 U+548B # +3-3A71 U+643E # +3-3A72 U+6628 # +3-3A73 U+6714 # +3-3A74 U+67F5 # +3-3A75 U+7A84 # +3-3A76 U+7B56 # +3-3A77 U+7D22 # +3-3A78 U+932F # +3-3A79 U+685C # +3-3A7A U+9BAD # +3-3A7B U+7B39 # +3-3A7C U+5319 # +3-3A7D U+518A # +3-3A7E U+5237 # +3-3B21 U+5BDF # +3-3B22 U+62F6 # +3-3B23 U+64AE # +3-3B24 U+64E6 # +3-3B25 U+672D # +3-3B26 U+6BBA # +3-3B27 U+85A9 # +3-3B28 U+96D1 # +3-3B29 U+7690 # +3-3B2A U+9BD6 # +3-3B2B U+634C # +3-3B2C U+9306 # +3-3B2D U+9BAB # +3-3B2E U+76BF # +3-3B2F U+6652 # +3-3B30 U+4E09 # +3-3B31 U+5098 # +3-3B32 U+53C2 # +3-3B33 U+5C71 # +3-3B34 U+60E8 # +3-3B35 U+6492 # +3-3B36 U+6563 # +3-3B37 U+685F # +3-3B38 U+71E6 # +3-3B39 U+73CA # +3-3B3A U+7523 # +3-3B3B U+7B97 # +3-3B3C U+7E82 # +3-3B3D U+8695 # +3-3B3E U+8B83 # +3-3B3F U+8CDB # +3-3B40 U+9178 # +3-3B41 U+9910 # +3-3B42 U+65AC # +3-3B43 U+66AB # +3-3B44 U+6B8B # +3-3B45 U+4ED5 # +3-3B46 U+4ED4 # +3-3B47 U+4F3A # +3-3B48 U+4F7F # +3-3B49 U+523A # +3-3B4A U+53F8 # +3-3B4B U+53F2 # +3-3B4C U+55E3 # +3-3B4D U+56DB # +3-3B4E U+58EB # +3-3B4F U+59CB # +3-3B50 U+59C9 # +3-3B51 U+59FF # +3-3B52 U+5B50 # +3-3B53 U+5C4D # +3-3B54 U+5E02 # +3-3B55 U+5E2B # +3-3B56 U+5FD7 # +3-3B57 U+601D # +3-3B58 U+6307 # +3-3B59 U+652F # +3-3B5A U+5B5C # +3-3B5B U+65AF # +3-3B5C U+65BD # +3-3B5D U+65E8 # +3-3B5E U+679D # +3-3B5F U+6B62 # +3-3B60 U+6B7B # +3-3B61 U+6C0F # +3-3B62 U+7345 # +3-3B63 U+7949 # +3-3B64 U+79C1 # +3-3B65 U+7CF8 # +3-3B66 U+7D19 # +3-3B67 U+7D2B # +3-3B68 U+80A2 # +3-3B69 U+8102 # +3-3B6A U+81F3 # +3-3B6B U+8996 # +3-3B6C U+8A5E # +3-3B6D U+8A69 # +3-3B6E U+8A66 # +3-3B6F U+8A8C # +3-3B70 U+8AEE # +3-3B71 U+8CC7 # +3-3B72 U+8CDC # +3-3B73 U+96CC # +3-3B74 U+98FC # +3-3B75 U+6B6F # +3-3B76 U+4E8B # +3-3B77 U+4F3C # +3-3B78 U+4F8D # +3-3B79 U+5150 # +3-3B7A U+5B57 # +3-3B7B U+5BFA # +3-3B7C U+6148 # +3-3B7D U+6301 # +3-3B7E U+6642 # +3-3C21 U+6B21 # +3-3C22 U+6ECB # +3-3C23 U+6CBB # +3-3C24 U+723E # +3-3C25 U+74BD # +3-3C26 U+75D4 # +3-3C27 U+78C1 # +3-3C28 U+793A # +3-3C29 U+800C # +3-3C2A U+8033 # +3-3C2B U+81EA # +3-3C2C U+8494 # +3-3C2D U+8F9E # +3-3C2E U+6C50 # +3-3C2F U+9E7F # +3-3C30 U+5F0F # +3-3C31 U+8B58 # +3-3C32 U+9D2B # +3-3C33 U+7AFA # +3-3C34 U+8EF8 # +3-3C35 U+5B8D # +3-3C36 U+96EB # +3-3C37 U+4E03 # +3-3C38 U+53F1 # +3-3C39 U+57F7 # +3-3C3A U+5931 # +3-3C3B U+5AC9 # +3-3C3C U+5BA4 # +3-3C3D U+6089 # +3-3C3E U+6E7F # +3-3C3F U+6F06 # +3-3C40 U+75BE # +3-3C41 U+8CEA # +3-3C42 U+5B9F # +3-3C43 U+8500 # +3-3C44 U+7BE0 # +3-3C45 U+5072 # +3-3C46 U+67F4 # +3-3C47 U+829D # +3-3C48 U+5C61 # +3-3C49 U+854A # +3-3C4A U+7E1E # +3-3C4B U+820E # +3-3C4C U+5199 # +3-3C4D U+5C04 # +3-3C4E U+6368 # +3-3C4F U+8D66 # +3-3C50 U+659C # +3-3C51 U+716E # +3-3C52 U+793E # +3-3C53 U+7D17 # +3-3C54 U+8005 # +3-3C55 U+8B1D # +3-3C56 U+8ECA # +3-3C57 U+906E # +3-3C58 U+86C7 # +3-3C59 U+90AA # +3-3C5A U+501F # +3-3C5B U+52FA # +3-3C5C U+5C3A # +3-3C5D U+6753 # +3-3C5E U+707C # +3-3C5F U+7235 # +3-3C60 U+914C # +3-3C61 U+91C8 # +3-3C62 U+932B # +3-3C63 U+82E5 # +3-3C64 U+5BC2 # +3-3C65 U+5F31 # +3-3C66 U+60F9 # +3-3C67 U+4E3B # +3-3C68 U+53D6 # +3-3C69 U+5B88 # +3-3C6A U+624B # +3-3C6B U+6731 # +3-3C6C U+6B8A # +3-3C6D U+72E9 # +3-3C6E U+73E0 # +3-3C6F U+7A2E # +3-3C70 U+816B # +3-3C71 U+8DA3 # +3-3C72 U+9152 # +3-3C73 U+9996 # +3-3C74 U+5112 # +3-3C75 U+53D7 # +3-3C76 U+546A # +3-3C77 U+5BFF # +3-3C78 U+6388 # +3-3C79 U+6A39 # +3-3C7A U+7DAC # +3-3C7B U+9700 # +3-3C7C U+56DA # +3-3C7D U+53CE # +3-3C7E U+5468 # +3-3D21 U+5B97 # +3-3D22 U+5C31 # +3-3D23 U+5DDE # +3-3D24 U+4FEE # +3-3D25 U+6101 # +3-3D26 U+62FE # +3-3D27 U+6D32 # +3-3D28 U+79C0 # +3-3D29 U+79CB # +3-3D2A U+7D42 # +3-3D2B U+7E4D # +3-3D2C U+7FD2 # +3-3D2D U+81ED # +3-3D2E U+821F # +3-3D2F U+8490 # +3-3D30 U+8846 # +3-3D31 U+8972 # +3-3D32 U+8B90 # +3-3D33 U+8E74 # +3-3D34 U+8F2F # +3-3D35 U+9031 # +3-3D36 U+914B # +3-3D37 U+916C # +3-3D38 U+96C6 # +3-3D39 U+919C # +3-3D3A U+4EC0 # +3-3D3B U+4F4F # +3-3D3C U+5145 # +3-3D3D U+5341 # +3-3D3E U+5F93 # +3-3D3F U+620E # +3-3D40 U+67D4 # +3-3D41 U+6C41 # +3-3D42 U+6E0B # +3-3D43 U+7363 # +3-3D44 U+7E26 # +3-3D45 U+91CD # +3-3D46 U+9283 # +3-3D47 U+53D4 # +3-3D48 U+5919 # +3-3D49 U+5BBF # +3-3D4A U+6DD1 # +3-3D4B U+795D # +3-3D4C U+7E2E # +3-3D4D U+7C9B # +3-3D4E U+587E # +3-3D4F U+719F # +3-3D50 U+51FA # +3-3D51 U+8853 # +3-3D52 U+8FF0 # +3-3D53 U+4FCA # +3-3D54 U+5CFB # +3-3D55 U+6625 # +3-3D56 U+77AC # +3-3D57 U+7AE3 # +3-3D58 U+821C # +3-3D59 U+99FF # +3-3D5A U+51C6 # +3-3D5B U+5FAA # +3-3D5C U+65EC # +3-3D5D U+696F # +3-3D5E U+6B89 # +3-3D5F U+6DF3 # +3-3D60 U+6E96 # +3-3D61 U+6F64 # +3-3D62 U+76FE # +3-3D63 U+7D14 # +3-3D64 U+5DE1 # +3-3D65 U+9075 # +3-3D66 U+9187 # +3-3D67 U+9806 # +3-3D68 U+51E6 # +3-3D69 U+521D # +3-3D6A U+6240 # +3-3D6B U+6691 # +3-3D6C U+66D9 # +3-3D6D U+6E1A # +3-3D6E U+5EB6 # +3-3D6F U+7DD2 # +3-3D70 U+7F72 # +3-3D71 U+66F8 # +3-3D72 U+85AF # +3-3D73 U+85F7 # +3-3D74 U+8AF8 # +3-3D75 U+52A9 # +3-3D76 U+53D9 # +3-3D77 U+5973 # +3-3D78 U+5E8F # +3-3D79 U+5F90 # +3-3D7A U+6055 # +3-3D7B U+92E4 # +3-3D7C U+9664 # +3-3D7D U+50B7 # +3-3D7E U+511F # +3-3E21 U+52DD # +3-3E22 U+5320 # +3-3E23 U+5347 # +3-3E24 U+53EC # +3-3E25 U+54E8 # +3-3E26 U+5546 # +3-3E27 U+5531 # +3-3E28 U+5617 # +3-3E29 U+5968 # +3-3E2A U+59BE # +3-3E2B U+5A3C # +3-3E2C U+5BB5 # +3-3E2D U+5C06 # +3-3E2E U+5C0F # +3-3E2F U+5C11 # +3-3E30 U+5C1A # +3-3E31 U+5E84 # +3-3E32 U+5E8A # +3-3E33 U+5EE0 # +3-3E34 U+5F70 # +3-3E35 U+627F # +3-3E36 U+6284 # +3-3E37 U+62DB # +3-3E38 U+638C # +3-3E39 U+6377 # +3-3E3A U+6607 # +3-3E3B U+660C # +3-3E3C U+662D # +3-3E3D U+6676 # +3-3E3E U+677E # +3-3E3F U+68A2 # +3-3E40 U+6A1F # +3-3E41 U+6A35 # +3-3E42 U+6CBC # +3-3E43 U+6D88 # +3-3E44 U+6E09 # +3-3E45 U+6E58 # +3-3E46 U+713C # +3-3E47 U+7126 # +3-3E48 U+7167 # +3-3E49 U+75C7 # +3-3E4A U+7701 # +3-3E4B U+785D # +3-3E4C U+7901 # +3-3E4D U+7965 # +3-3E4E U+79F0 # +3-3E4F U+7AE0 # +3-3E50 U+7B11 # +3-3E51 U+7CA7 # +3-3E52 U+7D39 # +3-3E53 U+8096 # +3-3E54 U+83D6 # +3-3E55 U+848B # +3-3E56 U+8549 # +3-3E57 U+885D # +3-3E58 U+88F3 # +3-3E59 U+8A1F # +3-3E5A U+8A3C # +3-3E5B U+8A54 # +3-3E5C U+8A73 # +3-3E5D U+8C61 # +3-3E5E U+8CDE # +3-3E5F U+91A4 # +3-3E60 U+9266 # +3-3E61 U+937E # +3-3E62 U+9418 # +3-3E63 U+969C # +3-3E64 U+9798 # +3-3E65 U+4E0A # +3-3E66 U+4E08 # +3-3E67 U+4E1E # +3-3E68 U+4E57 # +3-3E69 U+5197 # +3-3E6A U+5270 # +3-3E6B U+57CE # +3-3E6C U+5834 # +3-3E6D U+58CC # +3-3E6E U+5B22 # +3-3E6F U+5E38 # +3-3E70 U+60C5 # +3-3E71 U+64FE # +3-3E72 U+6761 # +3-3E73 U+6756 # +3-3E74 U+6D44 # +3-3E75 U+72B6 # +3-3E76 U+7573 # +3-3E77 U+7A63 # +3-3E78 U+84B8 # +3-3E79 U+8B72 # +3-3E7A U+91B8 # +3-3E7B U+9320 # +3-3E7C U+5631 # +3-3E7D U+57F4 # +3-3E7E U+98FE # +3-3F21 U+62ED # +3-3F22 U+690D # +3-3F23 U+6B96 # +3-3F24 U+71ED # +3-3F25 U+7E54 # +3-3F26 U+8077 # +3-3F27 U+8272 # +3-3F28 U+89E6 # +3-3F29 U+98DF # +3-3F2A U+8755 # +3-3F2B U+8FB1 # +3-3F2C U+5C3B # +3-3F2D U+4F38 # +3-3F2E U+4FE1 # +3-3F2F U+4FB5 # +3-3F30 U+5507 # +3-3F31 U+5A20 # +3-3F32 U+5BDD # +3-3F33 U+5BE9 # +3-3F34 U+5FC3 # +3-3F35 U+614E # +3-3F36 U+632F # +3-3F37 U+65B0 # +3-3F38 U+664B # +3-3F39 U+68EE # +3-3F3A U+699B # +3-3F3B U+6D78 # +3-3F3C U+6DF1 # +3-3F3D U+7533 # +3-3F3E U+75B9 # +3-3F3F U+771F # +3-3F40 U+795E # +3-3F41 U+79E6 # +3-3F42 U+7D33 # +3-3F43 U+81E3 # +3-3F44 U+82AF # +3-3F45 U+85AA # +3-3F46 U+89AA # +3-3F47 U+8A3A # +3-3F48 U+8EAB # +3-3F49 U+8F9B # +3-3F4A U+9032 # +3-3F4B U+91DD # +3-3F4C U+9707 # +3-3F4D U+4EBA # +3-3F4E U+4EC1 # +3-3F4F U+5203 # +3-3F50 U+5875 # +3-3F51 U+58EC # +3-3F52 U+5C0B # +3-3F53 U+751A # +3-3F54 U+5C3D # +3-3F55 U+814E # +3-3F56 U+8A0A # +3-3F57 U+8FC5 # +3-3F58 U+9663 # +3-3F59 U+976D # +3-3F5A U+7B25 # +3-3F5B U+8ACF # +3-3F5C U+9808 # +3-3F5D U+9162 # +3-3F5E U+56F3 # +3-3F5F U+53A8 # +3-3F60 U+9017 # +3-3F61 U+5439 # +3-3F62 U+5782 # +3-3F63 U+5E25 # +3-3F64 U+63A8 # +3-3F65 U+6C34 # +3-3F66 U+708A # +3-3F67 U+7761 # +3-3F68 U+7C8B # +3-3F69 U+7FE0 # +3-3F6A U+8870 # +3-3F6B U+9042 # +3-3F6C U+9154 # +3-3F6D U+9310 # +3-3F6E U+9318 # +3-3F6F U+968F # +3-3F70 U+745E # +3-3F71 U+9AC4 # +3-3F72 U+5D07 # +3-3F73 U+5D69 # +3-3F74 U+6570 # +3-3F75 U+67A2 # +3-3F76 U+8DA8 # +3-3F77 U+96DB # +3-3F78 U+636E # +3-3F79 U+6749 # +3-3F7A U+6919 # +3-3F7B U+83C5 # +3-3F7C U+9817 # +3-3F7D U+96C0 # +3-3F7E U+88FE # +3-4021 U+6F84 # +3-4022 U+647A # +3-4023 U+5BF8 # +3-4024 U+4E16 # +3-4025 U+702C # +3-4026 U+755D # +3-4027 U+662F # +3-4028 U+51C4 # +3-4029 U+5236 # +3-402A U+52E2 # +3-402B U+59D3 # +3-402C U+5F81 # +3-402D U+6027 # +3-402E U+6210 # +3-402F U+653F # +3-4030 U+6574 # +3-4031 U+661F # +3-4032 U+6674 # +3-4033 U+68F2 # +3-4034 U+6816 # +3-4035 U+6B63 # +3-4036 U+6E05 # +3-4037 U+7272 # +3-4038 U+751F # +3-4039 U+76DB # +3-403A U+7CBE # +3-403B U+8056 # +3-403C U+58F0 # +3-403D U+88FD # +3-403E U+897F # +3-403F U+8AA0 # +3-4040 U+8A93 # +3-4041 U+8ACB # +3-4042 U+901D # +3-4043 U+9192 # +3-4044 U+9752 # +3-4045 U+9759 # +3-4046 U+6589 # +3-4047 U+7A0E # +3-4048 U+8106 # +3-4049 U+96BB # +3-404A U+5E2D # +3-404B U+60DC # +3-404C U+621A # +3-404D U+65A5 # +3-404E U+6614 # +3-404F U+6790 # +3-4050 U+77F3 # +3-4051 U+7A4D # +3-4052 U+7C4D # +3-4053 U+7E3E # +3-4054 U+810A # +3-4055 U+8CAC # +3-4056 U+8D64 # +3-4057 U+8DE1 # +3-4058 U+8E5F # +3-4059 U+78A9 # +3-405A U+5207 # +3-405B U+62D9 # +3-405C U+63A5 # +3-405D U+6442 # +3-405E U+6298 # +3-405F U+8A2D # +3-4060 U+7A83 # +3-4061 U+7BC0 # +3-4062 U+8AAC # +3-4063 U+96EA # +3-4064 U+7D76 # +3-4065 U+820C # +3-4066 U+8749 # +3-4067 U+4ED9 # +3-4068 U+5148 # +3-4069 U+5343 # +3-406A U+5360 # +3-406B U+5BA3 # +3-406C U+5C02 # +3-406D U+5C16 # +3-406E U+5DDD # +3-406F U+6226 # +3-4070 U+6247 # +3-4071 U+64B0 # +3-4072 U+6813 # +3-4073 U+6834 # +3-4074 U+6CC9 # +3-4075 U+6D45 # +3-4076 U+6D17 # +3-4077 U+67D3 # +3-4078 U+6F5C # +3-4079 U+714E # +3-407A U+717D # +3-407B U+65CB # +3-407C U+7A7F # +3-407D U+7BAD # +3-407E U+7DDA # +3-4121 U+7E4A # +3-4122 U+7FA8 # +3-4123 U+817A # +3-4124 U+821B # +3-4125 U+8239 # +3-4126 U+85A6 # +3-4127 U+8A6E # +3-4128 U+8CCE # +3-4129 U+8DF5 # +3-412A U+9078 # +3-412B U+9077 # +3-412C U+92AD # +3-412D U+9291 # +3-412E U+9583 # +3-412F U+9BAE # +3-4130 U+524D # +3-4131 U+5584 # +3-4132 U+6F38 # +3-4133 U+7136 # +3-4134 U+5168 # +3-4135 U+7985 # +3-4136 U+7E55 # +3-4137 U+81B3 # +3-4138 U+7CCE # +3-4139 U+564C # +3-413A U+5851 # +3-413B U+5CA8 # +3-413C U+63AA # +3-413D U+66FE # +3-413E U+66FD # +3-413F U+695A # +3-4140 U+72D9 # +3-4141 U+758F # +3-4142 U+758E # +3-4143 U+790E # +3-4144 U+7956 # +3-4145 U+79DF # +3-4146 U+7C97 # +3-4147 U+7D20 # +3-4148 U+7D44 # +3-4149 U+8607 # +3-414A U+8A34 # +3-414B U+963B # +3-414C U+9061 # +3-414D U+9F20 # +3-414E U+50E7 # +3-414F U+5275 # +3-4150 U+53CC # +3-4151 U+53E2 # +3-4152 U+5009 # +3-4153 U+55AA # +3-4154 U+58EE # +3-4155 U+594F # +3-4156 U+723D # +3-4157 U+5B8B # +3-4158 U+5C64 # +3-4159 U+531D # +3-415A U+60E3 # +3-415B U+60F3 # +3-415C U+635C # +3-415D U+6383 # +3-415E U+633F # +3-415F U+63BB # +3-4160 U+64CD # +3-4161 U+65E9 # +3-4162 U+66F9 # +3-4163 U+5DE3 # +3-4164 U+69CD # +3-4165 U+69FD # +3-4166 U+6F15 # +3-4167 U+71E5 # +3-4168 U+4E89 # +3-4169 U+75E9 # +3-416A U+76F8 # +3-416B U+7A93 # +3-416C U+7CDF # +3-416D U+7DCF # +3-416E U+7D9C # +3-416F U+8061 # +3-4170 U+8349 # +3-4171 U+8358 # +3-4172 U+846C # +3-4173 U+84BC # +3-4174 U+85FB # +3-4175 U+88C5 # +3-4176 U+8D70 # +3-4177 U+9001 # +3-4178 U+906D # +3-4179 U+9397 # +3-417A U+971C # +3-417B U+9A12 # +3-417C U+50CF # +3-417D U+5897 # +3-417E U+618E # +3-4221 U+81D3 # +3-4222 U+8535 # +3-4223 U+8D08 # +3-4224 U+9020 # +3-4225 U+4FC3 # +3-4226 U+5074 # +3-4227 U+5247 # +3-4228 U+5373 # +3-4229 U+606F # +3-422A U+6349 # +3-422B U+675F # +3-422C U+6E2C # +3-422D U+8DB3 # +3-422E U+901F # +3-422F U+4FD7 # +3-4230 U+5C5E # +3-4231 U+8CCA # +3-4232 U+65CF # +3-4233 U+7D9A # +3-4234 U+5352 # +3-4235 U+8896 # +3-4236 U+5176 # +3-4237 U+63C3 # +3-4238 U+5B58 # +3-4239 U+5B6B # +3-423A U+5C0A # +3-423B U+640D # +3-423C U+6751 # +3-423D U+905C # +3-423E U+4ED6 # +3-423F U+591A # +3-4240 U+592A # +3-4241 U+6C70 # +3-4242 U+8A51 # +3-4243 U+553E # +3-4244 U+5815 # +3-4245 U+59A5 # +3-4246 U+60F0 # +3-4247 U+6253 # +3-4248 U+67C1 # +3-4249 U+8235 # +3-424A U+6955 # +3-424B U+9640 # +3-424C U+99C4 # +3-424D U+9A28 # +3-424E U+4F53 # +3-424F U+5806 # +3-4250 U+5BFE # +3-4251 U+8010 # +3-4252 U+5CB1 # +3-4253 U+5E2F # +3-4254 U+5F85 # +3-4255 U+6020 # +3-4256 U+614B # +3-4257 U+6234 # +3-4258 U+66FF # +3-4259 U+6CF0 # +3-425A U+6EDE # +3-425B U+80CE # +3-425C U+817F # +3-425D U+82D4 # +3-425E U+888B # +3-425F U+8CB8 # +3-4260 U+9000 # +3-4261 U+902E # +3-4262 U+968A # +3-4263 U+9EDB # +3-4264 U+9BDB # +3-4265 U+4EE3 # +3-4266 U+53F0 # +3-4267 U+5927 # +3-4268 U+7B2C # +3-4269 U+918D # +3-426A U+984C # +3-426B U+9DF9 # +3-426C U+6EDD # +3-426D U+7027 # +3-426E U+5353 # +3-426F U+5544 # +3-4270 U+5B85 # +3-4271 U+6258 # +3-4272 U+629E # +3-4273 U+62D3 # +3-4274 U+6CA2 # +3-4275 U+6FEF # +3-4276 U+7422 # +3-4277 U+8A17 # +3-4278 U+9438 # +3-4279 U+6FC1 # +3-427A U+8AFE # +3-427B U+8338 # +3-427C U+51E7 # +3-427D U+86F8 # +3-427E U+53EA # +3-4321 U+53E9 # +3-4322 U+4F46 # +3-4323 U+9054 # +3-4324 U+8FB0 # +3-4325 U+596A # +3-4326 U+8131 # +3-4327 U+5DFD # +3-4328 U+7AEA # +3-4329 U+8FBF # +3-432A U+68DA # +3-432B U+8C37 # +3-432C U+72F8 # +3-432D U+9C48 # +3-432E U+6A3D # +3-432F U+8AB0 # +3-4330 U+4E39 # +3-4331 U+5358 # +3-4332 U+5606 # +3-4333 U+5766 # +3-4334 U+62C5 # +3-4335 U+63A2 # +3-4336 U+65E6 # +3-4337 U+6B4E # +3-4338 U+6DE1 # +3-4339 U+6E5B # +3-433A U+70AD # +3-433B U+77ED # +3-433C U+7AEF # +3-433D U+7BAA # +3-433E U+7DBB # +3-433F U+803D # +3-4340 U+80C6 # +3-4341 U+86CB # +3-4342 U+8A95 # +3-4343 U+935B # +3-4344 U+56E3 # +3-4345 U+58C7 # +3-4346 U+5F3E # +3-4347 U+65AD # +3-4348 U+6696 # +3-4349 U+6A80 # +3-434A U+6BB5 # +3-434B U+7537 # +3-434C U+8AC7 # +3-434D U+5024 # +3-434E U+77E5 # +3-434F U+5730 # +3-4350 U+5F1B # +3-4351 U+6065 # +3-4352 U+667A # +3-4353 U+6C60 # +3-4354 U+75F4 # +3-4355 U+7A1A # +3-4356 U+7F6E # +3-4357 U+81F4 # +3-4358 U+8718 # +3-4359 U+9045 # +3-435A U+99B3 # +3-435B U+7BC9 # +3-435C U+755C # +3-435D U+7AF9 # +3-435E U+7B51 # +3-435F U+84C4 # +3-4360 U+9010 # +3-4361 U+79E9 # +3-4362 U+7A92 # +3-4363 U+8336 # +3-4364 U+5AE1 # +3-4365 U+7740 # +3-4366 U+4E2D # +3-4367 U+4EF2 # +3-4368 U+5B99 # +3-4369 U+5FE0 # +3-436A U+62BD # +3-436B U+663C # +3-436C U+67F1 # +3-436D U+6CE8 # +3-436E U+866B # +3-436F U+8877 # +3-4370 U+8A3B # +3-4371 U+914E # +3-4372 U+92F3 # +3-4373 U+99D0 # +3-4374 U+6A17 # +3-4375 U+7026 # +3-4376 U+732A # +3-4377 U+82E7 # +3-4378 U+8457 # +3-4379 U+8CAF # +3-437A U+4E01 # +3-437B U+5146 # +3-437C U+51CB # +3-437D U+558B # +3-437E U+5BF5 # +3-4421 U+5E16 # +3-4422 U+5E33 # +3-4423 U+5E81 # +3-4424 U+5F14 # +3-4425 U+5F35 # +3-4426 U+5F6B # +3-4427 U+5FB4 # +3-4428 U+61F2 # +3-4429 U+6311 # +3-442A U+66A2 # +3-442B U+671D # +3-442C U+6F6E # +3-442D U+7252 # +3-442E U+753A # +3-442F U+773A # +3-4430 U+8074 # +3-4431 U+8139 # +3-4432 U+8178 # +3-4433 U+8776 # +3-4434 U+8ABF # +3-4435 U+8ADC # +3-4436 U+8D85 # +3-4437 U+8DF3 # +3-4438 U+929A # +3-4439 U+9577 # +3-443A U+9802 # +3-443B U+9CE5 # +3-443C U+52C5 # +3-443D U+6357 # +3-443E U+76F4 # +3-443F U+6715 # +3-4440 U+6C88 # +3-4441 U+73CD # +3-4442 U+8CC3 # +3-4443 U+93AE # +3-4444 U+9673 # +3-4445 U+6D25 # +3-4446 U+589C # +3-4447 U+690E # +3-4448 U+69CC # +3-4449 U+8FFD # +3-444A U+939A # +3-444B U+75DB # +3-444C U+901A # +3-444D U+585A # +3-444E U+6802 # +3-444F U+63B4 # +3-4450 U+69FB # +3-4451 U+4F43 # +3-4452 U+6F2C # +3-4453 U+67D8 # +3-4454 U+8FBB # +3-4455 U+8526 # +3-4456 U+7DB4 # +3-4457 U+9354 # +3-4458 U+693F # +3-4459 U+6F70 # +3-445A U+576A # +3-445B U+58F7 # +3-445C U+5B2C # +3-445D U+7D2C # +3-445E U+722A # +3-445F U+540A # +3-4460 U+91E3 # +3-4461 U+9DB4 # +3-4462 U+4EAD # +3-4463 U+4F4E # +3-4464 U+505C # +3-4465 U+5075 # +3-4466 U+5243 # +3-4467 U+8C9E # +3-4468 U+5448 # +3-4469 U+5824 # +3-446A U+5B9A # +3-446B U+5E1D # +3-446C U+5E95 # +3-446D U+5EAD # +3-446E U+5EF7 # +3-446F U+5F1F # +3-4470 U+608C # +3-4471 U+62B5 # +3-4472 U+633A # +3-4473 U+63D0 # +3-4474 U+68AF # +3-4475 U+6C40 # +3-4476 U+7887 # +3-4477 U+798E # +3-4478 U+7A0B # +3-4479 U+7DE0 # +3-447A U+8247 # +3-447B U+8A02 # +3-447C U+8AE6 # +3-447D U+8E44 # +3-447E U+9013 # +3-4521 U+90B8 # +3-4522 U+912D # +3-4523 U+91D8 # +3-4524 U+9F0E # +3-4525 U+6CE5 # +3-4526 U+6458 # +3-4527 U+64E2 # +3-4528 U+6575 # +3-4529 U+6EF4 # +3-452A U+7684 # +3-452B U+7B1B # +3-452C U+9069 # +3-452D U+93D1 # +3-452E U+6EBA # +3-452F U+54F2 # +3-4530 U+5FB9 # +3-4531 U+64A4 # +3-4532 U+8F4D # +3-4533 U+8FED # +3-4534 U+9244 # +3-4535 U+5178 # +3-4536 U+586B # +3-4537 U+5929 # +3-4538 U+5C55 # +3-4539 U+5E97 # +3-453A U+6DFB # +3-453B U+7E8F # +3-453C U+751C # +3-453D U+8CBC # +3-453E U+8EE2 # +3-453F U+985B # +3-4540 U+70B9 # +3-4541 U+4F1D # +3-4542 U+6BBF # +3-4543 U+6FB1 # +3-4544 U+7530 # +3-4545 U+96FB # +3-4546 U+514E # +3-4547 U+5410 # +3-4548 U+5835 # +3-4549 U+5857 # +3-454A U+59AC # +3-454B U+5C60 # +3-454C U+5F92 # +3-454D U+6597 # +3-454E U+675C # +3-454F U+6E21 # +3-4550 U+767B # +3-4551 U+83DF # +3-4552 U+8CED # +3-4553 U+9014 # +3-4554 U+90FD # +3-4555 U+934D # +3-4556 U+7825 # +3-4557 U+783A # +3-4558 U+52AA # +3-4559 U+5EA6 # +3-455A U+571F # +3-455B U+5974 # +3-455C U+6012 # +3-455D U+5012 # +3-455E U+515A # +3-455F U+51AC # +3-4560 U+51CD # +3-4561 U+5200 # +3-4562 U+5510 # +3-4563 U+5854 # +3-4564 U+5858 # +3-4565 U+5957 # +3-4566 U+5B95 # +3-4567 U+5CF6 # +3-4568 U+5D8B # +3-4569 U+60BC # +3-456A U+6295 # +3-456B U+642D # +3-456C U+6771 # +3-456D U+6843 # +3-456E U+68BC # +3-456F U+68DF # +3-4570 U+76D7 # +3-4571 U+6DD8 # +3-4572 U+6E6F # +3-4573 U+6D9B # +3-4574 U+706F # +3-4575 U+71C8 # +3-4576 U+5F53 # +3-4577 U+75D8 # +3-4578 U+7977 # +3-4579 U+7B49 # +3-457A U+7B54 # +3-457B U+7B52 # +3-457C U+7CD6 # +3-457D U+7D71 # +3-457E U+5230 # +3-4621 U+8463 # +3-4622 U+8569 # +3-4623 U+85E4 # +3-4624 U+8A0E # +3-4625 U+8B04 # +3-4626 U+8C46 # +3-4627 U+8E0F # +3-4628 U+9003 # +3-4629 U+900F # +3-462A U+9419 # +3-462B U+9676 # +3-462C U+982D # +3-462D U+9A30 # +3-462E U+95D8 # +3-462F U+50CD # +3-4630 U+52D5 # +3-4631 U+540C # +3-4632 U+5802 # +3-4633 U+5C0E # +3-4634 U+61A7 # +3-4635 U+649E # +3-4636 U+6D1E # +3-4637 U+77B3 # +3-4638 U+7AE5 # +3-4639 U+80F4 # +3-463A U+8404 # +3-463B U+9053 # +3-463C U+9285 # +3-463D U+5CE0 # +3-463E U+9D07 # +3-463F U+533F # +3-4640 U+5F97 # +3-4641 U+5FB3 # +3-4642 U+6D9C # +3-4643 U+7279 # +3-4644 U+7763 # +3-4645 U+79BF # +3-4646 U+7BE4 # +3-4647 U+6BD2 # +3-4648 U+72EC # +3-4649 U+8AAD # +3-464A U+6803 # +3-464B U+6A61 # +3-464C U+51F8 # +3-464D U+7A81 # +3-464E U+6934 # +3-464F U+5C4A # +3-4650 U+9CF6 # +3-4651 U+82EB # +3-4652 U+5BC5 # +3-4653 U+9149 # +3-4654 U+701E # +3-4655 U+5678 # +3-4656 U+5C6F # +3-4657 U+60C7 # +3-4658 U+6566 # +3-4659 U+6C8C # +3-465A U+8C5A # +3-465B U+9041 # +3-465C U+9813 # +3-465D U+5451 # +3-465E U+66C7 # +3-465F U+920D # +3-4660 U+5948 # +3-4661 U+90A3 # +3-4662 U+5185 # +3-4663 U+4E4D # +3-4664 U+51EA # +3-4665 U+8599 # +3-4666 U+8B0E # +3-4667 U+7058 # +3-4668 U+637A # +3-4669 U+934B # +3-466A U+6962 # +3-466B U+99B4 # +3-466C U+7E04 # +3-466D U+7577 # +3-466E U+5357 # +3-466F U+6960 # +3-4670 U+8EDF # +3-4671 U+96E3 # +3-4672 U+6C5D # +3-4673 U+4E8C # +3-4674 U+5C3C # +3-4675 U+5F10 # +3-4676 U+8FE9 # +3-4677 U+5302 # +3-4678 U+8CD1 # +3-4679 U+8089 # +3-467A U+8679 # +3-467B U+5EFF # +3-467C U+65E5 # +3-467D U+4E73 # +3-467E U+5165 # +3-4721 U+5982 # +3-4722 U+5C3F # +3-4723 U+97EE # +3-4724 U+4EFB # +3-4725 U+598A # +3-4726 U+5FCD # +3-4727 U+8A8D # +3-4728 U+6FE1 # +3-4729 U+79B0 # +3-472A U+7962 # +3-472B U+5BE7 # +3-472C U+8471 # +3-472D U+732B # +3-472E U+71B1 # +3-472F U+5E74 # +3-4730 U+5FF5 # +3-4731 U+637B # +3-4732 U+649A # +3-4733 U+71C3 # +3-4734 U+7C98 # +3-4735 U+4E43 # +3-4736 U+5EFC # +3-4737 U+4E4B # +3-4738 U+57DC # +3-4739 U+56A2 # +3-473A U+60A9 # +3-473B U+6FC3 # +3-473C U+7D0D # +3-473D U+80FD # +3-473E U+8133 # +3-473F U+81BF # +3-4740 U+8FB2 # +3-4741 U+8997 # +3-4742 U+86A4 # +3-4743 U+5DF4 # +3-4744 U+628A # +3-4745 U+64AD # +3-4746 U+8987 # +3-4747 U+6777 # +3-4748 U+6CE2 # +3-4749 U+6D3E # +3-474A U+7436 # +3-474B U+7834 # +3-474C U+5A46 # +3-474D U+7F75 # +3-474E U+82AD # +3-474F U+99AC # +3-4750 U+4FF3 # +3-4751 U+5EC3 # +3-4752 U+62DD # +3-4753 U+6392 # +3-4754 U+6557 # +3-4755 U+676F # +3-4756 U+76C3 # +3-4757 U+724C # +3-4758 U+80CC # +3-4759 U+80BA # +3-475A U+8F29 # +3-475B U+914D # +3-475C U+500D # +3-475D U+57F9 # +3-475E U+5A92 # +3-475F U+6885 # +3-4760 U+6973 # +3-4761 U+7164 # +3-4762 U+72FD # +3-4763 U+8CB7 # +3-4764 U+58F2 # +3-4765 U+8CE0 # +3-4766 U+966A # +3-4767 U+9019 # +3-4768 U+877F # +3-4769 U+79E4 # +3-476A U+77E7 # +3-476B U+8429 # +3-476C U+4F2F # +3-476D U+5265 # +3-476E U+535A # +3-476F U+62CD # +3-4770 U+67CF # +3-4771 U+6CCA # +3-4772 U+767D # +3-4773 U+7B94 # +3-4774 U+7C95 # +3-4775 U+8236 # +3-4776 U+8584 # +3-4777 U+8FEB # +3-4778 U+66DD # +3-4779 U+6F20 # +3-477A U+7206 # +3-477B U+7E1B # +3-477C U+83AB # +3-477D U+99C1 # +3-477E U+9EA6 # +3-4821 U+51FD # +3-4822 U+7BB1 # +3-4823 U+7872 # +3-4824 U+7BB8 # +3-4825 U+8087 # +3-4826 U+7B48 # +3-4827 U+6AE8 # +3-4828 U+5E61 # +3-4829 U+808C # +3-482A U+7551 # +3-482B U+7560 # +3-482C U+516B # +3-482D U+9262 # +3-482E U+6E8C # +3-482F U+767A # +3-4830 U+9197 # +3-4831 U+9AEA # +3-4832 U+4F10 # +3-4833 U+7F70 # +3-4834 U+629C # +3-4835 U+7B4F # +3-4836 U+95A5 # +3-4837 U+9CE9 # +3-4838 U+567A # +3-4839 U+5859 # +3-483A U+86E4 # +3-483B U+96BC # +3-483C U+4F34 # +3-483D U+5224 # +3-483E U+534A # +3-483F U+53CD # +3-4840 U+53DB # +3-4841 U+5E06 # +3-4842 U+642C # +3-4843 U+6591 # +3-4844 U+677F # +3-4845 U+6C3E # +3-4846 U+6C4E # +3-4847 U+7248 # +3-4848 U+72AF # +3-4849 U+73ED # +3-484A U+7554 # +3-484B U+7E41 # +3-484C U+822C # +3-484D U+85E9 # +3-484E U+8CA9 # +3-484F U+7BC4 # +3-4850 U+91C6 # +3-4851 U+7169 # +3-4852 U+9812 # +3-4853 U+98EF # +3-4854 U+633D # +3-4855 U+6669 # +3-4856 U+756A # +3-4857 U+76E4 # +3-4858 U+78D0 # +3-4859 U+8543 # +3-485A U+86EE # +3-485B U+532A # +3-485C U+5351 # +3-485D U+5426 # +3-485E U+5983 # +3-485F U+5E87 # +3-4860 U+5F7C # +3-4861 U+60B2 # +3-4862 U+6249 # +3-4863 U+6279 # +3-4864 U+62AB # +3-4865 U+6590 # +3-4866 U+6BD4 # +3-4867 U+6CCC # +3-4868 U+75B2 # +3-4869 U+76AE # +3-486A U+7891 # +3-486B U+79D8 # +3-486C U+7DCB # +3-486D U+7F77 # +3-486E U+80A5 # +3-486F U+88AB # +3-4870 U+8AB9 # +3-4871 U+8CBB # +3-4872 U+907F # +3-4873 U+975E # +3-4874 U+98DB # +3-4875 U+6A0B # +3-4876 U+7C38 # +3-4877 U+5099 # +3-4878 U+5C3E # +3-4879 U+5FAE # +3-487A U+6787 # +3-487B U+6BD8 # +3-487C U+7435 # +3-487D U+7709 # +3-487E U+7F8E # +3-4921 U+9F3B # +3-4922 U+67CA # +3-4923 U+7A17 # +3-4924 U+5339 # +3-4925 U+758B # +3-4926 U+9AED # +3-4927 U+5F66 # +3-4928 U+819D # +3-4929 U+83F1 # +3-492A U+8098 # +3-492B U+5F3C # +3-492C U+5FC5 # +3-492D U+7562 # +3-492E U+7B46 # +3-492F U+903C # +3-4930 U+6867 # +3-4931 U+59EB # +3-4932 U+5A9B # +3-4933 U+7D10 # +3-4934 U+767E # +3-4935 U+8B2C # +3-4936 U+4FF5 # +3-4937 U+5F6A # +3-4938 U+6A19 # +3-4939 U+6C37 # +3-493A U+6F02 # +3-493B U+74E2 # +3-493C U+7968 # +3-493D U+8868 # +3-493E U+8A55 # +3-493F U+8C79 # +3-4940 U+5EDF # +3-4941 U+63CF # +3-4942 U+75C5 # +3-4943 U+79D2 # +3-4944 U+82D7 # +3-4945 U+9328 # +3-4946 U+92F2 # +3-4947 U+849C # +3-4948 U+86ED # +3-4949 U+9C2D # +3-494A U+54C1 # +3-494B U+5F6C # +3-494C U+658C # +3-494D U+6D5C # +3-494E U+7015 # +3-494F U+8CA7 # +3-4950 U+8CD3 # +3-4951 U+983B # +3-4952 U+654F # +3-4953 U+74F6 # +3-4954 U+4E0D # +3-4955 U+4ED8 # +3-4956 U+57E0 # +3-4957 U+592B # +3-4958 U+5A66 # +3-4959 U+5BCC # +3-495A U+51A8 # +3-495B U+5E03 # +3-495C U+5E9C # +3-495D U+6016 # +3-495E U+6276 # +3-495F U+6577 # +3-4960 U+65A7 # +3-4961 U+666E # +3-4962 U+6D6E # +3-4963 U+7236 # +3-4964 U+7B26 # +3-4965 U+8150 # +3-4966 U+819A # +3-4967 U+8299 # +3-4968 U+8B5C # +3-4969 U+8CA0 # +3-496A U+8CE6 # +3-496B U+8D74 # +3-496C U+961C # +3-496D U+9644 # +3-496E U+4FAE # +3-496F U+64AB # +3-4970 U+6B66 # +3-4971 U+821E # +3-4972 U+8461 # +3-4973 U+856A # +3-4974 U+90E8 # +3-4975 U+5C01 # +3-4976 U+6953 # +3-4977 U+98A8 # +3-4978 U+847A # +3-4979 U+8557 # +3-497A U+4F0F # +3-497B U+526F # +3-497C U+5FA9 # +3-497D U+5E45 # +3-497E U+670D # +3-4A21 U+798F # +3-4A22 U+8179 # +3-4A23 U+8907 # +3-4A24 U+8986 # +3-4A25 U+6DF5 # +3-4A26 U+5F17 # +3-4A27 U+6255 # +3-4A28 U+6CB8 # +3-4A29 U+4ECF # +3-4A2A U+7269 # +3-4A2B U+9B92 # +3-4A2C U+5206 # +3-4A2D U+543B # +3-4A2E U+5674 # +3-4A2F U+58B3 # +3-4A30 U+61A4 # +3-4A31 U+626E # +3-4A32 U+711A # +3-4A33 U+596E # +3-4A34 U+7C89 # +3-4A35 U+7CDE # +3-4A36 U+7D1B # +3-4A37 U+96F0 # +3-4A38 U+6587 # +3-4A39 U+805E # +3-4A3A U+4E19 # +3-4A3B U+4F75 # +3-4A3C U+5175 # +3-4A3D U+5840 # +3-4A3E U+5E63 # +3-4A3F U+5E73 # +3-4A40 U+5F0A # +3-4A41 U+67C4 # +3-4A42 U+4E26 # +3-4A43 U+853D # +3-4A44 U+9589 # +3-4A45 U+965B # +3-4A46 U+7C73 # +3-4A47 U+9801 # +3-4A48 U+50FB # +3-4A49 U+58C1 # +3-4A4A U+7656 # +3-4A4B U+78A7 # +3-4A4C U+5225 # +3-4A4D U+77A5 # +3-4A4E U+8511 # +3-4A4F U+7B86 # +3-4A50 U+504F # +3-4A51 U+5909 # +3-4A52 U+7247 # +3-4A53 U+7BC7 # +3-4A54 U+7DE8 # +3-4A55 U+8FBA # +3-4A56 U+8FD4 # +3-4A57 U+904D # +3-4A58 U+4FBF # +3-4A59 U+52C9 # +3-4A5A U+5A29 # +3-4A5B U+5F01 # +3-4A5C U+97AD # +3-4A5D U+4FDD # +3-4A5E U+8217 # +3-4A5F U+92EA # +3-4A60 U+5703 # +3-4A61 U+6355 # +3-4A62 U+6B69 # +3-4A63 U+752B # +3-4A64 U+88DC # +3-4A65 U+8F14 # +3-4A66 U+7A42 # +3-4A67 U+52DF # +3-4A68 U+5893 # +3-4A69 U+6155 # +3-4A6A U+620A # +3-4A6B U+66AE # +3-4A6C U+6BCD # +3-4A6D U+7C3F # +3-4A6E U+83E9 # +3-4A6F U+5023 # +3-4A70 U+4FF8 # +3-4A71 U+5305 # +3-4A72 U+5446 # +3-4A73 U+5831 # +3-4A74 U+5949 # +3-4A75 U+5B9D # +3-4A76 U+5CF0 # +3-4A77 U+5CEF # +3-4A78 U+5D29 # +3-4A79 U+5E96 # +3-4A7A U+62B1 # +3-4A7B U+6367 # +3-4A7C U+653E # +3-4A7D U+65B9 # +3-4A7E U+670B # +3-4B21 U+6CD5 # +3-4B22 U+6CE1 # +3-4B23 U+70F9 # +3-4B24 U+7832 # +3-4B25 U+7E2B # +3-4B26 U+80DE # +3-4B27 U+82B3 # +3-4B28 U+840C # +3-4B29 U+84EC # +3-4B2A U+8702 # +3-4B2B U+8912 # +3-4B2C U+8A2A # +3-4B2D U+8C4A # +3-4B2E U+90A6 # +3-4B2F U+92D2 # +3-4B30 U+98FD # +3-4B31 U+9CF3 # +3-4B32 U+9D6C # +3-4B33 U+4E4F # +3-4B34 U+4EA1 # +3-4B35 U+508D # +3-4B36 U+5256 # +3-4B37 U+574A # +3-4B38 U+59A8 # +3-4B39 U+5E3D # +3-4B3A U+5FD8 # +3-4B3B U+5FD9 # +3-4B3C U+623F # +3-4B3D U+66B4 # +3-4B3E U+671B # +3-4B3F U+67D0 # +3-4B40 U+68D2 # +3-4B41 U+5192 # +3-4B42 U+7D21 # +3-4B43 U+80AA # +3-4B44 U+81A8 # +3-4B45 U+8B00 # +3-4B46 U+8C8C # +3-4B47 U+8CBF # +3-4B48 U+927E # +3-4B49 U+9632 # +3-4B4A U+5420 # +3-4B4B U+982C # +3-4B4C U+5317 # +3-4B4D U+50D5 # +3-4B4E U+535C # +3-4B4F U+58A8 # +3-4B50 U+64B2 # +3-4B51 U+6734 # +3-4B52 U+7267 # +3-4B53 U+7766 # +3-4B54 U+7A46 # +3-4B55 U+91E6 # +3-4B56 U+52C3 # +3-4B57 U+6CA1 # +3-4B58 U+6B86 # +3-4B59 U+5800 # +3-4B5A U+5E4C # +3-4B5B U+5954 # +3-4B5C U+672C # +3-4B5D U+7FFB # +3-4B5E U+51E1 # +3-4B5F U+76C6 # +3-4B60 U+6469 # +3-4B61 U+78E8 # +3-4B62 U+9B54 # +3-4B63 U+9EBB # +3-4B64 U+57CB # +3-4B65 U+59B9 # +3-4B66 U+6627 # +3-4B67 U+679A # +3-4B68 U+6BCE # +3-4B69 U+54E9 # +3-4B6A U+69D9 # +3-4B6B U+5E55 # +3-4B6C U+819C # +3-4B6D U+6795 # +3-4B6E U+9BAA # +3-4B6F U+67FE # +3-4B70 U+9C52 # +3-4B71 U+685D # +3-4B72 U+4EA6 # +3-4B73 U+4FE3 # +3-4B74 U+53C8 # +3-4B75 U+62B9 # +3-4B76 U+672B # +3-4B77 U+6CAB # +3-4B78 U+8FC4 # +3-4B79 U+4FAD # +3-4B7A U+7E6D # +3-4B7B U+9EBF # +3-4B7C U+4E07 # +3-4B7D U+6162 # +3-4B7E U+6E80 # +3-4C21 U+6F2B # +3-4C22 U+8513 # +3-4C23 U+5473 # +3-4C24 U+672A # +3-4C25 U+9B45 # +3-4C26 U+5DF3 # +3-4C27 U+7B95 # +3-4C28 U+5CAC # +3-4C29 U+5BC6 # +3-4C2A U+871C # +3-4C2B U+6E4A # +3-4C2C U+84D1 # +3-4C2D U+7A14 # +3-4C2E U+8108 # +3-4C2F U+5999 # +3-4C30 U+7C8D # +3-4C31 U+6C11 # +3-4C32 U+7720 # +3-4C33 U+52D9 # +3-4C34 U+5922 # +3-4C35 U+7121 # +3-4C36 U+725F # +3-4C37 U+77DB # +3-4C38 U+9727 # +3-4C39 U+9D61 # +3-4C3A U+690B # +3-4C3B U+5A7F # +3-4C3C U+5A18 # +3-4C3D U+51A5 # +3-4C3E U+540D # +3-4C3F U+547D # +3-4C40 U+660E # +3-4C41 U+76DF # +3-4C42 U+8FF7 # +3-4C43 U+9298 # +3-4C44 U+9CF4 # +3-4C45 U+59EA # +3-4C46 U+725D # +3-4C47 U+6EC5 # +3-4C48 U+514D # +3-4C49 U+68C9 # +3-4C4A U+7DBF # +3-4C4B U+7DEC # +3-4C4C U+9762 # +3-4C4D U+9EBA # +3-4C4E U+6478 # +3-4C4F U+6A21 # +3-4C50 U+8302 # +3-4C51 U+5984 # +3-4C52 U+5B5F # +3-4C53 U+6BDB # +3-4C54 U+731B # +3-4C55 U+76F2 # +3-4C56 U+7DB2 # +3-4C57 U+8017 # +3-4C58 U+8499 # +3-4C59 U+5132 # +3-4C5A U+6728 # +3-4C5B U+9ED9 # +3-4C5C U+76EE # +3-4C5D U+6762 # +3-4C5E U+52FF # +3-4C5F U+9905 # +3-4C60 U+5C24 # +3-4C61 U+623B # +3-4C62 U+7C7E # +3-4C63 U+8CB0 # +3-4C64 U+554F # +3-4C65 U+60B6 # +3-4C66 U+7D0B # +3-4C67 U+9580 # +3-4C68 U+5301 # +3-4C69 U+4E5F # +3-4C6A U+51B6 # +3-4C6B U+591C # +3-4C6C U+723A # +3-4C6D U+8036 # +3-4C6E U+91CE # +3-4C6F U+5F25 # +3-4C70 U+77E2 # +3-4C71 U+5384 # +3-4C72 U+5F79 # +3-4C73 U+7D04 # +3-4C74 U+85AC # +3-4C75 U+8A33 # +3-4C76 U+8E8D # +3-4C77 U+9756 # +3-4C78 U+67F3 # +3-4C79 U+85AE # +3-4C7A U+9453 # +3-4C7B U+6109 # +3-4C7C U+6108 # +3-4C7D U+6CB9 # +3-4C7E U+7652 # +3-4D21 U+8AED # +3-4D22 U+8F38 # +3-4D23 U+552F # +3-4D24 U+4F51 # +3-4D25 U+512A # +3-4D26 U+52C7 # +3-4D27 U+53CB # +3-4D28 U+5BA5 # +3-4D29 U+5E7D # +3-4D2A U+60A0 # +3-4D2B U+6182 # +3-4D2C U+63D6 # +3-4D2D U+6709 # +3-4D2E U+67DA # +3-4D2F U+6E67 # +3-4D30 U+6D8C # +3-4D31 U+7336 # +3-4D32 U+7337 # +3-4D33 U+7531 # +3-4D34 U+7950 # +3-4D35 U+88D5 # +3-4D36 U+8A98 # +3-4D37 U+904A # +3-4D38 U+9091 # +3-4D39 U+90F5 # +3-4D3A U+96C4 # +3-4D3B U+878D # +3-4D3C U+5915 # +3-4D3D U+4E88 # +3-4D3E U+4F59 # +3-4D3F U+4E0E # +3-4D40 U+8A89 # +3-4D41 U+8F3F # +3-4D42 U+9810 # +3-4D43 U+50AD # +3-4D44 U+5E7C # +3-4D45 U+5996 # +3-4D46 U+5BB9 # +3-4D47 U+5EB8 # +3-4D48 U+63DA # +3-4D49 U+63FA # +3-4D4A U+64C1 # +3-4D4B U+66DC # +3-4D4C U+694A # +3-4D4D U+69D8 # +3-4D4E U+6D0B # +3-4D4F U+6EB6 # +3-4D50 U+7194 # +3-4D51 U+7528 # +3-4D52 U+7AAF # +3-4D53 U+7F8A # +3-4D54 U+8000 # +3-4D55 U+8449 # +3-4D56 U+84C9 # +3-4D57 U+8981 # +3-4D58 U+8B21 # +3-4D59 U+8E0A # +3-4D5A U+9065 # +3-4D5B U+967D # +3-4D5C U+990A # +3-4D5D U+617E # +3-4D5E U+6291 # +3-4D5F U+6B32 # +3-4D60 U+6C83 # +3-4D61 U+6D74 # +3-4D62 U+7FCC # +3-4D63 U+7FFC # +3-4D64 U+6DC0 # +3-4D65 U+7F85 # +3-4D66 U+87BA # +3-4D67 U+88F8 # +3-4D68 U+6765 # +3-4D69 U+83B1 # +3-4D6A U+983C # +3-4D6B U+96F7 # +3-4D6C U+6D1B # +3-4D6D U+7D61 # +3-4D6E U+843D # +3-4D6F U+916A # +3-4D70 U+4E71 # +3-4D71 U+5375 # +3-4D72 U+5D50 # +3-4D73 U+6B04 # +3-4D74 U+6FEB # +3-4D75 U+85CD # +3-4D76 U+862D # +3-4D77 U+89A7 # +3-4D78 U+5229 # +3-4D79 U+540F # +3-4D7A U+5C65 # +3-4D7B U+674E # +3-4D7C U+68A8 # +3-4D7D U+7406 # +3-4D7E U+7483 # +3-4E21 U+75E2 # +3-4E22 U+88CF # +3-4E23 U+88E1 # +3-4E24 U+91CC # +3-4E25 U+96E2 # +3-4E26 U+9678 # +3-4E27 U+5F8B # +3-4E28 U+7387 # +3-4E29 U+7ACB # +3-4E2A U+844E # +3-4E2B U+63A0 # +3-4E2C U+7565 # +3-4E2D U+5289 # +3-4E2E U+6D41 # +3-4E2F U+6E9C # +3-4E30 U+7409 # +3-4E31 U+7559 # +3-4E32 U+786B # +3-4E33 U+7C92 # +3-4E34 U+9686 # +3-4E35 U+7ADC # +3-4E36 U+9F8D # +3-4E37 U+4FB6 # +3-4E38 U+616E # +3-4E39 U+65C5 # +3-4E3A U+865C # +3-4E3B U+4E86 # +3-4E3C U+4EAE # +3-4E3D U+50DA # +3-4E3E U+4E21 # +3-4E3F U+51CC # +3-4E40 U+5BEE # +3-4E41 U+6599 # +3-4E42 U+6881 # +3-4E43 U+6DBC # +3-4E44 U+731F # +3-4E45 U+7642 # +3-4E46 U+77AD # +3-4E47 U+7A1C # +3-4E48 U+7CE7 # +3-4E49 U+826F # +3-4E4A U+8AD2 # +3-4E4B U+907C # +3-4E4C U+91CF # +3-4E4D U+9675 # +3-4E4E U+9818 # +3-4E4F U+529B # +3-4E50 U+7DD1 # +3-4E51 U+502B # +3-4E52 U+5398 # +3-4E53 U+6797 # +3-4E54 U+6DCB # +3-4E55 U+71D0 # +3-4E56 U+7433 # +3-4E57 U+81E8 # +3-4E58 U+8F2A # +3-4E59 U+96A3 # +3-4E5A U+9C57 # +3-4E5B U+9E9F # +3-4E5C U+7460 # +3-4E5D U+5841 # +3-4E5E U+6D99 # +3-4E5F U+7D2F # +3-4E60 U+985E # +3-4E61 U+4EE4 # +3-4E62 U+4F36 # +3-4E63 U+4F8B # +3-4E64 U+51B7 # +3-4E65 U+52B1 # +3-4E66 U+5DBA # +3-4E67 U+601C # +3-4E68 U+73B2 # +3-4E69 U+793C # +3-4E6A U+82D3 # +3-4E6B U+9234 # +3-4E6C U+96B7 # +3-4E6D U+96F6 # +3-4E6E U+970A # +3-4E6F U+9E97 # +3-4E70 U+9F62 # +3-4E71 U+66A6 # +3-4E72 U+6B74 # +3-4E73 U+5217 # +3-4E74 U+52A3 # +3-4E75 U+70C8 # +3-4E76 U+88C2 # +3-4E77 U+5EC9 # +3-4E78 U+604B # +3-4E79 U+6190 # +3-4E7A U+6F23 # +3-4E7B U+7149 # +3-4E7C U+7C3E # +3-4E7D U+7DF4 # +3-4E7E U+806F # +3-4F21 U+84EE # +3-4F22 U+9023 # +3-4F23 U+932C # +3-4F24 U+5442 # +3-4F25 U+9B6F # +3-4F26 U+6AD3 # +3-4F27 U+7089 # +3-4F28 U+8CC2 # +3-4F29 U+8DEF # +3-4F2A U+9732 # +3-4F2B U+52B4 # +3-4F2C U+5A41 # +3-4F2D U+5ECA # +3-4F2E U+5F04 # +3-4F2F U+6717 # +3-4F30 U+697C # +3-4F31 U+6994 # +3-4F32 U+6D6A # +3-4F33 U+6F0F # +3-4F34 U+7262 # +3-4F35 U+72FC # +3-4F36 U+7BED # +3-4F37 U+8001 # +3-4F38 U+807E # +3-4F39 U+874B # +3-4F3A U+90CE # +3-4F3B U+516D # +3-4F3C U+9E93 # +3-4F3D U+7984 # +3-4F3E U+808B # +3-4F3F U+9332 # +3-4F40 U+8AD6 # +3-4F41 U+502D # +3-4F42 U+548C # +3-4F43 U+8A71 # +3-4F44 U+6B6A # +3-4F45 U+8CC4 # +3-4F46 U+8107 # +3-4F47 U+60D1 # +3-4F48 U+67A0 # +3-4F49 U+9DF2 # +3-4F4A U+4E99 # +3-4F4B U+4E98 # +3-4F4C U+9C10 # +3-4F4D U+8A6B # +3-4F4E U+85C1 # +3-4F4F U+8568 # +3-4F50 U+6900 # +3-4F51 U+6E7E # +3-4F52 U+7897 # +3-4F53 U+8155 # +3-4F54 U+20B9F # [2004] +3-4F55 U+5B41 # [2000] +3-4F56 U+5B56 # [2000] +3-4F57 U+5B7D # [2000] +3-4F58 U+5B93 # [2000] +3-4F59 U+5BD8 # [2000] +3-4F5A U+5BEC # [2000] +3-4F5B U+5C12 # [2000] +3-4F5C U+5C1E # [2000] +3-4F5D U+5C23 # [2000] +3-4F5E U+5C2B # [2000] +3-4F5F U+378D # [2000] +3-4F60 U+5C62 # [2000] +3-4F61 U+FA3B # CJK COMPATIBILITY IDEOGRAPH-FA3B [2000] [Unicode3.2] +3-4F62 U+FA3C # CJK COMPATIBILITY IDEOGRAPH-FA3C [2000] [Unicode3.2] +3-4F63 U+216B4 # [2000] [Unicode3.1] Private: U+F792 +3-4F64 U+5C7A # [2000] +3-4F65 U+5C8F # [2000] +3-4F66 U+5C9F # [2000] +3-4F67 U+5CA3 # [2000] +3-4F68 U+5CAA # [2000] +3-4F69 U+5CBA # [2000] +3-4F6A U+5CCB # [2000] +3-4F6B U+5CD0 # [2000] +3-4F6C U+5CD2 # [2000] +3-4F6D U+5CF4 # [2000] +3-4F6E U+21E34 # [2000] [Unicode3.1] Private: U+F793 +3-4F6F U+37E2 # [2000] +3-4F70 U+5D0D # [2000] +3-4F71 U+5D27 # [2000] +3-4F72 U+FA11 # CJK COMPATIBILITY IDEOGRAPH-FA11 [2000] +3-4F73 U+5D46 # [2000] +3-4F74 U+5D47 # [2000] +3-4F75 U+5D53 # [2000] +3-4F76 U+5D4A # [2000] +3-4F77 U+5D6D # [2000] +3-4F78 U+5D81 # [2000] +3-4F79 U+5DA0 # [2000] +3-4F7A U+5DA4 # [2000] +3-4F7B U+5DA7 # [2000] +3-4F7C U+5DB8 # [2000] +3-4F7D U+5DCB # [2000] +3-4F7E U+541E # [2004] +3-5021 U+5F0C # +3-5022 U+4E10 # +3-5023 U+4E15 # +3-5024 U+4E2A # +3-5025 U+4E31 # +3-5026 U+4E36 # +3-5027 U+4E3C # +3-5028 U+4E3F # +3-5029 U+4E42 # +3-502A U+4E56 # +3-502B U+4E58 # +3-502C U+4E82 # +3-502D U+4E85 # +3-502E U+8C6B # +3-502F U+4E8A # +3-5030 U+8212 # +3-5031 U+5F0D # +3-5032 U+4E8E # +3-5033 U+4E9E # +3-5034 U+4E9F # +3-5035 U+4EA0 # +3-5036 U+4EA2 # +3-5037 U+4EB0 # +3-5038 U+4EB3 # +3-5039 U+4EB6 # +3-503A U+4ECE # +3-503B U+4ECD # +3-503C U+4EC4 # +3-503D U+4EC6 # +3-503E U+4EC2 # +3-503F U+4ED7 # +3-5040 U+4EDE # +3-5041 U+4EED # +3-5042 U+4EDF # +3-5043 U+4EF7 # +3-5044 U+4F09 # +3-5045 U+4F5A # +3-5046 U+4F30 # +3-5047 U+4F5B # +3-5048 U+4F5D # +3-5049 U+4F57 # +3-504A U+4F47 # +3-504B U+4F76 # +3-504C U+4F88 # +3-504D U+4F8F # +3-504E U+4F98 # +3-504F U+4F7B # +3-5050 U+4F69 # +3-5051 U+4F70 # +3-5052 U+4F91 # +3-5053 U+4F6F # +3-5054 U+4F86 # +3-5055 U+4F96 # +3-5056 U+5118 # +3-5057 U+4FD4 # +3-5058 U+4FDF # +3-5059 U+4FCE # +3-505A U+4FD8 # +3-505B U+4FDB # +3-505C U+4FD1 # +3-505D U+4FDA # +3-505E U+4FD0 # +3-505F U+4FE4 # +3-5060 U+4FE5 # +3-5061 U+501A # +3-5062 U+5028 # +3-5063 U+5014 # +3-5064 U+502A # +3-5065 U+5025 # +3-5066 U+5005 # +3-5067 U+4F1C # +3-5068 U+4FF6 # +3-5069 U+5021 # +3-506A U+5029 # +3-506B U+502C # +3-506C U+4FFE # +3-506D U+4FEF # +3-506E U+5011 # +3-506F U+5006 # +3-5070 U+5043 # +3-5071 U+5047 # +3-5072 U+6703 # +3-5073 U+5055 # +3-5074 U+5050 # +3-5075 U+5048 # +3-5076 U+505A # +3-5077 U+5056 # +3-5078 U+506C # +3-5079 U+5078 # +3-507A U+5080 # +3-507B U+509A # +3-507C U+5085 # +3-507D U+50B4 # +3-507E U+50B2 # +3-5121 U+50C9 # +3-5122 U+50CA # +3-5123 U+50B3 # +3-5124 U+50C2 # +3-5125 U+50D6 # +3-5126 U+50DE # +3-5127 U+50E5 # +3-5128 U+50ED # +3-5129 U+50E3 # +3-512A U+50EE # +3-512B U+50F9 # +3-512C U+50F5 # +3-512D U+5109 # +3-512E U+5101 # +3-512F U+5102 # +3-5130 U+5116 # +3-5131 U+5115 # +3-5132 U+5114 # +3-5133 U+511A # +3-5134 U+5121 # +3-5135 U+513A # +3-5136 U+5137 # +3-5137 U+513C # +3-5138 U+513B # +3-5139 U+513F # +3-513A U+5140 # +3-513B U+5152 # +3-513C U+514C # +3-513D U+5154 # +3-513E U+5162 # +3-513F U+7AF8 # +3-5140 U+5169 # +3-5141 U+516A # +3-5142 U+516E # +3-5143 U+5180 # +3-5144 U+5182 # +3-5145 U+56D8 # +3-5146 U+518C # +3-5147 U+5189 # +3-5148 U+518F # +3-5149 U+5191 # +3-514A U+5193 # +3-514B U+5195 # +3-514C U+5196 # +3-514D U+51A4 # +3-514E U+51A6 # +3-514F U+51A2 # +3-5150 U+51A9 # +3-5151 U+51AA # +3-5152 U+51AB # +3-5153 U+51B3 # +3-5154 U+51B1 # +3-5155 U+51B2 # +3-5156 U+51B0 # +3-5157 U+51B5 # +3-5158 U+51BD # +3-5159 U+51C5 # +3-515A U+51C9 # +3-515B U+51DB # +3-515C U+51E0 # +3-515D U+8655 # +3-515E U+51E9 # +3-515F U+51ED # +3-5160 U+51F0 # +3-5161 U+51F5 # +3-5162 U+51FE # +3-5163 U+5204 # +3-5164 U+520B # +3-5165 U+5214 # +3-5166 U+520E # +3-5167 U+5227 # +3-5168 U+522A # +3-5169 U+522E # +3-516A U+5233 # +3-516B U+5239 # +3-516C U+524F # +3-516D U+5244 # +3-516E U+524B # +3-516F U+524C # +3-5170 U+525E # +3-5171 U+5254 # +3-5172 U+526A # +3-5173 U+5274 # +3-5174 U+5269 # +3-5175 U+5273 # +3-5176 U+527F # +3-5177 U+527D # +3-5178 U+528D # +3-5179 U+5294 # +3-517A U+5292 # +3-517B U+5271 # +3-517C U+5288 # +3-517D U+5291 # +3-517E U+8FA8 # +3-5221 U+8FA7 # +3-5222 U+52AC # +3-5223 U+52AD # +3-5224 U+52BC # +3-5225 U+52B5 # +3-5226 U+52C1 # +3-5227 U+52CD # +3-5228 U+52D7 # +3-5229 U+52DE # +3-522A U+52E3 # +3-522B U+52E6 # +3-522C U+98ED # +3-522D U+52E0 # +3-522E U+52F3 # +3-522F U+52F5 # +3-5230 U+52F8 # +3-5231 U+52F9 # +3-5232 U+5306 # +3-5233 U+5308 # +3-5234 U+7538 # +3-5235 U+530D # +3-5236 U+5310 # +3-5237 U+530F # +3-5238 U+5315 # +3-5239 U+531A # +3-523A U+5323 # +3-523B U+532F # +3-523C U+5331 # +3-523D U+5333 # +3-523E U+5338 # +3-523F U+5340 # +3-5240 U+5346 # +3-5241 U+5345 # +3-5242 U+4E17 # +3-5243 U+5349 # +3-5244 U+534D # +3-5245 U+51D6 # +3-5246 U+535E # +3-5247 U+5369 # +3-5248 U+536E # +3-5249 U+5918 # +3-524A U+537B # +3-524B U+5377 # +3-524C U+5382 # +3-524D U+5396 # +3-524E U+53A0 # +3-524F U+53A6 # +3-5250 U+53A5 # +3-5251 U+53AE # +3-5252 U+53B0 # +3-5253 U+53B6 # +3-5254 U+53C3 # +3-5255 U+7C12 # +3-5256 U+96D9 # +3-5257 U+53DF # +3-5258 U+66FC # +3-5259 U+71EE # +3-525A U+53EE # +3-525B U+53E8 # +3-525C U+53ED # +3-525D U+53FA # +3-525E U+5401 # +3-525F U+543D # +3-5260 U+5440 # +3-5261 U+542C # +3-5262 U+542D # +3-5263 U+543C # +3-5264 U+542E # +3-5265 U+5436 # +3-5266 U+5429 # +3-5267 U+541D # +3-5268 U+544E # +3-5269 U+548F # +3-526A U+5475 # +3-526B U+548E # +3-526C U+545F # +3-526D U+5471 # +3-526E U+5477 # +3-526F U+5470 # +3-5270 U+5492 # +3-5271 U+547B # +3-5272 U+5480 # +3-5273 U+5476 # +3-5274 U+5484 # +3-5275 U+5490 # +3-5276 U+5486 # +3-5277 U+54C7 # +3-5278 U+54A2 # +3-5279 U+54B8 # +3-527A U+54A5 # +3-527B U+54AC # +3-527C U+54C4 # +3-527D U+54C8 # +3-527E U+54A8 # +3-5321 U+54AB # +3-5322 U+54C2 # +3-5323 U+54A4 # +3-5324 U+54BE # +3-5325 U+54BC # +3-5326 U+54D8 # +3-5327 U+54E5 # +3-5328 U+54E6 # +3-5329 U+550F # +3-532A U+5514 # +3-532B U+54FD # +3-532C U+54EE # +3-532D U+54ED # +3-532E U+54FA # +3-532F U+54E2 # +3-5330 U+5539 # +3-5331 U+5540 # +3-5332 U+5563 # +3-5333 U+554C # +3-5334 U+552E # +3-5335 U+555C # +3-5336 U+5545 # +3-5337 U+5556 # +3-5338 U+5557 # +3-5339 U+5538 # +3-533A U+5533 # +3-533B U+555D # +3-533C U+5599 # +3-533D U+5580 # +3-533E U+54AF # +3-533F U+558A # +3-5340 U+559F # +3-5341 U+557B # +3-5342 U+557E # +3-5343 U+5598 # +3-5344 U+559E # +3-5345 U+55AE # +3-5346 U+557C # +3-5347 U+5583 # +3-5348 U+55A9 # +3-5349 U+5587 # +3-534A U+55A8 # +3-534B U+55DA # +3-534C U+55C5 # +3-534D U+55DF # +3-534E U+55C4 # +3-534F U+55DC # +3-5350 U+55E4 # +3-5351 U+55D4 # +3-5352 U+5614 # +3-5353 U+55F7 # +3-5354 U+5616 # +3-5355 U+55FE # +3-5356 U+55FD # +3-5357 U+561B # +3-5358 U+55F9 # +3-5359 U+564E # +3-535A U+5650 # +3-535B U+71DF # +3-535C U+5634 # +3-535D U+5636 # +3-535E U+5632 # +3-535F U+5638 # +3-5360 U+566B # +3-5361 U+5664 # +3-5362 U+562F # +3-5363 U+566C # +3-5364 U+566A # +3-5365 U+5686 # +3-5366 U+5680 # +3-5367 U+568A # +3-5368 U+56A0 # +3-5369 U+5694 # +3-536A U+568F # +3-536B U+56A5 # +3-536C U+56AE # +3-536D U+56B6 # +3-536E U+56B4 # +3-536F U+56C2 # +3-5370 U+56BC # +3-5371 U+56C1 # +3-5372 U+56C3 # +3-5373 U+56C0 # +3-5374 U+56C8 # +3-5375 U+56CE # +3-5376 U+56D1 # +3-5377 U+56D3 # +3-5378 U+56D7 # +3-5379 U+56EE # +3-537A U+56F9 # +3-537B U+5700 # +3-537C U+56FF # +3-537D U+5704 # +3-537E U+5709 # +3-5421 U+5708 # +3-5422 U+570B # +3-5423 U+570D # +3-5424 U+5713 # +3-5425 U+5718 # +3-5426 U+5716 # +3-5427 U+55C7 # +3-5428 U+571C # +3-5429 U+5726 # +3-542A U+5737 # +3-542B U+5738 # +3-542C U+574E # +3-542D U+573B # +3-542E U+5740 # +3-542F U+574F # +3-5430 U+5769 # +3-5431 U+57C0 # +3-5432 U+5788 # +3-5433 U+5761 # +3-5434 U+577F # +3-5435 U+5789 # +3-5436 U+5793 # +3-5437 U+57A0 # +3-5438 U+57B3 # +3-5439 U+57A4 # +3-543A U+57AA # +3-543B U+57B0 # +3-543C U+57C3 # +3-543D U+57C6 # +3-543E U+57D4 # +3-543F U+57D2 # +3-5440 U+57D3 # +3-5441 U+580A # +3-5442 U+57D6 # +3-5443 U+57E3 # +3-5444 U+580B # +3-5445 U+5819 # +3-5446 U+581D # +3-5447 U+5872 # +3-5448 U+5821 # +3-5449 U+5862 # +3-544A U+584B # +3-544B U+5870 # +3-544C U+6BC0 # +3-544D U+5852 # +3-544E U+583D # +3-544F U+5879 # +3-5450 U+5885 # +3-5451 U+58B9 # +3-5452 U+589F # +3-5453 U+58AB # +3-5454 U+58BA # +3-5455 U+58DE # +3-5456 U+58BB # +3-5457 U+58B8 # +3-5458 U+58AE # +3-5459 U+58C5 # +3-545A U+58D3 # +3-545B U+58D1 # +3-545C U+58D7 # +3-545D U+58D9 # +3-545E U+58D8 # +3-545F U+58E5 # +3-5460 U+58DC # +3-5461 U+58E4 # +3-5462 U+58DF # +3-5463 U+58EF # +3-5464 U+58FA # +3-5465 U+58F9 # +3-5466 U+58FB # +3-5467 U+58FC # +3-5468 U+58FD # +3-5469 U+5902 # +3-546A U+590A # +3-546B U+5910 # +3-546C U+591B # +3-546D U+68A6 # +3-546E U+5925 # +3-546F U+592C # +3-5470 U+592D # +3-5471 U+5932 # +3-5472 U+5938 # +3-5473 U+593E # +3-5474 U+7AD2 # +3-5475 U+5955 # +3-5476 U+5950 # +3-5477 U+594E # +3-5478 U+595A # +3-5479 U+5958 # +3-547A U+5962 # +3-547B U+5960 # +3-547C U+5967 # +3-547D U+596C # +3-547E U+5969 # +3-5521 U+5978 # +3-5522 U+5981 # +3-5523 U+599D # +3-5524 U+4F5E # +3-5525 U+4FAB # +3-5526 U+59A3 # +3-5527 U+59B2 # +3-5528 U+59C6 # +3-5529 U+59E8 # +3-552A U+59DC # +3-552B U+598D # +3-552C U+59D9 # +3-552D U+59DA # +3-552E U+5A25 # +3-552F U+5A1F # +3-5530 U+5A11 # +3-5531 U+5A1C # +3-5532 U+5A09 # +3-5533 U+5A1A # +3-5534 U+5A40 # +3-5535 U+5A6C # +3-5536 U+5A49 # +3-5537 U+5A35 # +3-5538 U+5A36 # +3-5539 U+5A62 # +3-553A U+5A6A # +3-553B U+5A9A # +3-553C U+5ABC # +3-553D U+5ABE # +3-553E U+5ACB # +3-553F U+5AC2 # +3-5540 U+5ABD # +3-5541 U+5AE3 # +3-5542 U+5AD7 # +3-5543 U+5AE6 # +3-5544 U+5AE9 # +3-5545 U+5AD6 # +3-5546 U+5AFA # +3-5547 U+5AFB # +3-5548 U+5B0C # +3-5549 U+5B0B # +3-554A U+5B16 # +3-554B U+5B32 # +3-554C U+5AD0 # +3-554D U+5B2A # +3-554E U+5B36 # +3-554F U+5B3E # +3-5550 U+5B43 # +3-5551 U+5B45 # +3-5552 U+5B40 # +3-5553 U+5B51 # +3-5554 U+5B55 # +3-5555 U+5B5A # +3-5556 U+5B5B # +3-5557 U+5B65 # +3-5558 U+5B69 # +3-5559 U+5B70 # +3-555A U+5B73 # +3-555B U+5B75 # +3-555C U+5B78 # +3-555D U+6588 # +3-555E U+5B7A # +3-555F U+5B80 # +3-5560 U+5B83 # +3-5561 U+5BA6 # +3-5562 U+5BB8 # +3-5563 U+5BC3 # +3-5564 U+5BC7 # +3-5565 U+5BC9 # +3-5566 U+5BD4 # +3-5567 U+5BD0 # +3-5568 U+5BE4 # +3-5569 U+5BE6 # +3-556A U+5BE2 # +3-556B U+5BDE # +3-556C U+5BE5 # +3-556D U+5BEB # +3-556E U+5BF0 # +3-556F U+5BF6 # +3-5570 U+5BF3 # +3-5571 U+5C05 # +3-5572 U+5C07 # +3-5573 U+5C08 # +3-5574 U+5C0D # +3-5575 U+5C13 # +3-5576 U+5C20 # +3-5577 U+5C22 # +3-5578 U+5C28 # +3-5579 U+5C38 # +3-557A U+5C39 # +3-557B U+5C41 # +3-557C U+5C46 # +3-557D U+5C4E # +3-557E U+5C53 # +3-5621 U+5C50 # +3-5622 U+5C4F # +3-5623 U+5B71 # +3-5624 U+5C6C # +3-5625 U+5C6E # +3-5626 U+4E62 # +3-5627 U+5C76 # +3-5628 U+5C79 # +3-5629 U+5C8C # +3-562A U+5C91 # +3-562B U+5C94 # +3-562C U+599B # +3-562D U+5CAB # +3-562E U+5CBB # +3-562F U+5CB6 # +3-5630 U+5CBC # +3-5631 U+5CB7 # +3-5632 U+5CC5 # +3-5633 U+5CBE # +3-5634 U+5CC7 # +3-5635 U+5CD9 # +3-5636 U+5CE9 # +3-5637 U+5CFD # +3-5638 U+5CFA # +3-5639 U+5CED # +3-563A U+5D8C # +3-563B U+5CEA # +3-563C U+5D0B # +3-563D U+5D15 # +3-563E U+5D17 # +3-563F U+5D5C # +3-5640 U+5D1F # +3-5641 U+5D1B # +3-5642 U+5D11 # +3-5643 U+5D14 # +3-5644 U+5D22 # +3-5645 U+5D1A # +3-5646 U+5D19 # +3-5647 U+5D18 # +3-5648 U+5D4C # +3-5649 U+5D52 # +3-564A U+5D4E # +3-564B U+5D4B # +3-564C U+5D6C # +3-564D U+5D73 # +3-564E U+5D76 # +3-564F U+5D87 # +3-5650 U+5D84 # +3-5651 U+5D82 # +3-5652 U+5DA2 # +3-5653 U+5D9D # +3-5654 U+5DAC # +3-5655 U+5DAE # +3-5656 U+5DBD # +3-5657 U+5D90 # +3-5658 U+5DB7 # +3-5659 U+5DBC # +3-565A U+5DC9 # +3-565B U+5DCD # +3-565C U+5DD3 # +3-565D U+5DD2 # +3-565E U+5DD6 # +3-565F U+5DDB # +3-5660 U+5DEB # +3-5661 U+5DF2 # +3-5662 U+5DF5 # +3-5663 U+5E0B # +3-5664 U+5E1A # +3-5665 U+5E19 # +3-5666 U+5E11 # +3-5667 U+5E1B # +3-5668 U+5E36 # +3-5669 U+5E37 # +3-566A U+5E44 # +3-566B U+5E43 # +3-566C U+5E40 # +3-566D U+5E4E # +3-566E U+5E57 # +3-566F U+5E54 # +3-5670 U+5E5F # +3-5671 U+5E62 # +3-5672 U+5E64 # +3-5673 U+5E47 # +3-5674 U+5E75 # +3-5675 U+5E76 # +3-5676 U+5E7A # +3-5677 U+9EBC # +3-5678 U+5E7F # +3-5679 U+5EA0 # +3-567A U+5EC1 # +3-567B U+5EC2 # +3-567C U+5EC8 # +3-567D U+5ED0 # +3-567E U+5ECF # +3-5721 U+5ED6 # +3-5722 U+5EE3 # +3-5723 U+5EDD # +3-5724 U+5EDA # +3-5725 U+5EDB # +3-5726 U+5EE2 # +3-5727 U+5EE1 # +3-5728 U+5EE8 # +3-5729 U+5EE9 # +3-572A U+5EEC # +3-572B U+5EF1 # +3-572C U+5EF3 # +3-572D U+5EF0 # +3-572E U+5EF4 # +3-572F U+5EF8 # +3-5730 U+5EFE # +3-5731 U+5F03 # +3-5732 U+5F09 # +3-5733 U+5F5D # +3-5734 U+5F5C # +3-5735 U+5F0B # +3-5736 U+5F11 # +3-5737 U+5F16 # +3-5738 U+5F29 # +3-5739 U+5F2D # +3-573A U+5F38 # +3-573B U+5F41 # +3-573C U+5F48 # +3-573D U+5F4C # +3-573E U+5F4E # +3-573F U+5F2F # +3-5740 U+5F51 # +3-5741 U+5F56 # +3-5742 U+5F57 # +3-5743 U+5F59 # +3-5744 U+5F61 # +3-5745 U+5F6D # +3-5746 U+5F73 # +3-5747 U+5F77 # +3-5748 U+5F83 # +3-5749 U+5F82 # +3-574A U+5F7F # +3-574B U+5F8A # +3-574C U+5F88 # +3-574D U+5F91 # +3-574E U+5F87 # +3-574F U+5F9E # +3-5750 U+5F99 # +3-5751 U+5F98 # +3-5752 U+5FA0 # +3-5753 U+5FA8 # +3-5754 U+5FAD # +3-5755 U+5FBC # +3-5756 U+5FD6 # +3-5757 U+5FFB # +3-5758 U+5FE4 # +3-5759 U+5FF8 # +3-575A U+5FF1 # +3-575B U+5FDD # +3-575C U+60B3 # +3-575D U+5FFF # +3-575E U+6021 # +3-575F U+6060 # +3-5760 U+6019 # +3-5761 U+6010 # +3-5762 U+6029 # +3-5763 U+600E # +3-5764 U+6031 # +3-5765 U+601B # +3-5766 U+6015 # +3-5767 U+602B # +3-5768 U+6026 # +3-5769 U+600F # +3-576A U+603A # +3-576B U+605A # +3-576C U+6041 # +3-576D U+606A # +3-576E U+6077 # +3-576F U+605F # +3-5770 U+604A # +3-5771 U+6046 # +3-5772 U+604D # +3-5773 U+6063 # +3-5774 U+6043 # +3-5775 U+6064 # +3-5776 U+6042 # +3-5777 U+606C # +3-5778 U+606B # +3-5779 U+6059 # +3-577A U+6081 # +3-577B U+608D # +3-577C U+60E7 # +3-577D U+6083 # +3-577E U+609A # +3-5821 U+6084 # +3-5822 U+609B # +3-5823 U+6096 # +3-5824 U+6097 # +3-5825 U+6092 # +3-5826 U+60A7 # +3-5827 U+608B # +3-5828 U+60E1 # +3-5829 U+60B8 # +3-582A U+60E0 # +3-582B U+60D3 # +3-582C U+60B4 # +3-582D U+5FF0 # +3-582E U+60BD # +3-582F U+60C6 # +3-5830 U+60B5 # +3-5831 U+60D8 # +3-5832 U+614D # +3-5833 U+6115 # +3-5834 U+6106 # +3-5835 U+60F6 # +3-5836 U+60F7 # +3-5837 U+6100 # +3-5838 U+60F4 # +3-5839 U+60FA # +3-583A U+6103 # +3-583B U+6121 # +3-583C U+60FB # +3-583D U+60F1 # +3-583E U+610D # +3-583F U+610E # +3-5840 U+6147 # +3-5841 U+613E # +3-5842 U+6128 # +3-5843 U+6127 # +3-5844 U+614A # +3-5845 U+613F # +3-5846 U+613C # +3-5847 U+612C # +3-5848 U+6134 # +3-5849 U+613D # +3-584A U+6142 # +3-584B U+6144 # +3-584C U+6173 # +3-584D U+6177 # +3-584E U+6158 # +3-584F U+6159 # +3-5850 U+615A # +3-5851 U+616B # +3-5852 U+6174 # +3-5853 U+616F # +3-5854 U+6165 # +3-5855 U+6171 # +3-5856 U+615F # +3-5857 U+615D # +3-5858 U+6153 # +3-5859 U+6175 # +3-585A U+6199 # +3-585B U+6196 # +3-585C U+6187 # +3-585D U+61AC # +3-585E U+6194 # +3-585F U+619A # +3-5860 U+618A # +3-5861 U+6191 # +3-5862 U+61AB # +3-5863 U+61AE # +3-5864 U+61CC # +3-5865 U+61CA # +3-5866 U+61C9 # +3-5867 U+61F7 # +3-5868 U+61C8 # +3-5869 U+61C3 # +3-586A U+61C6 # +3-586B U+61BA # +3-586C U+61CB # +3-586D U+7F79 # +3-586E U+61CD # +3-586F U+61E6 # +3-5870 U+61E3 # +3-5871 U+61F6 # +3-5872 U+61FA # +3-5873 U+61F4 # +3-5874 U+61FF # +3-5875 U+61FD # +3-5876 U+61FC # +3-5877 U+61FE # +3-5878 U+6200 # +3-5879 U+6208 # +3-587A U+6209 # +3-587B U+620D # +3-587C U+620C # +3-587D U+6214 # +3-587E U+621B # +3-5921 U+621E # +3-5922 U+6221 # +3-5923 U+622A # +3-5924 U+622E # +3-5925 U+6230 # +3-5926 U+6232 # +3-5927 U+6233 # +3-5928 U+6241 # +3-5929 U+624E # +3-592A U+625E # +3-592B U+6263 # +3-592C U+625B # +3-592D U+6260 # +3-592E U+6268 # +3-592F U+627C # +3-5930 U+6282 # +3-5931 U+6289 # +3-5932 U+627E # +3-5933 U+6292 # +3-5934 U+6293 # +3-5935 U+6296 # +3-5936 U+62D4 # +3-5937 U+6283 # +3-5938 U+6294 # +3-5939 U+62D7 # +3-593A U+62D1 # +3-593B U+62BB # +3-593C U+62CF # +3-593D U+62FF # +3-593E U+62C6 # +3-593F U+64D4 # +3-5940 U+62C8 # +3-5941 U+62DC # +3-5942 U+62CC # +3-5943 U+62CA # +3-5944 U+62C2 # +3-5945 U+62C7 # +3-5946 U+629B # +3-5947 U+62C9 # +3-5948 U+630C # +3-5949 U+62EE # +3-594A U+62F1 # +3-594B U+6327 # +3-594C U+6302 # +3-594D U+6308 # +3-594E U+62EF # +3-594F U+62F5 # +3-5950 U+6350 # +3-5951 U+633E # +3-5952 U+634D # +3-5953 U+641C # +3-5954 U+634F # +3-5955 U+6396 # +3-5956 U+638E # +3-5957 U+6380 # +3-5958 U+63AB # +3-5959 U+6376 # +3-595A U+63A3 # +3-595B U+638F # +3-595C U+6389 # +3-595D U+639F # +3-595E U+63B5 # +3-595F U+636B # +3-5960 U+6369 # +3-5961 U+63BE # +3-5962 U+63E9 # +3-5963 U+63C0 # +3-5964 U+63C6 # +3-5965 U+63E3 # +3-5966 U+63C9 # +3-5967 U+63D2 # +3-5968 U+63F6 # +3-5969 U+63C4 # +3-596A U+6416 # +3-596B U+6434 # +3-596C U+6406 # +3-596D U+6413 # +3-596E U+6426 # +3-596F U+6436 # +3-5970 U+651D # +3-5971 U+6417 # +3-5972 U+6428 # +3-5973 U+640F # +3-5974 U+6467 # +3-5975 U+646F # +3-5976 U+6476 # +3-5977 U+644E # +3-5978 U+652A # +3-5979 U+6495 # +3-597A U+6493 # +3-597B U+64A5 # +3-597C U+64A9 # +3-597D U+6488 # +3-597E U+64BC # +3-5A21 U+64DA # +3-5A22 U+64D2 # +3-5A23 U+64C5 # +3-5A24 U+64C7 # +3-5A25 U+64BB # +3-5A26 U+64D8 # +3-5A27 U+64C2 # +3-5A28 U+64F1 # +3-5A29 U+64E7 # +3-5A2A U+8209 # +3-5A2B U+64E0 # +3-5A2C U+64E1 # +3-5A2D U+62AC # +3-5A2E U+64E3 # +3-5A2F U+64EF # +3-5A30 U+652C # +3-5A31 U+64F6 # +3-5A32 U+64F4 # +3-5A33 U+64F2 # +3-5A34 U+64FA # +3-5A35 U+6500 # +3-5A36 U+64FD # +3-5A37 U+6518 # +3-5A38 U+651C # +3-5A39 U+6505 # +3-5A3A U+6524 # +3-5A3B U+6523 # +3-5A3C U+652B # +3-5A3D U+6534 # +3-5A3E U+6535 # +3-5A3F U+6537 # +3-5A40 U+6536 # +3-5A41 U+6538 # +3-5A42 U+754B # +3-5A43 U+6548 # +3-5A44 U+6556 # +3-5A45 U+6555 # +3-5A46 U+654D # +3-5A47 U+6558 # +3-5A48 U+655E # +3-5A49 U+655D # +3-5A4A U+6572 # +3-5A4B U+6578 # +3-5A4C U+6582 # +3-5A4D U+6583 # +3-5A4E U+8B8A # +3-5A4F U+659B # +3-5A50 U+659F # +3-5A51 U+65AB # +3-5A52 U+65B7 # +3-5A53 U+65C3 # +3-5A54 U+65C6 # +3-5A55 U+65C1 # +3-5A56 U+65C4 # +3-5A57 U+65CC # +3-5A58 U+65D2 # +3-5A59 U+65DB # +3-5A5A U+65D9 # +3-5A5B U+65E0 # +3-5A5C U+65E1 # +3-5A5D U+65F1 # +3-5A5E U+6772 # +3-5A5F U+660A # +3-5A60 U+6603 # +3-5A61 U+65FB # +3-5A62 U+6773 # +3-5A63 U+6635 # +3-5A64 U+6636 # +3-5A65 U+6634 # +3-5A66 U+661C # +3-5A67 U+664F # +3-5A68 U+6644 # +3-5A69 U+6649 # +3-5A6A U+6641 # +3-5A6B U+665E # +3-5A6C U+665D # +3-5A6D U+6664 # +3-5A6E U+6667 # +3-5A6F U+6668 # +3-5A70 U+665F # +3-5A71 U+6662 # +3-5A72 U+6670 # +3-5A73 U+6683 # +3-5A74 U+6688 # +3-5A75 U+668E # +3-5A76 U+6689 # +3-5A77 U+6684 # +3-5A78 U+6698 # +3-5A79 U+669D # +3-5A7A U+66C1 # +3-5A7B U+66B9 # +3-5A7C U+66C9 # +3-5A7D U+66BE # +3-5A7E U+66BC # +3-5B21 U+66C4 # +3-5B22 U+66B8 # +3-5B23 U+66D6 # +3-5B24 U+66DA # +3-5B25 U+66E0 # +3-5B26 U+663F # +3-5B27 U+66E6 # +3-5B28 U+66E9 # +3-5B29 U+66F0 # +3-5B2A U+66F5 # +3-5B2B U+66F7 # +3-5B2C U+670F # +3-5B2D U+6716 # +3-5B2E U+671E # +3-5B2F U+6726 # +3-5B30 U+6727 # +3-5B31 U+9738 # +3-5B32 U+672E # +3-5B33 U+673F # +3-5B34 U+6736 # +3-5B35 U+6741 # +3-5B36 U+6738 # +3-5B37 U+6737 # +3-5B38 U+6746 # +3-5B39 U+675E # +3-5B3A U+6760 # +3-5B3B U+6759 # +3-5B3C U+6763 # +3-5B3D U+6764 # +3-5B3E U+6789 # +3-5B3F U+6770 # +3-5B40 U+67A9 # +3-5B41 U+677C # +3-5B42 U+676A # +3-5B43 U+678C # +3-5B44 U+678B # +3-5B45 U+67A6 # +3-5B46 U+67A1 # +3-5B47 U+6785 # +3-5B48 U+67B7 # +3-5B49 U+67EF # +3-5B4A U+67B4 # +3-5B4B U+67EC # +3-5B4C U+67B3 # +3-5B4D U+67E9 # +3-5B4E U+67B8 # +3-5B4F U+67E4 # +3-5B50 U+67DE # +3-5B51 U+67DD # +3-5B52 U+67E2 # +3-5B53 U+67EE # +3-5B54 U+67B9 # +3-5B55 U+67CE # +3-5B56 U+67C6 # +3-5B57 U+67E7 # +3-5B58 U+6A9C # +3-5B59 U+681E # +3-5B5A U+6846 # +3-5B5B U+6829 # +3-5B5C U+6840 # +3-5B5D U+684D # +3-5B5E U+6832 # +3-5B5F U+684E # +3-5B60 U+68B3 # +3-5B61 U+682B # +3-5B62 U+6859 # +3-5B63 U+6863 # +3-5B64 U+6877 # +3-5B65 U+687F # +3-5B66 U+689F # +3-5B67 U+688F # +3-5B68 U+68AD # +3-5B69 U+6894 # +3-5B6A U+689D # +3-5B6B U+689B # +3-5B6C U+6883 # +3-5B6D U+6AAE # +3-5B6E U+68B9 # +3-5B6F U+6874 # +3-5B70 U+68B5 # +3-5B71 U+68A0 # +3-5B72 U+68BA # +3-5B73 U+690F # +3-5B74 U+688D # +3-5B75 U+687E # +3-5B76 U+6901 # +3-5B77 U+68CA # +3-5B78 U+6908 # +3-5B79 U+68D8 # +3-5B7A U+6922 # +3-5B7B U+6926 # +3-5B7C U+68E1 # +3-5B7D U+690C # +3-5B7E U+68CD # +3-5C21 U+68D4 # +3-5C22 U+68E7 # +3-5C23 U+68D5 # +3-5C24 U+6936 # +3-5C25 U+6912 # +3-5C26 U+6904 # +3-5C27 U+68D7 # +3-5C28 U+68E3 # +3-5C29 U+6925 # +3-5C2A U+68F9 # +3-5C2B U+68E0 # +3-5C2C U+68EF # +3-5C2D U+6928 # +3-5C2E U+692A # +3-5C2F U+691A # +3-5C30 U+6923 # +3-5C31 U+6921 # +3-5C32 U+68C6 # +3-5C33 U+6979 # +3-5C34 U+6977 # +3-5C35 U+695C # +3-5C36 U+6978 # +3-5C37 U+696B # +3-5C38 U+6954 # +3-5C39 U+697E # +3-5C3A U+696E # +3-5C3B U+6939 # +3-5C3C U+6974 # +3-5C3D U+693D # +3-5C3E U+6959 # +3-5C3F U+6930 # +3-5C40 U+6961 # +3-5C41 U+695E # +3-5C42 U+695D # +3-5C43 U+6981 # +3-5C44 U+696A # +3-5C45 U+69B2 # +3-5C46 U+69AE # +3-5C47 U+69D0 # +3-5C48 U+69BF # +3-5C49 U+69C1 # +3-5C4A U+69D3 # +3-5C4B U+69BE # +3-5C4C U+69CE # +3-5C4D U+5BE8 # +3-5C4E U+69CA # +3-5C4F U+69DD # +3-5C50 U+69BB # +3-5C51 U+69C3 # +3-5C52 U+69A7 # +3-5C53 U+6A2E # +3-5C54 U+6991 # +3-5C55 U+69A0 # +3-5C56 U+699C # +3-5C57 U+6995 # +3-5C58 U+69B4 # +3-5C59 U+69DE # +3-5C5A U+69E8 # +3-5C5B U+6A02 # +3-5C5C U+6A1B # +3-5C5D U+69FF # +3-5C5E U+6B0A # +3-5C5F U+69F9 # +3-5C60 U+69F2 # +3-5C61 U+69E7 # +3-5C62 U+6A05 # +3-5C63 U+69B1 # +3-5C64 U+6A1E # +3-5C65 U+69ED # +3-5C66 U+6A14 # +3-5C67 U+69EB # +3-5C68 U+6A0A # +3-5C69 U+6A12 # +3-5C6A U+6AC1 # +3-5C6B U+6A23 # +3-5C6C U+6A13 # +3-5C6D U+6A44 # +3-5C6E U+6A0C # +3-5C6F U+6A72 # +3-5C70 U+6A36 # +3-5C71 U+6A78 # +3-5C72 U+6A47 # +3-5C73 U+6A62 # +3-5C74 U+6A59 # +3-5C75 U+6A66 # +3-5C76 U+6A48 # +3-5C77 U+6A38 # +3-5C78 U+6A22 # +3-5C79 U+6A90 # +3-5C7A U+6A8D # +3-5C7B U+6AA0 # +3-5C7C U+6A84 # +3-5C7D U+6AA2 # +3-5C7E U+6AA3 # +3-5D21 U+6A97 # +3-5D22 U+8617 # +3-5D23 U+6ABB # +3-5D24 U+6AC3 # +3-5D25 U+6AC2 # +3-5D26 U+6AB8 # +3-5D27 U+6AB3 # +3-5D28 U+6AAC # +3-5D29 U+6ADE # +3-5D2A U+6AD1 # +3-5D2B U+6ADF # +3-5D2C U+6AAA # +3-5D2D U+6ADA # +3-5D2E U+6AEA # +3-5D2F U+6AFB # +3-5D30 U+6B05 # +3-5D31 U+8616 # +3-5D32 U+6AFA # +3-5D33 U+6B12 # +3-5D34 U+6B16 # +3-5D35 U+9B31 # +3-5D36 U+6B1F # +3-5D37 U+6B38 # +3-5D38 U+6B37 # +3-5D39 U+76DC # +3-5D3A U+6B39 # +3-5D3B U+98EE # +3-5D3C U+6B47 # +3-5D3D U+6B43 # +3-5D3E U+6B49 # +3-5D3F U+6B50 # +3-5D40 U+6B59 # +3-5D41 U+6B54 # +3-5D42 U+6B5B # +3-5D43 U+6B5F # +3-5D44 U+6B61 # +3-5D45 U+6B78 # +3-5D46 U+6B79 # +3-5D47 U+6B7F # +3-5D48 U+6B80 # +3-5D49 U+6B84 # +3-5D4A U+6B83 # +3-5D4B U+6B8D # +3-5D4C U+6B98 # +3-5D4D U+6B95 # +3-5D4E U+6B9E # +3-5D4F U+6BA4 # +3-5D50 U+6BAA # +3-5D51 U+6BAB # +3-5D52 U+6BAF # +3-5D53 U+6BB2 # +3-5D54 U+6BB1 # +3-5D55 U+6BB3 # +3-5D56 U+6BB7 # +3-5D57 U+6BBC # +3-5D58 U+6BC6 # +3-5D59 U+6BCB # +3-5D5A U+6BD3 # +3-5D5B U+6BDF # +3-5D5C U+6BEC # +3-5D5D U+6BEB # +3-5D5E U+6BF3 # +3-5D5F U+6BEF # +3-5D60 U+9EBE # +3-5D61 U+6C08 # +3-5D62 U+6C13 # +3-5D63 U+6C14 # +3-5D64 U+6C1B # +3-5D65 U+6C24 # +3-5D66 U+6C23 # +3-5D67 U+6C5E # +3-5D68 U+6C55 # +3-5D69 U+6C62 # +3-5D6A U+6C6A # +3-5D6B U+6C82 # +3-5D6C U+6C8D # +3-5D6D U+6C9A # +3-5D6E U+6C81 # +3-5D6F U+6C9B # +3-5D70 U+6C7E # +3-5D71 U+6C68 # +3-5D72 U+6C73 # +3-5D73 U+6C92 # +3-5D74 U+6C90 # +3-5D75 U+6CC4 # +3-5D76 U+6CF1 # +3-5D77 U+6CD3 # +3-5D78 U+6CBD # +3-5D79 U+6CD7 # +3-5D7A U+6CC5 # +3-5D7B U+6CDD # +3-5D7C U+6CAE # +3-5D7D U+6CB1 # +3-5D7E U+6CBE # +3-5E21 U+6CBA # +3-5E22 U+6CDB # +3-5E23 U+6CEF # +3-5E24 U+6CD9 # +3-5E25 U+6CEA # +3-5E26 U+6D1F # +3-5E27 U+884D # +3-5E28 U+6D36 # +3-5E29 U+6D2B # +3-5E2A U+6D3D # +3-5E2B U+6D38 # +3-5E2C U+6D19 # +3-5E2D U+6D35 # +3-5E2E U+6D33 # +3-5E2F U+6D12 # +3-5E30 U+6D0C # +3-5E31 U+6D63 # +3-5E32 U+6D93 # +3-5E33 U+6D64 # +3-5E34 U+6D5A # +3-5E35 U+6D79 # +3-5E36 U+6D59 # +3-5E37 U+6D8E # +3-5E38 U+6D95 # +3-5E39 U+6FE4 # +3-5E3A U+6D85 # +3-5E3B U+6DF9 # +3-5E3C U+6E15 # +3-5E3D U+6E0A # +3-5E3E U+6DB5 # +3-5E3F U+6DC7 # +3-5E40 U+6DE6 # +3-5E41 U+6DB8 # +3-5E42 U+6DC6 # +3-5E43 U+6DEC # +3-5E44 U+6DDE # +3-5E45 U+6DCC # +3-5E46 U+6DE8 # +3-5E47 U+6DD2 # +3-5E48 U+6DC5 # +3-5E49 U+6DFA # +3-5E4A U+6DD9 # +3-5E4B U+6DE4 # +3-5E4C U+6DD5 # +3-5E4D U+6DEA # +3-5E4E U+6DEE # +3-5E4F U+6E2D # +3-5E50 U+6E6E # +3-5E51 U+6E2E # +3-5E52 U+6E19 # +3-5E53 U+6E72 # +3-5E54 U+6E5F # +3-5E55 U+6E3E # +3-5E56 U+6E23 # +3-5E57 U+6E6B # +3-5E58 U+6E2B # +3-5E59 U+6E76 # +3-5E5A U+6E4D # +3-5E5B U+6E1F # +3-5E5C U+6E43 # +3-5E5D U+6E3A # +3-5E5E U+6E4E # +3-5E5F U+6E24 # +3-5E60 U+6EFF # +3-5E61 U+6E1D # +3-5E62 U+6E38 # +3-5E63 U+6E82 # +3-5E64 U+6EAA # +3-5E65 U+6E98 # +3-5E66 U+6EC9 # +3-5E67 U+6EB7 # +3-5E68 U+6ED3 # +3-5E69 U+6EBD # +3-5E6A U+6EAF # +3-5E6B U+6EC4 # +3-5E6C U+6EB2 # +3-5E6D U+6ED4 # +3-5E6E U+6ED5 # +3-5E6F U+6E8F # +3-5E70 U+6EA5 # +3-5E71 U+6EC2 # +3-5E72 U+6E9F # +3-5E73 U+6F41 # +3-5E74 U+6F11 # +3-5E75 U+704C # +3-5E76 U+6EEC # +3-5E77 U+6EF8 # +3-5E78 U+6EFE # +3-5E79 U+6F3F # +3-5E7A U+6EF2 # +3-5E7B U+6F31 # +3-5E7C U+6EEF # +3-5E7D U+6F32 # +3-5E7E U+6ECC # +3-5F21 U+6F3E # +3-5F22 U+6F13 # +3-5F23 U+6EF7 # +3-5F24 U+6F86 # +3-5F25 U+6F7A # +3-5F26 U+6F78 # +3-5F27 U+6F81 # +3-5F28 U+6F80 # +3-5F29 U+6F6F # +3-5F2A U+6F5B # +3-5F2B U+6FF3 # +3-5F2C U+6F6D # +3-5F2D U+6F82 # +3-5F2E U+6F7C # +3-5F2F U+6F58 # +3-5F30 U+6F8E # +3-5F31 U+6F91 # +3-5F32 U+6FC2 # +3-5F33 U+6F66 # +3-5F34 U+6FB3 # +3-5F35 U+6FA3 # +3-5F36 U+6FA1 # +3-5F37 U+6FA4 # +3-5F38 U+6FB9 # +3-5F39 U+6FC6 # +3-5F3A U+6FAA # +3-5F3B U+6FDF # +3-5F3C U+6FD5 # +3-5F3D U+6FEC # +3-5F3E U+6FD4 # +3-5F3F U+6FD8 # +3-5F40 U+6FF1 # +3-5F41 U+6FEE # +3-5F42 U+6FDB # +3-5F43 U+7009 # +3-5F44 U+700B # +3-5F45 U+6FFA # +3-5F46 U+7011 # +3-5F47 U+7001 # +3-5F48 U+700F # +3-5F49 U+6FFE # +3-5F4A U+701B # +3-5F4B U+701A # +3-5F4C U+6F74 # +3-5F4D U+701D # +3-5F4E U+7018 # +3-5F4F U+701F # +3-5F50 U+7030 # +3-5F51 U+703E # +3-5F52 U+7032 # +3-5F53 U+7051 # +3-5F54 U+7063 # +3-5F55 U+7099 # +3-5F56 U+7092 # +3-5F57 U+70AF # +3-5F58 U+70F1 # +3-5F59 U+70AC # +3-5F5A U+70B8 # +3-5F5B U+70B3 # +3-5F5C U+70AE # +3-5F5D U+70DF # +3-5F5E U+70CB # +3-5F5F U+70DD # +3-5F60 U+70D9 # +3-5F61 U+7109 # +3-5F62 U+70FD # +3-5F63 U+711C # +3-5F64 U+7119 # +3-5F65 U+7165 # +3-5F66 U+7155 # +3-5F67 U+7188 # +3-5F68 U+7166 # +3-5F69 U+7162 # +3-5F6A U+714C # +3-5F6B U+7156 # +3-5F6C U+716C # +3-5F6D U+718F # +3-5F6E U+71FB # +3-5F6F U+7184 # +3-5F70 U+7195 # +3-5F71 U+71A8 # +3-5F72 U+71AC # +3-5F73 U+71D7 # +3-5F74 U+71B9 # +3-5F75 U+71BE # +3-5F76 U+71D2 # +3-5F77 U+71C9 # +3-5F78 U+71D4 # +3-5F79 U+71CE # +3-5F7A U+71E0 # +3-5F7B U+71EC # +3-5F7C U+71E7 # +3-5F7D U+71F5 # +3-5F7E U+71FC # +3-6021 U+71F9 # +3-6022 U+71FF # +3-6023 U+720D # +3-6024 U+7210 # +3-6025 U+721B # +3-6026 U+7228 # +3-6027 U+722D # +3-6028 U+722C # +3-6029 U+7230 # +3-602A U+7232 # +3-602B U+723B # +3-602C U+723C # +3-602D U+723F # +3-602E U+7240 # +3-602F U+7246 # +3-6030 U+724B # +3-6031 U+7258 # +3-6032 U+7274 # +3-6033 U+727E # +3-6034 U+7282 # +3-6035 U+7281 # +3-6036 U+7287 # +3-6037 U+7292 # +3-6038 U+7296 # +3-6039 U+72A2 # +3-603A U+72A7 # +3-603B U+72B9 # +3-603C U+72B2 # +3-603D U+72C3 # +3-603E U+72C6 # +3-603F U+72C4 # +3-6040 U+72CE # +3-6041 U+72D2 # +3-6042 U+72E2 # +3-6043 U+72E0 # +3-6044 U+72E1 # +3-6045 U+72F9 # +3-6046 U+72F7 # +3-6047 U+500F # +3-6048 U+7317 # +3-6049 U+730A # +3-604A U+731C # +3-604B U+7316 # +3-604C U+731D # +3-604D U+7334 # +3-604E U+732F # +3-604F U+7329 # +3-6050 U+7325 # +3-6051 U+733E # +3-6052 U+734E # +3-6053 U+734F # +3-6054 U+9ED8 # +3-6055 U+7357 # +3-6056 U+736A # +3-6057 U+7368 # +3-6058 U+7370 # +3-6059 U+7378 # +3-605A U+7375 # +3-605B U+737B # +3-605C U+737A # +3-605D U+73C8 # +3-605E U+73B3 # +3-605F U+73CE # +3-6060 U+73BB # +3-6061 U+73C0 # +3-6062 U+73E5 # +3-6063 U+73EE # +3-6064 U+73DE # +3-6065 U+74A2 # +3-6066 U+7405 # +3-6067 U+746F # +3-6068 U+7425 # +3-6069 U+73F8 # +3-606A U+7432 # +3-606B U+743A # +3-606C U+7455 # +3-606D U+743F # +3-606E U+745F # +3-606F U+7459 # +3-6070 U+7441 # +3-6071 U+745C # +3-6072 U+7469 # +3-6073 U+7470 # +3-6074 U+7463 # +3-6075 U+746A # +3-6076 U+7476 # +3-6077 U+747E # +3-6078 U+748B # +3-6079 U+749E # +3-607A U+74A7 # +3-607B U+74CA # +3-607C U+74CF # +3-607D U+74D4 # +3-607E U+73F1 # +3-6121 U+74E0 # +3-6122 U+74E3 # +3-6123 U+74E7 # +3-6124 U+74E9 # +3-6125 U+74EE # +3-6126 U+74F2 # +3-6127 U+74F0 # +3-6128 U+74F1 # +3-6129 U+74F8 # +3-612A U+74F7 # +3-612B U+7504 # +3-612C U+7503 # +3-612D U+7505 # +3-612E U+750C # +3-612F U+750E # +3-6130 U+750D # +3-6131 U+7515 # +3-6132 U+7513 # +3-6133 U+751E # +3-6134 U+7526 # +3-6135 U+752C # +3-6136 U+753C # +3-6137 U+7544 # +3-6138 U+754D # +3-6139 U+754A # +3-613A U+7549 # +3-613B U+755B # +3-613C U+7546 # +3-613D U+755A # +3-613E U+7569 # +3-613F U+7564 # +3-6140 U+7567 # +3-6141 U+756B # +3-6142 U+756D # +3-6143 U+7578 # +3-6144 U+7576 # +3-6145 U+7586 # +3-6146 U+7587 # +3-6147 U+7574 # +3-6148 U+758A # +3-6149 U+7589 # +3-614A U+7582 # +3-614B U+7594 # +3-614C U+759A # +3-614D U+759D # +3-614E U+75A5 # +3-614F U+75A3 # +3-6150 U+75C2 # +3-6151 U+75B3 # +3-6152 U+75C3 # +3-6153 U+75B5 # +3-6154 U+75BD # +3-6155 U+75B8 # +3-6156 U+75BC # +3-6157 U+75B1 # +3-6158 U+75CD # +3-6159 U+75CA # +3-615A U+75D2 # +3-615B U+75D9 # +3-615C U+75E3 # +3-615D U+75DE # +3-615E U+75FE # +3-615F U+75FF # +3-6160 U+75FC # +3-6161 U+7601 # +3-6162 U+75F0 # +3-6163 U+75FA # +3-6164 U+75F2 # +3-6165 U+75F3 # +3-6166 U+760B # +3-6167 U+760D # +3-6168 U+7609 # +3-6169 U+761F # +3-616A U+7627 # +3-616B U+7620 # +3-616C U+7621 # +3-616D U+7622 # +3-616E U+7624 # +3-616F U+7634 # +3-6170 U+7630 # +3-6171 U+763B # +3-6172 U+7647 # +3-6173 U+7648 # +3-6174 U+7646 # +3-6175 U+765C # +3-6176 U+7658 # +3-6177 U+7661 # +3-6178 U+7662 # +3-6179 U+7668 # +3-617A U+7669 # +3-617B U+766A # +3-617C U+7667 # +3-617D U+766C # +3-617E U+7670 # +3-6221 U+7672 # +3-6222 U+7676 # +3-6223 U+7678 # +3-6224 U+767C # +3-6225 U+7680 # +3-6226 U+7683 # +3-6227 U+7688 # +3-6228 U+768B # +3-6229 U+768E # +3-622A U+7696 # +3-622B U+7693 # +3-622C U+7699 # +3-622D U+769A # +3-622E U+76B0 # +3-622F U+76B4 # +3-6230 U+76B8 # +3-6231 U+76B9 # +3-6232 U+76BA # +3-6233 U+76C2 # +3-6234 U+76CD # +3-6235 U+76D6 # +3-6236 U+76D2 # +3-6237 U+76DE # +3-6238 U+76E1 # +3-6239 U+76E5 # +3-623A U+76E7 # +3-623B U+76EA # +3-623C U+862F # +3-623D U+76FB # +3-623E U+7708 # +3-623F U+7707 # +3-6240 U+7704 # +3-6241 U+7729 # +3-6242 U+7724 # +3-6243 U+771E # +3-6244 U+7725 # +3-6245 U+7726 # +3-6246 U+771B # +3-6247 U+7737 # +3-6248 U+7738 # +3-6249 U+7747 # +3-624A U+775A # +3-624B U+7768 # +3-624C U+776B # +3-624D U+775B # +3-624E U+7765 # +3-624F U+777F # +3-6250 U+777E # +3-6251 U+7779 # +3-6252 U+778E # +3-6253 U+778B # +3-6254 U+7791 # +3-6255 U+77A0 # +3-6256 U+779E # +3-6257 U+77B0 # +3-6258 U+77B6 # +3-6259 U+77B9 # +3-625A U+77BF # +3-625B U+77BC # +3-625C U+77BD # +3-625D U+77BB # +3-625E U+77C7 # +3-625F U+77CD # +3-6260 U+77D7 # +3-6261 U+77DA # +3-6262 U+77DC # +3-6263 U+77E3 # +3-6264 U+77EE # +3-6265 U+77FC # +3-6266 U+780C # +3-6267 U+7812 # +3-6268 U+7926 # +3-6269 U+7820 # +3-626A U+792A # +3-626B U+7845 # +3-626C U+788E # +3-626D U+7874 # +3-626E U+7886 # +3-626F U+787C # +3-6270 U+789A # +3-6271 U+788C # +3-6272 U+78A3 # +3-6273 U+78B5 # +3-6274 U+78AA # +3-6275 U+78AF # +3-6276 U+78D1 # +3-6277 U+78C6 # +3-6278 U+78CB # +3-6279 U+78D4 # +3-627A U+78BE # +3-627B U+78BC # +3-627C U+78C5 # +3-627D U+78CA # +3-627E U+78EC # +3-6321 U+78E7 # +3-6322 U+78DA # +3-6323 U+78FD # +3-6324 U+78F4 # +3-6325 U+7907 # +3-6326 U+7912 # +3-6327 U+7911 # +3-6328 U+7919 # +3-6329 U+792C # +3-632A U+792B # +3-632B U+7940 # +3-632C U+7960 # +3-632D U+7957 # +3-632E U+795F # +3-632F U+795A # +3-6330 U+7955 # +3-6331 U+7953 # +3-6332 U+797A # +3-6333 U+797F # +3-6334 U+798A # +3-6335 U+799D # +3-6336 U+79A7 # +3-6337 U+9F4B # +3-6338 U+79AA # +3-6339 U+79AE # +3-633A U+79B3 # +3-633B U+79B9 # +3-633C U+79BA # +3-633D U+79C9 # +3-633E U+79D5 # +3-633F U+79E7 # +3-6340 U+79EC # +3-6341 U+79E1 # +3-6342 U+79E3 # +3-6343 U+7A08 # +3-6344 U+7A0D # +3-6345 U+7A18 # +3-6346 U+7A19 # +3-6347 U+7A20 # +3-6348 U+7A1F # +3-6349 U+7980 # +3-634A U+7A31 # +3-634B U+7A3B # +3-634C U+7A3E # +3-634D U+7A37 # +3-634E U+7A43 # +3-634F U+7A57 # +3-6350 U+7A49 # +3-6351 U+7A61 # +3-6352 U+7A62 # +3-6353 U+7A69 # +3-6354 U+9F9D # +3-6355 U+7A70 # +3-6356 U+7A79 # +3-6357 U+7A7D # +3-6358 U+7A88 # +3-6359 U+7A97 # +3-635A U+7A95 # +3-635B U+7A98 # +3-635C U+7A96 # +3-635D U+7AA9 # +3-635E U+7AC8 # +3-635F U+7AB0 # +3-6360 U+7AB6 # +3-6361 U+7AC5 # +3-6362 U+7AC4 # +3-6363 U+7ABF # +3-6364 U+9083 # +3-6365 U+7AC7 # +3-6366 U+7ACA # +3-6367 U+7ACD # +3-6368 U+7ACF # +3-6369 U+7AD5 # +3-636A U+7AD3 # +3-636B U+7AD9 # +3-636C U+7ADA # +3-636D U+7ADD # +3-636E U+7AE1 # +3-636F U+7AE2 # +3-6370 U+7AE6 # +3-6371 U+7AED # +3-6372 U+7AF0 # +3-6373 U+7B02 # +3-6374 U+7B0F # +3-6375 U+7B0A # +3-6376 U+7B06 # +3-6377 U+7B33 # +3-6378 U+7B18 # +3-6379 U+7B19 # +3-637A U+7B1E # +3-637B U+7B35 # +3-637C U+7B28 # +3-637D U+7B36 # +3-637E U+7B50 # +3-6421 U+7B7A # +3-6422 U+7B04 # +3-6423 U+7B4D # +3-6424 U+7B0B # +3-6425 U+7B4C # +3-6426 U+7B45 # +3-6427 U+7B75 # +3-6428 U+7B65 # +3-6429 U+7B74 # +3-642A U+7B67 # +3-642B U+7B70 # +3-642C U+7B71 # +3-642D U+7B6C # +3-642E U+7B6E # +3-642F U+7B9D # +3-6430 U+7B98 # +3-6431 U+7B9F # +3-6432 U+7B8D # +3-6433 U+7B9C # +3-6434 U+7B9A # +3-6435 U+7B8B # +3-6436 U+7B92 # +3-6437 U+7B8F # +3-6438 U+7B5D # +3-6439 U+7B99 # +3-643A U+7BCB # +3-643B U+7BC1 # +3-643C U+7BCC # +3-643D U+7BCF # +3-643E U+7BB4 # +3-643F U+7BC6 # +3-6440 U+7BDD # +3-6441 U+7BE9 # +3-6442 U+7C11 # +3-6443 U+7C14 # +3-6444 U+7BE6 # +3-6445 U+7BE5 # +3-6446 U+7C60 # +3-6447 U+7C00 # +3-6448 U+7C07 # +3-6449 U+7C13 # +3-644A U+7BF3 # +3-644B U+7BF7 # +3-644C U+7C17 # +3-644D U+7C0D # +3-644E U+7BF6 # +3-644F U+7C23 # +3-6450 U+7C27 # +3-6451 U+7C2A # +3-6452 U+7C1F # +3-6453 U+7C37 # +3-6454 U+7C2B # +3-6455 U+7C3D # +3-6456 U+7C4C # +3-6457 U+7C43 # +3-6458 U+7C54 # +3-6459 U+7C4F # +3-645A U+7C40 # +3-645B U+7C50 # +3-645C U+7C58 # +3-645D U+7C5F # +3-645E U+7C64 # +3-645F U+7C56 # +3-6460 U+7C65 # +3-6461 U+7C6C # +3-6462 U+7C75 # +3-6463 U+7C83 # +3-6464 U+7C90 # +3-6465 U+7CA4 # +3-6466 U+7CAD # +3-6467 U+7CA2 # +3-6468 U+7CAB # +3-6469 U+7CA1 # +3-646A U+7CA8 # +3-646B U+7CB3 # +3-646C U+7CB2 # +3-646D U+7CB1 # +3-646E U+7CAE # +3-646F U+7CB9 # +3-6470 U+7CBD # +3-6471 U+7CC0 # +3-6472 U+7CC5 # +3-6473 U+7CC2 # +3-6474 U+7CD8 # +3-6475 U+7CD2 # +3-6476 U+7CDC # +3-6477 U+7CE2 # +3-6478 U+9B3B # +3-6479 U+7CEF # +3-647A U+7CF2 # +3-647B U+7CF4 # +3-647C U+7CF6 # +3-647D U+7CFA # +3-647E U+7D06 # +3-6521 U+7D02 # +3-6522 U+7D1C # +3-6523 U+7D15 # +3-6524 U+7D0A # +3-6525 U+7D45 # +3-6526 U+7D4B # +3-6527 U+7D2E # +3-6528 U+7D32 # +3-6529 U+7D3F # +3-652A U+7D35 # +3-652B U+7D46 # +3-652C U+7D73 # +3-652D U+7D56 # +3-652E U+7D4E # +3-652F U+7D72 # +3-6530 U+7D68 # +3-6531 U+7D6E # +3-6532 U+7D4F # +3-6533 U+7D63 # +3-6534 U+7D93 # +3-6535 U+7D89 # +3-6536 U+7D5B # +3-6537 U+7D8F # +3-6538 U+7D7D # +3-6539 U+7D9B # +3-653A U+7DBA # +3-653B U+7DAE # +3-653C U+7DA3 # +3-653D U+7DB5 # +3-653E U+7DC7 # +3-653F U+7DBD # +3-6540 U+7DAB # +3-6541 U+7E3D # +3-6542 U+7DA2 # +3-6543 U+7DAF # +3-6544 U+7DDC # +3-6545 U+7DB8 # +3-6546 U+7D9F # +3-6547 U+7DB0 # +3-6548 U+7DD8 # +3-6549 U+7DDD # +3-654A U+7DE4 # +3-654B U+7DDE # +3-654C U+7DFB # +3-654D U+7DF2 # +3-654E U+7DE1 # +3-654F U+7E05 # +3-6550 U+7E0A # +3-6551 U+7E23 # +3-6552 U+7E21 # +3-6553 U+7E12 # +3-6554 U+7E31 # +3-6555 U+7E1F # +3-6556 U+7E09 # +3-6557 U+7E0B # +3-6558 U+7E22 # +3-6559 U+7E46 # +3-655A U+7E66 # +3-655B U+7E3B # +3-655C U+7E35 # +3-655D U+7E39 # +3-655E U+7E43 # +3-655F U+7E37 # +3-6560 U+7E32 # +3-6561 U+7E3A # +3-6562 U+7E67 # +3-6563 U+7E5D # +3-6564 U+7E56 # +3-6565 U+7E5E # +3-6566 U+7E59 # +3-6567 U+7E5A # +3-6568 U+7E79 # +3-6569 U+7E6A # +3-656A U+7E69 # +3-656B U+7E7C # +3-656C U+7E7B # +3-656D U+7E83 # +3-656E U+7DD5 # +3-656F U+7E7D # +3-6570 U+8FAE # +3-6571 U+7E7F # +3-6572 U+7E88 # +3-6573 U+7E89 # +3-6574 U+7E8C # +3-6575 U+7E92 # +3-6576 U+7E90 # +3-6577 U+7E93 # +3-6578 U+7E94 # +3-6579 U+7E96 # +3-657A U+7E8E # +3-657B U+7E9B # +3-657C U+7E9C # +3-657D U+7F38 # +3-657E U+7F3A # +3-6621 U+7F45 # +3-6622 U+7F4C # +3-6623 U+7F4D # +3-6624 U+7F4E # +3-6625 U+7F50 # +3-6626 U+7F51 # +3-6627 U+7F55 # +3-6628 U+7F54 # +3-6629 U+7F58 # +3-662A U+7F5F # +3-662B U+7F60 # +3-662C U+7F68 # +3-662D U+7F69 # +3-662E U+7F67 # +3-662F U+7F78 # +3-6630 U+7F82 # +3-6631 U+7F86 # +3-6632 U+7F83 # +3-6633 U+7F88 # +3-6634 U+7F87 # +3-6635 U+7F8C # +3-6636 U+7F94 # +3-6637 U+7F9E # +3-6638 U+7F9D # +3-6639 U+7F9A # +3-663A U+7FA3 # +3-663B U+7FAF # +3-663C U+7FB2 # +3-663D U+7FB9 # +3-663E U+7FAE # +3-663F U+7FB6 # +3-6640 U+7FB8 # +3-6641 U+8B71 # +3-6642 U+7FC5 # +3-6643 U+7FC6 # +3-6644 U+7FCA # +3-6645 U+7FD5 # +3-6646 U+7FD4 # +3-6647 U+7FE1 # +3-6648 U+7FE6 # +3-6649 U+7FE9 # +3-664A U+7FF3 # +3-664B U+7FF9 # +3-664C U+98DC # +3-664D U+8006 # +3-664E U+8004 # +3-664F U+800B # +3-6650 U+8012 # +3-6651 U+8018 # +3-6652 U+8019 # +3-6653 U+801C # +3-6654 U+8021 # +3-6655 U+8028 # +3-6656 U+803F # +3-6657 U+803B # +3-6658 U+804A # +3-6659 U+8046 # +3-665A U+8052 # +3-665B U+8058 # +3-665C U+805A # +3-665D U+805F # +3-665E U+8062 # +3-665F U+8068 # +3-6660 U+8073 # +3-6661 U+8072 # +3-6662 U+8070 # +3-6663 U+8076 # +3-6664 U+8079 # +3-6665 U+807D # +3-6666 U+807F # +3-6667 U+8084 # +3-6668 U+8086 # +3-6669 U+8085 # +3-666A U+809B # +3-666B U+8093 # +3-666C U+809A # +3-666D U+80AD # +3-666E U+5190 # +3-666F U+80AC # +3-6670 U+80DB # +3-6671 U+80E5 # +3-6672 U+80D9 # +3-6673 U+80DD # +3-6674 U+80C4 # +3-6675 U+80DA # +3-6676 U+80D6 # +3-6677 U+8109 # +3-6678 U+80EF # +3-6679 U+80F1 # +3-667A U+811B # +3-667B U+8129 # +3-667C U+8123 # +3-667D U+812F # +3-667E U+814B # +3-6721 U+968B # +3-6722 U+8146 # +3-6723 U+813E # +3-6724 U+8153 # +3-6725 U+8151 # +3-6726 U+80FC # +3-6727 U+8171 # +3-6728 U+816E # +3-6729 U+8165 # +3-672A U+8166 # +3-672B U+8174 # +3-672C U+8183 # +3-672D U+8188 # +3-672E U+818A # +3-672F U+8180 # +3-6730 U+8182 # +3-6731 U+81A0 # +3-6732 U+8195 # +3-6733 U+81A4 # +3-6734 U+81A3 # +3-6735 U+815F # +3-6736 U+8193 # +3-6737 U+81A9 # +3-6738 U+81B0 # +3-6739 U+81B5 # +3-673A U+81BE # +3-673B U+81B8 # +3-673C U+81BD # +3-673D U+81C0 # +3-673E U+81C2 # +3-673F U+81BA # +3-6740 U+81C9 # +3-6741 U+81CD # +3-6742 U+81D1 # +3-6743 U+81D9 # +3-6744 U+81D8 # +3-6745 U+81C8 # +3-6746 U+81DA # +3-6747 U+81DF # +3-6748 U+81E0 # +3-6749 U+81E7 # +3-674A U+81FA # +3-674B U+81FB # +3-674C U+81FE # +3-674D U+8201 # +3-674E U+8202 # +3-674F U+8205 # +3-6750 U+8207 # +3-6751 U+820A # +3-6752 U+820D # +3-6753 U+8210 # +3-6754 U+8216 # +3-6755 U+8229 # +3-6756 U+822B # +3-6757 U+8238 # +3-6758 U+8233 # +3-6759 U+8240 # +3-675A U+8259 # +3-675B U+8258 # +3-675C U+825D # +3-675D U+825A # +3-675E U+825F # +3-675F U+8264 # +3-6760 U+8262 # +3-6761 U+8268 # +3-6762 U+826A # +3-6763 U+826B # +3-6764 U+822E # +3-6765 U+8271 # +3-6766 U+8277 # +3-6767 U+8278 # +3-6768 U+827E # +3-6769 U+828D # +3-676A U+8292 # +3-676B U+82AB # +3-676C U+829F # +3-676D U+82BB # +3-676E U+82AC # +3-676F U+82E1 # +3-6770 U+82E3 # +3-6771 U+82DF # +3-6772 U+82D2 # +3-6773 U+82F4 # +3-6774 U+82F3 # +3-6775 U+82FA # +3-6776 U+8393 # +3-6777 U+8303 # +3-6778 U+82FB # +3-6779 U+82F9 # +3-677A U+82DE # +3-677B U+8306 # +3-677C U+82DC # +3-677D U+8309 # +3-677E U+82D9 # +3-6821 U+8335 # +3-6822 U+8334 # +3-6823 U+8316 # +3-6824 U+8332 # +3-6825 U+8331 # +3-6826 U+8340 # +3-6827 U+8339 # +3-6828 U+8350 # +3-6829 U+8345 # +3-682A U+832F # +3-682B U+832B # +3-682C U+8317 # +3-682D U+8318 # +3-682E U+8385 # +3-682F U+839A # +3-6830 U+83AA # +3-6831 U+839F # +3-6832 U+83A2 # +3-6833 U+8396 # +3-6834 U+8323 # +3-6835 U+838E # +3-6836 U+8387 # +3-6837 U+838A # +3-6838 U+837C # +3-6839 U+83B5 # +3-683A U+8373 # +3-683B U+8375 # +3-683C U+83A0 # +3-683D U+8389 # +3-683E U+83A8 # +3-683F U+83F4 # +3-6840 U+8413 # +3-6841 U+83EB # +3-6842 U+83CE # +3-6843 U+83FD # +3-6844 U+8403 # +3-6845 U+83D8 # +3-6846 U+840B # +3-6847 U+83C1 # +3-6848 U+83F7 # +3-6849 U+8407 # +3-684A U+83E0 # +3-684B U+83F2 # +3-684C U+840D # +3-684D U+8422 # +3-684E U+8420 # +3-684F U+83BD # +3-6850 U+8438 # +3-6851 U+8506 # +3-6852 U+83FB # +3-6853 U+846D # +3-6854 U+842A # +3-6855 U+843C # +3-6856 U+855A # +3-6857 U+8484 # +3-6858 U+8477 # +3-6859 U+846B # +3-685A U+84AD # +3-685B U+846E # +3-685C U+8482 # +3-685D U+8469 # +3-685E U+8446 # +3-685F U+842C # +3-6860 U+846F # +3-6861 U+8479 # +3-6862 U+8435 # +3-6863 U+84CA # +3-6864 U+8462 # +3-6865 U+84B9 # +3-6866 U+84BF # +3-6867 U+849F # +3-6868 U+84D9 # +3-6869 U+84CD # +3-686A U+84BB # +3-686B U+84DA # +3-686C U+84D0 # +3-686D U+84C1 # +3-686E U+84C6 # +3-686F U+84D6 # +3-6870 U+84A1 # +3-6871 U+8521 # +3-6872 U+84FF # +3-6873 U+84F4 # +3-6874 U+8517 # +3-6875 U+8518 # +3-6876 U+852C # +3-6877 U+851F # +3-6878 U+8515 # +3-6879 U+8514 # +3-687A U+84FC # +3-687B U+8540 # +3-687C U+8563 # +3-687D U+8558 # +3-687E U+8548 # +3-6921 U+8541 # +3-6922 U+8602 # +3-6923 U+854B # +3-6924 U+8555 # +3-6925 U+8580 # +3-6926 U+85A4 # +3-6927 U+8588 # +3-6928 U+8591 # +3-6929 U+858A # +3-692A U+85A8 # +3-692B U+856D # +3-692C U+8594 # +3-692D U+859B # +3-692E U+85EA # +3-692F U+8587 # +3-6930 U+859C # +3-6931 U+8577 # +3-6932 U+857E # +3-6933 U+8590 # +3-6934 U+85C9 # +3-6935 U+85BA # +3-6936 U+85CF # +3-6937 U+85B9 # +3-6938 U+85D0 # +3-6939 U+85D5 # +3-693A U+85DD # +3-693B U+85E5 # +3-693C U+85DC # +3-693D U+85F9 # +3-693E U+860A # +3-693F U+8613 # +3-6940 U+860B # +3-6941 U+85FE # +3-6942 U+85FA # +3-6943 U+8606 # +3-6944 U+8622 # +3-6945 U+861A # +3-6946 U+8630 # +3-6947 U+863F # +3-6948 U+864D # +3-6949 U+4E55 # +3-694A U+8654 # +3-694B U+865F # +3-694C U+8667 # +3-694D U+8671 # +3-694E U+8693 # +3-694F U+86A3 # +3-6950 U+86A9 # +3-6951 U+86AA # +3-6952 U+868B # +3-6953 U+868C # +3-6954 U+86B6 # +3-6955 U+86AF # +3-6956 U+86C4 # +3-6957 U+86C6 # +3-6958 U+86B0 # +3-6959 U+86C9 # +3-695A U+8823 # +3-695B U+86AB # +3-695C U+86D4 # +3-695D U+86DE # +3-695E U+86E9 # +3-695F U+86EC # +3-6960 U+86DF # +3-6961 U+86DB # +3-6962 U+86EF # +3-6963 U+8712 # +3-6964 U+8706 # +3-6965 U+8708 # +3-6966 U+8700 # +3-6967 U+8703 # +3-6968 U+86FB # +3-6969 U+8711 # +3-696A U+8709 # +3-696B U+870D # +3-696C U+86F9 # +3-696D U+870A # +3-696E U+8734 # +3-696F U+873F # +3-6970 U+8737 # +3-6971 U+873B # +3-6972 U+8725 # +3-6973 U+8729 # +3-6974 U+871A # +3-6975 U+8760 # +3-6976 U+875F # +3-6977 U+8778 # +3-6978 U+874C # +3-6979 U+874E # +3-697A U+8774 # +3-697B U+8757 # +3-697C U+8768 # +3-697D U+876E # +3-697E U+8759 # +3-6A21 U+8753 # +3-6A22 U+8763 # +3-6A23 U+876A # +3-6A24 U+8805 # +3-6A25 U+87A2 # +3-6A26 U+879F # +3-6A27 U+8782 # +3-6A28 U+87AF # +3-6A29 U+87CB # +3-6A2A U+87BD # +3-6A2B U+87C0 # +3-6A2C U+87D0 # +3-6A2D U+96D6 # +3-6A2E U+87AB # +3-6A2F U+87C4 # +3-6A30 U+87B3 # +3-6A31 U+87C7 # +3-6A32 U+87C6 # +3-6A33 U+87BB # +3-6A34 U+87EF # +3-6A35 U+87F2 # +3-6A36 U+87E0 # +3-6A37 U+880F # +3-6A38 U+880D # +3-6A39 U+87FE # +3-6A3A U+87F6 # +3-6A3B U+87F7 # +3-6A3C U+880E # +3-6A3D U+87D2 # +3-6A3E U+8811 # +3-6A3F U+8816 # +3-6A40 U+8815 # +3-6A41 U+8822 # +3-6A42 U+8821 # +3-6A43 U+8831 # +3-6A44 U+8836 # +3-6A45 U+8839 # +3-6A46 U+8827 # +3-6A47 U+883B # +3-6A48 U+8844 # +3-6A49 U+8842 # +3-6A4A U+8852 # +3-6A4B U+8859 # +3-6A4C U+885E # +3-6A4D U+8862 # +3-6A4E U+886B # +3-6A4F U+8881 # +3-6A50 U+887E # +3-6A51 U+889E # +3-6A52 U+8875 # +3-6A53 U+887D # +3-6A54 U+88B5 # +3-6A55 U+8872 # +3-6A56 U+8882 # +3-6A57 U+8897 # +3-6A58 U+8892 # +3-6A59 U+88AE # +3-6A5A U+8899 # +3-6A5B U+88A2 # +3-6A5C U+888D # +3-6A5D U+88A4 # +3-6A5E U+88B0 # +3-6A5F U+88BF # +3-6A60 U+88B1 # +3-6A61 U+88C3 # +3-6A62 U+88C4 # +3-6A63 U+88D4 # +3-6A64 U+88D8 # +3-6A65 U+88D9 # +3-6A66 U+88DD # +3-6A67 U+88F9 # +3-6A68 U+8902 # +3-6A69 U+88FC # +3-6A6A U+88F4 # +3-6A6B U+88E8 # +3-6A6C U+88F2 # +3-6A6D U+8904 # +3-6A6E U+890C # +3-6A6F U+890A # +3-6A70 U+8913 # +3-6A71 U+8943 # +3-6A72 U+891E # +3-6A73 U+8925 # +3-6A74 U+892A # +3-6A75 U+892B # +3-6A76 U+8941 # +3-6A77 U+8944 # +3-6A78 U+893B # +3-6A79 U+8936 # +3-6A7A U+8938 # +3-6A7B U+894C # +3-6A7C U+891D # +3-6A7D U+8960 # +3-6A7E U+895E # +3-6B21 U+8966 # +3-6B22 U+8964 # +3-6B23 U+896D # +3-6B24 U+896A # +3-6B25 U+896F # +3-6B26 U+8974 # +3-6B27 U+8977 # +3-6B28 U+897E # +3-6B29 U+8983 # +3-6B2A U+8988 # +3-6B2B U+898A # +3-6B2C U+8993 # +3-6B2D U+8998 # +3-6B2E U+89A1 # +3-6B2F U+89A9 # +3-6B30 U+89A6 # +3-6B31 U+89AC # +3-6B32 U+89AF # +3-6B33 U+89B2 # +3-6B34 U+89BA # +3-6B35 U+89BD # +3-6B36 U+89BF # +3-6B37 U+89C0 # +3-6B38 U+89DA # +3-6B39 U+89DC # +3-6B3A U+89DD # +3-6B3B U+89E7 # +3-6B3C U+89F4 # +3-6B3D U+89F8 # +3-6B3E U+8A03 # +3-6B3F U+8A16 # +3-6B40 U+8A10 # +3-6B41 U+8A0C # +3-6B42 U+8A1B # +3-6B43 U+8A1D # +3-6B44 U+8A25 # +3-6B45 U+8A36 # +3-6B46 U+8A41 # +3-6B47 U+8A5B # +3-6B48 U+8A52 # +3-6B49 U+8A46 # +3-6B4A U+8A48 # +3-6B4B U+8A7C # +3-6B4C U+8A6D # +3-6B4D U+8A6C # +3-6B4E U+8A62 # +3-6B4F U+8A85 # +3-6B50 U+8A82 # +3-6B51 U+8A84 # +3-6B52 U+8AA8 # +3-6B53 U+8AA1 # +3-6B54 U+8A91 # +3-6B55 U+8AA5 # +3-6B56 U+8AA6 # +3-6B57 U+8A9A # +3-6B58 U+8AA3 # +3-6B59 U+8AC4 # +3-6B5A U+8ACD # +3-6B5B U+8AC2 # +3-6B5C U+8ADA # +3-6B5D U+8AEB # +3-6B5E U+8AF3 # +3-6B5F U+8AE7 # +3-6B60 U+8AE4 # +3-6B61 U+8AF1 # +3-6B62 U+8B14 # +3-6B63 U+8AE0 # +3-6B64 U+8AE2 # +3-6B65 U+8AF7 # +3-6B66 U+8ADE # +3-6B67 U+8ADB # +3-6B68 U+8B0C # +3-6B69 U+8B07 # +3-6B6A U+8B1A # +3-6B6B U+8AE1 # +3-6B6C U+8B16 # +3-6B6D U+8B10 # +3-6B6E U+8B17 # +3-6B6F U+8B20 # +3-6B70 U+8B33 # +3-6B71 U+97AB # +3-6B72 U+8B26 # +3-6B73 U+8B2B # +3-6B74 U+8B3E # +3-6B75 U+8B28 # +3-6B76 U+8B41 # +3-6B77 U+8B4C # +3-6B78 U+8B4F # +3-6B79 U+8B4E # +3-6B7A U+8B49 # +3-6B7B U+8B56 # +3-6B7C U+8B5B # +3-6B7D U+8B5A # +3-6B7E U+8B6B # +3-6C21 U+8B5F # +3-6C22 U+8B6C # +3-6C23 U+8B6F # +3-6C24 U+8B74 # +3-6C25 U+8B7D # +3-6C26 U+8B80 # +3-6C27 U+8B8C # +3-6C28 U+8B8E # +3-6C29 U+8B92 # +3-6C2A U+8B93 # +3-6C2B U+8B96 # +3-6C2C U+8B99 # +3-6C2D U+8B9A # +3-6C2E U+8C3A # +3-6C2F U+8C41 # +3-6C30 U+8C3F # +3-6C31 U+8C48 # +3-6C32 U+8C4C # +3-6C33 U+8C4E # +3-6C34 U+8C50 # +3-6C35 U+8C55 # +3-6C36 U+8C62 # +3-6C37 U+8C6C # +3-6C38 U+8C78 # +3-6C39 U+8C7A # +3-6C3A U+8C82 # +3-6C3B U+8C89 # +3-6C3C U+8C85 # +3-6C3D U+8C8A # +3-6C3E U+8C8D # +3-6C3F U+8C8E # +3-6C40 U+8C94 # +3-6C41 U+8C7C # +3-6C42 U+8C98 # +3-6C43 U+621D # +3-6C44 U+8CAD # +3-6C45 U+8CAA # +3-6C46 U+8CBD # +3-6C47 U+8CB2 # +3-6C48 U+8CB3 # +3-6C49 U+8CAE # +3-6C4A U+8CB6 # +3-6C4B U+8CC8 # +3-6C4C U+8CC1 # +3-6C4D U+8CE4 # +3-6C4E U+8CE3 # +3-6C4F U+8CDA # +3-6C50 U+8CFD # +3-6C51 U+8CFA # +3-6C52 U+8CFB # +3-6C53 U+8D04 # +3-6C54 U+8D05 # +3-6C55 U+8D0A # +3-6C56 U+8D07 # +3-6C57 U+8D0F # +3-6C58 U+8D0D # +3-6C59 U+8D10 # +3-6C5A U+9F4E # +3-6C5B U+8D13 # +3-6C5C U+8CCD # +3-6C5D U+8D14 # +3-6C5E U+8D16 # +3-6C5F U+8D67 # +3-6C60 U+8D6D # +3-6C61 U+8D71 # +3-6C62 U+8D73 # +3-6C63 U+8D81 # +3-6C64 U+8D99 # +3-6C65 U+8DC2 # +3-6C66 U+8DBE # +3-6C67 U+8DBA # +3-6C68 U+8DCF # +3-6C69 U+8DDA # +3-6C6A U+8DD6 # +3-6C6B U+8DCC # +3-6C6C U+8DDB # +3-6C6D U+8DCB # +3-6C6E U+8DEA # +3-6C6F U+8DEB # +3-6C70 U+8DDF # +3-6C71 U+8DE3 # +3-6C72 U+8DFC # +3-6C73 U+8E08 # +3-6C74 U+8E09 # +3-6C75 U+8DFF # +3-6C76 U+8E1D # +3-6C77 U+8E1E # +3-6C78 U+8E10 # +3-6C79 U+8E1F # +3-6C7A U+8E42 # +3-6C7B U+8E35 # +3-6C7C U+8E30 # +3-6C7D U+8E34 # +3-6C7E U+8E4A # +3-6D21 U+8E47 # +3-6D22 U+8E49 # +3-6D23 U+8E4C # +3-6D24 U+8E50 # +3-6D25 U+8E48 # +3-6D26 U+8E59 # +3-6D27 U+8E64 # +3-6D28 U+8E60 # +3-6D29 U+8E2A # +3-6D2A U+8E63 # +3-6D2B U+8E55 # +3-6D2C U+8E76 # +3-6D2D U+8E72 # +3-6D2E U+8E7C # +3-6D2F U+8E81 # +3-6D30 U+8E87 # +3-6D31 U+8E85 # +3-6D32 U+8E84 # +3-6D33 U+8E8B # +3-6D34 U+8E8A # +3-6D35 U+8E93 # +3-6D36 U+8E91 # +3-6D37 U+8E94 # +3-6D38 U+8E99 # +3-6D39 U+8EAA # +3-6D3A U+8EA1 # +3-6D3B U+8EAC # +3-6D3C U+8EB0 # +3-6D3D U+8EC6 # +3-6D3E U+8EB1 # +3-6D3F U+8EBE # +3-6D40 U+8EC5 # +3-6D41 U+8EC8 # +3-6D42 U+8ECB # +3-6D43 U+8EDB # +3-6D44 U+8EE3 # +3-6D45 U+8EFC # +3-6D46 U+8EFB # +3-6D47 U+8EEB # +3-6D48 U+8EFE # +3-6D49 U+8F0A # +3-6D4A U+8F05 # +3-6D4B U+8F15 # +3-6D4C U+8F12 # +3-6D4D U+8F19 # +3-6D4E U+8F13 # +3-6D4F U+8F1C # +3-6D50 U+8F1F # +3-6D51 U+8F1B # +3-6D52 U+8F0C # +3-6D53 U+8F26 # +3-6D54 U+8F33 # +3-6D55 U+8F3B # +3-6D56 U+8F39 # +3-6D57 U+8F45 # +3-6D58 U+8F42 # +3-6D59 U+8F3E # +3-6D5A U+8F4C # +3-6D5B U+8F49 # +3-6D5C U+8F46 # +3-6D5D U+8F4E # +3-6D5E U+8F57 # +3-6D5F U+8F5C # +3-6D60 U+8F62 # +3-6D61 U+8F63 # +3-6D62 U+8F64 # +3-6D63 U+8F9C # +3-6D64 U+8F9F # +3-6D65 U+8FA3 # +3-6D66 U+8FAD # +3-6D67 U+8FAF # +3-6D68 U+8FB7 # +3-6D69 U+8FDA # +3-6D6A U+8FE5 # +3-6D6B U+8FE2 # +3-6D6C U+8FEA # +3-6D6D U+8FEF # +3-6D6E U+9087 # +3-6D6F U+8FF4 # +3-6D70 U+9005 # +3-6D71 U+8FF9 # +3-6D72 U+8FFA # +3-6D73 U+9011 # +3-6D74 U+9015 # +3-6D75 U+9021 # +3-6D76 U+900D # +3-6D77 U+901E # +3-6D78 U+9016 # +3-6D79 U+900B # +3-6D7A U+9027 # +3-6D7B U+9036 # +3-6D7C U+9035 # +3-6D7D U+9039 # +3-6D7E U+8FF8 # +3-6E21 U+904F # +3-6E22 U+9050 # +3-6E23 U+9051 # +3-6E24 U+9052 # +3-6E25 U+900E # +3-6E26 U+9049 # +3-6E27 U+903E # +3-6E28 U+9056 # +3-6E29 U+9058 # +3-6E2A U+905E # +3-6E2B U+9068 # +3-6E2C U+906F # +3-6E2D U+9076 # +3-6E2E U+96A8 # +3-6E2F U+9072 # +3-6E30 U+9082 # +3-6E31 U+907D # +3-6E32 U+9081 # +3-6E33 U+9080 # +3-6E34 U+908A # +3-6E35 U+9089 # +3-6E36 U+908F # +3-6E37 U+90A8 # +3-6E38 U+90AF # +3-6E39 U+90B1 # +3-6E3A U+90B5 # +3-6E3B U+90E2 # +3-6E3C U+90E4 # +3-6E3D U+6248 # +3-6E3E U+90DB # +3-6E3F U+9102 # +3-6E40 U+9112 # +3-6E41 U+9119 # +3-6E42 U+9132 # +3-6E43 U+9130 # +3-6E44 U+914A # +3-6E45 U+9156 # +3-6E46 U+9158 # +3-6E47 U+9163 # +3-6E48 U+9165 # +3-6E49 U+9169 # +3-6E4A U+9173 # +3-6E4B U+9172 # +3-6E4C U+918B # +3-6E4D U+9189 # +3-6E4E U+9182 # +3-6E4F U+91A2 # +3-6E50 U+91AB # +3-6E51 U+91AF # +3-6E52 U+91AA # +3-6E53 U+91B5 # +3-6E54 U+91B4 # +3-6E55 U+91BA # +3-6E56 U+91C0 # +3-6E57 U+91C1 # +3-6E58 U+91C9 # +3-6E59 U+91CB # +3-6E5A U+91D0 # +3-6E5B U+91D6 # +3-6E5C U+91DF # +3-6E5D U+91E1 # +3-6E5E U+91DB # +3-6E5F U+91FC # +3-6E60 U+91F5 # +3-6E61 U+91F6 # +3-6E62 U+921E # +3-6E63 U+91FF # +3-6E64 U+9214 # +3-6E65 U+922C # +3-6E66 U+9215 # +3-6E67 U+9211 # +3-6E68 U+925E # +3-6E69 U+9257 # +3-6E6A U+9245 # +3-6E6B U+9249 # +3-6E6C U+9264 # +3-6E6D U+9248 # +3-6E6E U+9295 # +3-6E6F U+923F # +3-6E70 U+924B # +3-6E71 U+9250 # +3-6E72 U+929C # +3-6E73 U+9296 # +3-6E74 U+9293 # +3-6E75 U+929B # +3-6E76 U+925A # +3-6E77 U+92CF # +3-6E78 U+92B9 # +3-6E79 U+92B7 # +3-6E7A U+92E9 # +3-6E7B U+930F # +3-6E7C U+92FA # +3-6E7D U+9344 # +3-6E7E U+932E # +3-6F21 U+9319 # +3-6F22 U+9322 # +3-6F23 U+931A # +3-6F24 U+9323 # +3-6F25 U+933A # +3-6F26 U+9335 # +3-6F27 U+933B # +3-6F28 U+935C # +3-6F29 U+9360 # +3-6F2A U+937C # +3-6F2B U+936E # +3-6F2C U+9356 # +3-6F2D U+93B0 # +3-6F2E U+93AC # +3-6F2F U+93AD # +3-6F30 U+9394 # +3-6F31 U+93B9 # +3-6F32 U+93D6 # +3-6F33 U+93D7 # +3-6F34 U+93E8 # +3-6F35 U+93E5 # +3-6F36 U+93D8 # +3-6F37 U+93C3 # +3-6F38 U+93DD # +3-6F39 U+93D0 # +3-6F3A U+93C8 # +3-6F3B U+93E4 # +3-6F3C U+941A # +3-6F3D U+9414 # +3-6F3E U+9413 # +3-6F3F U+9403 # +3-6F40 U+9407 # +3-6F41 U+9410 # +3-6F42 U+9436 # +3-6F43 U+942B # +3-6F44 U+9435 # +3-6F45 U+9421 # +3-6F46 U+943A # +3-6F47 U+9441 # +3-6F48 U+9452 # +3-6F49 U+9444 # +3-6F4A U+945B # +3-6F4B U+9460 # +3-6F4C U+9462 # +3-6F4D U+945E # +3-6F4E U+946A # +3-6F4F U+9229 # +3-6F50 U+9470 # +3-6F51 U+9475 # +3-6F52 U+9477 # +3-6F53 U+947D # +3-6F54 U+945A # +3-6F55 U+947C # +3-6F56 U+947E # +3-6F57 U+9481 # +3-6F58 U+947F # +3-6F59 U+9582 # +3-6F5A U+9587 # +3-6F5B U+958A # +3-6F5C U+9594 # +3-6F5D U+9596 # +3-6F5E U+9598 # +3-6F5F U+9599 # +3-6F60 U+95A0 # +3-6F61 U+95A8 # +3-6F62 U+95A7 # +3-6F63 U+95AD # +3-6F64 U+95BC # +3-6F65 U+95BB # +3-6F66 U+95B9 # +3-6F67 U+95BE # +3-6F68 U+95CA # +3-6F69 U+6FF6 # +3-6F6A U+95C3 # +3-6F6B U+95CD # +3-6F6C U+95CC # +3-6F6D U+95D5 # +3-6F6E U+95D4 # +3-6F6F U+95D6 # +3-6F70 U+95DC # +3-6F71 U+95E1 # +3-6F72 U+95E5 # +3-6F73 U+95E2 # +3-6F74 U+9621 # +3-6F75 U+9628 # +3-6F76 U+962E # +3-6F77 U+962F # +3-6F78 U+9642 # +3-6F79 U+964C # +3-6F7A U+964F # +3-6F7B U+964B # +3-6F7C U+9677 # +3-6F7D U+965C # +3-6F7E U+965E # +3-7021 U+965D # +3-7022 U+965F # +3-7023 U+9666 # +3-7024 U+9672 # +3-7025 U+966C # +3-7026 U+968D # +3-7027 U+9698 # +3-7028 U+9695 # +3-7029 U+9697 # +3-702A U+96AA # +3-702B U+96A7 # +3-702C U+96B1 # +3-702D U+96B2 # +3-702E U+96B0 # +3-702F U+96B4 # +3-7030 U+96B6 # +3-7031 U+96B8 # +3-7032 U+96B9 # +3-7033 U+96CE # +3-7034 U+96CB # +3-7035 U+96C9 # +3-7036 U+96CD # +3-7037 U+894D # +3-7038 U+96DC # +3-7039 U+970D # +3-703A U+96D5 # +3-703B U+96F9 # +3-703C U+9704 # +3-703D U+9706 # +3-703E U+9708 # +3-703F U+9713 # +3-7040 U+970E # +3-7041 U+9711 # +3-7042 U+970F # +3-7043 U+9716 # +3-7044 U+9719 # +3-7045 U+9724 # +3-7046 U+972A # +3-7047 U+9730 # +3-7048 U+9739 # +3-7049 U+973D # +3-704A U+973E # +3-704B U+9744 # +3-704C U+9746 # +3-704D U+9748 # +3-704E U+9742 # +3-704F U+9749 # +3-7050 U+975C # +3-7051 U+9760 # +3-7052 U+9764 # +3-7053 U+9766 # +3-7054 U+9768 # +3-7055 U+52D2 # +3-7056 U+976B # +3-7057 U+9771 # +3-7058 U+9779 # +3-7059 U+9785 # +3-705A U+977C # +3-705B U+9781 # +3-705C U+977A # +3-705D U+9786 # +3-705E U+978B # +3-705F U+978F # +3-7060 U+9790 # +3-7061 U+979C # +3-7062 U+97A8 # +3-7063 U+97A6 # +3-7064 U+97A3 # +3-7065 U+97B3 # +3-7066 U+97B4 # +3-7067 U+97C3 # +3-7068 U+97C6 # +3-7069 U+97C8 # +3-706A U+97CB # +3-706B U+97DC # +3-706C U+97ED # +3-706D U+9F4F # +3-706E U+97F2 # +3-706F U+7ADF # +3-7070 U+97F6 # +3-7071 U+97F5 # +3-7072 U+980F # +3-7073 U+980C # +3-7074 U+9838 # +3-7075 U+9824 # +3-7076 U+9821 # +3-7077 U+9837 # +3-7078 U+983D # +3-7079 U+9846 # +3-707A U+984F # +3-707B U+984B # +3-707C U+986B # +3-707D U+986F # +3-707E U+9870 # +3-7121 U+9871 # +3-7122 U+9874 # +3-7123 U+9873 # +3-7124 U+98AA # +3-7125 U+98AF # +3-7126 U+98B1 # +3-7127 U+98B6 # +3-7128 U+98C4 # +3-7129 U+98C3 # +3-712A U+98C6 # +3-712B U+98E9 # +3-712C U+98EB # +3-712D U+9903 # +3-712E U+9909 # +3-712F U+9912 # +3-7130 U+9914 # +3-7131 U+9918 # +3-7132 U+9921 # +3-7133 U+991D # +3-7134 U+991E # +3-7135 U+9924 # +3-7136 U+9920 # +3-7137 U+992C # +3-7138 U+992E # +3-7139 U+993D # +3-713A U+993E # +3-713B U+9942 # +3-713C U+9949 # +3-713D U+9945 # +3-713E U+9950 # +3-713F U+994B # +3-7140 U+9951 # +3-7141 U+9952 # +3-7142 U+994C # +3-7143 U+9955 # +3-7144 U+9997 # +3-7145 U+9998 # +3-7146 U+99A5 # +3-7147 U+99AD # +3-7148 U+99AE # +3-7149 U+99BC # +3-714A U+99DF # +3-714B U+99DB # +3-714C U+99DD # +3-714D U+99D8 # +3-714E U+99D1 # +3-714F U+99ED # +3-7150 U+99EE # +3-7151 U+99F1 # +3-7152 U+99F2 # +3-7153 U+99FB # +3-7154 U+99F8 # +3-7155 U+9A01 # +3-7156 U+9A0F # +3-7157 U+9A05 # +3-7158 U+99E2 # +3-7159 U+9A19 # +3-715A U+9A2B # +3-715B U+9A37 # +3-715C U+9A45 # +3-715D U+9A42 # +3-715E U+9A40 # +3-715F U+9A43 # +3-7160 U+9A3E # +3-7161 U+9A55 # +3-7162 U+9A4D # +3-7163 U+9A5B # +3-7164 U+9A57 # +3-7165 U+9A5F # +3-7166 U+9A62 # +3-7167 U+9A65 # +3-7168 U+9A64 # +3-7169 U+9A69 # +3-716A U+9A6B # +3-716B U+9A6A # +3-716C U+9AAD # +3-716D U+9AB0 # +3-716E U+9ABC # +3-716F U+9AC0 # +3-7170 U+9ACF # +3-7171 U+9AD1 # +3-7172 U+9AD3 # +3-7173 U+9AD4 # +3-7174 U+9ADE # +3-7175 U+9ADF # +3-7176 U+9AE2 # +3-7177 U+9AE3 # +3-7178 U+9AE6 # +3-7179 U+9AEF # +3-717A U+9AEB # +3-717B U+9AEE # +3-717C U+9AF4 # +3-717D U+9AF1 # +3-717E U+9AF7 # +3-7221 U+9AFB # +3-7222 U+9B06 # +3-7223 U+9B18 # +3-7224 U+9B1A # +3-7225 U+9B1F # +3-7226 U+9B22 # +3-7227 U+9B23 # +3-7228 U+9B25 # +3-7229 U+9B27 # +3-722A U+9B28 # +3-722B U+9B29 # +3-722C U+9B2A # +3-722D U+9B2E # +3-722E U+9B2F # +3-722F U+9B32 # +3-7230 U+9B44 # +3-7231 U+9B43 # +3-7232 U+9B4F # +3-7233 U+9B4D # +3-7234 U+9B4E # +3-7235 U+9B51 # +3-7236 U+9B58 # +3-7237 U+9B74 # +3-7238 U+9B93 # +3-7239 U+9B83 # +3-723A U+9B91 # +3-723B U+9B96 # +3-723C U+9B97 # +3-723D U+9B9F # +3-723E U+9BA0 # +3-723F U+9BA8 # +3-7240 U+9BB4 # +3-7241 U+9BC0 # +3-7242 U+9BCA # +3-7243 U+9BB9 # +3-7244 U+9BC6 # +3-7245 U+9BCF # +3-7246 U+9BD1 # +3-7247 U+9BD2 # +3-7248 U+9BE3 # +3-7249 U+9BE2 # +3-724A U+9BE4 # +3-724B U+9BD4 # +3-724C U+9BE1 # +3-724D U+9C3A # +3-724E U+9BF2 # +3-724F U+9BF1 # +3-7250 U+9BF0 # +3-7251 U+9C15 # +3-7252 U+9C14 # +3-7253 U+9C09 # +3-7254 U+9C13 # +3-7255 U+9C0C # +3-7256 U+9C06 # +3-7257 U+9C08 # +3-7258 U+9C12 # +3-7259 U+9C0A # +3-725A U+9C04 # +3-725B U+9C2E # +3-725C U+9C1B # +3-725D U+9C25 # +3-725E U+9C24 # +3-725F U+9C21 # +3-7260 U+9C30 # +3-7261 U+9C47 # +3-7262 U+9C32 # +3-7263 U+9C46 # +3-7264 U+9C3E # +3-7265 U+9C5A # +3-7266 U+9C60 # +3-7267 U+9C67 # +3-7268 U+9C76 # +3-7269 U+9C78 # +3-726A U+9CE7 # +3-726B U+9CEC # +3-726C U+9CF0 # +3-726D U+9D09 # +3-726E U+9D08 # +3-726F U+9CEB # +3-7270 U+9D03 # +3-7271 U+9D06 # +3-7272 U+9D2A # +3-7273 U+9D26 # +3-7274 U+9DAF # +3-7275 U+9D23 # +3-7276 U+9D1F # +3-7277 U+9D44 # +3-7278 U+9D15 # +3-7279 U+9D12 # +3-727A U+9D41 # +3-727B U+9D3F # +3-727C U+9D3E # +3-727D U+9D46 # +3-727E U+9D48 # +3-7321 U+9D5D # +3-7322 U+9D5E # +3-7323 U+9D64 # +3-7324 U+9D51 # +3-7325 U+9D50 # +3-7326 U+9D59 # +3-7327 U+9D72 # +3-7328 U+9D89 # +3-7329 U+9D87 # +3-732A U+9DAB # +3-732B U+9D6F # +3-732C U+9D7A # +3-732D U+9D9A # +3-732E U+9DA4 # +3-732F U+9DA9 # +3-7330 U+9DB2 # +3-7331 U+9DC4 # +3-7332 U+9DC1 # +3-7333 U+9DBB # +3-7334 U+9DB8 # +3-7335 U+9DBA # +3-7336 U+9DC6 # +3-7337 U+9DCF # +3-7338 U+9DC2 # +3-7339 U+9DD9 # +3-733A U+9DD3 # +3-733B U+9DF8 # +3-733C U+9DE6 # +3-733D U+9DED # +3-733E U+9DEF # +3-733F U+9DFD # +3-7340 U+9E1A # +3-7341 U+9E1B # +3-7342 U+9E1E # +3-7343 U+9E75 # +3-7344 U+9E79 # +3-7345 U+9E7D # +3-7346 U+9E81 # +3-7347 U+9E88 # +3-7348 U+9E8B # +3-7349 U+9E8C # +3-734A U+9E92 # +3-734B U+9E95 # +3-734C U+9E91 # +3-734D U+9E9D # +3-734E U+9EA5 # +3-734F U+9EA9 # +3-7350 U+9EB8 # +3-7351 U+9EAA # +3-7352 U+9EAD # +3-7353 U+9761 # +3-7354 U+9ECC # +3-7355 U+9ECE # +3-7356 U+9ECF # +3-7357 U+9ED0 # +3-7358 U+9ED4 # +3-7359 U+9EDC # +3-735A U+9EDE # +3-735B U+9EDD # +3-735C U+9EE0 # +3-735D U+9EE5 # +3-735E U+9EE8 # +3-735F U+9EEF # +3-7360 U+9EF4 # +3-7361 U+9EF6 # +3-7362 U+9EF7 # +3-7363 U+9EF9 # +3-7364 U+9EFB # +3-7365 U+9EFC # +3-7366 U+9EFD # +3-7367 U+9F07 # +3-7368 U+9F08 # +3-7369 U+76B7 # +3-736A U+9F15 # +3-736B U+9F21 # +3-736C U+9F2C # +3-736D U+9F3E # +3-736E U+9F4A # +3-736F U+9F52 # +3-7370 U+9F54 # +3-7371 U+9F63 # +3-7372 U+9F5F # +3-7373 U+9F60 # +3-7374 U+9F61 # +3-7375 U+9F66 # +3-7376 U+9F67 # +3-7377 U+9F6C # +3-7378 U+9F6A # +3-7379 U+9F77 # +3-737A U+9F72 # +3-737B U+9F76 # +3-737C U+9F95 # +3-737D U+9F9C # +3-737E U+9FA0 # +3-7421 U+582F # [1983] +3-7422 U+69C7 # [1983] +3-7423 U+9059 # [1983] +3-7424 U+7464 # [1983] +3-7425 U+51DC # [1990] +3-7426 U+7199 # [1990] +3-7427 U+5653 # [2004] +3-7428 U+5DE2 # [2000] +3-7429 U+5E14 # [2000] +3-742A U+5E18 # [2000] +3-742B U+5E58 # [2000] +3-742C U+5E5E # [2000] +3-742D U+5EBE # [2000] +3-742E U+F928 # CJK COMPATIBILITY IDEOGRAPH-F928 [2000] +3-742F U+5ECB # [2000] +3-7430 U+5EF9 # [2000] +3-7431 U+5F00 # [2000] +3-7432 U+5F02 # [2000] +3-7433 U+5F07 # [2000] +3-7434 U+5F1D # [2000] +3-7435 U+5F23 # [2000] +3-7436 U+5F34 # [2000] +3-7437 U+5F36 # [2000] +3-7438 U+5F3D # [2000] +3-7439 U+5F40 # [2000] +3-743A U+5F45 # [2000] +3-743B U+5F54 # [2000] +3-743C U+5F58 # [2000] +3-743D U+5F64 # [2000] +3-743E U+5F67 # [2000] +3-743F U+5F7D # [2000] +3-7440 U+5F89 # [2000] +3-7441 U+5F9C # [2000] +3-7442 U+5FA7 # [2000] +3-7443 U+5FAF # [2000] +3-7444 U+5FB5 # [2000] +3-7445 U+5FB7 # [2000] +3-7446 U+5FC9 # [2000] +3-7447 U+5FDE # [2000] +3-7448 U+5FE1 # [2000] +3-7449 U+5FE9 # [2000] +3-744A U+600D # [2000] +3-744B U+6014 # [2000] +3-744C U+6018 # [2000] +3-744D U+6033 # [2000] +3-744E U+6035 # [2000] +3-744F U+6047 # [2000] +3-7450 U+FA3D # CJK COMPATIBILITY IDEOGRAPH-FA3D [2000] [Unicode3.2] +3-7451 U+609D # [2000] +3-7452 U+609E # [2000] +3-7453 U+60CB # [2000] +3-7454 U+60D4 # [2000] +3-7455 U+60D5 # [2000] +3-7456 U+60DD # [2000] +3-7457 U+60F8 # [2000] +3-7458 U+611C # [2000] +3-7459 U+612B # [2000] +3-745A U+6130 # [2000] +3-745B U+6137 # [2000] +3-745C U+FA3E # CJK COMPATIBILITY IDEOGRAPH-FA3E [2000] [Unicode3.2] +3-745D U+618D # [2000] +3-745E U+FA3F # CJK COMPATIBILITY IDEOGRAPH-FA3F [2000] [Unicode3.2] +3-745F U+61BC # [2000] +3-7460 U+61B9 # [2000] +3-7461 U+FA40 # CJK COMPATIBILITY IDEOGRAPH-FA40 [2000] [Unicode3.2] +3-7462 U+6222 # [2000] +3-7463 U+623E # [2000] +3-7464 U+6243 # [2000] +3-7465 U+6256 # [2000] +3-7466 U+625A # [2000] +3-7467 U+626F # [2000] +3-7468 U+6285 # [2000] +3-7469 U+62C4 # [2000] +3-746A U+62D6 # [2000] +3-746B U+62FC # [2000] +3-746C U+630A # [2000] +3-746D U+6318 # [2000] +3-746E U+6339 # [2000] +3-746F U+6343 # [2000] +3-7470 U+6365 # [2000] +3-7471 U+637C # [2000] +3-7472 U+63E5 # [2000] +3-7473 U+63ED # [2000] +3-7474 U+63F5 # [2000] +3-7475 U+6410 # [2000] +3-7476 U+6414 # [2000] +3-7477 U+6422 # [2000] +3-7478 U+6479 # [2000] +3-7479 U+6451 # [2000] +3-747A U+6460 # [2000] +3-747B U+646D # [2000] +3-747C U+64CE # [2000] +3-747D U+64BE # [2000] +3-747E U+64BF # [2000] +3-7521 U+64C4 # [2000] +3-7522 U+64CA # [2000] +3-7523 U+64D0 # [2000] +3-7524 U+64F7 # [2000] +3-7525 U+64FB # [2000] +3-7526 U+6522 # [2000] +3-7527 U+6529 # [2000] +3-7528 U+FA41 # CJK COMPATIBILITY IDEOGRAPH-FA41 [2000] [Unicode3.2] +3-7529 U+6567 # [2000] +3-752A U+659D # [2000] +3-752B U+FA42 # CJK COMPATIBILITY IDEOGRAPH-FA42 [2000] [Unicode3.2] +3-752C U+6600 # [2000] +3-752D U+6609 # [2000] +3-752E U+6615 # [2000] +3-752F U+661E # [2000] +3-7530 U+663A # [2000] +3-7531 U+6622 # [2000] +3-7532 U+6624 # [2000] +3-7533 U+662B # [2000] +3-7534 U+6630 # [2000] +3-7535 U+6631 # [2000] +3-7536 U+6633 # [2000] +3-7537 U+66FB # [2000] +3-7538 U+6648 # [2000] +3-7539 U+664C # [2000] +3-753A U+231C4 # [2000] [Unicode3.1] Private: U+F79A +3-753B U+6659 # [2000] +3-753C U+665A # [2000] +3-753D U+6661 # [2000] +3-753E U+6665 # [2000] +3-753F U+6673 # [2000] +3-7540 U+6677 # [2000] +3-7541 U+6678 # [2000] +3-7542 U+668D # [2000] +3-7543 U+FA43 # CJK COMPATIBILITY IDEOGRAPH-FA43 [2000] [Unicode3.2] +3-7544 U+66A0 # [2000] +3-7545 U+66B2 # [2000] +3-7546 U+66BB # [2000] +3-7547 U+66C6 # [2000] +3-7548 U+66C8 # [2000] +3-7549 U+3B22 # [2000] +3-754A U+66DB # [2000] +3-754B U+66E8 # [2000] +3-754C U+66FA # [2000] +3-754D U+6713 # [2000] +3-754E U+F929 # CJK COMPATIBILITY IDEOGRAPH-F929 [2000] +3-754F U+6733 # [2000] +3-7550 U+6766 # [2000] +3-7551 U+6747 # [2000] +3-7552 U+6748 # [2000] +3-7553 U+677B # [2000] +3-7554 U+6781 # [2000] +3-7555 U+6793 # [2000] +3-7556 U+6798 # [2000] +3-7557 U+679B # [2000] +3-7558 U+67BB # [2000] +3-7559 U+67F9 # [2000] +3-755A U+67C0 # [2000] +3-755B U+67D7 # [2000] +3-755C U+67FC # [2000] +3-755D U+6801 # [2000] +3-755E U+6852 # [2000] +3-755F U+681D # [2000] +3-7560 U+682C # [2000] +3-7561 U+6831 # [2000] +3-7562 U+685B # [2000] +3-7563 U+6872 # [2000] +3-7564 U+6875 # [2000] +3-7565 U+FA44 # CJK COMPATIBILITY IDEOGRAPH-FA44 [2000] [Unicode3.2] +3-7566 U+68A3 # [2000] +3-7567 U+68A5 # [2000] +3-7568 U+68B2 # [2000] +3-7569 U+68C8 # [2000] +3-756A U+68D0 # [2000] +3-756B U+68E8 # [2000] +3-756C U+68ED # [2000] +3-756D U+68F0 # [2000] +3-756E U+68F1 # [2000] +3-756F U+68FC # [2000] +3-7570 U+690A # [2000] +3-7571 U+6949 # [2000] +3-7572 U+235C4 # [2000] [Unicode3.1] Private: U+F79D +3-7573 U+6935 # [2000] +3-7574 U+6942 # [2000] +3-7575 U+6957 # [2000] +3-7576 U+6963 # [2000] +3-7577 U+6964 # [2000] +3-7578 U+6968 # [2000] +3-7579 U+6980 # [2000] +3-757A U+FA14 # CJK COMPATIBILITY IDEOGRAPH-FA14 [2000] +3-757B U+69A5 # [2000] +3-757C U+69AD # [2000] +3-757D U+69CF # [2000] +3-757E U+3BB6 # [2000] +3-7621 U+3BC3 # [2000] +3-7622 U+69E2 # [2000] +3-7623 U+69E9 # [2000] +3-7624 U+69EA # [2000] +3-7625 U+69F5 # [2000] +3-7626 U+69F6 # [2000] +3-7627 U+6A0F # [2000] +3-7628 U+6A15 # [2000] +3-7629 U+2373F # [2000] [Unicode3.1] Private: U+F79F +3-762A U+6A3B # [2000] +3-762B U+6A3E # [2000] +3-762C U+6A45 # [2000] +3-762D U+6A50 # [2000] +3-762E U+6A56 # [2000] +3-762F U+6A5B # [2000] +3-7630 U+6A6B # [2000] +3-7631 U+6A73 # [2000] +3-7632 U+23763 # [2000] [Unicode3.1] Private: U+F7A0 +3-7633 U+6A89 # [2000] +3-7634 U+6A94 # [2000] +3-7635 U+6A9D # [2000] +3-7636 U+6A9E # [2000] +3-7637 U+6AA5 # [2000] +3-7638 U+6AE4 # [2000] +3-7639 U+6AE7 # [2000] +3-763A U+3C0F # [2000] +3-763B U+F91D # CJK COMPATIBILITY IDEOGRAPH-F91D [2000] +3-763C U+6B1B # [2000] +3-763D U+6B1E # [2000] +3-763E U+6B2C # [2000] +3-763F U+6B35 # [2000] +3-7640 U+6B46 # [2000] +3-7641 U+6B56 # [2000] +3-7642 U+6B60 # [2000] +3-7643 U+6B65 # [2000] +3-7644 U+6B67 # [2000] +3-7645 U+6B77 # [2000] +3-7646 U+6B82 # [2000] +3-7647 U+6BA9 # [2000] +3-7648 U+6BAD # [2000] +3-7649 U+F970 # CJK COMPATIBILITY IDEOGRAPH-F970 [2000] +3-764A U+6BCF # [2000] +3-764B U+6BD6 # [2000] +3-764C U+6BD7 # [2000] +3-764D U+6BFF # [2000] +3-764E U+6C05 # [2000] +3-764F U+6C10 # [2000] +3-7650 U+6C33 # [2000] +3-7651 U+6C59 # [2000] +3-7652 U+6C5C # [2000] +3-7653 U+6CAA # [2000] +3-7654 U+6C74 # [2000] +3-7655 U+6C76 # [2000] +3-7656 U+6C85 # [2000] +3-7657 U+6C86 # [2000] +3-7658 U+6C98 # [2000] +3-7659 U+6C9C # [2000] +3-765A U+6CFB # [2000] +3-765B U+6CC6 # [2000] +3-765C U+6CD4 # [2000] +3-765D U+6CE0 # [2000] +3-765E U+6CEB # [2000] +3-765F U+6CEE # [2000] +3-7660 U+23CFE # [2000] [Unicode3.1] Private: U+F7A1 +3-7661 U+6D04 # [2000] +3-7662 U+6D0E # [2000] +3-7663 U+6D2E # [2000] +3-7664 U+6D31 # [2000] +3-7665 U+6D39 # [2000] +3-7666 U+6D3F # [2000] +3-7667 U+6D58 # [2000] +3-7668 U+6D65 # [2000] +3-7669 U+FA45 # CJK COMPATIBILITY IDEOGRAPH-FA45 [2000] [Unicode3.2] +3-766A U+6D82 # [2000] +3-766B U+6D87 # [2000] +3-766C U+6D89 # [2000] +3-766D U+6D94 # [2000] +3-766E U+6DAA # [2000] +3-766F U+6DAC # [2000] +3-7670 U+6DBF # [2000] +3-7671 U+6DC4 # [2000] +3-7672 U+6DD6 # [2000] +3-7673 U+6DDA # [2000] +3-7674 U+6DDB # [2000] +3-7675 U+6DDD # [2000] +3-7676 U+6DFC # [2000] +3-7677 U+FA46 # CJK COMPATIBILITY IDEOGRAPH-FA46 [2000] [Unicode3.2] +3-7678 U+6E34 # [2000] +3-7679 U+6E44 # [2000] +3-767A U+6E5C # [2000] +3-767B U+6E5E # [2000] +3-767C U+6EAB # [2000] +3-767D U+6EB1 # [2000] +3-767E U+6EC1 # [2000] +3-7721 U+6EC7 # [2000] +3-7722 U+6ECE # [2000] +3-7723 U+6F10 # [2000] +3-7724 U+6F1A # [2000] +3-7725 U+FA47 # CJK COMPATIBILITY IDEOGRAPH-FA47 [2000] [Unicode3.2] +3-7726 U+6F2A # [2000] +3-7727 U+6F2F # [2000] +3-7728 U+6F33 # [2000] +3-7729 U+6F51 # [2000] +3-772A U+6F59 # [2000] +3-772B U+6F5E # [2000] +3-772C U+6F61 # [2000] +3-772D U+6F62 # [2000] +3-772E U+6F7E # [2000] +3-772F U+6F88 # [2000] +3-7730 U+6F8C # [2000] +3-7731 U+6F8D # [2000] +3-7732 U+6F94 # [2000] +3-7733 U+6FA0 # [2000] +3-7734 U+6FA7 # [2000] +3-7735 U+6FB6 # [2000] +3-7736 U+6FBC # [2000] +3-7737 U+6FC7 # [2000] +3-7738 U+6FCA # [2000] +3-7739 U+6FF9 # [2000] +3-773A U+6FF0 # [2000] +3-773B U+6FF5 # [2000] +3-773C U+7005 # [2000] +3-773D U+7006 # [2000] +3-773E U+7028 # [2000] +3-773F U+704A # [2000] +3-7740 U+705D # [2000] +3-7741 U+705E # [2000] +3-7742 U+704E # [2000] +3-7743 U+7064 # [2000] +3-7744 U+7075 # [2000] +3-7745 U+7085 # [2000] +3-7746 U+70A4 # [2000] +3-7747 U+70AB # [2000] +3-7748 U+70B7 # [2000] +3-7749 U+70D4 # [2000] +3-774A U+70D8 # [2000] +3-774B U+70E4 # [2000] +3-774C U+710F # [2000] +3-774D U+712B # [2000] +3-774E U+711E # [2000] +3-774F U+7120 # [2000] +3-7750 U+712E # [2000] +3-7751 U+7130 # [2000] +3-7752 U+7146 # [2000] +3-7753 U+7147 # [2000] +3-7754 U+7151 # [2000] +3-7755 U+FA48 # CJK COMPATIBILITY IDEOGRAPH-FA48 [2000] [Unicode3.2] +3-7756 U+7152 # [2000] +3-7757 U+715C # [2000] +3-7758 U+7160 # [2000] +3-7759 U+7168 # [2000] +3-775A U+FA15 # CJK COMPATIBILITY IDEOGRAPH-FA15 [2000] +3-775B U+7185 # [2000] +3-775C U+7187 # [2000] +3-775D U+7192 # [2000] +3-775E U+71C1 # [2000] +3-775F U+71BA # [2000] +3-7760 U+71C4 # [2000] +3-7761 U+71FE # [2000] +3-7762 U+7200 # [2000] +3-7763 U+7215 # [2000] +3-7764 U+7255 # [2000] +3-7765 U+7256 # [2000] +3-7766 U+3E3F # [2000] +3-7767 U+728D # [2000] +3-7768 U+729B # [2000] +3-7769 U+72BE # [2000] +3-776A U+72C0 # [2000] +3-776B U+72FB # [2000] +3-776C U+247F1 # [2000] [Unicode3.1] Private: U+F7A6 +3-776D U+7327 # [2000] +3-776E U+7328 # [2000] +3-776F U+FA16 # CJK COMPATIBILITY IDEOGRAPH-FA16 [2000] +3-7770 U+7350 # [2000] +3-7771 U+7366 # [2000] +3-7772 U+737C # [2000] +3-7773 U+7395 # [2000] +3-7774 U+739F # [2000] +3-7775 U+73A0 # [2000] +3-7776 U+73A2 # [2000] +3-7777 U+73A6 # [2000] +3-7778 U+73AB # [2000] +3-7779 U+73C9 # [2000] +3-777A U+73CF # [2000] +3-777B U+73D6 # [2000] +3-777C U+73D9 # [2000] +3-777D U+73E3 # [2000] +3-777E U+73E9 # [2000] +3-7821 U+7407 # [2000] +3-7822 U+740A # [2000] +3-7823 U+741A # [2000] +3-7824 U+741B # [2000] +3-7825 U+FA4A # CJK COMPATIBILITY IDEOGRAPH-FA4A [2000] [Unicode3.2] +3-7826 U+7426 # [2000] +3-7827 U+7428 # [2000] +3-7828 U+742A # [2000] +3-7829 U+742B # [2000] +3-782A U+742C # [2000] +3-782B U+742E # [2000] +3-782C U+742F # [2000] +3-782D U+7430 # [2000] +3-782E U+7444 # [2000] +3-782F U+7446 # [2000] +3-7830 U+7447 # [2000] +3-7831 U+744B # [2000] +3-7832 U+7457 # [2000] +3-7833 U+7462 # [2000] +3-7834 U+746B # [2000] +3-7835 U+746D # [2000] +3-7836 U+7486 # [2000] +3-7837 U+7487 # [2000] +3-7838 U+7489 # [2000] +3-7839 U+7498 # [2000] +3-783A U+749C # [2000] +3-783B U+749F # [2000] +3-783C U+74A3 # [2000] +3-783D U+7490 # [2000] +3-783E U+74A6 # [2000] +3-783F U+74A8 # [2000] +3-7840 U+74A9 # [2000] +3-7841 U+74B5 # [2000] +3-7842 U+74BF # [2000] +3-7843 U+74C8 # [2000] +3-7844 U+74C9 # [2000] +3-7845 U+74DA # [2000] +3-7846 U+74FF # [2000] +3-7847 U+7501 # [2000] +3-7848 U+7517 # [2000] +3-7849 U+752F # [2000] +3-784A U+756F # [2000] +3-784B U+7579 # [2000] +3-784C U+7592 # [2000] +3-784D U+3F72 # [2000] +3-784E U+75CE # [2000] +3-784F U+75E4 # [2000] +3-7850 U+7600 # [2000] +3-7851 U+7602 # [2000] +3-7852 U+7608 # [2000] +3-7853 U+7615 # [2000] +3-7854 U+7616 # [2000] +3-7855 U+7619 # [2000] +3-7856 U+761E # [2000] +3-7857 U+762D # [2000] +3-7858 U+7635 # [2000] +3-7859 U+7643 # [2000] +3-785A U+764B # [2000] +3-785B U+7664 # [2000] +3-785C U+7665 # [2000] +3-785D U+766D # [2000] +3-785E U+766F # [2000] +3-785F U+7671 # [2000] +3-7860 U+7681 # [2000] +3-7861 U+769B # [2000] +3-7862 U+769D # [2000] +3-7863 U+769E # [2000] +3-7864 U+76A6 # [2000] +3-7865 U+76AA # [2000] +3-7866 U+76B6 # [2000] +3-7867 U+76C5 # [2000] +3-7868 U+76CC # [2000] +3-7869 U+76CE # [2000] +3-786A U+76D4 # [2000] +3-786B U+76E6 # [2000] +3-786C U+76F1 # [2000] +3-786D U+76FC # [2000] +3-786E U+770A # [2000] +3-786F U+7719 # [2000] +3-7870 U+7734 # [2000] +3-7871 U+7736 # [2000] +3-7872 U+7746 # [2000] +3-7873 U+774D # [2000] +3-7874 U+774E # [2000] +3-7875 U+775C # [2000] +3-7876 U+775F # [2000] +3-7877 U+7762 # [2000] +3-7878 U+777A # [2000] +3-7879 U+7780 # [2000] +3-787A U+7794 # [2000] +3-787B U+77AA # [2000] +3-787C U+77E0 # [2000] +3-787D U+782D # [2000] +3-787E U+2548E # [2000] [Unicode3.1] Private: U+F7A8 +3-7921 U+7843 # [2000] +3-7922 U+784E # [2000] +3-7923 U+784F # [2000] +3-7924 U+7851 # [2000] +3-7925 U+7868 # [2000] +3-7926 U+786E # [2000] +3-7927 U+FA4B # CJK COMPATIBILITY IDEOGRAPH-FA4B [2000] [Unicode3.2] +3-7928 U+78B0 # [2000] +3-7929 U+2550E # [2000] [Unicode3.1] Private: U+F7AA +3-792A U+78AD # [2000] +3-792B U+78E4 # [2000] +3-792C U+78F2 # [2000] +3-792D U+7900 # [2000] +3-792E U+78F7 # [2000] +3-792F U+791C # [2000] +3-7930 U+792E # [2000] +3-7931 U+7931 # [2000] +3-7932 U+7934 # [2000] +3-7933 U+FA4C # CJK COMPATIBILITY IDEOGRAPH-FA4C [2000] [Unicode3.2] +3-7934 U+FA4D # CJK COMPATIBILITY IDEOGRAPH-FA4D [2000] [Unicode3.2] +3-7935 U+7945 # [2000] +3-7936 U+7946 # [2000] +3-7937 U+FA4E # CJK COMPATIBILITY IDEOGRAPH-FA4E [2000] [Unicode3.2] +3-7938 U+FA4F # CJK COMPATIBILITY IDEOGRAPH-FA4F [2000] [Unicode3.2] +3-7939 U+FA50 # CJK COMPATIBILITY IDEOGRAPH-FA50 [2000] [Unicode3.2] +3-793A U+795C # [2000] +3-793B U+FA51 # CJK COMPATIBILITY IDEOGRAPH-FA51 [2000] [Unicode3.2] +3-793C U+FA19 # CJK COMPATIBILITY IDEOGRAPH-FA19 [2000] +3-793D U+FA1A # CJK COMPATIBILITY IDEOGRAPH-FA1A [2000] +3-793E U+7979 # [2000] +3-793F U+FA52 # CJK COMPATIBILITY IDEOGRAPH-FA52 [2000] [Unicode3.2] +3-7940 U+FA53 # CJK COMPATIBILITY IDEOGRAPH-FA53 [2000] [Unicode3.2] +3-7941 U+FA1B # CJK COMPATIBILITY IDEOGRAPH-FA1B [2000] +3-7942 U+7998 # [2000] +3-7943 U+79B1 # [2000] +3-7944 U+79B8 # [2000] +3-7945 U+79C8 # [2000] +3-7946 U+79CA # [2000] +3-7947 U+25771 # [2000] [Unicode3.1] Private: U+F7B3 +3-7948 U+79D4 # [2000] +3-7949 U+79DE # [2000] +3-794A U+79EB # [2000] +3-794B U+79ED # [2000] +3-794C U+7A03 # [2000] +3-794D U+FA54 # CJK COMPATIBILITY IDEOGRAPH-FA54 [2000] [Unicode3.2] +3-794E U+7A39 # [2000] +3-794F U+7A5D # [2000] +3-7950 U+7A6D # [2000] +3-7951 U+FA55 # CJK COMPATIBILITY IDEOGRAPH-FA55 [2000] [Unicode3.2] +3-7952 U+7A85 # [2000] +3-7953 U+7AA0 # [2000] +3-7954 U+259C4 # [2000] [Unicode3.1] Private: U+F7B6 +3-7955 U+7AB3 # [2000] +3-7956 U+7ABB # [2000] +3-7957 U+7ACE # [2000] +3-7958 U+7AEB # [2000] +3-7959 U+7AFD # [2000] +3-795A U+7B12 # [2000] +3-795B U+7B2D # [2000] +3-795C U+7B3B # [2000] +3-795D U+7B47 # [2000] +3-795E U+7B4E # [2000] +3-795F U+7B60 # [2000] +3-7960 U+7B6D # [2000] +3-7961 U+7B6F # [2000] +3-7962 U+7B72 # [2000] +3-7963 U+7B9E # [2000] +3-7964 U+FA56 # CJK COMPATIBILITY IDEOGRAPH-FA56 [2000] [Unicode3.2] +3-7965 U+7BD7 # [2000] +3-7966 U+7BD9 # [2000] +3-7967 U+7C01 # [2000] +3-7968 U+7C31 # [2000] +3-7969 U+7C1E # [2000] +3-796A U+7C20 # [2000] +3-796B U+7C33 # [2000] +3-796C U+7C36 # [2000] +3-796D U+4264 # [2000] +3-796E U+25DA1 # [2000] [Unicode3.1] Private: U+F7B8 +3-796F U+7C59 # [2000] +3-7970 U+7C6D # [2000] +3-7971 U+7C79 # [2000] +3-7972 U+7C8F # [2000] +3-7973 U+7C94 # [2000] +3-7974 U+7CA0 # [2000] +3-7975 U+7CBC # [2000] +3-7976 U+7CD5 # [2000] +3-7977 U+7CD9 # [2000] +3-7978 U+7CDD # [2000] +3-7979 U+7D07 # [2000] +3-797A U+7D08 # [2000] +3-797B U+7D13 # [2000] +3-797C U+7D1D # [2000] +3-797D U+7D23 # [2000] +3-797E U+7D31 # [2000] +3-7A21 U+7D41 # [2000] +3-7A22 U+7D48 # [2000] +3-7A23 U+7D53 # [2000] +3-7A24 U+7D5C # [2000] +3-7A25 U+7D7A # [2000] +3-7A26 U+7D83 # [2000] +3-7A27 U+7D8B # [2000] +3-7A28 U+7DA0 # [2000] +3-7A29 U+7DA6 # [2000] +3-7A2A U+7DC2 # [2000] +3-7A2B U+7DCC # [2000] +3-7A2C U+7DD6 # [2000] +3-7A2D U+7DE3 # [2000] +3-7A2E U+FA57 # CJK COMPATIBILITY IDEOGRAPH-FA57 [2000] [Unicode3.2] +3-7A2F U+7E28 # [2000] +3-7A30 U+7E08 # [2000] +3-7A31 U+7E11 # [2000] +3-7A32 U+7E15 # [2000] +3-7A33 U+FA59 # CJK COMPATIBILITY IDEOGRAPH-FA59 [2000] [Unicode3.2] +3-7A34 U+7E47 # [2000] +3-7A35 U+7E52 # [2000] +3-7A36 U+7E61 # [2000] +3-7A37 U+7E8A # [2000] +3-7A38 U+7E8D # [2000] +3-7A39 U+7F47 # [2000] +3-7A3A U+FA5A # CJK COMPATIBILITY IDEOGRAPH-FA5A [2000] [Unicode3.2] +3-7A3B U+7F91 # [2000] +3-7A3C U+7F97 # [2000] +3-7A3D U+7FBF # [2000] +3-7A3E U+7FCE # [2000] +3-7A3F U+7FDB # [2000] +3-7A40 U+7FDF # [2000] +3-7A41 U+7FEC # [2000] +3-7A42 U+7FEE # [2000] +3-7A43 U+7FFA # [2000] +3-7A44 U+FA5B # CJK COMPATIBILITY IDEOGRAPH-FA5B [2000] [Unicode3.2] +3-7A45 U+8014 # [2000] +3-7A46 U+8026 # [2000] +3-7A47 U+8035 # [2000] +3-7A48 U+8037 # [2000] +3-7A49 U+803C # [2000] +3-7A4A U+80CA # [2000] +3-7A4B U+80D7 # [2000] +3-7A4C U+80E0 # [2000] +3-7A4D U+80F3 # [2000] +3-7A4E U+8118 # [2000] +3-7A4F U+814A # [2000] +3-7A50 U+8160 # [2000] +3-7A51 U+8167 # [2000] +3-7A52 U+8168 # [2000] +3-7A53 U+816D # [2000] +3-7A54 U+81BB # [2000] +3-7A55 U+81CA # [2000] +3-7A56 U+81CF # [2000] +3-7A57 U+81D7 # [2000] +3-7A58 U+FA5C # CJK COMPATIBILITY IDEOGRAPH-FA5C [2000] [Unicode3.2] +3-7A59 U+4453 # [2000] +3-7A5A U+445B # [2000] +3-7A5B U+8260 # [2000] +3-7A5C U+8274 # [2000] +3-7A5D U+26AFF # [2000] [Unicode3.1] Private: U+F7BE +3-7A5E U+828E # [2000] +3-7A5F U+82A1 # [2000] +3-7A60 U+82A3 # [2000] +3-7A61 U+82A4 # [2000] +3-7A62 U+82A9 # [2000] +3-7A63 U+82AE # [2000] +3-7A64 U+82B7 # [2000] +3-7A65 U+82BE # [2000] +3-7A66 U+82BF # [2000] +3-7A67 U+82C6 # [2000] +3-7A68 U+82D5 # [2000] +3-7A69 U+82FD # [2000] +3-7A6A U+82FE # [2000] +3-7A6B U+8300 # [2000] +3-7A6C U+8301 # [2000] +3-7A6D U+8362 # [2000] +3-7A6E U+8322 # [2000] +3-7A6F U+832D # [2000] +3-7A70 U+833A # [2000] +3-7A71 U+8343 # [2000] +3-7A72 U+8347 # [2000] +3-7A73 U+8351 # [2000] +3-7A74 U+8355 # [2000] +3-7A75 U+837D # [2000] +3-7A76 U+8386 # [2000] +3-7A77 U+8392 # [2000] +3-7A78 U+8398 # [2000] +3-7A79 U+83A7 # [2000] +3-7A7A U+83A9 # [2000] +3-7A7B U+83BF # [2000] +3-7A7C U+83C0 # [2000] +3-7A7D U+83C7 # [2000] +3-7A7E U+83CF # [2000] +3-7B21 U+83D1 # [2000] +3-7B22 U+83E1 # [2000] +3-7B23 U+83EA # [2000] +3-7B24 U+8401 # [2000] +3-7B25 U+8406 # [2000] +3-7B26 U+840A # [2000] +3-7B27 U+FA5F # CJK COMPATIBILITY IDEOGRAPH-FA5F [2000] [Unicode3.2] +3-7B28 U+8448 # [2000] +3-7B29 U+845F # [2000] +3-7B2A U+8470 # [2000] +3-7B2B U+8473 # [2000] +3-7B2C U+8485 # [2000] +3-7B2D U+849E # [2000] +3-7B2E U+84AF # [2000] +3-7B2F U+84B4 # [2000] +3-7B30 U+84BA # [2000] +3-7B31 U+84C0 # [2000] +3-7B32 U+84C2 # [2000] +3-7B33 U+26E40 # [2000] [Unicode3.1] Private: U+F7C0 +3-7B34 U+8532 # [2000] +3-7B35 U+851E # [2000] +3-7B36 U+8523 # [2000] +3-7B37 U+852F # [2000] +3-7B38 U+8559 # [2000] +3-7B39 U+8564 # [2000] +3-7B3A U+FA1F # CJK COMPATIBILITY IDEOGRAPH-FA1F [2000] +3-7B3B U+85AD # [2000] +3-7B3C U+857A # [2000] +3-7B3D U+858C # [2000] +3-7B3E U+858F # [2000] +3-7B3F U+85A2 # [2000] +3-7B40 U+85B0 # [2000] +3-7B41 U+85CB # [2000] +3-7B42 U+85CE # [2000] +3-7B43 U+85ED # [2000] +3-7B44 U+8612 # [2000] +3-7B45 U+85FF # [2000] +3-7B46 U+8604 # [2000] +3-7B47 U+8605 # [2000] +3-7B48 U+8610 # [2000] +3-7B49 U+270F4 # [2000] [Unicode3.1] Private: U+F7C1 +3-7B4A U+8618 # [2000] +3-7B4B U+8629 # [2000] +3-7B4C U+8638 # [2000] +3-7B4D U+8657 # [2000] +3-7B4E U+865B # [2000] +3-7B4F U+F936 # CJK COMPATIBILITY IDEOGRAPH-F936 [2000] +3-7B50 U+8662 # [2000] +3-7B51 U+459D # [2000] +3-7B52 U+866C # [2000] +3-7B53 U+8675 # [2000] +3-7B54 U+8698 # [2000] +3-7B55 U+86B8 # [2000] +3-7B56 U+86FA # [2000] +3-7B57 U+86FC # [2000] +3-7B58 U+86FD # [2000] +3-7B59 U+870B # [2000] +3-7B5A U+8771 # [2000] +3-7B5B U+8787 # [2000] +3-7B5C U+8788 # [2000] +3-7B5D U+87AC # [2000] +3-7B5E U+87AD # [2000] +3-7B5F U+87B5 # [2000] +3-7B60 U+45EA # [2000] +3-7B61 U+87D6 # [2000] +3-7B62 U+87EC # [2000] +3-7B63 U+8806 # [2000] +3-7B64 U+880A # [2000] +3-7B65 U+8810 # [2000] +3-7B66 U+8814 # [2000] +3-7B67 U+881F # [2000] +3-7B68 U+8898 # [2000] +3-7B69 U+88AA # [2000] +3-7B6A U+88CA # [2000] +3-7B6B U+88CE # [2000] +3-7B6C U+27684 # [2000] [Unicode3.1] Private: U+F7C2 +3-7B6D U+88F5 # [2000] +3-7B6E U+891C # [2000] +3-7B6F U+FA60 # CJK COMPATIBILITY IDEOGRAPH-FA60 [2000] [Unicode3.2] +3-7B70 U+8918 # [2000] +3-7B71 U+8919 # [2000] +3-7B72 U+891A # [2000] +3-7B73 U+8927 # [2000] +3-7B74 U+8930 # [2000] +3-7B75 U+8932 # [2000] +3-7B76 U+8939 # [2000] +3-7B77 U+8940 # [2000] +3-7B78 U+8994 # [2000] +3-7B79 U+FA61 # CJK COMPATIBILITY IDEOGRAPH-FA61 [2000] [Unicode3.2] +3-7B7A U+89D4 # [2000] +3-7B7B U+89E5 # [2000] +3-7B7C U+89F6 # [2000] +3-7B7D U+8A12 # [2000] +3-7B7E U+8A15 # [2000] +3-7C21 U+8A22 # [2000] +3-7C22 U+8A37 # [2000] +3-7C23 U+8A47 # [2000] +3-7C24 U+8A4E # [2000] +3-7C25 U+8A5D # [2000] +3-7C26 U+8A61 # [2000] +3-7C27 U+8A75 # [2000] +3-7C28 U+8A79 # [2000] +3-7C29 U+8AA7 # [2000] +3-7C2A U+8AD0 # [2000] +3-7C2B U+8ADF # [2000] +3-7C2C U+8AF4 # [2000] +3-7C2D U+8AF6 # [2000] +3-7C2E U+FA22 # CJK COMPATIBILITY IDEOGRAPH-FA22 [2000] +3-7C2F U+FA62 # CJK COMPATIBILITY IDEOGRAPH-FA62 [2000] [Unicode3.2] +3-7C30 U+FA63 # CJK COMPATIBILITY IDEOGRAPH-FA63 [2000] [Unicode3.2] +3-7C31 U+8B46 # [2000] +3-7C32 U+8B54 # [2000] +3-7C33 U+8B59 # [2000] +3-7C34 U+8B69 # [2000] +3-7C35 U+8B9D # [2000] +3-7C36 U+8C49 # [2000] +3-7C37 U+8C68 # [2000] +3-7C38 U+FA64 # CJK COMPATIBILITY IDEOGRAPH-FA64 [2000] [Unicode3.2] +3-7C39 U+8CE1 # [2000] +3-7C3A U+8CF4 # [2000] +3-7C3B U+8CF8 # [2000] +3-7C3C U+8CFE # [2000] +3-7C3D U+FA65 # CJK COMPATIBILITY IDEOGRAPH-FA65 [2000] [Unicode3.2] +3-7C3E U+8D12 # [2000] +3-7C3F U+8D1B # [2000] +3-7C40 U+8DAF # [2000] +3-7C41 U+8DCE # [2000] +3-7C42 U+8DD1 # [2000] +3-7C43 U+8DD7 # [2000] +3-7C44 U+8E20 # [2000] +3-7C45 U+8E23 # [2000] +3-7C46 U+8E3D # [2000] +3-7C47 U+8E70 # [2000] +3-7C48 U+8E7B # [2000] +3-7C49 U+28277 # [2000] [Unicode3.1] Private: U+F7C9 +3-7C4A U+8EC0 # [2000] +3-7C4B U+4844 # [2000] +3-7C4C U+8EFA # [2000] +3-7C4D U+8F1E # [2000] +3-7C4E U+8F2D # [2000] +3-7C4F U+8F36 # [2000] +3-7C50 U+8F54 # [2000] +3-7C51 U+283CD # [2000] [Unicode3.1] Private: U+F7CA +3-7C52 U+8FA6 # [2000] +3-7C53 U+8FB5 # [2000] +3-7C54 U+8FE4 # [2000] +3-7C55 U+8FE8 # [2000] +3-7C56 U+8FEE # [2000] +3-7C57 U+9008 # [2000] +3-7C58 U+902D # [2000] +3-7C59 U+FA67 # CJK COMPATIBILITY IDEOGRAPH-FA67 [2000] [Unicode3.2] +3-7C5A U+9088 # [2000] +3-7C5B U+9095 # [2000] +3-7C5C U+9097 # [2000] +3-7C5D U+9099 # [2000] +3-7C5E U+909B # [2000] +3-7C5F U+90A2 # [2000] +3-7C60 U+90B3 # [2000] +3-7C61 U+90BE # [2000] +3-7C62 U+90C4 # [2000] +3-7C63 U+90C5 # [2000] +3-7C64 U+90C7 # [2000] +3-7C65 U+90D7 # [2000] +3-7C66 U+90DD # [2000] +3-7C67 U+90DE # [2000] +3-7C68 U+90EF # [2000] +3-7C69 U+90F4 # [2000] +3-7C6A U+FA26 # CJK COMPATIBILITY IDEOGRAPH-FA26 [2000] +3-7C6B U+9114 # [2000] +3-7C6C U+9115 # [2000] +3-7C6D U+9116 # [2000] +3-7C6E U+9122 # [2000] +3-7C6F U+9123 # [2000] +3-7C70 U+9127 # [2000] +3-7C71 U+912F # [2000] +3-7C72 U+9131 # [2000] +3-7C73 U+9134 # [2000] +3-7C74 U+913D # [2000] +3-7C75 U+9148 # [2000] +3-7C76 U+915B # [2000] +3-7C77 U+9183 # [2000] +3-7C78 U+919E # [2000] +3-7C79 U+91AC # [2000] +3-7C7A U+91B1 # [2000] +3-7C7B U+91BC # [2000] +3-7C7C U+91D7 # [2000] +3-7C7D U+91FB # [2000] +3-7C7E U+91E4 # [2000] +3-7D21 U+91E5 # [2000] +3-7D22 U+91ED # [2000] +3-7D23 U+91F1 # [2000] +3-7D24 U+9207 # [2000] +3-7D25 U+9210 # [2000] +3-7D26 U+9238 # [2000] +3-7D27 U+9239 # [2000] +3-7D28 U+923A # [2000] +3-7D29 U+923C # [2000] +3-7D2A U+9240 # [2000] +3-7D2B U+9243 # [2000] +3-7D2C U+924F # [2000] +3-7D2D U+9278 # [2000] +3-7D2E U+9288 # [2000] +3-7D2F U+92C2 # [2000] +3-7D30 U+92CB # [2000] +3-7D31 U+92CC # [2000] +3-7D32 U+92D3 # [2000] +3-7D33 U+92E0 # [2000] +3-7D34 U+92FF # [2000] +3-7D35 U+9304 # [2000] +3-7D36 U+931F # [2000] +3-7D37 U+9321 # [2000] +3-7D38 U+9325 # [2000] +3-7D39 U+9348 # [2000] +3-7D3A U+9349 # [2000] +3-7D3B U+934A # [2000] +3-7D3C U+9364 # [2000] +3-7D3D U+9365 # [2000] +3-7D3E U+936A # [2000] +3-7D3F U+9370 # [2000] +3-7D40 U+939B # [2000] +3-7D41 U+93A3 # [2000] +3-7D42 U+93BA # [2000] +3-7D43 U+93C6 # [2000] +3-7D44 U+93DE # [2000] +3-7D45 U+93DF # [2000] +3-7D46 U+9404 # [2000] +3-7D47 U+93FD # [2000] +3-7D48 U+9433 # [2000] +3-7D49 U+944A # [2000] +3-7D4A U+9463 # [2000] +3-7D4B U+946B # [2000] +3-7D4C U+9471 # [2000] +3-7D4D U+9472 # [2000] +3-7D4E U+958E # [2000] +3-7D4F U+959F # [2000] +3-7D50 U+95A6 # [2000] +3-7D51 U+95A9 # [2000] +3-7D52 U+95AC # [2000] +3-7D53 U+95B6 # [2000] +3-7D54 U+95BD # [2000] +3-7D55 U+95CB # [2000] +3-7D56 U+95D0 # [2000] +3-7D57 U+95D3 # [2000] +3-7D58 U+49B0 # [2000] +3-7D59 U+95DA # [2000] +3-7D5A U+95DE # [2000] +3-7D5B U+9658 # [2000] +3-7D5C U+9684 # [2000] +3-7D5D U+F9DC # CJK COMPATIBILITY IDEOGRAPH-F9DC [2000] +3-7D5E U+969D # [2000] +3-7D5F U+96A4 # [2000] +3-7D60 U+96A5 # [2000] +3-7D61 U+96D2 # [2000] +3-7D62 U+96DE # [2000] +3-7D63 U+FA68 # CJK COMPATIBILITY IDEOGRAPH-FA68 [2000] [Unicode3.2] +3-7D64 U+96E9 # [2000] +3-7D65 U+96EF # [2000] +3-7D66 U+9733 # [2000] +3-7D67 U+973B # [2000] +3-7D68 U+974D # [2000] +3-7D69 U+974E # [2000] +3-7D6A U+974F # [2000] +3-7D6B U+975A # [2000] +3-7D6C U+976E # [2000] +3-7D6D U+9773 # [2000] +3-7D6E U+9795 # [2000] +3-7D6F U+97AE # [2000] +3-7D70 U+97BA # [2000] +3-7D71 U+97C1 # [2000] +3-7D72 U+97C9 # [2000] +3-7D73 U+97DE # [2000] +3-7D74 U+97DB # [2000] +3-7D75 U+97F4 # [2000] +3-7D76 U+FA69 # CJK COMPATIBILITY IDEOGRAPH-FA69 [2000] [Unicode3.2] +3-7D77 U+980A # [2000] +3-7D78 U+981E # [2000] +3-7D79 U+982B # [2000] +3-7D7A U+9830 # [2000] +3-7D7B U+FA6A # CJK COMPATIBILITY IDEOGRAPH-FA6A [2000] [Unicode3.2] +3-7D7C U+9852 # [2000] +3-7D7D U+9853 # [2000] +3-7D7E U+9856 # [2000] +3-7E21 U+9857 # [2000] +3-7E22 U+9859 # [2000] +3-7E23 U+985A # [2000] +3-7E24 U+F9D0 # CJK COMPATIBILITY IDEOGRAPH-F9D0 [2000] +3-7E25 U+9865 # [2000] +3-7E26 U+986C # [2000] +3-7E27 U+98BA # [2000] +3-7E28 U+98C8 # [2000] +3-7E29 U+98E7 # [2000] +3-7E2A U+9958 # [2000] +3-7E2B U+999E # [2000] +3-7E2C U+9A02 # [2000] +3-7E2D U+9A03 # [2000] +3-7E2E U+9A24 # [2000] +3-7E2F U+9A2D # [2000] +3-7E30 U+9A2E # [2000] +3-7E31 U+9A38 # [2000] +3-7E32 U+9A4A # [2000] +3-7E33 U+9A4E # [2000] +3-7E34 U+9A52 # [2000] +3-7E35 U+9AB6 # [2000] +3-7E36 U+9AC1 # [2000] +3-7E37 U+9AC3 # [2000] +3-7E38 U+9ACE # [2000] +3-7E39 U+9AD6 # [2000] +3-7E3A U+9AF9 # [2000] +3-7E3B U+9B02 # [2000] +3-7E3C U+9B08 # [2000] +3-7E3D U+9B20 # [2000] +3-7E3E U+4C17 # [2000] +3-7E3F U+9B2D # [2000] +3-7E40 U+9B5E # [2000] +3-7E41 U+9B79 # [2000] +3-7E42 U+9B66 # [2000] +3-7E43 U+9B72 # [2000] +3-7E44 U+9B75 # [2000] +3-7E45 U+9B84 # [2000] +3-7E46 U+9B8A # [2000] +3-7E47 U+9B8F # [2000] +3-7E48 U+9B9E # [2000] +3-7E49 U+9BA7 # [2000] +3-7E4A U+9BC1 # [2000] +3-7E4B U+9BCE # [2000] +3-7E4C U+9BE5 # [2000] +3-7E4D U+9BF8 # [2000] +3-7E4E U+9BFD # [2000] +3-7E4F U+9C00 # [2000] +3-7E50 U+9C23 # [2000] +3-7E51 U+9C41 # [2000] +3-7E52 U+9C4F # [2000] +3-7E53 U+9C50 # [2000] +3-7E54 U+9C53 # [2000] +3-7E55 U+9C63 # [2000] +3-7E56 U+9C65 # [2000] +3-7E57 U+9C77 # [2000] +3-7E58 U+9D1D # [2000] +3-7E59 U+9D1E # [2000] +3-7E5A U+9D43 # [2000] +3-7E5B U+9D47 # [2000] +3-7E5C U+9D52 # [2000] +3-7E5D U+9D63 # [2000] +3-7E5E U+9D70 # [2000] +3-7E5F U+9D7C # [2000] +3-7E60 U+9D8A # [2000] +3-7E61 U+9D96 # [2000] +3-7E62 U+9DC0 # [2000] +3-7E63 U+9DAC # [2000] +3-7E64 U+9DBC # [2000] +3-7E65 U+9DD7 # [2000] +3-7E66 U+2A190 # [2000] [Unicode3.1] Private: U+F7D0 +3-7E67 U+9DE7 # [2000] +3-7E68 U+9E07 # [2000] +3-7E69 U+9E15 # [2000] +3-7E6A U+9E7C # [2000] +3-7E6B U+9E9E # [2000] +3-7E6C U+9EA4 # [2000] +3-7E6D U+9EAC # [2000] +3-7E6E U+9EAF # [2000] +3-7E6F U+9EB4 # [2000] +3-7E70 U+9EB5 # [2000] +3-7E71 U+9EC3 # [2000] +3-7E72 U+9ED1 # [2000] +3-7E73 U+9F10 # [2000] +3-7E74 U+9F39 # [2000] +3-7E75 U+9F57 # [2000] +3-7E76 U+9F90 # [2000] +3-7E77 U+9F94 # [2000] +3-7E78 U+9F97 # [2000] +3-7E79 U+9FA2 # [2000] +3-7E7A U+59F8 # [2004] +3-7E7B U+5C5B # [2004] +3-7E7C U+5E77 # [2004] +3-7E7D U+7626 # [2004] +3-7E7E U+7E6B # [2004] +4-2121 U+20089 # [2000] [Unicode3.1] Private: U+F7D1 +4-2122 U+4E02 # [2000] +4-2123 U+4E0F # [2000] +4-2124 U+4E12 # [2000] +4-2125 U+4E29 # [2000] +4-2126 U+4E2B # [2000] +4-2127 U+4E2E # [2000] +4-2128 U+4E40 # [2000] +4-2129 U+4E47 # [2000] +4-212A U+4E48 # [2000] +4-212B U+200A2 # [2000] [Unicode3.1] Private: U+F7D2 +4-212C U+4E51 # [2000] +4-212D U+3406 # [2000] +4-212E U+200A4 # [2000] [Unicode3.1] Private: U+F7D3 +4-212F U+4E5A # [2000] +4-2130 U+4E69 # [2000] +4-2131 U+4E9D # [2000] +4-2132 U+342C # [2000] +4-2133 U+342E # [2000] +4-2134 U+4EB9 # [2000] +4-2135 U+4EBB # [2000] +4-2136 U+201A2 # [2000] [Unicode3.1] Private: U+F7D4 +4-2137 U+4EBC # [2000] +4-2138 U+4EC3 # [2000] +4-2139 U+4EC8 # [2000] +4-213A U+4ED0 # [2000] +4-213B U+4EEB # [2000] +4-213C U+4EDA # [2000] +4-213D U+4EF1 # [2000] +4-213E U+4EF5 # [2000] +4-213F U+4F00 # [2000] +4-2140 U+4F16 # [2000] +4-2141 U+4F64 # [2000] +4-2142 U+4F37 # [2000] +4-2143 U+4F3E # [2000] +4-2144 U+4F54 # [2000] +4-2145 U+4F58 # [2000] +4-2146 U+20213 # [2000] [Unicode3.1] Private: U+F7D5 +4-2147 U+4F77 # [2000] +4-2148 U+4F78 # [2000] +4-2149 U+4F7A # [2000] +4-214A U+4F7D # [2000] +4-214B U+4F82 # [2000] +4-214C U+4F85 # [2000] +4-214D U+4F92 # [2000] +4-214E U+4F9A # [2000] +4-214F U+4FE6 # [2000] +4-2150 U+4FB2 # [2000] +4-2151 U+4FBE # [2000] +4-2152 U+4FC5 # [2000] +4-2153 U+4FCB # [2000] +4-2154 U+4FCF # [2000] +4-2155 U+4FD2 # [2000] +4-2156 U+346A # [2000] +4-2157 U+4FF2 # [2000] +4-2158 U+5000 # [2000] +4-2159 U+5010 # [2000] +4-215A U+5013 # [2000] +4-215B U+501C # [2000] +4-215C U+501E # [2000] +4-215D U+5022 # [2000] +4-215E U+3468 # [2000] +4-215F U+5042 # [2000] +4-2160 U+5046 # [2000] +4-2161 U+504E # [2000] +4-2162 U+5053 # [2000] +4-2163 U+5057 # [2000] +4-2164 U+5063 # [2000] +4-2165 U+5066 # [2000] +4-2166 U+506A # [2000] +4-2167 U+5070 # [2000] +4-2168 U+50A3 # [2000] +4-2169 U+5088 # [2000] +4-216A U+5092 # [2000] +4-216B U+5093 # [2000] +4-216C U+5095 # [2000] +4-216D U+5096 # [2000] +4-216E U+509C # [2000] +4-216F U+50AA # [2000] +4-2170 U+2032B # [2000] [Unicode3.1] Private: U+F7D6 +4-2171 U+50B1 # [2000] +4-2172 U+50BA # [2000] +4-2173 U+50BB # [2000] +4-2174 U+50C4 # [2000] +4-2175 U+50C7 # [2000] +4-2176 U+50F3 # [2000] +4-2177 U+20381 # [2000] [Unicode3.1] Private: U+F7D7 +4-2178 U+50CE # [2000] +4-2179 U+20371 # [2000] [Unicode3.1] Private: U+F7D8 +4-217A U+50D4 # [2000] +4-217B U+50D9 # [2000] +4-217C U+50E1 # [2000] +4-217D U+50E9 # [2000] +4-217E U+3492 # [2000] +4-2321 U+5108 # [2000] +4-2322 U+203F9 # [2000] [Unicode3.1] Private: U+F7D9 +4-2323 U+5117 # [2000] +4-2324 U+511B # [2000] +4-2325 U+2044A # [2000] [Unicode3.1] Private: U+F7DA +4-2326 U+5160 # [2000] +4-2327 U+20509 # [2000] [Unicode3.1] Private: U+F7DB +4-2328 U+5173 # [2000] +4-2329 U+5183 # [2000] +4-232A U+518B # [2000] +4-232B U+34BC # [2000] +4-232C U+5198 # [2000] +4-232D U+51A3 # [2000] +4-232E U+51AD # [2000] +4-232F U+34C7 # [2000] +4-2330 U+51BC # [2000] +4-2331 U+205D6 # [2000] [Unicode3.1] Private: U+F7DC +4-2332 U+20628 # [2000] [Unicode3.1] Private: U+F7DD +4-2333 U+51F3 # [2000] +4-2334 U+51F4 # [2000] +4-2335 U+5202 # [2000] +4-2336 U+5212 # [2000] +4-2337 U+5216 # [2000] +4-2338 U+2074F # [2000] [Unicode3.1] Private: U+F7DE +4-2339 U+5255 # [2000] +4-233A U+525C # [2000] +4-233B U+526C # [2000] +4-233C U+5277 # [2000] +4-233D U+5284 # [2000] +4-233E U+5282 # [2000] +4-233F U+20807 # [2000] [Unicode3.1] Private: U+F7DF +4-2340 U+5298 # [2000] +4-2341 U+2083A # [2000] [Unicode3.1] Private: U+F7E0 +4-2342 U+52A4 # [2000] +4-2343 U+52A6 # [2000] +4-2344 U+52AF # [2000] +4-2345 U+52BA # [2000] +4-2346 U+52BB # [2000] +4-2347 U+52CA # [2000] +4-2348 U+351F # [2000] +4-2349 U+52D1 # [2000] +4-234A U+208B9 # [2000] [Unicode3.1] Private: U+F7E1 +4-234B U+52F7 # [2000] +4-234C U+530A # [2000] +4-234D U+530B # [2000] +4-234E U+5324 # [2000] +4-234F U+5335 # [2000] +4-2350 U+533E # [2000] +4-2351 U+5342 # [2000] +4-2352 U+2097C # [2000] [Unicode3.1] Private: U+F7E2 +4-2353 U+2099D # [2000] [Unicode3.1] Private: U+F7E3 +4-2354 U+5367 # [2000] +4-2355 U+536C # [2000] +4-2356 U+537A # [2000] +4-2357 U+53A4 # [2000] +4-2358 U+53B4 # [2000] +4-2359 U+20AD3 # [2000] [Unicode3.1] Private: U+F7E4 +4-235A U+53B7 # [2000] +4-235B U+53C0 # [2000] +4-235C U+20B1D # [2000] [Unicode3.1] Private: U+F7E5 +4-235D U+355D # [2000] +4-235E U+355E # [2000] +4-235F U+53D5 # [2000] +4-2360 U+53DA # [2000] +4-2361 U+3563 # [2000] +4-2362 U+53F4 # [2000] +4-2363 U+53F5 # [2000] +4-2364 U+5455 # [2000] +4-2365 U+5424 # [2000] +4-2366 U+5428 # [2000] +4-2367 U+356E # [2000] +4-2368 U+5443 # [2000] +4-2369 U+5462 # [2000] +4-236A U+5466 # [2000] +4-236B U+546C # [2000] +4-236C U+548A # [2000] +4-236D U+548D # [2000] +4-236E U+5495 # [2000] +4-236F U+54A0 # [2000] +4-2370 U+54A6 # [2000] +4-2371 U+54AD # [2000] +4-2372 U+54AE # [2000] +4-2373 U+54B7 # [2000] +4-2374 U+54BA # [2000] +4-2375 U+54BF # [2000] +4-2376 U+54C3 # [2000] +4-2377 U+20D45 # [2000] [Unicode3.1] Private: U+F7E6 +4-2378 U+54EC # [2000] +4-2379 U+54EF # [2000] +4-237A U+54F1 # [2000] +4-237B U+54F3 # [2000] +4-237C U+5500 # [2000] +4-237D U+5501 # [2000] +4-237E U+5509 # [2000] +4-2421 U+553C # [2000] +4-2422 U+5541 # [2000] +4-2423 U+35A6 # [2000] +4-2424 U+5547 # [2000] +4-2425 U+554A # [2000] +4-2426 U+35A8 # [2000] +4-2427 U+5560 # [2000] +4-2428 U+5561 # [2000] +4-2429 U+5564 # [2000] +4-242A U+20DE1 # [2000] [Unicode3.1] Private: U+F7E7 +4-242B U+557D # [2000] +4-242C U+5582 # [2000] +4-242D U+5588 # [2000] +4-242E U+5591 # [2000] +4-242F U+35C5 # [2000] +4-2430 U+55D2 # [2000] +4-2431 U+20E95 # [2000] [Unicode3.1] Private: U+F7E8 +4-2432 U+20E6D # [2000] [Unicode3.1] Private: U+F7E9 +4-2433 U+55BF # [2000] +4-2434 U+55C9 # [2000] +4-2435 U+55CC # [2000] +4-2436 U+55D1 # [2000] +4-2437 U+55DD # [2000] +4-2438 U+35DA # [2000] +4-2439 U+55E2 # [2000] +4-243A U+20E64 # [2000] [Unicode3.1] Private: U+F7EA +4-243B U+55E9 # [2000] +4-243C U+5628 # [2000] +4-243D U+20F5F # [2000] [Unicode3.1] Private: U+F7EB +4-243E U+5607 # [2000] +4-243F U+5610 # [2000] +4-2440 U+5630 # [2000] +4-2441 U+5637 # [2000] +4-2442 U+35F4 # [2000] +4-2443 U+563D # [2000] +4-2444 U+563F # [2000] +4-2445 U+5640 # [2000] +4-2446 U+5647 # [2000] +4-2447 U+565E # [2000] +4-2448 U+5660 # [2000] +4-2449 U+566D # [2000] +4-244A U+3605 # [2000] +4-244B U+5688 # [2000] +4-244C U+568C # [2000] +4-244D U+5695 # [2000] +4-244E U+569A # [2000] +4-244F U+569D # [2000] +4-2450 U+56A8 # [2000] +4-2451 U+56AD # [2000] +4-2452 U+56B2 # [2000] +4-2453 U+56C5 # [2000] +4-2454 U+56CD # [2000] +4-2455 U+56DF # [2000] +4-2456 U+56E8 # [2000] +4-2457 U+56F6 # [2000] +4-2458 U+56F7 # [2000] +4-2459 U+21201 # [2000] [Unicode3.1] Private: U+F7EC +4-245A U+5715 # [2000] +4-245B U+5723 # [2000] +4-245C U+21255 # [2000] [Unicode3.1] Private: U+F7ED +4-245D U+5729 # [2000] +4-245E U+2127B # [2000] [Unicode3.1] Private: U+F7EE +4-245F U+5745 # [2000] +4-2460 U+5746 # [2000] +4-2461 U+574C # [2000] +4-2462 U+574D # [2000] +4-2463 U+21274 # [2000] [Unicode3.1] Private: U+F7EF +4-2464 U+5768 # [2000] +4-2465 U+576F # [2000] +4-2466 U+5773 # [2000] +4-2467 U+5774 # [2000] +4-2468 U+5775 # [2000] +4-2469 U+577B # [2000] +4-246A U+212E4 # [2000] [Unicode3.1] Private: U+F7F0 +4-246B U+212D7 # [2000] [Unicode3.1] Private: U+F7F1 +4-246C U+57AC # [2000] +4-246D U+579A # [2000] +4-246E U+579D # [2000] +4-246F U+579E # [2000] +4-2470 U+57A8 # [2000] +4-2471 U+57D7 # [2000] +4-2472 U+212FD # [2000] [Unicode3.1] Private: U+F7F2 +4-2473 U+57CC # [2000] +4-2474 U+21336 # [2000] [Unicode3.1] Private: U+F7F3 +4-2475 U+21344 # [2000] [Unicode3.1] Private: U+F7F4 +4-2476 U+57DE # [2000] +4-2477 U+57E6 # [2000] +4-2478 U+57F0 # [2000] +4-2479 U+364A # [2000] +4-247A U+57F8 # [2000] +4-247B U+57FB # [2000] +4-247C U+57FD # [2000] +4-247D U+5804 # [2000] +4-247E U+581E # [2000] +4-2521 U+5820 # [2000] +4-2522 U+5827 # [2000] +4-2523 U+5832 # [2000] +4-2524 U+5839 # [2000] +4-2525 U+213C4 # [2000] [Unicode3.1] Private: U+F7F5 +4-2526 U+5849 # [2000] +4-2527 U+584C # [2000] +4-2528 U+5867 # [2000] +4-2529 U+588A # [2000] +4-252A U+588B # [2000] +4-252B U+588D # [2000] +4-252C U+588F # [2000] +4-252D U+5890 # [2000] +4-252E U+5894 # [2000] +4-252F U+589D # [2000] +4-2530 U+58AA # [2000] +4-2531 U+58B1 # [2000] +4-2532 U+2146D # [2000] [Unicode3.1] Private: U+F7F6 +4-2533 U+58C3 # [2000] +4-2534 U+58CD # [2000] +4-2535 U+58E2 # [2000] +4-2536 U+58F3 # [2000] +4-2537 U+58F4 # [2000] +4-2538 U+5905 # [2000] +4-2539 U+5906 # [2000] +4-253A U+590B # [2000] +4-253B U+590D # [2000] +4-253C U+5914 # [2000] +4-253D U+5924 # [2000] +4-253E U+215D7 # [2000] [Unicode3.1] Private: U+F7F7 +4-253F U+3691 # [2000] +4-2540 U+593D # [2000] +4-2541 U+3699 # [2000] +4-2542 U+5946 # [2000] +4-2543 U+3696 # [2000] +4-2544 U+26C29 # [2000] [Unicode3.1] Private: U+F7F8 +4-2545 U+595B # [2000] +4-2546 U+595F # [2000] +4-2547 U+21647 # [2000] [Unicode3.1] Private: U+F7F9 +4-2548 U+5975 # [2000] +4-2549 U+5976 # [2000] +4-254A U+597C # [2000] +4-254B U+599F # [2000] +4-254C U+59AE # [2000] +4-254D U+59BC # [2000] +4-254E U+59C8 # [2000] +4-254F U+59CD # [2000] +4-2550 U+59DE # [2000] +4-2551 U+59E3 # [2000] +4-2552 U+59E4 # [2000] +4-2553 U+59E7 # [2000] +4-2554 U+59EE # [2000] +4-2555 U+21706 # [2000] [Unicode3.1] Private: U+F7FA +4-2556 U+21742 # [2000] [Unicode3.1] Private: U+F7FB +4-2557 U+36CF # [2000] +4-2558 U+5A0C # [2000] +4-2559 U+5A0D # [2000] +4-255A U+5A17 # [2000] +4-255B U+5A27 # [2000] +4-255C U+5A2D # [2000] +4-255D U+5A55 # [2000] +4-255E U+5A65 # [2000] +4-255F U+5A7A # [2000] +4-2560 U+5A8B # [2000] +4-2561 U+5A9C # [2000] +4-2562 U+5A9F # [2000] +4-2563 U+5AA0 # [2000] +4-2564 U+5AA2 # [2000] +4-2565 U+5AB1 # [2000] +4-2566 U+5AB3 # [2000] +4-2567 U+5AB5 # [2000] +4-2568 U+5ABA # [2000] +4-2569 U+5ABF # [2000] +4-256A U+5ADA # [2000] +4-256B U+5ADC # [2000] +4-256C U+5AE0 # [2000] +4-256D U+5AE5 # [2000] +4-256E U+5AF0 # [2000] +4-256F U+5AEE # [2000] +4-2570 U+5AF5 # [2000] +4-2571 U+5B00 # [2000] +4-2572 U+5B08 # [2000] +4-2573 U+5B17 # [2000] +4-2574 U+5B34 # [2000] +4-2575 U+5B2D # [2000] +4-2576 U+5B4C # [2000] +4-2577 U+5B52 # [2000] +4-2578 U+5B68 # [2000] +4-2579 U+5B6F # [2000] +4-257A U+5B7C # [2000] +4-257B U+5B7F # [2000] +4-257C U+5B81 # [2000] +4-257D U+5B84 # [2000] +4-257E U+219C3 # [2000] [Unicode3.1] Private: U+F7FC +4-2821 U+5B96 # [2000] +4-2822 U+5BAC # [2000] +4-2823 U+3761 # [2000] +4-2824 U+5BC0 # [2000] +4-2825 U+3762 # [2000] +4-2826 U+5BCE # [2000] +4-2827 U+5BD6 # [2000] +4-2828 U+376C # [2000] +4-2829 U+376B # [2000] +4-282A U+5BF1 # [2000] +4-282B U+5BFD # [2000] +4-282C U+3775 # [2000] +4-282D U+5C03 # [2000] +4-282E U+5C29 # [2000] +4-282F U+5C30 # [2000] +4-2830 U+21C56 # [2000] [Unicode3.1] Private: U+F7FD +4-2831 U+5C5F # [2000] +4-2832 U+5C63 # [2000] +4-2833 U+5C67 # [2000] +4-2834 U+5C68 # [2000] +4-2835 U+5C69 # [2000] +4-2836 U+5C70 # [2000] +4-2837 U+21D2D # [2000] [Unicode3.1] Private: U+F7FE +4-2838 U+21D45 # [2000] [Unicode3.1] Private: U+F7FF +4-2839 U+5C7C # [2000] +4-283A U+21D78 # [2000] [Unicode3.1] Private: U+F800 +4-283B U+21D62 # [2000] [Unicode3.1] Private: U+F801 +4-283C U+5C88 # [2000] +4-283D U+5C8A # [2000] +4-283E U+37C1 # [2000] +4-283F U+21DA1 # [2000] [Unicode3.1] Private: U+F802 +4-2840 U+21D9C # [2000] [Unicode3.1] Private: U+F803 +4-2841 U+5CA0 # [2000] +4-2842 U+5CA2 # [2000] +4-2843 U+5CA6 # [2000] +4-2844 U+5CA7 # [2000] +4-2845 U+21D92 # [2000] [Unicode3.1] Private: U+F804 +4-2846 U+5CAD # [2000] +4-2847 U+5CB5 # [2000] +4-2848 U+21DB7 # [2000] [Unicode3.1] Private: U+F805 +4-2849 U+5CC9 # [2000] +4-284A U+21DE0 # [2000] [Unicode3.1] Private: U+F806 +4-284B U+21E33 # [2000] [Unicode3.1] Private: U+F807 +4-284C U+5D06 # [2000] +4-284D U+5D10 # [2000] +4-284E U+5D2B # [2000] +4-284F U+5D1D # [2000] +4-2850 U+5D20 # [2000] +4-2851 U+5D24 # [2000] +4-2852 U+5D26 # [2000] +4-2853 U+5D31 # [2000] +4-2854 U+5D39 # [2000] +4-2855 U+5D42 # [2000] +4-2856 U+37E8 # [2000] +4-2857 U+5D61 # [2000] +4-2858 U+5D6A # [2000] +4-2859 U+37F4 # [2000] +4-285A U+5D70 # [2000] +4-285B U+21F1E # [2000] [Unicode3.1] Private: U+F808 +4-285C U+37FD # [2000] +4-285D U+5D88 # [2000] +4-285E U+3800 # [2000] +4-285F U+5D92 # [2000] +4-2860 U+5D94 # [2000] +4-2861 U+5D97 # [2000] +4-2862 U+5D99 # [2000] +4-2863 U+5DB0 # [2000] +4-2864 U+5DB2 # [2000] +4-2865 U+5DB4 # [2000] +4-2866 U+21F76 # [2000] [Unicode3.1] Private: U+F809 +4-2867 U+5DB9 # [2000] +4-2868 U+5DD1 # [2000] +4-2869 U+5DD7 # [2000] +4-286A U+5DD8 # [2000] +4-286B U+5DE0 # [2000] +4-286C U+21FFA # [2000] [Unicode3.1] Private: U+F80A +4-286D U+5DE4 # [2000] +4-286E U+5DE9 # [2000] +4-286F U+382F # [2000] +4-2870 U+5E00 # [2000] +4-2871 U+3836 # [2000] +4-2872 U+5E12 # [2000] +4-2873 U+5E15 # [2000] +4-2874 U+3840 # [2000] +4-2875 U+5E1F # [2000] +4-2876 U+5E2E # [2000] +4-2877 U+5E3E # [2000] +4-2878 U+5E49 # [2000] +4-2879 U+385C # [2000] +4-287A U+5E56 # [2000] +4-287B U+3861 # [2000] +4-287C U+5E6B # [2000] +4-287D U+5E6C # [2000] +4-287E U+5E6D # [2000] +4-2C21 U+5E6E # [2000] +4-2C22 U+2217B # [2000] [Unicode3.1] Private: U+F80B +4-2C23 U+5EA5 # [2000] +4-2C24 U+5EAA # [2000] +4-2C25 U+5EAC # [2000] +4-2C26 U+5EB9 # [2000] +4-2C27 U+5EBF # [2000] +4-2C28 U+5EC6 # [2000] +4-2C29 U+5ED2 # [2000] +4-2C2A U+5ED9 # [2000] +4-2C2B U+2231E # [2000] [Unicode3.1] Private: U+F80C +4-2C2C U+5EFD # [2000] +4-2C2D U+5F08 # [2000] +4-2C2E U+5F0E # [2000] +4-2C2F U+5F1C # [2000] +4-2C30 U+223AD # [2000] [Unicode3.1] Private: U+F80D +4-2C31 U+5F1E # [2000] +4-2C32 U+5F47 # [2000] +4-2C33 U+5F63 # [2000] +4-2C34 U+5F72 # [2000] +4-2C35 U+5F7E # [2000] +4-2C36 U+5F8F # [2000] +4-2C37 U+5FA2 # [2000] +4-2C38 U+5FA4 # [2000] +4-2C39 U+5FB8 # [2000] +4-2C3A U+5FC4 # [2000] +4-2C3B U+38FA # [2000] +4-2C3C U+5FC7 # [2000] +4-2C3D U+5FCB # [2000] +4-2C3E U+5FD2 # [2000] +4-2C3F U+5FD3 # [2000] +4-2C40 U+5FD4 # [2000] +4-2C41 U+5FE2 # [2000] +4-2C42 U+5FEE # [2000] +4-2C43 U+5FEF # [2000] +4-2C44 U+5FF3 # [2000] +4-2C45 U+5FFC # [2000] +4-2C46 U+3917 # [2000] +4-2C47 U+6017 # [2000] +4-2C48 U+6022 # [2000] +4-2C49 U+6024 # [2000] +4-2C4A U+391A # [2000] +4-2C4B U+604C # [2000] +4-2C4C U+607F # [2000] +4-2C4D U+608A # [2000] +4-2C4E U+6095 # [2000] +4-2C4F U+60A8 # [2000] +4-2C50 U+226F3 # [2000] [Unicode3.1] Private: U+F80E +4-2C51 U+60B0 # [2000] +4-2C52 U+60B1 # [2000] +4-2C53 U+60BE # [2000] +4-2C54 U+60C8 # [2000] +4-2C55 U+60D9 # [2000] +4-2C56 U+60DB # [2000] +4-2C57 U+60EE # [2000] +4-2C58 U+60F2 # [2000] +4-2C59 U+60F5 # [2000] +4-2C5A U+6110 # [2000] +4-2C5B U+6112 # [2000] +4-2C5C U+6113 # [2000] +4-2C5D U+6119 # [2000] +4-2C5E U+611E # [2000] +4-2C5F U+613A # [2000] +4-2C60 U+396F # [2000] +4-2C61 U+6141 # [2000] +4-2C62 U+6146 # [2000] +4-2C63 U+6160 # [2000] +4-2C64 U+617C # [2000] +4-2C65 U+2285B # [2000] [Unicode3.1] Private: U+F80F +4-2C66 U+6192 # [2000] +4-2C67 U+6193 # [2000] +4-2C68 U+6197 # [2000] +4-2C69 U+6198 # [2000] +4-2C6A U+61A5 # [2000] +4-2C6B U+61A8 # [2000] +4-2C6C U+61AD # [2000] +4-2C6D U+228AB # [2000] [Unicode3.1] Private: U+F810 +4-2C6E U+61D5 # [2000] +4-2C6F U+61DD # [2000] +4-2C70 U+61DF # [2000] +4-2C71 U+61F5 # [2000] +4-2C72 U+2298F # [2000] [Unicode3.1] Private: U+F811 +4-2C73 U+6215 # [2000] +4-2C74 U+6223 # [2000] +4-2C75 U+6229 # [2000] +4-2C76 U+6246 # [2000] +4-2C77 U+624C # [2000] +4-2C78 U+6251 # [2000] +4-2C79 U+6252 # [2000] +4-2C7A U+6261 # [2000] +4-2C7B U+6264 # [2000] +4-2C7C U+627B # [2000] +4-2C7D U+626D # [2000] +4-2C7E U+6273 # [2000] +4-2D21 U+6299 # [2000] +4-2D22 U+62A6 # [2000] +4-2D23 U+62D5 # [2000] +4-2D24 U+22AB8 # [2000] [Unicode3.1] Private: U+F812 +4-2D25 U+62FD # [2000] +4-2D26 U+6303 # [2000] +4-2D27 U+630D # [2000] +4-2D28 U+6310 # [2000] +4-2D29 U+22B4F # [2000] [Unicode3.1] Private: U+F813 +4-2D2A U+22B50 # [2000] [Unicode3.1] Private: U+F814 +4-2D2B U+6332 # [2000] +4-2D2C U+6335 # [2000] +4-2D2D U+633B # [2000] +4-2D2E U+633C # [2000] +4-2D2F U+6341 # [2000] +4-2D30 U+6344 # [2000] +4-2D31 U+634E # [2000] +4-2D32 U+22B46 # [2000] [Unicode3.1] Private: U+F815 +4-2D33 U+6359 # [2000] +4-2D34 U+22C1D # [2000] [Unicode3.1] Private: U+F816 +4-2D35 U+22BA6 # [2000] [Unicode3.1] Private: U+F817 +4-2D36 U+636C # [2000] +4-2D37 U+6384 # [2000] +4-2D38 U+6399 # [2000] +4-2D39 U+22C24 # [2000] [Unicode3.1] Private: U+F818 +4-2D3A U+6394 # [2000] +4-2D3B U+63BD # [2000] +4-2D3C U+63F7 # [2000] +4-2D3D U+63D4 # [2000] +4-2D3E U+63D5 # [2000] +4-2D3F U+63DC # [2000] +4-2D40 U+63E0 # [2000] +4-2D41 U+63EB # [2000] +4-2D42 U+63EC # [2000] +4-2D43 U+63F2 # [2000] +4-2D44 U+6409 # [2000] +4-2D45 U+641E # [2000] +4-2D46 U+6425 # [2000] +4-2D47 U+6429 # [2000] +4-2D48 U+642F # [2000] +4-2D49 U+645A # [2000] +4-2D4A U+645B # [2000] +4-2D4B U+645D # [2000] +4-2D4C U+6473 # [2000] +4-2D4D U+647D # [2000] +4-2D4E U+6487 # [2000] +4-2D4F U+6491 # [2000] +4-2D50 U+649D # [2000] +4-2D51 U+649F # [2000] +4-2D52 U+64CB # [2000] +4-2D53 U+64CC # [2000] +4-2D54 U+64D5 # [2000] +4-2D55 U+64D7 # [2000] +4-2D56 U+22DE1 # [2000] [Unicode3.1] Private: U+F819 +4-2D57 U+64E4 # [2000] +4-2D58 U+64E5 # [2000] +4-2D59 U+64FF # [2000] +4-2D5A U+6504 # [2000] +4-2D5B U+3A6E # [2000] +4-2D5C U+650F # [2000] +4-2D5D U+6514 # [2000] +4-2D5E U+6516 # [2000] +4-2D5F U+3A73 # [2000] +4-2D60 U+651E # [2000] +4-2D61 U+6532 # [2000] +4-2D62 U+6544 # [2000] +4-2D63 U+6554 # [2000] +4-2D64 U+656B # [2000] +4-2D65 U+657A # [2000] +4-2D66 U+6581 # [2000] +4-2D67 U+6584 # [2000] +4-2D68 U+6585 # [2000] +4-2D69 U+658A # [2000] +4-2D6A U+65B2 # [2000] +4-2D6B U+65B5 # [2000] +4-2D6C U+65B8 # [2000] +4-2D6D U+65BF # [2000] +4-2D6E U+65C2 # [2000] +4-2D6F U+65C9 # [2000] +4-2D70 U+65D4 # [2000] +4-2D71 U+3AD6 # [2000] +4-2D72 U+65F2 # [2000] +4-2D73 U+65F9 # [2000] +4-2D74 U+65FC # [2000] +4-2D75 U+6604 # [2000] +4-2D76 U+6608 # [2000] +4-2D77 U+6621 # [2000] +4-2D78 U+662A # [2000] +4-2D79 U+6645 # [2000] +4-2D7A U+6651 # [2000] +4-2D7B U+664E # [2000] +4-2D7C U+3AEA # [2000] +4-2D7D U+231C3 # [2000] [Unicode3.1] Private: U+F81A +4-2D7E U+6657 # [2000] +4-2E21 U+665B # [2000] +4-2E22 U+6663 # [2000] +4-2E23 U+231F5 # [2000] [Unicode3.1] Private: U+F81B +4-2E24 U+231B6 # [2000] [Unicode3.1] Private: U+F81C +4-2E25 U+666A # [2000] +4-2E26 U+666B # [2000] +4-2E27 U+666C # [2000] +4-2E28 U+666D # [2000] +4-2E29 U+667B # [2000] +4-2E2A U+6680 # [2000] +4-2E2B U+6690 # [2000] +4-2E2C U+6692 # [2000] +4-2E2D U+6699 # [2000] +4-2E2E U+3B0E # [2000] +4-2E2F U+66AD # [2000] +4-2E30 U+66B1 # [2000] +4-2E31 U+66B5 # [2000] +4-2E32 U+3B1A # [2000] +4-2E33 U+66BF # [2000] +4-2E34 U+3B1C # [2000] +4-2E35 U+66EC # [2000] +4-2E36 U+3AD7 # [2000] +4-2E37 U+6701 # [2000] +4-2E38 U+6705 # [2000] +4-2E39 U+6712 # [2000] +4-2E3A U+23372 # [2000] [Unicode3.1] Private: U+F81D +4-2E3B U+6719 # [2000] +4-2E3C U+233D3 # [2000] [Unicode3.1] Private: U+F81E +4-2E3D U+233D2 # [2000] [Unicode3.1] Private: U+F81F +4-2E3E U+674C # [2000] +4-2E3F U+674D # [2000] +4-2E40 U+6754 # [2000] +4-2E41 U+675D # [2000] +4-2E42 U+233D0 # [2000] [Unicode3.1] Private: U+F820 +4-2E43 U+233E4 # [2000] [Unicode3.1] Private: U+F821 +4-2E44 U+233D5 # [2000] [Unicode3.1] Private: U+F822 +4-2E45 U+6774 # [2000] +4-2E46 U+6776 # [2000] +4-2E47 U+233DA # [2000] [Unicode3.1] Private: U+F823 +4-2E48 U+6792 # [2000] +4-2E49 U+233DF # [2000] [Unicode3.1] Private: U+F824 +4-2E4A U+8363 # [2000] +4-2E4B U+6810 # [2000] +4-2E4C U+67B0 # [2000] +4-2E4D U+67B2 # [2000] +4-2E4E U+67C3 # [2000] +4-2E4F U+67C8 # [2000] +4-2E50 U+67D2 # [2000] +4-2E51 U+67D9 # [2000] +4-2E52 U+67DB # [2000] +4-2E53 U+67F0 # [2000] +4-2E54 U+67F7 # [2000] +4-2E55 U+2344A # [2000] [Unicode3.1] Private: U+F825 +4-2E56 U+23451 # [2000] [Unicode3.1] Private: U+F826 +4-2E57 U+2344B # [2000] [Unicode3.1] Private: U+F827 +4-2E58 U+6818 # [2000] +4-2E59 U+681F # [2000] +4-2E5A U+682D # [2000] +4-2E5B U+23465 # [2000] [Unicode3.1] Private: U+F828 +4-2E5C U+6833 # [2000] +4-2E5D U+683B # [2000] +4-2E5E U+683E # [2000] +4-2E5F U+6844 # [2000] +4-2E60 U+6845 # [2000] +4-2E61 U+6849 # [2000] +4-2E62 U+684C # [2000] +4-2E63 U+6855 # [2000] +4-2E64 U+6857 # [2000] +4-2E65 U+3B77 # [2000] +4-2E66 U+686B # [2000] +4-2E67 U+686E # [2000] +4-2E68 U+687A # [2000] +4-2E69 U+687C # [2000] +4-2E6A U+6882 # [2000] +4-2E6B U+6890 # [2000] +4-2E6C U+6896 # [2000] +4-2E6D U+3B6D # [2000] +4-2E6E U+6898 # [2000] +4-2E6F U+6899 # [2000] +4-2E70 U+689A # [2000] +4-2E71 U+689C # [2000] +4-2E72 U+68AA # [2000] +4-2E73 U+68AB # [2000] +4-2E74 U+68B4 # [2000] +4-2E75 U+68BB # [2000] +4-2E76 U+68FB # [2000] +4-2E77 U+234E4 # [2000] [Unicode3.1] Private: U+F829 +4-2E78 U+2355A # [2000] [Unicode3.1] Private: U+F82A +4-2E79 U+FA13 # CJK COMPATIBILITY IDEOGRAPH-FA13 [2000] +4-2E7A U+68C3 # [2000] +4-2E7B U+68C5 # [2000] +4-2E7C U+68CC # [2000] +4-2E7D U+68CF # [2000] +4-2E7E U+68D6 # [2000] +4-2F21 U+68D9 # [2000] +4-2F22 U+68E4 # [2000] +4-2F23 U+68E5 # [2000] +4-2F24 U+68EC # [2000] +4-2F25 U+68F7 # [2000] +4-2F26 U+6903 # [2000] +4-2F27 U+6907 # [2000] +4-2F28 U+3B87 # [2000] +4-2F29 U+3B88 # [2000] +4-2F2A U+23594 # [2000] [Unicode3.1] Private: U+F82B +4-2F2B U+693B # [2000] +4-2F2C U+3B8D # [2000] +4-2F2D U+6946 # [2000] +4-2F2E U+6969 # [2000] +4-2F2F U+696C # [2000] +4-2F30 U+6972 # [2000] +4-2F31 U+697A # [2000] +4-2F32 U+697F # [2000] +4-2F33 U+6992 # [2000] +4-2F34 U+3BA4 # [2000] +4-2F35 U+6996 # [2000] +4-2F36 U+6998 # [2000] +4-2F37 U+69A6 # [2000] +4-2F38 U+69B0 # [2000] +4-2F39 U+69B7 # [2000] +4-2F3A U+69BA # [2000] +4-2F3B U+69BC # [2000] +4-2F3C U+69C0 # [2000] +4-2F3D U+69D1 # [2000] +4-2F3E U+69D6 # [2000] +4-2F3F U+23639 # [2000] [Unicode3.1] Private: U+F82C +4-2F40 U+23647 # [2000] [Unicode3.1] Private: U+F82D +4-2F41 U+6A30 # [2000] +4-2F42 U+23638 # [2000] [Unicode3.1] Private: U+F82E +4-2F43 U+2363A # [2000] [Unicode3.1] Private: U+F82F +4-2F44 U+69E3 # [2000] +4-2F45 U+69EE # [2000] +4-2F46 U+69EF # [2000] +4-2F47 U+69F3 # [2000] +4-2F48 U+3BCD # [2000] +4-2F49 U+69F4 # [2000] +4-2F4A U+69FE # [2000] +4-2F4B U+6A11 # [2000] +4-2F4C U+6A1A # [2000] +4-2F4D U+6A1D # [2000] +4-2F4E U+2371C # [2000] [Unicode3.1] Private: U+F830 +4-2F4F U+6A32 # [2000] +4-2F50 U+6A33 # [2000] +4-2F51 U+6A34 # [2000] +4-2F52 U+6A3F # [2000] +4-2F53 U+6A46 # [2000] +4-2F54 U+6A49 # [2000] +4-2F55 U+6A7A # [2000] +4-2F56 U+6A4E # [2000] +4-2F57 U+6A52 # [2000] +4-2F58 U+6A64 # [2000] +4-2F59 U+2370C # [2000] [Unicode3.1] Private: U+F831 +4-2F5A U+6A7E # [2000] +4-2F5B U+6A83 # [2000] +4-2F5C U+6A8B # [2000] +4-2F5D U+3BF0 # [2000] +4-2F5E U+6A91 # [2000] +4-2F5F U+6A9F # [2000] +4-2F60 U+6AA1 # [2000] +4-2F61 U+23764 # [2000] [Unicode3.1] Private: U+F832 +4-2F62 U+6AAB # [2000] +4-2F63 U+6ABD # [2000] +4-2F64 U+6AC6 # [2000] +4-2F65 U+6AD4 # [2000] +4-2F66 U+6AD0 # [2000] +4-2F67 U+6ADC # [2000] +4-2F68 U+6ADD # [2000] +4-2F69 U+237FF # [2000] [Unicode3.1] Private: U+F833 +4-2F6A U+237E7 # [2000] [Unicode3.1] Private: U+F834 +4-2F6B U+6AEC # [2000] +4-2F6C U+6AF1 # [2000] +4-2F6D U+6AF2 # [2000] +4-2F6E U+6AF3 # [2000] +4-2F6F U+6AFD # [2000] +4-2F70 U+23824 # [2000] [Unicode3.1] Private: U+F835 +4-2F71 U+6B0B # [2000] +4-2F72 U+6B0F # [2000] +4-2F73 U+6B10 # [2000] +4-2F74 U+6B11 # [2000] +4-2F75 U+2383D # [2000] [Unicode3.1] Private: U+F836 +4-2F76 U+6B17 # [2000] +4-2F77 U+3C26 # [2000] +4-2F78 U+6B2F # [2000] +4-2F79 U+6B4A # [2000] +4-2F7A U+6B58 # [2000] +4-2F7B U+6B6C # [2000] +4-2F7C U+6B75 # [2000] +4-2F7D U+6B7A # [2000] +4-2F7E U+6B81 # [2000] +4-6E21 U+6B9B # [2000] +4-6E22 U+6BAE # [2000] +4-6E23 U+23A98 # [2000] [Unicode3.1] Private: U+F837 +4-6E24 U+6BBD # [2000] +4-6E25 U+6BBE # [2000] +4-6E26 U+6BC7 # [2000] +4-6E27 U+6BC8 # [2000] +4-6E28 U+6BC9 # [2000] +4-6E29 U+6BDA # [2000] +4-6E2A U+6BE6 # [2000] +4-6E2B U+6BE7 # [2000] +4-6E2C U+6BEE # [2000] +4-6E2D U+6BF1 # [2000] +4-6E2E U+6C02 # [2000] +4-6E2F U+6C0A # [2000] +4-6E30 U+6C0E # [2000] +4-6E31 U+6C35 # [2000] +4-6E32 U+6C36 # [2000] +4-6E33 U+6C3A # [2000] +4-6E34 U+23C7F # [2000] [Unicode3.1] Private: U+F838 +4-6E35 U+6C3F # [2000] +4-6E36 U+6C4D # [2000] +4-6E37 U+6C5B # [2000] +4-6E38 U+6C6D # [2000] +4-6E39 U+6C84 # [2000] +4-6E3A U+6C89 # [2000] +4-6E3B U+3CC3 # [2000] +4-6E3C U+6C94 # [2000] +4-6E3D U+6C95 # [2000] +4-6E3E U+6C97 # [2000] +4-6E3F U+6CAD # [2000] +4-6E40 U+6CC2 # [2000] +4-6E41 U+6CD0 # [2000] +4-6E42 U+3CD2 # [2000] +4-6E43 U+6CD6 # [2000] +4-6E44 U+6CDA # [2000] +4-6E45 U+6CDC # [2000] +4-6E46 U+6CE9 # [2000] +4-6E47 U+6CEC # [2000] +4-6E48 U+6CED # [2000] +4-6E49 U+23D00 # [2000] [Unicode3.1] Private: U+F839 +4-6E4A U+6D00 # [2000] +4-6E4B U+6D0A # [2000] +4-6E4C U+6D24 # [2000] +4-6E4D U+6D26 # [2000] +4-6E4E U+6D27 # [2000] +4-6E4F U+6C67 # [2000] +4-6E50 U+6D2F # [2000] +4-6E51 U+6D3C # [2000] +4-6E52 U+6D5B # [2000] +4-6E53 U+6D5E # [2000] +4-6E54 U+6D60 # [2000] +4-6E55 U+6D70 # [2000] +4-6E56 U+6D80 # [2000] +4-6E57 U+6D81 # [2000] +4-6E58 U+6D8A # [2000] +4-6E59 U+6D8D # [2000] +4-6E5A U+6D91 # [2000] +4-6E5B U+6D98 # [2000] +4-6E5C U+23D40 # [2000] [Unicode3.1] Private: U+F83A +4-6E5D U+6E17 # [2000] +4-6E5E U+23DFA # [2000] [Unicode3.1] Private: U+F83B +4-6E5F U+23DF9 # [2000] [Unicode3.1] Private: U+F83C +4-6E60 U+23DD3 # [2000] [Unicode3.1] Private: U+F83D +4-6E61 U+6DAB # [2000] +4-6E62 U+6DAE # [2000] +4-6E63 U+6DB4 # [2000] +4-6E64 U+6DC2 # [2000] +4-6E65 U+6D34 # [2000] +4-6E66 U+6DC8 # [2000] +4-6E67 U+6DCE # [2000] +4-6E68 U+6DCF # [2000] +4-6E69 U+6DD0 # [2000] +4-6E6A U+6DDF # [2000] +4-6E6B U+6DE9 # [2000] +4-6E6C U+6DF6 # [2000] +4-6E6D U+6E36 # [2000] +4-6E6E U+6E1E # [2000] +4-6E6F U+6E22 # [2000] +4-6E70 U+6E27 # [2000] +4-6E71 U+3D11 # [2000] +4-6E72 U+6E32 # [2000] +4-6E73 U+6E3C # [2000] +4-6E74 U+6E48 # [2000] +4-6E75 U+6E49 # [2000] +4-6E76 U+6E4B # [2000] +4-6E77 U+6E4C # [2000] +4-6E78 U+6E4F # [2000] +4-6E79 U+6E51 # [2000] +4-6E7A U+6E53 # [2000] +4-6E7B U+6E54 # [2000] +4-6E7C U+6E57 # [2000] +4-6E7D U+6E63 # [2000] +4-6E7E U+3D1E # [2000] +4-6F21 U+6E93 # [2000] +4-6F22 U+6EA7 # [2000] +4-6F23 U+6EB4 # [2000] +4-6F24 U+6EBF # [2000] +4-6F25 U+6EC3 # [2000] +4-6F26 U+6ECA # [2000] +4-6F27 U+6ED9 # [2000] +4-6F28 U+6F35 # [2000] +4-6F29 U+6EEB # [2000] +4-6F2A U+6EF9 # [2000] +4-6F2B U+6EFB # [2000] +4-6F2C U+6F0A # [2000] +4-6F2D U+6F0C # [2000] +4-6F2E U+6F18 # [2000] +4-6F2F U+6F25 # [2000] +4-6F30 U+6F36 # [2000] +4-6F31 U+6F3C # [2000] +4-6F32 U+23F7E # [2000] [Unicode3.1] Private: U+F83E +4-6F33 U+6F52 # [2000] +4-6F34 U+6F57 # [2000] +4-6F35 U+6F5A # [2000] +4-6F36 U+6F60 # [2000] +4-6F37 U+6F68 # [2000] +4-6F38 U+6F98 # [2000] +4-6F39 U+6F7D # [2000] +4-6F3A U+6F90 # [2000] +4-6F3B U+6F96 # [2000] +4-6F3C U+6FBE # [2000] +4-6F3D U+6F9F # [2000] +4-6F3E U+6FA5 # [2000] +4-6F3F U+6FAF # [2000] +4-6F40 U+3D64 # [2000] +4-6F41 U+6FB5 # [2000] +4-6F42 U+6FC8 # [2000] +4-6F43 U+6FC9 # [2000] +4-6F44 U+6FDA # [2000] +4-6F45 U+6FDE # [2000] +4-6F46 U+6FE9 # [2000] +4-6F47 U+24096 # [2000] [Unicode3.1] Private: U+F83F +4-6F48 U+6FFC # [2000] +4-6F49 U+7000 # [2000] +4-6F4A U+7007 # [2000] +4-6F4B U+700A # [2000] +4-6F4C U+7023 # [2000] +4-6F4D U+24103 # [2000] [Unicode3.1] Private: U+F840 +4-6F4E U+7039 # [2000] +4-6F4F U+703A # [2000] +4-6F50 U+703C # [2000] +4-6F51 U+7043 # [2000] +4-6F52 U+7047 # [2000] +4-6F53 U+704B # [2000] +4-6F54 U+3D9A # [2000] +4-6F55 U+7054 # [2000] +4-6F56 U+7065 # [2000] +4-6F57 U+7069 # [2000] +4-6F58 U+706C # [2000] +4-6F59 U+706E # [2000] +4-6F5A U+7076 # [2000] +4-6F5B U+707E # [2000] +4-6F5C U+7081 # [2000] +4-6F5D U+7086 # [2000] +4-6F5E U+7095 # [2000] +4-6F5F U+7097 # [2000] +4-6F60 U+70BB # [2000] +4-6F61 U+241C6 # [2000] [Unicode3.1] Private: U+F841 +4-6F62 U+709F # [2000] +4-6F63 U+70B1 # [2000] +4-6F64 U+241FE # [2000] [Unicode3.1] Private: U+F842 +4-6F65 U+70EC # [2000] +4-6F66 U+70CA # [2000] +4-6F67 U+70D1 # [2000] +4-6F68 U+70D3 # [2000] +4-6F69 U+70DC # [2000] +4-6F6A U+7103 # [2000] +4-6F6B U+7104 # [2000] +4-6F6C U+7106 # [2000] +4-6F6D U+7107 # [2000] +4-6F6E U+7108 # [2000] +4-6F6F U+710C # [2000] +4-6F70 U+3DC0 # [2000] +4-6F71 U+712F # [2000] +4-6F72 U+7131 # [2000] +4-6F73 U+7150 # [2000] +4-6F74 U+714A # [2000] +4-6F75 U+7153 # [2000] +4-6F76 U+715E # [2000] +4-6F77 U+3DD4 # [2000] +4-6F78 U+7196 # [2000] +4-6F79 U+7180 # [2000] +4-6F7A U+719B # [2000] +4-6F7B U+71A0 # [2000] +4-6F7C U+71A2 # [2000] +4-6F7D U+71AE # [2000] +4-6F7E U+71AF # [2000] +4-7021 U+71B3 # [2000] +4-7022 U+243BC # [2000] [Unicode3.1] Private: U+F843 +4-7023 U+71CB # [2000] +4-7024 U+71D3 # [2000] +4-7025 U+71D9 # [2000] +4-7026 U+71DC # [2000] +4-7027 U+7207 # [2000] +4-7028 U+3E05 # [2000] +4-7029 U+FA49 # CJK COMPATIBILITY IDEOGRAPH-FA49 [2000] [Unicode3.2] +4-702A U+722B # [2000] +4-702B U+7234 # [2000] +4-702C U+7238 # [2000] +4-702D U+7239 # [2000] +4-702E U+4E2C # [2000] +4-702F U+7242 # [2000] +4-7030 U+7253 # [2000] +4-7031 U+7257 # [2000] +4-7032 U+7263 # [2000] +4-7033 U+24629 # [2000] [Unicode3.1] Private: U+F845 +4-7034 U+726E # [2000] +4-7035 U+726F # [2000] +4-7036 U+7278 # [2000] +4-7037 U+727F # [2000] +4-7038 U+728E # [2000] +4-7039 U+246A5 # [2000] [Unicode3.1] Private: U+F846 +4-703A U+72AD # [2000] +4-703B U+72AE # [2000] +4-703C U+72B0 # [2000] +4-703D U+72B1 # [2000] +4-703E U+72C1 # [2000] +4-703F U+3E60 # [2000] +4-7040 U+72CC # [2000] +4-7041 U+3E66 # [2000] +4-7042 U+3E68 # [2000] +4-7043 U+72F3 # [2000] +4-7044 U+72FA # [2000] +4-7045 U+7307 # [2000] +4-7046 U+7312 # [2000] +4-7047 U+7318 # [2000] +4-7048 U+7319 # [2000] +4-7049 U+3E83 # [2000] +4-704A U+7339 # [2000] +4-704B U+732C # [2000] +4-704C U+7331 # [2000] +4-704D U+7333 # [2000] +4-704E U+733D # [2000] +4-704F U+7352 # [2000] +4-7050 U+3E94 # [2000] +4-7051 U+736B # [2000] +4-7052 U+736C # [2000] +4-7053 U+24896 # [2000] [Unicode3.1] Private: U+F847 +4-7054 U+736E # [2000] +4-7055 U+736F # [2000] +4-7056 U+7371 # [2000] +4-7057 U+7377 # [2000] +4-7058 U+7381 # [2000] +4-7059 U+7385 # [2000] +4-705A U+738A # [2000] +4-705B U+7394 # [2000] +4-705C U+7398 # [2000] +4-705D U+739C # [2000] +4-705E U+739E # [2000] +4-705F U+73A5 # [2000] +4-7060 U+73A8 # [2000] +4-7061 U+73B5 # [2000] +4-7062 U+73B7 # [2000] +4-7063 U+73B9 # [2000] +4-7064 U+73BC # [2000] +4-7065 U+73BF # [2000] +4-7066 U+73C5 # [2000] +4-7067 U+73CB # [2000] +4-7068 U+73E1 # [2000] +4-7069 U+73E7 # [2000] +4-706A U+73F9 # [2000] +4-706B U+7413 # [2000] +4-706C U+73FA # [2000] +4-706D U+7401 # [2000] +4-706E U+7424 # [2000] +4-706F U+7431 # [2000] +4-7070 U+7439 # [2000] +4-7071 U+7453 # [2000] +4-7072 U+7440 # [2000] +4-7073 U+7443 # [2000] +4-7074 U+744D # [2000] +4-7075 U+7452 # [2000] +4-7076 U+745D # [2000] +4-7077 U+7471 # [2000] +4-7078 U+7481 # [2000] +4-7079 U+7485 # [2000] +4-707A U+7488 # [2000] +4-707B U+24A4D # [2000] [Unicode3.1] Private: U+F848 +4-707C U+7492 # [2000] +4-707D U+7497 # [2000] +4-707E U+7499 # [2000] +4-7121 U+74A0 # [2000] +4-7122 U+74A1 # [2000] +4-7123 U+74A5 # [2000] +4-7124 U+74AA # [2000] +4-7125 U+74AB # [2000] +4-7126 U+74B9 # [2000] +4-7127 U+74BB # [2000] +4-7128 U+74BA # [2000] +4-7129 U+74D6 # [2000] +4-712A U+74D8 # [2000] +4-712B U+74DE # [2000] +4-712C U+74EF # [2000] +4-712D U+74EB # [2000] +4-712E U+24B56 # [2000] [Unicode3.1] Private: U+F849 +4-712F U+74FA # [2000] +4-7130 U+24B6F # [2000] [Unicode3.1] Private: U+F84A +4-7131 U+7520 # [2000] +4-7132 U+7524 # [2000] +4-7133 U+752A # [2000] +4-7134 U+3F57 # [2000] +4-7135 U+24C16 # [2000] [Unicode3.1] Private: U+F84B +4-7136 U+753D # [2000] +4-7137 U+753E # [2000] +4-7138 U+7540 # [2000] +4-7139 U+7548 # [2000] +4-713A U+754E # [2000] +4-713B U+7550 # [2000] +4-713C U+7552 # [2000] +4-713D U+756C # [2000] +4-713E U+7572 # [2000] +4-713F U+7571 # [2000] +4-7140 U+757A # [2000] +4-7141 U+757D # [2000] +4-7142 U+757E # [2000] +4-7143 U+7581 # [2000] +4-7144 U+24D14 # [2000] [Unicode3.1] Private: U+F84C +4-7145 U+758C # [2000] +4-7146 U+3F75 # [2000] +4-7147 U+75A2 # [2000] +4-7148 U+3F77 # [2000] +4-7149 U+75B0 # [2000] +4-714A U+75B7 # [2000] +4-714B U+75BF # [2000] +4-714C U+75C0 # [2000] +4-714D U+75C6 # [2000] +4-714E U+75CF # [2000] +4-714F U+75D3 # [2000] +4-7150 U+75DD # [2000] +4-7151 U+75DF # [2000] +4-7152 U+75E0 # [2000] +4-7153 U+75E7 # [2000] +4-7154 U+75EC # [2000] +4-7155 U+75EE # [2000] +4-7156 U+75F1 # [2000] +4-7157 U+75F9 # [2000] +4-7158 U+7603 # [2000] +4-7159 U+7618 # [2000] +4-715A U+7607 # [2000] +4-715B U+760F # [2000] +4-715C U+3FAE # [2000] +4-715D U+24E0E # [2000] [Unicode3.1] Private: U+F84D +4-715E U+7613 # [2000] +4-715F U+761B # [2000] +4-7160 U+761C # [2000] +4-7161 U+24E37 # [2000] [Unicode3.1] Private: U+F84E +4-7162 U+7625 # [2000] +4-7163 U+7628 # [2000] +4-7164 U+763C # [2000] +4-7165 U+7633 # [2000] +4-7166 U+24E6A # [2000] [Unicode3.1] Private: U+F84F +4-7167 U+3FC9 # [2000] +4-7168 U+7641 # [2000] +4-7169 U+24E8B # [2000] [Unicode3.1] Private: U+F850 +4-716A U+7649 # [2000] +4-716B U+7655 # [2000] +4-716C U+3FD7 # [2000] +4-716D U+766E # [2000] +4-716E U+7695 # [2000] +4-716F U+769C # [2000] +4-7170 U+76A1 # [2000] +4-7171 U+76A0 # [2000] +4-7172 U+76A7 # [2000] +4-7173 U+76A8 # [2000] +4-7174 U+76AF # [2000] +4-7175 U+2504A # [2000] [Unicode3.1] Private: U+F851 +4-7176 U+76C9 # [2000] +4-7177 U+25055 # [2000] [Unicode3.1] Private: U+F852 +4-7178 U+76E8 # [2000] +4-7179 U+76EC # [2000] +4-717A U+25122 # [2000] [Unicode3.1] Private: U+F853 +4-717B U+7717 # [2000] +4-717C U+771A # [2000] +4-717D U+772D # [2000] +4-717E U+7735 # [2000] +4-7221 U+251A9 # [2000] [Unicode3.1] Private: U+F854 +4-7222 U+4039 # [2000] +4-7223 U+251E5 # [2000] [Unicode3.1] Private: U+F855 +4-7224 U+251CD # [2000] [Unicode3.1] Private: U+F856 +4-7225 U+7758 # [2000] +4-7226 U+7760 # [2000] +4-7227 U+776A # [2000] +4-7228 U+2521E # [2000] [Unicode3.1] Private: U+F857 +4-7229 U+7772 # [2000] +4-722A U+777C # [2000] +4-722B U+777D # [2000] +4-722C U+2524C # [2000] [Unicode3.1] Private: U+F858 +4-722D U+4058 # [2000] +4-722E U+779A # [2000] +4-722F U+779F # [2000] +4-7230 U+77A2 # [2000] +4-7231 U+77A4 # [2000] +4-7232 U+77A9 # [2000] +4-7233 U+77DE # [2000] +4-7234 U+77DF # [2000] +4-7235 U+77E4 # [2000] +4-7236 U+77E6 # [2000] +4-7237 U+77EA # [2000] +4-7238 U+77EC # [2000] +4-7239 U+4093 # [2000] +4-723A U+77F0 # [2000] +4-723B U+77F4 # [2000] +4-723C U+77FB # [2000] +4-723D U+2542E # [2000] [Unicode3.1] Private: U+F859 +4-723E U+7805 # [2000] +4-723F U+7806 # [2000] +4-7240 U+7809 # [2000] +4-7241 U+780D # [2000] +4-7242 U+7819 # [2000] +4-7243 U+7821 # [2000] +4-7244 U+782C # [2000] +4-7245 U+7847 # [2000] +4-7246 U+7864 # [2000] +4-7247 U+786A # [2000] +4-7248 U+254D9 # [2000] [Unicode3.1] Private: U+F85A +4-7249 U+788A # [2000] +4-724A U+7894 # [2000] +4-724B U+78A4 # [2000] +4-724C U+789D # [2000] +4-724D U+789E # [2000] +4-724E U+789F # [2000] +4-724F U+78BB # [2000] +4-7250 U+78C8 # [2000] +4-7251 U+78CC # [2000] +4-7252 U+78CE # [2000] +4-7253 U+78D5 # [2000] +4-7254 U+78E0 # [2000] +4-7255 U+78E1 # [2000] +4-7256 U+78E6 # [2000] +4-7257 U+78F9 # [2000] +4-7258 U+78FA # [2000] +4-7259 U+78FB # [2000] +4-725A U+78FE # [2000] +4-725B U+255A7 # [2000] [Unicode3.1] Private: U+F85B +4-725C U+7910 # [2000] +4-725D U+791B # [2000] +4-725E U+7930 # [2000] +4-725F U+7925 # [2000] +4-7260 U+793B # [2000] +4-7261 U+794A # [2000] +4-7262 U+7958 # [2000] +4-7263 U+795B # [2000] +4-7264 U+4105 # [2000] +4-7265 U+7967 # [2000] +4-7266 U+7972 # [2000] +4-7267 U+7994 # [2000] +4-7268 U+7995 # [2000] +4-7269 U+7996 # [2000] +4-726A U+799B # [2000] +4-726B U+79A1 # [2000] +4-726C U+79A9 # [2000] +4-726D U+79B4 # [2000] +4-726E U+79BB # [2000] +4-726F U+79C2 # [2000] +4-7270 U+79C7 # [2000] +4-7271 U+79CC # [2000] +4-7272 U+79CD # [2000] +4-7273 U+79D6 # [2000] +4-7274 U+4148 # [2000] +4-7275 U+257A9 # [2000] [Unicode3.1] Private: U+F85C +4-7276 U+257B4 # [2000] [Unicode3.1] Private: U+F85D +4-7277 U+414F # [2000] +4-7278 U+7A0A # [2000] +4-7279 U+7A11 # [2000] +4-727A U+7A15 # [2000] +4-727B U+7A1B # [2000] +4-727C U+7A1E # [2000] +4-727D U+4163 # [2000] +4-727E U+7A2D # [2000] +4-7321 U+7A38 # [2000] +4-7322 U+7A47 # [2000] +4-7323 U+7A4C # [2000] +4-7324 U+7A56 # [2000] +4-7325 U+7A59 # [2000] +4-7326 U+7A5C # [2000] +4-7327 U+7A5F # [2000] +4-7328 U+7A60 # [2000] +4-7329 U+7A67 # [2000] +4-732A U+7A6A # [2000] +4-732B U+7A75 # [2000] +4-732C U+7A78 # [2000] +4-732D U+7A82 # [2000] +4-732E U+7A8A # [2000] +4-732F U+7A90 # [2000] +4-7330 U+7AA3 # [2000] +4-7331 U+7AAC # [2000] +4-7332 U+259D4 # [2000] [Unicode3.1] Private: U+F85E +4-7333 U+41B4 # [2000] +4-7334 U+7AB9 # [2000] +4-7335 U+7ABC # [2000] +4-7336 U+7ABE # [2000] +4-7337 U+41BF # [2000] +4-7338 U+7ACC # [2000] +4-7339 U+7AD1 # [2000] +4-733A U+7AE7 # [2000] +4-733B U+7AE8 # [2000] +4-733C U+7AF4 # [2000] +4-733D U+25AE4 # [2000] [Unicode3.1] Private: U+F85F +4-733E U+25AE3 # [2000] [Unicode3.1] Private: U+F860 +4-733F U+7B07 # [2000] +4-7340 U+25AF1 # [2000] [Unicode3.1] Private: U+F861 +4-7341 U+7B3D # [2000] +4-7342 U+7B27 # [2000] +4-7343 U+7B2A # [2000] +4-7344 U+7B2E # [2000] +4-7345 U+7B2F # [2000] +4-7346 U+7B31 # [2000] +4-7347 U+41E6 # [2000] +4-7348 U+41F3 # [2000] +4-7349 U+7B7F # [2000] +4-734A U+7B41 # [2000] +4-734B U+41EE # [2000] +4-734C U+7B55 # [2000] +4-734D U+7B79 # [2000] +4-734E U+7B64 # [2000] +4-734F U+7B66 # [2000] +4-7350 U+7B69 # [2000] +4-7351 U+7B73 # [2000] +4-7352 U+25BB2 # [2000] [Unicode3.1] Private: U+F862 +4-7353 U+4207 # [2000] +4-7354 U+7B90 # [2000] +4-7355 U+7B91 # [2000] +4-7356 U+7B9B # [2000] +4-7357 U+420E # [2000] +4-7358 U+7BAF # [2000] +4-7359 U+7BB5 # [2000] +4-735A U+7BBC # [2000] +4-735B U+7BC5 # [2000] +4-735C U+7BCA # [2000] +4-735D U+25C4B # [2000] [Unicode3.1] Private: U+F863 +4-735E U+25C64 # [2000] [Unicode3.1] Private: U+F864 +4-735F U+7BD4 # [2000] +4-7360 U+7BD6 # [2000] +4-7361 U+7BDA # [2000] +4-7362 U+7BEA # [2000] +4-7363 U+7BF0 # [2000] +4-7364 U+7C03 # [2000] +4-7365 U+7C0B # [2000] +4-7366 U+7C0E # [2000] +4-7367 U+7C0F # [2000] +4-7368 U+7C26 # [2000] +4-7369 U+7C45 # [2000] +4-736A U+7C4A # [2000] +4-736B U+7C51 # [2000] +4-736C U+7C57 # [2000] +4-736D U+7C5E # [2000] +4-736E U+7C61 # [2000] +4-736F U+7C69 # [2000] +4-7370 U+7C6E # [2000] +4-7371 U+7C6F # [2000] +4-7372 U+7C70 # [2000] +4-7373 U+25E2E # [2000] [Unicode3.1] Private: U+F865 +4-7374 U+25E56 # [2000] [Unicode3.1] Private: U+F866 +4-7375 U+25E65 # [2000] [Unicode3.1] Private: U+F867 +4-7376 U+7CA6 # [2000] +4-7377 U+25E62 # [2000] [Unicode3.1] Private: U+F868 +4-7378 U+7CB6 # [2000] +4-7379 U+7CB7 # [2000] +4-737A U+7CBF # [2000] +4-737B U+25ED8 # [2000] [Unicode3.1] Private: U+F869 +4-737C U+7CC4 # [2000] +4-737D U+25EC2 # [2000] [Unicode3.1] Private: U+F86A +4-737E U+7CC8 # [2000] +4-7421 U+7CCD # [2000] +4-7422 U+25EE8 # [2000] [Unicode3.1] Private: U+F86B +4-7423 U+7CD7 # [2000] +4-7424 U+25F23 # [2000] [Unicode3.1] Private: U+F86C +4-7425 U+7CE6 # [2000] +4-7426 U+7CEB # [2000] +4-7427 U+25F5C # [2000] [Unicode3.1] Private: U+F86D +4-7428 U+7CF5 # [2000] +4-7429 U+7D03 # [2000] +4-742A U+7D09 # [2000] +4-742B U+42C6 # [2000] +4-742C U+7D12 # [2000] +4-742D U+7D1E # [2000] +4-742E U+25FE0 # [2000] [Unicode3.1] Private: U+F86E +4-742F U+25FD4 # [2000] [Unicode3.1] Private: U+F86F +4-7430 U+7D3D # [2000] +4-7431 U+7D3E # [2000] +4-7432 U+7D40 # [2000] +4-7433 U+7D47 # [2000] +4-7434 U+2600C # [2000] [Unicode3.1] Private: U+F870 +4-7435 U+25FFB # [2000] [Unicode3.1] Private: U+F871 +4-7436 U+42D6 # [2000] +4-7437 U+7D59 # [2000] +4-7438 U+7D5A # [2000] +4-7439 U+7D6A # [2000] +4-743A U+7D70 # [2000] +4-743B U+42DD # [2000] +4-743C U+7D7F # [2000] +4-743D U+26017 # [2000] [Unicode3.1] Private: U+F872 +4-743E U+7D86 # [2000] +4-743F U+7D88 # [2000] +4-7440 U+7D8C # [2000] +4-7441 U+7D97 # [2000] +4-7442 U+26060 # [2000] [Unicode3.1] Private: U+F873 +4-7443 U+7D9D # [2000] +4-7444 U+7DA7 # [2000] +4-7445 U+7DAA # [2000] +4-7446 U+7DB6 # [2000] +4-7447 U+7DB7 # [2000] +4-7448 U+7DC0 # [2000] +4-7449 U+7DD7 # [2000] +4-744A U+7DD9 # [2000] +4-744B U+7DE6 # [2000] +4-744C U+7DF1 # [2000] +4-744D U+7DF9 # [2000] +4-744E U+4302 # [2000] +4-744F U+260ED # [2000] [Unicode3.1] Private: U+F874 +4-7450 U+FA58 # CJK COMPATIBILITY IDEOGRAPH-FA58 [2000] [Unicode3.2] +4-7451 U+7E10 # [2000] +4-7452 U+7E17 # [2000] +4-7453 U+7E1D # [2000] +4-7454 U+7E20 # [2000] +4-7455 U+7E27 # [2000] +4-7456 U+7E2C # [2000] +4-7457 U+7E45 # [2000] +4-7458 U+7E73 # [2000] +4-7459 U+7E75 # [2000] +4-745A U+7E7E # [2000] +4-745B U+7E86 # [2000] +4-745C U+7E87 # [2000] +4-745D U+432B # [2000] +4-745E U+7E91 # [2000] +4-745F U+7E98 # [2000] +4-7460 U+7E9A # [2000] +4-7461 U+4343 # [2000] +4-7462 U+7F3C # [2000] +4-7463 U+7F3B # [2000] +4-7464 U+7F3E # [2000] +4-7465 U+7F43 # [2000] +4-7466 U+7F44 # [2000] +4-7467 U+7F4F # [2000] +4-7468 U+34C1 # [2000] +4-7469 U+26270 # [2000] [Unicode3.1] Private: U+F876 +4-746A U+7F52 # [2000] +4-746B U+26286 # [2000] [Unicode3.1] Private: U+F877 +4-746C U+7F61 # [2000] +4-746D U+7F63 # [2000] +4-746E U+7F64 # [2000] +4-746F U+7F6D # [2000] +4-7470 U+7F7D # [2000] +4-7471 U+7F7E # [2000] +4-7472 U+2634C # [2000] [Unicode3.1] Private: U+F878 +4-7473 U+7F90 # [2000] +4-7474 U+517B # [2000] +4-7475 U+23D0E # [2000] [Unicode3.1] Private: U+F879 +4-7476 U+7F96 # [2000] +4-7477 U+7F9C # [2000] +4-7478 U+7FAD # [2000] +4-7479 U+26402 # [2000] [Unicode3.1] Private: U+F87A +4-747A U+7FC3 # [2000] +4-747B U+7FCF # [2000] +4-747C U+7FE3 # [2000] +4-747D U+7FE5 # [2000] +4-747E U+7FEF # [2000] +4-7521 U+7FF2 # [2000] +4-7522 U+8002 # [2000] +4-7523 U+800A # [2000] +4-7524 U+8008 # [2000] +4-7525 U+800E # [2000] +4-7526 U+8011 # [2000] +4-7527 U+8016 # [2000] +4-7528 U+8024 # [2000] +4-7529 U+802C # [2000] +4-752A U+8030 # [2000] +4-752B U+8043 # [2000] +4-752C U+8066 # [2000] +4-752D U+8071 # [2000] +4-752E U+8075 # [2000] +4-752F U+807B # [2000] +4-7530 U+8099 # [2000] +4-7531 U+809C # [2000] +4-7532 U+80A4 # [2000] +4-7533 U+80A7 # [2000] +4-7534 U+80B8 # [2000] +4-7535 U+2667E # [2000] [Unicode3.1] Private: U+F87B +4-7536 U+80C5 # [2000] +4-7537 U+80D5 # [2000] +4-7538 U+80D8 # [2000] +4-7539 U+80E6 # [2000] +4-753A U+266B0 # [2000] [Unicode3.1] Private: U+F87C +4-753B U+810D # [2000] +4-753C U+80F5 # [2000] +4-753D U+80FB # [2000] +4-753E U+43EE # [2000] +4-753F U+8135 # [2000] +4-7540 U+8116 # [2000] +4-7541 U+811E # [2000] +4-7542 U+43F0 # [2000] +4-7543 U+8124 # [2000] +4-7544 U+8127 # [2000] +4-7545 U+812C # [2000] +4-7546 U+2671D # [2000] [Unicode3.1] Private: U+F87D +4-7547 U+813D # [2000] +4-7548 U+4408 # [2000] +4-7549 U+8169 # [2000] +4-754A U+4417 # [2000] +4-754B U+8181 # [2000] +4-754C U+441C # [2000] +4-754D U+8184 # [2000] +4-754E U+8185 # [2000] +4-754F U+4422 # [2000] +4-7550 U+8198 # [2000] +4-7551 U+81B2 # [2000] +4-7552 U+81C1 # [2000] +4-7553 U+81C3 # [2000] +4-7554 U+81D6 # [2000] +4-7555 U+81DB # [2000] +4-7556 U+268DD # [2000] [Unicode3.1] Private: U+F87E +4-7557 U+81E4 # [2000] +4-7558 U+268EA # [2000] [Unicode3.1] Private: U+F87F +4-7559 U+81EC # [2000] +4-755A U+26951 # [2000] [Unicode3.1] Private: U+F880 +4-755B U+81FD # [2000] +4-755C U+81FF # [2000] +4-755D U+2696F # [2000] [Unicode3.1] Private: U+F881 +4-755E U+8204 # [2000] +4-755F U+269DD # [2000] [Unicode3.1] Private: U+F882 +4-7560 U+8219 # [2000] +4-7561 U+8221 # [2000] +4-7562 U+8222 # [2000] +4-7563 U+26A1E # [2000] [Unicode3.1] Private: U+F883 +4-7564 U+8232 # [2000] +4-7565 U+8234 # [2000] +4-7566 U+823C # [2000] +4-7567 U+8246 # [2000] +4-7568 U+8249 # [2000] +4-7569 U+8245 # [2000] +4-756A U+26A58 # [2000] [Unicode3.1] Private: U+F884 +4-756B U+824B # [2000] +4-756C U+4476 # [2000] +4-756D U+824F # [2000] +4-756E U+447A # [2000] +4-756F U+8257 # [2000] +4-7570 U+26A8C # [2000] [Unicode3.1] Private: U+F885 +4-7571 U+825C # [2000] +4-7572 U+8263 # [2000] +4-7573 U+26AB7 # [2000] [Unicode3.1] Private: U+F886 +4-7574 U+FA5D # CJK COMPATIBILITY IDEOGRAPH-FA5D [2000] [Unicode3.2] +4-7575 U+FA5E # CJK COMPATIBILITY IDEOGRAPH-FA5E [2000] [Unicode3.2] +4-7576 U+8279 # [2000] +4-7577 U+4491 # [2000] +4-7578 U+827D # [2000] +4-7579 U+827F # [2000] +4-757A U+8283 # [2000] +4-757B U+828A # [2000] +4-757C U+8293 # [2000] +4-757D U+82A7 # [2000] +4-757E U+82A8 # [2000] +4-7621 U+82B2 # [2000] +4-7622 U+82B4 # [2000] +4-7623 U+82BA # [2000] +4-7624 U+82BC # [2000] +4-7625 U+82E2 # [2000] +4-7626 U+82E8 # [2000] +4-7627 U+82F7 # [2000] +4-7628 U+8307 # [2000] +4-7629 U+8308 # [2000] +4-762A U+830C # [2000] +4-762B U+8354 # [2000] +4-762C U+831B # [2000] +4-762D U+831D # [2000] +4-762E U+8330 # [2000] +4-762F U+833C # [2000] +4-7630 U+8344 # [2000] +4-7631 U+8357 # [2000] +4-7632 U+44BE # [2000] +4-7633 U+837F # [2000] +4-7634 U+44D4 # [2000] +4-7635 U+44B3 # [2000] +4-7636 U+838D # [2000] +4-7637 U+8394 # [2000] +4-7638 U+8395 # [2000] +4-7639 U+839B # [2000] +4-763A U+839D # [2000] +4-763B U+83C9 # [2000] +4-763C U+83D0 # [2000] +4-763D U+83D4 # [2000] +4-763E U+83DD # [2000] +4-763F U+83E5 # [2000] +4-7640 U+83F9 # [2000] +4-7641 U+840F # [2000] +4-7642 U+8411 # [2000] +4-7643 U+8415 # [2000] +4-7644 U+26C73 # [2000] [Unicode3.1] Private: U+F889 +4-7645 U+8417 # [2000] +4-7646 U+8439 # [2000] +4-7647 U+844A # [2000] +4-7648 U+844F # [2000] +4-7649 U+8451 # [2000] +4-764A U+8452 # [2000] +4-764B U+8459 # [2000] +4-764C U+845A # [2000] +4-764D U+845C # [2000] +4-764E U+26CDD # [2000] [Unicode3.1] Private: U+F88A +4-764F U+8465 # [2000] +4-7650 U+8476 # [2000] +4-7651 U+8478 # [2000] +4-7652 U+847C # [2000] +4-7653 U+8481 # [2000] +4-7654 U+450D # [2000] +4-7655 U+84DC # [2000] +4-7656 U+8497 # [2000] +4-7657 U+84A6 # [2000] +4-7658 U+84BE # [2000] +4-7659 U+4508 # [2000] +4-765A U+84CE # [2000] +4-765B U+84CF # [2000] +4-765C U+84D3 # [2000] +4-765D U+26E65 # [2000] [Unicode3.1] Private: U+F88B +4-765E U+84E7 # [2000] +4-765F U+84EA # [2000] +4-7660 U+84EF # [2000] +4-7661 U+84F0 # [2000] +4-7662 U+84F1 # [2000] +4-7663 U+84FA # [2000] +4-7664 U+84FD # [2000] +4-7665 U+850C # [2000] +4-7666 U+851B # [2000] +4-7667 U+8524 # [2000] +4-7668 U+8525 # [2000] +4-7669 U+852B # [2000] +4-766A U+8534 # [2000] +4-766B U+854F # [2000] +4-766C U+856F # [2000] +4-766D U+4525 # [2000] +4-766E U+4543 # [2000] +4-766F U+853E # [2000] +4-7670 U+8551 # [2000] +4-7671 U+8553 # [2000] +4-7672 U+855E # [2000] +4-7673 U+8561 # [2000] +4-7674 U+8562 # [2000] +4-7675 U+26F94 # [2000] [Unicode3.1] Private: U+F88C +4-7676 U+857B # [2000] +4-7677 U+857D # [2000] +4-7678 U+857F # [2000] +4-7679 U+8581 # [2000] +4-767A U+8586 # [2000] +4-767B U+8593 # [2000] +4-767C U+859D # [2000] +4-767D U+859F # [2000] +4-767E U+26FF8 # [2000] [Unicode3.1] Private: U+F88D +4-7721 U+26FF6 # [2000] [Unicode3.1] Private: U+F88E +4-7722 U+26FF7 # [2000] [Unicode3.1] Private: U+F88F +4-7723 U+85B7 # [2000] +4-7724 U+85BC # [2000] +4-7725 U+85C7 # [2000] +4-7726 U+85CA # [2000] +4-7727 U+85D8 # [2000] +4-7728 U+85D9 # [2000] +4-7729 U+85DF # [2000] +4-772A U+85E1 # [2000] +4-772B U+85E6 # [2000] +4-772C U+85F6 # [2000] +4-772D U+8600 # [2000] +4-772E U+8611 # [2000] +4-772F U+861E # [2000] +4-7730 U+8621 # [2000] +4-7731 U+8624 # [2000] +4-7732 U+8627 # [2000] +4-7733 U+2710D # [2000] [Unicode3.1] Private: U+F890 +4-7734 U+8639 # [2000] +4-7735 U+863C # [2000] +4-7736 U+27139 # [2000] [Unicode3.1] Private: U+F891 +4-7737 U+8640 # [2000] +4-7738 U+FA20 # CJK COMPATIBILITY IDEOGRAPH-FA20 [2000] +4-7739 U+8653 # [2000] +4-773A U+8656 # [2000] +4-773B U+866F # [2000] +4-773C U+8677 # [2000] +4-773D U+867A # [2000] +4-773E U+8687 # [2000] +4-773F U+8689 # [2000] +4-7740 U+868D # [2000] +4-7741 U+8691 # [2000] +4-7742 U+869C # [2000] +4-7743 U+869D # [2000] +4-7744 U+86A8 # [2000] +4-7745 U+FA21 # CJK COMPATIBILITY IDEOGRAPH-FA21 [2000] +4-7746 U+86B1 # [2000] +4-7747 U+86B3 # [2000] +4-7748 U+86C1 # [2000] +4-7749 U+86C3 # [2000] +4-774A U+86D1 # [2000] +4-774B U+86D5 # [2000] +4-774C U+86D7 # [2000] +4-774D U+86E3 # [2000] +4-774E U+86E6 # [2000] +4-774F U+45B8 # [2000] +4-7750 U+8705 # [2000] +4-7751 U+8707 # [2000] +4-7752 U+870E # [2000] +4-7753 U+8710 # [2000] +4-7754 U+8713 # [2000] +4-7755 U+8719 # [2000] +4-7756 U+871F # [2000] +4-7757 U+8721 # [2000] +4-7758 U+8723 # [2000] +4-7759 U+8731 # [2000] +4-775A U+873A # [2000] +4-775B U+873E # [2000] +4-775C U+8740 # [2000] +4-775D U+8743 # [2000] +4-775E U+8751 # [2000] +4-775F U+8758 # [2000] +4-7760 U+8764 # [2000] +4-7761 U+8765 # [2000] +4-7762 U+8772 # [2000] +4-7763 U+877C # [2000] +4-7764 U+273DB # [2000] [Unicode3.1] Private: U+F892 +4-7765 U+273DA # [2000] [Unicode3.1] Private: U+F893 +4-7766 U+87A7 # [2000] +4-7767 U+8789 # [2000] +4-7768 U+878B # [2000] +4-7769 U+8793 # [2000] +4-776A U+87A0 # [2000] +4-776B U+273FE # [2000] [Unicode3.1] Private: U+F894 +4-776C U+45E5 # [2000] +4-776D U+87BE # [2000] +4-776E U+27410 # [2000] [Unicode3.1] Private: U+F895 +4-776F U+87C1 # [2000] +4-7770 U+87CE # [2000] +4-7771 U+87F5 # [2000] +4-7772 U+87DF # [2000] +4-7773 U+27449 # [2000] [Unicode3.1] Private: U+F896 +4-7774 U+87E3 # [2000] +4-7775 U+87E5 # [2000] +4-7776 U+87E6 # [2000] +4-7777 U+87EA # [2000] +4-7778 U+87EB # [2000] +4-7779 U+87ED # [2000] +4-777A U+8801 # [2000] +4-777B U+8803 # [2000] +4-777C U+880B # [2000] +4-777D U+8813 # [2000] +4-777E U+8828 # [2000] +4-7821 U+882E # [2000] +4-7822 U+8832 # [2000] +4-7823 U+883C # [2000] +4-7824 U+460F # [2000] +4-7825 U+884A # [2000] +4-7826 U+8858 # [2000] +4-7827 U+885F # [2000] +4-7828 U+8864 # [2000] +4-7829 U+27615 # [2000] [Unicode3.1] Private: U+F897 +4-782A U+27614 # [2000] [Unicode3.1] Private: U+F898 +4-782B U+8869 # [2000] +4-782C U+27631 # [2000] [Unicode3.1] Private: U+F899 +4-782D U+886F # [2000] +4-782E U+88A0 # [2000] +4-782F U+88BC # [2000] +4-7830 U+88BD # [2000] +4-7831 U+88BE # [2000] +4-7832 U+88C0 # [2000] +4-7833 U+88D2 # [2000] +4-7834 U+27693 # [2000] [Unicode3.1] Private: U+F89A +4-7835 U+88D1 # [2000] +4-7836 U+88D3 # [2000] +4-7837 U+88DB # [2000] +4-7838 U+88F0 # [2000] +4-7839 U+88F1 # [2000] +4-783A U+4641 # [2000] +4-783B U+8901 # [2000] +4-783C U+2770E # [2000] [Unicode3.1] Private: U+F89B +4-783D U+8937 # [2000] +4-783E U+27723 # [2000] [Unicode3.1] Private: U+F89C +4-783F U+8942 # [2000] +4-7840 U+8945 # [2000] +4-7841 U+8949 # [2000] +4-7842 U+27752 # [2000] [Unicode3.1] Private: U+F89D +4-7843 U+4665 # [2000] +4-7844 U+8962 # [2000] +4-7845 U+8980 # [2000] +4-7846 U+8989 # [2000] +4-7847 U+8990 # [2000] +4-7848 U+899F # [2000] +4-7849 U+89B0 # [2000] +4-784A U+89B7 # [2000] +4-784B U+89D6 # [2000] +4-784C U+89D8 # [2000] +4-784D U+89EB # [2000] +4-784E U+46A1 # [2000] +4-784F U+89F1 # [2000] +4-7850 U+89F3 # [2000] +4-7851 U+89FD # [2000] +4-7852 U+89FF # [2000] +4-7853 U+46AF # [2000] +4-7854 U+8A11 # [2000] +4-7855 U+8A14 # [2000] +4-7856 U+27985 # [2000] [Unicode3.1] Private: U+F89E +4-7857 U+8A21 # [2000] +4-7858 U+8A35 # [2000] +4-7859 U+8A3E # [2000] +4-785A U+8A45 # [2000] +4-785B U+8A4D # [2000] +4-785C U+8A58 # [2000] +4-785D U+8AAE # [2000] +4-785E U+8A90 # [2000] +4-785F U+8AB7 # [2000] +4-7860 U+8ABE # [2000] +4-7861 U+8AD7 # [2000] +4-7862 U+8AFC # [2000] +4-7863 U+27A84 # [2000] [Unicode3.1] Private: U+F89F +4-7864 U+8B0A # [2000] +4-7865 U+8B05 # [2000] +4-7866 U+8B0D # [2000] +4-7867 U+8B1C # [2000] +4-7868 U+8B1F # [2000] +4-7869 U+8B2D # [2000] +4-786A U+8B43 # [2000] +4-786B U+470C # [2000] +4-786C U+8B51 # [2000] +4-786D U+8B5E # [2000] +4-786E U+8B76 # [2000] +4-786F U+8B7F # [2000] +4-7870 U+8B81 # [2000] +4-7871 U+8B8B # [2000] +4-7872 U+8B94 # [2000] +4-7873 U+8B95 # [2000] +4-7874 U+8B9C # [2000] +4-7875 U+8B9E # [2000] +4-7876 U+8C39 # [2000] +4-7877 U+27BB3 # [2000] [Unicode3.1] Private: U+F8A0 +4-7878 U+8C3D # [2000] +4-7879 U+27BBE # [2000] [Unicode3.1] Private: U+F8A1 +4-787A U+27BC7 # [2000] [Unicode3.1] Private: U+F8A2 +4-787B U+8C45 # [2000] +4-787C U+8C47 # [2000] +4-787D U+8C4F # [2000] +4-787E U+8C54 # [2000] +4-7921 U+8C57 # [2000] +4-7922 U+8C69 # [2000] +4-7923 U+8C6D # [2000] +4-7924 U+8C73 # [2000] +4-7925 U+27CB8 # [2000] [Unicode3.1] Private: U+F8A3 +4-7926 U+8C93 # [2000] +4-7927 U+8C92 # [2000] +4-7928 U+8C99 # [2000] +4-7929 U+4764 # [2000] +4-792A U+8C9B # [2000] +4-792B U+8CA4 # [2000] +4-792C U+8CD6 # [2000] +4-792D U+8CD5 # [2000] +4-792E U+8CD9 # [2000] +4-792F U+27DA0 # [2000] [Unicode3.1] Private: U+F8A4 +4-7930 U+8CF0 # [2000] +4-7931 U+8CF1 # [2000] +4-7932 U+27E10 # [2000] [Unicode3.1] Private: U+F8A5 +4-7933 U+8D09 # [2000] +4-7934 U+8D0E # [2000] +4-7935 U+8D6C # [2000] +4-7936 U+8D84 # [2000] +4-7937 U+8D95 # [2000] +4-7938 U+8DA6 # [2000] +4-7939 U+27FB7 # [2000] [Unicode3.1] Private: U+F8A6 +4-793A U+8DC6 # [2000] +4-793B U+8DC8 # [2000] +4-793C U+8DD9 # [2000] +4-793D U+8DEC # [2000] +4-793E U+8E0C # [2000] +4-793F U+47FD # [2000] +4-7940 U+8DFD # [2000] +4-7941 U+8E06 # [2000] +4-7942 U+2808A # [2000] [Unicode3.1] Private: U+F8A7 +4-7943 U+8E14 # [2000] +4-7944 U+8E16 # [2000] +4-7945 U+8E21 # [2000] +4-7946 U+8E22 # [2000] +4-7947 U+8E27 # [2000] +4-7948 U+280BB # [2000] [Unicode3.1] Private: U+F8A8 +4-7949 U+4816 # [2000] +4-794A U+8E36 # [2000] +4-794B U+8E39 # [2000] +4-794C U+8E4B # [2000] +4-794D U+8E54 # [2000] +4-794E U+8E62 # [2000] +4-794F U+8E6C # [2000] +4-7950 U+8E6D # [2000] +4-7951 U+8E6F # [2000] +4-7952 U+8E98 # [2000] +4-7953 U+8E9E # [2000] +4-7954 U+8EAE # [2000] +4-7955 U+8EB3 # [2000] +4-7956 U+8EB5 # [2000] +4-7957 U+8EB6 # [2000] +4-7958 U+8EBB # [2000] +4-7959 U+28282 # [2000] [Unicode3.1] Private: U+F8A9 +4-795A U+8ED1 # [2000] +4-795B U+8ED4 # [2000] +4-795C U+484E # [2000] +4-795D U+8EF9 # [2000] +4-795E U+282F3 # [2000] [Unicode3.1] Private: U+F8AA +4-795F U+8F00 # [2000] +4-7960 U+8F08 # [2000] +4-7961 U+8F17 # [2000] +4-7962 U+8F2B # [2000] +4-7963 U+8F40 # [2000] +4-7964 U+8F4A # [2000] +4-7965 U+8F58 # [2000] +4-7966 U+2840C # [2000] [Unicode3.1] Private: U+F8AB +4-7967 U+8FA4 # [2000] +4-7968 U+8FB4 # [2000] +4-7969 U+FA66 # CJK COMPATIBILITY IDEOGRAPH-FA66 [2000] [Unicode3.2] +4-796A U+8FB6 # [2000] +4-796B U+28455 # [2000] [Unicode3.1] Private: U+F8AD +4-796C U+8FC1 # [2000] +4-796D U+8FC6 # [2000] +4-796E U+FA24 # CJK COMPATIBILITY IDEOGRAPH-FA24 [2000] +4-796F U+8FCA # [2000] +4-7970 U+8FCD # [2000] +4-7971 U+8FD3 # [2000] +4-7972 U+8FD5 # [2000] +4-7973 U+8FE0 # [2000] +4-7974 U+8FF1 # [2000] +4-7975 U+8FF5 # [2000] +4-7976 U+8FFB # [2000] +4-7977 U+9002 # [2000] +4-7978 U+900C # [2000] +4-7979 U+9037 # [2000] +4-797A U+2856B # [2000] [Unicode3.1] Private: U+F8AE +4-797B U+9043 # [2000] +4-797C U+9044 # [2000] +4-797D U+905D # [2000] +4-797E U+285C8 # [2000] [Unicode3.1] Private: U+F8AF +4-7A21 U+285C9 # [2000] [Unicode3.1] Private: U+F8B0 +4-7A22 U+9085 # [2000] +4-7A23 U+908C # [2000] +4-7A24 U+9090 # [2000] +4-7A25 U+961D # [2000] +4-7A26 U+90A1 # [2000] +4-7A27 U+48B5 # [2000] +4-7A28 U+90B0 # [2000] +4-7A29 U+90B6 # [2000] +4-7A2A U+90C3 # [2000] +4-7A2B U+90C8 # [2000] +4-7A2C U+286D7 # [2000] [Unicode3.1] Private: U+F8B1 +4-7A2D U+90DC # [2000] +4-7A2E U+90DF # [2000] +4-7A2F U+286FA # [2000] [Unicode3.1] Private: U+F8B2 +4-7A30 U+90F6 # [2000] +4-7A31 U+90F2 # [2000] +4-7A32 U+9100 # [2000] +4-7A33 U+90EB # [2000] +4-7A34 U+90FE # [2000] +4-7A35 U+90FF # [2000] +4-7A36 U+9104 # [2000] +4-7A37 U+9106 # [2000] +4-7A38 U+9118 # [2000] +4-7A39 U+911C # [2000] +4-7A3A U+911E # [2000] +4-7A3B U+9137 # [2000] +4-7A3C U+9139 # [2000] +4-7A3D U+913A # [2000] +4-7A3E U+9146 # [2000] +4-7A3F U+9147 # [2000] +4-7A40 U+9157 # [2000] +4-7A41 U+9159 # [2000] +4-7A42 U+9161 # [2000] +4-7A43 U+9164 # [2000] +4-7A44 U+9174 # [2000] +4-7A45 U+9179 # [2000] +4-7A46 U+9185 # [2000] +4-7A47 U+918E # [2000] +4-7A48 U+91A8 # [2000] +4-7A49 U+91AE # [2000] +4-7A4A U+91B3 # [2000] +4-7A4B U+91B6 # [2000] +4-7A4C U+91C3 # [2000] +4-7A4D U+91C4 # [2000] +4-7A4E U+91DA # [2000] +4-7A4F U+28949 # [2000] [Unicode3.1] Private: U+F8B3 +4-7A50 U+28946 # [2000] [Unicode3.1] Private: U+F8B4 +4-7A51 U+91EC # [2000] +4-7A52 U+91EE # [2000] +4-7A53 U+9201 # [2000] +4-7A54 U+920A # [2000] +4-7A55 U+9216 # [2000] +4-7A56 U+9217 # [2000] +4-7A57 U+2896B # [2000] [Unicode3.1] Private: U+F8B5 +4-7A58 U+9233 # [2000] +4-7A59 U+9242 # [2000] +4-7A5A U+9247 # [2000] +4-7A5B U+924A # [2000] +4-7A5C U+924E # [2000] +4-7A5D U+9251 # [2000] +4-7A5E U+9256 # [2000] +4-7A5F U+9259 # [2000] +4-7A60 U+9260 # [2000] +4-7A61 U+9261 # [2000] +4-7A62 U+9265 # [2000] +4-7A63 U+9267 # [2000] +4-7A64 U+9268 # [2000] +4-7A65 U+28987 # [2000] [Unicode3.1] Private: U+F8B6 +4-7A66 U+28988 # [2000] [Unicode3.1] Private: U+F8B7 +4-7A67 U+927C # [2000] +4-7A68 U+927D # [2000] +4-7A69 U+927F # [2000] +4-7A6A U+9289 # [2000] +4-7A6B U+928D # [2000] +4-7A6C U+9297 # [2000] +4-7A6D U+9299 # [2000] +4-7A6E U+929F # [2000] +4-7A6F U+92A7 # [2000] +4-7A70 U+92AB # [2000] +4-7A71 U+289BA # [2000] [Unicode3.1] Private: U+F8B8 +4-7A72 U+289BB # [2000] [Unicode3.1] Private: U+F8B9 +4-7A73 U+92B2 # [2000] +4-7A74 U+92BF # [2000] +4-7A75 U+92C0 # [2000] +4-7A76 U+92C6 # [2000] +4-7A77 U+92CE # [2000] +4-7A78 U+92D0 # [2000] +4-7A79 U+92D7 # [2000] +4-7A7A U+92D9 # [2000] +4-7A7B U+92E5 # [2000] +4-7A7C U+92E7 # [2000] +4-7A7D U+9311 # [2000] +4-7A7E U+28A1E # [2000] [Unicode3.1] Private: U+F8BA +4-7B21 U+28A29 # [2000] [Unicode3.1] Private: U+F8BB +4-7B22 U+92F7 # [2000] +4-7B23 U+92F9 # [2000] +4-7B24 U+92FB # [2000] +4-7B25 U+9302 # [2000] +4-7B26 U+930D # [2000] +4-7B27 U+9315 # [2000] +4-7B28 U+931D # [2000] +4-7B29 U+931E # [2000] +4-7B2A U+9327 # [2000] +4-7B2B U+9329 # [2000] +4-7B2C U+28A71 # [2000] [Unicode3.1] Private: U+F8BC +4-7B2D U+28A43 # [2000] [Unicode3.1] Private: U+F8BD +4-7B2E U+9347 # [2000] +4-7B2F U+9351 # [2000] +4-7B30 U+9357 # [2000] +4-7B31 U+935A # [2000] +4-7B32 U+936B # [2000] +4-7B33 U+9371 # [2000] +4-7B34 U+9373 # [2000] +4-7B35 U+93A1 # [2000] +4-7B36 U+28A99 # [2000] [Unicode3.1] Private: U+F8BE +4-7B37 U+28ACD # [2000] [Unicode3.1] Private: U+F8BF +4-7B38 U+9388 # [2000] +4-7B39 U+938B # [2000] +4-7B3A U+938F # [2000] +4-7B3B U+939E # [2000] +4-7B3C U+93F5 # [2000] +4-7B3D U+28AE4 # [2000] [Unicode3.1] Private: U+F8C0 +4-7B3E U+28ADD # [2000] [Unicode3.1] Private: U+F8C1 +4-7B3F U+93F1 # [2000] +4-7B40 U+93C1 # [2000] +4-7B41 U+93C7 # [2000] +4-7B42 U+93DC # [2000] +4-7B43 U+93E2 # [2000] +4-7B44 U+93E7 # [2000] +4-7B45 U+9409 # [2000] +4-7B46 U+940F # [2000] +4-7B47 U+9416 # [2000] +4-7B48 U+9417 # [2000] +4-7B49 U+93FB # [2000] +4-7B4A U+9432 # [2000] +4-7B4B U+9434 # [2000] +4-7B4C U+943B # [2000] +4-7B4D U+9445 # [2000] +4-7B4E U+28BC1 # [2000] [Unicode3.1] Private: U+F8C2 +4-7B4F U+28BEF # [2000] [Unicode3.1] Private: U+F8C3 +4-7B50 U+946D # [2000] +4-7B51 U+946F # [2000] +4-7B52 U+9578 # [2000] +4-7B53 U+9579 # [2000] +4-7B54 U+9586 # [2000] +4-7B55 U+958C # [2000] +4-7B56 U+958D # [2000] +4-7B57 U+28D10 # [2000] [Unicode3.1] Private: U+F8C4 +4-7B58 U+95AB # [2000] +4-7B59 U+95B4 # [2000] +4-7B5A U+28D71 # [2000] [Unicode3.1] Private: U+F8C5 +4-7B5B U+95C8 # [2000] +4-7B5C U+28DFB # [2000] [Unicode3.1] Private: U+F8C6 +4-7B5D U+28E1F # [2000] [Unicode3.1] Private: U+F8C7 +4-7B5E U+962C # [2000] +4-7B5F U+9633 # [2000] +4-7B60 U+9634 # [2000] +4-7B61 U+28E36 # [2000] [Unicode3.1] Private: U+F8C8 +4-7B62 U+963C # [2000] +4-7B63 U+9641 # [2000] +4-7B64 U+9661 # [2000] +4-7B65 U+28E89 # [2000] [Unicode3.1] Private: U+F8C9 +4-7B66 U+9682 # [2000] +4-7B67 U+28EEB # [2000] [Unicode3.1] Private: U+F8CA +4-7B68 U+969A # [2000] +4-7B69 U+28F32 # [2000] [Unicode3.1] Private: U+F8CB +4-7B6A U+49E7 # [2000] +4-7B6B U+96A9 # [2000] +4-7B6C U+96AF # [2000] +4-7B6D U+96B3 # [2000] +4-7B6E U+96BA # [2000] +4-7B6F U+96BD # [2000] +4-7B70 U+49FA # [2000] +4-7B71 U+28FF8 # [2000] [Unicode3.1] Private: U+F8CC +4-7B72 U+96D8 # [2000] +4-7B73 U+96DA # [2000] +4-7B74 U+96DD # [2000] +4-7B75 U+4A04 # [2000] +4-7B76 U+9714 # [2000] +4-7B77 U+9723 # [2000] +4-7B78 U+4A29 # [2000] +4-7B79 U+9736 # [2000] +4-7B7A U+9741 # [2000] +4-7B7B U+9747 # [2000] +4-7B7C U+9755 # [2000] +4-7B7D U+9757 # [2000] +4-7B7E U+975B # [2000] +4-7C21 U+976A # [2000] +4-7C22 U+292A0 # [2000] [Unicode3.1] Private: U+F8CD +4-7C23 U+292B1 # [2000] [Unicode3.1] Private: U+F8CE +4-7C24 U+9796 # [2000] +4-7C25 U+979A # [2000] +4-7C26 U+979E # [2000] +4-7C27 U+97A2 # [2000] +4-7C28 U+97B1 # [2000] +4-7C29 U+97B2 # [2000] +4-7C2A U+97BE # [2000] +4-7C2B U+97CC # [2000] +4-7C2C U+97D1 # [2000] +4-7C2D U+97D4 # [2000] +4-7C2E U+97D8 # [2000] +4-7C2F U+97D9 # [2000] +4-7C30 U+97E1 # [2000] +4-7C31 U+97F1 # [2000] +4-7C32 U+9804 # [2000] +4-7C33 U+980D # [2000] +4-7C34 U+980E # [2000] +4-7C35 U+9814 # [2000] +4-7C36 U+9816 # [2000] +4-7C37 U+4ABC # [2000] +4-7C38 U+29490 # [2000] [Unicode3.1] Private: U+F8CF +4-7C39 U+9823 # [2000] +4-7C3A U+9832 # [2000] +4-7C3B U+9833 # [2000] +4-7C3C U+9825 # [2000] +4-7C3D U+9847 # [2000] +4-7C3E U+9866 # [2000] +4-7C3F U+98AB # [2000] +4-7C40 U+98AD # [2000] +4-7C41 U+98B0 # [2000] +4-7C42 U+295CF # [2000] [Unicode3.1] Private: U+F8D0 +4-7C43 U+98B7 # [2000] +4-7C44 U+98B8 # [2000] +4-7C45 U+98BB # [2000] +4-7C46 U+98BC # [2000] +4-7C47 U+98BF # [2000] +4-7C48 U+98C2 # [2000] +4-7C49 U+98C7 # [2000] +4-7C4A U+98CB # [2000] +4-7C4B U+98E0 # [2000] +4-7C4C U+2967F # [2000] [Unicode3.1] Private: U+F8D1 +4-7C4D U+98E1 # [2000] +4-7C4E U+98E3 # [2000] +4-7C4F U+98E5 # [2000] +4-7C50 U+98EA # [2000] +4-7C51 U+98F0 # [2000] +4-7C52 U+98F1 # [2000] +4-7C53 U+98F3 # [2000] +4-7C54 U+9908 # [2000] +4-7C55 U+4B3B # [2000] +4-7C56 U+296F0 # [2000] [Unicode3.1] Private: U+F8D2 +4-7C57 U+9916 # [2000] +4-7C58 U+9917 # [2000] +4-7C59 U+29719 # [2000] [Unicode3.1] Private: U+F8D3 +4-7C5A U+991A # [2000] +4-7C5B U+991B # [2000] +4-7C5C U+991C # [2000] +4-7C5D U+29750 # [2000] [Unicode3.1] Private: U+F8D4 +4-7C5E U+9931 # [2000] +4-7C5F U+9932 # [2000] +4-7C60 U+9933 # [2000] +4-7C61 U+993A # [2000] +4-7C62 U+993B # [2000] +4-7C63 U+993C # [2000] +4-7C64 U+9940 # [2000] +4-7C65 U+9941 # [2000] +4-7C66 U+9946 # [2000] +4-7C67 U+994D # [2000] +4-7C68 U+994E # [2000] +4-7C69 U+995C # [2000] +4-7C6A U+995F # [2000] +4-7C6B U+9960 # [2000] +4-7C6C U+99A3 # [2000] +4-7C6D U+99A6 # [2000] +4-7C6E U+99B9 # [2000] +4-7C6F U+99BD # [2000] +4-7C70 U+99BF # [2000] +4-7C71 U+99C3 # [2000] +4-7C72 U+99C9 # [2000] +4-7C73 U+99D4 # [2000] +4-7C74 U+99D9 # [2000] +4-7C75 U+99DE # [2000] +4-7C76 U+298C6 # [2000] [Unicode3.1] Private: U+F8D5 +4-7C77 U+99F0 # [2000] +4-7C78 U+99F9 # [2000] +4-7C79 U+99FC # [2000] +4-7C7A U+9A0A # [2000] +4-7C7B U+9A11 # [2000] +4-7C7C U+9A16 # [2000] +4-7C7D U+9A1A # [2000] +4-7C7E U+9A20 # [2000] +4-7D21 U+9A31 # [2000] +4-7D22 U+9A36 # [2000] +4-7D23 U+9A44 # [2000] +4-7D24 U+9A4C # [2000] +4-7D25 U+9A58 # [2000] +4-7D26 U+4BC2 # [2000] +4-7D27 U+9AAF # [2000] +4-7D28 U+4BCA # [2000] +4-7D29 U+9AB7 # [2000] +4-7D2A U+4BD2 # [2000] +4-7D2B U+9AB9 # [2000] +4-7D2C U+29A72 # [2000] [Unicode3.1] Private: U+F8D6 +4-7D2D U+9AC6 # [2000] +4-7D2E U+9AD0 # [2000] +4-7D2F U+9AD2 # [2000] +4-7D30 U+9AD5 # [2000] +4-7D31 U+4BE8 # [2000] +4-7D32 U+9ADC # [2000] +4-7D33 U+9AE0 # [2000] +4-7D34 U+9AE5 # [2000] +4-7D35 U+9AE9 # [2000] +4-7D36 U+9B03 # [2000] +4-7D37 U+9B0C # [2000] +4-7D38 U+9B10 # [2000] +4-7D39 U+9B12 # [2000] +4-7D3A U+9B16 # [2000] +4-7D3B U+9B1C # [2000] +4-7D3C U+9B2B # [2000] +4-7D3D U+9B33 # [2000] +4-7D3E U+9B3D # [2000] +4-7D3F U+4C20 # [2000] +4-7D40 U+9B4B # [2000] +4-7D41 U+9B63 # [2000] +4-7D42 U+9B65 # [2000] +4-7D43 U+9B6B # [2000] +4-7D44 U+9B6C # [2000] +4-7D45 U+9B73 # [2000] +4-7D46 U+9B76 # [2000] +4-7D47 U+9B77 # [2000] +4-7D48 U+9BA6 # [2000] +4-7D49 U+9BAC # [2000] +4-7D4A U+9BB1 # [2000] +4-7D4B U+29DDB # [2000] [Unicode3.1] Private: U+F8D7 +4-7D4C U+29E3D # [2000] [Unicode3.1] Private: U+F8D8 +4-7D4D U+9BB2 # [2000] +4-7D4E U+9BB8 # [2000] +4-7D4F U+9BBE # [2000] +4-7D50 U+9BC7 # [2000] +4-7D51 U+9BF3 # [2000] +4-7D52 U+9BD8 # [2000] +4-7D53 U+9BDD # [2000] +4-7D54 U+9BE7 # [2000] +4-7D55 U+9BEA # [2000] +4-7D56 U+9BEB # [2000] +4-7D57 U+9BEF # [2000] +4-7D58 U+9BEE # [2000] +4-7D59 U+29E15 # [2000] [Unicode3.1] Private: U+F8D9 +4-7D5A U+9BFA # [2000] +4-7D5B U+29E8A # [2000] [Unicode3.1] Private: U+F8DA +4-7D5C U+9BF7 # [2000] +4-7D5D U+29E49 # [2000] [Unicode3.1] Private: U+F8DB +4-7D5E U+9C16 # [2000] +4-7D5F U+9C18 # [2000] +4-7D60 U+9C19 # [2000] +4-7D61 U+9C1A # [2000] +4-7D62 U+9C1D # [2000] +4-7D63 U+9C22 # [2000] +4-7D64 U+9C27 # [2000] +4-7D65 U+9C29 # [2000] +4-7D66 U+9C2A # [2000] +4-7D67 U+29EC4 # [2000] [Unicode3.1] Private: U+F8DC +4-7D68 U+9C31 # [2000] +4-7D69 U+9C36 # [2000] +4-7D6A U+9C37 # [2000] +4-7D6B U+9C45 # [2000] +4-7D6C U+9C5C # [2000] +4-7D6D U+29EE9 # [2000] [Unicode3.1] Private: U+F8DD +4-7D6E U+9C49 # [2000] +4-7D6F U+9C4A # [2000] +4-7D70 U+29EDB # [2000] [Unicode3.1] Private: U+F8DE +4-7D71 U+9C54 # [2000] +4-7D72 U+9C58 # [2000] +4-7D73 U+9C5B # [2000] +4-7D74 U+9C5D # [2000] +4-7D75 U+9C5F # [2000] +4-7D76 U+9C69 # [2000] +4-7D77 U+9C6A # [2000] +4-7D78 U+9C6B # [2000] +4-7D79 U+9C6D # [2000] +4-7D7A U+9C6E # [2000] +4-7D7B U+9C70 # [2000] +4-7D7C U+9C72 # [2000] +4-7D7D U+9C75 # [2000] +4-7D7E U+9C7A # [2000] +4-7E21 U+9CE6 # [2000] +4-7E22 U+9CF2 # [2000] +4-7E23 U+9D0B # [2000] +4-7E24 U+9D02 # [2000] +4-7E25 U+29FCE # [2000] [Unicode3.1] Private: U+F8DF +4-7E26 U+9D11 # [2000] +4-7E27 U+9D17 # [2000] +4-7E28 U+9D18 # [2000] +4-7E29 U+2A02F # [2000] [Unicode3.1] Private: U+F8E0 +4-7E2A U+4CC4 # [2000] +4-7E2B U+2A01A # [2000] [Unicode3.1] Private: U+F8E1 +4-7E2C U+9D32 # [2000] +4-7E2D U+4CD1 # [2000] +4-7E2E U+9D42 # [2000] +4-7E2F U+9D4A # [2000] +4-7E30 U+9D5F # [2000] +4-7E31 U+9D62 # [2000] +4-7E32 U+2A0F9 # [2000] [Unicode3.1] Private: U+F8E2 +4-7E33 U+9D69 # [2000] +4-7E34 U+9D6B # [2000] +4-7E35 U+2A082 # [2000] [Unicode3.1] Private: U+F8E3 +4-7E36 U+9D73 # [2000] +4-7E37 U+9D76 # [2000] +4-7E38 U+9D77 # [2000] +4-7E39 U+9D7E # [2000] +4-7E3A U+9D84 # [2000] +4-7E3B U+9D8D # [2000] +4-7E3C U+9D99 # [2000] +4-7E3D U+9DA1 # [2000] +4-7E3E U+9DBF # [2000] +4-7E3F U+9DB5 # [2000] +4-7E40 U+9DB9 # [2000] +4-7E41 U+9DBD # [2000] +4-7E42 U+9DC3 # [2000] +4-7E43 U+9DC7 # [2000] +4-7E44 U+9DC9 # [2000] +4-7E45 U+9DD6 # [2000] +4-7E46 U+9DDA # [2000] +4-7E47 U+9DDF # [2000] +4-7E48 U+9DE0 # [2000] +4-7E49 U+9DE3 # [2000] +4-7E4A U+9DF4 # [2000] +4-7E4B U+4D07 # [2000] +4-7E4C U+9E0A # [2000] +4-7E4D U+9E02 # [2000] +4-7E4E U+9E0D # [2000] +4-7E4F U+9E19 # [2000] +4-7E50 U+9E1C # [2000] +4-7E51 U+9E1D # [2000] +4-7E52 U+9E7B # [2000] +4-7E53 U+22218 # [2000] [Unicode3.1] Private: U+F8E4 +4-7E54 U+9E80 # [2000] +4-7E55 U+9E85 # [2000] +4-7E56 U+9E9B # [2000] +4-7E57 U+9EA8 # [2000] +4-7E58 U+2A38C # [2000] [Unicode3.1] Private: U+F8E5 +4-7E59 U+9EBD # [2000] +4-7E5A U+2A437 # [2000] [Unicode3.1] Private: U+F8E6 +4-7E5B U+9EDF # [2000] +4-7E5C U+9EE7 # [2000] +4-7E5D U+9EEE # [2000] +4-7E5E U+9EFF # [2000] +4-7E5F U+9F02 # [2000] +4-7E60 U+4D77 # [2000] +4-7E61 U+9F03 # [2000] +4-7E62 U+9F17 # [2000] +4-7E63 U+9F19 # [2000] +4-7E64 U+9F2F # [2000] +4-7E65 U+9F37 # [2000] +4-7E66 U+9F3A # [2000] +4-7E67 U+9F3D # [2000] +4-7E68 U+9F41 # [2000] +4-7E69 U+9F45 # [2000] +4-7E6A U+9F46 # [2000] +4-7E6B U+9F53 # [2000] +4-7E6C U+9F55 # [2000] +4-7E6D U+9F58 # [2000] +4-7E6E U+2A5F1 # [2000] [Unicode3.1] Private: U+F8E7 +4-7E6F U+9F5D # [2000] +4-7E70 U+2A602 # [2000] [Unicode3.1] Private: U+F8E8 +4-7E71 U+9F69 # [2000] +4-7E72 U+2A61A # [2000] [Unicode3.1] Private: U+F8E9 +4-7E73 U+9F6D # [2000] +4-7E74 U+9F70 # [2000] +4-7E75 U+9F75 # [2000] +4-7E76 U+2A6B2 # [2000] [Unicode3.1] Private: U+F8EA From webhook-mailer at python.org Wed Apr 29 14:20:35 2020 From: webhook-mailer at python.org (Dong-hee Na) Date: Wed, 29 Apr 2020 18:20:35 -0000 Subject: [Python-checkins] bpo-1635741: Port _stat module to multiphase initialization (GH-19798) Message-ID: https://github.com/python/cpython/commit/84724dd239c30043616487812f6a710b1d70cd4b commit: 84724dd239c30043616487812f6a710b1d70cd4b branch: master author: Dong-hee Na committer: GitHub date: 2020-04-30T03:20:27+09:00 summary: bpo-1635741: Port _stat module to multiphase initialization (GH-19798) files: A Misc/NEWS.d/next/Core and Builtins/2020-04-30-01-44-42.bpo-1635741.GKtjqr.rst M Modules/_stat.c diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-30-01-44-42.bpo-1635741.GKtjqr.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-30-01-44-42.bpo-1635741.GKtjqr.rst new file mode 100644 index 0000000000000..7b3c7511e139e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-30-01-44-42.bpo-1635741.GKtjqr.rst @@ -0,0 +1 @@ +Port _stat module to multiphase initialization (:pep:`489`). diff --git a/Modules/_stat.c b/Modules/_stat.c index 6a3020a00d114..45a4e080c7746 100644 --- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -492,113 +492,140 @@ ST_CTIME\n\ "); +static int +stat_exec(PyObject *module) +{ +#define ADD_INT_MACRO(module, macro) \ + do { \ + if (PyModule_AddIntConstant(module, #macro, macro) < 0) { \ + return -1; \ + } \ + } while (0) + + ADD_INT_MACRO(module, S_IFDIR); + ADD_INT_MACRO(module, S_IFCHR); + ADD_INT_MACRO(module, S_IFBLK); + ADD_INT_MACRO(module, S_IFREG); + ADD_INT_MACRO(module, S_IFIFO); + ADD_INT_MACRO(module, S_IFLNK); + ADD_INT_MACRO(module, S_IFSOCK); + ADD_INT_MACRO(module, S_IFDOOR); + ADD_INT_MACRO(module, S_IFPORT); + ADD_INT_MACRO(module, S_IFWHT); + + ADD_INT_MACRO(module, S_ISUID); + ADD_INT_MACRO(module, S_ISGID); + ADD_INT_MACRO(module, S_ISVTX); + ADD_INT_MACRO(module, S_ENFMT); + + ADD_INT_MACRO(module, S_IREAD); + ADD_INT_MACRO(module, S_IWRITE); + ADD_INT_MACRO(module, S_IEXEC); + + ADD_INT_MACRO(module, S_IRWXU); + ADD_INT_MACRO(module, S_IRUSR); + ADD_INT_MACRO(module, S_IWUSR); + ADD_INT_MACRO(module, S_IXUSR); + + ADD_INT_MACRO(module, S_IRWXG); + ADD_INT_MACRO(module, S_IRGRP); + ADD_INT_MACRO(module, S_IWGRP); + ADD_INT_MACRO(module, S_IXGRP); + + ADD_INT_MACRO(module, S_IRWXO); + ADD_INT_MACRO(module, S_IROTH); + ADD_INT_MACRO(module, S_IWOTH); + ADD_INT_MACRO(module, S_IXOTH); + + ADD_INT_MACRO(module, UF_NODUMP); + ADD_INT_MACRO(module, UF_IMMUTABLE); + ADD_INT_MACRO(module, UF_APPEND); + ADD_INT_MACRO(module, UF_OPAQUE); + ADD_INT_MACRO(module, UF_NOUNLINK); + ADD_INT_MACRO(module, UF_COMPRESSED); + ADD_INT_MACRO(module, UF_HIDDEN); + ADD_INT_MACRO(module, SF_ARCHIVED); + ADD_INT_MACRO(module, SF_IMMUTABLE); + ADD_INT_MACRO(module, SF_APPEND); + ADD_INT_MACRO(module, SF_NOUNLINK); + ADD_INT_MACRO(module, SF_SNAPSHOT); + + const char* st_constants[] = { + "ST_MODE", + "ST_INO", + "ST_DEV", + "ST_NLINK", + "ST_UID", + "ST_GID", + "ST_SIZE", + "ST_ATIME", + "ST_MTIME", + "ST_CTIME" + }; + + for (int i = 0; i < Py_ARRAY_LENGTH(st_constants); i++) { + if (PyModule_AddIntConstant(module, st_constants[i], i) < 0) { + return -1; + } + } + +#ifdef MS_WINDOWS + ADD_INT_MACRO(module, FILE_ATTRIBUTE_ARCHIVE); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_COMPRESSED); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_DEVICE); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_DIRECTORY); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_ENCRYPTED); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_HIDDEN); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_INTEGRITY_STREAM); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_NORMAL); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_NO_SCRUB_DATA); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_OFFLINE); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_READONLY); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_REPARSE_POINT); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_SPARSE_FILE); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_SYSTEM); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_TEMPORARY); + ADD_INT_MACRO(module, FILE_ATTRIBUTE_VIRTUAL); + + if (PyModule_AddObject(module, "IO_REPARSE_TAG_SYMLINK", + PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK)) < 0) { + return -1; + } + if (PyModule_AddObject(module, "IO_REPARSE_TAG_MOUNT_POINT", + PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT)) < 0) { + return -1; + } + if (PyModule_AddObject(module, "IO_REPARSE_TAG_APPEXECLINK", + PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK)) < 0) { + return -1; + } +#endif + + return 0; +} + + +static PyModuleDef_Slot stat_slots[] = { + {Py_mod_exec, stat_exec}, + {0, NULL} +}; + + static struct PyModuleDef statmodule = { PyModuleDef_HEAD_INIT, - "_stat", - module_doc, - -1, - stat_methods, - NULL, - NULL, - NULL, - NULL + .m_name = "_stat", + .m_doc = module_doc, + .m_size = 0, + .m_methods = stat_methods, + .m_slots = stat_slots, }; + PyMODINIT_FUNC PyInit__stat(void) { - PyObject *m; - m = PyModule_Create(&statmodule); - if (m == NULL) - return NULL; - - if (PyModule_AddIntMacro(m, S_IFDIR)) return NULL; - if (PyModule_AddIntMacro(m, S_IFCHR)) return NULL; - if (PyModule_AddIntMacro(m, S_IFBLK)) return NULL; - if (PyModule_AddIntMacro(m, S_IFREG)) return NULL; - if (PyModule_AddIntMacro(m, S_IFIFO)) return NULL; - if (PyModule_AddIntMacro(m, S_IFLNK)) return NULL; - if (PyModule_AddIntMacro(m, S_IFSOCK)) return NULL; - if (PyModule_AddIntMacro(m, S_IFDOOR)) return NULL; - if (PyModule_AddIntMacro(m, S_IFPORT)) return NULL; - if (PyModule_AddIntMacro(m, S_IFWHT)) return NULL; - - if (PyModule_AddIntMacro(m, S_ISUID)) return NULL; - if (PyModule_AddIntMacro(m, S_ISGID)) return NULL; - if (PyModule_AddIntMacro(m, S_ISVTX)) return NULL; - if (PyModule_AddIntMacro(m, S_ENFMT)) return NULL; - - if (PyModule_AddIntMacro(m, S_IREAD)) return NULL; - if (PyModule_AddIntMacro(m, S_IWRITE)) return NULL; - if (PyModule_AddIntMacro(m, S_IEXEC)) return NULL; - - if (PyModule_AddIntMacro(m, S_IRWXU)) return NULL; - if (PyModule_AddIntMacro(m, S_IRUSR)) return NULL; - if (PyModule_AddIntMacro(m, S_IWUSR)) return NULL; - if (PyModule_AddIntMacro(m, S_IXUSR)) return NULL; - - if (PyModule_AddIntMacro(m, S_IRWXG)) return NULL; - if (PyModule_AddIntMacro(m, S_IRGRP)) return NULL; - if (PyModule_AddIntMacro(m, S_IWGRP)) return NULL; - if (PyModule_AddIntMacro(m, S_IXGRP)) return NULL; - - if (PyModule_AddIntMacro(m, S_IRWXO)) return NULL; - if (PyModule_AddIntMacro(m, S_IROTH)) return NULL; - if (PyModule_AddIntMacro(m, S_IWOTH)) return NULL; - if (PyModule_AddIntMacro(m, S_IXOTH)) return NULL; - - if (PyModule_AddIntMacro(m, UF_NODUMP)) return NULL; - if (PyModule_AddIntMacro(m, UF_IMMUTABLE)) return NULL; - if (PyModule_AddIntMacro(m, UF_APPEND)) return NULL; - if (PyModule_AddIntMacro(m, UF_OPAQUE)) return NULL; - if (PyModule_AddIntMacro(m, UF_NOUNLINK)) return NULL; - if (PyModule_AddIntMacro(m, UF_COMPRESSED)) return NULL; - if (PyModule_AddIntMacro(m, UF_HIDDEN)) return NULL; - if (PyModule_AddIntMacro(m, SF_ARCHIVED)) return NULL; - if (PyModule_AddIntMacro(m, SF_IMMUTABLE)) return NULL; - if (PyModule_AddIntMacro(m, SF_APPEND)) return NULL; - if (PyModule_AddIntMacro(m, SF_NOUNLINK)) return NULL; - if (PyModule_AddIntMacro(m, SF_SNAPSHOT)) return NULL; - - if (PyModule_AddIntConstant(m, "ST_MODE", 0)) return NULL; - if (PyModule_AddIntConstant(m, "ST_INO", 1)) return NULL; - if (PyModule_AddIntConstant(m, "ST_DEV", 2)) return NULL; - if (PyModule_AddIntConstant(m, "ST_NLINK", 3)) return NULL; - if (PyModule_AddIntConstant(m, "ST_UID", 4)) return NULL; - if (PyModule_AddIntConstant(m, "ST_GID", 5)) return NULL; - if (PyModule_AddIntConstant(m, "ST_SIZE", 6)) return NULL; - if (PyModule_AddIntConstant(m, "ST_ATIME", 7)) return NULL; - if (PyModule_AddIntConstant(m, "ST_MTIME", 8)) return NULL; - if (PyModule_AddIntConstant(m, "ST_CTIME", 9)) return NULL; - -#ifdef MS_WINDOWS - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_ARCHIVE)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_COMPRESSED)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_DEVICE)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_DIRECTORY)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_ENCRYPTED)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_HIDDEN)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_INTEGRITY_STREAM)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_NORMAL)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_NO_SCRUB_DATA)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_OFFLINE)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_READONLY)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_REPARSE_POINT)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_SPARSE_FILE)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_SYSTEM)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_TEMPORARY)) return NULL; - if (PyModule_AddIntMacro(m, FILE_ATTRIBUTE_VIRTUAL)) return NULL; - - if (PyModule_AddObject(m, "IO_REPARSE_TAG_SYMLINK", - PyLong_FromUnsignedLong(IO_REPARSE_TAG_SYMLINK))) return NULL; - if (PyModule_AddObject(m, "IO_REPARSE_TAG_MOUNT_POINT", - PyLong_FromUnsignedLong(IO_REPARSE_TAG_MOUNT_POINT))) return NULL; - if (PyModule_AddObject(m, "IO_REPARSE_TAG_APPEXECLINK", - PyLong_FromUnsignedLong(IO_REPARSE_TAG_APPEXECLINK))) return NULL; -#endif - - return m; + return PyModuleDef_Init(&statmodule); } #ifdef __cplusplus From webhook-mailer at python.org Wed Apr 29 18:17:19 2020 From: webhook-mailer at python.org (Alex Povel) Date: Wed, 29 Apr 2020 22:17:19 -0000 Subject: [Python-checkins] Fix plural typo in documentation (GH-19799) Message-ID: https://github.com/python/cpython/commit/fd33cdbd05d2fbe2443554a9b79155de07b0d056 commit: fd33cdbd05d2fbe2443554a9b79155de07b0d056 branch: master author: Alex Povel <48824213+alexpovel at users.noreply.github.com> committer: GitHub date: 2020-04-29T19:17:12-03:00 summary: Fix plural typo in documentation (GH-19799) Co-authored-by: Alex Povel files: M Doc/faq/design.rst diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index df3dbf4977e01..4e3cc575ee196 100644 --- a/Doc/faq/design.rst +++ b/Doc/faq/design.rst @@ -651,7 +651,7 @@ Why doesn't Python have a "with" statement for attribute assignments? --------------------------------------------------------------------- Python has a 'with' statement that wraps the execution of a block, calling code -on the entrance and exit from the block. Some language have a construct that +on the entrance and exit from the block. Some languages have a construct that looks like this:: with obj: From webhook-mailer at python.org Wed Apr 29 18:31:28 2020 From: webhook-mailer at python.org (karl ding) Date: Wed, 29 Apr 2020 22:31:28 -0000 Subject: [Python-checkins] bpo-40291: Add support for CAN_J1939 sockets (GH-19538) Message-ID: https://github.com/python/cpython/commit/360371f79c48f15bbcee7aeecacf97a899913b25 commit: 360371f79c48f15bbcee7aeecacf97a899913b25 branch: master author: karl ding committer: GitHub date: 2020-04-29T15:31:19-07:00 summary: bpo-40291: Add support for CAN_J1939 sockets (GH-19538) Add support for CAN_J1939 sockets that wrap SAE J1939 protocol functionality provided by Linux 5.4+ kernels. files: A Misc/NEWS.d/next/Library/2020-04-14-22-31-27.bpo-40291._O8hXn.rst M Doc/library/socket.rst M Lib/test/test_socket.py M Modules/socketmodule.c M Modules/socketmodule.h M configure M configure.ac M pyconfig.h.in diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 87dee1a801dea..d798c1a9d10a0 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -118,6 +118,10 @@ created. Socket addresses are represented as follows: - :const:`CAN_ISOTP` protocol require a tuple ``(interface, rx_addr, tx_addr)`` where both additional parameters are unsigned long integer that represent a CAN identifier (standard or extended). + - :const:`CAN_J1939` protocol require a tuple ``(interface, name, pgn, addr)`` + where additional parameters are 64-bit unsigned integer representing the + ECU name, a 32-bit unsigned integer representing the Parameter Group Number + (PGN), and an 8-bit integer representing the address. - A string or a tuple ``(id, unit)`` is used for the :const:`SYSPROTO_CONTROL` protocol of the :const:`PF_SYSTEM` family. The string is the name of a @@ -428,6 +432,15 @@ Constants .. versionadded:: 3.7 +.. data:: CAN_J1939 + + CAN_J1939, in the CAN protocol family, is the SAE J1939 protocol. + J1939 constants, documented in the Linux documentation. + + .. availability:: Linux >= 5.4. + + .. versionadded:: 3.9 + .. data:: AF_PACKET PF_PACKET @@ -544,7 +557,8 @@ The following functions all create :ref:`socket objects `. default), :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` constants. The protocol number is usually zero and may be omitted or in the case where the address family is :const:`AF_CAN` the protocol - should be one of :const:`CAN_RAW`, :const:`CAN_BCM` or :const:`CAN_ISOTP`. + should be one of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or + :const:`CAN_J1939`. If *fileno* is specified, the values for *family*, *type*, and *proto* are auto-detected from the specified file descriptor. Auto-detection can be @@ -588,6 +602,9 @@ The following functions all create :ref:`socket objects `. ``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``. + .. versionchanged:: 3.9 + The CAN_J1939 protocol was added. + .. function:: socketpair([family[, type[, proto]]]) Build a pair of connected socket objects using the given address family, socket diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 87ae2e127a236..4a436cf3c143a 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -80,6 +80,16 @@ def _have_socket_can_isotp(): s.close() return True +def _have_socket_can_j1939(): + """Check whether CAN J1939 sockets are supported on this host.""" + try: + s = socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) + except (AttributeError, OSError): + return False + else: + s.close() + return True + def _have_socket_rds(): """Check whether RDS sockets are supported on this host.""" try: @@ -143,6 +153,8 @@ def socket_setdefaulttimeout(timeout): HAVE_SOCKET_CAN_ISOTP = _have_socket_can_isotp() +HAVE_SOCKET_CAN_J1939 = _have_socket_can_j1939() + HAVE_SOCKET_RDS = _have_socket_rds() HAVE_SOCKET_ALG = _have_socket_alg() @@ -2117,6 +2129,68 @@ def testBind(self): raise + at unittest.skipUnless(HAVE_SOCKET_CAN_J1939, 'CAN J1939 required for this test.') +class J1939Test(unittest.TestCase): + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.interface = "vcan0" + + @unittest.skipUnless(hasattr(socket, "CAN_J1939"), + 'socket.CAN_J1939 required for this test.') + def testJ1939Constants(self): + socket.CAN_J1939 + + socket.J1939_MAX_UNICAST_ADDR + socket.J1939_IDLE_ADDR + socket.J1939_NO_ADDR + socket.J1939_NO_NAME + socket.J1939_PGN_REQUEST + socket.J1939_PGN_ADDRESS_CLAIMED + socket.J1939_PGN_ADDRESS_COMMANDED + socket.J1939_PGN_PDU1_MAX + socket.J1939_PGN_MAX + socket.J1939_NO_PGN + + # J1939 socket options + socket.SO_J1939_FILTER + socket.SO_J1939_PROMISC + socket.SO_J1939_SEND_PRIO + socket.SO_J1939_ERRQUEUE + + socket.SCM_J1939_DEST_ADDR + socket.SCM_J1939_DEST_NAME + socket.SCM_J1939_PRIO + socket.SCM_J1939_ERRQUEUE + + socket.J1939_NLA_PAD + socket.J1939_NLA_BYTES_ACKED + + socket.J1939_EE_INFO_NONE + socket.J1939_EE_INFO_TX_ABORT + + socket.J1939_FILTER_MAX + + @unittest.skipUnless(hasattr(socket, "CAN_J1939"), + 'socket.CAN_J1939 required for this test.') + def testCreateJ1939Socket(self): + with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) as s: + pass + + def testBind(self): + try: + with socket.socket(socket.PF_CAN, socket.SOCK_DGRAM, socket.CAN_J1939) as s: + addr = self.interface, socket.J1939_NO_NAME, socket.J1939_NO_PGN, socket.J1939_NO_ADDR + s.bind(addr) + self.assertEqual(s.getsockname(), addr) + except OSError as e: + if e.errno == errno.ENODEV: + self.skipTest('network interface `%s` does not exist' % + self.interface) + else: + raise + + @unittest.skipUnless(HAVE_SOCKET_RDS, 'RDS sockets required for this test.') class BasicRDSTest(unittest.TestCase): diff --git a/Misc/NEWS.d/next/Library/2020-04-14-22-31-27.bpo-40291._O8hXn.rst b/Misc/NEWS.d/next/Library/2020-04-14-22-31-27.bpo-40291._O8hXn.rst new file mode 100644 index 0000000000000..a560ef12302bb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-14-22-31-27.bpo-40291._O8hXn.rst @@ -0,0 +1 @@ +Add support for CAN_J1939 sockets (available on Linux 5.4+) diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 9db8535eb3434..580ac0af5aff5 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -1556,6 +1556,16 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto) a->can_addr.tp.tx_id); } #endif /* CAN_ISOTP */ +#ifdef CAN_J1939 + case CAN_J1939: + { + return Py_BuildValue("O&KkB", PyUnicode_DecodeFSDefault, + ifname, + a->can_addr.j1939.name, + a->can_addr.j1939.pgn, + a->can_addr.j1939.addr); + } +#endif /* CAN_J1939 */ default: { return Py_BuildValue("(O&)", PyUnicode_DecodeFSDefault, @@ -2237,6 +2247,55 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args, return 1; } #endif /* CAN_ISOTP */ +#ifdef CAN_J1939 + case CAN_J1939: + { + PyObject *interfaceName; + struct ifreq ifr; + Py_ssize_t len; + uint64_t j1939_name; + uint32_t j1939_pgn; + uint8_t j1939_addr; + + struct sockaddr_can *addr = &addrbuf->can; + + if (!PyArg_ParseTuple(args, "O&KkB", PyUnicode_FSConverter, + &interfaceName, + &j1939_name, + &j1939_pgn, + &j1939_addr)) + return 0; + + len = PyBytes_GET_SIZE(interfaceName); + + if (len == 0) { + ifr.ifr_ifindex = 0; + } else if ((size_t)len < sizeof(ifr.ifr_name)) { + strncpy(ifr.ifr_name, PyBytes_AS_STRING(interfaceName), sizeof(ifr.ifr_name)); + ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0'; + if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) { + s->errorhandler(); + Py_DECREF(interfaceName); + return 0; + } + } else { + PyErr_SetString(PyExc_OSError, + "AF_CAN interface name too long"); + Py_DECREF(interfaceName); + return 0; + } + + addr->can_family = AF_CAN; + addr->can_ifindex = ifr.ifr_ifindex; + addr->can_addr.j1939.name = j1939_name; + addr->can_addr.j1939.pgn = j1939_pgn; + addr->can_addr.j1939.addr = j1939_addr; + + *len_ret = sizeof(*addr); + Py_DECREF(interfaceName); + return 1; + } +#endif /* CAN_J1939 */ default: PyErr_Format(PyExc_OSError, "%s(): unsupported CAN protocol", caller); @@ -7687,6 +7746,9 @@ PyInit__socket(void) #ifdef CAN_ISOTP PyModule_AddIntMacro(m, CAN_ISOTP); #endif +#ifdef CAN_J1939 + PyModule_AddIntMacro(m, CAN_J1939); +#endif #endif #ifdef HAVE_LINUX_CAN_RAW_H PyModule_AddIntMacro(m, CAN_RAW_FILTER); @@ -7734,6 +7796,37 @@ PyInit__socket(void) PyModule_AddIntConstant(m, "CAN_BCM_CAN_FD_FRAME", CAN_FD_FRAME); #endif #endif +#ifdef HAVE_LINUX_CAN_J1939_H + PyModule_AddIntMacro(m, J1939_MAX_UNICAST_ADDR); + PyModule_AddIntMacro(m, J1939_IDLE_ADDR); + PyModule_AddIntMacro(m, J1939_NO_ADDR); + PyModule_AddIntMacro(m, J1939_NO_NAME); + PyModule_AddIntMacro(m, J1939_PGN_REQUEST); + PyModule_AddIntMacro(m, J1939_PGN_ADDRESS_CLAIMED); + PyModule_AddIntMacro(m, J1939_PGN_ADDRESS_COMMANDED); + PyModule_AddIntMacro(m, J1939_PGN_PDU1_MAX); + PyModule_AddIntMacro(m, J1939_PGN_MAX); + PyModule_AddIntMacro(m, J1939_NO_PGN); + + /* J1939 socket options */ + PyModule_AddIntMacro(m, SO_J1939_FILTER); + PyModule_AddIntMacro(m, SO_J1939_PROMISC); + PyModule_AddIntMacro(m, SO_J1939_SEND_PRIO); + PyModule_AddIntMacro(m, SO_J1939_ERRQUEUE); + + PyModule_AddIntMacro(m, SCM_J1939_DEST_ADDR); + PyModule_AddIntMacro(m, SCM_J1939_DEST_NAME); + PyModule_AddIntMacro(m, SCM_J1939_PRIO); + PyModule_AddIntMacro(m, SCM_J1939_ERRQUEUE); + + PyModule_AddIntMacro(m, J1939_NLA_PAD); + PyModule_AddIntMacro(m, J1939_NLA_BYTES_ACKED); + + PyModule_AddIntMacro(m, J1939_EE_INFO_NONE); + PyModule_AddIntMacro(m, J1939_EE_INFO_TX_ABORT); + + PyModule_AddIntMacro(m, J1939_FILTER_MAX); +#endif #ifdef SOL_RDS PyModule_AddIntMacro(m, SOL_RDS); #endif diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index 7684e59cd4546..ba2c9f5c31c3b 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -144,6 +144,10 @@ typedef int socklen_t; #include #endif +#ifdef HAVE_LINUX_CAN_J1939_H +#include +#endif + #ifdef HAVE_SYS_SYS_DOMAIN_H #include #endif diff --git a/configure b/configure index 29d5f4ce66735..a8a35d0defc6b 100755 --- a/configure +++ b/configure @@ -8282,8 +8282,8 @@ fi done -# On Linux, can.h and can/raw.h require sys/socket.h -for ac_header in linux/can.h linux/can/raw.h linux/can/bcm.h +# On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h +for ac_header in linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " diff --git a/configure.ac b/configure.ac index 240ddeb9b3d22..f996051efc719 100644 --- a/configure.ac +++ b/configure.ac @@ -2236,8 +2236,8 @@ AC_CHECK_HEADERS(linux/vm_sockets.h,,,[ #endif ]) -# On Linux, can.h and can/raw.h require sys/socket.h -AC_CHECK_HEADERS(linux/can.h linux/can/raw.h linux/can/bcm.h,,,[ +# On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h +AC_CHECK_HEADERS(linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h,,,[ #ifdef HAVE_SYS_SOCKET_H #include #endif diff --git a/pyconfig.h.in b/pyconfig.h.in index 76a10474208cf..75ac368aadafe 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -622,6 +622,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CAN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_CAN_J1939_H + /* Define if compiling using Linux 3.6 or later. */ #undef HAVE_LINUX_CAN_RAW_FD_FRAMES From webhook-mailer at python.org Wed Apr 29 18:53:37 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Wed, 29 Apr 2020 22:53:37 -0000 Subject: [Python-checkins] bpo-40334: Fix test_peg_parser to actually use the old parser (GH-19778) Message-ID: https://github.com/python/cpython/commit/69e802ed812e38cb68a4ab74af64b4f719b6cc78 commit: 69e802ed812e38cb68a4ab74af64b4f719b6cc78 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-29T23:53:30+01:00 summary: bpo-40334: Fix test_peg_parser to actually use the old parser (GH-19778) Now that the default parser is the new PEG parser, ast.parse uses it, which means that we don't actually test something in test_peg_parser. This commit introduces a new keyword argument (`oldparser`) for `_peg_parser.parse_string` for specifying that a string needs to be parsed with the old parser. This keyword argument is used in the tests to actually compare the ASTs the new parser generates with those generated by the old parser. files: M Lib/test/test_peg_parser.py M Modules/_peg_parser.c diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py index ea4afa6e17973..43d30bae84984 100644 --- a/Lib/test/test_peg_parser.py +++ b/Lib/test/test_peg_parser.py @@ -699,7 +699,7 @@ def test_correct_ast_generation_on_source_files(self) -> None: self.maxDiff = None for source in TEST_SOURCES: actual_ast = peg_parser.parse_string(source) - expected_ast = ast.parse(source) + expected_ast = peg_parser.parse_string(source, oldparser=True) self.assertEqual( ast.dump(actual_ast, include_attributes=True), ast.dump(expected_ast, include_attributes=True), @@ -721,12 +721,11 @@ def test_incorrect_ast_generation_with_specialized_errors(self) -> None: f"Actual error message does not match expexted for {source}" ) - @support.skip_if_new_parser("This tests nothing for now, since compile uses pegen as well") @unittest.expectedFailure def test_correct_but_known_to_fail_ast_generation_on_source_files(self) -> None: for source in GOOD_BUT_FAIL_SOURCES: actual_ast = peg_parser.parse_string(source) - expected_ast = ast.parse(source) + expected_ast = peg_parser.parse_string(source, oldparser=True) self.assertEqual( ast.dump(actual_ast, include_attributes=True), ast.dump(expected_ast, include_attributes=True), @@ -736,7 +735,7 @@ def test_correct_but_known_to_fail_ast_generation_on_source_files(self) -> None: def test_correct_ast_generation_without_pos_info(self) -> None: for source in GOOD_BUT_FAIL_SOURCES: actual_ast = peg_parser.parse_string(source) - expected_ast = ast.parse(source) + expected_ast = peg_parser.parse_string(source, oldparser=True) self.assertEqual( ast.dump(actual_ast), ast.dump(expected_ast), @@ -752,7 +751,7 @@ def test_fstring_parse_error_tracebacks(self) -> None: def test_correct_ast_generatrion_eval(self) -> None: for source in EXPRESSIONS_TEST_SOURCES: actual_ast = peg_parser.parse_string(source, mode='eval') - expected_ast = ast.parse(source, mode='eval') + expected_ast = peg_parser.parse_string(source, mode='eval', oldparser=True) self.assertEqual( ast.dump(actual_ast, include_attributes=True), ast.dump(expected_ast, include_attributes=True), diff --git a/Modules/_peg_parser.c b/Modules/_peg_parser.c index e1ec36e07bd57..59b80f9e06e9e 100644 --- a/Modules/_peg_parser.c +++ b/Modules/_peg_parser.c @@ -45,11 +45,13 @@ _Py_parse_file(PyObject *self, PyObject *args, PyObject *kwds) PyObject * _Py_parse_string(PyObject *self, PyObject *args, PyObject *kwds) { - static char *keywords[] = {"string", "mode", NULL}; + static char *keywords[] = {"string", "mode", "oldparser", NULL}; char *the_string; char *mode_str = "exec"; + int oldparser = 0; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|s", keywords, &the_string, &mode_str)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|sp", keywords, + &the_string, &mode_str, &oldparser)) { return NULL; } @@ -77,7 +79,13 @@ _Py_parse_string(PyObject *self, PyObject *args, PyObject *kwds) PyCompilerFlags flags = _PyCompilerFlags_INIT; flags.cf_flags = PyCF_IGNORE_COOKIE; - mod_ty res = PyPegen_ASTFromString(the_string, mode, &flags, arena); + mod_ty res; + if (oldparser) { + res = PyParser_ASTFromString(the_string, "", mode, &flags, arena); + } + else { + res = PyPegen_ASTFromString(the_string, mode, &flags, arena); + } if (res == NULL) { goto error; } From webhook-mailer at python.org Wed Apr 29 19:48:47 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Wed, 29 Apr 2020 23:48:47 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in tests (GH-19805) Message-ID: https://github.com/python/cpython/commit/57572b103ebd8732ac21922f0051a7f140d0e405 commit: 57572b103ebd8732ac21922f0051a7f140d0e405 branch: master author: Victor Stinner committer: GitHub date: 2020-04-30T01:48:37+02:00 summary: bpo-40443: Remove unused imports in tests (GH-19805) files: M Lib/test/test_parser.py M Lib/test/test_peg_parser.py M Lib/test/test_platform.py M Lib/test/test_positional_only_arg.py M Lib/test/test_pstats.py M Lib/test/test_re.py M Lib/test/test_regrtest.py M Lib/test/test_string_literals.py M Lib/test/test_support.py M Lib/test/test_syntax.py M Lib/test/test_tempfile.py M Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py M Lib/test/test_tools/test_lll.py M Lib/test/test_tools/test_pathfix.py M Lib/test/test_typing.py M Lib/test/test_unparse.py M Lib/test/test_uuid.py diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index fd33d6529b144..a4d2cdc090aa2 100644 --- a/Lib/test/test_parser.py +++ b/Lib/test/test_parser.py @@ -8,7 +8,6 @@ import unittest import operator import struct -import sys from test import support from test.support.script_helper import assert_python_failure from test.support.script_helper import assert_python_ok diff --git a/Lib/test/test_peg_parser.py b/Lib/test/test_peg_parser.py index 43d30bae84984..191494481eb0a 100644 --- a/Lib/test/test_peg_parser.py +++ b/Lib/test/test_peg_parser.py @@ -1,9 +1,6 @@ import ast -import os -import sys import _peg_parser as peg_parser import unittest -from pathlib import PurePath from typing import Any, Union, Iterable, Tuple from textwrap import dedent from test import support diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 998f1e0dc315a..7664b38a720a7 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -3,7 +3,6 @@ import subprocess import sys import unittest -import collections from unittest import mock from test import support diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py index 4d5fb6bc6112c..f7bd401804364 100644 --- a/Lib/test/test_positional_only_arg.py +++ b/Lib/test/test_positional_only_arg.py @@ -3,7 +3,6 @@ import dis import pickle import unittest -import sys from test.support import check_syntax_error, use_old_parser diff --git a/Lib/test/test_pstats.py b/Lib/test/test_pstats.py index f3a6e586c3bcc..10559deb6bcb2 100644 --- a/Lib/test/test_pstats.py +++ b/Lib/test/test_pstats.py @@ -5,7 +5,6 @@ from pstats import SortKey import pstats -import time import cProfile class AddCallersTestCase(unittest.TestCase): diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 4817d761a22df..1bfbcb853c4ed 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -2217,7 +2217,7 @@ def test_re_benchmarks(self): def test_re_tests(self): 're_tests test suite' - from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR + from test.re_tests import tests, FAIL, SYNTAX_ERROR for t in tests: pattern = s = outcome = repl = expected = None if len(t) == 5: diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 93f8d44ec6938..de209da41a34d 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -5,7 +5,6 @@ """ import contextlib -import faulthandler import glob import io import os.path diff --git a/Lib/test/test_string_literals.py b/Lib/test/test_string_literals.py index 5a2fb8b372f8c..5b5477d14d467 100644 --- a/Lib/test/test_string_literals.py +++ b/Lib/test/test_string_literals.py @@ -33,7 +33,7 @@ import tempfile import unittest import warnings -from test.support import check_syntax_warning, use_old_parser +from test.support import use_old_parser TEMPLATE = r"""# coding: %s diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 606e57003ed71..b5a16f9cb6027 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -1,4 +1,3 @@ -import contextlib import errno import importlib import io diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index aff8dd72b78d4..e7468cae7b132 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -644,7 +644,6 @@ """ import re -import sys import unittest from test import support diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index 69d5de2e1b95f..fcc706ede5aaa 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -4,7 +4,6 @@ import io import os import pathlib -import signal import sys import re import warnings diff --git a/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py b/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py index 56a1c9c612f72..b7f950f813976 100644 --- a/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py +++ b/Lib/test/test_tools/test_c_analyzer/test_parser/test_preprocessor.py @@ -1,4 +1,3 @@ -import itertools import textwrap import unittest import sys diff --git a/Lib/test/test_tools/test_lll.py b/Lib/test/test_tools/test_lll.py index b01e2188e1cf2..568cbfb5e4746 100644 --- a/Lib/test/test_tools/test_lll.py +++ b/Lib/test/test_tools/test_lll.py @@ -1,7 +1,6 @@ """Tests for the lll script in the Tools/script directory.""" import os -import sys import tempfile from test import support from test.test_tools import skip_if_missing, import_tool diff --git a/Lib/test/test_tools/test_pathfix.py b/Lib/test/test_tools/test_pathfix.py index ec361178e6d81..8b4193073408b 100644 --- a/Lib/test/test_tools/test_pathfix.py +++ b/Lib/test/test_tools/test_pathfix.py @@ -3,7 +3,7 @@ import sys import unittest from test import support -from test.test_tools import import_tool, scriptsdir, skip_if_missing +from test.test_tools import scriptsdir, skip_if_missing # need Tools/script/ directory: skip if run on Python installed on the system diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index f191d3bb9e90c..cab8de0f5efb2 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3,7 +3,7 @@ import pickle import re import sys -from unittest import TestCase, main, skipUnless, SkipTest, skip +from unittest import TestCase, main, skipUnless, skip from copy import copy, deepcopy from typing import Any, NoReturn diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index 3bacd672d4462..b913569585a21 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -6,7 +6,6 @@ import random import tokenize import ast -import sys def read_pyfile(filename): diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index 0b267f4a97861..ac166ced38afb 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -6,8 +6,6 @@ import io import os import pickle -import shutil -import subprocess import sys import weakref from unittest import mock From webhook-mailer at python.org Wed Apr 29 20:21:37 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 30 Apr 2020 00:21:37 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in tests (GH-19804) Message-ID: https://github.com/python/cpython/commit/b1e11c31c523dc082985e9de779ceeb47224e536 commit: b1e11c31c523dc082985e9de779ceeb47224e536 branch: master author: Victor Stinner committer: GitHub date: 2020-04-30T02:21:30+02:00 summary: bpo-40443: Remove unused imports in tests (GH-19804) files: M Lib/distutils/tests/test_build_clib.py M Lib/distutils/tests/test_config_cmd.py M Lib/distutils/tests/test_dist.py M Lib/distutils/tests/test_spawn.py M Lib/test/test_array.py M Lib/test/test_asyncio/test_base_events.py M Lib/test/test_asyncio/test_server.py M Lib/test/test_asyncio/test_sslproto.py M Lib/test/test_call.py M Lib/test/test_code.py M Lib/test/test_compileall.py M Lib/test/test_flufl.py M Lib/test/test_fractions.py M Lib/test/test_fstring.py M Lib/test/test_hashlib.py M Lib/test/test_ipaddress.py M Lib/test/test_logging.py M Lib/test/test_named_expressions.py diff --git a/Lib/distutils/tests/test_build_clib.py b/Lib/distutils/tests/test_build_clib.py index 85d09906f228d..abd8313770ef7 100644 --- a/Lib/distutils/tests/test_build_clib.py +++ b/Lib/distutils/tests/test_build_clib.py @@ -8,7 +8,6 @@ from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support -from distutils.spawn import find_executable class BuildCLibTestCase(support.TempdirManager, support.LoggingSilencer, diff --git a/Lib/distutils/tests/test_config_cmd.py b/Lib/distutils/tests/test_config_cmd.py index 8bd2c94237846..9aeab07b46836 100644 --- a/Lib/distutils/tests/test_config_cmd.py +++ b/Lib/distutils/tests/test_config_cmd.py @@ -39,7 +39,6 @@ def test_dump_file(self): @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") def test_search_cpp(self): - import shutil cmd = missing_compiler_executable(['preprocessor']) if cmd is not None: self.skipTest('The %r command is not found' % cmd) diff --git a/Lib/distutils/tests/test_dist.py b/Lib/distutils/tests/test_dist.py index cc34725a99efa..60956dadef234 100644 --- a/Lib/distutils/tests/test_dist.py +++ b/Lib/distutils/tests/test_dist.py @@ -8,7 +8,7 @@ from unittest import mock -from distutils.dist import Distribution, fix_help_options, DistributionMetadata +from distutils.dist import Distribution, fix_help_options from distutils.cmd import Command from test.support import ( diff --git a/Lib/distutils/tests/test_spawn.py b/Lib/distutils/tests/test_spawn.py index 73b0f5cb7324c..cf1faad5f4dd5 100644 --- a/Lib/distutils/tests/test_spawn.py +++ b/Lib/distutils/tests/test_spawn.py @@ -2,8 +2,7 @@ import os import stat import sys -import unittest -from unittest import mock +import unittest.mock from test.support import run_unittest, unix_shell from test import support as test_support diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 5f612fba8a497..f731b70415e7f 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -10,7 +10,6 @@ import operator import struct import sys -import warnings import array from array import _array_reconstructor as array_reconstructor diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 4adcbf46cc9eb..533d5cc7f5038 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -3,7 +3,6 @@ import concurrent.futures import errno import math -import os import socket import sys import threading diff --git a/Lib/test/test_asyncio/test_server.py b/Lib/test/test_asyncio/test_server.py index 006ead29562cf..2de4dcad17c8e 100644 --- a/Lib/test/test_asyncio/test_server.py +++ b/Lib/test/test_asyncio/test_server.py @@ -3,7 +3,6 @@ import threading import unittest -from test import support from test.support import socket_helper from test.test_asyncio import utils as test_utils from test.test_asyncio import functional as func_tests diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index c716eacfaf1c0..948820c82f3bf 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -2,7 +2,6 @@ import logging import socket -import sys from test import support import unittest import weakref diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py index b3077ad1d1cb8..451a7170c304d 100644 --- a/Lib/test/test_call.py +++ b/Lib/test/test_call.py @@ -1,4 +1,3 @@ -import datetime import unittest from test.support import cpython_only try: diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py index 7bb824ea31dac..ac3dde745603d 100644 --- a/Lib/test/test_code.py +++ b/Lib/test/test_code.py @@ -130,7 +130,6 @@ import threading import unittest import weakref -import opcode try: import ctypes except ImportError: diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index cb59fd71b3825..72678945089f2 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -11,7 +11,6 @@ import time import unittest import io -import errno from unittest import mock, skipUnless try: diff --git a/Lib/test/test_flufl.py b/Lib/test/test_flufl.py index b71442804c72b..22285859a92bb 100644 --- a/Lib/test/test_flufl.py +++ b/Lib/test/test_flufl.py @@ -1,6 +1,5 @@ import __future__ import unittest -import sys from test import support diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py index c748533c79129..0845f7921c39e 100644 --- a/Lib/test/test_fractions.py +++ b/Lib/test/test_fractions.py @@ -9,7 +9,6 @@ import functools import sys import unittest -import warnings from copy import copy, deepcopy from pickle import dumps, loads F = fractions.Fraction diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 4c240f34a3543..fe465b7e1d43d 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -10,9 +10,7 @@ import ast import types import decimal -import sys import unittest -from test import support a_global = 'global variable' diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index 31d8e5567639c..f9fe7e37920a3 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -8,7 +8,6 @@ import array from binascii import unhexlify -import functools import hashlib import importlib import itertools diff --git a/Lib/test/test_ipaddress.py b/Lib/test/test_ipaddress.py index bbb3fc89da653..6d5814c9774a0 100644 --- a/Lib/test/test_ipaddress.py +++ b/Lib/test/test_ipaddress.py @@ -7,7 +7,6 @@ import unittest import re import contextlib -import functools import operator import pickle import ipaddress diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index e1d0eb8145fe2..4cc45f7107115 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -36,7 +36,6 @@ import queue import random import re -import signal import socket import struct import sys diff --git a/Lib/test/test_named_expressions.py b/Lib/test/test_named_expressions.py index 3ae557f78d273..c813830ce6d3c 100644 --- a/Lib/test/test_named_expressions.py +++ b/Lib/test/test_named_expressions.py @@ -1,4 +1,3 @@ -import os import unittest GLOBAL_VAR = None From webhook-mailer at python.org Wed Apr 29 21:06:43 2020 From: webhook-mailer at python.org (Vlad Serebrennikov) Date: Thu, 30 Apr 2020 01:06:43 -0000 Subject: [Python-checkins] bpo-40389: Improve repr of typing.Optional (#19714) Message-ID: https://github.com/python/cpython/commit/138a9b9c2a394f30f222c23391f9515a7df9d809 commit: 138a9b9c2a394f30f222c23391f9515a7df9d809 branch: master author: Vlad Serebrennikov committer: GitHub date: 2020-04-29T18:06:39-07:00 summary: bpo-40389: Improve repr of typing.Optional (#19714) files: A Misc/NEWS.d/next/Library/2020-04-25-20-00-58.bpo-40389.FPA6f0.rst M Lib/test/test_dataclasses.py M Lib/test/test_typing.py M Lib/typing.py diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index e8fe455fc19b4..b20103bdce51c 100644 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -2028,7 +2028,7 @@ def test_docstring_one_field_with_default_none(self): class C: x: Union[int, type(None)] = None - self.assertDocStrEqual(C.__doc__, "C(x:Union[int, NoneType]=None)") + self.assertDocStrEqual(C.__doc__, "C(x:Optional[int]=None)") def test_docstring_list_field(self): @dataclass diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index cab8de0f5efb2..21bc7c81f2a30 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -1750,7 +1750,7 @@ def test_extended_generic_rules_repr(self): self.assertEqual(repr(Union[Tuple, Tuple[int]]).replace('typing.', ''), 'Union[Tuple, Tuple[int]]') self.assertEqual(repr(Callable[..., Optional[T]][int]).replace('typing.', ''), - 'Callable[..., Union[int, NoneType]]') + 'Callable[..., Optional[int]]') self.assertEqual(repr(Callable[[], List[T]][int]).replace('typing.', ''), 'Callable[[], List[int]]') diff --git a/Lib/typing.py b/Lib/typing.py index c82989861927d..f3cd280a09e27 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -691,6 +691,13 @@ def copy_with(self, params): return _GenericAlias(self.__origin__, params, name=self._name, inst=self._inst) def __repr__(self): + if (self.__origin__ == Union and len(self.__args__) == 2 + and type(None) in self.__args__): + if self.__args__[0] is not type(None): + arg = self.__args__[0] + else: + arg = self.__args__[1] + return (f'typing.Optional[{_type_repr(arg)}]') if (self._name != 'Callable' or len(self.__args__) == 2 and self.__args__[0] is Ellipsis): if self._name: diff --git a/Misc/NEWS.d/next/Library/2020-04-25-20-00-58.bpo-40389.FPA6f0.rst b/Misc/NEWS.d/next/Library/2020-04-25-20-00-58.bpo-40389.FPA6f0.rst new file mode 100644 index 0000000000000..e7a60a8d5f6f4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-25-20-00-58.bpo-40389.FPA6f0.rst @@ -0,0 +1 @@ +``repr()`` now returns ``typing.Optional[T]`` when called for ``typing.Union`` of two types, one of which is ``NoneType``. \ No newline at end of file From webhook-mailer at python.org Wed Apr 29 21:28:59 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 30 Apr 2020 01:28:59 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in idlelib (GH-19801) Message-ID: https://github.com/python/cpython/commit/6900f16d2207ca4fc252fa9d778ca0b13a3c95e0 commit: 6900f16d2207ca4fc252fa9d778ca0b13a3c95e0 branch: master author: Victor Stinner committer: GitHub date: 2020-04-29T21:28:51-04:00 summary: bpo-40443: Remove unused imports in idlelib (GH-19801) files: M Lib/idlelib/autocomplete_w.py M Lib/idlelib/config_key.py M Lib/idlelib/configdialog.py M Lib/idlelib/idle_test/test_sidebar.py M Lib/idlelib/idle_test/test_squeezer.py M Lib/idlelib/textview.py diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 0643c092c6e54..fe7a6be83d586 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -4,7 +4,7 @@ import platform from tkinter import * -from tkinter.ttk import Frame, Scrollbar +from tkinter.ttk import Scrollbar from idlelib.autocomplete import FILES, ATTRS from idlelib.multicall import MC_SHIFT diff --git a/Lib/idlelib/config_key.py b/Lib/idlelib/config_key.py index 4478323fcc2c5..7510aa9f3d878 100644 --- a/Lib/idlelib/config_key.py +++ b/Lib/idlelib/config_key.py @@ -1,7 +1,7 @@ """ Dialog for building Tkinter accelerator key bindings """ -from tkinter import Toplevel, Listbox, Text, StringVar, TclError +from tkinter import Toplevel, Listbox, StringVar, TclError from tkinter.ttk import Frame, Button, Checkbutton, Entry, Label, Scrollbar from tkinter import messagebox import string diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 9d5c2cde04b24..82596498d3461 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -11,7 +11,7 @@ """ import re -from tkinter import (Toplevel, Listbox, Text, Scale, Canvas, +from tkinter import (Toplevel, Listbox, Scale, Canvas, StringVar, BooleanVar, IntVar, TRUE, FALSE, TOP, BOTTOM, RIGHT, LEFT, SOLID, GROOVE, NONE, BOTH, X, Y, W, E, EW, NS, NSEW, NW, diff --git a/Lib/idlelib/idle_test/test_sidebar.py b/Lib/idlelib/idle_test/test_sidebar.py index 0f5b4c7122324..2974a9a7b0987 100644 --- a/Lib/idlelib/idle_test/test_sidebar.py +++ b/Lib/idlelib/idle_test/test_sidebar.py @@ -1,6 +1,5 @@ """Test sidebar, coverage 93%""" import idlelib.sidebar -from sys import platform from itertools import chain import unittest import unittest.mock diff --git a/Lib/idlelib/idle_test/test_squeezer.py b/Lib/idlelib/idle_test/test_squeezer.py index 1af2ce832845c..e3912f4bbbec8 100644 --- a/Lib/idlelib/idle_test/test_squeezer.py +++ b/Lib/idlelib/idle_test/test_squeezer.py @@ -1,6 +1,5 @@ "Test squeezer, coverage 95%" -from collections import namedtuple from textwrap import dedent from tkinter import Text, Tk import unittest diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py index 808a2aefab4f7..a66c1a4309a61 100644 --- a/Lib/idlelib/textview.py +++ b/Lib/idlelib/textview.py @@ -6,7 +6,6 @@ from tkinter.ttk import Frame, Scrollbar, Button from tkinter.messagebox import showerror -from functools import update_wrapper from idlelib.colorizer import color_config From webhook-mailer at python.org Wed Apr 29 21:46:02 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 30 Apr 2020 01:46:02 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in idlelib (GH-19801) Message-ID: https://github.com/python/cpython/commit/48ef06b62682c19b7860dcf5d9d610e589a49840 commit: 48ef06b62682c19b7860dcf5d9d610e589a49840 branch: 3.7 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-29T18:45:54-07:00 summary: bpo-40443: Remove unused imports in idlelib (GH-19801) (cherry picked from commit 6900f16d2207ca4fc252fa9d778ca0b13a3c95e0) Co-authored-by: Victor Stinner files: M Lib/idlelib/autocomplete_w.py M Lib/idlelib/config_key.py M Lib/idlelib/configdialog.py M Lib/idlelib/idle_test/test_sidebar.py M Lib/idlelib/idle_test/test_squeezer.py M Lib/idlelib/textview.py diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 0643c092c6e54..fe7a6be83d586 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -4,7 +4,7 @@ import platform from tkinter import * -from tkinter.ttk import Frame, Scrollbar +from tkinter.ttk import Scrollbar from idlelib.autocomplete import FILES, ATTRS from idlelib.multicall import MC_SHIFT diff --git a/Lib/idlelib/config_key.py b/Lib/idlelib/config_key.py index 4478323fcc2c5..7510aa9f3d878 100644 --- a/Lib/idlelib/config_key.py +++ b/Lib/idlelib/config_key.py @@ -1,7 +1,7 @@ """ Dialog for building Tkinter accelerator key bindings """ -from tkinter import Toplevel, Listbox, Text, StringVar, TclError +from tkinter import Toplevel, Listbox, StringVar, TclError from tkinter.ttk import Frame, Button, Checkbutton, Entry, Label, Scrollbar from tkinter import messagebox import string diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 9d5c2cde04b24..82596498d3461 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -11,7 +11,7 @@ """ import re -from tkinter import (Toplevel, Listbox, Text, Scale, Canvas, +from tkinter import (Toplevel, Listbox, Scale, Canvas, StringVar, BooleanVar, IntVar, TRUE, FALSE, TOP, BOTTOM, RIGHT, LEFT, SOLID, GROOVE, NONE, BOTH, X, Y, W, E, EW, NS, NSEW, NW, diff --git a/Lib/idlelib/idle_test/test_sidebar.py b/Lib/idlelib/idle_test/test_sidebar.py index 0f5b4c7122324..2974a9a7b0987 100644 --- a/Lib/idlelib/idle_test/test_sidebar.py +++ b/Lib/idlelib/idle_test/test_sidebar.py @@ -1,6 +1,5 @@ """Test sidebar, coverage 93%""" import idlelib.sidebar -from sys import platform from itertools import chain import unittest import unittest.mock diff --git a/Lib/idlelib/idle_test/test_squeezer.py b/Lib/idlelib/idle_test/test_squeezer.py index 1af2ce832845c..e3912f4bbbec8 100644 --- a/Lib/idlelib/idle_test/test_squeezer.py +++ b/Lib/idlelib/idle_test/test_squeezer.py @@ -1,6 +1,5 @@ "Test squeezer, coverage 95%" -from collections import namedtuple from textwrap import dedent from tkinter import Text, Tk import unittest diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py index 808a2aefab4f7..a66c1a4309a61 100644 --- a/Lib/idlelib/textview.py +++ b/Lib/idlelib/textview.py @@ -6,7 +6,6 @@ from tkinter.ttk import Frame, Scrollbar, Button from tkinter.messagebox import showerror -from functools import update_wrapper from idlelib.colorizer import color_config From webhook-mailer at python.org Wed Apr 29 21:47:55 2020 From: webhook-mailer at python.org (Miss Islington (bot)) Date: Thu, 30 Apr 2020 01:47:55 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in idlelib (GH-19801) Message-ID: https://github.com/python/cpython/commit/95e208dce505c542b8e4f8f42c57e6d4793b6895 commit: 95e208dce505c542b8e4f8f42c57e6d4793b6895 branch: 3.8 author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com> committer: GitHub date: 2020-04-29T18:47:50-07:00 summary: bpo-40443: Remove unused imports in idlelib (GH-19801) (cherry picked from commit 6900f16d2207ca4fc252fa9d778ca0b13a3c95e0) Co-authored-by: Victor Stinner files: M Lib/idlelib/autocomplete_w.py M Lib/idlelib/config_key.py M Lib/idlelib/configdialog.py M Lib/idlelib/idle_test/test_sidebar.py M Lib/idlelib/idle_test/test_squeezer.py M Lib/idlelib/textview.py diff --git a/Lib/idlelib/autocomplete_w.py b/Lib/idlelib/autocomplete_w.py index 0643c092c6e54..fe7a6be83d586 100644 --- a/Lib/idlelib/autocomplete_w.py +++ b/Lib/idlelib/autocomplete_w.py @@ -4,7 +4,7 @@ import platform from tkinter import * -from tkinter.ttk import Frame, Scrollbar +from tkinter.ttk import Scrollbar from idlelib.autocomplete import FILES, ATTRS from idlelib.multicall import MC_SHIFT diff --git a/Lib/idlelib/config_key.py b/Lib/idlelib/config_key.py index 4478323fcc2c5..7510aa9f3d878 100644 --- a/Lib/idlelib/config_key.py +++ b/Lib/idlelib/config_key.py @@ -1,7 +1,7 @@ """ Dialog for building Tkinter accelerator key bindings """ -from tkinter import Toplevel, Listbox, Text, StringVar, TclError +from tkinter import Toplevel, Listbox, StringVar, TclError from tkinter.ttk import Frame, Button, Checkbutton, Entry, Label, Scrollbar from tkinter import messagebox import string diff --git a/Lib/idlelib/configdialog.py b/Lib/idlelib/configdialog.py index 9d5c2cde04b24..82596498d3461 100644 --- a/Lib/idlelib/configdialog.py +++ b/Lib/idlelib/configdialog.py @@ -11,7 +11,7 @@ """ import re -from tkinter import (Toplevel, Listbox, Text, Scale, Canvas, +from tkinter import (Toplevel, Listbox, Scale, Canvas, StringVar, BooleanVar, IntVar, TRUE, FALSE, TOP, BOTTOM, RIGHT, LEFT, SOLID, GROOVE, NONE, BOTH, X, Y, W, E, EW, NS, NSEW, NW, diff --git a/Lib/idlelib/idle_test/test_sidebar.py b/Lib/idlelib/idle_test/test_sidebar.py index 0f5b4c7122324..2974a9a7b0987 100644 --- a/Lib/idlelib/idle_test/test_sidebar.py +++ b/Lib/idlelib/idle_test/test_sidebar.py @@ -1,6 +1,5 @@ """Test sidebar, coverage 93%""" import idlelib.sidebar -from sys import platform from itertools import chain import unittest import unittest.mock diff --git a/Lib/idlelib/idle_test/test_squeezer.py b/Lib/idlelib/idle_test/test_squeezer.py index 1af2ce832845c..e3912f4bbbec8 100644 --- a/Lib/idlelib/idle_test/test_squeezer.py +++ b/Lib/idlelib/idle_test/test_squeezer.py @@ -1,6 +1,5 @@ "Test squeezer, coverage 95%" -from collections import namedtuple from textwrap import dedent from tkinter import Text, Tk import unittest diff --git a/Lib/idlelib/textview.py b/Lib/idlelib/textview.py index 808a2aefab4f7..a66c1a4309a61 100644 --- a/Lib/idlelib/textview.py +++ b/Lib/idlelib/textview.py @@ -6,7 +6,6 @@ from tkinter.ttk import Frame, Scrollbar, Button from tkinter.messagebox import showerror -from functools import update_wrapper from idlelib.colorizer import color_config From webhook-mailer at python.org Wed Apr 29 23:42:52 2020 From: webhook-mailer at python.org (lrjball) Date: Thu, 30 Apr 2020 03:42:52 -0000 Subject: [Python-checkins] bpo-40394 - difflib.SequenceMatched.find_longest_match default args (GH-19742) Message-ID: https://github.com/python/cpython/commit/3209cbd99b6d65aa18b3beb124fac9c792b8993d commit: 3209cbd99b6d65aa18b3beb124fac9c792b8993d branch: master author: lrjball <50599110+lrjball at users.noreply.github.com> committer: GitHub date: 2020-04-29T22:42:45-05:00 summary: bpo-40394 - difflib.SequenceMatched.find_longest_match default args (GH-19742) * bpo-40394 - difflib.SequenceMatched.find_longest_match default args Added default args to find_longest_match, as well as related tests. files: A Misc/NEWS.d/next/Library/2020-04-28-18-59-48.bpo-40394.Yi5uuM.rst M Doc/library/difflib.rst M Lib/difflib.py M Lib/test/test_difflib.py M Misc/ACKS diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index ada311bc3a205..7a898c21b52e0 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -421,7 +421,7 @@ The :class:`SequenceMatcher` class has this constructor: is not changed. - .. method:: find_longest_match(alo, ahi, blo, bhi) + .. method:: find_longest_match(alo=0, ahi=None, blo=0, bhi=None) Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``. @@ -458,6 +458,9 @@ The :class:`SequenceMatcher` class has this constructor: This method returns a :term:`named tuple` ``Match(a, b, size)``. + .. versionchanged:: 3.9 + Added default arguments. + .. method:: get_matching_blocks() diff --git a/Lib/difflib.py b/Lib/difflib.py index f2215d8d4561c..0dda80d387573 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -130,7 +130,7 @@ class SequenceMatcher: set_seq2(b) Set the second sequence to be compared. - find_longest_match(alo, ahi, blo, bhi) + find_longest_match(alo=0, ahi=None, blo=0, bhi=None) Find longest matching block in a[alo:ahi] and b[blo:bhi]. get_matching_blocks() @@ -334,9 +334,11 @@ def __chain_b(self): for elt in popular: # ditto; as fast for 1% deletion del b2j[elt] - def find_longest_match(self, alo, ahi, blo, bhi): + def find_longest_match(self, alo=0, ahi=None, blo=0, bhi=None): """Find longest matching block in a[alo:ahi] and b[blo:bhi]. + By default it will find the longest match in the entirety of a and b. + If isjunk is not defined: Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where @@ -391,6 +393,10 @@ def find_longest_match(self, alo, ahi, blo, bhi): # the unique 'b's and then matching the first two 'a's. a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.bjunk.__contains__ + if ahi is None: + ahi = len(a) + if bhi is None: + bhi = len(b) besti, bestj, bestsize = alo, blo, 0 # find longest junk-free match # during an iteration of the loop, j2len[j] = length of longest diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py index 5e2ca1a23b928..42ac1fdcd81cd 100644 --- a/Lib/test/test_difflib.py +++ b/Lib/test/test_difflib.py @@ -501,12 +501,58 @@ def test_is_character_junk_false(self): for char in ['a', '#', '\n', '\f', '\r', '\v']: self.assertFalse(difflib.IS_CHARACTER_JUNK(char), repr(char)) +class TestFindLongest(unittest.TestCase): + def longer_match_exists(self, a, b, n): + return any(b_part in a for b_part in + [b[i:i + n + 1] for i in range(0, len(b) - n - 1)]) + + def test_default_args(self): + a = 'foo bar' + b = 'foo baz bar' + sm = difflib.SequenceMatcher(a=a, b=b) + match = sm.find_longest_match() + self.assertEqual(match.a, 0) + self.assertEqual(match.b, 0) + self.assertEqual(match.size, 6) + self.assertEqual(a[match.a: match.a + match.size], + b[match.b: match.b + match.size]) + self.assertFalse(self.longer_match_exists(a, b, match.size)) + + match = sm.find_longest_match(alo=2, blo=4) + self.assertEqual(match.a, 3) + self.assertEqual(match.b, 7) + self.assertEqual(match.size, 4) + self.assertEqual(a[match.a: match.a + match.size], + b[match.b: match.b + match.size]) + self.assertFalse(self.longer_match_exists(a[2:], b[4:], match.size)) + + match = sm.find_longest_match(bhi=5, blo=1) + self.assertEqual(match.a, 1) + self.assertEqual(match.b, 1) + self.assertEqual(match.size, 4) + self.assertEqual(a[match.a: match.a + match.size], + b[match.b: match.b + match.size]) + self.assertFalse(self.longer_match_exists(a, b[1:5], match.size)) + + def test_longest_match_with_popular_chars(self): + a = 'dabcd' + b = 'd'*100 + 'abc' + 'd'*100 # length over 200 so popular used + sm = difflib.SequenceMatcher(a=a, b=b) + match = sm.find_longest_match(0, len(a), 0, len(b)) + self.assertEqual(match.a, 0) + self.assertEqual(match.b, 99) + self.assertEqual(match.size, 5) + self.assertEqual(a[match.a: match.a + match.size], + b[match.b: match.b + match.size]) + self.assertFalse(self.longer_match_exists(a, b, match.size)) + + def test_main(): difflib.HtmlDiff._default_prefix = 0 Doctests = doctest.DocTestSuite(difflib) run_unittest( TestWithAscii, TestAutojunk, TestSFpatches, TestSFbugs, - TestOutputFormat, TestBytes, TestJunkAPIs, Doctests) + TestOutputFormat, TestBytes, TestJunkAPIs, TestFindLongest, Doctests) if __name__ == '__main__': test_main() diff --git a/Misc/ACKS b/Misc/ACKS index 89f37e584ef8b..21822dd7524cf 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -88,6 +88,7 @@ Dwayne Bailey Stig Bakken Aleksandr Balezin Greg Ball +Lewis Ball Luigi Ballabio Thomas Ballinger Jeff Balogh diff --git a/Misc/NEWS.d/next/Library/2020-04-28-18-59-48.bpo-40394.Yi5uuM.rst b/Misc/NEWS.d/next/Library/2020-04-28-18-59-48.bpo-40394.Yi5uuM.rst new file mode 100644 index 0000000000000..ef2e239b1e678 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-28-18-59-48.bpo-40394.Yi5uuM.rst @@ -0,0 +1 @@ +Added default arguments to :meth:`difflib.SequenceMatcher.find_longest_match()`. \ No newline at end of file From webhook-mailer at python.org Thu Apr 30 05:26:41 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 30 Apr 2020 09:26:41 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in the stdlib (GH-19803) Message-ID: https://github.com/python/cpython/commit/90549676e063c2c818cfc14213d3adb7edcc2bd5 commit: 90549676e063c2c818cfc14213d3adb7edcc2bd5 branch: master author: Victor Stinner committer: GitHub date: 2020-04-30T11:26:33+02:00 summary: bpo-40443: Remove unused imports in the stdlib (GH-19803) files: M Lib/asyncio/events.py M Lib/asyncio/sslproto.py M Lib/bz2.py M Lib/concurrent/futures/process.py M Lib/concurrent/futures/thread.py M Lib/ctypes/test/test_loading.py M Lib/modulefinder.py M Lib/plistlib.py M Lib/xml/dom/xmlbuilder.py M Lib/zipfile.py diff --git a/Lib/asyncio/events.py b/Lib/asyncio/events.py index 16a6cfd438bdc..70017cb86a059 100644 --- a/Lib/asyncio/events.py +++ b/Lib/asyncio/events.py @@ -19,7 +19,6 @@ import threading from . import format_helpers -from . import exceptions class Handle: diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 3eca6b4a39128..cad25b26539f5 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -5,7 +5,6 @@ except ImportError: # pragma: no cover ssl = None -from . import base_events from . import constants from . import protocols from . import transports diff --git a/Lib/bz2.py b/Lib/bz2.py index e094fbb548bc9..ce07ebeb142d9 100644 --- a/Lib/bz2.py +++ b/Lib/bz2.py @@ -12,7 +12,6 @@ from builtins import open as _builtin_open import io import os -import warnings import _compression from threading import RLock diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index a76e2c9cf231a..90bc98bf2ecd1 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -45,7 +45,6 @@ __author__ = 'Brian Quinlan (brian at sweetapp.com)' -import atexit import os from concurrent.futures import _base import queue diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread.py index 2810b357bc1e1..b7a2cac7f5701 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -5,7 +5,6 @@ __author__ = 'Brian Quinlan (brian at sweetapp.com)' -import atexit from concurrent.futures import _base import itertools import queue diff --git a/Lib/ctypes/test/test_loading.py b/Lib/ctypes/test/test_loading.py index 5c48b0db4c393..ba655bceb8b21 100644 --- a/Lib/ctypes/test/test_loading.py +++ b/Lib/ctypes/test/test_loading.py @@ -3,7 +3,6 @@ import shutil import subprocess import sys -import sysconfig import unittest import test.support from ctypes.util import find_library diff --git a/Lib/modulefinder.py b/Lib/modulefinder.py index aadcd23edbaaa..cb455f40c4d78 100644 --- a/Lib/modulefinder.py +++ b/Lib/modulefinder.py @@ -7,8 +7,6 @@ import os import io import sys -import types -import warnings LOAD_CONST = dis.opmap['LOAD_CONST'] diff --git a/Lib/plistlib.py b/Lib/plistlib.py index a84bb57371ef6..aff5fe36ca38b 100644 --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -51,7 +51,6 @@ import binascii import codecs -import contextlib import datetime import enum from io import BytesIO @@ -59,7 +58,6 @@ import os import re import struct -from warnings import warn from xml.parsers.expat import ParserCreate diff --git a/Lib/xml/dom/xmlbuilder.py b/Lib/xml/dom/xmlbuilder.py index 213ab14551c67..8a200263497b8 100644 --- a/Lib/xml/dom/xmlbuilder.py +++ b/Lib/xml/dom/xmlbuilder.py @@ -1,7 +1,6 @@ """Implementation of the DOM Level 3 'LS-Load' feature.""" import copy -import warnings import xml.dom from xml.dom.NodeFilter import NodeFilter diff --git a/Lib/zipfile.py b/Lib/zipfile.py index c3f814cc747e0..8903d6a42ee4e 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -4,7 +4,6 @@ XXX references to utf-8 need further investigation. """ import binascii -import functools import importlib.util import io import itertools From webhook-mailer at python.org Thu Apr 30 05:28:14 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 30 Apr 2020 09:28:14 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in distutils (GH-19802) Message-ID: https://github.com/python/cpython/commit/e488e300f5c01289c10906c2e53a8e43d6de32d8 commit: e488e300f5c01289c10906c2e53a8e43d6de32d8 branch: master author: Victor Stinner committer: GitHub date: 2020-04-30T11:28:09+02:00 summary: bpo-40443: Remove unused imports in distutils (GH-19802) files: M Lib/distutils/_msvccompiler.py M Lib/distutils/bcppcompiler.py M Lib/distutils/ccompiler.py M Lib/distutils/command/bdist_rpm.py M Lib/distutils/command/bdist_wininst.py M Lib/distutils/command/check.py M Lib/distutils/command/upload.py M Lib/distutils/cygwinccompiler.py M Lib/distutils/msvc9compiler.py M Lib/distutils/msvccompiler.py M Lib/distutils/sysconfig.py diff --git a/Lib/distutils/_msvccompiler.py b/Lib/distutils/_msvccompiler.py index 03a5986d984dc..af8099a407819 100644 --- a/Lib/distutils/_msvccompiler.py +++ b/Lib/distutils/_msvccompiler.py @@ -14,8 +14,6 @@ # ported to VS 2015 by Steve Dower import os -import shutil -import stat import subprocess import winreg @@ -65,8 +63,6 @@ def _find_vc2017(): If vswhere.exe is not available, by definition, VS 2017 is not installed. """ - import json - root = os.environ.get("ProgramFiles(x86)") or os.environ.get("ProgramFiles") if not root: return None, None diff --git a/Lib/distutils/bcppcompiler.py b/Lib/distutils/bcppcompiler.py index 9f4c432d90e77..071fea5d038cb 100644 --- a/Lib/distutils/bcppcompiler.py +++ b/Lib/distutils/bcppcompiler.py @@ -14,10 +14,10 @@ import os from distutils.errors import \ - DistutilsExecError, DistutilsPlatformError, \ + DistutilsExecError, \ CompileError, LibError, LinkError, UnknownFileError from distutils.ccompiler import \ - CCompiler, gen_preprocess_options, gen_lib_options + CCompiler, gen_preprocess_options from distutils.file_util import write_file from distutils.dep_util import newer from distutils import log diff --git a/Lib/distutils/ccompiler.py b/Lib/distutils/ccompiler.py index 4cfc6c7065e92..b5ef143e72c56 100644 --- a/Lib/distutils/ccompiler.py +++ b/Lib/distutils/ccompiler.py @@ -8,7 +8,7 @@ from distutils.spawn import spawn from distutils.file_util import move_file from distutils.dir_util import mkpath -from distutils.dep_util import newer_pairwise, newer_group +from distutils.dep_util import newer_group from distutils.util import split_quoted, execute from distutils import log diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index 74381cc69a6ce..550cbfa1e28a2 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -6,7 +6,6 @@ import subprocess, sys, os from distutils.core import Command from distutils.debug import DEBUG -from distutils.util import get_platform from distutils.file_util import write_file from distutils.errors import * from distutils.sysconfig import get_python_version diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py index b5ed6f041e19a..0e9ddaa21419e 100644 --- a/Lib/distutils/command/bdist_wininst.py +++ b/Lib/distutils/command/bdist_wininst.py @@ -8,7 +8,7 @@ import warnings from distutils.core import Command from distutils.util import get_platform -from distutils.dir_util import create_tree, remove_tree +from distutils.dir_util import remove_tree from distutils.errors import * from distutils.sysconfig import get_python_version from distutils import log diff --git a/Lib/distutils/command/check.py b/Lib/distutils/command/check.py index 7ceabd3adf22d..ada250064678e 100644 --- a/Lib/distutils/command/check.py +++ b/Lib/distutils/command/check.py @@ -11,7 +11,6 @@ from docutils.parsers.rst import Parser from docutils import frontend from docutils import nodes - from io import StringIO class SilentReporter(Reporter): diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py index 11afa24b777a1..d822ba01338af 100644 --- a/Lib/distutils/command/upload.py +++ b/Lib/distutils/command/upload.py @@ -7,7 +7,6 @@ import os import io -import platform import hashlib from base64 import standard_b64encode from urllib.request import urlopen, Request, HTTPError diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py index 6c5d77746b6f5..66c12dd35830b 100644 --- a/Lib/distutils/cygwinccompiler.py +++ b/Lib/distutils/cygwinccompiler.py @@ -51,12 +51,10 @@ from subprocess import Popen, PIPE, check_output import re -from distutils.ccompiler import gen_preprocess_options, gen_lib_options from distutils.unixccompiler import UnixCCompiler from distutils.file_util import write_file from distutils.errors import (DistutilsExecError, CCompilerError, CompileError, UnknownFileError) -from distutils import log from distutils.version import LooseVersion from distutils.spawn import find_executable diff --git a/Lib/distutils/msvc9compiler.py b/Lib/distutils/msvc9compiler.py index 4c0036a0f1330..6934e964abd69 100644 --- a/Lib/distutils/msvc9compiler.py +++ b/Lib/distutils/msvc9compiler.py @@ -19,8 +19,7 @@ from distutils.errors import DistutilsExecError, DistutilsPlatformError, \ CompileError, LibError, LinkError -from distutils.ccompiler import CCompiler, gen_preprocess_options, \ - gen_lib_options +from distutils.ccompiler import CCompiler, gen_lib_options from distutils import log from distutils.util import get_platform diff --git a/Lib/distutils/msvccompiler.py b/Lib/distutils/msvccompiler.py index d1de2fbfcb947..d5857cb1ffe42 100644 --- a/Lib/distutils/msvccompiler.py +++ b/Lib/distutils/msvccompiler.py @@ -13,7 +13,7 @@ DistutilsExecError, DistutilsPlatformError, \ CompileError, LibError, LinkError from distutils.ccompiler import \ - CCompiler, gen_preprocess_options, gen_lib_options + CCompiler, gen_lib_options from distutils import log _can_read_reg = False diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 01ee519792932..37feae5df72c9 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -15,7 +15,6 @@ import sys from .errors import DistutilsPlatformError -from .util import get_platform, get_host_platform # These are needed in a couple of spots, so just compute them once. PREFIX = os.path.normpath(sys.prefix) From webhook-mailer at python.org Thu Apr 30 06:39:17 2020 From: webhook-mailer at python.org (Jelle Zijlstra) Date: Thu, 30 Apr 2020 10:39:17 -0000 Subject: [Python-checkins] compileall: Fix typos in docstring (GH-19810) Message-ID: https://github.com/python/cpython/commit/efb8dd5b3ec91f7d9458d3f203d748604d52b121 commit: efb8dd5b3ec91f7d9458d3f203d748604d52b121 branch: master author: Jelle Zijlstra committer: GitHub date: 2020-04-30T16:09:11+05:30 summary: compileall: Fix typos in docstring (GH-19810) files: M Lib/compileall.py diff --git a/Lib/compileall.py b/Lib/compileall.py index 1831ad749f2b1..abe6cffce59c5 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -66,7 +66,7 @@ def compile_dir(dir, maxlevels=None, ddir=None, force=False, workers: maximum number of parallel workers invalidation_mode: how the up-to-dateness of the pyc will be checked stripdir: part of path to left-strip from source file path - prependdir: path to prepend to beggining of original file path, applied + prependdir: path to prepend to beginning of original file path, applied after stripdir limit_sl_dest: ignore symlinks if they are pointing outside of the defined path @@ -136,7 +136,7 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, files each with one optimization level. invalidation_mode: how the up-to-dateness of the pyc will be checked stripdir: part of path to left-strip from source file path - prependdir: path to prepend to beggining of original file path, applied + prependdir: path to prepend to beginning of original file path, applied after stripdir limit_sl_dest: ignore symlinks if they are pointing outside of the defined path. From webhook-mailer at python.org Thu Apr 30 15:12:34 2020 From: webhook-mailer at python.org (Guido van Rossum) Date: Thu, 30 Apr 2020 19:12:34 -0000 Subject: [Python-checkins] bpo-40334: Support type comments (GH-19780) Message-ID: https://github.com/python/cpython/commit/c001c09e9059ba04bc088349cd87a1374dc0754f commit: c001c09e9059ba04bc088349cd87a1374dc0754f branch: master author: Guido van Rossum committer: GitHub date: 2020-04-30T12:12:19-07:00 summary: bpo-40334: Support type comments (GH-19780) This implements full support for # type: comments, # type: ignore comments, and the func_type parsing mode for ast.parse() and compile(). Closes https://github.com/we-like-parsers/cpython/issues/95. (For now, you need to use the master branch of mypy, since another issue unique to 3.9 had to be fixed there, and there's no mypy release yet.) The only thing missing is `feature_version=N`, which is being tracked in https://github.com/we-like-parsers/cpython/issues/124. files: M Grammar/python.gram M Lib/test/test_type_comments.py M Parser/pegen/parse.c M Parser/pegen/pegen.c M Parser/pegen/pegen.h M Python/bltinmodule.c diff --git a/Grammar/python.gram b/Grammar/python.gram index 0ff2dcca884f1..e1164d990aaa4 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -17,6 +17,8 @@ _PyPegen_parse(Parser *p) result = interactive_rule(p); } else if (p->start_rule == Py_eval_input) { result = eval_rule(p); + } else if (p->start_rule == Py_func_type_input) { + result = func_type_rule(p); } else if (p->start_rule == Py_fstring_input) { result = fstring_rule(p); } @@ -26,11 +28,20 @@ _PyPegen_parse(Parser *p) // The end ''' -file[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } +file[mod_ty]: a=[statements] ENDMARKER { _PyPegen_make_module(p, a) } interactive[mod_ty]: a=statement_newline { Interactive(a, p->arena) } eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { Expression(a, p->arena) } +func_type[mod_ty]: '(' a=[type_expressions] ')' '->' b=expression NEWLINE* ENDMARKER { FunctionType(a, b, p->arena) } fstring[expr_ty]: star_expressions +# type_expressions allow */** but ignore them +type_expressions[asdl_seq*]: + | a=','.expression+ ',' '*' b=expression ',' '**' c=expression { + _PyPegen_seq_append_to_end(p, CHECK(_PyPegen_seq_append_to_end(p, a, b)), c) } + | a=','.expression+ ',' '*' b=expression { _PyPegen_seq_append_to_end(p, a, b) } + | a=','.expression+ ',' '**' b=expression { _PyPegen_seq_append_to_end(p, a, b) } + | ','.expression+ + statements[asdl_seq*]: a=statement+ { _PyPegen_seq_flatten(p, a) } statement[asdl_seq*]: a=compound_stmt { _PyPegen_singleton_seq(p, a) } | simple_stmt statement_newline[asdl_seq*]: @@ -73,8 +84,8 @@ assignment: | a=('(' b=inside_paren_ann_assign_target ')' { b } | ann_assign_subscript_attribute_target) ':' b=expression c=['=' d=annotated_rhs { d }] { _Py_AnnAssign(a, b, c, 0, EXTRA)} - | a=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) { - _Py_Assign(a, b, NULL, EXTRA) } + | a=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) tc=[TYPE_COMMENT] { + _Py_Assign(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } | a=target b=augassign c=(yield_expr | star_expressions) { _Py_AugAssign(a, b->kind, c, EXTRA) } | invalid_assignment @@ -145,14 +156,14 @@ while_stmt[stmt_ty]: | 'while' a=named_expression ':' b=block c=[else_block] { _Py_While(a, b, c, EXTRA) } for_stmt[stmt_ty]: - | is_async=[ASYNC] 'for' t=star_targets 'in' ex=star_expressions ':' b=block el=[else_block] { - (is_async ? _Py_AsyncFor : _Py_For)(t, ex, b, el, NULL, EXTRA) } + | is_async=[ASYNC] 'for' t=star_targets 'in' ex=star_expressions ':' tc=[TYPE_COMMENT] b=block el=[else_block] { + (is_async ? _Py_AsyncFor : _Py_For)(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA) } with_stmt[stmt_ty]: | is_async=[ASYNC] 'with' '(' a=','.with_item+ ')' ':' b=block { (is_async ? _Py_AsyncWith : _Py_With)(a, b, NULL, EXTRA) } - | is_async=[ASYNC] 'with' a=','.with_item+ ':' b=block { - (is_async ? _Py_AsyncWith : _Py_With)(a, b, NULL, EXTRA) } + | is_async=[ASYNC] 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { + (is_async ? _Py_AsyncWith : _Py_With)(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } with_item[withitem_ty]: | e=expression o=['as' t=target { t }] { _Py_withitem(e, o, p->arena) } @@ -177,43 +188,74 @@ function_def[stmt_ty]: | function_def_raw function_def_raw[stmt_ty]: - | is_async=[ASYNC] 'def' n=NAME '(' params=[params] ')' a=['->' z=annotation { z }] ':' b=block { + | is_async=[ASYNC] 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] ':' tc=[func_type_comment] b=block { (is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef)(n->v.Name.id, (params) ? params : CHECK(_PyPegen_empty_arguments(p)), - b, NULL, a, NULL, EXTRA) } + b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) } +func_type_comment[PyObject*]: + | NEWLINE t=TYPE_COMMENT &(NEWLINE INDENT) { t } # Must be followed by indented block + | invalid_double_type_comments + | TYPE_COMMENT params[arguments_ty]: | invalid_parameters | parameters + parameters[arguments_ty]: - | a=slash_without_default b=[',' x=plain_names { x }] c=[',' y=names_with_default { y }] d=[',' z=[star_etc] { z }] { + | a=slash_no_default b=param_no_default* c=param_with_default* d=[star_etc] { _PyPegen_make_arguments(p, a, NULL, b, c, d) } - | a=slash_with_default b=[',' y=names_with_default { y }] c=[',' z=[star_etc] { z }] { + | a=slash_with_default b=param_with_default* c=[star_etc] { _PyPegen_make_arguments(p, NULL, a, NULL, b, c) } - | a=plain_names b=[',' y=names_with_default { y }] c=[',' z=[star_etc] { z }] { + | a=param_no_default+ b=param_with_default* c=[star_etc] { _PyPegen_make_arguments(p, NULL, NULL, a, b, c) } - | a=names_with_default b=[',' z=[star_etc] { z }] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)} + | a=param_with_default+ b=[star_etc] { _PyPegen_make_arguments(p, NULL, NULL, NULL, a, b)} | a=star_etc { _PyPegen_make_arguments(p, NULL, NULL, NULL, NULL, a) } -slash_without_default[asdl_seq*]: a=plain_names ',' '/' { a } -slash_with_default[SlashWithDefault*]: a=[n=plain_names ',' { n }] b=names_with_default ',' '/' { - _PyPegen_slash_with_default(p, a, b) } + +# Some duplication here because we can't write (',' | &')'), +# which is because we don't support empty alternatives (yet). +# +slash_no_default[asdl_seq*]: + | a=param_no_default+ '/' ',' { a } + | a=param_no_default+ '/' &')' { a } +slash_with_default[SlashWithDefault*]: + | a=param_no_default* b=param_with_default+ '/' ',' { _PyPegen_slash_with_default(p, a, b) } + | a=param_no_default* b=param_with_default+ '/' &')' { _PyPegen_slash_with_default(p, a, b) } + star_etc[StarEtc*]: - | '*' a=plain_name b=name_with_optional_default* c=[',' d=kwds { d }] [','] { + | '*' a=param_no_default b=param_maybe_default* c=[kwds] { _PyPegen_star_etc(p, a, b, c) } - | '*' b=name_with_optional_default+ c=[',' d=kwds { d }] [','] { + | '*' ',' b=param_maybe_default+ c=[kwds] { _PyPegen_star_etc(p, NULL, b, c) } - | a=kwds [','] { _PyPegen_star_etc(p, NULL, NULL, a) } -name_with_optional_default[NameDefaultPair*]: - | ',' a=plain_name b=['=' e=expression { e }] { _PyPegen_name_default_pair(p, a, b) } -names_with_default[asdl_seq*]: a=','.name_with_default+ { a } -name_with_default[NameDefaultPair*]: - | n=plain_name '=' e=expression { _PyPegen_name_default_pair(p, n, e) } -plain_names[asdl_seq*] (memo): a=','.(plain_name !'=')+ { a } -plain_name[arg_ty]: - | a=NAME b=[':' z=annotation { z }] { _Py_arg(a->v.Name.id, b, NULL, EXTRA) } + | a=kwds { _PyPegen_star_etc(p, NULL, NULL, a) } + kwds[arg_ty]: - | '**' a=plain_name { a } -annotation[expr_ty]: expression + | '**' a=param_no_default { a } + +# One parameter. This *includes* a following comma and type comment. +# +# There are three styles: +# - No default +# - With default +# - Maybe with default +# +# There are two alternative forms of each, to deal with type comments: +# - Ends in a comma followed by an optional type comment +# - No comma, optional type comment, must be followed by close paren +# The latter form is for a final parameter without trailing comma. +# +param_no_default[arg_ty]: + | a=param ',' tc=TYPE_COMMENT? { _PyPegen_add_type_comment_to_arg(p, a, tc) } + | a=param tc=TYPE_COMMENT? &')' { _PyPegen_add_type_comment_to_arg(p, a, tc) } +param_with_default[NameDefaultPair*]: + | a=param c=default ',' tc=TYPE_COMMENT? { _PyPegen_name_default_pair(p, a, c, tc) } + | a=param c=default tc=TYPE_COMMENT? &')' { _PyPegen_name_default_pair(p, a, c, tc) } +param_maybe_default[NameDefaultPair*]: + | a=param c=default? ',' tc=TYPE_COMMENT? { _PyPegen_name_default_pair(p, a, c, tc) } + | a=param c=default? tc=TYPE_COMMENT? &')' { _PyPegen_name_default_pair(p, a, c, tc) } +param[arg_ty]: a=NAME b=annotation? { _Py_arg(a->v.Name.id, b, NULL, EXTRA) } + +annotation[expr_ty]: ':' a=expression { a } +default[expr_ty]: '=' a=expression { a } decorators[asdl_seq*]: a=('@' f=named_expression NEWLINE { f })+ { a } @@ -284,10 +326,10 @@ lambda_star_etc[StarEtc*]: _PyPegen_star_etc(p, NULL, b, c) } | a=lambda_kwds [','] { _PyPegen_star_etc(p, NULL, NULL, a) } lambda_name_with_optional_default[NameDefaultPair*]: - | ',' a=lambda_plain_name b=['=' e=expression { e }] { _PyPegen_name_default_pair(p, a, b) } + | ',' a=lambda_plain_name b=['=' e=expression { e }] { _PyPegen_name_default_pair(p, a, b, NULL) } lambda_names_with_default[asdl_seq*]: a=','.lambda_name_with_default+ { a } lambda_name_with_default[NameDefaultPair*]: - | n=lambda_plain_name '=' e=expression { _PyPegen_name_default_pair(p, n, e) } + | n=lambda_plain_name '=' e=expression { _PyPegen_name_default_pair(p, n, e, NULL) } lambda_plain_names[asdl_seq*]: a=','.(lambda_plain_name !'=')+ { a } lambda_plain_name[arg_ty]: a=NAME { _Py_arg(a->v.Name.id, NULL, NULL, EXTRA) } lambda_kwds[arg_ty]: '**' a=lambda_plain_name { a } @@ -552,5 +594,8 @@ invalid_comprehension: | ('[' | '(' | '{') '*' expression for_if_clauses { RAISE_SYNTAX_ERROR("iterable unpacking cannot be used in comprehension") } invalid_parameters: - | [plain_names ','] (slash_with_default | names_with_default) ',' plain_names { + | param_no_default* (slash_with_default | param_with_default+) param_no_default { RAISE_SYNTAX_ERROR("non-default argument follows default argument") } +invalid_double_type_comments: + | TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT { + RAISE_SYNTAX_ERROR("Cannot have two type comments on def") } diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index ce3b7985e62b2..6c3f6ed4ed209 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -219,7 +219,6 @@ def favk( """ - at support.skip_if_new_parser("Pegen does not support type comments yet") class TypeCommentTests(unittest.TestCase): lowest = 4 # Lowest minor version supported @@ -253,6 +252,7 @@ def test_funcdef(self): self.assertEqual(tree.body[0].type_comment, None) self.assertEqual(tree.body[1].type_comment, None) + @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asyncdef(self): for tree in self.parse_all(asyncdef, minver=5): self.assertEqual(tree.body[0].type_comment, "() -> int") @@ -261,22 +261,27 @@ def test_asyncdef(self): self.assertEqual(tree.body[0].type_comment, None) self.assertEqual(tree.body[1].type_comment, None) + @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asyncvar(self): for tree in self.parse_all(asyncvar, maxver=6): pass + @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asynccomp(self): for tree in self.parse_all(asynccomp, minver=6): pass + @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_matmul(self): for tree in self.parse_all(matmul, minver=5): pass + @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_fstring(self): for tree in self.parse_all(fstring, minver=6): pass + @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_underscorednumber(self): for tree in self.parse_all(underscorednumber, minver=6): pass diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index 76dd6d31da05a..8ff9a70d3bb82 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -71,289 +71,300 @@ static KeywordToken *reserved_keywords[] = { #define file_type 1000 #define interactive_type 1001 #define eval_type 1002 -#define fstring_type 1003 -#define statements_type 1004 -#define statement_type 1005 -#define statement_newline_type 1006 -#define simple_stmt_type 1007 -#define small_stmt_type 1008 -#define compound_stmt_type 1009 -#define assignment_type 1010 -#define augassign_type 1011 -#define global_stmt_type 1012 -#define nonlocal_stmt_type 1013 -#define yield_stmt_type 1014 -#define assert_stmt_type 1015 -#define del_stmt_type 1016 -#define import_stmt_type 1017 -#define import_name_type 1018 -#define import_from_type 1019 -#define import_from_targets_type 1020 -#define import_from_as_names_type 1021 -#define import_from_as_name_type 1022 -#define dotted_as_names_type 1023 -#define dotted_as_name_type 1024 -#define dotted_name_type 1025 // Left-recursive -#define if_stmt_type 1026 -#define elif_stmt_type 1027 -#define else_block_type 1028 -#define while_stmt_type 1029 -#define for_stmt_type 1030 -#define with_stmt_type 1031 -#define with_item_type 1032 -#define try_stmt_type 1033 -#define except_block_type 1034 -#define finally_block_type 1035 -#define return_stmt_type 1036 -#define raise_stmt_type 1037 -#define function_def_type 1038 -#define function_def_raw_type 1039 -#define params_type 1040 -#define parameters_type 1041 -#define slash_without_default_type 1042 -#define slash_with_default_type 1043 -#define star_etc_type 1044 -#define name_with_optional_default_type 1045 -#define names_with_default_type 1046 -#define name_with_default_type 1047 -#define plain_names_type 1048 -#define plain_name_type 1049 -#define kwds_type 1050 -#define annotation_type 1051 -#define decorators_type 1052 -#define class_def_type 1053 -#define class_def_raw_type 1054 -#define block_type 1055 -#define expressions_list_type 1056 -#define star_expressions_type 1057 -#define star_expression_type 1058 -#define star_named_expressions_type 1059 -#define star_named_expression_type 1060 -#define named_expression_type 1061 -#define annotated_rhs_type 1062 -#define expressions_type 1063 -#define expression_type 1064 -#define lambdef_type 1065 -#define lambda_parameters_type 1066 -#define lambda_slash_without_default_type 1067 -#define lambda_slash_with_default_type 1068 -#define lambda_star_etc_type 1069 -#define lambda_name_with_optional_default_type 1070 -#define lambda_names_with_default_type 1071 -#define lambda_name_with_default_type 1072 -#define lambda_plain_names_type 1073 -#define lambda_plain_name_type 1074 -#define lambda_kwds_type 1075 -#define disjunction_type 1076 -#define conjunction_type 1077 -#define inversion_type 1078 -#define comparison_type 1079 -#define compare_op_bitwise_or_pair_type 1080 -#define eq_bitwise_or_type 1081 -#define noteq_bitwise_or_type 1082 -#define lte_bitwise_or_type 1083 -#define lt_bitwise_or_type 1084 -#define gte_bitwise_or_type 1085 -#define gt_bitwise_or_type 1086 -#define notin_bitwise_or_type 1087 -#define in_bitwise_or_type 1088 -#define isnot_bitwise_or_type 1089 -#define is_bitwise_or_type 1090 -#define bitwise_or_type 1091 // Left-recursive -#define bitwise_xor_type 1092 // Left-recursive -#define bitwise_and_type 1093 // Left-recursive -#define shift_expr_type 1094 // Left-recursive -#define sum_type 1095 // Left-recursive -#define term_type 1096 // Left-recursive -#define factor_type 1097 -#define power_type 1098 -#define await_primary_type 1099 -#define primary_type 1100 // Left-recursive -#define slices_type 1101 -#define slice_type 1102 -#define atom_type 1103 -#define strings_type 1104 -#define list_type 1105 -#define listcomp_type 1106 -#define tuple_type 1107 -#define group_type 1108 -#define genexp_type 1109 -#define set_type 1110 -#define setcomp_type 1111 -#define dict_type 1112 -#define dictcomp_type 1113 -#define kvpairs_type 1114 -#define kvpair_type 1115 -#define for_if_clauses_type 1116 -#define yield_expr_type 1117 -#define arguments_type 1118 -#define args_type 1119 -#define kwargs_type 1120 -#define starred_expression_type 1121 -#define kwarg_or_starred_type 1122 -#define kwarg_or_double_starred_type 1123 -#define star_targets_type 1124 -#define star_targets_seq_type 1125 -#define star_target_type 1126 -#define star_atom_type 1127 -#define inside_paren_ann_assign_target_type 1128 -#define ann_assign_subscript_attribute_target_type 1129 -#define del_targets_type 1130 -#define del_target_type 1131 -#define del_t_atom_type 1132 -#define targets_type 1133 -#define target_type 1134 -#define t_primary_type 1135 // Left-recursive -#define t_lookahead_type 1136 -#define t_atom_type 1137 -#define incorrect_arguments_type 1138 -#define invalid_named_expression_type 1139 -#define invalid_assignment_type 1140 -#define invalid_block_type 1141 -#define invalid_comprehension_type 1142 -#define invalid_parameters_type 1143 -#define _loop0_1_type 1144 -#define _loop1_2_type 1145 -#define _loop0_4_type 1146 -#define _gather_3_type 1147 -#define _tmp_5_type 1148 -#define _tmp_6_type 1149 -#define _tmp_7_type 1150 -#define _tmp_8_type 1151 -#define _tmp_9_type 1152 -#define _tmp_10_type 1153 -#define _tmp_11_type 1154 -#define _tmp_12_type 1155 -#define _loop1_13_type 1156 -#define _tmp_14_type 1157 -#define _tmp_15_type 1158 -#define _loop0_17_type 1159 -#define _gather_16_type 1160 -#define _loop0_19_type 1161 -#define _gather_18_type 1162 -#define _tmp_20_type 1163 -#define _loop0_21_type 1164 -#define _loop1_22_type 1165 -#define _loop0_24_type 1166 -#define _gather_23_type 1167 -#define _tmp_25_type 1168 -#define _loop0_27_type 1169 -#define _gather_26_type 1170 -#define _tmp_28_type 1171 -#define _loop0_30_type 1172 -#define _gather_29_type 1173 -#define _loop0_32_type 1174 -#define _gather_31_type 1175 -#define _tmp_33_type 1176 -#define _loop1_34_type 1177 -#define _tmp_35_type 1178 -#define _tmp_36_type 1179 -#define _tmp_37_type 1180 -#define _tmp_38_type 1181 -#define _tmp_39_type 1182 -#define _tmp_40_type 1183 -#define _tmp_41_type 1184 -#define _tmp_42_type 1185 -#define _tmp_43_type 1186 -#define _tmp_44_type 1187 -#define _tmp_45_type 1188 -#define _tmp_46_type 1189 -#define _loop0_47_type 1190 -#define _tmp_48_type 1191 -#define _loop1_49_type 1192 -#define _tmp_50_type 1193 -#define _tmp_51_type 1194 -#define _loop0_53_type 1195 -#define _gather_52_type 1196 -#define _loop0_55_type 1197 -#define _gather_54_type 1198 -#define _tmp_56_type 1199 -#define _loop1_57_type 1200 -#define _tmp_58_type 1201 -#define _loop0_60_type 1202 -#define _gather_59_type 1203 -#define _loop1_61_type 1204 -#define _loop0_63_type 1205 -#define _gather_62_type 1206 -#define _loop1_64_type 1207 -#define _tmp_65_type 1208 -#define _tmp_66_type 1209 -#define _tmp_67_type 1210 -#define _tmp_68_type 1211 -#define _tmp_69_type 1212 -#define _tmp_70_type 1213 -#define _tmp_71_type 1214 -#define _tmp_72_type 1215 -#define _tmp_73_type 1216 -#define _loop0_74_type 1217 -#define _tmp_75_type 1218 -#define _loop1_76_type 1219 -#define _tmp_77_type 1220 -#define _tmp_78_type 1221 -#define _loop0_80_type 1222 -#define _gather_79_type 1223 -#define _loop0_82_type 1224 -#define _gather_81_type 1225 -#define _loop1_83_type 1226 -#define _loop1_84_type 1227 -#define _loop1_85_type 1228 -#define _tmp_86_type 1229 -#define _loop0_88_type 1230 -#define _gather_87_type 1231 -#define _tmp_89_type 1232 -#define _tmp_90_type 1233 -#define _tmp_91_type 1234 -#define _tmp_92_type 1235 -#define _loop1_93_type 1236 -#define _tmp_94_type 1237 -#define _tmp_95_type 1238 -#define _loop0_97_type 1239 -#define _gather_96_type 1240 -#define _loop1_98_type 1241 -#define _tmp_99_type 1242 -#define _tmp_100_type 1243 -#define _loop0_102_type 1244 -#define _gather_101_type 1245 -#define _loop0_104_type 1246 -#define _gather_103_type 1247 -#define _loop0_106_type 1248 -#define _gather_105_type 1249 -#define _loop0_108_type 1250 -#define _gather_107_type 1251 -#define _loop0_109_type 1252 -#define _loop0_111_type 1253 -#define _gather_110_type 1254 -#define _tmp_112_type 1255 -#define _loop0_114_type 1256 -#define _gather_113_type 1257 -#define _loop0_116_type 1258 -#define _gather_115_type 1259 -#define _tmp_117_type 1260 -#define _tmp_118_type 1261 -#define _tmp_119_type 1262 -#define _tmp_120_type 1263 -#define _tmp_121_type 1264 -#define _tmp_122_type 1265 -#define _tmp_123_type 1266 -#define _tmp_124_type 1267 -#define _tmp_125_type 1268 -#define _tmp_126_type 1269 -#define _tmp_127_type 1270 -#define _tmp_128_type 1271 -#define _tmp_129_type 1272 -#define _tmp_130_type 1273 -#define _tmp_131_type 1274 -#define _tmp_132_type 1275 -#define _tmp_133_type 1276 -#define _tmp_134_type 1277 -#define _tmp_135_type 1278 -#define _loop0_136_type 1279 -#define _tmp_137_type 1280 +#define func_type_type 1003 +#define fstring_type 1004 +#define type_expressions_type 1005 +#define statements_type 1006 +#define statement_type 1007 +#define statement_newline_type 1008 +#define simple_stmt_type 1009 +#define small_stmt_type 1010 +#define compound_stmt_type 1011 +#define assignment_type 1012 +#define augassign_type 1013 +#define global_stmt_type 1014 +#define nonlocal_stmt_type 1015 +#define yield_stmt_type 1016 +#define assert_stmt_type 1017 +#define del_stmt_type 1018 +#define import_stmt_type 1019 +#define import_name_type 1020 +#define import_from_type 1021 +#define import_from_targets_type 1022 +#define import_from_as_names_type 1023 +#define import_from_as_name_type 1024 +#define dotted_as_names_type 1025 +#define dotted_as_name_type 1026 +#define dotted_name_type 1027 // Left-recursive +#define if_stmt_type 1028 +#define elif_stmt_type 1029 +#define else_block_type 1030 +#define while_stmt_type 1031 +#define for_stmt_type 1032 +#define with_stmt_type 1033 +#define with_item_type 1034 +#define try_stmt_type 1035 +#define except_block_type 1036 +#define finally_block_type 1037 +#define return_stmt_type 1038 +#define raise_stmt_type 1039 +#define function_def_type 1040 +#define function_def_raw_type 1041 +#define func_type_comment_type 1042 +#define params_type 1043 +#define parameters_type 1044 +#define slash_no_default_type 1045 +#define slash_with_default_type 1046 +#define star_etc_type 1047 +#define kwds_type 1048 +#define param_no_default_type 1049 +#define param_with_default_type 1050 +#define param_maybe_default_type 1051 +#define param_type 1052 +#define annotation_type 1053 +#define default_type 1054 +#define decorators_type 1055 +#define class_def_type 1056 +#define class_def_raw_type 1057 +#define block_type 1058 +#define expressions_list_type 1059 +#define star_expressions_type 1060 +#define star_expression_type 1061 +#define star_named_expressions_type 1062 +#define star_named_expression_type 1063 +#define named_expression_type 1064 +#define annotated_rhs_type 1065 +#define expressions_type 1066 +#define expression_type 1067 +#define lambdef_type 1068 +#define lambda_parameters_type 1069 +#define lambda_slash_without_default_type 1070 +#define lambda_slash_with_default_type 1071 +#define lambda_star_etc_type 1072 +#define lambda_name_with_optional_default_type 1073 +#define lambda_names_with_default_type 1074 +#define lambda_name_with_default_type 1075 +#define lambda_plain_names_type 1076 +#define lambda_plain_name_type 1077 +#define lambda_kwds_type 1078 +#define disjunction_type 1079 +#define conjunction_type 1080 +#define inversion_type 1081 +#define comparison_type 1082 +#define compare_op_bitwise_or_pair_type 1083 +#define eq_bitwise_or_type 1084 +#define noteq_bitwise_or_type 1085 +#define lte_bitwise_or_type 1086 +#define lt_bitwise_or_type 1087 +#define gte_bitwise_or_type 1088 +#define gt_bitwise_or_type 1089 +#define notin_bitwise_or_type 1090 +#define in_bitwise_or_type 1091 +#define isnot_bitwise_or_type 1092 +#define is_bitwise_or_type 1093 +#define bitwise_or_type 1094 // Left-recursive +#define bitwise_xor_type 1095 // Left-recursive +#define bitwise_and_type 1096 // Left-recursive +#define shift_expr_type 1097 // Left-recursive +#define sum_type 1098 // Left-recursive +#define term_type 1099 // Left-recursive +#define factor_type 1100 +#define power_type 1101 +#define await_primary_type 1102 +#define primary_type 1103 // Left-recursive +#define slices_type 1104 +#define slice_type 1105 +#define atom_type 1106 +#define strings_type 1107 +#define list_type 1108 +#define listcomp_type 1109 +#define tuple_type 1110 +#define group_type 1111 +#define genexp_type 1112 +#define set_type 1113 +#define setcomp_type 1114 +#define dict_type 1115 +#define dictcomp_type 1116 +#define kvpairs_type 1117 +#define kvpair_type 1118 +#define for_if_clauses_type 1119 +#define yield_expr_type 1120 +#define arguments_type 1121 +#define args_type 1122 +#define kwargs_type 1123 +#define starred_expression_type 1124 +#define kwarg_or_starred_type 1125 +#define kwarg_or_double_starred_type 1126 +#define star_targets_type 1127 +#define star_targets_seq_type 1128 +#define star_target_type 1129 +#define star_atom_type 1130 +#define inside_paren_ann_assign_target_type 1131 +#define ann_assign_subscript_attribute_target_type 1132 +#define del_targets_type 1133 +#define del_target_type 1134 +#define del_t_atom_type 1135 +#define targets_type 1136 +#define target_type 1137 +#define t_primary_type 1138 // Left-recursive +#define t_lookahead_type 1139 +#define t_atom_type 1140 +#define incorrect_arguments_type 1141 +#define invalid_named_expression_type 1142 +#define invalid_assignment_type 1143 +#define invalid_block_type 1144 +#define invalid_comprehension_type 1145 +#define invalid_parameters_type 1146 +#define invalid_double_type_comments_type 1147 +#define _loop0_1_type 1148 +#define _loop0_2_type 1149 +#define _loop0_4_type 1150 +#define _gather_3_type 1151 +#define _loop0_6_type 1152 +#define _gather_5_type 1153 +#define _loop0_8_type 1154 +#define _gather_7_type 1155 +#define _loop0_10_type 1156 +#define _gather_9_type 1157 +#define _loop1_11_type 1158 +#define _loop0_13_type 1159 +#define _gather_12_type 1160 +#define _tmp_14_type 1161 +#define _tmp_15_type 1162 +#define _tmp_16_type 1163 +#define _tmp_17_type 1164 +#define _tmp_18_type 1165 +#define _tmp_19_type 1166 +#define _tmp_20_type 1167 +#define _tmp_21_type 1168 +#define _loop1_22_type 1169 +#define _tmp_23_type 1170 +#define _tmp_24_type 1171 +#define _loop0_26_type 1172 +#define _gather_25_type 1173 +#define _loop0_28_type 1174 +#define _gather_27_type 1175 +#define _tmp_29_type 1176 +#define _loop0_30_type 1177 +#define _loop1_31_type 1178 +#define _loop0_33_type 1179 +#define _gather_32_type 1180 +#define _tmp_34_type 1181 +#define _loop0_36_type 1182 +#define _gather_35_type 1183 +#define _tmp_37_type 1184 +#define _loop0_39_type 1185 +#define _gather_38_type 1186 +#define _loop0_41_type 1187 +#define _gather_40_type 1188 +#define _tmp_42_type 1189 +#define _loop1_43_type 1190 +#define _tmp_44_type 1191 +#define _tmp_45_type 1192 +#define _tmp_46_type 1193 +#define _tmp_47_type 1194 +#define _loop0_48_type 1195 +#define _loop0_49_type 1196 +#define _loop0_50_type 1197 +#define _loop1_51_type 1198 +#define _loop0_52_type 1199 +#define _loop1_53_type 1200 +#define _loop1_54_type 1201 +#define _loop1_55_type 1202 +#define _loop0_56_type 1203 +#define _loop1_57_type 1204 +#define _loop0_58_type 1205 +#define _loop1_59_type 1206 +#define _loop0_60_type 1207 +#define _loop1_61_type 1208 +#define _loop1_62_type 1209 +#define _tmp_63_type 1210 +#define _loop0_65_type 1211 +#define _gather_64_type 1212 +#define _loop1_66_type 1213 +#define _loop0_68_type 1214 +#define _gather_67_type 1215 +#define _loop1_69_type 1216 +#define _tmp_70_type 1217 +#define _tmp_71_type 1218 +#define _tmp_72_type 1219 +#define _tmp_73_type 1220 +#define _tmp_74_type 1221 +#define _tmp_75_type 1222 +#define _tmp_76_type 1223 +#define _tmp_77_type 1224 +#define _tmp_78_type 1225 +#define _loop0_79_type 1226 +#define _tmp_80_type 1227 +#define _loop1_81_type 1228 +#define _tmp_82_type 1229 +#define _tmp_83_type 1230 +#define _loop0_85_type 1231 +#define _gather_84_type 1232 +#define _loop0_87_type 1233 +#define _gather_86_type 1234 +#define _loop1_88_type 1235 +#define _loop1_89_type 1236 +#define _loop1_90_type 1237 +#define _tmp_91_type 1238 +#define _loop0_93_type 1239 +#define _gather_92_type 1240 +#define _tmp_94_type 1241 +#define _tmp_95_type 1242 +#define _tmp_96_type 1243 +#define _tmp_97_type 1244 +#define _loop1_98_type 1245 +#define _tmp_99_type 1246 +#define _tmp_100_type 1247 +#define _loop0_102_type 1248 +#define _gather_101_type 1249 +#define _loop1_103_type 1250 +#define _tmp_104_type 1251 +#define _tmp_105_type 1252 +#define _loop0_107_type 1253 +#define _gather_106_type 1254 +#define _loop0_109_type 1255 +#define _gather_108_type 1256 +#define _loop0_111_type 1257 +#define _gather_110_type 1258 +#define _loop0_113_type 1259 +#define _gather_112_type 1260 +#define _loop0_114_type 1261 +#define _loop0_116_type 1262 +#define _gather_115_type 1263 +#define _tmp_117_type 1264 +#define _loop0_119_type 1265 +#define _gather_118_type 1266 +#define _loop0_121_type 1267 +#define _gather_120_type 1268 +#define _tmp_122_type 1269 +#define _tmp_123_type 1270 +#define _tmp_124_type 1271 +#define _tmp_125_type 1272 +#define _tmp_126_type 1273 +#define _loop0_127_type 1274 +#define _tmp_128_type 1275 +#define _tmp_129_type 1276 +#define _tmp_130_type 1277 +#define _tmp_131_type 1278 +#define _tmp_132_type 1279 +#define _tmp_133_type 1280 +#define _tmp_134_type 1281 +#define _tmp_135_type 1282 +#define _tmp_136_type 1283 +#define _tmp_137_type 1284 +#define _tmp_138_type 1285 +#define _tmp_139_type 1286 +#define _loop1_140_type 1287 +#define _loop0_141_type 1288 +#define _tmp_142_type 1289 static mod_ty file_rule(Parser *p); static mod_ty interactive_rule(Parser *p); static mod_ty eval_rule(Parser *p); +static mod_ty func_type_rule(Parser *p); static expr_ty fstring_rule(Parser *p); +static asdl_seq* type_expressions_rule(Parser *p); static asdl_seq* statements_rule(Parser *p); static asdl_seq* statement_rule(Parser *p); static asdl_seq* statement_newline_rule(Parser *p); @@ -390,18 +401,19 @@ static stmt_ty return_stmt_rule(Parser *p); static stmt_ty raise_stmt_rule(Parser *p); static stmt_ty function_def_rule(Parser *p); static stmt_ty function_def_raw_rule(Parser *p); +static PyObject* func_type_comment_rule(Parser *p); static arguments_ty params_rule(Parser *p); static arguments_ty parameters_rule(Parser *p); -static asdl_seq* slash_without_default_rule(Parser *p); +static asdl_seq* slash_no_default_rule(Parser *p); static SlashWithDefault* slash_with_default_rule(Parser *p); static StarEtc* star_etc_rule(Parser *p); -static NameDefaultPair* name_with_optional_default_rule(Parser *p); -static asdl_seq* names_with_default_rule(Parser *p); -static NameDefaultPair* name_with_default_rule(Parser *p); -static asdl_seq* plain_names_rule(Parser *p); -static arg_ty plain_name_rule(Parser *p); static arg_ty kwds_rule(Parser *p); +static arg_ty param_no_default_rule(Parser *p); +static NameDefaultPair* param_with_default_rule(Parser *p); +static NameDefaultPair* param_maybe_default_rule(Parser *p); +static arg_ty param_rule(Parser *p); static expr_ty annotation_rule(Parser *p); +static expr_ty default_rule(Parser *p); static asdl_seq* decorators_rule(Parser *p); static stmt_ty class_def_rule(Parser *p); static stmt_ty class_def_raw_rule(Parser *p); @@ -494,133 +506,134 @@ static void *invalid_assignment_rule(Parser *p); static void *invalid_block_rule(Parser *p); static void *invalid_comprehension_rule(Parser *p); static void *invalid_parameters_rule(Parser *p); +static void *invalid_double_type_comments_rule(Parser *p); static asdl_seq *_loop0_1_rule(Parser *p); -static asdl_seq *_loop1_2_rule(Parser *p); +static asdl_seq *_loop0_2_rule(Parser *p); static asdl_seq *_loop0_4_rule(Parser *p); static asdl_seq *_gather_3_rule(Parser *p); -static void *_tmp_5_rule(Parser *p); -static void *_tmp_6_rule(Parser *p); -static void *_tmp_7_rule(Parser *p); -static void *_tmp_8_rule(Parser *p); -static void *_tmp_9_rule(Parser *p); -static void *_tmp_10_rule(Parser *p); -static void *_tmp_11_rule(Parser *p); -static void *_tmp_12_rule(Parser *p); -static asdl_seq *_loop1_13_rule(Parser *p); +static asdl_seq *_loop0_6_rule(Parser *p); +static asdl_seq *_gather_5_rule(Parser *p); +static asdl_seq *_loop0_8_rule(Parser *p); +static asdl_seq *_gather_7_rule(Parser *p); +static asdl_seq *_loop0_10_rule(Parser *p); +static asdl_seq *_gather_9_rule(Parser *p); +static asdl_seq *_loop1_11_rule(Parser *p); +static asdl_seq *_loop0_13_rule(Parser *p); +static asdl_seq *_gather_12_rule(Parser *p); static void *_tmp_14_rule(Parser *p); static void *_tmp_15_rule(Parser *p); -static asdl_seq *_loop0_17_rule(Parser *p); -static asdl_seq *_gather_16_rule(Parser *p); -static asdl_seq *_loop0_19_rule(Parser *p); -static asdl_seq *_gather_18_rule(Parser *p); +static void *_tmp_16_rule(Parser *p); +static void *_tmp_17_rule(Parser *p); +static void *_tmp_18_rule(Parser *p); +static void *_tmp_19_rule(Parser *p); static void *_tmp_20_rule(Parser *p); -static asdl_seq *_loop0_21_rule(Parser *p); +static void *_tmp_21_rule(Parser *p); static asdl_seq *_loop1_22_rule(Parser *p); -static asdl_seq *_loop0_24_rule(Parser *p); -static asdl_seq *_gather_23_rule(Parser *p); -static void *_tmp_25_rule(Parser *p); -static asdl_seq *_loop0_27_rule(Parser *p); -static asdl_seq *_gather_26_rule(Parser *p); -static void *_tmp_28_rule(Parser *p); +static void *_tmp_23_rule(Parser *p); +static void *_tmp_24_rule(Parser *p); +static asdl_seq *_loop0_26_rule(Parser *p); +static asdl_seq *_gather_25_rule(Parser *p); +static asdl_seq *_loop0_28_rule(Parser *p); +static asdl_seq *_gather_27_rule(Parser *p); +static void *_tmp_29_rule(Parser *p); static asdl_seq *_loop0_30_rule(Parser *p); -static asdl_seq *_gather_29_rule(Parser *p); -static asdl_seq *_loop0_32_rule(Parser *p); -static asdl_seq *_gather_31_rule(Parser *p); -static void *_tmp_33_rule(Parser *p); -static asdl_seq *_loop1_34_rule(Parser *p); -static void *_tmp_35_rule(Parser *p); -static void *_tmp_36_rule(Parser *p); +static asdl_seq *_loop1_31_rule(Parser *p); +static asdl_seq *_loop0_33_rule(Parser *p); +static asdl_seq *_gather_32_rule(Parser *p); +static void *_tmp_34_rule(Parser *p); +static asdl_seq *_loop0_36_rule(Parser *p); +static asdl_seq *_gather_35_rule(Parser *p); static void *_tmp_37_rule(Parser *p); -static void *_tmp_38_rule(Parser *p); -static void *_tmp_39_rule(Parser *p); -static void *_tmp_40_rule(Parser *p); -static void *_tmp_41_rule(Parser *p); +static asdl_seq *_loop0_39_rule(Parser *p); +static asdl_seq *_gather_38_rule(Parser *p); +static asdl_seq *_loop0_41_rule(Parser *p); +static asdl_seq *_gather_40_rule(Parser *p); static void *_tmp_42_rule(Parser *p); -static void *_tmp_43_rule(Parser *p); +static asdl_seq *_loop1_43_rule(Parser *p); static void *_tmp_44_rule(Parser *p); static void *_tmp_45_rule(Parser *p); static void *_tmp_46_rule(Parser *p); -static asdl_seq *_loop0_47_rule(Parser *p); -static void *_tmp_48_rule(Parser *p); -static asdl_seq *_loop1_49_rule(Parser *p); -static void *_tmp_50_rule(Parser *p); -static void *_tmp_51_rule(Parser *p); -static asdl_seq *_loop0_53_rule(Parser *p); -static asdl_seq *_gather_52_rule(Parser *p); -static asdl_seq *_loop0_55_rule(Parser *p); -static asdl_seq *_gather_54_rule(Parser *p); -static void *_tmp_56_rule(Parser *p); +static void *_tmp_47_rule(Parser *p); +static asdl_seq *_loop0_48_rule(Parser *p); +static asdl_seq *_loop0_49_rule(Parser *p); +static asdl_seq *_loop0_50_rule(Parser *p); +static asdl_seq *_loop1_51_rule(Parser *p); +static asdl_seq *_loop0_52_rule(Parser *p); +static asdl_seq *_loop1_53_rule(Parser *p); +static asdl_seq *_loop1_54_rule(Parser *p); +static asdl_seq *_loop1_55_rule(Parser *p); +static asdl_seq *_loop0_56_rule(Parser *p); static asdl_seq *_loop1_57_rule(Parser *p); -static void *_tmp_58_rule(Parser *p); +static asdl_seq *_loop0_58_rule(Parser *p); +static asdl_seq *_loop1_59_rule(Parser *p); static asdl_seq *_loop0_60_rule(Parser *p); -static asdl_seq *_gather_59_rule(Parser *p); static asdl_seq *_loop1_61_rule(Parser *p); -static asdl_seq *_loop0_63_rule(Parser *p); -static asdl_seq *_gather_62_rule(Parser *p); -static asdl_seq *_loop1_64_rule(Parser *p); -static void *_tmp_65_rule(Parser *p); -static void *_tmp_66_rule(Parser *p); -static void *_tmp_67_rule(Parser *p); -static void *_tmp_68_rule(Parser *p); -static void *_tmp_69_rule(Parser *p); +static asdl_seq *_loop1_62_rule(Parser *p); +static void *_tmp_63_rule(Parser *p); +static asdl_seq *_loop0_65_rule(Parser *p); +static asdl_seq *_gather_64_rule(Parser *p); +static asdl_seq *_loop1_66_rule(Parser *p); +static asdl_seq *_loop0_68_rule(Parser *p); +static asdl_seq *_gather_67_rule(Parser *p); +static asdl_seq *_loop1_69_rule(Parser *p); static void *_tmp_70_rule(Parser *p); static void *_tmp_71_rule(Parser *p); static void *_tmp_72_rule(Parser *p); static void *_tmp_73_rule(Parser *p); -static asdl_seq *_loop0_74_rule(Parser *p); +static void *_tmp_74_rule(Parser *p); static void *_tmp_75_rule(Parser *p); -static asdl_seq *_loop1_76_rule(Parser *p); +static void *_tmp_76_rule(Parser *p); static void *_tmp_77_rule(Parser *p); static void *_tmp_78_rule(Parser *p); -static asdl_seq *_loop0_80_rule(Parser *p); -static asdl_seq *_gather_79_rule(Parser *p); -static asdl_seq *_loop0_82_rule(Parser *p); -static asdl_seq *_gather_81_rule(Parser *p); -static asdl_seq *_loop1_83_rule(Parser *p); -static asdl_seq *_loop1_84_rule(Parser *p); -static asdl_seq *_loop1_85_rule(Parser *p); -static void *_tmp_86_rule(Parser *p); -static asdl_seq *_loop0_88_rule(Parser *p); -static asdl_seq *_gather_87_rule(Parser *p); -static void *_tmp_89_rule(Parser *p); -static void *_tmp_90_rule(Parser *p); +static asdl_seq *_loop0_79_rule(Parser *p); +static void *_tmp_80_rule(Parser *p); +static asdl_seq *_loop1_81_rule(Parser *p); +static void *_tmp_82_rule(Parser *p); +static void *_tmp_83_rule(Parser *p); +static asdl_seq *_loop0_85_rule(Parser *p); +static asdl_seq *_gather_84_rule(Parser *p); +static asdl_seq *_loop0_87_rule(Parser *p); +static asdl_seq *_gather_86_rule(Parser *p); +static asdl_seq *_loop1_88_rule(Parser *p); +static asdl_seq *_loop1_89_rule(Parser *p); +static asdl_seq *_loop1_90_rule(Parser *p); static void *_tmp_91_rule(Parser *p); -static void *_tmp_92_rule(Parser *p); -static asdl_seq *_loop1_93_rule(Parser *p); +static asdl_seq *_loop0_93_rule(Parser *p); +static asdl_seq *_gather_92_rule(Parser *p); static void *_tmp_94_rule(Parser *p); static void *_tmp_95_rule(Parser *p); -static asdl_seq *_loop0_97_rule(Parser *p); -static asdl_seq *_gather_96_rule(Parser *p); +static void *_tmp_96_rule(Parser *p); +static void *_tmp_97_rule(Parser *p); static asdl_seq *_loop1_98_rule(Parser *p); static void *_tmp_99_rule(Parser *p); static void *_tmp_100_rule(Parser *p); static asdl_seq *_loop0_102_rule(Parser *p); static asdl_seq *_gather_101_rule(Parser *p); -static asdl_seq *_loop0_104_rule(Parser *p); -static asdl_seq *_gather_103_rule(Parser *p); -static asdl_seq *_loop0_106_rule(Parser *p); -static asdl_seq *_gather_105_rule(Parser *p); -static asdl_seq *_loop0_108_rule(Parser *p); -static asdl_seq *_gather_107_rule(Parser *p); +static asdl_seq *_loop1_103_rule(Parser *p); +static void *_tmp_104_rule(Parser *p); +static void *_tmp_105_rule(Parser *p); +static asdl_seq *_loop0_107_rule(Parser *p); +static asdl_seq *_gather_106_rule(Parser *p); static asdl_seq *_loop0_109_rule(Parser *p); +static asdl_seq *_gather_108_rule(Parser *p); static asdl_seq *_loop0_111_rule(Parser *p); static asdl_seq *_gather_110_rule(Parser *p); -static void *_tmp_112_rule(Parser *p); +static asdl_seq *_loop0_113_rule(Parser *p); +static asdl_seq *_gather_112_rule(Parser *p); static asdl_seq *_loop0_114_rule(Parser *p); -static asdl_seq *_gather_113_rule(Parser *p); static asdl_seq *_loop0_116_rule(Parser *p); static asdl_seq *_gather_115_rule(Parser *p); static void *_tmp_117_rule(Parser *p); -static void *_tmp_118_rule(Parser *p); -static void *_tmp_119_rule(Parser *p); -static void *_tmp_120_rule(Parser *p); -static void *_tmp_121_rule(Parser *p); +static asdl_seq *_loop0_119_rule(Parser *p); +static asdl_seq *_gather_118_rule(Parser *p); +static asdl_seq *_loop0_121_rule(Parser *p); +static asdl_seq *_gather_120_rule(Parser *p); static void *_tmp_122_rule(Parser *p); static void *_tmp_123_rule(Parser *p); static void *_tmp_124_rule(Parser *p); static void *_tmp_125_rule(Parser *p); static void *_tmp_126_rule(Parser *p); -static void *_tmp_127_rule(Parser *p); +static asdl_seq *_loop0_127_rule(Parser *p); static void *_tmp_128_rule(Parser *p); static void *_tmp_129_rule(Parser *p); static void *_tmp_130_rule(Parser *p); @@ -629,8 +642,13 @@ static void *_tmp_132_rule(Parser *p); static void *_tmp_133_rule(Parser *p); static void *_tmp_134_rule(Parser *p); static void *_tmp_135_rule(Parser *p); -static asdl_seq *_loop0_136_rule(Parser *p); +static void *_tmp_136_rule(Parser *p); static void *_tmp_137_rule(Parser *p); +static void *_tmp_138_rule(Parser *p); +static void *_tmp_139_rule(Parser *p); +static asdl_seq *_loop1_140_rule(Parser *p); +static asdl_seq *_loop0_141_rule(Parser *p); +static void *_tmp_142_rule(Parser *p); // file: statements? $ @@ -651,7 +669,7 @@ file_rule(Parser *p) (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) ) { - res = Module ( a , NULL , p -> arena ); + res = _PyPegen_make_module ( p , a ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -729,6 +747,53 @@ eval_rule(Parser *p) return res; } +// func_type: '(' type_expressions? ')' '->' expression NEWLINE* $ +static mod_ty +func_type_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + mod_ty res = NULL; + int mark = p->mark; + { // '(' type_expressions? ')' '->' expression NEWLINE* $ + asdl_seq * _loop0_2_var; + void *a; + expr_ty b; + void *endmarker_var; + void *literal; + void *literal_1; + void *literal_2; + if ( + (literal = _PyPegen_expect_token(p, 7)) + && + (a = type_expressions_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + && + (literal_2 = _PyPegen_expect_token(p, 51)) + && + (b = expression_rule(p)) + && + (_loop0_2_var = _loop0_2_rule(p)) + && + (endmarker_var = _PyPegen_expect_token(p, ENDMARKER)) + ) + { + res = FunctionType ( a , b , p -> arena ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + // fstring: star_expressions static expr_ty fstring_rule(Parser *p) @@ -754,6 +819,116 @@ fstring_rule(Parser *p) return res; } +// type_expressions: +// | ','.expression+ ',' '*' expression ',' '**' expression +// | ','.expression+ ',' '*' expression +// | ','.expression+ ',' '**' expression +// | ','.expression+ +static asdl_seq* +type_expressions_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq* res = NULL; + int mark = p->mark; + { // ','.expression+ ',' '*' expression ',' '**' expression + asdl_seq * a; + expr_ty b; + expr_ty c; + void *literal; + void *literal_1; + void *literal_2; + void *literal_3; + if ( + (a = _gather_3_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 16)) + && + (b = expression_rule(p)) + && + (literal_2 = _PyPegen_expect_token(p, 12)) + && + (literal_3 = _PyPegen_expect_token(p, 35)) + && + (c = expression_rule(p)) + ) + { + res = _PyPegen_seq_append_to_end ( p , CHECK ( _PyPegen_seq_append_to_end ( p , a , b ) ) , c ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ','.expression+ ',' '*' expression + asdl_seq * a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = _gather_5_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 16)) + && + (b = expression_rule(p)) + ) + { + res = _PyPegen_seq_append_to_end ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ','.expression+ ',' '**' expression + asdl_seq * a; + expr_ty b; + void *literal; + void *literal_1; + if ( + (a = _gather_7_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (literal_1 = _PyPegen_expect_token(p, 35)) + && + (b = expression_rule(p)) + ) + { + res = _PyPegen_seq_append_to_end ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ','.expression+ + asdl_seq * _gather_9_var; + if ( + (_gather_9_var = _gather_9_rule(p)) + ) + { + res = _gather_9_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + // statements: statement+ static asdl_seq* statements_rule(Parser *p) @@ -766,7 +941,7 @@ statements_rule(Parser *p) { // statement+ asdl_seq * a; if ( - (a = _loop1_2_rule(p)) + (a = _loop1_11_rule(p)) ) { res = _PyPegen_seq_flatten ( p , a ); @@ -947,7 +1122,7 @@ simple_stmt_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_3_rule(p)) + (a = _gather_12_rule(p)) && (opt_var = _PyPegen_expect_token(p, 13), 1) && @@ -1050,7 +1225,7 @@ small_stmt_rule(Parser *p) { // &('import' | 'from') import_stmt stmt_ty import_stmt_var; if ( - _PyPegen_lookahead(1, _tmp_5_rule, p) + _PyPegen_lookahead(1, _tmp_14_rule, p) && (import_stmt_var = import_stmt_rule(p)) ) @@ -1232,7 +1407,7 @@ compound_stmt_rule(Parser *p) { // &('def' | '@' | ASYNC) function_def stmt_ty function_def_var; if ( - _PyPegen_lookahead(1, _tmp_6_rule, p) + _PyPegen_lookahead(1, _tmp_15_rule, p) && (function_def_var = function_def_rule(p)) ) @@ -1258,7 +1433,7 @@ compound_stmt_rule(Parser *p) { // &('class' | '@') class_def stmt_ty class_def_var; if ( - _PyPegen_lookahead(1, _tmp_7_rule, p) + _PyPegen_lookahead(1, _tmp_16_rule, p) && (class_def_var = class_def_rule(p)) ) @@ -1271,7 +1446,7 @@ compound_stmt_rule(Parser *p) { // &('with' | ASYNC) with_stmt stmt_ty with_stmt_var; if ( - _PyPegen_lookahead(1, _tmp_8_rule, p) + _PyPegen_lookahead(1, _tmp_17_rule, p) && (with_stmt_var = with_stmt_rule(p)) ) @@ -1284,7 +1459,7 @@ compound_stmt_rule(Parser *p) { // &('for' | ASYNC) for_stmt stmt_ty for_stmt_var; if ( - _PyPegen_lookahead(1, _tmp_9_rule, p) + _PyPegen_lookahead(1, _tmp_18_rule, p) && (for_stmt_var = for_stmt_rule(p)) ) @@ -1328,7 +1503,7 @@ compound_stmt_rule(Parser *p) // assignment: // | NAME ':' expression ['=' annotated_rhs] // | ('(' inside_paren_ann_assign_target ')' | ann_assign_subscript_attribute_target) ':' expression ['=' annotated_rhs] -// | ((star_targets '='))+ (yield_expr | star_expressions) +// | ((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT? // | target augassign (yield_expr | star_expressions) // | invalid_assignment static void * @@ -1359,7 +1534,7 @@ assignment_rule(Parser *p) && (b = expression_rule(p)) && - (c = _tmp_10_rule(p), 1) + (c = _tmp_19_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -1385,13 +1560,13 @@ assignment_rule(Parser *p) void *c; void *literal; if ( - (a = _tmp_11_rule(p)) + (a = _tmp_20_rule(p)) && (literal = _PyPegen_expect_token(p, 11)) && (b = expression_rule(p)) && - (c = _tmp_12_rule(p), 1) + (c = _tmp_21_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -1411,13 +1586,16 @@ assignment_rule(Parser *p) } p->mark = mark; } - { // ((star_targets '='))+ (yield_expr | star_expressions) + { // ((star_targets '='))+ (yield_expr | star_expressions) TYPE_COMMENT? asdl_seq * a; void *b; + void *tc; if ( - (a = _loop1_13_rule(p)) + (a = _loop1_22_rule(p)) + && + (b = _tmp_23_rule(p)) && - (b = _tmp_14_rule(p)) + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -1428,7 +1606,7 @@ assignment_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = _Py_Assign ( a , b , NULL , EXTRA ); + res = _Py_Assign ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -1446,7 +1624,7 @@ assignment_rule(Parser *p) && (b = augassign_rule(p)) && - (c = _tmp_15_rule(p)) + (c = _tmp_24_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -1727,7 +1905,7 @@ global_stmt_rule(Parser *p) if ( (keyword = _PyPegen_expect_token(p, 508)) && - (a = _gather_16_rule(p)) + (a = _gather_25_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -1775,7 +1953,7 @@ nonlocal_stmt_rule(Parser *p) if ( (keyword = _PyPegen_expect_token(p, 509)) && - (a = _gather_18_rule(p)) + (a = _gather_27_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -1871,7 +2049,7 @@ assert_stmt_rule(Parser *p) && (a = expression_rule(p)) && - (b = _tmp_20_rule(p), 1) + (b = _tmp_29_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -2056,7 +2234,7 @@ import_from_rule(Parser *p) if ( (keyword = _PyPegen_expect_token(p, 514)) && - (a = _loop0_21_rule(p)) + (a = _loop0_30_rule(p)) && (b = dotted_name_rule(p)) && @@ -2090,7 +2268,7 @@ import_from_rule(Parser *p) if ( (keyword = _PyPegen_expect_token(p, 514)) && - (a = _loop1_22_rule(p)) + (a = _loop1_31_rule(p)) && (keyword_1 = _PyPegen_expect_token(p, 513)) && @@ -2196,7 +2374,7 @@ import_from_as_names_rule(Parser *p) { // ','.import_from_as_name+ asdl_seq * a; if ( - (a = _gather_23_rule(p)) + (a = _gather_32_rule(p)) ) { res = a; @@ -2228,7 +2406,7 @@ import_from_as_name_rule(Parser *p) if ( (a = _PyPegen_name_token(p)) && - (b = _tmp_25_rule(p), 1) + (b = _tmp_34_rule(p), 1) ) { res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); @@ -2257,7 +2435,7 @@ dotted_as_names_rule(Parser *p) { // ','.dotted_as_name+ asdl_seq * a; if ( - (a = _gather_26_rule(p)) + (a = _gather_35_rule(p)) ) { res = a; @@ -2289,7 +2467,7 @@ dotted_as_name_rule(Parser *p) if ( (a = dotted_name_rule(p)) && - (b = _tmp_28_rule(p), 1) + (b = _tmp_37_rule(p), 1) ) { res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); @@ -2657,7 +2835,8 @@ while_stmt_rule(Parser *p) return res; } -// for_stmt: ASYNC? 'for' star_targets 'in' star_expressions ':' block else_block? +// for_stmt: +// | ASYNC? 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? static stmt_ty for_stmt_rule(Parser *p) { @@ -2674,7 +2853,7 @@ for_stmt_rule(Parser *p) UNUSED(start_lineno); // Only used by EXTRA macro int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro - { // ASYNC? 'for' star_targets 'in' star_expressions ':' block else_block? + { // ASYNC? 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? asdl_seq* b; void *el; expr_ty ex; @@ -2683,6 +2862,7 @@ for_stmt_rule(Parser *p) void *keyword_1; void *literal; expr_ty t; + void *tc; if ( (is_async = _PyPegen_expect_token(p, ASYNC), 1) && @@ -2696,6 +2876,8 @@ for_stmt_rule(Parser *p) && (literal = _PyPegen_expect_token(p, 11)) && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && (b = block_rule(p)) && (el = else_block_rule(p), 1) @@ -2709,7 +2891,7 @@ for_stmt_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncFor : _Py_For ) ( t , ex , b , el , NULL , EXTRA ); + res = ( is_async ? _Py_AsyncFor : _Py_For ) ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -2725,7 +2907,7 @@ for_stmt_rule(Parser *p) // with_stmt: // | ASYNC? 'with' '(' ','.with_item+ ')' ':' block -// | ASYNC? 'with' ','.with_item+ ':' block +// | ASYNC? 'with' ','.with_item+ ':' TYPE_COMMENT? block static stmt_ty with_stmt_rule(Parser *p) { @@ -2757,7 +2939,7 @@ with_stmt_rule(Parser *p) && (literal = _PyPegen_expect_token(p, 7)) && - (a = _gather_29_rule(p)) + (a = _gather_38_rule(p)) && (literal_1 = _PyPegen_expect_token(p, 8)) && @@ -2783,21 +2965,24 @@ with_stmt_rule(Parser *p) } p->mark = mark; } - { // ASYNC? 'with' ','.with_item+ ':' block + { // ASYNC? 'with' ','.with_item+ ':' TYPE_COMMENT? block asdl_seq * a; asdl_seq* b; void *is_async; void *keyword; void *literal; + void *tc; if ( (is_async = _PyPegen_expect_token(p, ASYNC), 1) && (keyword = _PyPegen_expect_token(p, 519)) && - (a = _gather_31_rule(p)) + (a = _gather_40_rule(p)) && (literal = _PyPegen_expect_token(p, 11)) && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && (b = block_rule(p)) ) { @@ -2809,7 +2994,7 @@ with_stmt_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncWith : _Py_With ) ( a , b , NULL , EXTRA ); + res = ( is_async ? _Py_AsyncWith : _Py_With ) ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -2838,7 +3023,7 @@ with_item_rule(Parser *p) if ( (e = expression_rule(p)) && - (o = _tmp_33_rule(p), 1) + (o = _tmp_42_rule(p), 1) ) { res = _Py_withitem ( e , o , p -> arena ); @@ -2920,7 +3105,7 @@ try_stmt_rule(Parser *p) && (b = block_rule(p)) && - (ex = _loop1_34_rule(p)) + (ex = _loop1_43_rule(p)) && (el = else_block_rule(p), 1) && @@ -2977,7 +3162,7 @@ except_block_rule(Parser *p) && (e = expression_rule(p)) && - (t = _tmp_35_rule(p), 1) + (t = _tmp_44_rule(p), 1) && (literal = _PyPegen_expect_token(p, 11)) && @@ -3144,7 +3329,7 @@ raise_stmt_rule(Parser *p) && (a = expression_rule(p)) && - (b = _tmp_36_rule(p), 1) + (b = _tmp_45_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -3235,7 +3420,8 @@ function_def_rule(Parser *p) return res; } -// function_def_raw: ASYNC? 'def' NAME '(' params? ')' ['->' annotation] ':' block +// function_def_raw: +// | ASYNC? 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block static stmt_ty function_def_raw_rule(Parser *p) { @@ -3252,7 +3438,7 @@ function_def_raw_rule(Parser *p) UNUSED(start_lineno); // Only used by EXTRA macro int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro - { // ASYNC? 'def' NAME '(' params? ')' ['->' annotation] ':' block + { // ASYNC? 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block void *a; asdl_seq* b; void *is_async; @@ -3262,6 +3448,7 @@ function_def_raw_rule(Parser *p) void *literal_2; expr_ty n; void *params; + void *tc; if ( (is_async = _PyPegen_expect_token(p, ASYNC), 1) && @@ -3275,10 +3462,12 @@ function_def_raw_rule(Parser *p) && (literal_1 = _PyPegen_expect_token(p, 8)) && - (a = _tmp_37_rule(p), 1) + (a = _tmp_46_rule(p), 1) && (literal_2 = _PyPegen_expect_token(p, 11)) && + (tc = func_type_comment_rule(p), 1) + && (b = block_rule(p)) ) { @@ -3290,7 +3479,44 @@ function_def_raw_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef ) ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NULL , EXTRA ); + res = ( is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef ) ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// func_type_comment: +// | NEWLINE TYPE_COMMENT &(NEWLINE INDENT) +// | invalid_double_type_comments +// | TYPE_COMMENT +static PyObject* +func_type_comment_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + PyObject* res = NULL; + int mark = p->mark; + { // NEWLINE TYPE_COMMENT &(NEWLINE INDENT) + void *newline_var; + void *t; + if ( + (newline_var = _PyPegen_expect_token(p, NEWLINE)) + && + (t = _PyPegen_expect_token(p, TYPE_COMMENT)) + && + _PyPegen_lookahead(1, _tmp_47_rule, p) + ) + { + res = t; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3299,6 +3525,28 @@ function_def_raw_rule(Parser *p) } p->mark = mark; } + { // invalid_double_type_comments + void *invalid_double_type_comments_var; + if ( + (invalid_double_type_comments_var = invalid_double_type_comments_rule(p)) + ) + { + res = invalid_double_type_comments_var; + goto done; + } + p->mark = mark; + } + { // TYPE_COMMENT + void *type_comment_var; + if ( + (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT)) + ) + { + res = type_comment_var; + goto done; + } + p->mark = mark; + } res = NULL; done: return res; @@ -3341,10 +3589,10 @@ params_rule(Parser *p) } // parameters: -// | slash_without_default [',' plain_names] [',' names_with_default] [',' star_etc?] -// | slash_with_default [',' names_with_default] [',' star_etc?] -// | plain_names [',' names_with_default] [',' star_etc?] -// | names_with_default [',' star_etc?] +// | slash_no_default param_no_default* param_with_default* star_etc? +// | slash_with_default param_with_default* star_etc? +// | param_no_default+ param_with_default* star_etc? +// | param_with_default+ star_etc? // | star_etc static arguments_ty parameters_rule(Parser *p) @@ -3354,19 +3602,19 @@ parameters_rule(Parser *p) } arguments_ty res = NULL; int mark = p->mark; - { // slash_without_default [',' plain_names] [',' names_with_default] [',' star_etc?] + { // slash_no_default param_no_default* param_with_default* star_etc? asdl_seq* a; - void *b; - void *c; + asdl_seq * b; + asdl_seq * c; void *d; if ( - (a = slash_without_default_rule(p)) + (a = slash_no_default_rule(p)) && - (b = _tmp_38_rule(p), 1) + (b = _loop0_48_rule(p)) && - (c = _tmp_39_rule(p), 1) + (c = _loop0_49_rule(p)) && - (d = _tmp_40_rule(p), 1) + (d = star_etc_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); @@ -3378,16 +3626,16 @@ parameters_rule(Parser *p) } p->mark = mark; } - { // slash_with_default [',' names_with_default] [',' star_etc?] + { // slash_with_default param_with_default* star_etc? SlashWithDefault* a; - void *b; + asdl_seq * b; void *c; if ( (a = slash_with_default_rule(p)) && - (b = _tmp_41_rule(p), 1) + (b = _loop0_50_rule(p)) && - (c = _tmp_42_rule(p), 1) + (c = star_etc_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); @@ -3399,16 +3647,16 @@ parameters_rule(Parser *p) } p->mark = mark; } - { // plain_names [',' names_with_default] [',' star_etc?] - asdl_seq* a; - void *b; + { // param_no_default+ param_with_default* star_etc? + asdl_seq * a; + asdl_seq * b; void *c; if ( - (a = plain_names_rule(p)) + (a = _loop1_51_rule(p)) && - (b = _tmp_43_rule(p), 1) + (b = _loop0_52_rule(p)) && - (c = _tmp_44_rule(p), 1) + (c = star_etc_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); @@ -3420,13 +3668,13 @@ parameters_rule(Parser *p) } p->mark = mark; } - { // names_with_default [',' star_etc?] - asdl_seq* a; + { // param_with_default+ star_etc? + asdl_seq * a; void *b; if ( - (a = names_with_default_rule(p)) + (a = _loop1_53_rule(p)) && - (b = _tmp_45_rule(p), 1) + (b = star_etc_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); @@ -3458,25 +3706,45 @@ parameters_rule(Parser *p) return res; } -// slash_without_default: plain_names ',' '/' +// slash_no_default: param_no_default+ '/' ',' | param_no_default+ '/' &')' static asdl_seq* -slash_without_default_rule(Parser *p) +slash_no_default_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq* res = NULL; int mark = p->mark; - { // plain_names ',' '/' - asdl_seq* a; + { // param_no_default+ '/' ',' + asdl_seq * a; void *literal; void *literal_1; if ( - (a = plain_names_rule(p)) + (a = _loop1_54_rule(p)) && - (literal = _PyPegen_expect_token(p, 12)) + (literal = _PyPegen_expect_token(p, 17)) && - (literal_1 = _PyPegen_expect_token(p, 17)) + (literal_1 = _PyPegen_expect_token(p, 12)) + ) + { + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // param_no_default+ '/' &')' + asdl_seq * a; + void *literal; + if ( + (a = _loop1_55_rule(p)) + && + (literal = _PyPegen_expect_token(p, 17)) + && + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) ) { res = a; @@ -3493,7 +3761,9 @@ slash_without_default_rule(Parser *p) return res; } -// slash_with_default: [plain_names ','] names_with_default ',' '/' +// slash_with_default: +// | param_no_default* param_with_default+ '/' ',' +// | param_no_default* param_with_default+ '/' &')' static SlashWithDefault* slash_with_default_rule(Parser *p) { @@ -3502,19 +3772,42 @@ slash_with_default_rule(Parser *p) } SlashWithDefault* res = NULL; int mark = p->mark; - { // [plain_names ','] names_with_default ',' '/' - void *a; - asdl_seq* b; + { // param_no_default* param_with_default+ '/' ',' + asdl_seq * a; + asdl_seq * b; void *literal; void *literal_1; if ( - (a = _tmp_46_rule(p), 1) + (a = _loop0_56_rule(p)) && - (b = names_with_default_rule(p)) + (b = _loop1_57_rule(p)) && - (literal = _PyPegen_expect_token(p, 12)) + (literal = _PyPegen_expect_token(p, 17)) && - (literal_1 = _PyPegen_expect_token(p, 17)) + (literal_1 = _PyPegen_expect_token(p, 12)) + ) + { + res = _PyPegen_slash_with_default ( p , a , b ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // param_no_default* param_with_default+ '/' &')' + asdl_seq * a; + asdl_seq * b; + void *literal; + if ( + (a = _loop0_58_rule(p)) + && + (b = _loop1_59_rule(p)) + && + (literal = _PyPegen_expect_token(p, 17)) + && + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) ) { res = _PyPegen_slash_with_default ( p , a , b ); @@ -3532,9 +3825,9 @@ slash_with_default_rule(Parser *p) } // star_etc: -// | '*' plain_name name_with_optional_default* [',' kwds] ','? -// | '*' name_with_optional_default+ [',' kwds] ','? -// | kwds ','? +// | '*' param_no_default param_maybe_default* kwds? +// | '*' ',' param_maybe_default+ kwds? +// | kwds static StarEtc* star_etc_rule(Parser *p) { @@ -3543,23 +3836,19 @@ star_etc_rule(Parser *p) } StarEtc* res = NULL; int mark = p->mark; - { // '*' plain_name name_with_optional_default* [',' kwds] ','? + { // '*' param_no_default param_maybe_default* kwds? arg_ty a; asdl_seq * b; void *c; void *literal; - void *opt_var; - UNUSED(opt_var); // Silence compiler warnings if ( (literal = _PyPegen_expect_token(p, 16)) && - (a = plain_name_rule(p)) + (a = param_no_default_rule(p)) && - (b = _loop0_47_rule(p)) + (b = _loop0_60_rule(p)) && - (c = _tmp_48_rule(p), 1) - && - (opt_var = _PyPegen_expect_token(p, 12), 1) + (c = kwds_rule(p), 1) ) { res = _PyPegen_star_etc ( p , a , b , c ); @@ -3571,20 +3860,19 @@ star_etc_rule(Parser *p) } p->mark = mark; } - { // '*' name_with_optional_default+ [',' kwds] ','? + { // '*' ',' param_maybe_default+ kwds? asdl_seq * b; void *c; void *literal; - void *opt_var; - UNUSED(opt_var); // Silence compiler warnings + void *literal_1; if ( (literal = _PyPegen_expect_token(p, 16)) && - (b = _loop1_49_rule(p)) + (literal_1 = _PyPegen_expect_token(p, 12)) && - (c = _tmp_50_rule(p), 1) + (b = _loop1_61_rule(p)) && - (opt_var = _PyPegen_expect_token(p, 12), 1) + (c = kwds_rule(p), 1) ) { res = _PyPegen_star_etc ( p , NULL , b , c ); @@ -3596,14 +3884,10 @@ star_etc_rule(Parser *p) } p->mark = mark; } - { // kwds ','? + { // kwds arg_ty a; - void *opt_var; - UNUSED(opt_var); // Silence compiler warnings if ( (a = kwds_rule(p)) - && - (opt_var = _PyPegen_expect_token(p, 12), 1) ) { res = _PyPegen_star_etc ( p , NULL , NULL , a ); @@ -3620,28 +3904,25 @@ star_etc_rule(Parser *p) return res; } -// name_with_optional_default: ',' plain_name ['=' expression] -static NameDefaultPair* -name_with_optional_default_rule(Parser *p) +// kwds: '**' param_no_default +static arg_ty +kwds_rule(Parser *p) { if (p->error_indicator) { return NULL; } - NameDefaultPair* res = NULL; + arg_ty res = NULL; int mark = p->mark; - { // ',' plain_name ['=' expression] + { // '**' param_no_default arg_ty a; - void *b; void *literal; if ( - (literal = _PyPegen_expect_token(p, 12)) - && - (a = plain_name_rule(p)) + (literal = _PyPegen_expect_token(p, 35)) && - (b = _tmp_51_rule(p), 1) + (a = param_no_default_rule(p)) ) { - res = _PyPegen_name_default_pair ( p , a , b ); + res = a; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3655,22 +3936,48 @@ name_with_optional_default_rule(Parser *p) return res; } -// names_with_default: ','.name_with_default+ -static asdl_seq* -names_with_default_rule(Parser *p) +// param_no_default: param ',' TYPE_COMMENT? | param TYPE_COMMENT? &')' +static arg_ty +param_no_default_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq* res = NULL; + arg_ty res = NULL; int mark = p->mark; - { // ','.name_with_default+ - asdl_seq * a; + { // param ',' TYPE_COMMENT? + arg_ty a; + void *literal; + void *tc; if ( - (a = _gather_52_rule(p)) + (a = param_rule(p)) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) ) { - res = a; + res = _PyPegen_add_type_comment_to_arg ( p , a , tc ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // param TYPE_COMMENT? &')' + arg_ty a; + void *tc; + if ( + (a = param_rule(p)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) + ) + { + res = _PyPegen_add_type_comment_to_arg ( p , a , tc ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3684,28 +3991,54 @@ names_with_default_rule(Parser *p) return res; } -// name_with_default: plain_name '=' expression +// param_with_default: param default ',' TYPE_COMMENT? | param default TYPE_COMMENT? &')' static NameDefaultPair* -name_with_default_rule(Parser *p) +param_with_default_rule(Parser *p) { if (p->error_indicator) { return NULL; } NameDefaultPair* res = NULL; int mark = p->mark; - { // plain_name '=' expression - expr_ty e; + { // param default ',' TYPE_COMMENT? + arg_ty a; + expr_ty c; void *literal; - arg_ty n; + void *tc; if ( - (n = plain_name_rule(p)) + (a = param_rule(p)) && - (literal = _PyPegen_expect_token(p, 22)) + (c = default_rule(p)) && - (e = expression_rule(p)) + (literal = _PyPegen_expect_token(p, 12)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + ) + { + res = _PyPegen_name_default_pair ( p , a , c , tc ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // param default TYPE_COMMENT? &')' + arg_ty a; + expr_ty c; + void *tc; + if ( + (a = param_rule(p)) + && + (c = default_rule(p)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) ) { - res = _PyPegen_name_default_pair ( p , n , e ); + res = _PyPegen_name_default_pair ( p , a , c , tc ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3719,24 +4052,56 @@ name_with_default_rule(Parser *p) return res; } -// plain_names: ','.(plain_name !'=')+ -static asdl_seq* -plain_names_rule(Parser *p) +// param_maybe_default: +// | param default? ',' TYPE_COMMENT? +// | param default? TYPE_COMMENT? &')' +static NameDefaultPair* +param_maybe_default_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq* res = NULL; - if (_PyPegen_is_memoized(p, plain_names_type, &res)) - return res; + NameDefaultPair* res = NULL; int mark = p->mark; - { // ','.(plain_name !'=')+ - asdl_seq * a; + { // param default? ',' TYPE_COMMENT? + arg_ty a; + void *c; + void *literal; + void *tc; if ( - (a = _gather_54_rule(p)) + (a = param_rule(p)) + && + (c = default_rule(p), 1) + && + (literal = _PyPegen_expect_token(p, 12)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) ) { - res = a; + res = _PyPegen_name_default_pair ( p , a , c , tc ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // param default? TYPE_COMMENT? &')' + arg_ty a; + void *c; + void *tc; + if ( + (a = param_rule(p)) + && + (c = default_rule(p), 1) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && + _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 8) + ) + { + res = _PyPegen_name_default_pair ( p , a , c , tc ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3747,13 +4112,12 @@ plain_names_rule(Parser *p) } res = NULL; done: - _PyPegen_insert_memo(p, mark, plain_names_type, res); return res; } -// plain_name: NAME [':' annotation] +// param: NAME annotation? static arg_ty -plain_name_rule(Parser *p) +param_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -3768,13 +4132,13 @@ plain_name_rule(Parser *p) UNUSED(start_lineno); // Only used by EXTRA macro int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro - { // NAME [':' annotation] + { // NAME annotation? expr_ty a; void *b; if ( (a = _PyPegen_name_token(p)) && - (b = _tmp_56_rule(p), 1) + (b = annotation_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -3799,22 +4163,22 @@ plain_name_rule(Parser *p) return res; } -// kwds: '**' plain_name -static arg_ty -kwds_rule(Parser *p) +// annotation: ':' expression +static expr_ty +annotation_rule(Parser *p) { if (p->error_indicator) { return NULL; } - arg_ty res = NULL; + expr_ty res = NULL; int mark = p->mark; - { // '**' plain_name - arg_ty a; + { // ':' expression + expr_ty a; void *literal; if ( - (literal = _PyPegen_expect_token(p, 35)) + (literal = _PyPegen_expect_token(p, 11)) && - (a = plain_name_rule(p)) + (a = expression_rule(p)) ) { res = a; @@ -3831,22 +4195,29 @@ kwds_rule(Parser *p) return res; } -// annotation: expression +// default: '=' expression static expr_ty -annotation_rule(Parser *p) +default_rule(Parser *p) { if (p->error_indicator) { return NULL; } expr_ty res = NULL; int mark = p->mark; - { // expression - expr_ty expression_var; + { // '=' expression + expr_ty a; + void *literal; if ( - (expression_var = expression_rule(p)) + (literal = _PyPegen_expect_token(p, 22)) + && + (a = expression_rule(p)) ) { - res = expression_var; + res = a; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } goto done; } p->mark = mark; @@ -3868,7 +4239,7 @@ decorators_rule(Parser *p) { // (('@' named_expression NEWLINE))+ asdl_seq * a; if ( - (a = _loop1_57_rule(p)) + (a = _loop1_62_rule(p)) ) { res = a; @@ -3956,7 +4327,7 @@ class_def_raw_rule(Parser *p) && (a = _PyPegen_name_token(p)) && - (b = _tmp_58_rule(p), 1) + (b = _tmp_63_rule(p), 1) && (literal = _PyPegen_expect_token(p, 11)) && @@ -4062,7 +4433,7 @@ expressions_list_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_59_rule(p)) + (a = _gather_64_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4109,7 +4480,7 @@ star_expressions_rule(Parser *p) if ( (a = star_expression_rule(p)) && - (b = _loop1_61_rule(p)) + (b = _loop1_66_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4249,7 +4620,7 @@ star_named_expressions_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_62_rule(p)) + (a = _gather_67_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4463,7 +4834,7 @@ expressions_rule(Parser *p) if ( (a = expression_rule(p)) && - (b = _loop1_64_rule(p)) + (b = _loop1_69_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4685,11 +5056,11 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_slash_without_default_rule(p)) && - (b = _tmp_65_rule(p), 1) + (b = _tmp_70_rule(p), 1) && - (c = _tmp_66_rule(p), 1) + (c = _tmp_71_rule(p), 1) && - (d = _tmp_67_rule(p), 1) + (d = _tmp_72_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); @@ -4708,9 +5079,9 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_slash_with_default_rule(p)) && - (b = _tmp_68_rule(p), 1) + (b = _tmp_73_rule(p), 1) && - (c = _tmp_69_rule(p), 1) + (c = _tmp_74_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); @@ -4729,9 +5100,9 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_plain_names_rule(p)) && - (b = _tmp_70_rule(p), 1) + (b = _tmp_75_rule(p), 1) && - (c = _tmp_71_rule(p), 1) + (c = _tmp_76_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); @@ -4749,7 +5120,7 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_names_with_default_rule(p)) && - (b = _tmp_72_rule(p), 1) + (b = _tmp_77_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); @@ -4831,7 +5202,7 @@ lambda_slash_with_default_rule(Parser *p) void *literal; void *literal_1; if ( - (a = _tmp_73_rule(p), 1) + (a = _tmp_78_rule(p), 1) && (b = lambda_names_with_default_rule(p)) && @@ -4878,9 +5249,9 @@ lambda_star_etc_rule(Parser *p) && (a = lambda_plain_name_rule(p)) && - (b = _loop0_74_rule(p)) + (b = _loop0_79_rule(p)) && - (c = _tmp_75_rule(p), 1) + (c = _tmp_80_rule(p), 1) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4903,9 +5274,9 @@ lambda_star_etc_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 16)) && - (b = _loop1_76_rule(p)) + (b = _loop1_81_rule(p)) && - (c = _tmp_77_rule(p), 1) + (c = _tmp_82_rule(p), 1) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4961,10 +5332,10 @@ lambda_name_with_optional_default_rule(Parser *p) && (a = lambda_plain_name_rule(p)) && - (b = _tmp_78_rule(p), 1) + (b = _tmp_83_rule(p), 1) ) { - res = _PyPegen_name_default_pair ( p , a , b ); + res = _PyPegen_name_default_pair ( p , a , b , NULL ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -4990,7 +5361,7 @@ lambda_names_with_default_rule(Parser *p) { // ','.lambda_name_with_default+ asdl_seq * a; if ( - (a = _gather_79_rule(p)) + (a = _gather_84_rule(p)) ) { res = a; @@ -5028,7 +5399,7 @@ lambda_name_with_default_rule(Parser *p) (e = expression_rule(p)) ) { - res = _PyPegen_name_default_pair ( p , n , e ); + res = _PyPegen_name_default_pair ( p , n , e , NULL ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -5054,7 +5425,7 @@ lambda_plain_names_rule(Parser *p) { // ','.(lambda_plain_name !'=')+ asdl_seq * a; if ( - (a = _gather_81_rule(p)) + (a = _gather_86_rule(p)) ) { res = a; @@ -5173,7 +5544,7 @@ disjunction_rule(Parser *p) if ( (a = conjunction_rule(p)) && - (b = _loop1_83_rule(p)) + (b = _loop1_88_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -5235,7 +5606,7 @@ conjunction_rule(Parser *p) if ( (a = inversion_rule(p)) && - (b = _loop1_84_rule(p)) + (b = _loop1_89_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -5357,7 +5728,7 @@ comparison_rule(Parser *p) if ( (a = bitwise_or_rule(p)) && - (b = _loop1_85_rule(p)) + (b = _loop1_90_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -5569,10 +5940,10 @@ noteq_bitwise_or_rule(Parser *p) CmpopExprPair* res = NULL; int mark = p->mark; { // ('!=') bitwise_or - void *_tmp_86_var; + void *_tmp_91_var; expr_ty a; if ( - (_tmp_86_var = _tmp_86_rule(p)) + (_tmp_91_var = _tmp_91_rule(p)) && (a = bitwise_or_rule(p)) ) @@ -7014,7 +7385,7 @@ slices_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_87_rule(p)) + (a = _gather_92_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -7070,7 +7441,7 @@ slice_rule(Parser *p) && (b = expression_rule(p), 1) && - (c = _tmp_89_rule(p), 1) + (c = _tmp_94_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -7258,40 +7629,40 @@ atom_rule(Parser *p) p->mark = mark; } { // &'(' (tuple | group | genexp) - void *_tmp_90_var; + void *_tmp_95_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7) && - (_tmp_90_var = _tmp_90_rule(p)) + (_tmp_95_var = _tmp_95_rule(p)) ) { - res = _tmp_90_var; + res = _tmp_95_var; goto done; } p->mark = mark; } { // &'[' (list | listcomp) - void *_tmp_91_var; + void *_tmp_96_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9) && - (_tmp_91_var = _tmp_91_rule(p)) + (_tmp_96_var = _tmp_96_rule(p)) ) { - res = _tmp_91_var; + res = _tmp_96_var; goto done; } p->mark = mark; } { // &'{' (dict | set | dictcomp | setcomp) - void *_tmp_92_var; + void *_tmp_97_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25) && - (_tmp_92_var = _tmp_92_rule(p)) + (_tmp_97_var = _tmp_97_rule(p)) ) { - res = _tmp_92_var; + res = _tmp_97_var; goto done; } p->mark = mark; @@ -7338,7 +7709,7 @@ strings_rule(Parser *p) { // STRING+ asdl_seq * a; if ( - (a = _loop1_93_rule(p)) + (a = _loop1_98_rule(p)) ) { res = _PyPegen_concatenate_strings ( p , a ); @@ -7496,7 +7867,7 @@ tuple_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 7)) && - (a = _tmp_94_rule(p), 1) + (a = _tmp_99_rule(p), 1) && (literal_1 = _PyPegen_expect_token(p, 8)) ) @@ -7539,7 +7910,7 @@ group_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 7)) && - (a = _tmp_95_rule(p)) + (a = _tmp_100_rule(p)) && (literal_1 = _PyPegen_expect_token(p, 8)) ) @@ -7858,7 +8229,7 @@ kvpairs_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_96_rule(p)) + (a = _gather_101_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -7942,7 +8313,7 @@ for_if_clauses_rule(Parser *p) { // ((ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*))+ asdl_seq * a; if ( - (a = _loop1_98_rule(p)) + (a = _loop1_103_rule(p)) ) { res = a; @@ -8108,7 +8479,7 @@ args_rule(Parser *p) if ( (a = starred_expression_rule(p)) && - (b = _tmp_99_rule(p), 1) + (b = _tmp_104_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8157,7 +8528,7 @@ args_rule(Parser *p) if ( (a = named_expression_rule(p)) && - (b = _tmp_100_rule(p), 1) + (b = _tmp_105_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8199,11 +8570,11 @@ kwargs_rule(Parser *p) asdl_seq * b; void *literal; if ( - (a = _gather_101_rule(p)) + (a = _gather_106_rule(p)) && (literal = _PyPegen_expect_token(p, 12)) && - (b = _gather_103_rule(p)) + (b = _gather_108_rule(p)) ) { res = _PyPegen_join_sequences ( p , a , b ); @@ -8216,23 +8587,23 @@ kwargs_rule(Parser *p) p->mark = mark; } { // ','.kwarg_or_starred+ - asdl_seq * _gather_105_var; + asdl_seq * _gather_110_var; if ( - (_gather_105_var = _gather_105_rule(p)) + (_gather_110_var = _gather_110_rule(p)) ) { - res = _gather_105_var; + res = _gather_110_var; goto done; } p->mark = mark; } { // ','.kwarg_or_double_starred+ - asdl_seq * _gather_107_var; + asdl_seq * _gather_112_var; if ( - (_gather_107_var = _gather_107_rule(p)) + (_gather_112_var = _gather_112_rule(p)) ) { - res = _gather_107_var; + res = _gather_112_var; goto done; } p->mark = mark; @@ -8475,7 +8846,7 @@ star_targets_rule(Parser *p) if ( (a = star_target_rule(p)) && - (b = _loop0_109_rule(p)) + (b = _loop0_114_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8516,7 +8887,7 @@ star_targets_seq_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_110_rule(p)) + (a = _gather_115_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8564,7 +8935,7 @@ star_target_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 16)) && - (a = _tmp_112_rule(p)) + (a = _tmp_117_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8953,7 +9324,7 @@ del_targets_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_113_rule(p)) + (a = _gather_118_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -9206,7 +9577,7 @@ targets_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_115_rule(p)) + (a = _gather_120_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -9734,7 +10105,7 @@ incorrect_arguments_rule(Parser *p) && (literal = _PyPegen_expect_token(p, 12)) && - (opt_var = _tmp_117_rule(p), 1) + (opt_var = _tmp_122_rule(p), 1) ) { res = RAISE_SYNTAX_ERROR ( "Generator expression must be parenthesized" ); @@ -9869,7 +10240,7 @@ invalid_assignment_rule(Parser *p) && (expression_var_1 = expression_rule(p)) && - (opt_var = _tmp_118_rule(p), 1) + (opt_var = _tmp_123_rule(p), 1) ) { res = RAISE_SYNTAX_ERROR ( "illegal target for annotation" ); @@ -9882,15 +10253,15 @@ invalid_assignment_rule(Parser *p) p->mark = mark; } { // expression ('=' | augassign) (yield_expr | star_expressions) - void *_tmp_119_var; - void *_tmp_120_var; + void *_tmp_124_var; + void *_tmp_125_var; expr_ty a; if ( (a = expression_rule(p)) && - (_tmp_119_var = _tmp_119_rule(p)) + (_tmp_124_var = _tmp_124_rule(p)) && - (_tmp_120_var = _tmp_120_rule(p)) + (_tmp_125_var = _tmp_125_rule(p)) ) { res = RAISE_SYNTAX_ERROR ( "cannot assign to %s" , _PyPegen_get_expr_name ( a ) ); @@ -9948,12 +10319,12 @@ invalid_comprehension_rule(Parser *p) void * res = NULL; int mark = p->mark; { // ('[' | '(' | '{') '*' expression for_if_clauses - void *_tmp_121_var; + void *_tmp_126_var; expr_ty expression_var; asdl_seq* for_if_clauses_var; void *literal; if ( - (_tmp_121_var = _tmp_121_rule(p)) + (_tmp_126_var = _tmp_126_rule(p)) && (literal = _PyPegen_expect_token(p, 16)) && @@ -9977,7 +10348,7 @@ invalid_comprehension_rule(Parser *p) } // invalid_parameters: -// | [plain_names ','] (slash_with_default | names_with_default) ',' plain_names +// | param_no_default* (slash_with_default | param_with_default+) param_no_default static void * invalid_parameters_rule(Parser *p) { @@ -9986,20 +10357,16 @@ invalid_parameters_rule(Parser *p) } void * res = NULL; int mark = p->mark; - { // [plain_names ','] (slash_with_default | names_with_default) ',' plain_names - void *_tmp_123_var; - void *literal; - void *opt_var; - UNUSED(opt_var); // Silence compiler warnings - asdl_seq* plain_names_var; + { // param_no_default* (slash_with_default | param_with_default+) param_no_default + asdl_seq * _loop0_127_var; + void *_tmp_128_var; + arg_ty param_no_default_var; if ( - (opt_var = _tmp_122_rule(p), 1) - && - (_tmp_123_var = _tmp_123_rule(p)) + (_loop0_127_var = _loop0_127_rule(p)) && - (literal = _PyPegen_expect_token(p, 12)) + (_tmp_128_var = _tmp_128_rule(p)) && - (plain_names_var = plain_names_rule(p)) + (param_no_default_var = param_no_default_rule(p)) ) { res = RAISE_SYNTAX_ERROR ( "non-default argument follows default argument" ); @@ -10016,6 +10383,47 @@ invalid_parameters_rule(Parser *p) return res; } +// invalid_double_type_comments: TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT +static void * +invalid_double_type_comments_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // TYPE_COMMENT NEWLINE TYPE_COMMENT NEWLINE INDENT + void *indent_var; + void *newline_var; + void *newline_var_1; + void *type_comment_var; + void *type_comment_var_1; + if ( + (type_comment_var = _PyPegen_expect_token(p, TYPE_COMMENT)) + && + (newline_var = _PyPegen_expect_token(p, NEWLINE)) + && + (type_comment_var_1 = _PyPegen_expect_token(p, TYPE_COMMENT)) + && + (newline_var_1 = _PyPegen_expect_token(p, NEWLINE)) + && + (indent_var = _PyPegen_expect_token(p, INDENT)) + ) + { + res = RAISE_SYNTAX_ERROR ( "Cannot have two type comments on def" ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + // _loop0_1: NEWLINE static asdl_seq * _loop0_1_rule(Parser *p) @@ -10065,9 +10473,9 @@ _loop0_1_rule(Parser *p) return seq; } -// _loop1_2: statement +// _loop0_2: NEWLINE static asdl_seq * -_loop1_2_rule(Parser *p) +_loop0_2_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -10082,13 +10490,13 @@ _loop1_2_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // statement - asdl_seq* statement_var; + { // NEWLINE + void *newline_var; while ( - (statement_var = statement_rule(p)) + (newline_var = _PyPegen_expect_token(p, NEWLINE)) ) { - res = statement_var; + res = newline_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -10102,23 +10510,19 @@ _loop1_2_rule(Parser *p) } p->mark = mark; } - if (n == 0) { - PyMem_Free(children); - return NULL; - } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_2"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_2"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_2_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_2_type, seq); return seq; } -// _loop0_4: ';' small_stmt +// _loop0_4: ',' expression static asdl_seq * _loop0_4_rule(Parser *p) { @@ -10135,13 +10539,13 @@ _loop0_4_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ';' small_stmt - stmt_ty elem; + { // ',' expression + expr_ty elem; void *literal; while ( - (literal = _PyPegen_expect_token(p, 13)) + (literal = _PyPegen_expect_token(p, 12)) && - (elem = small_stmt_rule(p)) + (elem = expression_rule(p)) ) { res = elem; @@ -10175,7 +10579,7 @@ _loop0_4_rule(Parser *p) return seq; } -// _gather_3: small_stmt _loop0_4 +// _gather_3: expression _loop0_4 static asdl_seq * _gather_3_rule(Parser *p) { @@ -10184,11 +10588,11 @@ _gather_3_rule(Parser *p) } asdl_seq * res = NULL; int mark = p->mark; - { // small_stmt _loop0_4 - stmt_ty elem; + { // expression _loop0_4 + expr_ty elem; asdl_seq * seq; if ( - (elem = small_stmt_rule(p)) + (elem = expression_rule(p)) && (seq = _loop0_4_rule(p)) ) @@ -10203,116 +10607,82 @@ _gather_3_rule(Parser *p) return res; } -// _tmp_5: 'import' | 'from' -static void * -_tmp_5_rule(Parser *p) +// _loop0_6: ',' expression +static asdl_seq * +_loop0_6_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // 'import' - void *keyword; - if ( - (keyword = _PyPegen_expect_token(p, 513)) - ) - { - res = keyword; - goto done; - } - p->mark = mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; } - { // 'from' - void *keyword; - if ( - (keyword = _PyPegen_expect_token(p, 514)) + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' expression + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = expression_rule(p)) ) { - res = keyword; - goto done; + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; -} - -// _tmp_6: 'def' | '@' | ASYNC -static void * -_tmp_6_rule(Parser *p) -{ - if (p->error_indicator) { + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_6"); + PyMem_Free(children); return NULL; } - void * res = NULL; - int mark = p->mark; - { // 'def' - void *keyword; - if ( - (keyword = _PyPegen_expect_token(p, 522)) - ) - { - res = keyword; - goto done; - } - p->mark = mark; - } - { // '@' - void *literal; - if ( - (literal = _PyPegen_expect_token(p, 49)) - ) - { - res = literal; - goto done; - } - p->mark = mark; - } - { // ASYNC - void *async_var; - if ( - (async_var = _PyPegen_expect_token(p, ASYNC)) - ) - { - res = async_var; - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_6_type, seq); + return seq; } -// _tmp_7: 'class' | '@' -static void * -_tmp_7_rule(Parser *p) +// _gather_5: expression _loop0_6 +static asdl_seq * +_gather_5_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + asdl_seq * res = NULL; int mark = p->mark; - { // 'class' - void *keyword; - if ( - (keyword = _PyPegen_expect_token(p, 523)) - ) - { - res = keyword; - goto done; - } - p->mark = mark; - } - { // '@' - void *literal; + { // expression _loop0_6 + expr_ty elem; + asdl_seq * seq; if ( - (literal = _PyPegen_expect_token(p, 49)) + (elem = expression_rule(p)) + && + (seq = _loop0_6_rule(p)) ) { - res = literal; + res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = mark; @@ -10322,101 +10692,82 @@ _tmp_7_rule(Parser *p) return res; } -// _tmp_8: 'with' | ASYNC -static void * -_tmp_8_rule(Parser *p) +// _loop0_8: ',' expression +static asdl_seq * +_loop0_8_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // 'with' - void *keyword; - if ( - (keyword = _PyPegen_expect_token(p, 519)) - ) - { - res = keyword; - goto done; - } - p->mark = mark; - } - { // ASYNC - void *async_var; - if ( - (async_var = _PyPegen_expect_token(p, ASYNC)) - ) - { - res = async_var; - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - -// _tmp_9: 'for' | ASYNC -static void * -_tmp_9_rule(Parser *p) -{ - if (p->error_indicator) { + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); return NULL; } - void * res = NULL; - int mark = p->mark; - { // 'for' - void *keyword; - if ( - (keyword = _PyPegen_expect_token(p, 517)) + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' expression + expr_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = expression_rule(p)) ) { - res = keyword; - goto done; + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - { // ASYNC - void *async_var; - if ( - (async_var = _PyPegen_expect_token(p, ASYNC)) - ) - { - res = async_var; - goto done; - } - p->mark = mark; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_8"); + PyMem_Free(children); + return NULL; } - res = NULL; - done: - return res; + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_8_type, seq); + return seq; } -// _tmp_10: '=' annotated_rhs -static void * -_tmp_10_rule(Parser *p) +// _gather_7: expression _loop0_8 +static asdl_seq * +_gather_7_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + asdl_seq * res = NULL; int mark = p->mark; - { // '=' annotated_rhs - expr_ty d; - void *literal; + { // expression _loop0_8 + expr_ty elem; + asdl_seq * seq; if ( - (literal = _PyPegen_expect_token(p, 22)) + (elem = expression_rule(p)) && - (d = annotated_rhs_rule(p)) + (seq = _loop0_8_rule(p)) ) { - res = d; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } + res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = mark; @@ -10426,75 +10777,82 @@ _tmp_10_rule(Parser *p) return res; } -// _tmp_11: '(' inside_paren_ann_assign_target ')' | ann_assign_subscript_attribute_target -static void * -_tmp_11_rule(Parser *p) +// _loop0_10: ',' expression +static asdl_seq * +_loop0_10_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // '(' inside_paren_ann_assign_target ')' - expr_ty b; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' expression + expr_ty elem; void *literal; - void *literal_1; - if ( - (literal = _PyPegen_expect_token(p, 7)) - && - (b = inside_paren_ann_assign_target_rule(p)) + while ( + (literal = _PyPegen_expect_token(p, 12)) && - (literal_1 = _PyPegen_expect_token(p, 8)) + (elem = expression_rule(p)) ) { - res = b; + res = elem; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + PyMem_Free(children); return NULL; } - goto done; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - { // ann_assign_subscript_attribute_target - expr_ty ann_assign_subscript_attribute_target_var; - if ( - (ann_assign_subscript_attribute_target_var = ann_assign_subscript_attribute_target_rule(p)) - ) - { - res = ann_assign_subscript_attribute_target_var; - goto done; - } - p->mark = mark; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_10"); + PyMem_Free(children); + return NULL; } - res = NULL; - done: - return res; + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_10_type, seq); + return seq; } -// _tmp_12: '=' annotated_rhs -static void * -_tmp_12_rule(Parser *p) +// _gather_9: expression _loop0_10 +static asdl_seq * +_gather_9_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + asdl_seq * res = NULL; int mark = p->mark; - { // '=' annotated_rhs - expr_ty d; - void *literal; + { // expression _loop0_10 + expr_ty elem; + asdl_seq * seq; if ( - (literal = _PyPegen_expect_token(p, 22)) + (elem = expression_rule(p)) && - (d = annotated_rhs_rule(p)) + (seq = _loop0_10_rule(p)) ) { - res = d; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } + res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = mark; @@ -10504,9 +10862,9 @@ _tmp_12_rule(Parser *p) return res; } -// _loop1_13: (star_targets '=') +// _loop1_11: statement static asdl_seq * -_loop1_13_rule(Parser *p) +_loop1_11_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -10521,13 +10879,13 @@ _loop1_13_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // (star_targets '=') - void *_tmp_124_var; + { // statement + asdl_seq* statement_var; while ( - (_tmp_124_var = _tmp_124_rule(p)) + (statement_var = statement_rule(p)) ) { - res = _tmp_124_var; + res = statement_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -10547,91 +10905,19 @@ _loop1_13_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_13"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_11"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_13_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_11_type, seq); return seq; } -// _tmp_14: yield_expr | star_expressions -static void * -_tmp_14_rule(Parser *p) -{ - if (p->error_indicator) { - return NULL; - } - void * res = NULL; - int mark = p->mark; - { // yield_expr - expr_ty yield_expr_var; - if ( - (yield_expr_var = yield_expr_rule(p)) - ) - { - res = yield_expr_var; - goto done; - } - p->mark = mark; - } - { // star_expressions - expr_ty star_expressions_var; - if ( - (star_expressions_var = star_expressions_rule(p)) - ) - { - res = star_expressions_var; - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - -// _tmp_15: yield_expr | star_expressions -static void * -_tmp_15_rule(Parser *p) -{ - if (p->error_indicator) { - return NULL; - } - void * res = NULL; - int mark = p->mark; - { // yield_expr - expr_ty yield_expr_var; - if ( - (yield_expr_var = yield_expr_rule(p)) - ) - { - res = yield_expr_var; - goto done; - } - p->mark = mark; - } - { // star_expressions - expr_ty star_expressions_var; - if ( - (star_expressions_var = star_expressions_rule(p)) - ) - { - res = star_expressions_var; - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - -// _loop0_17: ',' NAME +// _loop0_13: ';' small_stmt static asdl_seq * -_loop0_17_rule(Parser *p) +_loop0_13_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -10646,13 +10932,13 @@ _loop0_17_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ',' NAME - expr_ty elem; + { // ';' small_stmt + stmt_ty elem; void *literal; while ( - (literal = _PyPegen_expect_token(p, 12)) + (literal = _PyPegen_expect_token(p, 13)) && - (elem = _PyPegen_name_token(p)) + (elem = small_stmt_rule(p)) ) { res = elem; @@ -10676,32 +10962,32 @@ _loop0_17_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_17"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_13"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_17_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_13_type, seq); return seq; } -// _gather_16: NAME _loop0_17 +// _gather_12: small_stmt _loop0_13 static asdl_seq * -_gather_16_rule(Parser *p) +_gather_12_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // NAME _loop0_17 - expr_ty elem; + { // small_stmt _loop0_13 + stmt_ty elem; asdl_seq * seq; if ( - (elem = _PyPegen_name_token(p)) + (elem = small_stmt_rule(p)) && - (seq = _loop0_17_rule(p)) + (seq = _loop0_13_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -10714,82 +11000,80 @@ _gather_16_rule(Parser *p) return res; } -// _loop0_19: ',' NAME -static asdl_seq * -_loop0_19_rule(Parser *p) +// _tmp_14: 'import' | 'from' +static void * +_tmp_14_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void *res = NULL; + void * res = NULL; int mark = p->mark; - int start_mark = p->mark; - void **children = PyMem_Malloc(sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "Parser out of memory"); - return NULL; - } - ssize_t children_capacity = 1; - ssize_t n = 0; - { // ',' NAME - expr_ty elem; - void *literal; - while ( - (literal = _PyPegen_expect_token(p, 12)) - && - (elem = _PyPegen_name_token(p)) + { // 'import' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 513)) ) { - res = elem; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - PyMem_Free(children); - return NULL; - } - if (n == children_capacity) { - children_capacity *= 2; - children = PyMem_Realloc(children, children_capacity*sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "realloc None"); - return NULL; - } - } - children[n++] = res; - mark = p->mark; + res = keyword; + goto done; } p->mark = mark; } - asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); - if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_19"); - PyMem_Free(children); - return NULL; + { // 'from' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 514)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; } - for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); - PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_19_type, seq); - return seq; + res = NULL; + done: + return res; } -// _gather_18: NAME _loop0_19 -static asdl_seq * -_gather_18_rule(Parser *p) +// _tmp_15: 'def' | '@' | ASYNC +static void * +_tmp_15_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq * res = NULL; + void * res = NULL; int mark = p->mark; - { // NAME _loop0_19 - expr_ty elem; - asdl_seq * seq; + { // 'def' + void *keyword; if ( - (elem = _PyPegen_name_token(p)) - && - (seq = _loop0_19_rule(p)) + (keyword = _PyPegen_expect_token(p, 522)) ) { - res = _PyPegen_seq_insert_in_front(p, elem, seq); + res = keyword; + goto done; + } + p->mark = mark; + } + { // '@' + void *literal; + if ( + (literal = _PyPegen_expect_token(p, 49)) + ) + { + res = literal; + goto done; + } + p->mark = mark; + } + { // ASYNC + void *async_var; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) + ) + { + res = async_var; goto done; } p->mark = mark; @@ -10799,29 +11083,33 @@ _gather_18_rule(Parser *p) return res; } -// _tmp_20: ',' expression +// _tmp_16: 'class' | '@' static void * -_tmp_20_rule(Parser *p) +_tmp_16_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // ',' expression + { // 'class' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 523)) + ) + { + res = keyword; + goto done; + } + p->mark = mark; + } + { // '@' void *literal; - expr_ty z; if ( - (literal = _PyPegen_expect_token(p, 12)) - && - (z = expression_rule(p)) + (literal = _PyPegen_expect_token(p, 49)) ) { - res = z; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } + res = literal; goto done; } p->mark = mark; @@ -10831,184 +11119,147 @@ _tmp_20_rule(Parser *p) return res; } -// _loop0_21: ('.' | '...') -static asdl_seq * -_loop0_21_rule(Parser *p) +// _tmp_17: 'with' | ASYNC +static void * +_tmp_17_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void *res = NULL; + void * res = NULL; int mark = p->mark; - int start_mark = p->mark; - void **children = PyMem_Malloc(sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "Parser out of memory"); - return NULL; - } - ssize_t children_capacity = 1; - ssize_t n = 0; - { // ('.' | '...') - void *_tmp_125_var; - while ( - (_tmp_125_var = _tmp_125_rule(p)) + { // 'with' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 519)) ) { - res = _tmp_125_var; - if (n == children_capacity) { - children_capacity *= 2; - children = PyMem_Realloc(children, children_capacity*sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "realloc None"); - return NULL; - } - } - children[n++] = res; - mark = p->mark; + res = keyword; + goto done; } p->mark = mark; } - asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); - if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_21"); - PyMem_Free(children); - return NULL; + { // ASYNC + void *async_var; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) + ) + { + res = async_var; + goto done; + } + p->mark = mark; } - for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); - PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_21_type, seq); - return seq; + res = NULL; + done: + return res; } -// _loop1_22: ('.' | '...') -static asdl_seq * -_loop1_22_rule(Parser *p) +// _tmp_18: 'for' | ASYNC +static void * +_tmp_18_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void *res = NULL; + void * res = NULL; int mark = p->mark; - int start_mark = p->mark; - void **children = PyMem_Malloc(sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "Parser out of memory"); - return NULL; - } - ssize_t children_capacity = 1; - ssize_t n = 0; - { // ('.' | '...') - void *_tmp_126_var; - while ( - (_tmp_126_var = _tmp_126_rule(p)) + { // 'for' + void *keyword; + if ( + (keyword = _PyPegen_expect_token(p, 517)) ) { - res = _tmp_126_var; - if (n == children_capacity) { - children_capacity *= 2; - children = PyMem_Realloc(children, children_capacity*sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "realloc None"); - return NULL; - } - } - children[n++] = res; - mark = p->mark; + res = keyword; + goto done; } p->mark = mark; } - if (n == 0) { - PyMem_Free(children); - return NULL; - } - asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); - if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_22"); - PyMem_Free(children); - return NULL; + { // ASYNC + void *async_var; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) + ) + { + res = async_var; + goto done; + } + p->mark = mark; } - for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); - PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_22_type, seq); - return seq; + res = NULL; + done: + return res; } -// _loop0_24: ',' import_from_as_name -static asdl_seq * -_loop0_24_rule(Parser *p) +// _tmp_19: '=' annotated_rhs +static void * +_tmp_19_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void *res = NULL; + void * res = NULL; int mark = p->mark; - int start_mark = p->mark; - void **children = PyMem_Malloc(sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "Parser out of memory"); - return NULL; - } - ssize_t children_capacity = 1; - ssize_t n = 0; - { // ',' import_from_as_name - alias_ty elem; + { // '=' annotated_rhs + expr_ty d; void *literal; - while ( - (literal = _PyPegen_expect_token(p, 12)) + if ( + (literal = _PyPegen_expect_token(p, 22)) && - (elem = import_from_as_name_rule(p)) + (d = annotated_rhs_rule(p)) ) { - res = elem; + res = d; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; - PyMem_Free(children); return NULL; } - if (n == children_capacity) { - children_capacity *= 2; - children = PyMem_Realloc(children, children_capacity*sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "realloc None"); - return NULL; - } - } - children[n++] = res; - mark = p->mark; + goto done; } p->mark = mark; } - asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); - if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_24"); - PyMem_Free(children); - return NULL; - } - for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); - PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_24_type, seq); - return seq; + res = NULL; + done: + return res; } -// _gather_23: import_from_as_name _loop0_24 -static asdl_seq * -_gather_23_rule(Parser *p) +// _tmp_20: '(' inside_paren_ann_assign_target ')' | ann_assign_subscript_attribute_target +static void * +_tmp_20_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq * res = NULL; + void * res = NULL; int mark = p->mark; - { // import_from_as_name _loop0_24 - alias_ty elem; - asdl_seq * seq; + { // '(' inside_paren_ann_assign_target ')' + expr_ty b; + void *literal; + void *literal_1; if ( - (elem = import_from_as_name_rule(p)) + (literal = _PyPegen_expect_token(p, 7)) + && + (b = inside_paren_ann_assign_target_rule(p)) && - (seq = _loop0_24_rule(p)) + (literal_1 = _PyPegen_expect_token(p, 8)) ) { - res = _PyPegen_seq_insert_in_front(p, elem, seq); + res = b; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ann_assign_subscript_attribute_target + expr_ty ann_assign_subscript_attribute_target_var; + if ( + (ann_assign_subscript_attribute_target_var = ann_assign_subscript_attribute_target_rule(p)) + ) + { + res = ann_assign_subscript_attribute_target_var; goto done; } p->mark = mark; @@ -11018,25 +11269,25 @@ _gather_23_rule(Parser *p) return res; } -// _tmp_25: 'as' NAME +// _tmp_21: '=' annotated_rhs static void * -_tmp_25_rule(Parser *p) +_tmp_21_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // 'as' NAME - void *keyword; - expr_ty z; + { // '=' annotated_rhs + expr_ty d; + void *literal; if ( - (keyword = _PyPegen_expect_token(p, 531)) + (literal = _PyPegen_expect_token(p, 22)) && - (z = _PyPegen_name_token(p)) + (d = annotated_rhs_rule(p)) ) { - res = z; + res = d; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -11050,9 +11301,9 @@ _tmp_25_rule(Parser *p) return res; } -// _loop0_27: ',' dotted_as_name +// _loop1_22: (star_targets '=') static asdl_seq * -_loop0_27_rule(Parser *p) +_loop1_22_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -11067,21 +11318,13 @@ _loop0_27_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ',' dotted_as_name - alias_ty elem; - void *literal; + { // (star_targets '=') + void *_tmp_129_var; while ( - (literal = _PyPegen_expect_token(p, 12)) - && - (elem = dotted_as_name_rule(p)) + (_tmp_129_var = _tmp_129_rule(p)) ) { - res = elem; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - PyMem_Free(children); - return NULL; - } + res = _tmp_129_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -11095,37 +11338,49 @@ _loop0_27_rule(Parser *p) } p->mark = mark; } + if (n == 0) { + PyMem_Free(children); + return NULL; + } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_27"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_22"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_27_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_22_type, seq); return seq; } -// _gather_26: dotted_as_name _loop0_27 -static asdl_seq * -_gather_26_rule(Parser *p) +// _tmp_23: yield_expr | star_expressions +static void * +_tmp_23_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq * res = NULL; + void * res = NULL; int mark = p->mark; - { // dotted_as_name _loop0_27 - alias_ty elem; - asdl_seq * seq; + { // yield_expr + expr_ty yield_expr_var; if ( - (elem = dotted_as_name_rule(p)) - && - (seq = _loop0_27_rule(p)) + (yield_expr_var = yield_expr_rule(p)) ) { - res = _PyPegen_seq_insert_in_front(p, elem, seq); + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; goto done; } p->mark = mark; @@ -11135,29 +11390,33 @@ _gather_26_rule(Parser *p) return res; } -// _tmp_28: 'as' NAME +// _tmp_24: yield_expr | star_expressions static void * -_tmp_28_rule(Parser *p) +_tmp_24_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // 'as' NAME - void *keyword; - expr_ty z; + { // yield_expr + expr_ty yield_expr_var; if ( - (keyword = _PyPegen_expect_token(p, 531)) - && - (z = _PyPegen_name_token(p)) + (yield_expr_var = yield_expr_rule(p)) ) { - res = z; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } + res = yield_expr_var; + goto done; + } + p->mark = mark; + } + { // star_expressions + expr_ty star_expressions_var; + if ( + (star_expressions_var = star_expressions_rule(p)) + ) + { + res = star_expressions_var; goto done; } p->mark = mark; @@ -11167,9 +11426,9 @@ _tmp_28_rule(Parser *p) return res; } -// _loop0_30: ',' with_item +// _loop0_26: ',' NAME static asdl_seq * -_loop0_30_rule(Parser *p) +_loop0_26_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -11184,13 +11443,13 @@ _loop0_30_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ',' with_item - withitem_ty elem; + { // ',' NAME + expr_ty elem; void *literal; while ( (literal = _PyPegen_expect_token(p, 12)) && - (elem = with_item_rule(p)) + (elem = _PyPegen_name_token(p)) ) { res = elem; @@ -11214,32 +11473,32 @@ _loop0_30_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_30"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_26"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_30_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_26_type, seq); return seq; } -// _gather_29: with_item _loop0_30 +// _gather_25: NAME _loop0_26 static asdl_seq * -_gather_29_rule(Parser *p) +_gather_25_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // with_item _loop0_30 - withitem_ty elem; + { // NAME _loop0_26 + expr_ty elem; asdl_seq * seq; if ( - (elem = with_item_rule(p)) + (elem = _PyPegen_name_token(p)) && - (seq = _loop0_30_rule(p)) + (seq = _loop0_26_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -11252,9 +11511,9 @@ _gather_29_rule(Parser *p) return res; } -// _loop0_32: ',' with_item +// _loop0_28: ',' NAME static asdl_seq * -_loop0_32_rule(Parser *p) +_loop0_28_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -11269,13 +11528,13 @@ _loop0_32_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ',' with_item - withitem_ty elem; + { // ',' NAME + expr_ty elem; void *literal; while ( (literal = _PyPegen_expect_token(p, 12)) && - (elem = with_item_rule(p)) + (elem = _PyPegen_name_token(p)) ) { res = elem; @@ -11299,32 +11558,32 @@ _loop0_32_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_32"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_28"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_32_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_28_type, seq); return seq; } -// _gather_31: with_item _loop0_32 +// _gather_27: NAME _loop0_28 static asdl_seq * -_gather_31_rule(Parser *p) +_gather_27_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // with_item _loop0_32 - withitem_ty elem; + { // NAME _loop0_28 + expr_ty elem; asdl_seq * seq; if ( - (elem = with_item_rule(p)) + (elem = _PyPegen_name_token(p)) && - (seq = _loop0_32_rule(p)) + (seq = _loop0_28_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -11337,25 +11596,25 @@ _gather_31_rule(Parser *p) return res; } -// _tmp_33: 'as' target +// _tmp_29: ',' expression static void * -_tmp_33_rule(Parser *p) +_tmp_29_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // 'as' target - void *keyword; - expr_ty t; + { // ',' expression + void *literal; + expr_ty z; if ( - (keyword = _PyPegen_expect_token(p, 531)) + (literal = _PyPegen_expect_token(p, 12)) && - (t = target_rule(p)) + (z = expression_rule(p)) ) { - res = t; + res = z; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -11369,9 +11628,9 @@ _tmp_33_rule(Parser *p) return res; } -// _loop1_34: except_block +// _loop0_30: ('.' | '...') static asdl_seq * -_loop1_34_rule(Parser *p) +_loop0_30_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -11386,13 +11645,62 @@ _loop1_34_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // except_block - excepthandler_ty except_block_var; + { // ('.' | '...') + void *_tmp_130_var; while ( - (except_block_var = except_block_rule(p)) + (_tmp_130_var = _tmp_130_rule(p)) ) { - res = except_block_var; + res = _tmp_130_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_30"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_30_type, seq); + return seq; +} + +// _loop1_31: ('.' | '...') +static asdl_seq * +_loop1_31_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('.' | '...') + void *_tmp_131_var; + while ( + (_tmp_131_var = _tmp_131_rule(p)) + ) + { + res = _tmp_131_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -11412,71 +11720,92 @@ _loop1_34_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_34"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_31"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_34_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_31_type, seq); return seq; } -// _tmp_35: 'as' target -static void * -_tmp_35_rule(Parser *p) +// _loop0_33: ',' import_from_as_name +static asdl_seq * +_loop0_33_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // 'as' target - void *keyword; - expr_ty z; - if ( - (keyword = _PyPegen_expect_token(p, 531)) + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' import_from_as_name + alias_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) && - (z = target_rule(p)) + (elem = import_from_as_name_rule(p)) ) { - res = z; + res = elem; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + PyMem_Free(children); return NULL; } - goto done; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_33"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_33_type, seq); + return seq; } -// _tmp_36: 'from' expression -static void * -_tmp_36_rule(Parser *p) +// _gather_32: import_from_as_name _loop0_33 +static asdl_seq * +_gather_32_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + asdl_seq * res = NULL; int mark = p->mark; - { // 'from' expression - void *keyword; - expr_ty z; + { // import_from_as_name _loop0_33 + alias_ty elem; + asdl_seq * seq; if ( - (keyword = _PyPegen_expect_token(p, 514)) + (elem = import_from_as_name_rule(p)) && - (z = expression_rule(p)) + (seq = _loop0_33_rule(p)) ) { - res = z; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } + res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = mark; @@ -11486,22 +11815,22 @@ _tmp_36_rule(Parser *p) return res; } -// _tmp_37: '->' annotation +// _tmp_34: 'as' NAME static void * -_tmp_37_rule(Parser *p) +_tmp_34_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // '->' annotation - void *literal; + { // 'as' NAME + void *keyword; expr_ty z; if ( - (literal = _PyPegen_expect_token(p, 51)) + (keyword = _PyPegen_expect_token(p, 531)) && - (z = annotation_rule(p)) + (z = _PyPegen_name_token(p)) ) { res = z; @@ -11518,61 +11847,82 @@ _tmp_37_rule(Parser *p) return res; } -// _tmp_38: ',' plain_names -static void * -_tmp_38_rule(Parser *p) +// _loop0_36: ',' dotted_as_name +static asdl_seq * +_loop0_36_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // ',' plain_names + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' dotted_as_name + alias_ty elem; void *literal; - asdl_seq* x; - if ( + while ( (literal = _PyPegen_expect_token(p, 12)) && - (x = plain_names_rule(p)) + (elem = dotted_as_name_rule(p)) ) { - res = x; + res = elem; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + PyMem_Free(children); return NULL; } - goto done; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_36"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_36_type, seq); + return seq; } -// _tmp_39: ',' names_with_default -static void * -_tmp_39_rule(Parser *p) +// _gather_35: dotted_as_name _loop0_36 +static asdl_seq * +_gather_35_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + asdl_seq * res = NULL; int mark = p->mark; - { // ',' names_with_default - void *literal; - asdl_seq* y; + { // dotted_as_name _loop0_36 + alias_ty elem; + asdl_seq * seq; if ( - (literal = _PyPegen_expect_token(p, 12)) + (elem = dotted_as_name_rule(p)) && - (y = names_with_default_rule(p)) + (seq = _loop0_36_rule(p)) ) { - res = y; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } + res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = mark; @@ -11582,22 +11932,22 @@ _tmp_39_rule(Parser *p) return res; } -// _tmp_40: ',' star_etc? +// _tmp_37: 'as' NAME static void * -_tmp_40_rule(Parser *p) +_tmp_37_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // ',' star_etc? - void *literal; - void *z; + { // 'as' NAME + void *keyword; + expr_ty z; if ( - (literal = _PyPegen_expect_token(p, 12)) + (keyword = _PyPegen_expect_token(p, 531)) && - (z = star_etc_rule(p), 1) + (z = _PyPegen_name_token(p)) ) { res = z; @@ -11614,61 +11964,167 @@ _tmp_40_rule(Parser *p) return res; } -// _tmp_41: ',' names_with_default -static void * -_tmp_41_rule(Parser *p) +// _loop0_39: ',' with_item +static asdl_seq * +_loop0_39_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // ',' names_with_default + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' with_item + withitem_ty elem; void *literal; - asdl_seq* y; - if ( + while ( (literal = _PyPegen_expect_token(p, 12)) && - (y = names_with_default_rule(p)) + (elem = with_item_rule(p)) ) { - res = y; + res = elem; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + PyMem_Free(children); return NULL; } - goto done; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_39"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_39_type, seq); + return seq; } -// _tmp_42: ',' star_etc? -static void * -_tmp_42_rule(Parser *p) +// _gather_38: with_item _loop0_39 +static asdl_seq * +_gather_38_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + asdl_seq * res = NULL; int mark = p->mark; - { // ',' star_etc? - void *literal; - void *z; + { // with_item _loop0_39 + withitem_ty elem; + asdl_seq * seq; if ( - (literal = _PyPegen_expect_token(p, 12)) + (elem = with_item_rule(p)) && - (z = star_etc_rule(p), 1) + (seq = _loop0_39_rule(p)) ) { - res = z; + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_41: ',' with_item +static asdl_seq * +_loop0_41_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' with_item + withitem_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = with_item_rule(p)) + ) + { + res = elem; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; + PyMem_Free(children); return NULL; } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_41"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_41_type, seq); + return seq; +} + +// _gather_40: with_item _loop0_41 +static asdl_seq * +_gather_40_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // with_item _loop0_41 + withitem_ty elem; + asdl_seq * seq; + if ( + (elem = with_item_rule(p)) + && + (seq = _loop0_41_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = mark; @@ -11678,25 +12134,25 @@ _tmp_42_rule(Parser *p) return res; } -// _tmp_43: ',' names_with_default +// _tmp_42: 'as' target static void * -_tmp_43_rule(Parser *p) +_tmp_42_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // ',' names_with_default - void *literal; - asdl_seq* y; + { // 'as' target + void *keyword; + expr_ty t; if ( - (literal = _PyPegen_expect_token(p, 12)) + (keyword = _PyPegen_expect_token(p, 531)) && - (y = names_with_default_rule(p)) + (t = target_rule(p)) ) { - res = y; + res = t; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -11710,7 +12166,60 @@ _tmp_43_rule(Parser *p) return res; } -// _tmp_44: ',' star_etc? +// _loop1_43: except_block +static asdl_seq * +_loop1_43_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // except_block + excepthandler_ty except_block_var; + while ( + (except_block_var = except_block_rule(p)) + ) + { + res = except_block_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_43"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_43_type, seq); + return seq; +} + +// _tmp_44: 'as' target static void * _tmp_44_rule(Parser *p) { @@ -11719,13 +12228,13 @@ _tmp_44_rule(Parser *p) } void * res = NULL; int mark = p->mark; - { // ',' star_etc? - void *literal; - void *z; + { // 'as' target + void *keyword; + expr_ty z; if ( - (literal = _PyPegen_expect_token(p, 12)) + (keyword = _PyPegen_expect_token(p, 531)) && - (z = star_etc_rule(p), 1) + (z = target_rule(p)) ) { res = z; @@ -11742,7 +12251,7 @@ _tmp_44_rule(Parser *p) return res; } -// _tmp_45: ',' star_etc? +// _tmp_45: 'from' expression static void * _tmp_45_rule(Parser *p) { @@ -11751,13 +12260,13 @@ _tmp_45_rule(Parser *p) } void * res = NULL; int mark = p->mark; - { // ',' star_etc? - void *literal; - void *z; + { // 'from' expression + void *keyword; + expr_ty z; if ( - (literal = _PyPegen_expect_token(p, 12)) + (keyword = _PyPegen_expect_token(p, 514)) && - (z = star_etc_rule(p), 1) + (z = expression_rule(p)) ) { res = z; @@ -11774,7 +12283,7 @@ _tmp_45_rule(Parser *p) return res; } -// _tmp_46: plain_names ',' +// _tmp_46: '->' expression static void * _tmp_46_rule(Parser *p) { @@ -11783,16 +12292,16 @@ _tmp_46_rule(Parser *p) } void * res = NULL; int mark = p->mark; - { // plain_names ',' + { // '->' expression void *literal; - asdl_seq* n; + expr_ty z; if ( - (n = plain_names_rule(p)) + (literal = _PyPegen_expect_token(p, 51)) && - (literal = _PyPegen_expect_token(p, 12)) + (z = expression_rule(p)) ) { - res = n; + res = z; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -11806,9 +12315,339 @@ _tmp_46_rule(Parser *p) return res; } -// _loop0_47: name_with_optional_default +// _tmp_47: NEWLINE INDENT +static void * +_tmp_47_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // NEWLINE INDENT + void *indent_var; + void *newline_var; + if ( + (newline_var = _PyPegen_expect_token(p, NEWLINE)) + && + (indent_var = _PyPegen_expect_token(p, INDENT)) + ) + { + res = _PyPegen_dummy_name(p, newline_var, indent_var); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_48: param_no_default +static asdl_seq * +_loop0_48_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_no_default + arg_ty param_no_default_var; + while ( + (param_no_default_var = param_no_default_rule(p)) + ) + { + res = param_no_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_48"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_48_type, seq); + return seq; +} + +// _loop0_49: param_with_default +static asdl_seq * +_loop0_49_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) + ) + { + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_49"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_49_type, seq); + return seq; +} + +// _loop0_50: param_with_default +static asdl_seq * +_loop0_50_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) + ) + { + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_50"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_50_type, seq); + return seq; +} + +// _loop1_51: param_no_default +static asdl_seq * +_loop1_51_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_no_default + arg_ty param_no_default_var; + while ( + (param_no_default_var = param_no_default_rule(p)) + ) + { + res = param_no_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_51"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_51_type, seq); + return seq; +} + +// _loop0_52: param_with_default +static asdl_seq * +_loop0_52_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) + ) + { + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_52"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_52_type, seq); + return seq; +} + +// _loop1_53: param_with_default +static asdl_seq * +_loop1_53_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) + ) + { + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_53"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_53_type, seq); + return seq; +} + +// _loop1_54: param_no_default static asdl_seq * -_loop0_47_rule(Parser *p) +_loop1_54_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -11823,13 +12662,13 @@ _loop0_47_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // name_with_optional_default - NameDefaultPair* name_with_optional_default_var; + { // param_no_default + arg_ty param_no_default_var; while ( - (name_with_optional_default_var = name_with_optional_default_rule(p)) + (param_no_default_var = param_no_default_rule(p)) ) { - res = name_with_optional_default_var; + res = param_no_default_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -11843,53 +12682,25 @@ _loop0_47_rule(Parser *p) } p->mark = mark; } + if (n == 0) { + PyMem_Free(children); + return NULL; + } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_47"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_54"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_47_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_54_type, seq); return seq; } -// _tmp_48: ',' kwds -static void * -_tmp_48_rule(Parser *p) -{ - if (p->error_indicator) { - return NULL; - } - void * res = NULL; - int mark = p->mark; - { // ',' kwds - arg_ty d; - void *literal; - if ( - (literal = _PyPegen_expect_token(p, 12)) - && - (d = kwds_rule(p)) - ) - { - res = d; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - -// _loop1_49: name_with_optional_default +// _loop1_55: param_no_default static asdl_seq * -_loop1_49_rule(Parser *p) +_loop1_55_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -11904,13 +12715,13 @@ _loop1_49_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // name_with_optional_default - NameDefaultPair* name_with_optional_default_var; + { // param_no_default + arg_ty param_no_default_var; while ( - (name_with_optional_default_var = name_with_optional_default_rule(p)) + (param_no_default_var = param_no_default_rule(p)) ) { - res = name_with_optional_default_var; + res = param_no_default_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -11930,83 +12741,121 @@ _loop1_49_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_49"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_55"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_49_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_55_type, seq); return seq; } -// _tmp_50: ',' kwds -static void * -_tmp_50_rule(Parser *p) +// _loop0_56: param_no_default +static asdl_seq * +_loop0_56_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // ',' kwds - arg_ty d; - void *literal; - if ( - (literal = _PyPegen_expect_token(p, 12)) - && - (d = kwds_rule(p)) + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_no_default + arg_ty param_no_default_var; + while ( + (param_no_default_var = param_no_default_rule(p)) ) { - res = d; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; + res = param_no_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } } - goto done; + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_56"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_56_type, seq); + return seq; } -// _tmp_51: '=' expression -static void * -_tmp_51_rule(Parser *p) +// _loop1_57: param_with_default +static asdl_seq * +_loop1_57_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // '=' expression - expr_ty e; - void *literal; - if ( - (literal = _PyPegen_expect_token(p, 22)) - && - (e = expression_rule(p)) + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) ) { - res = e; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } } - goto done; + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_57"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_57_type, seq); + return seq; } -// _loop0_53: ',' name_with_default +// _loop0_58: param_no_default static asdl_seq * -_loop0_53_rule(Parser *p) +_loop0_58_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12021,21 +12870,13 @@ _loop0_53_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ',' name_with_default - NameDefaultPair* elem; - void *literal; + { // param_no_default + arg_ty param_no_default_var; while ( - (literal = _PyPegen_expect_token(p, 12)) - && - (elem = name_with_default_rule(p)) + (param_no_default_var = param_no_default_rule(p)) ) { - res = elem; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - PyMem_Free(children); - return NULL; - } + res = param_no_default_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12051,47 +12892,72 @@ _loop0_53_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_53"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_58"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_53_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_58_type, seq); return seq; } -// _gather_52: name_with_default _loop0_53 +// _loop1_59: param_with_default static asdl_seq * -_gather_52_rule(Parser *p) +_loop1_59_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq * res = NULL; + void *res = NULL; int mark = p->mark; - { // name_with_default _loop0_53 - NameDefaultPair* elem; - asdl_seq * seq; - if ( - (elem = name_with_default_rule(p)) - && - (seq = _loop0_53_rule(p)) + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) ) { - res = _PyPegen_seq_insert_in_front(p, elem, seq); - goto done; + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_59"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_59_type, seq); + return seq; } -// _loop0_55: ',' (plain_name !'=') +// _loop0_60: param_maybe_default static asdl_seq * -_loop0_55_rule(Parser *p) +_loop0_60_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12106,21 +12972,13 @@ _loop0_55_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // ',' (plain_name !'=') - void *elem; - void *literal; + { // param_maybe_default + NameDefaultPair* param_maybe_default_var; while ( - (literal = _PyPegen_expect_token(p, 12)) - && - (elem = _tmp_127_rule(p)) + (param_maybe_default_var = param_maybe_default_rule(p)) ) { - res = elem; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - PyMem_Free(children); - return NULL; - } + res = param_maybe_default_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12136,79 +12994,72 @@ _loop0_55_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_55"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_60"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_55_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_60_type, seq); return seq; } -// _gather_54: (plain_name !'=') _loop0_55 +// _loop1_61: param_maybe_default static asdl_seq * -_gather_54_rule(Parser *p) +_loop1_61_rule(Parser *p) { if (p->error_indicator) { return NULL; } - asdl_seq * res = NULL; + void *res = NULL; int mark = p->mark; - { // (plain_name !'=') _loop0_55 - void *elem; - asdl_seq * seq; - if ( - (elem = _tmp_127_rule(p)) - && - (seq = _loop0_55_rule(p)) - ) - { - res = _PyPegen_seq_insert_in_front(p, elem, seq); - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - -// _tmp_56: ':' annotation -static void * -_tmp_56_rule(Parser *p) -{ - if (p->error_indicator) { + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); return NULL; } - void * res = NULL; - int mark = p->mark; - { // ':' annotation - void *literal; - expr_ty z; - if ( - (literal = _PyPegen_expect_token(p, 11)) - && - (z = annotation_rule(p)) + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_maybe_default + NameDefaultPair* param_maybe_default_var; + while ( + (param_maybe_default_var = param_maybe_default_rule(p)) ) { - res = z; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; + res = param_maybe_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } } - goto done; + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_61"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_61_type, seq); + return seq; } -// _loop1_57: ('@' named_expression NEWLINE) +// _loop1_62: ('@' named_expression NEWLINE) static asdl_seq * -_loop1_57_rule(Parser *p) +_loop1_62_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12224,12 +13075,12 @@ _loop1_57_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('@' named_expression NEWLINE) - void *_tmp_128_var; + void *_tmp_132_var; while ( - (_tmp_128_var = _tmp_128_rule(p)) + (_tmp_132_var = _tmp_132_rule(p)) ) { - res = _tmp_128_var; + res = _tmp_132_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12249,19 +13100,19 @@ _loop1_57_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_57"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_62"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_57_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_62_type, seq); return seq; } -// _tmp_58: '(' arguments? ')' +// _tmp_63: '(' arguments? ')' static void * -_tmp_58_rule(Parser *p) +_tmp_63_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12294,9 +13145,9 @@ _tmp_58_rule(Parser *p) return res; } -// _loop0_60: ',' star_expression +// _loop0_65: ',' star_expression static asdl_seq * -_loop0_60_rule(Parser *p) +_loop0_65_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12341,32 +13192,32 @@ _loop0_60_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_60"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_65"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_60_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_65_type, seq); return seq; } -// _gather_59: star_expression _loop0_60 +// _gather_64: star_expression _loop0_65 static asdl_seq * -_gather_59_rule(Parser *p) +_gather_64_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_expression _loop0_60 + { // star_expression _loop0_65 expr_ty elem; asdl_seq * seq; if ( (elem = star_expression_rule(p)) && - (seq = _loop0_60_rule(p)) + (seq = _loop0_65_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -12379,9 +13230,9 @@ _gather_59_rule(Parser *p) return res; } -// _loop1_61: (',' star_expression) +// _loop1_66: (',' star_expression) static asdl_seq * -_loop1_61_rule(Parser *p) +_loop1_66_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12397,12 +13248,12 @@ _loop1_61_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' star_expression) - void *_tmp_129_var; + void *_tmp_133_var; while ( - (_tmp_129_var = _tmp_129_rule(p)) + (_tmp_133_var = _tmp_133_rule(p)) ) { - res = _tmp_129_var; + res = _tmp_133_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12422,19 +13273,19 @@ _loop1_61_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_61"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_66"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_61_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_66_type, seq); return seq; } -// _loop0_63: ',' star_named_expression +// _loop0_68: ',' star_named_expression static asdl_seq * -_loop0_63_rule(Parser *p) +_loop0_68_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12479,32 +13330,32 @@ _loop0_63_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_63"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_68"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_63_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_68_type, seq); return seq; } -// _gather_62: star_named_expression _loop0_63 +// _gather_67: star_named_expression _loop0_68 static asdl_seq * -_gather_62_rule(Parser *p) +_gather_67_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_named_expression _loop0_63 + { // star_named_expression _loop0_68 expr_ty elem; asdl_seq * seq; if ( (elem = star_named_expression_rule(p)) && - (seq = _loop0_63_rule(p)) + (seq = _loop0_68_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -12517,9 +13368,9 @@ _gather_62_rule(Parser *p) return res; } -// _loop1_64: (',' expression) +// _loop1_69: (',' expression) static asdl_seq * -_loop1_64_rule(Parser *p) +_loop1_69_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12535,12 +13386,12 @@ _loop1_64_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' expression) - void *_tmp_130_var; + void *_tmp_134_var; while ( - (_tmp_130_var = _tmp_130_rule(p)) + (_tmp_134_var = _tmp_134_rule(p)) ) { - res = _tmp_130_var; + res = _tmp_134_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12560,19 +13411,19 @@ _loop1_64_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_64"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_69"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_64_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_69_type, seq); return seq; } -// _tmp_65: ',' lambda_plain_names +// _tmp_70: ',' lambda_plain_names static void * -_tmp_65_rule(Parser *p) +_tmp_70_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12602,9 +13453,9 @@ _tmp_65_rule(Parser *p) return res; } -// _tmp_66: ',' lambda_names_with_default +// _tmp_71: ',' lambda_names_with_default static void * -_tmp_66_rule(Parser *p) +_tmp_71_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12634,9 +13485,9 @@ _tmp_66_rule(Parser *p) return res; } -// _tmp_67: ',' lambda_star_etc? +// _tmp_72: ',' lambda_star_etc? static void * -_tmp_67_rule(Parser *p) +_tmp_72_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12666,9 +13517,9 @@ _tmp_67_rule(Parser *p) return res; } -// _tmp_68: ',' lambda_names_with_default +// _tmp_73: ',' lambda_names_with_default static void * -_tmp_68_rule(Parser *p) +_tmp_73_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12698,9 +13549,9 @@ _tmp_68_rule(Parser *p) return res; } -// _tmp_69: ',' lambda_star_etc? +// _tmp_74: ',' lambda_star_etc? static void * -_tmp_69_rule(Parser *p) +_tmp_74_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12730,9 +13581,9 @@ _tmp_69_rule(Parser *p) return res; } -// _tmp_70: ',' lambda_names_with_default +// _tmp_75: ',' lambda_names_with_default static void * -_tmp_70_rule(Parser *p) +_tmp_75_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12762,9 +13613,9 @@ _tmp_70_rule(Parser *p) return res; } -// _tmp_71: ',' lambda_star_etc? +// _tmp_76: ',' lambda_star_etc? static void * -_tmp_71_rule(Parser *p) +_tmp_76_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12794,9 +13645,9 @@ _tmp_71_rule(Parser *p) return res; } -// _tmp_72: ',' lambda_star_etc? +// _tmp_77: ',' lambda_star_etc? static void * -_tmp_72_rule(Parser *p) +_tmp_77_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12826,9 +13677,9 @@ _tmp_72_rule(Parser *p) return res; } -// _tmp_73: lambda_plain_names ',' +// _tmp_78: lambda_plain_names ',' static void * -_tmp_73_rule(Parser *p) +_tmp_78_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12858,9 +13709,9 @@ _tmp_73_rule(Parser *p) return res; } -// _loop0_74: lambda_name_with_optional_default +// _loop0_79: lambda_name_with_optional_default static asdl_seq * -_loop0_74_rule(Parser *p) +_loop0_79_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12897,19 +13748,19 @@ _loop0_74_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_74"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_79"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_74_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_79_type, seq); return seq; } -// _tmp_75: ',' lambda_kwds +// _tmp_80: ',' lambda_kwds static void * -_tmp_75_rule(Parser *p) +_tmp_80_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12939,9 +13790,9 @@ _tmp_75_rule(Parser *p) return res; } -// _loop1_76: lambda_name_with_optional_default +// _loop1_81: lambda_name_with_optional_default static asdl_seq * -_loop1_76_rule(Parser *p) +_loop1_81_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12982,19 +13833,19 @@ _loop1_76_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_76"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_81"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_76_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_81_type, seq); return seq; } -// _tmp_77: ',' lambda_kwds +// _tmp_82: ',' lambda_kwds static void * -_tmp_77_rule(Parser *p) +_tmp_82_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13024,9 +13875,9 @@ _tmp_77_rule(Parser *p) return res; } -// _tmp_78: '=' expression +// _tmp_83: '=' expression static void * -_tmp_78_rule(Parser *p) +_tmp_83_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13056,9 +13907,9 @@ _tmp_78_rule(Parser *p) return res; } -// _loop0_80: ',' lambda_name_with_default +// _loop0_85: ',' lambda_name_with_default static asdl_seq * -_loop0_80_rule(Parser *p) +_loop0_85_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13103,32 +13954,32 @@ _loop0_80_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_80"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_85"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_80_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_85_type, seq); return seq; } -// _gather_79: lambda_name_with_default _loop0_80 +// _gather_84: lambda_name_with_default _loop0_85 static asdl_seq * -_gather_79_rule(Parser *p) +_gather_84_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // lambda_name_with_default _loop0_80 + { // lambda_name_with_default _loop0_85 NameDefaultPair* elem; asdl_seq * seq; if ( (elem = lambda_name_with_default_rule(p)) && - (seq = _loop0_80_rule(p)) + (seq = _loop0_85_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13141,9 +13992,9 @@ _gather_79_rule(Parser *p) return res; } -// _loop0_82: ',' (lambda_plain_name !'=') +// _loop0_87: ',' (lambda_plain_name !'=') static asdl_seq * -_loop0_82_rule(Parser *p) +_loop0_87_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13164,7 +14015,7 @@ _loop0_82_rule(Parser *p) while ( (literal = _PyPegen_expect_token(p, 12)) && - (elem = _tmp_131_rule(p)) + (elem = _tmp_135_rule(p)) ) { res = elem; @@ -13188,32 +14039,32 @@ _loop0_82_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_82"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_87"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_82_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_87_type, seq); return seq; } -// _gather_81: (lambda_plain_name !'=') _loop0_82 +// _gather_86: (lambda_plain_name !'=') _loop0_87 static asdl_seq * -_gather_81_rule(Parser *p) +_gather_86_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // (lambda_plain_name !'=') _loop0_82 + { // (lambda_plain_name !'=') _loop0_87 void *elem; asdl_seq * seq; if ( - (elem = _tmp_131_rule(p)) + (elem = _tmp_135_rule(p)) && - (seq = _loop0_82_rule(p)) + (seq = _loop0_87_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13226,9 +14077,9 @@ _gather_81_rule(Parser *p) return res; } -// _loop1_83: ('or' conjunction) +// _loop1_88: ('or' conjunction) static asdl_seq * -_loop1_83_rule(Parser *p) +_loop1_88_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13244,12 +14095,12 @@ _loop1_83_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('or' conjunction) - void *_tmp_132_var; + void *_tmp_136_var; while ( - (_tmp_132_var = _tmp_132_rule(p)) + (_tmp_136_var = _tmp_136_rule(p)) ) { - res = _tmp_132_var; + res = _tmp_136_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13269,19 +14120,19 @@ _loop1_83_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_83"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_88"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_83_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_88_type, seq); return seq; } -// _loop1_84: ('and' inversion) +// _loop1_89: ('and' inversion) static asdl_seq * -_loop1_84_rule(Parser *p) +_loop1_89_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13297,12 +14148,12 @@ _loop1_84_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('and' inversion) - void *_tmp_133_var; + void *_tmp_137_var; while ( - (_tmp_133_var = _tmp_133_rule(p)) + (_tmp_137_var = _tmp_137_rule(p)) ) { - res = _tmp_133_var; + res = _tmp_137_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13322,19 +14173,19 @@ _loop1_84_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_84"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_89"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_84_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_89_type, seq); return seq; } -// _loop1_85: compare_op_bitwise_or_pair +// _loop1_90: compare_op_bitwise_or_pair static asdl_seq * -_loop1_85_rule(Parser *p) +_loop1_90_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13375,19 +14226,19 @@ _loop1_85_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_85"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_90"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_85_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_90_type, seq); return seq; } -// _tmp_86: '!=' +// _tmp_91: '!=' static void * -_tmp_86_rule(Parser *p) +_tmp_91_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13414,9 +14265,9 @@ _tmp_86_rule(Parser *p) return res; } -// _loop0_88: ',' slice +// _loop0_93: ',' slice static asdl_seq * -_loop0_88_rule(Parser *p) +_loop0_93_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13461,32 +14312,32 @@ _loop0_88_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_88"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_93"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_88_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_93_type, seq); return seq; } -// _gather_87: slice _loop0_88 +// _gather_92: slice _loop0_93 static asdl_seq * -_gather_87_rule(Parser *p) +_gather_92_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // slice _loop0_88 + { // slice _loop0_93 expr_ty elem; asdl_seq * seq; if ( (elem = slice_rule(p)) && - (seq = _loop0_88_rule(p)) + (seq = _loop0_93_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13499,9 +14350,9 @@ _gather_87_rule(Parser *p) return res; } -// _tmp_89: ':' expression? +// _tmp_94: ':' expression? static void * -_tmp_89_rule(Parser *p) +_tmp_94_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13531,9 +14382,9 @@ _tmp_89_rule(Parser *p) return res; } -// _tmp_90: tuple | group | genexp +// _tmp_95: tuple | group | genexp static void * -_tmp_90_rule(Parser *p) +_tmp_95_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13578,9 +14429,9 @@ _tmp_90_rule(Parser *p) return res; } -// _tmp_91: list | listcomp +// _tmp_96: list | listcomp static void * -_tmp_91_rule(Parser *p) +_tmp_96_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13614,9 +14465,9 @@ _tmp_91_rule(Parser *p) return res; } -// _tmp_92: dict | set | dictcomp | setcomp +// _tmp_97: dict | set | dictcomp | setcomp static void * -_tmp_92_rule(Parser *p) +_tmp_97_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13672,9 +14523,9 @@ _tmp_92_rule(Parser *p) return res; } -// _loop1_93: STRING +// _loop1_98: STRING static asdl_seq * -_loop1_93_rule(Parser *p) +_loop1_98_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13715,19 +14566,19 @@ _loop1_93_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_93"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_98"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_93_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_98_type, seq); return seq; } -// _tmp_94: star_named_expression ',' star_named_expressions? +// _tmp_99: star_named_expression ',' star_named_expressions? static void * -_tmp_94_rule(Parser *p) +_tmp_99_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13760,9 +14611,9 @@ _tmp_94_rule(Parser *p) return res; } -// _tmp_95: yield_expr | named_expression +// _tmp_100: yield_expr | named_expression static void * -_tmp_95_rule(Parser *p) +_tmp_100_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13796,9 +14647,9 @@ _tmp_95_rule(Parser *p) return res; } -// _loop0_97: ',' kvpair +// _loop0_102: ',' kvpair static asdl_seq * -_loop0_97_rule(Parser *p) +_loop0_102_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13843,32 +14694,32 @@ _loop0_97_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_97"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_102"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_97_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_102_type, seq); return seq; } -// _gather_96: kvpair _loop0_97 +// _gather_101: kvpair _loop0_102 static asdl_seq * -_gather_96_rule(Parser *p) +_gather_101_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kvpair _loop0_97 + { // kvpair _loop0_102 KeyValuePair* elem; asdl_seq * seq; if ( (elem = kvpair_rule(p)) && - (seq = _loop0_97_rule(p)) + (seq = _loop0_102_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13881,9 +14732,9 @@ _gather_96_rule(Parser *p) return res; } -// _loop1_98: (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) +// _loop1_103: (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) static asdl_seq * -_loop1_98_rule(Parser *p) +_loop1_103_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13899,12 +14750,12 @@ _loop1_98_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) - void *_tmp_134_var; + void *_tmp_138_var; while ( - (_tmp_134_var = _tmp_134_rule(p)) + (_tmp_138_var = _tmp_138_rule(p)) ) { - res = _tmp_134_var; + res = _tmp_138_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13924,19 +14775,19 @@ _loop1_98_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_98"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_103"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_98_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_103_type, seq); return seq; } -// _tmp_99: ',' args +// _tmp_104: ',' args static void * -_tmp_99_rule(Parser *p) +_tmp_104_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13966,9 +14817,9 @@ _tmp_99_rule(Parser *p) return res; } -// _tmp_100: ',' args +// _tmp_105: ',' args static void * -_tmp_100_rule(Parser *p) +_tmp_105_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13998,9 +14849,9 @@ _tmp_100_rule(Parser *p) return res; } -// _loop0_102: ',' kwarg_or_starred +// _loop0_107: ',' kwarg_or_starred static asdl_seq * -_loop0_102_rule(Parser *p) +_loop0_107_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14045,32 +14896,32 @@ _loop0_102_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_102"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_107"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_102_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_107_type, seq); return seq; } -// _gather_101: kwarg_or_starred _loop0_102 +// _gather_106: kwarg_or_starred _loop0_107 static asdl_seq * -_gather_101_rule(Parser *p) +_gather_106_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_starred _loop0_102 + { // kwarg_or_starred _loop0_107 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_starred_rule(p)) && - (seq = _loop0_102_rule(p)) + (seq = _loop0_107_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14083,9 +14934,9 @@ _gather_101_rule(Parser *p) return res; } -// _loop0_104: ',' kwarg_or_double_starred +// _loop0_109: ',' kwarg_or_double_starred static asdl_seq * -_loop0_104_rule(Parser *p) +_loop0_109_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14130,32 +14981,32 @@ _loop0_104_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_104"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_109"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_104_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_109_type, seq); return seq; } -// _gather_103: kwarg_or_double_starred _loop0_104 +// _gather_108: kwarg_or_double_starred _loop0_109 static asdl_seq * -_gather_103_rule(Parser *p) +_gather_108_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_double_starred _loop0_104 + { // kwarg_or_double_starred _loop0_109 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_double_starred_rule(p)) && - (seq = _loop0_104_rule(p)) + (seq = _loop0_109_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14168,9 +15019,9 @@ _gather_103_rule(Parser *p) return res; } -// _loop0_106: ',' kwarg_or_starred +// _loop0_111: ',' kwarg_or_starred static asdl_seq * -_loop0_106_rule(Parser *p) +_loop0_111_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14215,32 +15066,32 @@ _loop0_106_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_106"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_111"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_106_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_111_type, seq); return seq; } -// _gather_105: kwarg_or_starred _loop0_106 +// _gather_110: kwarg_or_starred _loop0_111 static asdl_seq * -_gather_105_rule(Parser *p) +_gather_110_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_starred _loop0_106 + { // kwarg_or_starred _loop0_111 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_starred_rule(p)) && - (seq = _loop0_106_rule(p)) + (seq = _loop0_111_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14253,9 +15104,9 @@ _gather_105_rule(Parser *p) return res; } -// _loop0_108: ',' kwarg_or_double_starred +// _loop0_113: ',' kwarg_or_double_starred static asdl_seq * -_loop0_108_rule(Parser *p) +_loop0_113_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14300,32 +15151,32 @@ _loop0_108_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_108"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_113"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_108_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_113_type, seq); return seq; } -// _gather_107: kwarg_or_double_starred _loop0_108 +// _gather_112: kwarg_or_double_starred _loop0_113 static asdl_seq * -_gather_107_rule(Parser *p) +_gather_112_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_double_starred _loop0_108 + { // kwarg_or_double_starred _loop0_113 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_double_starred_rule(p)) && - (seq = _loop0_108_rule(p)) + (seq = _loop0_113_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14338,9 +15189,9 @@ _gather_107_rule(Parser *p) return res; } -// _loop0_109: (',' star_target) +// _loop0_114: (',' star_target) static asdl_seq * -_loop0_109_rule(Parser *p) +_loop0_114_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14356,12 +15207,12 @@ _loop0_109_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' star_target) - void *_tmp_135_var; + void *_tmp_139_var; while ( - (_tmp_135_var = _tmp_135_rule(p)) + (_tmp_139_var = _tmp_139_rule(p)) ) { - res = _tmp_135_var; + res = _tmp_139_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -14377,19 +15228,19 @@ _loop0_109_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_109"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_114"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_109_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_114_type, seq); return seq; } -// _loop0_111: ',' star_target +// _loop0_116: ',' star_target static asdl_seq * -_loop0_111_rule(Parser *p) +_loop0_116_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14434,32 +15285,32 @@ _loop0_111_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_111"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_116"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_111_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_116_type, seq); return seq; } -// _gather_110: star_target _loop0_111 +// _gather_115: star_target _loop0_116 static asdl_seq * -_gather_110_rule(Parser *p) +_gather_115_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_target _loop0_111 + { // star_target _loop0_116 expr_ty elem; asdl_seq * seq; if ( (elem = star_target_rule(p)) && - (seq = _loop0_111_rule(p)) + (seq = _loop0_116_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14472,9 +15323,9 @@ _gather_110_rule(Parser *p) return res; } -// _tmp_112: !'*' star_target +// _tmp_117: !'*' star_target static void * -_tmp_112_rule(Parser *p) +_tmp_117_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14499,9 +15350,9 @@ _tmp_112_rule(Parser *p) return res; } -// _loop0_114: ',' del_target +// _loop0_119: ',' del_target static asdl_seq * -_loop0_114_rule(Parser *p) +_loop0_119_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14546,32 +15397,32 @@ _loop0_114_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_114"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_119"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_114_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_119_type, seq); return seq; } -// _gather_113: del_target _loop0_114 +// _gather_118: del_target _loop0_119 static asdl_seq * -_gather_113_rule(Parser *p) +_gather_118_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // del_target _loop0_114 + { // del_target _loop0_119 expr_ty elem; asdl_seq * seq; if ( (elem = del_target_rule(p)) && - (seq = _loop0_114_rule(p)) + (seq = _loop0_119_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14584,9 +15435,9 @@ _gather_113_rule(Parser *p) return res; } -// _loop0_116: ',' target +// _loop0_121: ',' target static asdl_seq * -_loop0_116_rule(Parser *p) +_loop0_121_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14631,32 +15482,32 @@ _loop0_116_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_116"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_121"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_116_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_121_type, seq); return seq; } -// _gather_115: target _loop0_116 +// _gather_120: target _loop0_121 static asdl_seq * -_gather_115_rule(Parser *p) +_gather_120_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // target _loop0_116 + { // target _loop0_121 expr_ty elem; asdl_seq * seq; if ( (elem = target_rule(p)) && - (seq = _loop0_116_rule(p)) + (seq = _loop0_121_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14669,9 +15520,9 @@ _gather_115_rule(Parser *p) return res; } -// _tmp_117: args | expression for_if_clauses +// _tmp_122: args | expression for_if_clauses static void * -_tmp_117_rule(Parser *p) +_tmp_122_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14708,9 +15559,9 @@ _tmp_117_rule(Parser *p) return res; } -// _tmp_118: '=' annotated_rhs +// _tmp_123: '=' annotated_rhs static void * -_tmp_118_rule(Parser *p) +_tmp_123_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14736,9 +15587,9 @@ _tmp_118_rule(Parser *p) return res; } -// _tmp_119: '=' | augassign +// _tmp_124: '=' | augassign static void * -_tmp_119_rule(Parser *p) +_tmp_124_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14772,9 +15623,9 @@ _tmp_119_rule(Parser *p) return res; } -// _tmp_120: yield_expr | star_expressions +// _tmp_125: yield_expr | star_expressions static void * -_tmp_120_rule(Parser *p) +_tmp_125_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14808,9 +15659,9 @@ _tmp_120_rule(Parser *p) return res; } -// _tmp_121: '[' | '(' | '{' +// _tmp_126: '[' | '(' | '{' static void * -_tmp_121_rule(Parser *p) +_tmp_126_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14855,37 +15706,58 @@ _tmp_121_rule(Parser *p) return res; } -// _tmp_122: plain_names ',' -static void * -_tmp_122_rule(Parser *p) +// _loop0_127: param_no_default +static asdl_seq * +_loop0_127_rule(Parser *p) { if (p->error_indicator) { return NULL; } - void * res = NULL; + void *res = NULL; int mark = p->mark; - { // plain_names ',' - void *literal; - asdl_seq* plain_names_var; - if ( - (plain_names_var = plain_names_rule(p)) - && - (literal = _PyPegen_expect_token(p, 12)) + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_no_default + arg_ty param_no_default_var; + while ( + (param_no_default_var = param_no_default_rule(p)) ) { - res = _PyPegen_dummy_name(p, plain_names_var, literal); - goto done; + res = param_no_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; } p->mark = mark; } - res = NULL; - done: - return res; + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_127"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_127_type, seq); + return seq; } -// _tmp_123: slash_with_default | names_with_default +// _tmp_128: slash_with_default | param_with_default+ static void * -_tmp_123_rule(Parser *p) +_tmp_128_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14903,13 +15775,13 @@ _tmp_123_rule(Parser *p) } p->mark = mark; } - { // names_with_default - asdl_seq* names_with_default_var; + { // param_with_default+ + asdl_seq * _loop1_140_var; if ( - (names_with_default_var = names_with_default_rule(p)) + (_loop1_140_var = _loop1_140_rule(p)) ) { - res = names_with_default_var; + res = _loop1_140_var; goto done; } p->mark = mark; @@ -14919,9 +15791,9 @@ _tmp_123_rule(Parser *p) return res; } -// _tmp_124: star_targets '=' +// _tmp_129: star_targets '=' static void * -_tmp_124_rule(Parser *p) +_tmp_129_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14951,9 +15823,9 @@ _tmp_124_rule(Parser *p) return res; } -// _tmp_125: '.' | '...' +// _tmp_130: '.' | '...' static void * -_tmp_125_rule(Parser *p) +_tmp_130_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14987,9 +15859,9 @@ _tmp_125_rule(Parser *p) return res; } -// _tmp_126: '.' | '...' +// _tmp_131: '.' | '...' static void * -_tmp_126_rule(Parser *p) +_tmp_131_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15023,36 +15895,9 @@ _tmp_126_rule(Parser *p) return res; } -// _tmp_127: plain_name !'=' -static void * -_tmp_127_rule(Parser *p) -{ - if (p->error_indicator) { - return NULL; - } - void * res = NULL; - int mark = p->mark; - { // plain_name !'=' - arg_ty plain_name_var; - if ( - (plain_name_var = plain_name_rule(p)) - && - _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) - ) - { - res = plain_name_var; - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - -// _tmp_128: '@' named_expression NEWLINE +// _tmp_132: '@' named_expression NEWLINE static void * -_tmp_128_rule(Parser *p) +_tmp_132_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15085,9 +15930,9 @@ _tmp_128_rule(Parser *p) return res; } -// _tmp_129: ',' star_expression +// _tmp_133: ',' star_expression static void * -_tmp_129_rule(Parser *p) +_tmp_133_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15117,9 +15962,9 @@ _tmp_129_rule(Parser *p) return res; } -// _tmp_130: ',' expression +// _tmp_134: ',' expression static void * -_tmp_130_rule(Parser *p) +_tmp_134_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15149,9 +15994,9 @@ _tmp_130_rule(Parser *p) return res; } -// _tmp_131: lambda_plain_name !'=' +// _tmp_135: lambda_plain_name !'=' static void * -_tmp_131_rule(Parser *p) +_tmp_135_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15176,9 +16021,9 @@ _tmp_131_rule(Parser *p) return res; } -// _tmp_132: 'or' conjunction +// _tmp_136: 'or' conjunction static void * -_tmp_132_rule(Parser *p) +_tmp_136_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15208,9 +16053,9 @@ _tmp_132_rule(Parser *p) return res; } -// _tmp_133: 'and' inversion +// _tmp_137: 'and' inversion static void * -_tmp_133_rule(Parser *p) +_tmp_137_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15240,9 +16085,9 @@ _tmp_133_rule(Parser *p) return res; } -// _tmp_134: ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* +// _tmp_138: ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* static void * -_tmp_134_rule(Parser *p) +_tmp_138_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15267,7 +16112,7 @@ _tmp_134_rule(Parser *p) && (b = disjunction_rule(p)) && - (c = _loop0_136_rule(p)) + (c = _loop0_141_rule(p)) ) { res = _Py_comprehension ( a , b , c , y != NULL , p -> arena ); @@ -15284,9 +16129,9 @@ _tmp_134_rule(Parser *p) return res; } -// _tmp_135: ',' star_target +// _tmp_139: ',' star_target static void * -_tmp_135_rule(Parser *p) +_tmp_139_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15316,9 +16161,62 @@ _tmp_135_rule(Parser *p) return res; } -// _loop0_136: ('if' disjunction) +// _loop1_140: param_with_default +static asdl_seq * +_loop1_140_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // param_with_default + NameDefaultPair* param_with_default_var; + while ( + (param_with_default_var = param_with_default_rule(p)) + ) + { + res = param_with_default_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + if (n == 0) { + PyMem_Free(children); + return NULL; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_140"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop1_140_type, seq); + return seq; +} + +// _loop0_141: ('if' disjunction) static asdl_seq * -_loop0_136_rule(Parser *p) +_loop0_141_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15334,12 +16232,12 @@ _loop0_136_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('if' disjunction) - void *_tmp_137_var; + void *_tmp_142_var; while ( - (_tmp_137_var = _tmp_137_rule(p)) + (_tmp_142_var = _tmp_142_rule(p)) ) { - res = _tmp_137_var; + res = _tmp_142_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -15355,19 +16253,19 @@ _loop0_136_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_136"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_141"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_136_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_141_type, seq); return seq; } -// _tmp_137: 'if' disjunction +// _tmp_142: 'if' disjunction static void * -_tmp_137_rule(Parser *p) +_tmp_142_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15412,6 +16310,8 @@ _PyPegen_parse(Parser *p) result = interactive_rule(p); } else if (p->start_rule == Py_eval_input) { result = eval_rule(p); + } else if (p->start_rule == Py_func_type_input) { + result = func_type_rule(p); } else if (p->start_rule == Py_fstring_input) { result = fstring_rule(p); } diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 942447b0f8fd1..5a2491c181f98 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -5,6 +5,39 @@ #include "pegen.h" #include "parse_string.h" +PyObject * +_PyPegen_new_type_comment(Parser *p, char *s) +{ + PyObject *res = PyUnicode_DecodeUTF8(s, strlen(s), NULL); + if (res == NULL) { + return NULL; + } + if (PyArena_AddPyObject(p->arena, res) < 0) { + Py_DECREF(res); + return NULL; + } + return res; +} + +arg_ty +_PyPegen_add_type_comment_to_arg(Parser *p, arg_ty a, Token *tc) +{ + if (tc == NULL) { + return a; + } + char *bytes = PyBytes_AsString(tc->bytes); + if (bytes == NULL) { + return NULL; + } + PyObject *tco = _PyPegen_new_type_comment(p, bytes); + if (tco == NULL) { + return NULL; + } + return arg(a->arg, a->annotation, tco, + a->lineno, a->col_offset, a->end_lineno, a->end_col_offset, + p->arena); +} + static int init_normalization(Parser *p) { @@ -539,11 +572,66 @@ _get_keyword_or_name_type(Parser *p, const char *name, int name_len) return NAME; } +static int +growable_comment_array_init(growable_comment_array *arr, size_t initial_size) { + assert(initial_size > 0); + arr->items = PyMem_Malloc(initial_size * sizeof(*arr->items)); + arr->size = initial_size; + arr->num_items = 0; + + return arr->items != NULL; +} + +static int +growable_comment_array_add(growable_comment_array *arr, int lineno, char *comment) { + if (arr->num_items >= arr->size) { + size_t new_size = arr->size * 2; + void *new_items_array = PyMem_Realloc(arr->items, new_size * sizeof(*arr->items)); + if (!new_items_array) { + return 0; + } + arr->items = new_items_array; + arr->size = new_size; + } + + arr->items[arr->num_items].lineno = lineno; + arr->items[arr->num_items].comment = comment; // Take ownership + arr->num_items++; + return 1; +} + +static void +growable_comment_array_deallocate(growable_comment_array *arr) { + for (unsigned i = 0; i < arr->num_items; i++) { + PyMem_Free(arr->items[i].comment); + } + PyMem_Free(arr->items); +} + int _PyPegen_fill_token(Parser *p) { const char *start, *end; int type = PyTokenizer_Get(p->tok, &start, &end); + + // Record and skip '# type: ignore' comments + while (type == TYPE_IGNORE) { + Py_ssize_t len = end - start; + char *tag = PyMem_Malloc(len + 1); + if (tag == NULL) { + PyErr_NoMemory(); + return -1; + } + strncpy(tag, start, len); + tag[len] = '\0'; + // Ownership of tag passes to the growable array + if (!growable_comment_array_add(&p->type_ignore_comments, p->tok->lineno, tag)) { + PyErr_NoMemory(); + return -1; + } + type = PyTokenizer_Get(p->tok, &start, &end); + } + if (type == ERRORTOKEN) { if (p->tok->done == E_DECODE) { return raise_decode_error(p); @@ -919,6 +1007,7 @@ _PyPegen_Parser_Free(Parser *p) PyMem_Free(p->tokens[i]); } PyMem_Free(p->tokens); + growable_comment_array_deallocate(&p->type_ignore_comments); PyMem_Free(p); } @@ -961,13 +1050,19 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int flags, PyMem_Free(p); return (Parser *) PyErr_NoMemory(); } - p->tokens[0] = PyMem_Malloc(sizeof(Token)); + p->tokens[0] = PyMem_Calloc(1, sizeof(Token)); if (!p->tokens) { PyMem_Free(p->tokens); PyMem_Free(p); return (Parser *) PyErr_NoMemory(); } - memset(p->tokens[0], '\0', sizeof(Token)); + if (!growable_comment_array_init(&p->type_ignore_comments, 10)) { + PyMem_Free(p->tokens[0]); + PyMem_Free(p->tokens); + PyMem_Free(p); + return (Parser *) PyErr_NoMemory(); + } + p->mark = 0; p->fill = 0; p->size = 1; @@ -1099,6 +1194,8 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen mod_ty result = NULL; int parser_flags = compute_parser_flags(flags); + tok->type_comments = (parser_flags & PyPARSE_TYPE_COMMENTS) > 0; + Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, NULL, arena); if (p == NULL) { goto error; @@ -1155,6 +1252,27 @@ _PyPegen_seq_insert_in_front(Parser *p, void *a, asdl_seq *seq) return new_seq; } +/* Creates a copy of seq and appends a to it */ +asdl_seq * +_PyPegen_seq_append_to_end(Parser *p, asdl_seq *seq, void *a) +{ + assert(a != NULL); + if (!seq) { + return _PyPegen_singleton_seq(p, a); + } + + asdl_seq *new_seq = _Py_asdl_seq_new(asdl_seq_LEN(seq) + 1, p->arena); + if (!new_seq) { + return NULL; + } + + for (Py_ssize_t i = 0, l = asdl_seq_LEN(new_seq); i + 1 < l; i++) { + asdl_seq_SET(new_seq, i, asdl_seq_GET(seq, i)); + } + asdl_seq_SET(new_seq, asdl_seq_LEN(new_seq) - 1, a); + return new_seq; +} + static Py_ssize_t _get_flattened_seq_size(asdl_seq *seqs) { @@ -1483,13 +1601,13 @@ _PyPegen_get_values(Parser *p, asdl_seq *seq) /* Constructs a NameDefaultPair */ NameDefaultPair * -_PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value) +_PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value, Token *tc) { NameDefaultPair *a = PyArena_Malloc(p->arena, sizeof(NameDefaultPair)); if (!a) { return NULL; } - a->arg = arg; + a->arg = _PyPegen_add_type_comment_to_arg(p, arg, tc); a->value = value; return a; } @@ -1946,3 +2064,28 @@ _PyPegen_concatenate_strings(Parser *p, asdl_seq *strings) } return NULL; } + +mod_ty +_PyPegen_make_module(Parser *p, asdl_seq *a) { + asdl_seq *type_ignores = NULL; + Py_ssize_t num = p->type_ignore_comments.num_items; + if (num > 0) { + // Turn the raw (comment, lineno) pairs into TypeIgnore objects in the arena + type_ignores = _Py_asdl_seq_new(num, p->arena); + if (type_ignores == NULL) { + return NULL; + } + for (int i = 0; i < num; i++) { + PyObject *tag = _PyPegen_new_type_comment(p, p->type_ignore_comments.items[i].comment); + if (tag == NULL) { + return NULL; + } + type_ignore_ty ti = TypeIgnore(p->type_ignore_comments.items[i].lineno, tag, p->arena); + if (ti == NULL) { + return NULL; + } + asdl_seq_SET(type_ignores, i, ti); + } + } + return Module(a, type_ignores, p->arena); +} diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index 99ec0f44e6518..3af4bb29aa177 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -43,6 +43,16 @@ typedef struct { int type; } KeywordToken; + +typedef struct { + struct { + int lineno; + char *comment; // The " " in "# type: ignore " + } *items; + size_t size; + size_t num_items; +} growable_comment_array; + typedef struct { struct tok_state *tok; Token **tokens; @@ -59,6 +69,7 @@ typedef struct { int starting_col_offset; int error_indicator; int flags; + growable_comment_array type_ignore_comments; } Parser; typedef struct { @@ -110,13 +121,7 @@ int _PyPegen_lookahead(int, void *(func)(Parser *), Parser *); Token *_PyPegen_expect_token(Parser *p, int type); Token *_PyPegen_get_last_nonnwhitespace_token(Parser *); int _PyPegen_fill_token(Parser *p); -void *_PyPegen_async_token(Parser *p); -void *_PyPegen_await_token(Parser *p); -void *_PyPegen_endmarker_token(Parser *p); expr_ty _PyPegen_name_token(Parser *p); -void *_PyPegen_newline_token(Parser *p); -void *_PyPegen_indent_token(Parser *p); -void *_PyPegen_dedent_token(Parser *p); expr_ty _PyPegen_number_token(Parser *p); void *_PyPegen_string_token(Parser *p); const char *_PyPegen_get_expr_name(expr_ty); @@ -153,6 +158,29 @@ CHECK_CALL_NULL_ALLOWED(Parser *p, void *result) #define CHECK(result) CHECK_CALL(p, result) #define CHECK_NULL_ALLOWED(result) CHECK_CALL_NULL_ALLOWED(p, result) +PyObject *_PyPegen_new_type_comment(Parser *, char *); + +Py_LOCAL_INLINE(PyObject *) +NEW_TYPE_COMMENT(Parser *p, Token *tc) +{ + if (tc == NULL) { + return NULL; + } + char *bytes = PyBytes_AsString(tc->bytes); + if (bytes == NULL) { + goto error; + } + PyObject *tco = _PyPegen_new_type_comment(p, bytes); + if (tco == NULL) { + goto error; + } + return tco; + error: + p->error_indicator = 1; // Inline CHECK_CALL + return NULL; +} + +arg_ty _PyPegen_add_type_comment_to_arg(Parser *, arg_ty, Token *); PyObject *_PyPegen_new_identifier(Parser *, char *); Parser *_PyPegen_Parser_New(struct tok_state *, int, int, int *, PyArena *); void _PyPegen_Parser_Free(Parser *); @@ -164,6 +192,7 @@ mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, PyCompiler void *_PyPegen_interactive_exit(Parser *); asdl_seq *_PyPegen_singleton_seq(Parser *, void *); asdl_seq *_PyPegen_seq_insert_in_front(Parser *, void *, asdl_seq *); +asdl_seq *_PyPegen_seq_append_to_end(Parser *, asdl_seq *, void *); asdl_seq *_PyPegen_seq_flatten(Parser *, asdl_seq *); expr_ty _PyPegen_join_names_with_dot(Parser *, expr_ty, expr_ty); int _PyPegen_seq_count_dots(asdl_seq *); @@ -176,7 +205,7 @@ expr_ty _PyPegen_set_expr_context(Parser *, expr_ty, expr_context_ty); KeyValuePair *_PyPegen_key_value_pair(Parser *, expr_ty, expr_ty); asdl_seq *_PyPegen_get_keys(Parser *, asdl_seq *); asdl_seq *_PyPegen_get_values(Parser *, asdl_seq *); -NameDefaultPair *_PyPegen_name_default_pair(Parser *, arg_ty, expr_ty); +NameDefaultPair *_PyPegen_name_default_pair(Parser *, arg_ty, expr_ty, Token *); SlashWithDefault *_PyPegen_slash_with_default(Parser *, asdl_seq *, asdl_seq *); StarEtc *_PyPegen_star_etc(Parser *, arg_ty, asdl_seq *, arg_ty); arguments_ty _PyPegen_make_arguments(Parser *, asdl_seq *, SlashWithDefault *, @@ -192,6 +221,7 @@ expr_ty _PyPegen_concatenate_strings(Parser *p, asdl_seq *); asdl_seq *_PyPegen_join_sequences(Parser *, asdl_seq *, asdl_seq *); void *_PyPegen_arguments_parsing_error(Parser *, expr_ty); int _PyPegen_check_barry_as_flufl(Parser *); +mod_ty _PyPegen_make_module(Parser *, asdl_seq *); void *_PyPegen_parse(Parser *); diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 14c3e96fb51ab..82ca317c7e9c2 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -816,12 +816,8 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, if (str == NULL) goto error; - int current_use_peg = PyInterpreterState_Get()->config._use_peg_parser; - if (flags & PyCF_TYPE_COMMENTS || feature_version >= 0 || compile_mode == 3) { - PyInterpreterState_Get()->config._use_peg_parser = 0; - } result = Py_CompileStringObject(str, filename, start[compile_mode], &cf, optimize); - PyInterpreterState_Get()->config._use_peg_parser = current_use_peg; + Py_XDECREF(source_copy); goto finally; From webhook-mailer at python.org Thu Apr 30 15:18:14 2020 From: webhook-mailer at python.org (Chris Jerdonek) Date: Thu, 30 Apr 2020 19:18:14 -0000 Subject: [Python-checkins] bpo-29587: Enable implicit exception chaining with gen.throw() (GH-19811) Message-ID: https://github.com/python/cpython/commit/2514a632fb7d37be24c2059d0e286d35600f9795 commit: 2514a632fb7d37be24c2059d0e286d35600f9795 branch: master author: Chris Jerdonek committer: GitHub date: 2020-04-30T12:18:05-07:00 summary: bpo-29587: Enable implicit exception chaining with gen.throw() (GH-19811) Before this commit, if an exception was active inside a generator when calling gen.throw(), then that exception was lost (i.e. there was no implicit exception chaining). This commit fixes that. files: A Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.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 3e42bc6b69a81..4d96f44b15062 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -316,6 +316,23 @@ def g(): self.assertEqual(cm.exception.value.value, 2) +class GeneratorThrowTest(unittest.TestCase): + + def test_exception_context_set(self): + def f(): + try: + raise KeyError('a') + except Exception: + yield + + gen = f() + gen.send(None) + with self.assertRaises(ValueError) as cm: + gen.throw(ValueError) + context = cm.exception.__context__ + self.assertEqual((type(context), context.args), (KeyError, ('a',))) + + class YieldFromTests(unittest.TestCase): def test_generator_gi_yieldfrom(self): def a(): diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst new file mode 100644 index 0000000000000..f44aa360cc2ef --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst @@ -0,0 +1 @@ +Enable implicit exception chaining when calling :meth:`generator.throw`. diff --git a/Objects/genobject.c b/Objects/genobject.c index 6e36690b65148..289ed79aa28a6 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -512,6 +512,12 @@ _gen_throw(PyGenObject *gen, int close_on_genexit, } PyErr_Restore(typ, val, tb); + if (gen->gi_exc_state.exc_type) { + Py_INCREF(gen->gi_exc_state.exc_type); + Py_XINCREF(gen->gi_exc_state.exc_value); + Py_XINCREF(gen->gi_exc_state.exc_traceback); + _PyErr_ChainExceptions(gen->gi_exc_state.exc_type, gen->gi_exc_state.exc_value, gen->gi_exc_state.exc_traceback); + } return gen_send_ex(gen, Py_None, 1, 0); failed_throw: From webhook-mailer at python.org Thu Apr 30 16:44:28 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 30 Apr 2020 20:44:28 -0000 Subject: [Python-checkins] Revert "bpo-29587: Enable implicit exception chaining with gen.throw() (GH-19811)" (#19821) Message-ID: https://github.com/python/cpython/commit/3c7f9db85095952821f9d106dd874f75662ce7ec commit: 3c7f9db85095952821f9d106dd874f75662ce7ec branch: master author: Victor Stinner committer: GitHub date: 2020-04-30T22:44:24+02:00 summary: Revert "bpo-29587: Enable implicit exception chaining with gen.throw() (GH-19811)" (#19821) This reverts commit 2514a632fb7d37be24c2059d0e286d35600f9795. files: D Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.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 4d96f44b15062..3e42bc6b69a81 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -316,23 +316,6 @@ def g(): self.assertEqual(cm.exception.value.value, 2) -class GeneratorThrowTest(unittest.TestCase): - - def test_exception_context_set(self): - def f(): - try: - raise KeyError('a') - except Exception: - yield - - gen = f() - gen.send(None) - with self.assertRaises(ValueError) as cm: - gen.throw(ValueError) - context = cm.exception.__context__ - self.assertEqual((type(context), context.args), (KeyError, ('a',))) - - class YieldFromTests(unittest.TestCase): def test_generator_gi_yieldfrom(self): def a(): diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst deleted file mode 100644 index f44aa360cc2ef..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-30-00-50-25.bpo-29587.oEwSq.rst +++ /dev/null @@ -1 +0,0 @@ -Enable implicit exception chaining when calling :meth:`generator.throw`. diff --git a/Objects/genobject.c b/Objects/genobject.c index 289ed79aa28a6..6e36690b65148 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -512,12 +512,6 @@ _gen_throw(PyGenObject *gen, int close_on_genexit, } PyErr_Restore(typ, val, tb); - if (gen->gi_exc_state.exc_type) { - Py_INCREF(gen->gi_exc_state.exc_type); - Py_XINCREF(gen->gi_exc_state.exc_value); - Py_XINCREF(gen->gi_exc_state.exc_traceback); - _PyErr_ChainExceptions(gen->gi_exc_state.exc_type, gen->gi_exc_state.exc_value, gen->gi_exc_state.exc_traceback); - } return gen_send_ex(gen, Py_None, 1, 0); failed_throw: From webhook-mailer at python.org Thu Apr 30 18:44:07 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Thu, 30 Apr 2020 22:44:07 -0000 Subject: [Python-checkins] bpo-1635741: Fix compiler warning in _stat.c (GH-19822) Message-ID: https://github.com/python/cpython/commit/b66c0ff8af0c1a4adc6908897b2d05afc78cc27e commit: b66c0ff8af0c1a4adc6908897b2d05afc78cc27e branch: master author: Victor Stinner committer: GitHub date: 2020-05-01T00:44:03+02:00 summary: bpo-1635741: Fix compiler warning in _stat.c (GH-19822) Cast Py_ARRAY_LENGTH() size_t to int explicitly. files: M Modules/_stat.c diff --git a/Modules/_stat.c b/Modules/_stat.c index 45a4e080c7746..c7090c02688de 100644 --- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -563,7 +563,7 @@ stat_exec(PyObject *module) "ST_CTIME" }; - for (int i = 0; i < Py_ARRAY_LENGTH(st_constants); i++) { + for (int i = 0; i < (int)Py_ARRAY_LENGTH(st_constants); i++) { if (PyModule_AddIntConstant(module, st_constants[i], i) < 0) { return -1; } From webhook-mailer at python.org Thu Apr 30 20:34:30 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 01 May 2020 00:34:30 -0000 Subject: [Python-checkins] Remove dead code in test__xxsubinterpreters (GH-19826) Message-ID: https://github.com/python/cpython/commit/17014e45864cefd37660b054fb71fa2e177690ef commit: 17014e45864cefd37660b054fb71fa2e177690ef branch: master author: Victor Stinner committer: GitHub date: 2020-05-01T02:34:22+02:00 summary: Remove dead code in test__xxsubinterpreters (GH-19826) files: M Lib/test/test__xxsubinterpreters.py diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index 44f4d3fa0f4c9..80eff19152f15 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -19,12 +19,6 @@ ################################## # helpers -def powerset(*sets): - return itertools.chain.from_iterable( - combinations(sets, r) - for r in range(len(sets)+1)) - - def _captured_script(script): r, w = os.pipe() indented = script.replace('\n', '\n ') @@ -90,14 +84,6 @@ def _run_interp(id, source, shared, _mainns={}): interpreters.run_string(id, source, shared) -def run_interp_threaded(id, source, **shared): - def run(): - _run(id, source, shared) - t = threading.Thread(target=run) - t.start() - t.join() - - class Interpreter(namedtuple('Interpreter', 'name id')): @classmethod @@ -786,12 +772,6 @@ def tearDown(self): self._fs.close() super().tearDown() - @property - def fs(self): - if self._fs is None: - self._fs = FSFixture(self) - return self._fs - def test_success(self): script, file = _captured_script('print("it worked!", end="")') with file: From webhook-mailer at python.org Thu Apr 30 20:35:28 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 01 May 2020 00:35:28 -0000 Subject: [Python-checkins] bpo-40275: Fix name error in support.socket_helper (GH-19825) Message-ID: https://github.com/python/cpython/commit/2935e65c36fab1989bbda19db72c035ea22b044b commit: 2935e65c36fab1989bbda19db72c035ea22b044b branch: master author: Victor Stinner committer: GitHub date: 2020-05-01T02:35:24+02:00 summary: bpo-40275: Fix name error in support.socket_helper (GH-19825) Replace TestFailed with support.TestFailed. Bug spotted by pyflakes. files: M Lib/test/support/socket_helper.py diff --git a/Lib/test/support/socket_helper.py b/Lib/test/support/socket_helper.py index 0ac8445562926..f709ffd40dd8a 100644 --- a/Lib/test/support/socket_helper.py +++ b/Lib/test/support/socket_helper.py @@ -91,13 +91,15 @@ def bind_port(sock, host=HOST): if sock.family == socket.AF_INET and sock.type == socket.SOCK_STREAM: if hasattr(socket, 'SO_REUSEADDR'): if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) == 1: - raise TestFailed("tests should never set the SO_REUSEADDR " \ - "socket option on TCP/IP sockets!") + raise support.TestFailed("tests should never set the " + "SO_REUSEADDR socket option on " + "TCP/IP sockets!") if hasattr(socket, 'SO_REUSEPORT'): try: if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: - raise TestFailed("tests should never set the SO_REUSEPORT " \ - "socket option on TCP/IP sockets!") + raise support.TestFailed("tests should never set the " + "SO_REUSEPORT socket option on " + "TCP/IP sockets!") except OSError: # Python's socket module was compiled using modern headers # thus defining SO_REUSEPORT but this process is running From webhook-mailer at python.org Thu Apr 30 20:38:05 2020 From: webhook-mailer at python.org (Victor Stinner) Date: Fri, 01 May 2020 00:38:05 -0000 Subject: [Python-checkins] bpo-40443: Remove unused imports in stdlib (GH-19815) Message-ID: https://github.com/python/cpython/commit/eb0d359b4b0e14552998e7af771a088b4fd01745 commit: eb0d359b4b0e14552998e7af771a088b4fd01745 branch: master author: Victor Stinner committer: GitHub date: 2020-05-01T02:38:00+02:00 summary: bpo-40443: Remove unused imports in stdlib (GH-19815) files: M Lib/importlib/resources.py M Lib/multiprocessing/pool.py M Lib/ssl.py diff --git a/Lib/importlib/resources.py b/Lib/importlib/resources.py index fc3a1c9cabe63..f51886557466c 100644 --- a/Lib/importlib/resources.py +++ b/Lib/importlib/resources.py @@ -8,10 +8,9 @@ from io import BytesIO, TextIOWrapper from pathlib import Path from types import ModuleType -from typing import Iterable, Iterator, Optional, Set, Union # noqa: F401 +from typing import Iterable, Iterator, Optional, Union # noqa: F401 from typing import cast from typing.io import BinaryIO, TextIO -from zipimport import ZipImportError __all__ = [ diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index b8a0b827635f0..bbe05a550c349 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -22,7 +22,6 @@ import traceback import types import warnings -from queue import Empty # If threading is available then ThreadPool should be provided. Therefore # we avoid top-level imports which are liable to fail on some systems. diff --git a/Lib/ssl.py b/Lib/ssl.py index 0726caee49aa5..30f4e5934febf 100644 --- a/Lib/ssl.py +++ b/Lib/ssl.py @@ -252,7 +252,7 @@ class _TLSMessageType(_IntEnum): if sys.platform == "win32": from _ssl import enum_certificates, enum_crls -from socket import socket, AF_INET, SOCK_STREAM, create_connection +from socket import socket, SOCK_STREAM, create_connection from socket import SOL_SOCKET, SO_TYPE import socket as _socket import base64 # for DER-to-PEM translation From webhook-mailer at python.org Thu Apr 30 23:28:01 2020 From: webhook-mailer at python.org (Lysandros Nikolaou) Date: Fri, 01 May 2020 03:28:01 -0000 Subject: [Python-checkins] bpo-40334: Add support for feature_version in new PEG parser (GH-19827) Message-ID: https://github.com/python/cpython/commit/3e0a6f37dfdd595be737baae00ec0e036a912615 commit: 3e0a6f37dfdd595be737baae00ec0e036a912615 branch: master author: Lysandros Nikolaou committer: GitHub date: 2020-04-30T20:27:52-07:00 summary: bpo-40334: Add support for feature_version in new PEG parser (GH-19827) `ast.parse` and `compile` support a `feature_version` parameter that tells the parser to parse the input string, as if it were written in an older Python version. The `feature_version` is propagated to the tokenizer, which uses it to handle the three different stages of support for `async` and `await`. Additionally, it disallows the following at parser level: - The '@' operator in < 3.5 - Async functions in < 3.5 - Async comprehensions in < 3.6 - Underscores in numeric literals in < 3.6 - Await expression in < 3.5 - Variable annotations in < 3.6 - Async for-loops in < 3.5 - Async with-statements in < 3.5 - F-strings in < 3.6 Closes we-like-parsers/cpython#124. files: M Grammar/python.gram M Lib/test/test_type_comments.py M Parser/pegen/parse.c M Parser/pegen/parse_string.c M Parser/pegen/pegen.c M Parser/pegen/pegen.h diff --git a/Grammar/python.gram b/Grammar/python.gram index e1164d990aaa4..38107fcf7354c 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -80,10 +80,14 @@ compound_stmt[stmt_ty]: # NOTE: annotated_rhs may start with 'yield'; yield_expr must start with 'yield' assignment: | a=NAME ':' b=expression c=['=' d=annotated_rhs { d }] { - _Py_AnnAssign(CHECK(_PyPegen_set_expr_context(p, a, Store)), b, c, 1, EXTRA) } + CHECK_VERSION( + 6, + "Variable annotation syntax is", + _Py_AnnAssign(CHECK(_PyPegen_set_expr_context(p, a, Store)), b, c, 1, EXTRA) + ) } | a=('(' b=inside_paren_ann_assign_target ')' { b } | ann_assign_subscript_attribute_target) ':' b=expression c=['=' d=annotated_rhs { d }] { - _Py_AnnAssign(a, b, c, 0, EXTRA)} + CHECK_VERSION(6, "Variable annotations syntax is", _Py_AnnAssign(a, b, c, 0, EXTRA)) } | a=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) tc=[TYPE_COMMENT] { _Py_Assign(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } | a=target b=augassign c=(yield_expr | star_expressions) { @@ -91,19 +95,19 @@ assignment: | invalid_assignment augassign[AugOperator*]: - | '+=' {_PyPegen_augoperator(p, Add)} - | '-=' {_PyPegen_augoperator(p, Sub)} - | '*=' {_PyPegen_augoperator(p, Mult)} - | '@=' {_PyPegen_augoperator(p, MatMult)} - | '/=' {_PyPegen_augoperator(p, Div)} - | '%=' {_PyPegen_augoperator(p, Mod)} - | '&=' {_PyPegen_augoperator(p, BitAnd)} - | '|=' {_PyPegen_augoperator(p, BitOr)} - | '^=' {_PyPegen_augoperator(p, BitXor)} - | '<<=' {_PyPegen_augoperator(p, LShift)} - | '>>=' {_PyPegen_augoperator(p, RShift)} - | '**=' {_PyPegen_augoperator(p, Pow)} - | '//=' {_PyPegen_augoperator(p, FloorDiv)} + | '+=' { _PyPegen_augoperator(p, Add) } + | '-=' { _PyPegen_augoperator(p, Sub) } + | '*=' { _PyPegen_augoperator(p, Mult) } + | '@=' { CHECK_VERSION(5, "The '@' operator is", _PyPegen_augoperator(p, MatMult)) } + | '/=' { _PyPegen_augoperator(p, Div) } + | '%=' { _PyPegen_augoperator(p, Mod) } + | '&=' { _PyPegen_augoperator(p, BitAnd) } + | '|=' { _PyPegen_augoperator(p, BitOr) } + | '^=' { _PyPegen_augoperator(p, BitXor) } + | '<<=' { _PyPegen_augoperator(p, LShift) } + | '>>=' { _PyPegen_augoperator(p, RShift) } + | '**=' { _PyPegen_augoperator(p, Pow) } + | '//=' { _PyPegen_augoperator(p, FloorDiv) } global_stmt[stmt_ty]: 'global' a=','.NAME+ { _Py_Global(CHECK(_PyPegen_map_names_to_ids(p, a)), EXTRA) } @@ -156,14 +160,20 @@ while_stmt[stmt_ty]: | 'while' a=named_expression ':' b=block c=[else_block] { _Py_While(a, b, c, EXTRA) } for_stmt[stmt_ty]: - | is_async=[ASYNC] 'for' t=star_targets 'in' ex=star_expressions ':' tc=[TYPE_COMMENT] b=block el=[else_block] { - (is_async ? _Py_AsyncFor : _Py_For)(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA) } + | 'for' t=star_targets 'in' ex=star_expressions ':' tc=[TYPE_COMMENT] b=block el=[else_block] { + _Py_For(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA) } + | ASYNC 'for' t=star_targets 'in' ex=star_expressions ':' tc=[TYPE_COMMENT] b=block el=[else_block] { + CHECK_VERSION(5, "Async for loops are", _Py_AsyncFor(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA)) } with_stmt[stmt_ty]: - | is_async=[ASYNC] 'with' '(' a=','.with_item+ ')' ':' b=block { - (is_async ? _Py_AsyncWith : _Py_With)(a, b, NULL, EXTRA) } - | is_async=[ASYNC] 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { - (is_async ? _Py_AsyncWith : _Py_With)(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } + | 'with' '(' a=','.with_item+ ')' ':' b=block { + _Py_With(a, b, NULL, EXTRA) } + | 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { + _Py_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } + | ASYNC 'with' '(' a=','.with_item+ ')' ':' b=block { + CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NULL, EXTRA)) } + | ASYNC 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { + CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) } with_item[withitem_ty]: | e=expression o=['as' t=target { t }] { _Py_withitem(e, o, p->arena) } @@ -188,10 +198,18 @@ function_def[stmt_ty]: | function_def_raw function_def_raw[stmt_ty]: - | is_async=[ASYNC] 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] ':' tc=[func_type_comment] b=block { - (is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef)(n->v.Name.id, - (params) ? params : CHECK(_PyPegen_empty_arguments(p)), - b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) } + | 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] ':' tc=[func_type_comment] b=block { + _Py_FunctionDef(n->v.Name.id, + (params) ? params : CHECK(_PyPegen_empty_arguments(p)), + b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) } + | ASYNC 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] ':' tc=[func_type_comment] b=block { + CHECK_VERSION( + 5, + "Async functions are", + _Py_AsyncFunctionDef(n->v.Name.id, + (params) ? params : CHECK(_PyPegen_empty_arguments(p)), + b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) + ) } func_type_comment[PyObject*]: | NEWLINE t=TYPE_COMMENT &(NEWLINE INDENT) { t } # Must be followed by indented block | invalid_double_type_comments @@ -399,7 +417,7 @@ term[expr_ty]: | a=term '/' b=factor { _Py_BinOp(a, Div, b, EXTRA) } | a=term '//' b=factor { _Py_BinOp(a, FloorDiv, b, EXTRA) } | a=term '%' b=factor { _Py_BinOp(a, Mod, b, EXTRA) } - | a=term '@' b=factor { _Py_BinOp(a, MatMult, b, EXTRA) } + | a=term '@' b=factor { CHECK_VERSION(5, "The '@' operator is", _Py_BinOp(a, MatMult, b, EXTRA)) } | factor factor[expr_ty] (memo): | '+' a=factor { _Py_UnaryOp(UAdd, a, EXTRA) } @@ -410,7 +428,7 @@ power[expr_ty]: | a=await_primary '**' b=factor { _Py_BinOp(a, Pow, b, EXTRA) } | await_primary await_primary[expr_ty] (memo): - | AWAIT a=primary { _Py_Await(a, EXTRA) } + | AWAIT a=primary { CHECK_VERSION(5, "Await expressions are", _Py_Await(a, EXTRA)) } | primary primary[expr_ty]: | a=primary '.' b=NAME { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) } @@ -469,8 +487,12 @@ kvpair[KeyValuePair*]: | '**' a=bitwise_or { _PyPegen_key_value_pair(p, NULL, a) } | a=expression ':' b=expression { _PyPegen_key_value_pair(p, a, b) } for_if_clauses[asdl_seq*]: - | a=(y=[ASYNC] 'for' a=star_targets 'in' b=disjunction c=('if' z=disjunction { z })* - { _Py_comprehension(a, b, c, y != NULL, p->arena) })+ { a } + | for_if_clause+ +for_if_clause[comprehension_ty]: + | ASYNC 'for' a=star_targets 'in' b=disjunction c=('if' z=disjunction { z })* { + CHECK_VERSION(6, "Async comprehensions are", _Py_comprehension(a, b, c, 1, p->arena)) } + | 'for' a=star_targets 'in' b=disjunction c=('if' z=disjunction { z })* { + _Py_comprehension(a, b, c, 0, p->arena) } yield_expr[expr_ty]: | 'yield' 'from' a=expression { _Py_YieldFrom(a, EXTRA) } diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index 6c3f6ed4ed209..6027b3b56f76f 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -252,7 +252,6 @@ def test_funcdef(self): self.assertEqual(tree.body[0].type_comment, None) self.assertEqual(tree.body[1].type_comment, None) - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asyncdef(self): for tree in self.parse_all(asyncdef, minver=5): self.assertEqual(tree.body[0].type_comment, "() -> int") @@ -261,27 +260,22 @@ def test_asyncdef(self): self.assertEqual(tree.body[0].type_comment, None) self.assertEqual(tree.body[1].type_comment, None) - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asyncvar(self): for tree in self.parse_all(asyncvar, maxver=6): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_asynccomp(self): for tree in self.parse_all(asynccomp, minver=6): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_matmul(self): for tree in self.parse_all(matmul, minver=5): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_fstring(self): for tree in self.parse_all(fstring, minver=6): pass - @support.skip_if_new_parser("Pegen does not support feature_version yet") def test_underscorednumber(self): for tree in self.parse_all(underscorednumber, minver=6): pass diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c index 8ff9a70d3bb82..9c941ca1ee2ec 100644 --- a/Parser/pegen/parse.c +++ b/Parser/pegen/parse.c @@ -188,176 +188,183 @@ static KeywordToken *reserved_keywords[] = { #define kvpairs_type 1117 #define kvpair_type 1118 #define for_if_clauses_type 1119 -#define yield_expr_type 1120 -#define arguments_type 1121 -#define args_type 1122 -#define kwargs_type 1123 -#define starred_expression_type 1124 -#define kwarg_or_starred_type 1125 -#define kwarg_or_double_starred_type 1126 -#define star_targets_type 1127 -#define star_targets_seq_type 1128 -#define star_target_type 1129 -#define star_atom_type 1130 -#define inside_paren_ann_assign_target_type 1131 -#define ann_assign_subscript_attribute_target_type 1132 -#define del_targets_type 1133 -#define del_target_type 1134 -#define del_t_atom_type 1135 -#define targets_type 1136 -#define target_type 1137 -#define t_primary_type 1138 // Left-recursive -#define t_lookahead_type 1139 -#define t_atom_type 1140 -#define incorrect_arguments_type 1141 -#define invalid_named_expression_type 1142 -#define invalid_assignment_type 1143 -#define invalid_block_type 1144 -#define invalid_comprehension_type 1145 -#define invalid_parameters_type 1146 -#define invalid_double_type_comments_type 1147 -#define _loop0_1_type 1148 -#define _loop0_2_type 1149 -#define _loop0_4_type 1150 -#define _gather_3_type 1151 -#define _loop0_6_type 1152 -#define _gather_5_type 1153 -#define _loop0_8_type 1154 -#define _gather_7_type 1155 -#define _loop0_10_type 1156 -#define _gather_9_type 1157 -#define _loop1_11_type 1158 -#define _loop0_13_type 1159 -#define _gather_12_type 1160 -#define _tmp_14_type 1161 -#define _tmp_15_type 1162 -#define _tmp_16_type 1163 -#define _tmp_17_type 1164 -#define _tmp_18_type 1165 -#define _tmp_19_type 1166 -#define _tmp_20_type 1167 -#define _tmp_21_type 1168 -#define _loop1_22_type 1169 -#define _tmp_23_type 1170 -#define _tmp_24_type 1171 -#define _loop0_26_type 1172 -#define _gather_25_type 1173 -#define _loop0_28_type 1174 -#define _gather_27_type 1175 -#define _tmp_29_type 1176 -#define _loop0_30_type 1177 -#define _loop1_31_type 1178 -#define _loop0_33_type 1179 -#define _gather_32_type 1180 -#define _tmp_34_type 1181 -#define _loop0_36_type 1182 -#define _gather_35_type 1183 -#define _tmp_37_type 1184 -#define _loop0_39_type 1185 -#define _gather_38_type 1186 -#define _loop0_41_type 1187 -#define _gather_40_type 1188 -#define _tmp_42_type 1189 -#define _loop1_43_type 1190 -#define _tmp_44_type 1191 -#define _tmp_45_type 1192 -#define _tmp_46_type 1193 -#define _tmp_47_type 1194 -#define _loop0_48_type 1195 -#define _loop0_49_type 1196 -#define _loop0_50_type 1197 -#define _loop1_51_type 1198 -#define _loop0_52_type 1199 -#define _loop1_53_type 1200 -#define _loop1_54_type 1201 -#define _loop1_55_type 1202 -#define _loop0_56_type 1203 -#define _loop1_57_type 1204 -#define _loop0_58_type 1205 -#define _loop1_59_type 1206 -#define _loop0_60_type 1207 -#define _loop1_61_type 1208 -#define _loop1_62_type 1209 -#define _tmp_63_type 1210 -#define _loop0_65_type 1211 -#define _gather_64_type 1212 -#define _loop1_66_type 1213 -#define _loop0_68_type 1214 -#define _gather_67_type 1215 -#define _loop1_69_type 1216 -#define _tmp_70_type 1217 -#define _tmp_71_type 1218 -#define _tmp_72_type 1219 -#define _tmp_73_type 1220 -#define _tmp_74_type 1221 -#define _tmp_75_type 1222 -#define _tmp_76_type 1223 -#define _tmp_77_type 1224 -#define _tmp_78_type 1225 -#define _loop0_79_type 1226 -#define _tmp_80_type 1227 -#define _loop1_81_type 1228 -#define _tmp_82_type 1229 -#define _tmp_83_type 1230 -#define _loop0_85_type 1231 -#define _gather_84_type 1232 -#define _loop0_87_type 1233 -#define _gather_86_type 1234 -#define _loop1_88_type 1235 -#define _loop1_89_type 1236 -#define _loop1_90_type 1237 -#define _tmp_91_type 1238 -#define _loop0_93_type 1239 -#define _gather_92_type 1240 -#define _tmp_94_type 1241 -#define _tmp_95_type 1242 -#define _tmp_96_type 1243 -#define _tmp_97_type 1244 -#define _loop1_98_type 1245 -#define _tmp_99_type 1246 -#define _tmp_100_type 1247 -#define _loop0_102_type 1248 -#define _gather_101_type 1249 -#define _loop1_103_type 1250 -#define _tmp_104_type 1251 -#define _tmp_105_type 1252 -#define _loop0_107_type 1253 -#define _gather_106_type 1254 -#define _loop0_109_type 1255 -#define _gather_108_type 1256 -#define _loop0_111_type 1257 -#define _gather_110_type 1258 -#define _loop0_113_type 1259 -#define _gather_112_type 1260 +#define for_if_clause_type 1120 +#define yield_expr_type 1121 +#define arguments_type 1122 +#define args_type 1123 +#define kwargs_type 1124 +#define starred_expression_type 1125 +#define kwarg_or_starred_type 1126 +#define kwarg_or_double_starred_type 1127 +#define star_targets_type 1128 +#define star_targets_seq_type 1129 +#define star_target_type 1130 +#define star_atom_type 1131 +#define inside_paren_ann_assign_target_type 1132 +#define ann_assign_subscript_attribute_target_type 1133 +#define del_targets_type 1134 +#define del_target_type 1135 +#define del_t_atom_type 1136 +#define targets_type 1137 +#define target_type 1138 +#define t_primary_type 1139 // Left-recursive +#define t_lookahead_type 1140 +#define t_atom_type 1141 +#define incorrect_arguments_type 1142 +#define invalid_named_expression_type 1143 +#define invalid_assignment_type 1144 +#define invalid_block_type 1145 +#define invalid_comprehension_type 1146 +#define invalid_parameters_type 1147 +#define invalid_double_type_comments_type 1148 +#define _loop0_1_type 1149 +#define _loop0_2_type 1150 +#define _loop0_4_type 1151 +#define _gather_3_type 1152 +#define _loop0_6_type 1153 +#define _gather_5_type 1154 +#define _loop0_8_type 1155 +#define _gather_7_type 1156 +#define _loop0_10_type 1157 +#define _gather_9_type 1158 +#define _loop1_11_type 1159 +#define _loop0_13_type 1160 +#define _gather_12_type 1161 +#define _tmp_14_type 1162 +#define _tmp_15_type 1163 +#define _tmp_16_type 1164 +#define _tmp_17_type 1165 +#define _tmp_18_type 1166 +#define _tmp_19_type 1167 +#define _tmp_20_type 1168 +#define _tmp_21_type 1169 +#define _loop1_22_type 1170 +#define _tmp_23_type 1171 +#define _tmp_24_type 1172 +#define _loop0_26_type 1173 +#define _gather_25_type 1174 +#define _loop0_28_type 1175 +#define _gather_27_type 1176 +#define _tmp_29_type 1177 +#define _loop0_30_type 1178 +#define _loop1_31_type 1179 +#define _loop0_33_type 1180 +#define _gather_32_type 1181 +#define _tmp_34_type 1182 +#define _loop0_36_type 1183 +#define _gather_35_type 1184 +#define _tmp_37_type 1185 +#define _loop0_39_type 1186 +#define _gather_38_type 1187 +#define _loop0_41_type 1188 +#define _gather_40_type 1189 +#define _loop0_43_type 1190 +#define _gather_42_type 1191 +#define _loop0_45_type 1192 +#define _gather_44_type 1193 +#define _tmp_46_type 1194 +#define _loop1_47_type 1195 +#define _tmp_48_type 1196 +#define _tmp_49_type 1197 +#define _tmp_50_type 1198 +#define _tmp_51_type 1199 +#define _tmp_52_type 1200 +#define _loop0_53_type 1201 +#define _loop0_54_type 1202 +#define _loop0_55_type 1203 +#define _loop1_56_type 1204 +#define _loop0_57_type 1205 +#define _loop1_58_type 1206 +#define _loop1_59_type 1207 +#define _loop1_60_type 1208 +#define _loop0_61_type 1209 +#define _loop1_62_type 1210 +#define _loop0_63_type 1211 +#define _loop1_64_type 1212 +#define _loop0_65_type 1213 +#define _loop1_66_type 1214 +#define _loop1_67_type 1215 +#define _tmp_68_type 1216 +#define _loop0_70_type 1217 +#define _gather_69_type 1218 +#define _loop1_71_type 1219 +#define _loop0_73_type 1220 +#define _gather_72_type 1221 +#define _loop1_74_type 1222 +#define _tmp_75_type 1223 +#define _tmp_76_type 1224 +#define _tmp_77_type 1225 +#define _tmp_78_type 1226 +#define _tmp_79_type 1227 +#define _tmp_80_type 1228 +#define _tmp_81_type 1229 +#define _tmp_82_type 1230 +#define _tmp_83_type 1231 +#define _loop0_84_type 1232 +#define _tmp_85_type 1233 +#define _loop1_86_type 1234 +#define _tmp_87_type 1235 +#define _tmp_88_type 1236 +#define _loop0_90_type 1237 +#define _gather_89_type 1238 +#define _loop0_92_type 1239 +#define _gather_91_type 1240 +#define _loop1_93_type 1241 +#define _loop1_94_type 1242 +#define _loop1_95_type 1243 +#define _tmp_96_type 1244 +#define _loop0_98_type 1245 +#define _gather_97_type 1246 +#define _tmp_99_type 1247 +#define _tmp_100_type 1248 +#define _tmp_101_type 1249 +#define _tmp_102_type 1250 +#define _loop1_103_type 1251 +#define _tmp_104_type 1252 +#define _tmp_105_type 1253 +#define _loop0_107_type 1254 +#define _gather_106_type 1255 +#define _loop1_108_type 1256 +#define _loop0_109_type 1257 +#define _loop0_110_type 1258 +#define _tmp_111_type 1259 +#define _tmp_112_type 1260 #define _loop0_114_type 1261 -#define _loop0_116_type 1262 -#define _gather_115_type 1263 -#define _tmp_117_type 1264 -#define _loop0_119_type 1265 -#define _gather_118_type 1266 -#define _loop0_121_type 1267 -#define _gather_120_type 1268 -#define _tmp_122_type 1269 -#define _tmp_123_type 1270 -#define _tmp_124_type 1271 -#define _tmp_125_type 1272 -#define _tmp_126_type 1273 -#define _loop0_127_type 1274 -#define _tmp_128_type 1275 -#define _tmp_129_type 1276 -#define _tmp_130_type 1277 -#define _tmp_131_type 1278 -#define _tmp_132_type 1279 -#define _tmp_133_type 1280 -#define _tmp_134_type 1281 -#define _tmp_135_type 1282 -#define _tmp_136_type 1283 -#define _tmp_137_type 1284 -#define _tmp_138_type 1285 -#define _tmp_139_type 1286 -#define _loop1_140_type 1287 -#define _loop0_141_type 1288 -#define _tmp_142_type 1289 +#define _gather_113_type 1262 +#define _loop0_116_type 1263 +#define _gather_115_type 1264 +#define _loop0_118_type 1265 +#define _gather_117_type 1266 +#define _loop0_120_type 1267 +#define _gather_119_type 1268 +#define _loop0_121_type 1269 +#define _loop0_123_type 1270 +#define _gather_122_type 1271 +#define _tmp_124_type 1272 +#define _loop0_126_type 1273 +#define _gather_125_type 1274 +#define _loop0_128_type 1275 +#define _gather_127_type 1276 +#define _tmp_129_type 1277 +#define _tmp_130_type 1278 +#define _tmp_131_type 1279 +#define _tmp_132_type 1280 +#define _tmp_133_type 1281 +#define _loop0_134_type 1282 +#define _tmp_135_type 1283 +#define _tmp_136_type 1284 +#define _tmp_137_type 1285 +#define _tmp_138_type 1286 +#define _tmp_139_type 1287 +#define _tmp_140_type 1288 +#define _tmp_141_type 1289 +#define _tmp_142_type 1290 +#define _tmp_143_type 1291 +#define _tmp_144_type 1292 +#define _tmp_145_type 1293 +#define _tmp_146_type 1294 +#define _tmp_147_type 1295 +#define _loop1_148_type 1296 static mod_ty file_rule(Parser *p); static mod_ty interactive_rule(Parser *p); @@ -479,6 +486,7 @@ static expr_ty dictcomp_rule(Parser *p); static asdl_seq* kvpairs_rule(Parser *p); static KeyValuePair* kvpair_rule(Parser *p); static asdl_seq* for_if_clauses_rule(Parser *p); +static comprehension_ty for_if_clause_rule(Parser *p); static expr_ty yield_expr_rule(Parser *p); static expr_ty arguments_rule(Parser *p); static expr_ty args_rule(Parser *p); @@ -548,107 +556,113 @@ static asdl_seq *_loop0_39_rule(Parser *p); static asdl_seq *_gather_38_rule(Parser *p); static asdl_seq *_loop0_41_rule(Parser *p); static asdl_seq *_gather_40_rule(Parser *p); -static void *_tmp_42_rule(Parser *p); -static asdl_seq *_loop1_43_rule(Parser *p); -static void *_tmp_44_rule(Parser *p); -static void *_tmp_45_rule(Parser *p); +static asdl_seq *_loop0_43_rule(Parser *p); +static asdl_seq *_gather_42_rule(Parser *p); +static asdl_seq *_loop0_45_rule(Parser *p); +static asdl_seq *_gather_44_rule(Parser *p); static void *_tmp_46_rule(Parser *p); -static void *_tmp_47_rule(Parser *p); -static asdl_seq *_loop0_48_rule(Parser *p); -static asdl_seq *_loop0_49_rule(Parser *p); -static asdl_seq *_loop0_50_rule(Parser *p); -static asdl_seq *_loop1_51_rule(Parser *p); -static asdl_seq *_loop0_52_rule(Parser *p); -static asdl_seq *_loop1_53_rule(Parser *p); -static asdl_seq *_loop1_54_rule(Parser *p); -static asdl_seq *_loop1_55_rule(Parser *p); -static asdl_seq *_loop0_56_rule(Parser *p); -static asdl_seq *_loop1_57_rule(Parser *p); -static asdl_seq *_loop0_58_rule(Parser *p); +static asdl_seq *_loop1_47_rule(Parser *p); +static void *_tmp_48_rule(Parser *p); +static void *_tmp_49_rule(Parser *p); +static void *_tmp_50_rule(Parser *p); +static void *_tmp_51_rule(Parser *p); +static void *_tmp_52_rule(Parser *p); +static asdl_seq *_loop0_53_rule(Parser *p); +static asdl_seq *_loop0_54_rule(Parser *p); +static asdl_seq *_loop0_55_rule(Parser *p); +static asdl_seq *_loop1_56_rule(Parser *p); +static asdl_seq *_loop0_57_rule(Parser *p); +static asdl_seq *_loop1_58_rule(Parser *p); static asdl_seq *_loop1_59_rule(Parser *p); -static asdl_seq *_loop0_60_rule(Parser *p); -static asdl_seq *_loop1_61_rule(Parser *p); +static asdl_seq *_loop1_60_rule(Parser *p); +static asdl_seq *_loop0_61_rule(Parser *p); static asdl_seq *_loop1_62_rule(Parser *p); -static void *_tmp_63_rule(Parser *p); +static asdl_seq *_loop0_63_rule(Parser *p); +static asdl_seq *_loop1_64_rule(Parser *p); static asdl_seq *_loop0_65_rule(Parser *p); -static asdl_seq *_gather_64_rule(Parser *p); static asdl_seq *_loop1_66_rule(Parser *p); -static asdl_seq *_loop0_68_rule(Parser *p); -static asdl_seq *_gather_67_rule(Parser *p); -static asdl_seq *_loop1_69_rule(Parser *p); -static void *_tmp_70_rule(Parser *p); -static void *_tmp_71_rule(Parser *p); -static void *_tmp_72_rule(Parser *p); -static void *_tmp_73_rule(Parser *p); -static void *_tmp_74_rule(Parser *p); +static asdl_seq *_loop1_67_rule(Parser *p); +static void *_tmp_68_rule(Parser *p); +static asdl_seq *_loop0_70_rule(Parser *p); +static asdl_seq *_gather_69_rule(Parser *p); +static asdl_seq *_loop1_71_rule(Parser *p); +static asdl_seq *_loop0_73_rule(Parser *p); +static asdl_seq *_gather_72_rule(Parser *p); +static asdl_seq *_loop1_74_rule(Parser *p); static void *_tmp_75_rule(Parser *p); static void *_tmp_76_rule(Parser *p); static void *_tmp_77_rule(Parser *p); static void *_tmp_78_rule(Parser *p); -static asdl_seq *_loop0_79_rule(Parser *p); +static void *_tmp_79_rule(Parser *p); static void *_tmp_80_rule(Parser *p); -static asdl_seq *_loop1_81_rule(Parser *p); +static void *_tmp_81_rule(Parser *p); static void *_tmp_82_rule(Parser *p); static void *_tmp_83_rule(Parser *p); -static asdl_seq *_loop0_85_rule(Parser *p); -static asdl_seq *_gather_84_rule(Parser *p); -static asdl_seq *_loop0_87_rule(Parser *p); -static asdl_seq *_gather_86_rule(Parser *p); -static asdl_seq *_loop1_88_rule(Parser *p); -static asdl_seq *_loop1_89_rule(Parser *p); -static asdl_seq *_loop1_90_rule(Parser *p); -static void *_tmp_91_rule(Parser *p); -static asdl_seq *_loop0_93_rule(Parser *p); -static asdl_seq *_gather_92_rule(Parser *p); -static void *_tmp_94_rule(Parser *p); -static void *_tmp_95_rule(Parser *p); +static asdl_seq *_loop0_84_rule(Parser *p); +static void *_tmp_85_rule(Parser *p); +static asdl_seq *_loop1_86_rule(Parser *p); +static void *_tmp_87_rule(Parser *p); +static void *_tmp_88_rule(Parser *p); +static asdl_seq *_loop0_90_rule(Parser *p); +static asdl_seq *_gather_89_rule(Parser *p); +static asdl_seq *_loop0_92_rule(Parser *p); +static asdl_seq *_gather_91_rule(Parser *p); +static asdl_seq *_loop1_93_rule(Parser *p); +static asdl_seq *_loop1_94_rule(Parser *p); +static asdl_seq *_loop1_95_rule(Parser *p); static void *_tmp_96_rule(Parser *p); -static void *_tmp_97_rule(Parser *p); -static asdl_seq *_loop1_98_rule(Parser *p); +static asdl_seq *_loop0_98_rule(Parser *p); +static asdl_seq *_gather_97_rule(Parser *p); static void *_tmp_99_rule(Parser *p); static void *_tmp_100_rule(Parser *p); -static asdl_seq *_loop0_102_rule(Parser *p); -static asdl_seq *_gather_101_rule(Parser *p); +static void *_tmp_101_rule(Parser *p); +static void *_tmp_102_rule(Parser *p); static asdl_seq *_loop1_103_rule(Parser *p); static void *_tmp_104_rule(Parser *p); static void *_tmp_105_rule(Parser *p); static asdl_seq *_loop0_107_rule(Parser *p); static asdl_seq *_gather_106_rule(Parser *p); +static asdl_seq *_loop1_108_rule(Parser *p); static asdl_seq *_loop0_109_rule(Parser *p); -static asdl_seq *_gather_108_rule(Parser *p); -static asdl_seq *_loop0_111_rule(Parser *p); -static asdl_seq *_gather_110_rule(Parser *p); -static asdl_seq *_loop0_113_rule(Parser *p); -static asdl_seq *_gather_112_rule(Parser *p); +static asdl_seq *_loop0_110_rule(Parser *p); +static void *_tmp_111_rule(Parser *p); +static void *_tmp_112_rule(Parser *p); static asdl_seq *_loop0_114_rule(Parser *p); +static asdl_seq *_gather_113_rule(Parser *p); static asdl_seq *_loop0_116_rule(Parser *p); static asdl_seq *_gather_115_rule(Parser *p); -static void *_tmp_117_rule(Parser *p); -static asdl_seq *_loop0_119_rule(Parser *p); -static asdl_seq *_gather_118_rule(Parser *p); +static asdl_seq *_loop0_118_rule(Parser *p); +static asdl_seq *_gather_117_rule(Parser *p); +static asdl_seq *_loop0_120_rule(Parser *p); +static asdl_seq *_gather_119_rule(Parser *p); static asdl_seq *_loop0_121_rule(Parser *p); -static asdl_seq *_gather_120_rule(Parser *p); -static void *_tmp_122_rule(Parser *p); -static void *_tmp_123_rule(Parser *p); +static asdl_seq *_loop0_123_rule(Parser *p); +static asdl_seq *_gather_122_rule(Parser *p); static void *_tmp_124_rule(Parser *p); -static void *_tmp_125_rule(Parser *p); -static void *_tmp_126_rule(Parser *p); -static asdl_seq *_loop0_127_rule(Parser *p); -static void *_tmp_128_rule(Parser *p); +static asdl_seq *_loop0_126_rule(Parser *p); +static asdl_seq *_gather_125_rule(Parser *p); +static asdl_seq *_loop0_128_rule(Parser *p); +static asdl_seq *_gather_127_rule(Parser *p); static void *_tmp_129_rule(Parser *p); static void *_tmp_130_rule(Parser *p); static void *_tmp_131_rule(Parser *p); static void *_tmp_132_rule(Parser *p); static void *_tmp_133_rule(Parser *p); -static void *_tmp_134_rule(Parser *p); +static asdl_seq *_loop0_134_rule(Parser *p); static void *_tmp_135_rule(Parser *p); static void *_tmp_136_rule(Parser *p); static void *_tmp_137_rule(Parser *p); static void *_tmp_138_rule(Parser *p); static void *_tmp_139_rule(Parser *p); -static asdl_seq *_loop1_140_rule(Parser *p); -static asdl_seq *_loop0_141_rule(Parser *p); +static void *_tmp_140_rule(Parser *p); +static void *_tmp_141_rule(Parser *p); static void *_tmp_142_rule(Parser *p); +static void *_tmp_143_rule(Parser *p); +static void *_tmp_144_rule(Parser *p); +static void *_tmp_145_rule(Parser *p); +static void *_tmp_146_rule(Parser *p); +static void *_tmp_147_rule(Parser *p); +static asdl_seq *_loop1_148_rule(Parser *p); // file: statements? $ @@ -1545,7 +1559,7 @@ assignment_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = _Py_AnnAssign ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ); + res = CHECK_VERSION ( 6 , "Variable annotation syntax is" , _Py_AnnAssign ( CHECK ( _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -1577,7 +1591,7 @@ assignment_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = _Py_AnnAssign ( a , b , c , 0 , EXTRA ); + res = CHECK_VERSION ( 6 , "Variable annotations syntax is" , _Py_AnnAssign ( a , b , c , 0 , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -1733,7 +1747,7 @@ augassign_rule(Parser *p) (literal = _PyPegen_expect_token(p, 50)) ) { - res = _PyPegen_augoperator ( p , MatMult ); + res = CHECK_VERSION ( 5 , "The '@' operator is" , _PyPegen_augoperator ( p , MatMult ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -2836,7 +2850,8 @@ while_stmt_rule(Parser *p) } // for_stmt: -// | ASYNC? 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? +// | 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? +// | ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? static stmt_ty for_stmt_rule(Parser *p) { @@ -2853,18 +2868,62 @@ for_stmt_rule(Parser *p) UNUSED(start_lineno); // Only used by EXTRA macro int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro - { // ASYNC? 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? + { // 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? asdl_seq* b; void *el; expr_ty ex; - void *is_async; void *keyword; void *keyword_1; void *literal; expr_ty t; void *tc; if ( - (is_async = _PyPegen_expect_token(p, ASYNC), 1) + (keyword = _PyPegen_expect_token(p, 517)) + && + (t = star_targets_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 518)) + && + (ex = star_expressions_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && + (b = block_rule(p)) + && + (el = else_block_rule(p), 1) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_For ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ASYNC 'for' star_targets 'in' star_expressions ':' TYPE_COMMENT? block else_block? + void *async_var; + asdl_seq* b; + void *el; + expr_ty ex; + void *keyword; + void *keyword_1; + void *literal; + expr_ty t; + void *tc; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) && (keyword = _PyPegen_expect_token(p, 517)) && @@ -2891,7 +2950,7 @@ for_stmt_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncFor : _Py_For ) ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + res = CHECK_VERSION ( 5 , "Async for loops are" , _Py_AsyncFor ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -2906,8 +2965,10 @@ for_stmt_rule(Parser *p) } // with_stmt: -// | ASYNC? 'with' '(' ','.with_item+ ')' ':' block -// | ASYNC? 'with' ','.with_item+ ':' TYPE_COMMENT? block +// | 'with' '(' ','.with_item+ ')' ':' block +// | 'with' ','.with_item+ ':' TYPE_COMMENT? block +// | ASYNC 'with' '(' ','.with_item+ ')' ':' block +// | ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block static stmt_ty with_stmt_rule(Parser *p) { @@ -2924,17 +2985,14 @@ with_stmt_rule(Parser *p) UNUSED(start_lineno); // Only used by EXTRA macro int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro - { // ASYNC? 'with' '(' ','.with_item+ ')' ':' block + { // 'with' '(' ','.with_item+ ')' ':' block asdl_seq * a; asdl_seq* b; - void *is_async; void *keyword; void *literal; void *literal_1; void *literal_2; if ( - (is_async = _PyPegen_expect_token(p, ASYNC), 1) - && (keyword = _PyPegen_expect_token(p, 519)) && (literal = _PyPegen_expect_token(p, 7)) @@ -2956,7 +3014,7 @@ with_stmt_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncWith : _Py_With ) ( a , b , NULL , EXTRA ); + res = _Py_With ( a , b , NULL , EXTRA ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -2965,16 +3023,13 @@ with_stmt_rule(Parser *p) } p->mark = mark; } - { // ASYNC? 'with' ','.with_item+ ':' TYPE_COMMENT? block + { // 'with' ','.with_item+ ':' TYPE_COMMENT? block asdl_seq * a; asdl_seq* b; - void *is_async; void *keyword; void *literal; void *tc; if ( - (is_async = _PyPegen_expect_token(p, ASYNC), 1) - && (keyword = _PyPegen_expect_token(p, 519)) && (a = _gather_40_rule(p)) @@ -2994,7 +3049,86 @@ with_stmt_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncWith : _Py_With ) ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + res = _Py_With ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ASYNC 'with' '(' ','.with_item+ ')' ':' block + asdl_seq * a; + void *async_var; + asdl_seq* b; + void *keyword; + void *literal; + void *literal_1; + void *literal_2; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) + && + (keyword = _PyPegen_expect_token(p, 519)) + && + (literal = _PyPegen_expect_token(p, 7)) + && + (a = _gather_42_rule(p)) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + && + (literal_2 = _PyPegen_expect_token(p, 11)) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = CHECK_VERSION ( 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NULL , EXTRA ) ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ASYNC 'with' ','.with_item+ ':' TYPE_COMMENT? block + asdl_seq * a; + void *async_var; + asdl_seq* b; + void *keyword; + void *literal; + void *tc; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) + && + (keyword = _PyPegen_expect_token(p, 519)) + && + (a = _gather_44_rule(p)) + && + (literal = _PyPegen_expect_token(p, 11)) + && + (tc = _PyPegen_expect_token(p, TYPE_COMMENT), 1) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = CHECK_VERSION ( 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3023,7 +3157,7 @@ with_item_rule(Parser *p) if ( (e = expression_rule(p)) && - (o = _tmp_42_rule(p), 1) + (o = _tmp_46_rule(p), 1) ) { res = _Py_withitem ( e , o , p -> arena ); @@ -3105,7 +3239,7 @@ try_stmt_rule(Parser *p) && (b = block_rule(p)) && - (ex = _loop1_43_rule(p)) + (ex = _loop1_47_rule(p)) && (el = else_block_rule(p), 1) && @@ -3162,7 +3296,7 @@ except_block_rule(Parser *p) && (e = expression_rule(p)) && - (t = _tmp_44_rule(p), 1) + (t = _tmp_48_rule(p), 1) && (literal = _PyPegen_expect_token(p, 11)) && @@ -3329,7 +3463,7 @@ raise_stmt_rule(Parser *p) && (a = expression_rule(p)) && - (b = _tmp_45_rule(p), 1) + (b = _tmp_49_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -3421,7 +3555,8 @@ function_def_rule(Parser *p) } // function_def_raw: -// | ASYNC? 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block +// | 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block +// | ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block static stmt_ty function_def_raw_rule(Parser *p) { @@ -3438,10 +3573,57 @@ function_def_raw_rule(Parser *p) UNUSED(start_lineno); // Only used by EXTRA macro int start_col_offset = p->tokens[mark]->col_offset; UNUSED(start_col_offset); // Only used by EXTRA macro - { // ASYNC? 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block + { // 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block + void *a; + asdl_seq* b; + void *keyword; + void *literal; + void *literal_1; + void *literal_2; + expr_ty n; + void *params; + void *tc; + if ( + (keyword = _PyPegen_expect_token(p, 522)) + && + (n = _PyPegen_name_token(p)) + && + (literal = _PyPegen_expect_token(p, 7)) + && + (params = params_rule(p), 1) + && + (literal_1 = _PyPegen_expect_token(p, 8)) + && + (a = _tmp_50_rule(p), 1) + && + (literal_2 = _PyPegen_expect_token(p, 11)) + && + (tc = func_type_comment_rule(p), 1) + && + (b = block_rule(p)) + ) + { + Token *token = _PyPegen_get_last_nonnwhitespace_token(p); + if (token == NULL) { + return NULL; + } + int end_lineno = token->end_lineno; + UNUSED(end_lineno); // Only used by EXTRA macro + int end_col_offset = token->end_col_offset; + UNUSED(end_col_offset); // Only used by EXTRA macro + res = _Py_FunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // ASYNC 'def' NAME '(' params? ')' ['->' expression] ':' func_type_comment? block void *a; + void *async_var; asdl_seq* b; - void *is_async; void *keyword; void *literal; void *literal_1; @@ -3450,7 +3632,7 @@ function_def_raw_rule(Parser *p) void *params; void *tc; if ( - (is_async = _PyPegen_expect_token(p, ASYNC), 1) + (async_var = _PyPegen_expect_token(p, ASYNC)) && (keyword = _PyPegen_expect_token(p, 522)) && @@ -3462,7 +3644,7 @@ function_def_raw_rule(Parser *p) && (literal_1 = _PyPegen_expect_token(p, 8)) && - (a = _tmp_46_rule(p), 1) + (a = _tmp_51_rule(p), 1) && (literal_2 = _PyPegen_expect_token(p, 11)) && @@ -3479,7 +3661,7 @@ function_def_raw_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = ( is_async ? _Py_AsyncFunctionDef : _Py_FunctionDef ) ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + res = CHECK_VERSION ( 5 , "Async functions are" , _Py_AsyncFunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -3513,7 +3695,7 @@ func_type_comment_rule(Parser *p) && (t = _PyPegen_expect_token(p, TYPE_COMMENT)) && - _PyPegen_lookahead(1, _tmp_47_rule, p) + _PyPegen_lookahead(1, _tmp_52_rule, p) ) { res = t; @@ -3610,9 +3792,9 @@ parameters_rule(Parser *p) if ( (a = slash_no_default_rule(p)) && - (b = _loop0_48_rule(p)) + (b = _loop0_53_rule(p)) && - (c = _loop0_49_rule(p)) + (c = _loop0_54_rule(p)) && (d = star_etc_rule(p), 1) ) @@ -3633,7 +3815,7 @@ parameters_rule(Parser *p) if ( (a = slash_with_default_rule(p)) && - (b = _loop0_50_rule(p)) + (b = _loop0_55_rule(p)) && (c = star_etc_rule(p), 1) ) @@ -3652,9 +3834,9 @@ parameters_rule(Parser *p) asdl_seq * b; void *c; if ( - (a = _loop1_51_rule(p)) + (a = _loop1_56_rule(p)) && - (b = _loop0_52_rule(p)) + (b = _loop0_57_rule(p)) && (c = star_etc_rule(p), 1) ) @@ -3672,7 +3854,7 @@ parameters_rule(Parser *p) asdl_seq * a; void *b; if ( - (a = _loop1_53_rule(p)) + (a = _loop1_58_rule(p)) && (b = star_etc_rule(p), 1) ) @@ -3720,7 +3902,7 @@ slash_no_default_rule(Parser *p) void *literal; void *literal_1; if ( - (a = _loop1_54_rule(p)) + (a = _loop1_59_rule(p)) && (literal = _PyPegen_expect_token(p, 17)) && @@ -3740,7 +3922,7 @@ slash_no_default_rule(Parser *p) asdl_seq * a; void *literal; if ( - (a = _loop1_55_rule(p)) + (a = _loop1_60_rule(p)) && (literal = _PyPegen_expect_token(p, 17)) && @@ -3778,9 +3960,9 @@ slash_with_default_rule(Parser *p) void *literal; void *literal_1; if ( - (a = _loop0_56_rule(p)) + (a = _loop0_61_rule(p)) && - (b = _loop1_57_rule(p)) + (b = _loop1_62_rule(p)) && (literal = _PyPegen_expect_token(p, 17)) && @@ -3801,9 +3983,9 @@ slash_with_default_rule(Parser *p) asdl_seq * b; void *literal; if ( - (a = _loop0_58_rule(p)) + (a = _loop0_63_rule(p)) && - (b = _loop1_59_rule(p)) + (b = _loop1_64_rule(p)) && (literal = _PyPegen_expect_token(p, 17)) && @@ -3846,7 +4028,7 @@ star_etc_rule(Parser *p) && (a = param_no_default_rule(p)) && - (b = _loop0_60_rule(p)) + (b = _loop0_65_rule(p)) && (c = kwds_rule(p), 1) ) @@ -3870,7 +4052,7 @@ star_etc_rule(Parser *p) && (literal_1 = _PyPegen_expect_token(p, 12)) && - (b = _loop1_61_rule(p)) + (b = _loop1_66_rule(p)) && (c = kwds_rule(p), 1) ) @@ -4239,7 +4421,7 @@ decorators_rule(Parser *p) { // (('@' named_expression NEWLINE))+ asdl_seq * a; if ( - (a = _loop1_62_rule(p)) + (a = _loop1_67_rule(p)) ) { res = a; @@ -4327,7 +4509,7 @@ class_def_raw_rule(Parser *p) && (a = _PyPegen_name_token(p)) && - (b = _tmp_63_rule(p), 1) + (b = _tmp_68_rule(p), 1) && (literal = _PyPegen_expect_token(p, 11)) && @@ -4433,7 +4615,7 @@ expressions_list_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_64_rule(p)) + (a = _gather_69_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4480,7 +4662,7 @@ star_expressions_rule(Parser *p) if ( (a = star_expression_rule(p)) && - (b = _loop1_66_rule(p)) + (b = _loop1_71_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4620,7 +4802,7 @@ star_named_expressions_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_67_rule(p)) + (a = _gather_72_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -4834,7 +5016,7 @@ expressions_rule(Parser *p) if ( (a = expression_rule(p)) && - (b = _loop1_69_rule(p)) + (b = _loop1_74_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -5056,11 +5238,11 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_slash_without_default_rule(p)) && - (b = _tmp_70_rule(p), 1) + (b = _tmp_75_rule(p), 1) && - (c = _tmp_71_rule(p), 1) + (c = _tmp_76_rule(p), 1) && - (d = _tmp_72_rule(p), 1) + (d = _tmp_77_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , a , NULL , b , c , d ); @@ -5079,9 +5261,9 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_slash_with_default_rule(p)) && - (b = _tmp_73_rule(p), 1) + (b = _tmp_78_rule(p), 1) && - (c = _tmp_74_rule(p), 1) + (c = _tmp_79_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , a , NULL , b , c ); @@ -5100,9 +5282,9 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_plain_names_rule(p)) && - (b = _tmp_75_rule(p), 1) + (b = _tmp_80_rule(p), 1) && - (c = _tmp_76_rule(p), 1) + (c = _tmp_81_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , NULL , a , b , c ); @@ -5120,7 +5302,7 @@ lambda_parameters_rule(Parser *p) if ( (a = lambda_names_with_default_rule(p)) && - (b = _tmp_77_rule(p), 1) + (b = _tmp_82_rule(p), 1) ) { res = _PyPegen_make_arguments ( p , NULL , NULL , NULL , a , b ); @@ -5202,7 +5384,7 @@ lambda_slash_with_default_rule(Parser *p) void *literal; void *literal_1; if ( - (a = _tmp_78_rule(p), 1) + (a = _tmp_83_rule(p), 1) && (b = lambda_names_with_default_rule(p)) && @@ -5249,9 +5431,9 @@ lambda_star_etc_rule(Parser *p) && (a = lambda_plain_name_rule(p)) && - (b = _loop0_79_rule(p)) + (b = _loop0_84_rule(p)) && - (c = _tmp_80_rule(p), 1) + (c = _tmp_85_rule(p), 1) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -5274,9 +5456,9 @@ lambda_star_etc_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 16)) && - (b = _loop1_81_rule(p)) + (b = _loop1_86_rule(p)) && - (c = _tmp_82_rule(p), 1) + (c = _tmp_87_rule(p), 1) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -5332,7 +5514,7 @@ lambda_name_with_optional_default_rule(Parser *p) && (a = lambda_plain_name_rule(p)) && - (b = _tmp_83_rule(p), 1) + (b = _tmp_88_rule(p), 1) ) { res = _PyPegen_name_default_pair ( p , a , b , NULL ); @@ -5361,7 +5543,7 @@ lambda_names_with_default_rule(Parser *p) { // ','.lambda_name_with_default+ asdl_seq * a; if ( - (a = _gather_84_rule(p)) + (a = _gather_89_rule(p)) ) { res = a; @@ -5425,7 +5607,7 @@ lambda_plain_names_rule(Parser *p) { // ','.(lambda_plain_name !'=')+ asdl_seq * a; if ( - (a = _gather_86_rule(p)) + (a = _gather_91_rule(p)) ) { res = a; @@ -5544,7 +5726,7 @@ disjunction_rule(Parser *p) if ( (a = conjunction_rule(p)) && - (b = _loop1_88_rule(p)) + (b = _loop1_93_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -5606,7 +5788,7 @@ conjunction_rule(Parser *p) if ( (a = inversion_rule(p)) && - (b = _loop1_89_rule(p)) + (b = _loop1_94_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -5728,7 +5910,7 @@ comparison_rule(Parser *p) if ( (a = bitwise_or_rule(p)) && - (b = _loop1_90_rule(p)) + (b = _loop1_95_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -5940,10 +6122,10 @@ noteq_bitwise_or_rule(Parser *p) CmpopExprPair* res = NULL; int mark = p->mark; { // ('!=') bitwise_or - void *_tmp_91_var; + void *_tmp_96_var; expr_ty a; if ( - (_tmp_91_var = _tmp_91_rule(p)) + (_tmp_96_var = _tmp_96_rule(p)) && (a = bitwise_or_rule(p)) ) @@ -6901,7 +7083,7 @@ term_raw(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = _Py_BinOp ( a , MatMult , b , EXTRA ); + res = CHECK_VERSION ( 5 , "The '@' operator is" , _Py_BinOp ( a , MatMult , b , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -7138,7 +7320,7 @@ await_primary_rule(Parser *p) UNUSED(end_lineno); // Only used by EXTRA macro int end_col_offset = token->end_col_offset; UNUSED(end_col_offset); // Only used by EXTRA macro - res = _Py_Await ( a , EXTRA ); + res = CHECK_VERSION ( 5 , "Await expressions are" , _Py_Await ( a , EXTRA ) ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -7385,7 +7567,7 @@ slices_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_92_rule(p)) + (a = _gather_97_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -7441,7 +7623,7 @@ slice_rule(Parser *p) && (b = expression_rule(p), 1) && - (c = _tmp_94_rule(p), 1) + (c = _tmp_99_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -7629,40 +7811,40 @@ atom_rule(Parser *p) p->mark = mark; } { // &'(' (tuple | group | genexp) - void *_tmp_95_var; + void *_tmp_100_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 7) && - (_tmp_95_var = _tmp_95_rule(p)) + (_tmp_100_var = _tmp_100_rule(p)) ) { - res = _tmp_95_var; + res = _tmp_100_var; goto done; } p->mark = mark; } { // &'[' (list | listcomp) - void *_tmp_96_var; + void *_tmp_101_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 9) && - (_tmp_96_var = _tmp_96_rule(p)) + (_tmp_101_var = _tmp_101_rule(p)) ) { - res = _tmp_96_var; + res = _tmp_101_var; goto done; } p->mark = mark; } { // &'{' (dict | set | dictcomp | setcomp) - void *_tmp_97_var; + void *_tmp_102_var; if ( _PyPegen_lookahead_with_int(1, _PyPegen_expect_token, p, 25) && - (_tmp_97_var = _tmp_97_rule(p)) + (_tmp_102_var = _tmp_102_rule(p)) ) { - res = _tmp_97_var; + res = _tmp_102_var; goto done; } p->mark = mark; @@ -7709,7 +7891,7 @@ strings_rule(Parser *p) { // STRING+ asdl_seq * a; if ( - (a = _loop1_98_rule(p)) + (a = _loop1_103_rule(p)) ) { res = _PyPegen_concatenate_strings ( p , a ); @@ -7867,7 +8049,7 @@ tuple_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 7)) && - (a = _tmp_99_rule(p), 1) + (a = _tmp_104_rule(p), 1) && (literal_1 = _PyPegen_expect_token(p, 8)) ) @@ -7910,7 +8092,7 @@ group_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 7)) && - (a = _tmp_100_rule(p)) + (a = _tmp_105_rule(p)) && (literal_1 = _PyPegen_expect_token(p, 8)) ) @@ -8229,7 +8411,7 @@ kvpairs_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_101_rule(p)) + (a = _gather_106_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8301,7 +8483,7 @@ kvpair_rule(Parser *p) return res; } -// for_if_clauses: ((ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*))+ +// for_if_clauses: for_if_clause+ static asdl_seq* for_if_clauses_rule(Parser *p) { @@ -8310,13 +8492,82 @@ for_if_clauses_rule(Parser *p) } asdl_seq* res = NULL; int mark = p->mark; - { // ((ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*))+ - asdl_seq * a; + { // for_if_clause+ + asdl_seq * _loop1_108_var; if ( - (a = _loop1_103_rule(p)) + (_loop1_108_var = _loop1_108_rule(p)) ) { - res = a; + res = _loop1_108_var; + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// for_if_clause: +// | ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))* +// | 'for' star_targets 'in' disjunction (('if' disjunction))* +static comprehension_ty +for_if_clause_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + comprehension_ty res = NULL; + int mark = p->mark; + { // ASYNC 'for' star_targets 'in' disjunction (('if' disjunction))* + expr_ty a; + void *async_var; + expr_ty b; + asdl_seq * c; + void *keyword; + void *keyword_1; + if ( + (async_var = _PyPegen_expect_token(p, ASYNC)) + && + (keyword = _PyPegen_expect_token(p, 517)) + && + (a = star_targets_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 518)) + && + (b = disjunction_rule(p)) + && + (c = _loop0_109_rule(p)) + ) + { + res = CHECK_VERSION ( 6 , "Async comprehensions are" , _Py_comprehension ( a , b , c , 1 , p -> arena ) ); + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + { // 'for' star_targets 'in' disjunction (('if' disjunction))* + expr_ty a; + expr_ty b; + asdl_seq * c; + void *keyword; + void *keyword_1; + if ( + (keyword = _PyPegen_expect_token(p, 517)) + && + (a = star_targets_rule(p)) + && + (keyword_1 = _PyPegen_expect_token(p, 518)) + && + (b = disjunction_rule(p)) + && + (c = _loop0_110_rule(p)) + ) + { + res = _Py_comprehension ( a , b , c , 0 , p -> arena ); if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -8479,7 +8730,7 @@ args_rule(Parser *p) if ( (a = starred_expression_rule(p)) && - (b = _tmp_104_rule(p), 1) + (b = _tmp_111_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8528,7 +8779,7 @@ args_rule(Parser *p) if ( (a = named_expression_rule(p)) && - (b = _tmp_105_rule(p), 1) + (b = _tmp_112_rule(p), 1) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -8570,11 +8821,11 @@ kwargs_rule(Parser *p) asdl_seq * b; void *literal; if ( - (a = _gather_106_rule(p)) + (a = _gather_113_rule(p)) && (literal = _PyPegen_expect_token(p, 12)) && - (b = _gather_108_rule(p)) + (b = _gather_115_rule(p)) ) { res = _PyPegen_join_sequences ( p , a , b ); @@ -8587,23 +8838,23 @@ kwargs_rule(Parser *p) p->mark = mark; } { // ','.kwarg_or_starred+ - asdl_seq * _gather_110_var; + asdl_seq * _gather_117_var; if ( - (_gather_110_var = _gather_110_rule(p)) + (_gather_117_var = _gather_117_rule(p)) ) { - res = _gather_110_var; + res = _gather_117_var; goto done; } p->mark = mark; } { // ','.kwarg_or_double_starred+ - asdl_seq * _gather_112_var; + asdl_seq * _gather_119_var; if ( - (_gather_112_var = _gather_112_rule(p)) + (_gather_119_var = _gather_119_rule(p)) ) { - res = _gather_112_var; + res = _gather_119_var; goto done; } p->mark = mark; @@ -8846,7 +9097,7 @@ star_targets_rule(Parser *p) if ( (a = star_target_rule(p)) && - (b = _loop0_114_rule(p)) + (b = _loop0_121_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8887,7 +9138,7 @@ star_targets_seq_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_115_rule(p)) + (a = _gather_122_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -8935,7 +9186,7 @@ star_target_rule(Parser *p) if ( (literal = _PyPegen_expect_token(p, 16)) && - (a = _tmp_117_rule(p)) + (a = _tmp_124_rule(p)) ) { Token *token = _PyPegen_get_last_nonnwhitespace_token(p); @@ -9324,7 +9575,7 @@ del_targets_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_118_rule(p)) + (a = _gather_125_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -9577,7 +9828,7 @@ targets_rule(Parser *p) void *opt_var; UNUSED(opt_var); // Silence compiler warnings if ( - (a = _gather_120_rule(p)) + (a = _gather_127_rule(p)) && (opt_var = _PyPegen_expect_token(p, 12), 1) ) @@ -10105,7 +10356,7 @@ incorrect_arguments_rule(Parser *p) && (literal = _PyPegen_expect_token(p, 12)) && - (opt_var = _tmp_122_rule(p), 1) + (opt_var = _tmp_129_rule(p), 1) ) { res = RAISE_SYNTAX_ERROR ( "Generator expression must be parenthesized" ); @@ -10240,7 +10491,7 @@ invalid_assignment_rule(Parser *p) && (expression_var_1 = expression_rule(p)) && - (opt_var = _tmp_123_rule(p), 1) + (opt_var = _tmp_130_rule(p), 1) ) { res = RAISE_SYNTAX_ERROR ( "illegal target for annotation" ); @@ -10253,15 +10504,15 @@ invalid_assignment_rule(Parser *p) p->mark = mark; } { // expression ('=' | augassign) (yield_expr | star_expressions) - void *_tmp_124_var; - void *_tmp_125_var; + void *_tmp_131_var; + void *_tmp_132_var; expr_ty a; if ( (a = expression_rule(p)) && - (_tmp_124_var = _tmp_124_rule(p)) + (_tmp_131_var = _tmp_131_rule(p)) && - (_tmp_125_var = _tmp_125_rule(p)) + (_tmp_132_var = _tmp_132_rule(p)) ) { res = RAISE_SYNTAX_ERROR ( "cannot assign to %s" , _PyPegen_get_expr_name ( a ) ); @@ -10319,12 +10570,12 @@ invalid_comprehension_rule(Parser *p) void * res = NULL; int mark = p->mark; { // ('[' | '(' | '{') '*' expression for_if_clauses - void *_tmp_126_var; + void *_tmp_133_var; expr_ty expression_var; asdl_seq* for_if_clauses_var; void *literal; if ( - (_tmp_126_var = _tmp_126_rule(p)) + (_tmp_133_var = _tmp_133_rule(p)) && (literal = _PyPegen_expect_token(p, 16)) && @@ -10358,13 +10609,13 @@ invalid_parameters_rule(Parser *p) void * res = NULL; int mark = p->mark; { // param_no_default* (slash_with_default | param_with_default+) param_no_default - asdl_seq * _loop0_127_var; - void *_tmp_128_var; + asdl_seq * _loop0_134_var; + void *_tmp_135_var; arg_ty param_no_default_var; if ( - (_loop0_127_var = _loop0_127_rule(p)) + (_loop0_134_var = _loop0_134_rule(p)) && - (_tmp_128_var = _tmp_128_rule(p)) + (_tmp_135_var = _tmp_135_rule(p)) && (param_no_default_var = param_no_default_rule(p)) ) @@ -11319,12 +11570,12 @@ _loop1_22_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (star_targets '=') - void *_tmp_129_var; + void *_tmp_136_var; while ( - (_tmp_129_var = _tmp_129_rule(p)) + (_tmp_136_var = _tmp_136_rule(p)) ) { - res = _tmp_129_var; + res = _tmp_136_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -11646,12 +11897,12 @@ _loop0_30_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('.' | '...') - void *_tmp_130_var; + void *_tmp_137_var; while ( - (_tmp_130_var = _tmp_130_rule(p)) + (_tmp_137_var = _tmp_137_rule(p)) ) { - res = _tmp_130_var; + res = _tmp_137_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -11695,12 +11946,12 @@ _loop1_31_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('.' | '...') - void *_tmp_131_var; + void *_tmp_138_var; while ( - (_tmp_131_var = _tmp_131_rule(p)) + (_tmp_138_var = _tmp_138_rule(p)) ) { - res = _tmp_131_var; + res = _tmp_138_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -12134,9 +12385,179 @@ _gather_40_rule(Parser *p) return res; } -// _tmp_42: 'as' target -static void * -_tmp_42_rule(Parser *p) +// _loop0_43: ',' with_item +static asdl_seq * +_loop0_43_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' with_item + withitem_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = with_item_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_43"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_43_type, seq); + return seq; +} + +// _gather_42: with_item _loop0_43 +static asdl_seq * +_gather_42_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // with_item _loop0_43 + withitem_ty elem; + asdl_seq * seq; + if ( + (elem = with_item_rule(p)) + && + (seq = _loop0_43_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _loop0_45: ',' with_item +static asdl_seq * +_loop0_45_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ',' with_item + withitem_ty elem; + void *literal; + while ( + (literal = _PyPegen_expect_token(p, 12)) + && + (elem = with_item_rule(p)) + ) + { + res = elem; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + PyMem_Free(children); + return NULL; + } + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_45"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_45_type, seq); + return seq; +} + +// _gather_44: with_item _loop0_45 +static asdl_seq * +_gather_44_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + asdl_seq * res = NULL; + int mark = p->mark; + { // with_item _loop0_45 + withitem_ty elem; + asdl_seq * seq; + if ( + (elem = with_item_rule(p)) + && + (seq = _loop0_45_rule(p)) + ) + { + res = _PyPegen_seq_insert_in_front(p, elem, seq); + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_46: 'as' target +static void * +_tmp_46_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12166,9 +12587,9 @@ _tmp_42_rule(Parser *p) return res; } -// _loop1_43: except_block +// _loop1_47: except_block static asdl_seq * -_loop1_43_rule(Parser *p) +_loop1_47_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12209,19 +12630,19 @@ _loop1_43_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_43"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_47"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_43_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_47_type, seq); return seq; } -// _tmp_44: 'as' target +// _tmp_48: 'as' target static void * -_tmp_44_rule(Parser *p) +_tmp_48_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12251,9 +12672,9 @@ _tmp_44_rule(Parser *p) return res; } -// _tmp_45: 'from' expression +// _tmp_49: 'from' expression static void * -_tmp_45_rule(Parser *p) +_tmp_49_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12283,9 +12704,41 @@ _tmp_45_rule(Parser *p) return res; } -// _tmp_46: '->' expression +// _tmp_50: '->' expression static void * -_tmp_46_rule(Parser *p) +_tmp_50_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // '->' expression + void *literal; + expr_ty z; + if ( + (literal = _PyPegen_expect_token(p, 51)) + && + (z = expression_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_51: '->' expression +static void * +_tmp_51_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12315,9 +12768,9 @@ _tmp_46_rule(Parser *p) return res; } -// _tmp_47: NEWLINE INDENT +// _tmp_52: NEWLINE INDENT static void * -_tmp_47_rule(Parser *p) +_tmp_52_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12343,9 +12796,9 @@ _tmp_47_rule(Parser *p) return res; } -// _loop0_48: param_no_default +// _loop0_53: param_no_default static asdl_seq * -_loop0_48_rule(Parser *p) +_loop0_53_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12382,19 +12835,19 @@ _loop0_48_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_48"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_53"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_48_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_53_type, seq); return seq; } -// _loop0_49: param_with_default +// _loop0_54: param_with_default static asdl_seq * -_loop0_49_rule(Parser *p) +_loop0_54_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12431,19 +12884,19 @@ _loop0_49_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_49"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_54"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_49_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_54_type, seq); return seq; } -// _loop0_50: param_with_default +// _loop0_55: param_with_default static asdl_seq * -_loop0_50_rule(Parser *p) +_loop0_55_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12480,19 +12933,19 @@ _loop0_50_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_50"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_55"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_50_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_55_type, seq); return seq; } -// _loop1_51: param_no_default +// _loop1_56: param_no_default static asdl_seq * -_loop1_51_rule(Parser *p) +_loop1_56_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12533,19 +12986,19 @@ _loop1_51_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_51"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_56"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_51_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_56_type, seq); return seq; } -// _loop0_52: param_with_default +// _loop0_57: param_with_default static asdl_seq * -_loop0_52_rule(Parser *p) +_loop0_57_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12582,19 +13035,19 @@ _loop0_52_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_52"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_57"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_52_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_57_type, seq); return seq; } -// _loop1_53: param_with_default +// _loop1_58: param_with_default static asdl_seq * -_loop1_53_rule(Parser *p) +_loop1_58_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12635,19 +13088,19 @@ _loop1_53_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_53"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_58"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_53_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_58_type, seq); return seq; } -// _loop1_54: param_no_default +// _loop1_59: param_no_default static asdl_seq * -_loop1_54_rule(Parser *p) +_loop1_59_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12688,19 +13141,19 @@ _loop1_54_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_54"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_59"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_54_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_59_type, seq); return seq; } -// _loop1_55: param_no_default +// _loop1_60: param_no_default static asdl_seq * -_loop1_55_rule(Parser *p) +_loop1_60_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12741,19 +13194,19 @@ _loop1_55_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_55"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_60"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_55_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_60_type, seq); return seq; } -// _loop0_56: param_no_default +// _loop0_61: param_no_default static asdl_seq * -_loop0_56_rule(Parser *p) +_loop0_61_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12790,19 +13243,19 @@ _loop0_56_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_56"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_61"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_56_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_61_type, seq); return seq; } -// _loop1_57: param_with_default +// _loop1_62: param_with_default static asdl_seq * -_loop1_57_rule(Parser *p) +_loop1_62_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12843,19 +13296,19 @@ _loop1_57_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_57"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_62"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_57_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_62_type, seq); return seq; } -// _loop0_58: param_no_default +// _loop0_63: param_no_default static asdl_seq * -_loop0_58_rule(Parser *p) +_loop0_63_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12892,19 +13345,19 @@ _loop0_58_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_58"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_63"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_58_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_63_type, seq); return seq; } -// _loop1_59: param_with_default +// _loop1_64: param_with_default static asdl_seq * -_loop1_59_rule(Parser *p) +_loop1_64_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12945,19 +13398,19 @@ _loop1_59_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_59"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_64"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_59_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_64_type, seq); return seq; } -// _loop0_60: param_maybe_default +// _loop0_65: param_maybe_default static asdl_seq * -_loop0_60_rule(Parser *p) +_loop0_65_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -12994,19 +13447,19 @@ _loop0_60_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_60"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_65"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_60_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_65_type, seq); return seq; } -// _loop1_61: param_maybe_default +// _loop1_66: param_maybe_default static asdl_seq * -_loop1_61_rule(Parser *p) +_loop1_66_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13047,19 +13500,19 @@ _loop1_61_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_61"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_66"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_61_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_66_type, seq); return seq; } -// _loop1_62: ('@' named_expression NEWLINE) +// _loop1_67: ('@' named_expression NEWLINE) static asdl_seq * -_loop1_62_rule(Parser *p) +_loop1_67_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13075,12 +13528,12 @@ _loop1_62_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('@' named_expression NEWLINE) - void *_tmp_132_var; + void *_tmp_139_var; while ( - (_tmp_132_var = _tmp_132_rule(p)) + (_tmp_139_var = _tmp_139_rule(p)) ) { - res = _tmp_132_var; + res = _tmp_139_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13100,19 +13553,19 @@ _loop1_62_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_62"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_67"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_62_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_67_type, seq); return seq; } -// _tmp_63: '(' arguments? ')' +// _tmp_68: '(' arguments? ')' static void * -_tmp_63_rule(Parser *p) +_tmp_68_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13145,9 +13598,9 @@ _tmp_63_rule(Parser *p) return res; } -// _loop0_65: ',' star_expression +// _loop0_70: ',' star_expression static asdl_seq * -_loop0_65_rule(Parser *p) +_loop0_70_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13192,32 +13645,32 @@ _loop0_65_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_65"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_70"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_65_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_70_type, seq); return seq; } -// _gather_64: star_expression _loop0_65 +// _gather_69: star_expression _loop0_70 static asdl_seq * -_gather_64_rule(Parser *p) +_gather_69_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_expression _loop0_65 + { // star_expression _loop0_70 expr_ty elem; asdl_seq * seq; if ( (elem = star_expression_rule(p)) && - (seq = _loop0_65_rule(p)) + (seq = _loop0_70_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13230,9 +13683,9 @@ _gather_64_rule(Parser *p) return res; } -// _loop1_66: (',' star_expression) +// _loop1_71: (',' star_expression) static asdl_seq * -_loop1_66_rule(Parser *p) +_loop1_71_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13248,12 +13701,12 @@ _loop1_66_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' star_expression) - void *_tmp_133_var; + void *_tmp_140_var; while ( - (_tmp_133_var = _tmp_133_rule(p)) + (_tmp_140_var = _tmp_140_rule(p)) ) { - res = _tmp_133_var; + res = _tmp_140_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13273,19 +13726,19 @@ _loop1_66_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_66"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_71"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_66_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_71_type, seq); return seq; } -// _loop0_68: ',' star_named_expression +// _loop0_73: ',' star_named_expression static asdl_seq * -_loop0_68_rule(Parser *p) +_loop0_73_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13330,32 +13783,32 @@ _loop0_68_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_68"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_73"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_68_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_73_type, seq); return seq; } -// _gather_67: star_named_expression _loop0_68 +// _gather_72: star_named_expression _loop0_73 static asdl_seq * -_gather_67_rule(Parser *p) +_gather_72_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_named_expression _loop0_68 + { // star_named_expression _loop0_73 expr_ty elem; asdl_seq * seq; if ( (elem = star_named_expression_rule(p)) && - (seq = _loop0_68_rule(p)) + (seq = _loop0_73_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13368,9 +13821,9 @@ _gather_67_rule(Parser *p) return res; } -// _loop1_69: (',' expression) +// _loop1_74: (',' expression) static asdl_seq * -_loop1_69_rule(Parser *p) +_loop1_74_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13386,12 +13839,12 @@ _loop1_69_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' expression) - void *_tmp_134_var; + void *_tmp_141_var; while ( - (_tmp_134_var = _tmp_134_rule(p)) + (_tmp_141_var = _tmp_141_rule(p)) ) { - res = _tmp_134_var; + res = _tmp_141_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -13411,19 +13864,19 @@ _loop1_69_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_69"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_74"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_69_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_74_type, seq); return seq; } -// _tmp_70: ',' lambda_plain_names +// _tmp_75: ',' lambda_plain_names static void * -_tmp_70_rule(Parser *p) +_tmp_75_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13453,9 +13906,9 @@ _tmp_70_rule(Parser *p) return res; } -// _tmp_71: ',' lambda_names_with_default +// _tmp_76: ',' lambda_names_with_default static void * -_tmp_71_rule(Parser *p) +_tmp_76_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13485,9 +13938,9 @@ _tmp_71_rule(Parser *p) return res; } -// _tmp_72: ',' lambda_star_etc? +// _tmp_77: ',' lambda_star_etc? static void * -_tmp_72_rule(Parser *p) +_tmp_77_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13517,9 +13970,9 @@ _tmp_72_rule(Parser *p) return res; } -// _tmp_73: ',' lambda_names_with_default +// _tmp_78: ',' lambda_names_with_default static void * -_tmp_73_rule(Parser *p) +_tmp_78_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13549,9 +14002,9 @@ _tmp_73_rule(Parser *p) return res; } -// _tmp_74: ',' lambda_star_etc? +// _tmp_79: ',' lambda_star_etc? static void * -_tmp_74_rule(Parser *p) +_tmp_79_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13581,9 +14034,9 @@ _tmp_74_rule(Parser *p) return res; } -// _tmp_75: ',' lambda_names_with_default +// _tmp_80: ',' lambda_names_with_default static void * -_tmp_75_rule(Parser *p) +_tmp_80_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13613,9 +14066,9 @@ _tmp_75_rule(Parser *p) return res; } -// _tmp_76: ',' lambda_star_etc? +// _tmp_81: ',' lambda_star_etc? static void * -_tmp_76_rule(Parser *p) +_tmp_81_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13645,9 +14098,9 @@ _tmp_76_rule(Parser *p) return res; } -// _tmp_77: ',' lambda_star_etc? +// _tmp_82: ',' lambda_star_etc? static void * -_tmp_77_rule(Parser *p) +_tmp_82_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13677,9 +14130,9 @@ _tmp_77_rule(Parser *p) return res; } -// _tmp_78: lambda_plain_names ',' +// _tmp_83: lambda_plain_names ',' static void * -_tmp_78_rule(Parser *p) +_tmp_83_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13709,9 +14162,9 @@ _tmp_78_rule(Parser *p) return res; } -// _loop0_79: lambda_name_with_optional_default +// _loop0_84: lambda_name_with_optional_default static asdl_seq * -_loop0_79_rule(Parser *p) +_loop0_84_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13748,19 +14201,19 @@ _loop0_79_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_79"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_84"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_79_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_84_type, seq); return seq; } -// _tmp_80: ',' lambda_kwds +// _tmp_85: ',' lambda_kwds static void * -_tmp_80_rule(Parser *p) +_tmp_85_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13790,9 +14243,9 @@ _tmp_80_rule(Parser *p) return res; } -// _loop1_81: lambda_name_with_optional_default +// _loop1_86: lambda_name_with_optional_default static asdl_seq * -_loop1_81_rule(Parser *p) +_loop1_86_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13833,19 +14286,19 @@ _loop1_81_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_81"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_86"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_81_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_86_type, seq); return seq; } -// _tmp_82: ',' lambda_kwds +// _tmp_87: ',' lambda_kwds static void * -_tmp_82_rule(Parser *p) +_tmp_87_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13875,9 +14328,9 @@ _tmp_82_rule(Parser *p) return res; } -// _tmp_83: '=' expression +// _tmp_88: '=' expression static void * -_tmp_83_rule(Parser *p) +_tmp_88_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13907,9 +14360,9 @@ _tmp_83_rule(Parser *p) return res; } -// _loop0_85: ',' lambda_name_with_default +// _loop0_90: ',' lambda_name_with_default static asdl_seq * -_loop0_85_rule(Parser *p) +_loop0_90_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -13954,32 +14407,32 @@ _loop0_85_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_85"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_90"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_85_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_90_type, seq); return seq; } -// _gather_84: lambda_name_with_default _loop0_85 +// _gather_89: lambda_name_with_default _loop0_90 static asdl_seq * -_gather_84_rule(Parser *p) +_gather_89_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // lambda_name_with_default _loop0_85 + { // lambda_name_with_default _loop0_90 NameDefaultPair* elem; asdl_seq * seq; if ( (elem = lambda_name_with_default_rule(p)) && - (seq = _loop0_85_rule(p)) + (seq = _loop0_90_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -13992,9 +14445,9 @@ _gather_84_rule(Parser *p) return res; } -// _loop0_87: ',' (lambda_plain_name !'=') +// _loop0_92: ',' (lambda_plain_name !'=') static asdl_seq * -_loop0_87_rule(Parser *p) +_loop0_92_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14015,7 +14468,7 @@ _loop0_87_rule(Parser *p) while ( (literal = _PyPegen_expect_token(p, 12)) && - (elem = _tmp_135_rule(p)) + (elem = _tmp_142_rule(p)) ) { res = elem; @@ -14039,32 +14492,32 @@ _loop0_87_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_87"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_92"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_87_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_92_type, seq); return seq; } -// _gather_86: (lambda_plain_name !'=') _loop0_87 +// _gather_91: (lambda_plain_name !'=') _loop0_92 static asdl_seq * -_gather_86_rule(Parser *p) +_gather_91_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // (lambda_plain_name !'=') _loop0_87 + { // (lambda_plain_name !'=') _loop0_92 void *elem; asdl_seq * seq; if ( - (elem = _tmp_135_rule(p)) + (elem = _tmp_142_rule(p)) && - (seq = _loop0_87_rule(p)) + (seq = _loop0_92_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14077,9 +14530,9 @@ _gather_86_rule(Parser *p) return res; } -// _loop1_88: ('or' conjunction) +// _loop1_93: ('or' conjunction) static asdl_seq * -_loop1_88_rule(Parser *p) +_loop1_93_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14095,12 +14548,12 @@ _loop1_88_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('or' conjunction) - void *_tmp_136_var; + void *_tmp_143_var; while ( - (_tmp_136_var = _tmp_136_rule(p)) + (_tmp_143_var = _tmp_143_rule(p)) ) { - res = _tmp_136_var; + res = _tmp_143_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -14120,19 +14573,19 @@ _loop1_88_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_88"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_93"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_88_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_93_type, seq); return seq; } -// _loop1_89: ('and' inversion) +// _loop1_94: ('and' inversion) static asdl_seq * -_loop1_89_rule(Parser *p) +_loop1_94_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14148,12 +14601,12 @@ _loop1_89_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // ('and' inversion) - void *_tmp_137_var; + void *_tmp_144_var; while ( - (_tmp_137_var = _tmp_137_rule(p)) + (_tmp_144_var = _tmp_144_rule(p)) ) { - res = _tmp_137_var; + res = _tmp_144_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -14173,19 +14626,19 @@ _loop1_89_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_89"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_94"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_89_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_94_type, seq); return seq; } -// _loop1_90: compare_op_bitwise_or_pair +// _loop1_95: compare_op_bitwise_or_pair static asdl_seq * -_loop1_90_rule(Parser *p) +_loop1_95_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14226,19 +14679,19 @@ _loop1_90_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_90"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_95"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_90_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_95_type, seq); return seq; } -// _tmp_91: '!=' +// _tmp_96: '!=' static void * -_tmp_91_rule(Parser *p) +_tmp_96_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14265,9 +14718,9 @@ _tmp_91_rule(Parser *p) return res; } -// _loop0_93: ',' slice +// _loop0_98: ',' slice static asdl_seq * -_loop0_93_rule(Parser *p) +_loop0_98_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14312,32 +14765,32 @@ _loop0_93_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_93"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_98"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_93_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_98_type, seq); return seq; } -// _gather_92: slice _loop0_93 +// _gather_97: slice _loop0_98 static asdl_seq * -_gather_92_rule(Parser *p) +_gather_97_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // slice _loop0_93 + { // slice _loop0_98 expr_ty elem; asdl_seq * seq; if ( (elem = slice_rule(p)) && - (seq = _loop0_93_rule(p)) + (seq = _loop0_98_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14350,9 +14803,9 @@ _gather_92_rule(Parser *p) return res; } -// _tmp_94: ':' expression? +// _tmp_99: ':' expression? static void * -_tmp_94_rule(Parser *p) +_tmp_99_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14382,9 +14835,9 @@ _tmp_94_rule(Parser *p) return res; } -// _tmp_95: tuple | group | genexp +// _tmp_100: tuple | group | genexp static void * -_tmp_95_rule(Parser *p) +_tmp_100_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14429,9 +14882,9 @@ _tmp_95_rule(Parser *p) return res; } -// _tmp_96: list | listcomp +// _tmp_101: list | listcomp static void * -_tmp_96_rule(Parser *p) +_tmp_101_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14465,9 +14918,9 @@ _tmp_96_rule(Parser *p) return res; } -// _tmp_97: dict | set | dictcomp | setcomp +// _tmp_102: dict | set | dictcomp | setcomp static void * -_tmp_97_rule(Parser *p) +_tmp_102_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14523,9 +14976,9 @@ _tmp_97_rule(Parser *p) return res; } -// _loop1_98: STRING +// _loop1_103: STRING static asdl_seq * -_loop1_98_rule(Parser *p) +_loop1_103_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14566,19 +15019,19 @@ _loop1_98_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_98"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_103"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_98_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_103_type, seq); return seq; } -// _tmp_99: star_named_expression ',' star_named_expressions? +// _tmp_104: star_named_expression ',' star_named_expressions? static void * -_tmp_99_rule(Parser *p) +_tmp_104_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14611,9 +15064,9 @@ _tmp_99_rule(Parser *p) return res; } -// _tmp_100: yield_expr | named_expression +// _tmp_105: yield_expr | named_expression static void * -_tmp_100_rule(Parser *p) +_tmp_105_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14647,9 +15100,9 @@ _tmp_100_rule(Parser *p) return res; } -// _loop0_102: ',' kvpair +// _loop0_107: ',' kvpair static asdl_seq * -_loop0_102_rule(Parser *p) +_loop0_107_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14694,32 +15147,32 @@ _loop0_102_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_102"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_107"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_102_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_107_type, seq); return seq; } -// _gather_101: kvpair _loop0_102 +// _gather_106: kvpair _loop0_107 static asdl_seq * -_gather_101_rule(Parser *p) +_gather_106_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kvpair _loop0_102 + { // kvpair _loop0_107 KeyValuePair* elem; asdl_seq * seq; if ( (elem = kvpair_rule(p)) && - (seq = _loop0_102_rule(p)) + (seq = _loop0_107_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14732,9 +15185,9 @@ _gather_101_rule(Parser *p) return res; } -// _loop1_103: (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) +// _loop1_108: for_if_clause static asdl_seq * -_loop1_103_rule(Parser *p) +_loop1_108_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14749,13 +15202,13 @@ _loop1_103_rule(Parser *p) } ssize_t children_capacity = 1; ssize_t n = 0; - { // (ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))*) - void *_tmp_138_var; + { // for_if_clause + comprehension_ty for_if_clause_var; while ( - (_tmp_138_var = _tmp_138_rule(p)) + (for_if_clause_var = for_if_clause_rule(p)) ) { - res = _tmp_138_var; + res = for_if_clause_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -14775,19 +15228,117 @@ _loop1_103_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_103"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_108"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_103_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_108_type, seq); + return seq; +} + +// _loop0_109: ('if' disjunction) +static asdl_seq * +_loop0_109_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('if' disjunction) + void *_tmp_145_var; + while ( + (_tmp_145_var = _tmp_145_rule(p)) + ) + { + res = _tmp_145_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_109"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_109_type, seq); return seq; } -// _tmp_104: ',' args +// _loop0_110: ('if' disjunction) +static asdl_seq * +_loop0_110_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void *res = NULL; + int mark = p->mark; + int start_mark = p->mark; + void **children = PyMem_Malloc(sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "Parser out of memory"); + return NULL; + } + ssize_t children_capacity = 1; + ssize_t n = 0; + { // ('if' disjunction) + void *_tmp_146_var; + while ( + (_tmp_146_var = _tmp_146_rule(p)) + ) + { + res = _tmp_146_var; + if (n == children_capacity) { + children_capacity *= 2; + children = PyMem_Realloc(children, children_capacity*sizeof(void *)); + if (!children) { + PyErr_Format(PyExc_MemoryError, "realloc None"); + return NULL; + } + } + children[n++] = res; + mark = p->mark; + } + p->mark = mark; + } + asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); + if (!seq) { + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_110"); + PyMem_Free(children); + return NULL; + } + for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); + PyMem_Free(children); + _PyPegen_insert_memo(p, start_mark, _loop0_110_type, seq); + return seq; +} + +// _tmp_111: ',' args static void * -_tmp_104_rule(Parser *p) +_tmp_111_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14817,9 +15368,9 @@ _tmp_104_rule(Parser *p) return res; } -// _tmp_105: ',' args +// _tmp_112: ',' args static void * -_tmp_105_rule(Parser *p) +_tmp_112_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14849,9 +15400,9 @@ _tmp_105_rule(Parser *p) return res; } -// _loop0_107: ',' kwarg_or_starred +// _loop0_114: ',' kwarg_or_starred static asdl_seq * -_loop0_107_rule(Parser *p) +_loop0_114_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14896,32 +15447,32 @@ _loop0_107_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_107"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_114"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_107_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_114_type, seq); return seq; } -// _gather_106: kwarg_or_starred _loop0_107 +// _gather_113: kwarg_or_starred _loop0_114 static asdl_seq * -_gather_106_rule(Parser *p) +_gather_113_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_starred _loop0_107 + { // kwarg_or_starred _loop0_114 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_starred_rule(p)) && - (seq = _loop0_107_rule(p)) + (seq = _loop0_114_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -14934,9 +15485,9 @@ _gather_106_rule(Parser *p) return res; } -// _loop0_109: ',' kwarg_or_double_starred +// _loop0_116: ',' kwarg_or_double_starred static asdl_seq * -_loop0_109_rule(Parser *p) +_loop0_116_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -14981,32 +15532,32 @@ _loop0_109_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_109"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_116"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_109_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_116_type, seq); return seq; } -// _gather_108: kwarg_or_double_starred _loop0_109 +// _gather_115: kwarg_or_double_starred _loop0_116 static asdl_seq * -_gather_108_rule(Parser *p) +_gather_115_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_double_starred _loop0_109 + { // kwarg_or_double_starred _loop0_116 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_double_starred_rule(p)) && - (seq = _loop0_109_rule(p)) + (seq = _loop0_116_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -15019,9 +15570,9 @@ _gather_108_rule(Parser *p) return res; } -// _loop0_111: ',' kwarg_or_starred +// _loop0_118: ',' kwarg_or_starred static asdl_seq * -_loop0_111_rule(Parser *p) +_loop0_118_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15066,32 +15617,32 @@ _loop0_111_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_111"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_118"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_111_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_118_type, seq); return seq; } -// _gather_110: kwarg_or_starred _loop0_111 +// _gather_117: kwarg_or_starred _loop0_118 static asdl_seq * -_gather_110_rule(Parser *p) +_gather_117_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_starred _loop0_111 + { // kwarg_or_starred _loop0_118 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_starred_rule(p)) && - (seq = _loop0_111_rule(p)) + (seq = _loop0_118_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -15104,9 +15655,9 @@ _gather_110_rule(Parser *p) return res; } -// _loop0_113: ',' kwarg_or_double_starred +// _loop0_120: ',' kwarg_or_double_starred static asdl_seq * -_loop0_113_rule(Parser *p) +_loop0_120_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15151,32 +15702,32 @@ _loop0_113_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_113"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_120"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_113_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_120_type, seq); return seq; } -// _gather_112: kwarg_or_double_starred _loop0_113 +// _gather_119: kwarg_or_double_starred _loop0_120 static asdl_seq * -_gather_112_rule(Parser *p) +_gather_119_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // kwarg_or_double_starred _loop0_113 + { // kwarg_or_double_starred _loop0_120 KeywordOrStarred* elem; asdl_seq * seq; if ( (elem = kwarg_or_double_starred_rule(p)) && - (seq = _loop0_113_rule(p)) + (seq = _loop0_120_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -15189,9 +15740,9 @@ _gather_112_rule(Parser *p) return res; } -// _loop0_114: (',' star_target) +// _loop0_121: (',' star_target) static asdl_seq * -_loop0_114_rule(Parser *p) +_loop0_121_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15207,12 +15758,12 @@ _loop0_114_rule(Parser *p) ssize_t children_capacity = 1; ssize_t n = 0; { // (',' star_target) - void *_tmp_139_var; + void *_tmp_147_var; while ( - (_tmp_139_var = _tmp_139_rule(p)) + (_tmp_147_var = _tmp_147_rule(p)) ) { - res = _tmp_139_var; + res = _tmp_147_var; if (n == children_capacity) { children_capacity *= 2; children = PyMem_Realloc(children, children_capacity*sizeof(void *)); @@ -15228,19 +15779,19 @@ _loop0_114_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_114"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_121"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_114_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_121_type, seq); return seq; } -// _loop0_116: ',' star_target +// _loop0_123: ',' star_target static asdl_seq * -_loop0_116_rule(Parser *p) +_loop0_123_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15285,32 +15836,32 @@ _loop0_116_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_116"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_123"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_116_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_123_type, seq); return seq; } -// _gather_115: star_target _loop0_116 +// _gather_122: star_target _loop0_123 static asdl_seq * -_gather_115_rule(Parser *p) +_gather_122_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // star_target _loop0_116 + { // star_target _loop0_123 expr_ty elem; asdl_seq * seq; if ( (elem = star_target_rule(p)) && - (seq = _loop0_116_rule(p)) + (seq = _loop0_123_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -15323,9 +15874,9 @@ _gather_115_rule(Parser *p) return res; } -// _tmp_117: !'*' star_target +// _tmp_124: !'*' star_target static void * -_tmp_117_rule(Parser *p) +_tmp_124_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15350,9 +15901,9 @@ _tmp_117_rule(Parser *p) return res; } -// _loop0_119: ',' del_target +// _loop0_126: ',' del_target static asdl_seq * -_loop0_119_rule(Parser *p) +_loop0_126_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15397,32 +15948,32 @@ _loop0_119_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_119"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_126"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_119_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_126_type, seq); return seq; } -// _gather_118: del_target _loop0_119 +// _gather_125: del_target _loop0_126 static asdl_seq * -_gather_118_rule(Parser *p) +_gather_125_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // del_target _loop0_119 + { // del_target _loop0_126 expr_ty elem; asdl_seq * seq; if ( (elem = del_target_rule(p)) && - (seq = _loop0_119_rule(p)) + (seq = _loop0_126_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -15435,9 +15986,9 @@ _gather_118_rule(Parser *p) return res; } -// _loop0_121: ',' target +// _loop0_128: ',' target static asdl_seq * -_loop0_121_rule(Parser *p) +_loop0_128_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15482,32 +16033,32 @@ _loop0_121_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_121"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_128"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_121_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_128_type, seq); return seq; } -// _gather_120: target _loop0_121 +// _gather_127: target _loop0_128 static asdl_seq * -_gather_120_rule(Parser *p) +_gather_127_rule(Parser *p) { if (p->error_indicator) { return NULL; } asdl_seq * res = NULL; int mark = p->mark; - { // target _loop0_121 + { // target _loop0_128 expr_ty elem; asdl_seq * seq; if ( (elem = target_rule(p)) && - (seq = _loop0_121_rule(p)) + (seq = _loop0_128_rule(p)) ) { res = _PyPegen_seq_insert_in_front(p, elem, seq); @@ -15520,9 +16071,9 @@ _gather_120_rule(Parser *p) return res; } -// _tmp_122: args | expression for_if_clauses +// _tmp_129: args | expression for_if_clauses static void * -_tmp_122_rule(Parser *p) +_tmp_129_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15559,9 +16110,9 @@ _tmp_122_rule(Parser *p) return res; } -// _tmp_123: '=' annotated_rhs +// _tmp_130: '=' annotated_rhs static void * -_tmp_123_rule(Parser *p) +_tmp_130_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15587,9 +16138,9 @@ _tmp_123_rule(Parser *p) return res; } -// _tmp_124: '=' | augassign +// _tmp_131: '=' | augassign static void * -_tmp_124_rule(Parser *p) +_tmp_131_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15623,9 +16174,9 @@ _tmp_124_rule(Parser *p) return res; } -// _tmp_125: yield_expr | star_expressions +// _tmp_132: yield_expr | star_expressions static void * -_tmp_125_rule(Parser *p) +_tmp_132_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15659,9 +16210,9 @@ _tmp_125_rule(Parser *p) return res; } -// _tmp_126: '[' | '(' | '{' +// _tmp_133: '[' | '(' | '{' static void * -_tmp_126_rule(Parser *p) +_tmp_133_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15706,9 +16257,9 @@ _tmp_126_rule(Parser *p) return res; } -// _loop0_127: param_no_default +// _loop0_134: param_no_default static asdl_seq * -_loop0_127_rule(Parser *p) +_loop0_134_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15745,19 +16296,19 @@ _loop0_127_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_127"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_134"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_127_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop0_134_type, seq); return seq; } -// _tmp_128: slash_with_default | param_with_default+ +// _tmp_135: slash_with_default | param_with_default+ static void * -_tmp_128_rule(Parser *p) +_tmp_135_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15776,12 +16327,12 @@ _tmp_128_rule(Parser *p) p->mark = mark; } { // param_with_default+ - asdl_seq * _loop1_140_var; + asdl_seq * _loop1_148_var; if ( - (_loop1_140_var = _loop1_140_rule(p)) + (_loop1_148_var = _loop1_148_rule(p)) ) { - res = _loop1_140_var; + res = _loop1_148_var; goto done; } p->mark = mark; @@ -15791,9 +16342,9 @@ _tmp_128_rule(Parser *p) return res; } -// _tmp_129: star_targets '=' +// _tmp_136: star_targets '=' static void * -_tmp_129_rule(Parser *p) +_tmp_136_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15823,9 +16374,9 @@ _tmp_129_rule(Parser *p) return res; } -// _tmp_130: '.' | '...' +// _tmp_137: '.' | '...' static void * -_tmp_130_rule(Parser *p) +_tmp_137_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15859,9 +16410,9 @@ _tmp_130_rule(Parser *p) return res; } -// _tmp_131: '.' | '...' +// _tmp_138: '.' | '...' static void * -_tmp_131_rule(Parser *p) +_tmp_138_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15895,9 +16446,9 @@ _tmp_131_rule(Parser *p) return res; } -// _tmp_132: '@' named_expression NEWLINE +// _tmp_139: '@' named_expression NEWLINE static void * -_tmp_132_rule(Parser *p) +_tmp_139_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15930,9 +16481,9 @@ _tmp_132_rule(Parser *p) return res; } -// _tmp_133: ',' star_expression +// _tmp_140: ',' star_expression static void * -_tmp_133_rule(Parser *p) +_tmp_140_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15962,9 +16513,9 @@ _tmp_133_rule(Parser *p) return res; } -// _tmp_134: ',' expression +// _tmp_141: ',' expression static void * -_tmp_134_rule(Parser *p) +_tmp_141_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -15994,9 +16545,9 @@ _tmp_134_rule(Parser *p) return res; } -// _tmp_135: lambda_plain_name !'=' +// _tmp_142: lambda_plain_name !'=' static void * -_tmp_135_rule(Parser *p) +_tmp_142_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -16021,9 +16572,9 @@ _tmp_135_rule(Parser *p) return res; } -// _tmp_136: 'or' conjunction +// _tmp_143: 'or' conjunction static void * -_tmp_136_rule(Parser *p) +_tmp_143_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -16053,9 +16604,9 @@ _tmp_136_rule(Parser *p) return res; } -// _tmp_137: 'and' inversion +// _tmp_144: 'and' inversion static void * -_tmp_137_rule(Parser *p) +_tmp_144_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -16085,37 +16636,57 @@ _tmp_137_rule(Parser *p) return res; } -// _tmp_138: ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* +// _tmp_145: 'if' disjunction static void * -_tmp_138_rule(Parser *p) +_tmp_145_rule(Parser *p) { if (p->error_indicator) { return NULL; } void * res = NULL; int mark = p->mark; - { // ASYNC? 'for' star_targets 'in' disjunction (('if' disjunction))* - expr_ty a; - expr_ty b; - asdl_seq * c; + { // 'if' disjunction void *keyword; - void *keyword_1; - void *y; + expr_ty z; if ( - (y = _PyPegen_expect_token(p, ASYNC), 1) - && - (keyword = _PyPegen_expect_token(p, 517)) - && - (a = star_targets_rule(p)) - && - (keyword_1 = _PyPegen_expect_token(p, 518)) + (keyword = _PyPegen_expect_token(p, 510)) && - (b = disjunction_rule(p)) + (z = disjunction_rule(p)) + ) + { + res = z; + if (res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + return NULL; + } + goto done; + } + p->mark = mark; + } + res = NULL; + done: + return res; +} + +// _tmp_146: 'if' disjunction +static void * +_tmp_146_rule(Parser *p) +{ + if (p->error_indicator) { + return NULL; + } + void * res = NULL; + int mark = p->mark; + { // 'if' disjunction + void *keyword; + expr_ty z; + if ( + (keyword = _PyPegen_expect_token(p, 510)) && - (c = _loop0_141_rule(p)) + (z = disjunction_rule(p)) ) { - res = _Py_comprehension ( a , b , c , y != NULL , p -> arena ); + res = z; if (res == NULL && PyErr_Occurred()) { p->error_indicator = 1; return NULL; @@ -16129,9 +16700,9 @@ _tmp_138_rule(Parser *p) return res; } -// _tmp_139: ',' star_target +// _tmp_147: ',' star_target static void * -_tmp_139_rule(Parser *p) +_tmp_147_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -16161,9 +16732,9 @@ _tmp_139_rule(Parser *p) return res; } -// _loop1_140: param_with_default +// _loop1_148: param_with_default static asdl_seq * -_loop1_140_rule(Parser *p) +_loop1_148_rule(Parser *p) { if (p->error_indicator) { return NULL; @@ -16204,97 +16775,16 @@ _loop1_140_rule(Parser *p) } asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_140"); - PyMem_Free(children); - return NULL; - } - for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); - PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop1_140_type, seq); - return seq; -} - -// _loop0_141: ('if' disjunction) -static asdl_seq * -_loop0_141_rule(Parser *p) -{ - if (p->error_indicator) { - return NULL; - } - void *res = NULL; - int mark = p->mark; - int start_mark = p->mark; - void **children = PyMem_Malloc(sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "Parser out of memory"); - return NULL; - } - ssize_t children_capacity = 1; - ssize_t n = 0; - { // ('if' disjunction) - void *_tmp_142_var; - while ( - (_tmp_142_var = _tmp_142_rule(p)) - ) - { - res = _tmp_142_var; - if (n == children_capacity) { - children_capacity *= 2; - children = PyMem_Realloc(children, children_capacity*sizeof(void *)); - if (!children) { - PyErr_Format(PyExc_MemoryError, "realloc None"); - return NULL; - } - } - children[n++] = res; - mark = p->mark; - } - p->mark = mark; - } - asdl_seq *seq = _Py_asdl_seq_new(n, p->arena); - if (!seq) { - PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_141"); + PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop1_148"); PyMem_Free(children); return NULL; } for (int i = 0; i < n; i++) asdl_seq_SET(seq, i, children[i]); PyMem_Free(children); - _PyPegen_insert_memo(p, start_mark, _loop0_141_type, seq); + _PyPegen_insert_memo(p, start_mark, _loop1_148_type, seq); return seq; } -// _tmp_142: 'if' disjunction -static void * -_tmp_142_rule(Parser *p) -{ - if (p->error_indicator) { - return NULL; - } - void * res = NULL; - int mark = p->mark; - { // 'if' disjunction - void *keyword; - expr_ty z; - if ( - (keyword = _PyPegen_expect_token(p, 510)) - && - (z = disjunction_rule(p)) - ) - { - res = z; - if (res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - return NULL; - } - goto done; - } - p->mark = mark; - } - res = NULL; - done: - return res; -} - void * _PyPegen_parse(Parser *p) { diff --git a/Parser/pegen/parse_string.c b/Parser/pegen/parse_string.c index 834239e23fa87..d96303dc183fa 100644 --- a/Parser/pegen/parse_string.c +++ b/Parser/pegen/parse_string.c @@ -179,6 +179,13 @@ _PyPegen_parsestr(Parser *p, const char *s, int *bytesmode, int *rawmode, PyObje } } + /* fstrings are only allowed in Python 3.6 and greater */ + if (fmode && p->feature_version < 6) { + p->error_indicator = 1; + RAISE_SYNTAX_ERROR("Format strings are only supported in Python 3.6 and greater"); + return -1; + } + if (fmode && *bytesmode) { PyErr_BadInternalCall(); return -1; @@ -595,7 +602,8 @@ fstring_compile_expr(Parser *p, const char *expr_start, const char *expr_end, return NULL; } - Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, p->flags, NULL, p->arena); + Parser *p2 = _PyPegen_Parser_New(tok, Py_fstring_input, p->flags, p->feature_version, + NULL, p->arena); p2->starting_lineno = p->starting_lineno + p->tok->first_lineno - 1; p2->starting_col_offset = p->tok->first_lineno == p->tok->lineno ? p->starting_col_offset + t->col_offset : 0; diff --git a/Parser/pegen/pegen.c b/Parser/pegen/pegen.c index 5a2491c181f98..40c09ffcc3a64 100644 --- a/Parser/pegen/pegen.c +++ b/Parser/pegen/pegen.c @@ -933,11 +933,16 @@ _PyPegen_number_token(Parser *p) } char *num_raw = PyBytes_AsString(t->bytes); - if (num_raw == NULL) { return NULL; } + if (p->feature_version < 6 && strchr(num_raw, '_') != NULL) { + p->error_indicator = 1; + return RAISE_SYNTAX_ERROR("Underscores in numeric literals are only supported" + "in Python 3.6 and greater"); + } + PyObject *c = parsenumber(num_raw); if (c == NULL) { @@ -1030,12 +1035,15 @@ compute_parser_flags(PyCompilerFlags *flags) if (flags->cf_flags & PyCF_TYPE_COMMENTS) { parser_flags |= PyPARSE_TYPE_COMMENTS; } + if (flags->cf_feature_version < 7) { + parser_flags |= PyPARSE_ASYNC_HACKS; + } return parser_flags; } Parser * _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int flags, - int *errcode, PyArena *arena) + int feature_version, int *errcode, PyArena *arena) { Parser *p = PyMem_Malloc(sizeof(Parser)); if (p == NULL) { @@ -1077,6 +1085,7 @@ _PyPegen_Parser_New(struct tok_state *tok, int start_rule, int flags, p->starting_lineno = 0; p->starting_col_offset = 0; p->flags = flags; + p->feature_version = feature_version; return p; } @@ -1138,7 +1147,8 @@ _PyPegen_run_parser_from_file_pointer(FILE *fp, int start_rule, PyObject *filena mod_ty result = NULL; int parser_flags = compute_parser_flags(flags); - Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, errcode, arena); + Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, PY_MINOR_VERSION, + errcode, arena); if (p == NULL) { goto error; } @@ -1194,9 +1204,12 @@ _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filen mod_ty result = NULL; int parser_flags = compute_parser_flags(flags); + int feature_version = flags ? flags->cf_feature_version : PY_MINOR_VERSION; tok->type_comments = (parser_flags & PyPARSE_TYPE_COMMENTS) > 0; + tok->async_hacks = (parser_flags & PyPARSE_ASYNC_HACKS) > 0; - Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, NULL, arena); + Parser *p = _PyPegen_Parser_New(tok, start_rule, parser_flags, feature_version, + NULL, arena); if (p == NULL) { goto error; } diff --git a/Parser/pegen/pegen.h b/Parser/pegen/pegen.h index 3af4bb29aa177..1620f92609472 100644 --- a/Parser/pegen/pegen.h +++ b/Parser/pegen/pegen.h @@ -69,6 +69,7 @@ typedef struct { int starting_col_offset; int error_indicator; int flags; + int feature_version; growable_comment_array type_ignore_comments; } Parser; @@ -180,9 +181,26 @@ NEW_TYPE_COMMENT(Parser *p, Token *tc) return NULL; } +Py_LOCAL_INLINE(void *) +INVALID_VERSION_CHECK(Parser *p, int version, char *msg, void *node) +{ + if (node == NULL) { + p->error_indicator = 1; // Inline CHECK_CALL + return NULL; + } + if (p->feature_version < version) { + p->error_indicator = 1; + return _PyPegen_raise_error(p, PyExc_SyntaxError, "%s only supported in Python 3.%i and greater", + msg, version); + } + return node; +} + +#define CHECK_VERSION(version, msg, node) INVALID_VERSION_CHECK(p, version, msg, node) + arg_ty _PyPegen_add_type_comment_to_arg(Parser *, arg_ty, Token *); PyObject *_PyPegen_new_identifier(Parser *, char *); -Parser *_PyPegen_Parser_New(struct tok_state *, int, int, int *, PyArena *); +Parser *_PyPegen_Parser_New(struct tok_state *, int, int, int, int *, PyArena *); void _PyPegen_Parser_Free(Parser *); mod_ty _PyPegen_run_parser_from_file_pointer(FILE *, int, PyObject *, const char *, const char *, const char *, PyCompilerFlags *, int *, PyArena *); From webhook-mailer at python.org Sat Apr 4 17:25:20 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Sat, 04 Apr 2020 21:25:20 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (GH-19369) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/1b21573a89632356737a24302dd64c9eb145= 7a7b commit: 1b21573a89632356737a24302dd64c9eb1457a7b branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-04T16:25:12-05:00 summary: closes bpo-40184: Only define pysiphash if the hash algorithm is SIPHASH24. (= GH-19369) files: M Python/pyhash.c diff --git a/Python/pyhash.c b/Python/pyhash.c index faac730d79dee..a6f42e71cf643 100644 --- a/Python/pyhash.c +++ b/Python/pyhash.c @@ -412,13 +412,6 @@ siphash24(uint64_t k0, uint64_t k1, const void *src, Py_= ssize_t src_sz) { return t; } =20 -static Py_hash_t -pysiphash(const void *src, Py_ssize_t src_sz) { - return (Py_hash_t)siphash24( - _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash= .k1), - src, src_sz); -} - uint64_t _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t src_sz) { @@ -427,6 +420,13 @@ _Py_KeyedHash(uint64_t key, const void *src, Py_ssize_t = src_sz) =20 =20 #if Py_HASH_ALGORITHM =3D=3D Py_HASH_SIPHASH24 +static Py_hash_t +pysiphash(const void *src, Py_ssize_t src_sz) { + return (Py_hash_t)siphash24( + _le64toh(_Py_HashSecret.siphash.k0), _le64toh(_Py_HashSecret.siphash= .k1), + src, src_sz); +} + static PyHash_FuncDef PyHash_Func =3D {pysiphash, "siphash24", 64, 128}; #endif =20 From webhook-mailer at python.org Sat Apr 4 20:40:57 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Sun, 05 Apr 2020 00:40:57 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-40190: Add support for _SC_AIX_REALMEM in sysconf (GH-19380) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/909f4a30093f74d409711e564f93a43167ca= 0919 commit: 909f4a30093f74d409711e564f93a43167ca0919 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-05T02:40:49+02:00 summary: bpo-40190: Add support for _SC_AIX_REALMEM in sysconf (GH-19380) files: A Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rst M Modules/posixmodule.c diff --git a/Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rs= t b/Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rst new file mode 100644 index 0000000000000..58359330e3920 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rst @@ -0,0 +1 @@ +Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 1adca8ec29dcd..345798dc8c10d 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -11424,6 +11424,9 @@ static struct constdef posix_constants_sysconf[] =3D { #ifdef _SC_PAGE_SIZE {"SC_PAGE_SIZE", _SC_PAGE_SIZE}, #endif +#ifdef _SC_AIX_REALMEM + {"SC_AIX_REALMEM", _SC_AIX_REALMEM}, +#endif #ifdef _SC_PASS_MAX {"SC_PASS_MAX", _SC_PASS_MAX}, #endif From webhook-mailer at python.org Tue Apr 7 03:39:08 2020 From: webhook-mailer at python.org (=?utf-8?q?R=C3=A9mi?= Lapeyre) Date: Tue, 07 Apr 2020 07:39:08 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Document missing methods of ssl.SSLObject (#19400) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/74e1b6b100719e11471e7e99494656554779= 26e2 commit: 74e1b6b100719e11471e7e9949465655477926e2 branch: master author: R=C3=A9mi Lapeyre committer: GitHub date: 2020-04-07T09:38:59+02:00 summary: Document missing methods of ssl.SSLObject (#19400) Co-authored-by: R=C3=A9mi Lapeyre files: M Doc/library/ssl.rst diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index 570d4f720a25a..952ee1653b924 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -2486,14 +2486,17 @@ provided. - :meth:`~SSLSocket.read` - :meth:`~SSLSocket.write` - :meth:`~SSLSocket.getpeercert` + - :meth:`~SSLSocket.selected_alpn_protocol` - :meth:`~SSLSocket.selected_npn_protocol` - :meth:`~SSLSocket.cipher` - :meth:`~SSLSocket.shared_ciphers` - :meth:`~SSLSocket.compression` - :meth:`~SSLSocket.pending` - :meth:`~SSLSocket.do_handshake` + - :meth:`~SSLSocket.verify_client_post_handshake` - :meth:`~SSLSocket.unwrap` - :meth:`~SSLSocket.get_channel_binding` + - :meth:`~SSLSocket.version` =20 When compared to :class:`SSLSocket`, this object lacks the following features: From webhook-mailer at python.org Tue Apr 7 17:37:23 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Tue, 07 Apr 2020 21:37:23 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-39481: Make os.DirEntry generic (GH-19415) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/f9dd51e7db27d04e0b716d41a2804d5acbf1= 45d1 commit: f9dd51e7db27d04e0b716d41a2804d5acbf145d1 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-07T14:37:19-07:00 summary: bpo-39481: Make os.DirEntry generic (GH-19415) files: M Lib/test/test_genericalias.py M Modules/posixmodule.c diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 9d8dbfe04205f..9c5b23e5e5b0f 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -7,6 +7,7 @@ ) from collections.abc import * from contextlib import AbstractContextManager, AbstractAsyncContextManager +from os import DirEntry from re import Pattern, Match from types import GenericAlias, MappingProxyType import typing @@ -34,7 +35,7 @@ def test_subscriptable(self): Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, Sequence, MutableSequence, - MappingProxyType, + MappingProxyType, DirEntry ): tname =3D t.__name__ with self.subTest(f"Testing {tname}"): diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 4264bf1a36dce..57f148726bc22 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -12976,6 +12976,8 @@ static PyMethodDef DirEntry_methods[] =3D { OS_DIRENTRY_STAT_METHODDEF OS_DIRENTRY_INODE_METHODDEF OS_DIRENTRY___FSPATH___METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL} }; =20 From webhook-mailer at python.org Fri Apr 10 00:05:02 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Fri, 10 Apr 2020 04:05:02 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-39481: PEP 585 for ipaddress.py (GH-19418) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/2fa67df605e4b0803e7e3aac0b85d851b4b4= e09a commit: 2fa67df605e4b0803e7e3aac0b85d851b4b4e09a branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-09T21:04:54-07:00 summary: bpo-39481: PEP 585 for ipaddress.py (GH-19418) files: M Lib/ipaddress.py M Lib/test/test_genericalias.py diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index ac1143acba426..439f241817468 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -12,6 +12,7 @@ =20 =20 import functools +import types =20 IPV4LENGTH =3D 32 IPV6LENGTH =3D 128 @@ -1124,6 +1125,7 @@ def is_loopback(self): return (self.network_address.is_loopback and self.broadcast_address.is_loopback) =20 + __class_getitem__ =3D classmethod(types.GenericAlias) =20 class _BaseV4: =20 @@ -1444,6 +1446,8 @@ def with_hostmask(self): return '%s/%s' % (self._string_from_ip_int(self._ip), self.hostmask) =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 class IPv4Network(_BaseV4, _BaseNetwork): =20 @@ -2152,6 +2156,8 @@ def is_unspecified(self): def is_loopback(self): return self._ip =3D=3D 1 and self.network.is_loopback =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 class IPv6Network(_BaseV6, _BaseNetwork): =20 diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index d8acdee2da3e2..535c2492574b3 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -7,6 +7,7 @@ ) from collections.abc import * from contextlib import AbstractContextManager, AbstractAsyncContextManager +from ipaddress import IPv4Network, IPv4Interface, IPv6Network, IPv6Interface from itertools import chain from os import DirEntry from re import Pattern, Match @@ -36,6 +37,9 @@ def test_subscriptable(self): Mapping, MutableMapping, MappingView, KeysView, ItemsView, ValuesView, Sequence, MutableSequence, + MappingProxyType, + DirEntry, + IPv4Network, IPv4Interface, IPv6Network, IPv6Interface, MappingProxyType, DirEntry, chain, ): From webhook-mailer at python.org Fri Apr 10 10:46:44 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Fri, 10 Apr 2020 14:46:44 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-39481: PEP 585 for a variety of modules (GH-19423) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/0361556537686f857f1025ead75e6af4ca7c= c94a commit: 0361556537686f857f1025ead75e6af4ca7cc94a branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-10T07:46:36-07:00 summary: bpo-39481: PEP 585 for a variety of modules (GH-19423) - concurrent.futures - ctypes - http.cookies - multiprocessing - queue - tempfile - unittest.case - urllib.parse files: M Lib/concurrent/futures/_base.py M Lib/concurrent/futures/thread.py M Lib/ctypes/__init__.py M Lib/http/cookies.py M Lib/multiprocessing/managers.py M Lib/multiprocessing/pool.py M Lib/multiprocessing/queues.py M Lib/multiprocessing/shared_memory.py M Lib/queue.py M Lib/tempfile.py M Lib/test/test_genericalias.py M Lib/unittest/case.py M Lib/urllib/parse.py M Modules/_ctypes/_ctypes.c M Modules/_queuemodule.c diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index fd0acec55d046..bf546f8ae1d1c 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -7,6 +7,7 @@ import logging import threading import time +import types =20 FIRST_COMPLETED =3D 'FIRST_COMPLETED' FIRST_EXCEPTION =3D 'FIRST_EXCEPTION' @@ -544,6 +545,8 @@ def set_exception(self, exception): self._condition.notify_all() self._invoke_callbacks() =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + class Executor(object): """This is an abstract base class for concrete asynchronous executors.""" =20 diff --git a/Lib/concurrent/futures/thread.py b/Lib/concurrent/futures/thread= .py index 2aa4e17d47fa7..2810b357bc1e1 100644 --- a/Lib/concurrent/futures/thread.py +++ b/Lib/concurrent/futures/thread.py @@ -10,6 +10,7 @@ import itertools import queue import threading +import types import weakref import os =20 @@ -57,6 +58,8 @@ def run(self): else: self.future.set_result(result) =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 def _worker(executor_reference, work_queue, initializer, initargs): if initializer is not None: diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py index 8f0991147d72f..4afa4ebd42249 100644 --- a/Lib/ctypes/__init__.py +++ b/Lib/ctypes/__init__.py @@ -1,6 +1,7 @@ """create and manipulate C data types in Python""" =20 import os as _os, sys as _sys +import types as _types =20 __version__ =3D "1.1.0" =20 @@ -450,6 +451,8 @@ def __getitem__(self, name): def LoadLibrary(self, name): return self._dlltype(name) =20 + __class_getitem__ =3D classmethod(_types.GenericAlias) + cdll =3D LibraryLoader(CDLL) pydll =3D LibraryLoader(PyDLL) =20 diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py index 6694f5478bdad..35ac2dc6ae280 100644 --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -131,6 +131,7 @@ # import re import string +import types =20 __all__ =3D ["CookieError", "BaseCookie", "SimpleCookie"] =20 @@ -419,6 +420,8 @@ def OutputString(self, attrs=3DNone): # Return the result return _semispacejoin(result) =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 # # Pattern for finding cookie diff --git a/Lib/multiprocessing/managers.py b/Lib/multiprocessing/managers.py index 1668220c09957..9d490a1d8b352 100644 --- a/Lib/multiprocessing/managers.py +++ b/Lib/multiprocessing/managers.py @@ -21,6 +21,7 @@ import array import queue import time +import types import os from os import getpid =20 @@ -1129,6 +1130,8 @@ def set(self, value): return self._callmethod('set', (value,)) value =3D property(get, set) =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 BaseListProxy =3D MakeProxyType('BaseListProxy', ( '__add__', '__contains__', '__delitem__', '__getitem__', '__len__', diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py index 41dd923d4f974..b8a0b827635f0 100644 --- a/Lib/multiprocessing/pool.py +++ b/Lib/multiprocessing/pool.py @@ -20,6 +20,7 @@ import threading import time import traceback +import types import warnings from queue import Empty =20 @@ -780,6 +781,8 @@ def _set(self, i, obj): del self._cache[self._job] self._pool =3D None =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + AsyncResult =3D ApplyResult # create alias -- see #17805 =20 # diff --git a/Lib/multiprocessing/queues.py b/Lib/multiprocessing/queues.py index d112db2cd981d..835070118387e 100644 --- a/Lib/multiprocessing/queues.py +++ b/Lib/multiprocessing/queues.py @@ -14,6 +14,7 @@ import threading import collections import time +import types import weakref import errno =20 @@ -366,3 +367,5 @@ def put(self, obj): else: with self._wlock: self._writer.send_bytes(obj) + + __class_getitem__ =3D classmethod(types.GenericAlias) diff --git a/Lib/multiprocessing/shared_memory.py b/Lib/multiprocessing/share= d_memory.py index 184e36704baae..9f954d9c38feb 100644 --- a/Lib/multiprocessing/shared_memory.py +++ b/Lib/multiprocessing/shared_memory.py @@ -14,6 +14,7 @@ import errno import struct import secrets +import types =20 if os.name =3D=3D "nt": import _winapi @@ -508,3 +509,5 @@ def index(self, value): return position else: raise ValueError(f"{value!r} not in this container") + + __class_getitem__ =3D classmethod(types.GenericAlias) diff --git a/Lib/queue.py b/Lib/queue.py index 5bb0431e94946..10dbcbc18ece8 100644 --- a/Lib/queue.py +++ b/Lib/queue.py @@ -1,6 +1,7 @@ '''A multi-producer, multi-consumer queue.''' =20 import threading +import types from collections import deque from heapq import heappush, heappop from time import monotonic as time @@ -216,6 +217,8 @@ def _put(self, item): def _get(self): return self.queue.popleft() =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 class PriorityQueue(Queue): '''Variant of Queue that retrieves open entries in priority order (lowes= t first). @@ -316,6 +319,8 @@ def qsize(self): '''Return the approximate size of the queue (not reliable!).''' return len(self._queue) =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 if SimpleQueue is None: SimpleQueue =3D _PySimpleQueue diff --git a/Lib/tempfile.py b/Lib/tempfile.py index a398345f108d0..ed15c0fd1f8af 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -829,3 +829,5 @@ def __exit__(self, exc, value, tb): def cleanup(self): if self._finalizer.detach(): self._rmtree(self.name) + + __class_getitem__ =3D classmethod(_types.GenericAlias) diff --git a/Lib/test/test_genericalias.py b/Lib/test/test_genericalias.py index 4241eabed0845..a00899f5267d7 100644 --- a/Lib/test/test_genericalias.py +++ b/Lib/test/test_genericalias.py @@ -6,16 +6,28 @@ defaultdict, deque, OrderedDict, Counter, UserDict, UserList ) from collections.abc import * +from concurrent.futures import Future +from concurrent.futures.thread import _WorkItem from contextlib import AbstractContextManager, AbstractAsyncContextManager +from ctypes import Array, LibraryLoader from difflib import SequenceMatcher from filecmp import dircmp from fileinput import FileInput from mmap import mmap from ipaddress import IPv4Network, IPv4Interface, IPv6Network, IPv6Interface from itertools import chain +from http.cookies import Morsel +from multiprocessing.managers import ValueProxy +from multiprocessing.pool import ApplyResult +from multiprocessing.shared_memory import ShareableList +from multiprocessing.queues import SimpleQueue from os import DirEntry from re import Pattern, Match from types import GenericAlias, MappingProxyType, AsyncGeneratorType +from tempfile import TemporaryDirectory, SpooledTemporaryFile +from urllib.parse import SplitResult, ParseResult +from unittest.case import _AssertRaisesContext +from queue import Queue, SimpleQueue import typing =20 from typing import TypeVar @@ -49,6 +61,15 @@ def test_subscriptable(self): DirEntry, IPv4Network, IPv4Interface, IPv6Network, IPv6Interface, chain, + TemporaryDirectory, SpooledTemporaryFile, + Queue, SimpleQueue, + _AssertRaisesContext, + Array, LibraryLoader, + SplitResult, ParseResult, + ValueProxy, ApplyResult, + ShareableList, SimpleQueue, + Future, _WorkItem, + Morsel, ): tname =3D t.__name__ with self.subTest(f"Testing {tname}"): diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 5e5d535dc6938..d0ee561a3ae93 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -241,6 +241,8 @@ def __exit__(self, exc_type, exc_value, tb): expected_regex.pattern, str(exc_value))) return True =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 class _AssertWarnsContext(_AssertRaisesBaseContext): """A context manager used to implement TestCase.assertWarns* methods.""" diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 779278bac598a..ea897c3032257 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -29,6 +29,7 @@ =20 import re import sys +import types import collections import warnings =20 @@ -176,6 +177,8 @@ def port(self): raise ValueError("Port out of range 0-65535") return port =20 + __class_getitem__ =3D classmethod(types.GenericAlias) + =20 class _NetlocResultMixinStr(_NetlocResultMixinBase, _ResultMixinStr): __slots__ =3D () diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index dab39396476ba..ba5ef397cf05b 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -4798,6 +4798,12 @@ Array_length(PyObject *myself) return self->b_length; } =20 +static PyMethodDef Array_methods[] =3D { + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, + { NULL, NULL } +}; + static PySequenceMethods Array_as_sequence =3D { Array_length, /* sq_length; */ 0, /* sq_concat; */ @@ -4846,7 +4852,7 @@ PyTypeObject PyCArray_Type =3D { 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ - 0, /* tp_methods */ + Array_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ diff --git a/Modules/_queuemodule.c b/Modules/_queuemodule.c index 5eef06252cd32..28bf8991285d8 100644 --- a/Modules/_queuemodule.c +++ b/Modules/_queuemodule.c @@ -302,6 +302,8 @@ static PyMethodDef simplequeue_methods[] =3D { _QUEUE_SIMPLEQUEUE_PUT_METHODDEF _QUEUE_SIMPLEQUEUE_PUT_NOWAIT_METHODDEF _QUEUE_SIMPLEQUEUE_QSIZE_METHODDEF + {"__class_getitem__", (PyCFunction)Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, {NULL, NULL} /* sentinel */ }; =20 From webhook-mailer at python.org Mon Apr 13 18:51:38 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Mon, 13 Apr 2020 22:51:38 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-32894: Support unparsing of infinity numbers in ast_unparser.c (GH-17426) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/258f5179f9494189e6a80311c86981d2a88b= a9d6 commit: 258f5179f9494189e6a80311c86981d2a88ba9d6 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-14T00:51:31+02:00 summary: bpo-32894: Support unparsing of infinity numbers in ast_unparser.c (GH-17426) files: A Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-32894.5g_UQr.rst M Lib/test/test_future.py M Python/ast_unparse.c diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index 9b88e3f464252..ebeb833d7e25b 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -5,6 +5,7 @@ from textwrap import dedent import os import re +import sys =20 rx =3D re.compile(r'\((\S+).py, line (\d+)') =20 @@ -308,5 +309,18 @@ def test_fstring_debug_annotations(self): self.assertAnnotationEqual("f'{x=3D!a}'", expected=3D"f'x=3D{x!a}'") self.assertAnnotationEqual("f'{x=3D!s:*^20}'", expected=3D"f'x=3D{x!= s:*^20}'") =20 + def test_infinity_numbers(self): + inf =3D "1e" + repr(sys.float_info.max_10_exp + 1) + infj =3D f"{inf}j" + self.assertAnnotationEqual("1e1000", expected=3Dinf) + self.assertAnnotationEqual("1e1000j", expected=3Dinfj) + self.assertAnnotationEqual("-1e1000", expected=3Df"-{inf}") + self.assertAnnotationEqual("3+1e1000j", expected=3Df"3 + {infj}") + self.assertAnnotationEqual("(1e1000, 1e1000j)", expected=3Df"({inf},= {infj})") + self.assertAnnotationEqual("'inf'") + self.assertAnnotationEqual("('inf', 1e1000, 'infxxx', 1e1000j)", exp= ected=3Df"('inf', {inf}, 'infxxx', {infj})") + self.assertAnnotationEqual("(1e1000, (1e1000j,))", expected=3Df"({in= f}, ({infj},))") + + if __name__ =3D=3D "__main__": unittest.main() diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-32894= .5g_UQr.rst b/Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-3289= 4.5g_UQr.rst new file mode 100644 index 0000000000000..68f4e6774a3b1 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-32894.5g_UQr= .rst=09 @@ -0,0 +1 @@ +Support unparsing of infinity numbers in postponed annotations. Patch by Bat= uhan Ta=C5=9Fkaya. diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index 5ecd1b0fef5ba..7cf199b1b42d9 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -1,3 +1,4 @@ +#include /* DBL_MAX_10_EXP */ #include #include "Python.h" #include "Python-ast.h" @@ -6,6 +7,8 @@ static PyObject *_str_open_br; static PyObject *_str_dbl_open_br; static PyObject *_str_close_br; static PyObject *_str_dbl_close_br; +static PyObject *_str_inf; +static PyObject *_str_replace_inf; =20 /* Forward declarations for recursion via helper functions. */ static PyObject * @@ -61,13 +64,28 @@ append_charp(_PyUnicodeWriter *writer, const char *charp) static int append_repr(_PyUnicodeWriter *writer, PyObject *obj) { - int ret; - PyObject *repr; - repr =3D PyObject_Repr(obj); + PyObject *repr =3D PyObject_Repr(obj); + if (!repr) { return -1; } - ret =3D _PyUnicodeWriter_WriteStr(writer, repr); + + if ((PyFloat_CheckExact(obj) && Py_IS_INFINITY(PyFloat_AS_DOUBLE(obj))) = || + PyComplex_CheckExact(obj)) + { + PyObject *new_repr =3D PyUnicode_Replace( + repr, + _str_inf, + _str_replace_inf, + -1 + ); + Py_DECREF(repr); + if (!new_repr) { + return -1; + } + repr =3D new_repr; + } + int ret =3D _PyUnicodeWriter_WriteStr(writer, repr); Py_DECREF(repr); return ret; } @@ -697,6 +715,28 @@ append_formattedvalue(_PyUnicodeWriter *writer, expr_ty = e) APPEND_STR_FINISH("}"); } =20 +static int +append_ast_constant(_PyUnicodeWriter *writer, PyObject *constant) +{ + if (PyTuple_CheckExact(constant)) { + Py_ssize_t i, elem_count; + + elem_count =3D PyTuple_GET_SIZE(constant); + APPEND_STR("("); + for (i =3D 0; i < elem_count; i++) { + APPEND_STR_IF(i > 0, ", "); + if (append_ast_constant(writer, PyTuple_GET_ITEM(constant, i)) <= 0) { + return -1; + } + } + + APPEND_STR_IF(elem_count =3D=3D 1, ","); + APPEND_STR(")"); + return 0; + } + return append_repr(writer, constant); +} + static int append_ast_attribute(_PyUnicodeWriter *writer, expr_ty e) { @@ -835,7 +875,7 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int = level) if (e->v.Constant.value =3D=3D Py_Ellipsis) { APPEND_STR_FINISH("..."); } - return append_repr(writer, e->v.Constant.value); + return append_ast_constant(writer, e->v.Constant.value); case JoinedStr_kind: return append_joinedstr(writer, e, false); case FormattedValue_kind: @@ -883,6 +923,14 @@ maybe_init_static_strings(void) !(_str_dbl_close_br =3D PyUnicode_InternFromString("}}"))) { return -1; } + if (!_str_inf && + !(_str_inf =3D PyUnicode_FromString("inf"))) { + return -1; + } + if (!_str_replace_inf && + !(_str_replace_inf =3D PyUnicode_FromFormat("1e%d", 1 + DBL_MAX_10_E= XP))) { + return -1; + } return 0; } =20 From webhook-mailer at python.org Mon Apr 13 19:51:40 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Mon, 13 Apr 2020 23:51:40 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/990ea4200f05fcd8bce3de363f4d7745ae14= 2385 commit: 990ea4200f05fcd8bce3de363f4d7745ae142385 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-14T08:51:32+09:00 summary: bpo-40208: Remove deprecated has_exec method of SymbolTable (GH-19396) files: A Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst M Doc/library/symtable.rst M Doc/whatsnew/3.9.rst M Lib/symtable.py M Lib/test/test_symtable.py diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index 7c6ac4dccf8b7..3efdecb5af710 100644 --- a/Doc/library/symtable.rst +++ b/Doc/library/symtable.rst @@ -67,10 +67,6 @@ Examining Symbol Tables Return ``True`` if the block has nested namespaces within it. These c= an be obtained with :meth:`get_children`. =20 - .. method:: has_exec() - - Return ``True`` if the block uses ``exec``. - .. method:: get_identifiers() =20 Return a list of names of symbols in this table. diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 1bbcae36a1a10..afb099a4ec558 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -753,6 +753,10 @@ Removed the ``__annotations__`` attribute instead. (Contributed by Serhiy Storchaka in :issue:`40182`.) =20 +* The :meth:`symtable.SymbolTable.has_exec` method has been removed. It was + deprecated since 2006, and only returning ``False`` when it's called. + (Contributed by Batuhan Taskaya in :issue:`40208`) + =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/symtable.py b/Lib/symtable.py index ac0a64ff58f79..a711676582f64 100644 --- a/Lib/symtable.py +++ b/Lib/symtable.py @@ -82,10 +82,6 @@ def is_nested(self): def has_children(self): return bool(self._table.children) =20 - def has_exec(self): - """Return true if the scope uses exec. Deprecated method.""" - return False - def get_identifiers(self): return self._table.symbols.keys() =20 diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py index 98d718c8ab1b1..d19355888e4b3 100644 --- a/Lib/test/test_symtable.py +++ b/Lib/test/test_symtable.py @@ -65,7 +65,6 @@ def test_type(self): =20 def test_optimized(self): self.assertFalse(self.top.is_optimized()) - self.assertFalse(self.top.has_exec()) =20 self.assertTrue(self.spam.is_optimized()) =20 diff --git a/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rs= t b/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst new file mode 100644 index 0000000000000..a06d5eadf3da8 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst @@ -0,0 +1 @@ +Remove deprecated :meth:`symtable.SymbolTable.has_exec`. From webhook-mailer at python.org Tue Apr 14 14:55:06 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Tue, 14 Apr 2020 18:55:06 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-395222: Correctly unparse unicode prefix in ast_unparse.c (GH-19512) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/aade1cc453698e1bc48861b16955c2c2219e= c521 commit: aade1cc453698e1bc48861b16955c2c2219ec521 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-14T19:55:01+01:00 summary: bpo-395222: Correctly unparse unicode prefix in ast_unparse.c (GH-19512) files: A Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-39522.uVeIV_.rst M Lib/test/test_future.py M Python/ast_unparse.c diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index ebeb833d7e25b..0522003d3c9b9 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -153,6 +153,7 @@ def test_annotations(self): eq =3D self.assertAnnotationEqual eq('...') eq("'some_string'") + eq("u'some_string'") eq("b'\\xa3'") eq('Name') eq('None') diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-39522= .uVeIV_.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-3952= 2.uVeIV_.rst new file mode 100644 index 0000000000000..12d939d05437e --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-39522.uVeIV_= .rst=09 @@ -0,0 +1,2 @@ +Correctly unparse explicit ``u`` prefix for strings when postponed +evaluation for annotations activated. Patch by Batuhan Taskaya. diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index 7cf199b1b42d9..c321acf991864 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -875,6 +875,8 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int = level) if (e->v.Constant.value =3D=3D Py_Ellipsis) { APPEND_STR_FINISH("..."); } + APPEND_STR_IF(e->v.Constant.kind !=3D NULL, + PyUnicode_AS_DATA(e->v.Constant.kind)); return append_ast_constant(writer, e->v.Constant.value); case JoinedStr_kind: return append_joinedstr(writer, e, false); From webhook-mailer at python.org Tue Apr 14 15:49:15 2020 From: webhook-mailer at python.org (Miro =?utf-8?q?Hron=C4=8Dok?=) Date: Tue, 14 Apr 2020 19:49:15 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-9216: Nobody expects the geohashing FIPS inquisition (GH-19520) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/4c0a31fb08407ba043688ad1c21102dd4cb9= 9146 commit: 4c0a31fb08407ba043688ad1c21102dd4cb99146 branch: master author: Miro Hron=C4=8Dok committer: GitHub date: 2020-04-14T12:49:11-07:00 summary: bpo-9216: Nobody expects the geohashing FIPS inquisition (GH-19520) Automerge-Triggered-By: @tiran files: M Lib/antigravity.py diff --git a/Lib/antigravity.py b/Lib/antigravity.py index c6f174ca6d873..6dc520733577a 100644 --- a/Lib/antigravity.py +++ b/Lib/antigravity.py @@ -12,6 +12,6 @@ def geohash(latitude, longitude, datedow): =20 ''' # https://xkcd.com/426/ - h =3D hashlib.md5(datedow).hexdigest() + h =3D hashlib.md5(datedow, usedforsecurity=3DFalse).hexdigest() p, q =3D [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])] print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:])) From webhook-mailer at python.org Tue Apr 14 16:21:30 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Tue, 14 Apr 2020 20:21:30 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-39522: Use _PyUnicodeWriter_WriteStr instead of PyUnicode_AS_DATA (GH-19523) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/43aeefa41915e4d3b0e68bbd4268c1c378a7= 2dce commit: 43aeefa41915e4d3b0e68bbd4268c1c378a72dce branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-14T21:21:22+01:00 summary: bpo-39522: Use _PyUnicodeWriter_WriteStr instead of PyUnicode_AS_DATA (GH-195= 23) files: M Python/ast_unparse.c diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index c321acf991864..443e7125d774e 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -875,8 +875,10 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, int= level) if (e->v.Constant.value =3D=3D Py_Ellipsis) { APPEND_STR_FINISH("..."); } - APPEND_STR_IF(e->v.Constant.kind !=3D NULL, - PyUnicode_AS_DATA(e->v.Constant.kind)); + if (e->v.Constant.kind !=3D NULL + && -1 =3D=3D _PyUnicodeWriter_WriteStr(writer, e->v.Constant.kin= d)) { + return -1; + } return append_ast_constant(writer, e->v.Constant.value); case JoinedStr_kind: return append_joinedstr(writer, e, false); From webhook-mailer at python.org Thu Apr 16 06:11:59 2020 From: webhook-mailer at python.org (Hakan =?utf-8?q?=C3=87elik?=) Date: Thu, 16 Apr 2020 10:11:59 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-40209: Use tokenize.open in test_unparse (GH-19399) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/6a5bf15c71a1c101c28774ae714b58e8a65b= 130c commit: 6a5bf15c71a1c101c28774ae714b58e8a65b130c branch: master author: Hakan =C3=87elik committer: GitHub date: 2020-04-16T11:11:55+01:00 summary: bpo-40209: Use tokenize.open in test_unparse (GH-19399) files: M Lib/test/test_unparse.py diff --git a/Lib/test/test_unparse.py b/Lib/test/test_unparse.py index 23292640086b9..d4089a3fc1cdf 100644 --- a/Lib/test/test_unparse.py +++ b/Lib/test/test_unparse.py @@ -11,11 +11,8 @@ def read_pyfile(filename): """Read and return the contents of a Python source file (as a string), taking into account the file encoding.""" - with open(filename, "rb") as pyfile: - encoding =3D tokenize.detect_encoding(pyfile.readline)[0] - with open(filename, "r", encoding=3Dencoding) as pyfile: - source =3D pyfile.read() - return source + with tokenize.open(filename) as stream: + return stream.read() =20 =20 for_else =3D """\ From webhook-mailer at python.org Thu Apr 16 13:29:20 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Thu, 16 Apr 2020 17:29:20 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-39793: use the same domain on make_msgid tests (#18698) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/5565c30f0b25996a0e73477fc0e1e1aced52= b926 commit: 5565c30f0b25996a0e73477fc0e1e1aced52b926 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-16T13:29:12-04:00 summary: bpo-39793: use the same domain on make_msgid tests (#18698) * bpo-39793: use same domain on make_msgid tests * apply suggestions files: A Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst M Lib/test/test_email/test_email.py diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_ema= il.py index 8ec39190ea8da..59eabb0092194 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -11,8 +11,8 @@ from io import StringIO, BytesIO from itertools import chain from random import choice -from socket import getfqdn from threading import Thread +from unittest.mock import patch =20 import email import email.policy @@ -3342,9 +3342,11 @@ def test_make_msgid_idstring(self): '.test-idstring at testdomain-string>') =20 def test_make_msgid_default_domain(self): - self.assertTrue( - email.utils.make_msgid().endswith( - '@' + getfqdn() + '>')) + with patch('socket.getfqdn') as mock_getfqdn: + mock_getfqdn.return_value =3D domain =3D 'pythontest.example.com' + self.assertTrue( + email.utils.make_msgid().endswith( + '@' + domain + '>')) =20 def test_Generator_linend(self): # Issue 14645. diff --git a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst = b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst new file mode 100644 index 0000000000000..6fa0d15ba2fdc --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst @@ -0,0 +1 @@ +Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. From webhook-mailer at python.org Sat Apr 18 12:17:26 2020 From: webhook-mailer at python.org (Hakan =?utf-8?q?=C3=87elik?=) Date: Sat, 18 Apr 2020 16:17:26 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Add spaces around the ":=" operator in ast_unparse.c (GH-19568) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/ce578831a4e573eac422a488930100bc5380= f227 commit: ce578831a4e573eac422a488930100bc5380f227 branch: master author: Hakan =C3=87elik committer: GitHub date: 2020-04-18T17:17:19+01:00 summary: Add spaces around the ":=3D" operator in ast_unparse.c (GH-19568) files: M Lib/test/test_future.py M Python/ast_unparse.c diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index 0522003d3c9b9..fdca2312fab7c 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -296,8 +296,8 @@ def test_annotations(self): eq('f((x for x in a), 2)') eq('(((a)))', 'a') eq('(((a, b)))', '(a, b)') - eq("(x:=3D10)") - eq("f'{(x:=3D10):=3D10}'") + eq("(x :=3D 10)") + eq("f'{(x :=3D 10):=3D10}'") eq("1 + 2 + 3") =20 def test_fstring_debug_annotations(self): diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index 443e7125d774e..d1e9d42d33bd4 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -829,7 +829,7 @@ append_named_expr(_PyUnicodeWriter *writer, expr_ty e, in= t level) { APPEND_STR_IF(level > PR_TUPLE, "("); APPEND_EXPR(e->v.NamedExpr.target, PR_ATOM); - APPEND_STR(":=3D"); + APPEND_STR(" :=3D "); APPEND_EXPR(e->v.NamedExpr.value, PR_ATOM); APPEND_STR_IF(level > PR_TUPLE, ")"); return 0; From webhook-mailer at python.org Sat Apr 18 14:09:14 2020 From: webhook-mailer at python.org (Furkan =?utf-8?q?=C3=96nder?=) Date: Sat, 18 Apr 2020 18:09:14 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/482259d0dcf27714a84cf56b93977320bea7= e093 commit: 482259d0dcf27714a84cf56b93977320bea7e093 branch: master author: Furkan =C3=96nder committer: GitHub date: 2020-04-18T11:09:09-07:00 summary: bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-192= 69) Automerge-Triggered-By: @pitrou files: A Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst M Doc/library/pickle.rst diff --git a/Doc/library/pickle.rst b/Doc/library/pickle.rst index 779b60ed4da00..a7b92bb9538d9 100644 --- a/Doc/library/pickle.rst +++ b/Doc/library/pickle.rst @@ -639,9 +639,9 @@ the methods :meth:`__getstate__` and :meth:`__setstate__`. At unpickling time, some methods like :meth:`__getattr__`, :meth:`__getattribute__`, or :meth:`__setattr__` may be called upon the instance. In case those methods rely on some internal invariant being - true, the type should implement :meth:`__getnewargs__` or - :meth:`__getnewargs_ex__` to establish such an invariant; otherwise, - neither :meth:`__new__` nor :meth:`__init__` will be called. + true, the type should implement :meth:`__new__` to establish such an + invariant, as :meth:`__init__` is not called when unpickling an + instance. =20 .. index:: pair: copy; protocol =20 diff --git a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.Vwx= Uty.rst b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty= .rst new file mode 100644 index 0000000000000..24f640bd4ef5f --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst @@ -0,0 +1,2 @@ +The pickle documentation incorrectly claimed that ``__new__`` isn't called by +default when unpickling. From webhook-mailer at python.org Sun Apr 19 14:02:25 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Sun, 19 Apr 2020 18:02:25 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: ignore Modules/python.exp on AIX (autogenerated) (GH-19607) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/3955da85687b176aed0c15faf06ad6c38d32= bade commit: 3955da85687b176aed0c15faf06ad6c38d32bade branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-19T19:02:17+01:00 summary: ignore Modules/python.exp on AIX (autogenerated) (GH-19607) files: M .gitignore diff --git a/.gitignore b/.gitignore index 8c1f8a43075a4..0962d3a1841fc 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ Programs/_freeze_importlib Programs/_testembed PC/python_nt*.h PC/pythonnt_rc*.h +Modules/python.exp PC/*/*.exp PC/*/*.lib PC/*/*.bsc From webhook-mailer at python.org Wed Apr 22 03:21:51 2020 From: webhook-mailer at python.org (Miro =?utf-8?q?Hron=C4=8Dok?=) Date: Wed, 22 Apr 2020 07:21:51 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-38439: Add 256px IDLE icon (GH-17473) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/3a69f3caeeaea57048ed3bc3051e16854b9a= 4cd6 commit: 3a69f3caeeaea57048ed3bc3051e16854b9a4cd6 branch: master author: Miro Hron=C4=8Dok committer: GitHub date: 2020-04-22T03:21:44-04:00 summary: bpo-38439: Add 256px IDLE icon (GH-17473) Icon author: Andrew Clover, bpo-1490384 files: A Lib/idlelib/Icons/README.txt A Lib/idlelib/Icons/idle_256.png A Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst D Lib/idlelib/Icons/idle.icns M Lib/idlelib/pyshell.py M PCbuild/lib.pyproj diff --git a/Lib/idlelib/Icons/README.txt b/Lib/idlelib/Icons/README.txt new file mode 100644 index 0000000000000..8b471629ecb3e --- /dev/null +++ b/Lib/idlelib/Icons/README.txt @@ -0,0 +1,9 @@ +The IDLE icons are from https://bugs.python.org/issue1490384 + +Created by Andrew Clover. + +The original sources are available from Andrew's website: +https://www.doxdesk.com/software/py/pyicons.html + +Various different formats and sizes are available at this GitHub Pull Reques= t: +https://github.com/python/cpython/pull/17473 diff --git a/Lib/idlelib/Icons/idle.icns b/Lib/idlelib/Icons/idle.icns deleted file mode 100644 index f65e3130f0aff..0000000000000 Binary files a/Lib/idlelib/Icons/idle.icns and /dev/null differ diff --git a/Lib/idlelib/Icons/idle_256.png b/Lib/idlelib/Icons/idle_256.png new file mode 100644 index 0000000000000..99ffa6fad4a92 Binary files /dev/null and b/Lib/idlelib/Icons/idle_256.png differ diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 43fb597c2ba6e..66ae0f7435dab 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -1485,9 +1485,14 @@ def main(): iconfile =3D os.path.join(icondir, 'idle.ico') root.wm_iconbitmap(default=3Diconfile) elif not macosx.isAquaTk(): - ext =3D '.png' if TkVersion >=3D 8.6 else '.gif' + if TkVersion >=3D 8.6: + ext =3D '.png' + sizes =3D (16, 32, 48, 256) + else: + ext =3D '.gif' + sizes =3D (16, 32, 48) iconfiles =3D [os.path.join(icondir, 'idle_%d%s' % (size, ext)) - for size in (16, 32, 48)] + for size in sizes] icons =3D [PhotoImage(master=3Droot, file=3Diconfile) for iconfile in iconfiles] root.wm_iconphoto(True, *icons) diff --git a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst b= /Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst new file mode 100644 index 0000000000000..de048d005cee7 --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst @@ -0,0 +1,2 @@ +Add a 256=C3=97256 pixel IDLE icon to support more modern environments. Crea= ted by Andrew Clover. +Delete the unused macOS idle.icns icon file. diff --git a/PCbuild/lib.pyproj b/PCbuild/lib.pyproj index d4351dec3bee2..0237b8cc85593 100644 --- a/PCbuild/lib.pyproj +++ b/PCbuild/lib.pyproj @@ -1585,6 +1585,7 @@ + From webhook-mailer at python.org Wed Apr 22 12:09:07 2020 From: webhook-mailer at python.org (Batuhan =?utf-8?q?Ta=C5=9Fkaya?=) Date: Wed, 22 Apr 2020 16:09:07 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-39562: Prevent collision of future and compiler flags (GH-19230) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/4454057269b995341b04d13f0bf97f96080f= 27d0 commit: 4454057269b995341b04d13f0bf97f96080f27d0 branch: master author: Batuhan Ta=C5=9Fkaya committer: GitHub date: 2020-04-22T18:09:03+02:00 summary: bpo-39562: Prevent collision of future and compiler flags (GH-19230) The constant values of future flags in the __future__ module is updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION. files: M Doc/whatsnew/3.9.rst M Include/code.h M Include/compile.h M Lib/__future__.py M Lib/test/test_future.py M Python/bltinmodule.c diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 20ebe92865a14..8064785178c49 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -832,6 +832,10 @@ Changes in the Python API inherit from it should have this method defined. (Contributed by Kyle Stanley in :issue:`34037`.) =20 +* The constant values of future flags in the :mod:`__future__` module + is updated in order to prevent collision with compiler flags. Previously + ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` was clashing with ``CO_FUTURE_DIVISION``. + (Contributed by Batuhan Taskaya in :issue:`39562`) =20 CPython bytecode changes ------------------------ diff --git a/Include/code.h b/Include/code.h index 107eba4b9c431..b268a6aedff8d 100644 --- a/Include/code.h +++ b/Include/code.h @@ -88,19 +88,19 @@ typedef struct { #define CO_ITERABLE_COROUTINE 0x0100 #define CO_ASYNC_GENERATOR 0x0200 =20 -/* These are no longer used. */ -#if 0 -#define CO_GENERATOR_ALLOWED 0x1000 -#endif -#define CO_FUTURE_DIVISION 0x2000 -#define CO_FUTURE_ABSOLUTE_IMPORT 0x4000 /* do absolute imports by default */ -#define CO_FUTURE_WITH_STATEMENT 0x8000 -#define CO_FUTURE_PRINT_FUNCTION 0x10000 -#define CO_FUTURE_UNICODE_LITERALS 0x20000 - -#define CO_FUTURE_BARRY_AS_BDFL 0x40000 -#define CO_FUTURE_GENERATOR_STOP 0x80000 -#define CO_FUTURE_ANNOTATIONS 0x100000 +/* bpo-39562: These constant values are changed in Python 3.9 + to prevent collision with compiler flags. CO_FUTURE_ and PyCF_ + constants must be kept unique. PyCF_ constants can use bits from + 0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */ +#define CO_FUTURE_DIVISION 0x20000 +#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default = */ +#define CO_FUTURE_WITH_STATEMENT 0x80000 +#define CO_FUTURE_PRINT_FUNCTION 0x100000 +#define CO_FUTURE_UNICODE_LITERALS 0x200000 + +#define CO_FUTURE_BARRY_AS_BDFL 0x400000 +#define CO_FUTURE_GENERATOR_STOP 0x800000 +#define CO_FUTURE_ANNOTATIONS 0x1000000 =20 /* This value is found in the co_cell2arg array when the associated cell variable does not correspond to an argument. */ diff --git a/Include/compile.h b/Include/compile.h index c0c73b29e4d9d..a2db65d47f001 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -18,12 +18,18 @@ PyAPI_FUNC(PyCodeObject *) PyNode_Compile(struct _node *,= const char *); CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) #define PyCF_MASK_OBSOLETE (CO_NESTED) + +/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. + PyCF_ constants can use bits from 0x0100 to 0x10000. + CO_FUTURE_ constants use bits starting at 0x20000. */ #define PyCF_SOURCE_IS_UTF8 0x0100 #define PyCF_DONT_IMPLY_DEDENT 0x0200 #define PyCF_ONLY_AST 0x0400 #define PyCF_IGNORE_COOKIE 0x0800 #define PyCF_TYPE_COMMENTS 0x1000 #define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 +#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ + PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT) =20 #ifndef Py_LIMITED_API typedef struct { diff --git a/Lib/__future__.py b/Lib/__future__.py index e1135685d846c..d7cb8ac5f4974 100644 --- a/Lib/__future__.py +++ b/Lib/__future__.py @@ -68,14 +68,14 @@ # this module. CO_NESTED =3D 0x0010 # nested_scopes CO_GENERATOR_ALLOWED =3D 0 # generators (obsolete, was 0x1000) -CO_FUTURE_DIVISION =3D 0x2000 # division -CO_FUTURE_ABSOLUTE_IMPORT =3D 0x4000 # perform absolute imports by default -CO_FUTURE_WITH_STATEMENT =3D 0x8000 # with statement -CO_FUTURE_PRINT_FUNCTION =3D 0x10000 # print function -CO_FUTURE_UNICODE_LITERALS =3D 0x20000 # unicode string literals -CO_FUTURE_BARRY_AS_BDFL =3D 0x40000 -CO_FUTURE_GENERATOR_STOP =3D 0x80000 # StopIteration becomes RuntimeError i= n generators -CO_FUTURE_ANNOTATIONS =3D 0x100000 # annotations become strings at runt= ime +CO_FUTURE_DIVISION =3D 0x20000 # division +CO_FUTURE_ABSOLUTE_IMPORT =3D 0x40000 # perform absolute imports by default +CO_FUTURE_WITH_STATEMENT =3D 0x80000 # with statement +CO_FUTURE_PRINT_FUNCTION =3D 0x100000 # print function +CO_FUTURE_UNICODE_LITERALS =3D 0x200000 # unicode string literals +CO_FUTURE_BARRY_AS_BDFL =3D 0x400000 +CO_FUTURE_GENERATOR_STOP =3D 0x800000 # StopIteration becomes RuntimeError = in generators +CO_FUTURE_ANNOTATIONS =3D 0x1000000 # annotations become strings at run= time =20 class _Feature: def __init__(self, optionalRelease, mandatoryRelease, compiler_flag): diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index fdca2312fab7c..56b7ac6865559 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -1,5 +1,7 @@ # Test various flavors of legal and illegal future statements =20 +import __future__ +import ast import unittest from test import support from textwrap import dedent @@ -75,6 +77,21 @@ def test_badfuture10(self): from test import badsyntax_future10 self.check_syntax_error(cm.exception, "badsyntax_future10", 3) =20 + def test_ensure_flags_dont_clash(self): + # bpo-39562: test that future flags and compiler flags doesn't clash + + # obtain future flags (CO_FUTURE_***) from the __future__ module + flags =3D { + f"CO_FUTURE_{future.upper()}": getattr(__future__, future).compi= ler_flag + for future in __future__.all_feature_names + } + # obtain some of the exported compiler flags (PyCF_***) from the ast= module + flags |=3D { + flag: getattr(ast, flag) + for flag in dir(ast) if flag.startswith("PyCF_") + } + self.assertCountEqual(set(flags.values()), flags.values()) + def test_parserhack(self): # test that the parser.c::future_hack function works as expected # Note: although this test must pass, it's not testing the original diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index a9fc21f108774..22ee5969473f5 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -739,7 +739,7 @@ builtin_compile_impl(PyObject *module, PyObject *source, = PyObject *filename, } =20 if (flags & - ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_DONT_IMPLY_DEDENT | PyCF_ONL= Y_AST | PyCF_TYPE_COMMENTS)) + ~(PyCF_MASK | PyCF_MASK_OBSOLETE | PyCF_COMPILE_MASK)) { PyErr_SetString(PyExc_ValueError, "compile(): unrecognised flags"); From webhook-mailer at python.org Tue Apr 28 10:30:10 2020 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Tue, 28 Apr 2020 14:30:10 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Python 3.9.0a6 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/bc1c8af8ef2563802767404c78c8ec6d6a96= 7897 commit: bc1c8af8ef2563802767404c78c8ec6d6a967897 branch: master author: =C5=81ukasz Langa committer: =C5=81ukasz Langa date: 2020-04-27T22:44:04+02:00 summary: Python 3.9.0a6 files: A Misc/NEWS.d/3.9.0a6.rst D Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst D Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst D Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst D Misc/NEWS.d/next/C API/2020-03-25-19-44-55.bpo-39947.2OxvPt.rst D Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst D Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst D Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst D Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst D Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst D Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst D Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst D Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst D Misc/NEWS.d/next/Core and Builtins/2019-06-09-10-54-31.bpo-37207.bLjgLS.rst D Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-32894.5g_UQr.rst D Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481.rqSeGl.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-19-21-53-41.bpo-40020.n-26G7.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-20-13-42-35.bpo-1635741.bhIu5M.r= st D Misc/NEWS.d/next/Core and Builtins/2020-03-22-01-01-41.bpo-1635741.gR7Igp.r= st D Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526.NHNZIv.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-17-12.bpo-1635741.jWaMRV.r= st D Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-26-26.bpo-1635741.AB38ot.r= st D Misc/NEWS.d/next/Core and Builtins/2020-03-25-20-34-01.bpo-40067.0bFda2.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-27-01-11-08.bpo-40077.wT002V.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-31-21-12-27.bpo-1635741.S2nkF3.r= st D Misc/NEWS.d/next/Core and Builtins/2020-03-31-22-15-04.bpo-1635741.8Ir1a0.r= st D Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-1635741.bhGWam.r= st D Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141.8fCRVj.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207.ZTPmKJ.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388.stlxBq.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082.WI3-lu.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246.vXPze5.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-39522.uVeIV_.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267.Q2N6Bw.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334.CTLGEp.rst D Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313.USVRW8.rst D Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy.rst D Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst D Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ7Cv.rst D Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst D Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst D Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst D Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst D Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst D Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst D Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst D Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst D Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rst D Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst D Misc/NEWS.d/next/Library/2020-03-07-11-26-08.bpo-36144.FG9jqy.rst D Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst D Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst D Misc/NEWS.d/next/Library/2020-03-18-14-02-58.bpo-36144.ooyn6Z.rst D Misc/NEWS.d/next/Library/2020-03-18-14-51-41.bpo-36144.lQm_RK.rst D Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst D Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst D Misc/NEWS.d/next/Library/2020-03-21-00-46-18.bpo-40017.HFpHZS.rst D Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst D Misc/NEWS.d/next/Library/2020-03-24-16-17-20.bpo-40050.6GrOlz.rst D Misc/NEWS.d/next/Library/2020-03-25-00-35-48.bpo-39812.rIKnms.rst D Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst D Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst D Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst D Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst D Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst D Misc/NEWS.d/next/Library/2020-03-31-01-11-20.bpo-40108.EGDVQ_.rst D Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst D Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst D Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rst D Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst D Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rst D Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst D Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst D Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst D Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst D Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst D Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst D Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst D Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst D Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst D Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst D Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst D Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst D Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst D Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst D Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst D Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst D Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst D Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst D Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst D Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst D Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst D Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst D Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst D Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst D Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst D Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst D Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rst D Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rst D Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst D Misc/NEWS.d/next/Security/2020-03-15-01-28-36.bpo-39073.6Szd3i.rst D Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.rst D Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst D Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst D Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst D Misc/NEWS.d/next/Tests/2020-03-31-16-07-15.bpo-40003.SOruLY.rst D Misc/NEWS.d/next/Tests/2020-03-31-18-57-52.bpo-40094.m3fTJe.rst D Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst D Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst D Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst D Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst D Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst D Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst D Misc/NEWS.d/next/Windows/2020-01-24-09-15-41.bpo-8901.hVnhGO.rst D Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst D Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst D Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.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 ba9e134e8dd24..4f91c9b901695 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -20,10 +20,10 @@ #define PY_MINOR_VERSION 9 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA -#define PY_RELEASE_SERIAL 5 +#define PY_RELEASE_SERIAL 6 =20 /* Version as a string */ -#define PY_VERSION "3.9.0a5+" +#define PY_VERSION "3.9.0a6" /*--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 11b48fd2657ae..8aca5c0cb88e3 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 Mar 23 17:18:04 2020 +# Autogenerated by Sphinx on Mon Apr 27 22:35:16 2020 topics =3D {'assert': 'The "assert" statement\n' '**********************\n' '\n' @@ -1877,9 +1877,9 @@ ' value is false. A counter-intuitive implication is that ' 'not-a-number\n' ' values are not equal to themselves. For example, if "x = =3D\n' - ' float(\'NaN\')", "3 < x", "x < 3", "x =3D=3D x", "x !=3D = x" are ' - 'all false.\n' - ' This behavior is compliant with IEEE 754.\n' + ' float(\'NaN\')", "3 < x", "x < 3" and "x =3D=3D x" are al= l ' + 'false, while "x\n' + ' !=3D x" is true. This behavior is compliant with IEEE 75= 4.\n' '\n' '* "None" and "NotImplemented" are singletons. **PEP 8** ' 'advises\n' @@ -3150,7 +3150,7 @@ '\n' 'When a description of an arithmetic operator below uses the= ' 'phrase\n' - '=E2=80=9Cthe numeric arguments are converted to a common ty= pe,=E2=80=9D this ' + '=E2=80=9Cthe numeric arguments are converted to a common ty= pe=E2=80=9D, this ' 'means\n' 'that the operator implementation for built-in types works a= s ' 'follows:\n' @@ -3414,7 +3414,7 @@ '\n' ' Changed in version 3.7: "object.__format__(x, \'\')" i= s ' 'now\n' - ' equivalent to "str(x)" rather than "format(str(self), ' + ' equivalent to "str(x)" rather than "format(str(x), ' '\'\')".\n' '\n' 'object.__lt__(self, other)\n' @@ -5962,19 +5962,18 @@ 'convention.\n' '\n' '"__*__"\n' - ' System-defined names. These names are defined by the ' - 'interpreter\n' - ' and its implementation (including the standard library). = ' - 'Current\n' - ' system names are discussed in the Special method names ' - 'section and\n' - ' elsewhere. More will likely be defined in future version= s ' - 'of\n' - ' Python. *Any* use of "__*__" names, in any context, that= ' - 'does not\n' - ' follow explicitly documented use, is subject to breakage ' - 'without\n' - ' warning.\n' + ' System-defined names, informally known as =E2=80=9Cdunder= =E2=80=9D names. ' + 'These\n' + ' names are defined by the interpreter and its ' + 'implementation\n' + ' (including the standard library). Current system names ar= e\n' + ' discussed in the Special method names section and ' + 'elsewhere. More\n' + ' will likely be defined in future versions of Python. *An= y* ' + 'use of\n' + ' "__*__" names, in any context, that does not follow ' + 'explicitly\n' + ' documented use, is subject to breakage without warning.\n' '\n' '"__*"\n' ' Class-private names. Names in this category, when used ' @@ -6110,19 +6109,19 @@ 'convention.\n' '\n' '"__*__"\n' - ' System-defined names. These names are defined by the ' - 'interpreter\n' - ' and its implementation (including the standard library).= ' - 'Current\n' - ' system names are discussed in the Special method names ' - 'section and\n' - ' elsewhere. More will likely be defined in future versio= ns ' - 'of\n' - ' Python. *Any* use of "__*__" names, in any context, tha= t ' - 'does not\n' - ' follow explicitly documented use, is subject to breakage= ' - 'without\n' - ' warning.\n' + ' System-defined names, informally known as =E2=80=9Cdunde= r=E2=80=9D names. ' + 'These\n' + ' names are defined by the interpreter and its ' + 'implementation\n' + ' (including the standard library). Current system names ' + 'are\n' + ' discussed in the Special method names section and ' + 'elsewhere. More\n' + ' will likely be defined in future versions of Python. ' + '*Any* use of\n' + ' "__*__" names, in any context, that does not follow ' + 'explicitly\n' + ' documented use, is subject to breakage without warning.\= n' '\n' '"__*"\n' ' Class-private names. Names in this category, when used ' @@ -7007,7 +7006,7 @@ 'program is represented by objects or by relations between ' 'objects. (In\n' 'a sense, and in conformance to Von Neumann=E2=80=99s model of a= =E2=80=9Cstored\n' - 'program computer,=E2=80=9D code is also represented by objects.= )\n' + 'program computer=E2=80=9D, code is also represented by objects.= )\n' '\n' 'Every object has an identity, a type and a value. An object=E2= =80=99s\n' '*identity* never changes once it has been created; you may thin= k ' @@ -8168,7 +8167,7 @@ '\n' ' Changed in version 3.7: "object.__format__(x, \'\')" is= ' 'now\n' - ' equivalent to "str(x)" rather than "format(str(self), ' + ' equivalent to "str(x)" rather than "format(str(x), ' '\'\')".\n' '\n' 'object.__lt__(self, other)\n' @@ -9915,6 +9914,35 @@ '*start* and\n' ' *end* are interpreted as in slice notation.\n' '\n' + 'str.removeprefix(prefix, /)\n' + '\n' + ' If the string starts with the *prefix* string, return= \n' + ' "string[len(prefix):]". Otherwise, return a copy of t= he ' + 'original\n' + ' string:\n' + '\n' + " >>> 'TestHook'.removeprefix('Test')\n" + " 'Hook'\n" + " >>> 'BaseTestCase'.removeprefix('Test')\n" + " 'BaseTestCase'\n" + '\n' + ' New in version 3.9.\n' + '\n' + 'str.removesuffix(suffix, /)\n' + '\n' + ' If the string ends with the *suffix* string and that ' + '*suffix* is\n' + ' not empty, return "string[:-len(suffix)]". Otherwise,= ' + 'return a copy\n' + ' of the original string:\n' + '\n' + " >>> 'MiscTests'.removesuffix('Tests')\n" + " 'Misc'\n" + " >>> 'TmpDirMixin'.removesuffix('Tests')\n" + " 'TmpDirMixin'\n" + '\n' + ' New in version 3.9.\n' + '\n' 'str.encode(encoding=3D"utf-8", errors=3D"strict")\n' '\n' ' Return an encoded version of the string as a bytes ' @@ -10297,6 +10325,16 @@ " >>> 'www.example.com'.lstrip('cmowz.')\n" " 'example.com'\n" '\n' + ' See "str.removeprefix()" for a method that will remov= e ' + 'a single\n' + ' prefix string rather than all of a set of characters.= ' + 'For example:\n' + '\n' + " >>> 'Arthur: three!'.lstrip('Arthur: ')\n" + " 'ee!'\n" + " >>> 'Arthur: three!'.removeprefix('Arthur: ')\n" + " 'three!'\n" + '\n' 'static str.maketrans(x[, y[, z]])\n' '\n' ' This static method returns a translation table usable= ' @@ -10410,6 +10448,16 @@ " >>> 'mississippi'.rstrip('ipz')\n" " 'mississ'\n" '\n' + ' See "str.removesuffix()" for a method that will remov= e ' + 'a single\n' + ' suffix string rather than all of a set of characters.= ' + 'For example:\n' + '\n' + " >>> 'Monty Python'.rstrip(' Python')\n" + " 'M'\n" + " >>> 'Monty Python'.removesuffix(' Python')\n" + " 'Monty'\n" + '\n' 'str.split(sep=3DNone, maxsplit=3D-1)\n' '\n' ' Return a list of the words in the string, using *sep*= ' @@ -11483,6 +11531,16 @@ ' then they can be used interchangeably to index the same\n' ' dictionary entry.\n' '\n' + ' Dictionaries preserve insertion order, meaning that keys wi= ll ' + 'be\n' + ' produced in the same order they were added sequentially ove= r ' + 'the\n' + ' dictionary. Replacing an existing key does not change the ' + 'order,\n' + ' however removing a key and re-inserting it will add it to ' + 'the\n' + ' end instead of keeping its old place.\n' + '\n' ' Dictionaries are mutable; they can be created by the "{...}= "\n' ' notation (see section Dictionary displays).\n' '\n' @@ -11491,6 +11549,13 @@ '"collections"\n' ' module.\n' '\n' + ' Changed in version 3.7: Dictionaries did not preserve ' + 'insertion\n' + ' order in versions of Python before 3.6. In CPython 3.6,\n' + ' insertion order was preserved, but it was considered an\n' + ' implementation detail at that time rather than a language\n' + ' guarantee.\n' + '\n' 'Callable types\n' ' These are the types to which the function call operation (see\= n' ' section Calls) can be applied:\n' diff --git a/Misc/NEWS.d/3.9.0a6.rst b/Misc/NEWS.d/3.9.0a6.rst new file mode 100644 index 0000000000000..af2cc7c3e9788 --- /dev/null +++ b/Misc/NEWS.d/3.9.0a6.rst @@ -0,0 +1,1211 @@ +.. bpo: 40121 +.. date: 2020-03-30-23-16-25 +.. nonce: p2LIio +.. release date: 2020-04-27 +.. section: Security + +Fixes audit events raised on creating a new socket. + +.. + +.. bpo: 39073 +.. date: 2020-03-15-01-28-36 +.. nonce: 6Szd3i +.. section: Security + +Disallow CR or LF in email.headerregistry.Address arguments to guard against +header injection attacks. + +.. + +.. bpo: 39503 +.. date: 2020-01-30-16-15-29 +.. nonce: B299Yq +.. section: Security + +CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class +of the :mod:`urllib.request` module uses an inefficient regular expression +which can be exploited by an attacker to cause a denial of service. Fix the +regex to prevent the catastrophic backtracking. Vulnerability reported by +Ben Caller and Matt Schwager. + +.. + +.. bpo: 40313 +.. date: 2020-04-20-23-58-35 +.. nonce: USVRW8 +.. section: Core and Builtins + +Improve the performance of bytes.hex(). + +.. + +.. bpo: 40334 +.. date: 2020-04-20-14-06-19 +.. nonce: CTLGEp +.. section: Core and Builtins + +Switch to a new parser, based on PEG. For more details see PEP 617. To +temporarily switch back to the old parser, use ``-X oldparser`` or +``PYTHONOLDPARSER=3D1``. In Python 3.10 we will remove the old parser +completely, including the ``parser`` module (already deprecated) and +anything that depends on it. + +.. + +.. bpo: 40267 +.. date: 2020-04-14-18-54-50 +.. nonce: Q2N6Bw +.. section: Core and Builtins + +Fix the tokenizer to display the correct error message, when there is a +SyntaxError on the last input character and no newline follows. It used to +be `unexpected EOF while parsing`, while it should be `invalid syntax`. + +.. + +.. bpo: 39522 +.. date: 2020-04-14-18-47-00 +.. nonce: uVeIV_ +.. section: Core and Builtins + +Correctly unparse explicit ``u`` prefix for strings when postponed +evaluation for annotations activated. Patch by Batuhan Taskaya. + +.. + +.. bpo: 40246 +.. date: 2020-04-11-17-52-03 +.. nonce: vXPze5 +.. section: Core and Builtins + +Report a specialized error message, `invalid string prefix`, when the +tokenizer encounters a string with an invalid prefix. + +.. + +.. bpo: 40082 +.. date: 2020-04-08-22-33-24 +.. nonce: WI3-lu +.. section: Core and Builtins + +Fix the signal handler: it now always uses the main interpreter, rather than +trying to get the current Python thread state. + +.. + +.. bpo: 37388 +.. date: 2020-04-07-15-44-29 +.. nonce: stlxBq +.. section: Core and Builtins + +str.encode() and str.decode() no longer check the encoding and errors in +development mode or in debug mode during Python finalization. The codecs +machinery can no longer work on very late calls to str.encode() and +str.decode(). + +.. + +.. bpo: 40077 +.. date: 2020-04-04-12-43-19 +.. nonce: m15TTX +.. section: Core and Builtins + +Fix possible refleaks in :mod:`_json`, memo of PyScannerObject should be +traversed. + +.. + +.. bpo: 37207 +.. date: 2020-04-02-00-25-19 +.. nonce: ZTPmKJ +.. section: Core and Builtins + +Speed up calls to ``dict()`` by using the :pep:`590` ``vectorcall`` calling +convention. + +.. + +.. bpo: 40141 +.. date: 2020-04-01-21-50-37 +.. nonce: 8fCRVj +.. section: Core and Builtins + +Add column and line information to ``ast.keyword`` nodes. Patch by Pablo +Galindo. + +.. + +.. bpo: 1635741 +.. date: 2020-04-01-00-08-18 +.. nonce: bhGWam +.. section: Core and Builtins + +Port :mod:`resource` to multiphase initialization (:pep:`489`). + +.. + +.. bpo: 1635741 +.. date: 2020-03-31-22-15-04 +.. nonce: 8Ir1a0 +.. section: Core and Builtins + +Port :mod:`math` to multiphase initialization (:pep:`489`). + +.. + +.. bpo: 1635741 +.. date: 2020-03-31-21-12-27 +.. nonce: S2nkF3 +.. section: Core and Builtins + +Port _uuid module to multiphase initialization (:pep:`489`). + +.. + +.. bpo: 40077 +.. date: 2020-03-27-01-11-08 +.. nonce: wT002V +.. section: Core and Builtins + +Convert json module to use :c:func:`PyType_FromSpec`. + +.. + +.. bpo: 40067 +.. date: 2020-03-25-20-34-01 +.. nonce: 0bFda2 +.. section: Core and Builtins + +Improve the error message for multiple star expressions in an assignment. +Patch by Furkan Onder + +.. + +.. bpo: 1635741 +.. date: 2020-03-24-22-26-26 +.. nonce: AB38ot +.. section: Core and Builtins + +Port _functools module to multiphase initialization (PEP 489). Patch by +Paulo Henrique Silva. + +.. + +.. bpo: 1635741 +.. date: 2020-03-24-22-17-12 +.. nonce: jWaMRV +.. section: Core and Builtins + +Port operator module to multiphase initialization (PEP 489). Patch by Paulo +Henrique Silva. + +.. + +.. bpo: 20526 +.. date: 2020-03-23-18-08-34 +.. nonce: NHNZIv +.. section: Core and Builtins + +Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is a borrowed +reference, not a strong reference: ``PyThreadState_Clear()`` must not call +``Py_CLEAR(tstate->frame)``. + +.. + +.. bpo: 1635741 +.. date: 2020-03-22-01-01-41 +.. nonce: gR7Igp +.. section: Core and Builtins + +Port time module to multiphase initialization (:pep:`489`). Patch by Paulo +Henrique Silva. + +.. + +.. bpo: 1635741 +.. date: 2020-03-20-13-42-35 +.. nonce: bhIu5M +.. section: Core and Builtins + +Port _weakref extension module to multiphase initialization (:pep:`489`). + +.. + +.. bpo: 40020 +.. date: 2020-03-19-21-53-41 +.. nonce: n-26G7 +.. section: Core and Builtins + +Fix a leak and subsequent crash in parsetok.c caused by realloc misuse on a +rare codepath. + +.. + +.. bpo: 39939 +.. date: 2020-03-11-19-17-36 +.. nonce: NwCnAM +.. section: Core and Builtins + +Added str.removeprefix and str.removesuffix methods and corresponding bytes, +bytearray, and collections.UserString methods to remove affixes from a +string if present. See :pep:`616` for a full description. Patch by Dennis +Sweeney. + +.. + +.. bpo: 39481 +.. date: 2020-01-28-17-19-18 +.. nonce: rqSeGl +.. section: Core and Builtins + +Implement PEP 585. This supports list[int], tuple[str, ...] etc. + +.. + +.. bpo: 32894 +.. date: 2019-12-01-21-36-49 +.. nonce: 5g_UQr +.. section: Core and Builtins + +Support unparsing of infinity numbers in postponed annotations. Patch by +Batuhan Ta=C5=9Fkaya. + +.. + +.. bpo: 37207 +.. date: 2019-06-09-10-54-31 +.. nonce: bLjgLS +.. section: Core and Builtins + +Speed up calls to ``list()`` by using the :pep:`590` ``vectorcall`` calling +convention. Patch by Mark Shannon. + +.. + +.. bpo: 40398 +.. date: 2020-04-26-22-25-36 +.. nonce: OdXnR3 +.. section: Library + +:func:`typing.get_args` now always returns an empty tuple for special +generic aliases. + +.. + +.. bpo: 40396 +.. date: 2020-04-26-19-07-40 +.. nonce: Fn-is1 +.. section: Library + +Functions :func:`typing.get_origin`, :func:`typing.get_args` and +:func:`typing.get_type_hints` support now generic aliases like +``list[int]``. + +.. + +.. bpo: 38061 +.. date: 2020-04-24-01-55-00 +.. nonce: XmULB3 +.. section: Library + +Optimize the :mod:`subprocess` module on FreeBSD using ``closefrom()``. A +single ``close(fd)`` syscall is cheap, but when ``sysconf(_SC_OPEN_MAX)`` is +high, the loop calling ``close(fd)`` on each file descriptor can take +several milliseconds. + +The workaround on FreeBSD to improve performance was to load and mount the +fdescfs kernel module, but this is not enabled by default. + +Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) +and Kubilay Kocak (koobs): +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242274 + +.. + +.. bpo: 38061 +.. date: 2020-04-24-01-27-08 +.. nonce: cdlkMz +.. section: Library + +On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls +``closefrom(fd_low)`` if *fd_high* is greater than or equal to +``sysconf(_SC_OPEN_MAX)``. + +Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) +and Kubilay Kocak (koobs): +https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242274 + +.. + +.. bpo: 40360 +.. date: 2020-04-22-20-55-17 +.. nonce: Er8sv- +.. section: Library + +The :mod:`lib2to3` module is pending deprecation due to :pep:`617`. + +.. + +.. bpo: 40138 +.. date: 2020-04-22-00-05-10 +.. nonce: i_oGqa +.. section: Library + +Fix the Windows implementation of :func:`os.waitpid` for exit code larger +than ``INT_MAX >> 8``. The exit status is now interpreted as an unsigned +number. + +.. + +.. bpo: 39942 +.. date: 2020-04-20-20-16-02 +.. nonce: NvGnTc +.. section: Library + +Set "__main__" as the default module name when "__name__" is missing in +:class:`typing.TypeVar`. Patch by Weipeng Hong. + +.. + +.. bpo: 40275 +.. date: 2020-04-20-19-06-55 +.. nonce: 9UcN2g +.. section: Library + +The :mod:`logging` package is now imported lazily in :mod:`unittest` only +when the :meth:`~unittest.TestCase.assertLogs` assertion is used. + +.. + +.. bpo: 40275 +.. date: 2020-04-20-18-50-25 +.. nonce: Ofk6J8 +.. section: Library + +The :mod:`asyncio` package is now imported lazily in :mod:`unittest` only +when the :class:`~unittest.IsolatedAsyncioTestCase` class is used. + +.. + +.. bpo: 40330 +.. date: 2020-04-19-17-31-29 +.. nonce: DGjoIS +.. section: Library + +In :meth:`ShareableList.__setitem__`, check the size of a new string item +after encoding it to utf-8, not before. + +.. + +.. bpo: 40148 +.. date: 2020-04-19-14-16-43 +.. nonce: pDZR6V +.. section: Library + +Added :meth:`pathlib.Path.with_stem()` to create a new Path with the stem +replaced. + +.. + +.. bpo: 40325 +.. date: 2020-04-18-19-40-00 +.. nonce: KWSvix +.. section: Library + +Deprecated support for set objects in random.sample(). + +.. + +.. bpo: 40257 +.. date: 2020-04-18-10-52-15 +.. nonce: lv4WTq +.. section: Library + +Improved help for the :mod:`typing` module. Docstrings are now shown for all +special forms and special generic aliases (like ``Union`` and ``List``). +Using ``help()`` with generic alias like ``List[int]`` will show the help +for the correspondent concrete type (``list`` in this case). + +.. + +.. bpo: 40257 +.. date: 2020-04-15-19-34-11 +.. nonce: ux8FUr +.. section: Library + +func:`inspect.getdoc` no longer returns docstring inherited from the type of +the object or from parent class if it is a class if it is not defined in the +object itself. In :mod:`pydoc` the documentation string is now shown not +only for class, function, method etc, but for any object that has its own +``__doc__`` attribute. + +.. + +.. bpo: 40287 +.. date: 2020-04-15-17-21-48 +.. nonce: -mkEJH +.. section: Library + +Fixed ``SpooledTemporaryFile.seek()`` to return the position. + +.. + +.. bpo: 40290 +.. date: 2020-04-15-16-43-48 +.. nonce: eqCMGJ +.. section: Library + +Added zscore() to statistics.NormalDist(). + +.. + +.. bpo: 40282 +.. date: 2020-04-15-10-23-52 +.. nonce: rIYJmu +.. section: Library + +Allow ``random.getrandbits(0)`` to succeed and to return 0. + +.. + +.. bpo: 40286 +.. date: 2020-04-15-00-39-25 +.. nonce: ai80FA +.. section: Library + +Add :func:`random.randbytes` function and :meth:`random.Random.randbytes` +method to generate random bytes. + +.. + +.. bpo: 40277 +.. date: 2020-04-14-21-53-18 +.. nonce: NknSaf +.. section: Library + +:func:`collections.namedtuple` now provides a human-readable repr for its +field accessors. + +.. + +.. bpo: 40270 +.. date: 2020-04-14-16-18-49 +.. nonce: XVJzeG +.. section: Library + +The included copy of sqlite3 on Windows is now compiled with the json +extension. This allows the use of functions such as ``json_object``. + +.. + +.. bpo: 29255 +.. date: 2020-04-14-11-31-07 +.. nonce: 4EcyIN +.. section: Library + +Wait in `KqueueSelector.select` when no fds are registered + +.. + +.. bpo: 40260 +.. date: 2020-04-12-21-18-56 +.. nonce: F6VWaE +.. section: Library + +Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding +comments. + +.. + +.. bpo: 40234 +.. date: 2020-04-10-16-13-47 +.. nonce: tar4d_ +.. section: Library + +Allow again to spawn daemon threads in subinterpreters (revert change which +denied them). + +.. + +.. bpo: 39207 +.. date: 2020-04-10-01-24-58 +.. nonce: 2dE5Ox +.. section: Library + +Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned +on demand, only when there are no available idle workers to reuse. This +optimizes startup overhead and reduces the amount of lost CPU time to idle +workers. Patch by Kyle Stanley. + +.. + +.. bpo: 40091 +.. date: 2020-04-07-23-26-25 +.. nonce: 5M9AW5 +.. section: Library + +Fix a hang at fork in the logging module: the new private _at_fork_reinit() +method is now used to reinitialize locks at fork in the child process. + +.. + +.. bpo: 40149 +.. date: 2020-04-07-18-06-38 +.. nonce: mMU2iu +.. section: Library + +Implement traverse and clear slots in _abc._abc_data type. + +.. + +.. bpo: 40208 +.. date: 2020-04-06-20-09-33 +.. nonce: 3rO_q7 +.. section: Library + +Remove deprecated :meth:`symtable.SymbolTable.has_exec`. + +.. + +.. bpo: 40196 +.. date: 2020-04-06-11-05-13 +.. nonce: Jqowse +.. section: Library + +Fix a bug in the :mod:`symtable` module that was causing incorrectly report +global variables as local. Patch by Pablo Galindo. + +.. + +.. bpo: 40190 +.. date: 2020-04-05-02-58-17 +.. nonce: HF3OWo +.. section: Library + +Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`. + +.. + +.. bpo: 40182 +.. date: 2020-04-04-23-44-09 +.. nonce: Bf_kFN +.. section: Library + +Removed the ``_field_types`` attribute of the :class:`typing.NamedTuple` +class. + +.. + +.. bpo: 36517 +.. date: 2020-04-04-17-49-39 +.. nonce: Ilj1IJ +.. section: Library + +Multiple inheritance with :class:`typing.NamedTuple` now raises an error +instead of silently ignoring other types. + +.. + +.. bpo: 40126 +.. date: 2020-04-04-00-47-40 +.. nonce: Y-bTNP +.. section: Library + +Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` +is now never called if its ``__enter__()`` is failed. Returning true from +``__exit__()`` silences now the exception. + +.. + +.. bpo: 40094 +.. date: 2020-04-02-01-13-28 +.. nonce: AeZ34K +.. section: Library + +CGIHTTPRequestHandler of http.server now logs the CGI script exit code, +rather than the CGI script exit status of os.waitpid(). For example, if the +script is killed by signal 11, it now logs: "CGI script exit code -11." + +.. + +.. bpo: 40108 +.. date: 2020-03-31-01-11-20 +.. nonce: EGDVQ_ +.. section: Library + +Improve the error message when triying to import a module using :mod:`runpy` +and incorrently use the ".py" extension at the end of the module name. Patch +by Pablo Galindo. + +.. + +.. bpo: 40094 +.. date: 2020-03-28-18-25-49 +.. nonce: v-wQIU +.. section: Library + +Add :func:`os.waitstatus_to_exitcode` function: convert a wait status to an +exit code. + +.. + +.. bpo: 40089 +.. date: 2020-03-27-17-22-34 +.. nonce: -lFsD0 +.. section: Library + +Fix threading._after_fork(): if fork was not called by a thread spawned by +threading.Thread, threading._after_fork() now creates a _MainThread instance +for _main_thread, instead of a _DummyThread instance. + +.. + +.. bpo: 40089 +.. date: 2020-03-27-16-54-29 +.. nonce: VTq_8s +.. section: Library + +Add a private ``_at_fork_reinit()`` method to :class:`_thread.Lock`, +:class:`_thread.RLock`, :class:`threading.RLock` and +:class:`threading.Condition` classes: reinitialize the lock at fork in the +child process, reset the lock to the unlocked state. Rename also the private +``_reset_internal_locks()`` method of :class:`threading.Event` to +``_at_fork_reinit()``. + +.. + +.. bpo: 25780 +.. date: 2020-03-27-08-57-46 +.. nonce: kIjVge +.. section: Library + +Expose :data:`~socket.CAN_RAW_JOIN_FILTERS` in the :mod:`socket` module. + +.. + +.. bpo: 39503 +.. date: 2020-03-25-16-02-16 +.. nonce: YmMbYn +.. section: Library + +:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` +now parses all WWW-Authenticate HTTP headers and accepts multiple challenges +per header: use the realm of the first Basic challenge. + +.. + +.. bpo: 39812 +.. date: 2020-03-25-00-35-48 +.. nonce: rIKnms +.. section: Library + +Removed daemon threads from :mod:`concurrent.futures` by adding an internal +`threading._register_atexit()`, which calls registered functions prior to +joining all non-daemon threads. This allows for compatibility with +subinterpreters, which don't support daemon threads. + +.. + +.. bpo: 40050 +.. date: 2020-03-24-16-17-20 +.. nonce: 6GrOlz +.. section: Library + +Fix ``importlib._bootstrap_external``: avoid creating a new ``winreg`` +builtin module if it's already available in :data:`sys.modules`, and remove +redundant imports. + +.. + +.. bpo: 40014 +.. date: 2020-03-23-17-52-00 +.. nonce: Ya70VG +.. section: Library + +Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails because the +group list is too small, retry with a larger group list. On failure, the +glibc implementation of ``getgrouplist()`` sets ``ngroups`` to the total +number of groups. For other implementations, double the group list size. + +.. + +.. bpo: 40017 +.. date: 2020-03-21-00-46-18 +.. nonce: HFpHZS +.. section: Library + +Add :data:`time.CLOCK_TAI` constant if the operating system support it. + +.. + +.. bpo: 40016 +.. date: 2020-03-19-19-40-27 +.. nonce: JWtxqJ +.. section: Library + +In re docstring, clarify the relationship between inline and argument +compile flags. + +.. + +.. bpo: 39953 +.. date: 2020-03-19-16-33-03 +.. nonce: yy5lC_ +.. section: Library + +Update internal table of OpenSSL error codes in the ``ssl`` module. + +.. + +.. bpo: 36144 +.. date: 2020-03-18-14-51-41 +.. nonce: lQm_RK +.. section: Library + +Added :pep:`584` operators to :class:`weakref.WeakValueDictionary`. + +.. + +.. bpo: 36144 +.. date: 2020-03-18-14-02-58 +.. nonce: ooyn6Z +.. section: Library + +Added :pep:`584` operators to :class:`weakref.WeakKeyDictionary`. + +.. + +.. bpo: 38891 +.. date: 2020-03-15-08-06-05 +.. nonce: 56Yokh +.. section: Library + +Fix linear runtime behaviour of the `__getitem__` and `__setitem__` methods +in :class:`multiprocessing.shared_memory.ShareableList`. This avoids +quadratic performance when iterating a `ShareableList`. Patch by Thomas +Krennwallner. + +.. + +.. bpo: 39682 +.. date: 2020-03-08-11-00-01 +.. nonce: AxXZNz +.. section: Library + +Remove undocumented support for *closing* a `pathlib.Path` object via its +context manager. The context manager magic methods remain, but they are now +a no-op, making `Path` objects immutable. + +.. + +.. bpo: 36144 +.. date: 2020-03-07-11-26-08 +.. nonce: FG9jqy +.. section: Library + +Added :pep:`584` operators (``|`` and ``|=3D``) to +:class:`collections.ChainMap`. + +.. + +.. bpo: 39011 +.. date: 2020-02-12-01-48-51 +.. nonce: hGve_t +.. section: Library + +Normalization of line endings in ElementTree attributes was removed, as line +endings which were replaced by entity numbers should be preserved in +original form. + +.. + +.. bpo: 38410 +.. date: 2019-10-09-08-14-25 +.. nonce: _YyoMV +.. section: Library + +Properly handle :func:`sys.audit` failures in +:func:`sys.set_asyncgen_hooks`. + +.. + +.. bpo: 36541 +.. date: 2019-06-18-19-38-27 +.. nonce: XI8mi1 +.. section: Library + +lib2to3 now recognizes named assignment expressions (the walrus operator, +``:=3D``) + +.. + +.. bpo: 35967 +.. date: 2019-04-14-14-11-07 +.. nonce: KUMT9E +.. section: Library + +In platform, delay the invocation of 'uname -p' until the processor +attribute is requested. + +.. + +.. bpo: 35113 +.. date: 2018-11-03-16-18-20 +.. nonce: vwvWKG +.. section: Library + +:meth:`inspect.getsource` now returns correct source code for inner class +with same name as module level class. Decorators are also returned as part +of source of the class. Patch by Karthikeyan Singaravelan. + +.. + +.. bpo: 33262 +.. date: 2018-04-17-13-23-29 +.. nonce: vHC7YQ +.. section: Library + +Deprecate passing None as an argument for :func:`shlex.split()`'s ``s`` +parameter. Patch by Zackery Spytz. + +.. + +.. bpo: 31758 +.. date: 2017-10-14-21-02-40 +.. nonce: 563ZZb +.. section: Library + +Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` +object. Patch by Oren Milman. + +.. + +.. bpo: 27635 +.. date: 2020-04-01-00-27-03 +.. nonce: VwxUty +.. section: Documentation + +The pickle documentation incorrectly claimed that ``__new__`` isn't called +by default when unpickling. + +.. + +.. bpo: 39879 +.. date: 2020-03-16-18-12-02 +.. nonce: CnQ7Cv +.. section: Documentation + +Updated :ref:`datamodel` docs to include :func:`dict` insertion order +preservation. Patch by Furkan Onder and Samy Lahfa. + +.. + +.. bpo: 38387 +.. date: 2019-10-06-23-44-15 +.. nonce: fZoq0S +.. section: Documentation + +Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. + +.. + +.. bpo: 13743 +.. date: 2019-09-25-23-20-55 +.. nonce: 5ToLDy +.. section: Documentation + +Some methods within xml.dom.minidom.Element class are now better documented. + +.. + +.. bpo: 31904 +.. date: 2020-04-09-16-29-18 +.. nonce: ej348T +.. section: Tests + +Set expected default encoding in test_c_locale_coercion.py for VxWorks RTOS. + +.. + +.. bpo: 40162 +.. date: 2020-04-03-02-40-16 +.. nonce: v3pQW_ +.. section: Tests + +Update Travis CI configuration to OpenSSL 1.1.1f. + +.. + +.. bpo: 40146 +.. date: 2020-04-02-02-14-37 +.. nonce: J-Yo9G +.. section: Tests + +Update OpenSSL to 1.1.1f in Azure Pipelines. + +.. + +.. bpo: 40094 +.. date: 2020-03-31-18-57-52 +.. nonce: m3fTJe +.. section: Tests + +Add :func:`test.support.wait_process` function. + +.. + +.. bpo: 40003 +.. date: 2020-03-31-16-07-15 +.. nonce: SOruLY +.. section: Tests + +``test.bisect_cmd`` now copies Python command line options like ``-O`` or +``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used with +``-w``/``--verbose2`` option. + +.. + +.. bpo: 39380 +.. date: 2020-03-22-20-00-04 +.. nonce: ZXlRQU +.. section: Tests + +Add the encoding in :class:`ftplib.FTP` and :class:`ftplib.FTP_TLS` to the +constructor as keyword-only and change the default from ``latin-1`` to +``utf-8`` to follow :rfc:`2640`. + +.. + +.. bpo: 39793 +.. date: 2020-02-29-12-58-17 +.. nonce: Og2SUN +.. section: Tests + +Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. + +.. + +.. bpo: 1812 +.. date: 2019-11-25-21-46-47 +.. nonce: sAbTbY +.. section: Tests + +Fix newline handling in doctest.testfile when loading from a package whose +loader has a get_data method. Patch by Peter Donis. + +.. + +.. bpo: 38360 +.. date: 2020-04-22-02-33-54 +.. nonce: 74C68u +.. section: Build + +Support single-argument form of macOS -isysroot flag. + +.. + +.. bpo: 40158 +.. date: 2020-04-03-17-54-33 +.. nonce: MWUTs4 +.. section: Build + +Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) + +.. + +.. bpo: 38527 +.. date: 2020-03-28-10-43-09 +.. nonce: fqCRgD +.. section: Build + +Fix configure check on Solaris for "float word ordering": sometimes, the +correct "grep" command was not being used. Patch by Arnon Yaari. + +.. + +.. bpo: 40164 +.. date: 2020-04-04-13-13-44 +.. nonce: SPrSn5 +.. section: Windows + +Updates Windows to OpenSSL 1.1.1f + +.. + +.. bpo: 8901 +.. date: 2020-01-24-09-15-41 +.. nonce: hVnhGO +.. section: Windows + +Ignore the Windows registry when the ``-E`` option is used. + +.. + +.. bpo: 38329 +.. date: 2020-04-22-03-39-22 +.. nonce: H0a8JV +.. section: macOS + +python.org macOS installers now update the Current version symlink of +/Library/Frameworks/Python.framework/Versions for 3.9 installs. Previously, +Current was only updated for Python 2.x installs. This should make it easier +to embed Python 3 into other macOS applications. + +.. + +.. bpo: 40164 +.. date: 2020-04-21-19-46-35 +.. nonce: 6HA6IC +.. section: macOS + +Update macOS installer builds to use OpenSSL 1.1.1g. + +.. + +.. bpo: 38439 +.. date: 2019-12-05-14-20-53 +.. nonce: j_L2PI +.. section: IDLE + +Add a 256=C3=97256 pixel IDLE icon to support more modern environments. Crea= ted +by Andrew Clover. Delete the unused macOS idle.icns icon file. + +.. + +.. bpo: 38689 +.. date: 2019-11-14-12-59-19 +.. nonce: Lgfxva +.. section: IDLE + +IDLE will no longer freeze when inspect.signature fails when fetching a +calltip. + +.. + +.. bpo: 40385 +.. date: 2020-04-24-21-08-19 +.. nonce: nWIQdq +.. section: Tools/Demos + +Removed the checkpyc.py tool. Please see compileall without force mode as a +potential alternative. + +.. + +.. bpo: 40179 +.. date: 2020-04-04-19-35-22 +.. nonce: u9FH10 +.. section: Tools/Demos + +Fixed translation of ``#elif`` in Argument Clinic. + +.. + +.. bpo: 40094 +.. date: 2020-04-02-01-22-21 +.. nonce: 1XQQF6 +.. section: Tools/Demos + +Fix ``which.py`` script exit code: it now uses +:func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status +into an exit code. + +.. + +.. bpo: 40241 +.. date: 2020-04-13-02-56-24 +.. nonce: _FOf7E +.. section: C API + +Move the :c:type:`PyGC_Head` structure to the internal C API. + +.. + +.. bpo: 40170 +.. date: 2020-04-11-06-12-44 +.. nonce: cmM9oK +.. section: C API + +Convert :c:func:`PyObject_IS_GC` macro to a function to hide implementation +details. + +.. + +.. bpo: 40241 +.. date: 2020-04-10-19-43-04 +.. nonce: Xm3w-1 +.. section: C API + +Add the functions :c:func:`PyObject_GC_IsTracked` and +:c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if +Python objects are being currently tracked or have been already finalized by +the garbage collector respectively. Patch by Pablo Galindo. + +.. + +.. bpo: 40170 +.. date: 2020-04-05-00-37-34 +.. nonce: Seuh3D +.. section: C API + +The :c:func:`PyObject_NEW` macro becomes an alias to the +:c:func:`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro +becomes an alias to the :c:func:`PyObject_NewVar` macro, to hide +implementation details. They no longer access directly the +:c:member:`PyTypeObject.tp_basicsize` member. + +.. + +.. bpo: 40170 +.. date: 2020-04-05-00-21-38 +.. nonce: Tx0vy6 +.. section: C API + +:c:func:`PyType_HasFeature` now always calls :c:func:`PyType_GetFlags` to +hide implementation details. Previously, it accessed directly the +:c:member:`PyTypeObject.tp_flags` member when the limited C API was not +used. + +.. + +.. bpo: 40170 +.. date: 2020-04-05-00-10-45 +.. nonce: 6nFYbY +.. section: C API + +Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a function to +hide implementation details: the macro accessed directly to the +:c:member:`PyTypeObject.tp_weaklistoffset` member. + +.. + +.. bpo: 40170 +.. date: 2020-04-05-00-02-13 +.. nonce: IFsGZ- +.. section: C API + +Convert :c:func:`PyObject_CheckBuffer` macro to a function to hide +implementation details: the macro accessed directly the +:c:member:`PyTypeObject.tp_as_buffer` member. + +.. + +.. bpo: 40170 +.. date: 2020-04-04-23-51-59 +.. nonce: uXQ701 +.. section: C API + +Always declare :c:func:`PyIndex_Check` as an opaque function to hide +implementation details: remove ``PyIndex_Check()`` macro. The macro accessed +directly the :c:member:`PyTypeObject.tp_as_number` member. + +.. + +.. bpo: 39947 +.. date: 2020-03-25-19-44-55 +.. nonce: 2OxvPt +.. section: C API + +Add :c:func:`PyThreadState_GetID` function: get the unique identifier of a +Python thread state. diff --git a/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst = b/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst deleted file mode 100644 index 869693095e49a..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix configure check on Solaris for "float word ordering": sometimes, the cor= rect "grep" command was not being used. -Patch by Arnon Yaari. diff --git a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst = b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst deleted file mode 100644 index a81548c3f9cdf..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst +++ /dev/null @@ -1 +0,0 @@ -Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) \ No newline at end of file diff --git a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst = b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst deleted file mode 100644 index e96ca14919919..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst +++ /dev/null @@ -1 +0,0 @@ -Support single-argument form of macOS -isysroot flag. diff --git a/Misc/NEWS.d/next/C API/2020-03-25-19-44-55.bpo-39947.2OxvPt.rst = b/Misc/NEWS.d/next/C API/2020-03-25-19-44-55.bpo-39947.2OxvPt.rst deleted file mode 100644 index e9910a544436e..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-03-25-19-44-55.bpo-39947.2OxvPt.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Add :c:func:`PyThreadState_GetID` function: get the unique identifier of a -Python thread state. diff --git a/Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst = b/Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst deleted file mode 100644 index 22bdc74904f41..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-04-23-51-59.bpo-40170.uXQ701.rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Always declare :c:func:`PyIndex_Check` as an opaque function to hide -implementation details: remove ``PyIndex_Check()`` macro. The macro accessed -directly the :c:member:`PyTypeObject.tp_as_number` member. diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst = b/Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst deleted file mode 100644 index fb378faa90c51..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-05-00-02-13.bpo-40170.IFsGZ-.rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Convert :c:func:`PyObject_CheckBuffer` macro to a function to hide -implementation details: the macro accessed directly the -:c:member:`PyTypeObject.tp_as_buffer` member. diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst = b/Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst deleted file mode 100644 index 3c4e33b9da134..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-05-00-10-45.bpo-40170.6nFYbY.rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a function to h= ide -implementation details: the macro accessed directly to the -:c:member:`PyTypeObject.tp_weaklistoffset` member. diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst = b/Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst deleted file mode 100644 index 858611df9059a..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-05-00-21-38.bpo-40170.Tx0vy6.rst=09 +++ /dev/null @@ -1,4 +0,0 @@ -:c:func:`PyType_HasFeature` now always calls :c:func:`PyType_GetFlags` to -hide implementation details. Previously, it accessed directly the -:c:member:`PyTypeObject.tp_flags` member when the limited C API was not -used. diff --git a/Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst = b/Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst deleted file mode 100644 index 2c31cca7f7ecf..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-05-00-37-34.bpo-40170.Seuh3D.rst=09 +++ /dev/null @@ -1,4 +0,0 @@ -The :c:func:`PyObject_NEW` macro becomes an alias to the :c:func:`PyObject_N= ew` -macro, and the :c:func:`PyObject_NEW_VAR` macro becomes an alias to the -:c:func:`PyObject_NewVar` macro, to hide implementation details. They no lon= ger -access directly the :c:member:`PyTypeObject.tp_basicsize` member. diff --git a/Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst = b/Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst deleted file mode 100644 index 0ade4a5f30e2e..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-10-19-43-04.bpo-40241.Xm3w-1.rst=09 +++ /dev/null @@ -1,4 +0,0 @@ -Add the functions :c:func:`PyObject_GC_IsTracked` and -:c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if -Python objects are being currently tracked or have been already finalized by -the garbage collector respectively. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst = b/Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst deleted file mode 100644 index 832b7f6e081d5..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-11-06-12-44.bpo-40170.cmM9oK.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Convert :c:func:`PyObject_IS_GC` macro to a function to hide -implementation details. diff --git a/Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst = b/Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst deleted file mode 100644 index b3e4aafe992df..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-04-13-02-56-24.bpo-40241._FOf7E.rst=09 +++ /dev/null @@ -1 +0,0 @@ -Move the :c:type:`PyGC_Head` structure to the internal C API. diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-06-09-10-54-31.bpo-37207= .bLjgLS.rst b/Misc/NEWS.d/next/Core and Builtins/2019-06-09-10-54-31.bpo-3720= 7.bLjgLS.rst deleted file mode 100644 index b6d0236db4635..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2019-06-09-10-54-31.bpo-37207.bLjgLS= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Speed up calls to ``list()`` by using the :pep:`590` ``vectorcall`` -calling convention. Patch by Mark Shannon. diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-32894= .5g_UQr.rst b/Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-3289= 4.5g_UQr.rst deleted file mode 100644 index 68f4e6774a3b1..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2019-12-01-21-36-49.bpo-32894.5g_UQr= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Support unparsing of infinity numbers in postponed annotations. Patch by Bat= uhan Ta=C5=9Fkaya. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481= .rqSeGl.rst b/Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-3948= 1.rqSeGl.rst deleted file mode 100644 index 9652a3fccd710..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-01-28-17-19-18.bpo-39481.rqSeGl= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Implement PEP 585. This supports list[int], tuple[str, ...] etc. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939= .NwCnAM.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-3993= 9.NwCnAM.rst deleted file mode 100644 index bf094f1ce9b9b..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-11-19-17-36.bpo-39939.NwCnAM= .rst=09 +++ /dev/null @@ -1,5 +0,0 @@ -Added str.removeprefix and str.removesuffix methods and corresponding -bytes, bytearray, and collections.UserString methods to remove affixes -from a string if present. -See :pep:`616` for a full description. -Patch by Dennis Sweeney. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-19-21-53-41.bpo-40020= .n-26G7.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-19-21-53-41.bpo-4002= 0.n-26G7.rst deleted file mode 100644 index 948404baba288..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-19-21-53-41.bpo-40020.n-26G7= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Fix a leak and subsequent crash in parsetok.c caused by realloc misuse on a = rare codepath. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-20-13-42-35.bpo-16357= 41.bhIu5M.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-20-13-42-35.bpo-16= 35741.bhIu5M.rst deleted file mode 100644 index ab5d0ae428d7d..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-20-13-42-35.bpo-1635741.bhIu= 5M.rst=09 +++ /dev/null @@ -1 +0,0 @@ -Port _weakref extension module to multiphase initialization (:pep:`489`). diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-22-01-01-41.bpo-16357= 41.gR7Igp.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-22-01-01-41.bpo-16= 35741.gR7Igp.rst deleted file mode 100644 index 5201ba6cdbcff..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-22-01-01-41.bpo-1635741.gR7I= gp.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Port time module to multiphase initialization (:pep:`489`). -Patch by Paulo Henrique Silva. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526= .NHNZIv.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-2052= 6.NHNZIv.rst deleted file mode 100644 index c808b7608c61e..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526.NHNZIv= .rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is a borrowed -reference, not a strong reference: ``PyThreadState_Clear()`` must not call -``Py_CLEAR(tstate->frame)``. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-17-12.bpo-16357= 41.jWaMRV.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-17-12.bpo-16= 35741.jWaMRV.rst deleted file mode 100644 index d84626af5b131..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-17-12.bpo-1635741.jWaM= RV.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Port operator module to multiphase initialization (PEP 489). Patch by Paulo -Henrique Silva. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-26-26.bpo-16357= 41.AB38ot.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-26-26.bpo-16= 35741.AB38ot.rst deleted file mode 100644 index 1a6116283435d..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-24-22-26-26.bpo-1635741.AB38= ot.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Port _functools module to multiphase initialization (PEP 489). Patch by -Paulo Henrique Silva. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-25-20-34-01.bpo-40067= .0bFda2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-25-20-34-01.bpo-4006= 7.0bFda2.rst deleted file mode 100644 index 2e1b20d293770..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-25-20-34-01.bpo-40067.0bFda2= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Improve the error message for multiple star expressions in an assignment. -Patch by Furkan Onder diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-27-01-11-08.bpo-40077= .wT002V.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-27-01-11-08.bpo-4007= 7.wT002V.rst deleted file mode 100644 index ab0654a5ca3cc..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-27-01-11-08.bpo-40077.wT002V= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Convert json module to use :c:func:`PyType_FromSpec`. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-31-21-12-27.bpo-16357= 41.S2nkF3.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-31-21-12-27.bpo-16= 35741.S2nkF3.rst deleted file mode 100644 index 7d5a8ca21d26f..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-31-21-12-27.bpo-1635741.S2nk= F3.rst=09 +++ /dev/null @@ -1 +0,0 @@ -Port _uuid module to multiphase initialization (:pep:`489`). diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-31-22-15-04.bpo-16357= 41.8Ir1a0.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-31-22-15-04.bpo-16= 35741.8Ir1a0.rst deleted file mode 100644 index e1c5a29916b1c..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-31-22-15-04.bpo-1635741.8Ir1= a0.rst=09 +++ /dev/null @@ -1 +0,0 @@ -Port :mod:`math` to multiphase initialization (:pep:`489`). diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-16357= 41.bhGWam.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-16= 35741.bhGWam.rst deleted file mode 100644 index cacfed2f9fdb5..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-01-00-08-18.bpo-1635741.bhGW= am.rst=09 +++ /dev/null @@ -1 +0,0 @@ -Port :mod:`resource` to multiphase initialization (:pep:`489`). diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141= .8fCRVj.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-4014= 1.8fCRVj.rst deleted file mode 100644 index c6ea50e2ce8bc..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-01-21-50-37.bpo-40141.8fCRVj= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Add column and line information to ``ast.keyword`` nodes. Patch by Pablo -Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207= .ZTPmKJ.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-3720= 7.ZTPmKJ.rst deleted file mode 100644 index cb5e9ff5b8f8e..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-02-00-25-19.bpo-37207.ZTPmKJ= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Speed up calls to ``dict()`` by using the :pep:`590` ``vectorcall`` calling -convention. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077= .m15TTX.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-4007= 7.m15TTX.rst deleted file mode 100644 index 21ed615917c59..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-04-12-43-19.bpo-40077.m15TTX= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Fix possible refleaks in :mod:`_json`, memo of PyScannerObject should be tra= versed. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388= .stlxBq.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-3738= 8.stlxBq.rst deleted file mode 100644 index 1da58d111912c..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-07-15-44-29.bpo-37388.stlxBq= .rst=09 +++ /dev/null @@ -1,4 +0,0 @@ -str.encode() and str.decode() no longer check the encoding and errors in -development mode or in debug mode during Python finalization. The codecs -machinery can no longer work on very late calls to str.encode() and -str.decode(). diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082= .WI3-lu.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-4008= 2.WI3-lu.rst deleted file mode 100644 index 0a25b5eca3aef..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-08-22-33-24.bpo-40082.WI3-lu= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Fix the signal handler: it now always uses the main interpreter, rather than -trying to get the current Python thread state. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246= .vXPze5.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-4024= 6.vXPze5.rst deleted file mode 100644 index 056b7f8472912..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-11-17-52-03.bpo-40246.vXPze5= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Report a specialized error message, `invalid string prefix`, when the tokeni= zer encounters a string with an invalid prefix. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-39522= .uVeIV_.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-3952= 2.uVeIV_.rst deleted file mode 100644 index 12d939d05437e..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-47-00.bpo-39522.uVeIV_= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Correctly unparse explicit ``u`` prefix for strings when postponed -evaluation for annotations activated. Patch by Batuhan Taskaya. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267= .Q2N6Bw.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-4026= 7.Q2N6Bw.rst deleted file mode 100644 index a778594ce9ced..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-14-18-54-50.bpo-40267.Q2N6Bw= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Fix the tokenizer to display the correct error message, when there is a Synt= axError on the last input character and no newline follows. It used to be `un= expected EOF while parsing`, while it should be `invalid syntax`. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334= .CTLGEp.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-4033= 4.CTLGEp.rst deleted file mode 100644 index b52d310508a8a..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-20-14-06-19.bpo-40334.CTLGEp= .rst=09 +++ /dev/null @@ -1,5 +0,0 @@ -Switch to a new parser, based on PEG. For more details see PEP 617. To -temporarily switch back to the old parser, use ``-X oldparser`` or -``PYTHONOLDPARSER=3D1``. In Python 3.10 we will remove the old parser -completely, including the ``parser`` module (already deprecated) and -anything that depends on it. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313= .USVRW8.rst b/Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-4031= 3.USVRW8.rst deleted file mode 100644 index 52880abe9c2d9..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-04-20-23-58-35.bpo-40313.USVRW8= .rst=09 +++ /dev/null @@ -1 +0,0 @@ -Improve the performance of bytes.hex(). \ No newline at end of file diff --git a/Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5To= LDy.rst b/Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy= .rst deleted file mode 100644 index 02dc4331a1251..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2019-09-25-23-20-55.bpo-13743.5ToLDy.rst +++ /dev/null @@ -1 +0,0 @@ -Some methods within xml.dom.minidom.Element class are now better documented. diff --git a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZo= q0S.rst b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S= .rst deleted file mode 100644 index a678fe5052673..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst +++ /dev/null @@ -1 +0,0 @@ -Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. diff --git a/Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ= 7Cv.rst b/Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ7Cv= .rst deleted file mode 100644 index 6698ed607ca0e..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ7Cv.rst +++ /dev/null @@ -1,2 +0,0 @@ -Updated :ref:`datamodel` docs to include :func:`dict` insertion order preser= vation. -Patch by Furkan Onder and Samy Lahfa. diff --git a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.Vwx= Uty.rst b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty= .rst deleted file mode 100644 index 24f640bd4ef5f..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst +++ /dev/null @@ -1,2 +0,0 @@ -The pickle documentation incorrectly claimed that ``__new__`` isn't called by -default when unpickling. diff --git a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst b= /Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst deleted file mode 100644 index f4f4a2e9afd85..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst +++ /dev/null @@ -1,2 +0,0 @@ -IDLE will no longer freeze when inspect.signature fails when fetching -a calltip. diff --git a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst b= /Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst deleted file mode 100644 index de048d005cee7..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add a 256=C3=97256 pixel IDLE icon to support more modern environments. Crea= ted by Andrew Clover. -Delete the unused macOS idle.icns icon file. diff --git a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rs= t b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst deleted file mode 100644 index 92e55db2b0986..0000000000000 --- a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst +++ /dev/null @@ -1,2 +0,0 @@ -Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` -object. Patch by Oren Milman. diff --git a/Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rs= t b/Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst deleted file mode 100644 index 2afe13aeb0fca..0000000000000 --- a/Misc/NEWS.d/next/Library/2018-04-17-13-23-29.bpo-33262.vHC7YQ.rst +++ /dev/null @@ -1,2 +0,0 @@ -Deprecate passing None as an argument for :func:`shlex.split()`'s ``s`` -parameter. Patch by Zackery Spytz. diff --git a/Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rs= t b/Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst deleted file mode 100644 index bf6b672964fa6..0000000000000 --- a/Misc/NEWS.d/next/Library/2018-11-03-16-18-20.bpo-35113.vwvWKG.rst +++ /dev/null @@ -1,3 +0,0 @@ -:meth:`inspect.getsource` now returns correct source code for inner class -with same name as module level class. Decorators are also returned as part -of source of the class. Patch by Karthikeyan Singaravelan. diff --git a/Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rs= t b/Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst deleted file mode 100644 index 38bec77313ac0..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-04-14-14-11-07.bpo-35967.KUMT9E.rst +++ /dev/null @@ -1 +0,0 @@ -In platform, delay the invocation of 'uname -p' until the processor attribut= e is requested. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rs= t b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst deleted file mode 100644 index e7b9dd648b407..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst +++ /dev/null @@ -1,2 +0,0 @@ -lib2to3 now recognizes named assignment expressions (the walrus operator, -``:=3D``) diff --git a/Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rs= t b/Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rst deleted file mode 100644 index 038c46afb5bb6..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rst +++ /dev/null @@ -1,2 +0,0 @@ -Properly handle :func:`sys.audit` failures in -:func:`sys.set_asyncgen_hooks`. diff --git a/Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rs= t b/Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst deleted file mode 100644 index 43962f0bf17fd..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-12-01-48-51.bpo-39011.hGve_t.rst +++ /dev/null @@ -1,3 +0,0 @@ -Normalization of line endings in ElementTree attributes was removed, as line -endings which were replaced by entity numbers should be preserved in -original form. diff --git a/Misc/NEWS.d/next/Library/2020-03-07-11-26-08.bpo-36144.FG9jqy.rs= t b/Misc/NEWS.d/next/Library/2020-03-07-11-26-08.bpo-36144.FG9jqy.rst deleted file mode 100644 index 9deb489d88352..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-07-11-26-08.bpo-36144.FG9jqy.rst +++ /dev/null @@ -1 +0,0 @@ -Added :pep:`584` operators (``|`` and ``|=3D``) to :class:`collections.Chain= Map`. diff --git a/Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rs= t b/Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst deleted file mode 100644 index d71a32132af9d..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-08-11-00-01.bpo-39682.AxXZNz.rst +++ /dev/null @@ -1,3 +0,0 @@ -Remove undocumented support for *closing* a `pathlib.Path` object via its -context manager. The context manager magic methods remain, but they are now a -no-op, making `Path` objects immutable. diff --git a/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rs= t b/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst deleted file mode 100644 index fdb8a05d18347..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-15-08-06-05.bpo-38891.56Yokh.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix linear runtime behaviour of the `__getitem__` and `__setitem__` methods = in -:class:`multiprocessing.shared_memory.ShareableList`. This avoids quadratic -performance when iterating a `ShareableList`. Patch by Thomas Krennwallner. diff --git a/Misc/NEWS.d/next/Library/2020-03-18-14-02-58.bpo-36144.ooyn6Z.rs= t b/Misc/NEWS.d/next/Library/2020-03-18-14-02-58.bpo-36144.ooyn6Z.rst deleted file mode 100644 index 262653a01b923..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-18-14-02-58.bpo-36144.ooyn6Z.rst +++ /dev/null @@ -1 +0,0 @@ -Added :pep:`584` operators to :class:`weakref.WeakKeyDictionary`. diff --git a/Misc/NEWS.d/next/Library/2020-03-18-14-51-41.bpo-36144.lQm_RK.rs= t b/Misc/NEWS.d/next/Library/2020-03-18-14-51-41.bpo-36144.lQm_RK.rst deleted file mode 100644 index daf1101601f4d..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-18-14-51-41.bpo-36144.lQm_RK.rst +++ /dev/null @@ -1 +0,0 @@ -Added :pep:`584` operators to :class:`weakref.WeakValueDictionary`. diff --git a/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rs= t b/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst deleted file mode 100644 index 3fea7c87ea885..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst +++ /dev/null @@ -1 +0,0 @@ -Update internal table of OpenSSL error codes in the ``ssl`` module. diff --git a/Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rs= t b/Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst deleted file mode 100644 index 0c6449de52799..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst +++ /dev/null @@ -1 +0,0 @@ -In re docstring, clarify the relationship between inline and argument compil= e flags. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-03-21-00-46-18.bpo-40017.HFpHZS.rs= t b/Misc/NEWS.d/next/Library/2020-03-21-00-46-18.bpo-40017.HFpHZS.rst deleted file mode 100644 index 9a17272d9699a..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-21-00-46-18.bpo-40017.HFpHZS.rst +++ /dev/null @@ -1 +0,0 @@ -Add :data:`time.CLOCK_TAI` constant if the operating system support it. diff --git a/Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rs= t b/Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst deleted file mode 100644 index e9b36c211324b..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails because the -group list is too small, retry with a larger group list. On failure, the gli= bc -implementation of ``getgrouplist()`` sets ``ngroups`` to the total number of -groups. For other implementations, double the group list size. diff --git a/Misc/NEWS.d/next/Library/2020-03-24-16-17-20.bpo-40050.6GrOlz.rs= t b/Misc/NEWS.d/next/Library/2020-03-24-16-17-20.bpo-40050.6GrOlz.rst deleted file mode 100644 index 0a8e24e4f2857..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-24-16-17-20.bpo-40050.6GrOlz.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix ``importlib._bootstrap_external``: avoid creating a new ``winreg`` built= in -module if it's already available in :data:`sys.modules`, and remove redundant -imports. diff --git a/Misc/NEWS.d/next/Library/2020-03-25-00-35-48.bpo-39812.rIKnms.rs= t b/Misc/NEWS.d/next/Library/2020-03-25-00-35-48.bpo-39812.rIKnms.rst deleted file mode 100644 index 4cea878d0ccb4..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-25-00-35-48.bpo-39812.rIKnms.rst +++ /dev/null @@ -1,4 +0,0 @@ -Removed daemon threads from :mod:`concurrent.futures` by adding -an internal `threading._register_atexit()`, which calls registered functions -prior to joining all non-daemon threads. This allows for compatibility -with subinterpreters, which don't support daemon threads. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rs= t b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst deleted file mode 100644 index be80ce79d91ed..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst +++ /dev/null @@ -1,3 +0,0 @@ -:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` -now parses all WWW-Authenticate HTTP headers and accepts multiple challenges -per header: use the realm of the first Basic challenge. diff --git a/Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rs= t b/Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst deleted file mode 100644 index 119e149ae7dc7..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-27-08-57-46.bpo-25780.kIjVge.rst +++ /dev/null @@ -1 +0,0 @@ -Expose :data:`~socket.CAN_RAW_JOIN_FILTERS` in the :mod:`socket` module. diff --git a/Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rs= t b/Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst deleted file mode 100644 index 3948852fbee6b..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-27-16-54-29.bpo-40089.VTq_8s.rst +++ /dev/null @@ -1,6 +0,0 @@ -Add a private ``_at_fork_reinit()`` method to :class:`_thread.Lock`, -:class:`_thread.RLock`, :class:`threading.RLock` and -:class:`threading.Condition` classes: reinitialize the lock at fork in the -child process, reset the lock to the unlocked state. -Rename also the private ``_reset_internal_locks()`` method of -:class:`threading.Event` to ``_at_fork_reinit()``. diff --git a/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rs= t b/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst deleted file mode 100644 index f5335a33c066c..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix threading._after_fork(): if fork was not called by a thread spawned by -threading.Thread, threading._after_fork() now creates a _MainThread instance -for _main_thread, instead of a _DummyThread instance. diff --git a/Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rs= t b/Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst deleted file mode 100644 index b50816f1a9a4b..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-28-18-25-49.bpo-40094.v-wQIU.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add :func:`os.waitstatus_to_exitcode` function: -convert a wait status to an exit code. diff --git a/Misc/NEWS.d/next/Library/2020-03-31-01-11-20.bpo-40108.EGDVQ_.rs= t b/Misc/NEWS.d/next/Library/2020-03-31-01-11-20.bpo-40108.EGDVQ_.rst deleted file mode 100644 index 778a0f1b1a596..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-31-01-11-20.bpo-40108.EGDVQ_.rst +++ /dev/null @@ -1,3 +0,0 @@ -Improve the error message when triying to import a module using :mod:`runpy` -and incorrently use the ".py" extension at the end of the module name. Patch -by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rs= t b/Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst deleted file mode 100644 index ba13d3cdf4a8d..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-02-01-13-28.bpo-40094.AeZ34K.rst +++ /dev/null @@ -1,3 +0,0 @@ -CGIHTTPRequestHandler of http.server now logs the CGI script exit code, -rather than the CGI script exit status of os.waitpid(). For example, if the -script is killed by signal 11, it now logs: "CGI script exit code -11." diff --git a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rs= t b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst deleted file mode 100644 index 8f725cfba86e2..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` -is now never called if its ``__enter__()`` is failed. Returning true from -``__exit__()`` silences now the exception. diff --git a/Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rs= t b/Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rst deleted file mode 100644 index cd5c0d729f1e7..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-04-17-49-39.bpo-36517.Ilj1IJ.rst +++ /dev/null @@ -1,2 +0,0 @@ -Multiple inheritance with :class:`typing.NamedTuple` now raises an error -instead of silently ignoring other types. diff --git a/Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rs= t b/Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst deleted file mode 100644 index 1120584ecc575..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-04-23-44-09.bpo-40182.Bf_kFN.rst +++ /dev/null @@ -1,2 +0,0 @@ -Removed the ``_field_types`` attribute of the :class:`typing.NamedTuple` -class. diff --git a/Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rs= t b/Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rst deleted file mode 100644 index 58359330e3920..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-05-02-58-17.bpo-40190.HF3OWo.rst +++ /dev/null @@ -1 +0,0 @@ -Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`. diff --git a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rs= t b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst deleted file mode 100644 index c5fbd6e5ff3fb..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bug in the :mod:`symtable` module that was causing incorrectly report -global variables as local. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rs= t b/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst deleted file mode 100644 index a06d5eadf3da8..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-06-20-09-33.bpo-40208.3rO_q7.rst +++ /dev/null @@ -1 +0,0 @@ -Remove deprecated :meth:`symtable.SymbolTable.has_exec`. diff --git a/Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rs= t b/Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst deleted file mode 100644 index dd8ac3b406d3e..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-07-18-06-38.bpo-40149.mMU2iu.rst +++ /dev/null @@ -1 +0,0 @@ -Implement traverse and clear slots in _abc._abc_data type. diff --git a/Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rs= t b/Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst deleted file mode 100644 index 4a98aa50f2371..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-07-23-26-25.bpo-40091.5M9AW5.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a hang at fork in the logging module: the new private _at_fork_reinit() -method is now used to reinitialize locks at fork in the child process. diff --git a/Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rs= t b/Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst deleted file mode 100644 index 3fa82771ded23..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-10-01-24-58.bpo-39207.2dE5Ox.rst +++ /dev/null @@ -1,4 +0,0 @@ -Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are now spawned = on -demand, only when there are no available idle workers to reuse. This optimiz= es -startup overhead and reduces the amount of lost CPU time to idle workers. -Patch by Kyle Stanley. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rs= t b/Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst deleted file mode 100644 index ed7a9f355dbac..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-10-16-13-47.bpo-40234.tar4d_.rst +++ /dev/null @@ -1,2 +0,0 @@ -Allow again to spawn daemon threads in subinterpreters (revert change which -denied them). diff --git a/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rs= t b/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst deleted file mode 100644 index decc073bf4d61..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding com= ments. diff --git a/Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rs= t b/Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst deleted file mode 100644 index 18fbddf2cee73..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-14-11-31-07.bpo-29255.4EcyIN.rst +++ /dev/null @@ -1 +0,0 @@ -Wait in `KqueueSelector.select` when no fds are registered diff --git a/Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rs= t b/Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst deleted file mode 100644 index c23f7c9d37d98..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-14-16-18-49.bpo-40270.XVJzeG.rst +++ /dev/null @@ -1,2 +0,0 @@ -The included copy of sqlite3 on Windows is now compiled with the json -extension. This allows the use of functions such as ``json_object``. diff --git a/Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rs= t b/Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst deleted file mode 100644 index 1fa2999f7f0a4..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-14-21-53-18.bpo-40277.NknSaf.rst +++ /dev/null @@ -1,2 +0,0 @@ -:func:`collections.namedtuple` now provides a human-readable repr for its -field accessors. diff --git a/Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rs= t b/Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst deleted file mode 100644 index 69c9cff10aa99..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-15-00-39-25.bpo-40286.ai80FA.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add :func:`random.randbytes` function and -:meth:`random.Random.randbytes` method to generate random bytes. diff --git a/Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rs= t b/Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst deleted file mode 100644 index 699282a7fb59c..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-15-10-23-52.bpo-40282.rIYJmu.rst +++ /dev/null @@ -1 +0,0 @@ -Allow ``random.getrandbits(0)`` to succeed and to return 0. diff --git a/Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rs= t b/Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst deleted file mode 100644 index a930cee1c8b24..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-15-16-43-48.bpo-40290.eqCMGJ.rst +++ /dev/null @@ -1 +0,0 @@ -Added zscore() to statistics.NormalDist(). diff --git a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rs= t b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst deleted file mode 100644 index d4db192b71076..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed ``SpooledTemporaryFile.seek()`` to return the position. diff --git a/Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rs= t b/Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst deleted file mode 100644 index 52247b2d1a7c1..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-15-19-34-11.bpo-40257.ux8FUr.rst +++ /dev/null @@ -1,5 +0,0 @@ -func:`inspect.getdoc` no longer returns docstring inherited from the type of -the object or from parent class if it is a class if it is not defined in the -object itself. In :mod:`pydoc` the documentation string is now shown not -only for class, function, method etc, but for any object that has its own -``__doc__`` attribute. diff --git a/Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rs= t b/Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst deleted file mode 100644 index 6ed094add1f62..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-18-10-52-15.bpo-40257.lv4WTq.rst +++ /dev/null @@ -1,4 +0,0 @@ -Improved help for the :mod:`typing` module. Docstrings are now shown for all -special forms and special generic aliases (like ``Union`` and ``List``). -Using ``help()`` with generic alias like ``List[int]`` will show the help -for the correspondent concrete type (``list`` in this case). diff --git a/Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rs= t b/Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst deleted file mode 100644 index 3df5fade6676a..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-18-19-40-00.bpo-40325.KWSvix.rst +++ /dev/null @@ -1 +0,0 @@ -Deprecated support for set objects in random.sample(). diff --git a/Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rs= t b/Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst deleted file mode 100644 index 02a5f9d708410..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-19-14-16-43.bpo-40148.pDZR6V.rst +++ /dev/null @@ -1 +0,0 @@ -Added :meth:`pathlib.Path.with_stem()` to create a new Path with the stem re= placed. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rs= t b/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst deleted file mode 100644 index 98cb62f1b115e..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst +++ /dev/null @@ -1,2 +0,0 @@ -In :meth:`ShareableList.__setitem__`, check the size of a new string item -after encoding it to utf-8, not before. diff --git a/Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rs= t b/Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst deleted file mode 100644 index 2093589f528b0..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-20-18-50-25.bpo-40275.Ofk6J8.rst +++ /dev/null @@ -1,2 +0,0 @@ -The :mod:`asyncio` package is now imported lazily in :mod:`unittest` only -when the :class:`~unittest.IsolatedAsyncioTestCase` class is used. diff --git a/Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rs= t b/Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst deleted file mode 100644 index 09e0a97f3ed98..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-20-19-06-55.bpo-40275.9UcN2g.rst +++ /dev/null @@ -1,2 +0,0 @@ -The :mod:`logging` package is now imported lazily in :mod:`unittest` only -when the :meth:`~unittest.TestCase.assertLogs` assertion is used. diff --git a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rs= t b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst deleted file mode 100644 index 3b83037d170f6..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Set "__main__" as the default module name when "__name__" is missing in -:class:`typing.TypeVar`. Patch by Weipeng Hong. diff --git a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rs= t b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst deleted file mode 100644 index ad5faf3865751..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix the Windows implementation of :func:`os.waitpid` for exit code larger th= an -``INT_MAX >> 8``. The exit status is now interpreted as an unsigned number. diff --git a/Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rs= t b/Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst deleted file mode 100644 index 290dd453bd4ad..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-22-20-55-17.bpo-40360.Er8sv-.rst +++ /dev/null @@ -1 +0,0 @@ -The :mod:`lib2to3` module is pending deprecation due to :pep:`617`. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rs= t b/Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst deleted file mode 100644 index e55d5d50bd7e2..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-24-01-27-08.bpo-38061.cdlkMz.rst +++ /dev/null @@ -1,6 +0,0 @@ -On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls ``closefrom(fd_low)= `` -if *fd_high* is greater than or equal to ``sysconf(_SC_OPEN_MAX)``. - -Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) -and Kubilay Kocak (koobs): -https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242274 diff --git a/Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rs= t b/Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst deleted file mode 100644 index 603d80b88b074..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-24-01-55-00.bpo-38061.XmULB3.rst +++ /dev/null @@ -1,11 +0,0 @@ -Optimize the :mod:`subprocess` module on FreeBSD using ``closefrom()``. -A single ``close(fd)`` syscall is cheap, but when ``sysconf(_SC_OPEN_MAX)`` = is -high, the loop calling ``close(fd)`` on each file descriptor can take several -milliseconds. - -The workaround on FreeBSD to improve performance was to load and mount the -fdescfs kernel module, but this is not enabled by default. - -Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans (kevans) = and -Kubilay Kocak (koobs): -https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242274 diff --git a/Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rs= t b/Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rst deleted file mode 100644 index f4273ff19663e..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-26-19-07-40.bpo-40396.Fn-is1.rst +++ /dev/null @@ -1,3 +0,0 @@ -Functions :func:`typing.get_origin`, :func:`typing.get_args` and -:func:`typing.get_type_hints` support now generic aliases like -``list[int]``. diff --git a/Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rs= t b/Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rst deleted file mode 100644 index a56da0c109592..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-26-22-25-36.bpo-40398.OdXnR3.rst +++ /dev/null @@ -1,2 +0,0 @@ -:func:`typing.get_args` now always returns an empty tuple for special -generic aliases. diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.r= st b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst deleted file mode 100644 index 9f2800581ca5e..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst +++ /dev/null @@ -1,5 +0,0 @@ -CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class o= f the -:mod:`urllib.request` module uses an inefficient regular expression which can -be exploited by an attacker to cause a denial of service. Fix the regex to -prevent the catastrophic backtracking. Vulnerability reported by Ben Caller -and Matt Schwager. diff --git a/Misc/NEWS.d/next/Security/2020-03-15-01-28-36.bpo-39073.6Szd3i.r= st b/Misc/NEWS.d/next/Security/2020-03-15-01-28-36.bpo-39073.6Szd3i.rst deleted file mode 100644 index 6c9447b897bf6..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-03-15-01-28-36.bpo-39073.6Szd3i.rst +++ /dev/null @@ -1 +0,0 @@ -Disallow CR or LF in email.headerregistry.Address arguments to guard against= header injection attacks. diff --git a/Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.r= st b/Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.rst deleted file mode 100644 index 5aac6cd8b9959..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.rst +++ /dev/null @@ -1 +0,0 @@ -Fixes audit events raised on creating a new socket. diff --git a/Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst b= /Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst deleted file mode 100644 index 7ffe90d55a4e7..0000000000000 --- a/Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix newline handling in doctest.testfile when loading from a package whose -loader has a get_data method. Patch by Peter Donis. diff --git a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst = b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst deleted file mode 100644 index 6fa0d15ba2fdc..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst +++ /dev/null @@ -1 +0,0 @@ -Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. diff --git a/Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst = b/Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst deleted file mode 100644 index 1ac9ead0eb321..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-03-22-20-00-04.bpo-39380.ZXlRQU.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add the encoding in :class:`ftplib.FTP` and :class:`ftplib.FTP_TLS` to the -constructor as keyword-only and change the default from ``latin-1`` to ``utf= -8`` -to follow :rfc:`2640`. diff --git a/Misc/NEWS.d/next/Tests/2020-03-31-16-07-15.bpo-40003.SOruLY.rst = b/Misc/NEWS.d/next/Tests/2020-03-31-16-07-15.bpo-40003.SOruLY.rst deleted file mode 100644 index 7ddb90121d894..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-03-31-16-07-15.bpo-40003.SOruLY.rst +++ /dev/null @@ -1,3 +0,0 @@ -``test.bisect_cmd`` now copies Python command line options like ``-O`` or -``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used with -``-w``/``--verbose2`` option. diff --git a/Misc/NEWS.d/next/Tests/2020-03-31-18-57-52.bpo-40094.m3fTJe.rst = b/Misc/NEWS.d/next/Tests/2020-03-31-18-57-52.bpo-40094.m3fTJe.rst deleted file mode 100644 index cae001bcb209e..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-03-31-18-57-52.bpo-40094.m3fTJe.rst +++ /dev/null @@ -1 +0,0 @@ -Add :func:`test.support.wait_process` function. diff --git a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst = b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst deleted file mode 100644 index 216925f40e106..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst +++ /dev/null @@ -1 +0,0 @@ -Update OpenSSL to 1.1.1f in Azure Pipelines. diff --git a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst = b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst deleted file mode 100644 index 8d5d0e0871d42..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst +++ /dev/null @@ -1 +0,0 @@ -Update Travis CI configuration to OpenSSL 1.1.1f. diff --git a/Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst = b/Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst deleted file mode 100644 index 0c08ab5631175..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-04-09-16-29-18.bpo-31904.ej348T.rst +++ /dev/null @@ -1 +0,0 @@ -Set expected default encoding in test_c_locale_coercion.py for VxWorks RTOS. diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF= 6.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst deleted file mode 100644 index 042550da8bc7f..0000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2020-04-02-01-22-21.bpo-40094.1XQQF6.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix ``which.py`` script exit code: it now uses -:func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status -into an exit code. diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH1= 0.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst deleted file mode 100644 index 61bd2e3d94aab..0000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed translation of ``#elif`` in Argument Clinic. diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQd= q.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst deleted file mode 100644 index 07d48fd17779e..0000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2020-04-24-21-08-19.bpo-40385.nWIQdq.rst +++ /dev/null @@ -1,2 +0,0 @@ -Removed the checkpyc.py tool. Please see compileall without force mode as a -potential alternative. diff --git a/Misc/NEWS.d/next/Windows/2020-01-24-09-15-41.bpo-8901.hVnhGO.rst= b/Misc/NEWS.d/next/Windows/2020-01-24-09-15-41.bpo-8901.hVnhGO.rst deleted file mode 100644 index 1d452cf26297f..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-01-24-09-15-41.bpo-8901.hVnhGO.rst +++ /dev/null @@ -1 +0,0 @@ -Ignore the Windows registry when the ``-E`` option is used. diff --git a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rs= t b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst deleted file mode 100644 index 0bb874b138b33..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst +++ /dev/null @@ -1 +0,0 @@ -Updates Windows to OpenSSL 1.1.1f diff --git a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst = b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst deleted file mode 100644 index 05c568190e7d8..0000000000000 --- a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst +++ /dev/null @@ -1 +0,0 @@ -Update macOS installer builds to use OpenSSL 1.1.1g. diff --git a/Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst = b/Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst deleted file mode 100644 index 0caf8a0f52434..0000000000000 --- a/Misc/NEWS.d/next/macOS/2020-04-22-03-39-22.bpo-38329.H0a8JV.rst +++ /dev/null @@ -1,4 +0,0 @@ -python.org macOS installers now update the Current version symlink of -/Library/Frameworks/Python.framework/Versions for 3.9 installs. Previously, -Current was only updated for Python 2.x installs. This should make it easier -to embed Python 3 into other macOS applications. diff --git a/README.rst b/README.rst index 6e1d931b6af5c..82303953ecda5 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -This is Python version 3.9.0 alpha 5 +This is Python version 3.9.0 alpha 6 =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=3D=3D=3D=3D=3D =20 .. image:: https://travis-ci.org/python/cpython.svg?branch=3Dmaster From webhook-mailer at python.org Tue Apr 28 20:00:12 2020 From: webhook-mailer at python.org (Miro =?utf-8?q?Hron=C4=8Dok?=) Date: Wed, 29 Apr 2020 00:00:12 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: bpo-40431: Fix syntax typo in turtledemo (GH-19777) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/49f70db83e2c62ad06805927f53f6c3e8f4b= 798e commit: 49f70db83e2c62ad06805927f53f6c3e8f4b798e branch: master author: Miro Hron=C4=8Dok committer: GitHub date: 2020-04-29T02:00:07+02:00 summary: bpo-40431: Fix syntax typo in turtledemo (GH-19777) *** File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275 bg=3D"#d00" if clear =3D=3D NORMAL else"#fca") ^ SyntaxError: invalid string prefix files: A Misc/NEWS.d/next/Tools-Demos/2020-04-29-01-32-17.bpo-40431.B_aEZ0.rst M Lib/turtledemo/__main__.py diff --git a/Lib/turtledemo/__main__.py b/Lib/turtledemo/__main__.py index 17fe9a75e1c5e..12be5098dad27 100755 --- a/Lib/turtledemo/__main__.py +++ b/Lib/turtledemo/__main__.py @@ -272,7 +272,7 @@ def configGUI(self, start, stop, clear, txt=3D"", color= =3D"blue"): self.stop_btn.config(state=3Dstop, bg=3D"#d00" if stop =3D=3D NORMAL else "#fca") self.clear_btn.config(state=3Dclear, - bg=3D"#d00" if clear =3D=3D NORMAL else"#fca") + bg=3D"#d00" if clear =3D=3D NORMAL else "#fca") self.output_lbl.config(text=3Dtxt, fg=3Dcolor) =20 def makeLoadDemoMenu(self, master): diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-29-01-32-17.bpo-40431.B_aEZ= 0.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-29-01-32-17.bpo-40431.B_aEZ0.rst new file mode 100644 index 0000000000000..abef046326fcb --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2020-04-29-01-32-17.bpo-40431.B_aEZ0.rst @@ -0,0 +1 @@ +Fix a syntax typo in ``turtledemo`` that now raises a ``SyntaxError``. From webhook-mailer at python.org Wed Apr 29 18:43:25 2020 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Wed, 29 Apr 2020 22:43:25 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Python 3.8.3rc1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/802eb676bad7a2558fdf35a8ea5882f5e97c= 2ad8 commit: 802eb676bad7a2558fdf35a8ea5882f5e97c2ad8 branch: 3.8 author: =C5=81ukasz Langa committer: =C5=81ukasz Langa date: 2020-04-29T19:21:55+02:00 summary: Python 3.8.3rc1 files: A Misc/NEWS.d/3.8.3rc1.rst D Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst D Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst D Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst D Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst D Misc/NEWS.d/next/C API/2020-02-25-20-10-34.bpo-38913.siF1lS.rst D Misc/NEWS.d/next/C API/2020-03-08-22-56-22.bpo-38643.k2ixx6.rst D Misc/NEWS.d/next/C API/2020-03-12-00-27-26.bpo-39884.CGOJBO.rst D Misc/NEWS.d/next/C API/2020-03-13-16-44-23.bpo-35370.sXRA-r.rst D Misc/NEWS.d/next/Core and Builtins/2018-09-23-16-32-58.bpo-22490.8e0YDf.rst D Misc/NEWS.d/next/Core and Builtins/2020-02-02-00-12-07.bpo-39520.uicBq6.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-02-19-21-21.bpo-39778._YGLEc.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-02-20-12-33.bpo-39776.fNaxi_.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-06-06-12-37.bpo-39871.dCAj_2.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-06-21-04-39.bpo-38894.nfcGKv.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-12-22-13-50.bpo-39562.E2u273.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-15-03-52-01.bpo-39965.Od3ZdP.rst D Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526.NHNZIv.rst D Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst D Misc/NEWS.d/next/Documentation/2020-02-18-14-28-31.bpo-39677.vNHqoX.rst D Misc/NEWS.d/next/Documentation/2020-02-21-22-05-20.bpo-39718.xtBoSi.rst D Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst D Misc/NEWS.d/next/Documentation/2020-02-27-17-35-27.bpo-17422.eS1hVh.rst D Misc/NEWS.d/next/Documentation/2020-02-28-14-39-25.bpo-13790.hvLaRI.rst D Misc/NEWS.d/next/Documentation/2020-03-05-16-29-03.bpo-39868.JQoHhO.rst D Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ7Cv.rst D Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst D Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst D Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst D Misc/NEWS.d/next/IDLE/2020-02-27-22-17-09.bpo-39781.bbYBeL.rst D Misc/NEWS.d/next/IDLE/2020-03-06-01-55-14.bpo-39852.QjA1qF.rst D Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst D Misc/NEWS.d/next/IDLE/2020-03-09-02-45-12.bpo-27115.8hSHMo.rst D Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst D Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst D Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rst D Misc/NEWS.d/next/Library/2019-12-20-16-06-28.bpo-38971.fKRYlF.rst D Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rst D Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst D Misc/NEWS.d/next/Library/2020-02-24-03-45-28.bpo-30566.qROxty.rst D Misc/NEWS.d/next/Library/2020-02-27-18-21-07.bpo-39764.wqPk68.rst D Misc/NEWS.d/next/Library/2020-02-29-11-20-50.bpo-39517.voQZb8.rst D Misc/NEWS.d/next/Library/2020-02-29-13-20-33.bpo-39769.hJmxu4.rst D Misc/NEWS.d/next/Library/2020-02-29-19-17-39.bpo-39794.7VjatS.rst D Misc/NEWS.d/next/Library/2020-03-04-16-10-59.bpo-13487.gqe4Fb.rst D Misc/NEWS.d/next/Library/2020-03-05-00-57-49.bpo-39828.yWq9NJ.rst D Misc/NEWS.d/next/Library/2020-03-09-01-45-06.bpo-39850.eaJNIE.rst D Misc/NEWS.d/next/Library/2020-03-09-18-56-27.bpo-39916.BHHyp3.rst D Misc/NEWS.d/next/Library/2020-03-10-15-32-31.bpo-38662.o1DMXj.rst D Misc/NEWS.d/next/Library/2020-03-10-19-38-47.bpo-39915.CjPeiY.rst D Misc/NEWS.d/next/Library/2020-03-11-23-08-25.bpo-39652.gbasrk.rst D Misc/NEWS.d/next/Library/2020-03-15-05-41-05.bpo-39360.cmcU5p.rst D Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst D Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst D Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst D Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst D Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst D Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst D Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst D Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst D Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst D Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst D Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst D Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst D Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst D Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst D Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.rst D Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst D Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst D Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst D Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst D Misc/NEWS.d/next/Tests/2020-03-18-16-04-33.bpo-27807.9gKjET.rst D Misc/NEWS.d/next/Tests/2020-03-20-00-30-36.bpo-40019.zOqHpQ.rst D Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst D Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst D Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst D Misc/NEWS.d/next/Tools-Demos/2020-03-07-18-01-30.bpo-39889.l1czT6.rst D Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst D Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst D Misc/NEWS.d/next/Windows/2020-02-25-18-43-34.bpo-34803.S3VcS0.rst D Misc/NEWS.d/next/Windows/2020-02-28-22-46-09.bpo-39789.67XRoP.rst D Misc/NEWS.d/next/Windows/2020-02-28-23-51-27.bpo-38380.TpOBCj.rst D Misc/NEWS.d/next/Windows/2020-03-01-15-04-54.bpo-38597.MnHdYl.rst D Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst D Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst D Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst D Misc/NEWS.d/next/macOS/2020-02-28-23-51-47.bpo-38380.u-ySyA.rst D Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.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 affbd82a70976..bc825c0a188b8 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 2 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL -#define PY_RELEASE_SERIAL 0 +#define PY_MICRO_VERSION 3 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA +#define PY_RELEASE_SERIAL 1 =20 /* Version as a string */ -#define PY_VERSION "3.8.2+" +#define PY_VERSION "3.8.3rc1" /*--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 f1fdb7fc8617c..ba068f0b2b9f7 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 Feb 24 21:52:17 2020 +# Autogenerated by Sphinx on Wed Apr 29 19:18:01 2020 topics =3D {'assert': 'The "assert" statement\n' '**********************\n' '\n' @@ -1475,8 +1475,8 @@ ' | starred_and_keywords ["," ' 'keywords_arguments]\n' ' | keywords_arguments\n' - ' positional_arguments ::=3D ["*"] expression ("," ["*"] ' - 'expression)*\n' + ' positional_arguments ::=3D positional_item ("," positional_ite= m)*\n' + ' positional_item ::=3D assignment_expression | "*" express= ion\n' ' starred_and_keywords ::=3D ("*" expression | keyword_item)\n' ' ("," "*" expression | "," ' 'keyword_item)*\n' @@ -1872,9 +1872,9 @@ ' value is false. A counter-intuitive implication is that ' 'not-a-number\n' ' values are not equal to themselves. For example, if "x = =3D\n' - ' float(\'NaN\')", "3 < x", "x < 3", "x =3D=3D x", "x !=3D = x" are ' - 'all false.\n' - ' This behavior is compliant with IEEE 754.\n' + ' float(\'NaN\')", "3 < x", "x < 3" and "x =3D=3D x" are al= l ' + 'false, while "x\n' + ' !=3D x" is true. This behavior is compliant with IEEE 75= 4.\n' '\n' '* "None" and "NotImplemented" are singletons. **PEP 8** ' 'advises\n' @@ -2186,8 +2186,8 @@ '\n' 'The "if" statement is used for conditional execution:\n' '\n' - ' if_stmt ::=3D "if" expression ":" suite\n' - ' ("elif" expression ":" suite)*\n' + ' if_stmt ::=3D "if" assignment_expression ":" suite\n' + ' ("elif" assignment_expression ":" suite)*\n' ' ["else" ":" suite]\n' '\n' 'It selects exactly one of the suites by evaluating the ' @@ -2210,7 +2210,7 @@ 'an\n' 'expression is true:\n' '\n' - ' while_stmt ::=3D "while" expression ":" suite\n' + ' while_stmt ::=3D "while" assignment_expression ":" suite\n' ' ["else" ":" suite]\n' '\n' 'This repeatedly tests the expression and, if it is true, ' @@ -3136,7 +3136,7 @@ '\n' 'When a description of an arithmetic operator below uses the= ' 'phrase\n' - '=E2=80=9Cthe numeric arguments are converted to a common ty= pe,=E2=80=9D this ' + '=E2=80=9Cthe numeric arguments are converted to a common ty= pe=E2=80=9D, this ' 'means\n' 'that the operator implementation for built-in types works a= s ' 'follows:\n' @@ -4402,8 +4402,8 @@ '\n' 'The "if" statement is used for conditional execution:\n' '\n' - ' if_stmt ::=3D "if" expression ":" suite\n' - ' ("elif" expression ":" suite)*\n' + ' if_stmt ::=3D "if" assignment_expression ":" suite\n' + ' ("elif" assignment_expression ":" suite)*\n' ' ["else" ":" suite]\n' '\n' 'It selects exactly one of the suites by evaluating the expressions= ' @@ -4819,7 +4819,7 @@ '[","]\n' ' starred_expression ::=3D expression | (starred_item ",")* ' '[starred_item]\n' - ' starred_item ::=3D expression | "*" or_expr\n' + ' starred_item ::=3D assignment_expression | "*" or_ex= pr\n' '\n' 'Except when part of a list or set display, an expression list= \n' 'containing at least one comma yields a tuple. The length of ' @@ -5129,11 +5129,11 @@ 'only\n' 'supported by the numeric types.\n' '\n' - 'A general convention is that an empty format string (""""= ) ' + 'A general convention is that an empty format specificatio= n ' 'produces\n' 'the same result as if you had called "str()" on the value= . ' 'A non-empty\n' - 'format string typically modifies the result.\n' + 'format specification typically modifies the result.\n' '\n' 'The general form of a *standard format specifier* is:\n' '\n' @@ -5939,19 +5939,18 @@ 'convention.\n' '\n' '"__*__"\n' - ' System-defined names. These names are defined by the ' - 'interpreter\n' - ' and its implementation (including the standard library). = ' - 'Current\n' - ' system names are discussed in the Special method names ' - 'section and\n' - ' elsewhere. More will likely be defined in future version= s ' - 'of\n' - ' Python. *Any* use of "__*__" names, in any context, that= ' - 'does not\n' - ' follow explicitly documented use, is subject to breakage ' - 'without\n' - ' warning.\n' + ' System-defined names, informally known as =E2=80=9Cdunder= =E2=80=9D names. ' + 'These\n' + ' names are defined by the interpreter and its ' + 'implementation\n' + ' (including the standard library). Current system names ar= e\n' + ' discussed in the Special method names section and ' + 'elsewhere. More\n' + ' will likely be defined in future versions of Python. *An= y* ' + 'use of\n' + ' "__*__" names, in any context, that does not follow ' + 'explicitly\n' + ' documented use, is subject to breakage without warning.\n' '\n' '"__*"\n' ' Class-private names. Names in this category, when used ' @@ -6087,19 +6086,19 @@ 'convention.\n' '\n' '"__*__"\n' - ' System-defined names. These names are defined by the ' - 'interpreter\n' - ' and its implementation (including the standard library).= ' - 'Current\n' - ' system names are discussed in the Special method names ' - 'section and\n' - ' elsewhere. More will likely be defined in future versio= ns ' - 'of\n' - ' Python. *Any* use of "__*__" names, in any context, tha= t ' - 'does not\n' - ' follow explicitly documented use, is subject to breakage= ' - 'without\n' - ' warning.\n' + ' System-defined names, informally known as =E2=80=9Cdunde= r=E2=80=9D names. ' + 'These\n' + ' names are defined by the interpreter and its ' + 'implementation\n' + ' (including the standard library). Current system names ' + 'are\n' + ' discussed in the Special method names section and ' + 'elsewhere. More\n' + ' will likely be defined in future versions of Python. ' + '*Any* use of\n' + ' "__*__" names, in any context, that does not follow ' + 'explicitly\n' + ' documented use, is subject to breakage without warning.\= n' '\n' '"__*"\n' ' Class-private names. Names in this category, when used ' @@ -6114,8 +6113,8 @@ '\n' 'The "if" statement is used for conditional execution:\n' '\n' - ' if_stmt ::=3D "if" expression ":" suite\n' - ' ("elif" expression ":" suite)*\n' + ' if_stmt ::=3D "if" assignment_expression ":" suite\n' + ' ("elif" assignment_expression ":" suite)*\n' ' ["else" ":" suite]\n' '\n' 'It selects exactly one of the suites by evaluating the expressions ' @@ -6984,7 +6983,7 @@ 'program is represented by objects or by relations between ' 'objects. (In\n' 'a sense, and in conformance to Von Neumann=E2=80=99s model of a= =E2=80=9Cstored\n' - 'program computer,=E2=80=9D code is also represented by objects.= )\n' + 'program computer=E2=80=9D, code is also represented by objects.= )\n' '\n' 'Every object has an identity, a type and a value. An object=E2= =80=99s\n' '*identity* never changes once it has been created; you may thin= k ' @@ -9012,7 +9011,7 @@ '\n' 'If the metaclass has no "__prepare__" attribute, then the ' 'class\n' - 'namespace is initialised as an empty "dict()".\n' + 'namespace is initialised as an empty ordered mapping.\n' '\n' 'See also:\n' '\n' @@ -11432,6 +11431,16 @@ ' then they can be used interchangeably to index the same\n' ' dictionary entry.\n' '\n' + ' Dictionaries preserve insertion order, meaning that keys wi= ll ' + 'be\n' + ' produced in the same order they were added sequentially ove= r ' + 'the\n' + ' dictionary. Replacing an existing key does not change the ' + 'order,\n' + ' however removing a key and re-inserting it will add it to ' + 'the\n' + ' end instead of keeping its old place.\n' + '\n' ' Dictionaries are mutable; they can be created by the "{...}= "\n' ' notation (see section Dictionary displays).\n' '\n' @@ -11440,6 +11449,13 @@ '"collections"\n' ' module.\n' '\n' + ' Changed in version 3.7: Dictionaries did not preserve ' + 'insertion\n' + ' order in versions of Python before 3.6. In CPython 3.6,\n' + ' insertion order was preserved, but it was considered an\n' + ' implementation detail at that time rather than a language\n' + ' guarantee.\n' + '\n' 'Callable types\n' ' These are the types to which the function call operation (see\= n' ' section Calls) can be applied:\n' @@ -13589,7 +13605,7 @@ 'The "while" statement is used for repeated execution as long as a= n\n' 'expression is true:\n' '\n' - ' while_stmt ::=3D "while" expression ":" suite\n' + ' while_stmt ::=3D "while" assignment_expression ":" suite\n' ' ["else" ":" suite]\n' '\n' 'This repeatedly tests the expression and, if it is true, executes= ' diff --git a/Misc/NEWS.d/3.8.3rc1.rst b/Misc/NEWS.d/3.8.3rc1.rst new file mode 100644 index 0000000000000..f07bf9072bd61 --- /dev/null +++ b/Misc/NEWS.d/3.8.3rc1.rst @@ -0,0 +1,884 @@ +.. bpo: 40121 +.. date: 2020-03-30-23-16-25 +.. nonce: p2LIio +.. release date: 2020-04-29 +.. section: Security + +Fixes audit events raised on creating a new socket. + +.. + +.. bpo: 38576 +.. date: 2020-03-14-14-57-44 +.. nonce: OowwQn +.. section: Security + +Disallow control characters in hostnames in http.client, addressing +CVE-2019-18348. Such potentially malicious header injection URLs now cause a +InvalidURL to be raised. + +.. + +.. bpo: 39503 +.. date: 2020-01-30-16-15-29 +.. nonce: B299Yq +.. section: Security + +CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class +of the :mod:`urllib.request` module uses an inefficient regular expression +which can be exploited by an attacker to cause a denial of service. Fix the +regex to prevent the catastrophic backtracking. Vulnerability reported by +Ben Caller and Matt Schwager. + +.. + +.. bpo: 20526 +.. date: 2020-03-23-18-08-34 +.. nonce: NHNZIv +.. section: Core and Builtins + +Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is a borrowed +reference, not a strong reference: ``PyThreadState_Clear()`` must not call +``Py_CLEAR(tstate->frame)``. + +.. + +.. bpo: 39965 +.. date: 2020-03-15-03-52-01 +.. nonce: Od3ZdP +.. section: Core and Builtins + +Correctly raise ``SyntaxError`` if *await* is used inside non-async +functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the asyncio +REPL). Patch by Pablo Galindo. + +.. + +.. bpo: 39562 +.. date: 2020-03-12-22-13-50 +.. nonce: E2u273 +.. section: Core and Builtins + +Allow executing asynchronous comprehensions on the top level when the +``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan Taskaya. + +.. + +.. bpo: 38894 +.. date: 2020-03-06-21-04-39 +.. nonce: nfcGKv +.. section: Core and Builtins + +Fix a bug that was causing incomplete results when calling +``pathlib.Path.glob`` in the presence of symlinks that point to files where +the user does not have read access. Patch by Pablo Galindo and Matt +Wozniski. + +.. + +.. bpo: 39871 +.. date: 2020-03-06-06-12-37 +.. nonce: dCAj_2 +.. section: Core and Builtins + +Fix a possible :exc:`SystemError` in ``math.{atan2,copysign,remainder}()`` +when the first argument cannot be converted to a :class:`float`. Patch by +Zachary Spytz. + +.. + +.. bpo: 39776 +.. date: 2020-03-02-20-12-33 +.. nonce: fNaxi_ +.. section: Core and Builtins + +Fix race condition where threads created by PyGILState_Ensure() could get a +duplicate id. + +This affects consumers of tstate->id like the contextvar caching machinery, +which could return invalid cached objects under heavy thread load (observed +in embedded scenarios). + +.. + +.. bpo: 39778 +.. date: 2020-03-02-19-21-21 +.. nonce: _YGLEc +.. section: Core and Builtins + +Fixed a crash due to incorrect handling of weak references in +``collections.OrderedDict`` classes. Patch by Pablo Galindo. + +.. + +.. bpo: 39520 +.. date: 2020-02-02-00-12-07 +.. nonce: uicBq6 +.. section: Core and Builtins + +Fix unparsing of ext slices with no items (``foo[:,]``). Patch by Batuhan +Taskaya. + +.. + +.. bpo: 22490 +.. date: 2018-09-23-16-32-58 +.. nonce: 8e0YDf +.. section: Core and Builtins + +Don't leak environment variable ``__PYVENV_LAUNCHER__`` into the interpreter +session on macOS. + +.. + +.. bpo: 40138 +.. date: 2020-04-22-00-05-10 +.. nonce: i_oGqa +.. section: Library + +Fix the Windows implementation of :func:`os.waitpid` for exit code larger +than ``INT_MAX >> 8``. The exit status is now interpreted as an unsigned +number. + +.. + +.. bpo: 39942 +.. date: 2020-04-20-20-16-02 +.. nonce: NvGnTc +.. section: Library + +Set "__main__" as the default module name when "__name__" is missing in +:class:`typing.TypeVar`. Patch by Weipeng Hong. + +.. + +.. bpo: 40330 +.. date: 2020-04-19-17-31-29 +.. nonce: DGjoIS +.. section: Library + +In :meth:`ShareableList.__setitem__`, check the size of a new string item +after encoding it to utf-8, not before. + +.. + +.. bpo: 40287 +.. date: 2020-04-15-17-21-48 +.. nonce: -mkEJH +.. section: Library + +Fixed ``SpooledTemporaryFile.seek()`` to return the position. + +.. + +.. bpo: 40260 +.. date: 2020-04-12-21-18-56 +.. nonce: F6VWaE +.. section: Library + +Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding +comments. + +.. + +.. bpo: 40196 +.. date: 2020-04-06-11-05-13 +.. nonce: Jqowse +.. section: Library + +Fix a bug in the :mod:`symtable` module that was causing incorrectly report +global variables as local. Patch by Pablo Galindo. + +.. + +.. bpo: 40126 +.. date: 2020-04-04-00-47-40 +.. nonce: Y-bTNP +.. section: Library + +Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` +is now never called if its ``__enter__()`` is failed. Returning true from +``__exit__()`` silences now the exception. + +.. + +.. bpo: 40089 +.. date: 2020-03-27-17-22-34 +.. nonce: -lFsD0 +.. section: Library + +Fix threading._after_fork(): if fork was not called by a thread spawned by +threading.Thread, threading._after_fork() now creates a _MainThread instance +for _main_thread, instead of a _DummyThread instance. + +.. + +.. bpo: 39503 +.. date: 2020-03-25-16-02-16 +.. nonce: YmMbYn +.. section: Library + +:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` +now parses all WWW-Authenticate HTTP headers and accepts multiple challenges +per header: use the realm of the first Basic challenge. + +.. + +.. bpo: 40014 +.. date: 2020-03-23-17-52-00 +.. nonce: Ya70VG +.. section: Library + +Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails because the +group list is too small, retry with a larger group list. On failure, the +glibc implementation of ``getgrouplist()`` sets ``ngroups`` to the total +number of groups. For other implementations, double the group list size. + +.. + +.. bpo: 40016 +.. date: 2020-03-19-19-40-27 +.. nonce: JWtxqJ +.. section: Library + +In re docstring, clarify the relationship between inline and argument +compile flags. + +.. + +.. bpo: 39953 +.. date: 2020-03-19-16-33-03 +.. nonce: yy5lC_ +.. section: Library + +Update internal table of OpenSSL error codes in the ``ssl`` module. + +.. + +.. bpo: 39360 +.. date: 2020-03-15-05-41-05 +.. nonce: cmcU5p +.. section: Library + +Ensure all workers exit when finalizing a :class:`multiprocessing.Pool` +implicitly via the module finalization handlers of multiprocessing. This +fixes a deadlock situation that can be experienced when the Pool is not +properly finalized via the context manager or a call to +``multiprocessing.Pool.terminate``. Patch by Batuhan Taskaya and Pablo +Galindo. + +.. + +.. bpo: 39652 +.. date: 2020-03-11-23-08-25 +.. nonce: gbasrk +.. section: Library + +The column name found in ``sqlite3.Cursor.description`` is now truncated on +the first '[' only if the PARSE_COLNAMES option is set. + +.. + +.. bpo: 39915 +.. date: 2020-03-10-19-38-47 +.. nonce: CjPeiY +.. section: Library + +Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call objects in +the order of awaited arguments instead of using +:attr:`unittest.mock.Mock.call_args` which has the last value of the call. +Patch by Karthikeyan Singaravelan. + +.. + +.. bpo: 38662 +.. date: 2020-03-10-15-32-31 +.. nonce: o1DMXj +.. section: Library + +The ``ensurepip`` module now invokes ``pip`` via the ``runpy`` module. Hence +it is no longer tightly coupled with the internal API of the bundled ``pip`` +version, allowing easier updates to a newer ``pip`` version both internally +and for distributors. + +.. + +.. bpo: 39916 +.. date: 2020-03-09-18-56-27 +.. nonce: BHHyp3 +.. section: Library + +More reliable use of ``os.scandir()`` in ``Path.glob()``. It no longer emits +a ResourceWarning when interrupted. + +.. + +.. bpo: 39850 +.. date: 2020-03-09-01-45-06 +.. nonce: eaJNIE +.. section: Library + +:mod:`multiprocessing` now supports abstract socket addresses (if abstract +sockets are supported in the running platform). Patch by Pablo Galindo. + +.. + +.. bpo: 39828 +.. date: 2020-03-05-00-57-49 +.. nonce: yWq9NJ +.. section: Library + +Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by Dong-hee Na. + +.. + +.. bpo: 13487 +.. date: 2020-03-04-16-10-59 +.. nonce: gqe4Fb +.. section: Library + +Avoid a possible *"RuntimeError: dictionary changed size during iteration"* +from :func:`inspect.getmodule` when it tried to loop through +:attr:`sys.modules`. + +.. + +.. bpo: 39794 +.. date: 2020-02-29-19-17-39 +.. nonce: 7VjatS +.. section: Library + +Add --without-decimal-contextvar build option. This enables a thread-local +rather than a coroutine local context. + +.. + +.. bpo: 39769 +.. date: 2020-02-29-13-20-33 +.. nonce: hJmxu4 +.. section: Library + +The :func:`compileall.compile_dir` function's *ddir* parameter and the +compileall command line flag `-d` no longer write the wrong pathname to the +generated pyc file for submodules beneath the root of the directory tree +being compiled. This fixes a regression introduced with Python 3.5. + +.. + +.. bpo: 39517 +.. date: 2020-02-29-11-20-50 +.. nonce: voQZb8 +.. section: Library + +Fix runpy.run_path() when using pathlike objects + +.. + +.. bpo: 39764 +.. date: 2020-02-27-18-21-07 +.. nonce: wqPk68 +.. section: Library + +Fix AttributeError when calling get_stack on a PyAsyncGenObject Task + +.. + +.. bpo: 30566 +.. date: 2020-02-24-03-45-28 +.. nonce: qROxty +.. section: Library + +Fix :exc:`IndexError` when trying to decode an invalid string with punycode +codec. + +.. + +.. bpo: 39667 +.. date: 2020-02-17-22-38-15 +.. nonce: QuzEHH +.. section: Library + +Correct performance degradation in ``zipfile.Path`` as found in zipp 3.0. +While retaining compatibility, this change discourages the use of +``zipfile.Path.open`` due to the signature change in Python 3.9. For +compatibility across Python 3.8 and later versions, consider using +``zipp.Path`` on Python 3.8.x and earlier. + +.. + +.. bpo: 39548 +.. date: 2020-02-06-05-33-52 +.. nonce: DF4FFe +.. section: Library + +Fix handling of header in :class:`urllib.request.AbstractDigestAuthHandler` +when the optional ``qop`` parameter is not present. + +.. + +.. bpo: 38971 +.. date: 2019-12-20-16-06-28 +.. nonce: fKRYlF +.. section: Library + +Open issue in the BPO indicated a desire to make the implementation of +codecs.open() at parity with io.open(), which implements a try/except to +assure file stream gets closed before an exception is raised. + +.. + +.. bpo: 38410 +.. date: 2019-10-09-08-14-25 +.. nonce: _YyoMV +.. section: Library + +Properly handle :func:`sys.audit` failures in +:func:`sys.set_asyncgen_hooks`. Based on patch by Zackery Spytz. + +.. + +.. bpo: 36541 +.. date: 2019-06-18-19-38-27 +.. nonce: XI8mi1 +.. section: Library + +lib2to3 now recognizes named assignment expressions (the walrus operator, +``:=3D``) + +.. + +.. bpo: 31758 +.. date: 2017-10-14-21-02-40 +.. nonce: 563ZZb +.. section: Library + +Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` +object. Patch by Oren Milman. + +.. + +.. bpo: 27635 +.. date: 2020-04-01-00-27-03 +.. nonce: VwxUty +.. section: Documentation + +The pickle documentation incorrectly claimed that ``__new__`` isn't called +by default when unpickling. + +.. + +.. bpo: 39879 +.. date: 2020-03-16-18-12-02 +.. nonce: CnQ7Cv +.. section: Documentation + +Updated :ref:`datamodel` docs to include :func:`dict` insertion order +preservation. Patch by Furkan Onder and Samy Lahfa. + +.. + +.. bpo: 39868 +.. date: 2020-03-05-16-29-03 +.. nonce: JQoHhO +.. section: Documentation + +Updated the Language Reference for :pep:`572`. + +.. + +.. bpo: 13790 +.. date: 2020-02-28-14-39-25 +.. nonce: hvLaRI +.. section: Documentation + +Change 'string' to 'specification' in format doc. + +.. + +.. bpo: 17422 +.. date: 2020-02-27-17-35-27 +.. nonce: eS1hVh +.. section: Documentation + +The language reference no longer restricts default class namespaces to dicts +only. + +.. + +.. bpo: 39530 +.. date: 2020-02-23-13-26-40 +.. nonce: _bCvzQ +.. section: Documentation + +Fix misleading documentation about mixed-type numeric comparisons. + +.. + +.. bpo: 39718 +.. date: 2020-02-21-22-05-20 +.. nonce: xtBoSi +.. section: Documentation + +Update :mod:`token` documentation to reflect additions in Python 3.8 + +.. + +.. bpo: 39677 +.. date: 2020-02-18-14-28-31 +.. nonce: vNHqoX +.. section: Documentation + +Changed operand name of **MAKE_FUNCTION** from *argc* to *flags* for module +:mod:`dis` + +.. + +.. bpo: 38387 +.. date: 2019-10-06-23-44-15 +.. nonce: fZoq0S +.. section: Documentation + +Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. + +.. + +.. bpo: 40436 +.. date: 2020-04-29-16-08-24 +.. nonce: gDMnYl +.. section: Tests + +test_gdb and test.pythoninfo now check gdb command exit code. + +.. + +.. bpo: 40162 +.. date: 2020-04-03-02-40-16 +.. nonce: v3pQW_ +.. section: Tests + +Update Travis CI configuration to OpenSSL 1.1.1f. + +.. + +.. bpo: 40146 +.. date: 2020-04-02-02-14-37 +.. nonce: J-Yo9G +.. section: Tests + +Update OpenSSL to 1.1.1f in Azure Pipelines. + +.. + +.. bpo: 40019 +.. date: 2020-03-20-00-30-36 +.. nonce: zOqHpQ +.. section: Tests + +test_gdb now skips tests if it detects that gdb failed to read debug +information because the Python binary is optimized. + +.. + +.. bpo: 27807 +.. date: 2020-03-18-16-04-33 +.. nonce: 9gKjET +.. section: Tests + +``test_site.test_startup_imports()`` is now skipped if a path of +:data:`sys.path` contains a ``.pth`` file. + +.. + +.. bpo: 39793 +.. date: 2020-02-29-12-58-17 +.. nonce: Og2SUN +.. section: Tests + +Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. + +.. + +.. bpo: 1812 +.. date: 2019-11-25-21-46-47 +.. nonce: sAbTbY +.. section: Tests + +Fix newline handling in doctest.testfile when loading from a package whose +loader has a get_data method. Patch by Peter Donis. + +.. + +.. bpo: 37957 +.. date: 2019-10-30-00-01-43 +.. nonce: X1r78F +.. section: Tests + +test.regrtest now can receive a list of test patterns to ignore (using the +-i/--ignore argument) or a file with a list of patterns to ignore (using the +--ignore-file argument). Patch by Pablo Galindo. + +.. + +.. bpo: 38502 +.. date: 2019-10-17-00-49-38 +.. nonce: vUEic7 +.. section: Tests + +test.regrtest now uses process groups in the multiprocessing mode (-jN +command line option) if process groups are available: if :func:`os.setsid` +and :func:`os.killpg` functions are available. + +.. + +.. bpo: 38360 +.. date: 2020-04-22-02-33-54 +.. nonce: 74C68u +.. section: Build + +Support single-argument form of macOS -isysroot flag. + +.. + +.. bpo: 40204 +.. date: 2020-04-09-00-19-10 +.. nonce: K-S6RZ +.. section: Build + +Pin Sphinx version to 1.8.2 in ``Doc/Makefile``. + +.. + +.. bpo: 40158 +.. date: 2020-04-03-17-54-33 +.. nonce: MWUTs4 +.. section: Build + +Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) + +.. + +.. bpo: 38527 +.. date: 2020-03-28-10-43-09 +.. nonce: fqCRgD +.. section: Build + +Fix configure check on Solaris for "float word ordering": sometimes, the +correct "grep" command was not being used. Patch by Arnon Yaari. + +.. + +.. bpo: 40164 +.. date: 2020-04-04-13-13-44 +.. nonce: SPrSn5 +.. section: Windows + +Updates Windows to OpenSSL 1.1.1f + +.. + +.. bpo: 39930 +.. date: 2020-03-11-10-15-56 +.. nonce: LGHw1j +.. section: Windows + +Ensures the required :file:`vcruntime140.dll` is included in install +packages. + +.. + +.. bpo: 39847 +.. date: 2020-03-04-17-05-11 +.. nonce: C3N2m3 +.. section: Windows + +Avoid hang when computer is hibernated whilst waiting for a mutex (for +lock-related objects from :mod:`threading`) around 49-day uptime. + +.. + +.. bpo: 38597 +.. date: 2020-03-01-15-04-54 +.. nonce: MnHdYl +.. section: Windows + +:mod:`distutils` will no longer statically link :file:`vcruntime140.dll` +when a redistributable version is unavailable. All future releases of +CPython will include a copy of this DLL to ensure distributed extensions can +continue to load. + +.. + +.. bpo: 38380 +.. date: 2020-02-28-23-51-27 +.. nonce: TpOBCj +.. section: Windows + +Update Windows builds to use SQLite 3.31.1 + +.. + +.. bpo: 39789 +.. date: 2020-02-28-22-46-09 +.. nonce: 67XRoP +.. section: Windows + +Update Windows release build machines to Visual Studio 2019 (MSVC 14.2). + +.. + +.. bpo: 34803 +.. date: 2020-02-25-18-43-34 +.. nonce: S3VcS0 +.. section: Windows + +Package for nuget.org now includes repository reference and bundled icon +image. + +.. + +.. bpo: 40164 +.. date: 2020-04-21-19-46-35 +.. nonce: 6HA6IC +.. section: macOS + +Update macOS installer builds to use OpenSSL 1.1.1g. + +.. + +.. bpo: 38380 +.. date: 2020-02-28-23-51-47 +.. nonce: u-ySyA +.. section: macOS + +Update macOS builds to use SQLite 3.31.1 + +.. + +.. bpo: 27115 +.. date: 2020-03-09-02-45-12 +.. nonce: 8hSHMo +.. section: IDLE + +For 'Go to Line', use a Query box subclass with IDLE standard behavior and +improved error checking. + +.. + +.. bpo: 39885 +.. date: 2020-03-08-14-27-36 +.. nonce: 29ERiR +.. section: IDLE + +Since clicking to get an IDLE context menu moves the cursor, any text +selection should be and now is cleared. + +.. + +.. bpo: 39852 +.. date: 2020-03-06-01-55-14 +.. nonce: QjA1qF +.. section: IDLE + +Edit "Go to line" now clears any selection, preventing accidental deletion. +It also updates Ln and Col on the status bar. + +.. + +.. bpo: 39781 +.. date: 2020-02-27-22-17-09 +.. nonce: bbYBeL +.. section: IDLE + +Selecting code context lines no longer causes a jump. + +.. + +.. bpo: 38439 +.. date: 2019-12-05-14-20-53 +.. nonce: j_L2PI +.. section: IDLE + +Add a 256=C3=97256 pixel IDLE icon to support more modern environments. Crea= ted +by Andrew Clover. Delete the unused macOS idle.icns icon file. + +.. + +.. bpo: 38689 +.. date: 2019-11-14-12-59-19 +.. nonce: Lgfxva +.. section: IDLE + +IDLE will no longer freeze when inspect.signature fails when fetching a +calltip. + +.. + +.. bpo: 40179 +.. date: 2020-04-04-19-35-22 +.. nonce: u9FH10 +.. section: Tools/Demos + +Fixed translation of ``#elif`` in Argument Clinic. + +.. + +.. bpo: 36184 +.. date: 2020-03-09-13-28-13 +.. nonce: BMPJ0D +.. section: Tools/Demos + +Port python-gdb.py to FreeBSD. python-gdb.py now checks for "take_gil" +function name to check if a frame tries to acquire the GIL, instead of +checking for "pthread_cond_timedwait" which is specific to Linux and can be +a different condition than the GIL. + +.. + +.. bpo: 39889 +.. date: 2020-03-07-18-01-30 +.. nonce: l1czT6 +.. section: Tools/Demos + +Fixed ``unparse.py`` for extended slices containing a single element (e.g. +``a[i:j,]``). Remove redundant tuples when index with a tuple (e.g. ``a[i, +j]``). + +.. + +.. bpo: 35370 +.. date: 2020-03-13-16-44-23 +.. nonce: sXRA-r +.. section: C API + +If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile` or +:c:func:`PyEval_SetTrace`, log the error as an unraisable exception. + +.. + +.. bpo: 39884 +.. date: 2020-03-12-00-27-26 +.. nonce: CGOJBO +.. section: C API + +:c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now include the +method name in the SystemError "bad call flags" error message to ease debug. + +.. + +.. bpo: 38643 +.. date: 2020-03-08-22-56-22 +.. nonce: k2ixx6 +.. section: C API + +:c:func:`PyNumber_ToBase` now raises a :exc:`SystemError` instead of +crashing when called with invalid base. + +.. + +.. bpo: 38913 +.. date: 2020-02-25-20-10-34 +.. nonce: siF1lS +.. section: C API + +Fixed segfault in ``Py_BuildValue()`` called with a format containing "#" +and undefined PY_SSIZE_T_CLEAN whwn an exception is set. diff --git a/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst = b/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst deleted file mode 100644 index 869693095e49a..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-03-28-10-43-09.bpo-38527.fqCRgD.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix configure check on Solaris for "float word ordering": sometimes, the cor= rect "grep" command was not being used. -Patch by Arnon Yaari. diff --git a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst = b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst deleted file mode 100644 index a81548c3f9cdf..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst +++ /dev/null @@ -1 +0,0 @@ -Fix CPython MSBuild Properties in NuGet Package (build/native/python.props) \ No newline at end of file diff --git a/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst = b/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst deleted file mode 100644 index e08f36f03cb5a..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-04-09-00-19-10.bpo-40204.K-S6RZ.rst +++ /dev/null @@ -1 +0,0 @@ -Pin Sphinx version to 1.8.2 in ``Doc/Makefile``. diff --git a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst = b/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst deleted file mode 100644 index e96ca14919919..0000000000000 --- a/Misc/NEWS.d/next/Build/2020-04-22-02-33-54.bpo-38360.74C68u.rst +++ /dev/null @@ -1 +0,0 @@ -Support single-argument form of macOS -isysroot flag. diff --git a/Misc/NEWS.d/next/C API/2020-02-25-20-10-34.bpo-38913.siF1lS.rst = b/Misc/NEWS.d/next/C API/2020-02-25-20-10-34.bpo-38913.siF1lS.rst deleted file mode 100644 index 0e4d1210315d8..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-02-25-20-10-34.bpo-38913.siF1lS.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Fixed segfault in ``Py_BuildValue()`` called with a format containing "#" -and undefined PY_SSIZE_T_CLEAN whwn an exception is set. diff --git a/Misc/NEWS.d/next/C API/2020-03-08-22-56-22.bpo-38643.k2ixx6.rst = b/Misc/NEWS.d/next/C API/2020-03-08-22-56-22.bpo-38643.k2ixx6.rst deleted file mode 100644 index 1e6472fd5578f..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-03-08-22-56-22.bpo-38643.k2ixx6.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -:c:func:`PyNumber_ToBase` now raises a :exc:`SystemError` instead of -crashing when called with invalid base. diff --git a/Misc/NEWS.d/next/C API/2020-03-12-00-27-26.bpo-39884.CGOJBO.rst = b/Misc/NEWS.d/next/C API/2020-03-12-00-27-26.bpo-39884.CGOJBO.rst deleted file mode 100644 index c65dfdc21244a..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-03-12-00-27-26.bpo-39884.CGOJBO.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -:c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now include the -method name in the SystemError "bad call flags" error message to ease debug. diff --git a/Misc/NEWS.d/next/C API/2020-03-13-16-44-23.bpo-35370.sXRA-r.rst = b/Misc/NEWS.d/next/C API/2020-03-13-16-44-23.bpo-35370.sXRA-r.rst deleted file mode 100644 index d3f1d293b6938..0000000000000 --- a/Misc/NEWS.d/next/C API/2020-03-13-16-44-23.bpo-35370.sXRA-r.rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile` or -:c:func:`PyEval_SetTrace`, log the error as an unraisable exception. diff --git a/Misc/NEWS.d/next/Core and Builtins/2018-09-23-16-32-58.bpo-22490= .8e0YDf.rst b/Misc/NEWS.d/next/Core and Builtins/2018-09-23-16-32-58.bpo-2249= 0.8e0YDf.rst deleted file mode 100644 index a281f024249f5..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2018-09-23-16-32-58.bpo-22490.8e0YDf= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Don't leak environment variable ``__PYVENV_LAUNCHER__`` into the interpreter -session on macOS. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-02-02-00-12-07.bpo-39520= .uicBq6.rst b/Misc/NEWS.d/next/Core and Builtins/2020-02-02-00-12-07.bpo-3952= 0.uicBq6.rst deleted file mode 100644 index dec67656fa849..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-02-02-00-12-07.bpo-39520.uicBq6= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Fix unparsing of ext slices with no items (``foo[:,]``). Patch by Batuhan -Taskaya. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-02-19-21-21.bpo-39778= ._YGLEc.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-02-19-21-21.bpo-3977= 8._YGLEc.rst deleted file mode 100644 index dc49512167365..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-02-19-21-21.bpo-39778._YGLEc= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Fixed a crash due to incorrect handling of weak references in -``collections.OrderedDict`` classes. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-02-20-12-33.bpo-39776= .fNaxi_.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-02-20-12-33.bpo-3977= 6.fNaxi_.rst deleted file mode 100644 index e5a00bd96ae47..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-02-20-12-33.bpo-39776.fNaxi_= .rst=09 +++ /dev/null @@ -1,6 +0,0 @@ -Fix race condition where threads created by PyGILState_Ensure() could get a -duplicate id. - -This affects consumers of tstate->id like the contextvar caching machinery, -which could return invalid cached objects under heavy thread load (observed -in embedded scenarios). diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-06-06-12-37.bpo-39871= .dCAj_2.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-06-06-12-37.bpo-3987= 1.dCAj_2.rst deleted file mode 100644 index 0b4c2e5f4cc92..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-06-06-12-37.bpo-39871.dCAj_2= .rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Fix a possible :exc:`SystemError` in ``math.{atan2,copysign,remainder}()`` -when the first argument cannot be converted to a :class:`float`. Patch by -Zachary Spytz. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-06-21-04-39.bpo-38894= .nfcGKv.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-06-21-04-39.bpo-3889= 4.nfcGKv.rst deleted file mode 100644 index a937b8ecc626f..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-06-21-04-39.bpo-38894.nfcGKv= .rst=09 +++ /dev/null @@ -1,4 +0,0 @@ -Fix a bug that was causing incomplete results when calling -``pathlib.Path.glob`` in the presence of symlinks that point -to files where the user does not have read access. Patch by Pablo -Galindo and Matt Wozniski. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-12-22-13-50.bpo-39562= .E2u273.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-12-22-13-50.bpo-3956= 2.E2u273.rst deleted file mode 100644 index dbe83c6aa19f9..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-12-22-13-50.bpo-39562.E2u273= .rst=09 +++ /dev/null @@ -1,2 +0,0 @@ -Allow executing asynchronous comprehensions on the top level when the -``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan Taskaya. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-15-03-52-01.bpo-39965= .Od3ZdP.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-15-03-52-01.bpo-3996= 5.Od3ZdP.rst deleted file mode 100644 index 4e3ac7ce7d681..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-15-03-52-01.bpo-39965.Od3ZdP= .rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Correctly raise ``SyntaxError`` if *await* is used inside non-async -functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the asyncio -REPL). Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526= .NHNZIv.rst b/Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-2052= 6.NHNZIv.rst deleted file mode 100644 index c808b7608c61e..0000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-03-23-18-08-34.bpo-20526.NHNZIv= .rst=09 +++ /dev/null @@ -1,3 +0,0 @@ -Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is a borrowed -reference, not a strong reference: ``PyThreadState_Clear()`` must not call -``Py_CLEAR(tstate->frame)``. diff --git a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZo= q0S.rst b/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S= .rst deleted file mode 100644 index a678fe5052673..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2019-10-06-23-44-15.bpo-38387.fZoq0S.rst +++ /dev/null @@ -1 +0,0 @@ -Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference. diff --git a/Misc/NEWS.d/next/Documentation/2020-02-18-14-28-31.bpo-39677.vNH= qoX.rst b/Misc/NEWS.d/next/Documentation/2020-02-18-14-28-31.bpo-39677.vNHqoX= .rst deleted file mode 100644 index 3678a721fc6d7..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-02-18-14-28-31.bpo-39677.vNHqoX.rst +++ /dev/null @@ -1 +0,0 @@ -Changed operand name of **MAKE_FUNCTION** from *argc* to *flags* for module = :mod:`dis` diff --git a/Misc/NEWS.d/next/Documentation/2020-02-21-22-05-20.bpo-39718.xtB= oSi.rst b/Misc/NEWS.d/next/Documentation/2020-02-21-22-05-20.bpo-39718.xtBoSi= .rst deleted file mode 100644 index 8072f617192b4..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-02-21-22-05-20.bpo-39718.xtBoSi.rst +++ /dev/null @@ -1 +0,0 @@ -Update :mod:`token` documentation to reflect additions in Python 3.8 \ No newline at end of file diff --git a/Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bC= vzQ.rst b/Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ= .rst deleted file mode 100644 index b7a02522bbb1c..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-02-23-13-26-40.bpo-39530._bCvzQ.rst +++ /dev/null @@ -1 +0,0 @@ -Fix misleading documentation about mixed-type numeric comparisons. diff --git a/Misc/NEWS.d/next/Documentation/2020-02-27-17-35-27.bpo-17422.eS1= hVh.rst b/Misc/NEWS.d/next/Documentation/2020-02-27-17-35-27.bpo-17422.eS1hVh= .rst deleted file mode 100644 index bbec5ec0eee65..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-02-27-17-35-27.bpo-17422.eS1hVh.rst +++ /dev/null @@ -1,2 +0,0 @@ -The language reference no longer restricts default class namespaces to dicts -only. diff --git a/Misc/NEWS.d/next/Documentation/2020-02-28-14-39-25.bpo-13790.hvL= aRI.rst b/Misc/NEWS.d/next/Documentation/2020-02-28-14-39-25.bpo-13790.hvLaRI= .rst deleted file mode 100644 index 77db173168fc5..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-02-28-14-39-25.bpo-13790.hvLaRI.rst +++ /dev/null @@ -1 +0,0 @@ -Change 'string' to 'specification' in format doc. diff --git a/Misc/NEWS.d/next/Documentation/2020-03-05-16-29-03.bpo-39868.JQo= HhO.rst b/Misc/NEWS.d/next/Documentation/2020-03-05-16-29-03.bpo-39868.JQoHhO= .rst deleted file mode 100644 index 9fa8bfd04f7db..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-03-05-16-29-03.bpo-39868.JQoHhO.rst +++ /dev/null @@ -1 +0,0 @@ -Updated the Language Reference for :pep:`572`. diff --git a/Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ= 7Cv.rst b/Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ7Cv= .rst deleted file mode 100644 index 6698ed607ca0e..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-03-16-18-12-02.bpo-39879.CnQ7Cv.rst +++ /dev/null @@ -1,2 +0,0 @@ -Updated :ref:`datamodel` docs to include :func:`dict` insertion order preser= vation. -Patch by Furkan Onder and Samy Lahfa. diff --git a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.Vwx= Uty.rst b/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty= .rst deleted file mode 100644 index 24f640bd4ef5f..0000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-04-01-00-27-03.bpo-27635.VwxUty.rst +++ /dev/null @@ -1,2 +0,0 @@ -The pickle documentation incorrectly claimed that ``__new__`` isn't called by -default when unpickling. diff --git a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst b= /Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst deleted file mode 100644 index f4f4a2e9afd85..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2019-11-14-12-59-19.bpo-38689.Lgfxva.rst +++ /dev/null @@ -1,2 +0,0 @@ -IDLE will no longer freeze when inspect.signature fails when fetching -a calltip. diff --git a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst b= /Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst deleted file mode 100644 index de048d005cee7..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2019-12-05-14-20-53.bpo-38439.j_L2PI.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add a 256=C3=97256 pixel IDLE icon to support more modern environments. Crea= ted by Andrew Clover. -Delete the unused macOS idle.icns icon file. diff --git a/Misc/NEWS.d/next/IDLE/2020-02-27-22-17-09.bpo-39781.bbYBeL.rst b= /Misc/NEWS.d/next/IDLE/2020-02-27-22-17-09.bpo-39781.bbYBeL.rst deleted file mode 100644 index 4ae0defc2e217..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-02-27-22-17-09.bpo-39781.bbYBeL.rst +++ /dev/null @@ -1 +0,0 @@ -Selecting code context lines no longer causes a jump. diff --git a/Misc/NEWS.d/next/IDLE/2020-03-06-01-55-14.bpo-39852.QjA1qF.rst b= /Misc/NEWS.d/next/IDLE/2020-03-06-01-55-14.bpo-39852.QjA1qF.rst deleted file mode 100644 index 7d7d941418074..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-03-06-01-55-14.bpo-39852.QjA1qF.rst +++ /dev/null @@ -1,2 +0,0 @@ -Edit "Go to line" now clears any selection, preventing accidental deletion. -It also updates Ln and Col on the status bar. diff --git a/Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst b= /Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst deleted file mode 100644 index f0f434ad3c1f4..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-03-08-14-27-36.bpo-39885.29ERiR.rst +++ /dev/null @@ -1,2 +0,0 @@ -Since clicking to get an IDLE context menu moves the cursor, -any text selection should be and now is cleared. diff --git a/Misc/NEWS.d/next/IDLE/2020-03-09-02-45-12.bpo-27115.8hSHMo.rst b= /Misc/NEWS.d/next/IDLE/2020-03-09-02-45-12.bpo-27115.8hSHMo.rst deleted file mode 100644 index 76af19e6014b4..0000000000000 --- a/Misc/NEWS.d/next/IDLE/2020-03-09-02-45-12.bpo-27115.8hSHMo.rst +++ /dev/null @@ -1,2 +0,0 @@ -For 'Go to Line', use a Query box subclass with IDLE standard behavior -and improved error checking. diff --git a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rs= t b/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst deleted file mode 100644 index 92e55db2b0986..0000000000000 --- a/Misc/NEWS.d/next/Library/2017-10-14-21-02-40.bpo-31758.563ZZb.rst +++ /dev/null @@ -1,2 +0,0 @@ -Prevent crashes when using an uninitialized ``_elementtree.XMLParser`` -object. Patch by Oren Milman. diff --git a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rs= t b/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst deleted file mode 100644 index e7b9dd648b407..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-06-18-19-38-27.bpo-36541.XI8mi1.rst +++ /dev/null @@ -1,2 +0,0 @@ -lib2to3 now recognizes named assignment expressions (the walrus operator, -``:=3D``) diff --git a/Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rs= t b/Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rst deleted file mode 100644 index fcfd7936e63ac..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-10-09-08-14-25.bpo-38410._YyoMV.rst +++ /dev/null @@ -1,2 +0,0 @@ -Properly handle :func:`sys.audit` failures in -:func:`sys.set_asyncgen_hooks`. Based on patch by Zackery Spytz. diff --git a/Misc/NEWS.d/next/Library/2019-12-20-16-06-28.bpo-38971.fKRYlF.rs= t b/Misc/NEWS.d/next/Library/2019-12-20-16-06-28.bpo-38971.fKRYlF.rst deleted file mode 100644 index 9676d72b44abc..0000000000000 --- a/Misc/NEWS.d/next/Library/2019-12-20-16-06-28.bpo-38971.fKRYlF.rst +++ /dev/null @@ -1,3 +0,0 @@ -Open issue in the BPO indicated a desire to make the implementation of -codecs.open() at parity with io.open(), which implements a try/except to -assure file stream gets closed before an exception is raised. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rs= t b/Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rst deleted file mode 100644 index 4cf32487b1f7a..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix handling of header in :class:`urllib.request.AbstractDigestAuthHandler` = when the optional ``qop`` parameter -is not present. diff --git a/Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rs= t b/Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst deleted file mode 100644 index ccc33e289846a..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-17-22-38-15.bpo-39667.QuzEHH.rst +++ /dev/null @@ -1 +0,0 @@ -Correct performance degradation in ``zipfile.Path`` as found in zipp 3.0. Wh= ile retaining compatibility, this change discourages the use of ``zipfile.Pat= h.open`` due to the signature change in Python 3.9. For compatibility across = Python 3.8 and later versions, consider using ``zipp.Path`` on Python 3.8.x a= nd earlier. diff --git a/Misc/NEWS.d/next/Library/2020-02-24-03-45-28.bpo-30566.qROxty.rs= t b/Misc/NEWS.d/next/Library/2020-02-24-03-45-28.bpo-30566.qROxty.rst deleted file mode 100644 index c780633030090..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-24-03-45-28.bpo-30566.qROxty.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix :exc:`IndexError` when trying to decode an invalid string with punycode -codec. diff --git a/Misc/NEWS.d/next/Library/2020-02-27-18-21-07.bpo-39764.wqPk68.rs= t b/Misc/NEWS.d/next/Library/2020-02-27-18-21-07.bpo-39764.wqPk68.rst deleted file mode 100644 index d61db2ea221f2..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-27-18-21-07.bpo-39764.wqPk68.rst +++ /dev/null @@ -1 +0,0 @@ -Fix AttributeError when calling get_stack on a PyAsyncGenObject Task \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-02-29-11-20-50.bpo-39517.voQZb8.rs= t b/Misc/NEWS.d/next/Library/2020-02-29-11-20-50.bpo-39517.voQZb8.rst deleted file mode 100644 index 0cd628f43a8e4..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-29-11-20-50.bpo-39517.voQZb8.rst +++ /dev/null @@ -1 +0,0 @@ -Fix runpy.run_path() when using pathlike objects \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-02-29-13-20-33.bpo-39769.hJmxu4.rs= t b/Misc/NEWS.d/next/Library/2020-02-29-13-20-33.bpo-39769.hJmxu4.rst deleted file mode 100644 index 9b564bd10d3b3..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-29-13-20-33.bpo-39769.hJmxu4.rst +++ /dev/null @@ -1,4 +0,0 @@ -The :func:`compileall.compile_dir` function's *ddir* parameter and the -compileall command line flag `-d` no longer write the wrong pathname to the -generated pyc file for submodules beneath the root of the directory tree -being compiled. This fixes a regression introduced with Python 3.5. diff --git a/Misc/NEWS.d/next/Library/2020-02-29-19-17-39.bpo-39794.7VjatS.rs= t b/Misc/NEWS.d/next/Library/2020-02-29-19-17-39.bpo-39794.7VjatS.rst deleted file mode 100644 index b2a4726068af9..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-02-29-19-17-39.bpo-39794.7VjatS.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add --without-decimal-contextvar build option. This enables a thread-local -rather than a coroutine local context. diff --git a/Misc/NEWS.d/next/Library/2020-03-04-16-10-59.bpo-13487.gqe4Fb.rs= t b/Misc/NEWS.d/next/Library/2020-03-04-16-10-59.bpo-13487.gqe4Fb.rst deleted file mode 100644 index 5a1f02a7bdf37..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-04-16-10-59.bpo-13487.gqe4Fb.rst +++ /dev/null @@ -1,3 +0,0 @@ -Avoid a possible *"RuntimeError: dictionary changed size during iteration"* -from :func:`inspect.getmodule` when it tried to loop through -:attr:`sys.modules`. diff --git a/Misc/NEWS.d/next/Library/2020-03-05-00-57-49.bpo-39828.yWq9NJ.rs= t b/Misc/NEWS.d/next/Library/2020-03-05-00-57-49.bpo-39828.yWq9NJ.rst deleted file mode 100644 index 04c61b94c45d6..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-05-00-57-49.bpo-39828.yWq9NJ.rst +++ /dev/null @@ -1 +0,0 @@ -Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by Dong-hee Na. diff --git a/Misc/NEWS.d/next/Library/2020-03-09-01-45-06.bpo-39850.eaJNIE.rs= t b/Misc/NEWS.d/next/Library/2020-03-09-01-45-06.bpo-39850.eaJNIE.rst deleted file mode 100644 index 57f98f5f0d6fb..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-09-01-45-06.bpo-39850.eaJNIE.rst +++ /dev/null @@ -1,2 +0,0 @@ -:mod:`multiprocessing` now supports abstract socket addresses (if abstract s= ockets -are supported in the running platform). Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2020-03-09-18-56-27.bpo-39916.BHHyp3.rs= t b/Misc/NEWS.d/next/Library/2020-03-09-18-56-27.bpo-39916.BHHyp3.rst deleted file mode 100644 index 5f490627b21e3..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-09-18-56-27.bpo-39916.BHHyp3.rst +++ /dev/null @@ -1,2 +0,0 @@ -More reliable use of ``os.scandir()`` in ``Path.glob()``. It no longer emits -a ResourceWarning when interrupted. diff --git a/Misc/NEWS.d/next/Library/2020-03-10-15-32-31.bpo-38662.o1DMXj.rs= t b/Misc/NEWS.d/next/Library/2020-03-10-15-32-31.bpo-38662.o1DMXj.rst deleted file mode 100644 index 241b2a6272ad6..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-10-15-32-31.bpo-38662.o1DMXj.rst +++ /dev/null @@ -1,4 +0,0 @@ -The ``ensurepip`` module now invokes ``pip`` via the ``runpy`` module. -Hence it is no longer tightly coupled with the internal API of the bundled -``pip`` version, allowing easier updates to a newer ``pip`` version both -internally and for distributors. diff --git a/Misc/NEWS.d/next/Library/2020-03-10-19-38-47.bpo-39915.CjPeiY.rs= t b/Misc/NEWS.d/next/Library/2020-03-10-19-38-47.bpo-39915.CjPeiY.rst deleted file mode 100644 index 2c369474c2df8..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-10-19-38-47.bpo-39915.CjPeiY.rst +++ /dev/null @@ -1,4 +0,0 @@ -Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call objects in -the order of awaited arguments instead of using -:attr:`unittest.mock.Mock.call_args` which has the last value of the call. -Patch by Karthikeyan Singaravelan. diff --git a/Misc/NEWS.d/next/Library/2020-03-11-23-08-25.bpo-39652.gbasrk.rs= t b/Misc/NEWS.d/next/Library/2020-03-11-23-08-25.bpo-39652.gbasrk.rst deleted file mode 100644 index 9b75ae9df6cec..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-11-23-08-25.bpo-39652.gbasrk.rst +++ /dev/null @@ -1,2 +0,0 @@ -The column name found in ``sqlite3.Cursor.description`` is now truncated on -the first '[' only if the PARSE_COLNAMES option is set. diff --git a/Misc/NEWS.d/next/Library/2020-03-15-05-41-05.bpo-39360.cmcU5p.rs= t b/Misc/NEWS.d/next/Library/2020-03-15-05-41-05.bpo-39360.cmcU5p.rst deleted file mode 100644 index 148878886e6ee..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-15-05-41-05.bpo-39360.cmcU5p.rst +++ /dev/null @@ -1,4 +0,0 @@ -Ensure all workers exit when finalizing a :class:`multiprocessing.Pool` impl= icitly via the module finalization -handlers of multiprocessing. This fixes a deadlock situation that can be exp= erienced when the Pool is not -properly finalized via the context manager or a call to ``multiprocessing.Po= ol.terminate``. Patch by Batuhan Taskaya -and Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rs= t b/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst deleted file mode 100644 index 3fea7c87ea885..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-19-16-33-03.bpo-39953.yy5lC_.rst +++ /dev/null @@ -1 +0,0 @@ -Update internal table of OpenSSL error codes in the ``ssl`` module. diff --git a/Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rs= t b/Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst deleted file mode 100644 index 0c6449de52799..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-19-19-40-27.bpo-40016.JWtxqJ.rst +++ /dev/null @@ -1 +0,0 @@ -In re docstring, clarify the relationship between inline and argument compil= e flags. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rs= t b/Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst deleted file mode 100644 index e9b36c211324b..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-23-17-52-00.bpo-40014.Ya70VG.rst +++ /dev/null @@ -1,4 +0,0 @@ -Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails because the -group list is too small, retry with a larger group list. On failure, the gli= bc -implementation of ``getgrouplist()`` sets ``ngroups`` to the total number of -groups. For other implementations, double the group list size. diff --git a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rs= t b/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst deleted file mode 100644 index be80ce79d91ed..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-25-16-02-16.bpo-39503.YmMbYn.rst +++ /dev/null @@ -1,3 +0,0 @@ -:class:`~urllib.request.AbstractBasicAuthHandler` of :mod:`urllib.request` -now parses all WWW-Authenticate HTTP headers and accepts multiple challenges -per header: use the realm of the first Basic challenge. diff --git a/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rs= t b/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst deleted file mode 100644 index f5335a33c066c..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-03-27-17-22-34.bpo-40089.-lFsD0.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix threading._after_fork(): if fork was not called by a thread spawned by -threading.Thread, threading._after_fork() now creates a _MainThread instance -for _main_thread, instead of a _DummyThread instance. diff --git a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rs= t b/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst deleted file mode 100644 index 8f725cfba86e2..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed reverting multiple patches in unittest.mock. Patcher's ``__exit__()`` -is now never called if its ``__enter__()`` is failed. Returning true from -``__exit__()`` silences now the exception. diff --git a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rs= t b/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst deleted file mode 100644 index c5fbd6e5ff3fb..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-06-11-05-13.bpo-40196.Jqowse.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bug in the :mod:`symtable` module that was causing incorrectly report -global variables as local. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rs= t b/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst deleted file mode 100644 index decc073bf4d61..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-12-21-18-56.bpo-40260.F6VWaE.rst +++ /dev/null @@ -1 +0,0 @@ -Ensure :mod:`modulefinder` uses :func:`io.open_code` and respects coding com= ments. diff --git a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rs= t b/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst deleted file mode 100644 index d4db192b71076..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-15-17-21-48.bpo-40287.-mkEJH.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed ``SpooledTemporaryFile.seek()`` to return the position. diff --git a/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rs= t b/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst deleted file mode 100644 index 98cb62f1b115e..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-19-17-31-29.bpo-40330.DGjoIS.rst +++ /dev/null @@ -1,2 +0,0 @@ -In :meth:`ShareableList.__setitem__`, check the size of a new string item -after encoding it to utf-8, not before. diff --git a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rs= t b/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst deleted file mode 100644 index 3b83037d170f6..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-20-20-16-02.bpo-39942.NvGnTc.rst +++ /dev/null @@ -1,2 +0,0 @@ -Set "__main__" as the default module name when "__name__" is missing in -:class:`typing.TypeVar`. Patch by Weipeng Hong. diff --git a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rs= t b/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst deleted file mode 100644 index ad5faf3865751..0000000000000 --- a/Misc/NEWS.d/next/Library/2020-04-22-00-05-10.bpo-40138.i_oGqa.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix the Windows implementation of :func:`os.waitpid` for exit code larger th= an -``INT_MAX >> 8``. The exit status is now interpreted as an unsigned number. diff --git a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.r= st b/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst deleted file mode 100644 index 9f2800581ca5e..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-01-30-16-15-29.bpo-39503.B299Yq.rst +++ /dev/null @@ -1,5 +0,0 @@ -CVE-2020-8492: The :class:`~urllib.request.AbstractBasicAuthHandler` class o= f the -:mod:`urllib.request` module uses an inefficient regular expression which can -be exploited by an attacker to cause a denial of service. Fix the regex to -prevent the catastrophic backtracking. Vulnerability reported by Ben Caller -and Matt Schwager. diff --git a/Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.r= st b/Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst deleted file mode 100644 index 34b8af28988fa..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-03-14-14-57-44.bpo-38576.OowwQn.rst +++ /dev/null @@ -1 +0,0 @@ -Disallow control characters in hostnames in http.client, addressing CVE-2019= -18348. Such potentially malicious header injection URLs now cause a InvalidU= RL to be raised. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.r= st b/Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.rst deleted file mode 100644 index 5aac6cd8b9959..0000000000000 --- a/Misc/NEWS.d/next/Security/2020-03-30-23-16-25.bpo-40121.p2LIio.rst +++ /dev/null @@ -1 +0,0 @@ -Fixes audit events raised on creating a new socket. diff --git a/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst = b/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst deleted file mode 100644 index 1df523e90c388..0000000000000 --- a/Misc/NEWS.d/next/Tests/2019-10-17-00-49-38.bpo-38502.vUEic7.rst +++ /dev/null @@ -1,3 +0,0 @@ -test.regrtest now uses process groups in the multiprocessing mode (-jN comma= nd -line option) if process groups are available: if :func:`os.setsid` and -:func:`os.killpg` functions are available. diff --git a/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst = b/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst deleted file mode 100644 index 75e186ef33e07..0000000000000 --- a/Misc/NEWS.d/next/Tests/2019-10-30-00-01-43.bpo-37957.X1r78F.rst +++ /dev/null @@ -1,3 +0,0 @@ -test.regrtest now can receive a list of test patterns to ignore (using the --i/--ignore argument) or a file with a list of patterns to ignore (using the ---ignore-file argument). Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst b= /Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst deleted file mode 100644 index 7ffe90d55a4e7..0000000000000 --- a/Misc/NEWS.d/next/Tests/2019-11-25-21-46-47.bpo-1812.sAbTbY.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix newline handling in doctest.testfile when loading from a package whose -loader has a get_data method. Patch by Peter Donis. diff --git a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst = b/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst deleted file mode 100644 index 6fa0d15ba2fdc..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-02-29-12-58-17.bpo-39793.Og2SUN.rst +++ /dev/null @@ -1 +0,0 @@ -Use the same domain when testing ``make_msgid``. Patch by Batuhan Taskaya. diff --git a/Misc/NEWS.d/next/Tests/2020-03-18-16-04-33.bpo-27807.9gKjET.rst = b/Misc/NEWS.d/next/Tests/2020-03-18-16-04-33.bpo-27807.9gKjET.rst deleted file mode 100644 index 3749a747c84b3..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-03-18-16-04-33.bpo-27807.9gKjET.rst +++ /dev/null @@ -1,2 +0,0 @@ -``test_site.test_startup_imports()`` is now skipped if a path of -:data:`sys.path` contains a ``.pth`` file. diff --git a/Misc/NEWS.d/next/Tests/2020-03-20-00-30-36.bpo-40019.zOqHpQ.rst = b/Misc/NEWS.d/next/Tests/2020-03-20-00-30-36.bpo-40019.zOqHpQ.rst deleted file mode 100644 index a9d0b3970ae53..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-03-20-00-30-36.bpo-40019.zOqHpQ.rst +++ /dev/null @@ -1,2 +0,0 @@ -test_gdb now skips tests if it detects that gdb failed to read debug -information because the Python binary is optimized. diff --git a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst = b/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst deleted file mode 100644 index 216925f40e106..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-04-02-02-14-37.bpo-40146.J-Yo9G.rst +++ /dev/null @@ -1 +0,0 @@ -Update OpenSSL to 1.1.1f in Azure Pipelines. diff --git a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst = b/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst deleted file mode 100644 index 8d5d0e0871d42..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-04-03-02-40-16.bpo-40162.v3pQW_.rst +++ /dev/null @@ -1 +0,0 @@ -Update Travis CI configuration to OpenSSL 1.1.1f. diff --git a/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst = b/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst deleted file mode 100644 index 0aee2c3aa2b4d..0000000000000 --- a/Misc/NEWS.d/next/Tests/2020-04-29-16-08-24.bpo-40436.gDMnYl.rst +++ /dev/null @@ -1 +0,0 @@ -test_gdb and test.pythoninfo now check gdb command exit code. diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-03-07-18-01-30.bpo-39889.l1czT= 6.rst b/Misc/NEWS.d/next/Tools-Demos/2020-03-07-18-01-30.bpo-39889.l1czT6.rst deleted file mode 100644 index 1202cb5fa064b..0000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2020-03-07-18-01-30.bpo-39889.l1czT6.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fixed ``unparse.py`` for extended slices containing a single element (e.g. -``a[i:j,]``). Remove redundant tuples when index with a tuple (e.g. ``a[i, -j]``). diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0= D.rst b/Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst deleted file mode 100644 index 2c845e7df7935..0000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2020-03-09-13-28-13.bpo-36184.BMPJ0D.rst +++ /dev/null @@ -1,4 +0,0 @@ -Port python-gdb.py to FreeBSD. python-gdb.py now checks for "take_gil" -function name to check if a frame tries to acquire the GIL, instead of -checking for "pthread_cond_timedwait" which is specific to Linux and can be -a different condition than the GIL. diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH1= 0.rst b/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst deleted file mode 100644 index 61bd2e3d94aab..0000000000000 --- a/Misc/NEWS.d/next/Tools-Demos/2020-04-04-19-35-22.bpo-40179.u9FH10.rst +++ /dev/null @@ -1 +0,0 @@ -Fixed translation of ``#elif`` in Argument Clinic. diff --git a/Misc/NEWS.d/next/Windows/2020-02-25-18-43-34.bpo-34803.S3VcS0.rs= t b/Misc/NEWS.d/next/Windows/2020-02-25-18-43-34.bpo-34803.S3VcS0.rst deleted file mode 100644 index 144ffd50af0e9..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-02-25-18-43-34.bpo-34803.S3VcS0.rst +++ /dev/null @@ -1,2 +0,0 @@ -Package for nuget.org now includes repository reference and bundled icon -image. diff --git a/Misc/NEWS.d/next/Windows/2020-02-28-22-46-09.bpo-39789.67XRoP.rs= t b/Misc/NEWS.d/next/Windows/2020-02-28-22-46-09.bpo-39789.67XRoP.rst deleted file mode 100644 index 077b0afcba3c1..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-02-28-22-46-09.bpo-39789.67XRoP.rst +++ /dev/null @@ -1 +0,0 @@ -Update Windows release build machines to Visual Studio 2019 (MSVC 14.2). diff --git a/Misc/NEWS.d/next/Windows/2020-02-28-23-51-27.bpo-38380.TpOBCj.rs= t b/Misc/NEWS.d/next/Windows/2020-02-28-23-51-27.bpo-38380.TpOBCj.rst deleted file mode 100644 index 521075d628f42..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-02-28-23-51-27.bpo-38380.TpOBCj.rst +++ /dev/null @@ -1 +0,0 @@ -Update Windows builds to use SQLite 3.31.1 diff --git a/Misc/NEWS.d/next/Windows/2020-03-01-15-04-54.bpo-38597.MnHdYl.rs= t b/Misc/NEWS.d/next/Windows/2020-03-01-15-04-54.bpo-38597.MnHdYl.rst deleted file mode 100644 index 7f3a2e756c5a1..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-03-01-15-04-54.bpo-38597.MnHdYl.rst +++ /dev/null @@ -1,4 +0,0 @@ -:mod:`distutils` will no longer statically link :file:`vcruntime140.dll` -when a redistributable version is unavailable. All future releases of -CPython will include a copy of this DLL to ensure distributed extensions can -continue to load. diff --git a/Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rs= t b/Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst deleted file mode 100644 index acfbce53eb399..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-03-04-17-05-11.bpo-39847.C3N2m3.rst +++ /dev/null @@ -1,2 +0,0 @@ -Avoid hang when computer is hibernated whilst waiting for a mutex (for -lock-related objects from :mod:`threading`) around 49-day uptime. diff --git a/Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rs= t b/Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst deleted file mode 100644 index c3011897b6dc8..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-03-11-10-15-56.bpo-39930.LGHw1j.rst +++ /dev/null @@ -1,2 +0,0 @@ -Ensures the required :file:`vcruntime140.dll` is included in install -packages. diff --git a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rs= t b/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst deleted file mode 100644 index 0bb874b138b33..0000000000000 --- a/Misc/NEWS.d/next/Windows/2020-04-04-13-13-44.bpo-40164.SPrSn5.rst +++ /dev/null @@ -1 +0,0 @@ -Updates Windows to OpenSSL 1.1.1f diff --git a/Misc/NEWS.d/next/macOS/2020-02-28-23-51-47.bpo-38380.u-ySyA.rst = b/Misc/NEWS.d/next/macOS/2020-02-28-23-51-47.bpo-38380.u-ySyA.rst deleted file mode 100644 index 908281b5d172f..0000000000000 --- a/Misc/NEWS.d/next/macOS/2020-02-28-23-51-47.bpo-38380.u-ySyA.rst +++ /dev/null @@ -1 +0,0 @@ -Update macOS builds to use SQLite 3.31.1 diff --git a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst = b/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst deleted file mode 100644 index 05c568190e7d8..0000000000000 --- a/Misc/NEWS.d/next/macOS/2020-04-21-19-46-35.bpo-40164.6HA6IC.rst +++ /dev/null @@ -1 +0,0 @@ -Update macOS installer builds to use OpenSSL 1.1.1g. diff --git a/README.rst b/README.rst index cf74d1d8ee6b3..8bf81f0066f0f 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -This is Python version 3.8.2 -=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.3rc1 +=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 =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 Wed Apr 29 18:44:21 2020 From: webhook-mailer at python.org (=?utf-8?q?=C5=81ukasz?= Langa) Date: Wed, 29 Apr 2020 22:44:21 -0000 Subject: [Python-checkins] (no subject) Message-ID: To: python-checkins at python.org Subject: Post 3.8.3rc1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://github.com/python/cpython/commit/e07fb669e9ed6cf75e241209f0547c2c2f7d= 7ef7 commit: e07fb669e9ed6cf75e241209f0547c2c2f7d7ef7 branch: 3.8 author: =C5=81ukasz Langa committer: =C5=81ukasz Langa date: 2020-04-30T00:43:53+02:00 summary: Post 3.8.3rc1 files: M Include/patchlevel.h diff --git a/Include/patchlevel.h b/Include/patchlevel.h index bc825c0a188b8..f3c412bf8dd8e 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 1 =20 /* Version as a string */ -#define PY_VERSION "3.8.3rc1" +#define PY_VERSION "3.8.3rc1+" /*--end constants--*/ =20 /* Version as a single 4-byte hex number, e.g. 0x010502B2 =3D=3D 1.5.2b2.